Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update examples 11047934471 #15

Closed
wants to merge 22 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
2ac73de
test(AboutModal): AVT test (#6063)
makafsal Sep 20, 2024
ba29c09
feat(tagset): support for size on overflow tag (#6065)
devadula-nandan Sep 20, 2024
03eadd2
fix(CreateFullPage): breadcrumb tooltip visibility issue (#6064)
anamikaanu96 Sep 20, 2024
c4ae43d
chore(release): v2.50.0-rc.1 (#6087)
github-actions[bot] Sep 20, 2024
fa31ebb
chore: updated doc links (#6078)
anamikaanu96 Sep 23, 2024
2b32f0f
fix(DataGrid): disable save button on customise column (#6026)
amal-k-joy Sep 23, 2024
f076047
fix(CreateFullPage): breadcrumbs should be array (#6058)
wkeese Sep 23, 2024
dd7564d
fix(ExportModal): screen reader indentifies hidden controls (#6079)
sangeethababu9223 Sep 24, 2024
ef4bfa8
fix(Export Modal): Focus moves to parent page (#6077)
sangeethababu9223 Sep 24, 2024
c7064de
fix(Datagrid): select all row count updated to exclude disabled rows …
sangeethababu9223 Sep 24, 2024
ec3dead
fix(ExportModal): update status message (#6080)
anamikaanu96 Sep 24, 2024
0b40cce
fix: remove ellipsis from EditInPlace (#6098)
davidmenendez Sep 24, 2024
7d17364
fix: add primaryButtonDisabled prop to ProductiveCard (#6100)
davidmenendez Sep 24, 2024
189f452
fix(datagrid): hidden columns included in search results (#5989)
sangeethababu9223 Sep 24, 2024
fd14678
chore(deps-dev): bump vite from 5.2.10 to 5.2.14 (#6071)
dependabot[bot] Sep 24, 2024
6dd626a
fix(NotificationPanel): focus return to trigger on closing notificati…
sangeethababu9223 Sep 24, 2024
15ec2a5
fix(datagrid): tooltip missing in Customize Columns modal (#6036)
sangeethababu9223 Sep 25, 2024
5b58d50
fix(Datagrid): remove redundant aria disabled (#6103)
sangeethababu9223 Sep 25, 2024
7bdf8be
test: gallery action
makafsal Sep 26, 2024
1f5cbfb
test: gallery action
makafsal Sep 26, 2024
5aae93d
test: gallery action
makafsal Sep 26, 2024
34a7456
chore: update examples gallery
makafsal Sep 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
21 changes: 18 additions & 3 deletions .github/workflows/update-example-gallery.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: Update example gallery # Updates examples twice a month

env:
BRANCH_NAME: update-examples-${{ github.run_id }}

on:
workflow_dispatch:
schedule:
Expand Down Expand Up @@ -42,17 +45,29 @@ jobs:
exit 0
fi

- name: Commit the changes
if: failure() && steps.up_to_date.outcome == 'failure'
id: commit_changes
run: |
git config --global user.email ${{ secrets.CARBON_BOT_EMAIL }}
git config --global user.name ${{ secrets.CARBON_BOT_NAME }}
git checkout -b ${{ env.BRANCH_NAME }}
git add .
git commit -m "chore: update examples gallery"
git push --set-upstream origin ${{ env.BRANCH_NAME }}

- name: Create pull request
if: steps.up_to_date.outcome == 'failure'
if: failure() && steps.up_to_date.outcome == 'failure'
id: create-pr
uses: peter-evans/create-pull-request@v4
with:
token: ${{ secrets.CREATE_PR_ACCESS_TOKEN }}
commit-message: 'chore: update example gallery'
committer: GitHub <[email protected]>
author:
${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
branch: 'update-examples'
${{ secrets.CARBON_BOT_NAME }} ${{ secrets.CARBON_BOT_EMAIL }}
branch: ${{ env.BRANCH_NAME }}
# branch: 'update-examples'
branch-suffix: random
title: 'chore: update example gallery'
body: |
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Carbon for IBM Products

> Carbon for IBM Products is an open source implementation of the closed source
> [IBM Software pattern asset library (PAL)](https://pages.github.ibm.com/cdai-design/pal/).
> [IBM Software pattern asset library (PAL)](https://pages.github.ibm.com/carbon/ibm-products/).
> These PAL designs build on the foundation of IBM’s open source Carbon Design
> System and React implementation to offer components and patterns beyond the
> typical component library. Carbon for IBM Products was previously known as
Expand Down
2 changes: 1 addition & 1 deletion docs/guides/VARIANT_COMPONENT_GUIDELINES.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Variant Component Guidelines

If you are creating a component with variant or themed modes such as the
[Card](https://pages.github.ibm.com/cdai-design/pal/components/card/overview)
[Card](https://pages.github.ibm.com/carbon/ibm-products/components/card/overview)
you'll want to follow these guidelines. Please note that this pattern may not be
applicable for every scenario, so please use your best judgment.

Expand Down
67 changes: 67 additions & 0 deletions e2e/components/AboutModal/AboutModal-test.avt.e2e.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,71 @@ test.describe('AboutModal @avt', () => {

await expect(closeButton).toBeFocused();
});

test('@avt-open-close-with-focus-trap', async ({ page }) => {
await visitStory(page, {
component: 'AboutModal',
id: 'ibm-products-components-about-modal-aboutmodal--about-modal-with-all-props-set',
globals: {
carbonTheme: 'white',
},
});

const modalElement = page.locator(`.${carbon.prefix}--modal`);
const openButton = page.getByText(
'Open the About modal with all props set'
);
const closeIcon = page.getByLabel('Close');
const linkActions = page.getByText('Link action');

// Focus the open button
await page.keyboard.press('Tab');
// Expect open button to be focused
await expect(openButton).toBeFocused();
// Open modal by pressing 'Enter' key
await page.keyboard.press('Enter');

// Opening modal
await modalElement.evaluate((element) =>
Promise.all(
element.getAnimations().map((animation) => animation.finished)
)
);

await expect(page).toHaveNoACViolations(
'AboutModal @avt-open-close-with-focus-trap'
);

// Initial focus should be on close button
await expect(closeIcon).toBeFocused();
// Press tab to move focus to first link element
await page.keyboard.press('Tab');
await expect(linkActions.first()).toBeFocused();

// Press tab to move focus to second link element
await page.keyboard.press('Tab');
await expect(linkActions.nth(1)).toBeFocused();

// Press tab to move focus to last link element
await page.keyboard.press('Tab');
await expect(linkActions.last()).toBeFocused();

// Press tab to move focus back to close button
await page.keyboard.press('Tab');
await expect(closeIcon).toBeFocused();

// Press escape to twise
// first to close tooltip then close modal
await page.keyboard.press('Escape');
await page.keyboard.press('Escape');

// Opening modal
await modalElement.evaluate((element) =>
Promise.all(
element.getAnimations().map((animation) => animation.finished)
)
);

await expect(modalElement).toHaveAttribute('aria-hidden', 'true');
});
});
9 changes: 9 additions & 0 deletions examples/carbon-for-ibm-products/APIKeyModal/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!--
@license
Copyright IBM Corp. 2020, 2024
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<!DOCTYPE html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion examples/carbon-for-ibm-products/APIKeyModal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
"dependencies": {
"@carbon/ibm-products": "^2.21.0",
"@carbon/react": "^1.51.1",
"@carbon/react": "^1.60.3",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import React, { createContext, useReducer } from 'react';

export const themeData = [
{
text: 'System W/90',
value: 'carbon-theme--user-preference-white-90',
},
{
text: 'System 10/100',
value: 'carbon-theme--user-preference-10-100',
},
{
text: 'White',
value: 'carbon-theme--white',
Expand All @@ -22,17 +30,16 @@ export const themeData = [
export const ThemeContext = createContext();

const initialState = {
currentTheme: themeData[0],
currentTheme: themeData[1],
};

const themeReducer = (state, action) => {
switch (action.type.value) {
case 'carbon-theme--user-preference-white-90':
case 'carbon-theme--user-preference-10-100':
case 'carbon-theme--white':
return { currentTheme: action.type };
case 'carbon-theme--g10':
return { currentTheme: action.type };
case 'carbon-theme--g90':
return { currentTheme: action.type };
case 'carbon-theme--g100':
return { currentTheme: action.type };
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/themes';
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/config';

// Best to stick with user preference - DARK
@media (prefers-color-scheme: dark) {
:root {
@include theme(themes.$g100, true); // dark default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g100, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$g90, true);
}
}

// Best to stick with user preference - LIGHT
@media (prefers-color-scheme: light) {
:root {
@include theme(themes.$white, true); // light default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g10, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$white, true);
}
}

.carbon-theme--white {
@include theme(themes.$white, true);
}
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/APIKeyModal/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/react' with (
$font-path: '@ibm/plex'
);
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/APIKeyModal/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

Expand Down
9 changes: 9 additions & 0 deletions examples/carbon-for-ibm-products/AboutModal/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!--
@license
Copyright IBM Corp. 2020, 2024
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<!DOCTYPE html>
<html lang="en">

Expand Down
2 changes: 1 addition & 1 deletion examples/carbon-for-ibm-products/AboutModal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
},
"dependencies": {
"@carbon/ibm-products": "^2.21.0",
"@carbon/react": "^1.51.1",
"@carbon/react": "^1.60.3",
"lodash": "^4.17.21",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import React, { createContext, useReducer } from 'react';

export const themeData = [
{
text: 'System W/90',
value: 'carbon-theme--user-preference-white-90',
},
{
text: 'System 10/100',
value: 'carbon-theme--user-preference-10-100',
},
{
text: 'White',
value: 'carbon-theme--white',
Expand All @@ -22,17 +30,16 @@ export const themeData = [
export const ThemeContext = createContext();

const initialState = {
currentTheme: themeData[0],
currentTheme: themeData[1],
};

const themeReducer = (state, action) => {
switch (action.type.value) {
case 'carbon-theme--user-preference-white-90':
case 'carbon-theme--user-preference-10-100':
case 'carbon-theme--white':
return { currentTheme: action.type };
case 'carbon-theme--g10':
return { currentTheme: action.type };
case 'carbon-theme--g90':
return { currentTheme: action.type };
case 'carbon-theme--g100':
return { currentTheme: action.type };
default:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,45 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/styles/scss/theme' as *;
@use '@carbon/styles/scss/themes';
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/config';

// Best to stick with user preference - DARK
@media (prefers-color-scheme: dark) {
:root {
@include theme(themes.$g100, true); // dark default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g100, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$g90, true);
}
}

// Best to stick with user preference - LIGHT
@media (prefers-color-scheme: light) {
:root {
@include theme(themes.$white, true); // light default
}

.carbon-theme--user-preference-10-100 {
@include theme(themes.$g10, true);
}

.carbon-theme--user-preference-white-90 {
@include theme(themes.$white, true);
}
}

.carbon-theme--white {
@include theme(themes.$white, true);
}
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/AboutModal/src/index.scss
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

@use '@carbon/react' with (
$font-path: '@ibm/plex'
);
Expand Down
7 changes: 7 additions & 0 deletions examples/carbon-for-ibm-products/AboutModal/vite.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
/**
* Copyright IBM Corp. 2024
*
* This source code is licensed under the Apache-2.0 license found in the
* LICENSE file in the root directory of this source tree.
*/

import { defineConfig } from 'vite';
import react from '@vitejs/plugin-react';

Expand Down
9 changes: 9 additions & 0 deletions examples/carbon-for-ibm-products/BigNumbers/index.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
<!--
@license
Copyright IBM Corp. 2020, 2024
This source code is licensed under the Apache-2.0 license found in the
LICENSE file in the root directory of this source tree.
-->

<!DOCTYPE html>
<html lang="en">

Expand Down
Loading
Loading