@adobe-commerce/elsie 1.9.0-beta.3 → 2.0.0-alpha-20260608090548
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/CHANGELOG.md +6 -19
- package/bin/builders/concurrently/index.js +13 -0
- package/bin/builders/generate/api/templates/story.js +1 -1
- package/bin/builders/generate/component/templates/stories.js +1 -1
- package/bin/builders/generate/container/templates/stories.js +1 -1
- package/bin/builders/wait-on/index.js +13 -0
- package/bin/index.js +10 -0
- package/config/jest.js +8 -2
- package/config/storybook/addon.js +153 -90
- package/config/storybook/components/Steps/Steps.jsx +1 -1
- package/config/storybook/components/Summary/Summary.jsx +1 -1
- package/config/storybook/components/Variants/{Variants.js → Variants.jsx} +1 -1
- package/config/storybook/components/{video/index.jsx → Video/Video.jsx} +8 -18
- package/config/storybook/components/Video/Video.module.css +15 -0
- package/config/storybook/components/Video/index.js +10 -0
- package/config/storybook/manager.js +1 -1
- package/config/storybook/preview.jsx +1 -1
- package/config/storybook/theming/theme.js +2 -2
- package/config/vite.mjs +81 -258
- package/package.json +21 -34
- package/src/components/Accordion/Accordion.stories.tsx +2 -2
- package/src/components/ActionButton/ActionButton.stories.tsx +2 -2
- package/src/components/ActionButtonGroup/ActionButtonGroup.stories.tsx +1 -1
- package/src/components/AlertBanner/AlertBanner.stories.tsx +3 -3
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +2 -2
- package/src/components/Button/Button.mdx +1 -1
- package/src/components/Button/Button.stories.tsx +3 -3
- package/src/components/Card/Card.stories.tsx +2 -2
- package/src/components/CartItem/CartItem.stories.tsx +2 -2
- package/src/components/CartList/CartList.stories.tsx +1 -1
- package/src/components/Checkbox/Checkbox.stories.tsx +2 -2
- package/src/components/ColorSwatch/ColorSwatch.stories.tsx +3 -3
- package/src/components/ContentGrid/ContentGrid.stories.tsx +1 -1
- package/src/components/Divider/Divider.stories.tsx +2 -2
- package/src/components/Field/Field.stories.tsx +2 -2
- package/src/components/Header/Header.stories.tsx +2 -2
- package/src/components/Icon/Icon.stories.tsx +2 -2
- package/src/components/Icon/Icon.tsx +2 -2
- package/src/components/IllustratedMessage/IllustratedMessage.stories.tsx +2 -2
- package/src/components/Image/Image.stories.tsx +2 -2
- package/src/components/ImageSwatch/ImageSwatch.stories.tsx +3 -3
- package/src/components/InLineAlert/InLineAlert.stories.tsx +5 -6
- package/src/components/Incrementer/Incrementer.stories.tsx +3 -3
- package/src/components/Incrementer/Incrementer.tsx +16 -9
- package/src/components/Input/Input.stories.tsx +3 -3
- package/src/components/InputDate/InputDate.stories.tsx +3 -3
- package/src/components/InputFile/InputFile.stories.tsx +2 -2
- package/src/components/InputPassword/InputPassword.stories.tsx +2 -2
- package/src/components/Modal/Modal.stories.tsx +2 -2
- package/src/components/MultiSelect/MultiSelect.stories.tsx +2 -2
- package/src/components/Pagination/Pagination.stories.tsx +3 -3
- package/src/components/Picker/Picker.stories.tsx +2 -2
- package/src/components/Portal/Portal.stories.tsx +1 -1
- package/src/components/Price/Price.stories.tsx +2 -2
- package/src/components/PriceRange/PriceRange.stories.tsx +1 -1
- package/src/components/ProductItemCard/ProductItemCard.stories.tsx +1 -1
- package/src/components/ProgressSpinner/ProgressSpinner.stories.tsx +2 -2
- package/src/components/RadioButton/RadioButton.stories.tsx +2 -2
- package/src/components/Skeleton/Skeleton.stories.tsx +2 -2
- package/src/components/Table/Table.stories.tsx +1 -1
- package/src/components/Tag/Tag.stories.tsx +2 -2
- package/src/components/TextArea/TextArea.stories.tsx +2 -2
- package/src/components/TextSwatch/TextSwatch.stories.tsx +3 -3
- package/src/components/ToggleButton/ToggleButton.stories.tsx +2 -2
- package/src/docs/API/event-bus.mdx +1 -1
- package/src/docs/API/graphql.mdx +1 -1
- package/src/docs/API/initializer.mdx +1 -1
- package/src/docs/API/render.mdx +1 -1
- package/src/docs/Design/colors.mdx +1 -1
- package/src/docs/Design/designBlocks.jsx +1 -1
- package/src/docs/Design/grid.mdx +1 -1
- package/src/docs/Design/overview.mdx +1 -1
- package/src/docs/Design/shapes.mdx +1 -1
- package/src/docs/Design/spacing.mdx +1 -1
- package/src/docs/Design/typography.mdx +1 -1
- package/src/docs/Utilities/VComponent.mdx +1 -1
- package/src/docs/Utilities/classList.mdx +1 -1
- package/src/docs/Utilities/debounce.mdx +1 -1
- package/src/docs/Utilities/deepmerge.mdx +1 -1
- package/src/docs/Utilities/getCookie.mdx +1 -1
- package/src/docs/Utilities/getFormErrors.mdx +1 -1
- package/src/docs/Utilities/getFormValues.mdx +1 -1
- package/src/docs/Utilities/getPathValue.mdx +1 -1
- package/src/docs/Utilities/links.mdx +1 -1
- package/src/docs/cli-usage.mdx +1 -1
- package/src/docs/components/overview.mdx +1 -1
- package/src/docs/quick-start.mdx +1 -1
- package/src/docs/slots.mdx +1 -1
- package/src/docs/welcome.mdx +1 -1
- package/src/i18n/en_US.json +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,33 +1,20 @@
|
|
|
1
1
|
# @adobe-commerce/elsie
|
|
2
2
|
|
|
3
|
-
##
|
|
3
|
+
## 2.0.0-alpha-20260608090548
|
|
4
4
|
|
|
5
|
-
###
|
|
6
|
-
|
|
7
|
-
- 5c64620: Implement a new `fragment-import-redirect` build plugin that automatically detects and redirects any dropin source file that directly imports a fragment source file (bypassing the barrel). The import is silently redirected to the fragments barrel at build time and a warning is emitted identifying the file so it can be corrected in source. This ensures fragment constants always appear as local declarations in `fragments.js` regardless of how dropin source code references them.
|
|
8
|
-
|
|
9
|
-
## 1.9.0-beta.2
|
|
10
|
-
|
|
11
|
-
### Patch Changes
|
|
5
|
+
### Major Changes
|
|
12
6
|
|
|
13
|
-
-
|
|
7
|
+
- 8e118e2: Upgrade Jest to 30.4.2 and Storybook to 10.4.0
|
|
14
8
|
|
|
15
|
-
|
|
9
|
+
Updated testing and component development tools to latest stable versions. Jest 30.4.2 provides enhanced snapshot handling and improved test performance. Storybook 10.4.0 includes updated addon ecosystem, improved Preact Vite integration, and enhanced accessibility features with addon-a11y and addon-coverage support.
|
|
16
10
|
|
|
17
11
|
### Minor Changes
|
|
18
12
|
|
|
19
|
-
-
|
|
13
|
+
- 005edc7: Adds validation to the Incrementer component when the field is changed to "empty".
|
|
14
|
+
- 3462840: Update minimum Node.js requirement to 22 LTS
|
|
20
15
|
|
|
21
16
|
Packages are now built with Node.js 22. `elsie` requires `>=22`; browser-only packages (`fetch-graphql`, `event-bus`, `recaptcha`, `storefront-design`, `build-tools`) do not declare an `engines` field as they do not run in Node.js.
|
|
22
17
|
|
|
23
|
-
## 1.9.0-beta.0
|
|
24
|
-
|
|
25
|
-
### Minor Changes
|
|
26
|
-
|
|
27
|
-
- f55a79c: Migrate to Node.js 24 LTS
|
|
28
|
-
|
|
29
|
-
Minimum required Node.js version is now 24. Updated `engines.node` from `>=16`/`>=18` to `>=24` across all packages. Regenerated lockfile under Node 24. Updated CI workflows to use `storefront-workflows@v6` with Node 24 support.
|
|
30
|
-
|
|
31
18
|
- 62adf1c: Reduce HTTP requests on page load through three bundling optimizations. The preact runtime is isolated in its own vendor chunk so it no longer co-locates into other chunks. Dropin API and internal component modules are consolidated into `chunks/api.js` and `chunks/components.js` respectively, replacing the previous pattern of one chunk file per function or component. All SVG icons are consolidated into a single `chunks/icons.js` chunk instead of one chunk per icon.
|
|
32
19
|
|
|
33
20
|
Drop-ins must be rebuilt against this release to get the reduced request footprint. No source changes are required.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
const concurrently = require('concurrently');
|
|
2
|
+
|
|
3
|
+
module.exports = function concurrentlyBuilder() {
|
|
4
|
+
const commands = process.argv.slice(3);
|
|
5
|
+
|
|
6
|
+
const { result } = concurrently(commands, {
|
|
7
|
+
killOthers: ['failure'],
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
return result.catch(() => {
|
|
11
|
+
process.exitCode = 1;
|
|
12
|
+
});
|
|
13
|
+
};
|
|
@@ -11,7 +11,7 @@ module.exports = ({ pathname, basename, importPath = '.' }) => {
|
|
|
11
11
|
*******************************************************************/
|
|
12
12
|
|
|
13
13
|
${source`
|
|
14
|
-
import { Meta } from '@storybook/blocks';
|
|
14
|
+
import { Meta } from '@storybook/addon-docs/blocks';
|
|
15
15
|
|
|
16
16
|
<Meta title="API/${pathname}" />
|
|
17
17
|
|
|
@@ -12,7 +12,7 @@ module.exports = ({ name, pathname, basename, group, importPath = '.' }) => {
|
|
|
12
12
|
|
|
13
13
|
${source`
|
|
14
14
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
15
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
15
|
+
import type { Meta, StoryObj } from '@storybook/preact-vite';
|
|
16
16
|
import { ${basename} as component, ${basename}Props } from '${importPath}';
|
|
17
17
|
|
|
18
18
|
/**
|
|
@@ -12,7 +12,7 @@ module.exports = ({ pathname, basename, importPath = '.' }) => {
|
|
|
12
12
|
|
|
13
13
|
${source`
|
|
14
14
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
15
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
15
|
+
import type { Meta, StoryObj } from '@storybook/preact-vite';
|
|
16
16
|
import { ${basename} as component, ${basename}Props } from '${importPath}';
|
|
17
17
|
|
|
18
18
|
const meta: Meta<${basename}Props> = {
|
package/bin/index.js
CHANGED
|
@@ -15,6 +15,16 @@ yargs
|
|
|
15
15
|
.command('build', 'Build bundles', require('./builders/build'))
|
|
16
16
|
.command('test', 'Run Jest tests', require('./builders/test'))
|
|
17
17
|
.command('lint', 'Run ESLint code analysis', require('./builders/lint'))
|
|
18
|
+
.command(
|
|
19
|
+
'concurrently',
|
|
20
|
+
'Run multiple commands concurrently',
|
|
21
|
+
require('./builders/concurrently')
|
|
22
|
+
)
|
|
23
|
+
.command(
|
|
24
|
+
'wait-on',
|
|
25
|
+
'Wait for files, ports, sockets, or http(s) resources',
|
|
26
|
+
require('./builders/wait-on')
|
|
27
|
+
)
|
|
18
28
|
.command(
|
|
19
29
|
'generate',
|
|
20
30
|
'Generate a new <resource>',
|
package/config/jest.js
CHANGED
|
@@ -17,9 +17,11 @@ const { compilerOptions } = require(path.resolve(
|
|
|
17
17
|
const paths = { ...compilerOptions.paths };
|
|
18
18
|
|
|
19
19
|
module.exports = {
|
|
20
|
-
|
|
20
|
+
testEnvironment: 'jsdom',
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
testEnvironmentOptions: {
|
|
23
|
+
customExportConditions: ['node', 'node-addons'],
|
|
24
|
+
},
|
|
23
25
|
|
|
24
26
|
setupFiles: [
|
|
25
27
|
path.resolve(__dirname, '../tests/__mocks__/browserMocks.ts'),
|
|
@@ -36,6 +38,10 @@ module.exports = {
|
|
|
36
38
|
],
|
|
37
39
|
|
|
38
40
|
moduleNameMapper: {
|
|
41
|
+
'^react/jsx-runtime$': 'preact/jsx-runtime',
|
|
42
|
+
'^react-dom/test-utils$': 'preact/test-utils',
|
|
43
|
+
'^react-dom$': 'preact/compat',
|
|
44
|
+
'^react$': 'preact/compat',
|
|
39
45
|
'\\.(css|less|scss|sass)$': 'identity-obj-proxy',
|
|
40
46
|
'\\.svg': '@adobe-commerce/elsie/__mocks__/svg.js',
|
|
41
47
|
'^@adobe-commerce/elsie/(.*)$': path.resolve(__dirname, '../src/$1'),
|
|
@@ -2,108 +2,171 @@
|
|
|
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
|
+
const fs = require('fs');
|
|
10
11
|
const path = require('path');
|
|
12
|
+
const dotenv = require('dotenv');
|
|
13
|
+
|
|
14
|
+
// Reads .env, .env.local, .env.[mode], .env.[mode].local from `root` (matching
|
|
15
|
+
// Vite's file lookup order) and returns the merged result. We don't use
|
|
16
|
+
// vite.loadEnv because it can only return either VITE_-prefixed vars or, with
|
|
17
|
+
// an empty prefix, the entire process.env — which would leak shell state
|
|
18
|
+
// (HOME, PATH, tokens, ...) into the bundle as `define` replacements.
|
|
19
|
+
function loadDotEnvFiles(root, mode) {
|
|
20
|
+
const files = ['.env', '.env.local'];
|
|
21
|
+
if (mode) files.push(`.env.${mode}`, `.env.${mode}.local`);
|
|
22
|
+
const result = {};
|
|
23
|
+
for (const file of files) {
|
|
24
|
+
const full = path.join(root, file);
|
|
25
|
+
if (fs.existsSync(full)) {
|
|
26
|
+
Object.assign(result, dotenv.parse(fs.readFileSync(full)));
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return result;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const cors = {
|
|
33
|
+
origin: '*',
|
|
34
|
+
methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
|
|
35
|
+
allowedHeaders: ['X-Requested-With', 'content-type', 'Authorization'],
|
|
36
|
+
};
|
|
11
37
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
38
|
+
// @storybook/addon-docs sets MDX's `providerImportSource` to a raw `file://`
|
|
39
|
+
// URL (addon-docs/dist/preset.js:318 — note the missing fileURLToPath wrap
|
|
40
|
+
// the surrounding lines have). Vite's resolver can't load `file://` specifiers
|
|
41
|
+
// in workspace/monorepo setups, so MDX docs fail to render.
|
|
42
|
+
// See: https://github.com/storybookjs/storybook/issues/33118
|
|
43
|
+
const fixMdxReactShim = {
|
|
44
|
+
name: 'elsie:fix-mdx-react-shim',
|
|
45
|
+
enforce: 'pre',
|
|
46
|
+
resolveId(source) {
|
|
47
|
+
if (source.startsWith('file://') && source.includes('mdx-react-shim.js')) {
|
|
48
|
+
return new URL(source).pathname;
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
15
51
|
},
|
|
52
|
+
};
|
|
16
53
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
54
|
+
// `dropinViteConfig` opts the consumer into the storybook-relevant subset of
|
|
55
|
+
// @adobe-commerce/elsie/config/vite.mjs (aliases, preact, svgr, tsconfig paths).
|
|
56
|
+
// Elsie's own storybook doesn't need this because its vite.config.mjs at the
|
|
57
|
+
// project root is auto-loaded by @storybook/builder-vite and merged in.
|
|
58
|
+
module.exports = (_storybookOptions, { dropinViteConfig = true } = {}) => ({
|
|
59
|
+
viteFinal: async (config) => {
|
|
60
|
+
// Allow cross-origin requests from the host application during development
|
|
61
|
+
config.server = { ...config.server, cors };
|
|
62
|
+
|
|
63
|
+
config.plugins = [...(config.plugins ?? []), fixMdxReactShim];
|
|
64
|
+
|
|
65
|
+
// Expose .env variables as process.env.* compile-time constants
|
|
66
|
+
const env = {
|
|
67
|
+
LOCALE: 'en-US',
|
|
68
|
+
...loadDotEnvFiles(process.cwd(), config.mode),
|
|
69
|
+
};
|
|
20
70
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
'GET, POST, PUT, DELETE, PATCH, OPTIONS',
|
|
30
|
-
'Access-Control-Allow-Headers':
|
|
31
|
-
'X-Requested-With, content-type, Authorization',
|
|
32
|
-
},
|
|
71
|
+
config.define = {
|
|
72
|
+
...config.define,
|
|
73
|
+
...Object.fromEntries(
|
|
74
|
+
Object.entries(env).map(([k, v]) => [
|
|
75
|
+
`process.env.${k}`,
|
|
76
|
+
JSON.stringify(v),
|
|
77
|
+
])
|
|
78
|
+
),
|
|
33
79
|
};
|
|
34
80
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
81
|
+
if (!dropinViteConfig) {
|
|
82
|
+
// Strip vite-plugin-css-injected-by-js — it is only needed for the
|
|
83
|
+
// library build and breaks storybook because storybook's output
|
|
84
|
+
// assets don't match the plugin's jsAssetsFilterFunction.
|
|
85
|
+
config.plugins = config.plugins.filter((p) => {
|
|
86
|
+
const name = Array.isArray(p) ? p[0]?.name : p?.name;
|
|
87
|
+
return name !== 'vite-plugin-css-injected-by-js';
|
|
88
|
+
});
|
|
89
|
+
return config;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
const [{ default: preact }, { default: svgr }, { default: tsconfigPaths }] =
|
|
93
|
+
await Promise.all([
|
|
94
|
+
import('@preact/preset-vite'),
|
|
95
|
+
import('vite-plugin-svgr'),
|
|
96
|
+
import('vite-tsconfig-paths'),
|
|
97
|
+
]);
|
|
98
|
+
|
|
99
|
+
// Resolve @adobe-commerce/elsie/* imports to absolute filesystem paths.
|
|
100
|
+
// vite-tsconfig-paths handles @adobe-commerce/elsie/* for host project files;
|
|
101
|
+
// these aliases cover imports originating from inside node_modules, which
|
|
102
|
+
// vite-tsconfig-paths skips by design.
|
|
103
|
+
const elsieRoot = path.resolve(__dirname, '../..');
|
|
104
|
+
|
|
105
|
+
config.resolve = {
|
|
106
|
+
...config.resolve,
|
|
107
|
+
alias: [
|
|
108
|
+
...(Array.isArray(config.resolve?.alias)
|
|
109
|
+
? config.resolve.alias
|
|
110
|
+
: Object.entries(config.resolve?.alias ?? {}).map(
|
|
111
|
+
([find, replacement]) => ({ find, replacement })
|
|
112
|
+
)),
|
|
113
|
+
{
|
|
114
|
+
find: /^@adobe-commerce\/elsie\/src(.*)$/,
|
|
115
|
+
replacement: `${elsieRoot}/src$1`,
|
|
59
116
|
},
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
test: /\.(mjs|tsx?|jsx?)$/,
|
|
75
|
-
loader: 'babel-loader',
|
|
76
|
-
exclude: {
|
|
77
|
-
and: [/node_modules/],
|
|
78
|
-
not: [/@adobe-commerce/],
|
|
79
|
-
},
|
|
80
|
-
options: {
|
|
81
|
-
presets: [
|
|
82
|
-
['@babel/preset-env'],
|
|
83
|
-
['@babel/preset-typescript', { jsxPragma: 'h' }],
|
|
84
|
-
],
|
|
85
|
-
plugins: [
|
|
86
|
-
['babel-plugin-tsconfig-paths'],
|
|
87
|
-
['@babel/transform-react-jsx', { runtime: 'automatic' }],
|
|
88
|
-
],
|
|
89
|
-
},
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
// Return the altered config
|
|
93
|
-
return config;
|
|
94
|
-
},
|
|
95
|
-
|
|
96
|
-
babel: async (config) => {
|
|
97
|
-
config.cacheDirectory = false;
|
|
117
|
+
{
|
|
118
|
+
find: /^@adobe-commerce\/elsie\/config(.*)$/,
|
|
119
|
+
replacement: `${elsieRoot}/config$1`,
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
find: /^@adobe-commerce\/elsie\/static(.*)$/,
|
|
123
|
+
replacement: `${elsieRoot}/static$1`,
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
find: /^@adobe-commerce\/elsie(.*)$/,
|
|
127
|
+
replacement: `${elsieRoot}/src$1`,
|
|
128
|
+
},
|
|
129
|
+
],
|
|
130
|
+
};
|
|
98
131
|
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
132
|
+
// Vite's dependency optimizer (pre-bundling of node_modules) runs its own
|
|
133
|
+
// esbuild instance that does NOT inherit the config.esbuild settings above.
|
|
134
|
+
// Without this, .tsx files from node_modules (e.g. @adobe-commerce/elsie/src)
|
|
135
|
+
// are compiled with the classic JSX transform, emitting React.createElement()
|
|
136
|
+
// calls that fail at runtime because React is not in scope.
|
|
137
|
+
const sbComponentsDir = path.resolve(__dirname, './components');
|
|
138
|
+
const sbComponentEntries = fs
|
|
139
|
+
.readdirSync(sbComponentsDir)
|
|
140
|
+
.filter((entry) =>
|
|
141
|
+
fs.statSync(path.join(sbComponentsDir, entry)).isDirectory()
|
|
142
|
+
)
|
|
143
|
+
.map(
|
|
144
|
+
(name) => `@adobe-commerce/elsie/config/storybook/components/${name}`
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
config.optimizeDeps = {
|
|
148
|
+
...config.optimizeDeps,
|
|
149
|
+
esbuildOptions: {
|
|
150
|
+
...config.optimizeDeps?.esbuildOptions,
|
|
151
|
+
jsx: 'automatic',
|
|
152
|
+
},
|
|
153
|
+
include: [
|
|
154
|
+
...(config.optimizeDeps?.include ?? []),
|
|
155
|
+
'@adobe-commerce/elsie/components',
|
|
156
|
+
'@adobe-commerce/elsie/icons',
|
|
157
|
+
'@adobe-commerce/elsie/icons/index',
|
|
158
|
+
'@adobe-commerce/elsie/lib',
|
|
159
|
+
'@adobe-commerce/elsie/lib/classes',
|
|
160
|
+
'@adobe-commerce/elsie/static/assets/images',
|
|
161
|
+
...sbComponentEntries,
|
|
162
|
+
],
|
|
163
|
+
};
|
|
103
164
|
|
|
104
165
|
config.plugins = [
|
|
105
|
-
[
|
|
106
|
-
|
|
166
|
+
...(config.plugins ?? []),
|
|
167
|
+
tsconfigPaths(),
|
|
168
|
+
preact(),
|
|
169
|
+
svgr({ include: '**/*.svg' }),
|
|
107
170
|
];
|
|
108
171
|
|
|
109
172
|
return config;
|
|
@@ -127,4 +190,4 @@ module.exports = {
|
|
|
127
190
|
autodocs: 'tag',
|
|
128
191
|
defaultName: 'Overview',
|
|
129
192
|
}),
|
|
130
|
-
};
|
|
193
|
+
});
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
import { Unstyled } from '@storybook/blocks';
|
|
10
|
+
import { Unstyled } from '@storybook/addon-docs/blocks';
|
|
11
11
|
import styles from './Steps.module.css';
|
|
12
12
|
|
|
13
13
|
export function Steps({ children }) {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
import { Unstyled } from '@storybook/blocks';
|
|
10
|
+
import { Unstyled } from '@storybook/addon-docs/blocks';
|
|
11
11
|
import styles from './Summary.module.css';
|
|
12
12
|
|
|
13
13
|
export function Summary({ children }) {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { useState } from 'preact/hooks';
|
|
11
|
-
import { useOf, Story, Source } from '@storybook/blocks';
|
|
11
|
+
import { useOf, Story, Source } from '@storybook/addon-docs/blocks';
|
|
12
12
|
import './docs.css';
|
|
13
13
|
|
|
14
14
|
export const Variants = ({ of, storyOrder = [] }) => {
|
|
@@ -2,27 +2,17 @@
|
|
|
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 './Video.module.css';
|
|
11
|
+
|
|
12
|
+
export function Video({ src }) {
|
|
11
13
|
return (
|
|
12
|
-
<video
|
|
13
|
-
muted
|
|
14
|
-
autoPlay
|
|
15
|
-
playsInline
|
|
16
|
-
loop
|
|
17
|
-
controls
|
|
18
|
-
style={{
|
|
19
|
-
marginTop: '6px',
|
|
20
|
-
borderRadius: '0.5rem',
|
|
21
|
-
border: '1px solid',
|
|
22
|
-
borderColor: 'dark:border-zinc-800',
|
|
23
|
-
}}
|
|
24
|
-
>
|
|
14
|
+
<video muted autoPlay playsInline loop controls className={styles.video}>
|
|
25
15
|
<source src={src} type="video/mp4" />
|
|
26
16
|
</video>
|
|
27
|
-
)
|
|
17
|
+
);
|
|
28
18
|
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
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.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
.video {
|
|
11
|
+
margin-top: 6px;
|
|
12
|
+
border-radius: 0.5rem;
|
|
13
|
+
border: 1px solid rgb(234, 237, 242);
|
|
14
|
+
width: 100%;
|
|
15
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
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.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/Video/Video';
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
import { addons } from '
|
|
10
|
+
import { addons } from 'storybook/manager-api';
|
|
11
11
|
import theme from './theming/theme';
|
|
12
12
|
import './theming/manager.css';
|
|
13
13
|
|
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
import { create } from '
|
|
10
|
+
import { create } from 'storybook/theming';
|
|
11
11
|
|
|
12
|
-
import logo from './logo.svg';
|
|
12
|
+
import logo from './logo.svg?url';
|
|
13
13
|
import './fonts.css';
|
|
14
14
|
|
|
15
15
|
/**
|