Skip to content

Commit

Permalink
Merge branch 'carbon-design-system:main' into useWebTerminal
Browse files Browse the repository at this point in the history
  • Loading branch information
anamikaanu96 authored May 13, 2024
2 parents 586fdb2 + af22157 commit a9535b0
Show file tree
Hide file tree
Showing 75 changed files with 1,274 additions and 1,789 deletions.
4 changes: 4 additions & 0 deletions cspell.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"aboutmodal",
"actionbar",
"apikey",
"apikeymodal",
"autodocs",
"automerge",
"buildhome",
Expand Down Expand Up @@ -92,6 +93,7 @@
"editinplace",
"editsidepanel",
"emptystate",
"exportmodal",
"expressivecard",
"fullpageerror",
"gridcell",
Expand All @@ -106,6 +108,7 @@
"loglevel",
"namor",
"noreply",
"notificationspanel",
"overridable",
"overscroll",
"pconsole",
Expand Down Expand Up @@ -155,6 +158,7 @@
"treegrid",
"treeview",
"typeahead",
"unauthorizedemptystate",
"userprofileimage",
"uuidv",
"webfonts"
Expand Down
27 changes: 27 additions & 0 deletions e2e/components/APIKeyModal/APIKeyModal-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
/**
* Copyright IBM Corp. 2024, 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 strict';

import { expect, test } from '@playwright/test';
import { visitStory } from '../../test-utils/storybook';

test.describe('APIKeyModal @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'APIKeyModal',
id: 'ibm-products-patterns-generating-an-api-key-apikeymodal--generate',
globals: {
carbonTheme: 'white',
},
});

await page.getByRole('button', { name: 'Generate API key' }).click();

await expect(page).toHaveNoACViolations('APIKeyModal @avt-default-state');
});
});
24 changes: 24 additions & 0 deletions e2e/components/EmptyState/EmptyState-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright IBM Corp. 2024, 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 strict';

import { expect, test } from '@playwright/test';
import { visitStory } from '../../test-utils/storybook';

test.describe('EmptyState @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'EmptyState',
id: 'ibm-products-patterns-empty-state-emptystate--default',
globals: {
carbonTheme: 'white',
},
});
await expect(page).toHaveNoACViolations('EmptyState @avt-default-state');
});
});
24 changes: 24 additions & 0 deletions e2e/components/ExportModal/ExportModal-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
/**
* Copyright IBM Corp. 2024, 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 strict';

import { expect, test } from '@playwright/test';
import { visitStory } from '../../test-utils/storybook';

test.describe('ExportModal @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'ExportModal',
id: 'ibm-products-patterns-export-exportmodal--standard',
globals: {
carbonTheme: 'white',
},
});
await expect(page).toHaveNoACViolations('ExportModal @avt-default-state');
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/**
* 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 strict';

import { expect, test } from '@playwright/test';
import { visitStory } from '../../test-utils/storybook';

test.describe('NotificationsPanel @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'NotificationsPanel',
id: 'ibm-products-patterns-notifications-notificationspanel--default',
globals: {
carbonTheme: 'white',
},
});

await page.getByLabel('Notifications').click();
await expect(page).toHaveNoACViolations(
'NotificationsPanel @avt-default-state'
);
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Copyright IBM Corp. 2024, 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 strict';

import { expect, test } from '@playwright/test';
import { visitStory } from '../../test-utils/storybook';

test.describe('UnauthorizedEmptyState @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'UnauthorizedEmptyState',
id: 'ibm-products-patterns-empty-state-unauthorizedemptystate--default',
globals: {
carbonTheme: 'white',
},
});
await expect(page).toHaveNoACViolations(
'UnauthorizedEmptyState @avt-default-state'
);
});
});
26 changes: 26 additions & 0 deletions e2e/components/UserProfileImage/UserProfileImage-test.avt.e2e.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
/**
* Copyright IBM Corp. 2024, 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 strict';

import { expect, test } from '@playwright/test';
import { visitStory } from '../../test-utils/storybook';

test.describe('UserProfileImage @avt', () => {
test('@avt-default-state', async ({ page }) => {
await visitStory(page, {
component: 'UserProfileImage',
id: 'ibm-products-patterns-user-profile-images-userprofileimage--default',
globals: {
carbonTheme: 'white',
},
});
await expect(page).toHaveNoACViolations(
'UserProfileImage @avt-default-state'
);
});
});
41 changes: 25 additions & 16 deletions packages/core/.storybook/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
* LICENSE file in the root directory of this source tree.
*/

const glob = require('fast-glob');
const path = require('path');
import glob from 'fast-glob';
import { dirname, join, resolve } from 'path';
import remarkGfm from 'remark-gfm';

const storyGlobs = [
'../../ibm-products/src/**/*.stories.*',
'../../ibm-products-community/src/**/*.stories.*',
'../src/**/*.stories.*',
'../src/**/*.mdx',
'../../../examples/carbon-for-ibm-products/example-gallery/src/example-gallery.stories.js',
];

Expand All @@ -24,15 +25,15 @@ const stories = glob.sync(storyGlobs, {
cwd: __dirname,
});

