@adobe-commerce/elsie 1.9.0-alpha-20260515103751 → 1.9.0-beta.0
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 +1 -12
- package/bin/index.js +0 -5
- package/config/tsconfig-base.json +1 -2
- package/package.json +10 -10
- package/src/components/Accordion/Accordion.stories.tsx +1 -1
- package/src/components/Accordion/Accordion.tsx +3 -4
- package/src/components/ActionButtonGroup/ActionButtonGroup.tsx +2 -1
- package/src/components/Header/Header.stories.tsx +8 -10
- package/src/components/Icon/Icon.stories.helpers.jsx +0 -1
- package/src/components/Incrementer/Incrementer.tsx +48 -67
- package/src/components/InputDate/InputDate.tsx +23 -22
- package/src/components/InputPassword/InputPassword.tsx +1 -1
- package/src/components/Modal/Modal.stories.tsx +1 -1
- package/src/components/Picker/Picker.stories.tsx +4 -5
- package/src/components/ProgressSpinner/ProgressSpinner.stories.tsx +5 -9
- package/src/components/Tag/Tag.stories.tsx +4 -8
- package/src/components/TextArea/TextArea.stories.tsx +8 -14
- package/src/components/UIProvider/UIProvider.tsx +3 -5
- package/types/icons.d.ts +0 -10
- package/bin/builders/tsc/index.js +0 -40
- package/bin/builders/tsc/validate-tsconfig.js +0 -87
- package/types/react.d.ts +0 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @adobe-commerce/elsie
|
|
2
2
|
|
|
3
|
-
## 1.9.0-
|
|
3
|
+
## 1.9.0-beta.0
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
@@ -12,17 +12,6 @@
|
|
|
12
12
|
|
|
13
13
|
Drop-ins must be rebuilt against this release to get the reduced request footprint. No source changes are required.
|
|
14
14
|
|
|
15
|
-
- b9e4104: Upgrade TypeScript from 4.7 to 6.0
|
|
16
|
-
|
|
17
|
-
- Upgraded `typescript` from `^4.7.3` to `^6.0.3`
|
|
18
|
-
- Upgraded `@typescript-eslint/parser` and `@typescript-eslint/eslint-plugin` from `^5.32.0` to `^8.59.3`
|
|
19
|
-
- Upgraded `vite-plugin-dts` from `^3.9.1` to `^4.5.4`
|
|
20
|
-
- Fixed tsconfig breaking changes: `moduleResolution: "node"` → `"bundler"` (recaptcha), explicit `types` arrays, `skipLibCheck: true` (elsie), `rootDir` (fetch-graphql)
|
|
21
|
-
- Retained `baseUrl` in elsie tsconfig with `ignoreDeprecations: "6.0"` for `babel-plugin-tsconfig-paths` compatibility (Storybook build)
|
|
22
|
-
- Fixed ~65 source-level type errors across all packages (stricter inference in TS6)
|
|
23
|
-
- `AccordionSectionProps`: `title` is now an explicit required `ComponentChildren` prop (was inherited as optional `string` from `HTMLAttributes`); `ariaLabelTitle` is now optional
|
|
24
|
-
- Added `elsie tsc [--config <path>]` CLI command to validate `tsconfig.json` for TS6 incompatible/deprecated settings and run `tsc --noEmit` using the consumer's local TypeScript
|
|
25
|
-
|
|
26
15
|
## 1.8.1
|
|
27
16
|
|
|
28
17
|
### Patch Changes
|
package/bin/index.js
CHANGED
|
@@ -15,11 +15,6 @@ 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
|
-
'tsc',
|
|
20
|
-
'Type-check with TypeScript and validate tsconfig for TS6 compatibility',
|
|
21
|
-
require('./builders/tsc')
|
|
22
|
-
)
|
|
23
18
|
.command(
|
|
24
19
|
'generate',
|
|
25
20
|
'Generate a new <resource>',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@adobe-commerce/elsie",
|
|
3
|
-
"version": "1.9.0-
|
|
3
|
+
"version": "1.9.0-beta.0",
|
|
4
4
|
"license": "SEE LICENSE IN LICENSE.md",
|
|
5
5
|
"description": "Domain Package SDK",
|
|
6
6
|
"engines": {
|
|
@@ -28,11 +28,11 @@
|
|
|
28
28
|
"postpublish": "node ./scripts/publish-tools.mjs"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"@adobe-commerce/event-bus": "1.1.0-
|
|
32
|
-
"@adobe-commerce/fetch-graphql": "1.3.0-
|
|
33
|
-
"@adobe-commerce/recaptcha": "1.2.0-
|
|
34
|
-
"@adobe-commerce/storefront-design": "1.1.0-
|
|
35
|
-
"@dropins/build-tools": "1.2.0-
|
|
31
|
+
"@adobe-commerce/event-bus": "~1.1.0-beta.0",
|
|
32
|
+
"@adobe-commerce/fetch-graphql": "~1.3.0-beta.0",
|
|
33
|
+
"@adobe-commerce/recaptcha": "1.2.0-beta.0",
|
|
34
|
+
"@adobe-commerce/storefront-design": "~1.1.0-beta.0",
|
|
35
|
+
"@dropins/build-tools": "~1.2.0-beta.0",
|
|
36
36
|
"preact": "~10.22.1",
|
|
37
37
|
"vite-plugin-banner": "^0.8.0"
|
|
38
38
|
},
|
|
@@ -69,8 +69,8 @@
|
|
|
69
69
|
"@types/css-modules": "^1.0.2",
|
|
70
70
|
"@types/jest": "^29.5.12",
|
|
71
71
|
"@types/preact-i18n": "^2.3.1",
|
|
72
|
-
"@typescript-eslint/eslint-plugin": "^
|
|
73
|
-
"@typescript-eslint/parser": "^
|
|
72
|
+
"@typescript-eslint/eslint-plugin": "^5.32.0",
|
|
73
|
+
"@typescript-eslint/parser": "^5.32.0",
|
|
74
74
|
"axe-playwright": "^2.0.1",
|
|
75
75
|
"babel-jest": "^29.7.0",
|
|
76
76
|
"babel-loader": "^9.1.3",
|
|
@@ -103,11 +103,11 @@
|
|
|
103
103
|
"rimraf": "^3.0.2",
|
|
104
104
|
"rollup-plugin-visualizer": "^5.12.0",
|
|
105
105
|
"storybook": "^8.2.3",
|
|
106
|
-
"typescript": "^
|
|
106
|
+
"typescript": "^4.7.3",
|
|
107
107
|
"vite": "^5.2.10",
|
|
108
108
|
"vite-plugin-banner": "^0.8.0",
|
|
109
109
|
"vite-plugin-css-injected-by-js": "^3.5.1",
|
|
110
|
-
"vite-plugin-dts": "^
|
|
110
|
+
"vite-plugin-dts": "^3.9.1",
|
|
111
111
|
"vite-plugin-svgr": "^4.2.0",
|
|
112
112
|
"vite-tsconfig-paths": "^4.3.2",
|
|
113
113
|
"webpack": "^5.93.0",
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
11
11
|
import { HTMLAttributes, useState, useEffect } from 'preact/compat';
|
|
12
12
|
import { classes } from '@adobe-commerce/elsie/lib';
|
|
13
13
|
import { Divider, Icon, IconNode } from '@adobe-commerce/elsie/components';
|
|
@@ -15,11 +15,10 @@ import { Add, Minus } from '@adobe-commerce/elsie/icons';
|
|
|
15
15
|
import { useText } from '@adobe-commerce/elsie/i18n';
|
|
16
16
|
import '@adobe-commerce/elsie/components/Accordion/Accordion.css';
|
|
17
17
|
export interface AccordionSectionProps
|
|
18
|
-
extends Omit<HTMLAttributes<HTMLDivElement>, 'icon'
|
|
19
|
-
title: ComponentChildren;
|
|
18
|
+
extends Omit<HTMLAttributes<HTMLDivElement>, 'icon'> {
|
|
20
19
|
defaultOpen?: boolean;
|
|
21
20
|
actionIconPosition?: 'left' | 'right';
|
|
22
|
-
ariaLabelTitle
|
|
21
|
+
ariaLabelTitle: string;
|
|
23
22
|
iconOpen?: IconNode;
|
|
24
23
|
iconClose?: IconNode;
|
|
25
24
|
iconLeft?: IconNode;
|
|
@@ -8,10 +8,11 @@
|
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
10
|
import { FunctionComponent, VNode, cloneElement } from 'preact';
|
|
11
|
-
import {
|
|
11
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
12
12
|
import { classes } from '@adobe-commerce/elsie/lib';
|
|
13
13
|
import '@adobe-commerce/elsie/components/ActionButtonGroup/ActionButtonGroup.css';
|
|
14
14
|
import { useCallback, useState } from 'preact/hooks';
|
|
15
|
+
import { Children } from 'react';
|
|
15
16
|
import { ActionButtonProps } from '@adobe-commerce/elsie/components/ActionButton';
|
|
16
17
|
|
|
17
18
|
export interface ActionButtonGroupOption {
|
|
@@ -78,9 +78,7 @@ export default {
|
|
|
78
78
|
},
|
|
79
79
|
} as Meta<HeaderProps>;
|
|
80
80
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
const Template: Story = {
|
|
81
|
+
const Template: StoryObj<HeaderProps> = {
|
|
84
82
|
render: (args) => (
|
|
85
83
|
<div style={{ maxWidth: '1200px', padding: '40px' }}>
|
|
86
84
|
<Header {...args} />
|
|
@@ -88,7 +86,7 @@ const Template: Story = {
|
|
|
88
86
|
),
|
|
89
87
|
};
|
|
90
88
|
|
|
91
|
-
export const MediumSize
|
|
89
|
+
export const MediumSize = {
|
|
92
90
|
...Template,
|
|
93
91
|
parameters: {
|
|
94
92
|
layout: 'fullscreen',
|
|
@@ -104,7 +102,7 @@ export const MediumSize: Story = {
|
|
|
104
102
|
),
|
|
105
103
|
level: 2,
|
|
106
104
|
},
|
|
107
|
-
play: async ({ canvasElement }
|
|
105
|
+
play: async ({ canvasElement }) => {
|
|
108
106
|
const canvas = within(canvasElement);
|
|
109
107
|
|
|
110
108
|
await expect(canvas.getByText('Print order details')).toBeInTheDocument();
|
|
@@ -116,7 +114,7 @@ export const MediumSize: Story = {
|
|
|
116
114
|
},
|
|
117
115
|
};
|
|
118
116
|
|
|
119
|
-
export const LargeSize
|
|
117
|
+
export const LargeSize = {
|
|
120
118
|
...Template,
|
|
121
119
|
parameters: {
|
|
122
120
|
layout: 'fullscreen',
|
|
@@ -130,7 +128,7 @@ export const LargeSize: Story = {
|
|
|
130
128
|
},
|
|
131
129
|
};
|
|
132
130
|
|
|
133
|
-
export const WithoutLine
|
|
131
|
+
export const WithoutLine = {
|
|
134
132
|
...Template,
|
|
135
133
|
parameters: {
|
|
136
134
|
layout: 'fullscreen',
|
|
@@ -144,7 +142,7 @@ export const WithoutLine: Story = {
|
|
|
144
142
|
},
|
|
145
143
|
};
|
|
146
144
|
|
|
147
|
-
export const WithoutActions
|
|
145
|
+
export const WithoutActions = {
|
|
148
146
|
...Template,
|
|
149
147
|
parameters: {
|
|
150
148
|
layout: 'fullscreen',
|
|
@@ -153,13 +151,13 @@ export const WithoutActions: Story = {
|
|
|
153
151
|
title: 'Order complete',
|
|
154
152
|
size: 'medium',
|
|
155
153
|
divider: false,
|
|
156
|
-
cta:
|
|
154
|
+
cta: null,
|
|
157
155
|
level: 2,
|
|
158
156
|
},
|
|
159
157
|
};
|
|
160
158
|
|
|
161
159
|
|
|
162
|
-
export const HeadingLevels
|
|
160
|
+
export const HeadingLevels = {
|
|
163
161
|
...Template,
|
|
164
162
|
parameters: {
|
|
165
163
|
layout: 'fullscreen',
|
|
@@ -12,7 +12,6 @@ import { Icon } from './Icon';
|
|
|
12
12
|
|
|
13
13
|
const iconNames = Object.keys(Icons);
|
|
14
14
|
|
|
15
|
-
/** @type {Record<string, import('preact').VNode | null>} */
|
|
16
15
|
export const IconsList = iconNames.reduce(
|
|
17
16
|
(acc, name) => {
|
|
18
17
|
acc[name] = <Icon key={name} source={Icons[name]} size="24" stroke="1" />;
|
|
@@ -89,58 +89,6 @@ export const Incrementer: FunctionComponent<IncrementerProps> = ({
|
|
|
89
89
|
setCurrentValue(newValue);
|
|
90
90
|
};
|
|
91
91
|
|
|
92
|
-
const decrementButton = (
|
|
93
|
-
<button
|
|
94
|
-
type="button"
|
|
95
|
-
className={classes([
|
|
96
|
-
'dropin-incrementer__decrease-button',
|
|
97
|
-
[`dropin-incrementer__decrease-button--disabled`, disabled],
|
|
98
|
-
])}
|
|
99
|
-
onClick={() => handleIncrementer(currentValue - 1)}
|
|
100
|
-
disabled={disabled || currentValue < minValue + 1}
|
|
101
|
-
aria-label={
|
|
102
|
-
(
|
|
103
|
-
// @ts-expect-error - preact-i18n Text JSX types are incompatible with TS6, but render a localized string at runtime.
|
|
104
|
-
<Text id="Dropin.Incrementer.decreaseLabel" />
|
|
105
|
-
) as unknown as string
|
|
106
|
-
}
|
|
107
|
-
>
|
|
108
|
-
<Icon
|
|
109
|
-
source={Minus}
|
|
110
|
-
size="16"
|
|
111
|
-
stroke="1"
|
|
112
|
-
viewBox="4 2 20 20"
|
|
113
|
-
className="dropin-incrementer__down"
|
|
114
|
-
/>
|
|
115
|
-
</button>
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
const incrementButton = (
|
|
119
|
-
<button
|
|
120
|
-
type="button"
|
|
121
|
-
className={classes([
|
|
122
|
-
'dropin-incrementer__increase-button',
|
|
123
|
-
[`dropin-incrementer__increase-button--disabled`, disabled],
|
|
124
|
-
])}
|
|
125
|
-
onClick={() => handleIncrementer(currentValue + 1)}
|
|
126
|
-
disabled={disabled || currentValue > maxValue - 1}
|
|
127
|
-
aria-label={
|
|
128
|
-
(
|
|
129
|
-
// @ts-expect-error - preact-i18n Text JSX types are incompatible with TS6, but render a localized string at runtime.
|
|
130
|
-
<Text id="Dropin.Incrementer.increaseLabel" />
|
|
131
|
-
) as unknown as string
|
|
132
|
-
}
|
|
133
|
-
>
|
|
134
|
-
<Icon
|
|
135
|
-
source={Add}
|
|
136
|
-
size="16"
|
|
137
|
-
stroke="1"
|
|
138
|
-
viewBox="4 2 20 20"
|
|
139
|
-
className="dropin-incrementer__add"
|
|
140
|
-
/>
|
|
141
|
-
</button>
|
|
142
|
-
);
|
|
143
|
-
|
|
144
92
|
return (
|
|
145
93
|
<div
|
|
146
94
|
className={classes([
|
|
@@ -167,10 +115,28 @@ export const Incrementer: FunctionComponent<IncrementerProps> = ({
|
|
|
167
115
|
[`dropin-incrementer__button-container--disabled`, disabled],
|
|
168
116
|
])}
|
|
169
117
|
>
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
118
|
+
<Localizer>
|
|
119
|
+
<button
|
|
120
|
+
type="button"
|
|
121
|
+
className={classes([
|
|
122
|
+
'dropin-incrementer__decrease-button',
|
|
123
|
+
[`dropin-incrementer__decrease-button--disabled`, disabled],
|
|
124
|
+
])}
|
|
125
|
+
onClick={() => handleIncrementer(currentValue - 1)}
|
|
126
|
+
disabled={disabled || currentValue < minValue + 1}
|
|
127
|
+
aria-label={
|
|
128
|
+
(<Text id="Dropin.Incrementer.decreaseLabel" />) as any
|
|
129
|
+
}
|
|
130
|
+
>
|
|
131
|
+
<Icon
|
|
132
|
+
source={Minus}
|
|
133
|
+
size="16"
|
|
134
|
+
stroke="1"
|
|
135
|
+
viewBox="4 2 20 20"
|
|
136
|
+
className="dropin-incrementer__down"
|
|
137
|
+
/>
|
|
138
|
+
</button>
|
|
139
|
+
</Localizer>
|
|
174
140
|
</div>
|
|
175
141
|
)}
|
|
176
142
|
|
|
@@ -204,22 +170,37 @@ export const Incrementer: FunctionComponent<IncrementerProps> = ({
|
|
|
204
170
|
])}
|
|
205
171
|
>
|
|
206
172
|
{/* Plus/Add button */}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
173
|
+
<Localizer>
|
|
174
|
+
<button
|
|
175
|
+
type="button"
|
|
176
|
+
className={classes([
|
|
177
|
+
'dropin-incrementer__increase-button',
|
|
178
|
+
[`dropin-incrementer__increase-button--disabled`, disabled],
|
|
179
|
+
])}
|
|
180
|
+
onClick={() => handleIncrementer(currentValue + 1)}
|
|
181
|
+
disabled={disabled || currentValue > maxValue - 1}
|
|
182
|
+
aria-label={
|
|
183
|
+
(<Text id="Dropin.Incrementer.increaseLabel" />) as any
|
|
184
|
+
}
|
|
185
|
+
>
|
|
186
|
+
<Icon
|
|
187
|
+
source={Add}
|
|
188
|
+
size="16"
|
|
189
|
+
stroke="1"
|
|
190
|
+
viewBox="4 2 20 20"
|
|
191
|
+
className="dropin-incrementer__add"
|
|
192
|
+
/>
|
|
193
|
+
</button>
|
|
194
|
+
</Localizer>
|
|
211
195
|
</div>
|
|
212
196
|
)}
|
|
213
197
|
</div>
|
|
214
198
|
{isInvalid && (
|
|
215
199
|
<p className="dropin-incrementer__content--error-message">
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
fields={{ minQuantity: min, maxQuantity: max }}
|
|
221
|
-
/>
|
|
222
|
-
}
|
|
200
|
+
<Text
|
|
201
|
+
id={errorMessage}
|
|
202
|
+
fields={{ minQuantity: min, maxQuantity: max }}
|
|
203
|
+
/>
|
|
223
204
|
</p>
|
|
224
205
|
)}
|
|
225
206
|
</div>
|
|
@@ -7,14 +7,16 @@
|
|
|
7
7
|
* accompanying it.
|
|
8
8
|
*******************************************************************/
|
|
9
9
|
|
|
10
|
+
import { FunctionComponent } from 'preact';
|
|
11
|
+
import { useRef, useState } from 'preact/hooks';
|
|
12
|
+
import { classes, isIOSMobileDevice } from '@adobe-commerce/elsie/lib';
|
|
13
|
+
import { JSX } from 'preact/compat';
|
|
10
14
|
import { Field, Icon, Input, InputProps } from '@adobe-commerce/elsie/components';
|
|
11
|
-
import { useText } from '@adobe-commerce/elsie/i18n';
|
|
12
15
|
import { Date } from '@adobe-commerce/elsie/icons';
|
|
13
|
-
import {
|
|
14
|
-
import { FunctionComponent, JSX } from 'preact';
|
|
15
|
-
import { useCallback, useRef, useState } from 'preact/hooks';
|
|
16
|
+
import { useText } from '@adobe-commerce/elsie/i18n';
|
|
16
17
|
|
|
17
18
|
import '@adobe-commerce/elsie/components/InputDate/InputDate.css';
|
|
19
|
+
import { useCallback } from 'react';
|
|
18
20
|
|
|
19
21
|
export interface InputDateProps extends Omit<InputProps, 'error' | 'value'> {
|
|
20
22
|
label?: string;
|
|
@@ -38,43 +40,42 @@ export const InputDate: FunctionComponent<InputDateProps> = ({
|
|
|
38
40
|
picker: 'Dropin.InputDate.picker',
|
|
39
41
|
});
|
|
40
42
|
|
|
41
|
-
const handleOnFocus = useCallback(
|
|
42
|
-
(event
|
|
43
|
+
const handleOnFocus: JSX.MouseEventHandler<HTMLInputElement> = useCallback(
|
|
44
|
+
(event) => {
|
|
43
45
|
event.currentTarget.setAttribute('type', 'date');
|
|
44
46
|
|
|
45
|
-
if (!isIOSMobileDevice()
|
|
47
|
+
if (!isIOSMobileDevice()) return;
|
|
46
48
|
|
|
47
49
|
iosInputRef.current.focus();
|
|
48
50
|
},
|
|
49
51
|
[]
|
|
50
52
|
);
|
|
51
53
|
|
|
52
|
-
const handleOnClick = useCallback(
|
|
53
|
-
(event
|
|
54
|
-
const input = event.currentTarget.parentElement?.querySelector(
|
|
55
|
-
'input'
|
|
56
|
-
) as HTMLInputElement | null;
|
|
54
|
+
const handleOnClick: JSX.MouseEventHandler<HTMLButtonElement> = useCallback(
|
|
55
|
+
(event) => {
|
|
56
|
+
const input = event.currentTarget.parentElement?.querySelector('input');
|
|
57
57
|
input?.focus();
|
|
58
|
-
input?.showPicker
|
|
58
|
+
input?.showPicker();
|
|
59
59
|
},
|
|
60
60
|
[]
|
|
61
61
|
);
|
|
62
62
|
|
|
63
|
-
const handleOnBlur = useCallback(
|
|
64
|
-
(event
|
|
63
|
+
const handleOnBlur: JSX.MouseEventHandler<HTMLInputElement> = useCallback(
|
|
64
|
+
(event) => {
|
|
65
65
|
event.currentTarget.setAttribute('type', 'text');
|
|
66
66
|
onBlur?.(event);
|
|
67
67
|
},
|
|
68
68
|
[onBlur]
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
-
const handleInputChange =
|
|
72
|
-
(
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
71
|
+
const handleInputChange: JSX.MouseEventHandler<HTMLInputElement> =
|
|
72
|
+
useCallback(
|
|
73
|
+
(event) => {
|
|
74
|
+
setInternalValue(event.target.value);
|
|
75
|
+
onChange?.(event);
|
|
76
|
+
},
|
|
77
|
+
[onChange]
|
|
78
|
+
);
|
|
78
79
|
|
|
79
80
|
return (
|
|
80
81
|
<div className={classes(['dropin-input-date'])}>
|
|
@@ -61,11 +61,10 @@ const meta: Meta<PickerProps> = {
|
|
|
61
61
|
},
|
|
62
62
|
defaultOption: {
|
|
63
63
|
description: 'Default available option from the options array',
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
},
|
|
64
|
+
type: {
|
|
65
|
+
required: false,
|
|
66
|
+
/* @ts-ignore */
|
|
67
|
+
name: 'object',
|
|
69
68
|
},
|
|
70
69
|
},
|
|
71
70
|
error: {
|
|
@@ -20,16 +20,12 @@ import { ActionButton, Button, Card, Icon, RadioButton, ImageSwatch } from '..';
|
|
|
20
20
|
/**
|
|
21
21
|
* Use Progress Spinners to display ongoing activity or loading status.
|
|
22
22
|
*/
|
|
23
|
-
|
|
24
|
-
active?: boolean;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const meta: Meta<StoryProps> = {
|
|
23
|
+
const meta: Meta<ProgressSpinnerProps> = {
|
|
28
24
|
title: 'Components/ProgressSpinner',
|
|
29
25
|
component,
|
|
30
26
|
argTypes: {
|
|
31
27
|
size: {
|
|
32
|
-
|
|
28
|
+
type: 'select',
|
|
33
29
|
table: {
|
|
34
30
|
defaultValue: {
|
|
35
31
|
summary: 'small',
|
|
@@ -39,7 +35,7 @@ const meta: Meta<StoryProps> = {
|
|
|
39
35
|
description: 'Size of the spinner',
|
|
40
36
|
},
|
|
41
37
|
stroke: {
|
|
42
|
-
|
|
38
|
+
type: 'select',
|
|
43
39
|
table: {
|
|
44
40
|
defaultValue: {
|
|
45
41
|
summary: '4',
|
|
@@ -49,7 +45,7 @@ const meta: Meta<StoryProps> = {
|
|
|
49
45
|
description: 'Stroke of the spinner',
|
|
50
46
|
},
|
|
51
47
|
active: {
|
|
52
|
-
|
|
48
|
+
type: 'boolean',
|
|
53
49
|
table: {
|
|
54
50
|
defaultValue: {
|
|
55
51
|
summary: 'true',
|
|
@@ -76,7 +72,7 @@ const meta: Meta<StoryProps> = {
|
|
|
76
72
|
|
|
77
73
|
export default meta;
|
|
78
74
|
|
|
79
|
-
type Story = StoryObj<
|
|
75
|
+
type Story = StoryObj<ProgressSpinnerProps>;
|
|
80
76
|
|
|
81
77
|
/**
|
|
82
78
|
* ```ts
|
|
@@ -43,11 +43,7 @@ export default {
|
|
|
43
43
|
},
|
|
44
44
|
} as Meta<any>; // Using "any" as a workaround to accommodate the string type for the children prop
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
children?: string;
|
|
48
|
-
};
|
|
49
|
-
|
|
50
|
-
const Template: StoryObj<StoryArgs> = {
|
|
46
|
+
const Template: StoryObj<TagProps> = {
|
|
51
47
|
render: (args) => (
|
|
52
48
|
<Tag {...args}>
|
|
53
49
|
{/* This workaround allows children to be edited as plain text in Storybook */}
|
|
@@ -59,7 +55,7 @@ const Template: StoryObj<StoryArgs> = {
|
|
|
59
55
|
),
|
|
60
56
|
};
|
|
61
57
|
|
|
62
|
-
type Story = StoryObj<
|
|
58
|
+
type Story = StoryObj<TagProps>;
|
|
63
59
|
|
|
64
60
|
export const Default: Story = {
|
|
65
61
|
...Template,
|
|
@@ -75,7 +71,7 @@ export const Default: Story = {
|
|
|
75
71
|
},
|
|
76
72
|
};
|
|
77
73
|
|
|
78
|
-
export const WithUppercase
|
|
74
|
+
export const WithUppercase = {
|
|
79
75
|
...Template,
|
|
80
76
|
args: { label: 'SHIPPING' },
|
|
81
77
|
play: async () => {
|
|
@@ -89,7 +85,7 @@ export const WithUppercase: Story = {
|
|
|
89
85
|
},
|
|
90
86
|
};
|
|
91
87
|
|
|
92
|
-
export const WithChildren
|
|
88
|
+
export const WithChildren = {
|
|
93
89
|
...Template,
|
|
94
90
|
args: {
|
|
95
91
|
label: '',
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
|
|
10
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
11
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
12
|
-
import { JSX } from 'preact';
|
|
13
12
|
import { TextArea, TextAreaProps } from '@adobe-commerce/elsie/components/TextArea';
|
|
14
13
|
import { expect, userEvent, within } from '@storybook/test';
|
|
15
14
|
import { useState, useCallback } from 'preact/hooks';
|
|
@@ -72,24 +71,19 @@ export default {
|
|
|
72
71
|
},
|
|
73
72
|
} as Meta<TextAreaProps>;
|
|
74
73
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const Template: Story = {
|
|
74
|
+
const Template: StoryObj<TextAreaProps> = {
|
|
78
75
|
render: (args) => {
|
|
79
76
|
const [value, setValue] = useState(args.value);
|
|
80
77
|
|
|
81
|
-
const setTextAreaValue = useCallback(
|
|
82
|
-
(event
|
|
83
|
-
|
|
84
|
-
},
|
|
85
|
-
[]
|
|
86
|
-
);
|
|
78
|
+
const setTextAreaValue = useCallback((event) => {
|
|
79
|
+
setValue(event.target.value);
|
|
80
|
+
}, []);
|
|
87
81
|
|
|
88
82
|
return <TextArea {...args} value={value} onChange={setTextAreaValue} />;
|
|
89
83
|
},
|
|
90
84
|
};
|
|
91
85
|
|
|
92
|
-
export const DefaultWithValue
|
|
86
|
+
export const DefaultWithValue = {
|
|
93
87
|
...Template,
|
|
94
88
|
parameters: {
|
|
95
89
|
layout: 'centered',
|
|
@@ -104,9 +98,9 @@ export const DefaultWithValue: Story = {
|
|
|
104
98
|
name: 'message',
|
|
105
99
|
value: 'Initial',
|
|
106
100
|
},
|
|
107
|
-
play: async ({ canvasElement }
|
|
101
|
+
play: async ({ canvasElement }) => {
|
|
108
102
|
const canvas = within(canvasElement);
|
|
109
|
-
const inputField = document.querySelector('textarea') as
|
|
103
|
+
const inputField = document.querySelector('textarea') as HTMLElement;
|
|
110
104
|
await userEvent.type(inputField, ' Storybook Test Text! input max length');
|
|
111
105
|
await expect(
|
|
112
106
|
await canvas.findByDisplayValue(
|
|
@@ -118,7 +112,7 @@ export const DefaultWithValue: Story = {
|
|
|
118
112
|
},
|
|
119
113
|
};
|
|
120
114
|
|
|
121
|
-
export const WithError
|
|
115
|
+
export const WithError = {
|
|
122
116
|
...Template,
|
|
123
117
|
parameters: {
|
|
124
118
|
layout: 'centered',
|
|
@@ -48,14 +48,12 @@ export const UIProvider: FunctionComponent<UIProviderProps> = ({
|
|
|
48
48
|
}, [lang, langDefinitions]);
|
|
49
49
|
|
|
50
50
|
const locale = lang.replace('_', '-');
|
|
51
|
-
const providerChildren = <>{children}</>;
|
|
52
51
|
|
|
53
52
|
return (
|
|
54
53
|
<UIContext.Provider value={{ locale }}>
|
|
55
|
-
{
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
54
|
+
<IntlProvider definition={definitions}>
|
|
55
|
+
<>{children}</>
|
|
56
|
+
</IntlProvider>
|
|
59
57
|
</UIContext.Provider>
|
|
60
58
|
);
|
|
61
59
|
};
|
package/types/icons.d.ts
CHANGED
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* Copyright 2025 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
|
-
const path = require('path');
|
|
11
|
-
const cli = require('../../lib/cli');
|
|
12
|
-
const logMessage = require('../../lib/log-message');
|
|
13
|
-
const validateTsconfig = require('./validate-tsconfig');
|
|
14
|
-
|
|
15
|
-
module.exports = async function tscBuilder({ argv } = {}) {
|
|
16
|
-
const configPath =
|
|
17
|
-
argv?.config
|
|
18
|
-
? path.resolve(process.cwd(), argv.config)
|
|
19
|
-
: path.resolve(process.cwd(), 'tsconfig.json');
|
|
20
|
-
|
|
21
|
-
const { errors, warnings } = validateTsconfig(configPath);
|
|
22
|
-
|
|
23
|
-
warnings.forEach((msg) => console.warn(logMessage(msg, 'warning')));
|
|
24
|
-
|
|
25
|
-
if (errors.length > 0) {
|
|
26
|
-
errors.forEach((msg) => console.error(logMessage(msg, 'error')));
|
|
27
|
-
process.exit(1);
|
|
28
|
-
return;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const tscBin = path.resolve(process.cwd(), 'node_modules/.bin/tsc');
|
|
32
|
-
return cli(`${tscBin} --noEmit --project ${configPath}`);
|
|
33
|
-
};
|
|
34
|
-
|
|
35
|
-
module.exports.builder = (yargs) =>
|
|
36
|
-
yargs.option('config', {
|
|
37
|
-
alias: 'c',
|
|
38
|
-
describe: 'Path to tsconfig.json',
|
|
39
|
-
type: 'string',
|
|
40
|
-
});
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/********************************************************************
|
|
2
|
-
* Copyright 2025 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
|
-
const fs = require('fs');
|
|
11
|
-
const stripJsonComments = require('strip-json-comments');
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* Settings removed in TypeScript 6 — produce an error and block tsc from running.
|
|
15
|
-
* Key: compilerOption name, Value: array of invalid values (lowercase).
|
|
16
|
-
*/
|
|
17
|
-
const REMOVED_IN_TS6 = {
|
|
18
|
-
moduleResolution: ['node'],
|
|
19
|
-
target: ['es3', 'es5'],
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* Settings deprecated in TypeScript 6 — produce a warning but still run tsc.
|
|
24
|
-
* Only reported when `ignoreDeprecations` is not set.
|
|
25
|
-
*/
|
|
26
|
-
const DEPRECATED_IN_TS6 = [
|
|
27
|
-
'baseUrl',
|
|
28
|
-
'importsNotUsedAsValues',
|
|
29
|
-
'preserveValueImports',
|
|
30
|
-
'noImplicitUseStrict',
|
|
31
|
-
'suppressImplicitAnyIndexErrors',
|
|
32
|
-
'suppressExcessPropertyErrors',
|
|
33
|
-
'noStrictGenericChecks',
|
|
34
|
-
];
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Validates a tsconfig.json for TypeScript 6 compatibility.
|
|
38
|
-
*
|
|
39
|
-
* @param {string} configPath - Absolute path to the tsconfig.json file
|
|
40
|
-
* @returns {{ errors: string[], warnings: string[] }}
|
|
41
|
-
*/
|
|
42
|
-
module.exports = function validateTsconfig(configPath) {
|
|
43
|
-
const errors = [];
|
|
44
|
-
const warnings = [];
|
|
45
|
-
|
|
46
|
-
if (!fs.existsSync(configPath)) {
|
|
47
|
-
errors.push(`tsconfig not found at: ${configPath}`);
|
|
48
|
-
return { errors, warnings };
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
let tsconfig;
|
|
52
|
-
try {
|
|
53
|
-
const raw = fs.readFileSync(configPath, 'utf-8');
|
|
54
|
-
tsconfig = JSON.parse(stripJsonComments(raw));
|
|
55
|
-
} catch {
|
|
56
|
-
errors.push(`Failed to parse tsconfig at: ${configPath}`);
|
|
57
|
-
return { errors, warnings };
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
const compilerOptions = tsconfig.compilerOptions ?? {};
|
|
61
|
-
const ignoreDeprecations = compilerOptions.ignoreDeprecations;
|
|
62
|
-
|
|
63
|
-
// Check removed options
|
|
64
|
-
for (const [key, removedValues] of Object.entries(REMOVED_IN_TS6)) {
|
|
65
|
-
const value = compilerOptions[key];
|
|
66
|
-
if (value !== undefined && removedValues.includes(value.toLowerCase())) {
|
|
67
|
-
errors.push(
|
|
68
|
-
`compilerOptions.${key}: "${value}" was removed in TypeScript 6. ` +
|
|
69
|
-
`Use ${key === 'moduleResolution' ? '"nodenext" or "bundler"' : '"es2015" or later'} instead.`
|
|
70
|
-
);
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// Check deprecated options (skipped if consumer already opted in)
|
|
75
|
-
if (!ignoreDeprecations) {
|
|
76
|
-
for (const key of DEPRECATED_IN_TS6) {
|
|
77
|
-
if (compilerOptions[key] !== undefined) {
|
|
78
|
-
warnings.push(
|
|
79
|
-
`compilerOptions.${key} is deprecated in TypeScript 6 and will be removed in TS7. ` +
|
|
80
|
-
`Add "ignoreDeprecations": "6.0" to silence, or migrate away from this option.`
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
return { errors, warnings };
|
|
87
|
-
};
|
package/types/react.d.ts
DELETED