@adobe-commerce/elsie 1.0.0-alpha04071347
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 +21 -0
- package/.eslintrc.js +18 -0
- package/README.md +52 -0
- package/__mocks__/svg.js +11 -0
- package/bin/builders/build/index.js +20 -0
- package/bin/builders/generate/api/index.js +65 -0
- package/bin/builders/generate/api/templates/function.js +9 -0
- package/bin/builders/generate/api/templates/index.js +7 -0
- package/bin/builders/generate/api/templates/story.js +23 -0
- package/bin/builders/generate/api/templates/unit-test.js +15 -0
- package/bin/builders/generate/component/index.js +87 -0
- package/bin/builders/generate/component/templates/Component.js +43 -0
- package/bin/builders/generate/component/templates/css.js +24 -0
- package/bin/builders/generate/component/templates/index.js +8 -0
- package/bin/builders/generate/component/templates/stories.js +46 -0
- package/bin/builders/generate/component/templates/unit-test.js +19 -0
- package/bin/builders/generate/config/index.js +54 -0
- package/bin/builders/generate/config/templates/elsie.js +29 -0
- package/bin/builders/generate/container/index.js +65 -0
- package/bin/builders/generate/container/templates/Component.js +18 -0
- package/bin/builders/generate/container/templates/index.js +8 -0
- package/bin/builders/generate/container/templates/stories.js +34 -0
- package/bin/builders/generate/container/templates/unit-test.js +19 -0
- package/bin/builders/generate/index.js +283 -0
- package/bin/builders/gql/createOrClearDirectory.js +33 -0
- package/bin/builders/gql/getSchemaRef.js +25 -0
- package/bin/builders/gql/index.js +71 -0
- package/bin/builders/lint/index.js +5 -0
- package/bin/builders/serve/index.js +44 -0
- package/bin/builders/storybook/index.js +5 -0
- package/bin/builders/test/index.js +5 -0
- package/bin/index.js +26 -0
- package/bin/lib/cli.js +8 -0
- package/bin/lib/config.js +12 -0
- package/bin/lib/log-message.js +11 -0
- package/bin/lib/string.js +26 -0
- package/bin/lib/validate-typeof.js +28 -0
- package/bin/lib/write-file.js +30 -0
- package/bin/lib/write-parent-index.js +45 -0
- package/config/eslint.js +113 -0
- package/config/jest.js +90 -0
- package/config/prettier.js +16 -0
- package/config/setEnvVars.js +14 -0
- package/config/storybook/addon.js +130 -0
- package/config/storybook/components/FileTree/FileTree.jsx +192 -0
- package/config/storybook/components/FileTree/index.js +10 -0
- package/config/storybook/components/Flex/Flex.jsx +21 -0
- package/config/storybook/components/Flex/Flex.module.css +29 -0
- package/config/storybook/components/Flex/index.js +10 -0
- package/config/storybook/components/OptionsTable/OptionsTable.jsx +88 -0
- package/config/storybook/components/OptionsTable/OptionsTable.module.css +104 -0
- package/config/storybook/components/OptionsTable/index.js +10 -0
- package/config/storybook/components/Panel/Panel.module.css +56 -0
- package/config/storybook/components/Panel/Panel.tsx +46 -0
- package/config/storybook/components/Panel/index.ts +10 -0
- package/config/storybook/components/Screenshot/Screenshot.jsx +23 -0
- package/config/storybook/components/Screenshot/Screenshot.module.css +28 -0
- package/config/storybook/components/Screenshot/index.js +10 -0
- package/config/storybook/components/Steps/Steps.jsx +21 -0
- package/config/storybook/components/Steps/Steps.module.css +43 -0
- package/config/storybook/components/Steps/index.js +10 -0
- package/config/storybook/components/StoryWrapper/StoryWrapper.jsx +18 -0
- package/config/storybook/components/StoryWrapper/StoryWrapper.module.css +22 -0
- package/config/storybook/components/StoryWrapper/index.js +10 -0
- package/config/storybook/components/Summary/Summary.jsx +19 -0
- package/config/storybook/components/Summary/Summary.module.css +20 -0
- package/config/storybook/components/Summary/index.js +10 -0
- package/config/storybook/components/Variants/Variants.js +57 -0
- package/config/storybook/components/Variants/docs.css +48 -0
- package/config/storybook/components/Variants/index.js +10 -0
- package/config/storybook/components/video/index.jsx +28 -0
- package/config/storybook/manager.js +23 -0
- package/config/storybook/preview.jsx +88 -0
- package/config/storybook/theming/fonts.css +68 -0
- package/config/storybook/theming/logo.svg +19 -0
- package/config/storybook/theming/manager.css +63 -0
- package/config/storybook/theming/preview.css +93 -0
- package/config/storybook/theming/theme.js +61 -0
- package/config/tsconfig-base.json +16 -0
- package/config/tsconfig-preact.json +15 -0
- package/config/vite.mjs +306 -0
- package/package.json +113 -0
- package/post-release.sh +5 -0
- package/src/components/Accordion/Accordion.css +88 -0
- package/src/components/Accordion/Accordion.stories.tsx +582 -0
- package/src/components/Accordion/Accordion.tsx +177 -0
- package/src/components/Accordion/index.ts +11 -0
- package/src/components/ActionButton/ActionButton.css +100 -0
- package/src/components/ActionButton/ActionButton.stories.tsx +169 -0
- package/src/components/ActionButton/ActionButton.tsx +53 -0
- package/src/components/ActionButton/index.ts +10 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.css +77 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.stories.tsx +97 -0
- package/src/components/ActionButtonGroup/ActionButtonGroup.tsx +91 -0
- package/src/components/ActionButtonGroup/index.ts +10 -0
- package/src/components/AlertBanner/AlertBanner.css +144 -0
- package/src/components/AlertBanner/AlertBanner.stories.tsx +165 -0
- package/src/components/AlertBanner/AlertBanner.tsx +90 -0
- package/src/components/AlertBanner/index.ts +11 -0
- package/src/components/Breadcrumbs/Breadcrumbs.css +60 -0
- package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +195 -0
- package/src/components/Breadcrumbs/Breadcrumbs.tsx +71 -0
- package/src/components/Breadcrumbs/index.ts +11 -0
- package/src/components/Button/Button.css +213 -0
- package/src/components/Button/Button.mdx +133 -0
- package/src/components/Button/Button.stories.tsx +398 -0
- package/src/components/Button/Button.tsx +121 -0
- package/src/components/Button/index.ts +11 -0
- package/src/components/Card/Card.css +34 -0
- package/src/components/Card/Card.stories.tsx +76 -0
- package/src/components/Card/Card.tsx +34 -0
- package/src/components/Card/index.ts +10 -0
- package/src/components/CartItem/CartItem.css +509 -0
- package/src/components/CartItem/CartItem.stories.tsx +628 -0
- package/src/components/CartItem/CartItem.tsx +467 -0
- package/src/components/CartItem/CartItemSkeleton.tsx +38 -0
- package/src/components/CartItem/index.ts +12 -0
- package/src/components/CartList/CartList.css +35 -0
- package/src/components/CartList/CartList.stories.tsx +111 -0
- package/src/components/CartList/CartList.tsx +40 -0
- package/src/components/CartList/index.ts +11 -0
- package/src/components/Checkbox/Checkbox.css +255 -0
- package/src/components/Checkbox/Checkbox.stories.tsx +290 -0
- package/src/components/Checkbox/Checkbox.tsx +138 -0
- package/src/components/Checkbox/index.ts +10 -0
- package/src/components/ColorSwatch/ColorSwatch.css +132 -0
- package/src/components/ColorSwatch/ColorSwatch.stories.tsx +274 -0
- package/src/components/ColorSwatch/ColorSwatch.tsx +127 -0
- package/src/components/ColorSwatch/index.ts +11 -0
- package/src/components/ContentGrid/ContentGrid.css +54 -0
- package/src/components/ContentGrid/ContentGrid.stories.tsx +137 -0
- package/src/components/ContentGrid/ContentGrid.tsx +57 -0
- package/src/components/ContentGrid/index.ts +11 -0
- package/src/components/Divider/Divider.css +22 -0
- package/src/components/Divider/Divider.stories.tsx +62 -0
- package/src/components/Divider/Divider.tsx +33 -0
- package/src/components/Divider/index.ts +11 -0
- package/src/components/Field/Field.css +83 -0
- package/src/components/Field/Field.stories.tsx +238 -0
- package/src/components/Field/Field.tsx +84 -0
- package/src/components/Field/index.ts +10 -0
- package/src/components/Header/Header.css +56 -0
- package/src/components/Header/Header.stories.tsx +180 -0
- package/src/components/Header/Header.tsx +81 -0
- package/src/components/Header/index.ts +11 -0
- package/src/components/Icon/Icon.css +26 -0
- package/src/components/Icon/Icon.stories.helpers.jsx +21 -0
- package/src/components/Icon/Icon.stories.tsx +98 -0
- package/src/components/Icon/Icon.tsx +112 -0
- package/src/components/Icon/index.ts +10 -0
- package/src/components/IllustratedMessage/IllustratedMessage.css +61 -0
- package/src/components/IllustratedMessage/IllustratedMessage.stories.tsx +126 -0
- package/src/components/IllustratedMessage/IllustratedMessage.tsx +78 -0
- package/src/components/IllustratedMessage/index.ts +11 -0
- package/src/components/Image/Image.css +52 -0
- package/src/components/Image/Image.stories.tsx +89 -0
- package/src/components/Image/Image.tsx +66 -0
- package/src/components/Image/index.ts +10 -0
- package/src/components/ImageSwatch/ImageSwatch.css +154 -0
- package/src/components/ImageSwatch/ImageSwatch.stories.tsx +310 -0
- package/src/components/ImageSwatch/ImageSwatch.tsx +123 -0
- package/src/components/ImageSwatch/index.ts +11 -0
- package/src/components/InLineAlert/InLineAlert.css +116 -0
- package/src/components/InLineAlert/InLineAlert.stories.tsx +326 -0
- package/src/components/InLineAlert/InLineAlert.tsx +128 -0
- package/src/components/InLineAlert/index.ts +11 -0
- package/src/components/Incrementer/Incrementer.css +165 -0
- package/src/components/Incrementer/Incrementer.stories.tsx +172 -0
- package/src/components/Incrementer/Incrementer.tsx +192 -0
- package/src/components/Incrementer/index.ts +10 -0
- package/src/components/Input/Input.css +304 -0
- package/src/components/Input/Input.stories.tsx +155 -0
- package/src/components/Input/Input.tsx +166 -0
- package/src/components/Input/index.ts +11 -0
- package/src/components/InputDate/InputDate.css +56 -0
- package/src/components/InputDate/InputDate.stories.tsx +117 -0
- package/src/components/InputDate/InputDate.tsx +120 -0
- package/src/components/InputDate/index.ts +11 -0
- package/src/components/InputPassword/InputPassword.css +31 -0
- package/src/components/InputPassword/InputPassword.stories.tsx +148 -0
- package/src/components/InputPassword/InputPassword.tsx +135 -0
- package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.css +31 -0
- package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.tsx +96 -0
- package/src/components/InputPassword/PasswordStatusIndicator/index.ts +11 -0
- package/src/components/InputPassword/index.ts +11 -0
- package/src/components/Modal/Modal.css +125 -0
- package/src/components/Modal/Modal.stories.tsx +250 -0
- package/src/components/Modal/Modal.tsx +157 -0
- package/src/components/Modal/index.ts +10 -0
- package/src/components/Pagination/Pagination.css +95 -0
- package/src/components/Pagination/Pagination.stories.tsx +117 -0
- package/src/components/Pagination/Pagination.tsx +149 -0
- package/src/components/Pagination/index.ts +11 -0
- package/src/components/Picker/Picker.css +220 -0
- package/src/components/Picker/Picker.stories.tsx +318 -0
- package/src/components/Picker/Picker.tsx +203 -0
- package/src/components/Picker/index.ts +10 -0
- package/src/components/Price/Price.css +57 -0
- package/src/components/Price/Price.stories.tsx +110 -0
- package/src/components/Price/Price.tsx +75 -0
- package/src/components/Price/index.ts +10 -0
- package/src/components/PriceRange/PriceRange.css +66 -0
- package/src/components/PriceRange/PriceRange.stories.tsx +240 -0
- package/src/components/PriceRange/PriceRange.tsx +248 -0
- package/src/components/PriceRange/index.ts +11 -0
- package/src/components/ProgressSpinner/ProgressSpinner.css +91 -0
- package/src/components/ProgressSpinner/ProgressSpinner.stories.tsx +300 -0
- package/src/components/ProgressSpinner/ProgressSpinner.tsx +86 -0
- package/src/components/ProgressSpinner/index.ts +11 -0
- package/src/components/RadioButton/RadioButton.css +134 -0
- package/src/components/RadioButton/RadioButton.stories.tsx +126 -0
- package/src/components/RadioButton/RadioButton.tsx +86 -0
- package/src/components/RadioButton/index.ts +11 -0
- package/src/components/Skeleton/Skeleton.css +145 -0
- package/src/components/Skeleton/Skeleton.stories.tsx +265 -0
- package/src/components/Skeleton/Skeleton.tsx +133 -0
- package/src/components/Skeleton/index.ts +10 -0
- package/src/components/Tag/Tag.css +26 -0
- package/src/components/Tag/Tag.stories.tsx +103 -0
- package/src/components/Tag/Tag.tsx +38 -0
- package/src/components/Tag/index.ts +11 -0
- package/src/components/TextArea/TextArea.css +140 -0
- package/src/components/TextArea/TextArea.stories.tsx +130 -0
- package/src/components/TextArea/TextArea.tsx +89 -0
- package/src/components/TextArea/index.ts +11 -0
- package/src/components/TextSwatch/TextSwatch.css +152 -0
- package/src/components/TextSwatch/TextSwatch.stories.tsx +277 -0
- package/src/components/TextSwatch/TextSwatch.tsx +131 -0
- package/src/components/TextSwatch/index.ts +11 -0
- package/src/components/ToggleButton/ToggleButton.css +95 -0
- package/src/components/ToggleButton/ToggleButton.stories.tsx +190 -0
- package/src/components/ToggleButton/ToggleButton.tsx +75 -0
- package/src/components/ToggleButton/index.ts +11 -0
- package/src/components/UIProvider/UIProvider.css +140 -0
- package/src/components/UIProvider/UIProvider.tsx +61 -0
- package/src/components/UIProvider/debugger.css +47 -0
- package/src/components/UIProvider/index.ts +10 -0
- package/src/components/UIProvider/normalize.css +26 -0
- package/src/components/index.ts +49 -0
- package/src/docs/API/event-bus.mdx +52 -0
- package/src/docs/API/graphql.mdx +214 -0
- package/src/docs/API/initializer.mdx +119 -0
- package/src/docs/API/render.mdx +125 -0
- package/src/docs/Design/colors.mdx +202 -0
- package/src/docs/Design/designBlocks.jsx +87 -0
- package/src/docs/Design/getTokenData.ts +28 -0
- package/src/docs/Design/grid.mdx +365 -0
- package/src/docs/Design/overview.mdx +69 -0
- package/src/docs/Design/shapes.mdx +100 -0
- package/src/docs/Design/spacing.mdx +22 -0
- package/src/docs/Design/typography.mdx +126 -0
- package/src/docs/Utilities/classList.mdx +52 -0
- package/src/docs/Utilities/debounce.mdx +49 -0
- package/src/docs/Utilities/deepmerge.mdx +12 -0
- package/src/docs/Utilities/getFormErrors.mdx +41 -0
- package/src/docs/Utilities/getFormValues.mdx +38 -0
- package/src/docs/assets/Banner.png +0 -0
- package/src/docs/assets/Colors.png +0 -0
- package/src/docs/assets/DropinBanner.png +0 -0
- package/src/docs/assets/ShapeStyles.png +0 -0
- package/src/docs/assets/Spacing.png +0 -0
- package/src/docs/assets/Typography.png +0 -0
- package/src/docs/cli-usage.mdx +181 -0
- package/src/docs/components/overview.mdx +124 -0
- package/src/docs/quick-start.mdx +245 -0
- package/src/docs/slots.mdx +211 -0
- package/src/docs/welcome.mdx +52 -0
- package/src/i18n/en_US.json +146 -0
- package/src/i18n/index.ts +26 -0
- package/src/icons/Add.svg +9 -0
- package/src/icons/AddressBook.svg +3 -0
- package/src/icons/Bulk.svg +24 -0
- package/src/icons/Burger.svg +5 -0
- package/src/icons/Card.svg +7 -0
- package/src/icons/Cart.svg +11 -0
- package/src/icons/Check.svg +8 -0
- package/src/icons/CheckWithCircle.svg +4 -0
- package/src/icons/ChevronDown.svg +3 -0
- package/src/icons/ChevronRight.svg +8 -0
- package/src/icons/ChevronUp.svg +3 -0
- package/src/icons/Close.svg +4 -0
- package/src/icons/Coupon.svg +3 -0
- package/src/icons/Date.svg +4 -0
- package/src/icons/Delivery.svg +11 -0
- package/src/icons/EmptyBox.svg +3 -0
- package/src/icons/Eye.svg +3 -0
- package/src/icons/EyeClose.svg +3 -0
- package/src/icons/Gift.svg +3 -0
- package/src/icons/GiftCard.svg +3 -0
- package/src/icons/Heart.svg +3 -0
- package/src/icons/HeartFilled.svg +3 -0
- package/src/icons/InfoFilled.svg +3 -0
- package/src/icons/Locker.svg +11 -0
- package/src/icons/Minus.svg +3 -0
- package/src/icons/Order.svg +6 -0
- package/src/icons/OrderError.svg +15 -0
- package/src/icons/OrderSuccess.svg +15 -0
- package/src/icons/PaymentError.svg +16 -0
- package/src/icons/Placeholder.svg +3 -0
- package/src/icons/PlaceholderFilled.svg +4 -0
- package/src/icons/Search.svg +9 -0
- package/src/icons/SearchFilled.svg +10 -0
- package/src/icons/Sort.svg +12 -0
- package/src/icons/Star.svg +8 -0
- package/src/icons/Trash.svg +7 -0
- package/src/icons/User.svg +5 -0
- package/src/icons/View.svg +14 -0
- package/src/icons/Wallet.svg +6 -0
- package/src/icons/Warning.svg +12 -0
- package/src/icons/WarningFilled.svg +3 -0
- package/src/icons/WarningWithCircle.svg +4 -0
- package/src/icons/index.ts +42 -0
- package/src/lib/classes.ts +34 -0
- package/src/lib/config.ts +24 -0
- package/src/lib/debounce.ts +16 -0
- package/src/lib/deepmerge.ts +45 -0
- package/src/lib/deviceUtils.ts +16 -0
- package/src/lib/form-values.ts +31 -0
- package/src/lib/i18n.ts +18 -0
- package/src/lib/image-params-keymap.ts +36 -0
- package/src/lib/index.ts +24 -0
- package/src/lib/initializer.ts +134 -0
- package/src/lib/is-number.ts +12 -0
- package/src/lib/render.tsx +138 -0
- package/src/lib/resolve-image.ts +101 -0
- package/src/lib/signals.ts +11 -0
- package/src/lib/slot.tsx +434 -0
- package/src/lib/tests.tsx +47 -0
- package/src/lib/types.ts +16 -0
- package/src/lib/vcomponent.tsx +42 -0
- package/static/assets/images/Card.png +0 -0
- package/static/assets/images/example.jpg +0 -0
- package/static/assets/images/index.ts +11 -0
- package/static/dropin.png +0 -0
- package/static/favicon.svg +14 -0
- package/storybook-stories.js +21 -0
- package/tests/__mocks__/browserMocks.ts +28 -0
- package/tests/__mocks__/fileMocks.ts +12 -0
- package/tests/__mocks__/styleMock.ts +0 -0
- package/types/icons.d.ts +18 -0
|
@@ -0,0 +1,88 @@
|
|
|
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 React from 'react';
|
|
11
|
+
import styles from './OptionsTable.module.css';
|
|
12
|
+
|
|
13
|
+
export function OptionsTable({ options, compact = false }) {
|
|
14
|
+
const [headers, ...rows] = options;
|
|
15
|
+
|
|
16
|
+
const cellClassName = compact ? styles.compactCell : styles.cell;
|
|
17
|
+
|
|
18
|
+
const newHeaders = headers.map((header) => {
|
|
19
|
+
const isCodeHeader = header.endsWith('(code)');
|
|
20
|
+
const headerText = isCodeHeader ? header.replace('(code)', '') : header;
|
|
21
|
+
const minWidthMatch = headerText.match(/\d+px/);
|
|
22
|
+
const minWidth = minWidthMatch ? minWidthMatch[0] : null;
|
|
23
|
+
const newHeaderText = minWidth
|
|
24
|
+
? headerText.replace(minWidth, '')
|
|
25
|
+
: headerText;
|
|
26
|
+
|
|
27
|
+
return {
|
|
28
|
+
text: newHeaderText,
|
|
29
|
+
minWidth: minWidth,
|
|
30
|
+
};
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
const newRows = rows.map((row) => {
|
|
34
|
+
if (row.length === 0) {
|
|
35
|
+
return [' ', ' ', ' ', ' '];
|
|
36
|
+
} else {
|
|
37
|
+
return row;
|
|
38
|
+
}
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
return (
|
|
42
|
+
<div className={styles.optionsTable}>
|
|
43
|
+
<table className={styles.table}>
|
|
44
|
+
<thead className={styles.tableHeader}>
|
|
45
|
+
<tr className={styles.headerRow}>
|
|
46
|
+
{newHeaders.map((header, index) => {
|
|
47
|
+
const isCodeHeader = headers[index].endsWith('(code)');
|
|
48
|
+
let headerClassName = styles.headerCell;
|
|
49
|
+
if (header.minWidth) {
|
|
50
|
+
headerClassName += ` ${styles.minWidth}`;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return (
|
|
54
|
+
<th
|
|
55
|
+
key={headers[index]}
|
|
56
|
+
className={headerClassName}
|
|
57
|
+
style={{ minWidth: header.minWidth }}
|
|
58
|
+
>
|
|
59
|
+
{header.text}
|
|
60
|
+
</th>
|
|
61
|
+
);
|
|
62
|
+
})}
|
|
63
|
+
</tr>
|
|
64
|
+
</thead>
|
|
65
|
+
<tbody className={styles.body}>
|
|
66
|
+
{newRows.map((row, rowIndex) => (
|
|
67
|
+
<tr key={rowIndex}>
|
|
68
|
+
{row.map((cell, index) => {
|
|
69
|
+
const isCodeCell = headers[index].endsWith('(code)');
|
|
70
|
+
let cellClassNameOverride = isCodeCell
|
|
71
|
+
? compact
|
|
72
|
+
? styles.compactCodeCell
|
|
73
|
+
: styles.codeCell
|
|
74
|
+
: cellClassName;
|
|
75
|
+
|
|
76
|
+
return (
|
|
77
|
+
<td key={index} className={cellClassNameOverride}>
|
|
78
|
+
{cell}
|
|
79
|
+
</td>
|
|
80
|
+
);
|
|
81
|
+
})}
|
|
82
|
+
</tr>
|
|
83
|
+
))}
|
|
84
|
+
</tbody>
|
|
85
|
+
</table>
|
|
86
|
+
</div>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
@@ -0,0 +1,104 @@
|
|
|
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
|
+
.optionsTable {
|
|
11
|
+
margin-left: -1.25rem;
|
|
12
|
+
margin-right: -1.25rem;
|
|
13
|
+
margin-bottom: 1rem;
|
|
14
|
+
margin-top: 1.5rem;
|
|
15
|
+
overflow-x: auto;
|
|
16
|
+
overscroll-behavior-x: contain;
|
|
17
|
+
padding-left: 1.5rem;
|
|
18
|
+
padding-right: 1.5rem;
|
|
19
|
+
padding-bottom: 1rem;
|
|
20
|
+
mask-image: linear-gradient(
|
|
21
|
+
transparent 0.8em,
|
|
22
|
+
white 1.5em,
|
|
23
|
+
white calc(100% - 1.5em),
|
|
24
|
+
transparent calc(100% - 0.8em)
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.optionsTable::-webkit-scrollbar {
|
|
29
|
+
width: 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.table {
|
|
33
|
+
border-collapse: collapse;
|
|
34
|
+
font-size: 0.9rem;
|
|
35
|
+
line-height: 1.25rem;
|
|
36
|
+
width: 100%;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
.tableHeader {
|
|
40
|
+
border-top: 0 none transparent;
|
|
41
|
+
border-bottom: 1px solid rgb(220, 220, 220);
|
|
42
|
+
padding: 1rem 0;
|
|
43
|
+
text-align: left;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
.headerRow {
|
|
47
|
+
border-top: 0 none transparent;
|
|
48
|
+
border-bottom: 1px solid rgb(220, 220, 220);
|
|
49
|
+
padding: 1rem 0;
|
|
50
|
+
text-align: left;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.headerCell {
|
|
54
|
+
border: none;
|
|
55
|
+
padding: 0.5rem 0;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
color: #222;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.body {
|
|
61
|
+
vertical-align: baseline;
|
|
62
|
+
color: rgb(17 24 39);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.row {
|
|
66
|
+
border-bottom: 1px solid rgb(135, 29, 29);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.cell {
|
|
70
|
+
padding: 0.5rem 0 0.5rem 0;
|
|
71
|
+
line-height: 1.5rem;
|
|
72
|
+
font-family: inherit;
|
|
73
|
+
border-bottom: 1px solid rgb(220, 220, 220);
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.codeCell {
|
|
77
|
+
border: none;
|
|
78
|
+
white-space: pre;
|
|
79
|
+
padding: 0.5rem 0 0.5rem 0;
|
|
80
|
+
line-height: 1.5rem;
|
|
81
|
+
font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
|
|
82
|
+
font-size: 0.75rem;
|
|
83
|
+
color: rgb(0, 93, 160);
|
|
84
|
+
border-bottom: 1px solid rgb(220, 220, 220);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.compactCell {
|
|
88
|
+
padding: 0;
|
|
89
|
+
border: none;
|
|
90
|
+
line-height: 1.5rem;
|
|
91
|
+
font-family: inherit;
|
|
92
|
+
border-bottom: 1px solid rgb(220, 220, 220);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.compactCodeCell {
|
|
96
|
+
border: none;
|
|
97
|
+
white-space: pre;
|
|
98
|
+
padding: 0;
|
|
99
|
+
line-height: 1.5rem;
|
|
100
|
+
font-family: Menlo, Monaco, Consolas, 'Courier New', monospace;
|
|
101
|
+
font-size: 0.75rem;
|
|
102
|
+
color: rgb(0, 93, 160);
|
|
103
|
+
border-bottom: 1px solid rgb(220, 220, 220);
|
|
104
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/OptionsTable/OptionsTable';
|
|
@@ -0,0 +1,56 @@
|
|
|
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
|
+
.panel {
|
|
11
|
+
box-sizing: border-box;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
border: 1px solid #d5d5d5;
|
|
15
|
+
border-radius: 0.25rem;
|
|
16
|
+
padding: 1rem;
|
|
17
|
+
width: 100%;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
.panelHeader {
|
|
21
|
+
display: flex;
|
|
22
|
+
align-items: center;
|
|
23
|
+
justify-content: center;
|
|
24
|
+
background-color: #f5f5f5;
|
|
25
|
+
width: 100%;
|
|
26
|
+
height: 100%;
|
|
27
|
+
min-height: 130px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.panelHeader img {
|
|
31
|
+
object-fit: cover;
|
|
32
|
+
width: 100%;
|
|
33
|
+
height: 100%;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
.panelContent {
|
|
37
|
+
display: flex;
|
|
38
|
+
flex-direction: column;
|
|
39
|
+
width: 100%;
|
|
40
|
+
height: 100%;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.panelContent h3 {
|
|
44
|
+
margin: 1rem 0 0 0;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.panelFooter {
|
|
48
|
+
display: flex;
|
|
49
|
+
align-items: center;
|
|
50
|
+
justify-content: flex-end;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.panelFooter p:last-child {
|
|
55
|
+
margin: 0;
|
|
56
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
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, toChildArray } from 'preact';
|
|
11
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
12
|
+
import styles from './Panel.module.css';
|
|
13
|
+
|
|
14
|
+
export interface PanelProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
header?: boolean;
|
|
16
|
+
footer?: boolean;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export const Panel: FunctionComponent<PanelProps> = ({
|
|
20
|
+
header,
|
|
21
|
+
footer,
|
|
22
|
+
children,
|
|
23
|
+
}) => {
|
|
24
|
+
const hasHeader = Boolean(header);
|
|
25
|
+
const hasFooter = Boolean(footer);
|
|
26
|
+
const childrenArray = toChildArray(children);
|
|
27
|
+
const firstChild = childrenArray[0];
|
|
28
|
+
const lastChild = childrenArray.slice(-1)[0];
|
|
29
|
+
|
|
30
|
+
const content =
|
|
31
|
+
hasHeader && !hasFooter
|
|
32
|
+
? childrenArray.slice(1)
|
|
33
|
+
: !hasHeader && hasFooter
|
|
34
|
+
? childrenArray.slice(0, -1)
|
|
35
|
+
: hasHeader && hasFooter
|
|
36
|
+
? childrenArray.slice(1, -1)
|
|
37
|
+
: childrenArray;
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<div className={`${styles.panel}`}>
|
|
41
|
+
{hasHeader && <div className={styles.panelHeader}>{firstChild}</div>}
|
|
42
|
+
<div className={styles.panelContent}>{content}</div>
|
|
43
|
+
{hasFooter && <div className={styles.panelFooter}>{lastChild}</div>}
|
|
44
|
+
</div>
|
|
45
|
+
);
|
|
46
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/Panel/Panel';
|
|
@@ -0,0 +1,23 @@
|
|
|
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 styles from './Screenshot.module.css';
|
|
11
|
+
|
|
12
|
+
export function Screenshot({ src, alt }) {
|
|
13
|
+
const image = {
|
|
14
|
+
src,
|
|
15
|
+
alt,
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
return (
|
|
19
|
+
<div className={styles.screenshotContainer}>
|
|
20
|
+
<img src={image.src} alt={image.alt} className={styles.image} />
|
|
21
|
+
</div>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
.screenshotContainer {
|
|
11
|
+
margin-bottom: 24px;
|
|
12
|
+
margin-top: 6px;
|
|
13
|
+
display: flex;
|
|
14
|
+
justify-content: center;
|
|
15
|
+
overflow: hidden;
|
|
16
|
+
border-radius: 0.5rem;
|
|
17
|
+
border: 1px solid rgb(234, 237, 242);
|
|
18
|
+
background-color: rgb(250, 250, 252);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.image {
|
|
22
|
+
user-select: none;
|
|
23
|
+
background-color: white;
|
|
24
|
+
outline-width: 1px;
|
|
25
|
+
outline-color: rgb(156, 163, 175);
|
|
26
|
+
width: 100%;
|
|
27
|
+
object-fit: cover;
|
|
28
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/Screenshot/Screenshot';
|
|
@@ -0,0 +1,21 @@
|
|
|
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 { Unstyled } from '@storybook/blocks';
|
|
11
|
+
import styles from './Steps.module.css';
|
|
12
|
+
|
|
13
|
+
export function Steps({ children }) {
|
|
14
|
+
return (
|
|
15
|
+
<Unstyled>
|
|
16
|
+
<div className={`${styles.stepsContainer} ${styles.steps}`}>
|
|
17
|
+
{children}
|
|
18
|
+
</div>
|
|
19
|
+
</Unstyled>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
.stepsContainer {
|
|
11
|
+
counter-reset: step;
|
|
12
|
+
padding-left: 1.5rem;
|
|
13
|
+
margin-left: 0.75rem !important;
|
|
14
|
+
margin-bottom: 3rem;
|
|
15
|
+
border-left: 1px solid rgba(229, 231, 235);
|
|
16
|
+
overflow-wrap: break-word;
|
|
17
|
+
/* border-color: rgba(229,231,235);
|
|
18
|
+
border-left-width: 1px; */
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
.steps h3 {
|
|
22
|
+
counter-increment: step;
|
|
23
|
+
color: rgba(15, 23, 42);
|
|
24
|
+
letter-spacing: -0.015em;
|
|
25
|
+
margin: 2rem 0 0 0;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.steps h3::before {
|
|
29
|
+
display: inline-block;
|
|
30
|
+
border: 6px solid;
|
|
31
|
+
border-color: rgba(255, 255, 255);
|
|
32
|
+
background-color: rgba(243, 244, 246);
|
|
33
|
+
text-align: center;
|
|
34
|
+
color: rgba(122, 122, 122);
|
|
35
|
+
content: counter(step);
|
|
36
|
+
border-radius: 9999px;
|
|
37
|
+
margin: 0 0 0 -44px;
|
|
38
|
+
font-size: 1rem;
|
|
39
|
+
font-weight: 400;
|
|
40
|
+
height: 26px;
|
|
41
|
+
width: 26px;
|
|
42
|
+
line-height: 1.5rem;
|
|
43
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/Steps/Steps';
|
|
@@ -0,0 +1,18 @@
|
|
|
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 styles from './StoryWrapper.module.css';
|
|
11
|
+
|
|
12
|
+
export function StoryWrapper({ direction = 'row', children }) {
|
|
13
|
+
const root = document.documentElement;
|
|
14
|
+
|
|
15
|
+
root.style.setProperty('--flex-direction', direction);
|
|
16
|
+
|
|
17
|
+
return <div className={`${styles.flexItems}`}>{children}</div>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
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
|
+
:root {
|
|
11
|
+
--flex-direction: row;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.flexItems {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: var(--flex-direction);
|
|
17
|
+
gap: 2rem;
|
|
18
|
+
margin-top: 1rem;
|
|
19
|
+
margin-bottom: 0;
|
|
20
|
+
background-color: #f5f5f5;
|
|
21
|
+
padding: 1rem;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/StoryWrapper/StoryWrapper';
|
|
@@ -0,0 +1,19 @@
|
|
|
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 { Unstyled } from '@storybook/blocks';
|
|
11
|
+
import styles from './Summary.module.css';
|
|
12
|
+
|
|
13
|
+
export function Summary({ children }) {
|
|
14
|
+
return (
|
|
15
|
+
<Unstyled>
|
|
16
|
+
<div className={`${styles.summary}`}>{children}</div>
|
|
17
|
+
</Unstyled>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
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
|
+
div.summary {
|
|
11
|
+
font-weight: 400;
|
|
12
|
+
margin: 0 0 1rem 0;
|
|
13
|
+
color: #6d6d6d;
|
|
14
|
+
font-size: 1.3rem;
|
|
15
|
+
line-height: 1.8rem;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
div.summary strong {
|
|
19
|
+
color: #222222;
|
|
20
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/Summary/Summary';
|
|
@@ -0,0 +1,57 @@
|
|
|
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 { useState } from 'preact/hooks';
|
|
11
|
+
import { useOf, Story, Source } from '@storybook/blocks';
|
|
12
|
+
import './docs.css';
|
|
13
|
+
|
|
14
|
+
export const Variants = ({ of, storyOrder = [] }) => {
|
|
15
|
+
const info = useOf(of || 'story', ['story', 'meta', 'component']);
|
|
16
|
+
const stories = Object.values(info.csfFile.stories).map(
|
|
17
|
+
(story) => story.moduleExport
|
|
18
|
+
);
|
|
19
|
+
const [bgColor, setBgColor] = useState('#F5F5F5');
|
|
20
|
+
const toggleBgColor = () => {
|
|
21
|
+
setBgColor((prevColor) =>
|
|
22
|
+
prevColor === '#F5F5F5' ? '#222222' : '#F5F5F5'
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
// Sort stories by custom order
|
|
27
|
+
const sortedStories = Object.values(stories).sort((a, b) => {
|
|
28
|
+
const indexA = storyOrder.indexOf(a);
|
|
29
|
+
const indexB = storyOrder.indexOf(b);
|
|
30
|
+
if (indexA === -1 || indexB === -1) {
|
|
31
|
+
return 0; // do not change order if story name is not in customOrder
|
|
32
|
+
}
|
|
33
|
+
return indexA - indexB;
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div>
|
|
38
|
+
<button onClick={toggleBgColor}>Toggle Background Color</button>
|
|
39
|
+
<div className="stories">
|
|
40
|
+
{sortedStories.map((story, index) => (
|
|
41
|
+
<div key={index} className="story">
|
|
42
|
+
<div className="story__item story__item--left">
|
|
43
|
+
<h3 className="docs__header3">{story.name}</h3>
|
|
44
|
+
<p className="docs__paragraph">
|
|
45
|
+
{story.parameters.docs.description || `Add description to ${story.name}.stories.tsx.`}
|
|
46
|
+
</p>
|
|
47
|
+
</div>
|
|
48
|
+
<div className="story__item story__item--right" style={{ backgroundColor: bgColor }}>
|
|
49
|
+
<Story of={story} />
|
|
50
|
+
<Source of={story} />
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
))}
|
|
54
|
+
</div>
|
|
55
|
+
</div>
|
|
56
|
+
);
|
|
57
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
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
|
+
.stories {
|
|
11
|
+
display: flex;
|
|
12
|
+
flex-direction: column;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
.stories .story {
|
|
16
|
+
display: flex;
|
|
17
|
+
flex-direction: row;
|
|
18
|
+
border: 1px solid #ddd;
|
|
19
|
+
margin-top: 0.5rem;
|
|
20
|
+
margin-bottom: 0.5rem;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.story__item {
|
|
24
|
+
min-height: 0;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.story__item--left {
|
|
28
|
+
display: flex;
|
|
29
|
+
flex-direction: column;
|
|
30
|
+
padding: 1rem;
|
|
31
|
+
flex-basis: 30%;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.story__item--right {
|
|
35
|
+
display: flex;
|
|
36
|
+
flex-direction: column;
|
|
37
|
+
padding: 1rem;
|
|
38
|
+
flex-basis: 70%;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
.stories .docs__header3.docs__header3 {
|
|
42
|
+
margin-top: 4px;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.stories .docs__paragraph.docs__paragraph {
|
|
46
|
+
margin-top: 0;
|
|
47
|
+
font-size: 1rem;
|
|
48
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/********************************************************************
|
|
2
|
+
* Copyright 2024 Adobe
|
|
3
|
+
* All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* NOTICE: Adobe permits you to use, modify, and distribute this
|
|
6
|
+
* file in accordance with the terms of the Adobe license agreement
|
|
7
|
+
* accompanying it.
|
|
8
|
+
*******************************************************************/
|
|
9
|
+
|
|
10
|
+
export * from '@adobe-commerce/elsie/config/storybook/components/Variants/Variants';
|