module.exports = {
export default {
staticDirs: ['../public'],

addons: [
'@storybook/addon-actions',
'@storybook/addon-controls',
'@storybook/addon-links',
'@storybook/addon-storysource',
'@storybook/addon-viewport',
'@storybook/addon-mdx-gfm',
getAbsolutePath('@storybook/addon-actions'),
getAbsolutePath('@storybook/addon-controls'),
getAbsolutePath('@storybook/addon-links'),
getAbsolutePath('@storybook/addon-storysource'),
getAbsolutePath('@storybook/addon-viewport'),
{
name: '@storybook/addon-docs',
options: {
Expand All @@ -55,17 +56,17 @@ module.exports = {
},
},
],
core: {
builder: '@storybook/builder-vite',
},
framework: '@storybook/react-vite',
features: {
storyStoreV7: true,

framework: {
name: getAbsolutePath('@storybook/react-vite'),
},

stories,

typescript: {
reactDocgen: 'react-docgen', // Favor docgen from prop-types instead of TS interfaces
},

async viteFinal(config, { configType }) {
// Merge custom configuration into the default config
const { mergeConfig } = await import('vite');
Expand All @@ -85,7 +86,7 @@ module.exports = {
},
resolve: {
alias: {
ALIAS_STORY_STYLE_CONFIG: path.resolve(
ALIAS_STORY_STYLE_CONFIG: resolve(
configType === 'DEVELOPMENT'
? '../ibm-products-styles/src/config-dev.scss'
: '../ibm-products-styles/src/config.scss'
Expand All @@ -94,4 +95,12 @@ module.exports = {
},
});
},

docs: {
autodocs: 'tag',
},
};

function getAbsolutePath(value) {
return dirname(require.resolve(join(value, 'package.json')));
}
2 changes: 1 addition & 1 deletion packages/core/.storybook/manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
* LICENSE file in the root directory of this source tree.
*/

import { addons } from '@storybook/addons';
import { addons } from '@storybook/manager-api';
import { create } from '@storybook/theming/create';

import React from 'react';
Expand Down
35 changes: 16 additions & 19 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,24 +35,21 @@
"@carbon/react": "^1.55.0",
"@carbon/themes": "^11.34.0",
"@carbon/type": "^11.26.0",
"@storybook/addon-actions": "^7.6.10",
"@storybook/addon-controls": "^7.6.10",
"@storybook/addon-docs": "^7.6.10",
"@storybook/addon-essentials": "^7.6.10",
"@storybook/addon-links": "^7.6.10",
"@storybook/addon-mdx-gfm": "7.6.10",
"@storybook/addon-storysource": "^7.6.10",
"@storybook/addon-viewport": "^7.6.10",
"@storybook/addons": "^7.6.10",
"@storybook/api": "^7.6.10",
"@storybook/builder-vite": "^7",
"@storybook/components": "^7.6.10",
"@storybook/core-events": "^7.6.10",
"@storybook/csf": "^0.1.2",
"@storybook/react": "^7.6.10",
"@storybook/react-vite": "^7",
"@storybook/source-loader": "^7.6.10",
"@storybook/theming": "^7.6.10",
"@storybook/addon-actions": "^8.0.9",
"@storybook/addon-controls": "^8.0.9",
"@storybook/addon-docs": "^8.0.9",
"@storybook/addon-essentials": "^8.0.9",
"@storybook/addon-links": "^8.0.9",
"@storybook/addon-storysource": "^8.0.9",
"@storybook/addon-viewport": "^8.0.9",
"@storybook/components": "^8.0.9",
"@storybook/core-events": "^8.0.9",
"@storybook/csf": "^0.1.5",
"@storybook/manager-api": "^8.0.9",
"@storybook/react": "^8.0.9",
"@storybook/react-vite": "^8.0.9",
"@storybook/source-loader": "^8.0.9",
"@storybook/theming": "^8.0.9",
"fast-glob": "^3.2.7",
"npm-check-updates": "^16.14.12",
"npm-run-all": "^4.1.5",
Expand All @@ -63,7 +60,7 @@
"remark-gfm": "^4.0.0",
"rimraf": "^5.0.5",
"sass": "^1.70.0",
"storybook": "^7.6.10",
"storybook": "^8.0.9",
"typescript": "^5.3.3",
"vite": "^5.2.10"
},
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/welcome/Welcome.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Link, Tag } from '@carbon/react';
import { ArrowRight, Pause, Play } from '@carbon/react/icons';
import lottie from 'lottie-web';
import WelcomeLottie from './welcome-lottie.json';
import './_storybook-styles.scss';

const Welcome = () => {
const animationRef = useRef(null);
Expand Down
13 changes: 12 additions & 1 deletion packages/core/src/welcome/_storybook-styles.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,25 @@
//

@use 'ALIAS_STORY_STYLE_CONFIG' as c4p-settings;
@use '@carbon/react' with (
$font-path: '@ibm/plex'
);
@use '@carbon/styles/scss/type';
@use '@carbon/styles/scss/colors';
@use '@carbon/styles/scss/spacing' as *;
@use '@carbon/styles/scss/type';

body {
@include type.reset();
}

.welcome__container--outer {
position: fixed;
top: 0;
left: 0;
overflow: hidden;
width: 100%;
height: 100vh;
padding: $spacing-09;
/* stylelint-disable-next-line carbon/theme-token-use */
background-color: colors.$purple-10;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Story, ArgsTable, Source, Canvas } from '@storybook/addon-docs';
import { Story, Controls, Source, Canvas } from '@storybook/addon-docs';
import { CodesandboxLink } from '../../global/js/utils/story-helper';
import { DISPLAY_NAME } from '.';
import * as stories from './DISPLAY_NAME.stories';
Expand Down Expand Up @@ -29,4 +29,4 @@ import * as stories from './DISPLAY_NAME.stories';

## Component API

<ArgsTable />
<Controls />
Loading

0 comments on commit a9535b0

Please sign in to comment.