@adobe-commerce/elsie 2.0.0 → 2.0.1-alpha-20260728135101
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.elsie.js +3 -3
- package/CHANGELOG.md +385 -112
- package/LICENSE.md +257 -157
- package/README.md +4 -2
- package/__mocks__/svg.js +3 -3
- package/bin/builders/build/index.js +2 -1
- package/bin/builders/changeset/index.js +1 -1
- package/bin/builders/concurrently/index.js +1 -1
- package/bin/builders/generate/api/index.js +7 -7
- package/bin/builders/generate/component/index.js +8 -8
- package/bin/builders/generate/config/index.js +5 -5
- package/bin/builders/generate/config/templates/elsie.js +1 -1
- package/bin/builders/generate/container/index.js +7 -7
- package/bin/builders/generate/index.js +36 -36
- package/bin/builders/gql/index.js +28 -28
- package/bin/builders/gql/validate.js +116 -105
- package/bin/builders/lint/index.js +1 -1
- package/bin/builders/serve/index.js +1 -1
- package/bin/builders/storybook/index.js +9 -1
- package/bin/builders/types/index.js +1 -2
- package/bin/builders/types/validate-tsconfig.js +5 -5
- package/bin/index.js +12 -6
- package/bin/lib/cli.js +9 -8
- package/bin/lib/resolve-bin.js +9 -0
- package/bin/lib/validate-typeof.js +3 -3
- package/bin/lib/write-file.js +3 -3
- package/bin/lib/write-parent-index.js +4 -4
- package/config/eslint.mjs +2 -1
- package/config/jest.mjs +7 -2
- package/config/plugins/dts-normalize-relative-replacer.cjs +1 -1
- package/config/plugins/dts.mjs +4 -3
- package/config/prettier.json +25 -3
- package/config/setEnvVars.mjs +2 -2
- package/config/storybook/addon.js +5 -5
- package/config/storybook/components/FileTree/FileTree.jsx +4 -4
- package/config/storybook/components/FileTree/index.js +4 -4
- package/config/storybook/components/Flex/Flex.jsx +3 -3
- package/config/storybook/components/Flex/index.js +3 -3
- package/config/storybook/components/OptionsTable/OptionsTable.jsx +3 -3
- package/config/storybook/components/OptionsTable/index.js +4 -4
- package/config/storybook/components/Panel/Panel.tsx +7 -7
- package/config/storybook/components/Panel/index.ts +3 -3
- package/config/storybook/components/Screenshot/Screenshot.jsx +3 -3
- package/config/storybook/components/Screenshot/index.js +4 -4
- package/config/storybook/components/Steps/Steps.jsx +3 -3
- package/config/storybook/components/Steps/index.js +4 -4
- package/config/storybook/components/StoryWrapper/StoryWrapper.jsx +3 -3
- package/config/storybook/components/StoryWrapper/index.js +3 -3
- package/config/storybook/components/Summary/Summary.jsx +3 -3
- package/config/storybook/components/Summary/index.js +3 -3
- package/config/storybook/components/Variants/Variants.jsx +11 -7
- package/config/storybook/components/Variants/index.js +3 -3
- package/config/storybook/manager.js +3 -3
- package/config/storybook/preview.jsx +3 -3
- package/config/storybook/theming/fonts.css +12 -4
- package/config/storybook/theming/preview.css +3 -1
- package/config/storybook/theming/theme.js +3 -3
- package/config/vite.mjs +53 -26
- package/package.json +36 -34
- package/src/components/Accordion/Accordion.css +1 -1
- package/src/components/Accordion/Accordion.stories.tsx +18 -18
- package/src/components/Accordion/Accordion.tsx +12 -8
- package/src/components/Accordion/index.ts +3 -3
- package/src/components/ActionButton/ActionButton.stories.tsx +8 -8
- package/src/components/ActionButton/ActionButton.tsx +7 -5
- package/src/components/ActionButton/index.ts +3 -3
- package/src/components/ActionButtonGroup/ActionButtonGroup.stories.tsx +3 -3
- package/src/components/ActionButtonGroup/ActionButtonGroup.tsx +2 -2
- package/src/components/ActionButtonGroup/index.ts +3 -3
- package/src/components/AlertBanner/AlertBanner.stories.tsx +6 -6
- package/src/components/AlertBanner/AlertBanner.tsx +12 -10
- package/src/components/AlertBanner/index.ts +3 -3
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +14 -14
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/src/components/Breadcrumbs/index.ts +3 -3
- package/src/components/Button/Button.mdx +24 -11
- package/src/components/Button/Button.stories.tsx +6 -6
- package/src/components/Button/Button.tsx +7 -8
- package/src/components/Button/index.ts +3 -3
- package/src/components/Card/Card.stories.tsx +6 -6
- package/src/components/Card/Card.tsx +3 -3
- package/src/components/Card/index.ts +3 -3
- package/src/components/CartItem/CartItem.stories.tsx +12 -12
- package/src/components/CartItem/CartItem.tsx +4 -2
- package/src/components/CartItem/CartItemSkeleton.tsx +3 -3
- package/src/components/CartItem/index.ts +3 -3
- package/src/components/CartList/CartList.tsx +3 -3
- package/src/components/CartList/index.ts +3 -3
- package/src/components/Checkbox/Checkbox.stories.tsx +17 -14
- package/src/components/Checkbox/Checkbox.tsx +8 -6
- package/src/components/Checkbox/index.ts +3 -3
- package/src/components/ColorSwatch/ColorSwatch.css +8 -4
- package/src/components/ColorSwatch/ColorSwatch.stories.tsx +6 -6
- package/src/components/ColorSwatch/ColorSwatch.tsx +8 -6
- package/src/components/ColorSwatch/index.ts +3 -3
- package/src/components/ContentGrid/ContentGrid.css +15 -15
- package/src/components/ContentGrid/ContentGrid.stories.tsx +4 -4
- package/src/components/ContentGrid/ContentGrid.tsx +3 -3
- package/src/components/ContentGrid/index.ts +3 -3
- package/src/components/Divider/Divider.stories.tsx +7 -4
- package/src/components/Divider/Divider.tsx +3 -3
- package/src/components/Divider/index.ts +4 -4
- package/src/components/Field/Field.stories.tsx +7 -7
- package/src/components/Field/Field.tsx +4 -2
- package/src/components/Field/index.ts +3 -3
- package/src/components/Header/Header.stories.tsx +9 -10
- package/src/components/Header/Header.tsx +11 -7
- package/src/components/Header/index.ts +3 -3
- package/src/components/Icon/Icon.stories.helpers.jsx +4 -4
- package/src/components/Icon/Icon.stories.tsx +74 -60
- package/src/components/Icon/Icon.tsx +77 -44
- package/src/components/Icon/index.ts +3 -3
- package/src/components/IllustratedMessage/IllustratedMessage.stories.tsx +8 -8
- package/src/components/IllustratedMessage/IllustratedMessage.tsx +7 -5
- package/src/components/IllustratedMessage/index.ts +3 -3
- package/src/components/Image/Image.stories.tsx +3 -3
- package/src/components/Image/Image.tsx +4 -4
- package/src/components/Image/index.ts +3 -3
- package/src/components/ImageSwatch/ImageSwatch.css +8 -4
- package/src/components/ImageSwatch/ImageSwatch.stories.tsx +10 -10
- package/src/components/ImageSwatch/ImageSwatch.tsx +25 -23
- package/src/components/ImageSwatch/index.ts +3 -3
- package/src/components/InLineAlert/InLineAlert.stories.tsx +12 -7
- package/src/components/InLineAlert/InLineAlert.tsx +4 -2
- package/src/components/InLineAlert/index.ts +3 -3
- package/src/components/Incrementer/Incrementer.stories.tsx +9 -9
- package/src/components/Incrementer/Incrementer.tsx +75 -37
- package/src/components/Incrementer/index.ts +3 -3
- package/src/components/Input/Input.css +4 -1
- package/src/components/Input/Input.stories.tsx +5 -5
- package/src/components/Input/Input.tsx +5 -3
- package/src/components/Input/index.ts +3 -3
- package/src/components/InputDate/InputDate.tsx +3 -3
- package/src/components/InputDate/index.ts +3 -3
- package/src/components/InputFile/InputFile.css +16 -16
- package/src/components/InputFile/InputFile.stories.tsx +21 -16
- package/src/components/InputFile/InputFile.tsx +8 -6
- package/src/components/InputFile/index.ts +5 -5
- package/src/components/InputPassword/InputPassword.stories.tsx +4 -4
- package/src/components/InputPassword/InputPassword.tsx +5 -4
- package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.tsx +1 -1
- package/src/components/InputPassword/PasswordStatusIndicator/index.ts +3 -3
- package/src/components/InputPassword/index.ts +3 -3
- package/src/components/Modal/Modal.stories.tsx +27 -16
- package/src/components/Modal/Modal.tsx +10 -11
- package/src/components/Modal/index.ts +3 -3
- package/src/components/MultiSelect/MultiSelect.stories.tsx +15 -15
- package/src/components/MultiSelect/MultiSelect.tsx +15 -15
- package/src/components/Pagination/Pagination.css +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +0 -1
- package/src/components/Pagination/Pagination.tsx +17 -12
- package/src/components/Pagination/PaginationButton.tsx +2 -3
- package/src/components/Pagination/index.ts +3 -3
- package/src/components/Picker/Picker.css +3 -1
- package/src/components/Picker/Picker.stories.tsx +1 -1
- package/src/components/Picker/Picker.tsx +8 -6
- package/src/components/Picker/index.ts +3 -3
- package/src/components/Portal/Portal.stories.tsx +50 -44
- package/src/components/Portal/Portal.tsx +4 -4
- package/src/components/Price/Price.stories.tsx +3 -3
- package/src/components/Price/Price.tsx +4 -2
- package/src/components/Price/index.ts +3 -3
- package/src/components/PriceRange/PriceRange.stories.tsx +3 -3
- package/src/components/PriceRange/PriceRange.tsx +8 -6
- package/src/components/PriceRange/index.ts +3 -3
- package/src/components/ProductItemCard/ProductItemCard.tsx +4 -2
- package/src/components/ProductItemCard/ProductItemCardSkeleton.tsx +16 -16
- package/src/components/ProductItemCard/index.ts +4 -4
- package/src/components/ProgressSpinner/ProgressSpinner.stories.tsx +8 -8
- package/src/components/ProgressSpinner/ProgressSpinner.tsx +7 -5
- package/src/components/ProgressSpinner/index.ts +3 -3
- package/src/components/RadioButton/RadioButton.stories.tsx +1 -1
- package/src/components/RadioButton/RadioButton.tsx +4 -2
- package/src/components/Skeleton/Skeleton.stories.tsx +4 -4
- package/src/components/Skeleton/Skeleton.tsx +11 -7
- package/src/components/Skeleton/index.ts +3 -3
- package/src/components/Table/Table.css +106 -99
- package/src/components/Table/Table.stories.tsx +404 -227
- package/src/components/Table/Table.tsx +11 -7
- package/src/components/Table/index.ts +4 -4
- package/src/components/Tag/Tag.stories.tsx +6 -6
- package/src/components/Tag/Tag.tsx +7 -5
- package/src/components/Tag/index.ts +3 -3
- package/src/components/TextArea/TextArea.css +3 -1
- package/src/components/TextArea/TextArea.stories.tsx +9 -6
- package/src/components/TextArea/TextArea.tsx +3 -3
- package/src/components/TextArea/index.ts +3 -3
- package/src/components/TextSwatch/TextSwatch.css +4 -2
- package/src/components/TextSwatch/TextSwatch.stories.tsx +8 -8
- package/src/components/TextSwatch/TextSwatch.tsx +12 -7
- package/src/components/TextSwatch/index.ts +3 -3
- package/src/components/ToggleButton/ToggleButton.css +6 -2
- package/src/components/ToggleButton/ToggleButton.stories.tsx +10 -6
- package/src/components/ToggleButton/ToggleButton.tsx +8 -3
- package/src/components/ToggleButton/index.ts +3 -3
- package/src/components/UIProvider/UIProvider.css +3 -2
- package/src/components/UIProvider/UIProvider.tsx +11 -7
- package/src/components/UIProvider/debugger.css +5 -6
- package/src/components/UIProvider/index.ts +3 -3
- package/src/docs/API/event-bus.mdx +64 -37
- package/src/docs/API/graphql.mdx +69 -36
- package/src/docs/API/initializer.mdx +58 -35
- package/src/docs/API/render.mdx +45 -32
- package/src/docs/Design/colors.mdx +10 -12
- package/src/docs/Design/grid.mdx +41 -14
- package/src/docs/Design/overview.mdx +20 -4
- package/src/docs/Design/shapes.mdx +8 -7
- package/src/docs/Design/spacing.mdx +3 -1
- package/src/docs/Design/typography.mdx +3 -2
- package/src/docs/Utilities/VComponent.mdx +27 -10
- package/src/docs/Utilities/classList.mdx +7 -5
- package/src/docs/Utilities/debounce.mdx +6 -7
- package/src/docs/Utilities/getCookie.mdx +1 -2
- package/src/docs/Utilities/getFormErrors.mdx +1 -2
- package/src/docs/Utilities/getFormValues.mdx +1 -2
- package/src/docs/Utilities/getPathValue.mdx +2 -4
- package/src/docs/Utilities/links.mdx +16 -7
- package/src/docs/cli-usage.mdx +8 -3
- package/src/docs/components/overview.mdx +14 -4
- package/src/docs/quick-start.mdx +69 -22
- package/src/docs/slots.mdx +74 -37
- package/src/docs/welcome.mdx +13 -4
- package/src/i18n/index.ts +3 -3
- package/src/lib/aem/assets.ts +9 -9
- package/src/lib/aem/configs.ts +16 -8
- package/src/lib/classes.ts +4 -4
- package/src/lib/config.ts +3 -3
- package/src/lib/debounce.ts +3 -3
- package/src/lib/deepmerge.ts +6 -13
- package/src/lib/deviceUtils.ts +3 -3
- package/src/lib/form-values.ts +3 -3
- package/src/lib/get-price-formatter.ts +8 -3
- package/src/lib/i18n.ts +3 -3
- package/src/lib/image-params-keymap.ts +4 -5
- package/src/lib/initializer.ts +11 -12
- package/src/lib/is-number.ts +3 -3
- package/src/lib/locale-config.ts +4 -4
- package/src/lib/render.tsx +14 -8
- package/src/lib/resolve-image.ts +19 -16
- package/src/lib/signals.ts +4 -4
- package/src/lib/slot.tsx +34 -27
- package/src/lib/tests.tsx +6 -8
- package/src/lib/types.ts +3 -3
- package/src/lib/vcomponent.tsx +3 -3
- package/src/shims/importmap.js +3107 -20
- package/static/assets/images/index.ts +3 -3
- package/storybook-stories.js +3 -3
- package/tests/__mocks__/browserMocks.ts +3 -3
- package/tests/__mocks__/fileMocks.ts +3 -3
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
const cli = require('../../lib/cli');
|
|
2
2
|
|
|
3
3
|
module.exports = function generateResourceBuilder() {
|
|
4
|
-
return cli('storybook
|
|
4
|
+
return cli('storybook', [
|
|
5
|
+
'dev',
|
|
6
|
+
'-h',
|
|
7
|
+
'localhost',
|
|
8
|
+
'-p',
|
|
9
|
+
'6006',
|
|
10
|
+
'--disable-telemetry',
|
|
11
|
+
'--quiet',
|
|
12
|
+
]);
|
|
5
13
|
};
|
|
@@ -27,8 +27,7 @@ module.exports = async function tscBuilder({ argv } = {}) {
|
|
|
27
27
|
return;
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
return cli(`node ${tscBin} --noEmit --project ${configPath}`);
|
|
30
|
+
return cli('typescript', ['--noEmit', '--project', configPath], 'tsc');
|
|
32
31
|
};
|
|
33
32
|
|
|
34
33
|
module.exports.builder = (yargs) =>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2025 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
const fs = require('fs');
|
|
@@ -67,7 +67,7 @@ module.exports = function validateTsconfig(configPath) {
|
|
|
67
67
|
if (value !== undefined && removedValues.includes(value.toLowerCase())) {
|
|
68
68
|
errors.push(
|
|
69
69
|
`compilerOptions.${key}: "${value}" was removed in TypeScript 6. ` +
|
|
70
|
-
`Use ${key === 'moduleResolution' ? '"nodenext" or "bundler"' : '"es2015" or later'} instead
|
|
70
|
+
`Use ${key === 'moduleResolution' ? '"nodenext" or "bundler"' : '"es2015" or later'} instead.`,
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
}
|
|
@@ -78,7 +78,7 @@ module.exports = function validateTsconfig(configPath) {
|
|
|
78
78
|
if (compilerOptions[key] !== undefined) {
|
|
79
79
|
warnings.push(
|
|
80
80
|
`compilerOptions.${key} is deprecated in TypeScript 6 and will be removed in TS7. ` +
|
|
81
|
-
`Add "ignoreDeprecations": "6.0" to silence, or migrate away from this option
|
|
81
|
+
`Add "ignoreDeprecations": "6.0" to silence, or migrate away from this option.`,
|
|
82
82
|
);
|
|
83
83
|
}
|
|
84
84
|
}
|
package/bin/index.js
CHANGED
|
@@ -10,7 +10,7 @@ yargs
|
|
|
10
10
|
.command(
|
|
11
11
|
'gql',
|
|
12
12
|
'Generates types or mocks for your API',
|
|
13
|
-
require('./builders/gql')
|
|
13
|
+
require('./builders/gql'),
|
|
14
14
|
)
|
|
15
15
|
.command('build', 'Build bundles', require('./builders/build'))
|
|
16
16
|
.command('test', 'Run Jest tests', require('./builders/test'))
|
|
@@ -18,24 +18,30 @@ yargs
|
|
|
18
18
|
.command(
|
|
19
19
|
'concurrently',
|
|
20
20
|
'Run multiple commands concurrently',
|
|
21
|
-
|
|
21
|
+
// Loaded lazily: concurrently is ESM-only and only needs to resolve when this
|
|
22
|
+
// command actually runs, not whenever this CLI module is merely required.
|
|
23
|
+
(...args) => require('./builders/concurrently')(...args),
|
|
22
24
|
)
|
|
23
25
|
.command(
|
|
24
26
|
'wait-on',
|
|
25
27
|
'Wait for files, ports, sockets, or http(s) resources',
|
|
26
|
-
require('./builders/wait-on')
|
|
28
|
+
require('./builders/wait-on'),
|
|
27
29
|
)
|
|
28
30
|
.command(
|
|
29
31
|
'types',
|
|
30
32
|
'Type-check with TypeScript and validate tsconfig for TS6 compatibility',
|
|
31
|
-
require('./builders/types')
|
|
33
|
+
require('./builders/types'),
|
|
32
34
|
)
|
|
33
35
|
.command(
|
|
34
36
|
'generate',
|
|
35
37
|
'Generate a new <resource>',
|
|
36
|
-
require('./builders/generate')
|
|
38
|
+
require('./builders/generate'),
|
|
39
|
+
)
|
|
40
|
+
.command(
|
|
41
|
+
'changeset',
|
|
42
|
+
'Run changeset commands',
|
|
43
|
+
require('./builders/changeset'),
|
|
37
44
|
)
|
|
38
|
-
.command('changeset', 'Run changeset commands', require('./builders/changeset'))
|
|
39
45
|
|
|
40
46
|
.help('help')
|
|
41
47
|
|
package/bin/lib/cli.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
const { spawn } = require('child_process');
|
|
2
|
+
const resolveBin = require('./resolve-bin');
|
|
3
|
+
|
|
4
|
+
module.exports = function cli(packageName, args = [], binName) {
|
|
5
|
+
const scriptPath = resolveBin(packageName, binName);
|
|
6
|
+
const passthroughArgs = process.argv.slice(3);
|
|
7
|
+
const allArgs = [scriptPath, ...args, ...passthroughArgs];
|
|
2
8
|
|
|
3
|
-
module.exports = function cli(command) {
|
|
4
|
-
let cmd = command;
|
|
5
|
-
const argvs = process.argv.slice(3).join(' ');
|
|
6
|
-
if (argvs) cmd += ` ${argvs}`;
|
|
7
|
-
|
|
8
9
|
return new Promise((resolve, reject) => {
|
|
9
|
-
const child = spawn(
|
|
10
|
-
|
|
10
|
+
const child = spawn(process.execPath, allArgs, { stdio: 'inherit' });
|
|
11
|
+
|
|
11
12
|
child.on('close', (code) => {
|
|
12
13
|
if (code !== 0) {
|
|
13
14
|
reject(new Error(`Command failed with exit code ${code}`));
|
|
@@ -15,7 +16,7 @@ module.exports = function cli(command) {
|
|
|
15
16
|
resolve(child);
|
|
16
17
|
}
|
|
17
18
|
});
|
|
18
|
-
|
|
19
|
+
|
|
19
20
|
child.on('error', (err) => {
|
|
20
21
|
reject(err);
|
|
21
22
|
});
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const path = require('path');
|
|
2
|
+
|
|
3
|
+
module.exports = function resolveBin(packageName, binName = packageName) {
|
|
4
|
+
const pkgJsonPath = require.resolve(`${packageName}/package.json`);
|
|
5
|
+
const pkgDir = path.dirname(pkgJsonPath);
|
|
6
|
+
const { bin } = require(pkgJsonPath);
|
|
7
|
+
const binRelativePath = typeof bin === 'string' ? bin : bin[binName];
|
|
8
|
+
return path.join(pkgDir, binRelativePath);
|
|
9
|
+
};
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
module.exports = function validateTypeOf(values, rules) {
|
package/bin/lib/write-file.js
CHANGED
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
const path = require('path');
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
const path = require('path');
|
|
@@ -13,7 +13,7 @@ const m = require('./log-message');
|
|
|
13
13
|
|
|
14
14
|
module.exports = function writeParentIndex(
|
|
15
15
|
filePath,
|
|
16
|
-
{ pathname, importAliasRoot = '.' }
|
|
16
|
+
{ pathname, importAliasRoot = '.' },
|
|
17
17
|
) {
|
|
18
18
|
const relativePath = path.relative('.', filePath);
|
|
19
19
|
|
package/config/eslint.mjs
CHANGED
|
@@ -122,7 +122,8 @@ export const sourceImportRestrictions = [
|
|
|
122
122
|
},
|
|
123
123
|
{
|
|
124
124
|
group: ['preact-i18n'],
|
|
125
|
-
message:
|
|
125
|
+
message:
|
|
126
|
+
'Please use "@adobe-commerce/elsie/i18n" instead of "preact-i18n".',
|
|
126
127
|
},
|
|
127
128
|
],
|
|
128
129
|
},
|
package/config/jest.mjs
CHANGED
|
@@ -14,7 +14,9 @@ import { createRequire } from 'module';
|
|
|
14
14
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
15
15
|
const require = createRequire(import.meta.url);
|
|
16
16
|
|
|
17
|
-
const { compilerOptions } = require(
|
|
17
|
+
const { compilerOptions } = require(
|
|
18
|
+
path.resolve(process.cwd(), 'tsconfig.json'),
|
|
19
|
+
);
|
|
18
20
|
|
|
19
21
|
const paths = { ...compilerOptions.paths };
|
|
20
22
|
|
|
@@ -46,7 +48,10 @@ export default {
|
|
|
46
48
|
'^react-dom/test-utils$': 'preact/test-utils',
|
|
47
49
|
'^react-dom$': 'preact/compat',
|
|
48
50
|
'^react$': 'preact/compat',
|
|
49
|
-
'\\.(css|less|scss|sass)\\?inline$': path.resolve(
|
|
51
|
+
'\\.(css|less|scss|sass)\\?inline$': path.resolve(
|
|
52
|
+
__dirname,
|
|
53
|
+
'../tests/__mocks__/cssMock.js',
|
|
54
|
+
),
|
|
50
55
|
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
|
|
51
56
|
'\\.svg': '@adobe-commerce/elsie/__mocks__/svg.js',
|
|
52
57
|
'^@adobe-commerce/elsie/(.*)$': path.resolve(__dirname, '../src/$1'),
|
|
@@ -42,6 +42,6 @@ exports.default = function normalizeRelativeReplacer({ orig, file }) {
|
|
|
42
42
|
if (rel === importPath) return orig;
|
|
43
43
|
return orig.replace(
|
|
44
44
|
`${openQuote}${importPath}${closeQuote}`,
|
|
45
|
-
`${openQuote}${rel}${closeQuote}
|
|
45
|
+
`${openQuote}${rel}${closeQuote}`,
|
|
46
46
|
);
|
|
47
47
|
};
|
package/config/plugins/dts.mjs
CHANGED
|
@@ -88,7 +88,7 @@ export function dtsPlugin({
|
|
|
88
88
|
// truth — tsconfig files do not need to define declarationDir themselves.
|
|
89
89
|
execSync(
|
|
90
90
|
`"${tscBin}" -p "${tsconfigAbsPath}" --declarationDir "${absDeclDir}"`,
|
|
91
|
-
{ stdio: 'inherit', cwd }
|
|
91
|
+
{ stdio: 'inherit', cwd },
|
|
92
92
|
);
|
|
93
93
|
|
|
94
94
|
{
|
|
@@ -127,7 +127,8 @@ export function dtsPlugin({
|
|
|
127
127
|
// receive the import *clause* (not the trailing ';'), so returning '' from
|
|
128
128
|
// one leaves an invalid bare ';' (TS1036). Removing the whole statement in
|
|
129
129
|
// a single pass avoids that.
|
|
130
|
-
const PURE_IMPORT =
|
|
130
|
+
const PURE_IMPORT =
|
|
131
|
+
/^[ \t]*import\s+['"][^'"]+['"][^\S\r\n]*;?[^\S\r\n]*(?:\r?\n|$)/gm;
|
|
131
132
|
for (const filePath of walkDts(absDeclDir)) {
|
|
132
133
|
const content = readFileSync(filePath, 'utf-8');
|
|
133
134
|
const cleaned = content.replace(PURE_IMPORT, '');
|
|
@@ -148,7 +149,7 @@ export function dtsPlugin({
|
|
|
148
149
|
const isLocalFile =
|
|
149
150
|
existsSync(absSrc) ||
|
|
150
151
|
['.ts', '.tsx', '.js', '.jsx'].some((ext) =>
|
|
151
|
-
existsSync(absSrc + ext)
|
|
152
|
+
existsSync(absSrc + ext),
|
|
152
153
|
);
|
|
153
154
|
if (!isLocalFile) {
|
|
154
155
|
writeFileSync(barrelPath, `export * from '${srcPath}';\n`, 'utf-8');
|
package/config/prettier.json
CHANGED
|
@@ -1,7 +1,29 @@
|
|
|
1
1
|
{
|
|
2
|
-
"
|
|
2
|
+
"trailingComma": "all",
|
|
3
3
|
"useTabs": false,
|
|
4
|
+
"semi": true,
|
|
5
|
+
"tabWidth": 2,
|
|
4
6
|
"singleQuote": true,
|
|
5
|
-
"
|
|
6
|
-
|
|
7
|
+
"overrides": [
|
|
8
|
+
{
|
|
9
|
+
"files": ["*.json", "*.json5"],
|
|
10
|
+
"options": {
|
|
11
|
+
"parser": "json",
|
|
12
|
+
"trailingComma": "none"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"files": ["*.yaml", "*.yml"],
|
|
17
|
+
"options": {
|
|
18
|
+
"singleQuote": false
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
"files": ["*.md", "*.mdx"],
|
|
23
|
+
"options": {
|
|
24
|
+
"proseWrap": "always",
|
|
25
|
+
"printWidth": 80
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
7
29
|
}
|
package/config/setEnvVars.mjs
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
// Used in the Price component to avoid using the system locale in tests, which can be different between computers
|
|
11
|
-
process.env.LOCALE =
|
|
11
|
+
process.env.LOCALE = 'en-US';
|
|
12
12
|
|
|
13
13
|
// Used mainly for the elsie generator to avoid issues with the system locale in tests
|
|
14
|
-
process.env.LANG =
|
|
14
|
+
process.env.LANG = 'en_US.UTF-8';
|
|
@@ -74,7 +74,7 @@ module.exports = (_storybookOptions, { dropinViteConfig = true } = {}) => ({
|
|
|
74
74
|
Object.entries(env).map(([k, v]) => [
|
|
75
75
|
`process.env.${k}`,
|
|
76
76
|
JSON.stringify(v),
|
|
77
|
-
])
|
|
77
|
+
]),
|
|
78
78
|
),
|
|
79
79
|
};
|
|
80
80
|
|
|
@@ -108,8 +108,8 @@ module.exports = (_storybookOptions, { dropinViteConfig = true } = {}) => ({
|
|
|
108
108
|
...(Array.isArray(config.resolve?.alias)
|
|
109
109
|
? config.resolve.alias
|
|
110
110
|
: Object.entries(config.resolve?.alias ?? {}).map(
|
|
111
|
-
|
|
112
|
-
|
|
111
|
+
([find, replacement]) => ({ find, replacement }),
|
|
112
|
+
)),
|
|
113
113
|
{
|
|
114
114
|
find: /^@adobe-commerce\/elsie\/src(.*)$/,
|
|
115
115
|
replacement: `${elsieRoot}/src$1`,
|
|
@@ -138,10 +138,10 @@ module.exports = (_storybookOptions, { dropinViteConfig = true } = {}) => ({
|
|
|
138
138
|
const sbComponentEntries = fs
|
|
139
139
|
.readdirSync(sbComponentsDir)
|
|
140
140
|
.filter((entry) =>
|
|
141
|
-
fs.statSync(path.join(sbComponentsDir, entry)).isDirectory()
|
|
141
|
+
fs.statSync(path.join(sbComponentsDir, entry)).isDirectory(),
|
|
142
142
|
)
|
|
143
143
|
.map(
|
|
144
|
-
(name) => `@adobe-commerce/elsie/config/storybook/components/${name}
|
|
144
|
+
(name) => `@adobe-commerce/elsie/config/storybook/components/${name}`,
|
|
145
145
|
);
|
|
146
146
|
|
|
147
147
|
config.optimizeDeps = {
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { createContext, memo, useCallback, useContext, useState } from 'react';
|
|
@@ -136,7 +136,7 @@ const Folder = memo(
|
|
|
136
136
|
)}
|
|
137
137
|
</li>
|
|
138
138
|
);
|
|
139
|
-
}
|
|
139
|
+
},
|
|
140
140
|
);
|
|
141
141
|
Folder.displayName = 'Folder';
|
|
142
142
|
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
export * from '@adobe-commerce/elsie/config/storybook/components/FileTree/FileTree';
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/FileTree/FileTree';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import styles from './Flex.module.css';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
export * from '@adobe-commerce/elsie/config/storybook/components/Flex/Flex';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import React from 'react';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
export * from '@adobe-commerce/elsie/config/storybook/components/OptionsTable/OptionsTable';
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/OptionsTable/OptionsTable';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { FunctionComponent, toChildArray } from 'preact';
|
|
@@ -31,10 +31,10 @@ export const Panel: FunctionComponent<PanelProps> = ({
|
|
|
31
31
|
hasHeader && !hasFooter
|
|
32
32
|
? childrenArray.slice(1)
|
|
33
33
|
: !hasHeader && hasFooter
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
34
|
+
? childrenArray.slice(0, -1)
|
|
35
|
+
: hasHeader && hasFooter
|
|
36
|
+
? childrenArray.slice(1, -1)
|
|
37
|
+
: childrenArray;
|
|
38
38
|
|
|
39
39
|
return (
|
|
40
40
|
<div className={`${styles.panel}`}>
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
export * from '@adobe-commerce/elsie/config/storybook/components/Panel/Panel';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import styles from './Screenshot.module.css';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
export * from '@adobe-commerce/elsie/config/storybook/components/Screenshot/Screenshot';
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/Screenshot/Screenshot';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { Unstyled } from '@storybook/addon-docs/blocks';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
export * from '@adobe-commerce/elsie/config/storybook/components/Steps/Steps';
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/Steps/Steps';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import styles from './StoryWrapper.module.css';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
export * from '@adobe-commerce/elsie/config/storybook/components/StoryWrapper/StoryWrapper';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { Unstyled } from '@storybook/addon-docs/blocks';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
export * from '@adobe-commerce/elsie/config/storybook/components/Summary/Summary';
|
|
@@ -2,9 +2,9 @@
|
|
|
2
2
|
* Copyright 2024 Adobe
|
|
3
3
|
* All Rights Reserved.
|
|
4
4
|
*
|
|
5
|
-
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
-
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
-
* accompanying it.
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { useState } from 'preact/hooks';
|
|
@@ -14,12 +14,12 @@ import './docs.css';
|
|
|
14
14
|
export const Variants = ({ of, storyOrder = [] }) => {
|
|
15
15
|
const info = useOf(of || 'story', ['story', 'meta', 'component']);
|
|
16
16
|
const stories = Object.values(info.csfFile.stories).map(
|
|
17
|
-
(story) => story.moduleExport
|
|
17
|
+
(story) => story.moduleExport,
|
|
18
18
|
);
|
|
19
19
|
const [bgColor, setBgColor] = useState('#F5F5F5');
|
|
20
20
|
const toggleBgColor = () => {
|
|
21
21
|
setBgColor((prevColor) =>
|
|
22
|
-
prevColor === '#F5F5F5' ? '#222222' : '#F5F5F5'
|
|
22
|
+
prevColor === '#F5F5F5' ? '#222222' : '#F5F5F5',
|
|
23
23
|
);
|
|
24
24
|
};
|
|
25
25
|
|
|
@@ -42,10 +42,14 @@ export const Variants = ({ of, storyOrder = [] }) => {
|
|
|
42
42
|
<div className="story__item story__item--left">
|
|
43
43
|
<h3 className="docs__header3">{story.name}</h3>
|
|
44
44
|
<p className="docs__paragraph">
|
|
45
|
-
{story.parameters.docs.description ||
|
|
45
|
+
{story.parameters.docs.description ||
|
|
46
|
+
`Add description to ${story.name}.stories.tsx.`}
|
|
46
47
|
</p>
|
|
47
48
|
</div>
|
|
48
|
-
<div
|
|
49
|
+
<div
|
|
50
|
+
className="story__item story__item--right"
|
|
51
|
+
style={{ backgroundColor: bgColor }}
|
|
52
|
+
>
|
|
49
53
|
<Story of={story} />
|
|
50
54
|
<Source of={story} />
|
|
51
55
|
</div>
|