@dropins/tools 0.21.1 → 0.21.2-alpha1
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/components/Accordion/Accordion.d.ts +25 -0
- package/components/Accordion/Accordion.d.ts.map +1 -0
- package/components/Accordion/Accordion.jsx +59 -0
- package/components/Accordion/Accordion.stories.d.ts +22 -0
- package/components/Accordion/Accordion.stories.d.ts.map +1 -0
- package/components/Accordion/Accordion.stories.jsx +320 -0
- package/components/Accordion/Accordion.test.d.ts +3 -0
- package/components/Accordion/Accordion.test.d.ts.map +1 -0
- package/components/Accordion/Accordion.test.jsx +79 -0
- package/components/Accordion/index.d.ts +3 -0
- package/components/Accordion/index.d.ts.map +1 -0
- package/components/Accordion/index.js +2 -0
- package/components/ActionButton/ActionButton.d.ts +11 -0
- package/components/ActionButton/ActionButton.d.ts.map +1 -0
- package/components/ActionButton/ActionButton.jsx +14 -0
- package/components/ActionButton/ActionButton.stories.d.ts +16 -0
- package/components/ActionButton/ActionButton.stories.d.ts.map +1 -0
- package/components/ActionButton/ActionButton.stories.jsx +119 -0
- package/components/ActionButton/ActionButton.test.d.ts +3 -0
- package/components/ActionButton/ActionButton.test.d.ts.map +1 -0
- package/components/ActionButton/ActionButton.test.jsx +47 -0
- package/components/ActionButton/index.d.ts +2 -0
- package/components/ActionButton/index.d.ts.map +1 -0
- package/components/ActionButton/index.js +1 -0
- package/components/ActionButtonGroup/ActionButtonGroup.d.ts +20 -0
- package/components/ActionButtonGroup/ActionButtonGroup.d.ts.map +1 -0
- package/components/ActionButtonGroup/ActionButtonGroup.jsx +39 -0
- package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts +16 -0
- package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts.map +1 -0
- package/components/ActionButtonGroup/ActionButtonGroup.stories.jsx +72 -0
- package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts +3 -0
- package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts.map +1 -0
- package/components/ActionButtonGroup/ActionButtonGroup.test.jsx +78 -0
- package/components/ActionButtonGroup/index.d.ts +2 -0
- package/components/ActionButtonGroup/index.d.ts.map +1 -0
- package/components/ActionButtonGroup/index.js +1 -0
- package/components/AlertBanner/AlertBanner.d.ts +15 -0
- package/components/AlertBanner/AlertBanner.d.ts.map +1 -0
- package/components/AlertBanner/AlertBanner.jsx +30 -0
- package/components/AlertBanner/AlertBanner.stories.d.ts +17 -0
- package/components/AlertBanner/AlertBanner.stories.d.ts.map +1 -0
- package/components/AlertBanner/AlertBanner.stories.jsx +128 -0
- package/components/AlertBanner/AlertBanner.test.d.ts +3 -0
- package/components/AlertBanner/AlertBanner.test.d.ts.map +1 -0
- package/components/AlertBanner/AlertBanner.test.jsx +40 -0
- package/components/AlertBanner/index.d.ts +3 -0
- package/components/AlertBanner/index.d.ts.map +1 -0
- package/components/AlertBanner/index.js +2 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts +9 -0
- package/components/Breadcrumbs/Breadcrumbs.d.ts.map +1 -0
- package/components/Breadcrumbs/Breadcrumbs.jsx +26 -0
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts +15 -0
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +1 -0
- package/components/Breadcrumbs/Breadcrumbs.stories.jsx +110 -0
- package/components/Breadcrumbs/Breadcrumbs.test.d.ts +3 -0
- package/components/Breadcrumbs/Breadcrumbs.test.d.ts.map +1 -0
- package/components/Breadcrumbs/Breadcrumbs.test.jsx +67 -0
- package/components/Breadcrumbs/index.d.ts +3 -0
- package/components/Breadcrumbs/index.d.ts.map +1 -0
- package/components/Breadcrumbs/index.js +2 -0
- package/components/Button/Button.d.ts +15 -0
- package/components/Button/Button.d.ts.map +1 -0
- package/components/Button/Button.jsx +59 -0
- package/components/Button/Button.stories.d.ts +135 -0
- package/components/Button/Button.stories.d.ts.map +1 -0
- package/components/Button/Button.stories.jsx +354 -0
- package/components/Button/Button.test.d.ts +2 -0
- package/components/Button/Button.test.d.ts.map +1 -0
- package/components/Button/Button.test.jsx +134 -0
- package/components/Button/index.d.ts +3 -0
- package/components/Button/index.d.ts.map +1 -0
- package/components/Button/index.js +2 -0
- package/components/Card/Card.d.ts +9 -0
- package/components/Card/Card.d.ts.map +1 -0
- package/components/Card/Card.jsx +7 -0
- package/components/Card/Card.stories.d.ts +16 -0
- package/components/Card/Card.stories.d.ts.map +1 -0
- package/components/Card/Card.stories.jsx +47 -0
- package/components/Card/Card.test.d.ts +3 -0
- package/components/Card/Card.test.d.ts.map +1 -0
- package/components/Card/Card.test.jsx +26 -0
- package/components/Card/index.d.ts +2 -0
- package/components/Card/index.d.ts.map +1 -0
- package/components/Card/index.js +1 -0
- package/components/CartItem/CartItem.d.ts +25 -0
- package/components/CartItem/CartItem.d.ts.map +1 -0
- package/components/CartItem/CartItem.jsx +124 -0
- package/components/CartItem/CartItem.stories.d.ts +54 -0
- package/components/CartItem/CartItem.stories.d.ts.map +1 -0
- package/components/CartItem/CartItem.stories.jsx +309 -0
- package/components/CartItem/CartItem.test.d.ts +3 -0
- package/components/CartItem/CartItem.test.d.ts.map +1 -0
- package/components/CartItem/CartItem.test.jsx +71 -0
- package/components/CartItem/CartItemSkeleton.d.ts +3 -0
- package/components/CartItem/CartItemSkeleton.d.ts.map +1 -0
- package/components/CartItem/CartItemSkeleton.jsx +25 -0
- package/components/CartItem/CartItemSkeleton.test.d.ts +3 -0
- package/components/CartItem/CartItemSkeleton.test.d.ts.map +1 -0
- package/components/CartItem/CartItemSkeleton.test.jsx +11 -0
- package/components/CartItem/index.d.ts +4 -0
- package/components/CartItem/index.d.ts.map +1 -0
- package/components/CartItem/index.js +3 -0
- package/components/CartList/CartList.d.ts +7 -0
- package/components/CartList/CartList.d.ts.map +1 -0
- package/components/CartList/CartList.jsx +14 -0
- package/components/CartList/CartList.stories.d.ts +17 -0
- package/components/CartList/CartList.stories.d.ts.map +1 -0
- package/components/CartList/CartList.stories.jsx +54 -0
- package/components/CartList/CartList.test.d.ts +3 -0
- package/components/CartList/CartList.test.d.ts.map +1 -0
- package/components/CartList/CartList.test.jsx +12 -0
- package/components/CartList/index.d.ts +3 -0
- package/components/CartList/index.d.ts.map +1 -0
- package/components/CartList/index.js +2 -0
- package/components/Checkbox/Checkbox.d.ts +13 -0
- package/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/components/Checkbox/Checkbox.jsx +51 -0
- package/components/Checkbox/Checkbox.stories.d.ts +22 -0
- package/components/Checkbox/Checkbox.stories.d.ts.map +1 -0
- package/components/Checkbox/Checkbox.stories.jsx +157 -0
- package/components/Checkbox/Checkbox.test.d.ts +3 -0
- package/components/Checkbox/Checkbox.test.d.ts.map +1 -0
- package/components/Checkbox/Checkbox.test.jsx +136 -0
- package/components/Checkbox/index.d.ts +2 -0
- package/components/Checkbox/index.d.ts.map +1 -0
- package/components/Checkbox/index.js +1 -0
- package/components/ColorSwatch/ColorSwatch.d.ts +20 -0
- package/components/ColorSwatch/ColorSwatch.d.ts.map +1 -0
- package/components/ColorSwatch/ColorSwatch.jsx +57 -0
- package/components/ColorSwatch/ColorSwatch.stories.d.ts +20 -0
- package/components/ColorSwatch/ColorSwatch.stories.d.ts.map +1 -0
- package/components/ColorSwatch/ColorSwatch.stories.jsx +206 -0
- package/components/ColorSwatch/ColorSwatch.test.d.ts +3 -0
- package/components/ColorSwatch/ColorSwatch.test.d.ts.map +1 -0
- package/components/ColorSwatch/ColorSwatch.test.jsx +87 -0
- package/components/ColorSwatch/index.d.ts +3 -0
- package/components/ColorSwatch/index.d.ts.map +1 -0
- package/components/ColorSwatch/index.js +2 -0
- package/components/Divider/Divider.d.ts +8 -0
- package/components/Divider/Divider.d.ts.map +1 -0
- package/components/Divider/Divider.jsx +9 -0
- package/components/Divider/Divider.stories.d.ts +11 -0
- package/components/Divider/Divider.stories.d.ts.map +1 -0
- package/components/Divider/Divider.stories.jsx +43 -0
- package/components/Divider/Divider.test.d.ts +2 -0
- package/components/Divider/Divider.test.d.ts.map +1 -0
- package/components/Divider/Divider.test.jsx +19 -0
- package/components/Divider/index.d.ts +3 -0
- package/components/Divider/index.d.ts.map +1 -0
- package/components/Divider/index.js +2 -0
- package/components/Field/Field.d.ts +14 -0
- package/components/Field/Field.d.ts.map +1 -0
- package/components/Field/Field.jsx +29 -0
- package/components/Field/Field.stories.d.ts +37 -0
- package/components/Field/Field.stories.d.ts.map +1 -0
- package/components/Field/Field.stories.jsx +174 -0
- package/components/Field/Field.test.d.ts +3 -0
- package/components/Field/Field.test.d.ts.map +1 -0
- package/components/Field/Field.test.jsx +91 -0
- package/components/Field/index.d.ts +2 -0
- package/components/Field/index.d.ts.map +1 -0
- package/components/Field/index.js +1 -0
- package/components/Icon/Icon.d.ts +11 -0
- package/components/Icon/Icon.d.ts.map +1 -0
- package/components/Icon/Icon.jsx +57 -0
- package/components/Icon/Icon.stories.d.ts +16 -0
- package/components/Icon/Icon.stories.d.ts.map +1 -0
- package/components/Icon/Icon.stories.helpers.d.ts +4 -0
- package/components/Icon/Icon.stories.helpers.d.ts.map +1 -0
- package/components/Icon/Icon.stories.helpers.jsx +7 -0
- package/components/Icon/Icon.stories.jsx +48 -0
- package/components/Icon/Icon.test.d.ts +3 -0
- package/components/Icon/Icon.test.d.ts.map +1 -0
- package/components/Icon/Icon.test.jsx +67 -0
- package/components/Icon/index.d.ts +2 -0
- package/components/Icon/index.d.ts.map +1 -0
- package/components/Icon/index.js +1 -0
- package/components/IllustratedMessage/IllustratedMessage.d.ts +13 -0
- package/components/IllustratedMessage/IllustratedMessage.d.ts.map +1 -0
- package/components/IllustratedMessage/IllustratedMessage.jsx +21 -0
- package/components/IllustratedMessage/IllustratedMessage.stories.d.ts +10 -0
- package/components/IllustratedMessage/IllustratedMessage.stories.d.ts.map +1 -0
- package/components/IllustratedMessage/IllustratedMessage.stories.jsx +90 -0
- package/components/IllustratedMessage/IllustratedMessage.test.d.ts +3 -0
- package/components/IllustratedMessage/IllustratedMessage.test.d.ts.map +1 -0
- package/components/IllustratedMessage/IllustratedMessage.test.jsx +42 -0
- package/components/IllustratedMessage/index.d.ts +3 -0
- package/components/IllustratedMessage/index.d.ts.map +1 -0
- package/components/IllustratedMessage/index.js +2 -0
- package/components/Image/Image.d.ts +11 -0
- package/components/Image/Image.d.ts.map +1 -0
- package/components/Image/Image.jsx +26 -0
- package/components/Image/Image.stories.d.ts +11 -0
- package/components/Image/Image.stories.d.ts.map +1 -0
- package/components/Image/Image.stories.jsx +66 -0
- package/components/Image/Image.test.d.ts +3 -0
- package/components/Image/Image.test.d.ts.map +1 -0
- package/components/Image/Image.test.jsx +82 -0
- package/components/Image/index.d.ts +2 -0
- package/components/Image/index.d.ts.map +1 -0
- package/components/Image/index.js +1 -0
- package/components/ImageSwatch/ImageSwatch.d.ts +20 -0
- package/components/ImageSwatch/ImageSwatch.d.ts.map +1 -0
- package/components/ImageSwatch/ImageSwatch.jsx +49 -0
- package/components/ImageSwatch/ImageSwatch.stories.d.ts +20 -0
- package/components/ImageSwatch/ImageSwatch.stories.d.ts.map +1 -0
- package/components/ImageSwatch/ImageSwatch.stories.jsx +206 -0
- package/components/ImageSwatch/ImageSwatch.test.d.ts +3 -0
- package/components/ImageSwatch/ImageSwatch.test.d.ts.map +1 -0
- package/components/ImageSwatch/ImageSwatch.test.jsx +64 -0
- package/components/ImageSwatch/index.d.ts +3 -0
- package/components/ImageSwatch/index.d.ts.map +1 -0
- package/components/ImageSwatch/index.js +2 -0
- package/components/InLineAlert/InLineAlert.d.ts +16 -0
- package/components/InLineAlert/InLineAlert.d.ts.map +1 -0
- package/components/InLineAlert/InLineAlert.jsx +38 -0
- package/components/InLineAlert/InLineAlert.stories.d.ts +86 -0
- package/components/InLineAlert/InLineAlert.stories.d.ts.map +1 -0
- package/components/InLineAlert/InLineAlert.stories.jsx +193 -0
- package/components/InLineAlert/InLineAlert.test.d.ts +3 -0
- package/components/InLineAlert/InLineAlert.test.d.ts.map +1 -0
- package/components/InLineAlert/InLineAlert.test.jsx +77 -0
- package/components/InLineAlert/index.d.ts +3 -0
- package/components/InLineAlert/index.d.ts.map +1 -0
- package/components/InLineAlert/index.js +2 -0
- package/components/Incrementer/Incrementer.d.ts +17 -0
- package/components/Incrementer/Incrementer.d.ts.map +1 -0
- package/components/Incrementer/Incrementer.jsx +87 -0
- package/components/Incrementer/Incrementer.stories.d.ts +10 -0
- package/components/Incrementer/Incrementer.stories.d.ts.map +1 -0
- package/components/Incrementer/Incrementer.stories.jsx +68 -0
- package/components/Incrementer/Incrementer.test.d.ts +3 -0
- package/components/Incrementer/Incrementer.test.d.ts.map +1 -0
- package/components/Incrementer/Incrementer.test.jsx +112 -0
- package/components/Incrementer/index.d.ts +2 -0
- package/components/Incrementer/index.d.ts.map +1 -0
- package/components/Incrementer/index.js +1 -0
- package/components/Input/Input.d.ts +19 -0
- package/components/Input/Input.d.ts.map +1 -0
- package/components/Input/Input.jsx +73 -0
- package/components/Input/Input.stories.d.ts +11 -0
- package/components/Input/Input.stories.d.ts.map +1 -0
- package/components/Input/Input.stories.jsx +115 -0
- package/components/Input/Input.test.d.ts +3 -0
- package/components/Input/Input.test.d.ts.map +1 -0
- package/components/Input/Input.test.jsx +111 -0
- package/components/Input/index.d.ts +3 -0
- package/components/Input/index.d.ts.map +1 -0
- package/components/Input/index.js +2 -0
- package/components/Modal/Modal.d.ts +15 -0
- package/components/Modal/Modal.d.ts.map +1 -0
- package/components/Modal/Modal.jsx +93 -0
- package/components/Modal/Modal.stories.d.ts +56 -0
- package/components/Modal/Modal.stories.d.ts.map +1 -0
- package/components/Modal/Modal.stories.jsx +189 -0
- package/components/Modal/Modal.test.d.ts +3 -0
- package/components/Modal/Modal.test.d.ts.map +1 -0
- package/components/Modal/Modal.test.jsx +85 -0
- package/components/Modal/index.d.ts +2 -0
- package/components/Modal/index.d.ts.map +1 -0
- package/components/Modal/index.js +14 -0
- package/components/Picker/Picker.d.ts +26 -0
- package/components/Picker/Picker.d.ts.map +1 -0
- package/components/Picker/Picker.jsx +81 -0
- package/components/Picker/Picker.stories.d.ts +22 -0
- package/components/Picker/Picker.stories.d.ts.map +1 -0
- package/components/Picker/Picker.stories.jsx +236 -0
- package/components/Picker/Picker.test.d.ts +2 -0
- package/components/Picker/Picker.test.d.ts.map +1 -0
- package/components/Picker/Picker.test.jsx +190 -0
- package/components/Picker/index.d.ts +2 -0
- package/components/Picker/index.d.ts.map +1 -0
- package/components/Picker/index.js +1 -0
- package/components/Price/Price.d.ts +17 -0
- package/components/Price/Price.d.ts.map +1 -0
- package/components/Price/Price.jsx +24 -0
- package/components/Price/Price.stories.d.ts +17 -0
- package/components/Price/Price.stories.d.ts.map +1 -0
- package/components/Price/Price.stories.jsx +78 -0
- package/components/Price/Price.test.d.ts +3 -0
- package/components/Price/Price.test.d.ts.map +1 -0
- package/components/Price/Price.test.jsx +68 -0
- package/components/Price/index.d.ts +2 -0
- package/components/Price/index.d.ts.map +1 -0
- package/components/Price/index.js +1 -0
- package/components/PriceRange/PriceRange.d.ts +17 -0
- package/components/PriceRange/PriceRange.d.ts.map +1 -0
- package/components/PriceRange/PriceRange.jsx +75 -0
- package/components/PriceRange/PriceRange.stories.d.ts +107 -0
- package/components/PriceRange/PriceRange.stories.d.ts.map +1 -0
- package/components/PriceRange/PriceRange.stories.jsx +210 -0
- package/components/PriceRange/PriceRange.test.d.ts +3 -0
- package/components/PriceRange/PriceRange.test.d.ts.map +1 -0
- package/components/PriceRange/PriceRange.test.jsx +188 -0
- package/components/PriceRange/index.d.ts +3 -0
- package/components/PriceRange/index.d.ts.map +1 -0
- package/components/PriceRange/index.js +2 -0
- package/components/PriceSummary/PriceSummary.d.ts +43 -0
- package/components/PriceSummary/PriceSummary.d.ts.map +1 -0
- package/components/PriceSummary/PriceSummary.jsx +228 -0
- package/components/PriceSummary/PriceSummary.stories.d.ts +127 -0
- package/components/PriceSummary/PriceSummary.stories.d.ts.map +1 -0
- package/components/PriceSummary/PriceSummary.stories.jsx +456 -0
- package/components/PriceSummary/PriceSummary.test.d.ts +3 -0
- package/components/PriceSummary/PriceSummary.test.d.ts.map +1 -0
- package/components/PriceSummary/PriceSummary.test.jsx +275 -0
- package/components/PriceSummary/index.d.ts +3 -0
- package/components/PriceSummary/index.d.ts.map +1 -0
- package/components/PriceSummary/index.js +2 -0
- package/components/ProgressSpinner/ProgressSpinner.d.ts +14 -0
- package/components/ProgressSpinner/ProgressSpinner.d.ts.map +1 -0
- package/components/ProgressSpinner/ProgressSpinner.jsx +31 -0
- package/components/ProgressSpinner/ProgressSpinner.stories.d.ts +19 -0
- package/components/ProgressSpinner/ProgressSpinner.stories.d.ts.map +1 -0
- package/components/ProgressSpinner/ProgressSpinner.stories.jsx +195 -0
- package/components/ProgressSpinner/ProgressSpinner.test.d.ts +3 -0
- package/components/ProgressSpinner/ProgressSpinner.test.d.ts.map +1 -0
- package/components/ProgressSpinner/ProgressSpinner.test.jsx +40 -0
- package/components/ProgressSpinner/index.d.ts +3 -0
- package/components/ProgressSpinner/index.d.ts.map +1 -0
- package/components/ProgressSpinner/index.js +2 -0
- package/components/RadioButton/RadioButton.d.ts +15 -0
- package/components/RadioButton/RadioButton.d.ts.map +1 -0
- package/components/RadioButton/RadioButton.jsx +31 -0
- package/components/RadioButton/RadioButton.stories.d.ts +15 -0
- package/components/RadioButton/RadioButton.stories.d.ts.map +1 -0
- package/components/RadioButton/RadioButton.stories.jsx +92 -0
- package/components/RadioButton/RadioButton.test.d.ts +3 -0
- package/components/RadioButton/RadioButton.test.d.ts.map +1 -0
- package/components/RadioButton/RadioButton.test.jsx +62 -0
- package/components/RadioButton/index.d.ts +3 -0
- package/components/RadioButton/index.d.ts.map +1 -0
- package/components/RadioButton/index.js +2 -0
- package/components/Skeleton/Skeleton.d.ts +17 -0
- package/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/components/Skeleton/Skeleton.jsx +52 -0
- package/components/Skeleton/Skeleton.stories.d.ts +67 -0
- package/components/Skeleton/Skeleton.stories.d.ts.map +1 -0
- package/components/Skeleton/Skeleton.stories.jsx +184 -0
- package/components/Skeleton/Skeleton.test.d.ts +3 -0
- package/components/Skeleton/Skeleton.test.d.ts.map +1 -0
- package/components/Skeleton/Skeleton.test.jsx +62 -0
- package/components/Skeleton/index.d.ts +2 -0
- package/components/Skeleton/index.d.ts.map +1 -0
- package/components/Skeleton/index.js +1 -0
- package/components/TextSwatch/TextSwatch.d.ts +18 -0
- package/components/TextSwatch/TextSwatch.d.ts.map +1 -0
- package/components/TextSwatch/TextSwatch.jsx +56 -0
- package/components/TextSwatch/TextSwatch.stories.d.ts +21 -0
- package/components/TextSwatch/TextSwatch.stories.d.ts.map +1 -0
- package/components/TextSwatch/TextSwatch.stories.jsx +211 -0
- package/components/TextSwatch/TextSwatch.test.d.ts +3 -0
- package/components/TextSwatch/TextSwatch.test.d.ts.map +1 -0
- package/components/TextSwatch/TextSwatch.test.jsx +85 -0
- package/components/TextSwatch/index.d.ts +3 -0
- package/components/TextSwatch/index.d.ts.map +1 -0
- package/components/TextSwatch/index.js +2 -0
- package/components/UIProvider/UIProvider.d.ts +18 -0
- package/components/UIProvider/UIProvider.d.ts.map +1 -0
- package/components/UIProvider/UIProvider.jsx +26 -0
- package/components/UIProvider/UIProvider.test.d.ts +2 -0
- package/components/UIProvider/UIProvider.test.d.ts.map +1 -0
- package/components/UIProvider/UIProvider.test.jsx +9 -0
- package/components/UIProvider/index.d.ts +2 -0
- package/components/UIProvider/index.d.ts.map +1 -0
- package/components/UIProvider/index.js +1 -0
- package/components/index.d.ts +34 -0
- package/components/index.d.ts.map +1 -0
- package/components/index.js +33 -0
- package/docs/Design/designBlocks.d.ts +21 -0
- package/docs/Design/designBlocks.d.ts.map +1 -0
- package/docs/Design/designBlocks.jsx +59 -0
- package/docs/Design/getTokenData.d.ts +7 -0
- package/docs/Design/getTokenData.d.ts.map +1 -0
- package/docs/Design/getTokenData.js +18 -0
- package/docs/Design/getTokenData.test.d.ts +2 -0
- package/docs/Design/getTokenData.test.d.ts.map +1 -0
- package/docs/Design/getTokenData.test.js +92 -0
- package/event-bus.js +49 -1
- package/fetch-graphql.js +62 -1
- package/i18n/en_US.json +112 -0
- package/i18n/index.d.ts +341 -0
- package/i18n/index.d.ts.map +1 -0
- package/i18n/index.js +12 -0
- package/i18n/index.test.d.ts +2 -0
- package/i18n/index.test.d.ts.map +1 -0
- package/i18n/index.test.js +11 -0
- package/icons/index.d.ts +35 -0
- package/icons/index.d.ts.map +1 -0
- package/icons/index.js +34 -0
- package/initializer.js +61 -1
- package/lib/classes.d.ts +5 -0
- package/lib/classes.d.ts.map +1 -0
- package/lib/classes.js +16 -0
- package/lib/classes.test.d.ts +2 -0
- package/lib/classes.test.d.ts.map +1 -0
- package/lib/classes.test.js +18 -0
- package/lib/config.d.ts +7 -0
- package/lib/config.d.ts.map +1 -0
- package/lib/config.js +12 -0
- package/lib/config.test.d.ts +2 -0
- package/lib/config.test.d.ts.map +1 -0
- package/lib/config.test.js +12 -0
- package/lib/debounce.d.ts +2 -0
- package/lib/debounce.d.ts.map +1 -0
- package/lib/debounce.js +7 -0
- package/lib/debounce.test.d.ts +2 -0
- package/lib/debounce.test.d.ts.map +1 -0
- package/lib/debounce.test.js +40 -0
- package/lib/deepmerge.d.ts +2 -0
- package/lib/deepmerge.d.ts.map +1 -0
- package/lib/deepmerge.js +1 -0
- package/lib/form-values.d.ts +5 -0
- package/lib/form-values.d.ts.map +1 -0
- package/lib/form-values.js +17 -0
- package/lib/form-values.test.d.ts +2 -0
- package/lib/form-values.test.d.ts.map +1 -0
- package/lib/form-values.test.jsx +29 -0
- package/lib/i18n.d.ts +8 -0
- package/lib/i18n.d.ts.map +1 -0
- package/lib/i18n.js +9 -0
- package/lib/i18n.test.d.ts +2 -0
- package/lib/i18n.test.d.ts.map +1 -0
- package/lib/i18n.test.jsx +8 -0
- package/lib/image-params-keymap.d.ts +4 -0
- package/lib/image-params-keymap.d.ts.map +1 -0
- package/lib/image-params-keymap.js +19 -0
- package/lib/image-params-keymap.test.d.ts +2 -0
- package/lib/image-params-keymap.test.d.ts.map +1 -0
- package/lib/image-params-keymap.test.js +7 -0
- package/lib/index.d.ts +14 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +13 -0
- package/lib/initializer.d.ts +78 -0
- package/lib/initializer.d.ts.map +1 -0
- package/lib/initializer.js +93 -0
- package/lib/initializer.test.d.ts +2 -0
- package/lib/initializer.test.d.ts.map +1 -0
- package/lib/initializer.test.js +64 -0
- package/lib/render.d.ts +10 -0
- package/lib/render.d.ts.map +1 -0
- package/lib/render.jsx +34 -0
- package/lib/render.test.d.ts +2 -0
- package/lib/render.test.d.ts.map +1 -0
- package/lib/render.test.jsx +70 -0
- package/lib/resolve-image.d.ts +10 -0
- package/lib/resolve-image.d.ts.map +1 -0
- package/lib/resolve-image.js +57 -0
- package/lib/resolve-image.test.d.ts +2 -0
- package/lib/resolve-image.test.d.ts.map +1 -0
- package/lib/resolve-image.test.jsx +146 -0
- package/lib/slot.d.ts +43 -0
- package/lib/slot.d.ts.map +1 -0
- package/lib/slot.jsx +184 -0
- package/lib/slot.test.d.ts +2 -0
- package/lib/slot.test.d.ts.map +1 -0
- package/lib/slot.test.jsx +325 -0
- package/lib/tests.d.ts +4 -0
- package/lib/tests.d.ts.map +1 -0
- package/lib/tests.jsx +19 -0
- package/lib/tests.test.d.ts +2 -0
- package/lib/tests.test.d.ts.map +1 -0
- package/lib/tests.test.jsx +13 -0
- package/lib/types.d.ts +9 -0
- package/lib/types.d.ts.map +1 -0
- package/lib/types.js +1 -0
- package/lib/vcomponent.d.ts +8 -0
- package/lib/vcomponent.d.ts.map +1 -0
- package/lib/vcomponent.jsx +27 -0
- package/lib/vcomponent.test.d.ts +2 -0
- package/lib/vcomponent.test.d.ts.map +1 -0
- package/lib/vcomponent.test.jsx +51 -0
- package/package.json +1 -1
- package/preact-compat.js +93 -1
- package/preact-hooks.js +40 -1
- package/preact-jsx-runtime.js +35 -1
- package/preact.js +21 -1
- package/runtime.js +69 -1
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
import '@adobe/elsie/components/Accordion/Accordion.css';
|
|
4
|
+
export interface AccordionSectionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'icon'> {
|
|
5
|
+
actionIconPosition?: 'left' | 'right';
|
|
6
|
+
iconOpen?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
7
|
+
iconClose?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
8
|
+
iconLeft?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
9
|
+
showIconLeft?: boolean;
|
|
10
|
+
secondaryText?: string | VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
11
|
+
renderContentWhenClosed?: boolean;
|
|
12
|
+
onStateChange?: (open: boolean) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare const AccordionSection: FunctionComponent<AccordionSectionProps>;
|
|
15
|
+
export interface AccordionProps extends Omit<HTMLAttributes<HTMLDivElement>, 'icon'> {
|
|
16
|
+
actionIconPosition?: 'left' | 'right';
|
|
17
|
+
iconOpen?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
18
|
+
iconClose?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
19
|
+
iconLeft?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
20
|
+
showIconLeft?: boolean;
|
|
21
|
+
secondaryText?: string | VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
22
|
+
children: VNode<AccordionSectionProps>[] | VNode<AccordionSectionProps>;
|
|
23
|
+
}
|
|
24
|
+
export declare const Accordion: FunctionComponent<AccordionProps>;
|
|
25
|
+
//# sourceMappingURL=Accordion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,cAAc,EAAY,MAAM,eAAe,CAAC;AAKzD,OAAO,iDAAiD,CAAC;AACzD,MAAM,WAAW,qBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACpD,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAChE,uBAAuB,CAAC,EAAE,OAAO,CAAC;IAClC,aAAa,CAAC,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAC;CACzC;AAED,eAAO,MAAM,gBAAgB,EAAE,iBAAiB,CAAC,qBAAqB,CA2FrE,CAAC;AAEF,MAAM,WAAW,cACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACpD,kBAAkB,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IACjD,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAChD,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,GAAG,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;IAChE,QAAQ,EAAE,KAAK,CAAC,qBAAqB,CAAC,EAAE,GAAG,KAAK,CAAC,qBAAqB,CAAC,CAAC;CACzE;AAED,eAAO,MAAM,SAAS,EAAE,iBAAiB,CAAC,cAAc,CAkCvD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useState } from 'preact/compat';
|
|
2
|
+
import { classes } from '@adobe/elsie/lib';
|
|
3
|
+
import { Divider, Icon } from '@adobe/elsie/components';
|
|
4
|
+
import { Add, Minus } from '@adobe/elsie/icons';
|
|
5
|
+
import { useText } from '@adobe/elsie/i18n';
|
|
6
|
+
import '@adobe/elsie/components/Accordion/Accordion.css';
|
|
7
|
+
export const AccordionSection = ({ className, children, title, secondaryText, actionIconPosition = 'left', iconOpen = Add, iconClose = Minus, iconLeft = Add, showIconLeft = false, renderContentWhenClosed = true, onStateChange, ...props }) => {
|
|
8
|
+
const [open, setOpen] = useState(false);
|
|
9
|
+
const onClickHandler = (e) => {
|
|
10
|
+
e.stopImmediatePropagation();
|
|
11
|
+
const next = !open;
|
|
12
|
+
setOpen(next);
|
|
13
|
+
onStateChange?.(next);
|
|
14
|
+
};
|
|
15
|
+
const buttonLabel = useText(`Dropin.Accordion.${open ? 'close' : 'open'}.label`).label;
|
|
16
|
+
const openIcon = (<Icon source={iconOpen} size="24" onClick={onClickHandler} onKeyPress={onClickHandler} className={'dropin-accordion-section__open-icon'}/>);
|
|
17
|
+
const closeIcon = (<Icon source={iconClose} size="24" onClick={onClickHandler} onKeyPress={onClickHandler} className={'dropin-accordion-section__close-icon'}/>);
|
|
18
|
+
const leftIcon = <Icon source={iconLeft} size="24"/>;
|
|
19
|
+
return (<div {...props} className={classes(['dropin-accordion-section', className])}>
|
|
20
|
+
<div className={'dropin-accordion-section__heading'}>
|
|
21
|
+
<div className={'dropin-accordion-section__flex'} onClick={onClickHandler} onKeyPress={onClickHandler} role="button" aria-label={`${buttonLabel} ${title}`} tabIndex={0}>
|
|
22
|
+
<div className={'dropin-accordion-section__title-container'}>
|
|
23
|
+
{actionIconPosition === 'left' && (open ? closeIcon : openIcon)}
|
|
24
|
+
|
|
25
|
+
{showIconLeft && leftIcon}
|
|
26
|
+
|
|
27
|
+
<h3 className={'dropin-accordion-section__title'}>{title}</h3>
|
|
28
|
+
</div>
|
|
29
|
+
</div>
|
|
30
|
+
|
|
31
|
+
<div className={'dropin-accordion-section__secondary-text-container'}>
|
|
32
|
+
{secondaryText && (<h4 className={'dropin-accordion-section__secondary-text'}>
|
|
33
|
+
{secondaryText}
|
|
34
|
+
</h4>)}
|
|
35
|
+
|
|
36
|
+
{actionIconPosition === 'right' && (open ? closeIcon : openIcon)}
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
|
|
40
|
+
<div className={'dropin-accordion-section__content-container'} style={{ display: open ? 'grid' : 'none' }}>
|
|
41
|
+
{(open || (renderContentWhenClosed && !open)) && children}
|
|
42
|
+
</div>
|
|
43
|
+
</div>);
|
|
44
|
+
};
|
|
45
|
+
export const Accordion = ({ className, children, actionIconPosition = 'left', iconOpen = Add, iconClose = Minus, ...props }) => {
|
|
46
|
+
const divider = <Divider variant="secondary"/>;
|
|
47
|
+
const renderAccordionSection = (child) => (<>
|
|
48
|
+
<AccordionSection {...child.props} actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}/>
|
|
49
|
+
{divider}
|
|
50
|
+
</>);
|
|
51
|
+
return (<div {...props} className={classes(['dropin-accordion', className])}>
|
|
52
|
+
{[
|
|
53
|
+
divider,
|
|
54
|
+
...(Array.isArray(children)
|
|
55
|
+
? children
|
|
56
|
+
: [children]).map(renderAccordionSection),
|
|
57
|
+
]}
|
|
58
|
+
</div>);
|
|
59
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { AccordionProps, AccordionSectionProps } from '@adobe/elsie/components/Accordion';
|
|
3
|
+
declare const meta: Meta<AccordionProps & AccordionSectionProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<AccordionProps>;
|
|
6
|
+
/**
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Accordion, AccordionSection } from '@adobe/elsie/components/Accordion';
|
|
9
|
+
*
|
|
10
|
+
* <Accordion>
|
|
11
|
+
* <AccordionSection title={"Title"}><p>Short product details should be kept to 6 lines maximum.</p></AccordionSection>
|
|
12
|
+
* </Accordion>
|
|
13
|
+
*
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare const SingleSection: Story;
|
|
17
|
+
export declare const SingleSectionWithLeftIcon: Story;
|
|
18
|
+
export declare const SingleSectionWithOptionalText: Story;
|
|
19
|
+
export declare const SingleSectionWithPrice: Story;
|
|
20
|
+
export declare const SingleSectionWithLinkAndCartItem: Story;
|
|
21
|
+
export declare const MultipleSection: Story;
|
|
22
|
+
//# sourceMappingURL=Accordion.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,cAAc,EAEd,qBAAqB,EACtB,MAAM,mCAAmC,CAAC;AAM3C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,cAAc,GAAG,qBAAqB,CAmDtD,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,cAAc,CAAC,CAAC;AAEtC;;;;;;;;;GASG;AACH,eAAO,MAAM,aAAa,EAAE,KAmD3B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAsDvC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KA8D3C,CAAC;AAEF,eAAO,MAAM,sBAAsB,EAAE,KA8CpC,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,KA+E9C,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,KA8G7B,CAAC"}
|
|
@@ -0,0 +1,320 @@
|
|
|
1
|
+
import { Accordion, AccordionSection, } from '@adobe/elsie/components/Accordion';
|
|
2
|
+
import { Price, Card, Image, CartItem } from '..';
|
|
3
|
+
import { expect } from '@storybook/jest';
|
|
4
|
+
import { within, userEvent } from '@storybook/testing-library';
|
|
5
|
+
import * as Icons from '@adobe/elsie/icons';
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/Accordion',
|
|
8
|
+
component: Accordion,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered', // centered | fullscreen
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
actionIconPosition: {
|
|
15
|
+
description: 'Position of the action icon',
|
|
16
|
+
options: ['left', 'right'],
|
|
17
|
+
control: {
|
|
18
|
+
type: 'select',
|
|
19
|
+
},
|
|
20
|
+
defaultValue: 'left',
|
|
21
|
+
},
|
|
22
|
+
iconOpen: {
|
|
23
|
+
description: 'Icon for open button (svg)',
|
|
24
|
+
options: Object.keys(Icons),
|
|
25
|
+
mapping: Icons,
|
|
26
|
+
control: {
|
|
27
|
+
type: 'select',
|
|
28
|
+
},
|
|
29
|
+
defaultValue: 'Minus',
|
|
30
|
+
},
|
|
31
|
+
iconClose: {
|
|
32
|
+
description: 'Icon for close button (svg)',
|
|
33
|
+
options: Object.keys(Icons),
|
|
34
|
+
mapping: Icons,
|
|
35
|
+
control: {
|
|
36
|
+
type: 'select',
|
|
37
|
+
},
|
|
38
|
+
defaultValue: 'Minus',
|
|
39
|
+
},
|
|
40
|
+
iconLeft: {
|
|
41
|
+
description: 'Optional icon on left side (svg)',
|
|
42
|
+
options: Object.keys(Icons),
|
|
43
|
+
mapping: Icons,
|
|
44
|
+
control: {
|
|
45
|
+
type: 'select',
|
|
46
|
+
},
|
|
47
|
+
defaultValue: 'Minus',
|
|
48
|
+
},
|
|
49
|
+
showIconLeft: {
|
|
50
|
+
description: 'Whether or not the display the leftIcon',
|
|
51
|
+
type: 'boolean',
|
|
52
|
+
defaultValue: {
|
|
53
|
+
summary: false,
|
|
54
|
+
},
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export default meta;
|
|
59
|
+
/**
|
|
60
|
+
* ```ts
|
|
61
|
+
* import { Accordion, AccordionSection } from '@adobe/elsie/components/Accordion';
|
|
62
|
+
*
|
|
63
|
+
* <Accordion>
|
|
64
|
+
* <AccordionSection title={"Title"}><p>Short product details should be kept to 6 lines maximum.</p></AccordionSection>
|
|
65
|
+
* </Accordion>
|
|
66
|
+
*
|
|
67
|
+
* ```
|
|
68
|
+
*/
|
|
69
|
+
export const SingleSection = {
|
|
70
|
+
args: {
|
|
71
|
+
actionIconPosition: 'right',
|
|
72
|
+
iconOpen: Icons.Add,
|
|
73
|
+
iconClose: Icons.Minus,
|
|
74
|
+
},
|
|
75
|
+
render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
|
|
76
|
+
<h2 style={{
|
|
77
|
+
font: 'var(--type-body-1-strong-font)',
|
|
78
|
+
color: 'var(--color-neutral-800)',
|
|
79
|
+
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
80
|
+
}}>
|
|
81
|
+
This is the Accordion Component, this title will be longer in order to
|
|
82
|
+
increase width of the story
|
|
83
|
+
</h2>
|
|
84
|
+
|
|
85
|
+
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
86
|
+
<AccordionSection title={'Title'}>
|
|
87
|
+
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
88
|
+
</AccordionSection>
|
|
89
|
+
</Accordion>
|
|
90
|
+
</div>),
|
|
91
|
+
play: async () => {
|
|
92
|
+
const canvasElement = document.querySelector('#storybook-root');
|
|
93
|
+
const canvas = within(canvasElement);
|
|
94
|
+
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
95
|
+
await expect(loaderIcon).toBeVisible();
|
|
96
|
+
const header = document.querySelector('.dropin-accordion-section__heading');
|
|
97
|
+
await expect(header).toHaveTextContent('Title');
|
|
98
|
+
await userEvent.click(canvas.getByRole('button'));
|
|
99
|
+
const content = document.querySelector('.dropin-accordion-section__content-container');
|
|
100
|
+
await expect(content).toBeVisible();
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
export const SingleSectionWithLeftIcon = {
|
|
104
|
+
args: {
|
|
105
|
+
actionIconPosition: 'right',
|
|
106
|
+
iconOpen: Icons.Add,
|
|
107
|
+
iconClose: Icons.Minus,
|
|
108
|
+
iconLeft: Icons.Card,
|
|
109
|
+
showIconLeft: true,
|
|
110
|
+
},
|
|
111
|
+
render: ({ actionIconPosition, iconOpen, iconClose, iconLeft, showIconLeft, }) => (<div>
|
|
112
|
+
<h2 style={{
|
|
113
|
+
font: 'var(--type-body-1-strong-font)',
|
|
114
|
+
color: 'var(--color-neutral-800)',
|
|
115
|
+
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
116
|
+
}}>
|
|
117
|
+
This is the Accordion Component, this title will be longer in order to
|
|
118
|
+
increase width of the story
|
|
119
|
+
</h2>
|
|
120
|
+
|
|
121
|
+
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
122
|
+
<AccordionSection title={'Title'} secondaryText={'Optional Text'} iconLeft={iconLeft} showIconLeft={showIconLeft}>
|
|
123
|
+
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
124
|
+
</AccordionSection>
|
|
125
|
+
</Accordion>
|
|
126
|
+
</div>),
|
|
127
|
+
play: async () => {
|
|
128
|
+
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
129
|
+
await expect(loaderIcon).toBeVisible();
|
|
130
|
+
const leftHeader = document.querySelector('.dropin-accordion-section__title-container');
|
|
131
|
+
await expect(leftHeader).toBeVisible();
|
|
132
|
+
await expect(leftHeader).toContainHTML('<svg');
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
export const SingleSectionWithOptionalText = {
|
|
136
|
+
args: {
|
|
137
|
+
actionIconPosition: 'right',
|
|
138
|
+
iconOpen: Icons.Add,
|
|
139
|
+
iconClose: Icons.Minus,
|
|
140
|
+
iconLeft: Icons.Card,
|
|
141
|
+
secondaryText: 'Optional Text',
|
|
142
|
+
},
|
|
143
|
+
argTypes: {
|
|
144
|
+
secondaryText: {
|
|
145
|
+
description: 'Add text to the button.',
|
|
146
|
+
table: {
|
|
147
|
+
type: { summary: 'ComponentChildren' },
|
|
148
|
+
},
|
|
149
|
+
control: 'text',
|
|
150
|
+
},
|
|
151
|
+
},
|
|
152
|
+
render: ({ actionIconPosition, iconOpen, iconClose, iconLeft, secondaryText, }) => (<div>
|
|
153
|
+
<h2 style={{
|
|
154
|
+
font: 'var(--type-body-1-strong-font)',
|
|
155
|
+
color: 'var(--color-neutral-800)',
|
|
156
|
+
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
157
|
+
}}>
|
|
158
|
+
This is the Accordion Component, this title will be longer in order to
|
|
159
|
+
increase width of the story
|
|
160
|
+
</h2>
|
|
161
|
+
|
|
162
|
+
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
163
|
+
<AccordionSection title={'Title'} secondaryText={secondaryText} iconLeft={iconLeft}>
|
|
164
|
+
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
165
|
+
</AccordionSection>
|
|
166
|
+
</Accordion>
|
|
167
|
+
</div>),
|
|
168
|
+
play: async () => {
|
|
169
|
+
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
170
|
+
await expect(loaderIcon).toBeVisible();
|
|
171
|
+
const secondaryText = document.querySelector('.dropin-accordion-section__secondary-text');
|
|
172
|
+
await expect(secondaryText).toBeVisible();
|
|
173
|
+
await expect(secondaryText).toHaveTextContent('Optional Text');
|
|
174
|
+
},
|
|
175
|
+
};
|
|
176
|
+
export const SingleSectionWithPrice = {
|
|
177
|
+
args: {
|
|
178
|
+
actionIconPosition: 'right',
|
|
179
|
+
iconOpen: Icons.Add,
|
|
180
|
+
iconClose: Icons.Minus,
|
|
181
|
+
iconLeft: Icons.Card,
|
|
182
|
+
},
|
|
183
|
+
render: ({ actionIconPosition, iconOpen, iconClose, iconLeft }) => (<div>
|
|
184
|
+
<h2 style={{
|
|
185
|
+
font: 'var(--type-body-1-strong-font)',
|
|
186
|
+
color: 'var(--color-neutral-800)',
|
|
187
|
+
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
188
|
+
}}>
|
|
189
|
+
This is the Accordion Component, this title will be longer in order to
|
|
190
|
+
increase width of the story
|
|
191
|
+
</h2>
|
|
192
|
+
|
|
193
|
+
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
194
|
+
<AccordionSection title={'Title'} iconLeft={iconLeft} secondaryText={<Price amount={9.99}/>}>
|
|
195
|
+
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
196
|
+
</AccordionSection>
|
|
197
|
+
</Accordion>
|
|
198
|
+
</div>),
|
|
199
|
+
play: async () => {
|
|
200
|
+
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
201
|
+
await expect(loaderIcon).toBeVisible();
|
|
202
|
+
const secondaryText = document.querySelector('.dropin-accordion-section__secondary-text');
|
|
203
|
+
await expect(secondaryText).toBeVisible();
|
|
204
|
+
await expect(secondaryText).toHaveTextContent('$9.99');
|
|
205
|
+
},
|
|
206
|
+
};
|
|
207
|
+
export const SingleSectionWithLinkAndCartItem = {
|
|
208
|
+
args: {
|
|
209
|
+
actionIconPosition: 'left',
|
|
210
|
+
iconOpen: Icons.ChevronDown,
|
|
211
|
+
iconClose: Icons.ChevronUp,
|
|
212
|
+
},
|
|
213
|
+
render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
|
|
214
|
+
<h2 style={{
|
|
215
|
+
font: 'var(--type-body-1-strong-font)',
|
|
216
|
+
color: 'var(--color-neutral-800)',
|
|
217
|
+
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
218
|
+
}}>
|
|
219
|
+
This is the Accordion Component, this title will be longer in order to
|
|
220
|
+
increase width of the story
|
|
221
|
+
</h2>
|
|
222
|
+
|
|
223
|
+
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
224
|
+
<AccordionSection title={'Title'} secondaryText={<a rel="noreferrer" href="/cart">
|
|
225
|
+
Edit
|
|
226
|
+
</a>}>
|
|
227
|
+
<CartItem key={'uuid'} title={<div>Short Name</div>} description={<div>
|
|
228
|
+
Secondary product information such as brand name, description,
|
|
229
|
+
etc.
|
|
230
|
+
</div>} sku={<div>SKU: 59YK7</div>} quantity={1} image={<Image src="https://picsum.photos/132/184" width="132" height="184" alt="Some alternative text" loading="lazy"/>} price={<Price amount={53.99} style={{ fontWeight: 'inherit', color: 'inherit' }}/>} total={<>
|
|
231
|
+
<Price amount={59.98} variant="strikethrough"/>
|
|
232
|
+
<Price amount={55.95} sale/>
|
|
233
|
+
</>}/>
|
|
234
|
+
</AccordionSection>
|
|
235
|
+
</Accordion>
|
|
236
|
+
</div>),
|
|
237
|
+
play: async () => {
|
|
238
|
+
const accordionElement = document.querySelector('.dropin-accordion');
|
|
239
|
+
const link = accordionElement.querySelector('.dropin-accordion a');
|
|
240
|
+
await expect(accordionElement).toBeVisible();
|
|
241
|
+
await expect(link).toHaveTextContent('Edit');
|
|
242
|
+
await expect(link).toHaveAttribute('href', '/cart');
|
|
243
|
+
},
|
|
244
|
+
};
|
|
245
|
+
export const MultipleSection = {
|
|
246
|
+
args: {
|
|
247
|
+
actionIconPosition: 'right',
|
|
248
|
+
iconOpen: Icons.ChevronDown,
|
|
249
|
+
iconClose: Icons.ChevronUp,
|
|
250
|
+
iconLeft: Icons.Card,
|
|
251
|
+
showIconLeft: false,
|
|
252
|
+
},
|
|
253
|
+
argTypes: {
|
|
254
|
+
showIconLeft: {
|
|
255
|
+
table: {
|
|
256
|
+
disable: true,
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
iconLeft: {
|
|
260
|
+
table: {
|
|
261
|
+
disable: true,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
},
|
|
265
|
+
render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
|
|
266
|
+
<h2 style={{
|
|
267
|
+
font: 'var(--type-body-1-strong-font)',
|
|
268
|
+
color: 'var(--color-neutral-800)',
|
|
269
|
+
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
270
|
+
}}>
|
|
271
|
+
This is the Accordion Component, this title will be longer in order to
|
|
272
|
+
increase width of the story
|
|
273
|
+
</h2>
|
|
274
|
+
|
|
275
|
+
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
276
|
+
<AccordionSection title={'Cart summary'} iconLeft={Icons.Cart} showIconLeft={true} renderContentWhenClosed={false}>
|
|
277
|
+
<Card>
|
|
278
|
+
<h2 style={{ font: 'var(--type-headline-2-strong-font)' }}>
|
|
279
|
+
Title
|
|
280
|
+
</h2>
|
|
281
|
+
<p style={{ font: 'var(--type-body-2-default-font)' }}>
|
|
282
|
+
This is a short description of the item and should be kept to two
|
|
283
|
+
or three lines as maximum.
|
|
284
|
+
</p>
|
|
285
|
+
</Card>
|
|
286
|
+
</AccordionSection>
|
|
287
|
+
<AccordionSection title={'Card info'} iconLeft={Icons.Card} showIconLeft={true} secondaryText={'Optional Text'} renderContentWhenClosed={false}>
|
|
288
|
+
<p>
|
|
289
|
+
Short product details should be kept to 6 lines maximum.
|
|
290
|
+
<br />
|
|
291
|
+
Short product details should be kept to 6 lines maximum.
|
|
292
|
+
<br />
|
|
293
|
+
Short product details should be kept to 6 lines maximum.
|
|
294
|
+
<br />
|
|
295
|
+
Short product details should be kept to 6 lines maximum.
|
|
296
|
+
<br />
|
|
297
|
+
Short product details should be kept to 6 lines maximum.
|
|
298
|
+
<br />
|
|
299
|
+
</p>
|
|
300
|
+
</AccordionSection>
|
|
301
|
+
<AccordionSection title={'Wallet'} iconLeft={Icons.Wallet} showIconLeft={true}>
|
|
302
|
+
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
303
|
+
</AccordionSection>
|
|
304
|
+
<AccordionSection title={'Shipping'} iconLeft={Icons.Delivery} showIconLeft={true}>
|
|
305
|
+
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
306
|
+
</AccordionSection>
|
|
307
|
+
<AccordionSection title={'Notes'} iconLeft={Icons.Delivery} showIconLeft={false}>
|
|
308
|
+
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
309
|
+
</AccordionSection>
|
|
310
|
+
</Accordion>
|
|
311
|
+
</div>),
|
|
312
|
+
play: async () => {
|
|
313
|
+
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
314
|
+
await expect(loaderIcon).toBeVisible();
|
|
315
|
+
const section = document.querySelector('.dropin-accordion-section');
|
|
316
|
+
await expect(section).toBeVisible();
|
|
317
|
+
const divider = document.querySelector('.dropin-divider');
|
|
318
|
+
await expect(divider).toBeVisible();
|
|
319
|
+
},
|
|
320
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Accordion.test.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
+
import { render, fireEvent, act } from '@adobe/elsie/lib/tests';
|
|
3
|
+
import { Accordion, AccordionSection } from '@adobe/elsie/components/Accordion';
|
|
4
|
+
describe('Base/Components/Accordion', () => {
|
|
5
|
+
test('renders', () => {
|
|
6
|
+
const { container } = render(<Accordion>
|
|
7
|
+
<AccordionSection title={'Title'}>
|
|
8
|
+
<span>Content goes here</span>
|
|
9
|
+
</AccordionSection>
|
|
10
|
+
</Accordion>);
|
|
11
|
+
const element = container.querySelector('.dropin-accordion');
|
|
12
|
+
expect(element).toMatchSnapshot();
|
|
13
|
+
});
|
|
14
|
+
test('renders and open', () => {
|
|
15
|
+
const mockOnStateChange = jest.fn();
|
|
16
|
+
const { container } = render(<Accordion>
|
|
17
|
+
<AccordionSection showIconLeft={true} title={'Title'} onStateChange={mockOnStateChange}>
|
|
18
|
+
<span>Content goes here</span>
|
|
19
|
+
</AccordionSection>
|
|
20
|
+
<AccordionSection showIconLeft={true} title={'Title2'} secondaryText={'Optional Text'}>
|
|
21
|
+
<span>Content goes here2</span>
|
|
22
|
+
</AccordionSection>
|
|
23
|
+
</Accordion>);
|
|
24
|
+
const button = container.querySelector('.dropin-accordion-section__flex');
|
|
25
|
+
expect(button).not.toBeNull();
|
|
26
|
+
act(() => {
|
|
27
|
+
fireEvent.click(button);
|
|
28
|
+
});
|
|
29
|
+
expect(mockOnStateChange).toHaveBeenCalledTimes(1);
|
|
30
|
+
const element_new = container.querySelector('.dropin-accordion');
|
|
31
|
+
expect(element_new).toMatchSnapshot();
|
|
32
|
+
});
|
|
33
|
+
test('renders different sections with action icon on different positions', () => {
|
|
34
|
+
const mockOnStateChange = jest.fn();
|
|
35
|
+
const { container } = render(<>
|
|
36
|
+
<AccordionSection showIconLeft={true} title={'Title1'} onStateChange={mockOnStateChange} actionIconPosition={'right'}>
|
|
37
|
+
<span>Content goes here1</span>
|
|
38
|
+
</AccordionSection>
|
|
39
|
+
<AccordionSection showIconLeft={true} title={'Title2'} onStateChange={mockOnStateChange} actionIconPosition={'left'}>
|
|
40
|
+
<span>Content goes here2</span>
|
|
41
|
+
</AccordionSection>
|
|
42
|
+
<AccordionSection showIconLeft={true} title={'Title3'} onStateChange={mockOnStateChange}>
|
|
43
|
+
<span>Content goes here3</span>
|
|
44
|
+
</AccordionSection>
|
|
45
|
+
</>);
|
|
46
|
+
const element = container.querySelector('.dropin-accordion-section');
|
|
47
|
+
expect(!!container).toEqual(true);
|
|
48
|
+
expect(container).toMatchSnapshot();
|
|
49
|
+
expect(element).not.toBeNull();
|
|
50
|
+
const actionButton = container.querySelector('.dropin-accordion-section__open-icon');
|
|
51
|
+
expect(actionButton).not.toBeNull();
|
|
52
|
+
act(() => {
|
|
53
|
+
fireEvent.click(actionButton);
|
|
54
|
+
});
|
|
55
|
+
expect(mockOnStateChange).toHaveBeenCalledTimes(1);
|
|
56
|
+
});
|
|
57
|
+
test('should render content when section is closed and renderContentWhenClosed is true', () => {
|
|
58
|
+
const { container } = render(<Accordion>
|
|
59
|
+
<AccordionSection title={'Title'} renderContentWhenClosed={true}>
|
|
60
|
+
<span id="content">Content goes here</span>
|
|
61
|
+
</AccordionSection>
|
|
62
|
+
</Accordion>);
|
|
63
|
+
const element = container.querySelector('.dropin-accordion');
|
|
64
|
+
expect(element).toMatchSnapshot();
|
|
65
|
+
const content = container.querySelector('#content');
|
|
66
|
+
expect(content).not.toBeNull();
|
|
67
|
+
});
|
|
68
|
+
test('should not render content when section is closed and renderContentWhenClosed is false', () => {
|
|
69
|
+
const { container } = render(<Accordion>
|
|
70
|
+
<AccordionSection title={'Title'} renderContentWhenClosed={false}>
|
|
71
|
+
<span id="content">Content goes here</span>
|
|
72
|
+
</AccordionSection>
|
|
73
|
+
</Accordion>);
|
|
74
|
+
const element = container.querySelector('.dropin-accordion');
|
|
75
|
+
expect(element).toMatchSnapshot();
|
|
76
|
+
const content = container.querySelector('#content');
|
|
77
|
+
expect(content).toBeNull();
|
|
78
|
+
});
|
|
79
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,6CAA6C,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { ComponentChildren, FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
import '@adobe/elsie/components/ActionButton/ActionButton.css';
|
|
4
|
+
export interface ActionButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'icon'> {
|
|
5
|
+
children?: ComponentChildren;
|
|
6
|
+
icon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
7
|
+
active?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const ActionButton: FunctionComponent<ActionButtonProps>;
|
|
11
|
+
//# sourceMappingURL=ActionButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,uDAAuD,CAAC;AAE/D,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACvD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA8B7D,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { VComponent, classes } from '@adobe/elsie/lib';
|
|
2
|
+
import '@adobe/elsie/components/ActionButton/ActionButton.css';
|
|
3
|
+
export const ActionButton = ({ icon, className, children, active = false, disabled = false, ...props }) => {
|
|
4
|
+
return (<button role="button" disabled={disabled} {...props} className={classes([
|
|
5
|
+
'dropin-action-button',
|
|
6
|
+
['dropin-action-button--active', active],
|
|
7
|
+
['dropin-action-button--disabled', disabled],
|
|
8
|
+
className,
|
|
9
|
+
])}>
|
|
10
|
+
{icon && (<VComponent node={icon} className={classes(['dropin-action-button-icon'])}/>)}
|
|
11
|
+
{children &&
|
|
12
|
+
(typeof children === 'string' ? <span>{children}</span> : children)}
|
|
13
|
+
</button>);
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { ActionButtonProps } from '@adobe/elsie/components/ActionButton';
|
|
3
|
+
/**
|
|
4
|
+
* Use Action Buttons to let users complete actions or select items in a workflow.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<ActionButtonProps>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<ActionButtonProps>;
|
|
9
|
+
export declare const Default: Story;
|
|
10
|
+
export declare const IconOnly: Story;
|
|
11
|
+
export declare const WithIcon: Story;
|
|
12
|
+
export declare const Disabled: Story;
|
|
13
|
+
export declare const Active: Story;
|
|
14
|
+
export declare const DisabledIcon: Story;
|
|
15
|
+
export declare const ActiveIcon: Story;
|
|
16
|
+
//# sourceMappingURL=ActionButton.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAO9C;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAYjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA4BtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA2BtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAiBtB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAiB1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC"}
|