@adobe-commerce/elsie 1.0.0-alpha4 → 1.0.0-beta1
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 +9 -0
- package/.eslintrc.js +9 -0
- package/__mocks__/svg.js +9 -0
- package/bin/lib/validate-typeof.js +9 -0
- package/bin/lib/write-file.js +9 -0
- package/bin/lib/write-parent-index.js +9 -0
- package/config/eslint.js +9 -0
- package/config/jest.js +9 -0
- package/config/prettier.js +9 -0
- package/config/setEnvVars.js +9 -0
- package/config/storybook/addon.js +9 -0
- package/config/storybook/components/FileTree/FileTree.jsx +9 -0
- package/config/storybook/components/FileTree/index.js +9 -0
- package/config/storybook/components/Flex/Flex.jsx +9 -0
- package/config/storybook/components/Flex/Flex.module.css +9 -0
- package/config/storybook/components/Flex/index.js +9 -0
- package/config/storybook/components/OptionsTable/OptionsTable.jsx +9 -0
- package/config/storybook/components/OptionsTable/OptionsTable.module.css +9 -0
- package/config/storybook/components/OptionsTable/index.js +9 -0
- package/config/storybook/components/Panel/Panel.module.css +9 -0
- package/config/storybook/components/Panel/Panel.tsx +9 -0
- package/config/storybook/components/Panel/index.ts +9 -0
- package/config/storybook/components/Screenshot/Screenshot.jsx +9 -0
- package/config/storybook/components/Screenshot/Screenshot.module.css +9 -0
- package/config/storybook/components/Screenshot/index.js +9 -0
- package/config/storybook/components/Steps/Steps.jsx +9 -0
- package/config/storybook/components/Steps/Steps.module.css +9 -0
- package/config/storybook/components/Steps/index.js +9 -0
- package/config/storybook/components/StoryWrapper/StoryWrapper.jsx +9 -0
- package/config/storybook/components/StoryWrapper/StoryWrapper.module.css +9 -0
- package/config/storybook/components/StoryWrapper/index.js +9 -0
- package/config/storybook/components/Summary/Summary.jsx +9 -0
- package/config/storybook/components/Summary/Summary.module.css +9 -0
- package/config/storybook/components/Summary/index.js +9 -0
- package/config/storybook/components/Variants/Variants.js +9 -0
- package/config/storybook/components/Variants/docs.css +9 -0
- package/config/storybook/components/Variants/index.js +9 -0
- package/config/storybook/components/video/index.jsx +9 -0
- package/config/storybook/manager.js +9 -0
- package/config/storybook/preview.jsx +9 -0
- package/config/storybook/theming/fonts.css +9 -0
- package/config/storybook/theming/manager.css +9 -0
- package/config/storybook/theming/preview.css +9 -0
- package/config/storybook/theming/theme.js +9 -0
- package/config/vite.mjs +9 -0
- package/package.json +1 -1
- package/post-release.sh +5 -0
- package/src/components/Accordion/Accordion.css +10 -1
- package/src/components/Accordion/Accordion.stories.tsx +9 -0
- package/src/components/Accordion/Accordion.tsx +9 -0
- package/src/components/Accordion/index.ts +9 -0
- package/src/components/ActionButton/ActionButton.css +9 -0
- package/src/components/ActionButton/ActionButton.stories.tsx +9 -0
- package/src/components/ActionButton/ActionButton.tsx +9 -0
- package/src/components/ActionButton/index.ts +9 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.css +9 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.stories.tsx +9 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.tsx +9 -0
- package/src/components/ActionButtonGroup/index.ts +9 -0
- package/src/components/AlertBanner/AlertBanner.css +9 -0
- package/src/components/AlertBanner/AlertBanner.stories.tsx +9 -0
- package/src/components/AlertBanner/AlertBanner.tsx +9 -0
- package/src/components/AlertBanner/index.ts +9 -0
- package/src/components/Breadcrumbs/Breadcrumbs.css +9 -0
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +9 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +9 -0
- package/src/components/Breadcrumbs/index.ts +9 -0
- package/src/components/Button/Button.css +9 -0
- package/src/components/Button/Button.stories.tsx +9 -0
- package/src/components/Button/Button.tsx +9 -0
- package/src/components/Button/index.ts +9 -0
- package/src/components/Card/Card.css +9 -0
- package/src/components/Card/Card.stories.tsx +9 -0
- package/src/components/Card/Card.tsx +9 -0
- package/src/components/Card/index.ts +9 -0
- package/src/components/CartItem/CartItem.css +40 -5
- package/src/components/CartItem/CartItem.stories.tsx +84 -44
- package/src/components/CartItem/CartItem.tsx +343 -320
- package/src/components/CartItem/CartItemSkeleton.tsx +9 -0
- package/src/components/CartItem/index.ts +9 -0
- package/src/components/CartList/CartList.css +9 -0
- package/src/components/CartList/CartList.stories.tsx +9 -0
- package/src/components/CartList/CartList.tsx +9 -0
- package/src/components/CartList/index.ts +9 -0
- package/src/components/Checkbox/Checkbox.css +9 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +9 -0
- package/src/components/Checkbox/Checkbox.tsx +9 -0
- package/src/components/Checkbox/index.ts +9 -0
- package/src/components/ColorSwatch/ColorSwatch.css +9 -0
- package/src/components/ColorSwatch/ColorSwatch.stories.tsx +9 -0
- package/src/components/ColorSwatch/ColorSwatch.tsx +9 -0
- package/src/components/ColorSwatch/index.ts +9 -0
- package/src/components/ContentGrid/ContentGrid.css +3 -11
- package/src/components/ContentGrid/ContentGrid.stories.tsx +3 -11
- package/src/components/ContentGrid/ContentGrid.tsx +3 -11
- package/src/components/ContentGrid/index.ts +3 -11
- package/src/components/Divider/Divider.css +9 -0
- package/src/components/Divider/Divider.stories.tsx +9 -0
- package/src/components/Divider/Divider.tsx +9 -0
- package/src/components/Divider/index.ts +9 -0
- package/src/components/Field/Field.css +9 -0
- package/src/components/Field/Field.stories.tsx +9 -0
- package/src/components/Field/Field.tsx +9 -0
- package/src/components/Field/index.ts +9 -0
- package/src/components/Header/Header.css +9 -0
- package/src/components/Header/Header.stories.tsx +52 -0
- package/src/components/Header/Header.tsx +31 -3
- package/src/components/Header/index.ts +9 -0
- package/src/components/Icon/Icon.css +9 -0
- package/src/components/Icon/Icon.stories.helpers.jsx +9 -0
- package/src/components/Icon/Icon.stories.tsx +9 -0
- package/src/components/Icon/Icon.tsx +9 -0
- package/src/components/Icon/index.ts +9 -0
- package/src/components/IllustratedMessage/IllustratedMessage.css +9 -0
- package/src/components/IllustratedMessage/IllustratedMessage.stories.tsx +9 -0
- package/src/components/IllustratedMessage/IllustratedMessage.tsx +9 -0
- package/src/components/IllustratedMessage/index.ts +9 -0
- package/src/components/Image/Image.css +9 -0
- package/src/components/Image/Image.stories.tsx +9 -0
- package/src/components/Image/Image.tsx +9 -0
- package/src/components/Image/index.ts +9 -0
- package/src/components/ImageSwatch/ImageSwatch.css +9 -0
- package/src/components/ImageSwatch/ImageSwatch.stories.tsx +58 -0
- package/src/components/ImageSwatch/ImageSwatch.tsx +22 -10
- package/src/components/ImageSwatch/index.ts +9 -0
- package/src/components/InLineAlert/InLineAlert.css +9 -0
- package/src/components/InLineAlert/InLineAlert.stories.tsx +9 -0
- package/src/components/InLineAlert/InLineAlert.tsx +9 -0
- package/src/components/InLineAlert/index.ts +9 -0
- package/src/components/Incrementer/Incrementer.css +9 -0
- package/src/components/Incrementer/Incrementer.stories.tsx +9 -0
- package/src/components/Incrementer/Incrementer.tsx +9 -0
- package/src/components/Incrementer/index.ts +9 -0
- package/src/components/Input/Input.css +9 -0
- package/src/components/Input/Input.stories.tsx +9 -0
- package/src/components/Input/Input.tsx +9 -0
- package/src/components/Input/index.ts +9 -0
- package/src/components/InputDate/InputDate.css +9 -0
- package/src/components/InputDate/InputDate.stories.tsx +9 -0
- package/src/components/InputDate/InputDate.tsx +9 -0
- package/src/components/InputDate/index.ts +9 -0
- package/src/components/InputPassword/InputPassword.css +9 -0
- package/src/components/InputPassword/InputPassword.stories.tsx +9 -0
- package/src/components/InputPassword/InputPassword.tsx +9 -0
- package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.css +9 -0
- package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.tsx +9 -0
- package/src/components/InputPassword/PasswordStatusIndicator/index.ts +9 -0
- package/src/components/InputPassword/index.ts +9 -0
- package/src/components/Modal/Modal.css +8 -13
- package/src/components/Modal/Modal.stories.tsx +8 -13
- package/src/components/Modal/Modal.tsx +8 -13
- package/src/components/Modal/index.ts +8 -13
- package/src/components/Pagination/Pagination.css +9 -0
- package/src/components/Pagination/Pagination.stories.tsx +9 -0
- package/src/components/Pagination/Pagination.tsx +9 -0
- package/src/components/Pagination/index.ts +9 -0
- package/src/components/Picker/Picker.css +9 -0
- package/src/components/Picker/Picker.stories.tsx +9 -0
- package/src/components/Picker/Picker.tsx +9 -0
- package/src/components/Picker/index.ts +9 -0
- package/src/components/Price/Price.css +9 -0
- package/src/components/Price/Price.stories.tsx +9 -0
- package/src/components/Price/Price.tsx +9 -0
- package/src/components/Price/index.ts +9 -0
- package/src/components/PriceRange/PriceRange.css +9 -0
- package/src/components/PriceRange/PriceRange.stories.tsx +9 -0
- package/src/components/PriceRange/PriceRange.tsx +9 -0
- package/src/components/PriceRange/index.ts +9 -0
- package/src/components/ProgressSpinner/ProgressSpinner.css +9 -0
- package/src/components/ProgressSpinner/ProgressSpinner.stories.tsx +9 -0
- package/src/components/ProgressSpinner/ProgressSpinner.tsx +9 -0
- package/src/components/ProgressSpinner/index.ts +9 -0
- package/src/components/RadioButton/RadioButton.css +9 -0
- package/src/components/RadioButton/RadioButton.stories.tsx +9 -0
- package/src/components/RadioButton/RadioButton.tsx +9 -0
- package/src/components/RadioButton/index.ts +9 -0
- package/src/components/Skeleton/Skeleton.css +9 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +9 -0
- package/src/components/Skeleton/Skeleton.tsx +9 -0
- package/src/components/Skeleton/index.ts +9 -0
- package/src/components/Tag/Tag.css +9 -0
- package/src/components/Tag/Tag.stories.tsx +9 -0
- package/src/components/Tag/Tag.tsx +9 -0
- package/src/components/Tag/index.ts +9 -0
- package/src/components/TextArea/TextArea.css +9 -0
- package/src/components/TextArea/TextArea.stories.tsx +9 -0
- package/src/components/TextArea/TextArea.tsx +9 -0
- package/src/components/TextArea/index.ts +9 -0
- package/src/components/TextSwatch/TextSwatch.css +9 -0
- package/src/components/TextSwatch/TextSwatch.stories.tsx +9 -0
- package/src/components/TextSwatch/TextSwatch.tsx +9 -0
- package/src/components/TextSwatch/index.ts +9 -0
- package/src/components/ToggleButton/ToggleButton.css +18 -0
- package/src/components/ToggleButton/ToggleButton.stories.tsx +47 -3
- package/src/components/ToggleButton/ToggleButton.tsx +19 -11
- package/src/components/ToggleButton/index.ts +9 -0
- package/src/components/UIProvider/UIProvider.css +9 -0
- package/src/components/UIProvider/UIProvider.tsx +9 -0
- package/src/components/UIProvider/debugger.css +9 -0
- package/src/components/UIProvider/index.ts +9 -0
- package/src/components/UIProvider/normalize.css +9 -0
- package/src/components/index.ts +9 -0
- package/src/i18n/index.ts +9 -0
- package/src/lib/classes.ts +9 -0
- package/src/lib/config.ts +9 -0
- package/src/lib/debounce.ts +9 -0
- package/src/lib/deepmerge.ts +9 -0
- package/src/lib/deviceUtils.ts +9 -0
- package/src/lib/form-values.ts +9 -0
- package/src/lib/i18n.ts +9 -0
- package/src/lib/image-params-keymap.ts +9 -0
- package/src/lib/index.ts +9 -0
- package/src/lib/initializer.ts +9 -0
- package/src/lib/is-number.ts +9 -0
- package/src/lib/render.tsx +9 -0
- package/src/lib/resolve-image.ts +9 -0
- package/src/lib/signals.ts +9 -0
- package/src/lib/slot.tsx +9 -0
- package/src/lib/tests.tsx +9 -0
- package/src/lib/types.ts +9 -0
- package/src/lib/vcomponent.tsx +8 -13
- package/static/assets/images/index.ts +9 -0
- package/storybook-stories.js +9 -0
- package/tests/__mocks__/browserMocks.ts +9 -0
- package/tests/__mocks__/fileMocks.ts +9 -0
- package/types/icons.d.ts +9 -0
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import {
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
import { FunctionComponent, VNode } from 'preact';
|
|
2
11
|
import { HTMLAttributes, JSX } from 'preact/compat';
|
|
3
12
|
import { classes, VComponent } from '@adobe-commerce/elsie/lib';
|
|
@@ -1,2 +1,11 @@
|
|
|
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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/IllustratedMessage/IllustratedMessage';
|
|
2
11
|
export { IllustratedMessage as default } from '@adobe-commerce/elsie/components/IllustratedMessage/IllustratedMessage';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
/* https://cssguidelin.es/#bem-like-naming */
|
|
2
11
|
|
|
3
12
|
.dropin-image {
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import { Image, ImageProps } from '@adobe-commerce/elsie/components/Image';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
import { FunctionComponent } from 'preact';
|
|
2
11
|
import { HTMLAttributes, useMemo, useState } from 'preact/compat';
|
|
3
12
|
import {
|
|
@@ -1 +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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/Image/Image';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
/* https://cssguidelin.es/#bem-like-naming */
|
|
2
11
|
|
|
3
12
|
/* Hide default the radio/checkbox button */
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import { expect, within } from '@storybook/test';
|
|
@@ -250,3 +259,52 @@ export const MultiImageSwatch: Story = {
|
|
|
250
259
|
</div>
|
|
251
260
|
),
|
|
252
261
|
};
|
|
262
|
+
|
|
263
|
+
export const CustomImageNodeSwatch: Story = {
|
|
264
|
+
args: {
|
|
265
|
+
name: 'customImageSwatch',
|
|
266
|
+
id: 'customImageSwatch1',
|
|
267
|
+
label: 'Custom Image Node Example',
|
|
268
|
+
groupAriaLabel: 'Custom Image Swatches',
|
|
269
|
+
value: 'customImageNode',
|
|
270
|
+
src: `https://picsum.photos/${defaultWidth}/${defaultHeight}`, // fallback, not used with imageNode
|
|
271
|
+
alt: 'Custom Image Node',
|
|
272
|
+
selected: false,
|
|
273
|
+
disabled: false,
|
|
274
|
+
outOfStock: false,
|
|
275
|
+
onValue: action('onValue'),
|
|
276
|
+
imageNode: (
|
|
277
|
+
<div style="position: relative; width: 100%; height: 100%;">
|
|
278
|
+
<img
|
|
279
|
+
src={`https://picsum.photos/${defaultWidth}/${defaultHeight}?grayscale`}
|
|
280
|
+
alt="Custom grayscale image"
|
|
281
|
+
style="width: 100%; height: 100%; object-fit: cover;"
|
|
282
|
+
/>
|
|
283
|
+
<div style="position: absolute; top: 0; left: 0; background: rgba(255,255,255,0.7); padding: 4px 8px; border-radius: 0 0 8px 0;">
|
|
284
|
+
<span style="font-size: 12px; font-weight: bold; color: #333;">
|
|
285
|
+
Custom
|
|
286
|
+
</span>
|
|
287
|
+
</div>
|
|
288
|
+
</div>
|
|
289
|
+
),
|
|
290
|
+
},
|
|
291
|
+
play: async ({ canvasElement }) => {
|
|
292
|
+
const canvas = within(canvasElement);
|
|
293
|
+
const imageSwatch = await canvas.findByRole('radio');
|
|
294
|
+
const customImageContainer = canvasElement.querySelector(
|
|
295
|
+
'div[style*="position: relative"]'
|
|
296
|
+
);
|
|
297
|
+
const customImage = canvasElement.querySelector(
|
|
298
|
+
'img[alt="Custom grayscale image"]'
|
|
299
|
+
);
|
|
300
|
+
const customLabel = canvasElement.querySelector(
|
|
301
|
+
'span[style*="font-weight: bold"]'
|
|
302
|
+
);
|
|
303
|
+
|
|
304
|
+
expect(imageSwatch).toBeInTheDocument();
|
|
305
|
+
expect(customImageContainer).toBeInTheDocument();
|
|
306
|
+
expect(customImage).toBeInTheDocument();
|
|
307
|
+
expect(customLabel).toBeInTheDocument();
|
|
308
|
+
expect(customLabel?.textContent).toBe('Custom');
|
|
309
|
+
},
|
|
310
|
+
};
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
-
|
|
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
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
11
|
import { HTMLAttributes, useCallback } from 'preact/compat';
|
|
3
12
|
import { classes } from '@adobe-commerce/elsie/lib';
|
|
4
13
|
import '@adobe-commerce/elsie/components/ImageSwatch/ImageSwatch.css';
|
|
5
14
|
import { Image } from '@adobe-commerce/elsie/components/Image';
|
|
6
15
|
import { useText } from '@adobe-commerce/elsie/i18n';
|
|
7
|
-
|
|
8
16
|
export interface ImageSwatchProps
|
|
9
17
|
extends Omit<HTMLAttributes<HTMLInputElement>, 'label'> {
|
|
10
18
|
name?: string;
|
|
@@ -18,6 +26,7 @@ export interface ImageSwatchProps
|
|
|
18
26
|
selected?: boolean;
|
|
19
27
|
outOfStock?: boolean;
|
|
20
28
|
multi?: boolean;
|
|
29
|
+
imageNode?: VNode;
|
|
21
30
|
onValue?: (value: any) => void;
|
|
22
31
|
onUpdateError?: (error: Error) => void;
|
|
23
32
|
}
|
|
@@ -35,6 +44,7 @@ export const ImageSwatch: FunctionComponent<ImageSwatchProps> = ({
|
|
|
35
44
|
selected = false,
|
|
36
45
|
outOfStock = false,
|
|
37
46
|
multi = false,
|
|
47
|
+
imageNode,
|
|
38
48
|
onValue,
|
|
39
49
|
onUpdateError,
|
|
40
50
|
...props
|
|
@@ -97,14 +107,16 @@ export const ImageSwatch: FunctionComponent<ImageSwatchProps> = ({
|
|
|
97
107
|
className,
|
|
98
108
|
])}
|
|
99
109
|
>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
110
|
+
{imageNode || (
|
|
111
|
+
<Image
|
|
112
|
+
src={src}
|
|
113
|
+
className={classes(['dropin-image-swatch__content'])}
|
|
114
|
+
params={{ width: 100, fit: 'bounds', crop: true }}
|
|
115
|
+
alt={alt}
|
|
116
|
+
loading={'lazy'}
|
|
117
|
+
onError={(e: any) => (e.target.style.display = 'none')}
|
|
118
|
+
/>
|
|
119
|
+
)}
|
|
108
120
|
</span>
|
|
109
121
|
</label>
|
|
110
122
|
);
|
|
@@ -1,2 +1,11 @@
|
|
|
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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/ImageSwatch/ImageSwatch';
|
|
2
11
|
export { ImageSwatch as default } from '@adobe-commerce/elsie/components/ImageSwatch/ImageSwatch';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
/* https://cssguidelin.es/#bem-like-naming */
|
|
2
11
|
|
|
3
12
|
.dropin-in-line-alert {
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import {
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
import { Button, Icon } from '@adobe-commerce/elsie/components';
|
|
2
11
|
import { useText } from '@adobe-commerce/elsie/i18n';
|
|
3
12
|
import { Close } from '@adobe-commerce/elsie/icons';
|
|
@@ -1,2 +1,11 @@
|
|
|
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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/InLineAlert/InLineAlert';
|
|
2
11
|
export { InLineAlert as default } from '@adobe-commerce/elsie/components/InLineAlert/InLineAlert';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
/* https://cssguidelin.es/#bem-like-naming */
|
|
2
11
|
|
|
3
12
|
/* Content */
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import {
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
import { FunctionComponent } from 'preact';
|
|
2
11
|
import { useState, useCallback } from 'preact/hooks';
|
|
3
12
|
import { HTMLAttributes } from 'preact/compat';
|
|
@@ -1 +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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/Incrementer/Incrementer';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
/* https://cssguidelin.es/#bem-like-naming */
|
|
2
11
|
|
|
3
12
|
/* Input */
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import { action } from '@storybook/addon-actions';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
import { Icon } from '@adobe-commerce/elsie/components/Icon';
|
|
2
11
|
import '@adobe-commerce/elsie/components/Input/Input.css';
|
|
3
12
|
import { CheckWithCircle, WarningWithCircle } from '@adobe-commerce/elsie/icons';
|
|
@@ -1,2 +1,11 @@
|
|
|
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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/Input/Input';
|
|
2
11
|
export { Input as default } from '@adobe-commerce/elsie/components/Input';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
.dropin-input-date {
|
|
2
11
|
position: relative;
|
|
3
12
|
width: 100%;
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import { InputDate, InputDateProps } from '@adobe-commerce/elsie/components/InputDate';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
import { FunctionComponent } from 'preact';
|
|
2
11
|
import { useRef, useState } from 'preact/hooks';
|
|
3
12
|
import { classes, isIOSMobileDevice } from '@adobe-commerce/elsie/lib';
|
|
@@ -1,2 +1,11 @@
|
|
|
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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/InputDate/InputDate';
|
|
2
11
|
export { InputDate as default } from '@adobe-commerce/elsie/components/InputDate/InputDate';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
.dropin-input-password {
|
|
2
11
|
position: relative;
|
|
3
12
|
}
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
// https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
|
|
2
11
|
import type { Meta, StoryObj } from '@storybook/preact';
|
|
3
12
|
import {
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
import { FunctionComponent } from 'preact';
|
|
2
11
|
import { useCallback, useState } from 'preact/hooks';
|
|
3
12
|
import { classes } from '@adobe-commerce/elsie/lib';
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
.dropin-password-status-indicator__item {
|
|
2
11
|
display: grid;
|
|
3
12
|
grid-template-columns: 20px auto;
|
|
@@ -1,3 +1,12 @@
|
|
|
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
|
+
|
|
1
10
|
import { FunctionComponent, JSX } from 'preact';
|
|
2
11
|
import { HTMLAttributes } from 'preact/compat';
|
|
3
12
|
import { classes } from '@adobe-commerce/elsie/lib';
|
|
@@ -1,2 +1,11 @@
|
|
|
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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator';
|
|
2
11
|
export { PasswordStatusIndicator as default } from '@adobe-commerce/elsie/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator';
|
|
@@ -1,2 +1,11 @@
|
|
|
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
|
+
|
|
1
10
|
export * from '@adobe-commerce/elsie/components/InputPassword/InputPassword';
|
|
2
11
|
export { InputPassword as default } from '@adobe-commerce/elsie/components/InputPassword/InputPassword';
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
NOTICE:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
property laws, including trade secret and copyright laws.
|
|
10
|
-
Dissemination of this information or reproduction of this material
|
|
11
|
-
is strictly forbidden unless prior written permission is obtained
|
|
12
|
-
from Adobe.
|
|
13
|
-
*/
|
|
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
|
+
*******************************************************************/
|
|
14
9
|
|
|
15
10
|
/* https://cssguidelin.es/#bem-like-naming */
|
|
16
11
|
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
NOTICE:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
property laws, including trade secret and copyright laws.
|
|
10
|
-
Dissemination of this information or reproduction of this material
|
|
11
|
-
is strictly forbidden unless prior written permission is obtained
|
|
12
|
-
from Adobe.
|
|
13
|
-
*/
|
|
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
|
+
*******************************************************************/
|
|
14
9
|
|
|
15
10
|
import { Meta, StoryObj } from '@storybook/preact';
|
|
16
11
|
import { Modal as component, ModalProps } from './Modal';
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
NOTICE:
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
property laws, including trade secret and copyright laws.
|
|
10
|
-
Dissemination of this information or reproduction of this material
|
|
11
|
-
is strictly forbidden unless prior written permission is obtained
|
|
12
|
-
from Adobe.
|
|
13
|
-
*/
|
|
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
|
+
*******************************************************************/
|
|
14
9
|
|
|
15
10
|
import { useText } from '@adobe-commerce/elsie/i18n';
|
|
16
11
|
import { classes } from '@adobe-commerce/elsie/lib';
|