@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
|
@@ -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
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
@@ -50,7 +50,7 @@ export const Default: Story = {
|
|
|
50
50
|
const canvas = within(canvasElement);
|
|
51
51
|
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
52
52
|
await expect(await canvas.findByRole('button')).toHaveClass(
|
|
53
|
-
'dropin-action-button'
|
|
53
|
+
'dropin-action-button',
|
|
54
54
|
);
|
|
55
55
|
},
|
|
56
56
|
};
|
|
@@ -74,10 +74,10 @@ export const IconOnly: Story = {
|
|
|
74
74
|
play: async ({ canvasElement }) => {
|
|
75
75
|
const canvas = within(canvasElement);
|
|
76
76
|
const buttonIcon = document.querySelector(
|
|
77
|
-
'.dropin-action-button-icon'
|
|
77
|
+
'.dropin-action-button-icon',
|
|
78
78
|
) as HTMLElement;
|
|
79
79
|
const addIcon = document.querySelector(
|
|
80
|
-
'g[data-name="Add icon"]'
|
|
80
|
+
'g[data-name="Add icon"]',
|
|
81
81
|
) as HTMLElement;
|
|
82
82
|
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
83
83
|
await expect(await buttonIcon).toBeVisible();
|
|
@@ -102,10 +102,10 @@ export const WithIcon: Story = {
|
|
|
102
102
|
play: async ({ canvasElement }) => {
|
|
103
103
|
const canvas = within(canvasElement);
|
|
104
104
|
const buttonIcon = document.querySelector(
|
|
105
|
-
'.dropin-action-button-icon'
|
|
105
|
+
'.dropin-action-button-icon',
|
|
106
106
|
) as HTMLElement;
|
|
107
107
|
const addIcon = document.querySelector(
|
|
108
|
-
'g[data-name="Add icon"]'
|
|
108
|
+
'g[data-name="Add icon"]',
|
|
109
109
|
) as HTMLElement;
|
|
110
110
|
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
111
111
|
await expect(await buttonIcon).toBeVisible();
|
|
@@ -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 { ComponentChildren, FunctionComponent, VNode } from 'preact';
|
|
@@ -12,8 +12,10 @@ import { HTMLAttributes } from 'preact/compat';
|
|
|
12
12
|
import { VComponent, classes } from '@adobe-commerce/elsie/lib';
|
|
13
13
|
import '@adobe-commerce/elsie/components/ActionButton/ActionButton.css';
|
|
14
14
|
|
|
15
|
-
export interface ActionButtonProps
|
|
16
|
-
|
|
15
|
+
export interface ActionButtonProps extends Omit<
|
|
16
|
+
HTMLAttributes<HTMLButtonElement>,
|
|
17
|
+
'icon'
|
|
18
|
+
> {
|
|
17
19
|
children?: ComponentChildren;
|
|
18
20
|
icon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
19
21
|
active?: boolean;
|
|
@@ -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/components/ActionButton/ActionButton';
|
|
@@ -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
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
@@ -52,7 +52,7 @@ export const ActionButtonGroup: FunctionComponent<ActionButtonGroupProps> = ({
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
|
-
[handleSelect, setActiveOptionState, disabled]
|
|
55
|
+
[handleSelect, setActiveOptionState, disabled],
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
const buttonGroupOptions = Children.map(
|
|
@@ -71,7 +71,7 @@ export const ActionButtonGroup: FunctionComponent<ActionButtonGroupProps> = ({
|
|
|
71
71
|
['dropin-action-button-group__option--with-dividers', dividers],
|
|
72
72
|
]),
|
|
73
73
|
});
|
|
74
|
-
}
|
|
74
|
+
},
|
|
75
75
|
);
|
|
76
76
|
|
|
77
77
|
return (
|
|
@@ -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/components/ActionButtonGroup/ActionButtonGroup';
|
|
@@ -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
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
@@ -94,13 +94,13 @@ export const Neutral: Story = {
|
|
|
94
94
|
},
|
|
95
95
|
play: async () => {
|
|
96
96
|
const alertBanner = document.querySelector(
|
|
97
|
-
'div[class*="dropin-alert-banner"]'
|
|
97
|
+
'div[class*="dropin-alert-banner"]',
|
|
98
98
|
) as HTMLElement;
|
|
99
99
|
|
|
100
100
|
await expect(alertBanner).toBeVisible();
|
|
101
101
|
|
|
102
102
|
const link = alertBanner.querySelector(
|
|
103
|
-
'.dropin-alert-banner__dismiss-button'
|
|
103
|
+
'.dropin-alert-banner__dismiss-button',
|
|
104
104
|
);
|
|
105
105
|
await expect(link).toBeVisible();
|
|
106
106
|
await expect(link?.ariaLabel).toBe('Dismiss Alert');
|
|
@@ -152,7 +152,7 @@ export const Action: Story = {
|
|
|
152
152
|
},
|
|
153
153
|
play: async () => {
|
|
154
154
|
const alertBanner = document.querySelector(
|
|
155
|
-
'div[class*="dropin-alert-banner"]'
|
|
155
|
+
'div[class*="dropin-alert-banner"]',
|
|
156
156
|
) as HTMLElement;
|
|
157
157
|
|
|
158
158
|
await expect(alertBanner).toBeVisible();
|
|
@@ -2,21 +2,23 @@
|
|
|
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
|
-
import { FunctionComponent, VNode } from 'preact';
|
|
11
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
12
|
-
import { classes, VComponent } from '@adobe-commerce/elsie/lib';
|
|
13
|
-
import '@adobe-commerce/elsie/components/AlertBanner/AlertBanner.css';
|
|
14
10
|
import { Button, Icon } from '@adobe-commerce/elsie/components';
|
|
15
|
-
import
|
|
11
|
+
import '@adobe-commerce/elsie/components/AlertBanner/AlertBanner.css';
|
|
16
12
|
import { useText } from '@adobe-commerce/elsie/i18n';
|
|
13
|
+
import { Close } from '@adobe-commerce/elsie/icons';
|
|
14
|
+
import { classes, VComponent } from '@adobe-commerce/elsie/lib';
|
|
15
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
16
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
17
17
|
|
|
18
|
-
export interface AlertBannerProps
|
|
19
|
-
|
|
18
|
+
export interface AlertBannerProps extends Omit<
|
|
19
|
+
HTMLAttributes<HTMLDivElement>,
|
|
20
|
+
'icon' | 'action'
|
|
21
|
+
> {
|
|
20
22
|
variant: 'brand' | 'neutral' | 'success' | 'warning';
|
|
21
23
|
icon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
22
24
|
message: VNode;
|
|
@@ -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/components/AlertBanner/AlertBanner';
|
|
@@ -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
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
@@ -65,10 +65,10 @@ export const Breadcrumbs: Story = {
|
|
|
65
65
|
},
|
|
66
66
|
play: async () => {
|
|
67
67
|
const breadcrumbsElement = document.querySelector(
|
|
68
|
-
'.dropin-breadcrumbs__container'
|
|
68
|
+
'.dropin-breadcrumbs__container',
|
|
69
69
|
) as HTMLElement;
|
|
70
70
|
const categories = breadcrumbsElement.querySelectorAll(
|
|
71
|
-
'.dropin-breadcrumbs__item a'
|
|
71
|
+
'.dropin-breadcrumbs__item a',
|
|
72
72
|
);
|
|
73
73
|
|
|
74
74
|
await expect(breadcrumbsElement).toBeVisible();
|
|
@@ -99,13 +99,13 @@ export const BreadcrumbsWithLeadingIcon: Story = {
|
|
|
99
99
|
},
|
|
100
100
|
play: async () => {
|
|
101
101
|
const breadcrumbsElement = document.querySelector(
|
|
102
|
-
'.dropin-breadcrumbs__container'
|
|
102
|
+
'.dropin-breadcrumbs__container',
|
|
103
103
|
) as HTMLElement;
|
|
104
104
|
const icon = breadcrumbsElement.querySelector(
|
|
105
|
-
'.dropin-breadcrumbs__item svg'
|
|
105
|
+
'.dropin-breadcrumbs__item svg',
|
|
106
106
|
) as HTMLElement;
|
|
107
107
|
const categories = breadcrumbsElement.querySelectorAll(
|
|
108
|
-
'.dropin-breadcrumbs__item a'
|
|
108
|
+
'.dropin-breadcrumbs__item a',
|
|
109
109
|
);
|
|
110
110
|
|
|
111
111
|
await expect(breadcrumbsElement).toBeVisible();
|
|
@@ -130,10 +130,10 @@ export const BreadcrumbsWithSeparator: Story = {
|
|
|
130
130
|
},
|
|
131
131
|
play: async () => {
|
|
132
132
|
const breadcrumbsElement = document.querySelector(
|
|
133
|
-
'.dropin-breadcrumbs__container'
|
|
133
|
+
'.dropin-breadcrumbs__container',
|
|
134
134
|
) as HTMLElement;
|
|
135
135
|
const separators = breadcrumbsElement.querySelectorAll(
|
|
136
|
-
'.dropin-breadcrumbs__separator--icon'
|
|
136
|
+
'.dropin-breadcrumbs__separator--icon',
|
|
137
137
|
);
|
|
138
138
|
|
|
139
139
|
await expect(breadcrumbsElement).toBeVisible();
|
|
@@ -174,16 +174,16 @@ export const BreadcrumbsWithIcons: Story = {
|
|
|
174
174
|
},
|
|
175
175
|
play: async () => {
|
|
176
176
|
const breadcrumbsElement = document.querySelector(
|
|
177
|
-
'.dropin-breadcrumbs__container'
|
|
177
|
+
'.dropin-breadcrumbs__container',
|
|
178
178
|
) as HTMLElement;
|
|
179
179
|
const icon = breadcrumbsElement.querySelector(
|
|
180
|
-
'.dropin-breadcrumbs__item svg'
|
|
180
|
+
'.dropin-breadcrumbs__item svg',
|
|
181
181
|
) as HTMLElement;
|
|
182
182
|
const categories = breadcrumbsElement.querySelectorAll(
|
|
183
|
-
'.dropin-breadcrumbs__item a'
|
|
183
|
+
'.dropin-breadcrumbs__item a',
|
|
184
184
|
);
|
|
185
185
|
const separators = breadcrumbsElement.querySelectorAll(
|
|
186
|
-
'.dropin-breadcrumbs__separator--icon'
|
|
186
|
+
'.dropin-breadcrumbs__separator--icon',
|
|
187
187
|
);
|
|
188
188
|
|
|
189
189
|
await expect(breadcrumbsElement).toBeVisible();
|
|
@@ -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 { HTMLAttributes } from 'preact/compat';
|
|
@@ -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/components/Breadcrumbs/Breadcrumbs';
|
|
@@ -29,17 +29,23 @@ This example uses all the `Button` properties.
|
|
|
29
29
|
|
|
30
30
|
## All props
|
|
31
31
|
|
|
32
|
-
The table below shows the name, description, and default value of each `Button`
|
|
33
|
-
Use the table controls to learn how each property affects the Button.
|
|
32
|
+
The table below shows the name, description, and default value of each `Button`
|
|
33
|
+
prop. Use the table controls to learn how each property affects the Button.
|
|
34
34
|
|
|
35
35
|
<Canvas of={ButtonStories.Button} />
|
|
36
36
|
<Controls of={ButtonStories.Button} sort="requiredFirst" />
|
|
37
37
|
|
|
38
38
|
## Active
|
|
39
39
|
|
|
40
|
-
Setting `active` to `true` overrides the Button's `icon` and `children`
|
|
40
|
+
Setting `active` to `true` overrides the Button's `icon` and `children`
|
|
41
|
+
properties with the values you set for the `activeIcon` and `activeChildren`
|
|
42
|
+
properties. With this one property, you can quickly toggle the Button's icon and
|
|
43
|
+
text.
|
|
41
44
|
|
|
42
|
-
**Note:** Setting the `active` property to `false` (from `true`) returns the
|
|
45
|
+
**Note:** Setting the `active` property to `false` (from `true`) returns the
|
|
46
|
+
button's `children` and `icon` values. It does not disable the button. To
|
|
47
|
+
disable the button, use the `disabled` property, as described in the
|
|
48
|
+
[Disabled](#disabled) section below.
|
|
43
49
|
|
|
44
50
|
<StoryWrapper>
|
|
45
51
|
<Story of={ButtonStories.Active} />
|
|
@@ -51,9 +57,12 @@ Setting `active` to `true` overrides the Button's `icon` and `children` properti
|
|
|
51
57
|
|
|
52
58
|
## Children
|
|
53
59
|
|
|
54
|
-
The `children` prop accepts the Preact `ComponentChildren` type. This type is
|
|
60
|
+
The `children` prop accepts the Preact `ComponentChildren` type. This type is
|
|
61
|
+
equal to React's `ReactNode` type and can accept any type. But in practice, you
|
|
62
|
+
should try to limit the `children` prop to a `string`.
|
|
55
63
|
|
|
56
|
-
To create Icon-only buttons, use the `icon` prop. See the [Icons](#icons)
|
|
64
|
+
To create Icon-only buttons, use the `icon` prop. See the [Icons](#icons)
|
|
65
|
+
section below for more information.
|
|
57
66
|
|
|
58
67
|
<StoryWrapper>
|
|
59
68
|
<Story of={ButtonStories.Children} />
|
|
@@ -73,7 +82,8 @@ The `disabled` prop is a `boolean` that disables the button. Default is `false`.
|
|
|
73
82
|
|
|
74
83
|
## Icons
|
|
75
84
|
|
|
76
|
-
The `icon` prop adds an `Icon` component. You can add an `Icon` with or without
|
|
85
|
+
The `icon` prop adds an `Icon` component. You can add an `Icon` with or without
|
|
86
|
+
Button text.
|
|
77
87
|
|
|
78
88
|
<StoryWrapper>
|
|
79
89
|
<Story of={ButtonStories.IconOnly} />
|
|
@@ -112,17 +122,20 @@ The `variant` prop sets the appearance of the button.
|
|
|
112
122
|
### When to use
|
|
113
123
|
|
|
114
124
|
Use buttons to communicate actions users can take and interact with the page.
|
|
115
|
-
Usually, each page should have only one primary button, and any remaining calls
|
|
125
|
+
Usually, each page should have only one primary button, and any remaining calls
|
|
126
|
+
to action should be represented as lower-emphasis buttons.
|
|
116
127
|
|
|
117
128
|
### When not to use
|
|
118
129
|
|
|
119
|
-
Do not use the `onClick()` attribute to make buttons act as navigational
|
|
120
|
-
Instead, render the button as a link when the desired action is to
|
|
130
|
+
Do not use the `onClick()` attribute to make buttons act as navigational
|
|
131
|
+
elements. Instead, render the button as a link when the desired action is to
|
|
132
|
+
take the user to a new page.
|
|
121
133
|
|
|
122
134
|
### Render as a link
|
|
123
135
|
|
|
124
136
|
To use a button as a navigation element, set the `href` prop to the target URL.
|
|
125
|
-
This renders the button as an anchor tag (`<a>`) instead of a button tag
|
|
137
|
+
This renders the button as an anchor tag (`<a>`) instead of a button tag
|
|
138
|
+
(`<button>`).
|
|
126
139
|
|
|
127
140
|
<StoryWrapper>
|
|
128
141
|
<Story of={ButtonStories.AsLink} />
|
|
@@ -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 type { Meta, StoryObj } from '@storybook/preact-vite';
|
|
@@ -265,7 +265,7 @@ export const IconOnly: Story = {
|
|
|
265
265
|
play: async ({ canvasElement }) => {
|
|
266
266
|
const canvas = within(canvasElement);
|
|
267
267
|
const searchIcon = document.querySelector(
|
|
268
|
-
'g[data-name="Search icon"]'
|
|
268
|
+
'g[data-name="Search icon"]',
|
|
269
269
|
) as HTMLElement;
|
|
270
270
|
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
271
271
|
await expect(searchIcon).toBeVisible();
|
|
@@ -294,7 +294,7 @@ export const TextAndIcon: Story = {
|
|
|
294
294
|
play: async ({ canvasElement }) => {
|
|
295
295
|
const canvas = within(canvasElement);
|
|
296
296
|
const searchIcon = document.querySelector(
|
|
297
|
-
'g[data-name="Search icon"]'
|
|
297
|
+
'g[data-name="Search icon"]',
|
|
298
298
|
) as HTMLElement;
|
|
299
299
|
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
300
300
|
await expect(searchIcon).toBeVisible();
|
|
@@ -351,7 +351,7 @@ export const Active: Story = {
|
|
|
351
351
|
play: async ({ canvasElement }) => {
|
|
352
352
|
const canvas = within(canvasElement);
|
|
353
353
|
const searchIcon = document.querySelector(
|
|
354
|
-
'[data-name="Search icon filled"]'
|
|
354
|
+
'[data-name="Search icon filled"]',
|
|
355
355
|
) as HTMLElement;
|
|
356
356
|
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
357
357
|
await expect(canvas.getByText('Active')).toBeVisible();
|
|
@@ -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 { ComponentChildren, FunctionComponent, VNode } from 'preact';
|
|
@@ -12,11 +12,10 @@ import { HTMLAttributes } from 'preact/compat';
|
|
|
12
12
|
import { VComponent, classes } from '@adobe-commerce/elsie/lib';
|
|
13
13
|
import '@adobe-commerce/elsie/components/Button/Button.css';
|
|
14
14
|
|
|
15
|
-
export interface ButtonProps
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
> {
|
|
15
|
+
export interface ButtonProps extends Omit<
|
|
16
|
+
HTMLAttributes<HTMLButtonElement | HTMLAnchorElement>,
|
|
17
|
+
'size' | 'icon'
|
|
18
|
+
> {
|
|
20
19
|
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
21
20
|
size?: 'medium' | 'large';
|
|
22
21
|
children?: ComponentChildren;
|
|
@@ -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/components/Button/Button';
|
|
@@ -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
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
@@ -28,7 +28,7 @@ const meta: Meta<CardProps> = {
|
|
|
28
28
|
description: 'The content of the Card.',
|
|
29
29
|
control: false,
|
|
30
30
|
type: { name: 'other', value: 'VNode[]' },
|
|
31
|
-
}
|
|
31
|
+
},
|
|
32
32
|
},
|
|
33
33
|
};
|
|
34
34
|
|
|
@@ -61,8 +61,8 @@ export const Primary: Story = {
|
|
|
61
61
|
await expect(await canvas.getByText('Title')).toBeVisible();
|
|
62
62
|
await expect(
|
|
63
63
|
await canvas.getByText(
|
|
64
|
-
'This is a short description of the item and should be kept to two or three lines as maximum.'
|
|
65
|
-
)
|
|
64
|
+
'This is a short description of the item and should be kept to two or three lines as maximum.',
|
|
65
|
+
),
|
|
66
66
|
).toBeVisible();
|
|
67
67
|
},
|
|
68
68
|
};
|
|
@@ -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 { ComponentChildren, FunctionComponent } from 'preact';
|
|
@@ -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/components/Card/Card';
|
|
@@ -469,48 +469,48 @@ export const CartItem: Story = {
|
|
|
469
469
|
},
|
|
470
470
|
play: async () => {
|
|
471
471
|
const canvasElement = document.querySelector(
|
|
472
|
-
'#storybook-root'
|
|
472
|
+
'#storybook-root',
|
|
473
473
|
) as HTMLElement;
|
|
474
474
|
const canvas = within(canvasElement);
|
|
475
475
|
|
|
476
476
|
const itemImage = document.querySelector(
|
|
477
|
-
'.dropin-cart-item__image'
|
|
477
|
+
'.dropin-cart-item__image',
|
|
478
478
|
) as HTMLElement;
|
|
479
479
|
expect(itemImage).toBeVisible();
|
|
480
480
|
const itemTitle = document.querySelector(
|
|
481
|
-
'.dropin-cart-item__title'
|
|
481
|
+
'.dropin-cart-item__title',
|
|
482
482
|
) as HTMLElement;
|
|
483
483
|
expect(itemTitle).toBeVisible();
|
|
484
484
|
const itemSku = document.querySelector(
|
|
485
|
-
'.dropin-cart-item__sku'
|
|
485
|
+
'.dropin-cart-item__sku',
|
|
486
486
|
) as HTMLElement;
|
|
487
487
|
expect(itemSku).toBeVisible();
|
|
488
488
|
const itemConfigurations = document.querySelector(
|
|
489
|
-
'.dropin-cart-item__configurations'
|
|
489
|
+
'.dropin-cart-item__configurations',
|
|
490
490
|
) as HTMLElement;
|
|
491
491
|
expect(itemConfigurations).toBeVisible();
|
|
492
492
|
const itemPrice = document.querySelector(
|
|
493
|
-
'.dropin-cart-item__price'
|
|
493
|
+
'.dropin-cart-item__price',
|
|
494
494
|
) as HTMLElement;
|
|
495
495
|
expect(itemPrice).toBeVisible();
|
|
496
496
|
const quantityStepper = document.querySelector(
|
|
497
|
-
'.dropin-cart-item__quantity'
|
|
497
|
+
'.dropin-cart-item__quantity',
|
|
498
498
|
) as HTMLElement;
|
|
499
499
|
expect(quantityStepper).toBeVisible();
|
|
500
500
|
const itemTotal = document.querySelector(
|
|
501
|
-
'.dropin-cart-item__total'
|
|
501
|
+
'.dropin-cart-item__total',
|
|
502
502
|
) as HTMLElement;
|
|
503
503
|
expect(itemTotal).toBeVisible();
|
|
504
504
|
const actions = document.querySelector(
|
|
505
|
-
'.dropin-cart-item__buttons'
|
|
505
|
+
'.dropin-cart-item__buttons',
|
|
506
506
|
) as HTMLElement;
|
|
507
507
|
expect(actions).toBeVisible();
|
|
508
508
|
|
|
509
509
|
const increaseButton = document.querySelector(
|
|
510
|
-
'button[aria-label="Increase Quantity"]'
|
|
510
|
+
'button[aria-label="Increase Quantity"]',
|
|
511
511
|
) as HTMLElement;
|
|
512
512
|
const decreaseButton = document.querySelector(
|
|
513
|
-
'button[aria-label="Decrease Quantity"]'
|
|
513
|
+
'button[aria-label="Decrease Quantity"]',
|
|
514
514
|
) as HTMLElement;
|
|
515
515
|
|
|
516
516
|
// Without this wait test failing intermittently as click event is triggering before even element fully loaded
|
|
@@ -665,7 +665,7 @@ export const WithPromotionalBadge: Story = {
|
|
|
665
665
|
play: async ({ canvasElement }) => {
|
|
666
666
|
// Verify row total footer is rendered below the total
|
|
667
667
|
const rowTotalFooter = canvasElement.querySelector(
|
|
668
|
-
'.dropin-cart-item__row-total-footer'
|
|
668
|
+
'.dropin-cart-item__row-total-footer',
|
|
669
669
|
) as HTMLElement;
|
|
670
670
|
expect(rowTotalFooter).toBeTruthy();
|
|
671
671
|
expect(rowTotalFooter?.textContent).toContain('Super offer');
|
|
@@ -24,8 +24,10 @@ import { Trash } from '@adobe-commerce/elsie/icons';
|
|
|
24
24
|
|
|
25
25
|
import '@adobe-commerce/elsie/components/CartItem/CartItem.css';
|
|
26
26
|
|
|
27
|
-
export interface CartItemProps
|
|
28
|
-
|
|
27
|
+
export interface CartItemProps extends Omit<
|
|
28
|
+
HTMLAttributes<HTMLDivElement>,
|
|
29
|
+
'title' | 'loading'
|
|
30
|
+
> {
|
|
29
31
|
ariaLabel?: string;
|
|
30
32
|
image?: VNode;
|
|
31
33
|
title?: VNode;
|
|
@@ -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 } from 'preact';
|