@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,174 @@
|
|
|
1
|
+
import { Field, Picker, Input, Incrementer, Checkbox, } from '@adobe/elsie/components';
|
|
2
|
+
import { within, userEvent } from '@storybook/testing-library';
|
|
3
|
+
import { expect } from '@storybook/jest';
|
|
4
|
+
/**
|
|
5
|
+
* Use Field Labels to wrap form inputs with titles and help text.
|
|
6
|
+
*/
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Field',
|
|
9
|
+
component: Field,
|
|
10
|
+
argTypes: {
|
|
11
|
+
label: {
|
|
12
|
+
description: 'Label',
|
|
13
|
+
control: 'text',
|
|
14
|
+
},
|
|
15
|
+
hint: {
|
|
16
|
+
description: 'Helper Text',
|
|
17
|
+
control: 'text',
|
|
18
|
+
},
|
|
19
|
+
error: {
|
|
20
|
+
description: 'Error Text',
|
|
21
|
+
control: 'text',
|
|
22
|
+
},
|
|
23
|
+
success: {
|
|
24
|
+
description: 'Success Text',
|
|
25
|
+
control: 'text',
|
|
26
|
+
},
|
|
27
|
+
size: {
|
|
28
|
+
description: '',
|
|
29
|
+
options: ['medium', 'large'],
|
|
30
|
+
control: { type: 'radio' },
|
|
31
|
+
defaultValue: {
|
|
32
|
+
summary: 'medium',
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
disabled: {
|
|
36
|
+
description: 'Whether or not the field is disabled',
|
|
37
|
+
control: 'boolean',
|
|
38
|
+
defaultValue: {
|
|
39
|
+
summary: false,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export default meta;
|
|
45
|
+
/**
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { Field } from '@adobe/elsie/components/Field';
|
|
48
|
+
* import { Input } from '@adobe/elsie/components/Input';
|
|
49
|
+
* ```
|
|
50
|
+
*/
|
|
51
|
+
export const InputField = {
|
|
52
|
+
render: (args) => (<Field {...args}>
|
|
53
|
+
<Input name="inputField" placeholder="Input"/>
|
|
54
|
+
</Field>),
|
|
55
|
+
args: {
|
|
56
|
+
label: 'Label',
|
|
57
|
+
hint: 'Helper Text',
|
|
58
|
+
error: '',
|
|
59
|
+
success: '',
|
|
60
|
+
size: 'medium',
|
|
61
|
+
disabled: false,
|
|
62
|
+
},
|
|
63
|
+
play: async ({ canvasElement }) => {
|
|
64
|
+
const canvas = within(canvasElement);
|
|
65
|
+
await userEvent.type(canvas.getByPlaceholderText('Input'), 'Test Content');
|
|
66
|
+
await expect(await canvas.findByDisplayValue('Test Content')).toBeVisible();
|
|
67
|
+
await expect(canvas.getByText('Label')).toBeVisible();
|
|
68
|
+
await expect(canvas.getByText('Helper Text')).toBeVisible();
|
|
69
|
+
},
|
|
70
|
+
};
|
|
71
|
+
/**
|
|
72
|
+
* ```ts
|
|
73
|
+
* import { Field } from '@adobe/elsie/components/Field';
|
|
74
|
+
* import { Incrementer } from '@adobe/elsie/components/Incrementer';
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export const IncrementerField = {
|
|
78
|
+
render: (args) => (<Field {...args}>
|
|
79
|
+
<Incrementer name="incrementerField" value="0" min={0} max={100}/>
|
|
80
|
+
</Field>),
|
|
81
|
+
args: {
|
|
82
|
+
label: 'Label',
|
|
83
|
+
hint: 'Helper Text',
|
|
84
|
+
error: '',
|
|
85
|
+
success: '',
|
|
86
|
+
size: 'medium',
|
|
87
|
+
disabled: false,
|
|
88
|
+
},
|
|
89
|
+
play: async () => {
|
|
90
|
+
const canvasElement = document.querySelector('#storybook-root');
|
|
91
|
+
const canvas = within(canvasElement);
|
|
92
|
+
const decreaseButton = document.querySelector('button[aria-label="Decrease Quantity"]');
|
|
93
|
+
const inputField = document.querySelector('input');
|
|
94
|
+
const increaseButton = document.querySelector('button[aria-label="Increase Quantity"]');
|
|
95
|
+
// Without this wait test failing intermittently as click event is triggerning before even element fully loaded
|
|
96
|
+
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
97
|
+
await userEvent.click(increaseButton);
|
|
98
|
+
await expect(await canvas.findByDisplayValue('1')).toBeTruthy();
|
|
99
|
+
await userEvent.click(decreaseButton);
|
|
100
|
+
await expect(await canvas.findByDisplayValue('0')).toBeTruthy();
|
|
101
|
+
await userEvent.type(inputField, '99');
|
|
102
|
+
await expect(await canvas.findByDisplayValue('99')).toBeTruthy();
|
|
103
|
+
await userEvent.click(increaseButton);
|
|
104
|
+
await expect(await canvas.findByDisplayValue('100')).toBeTruthy();
|
|
105
|
+
await userEvent.click(increaseButton);
|
|
106
|
+
await expect(await canvas.findByDisplayValue('100')).toBeTruthy();
|
|
107
|
+
await userEvent.click(decreaseButton);
|
|
108
|
+
await expect(await canvas.findByDisplayValue('99')).toBeTruthy();
|
|
109
|
+
await userEvent.clear(inputField);
|
|
110
|
+
await userEvent.type(inputField, '0');
|
|
111
|
+
await expect(await canvas.findByDisplayValue('0')).toBeTruthy();
|
|
112
|
+
},
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* ```ts
|
|
116
|
+
* import { Field } from '@adobe/elsie/components/Field';
|
|
117
|
+
* import { Picker } from '@adobe/elsie/components/Picker';
|
|
118
|
+
* ```
|
|
119
|
+
*/
|
|
120
|
+
export const PickerField = {
|
|
121
|
+
render: (args) => (<Field {...args}>
|
|
122
|
+
<Picker name="pickerField" placeholder="Select an option" options={[
|
|
123
|
+
{
|
|
124
|
+
value: 'option1',
|
|
125
|
+
text: 'Option 1',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
value: 'option2',
|
|
129
|
+
text: 'Option 2',
|
|
130
|
+
disabled: true,
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
value: 'option3',
|
|
134
|
+
text: 'Option 3',
|
|
135
|
+
},
|
|
136
|
+
]} disabled={false}/>
|
|
137
|
+
</Field>),
|
|
138
|
+
args: {
|
|
139
|
+
label: 'Label',
|
|
140
|
+
hint: 'Helper Text',
|
|
141
|
+
error: '',
|
|
142
|
+
success: '',
|
|
143
|
+
size: 'medium',
|
|
144
|
+
disabled: false,
|
|
145
|
+
},
|
|
146
|
+
play: async ({ canvasElement }) => {
|
|
147
|
+
const canvas = within(canvasElement);
|
|
148
|
+
await userEvent.click(canvas.getByText('Select an option'));
|
|
149
|
+
await expect(canvas.getByText('Option 1')).toBeVisible();
|
|
150
|
+
await expect(canvas.getByText('Option 2')).toBeVisible();
|
|
151
|
+
const select = document.querySelector('.dropin-picker__select');
|
|
152
|
+
await userEvent.selectOptions(select, 'option3');
|
|
153
|
+
await expect(select.textContent).toContain('Option 3');
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
export const CheckboxField = {
|
|
157
|
+
render: (args) => (<Field {...args}>
|
|
158
|
+
<Checkbox name="checkboxField" label="Option" description="Optional description text goes here"/>
|
|
159
|
+
</Field>),
|
|
160
|
+
args: {
|
|
161
|
+
label: 'Label',
|
|
162
|
+
hint: 'Helper Text',
|
|
163
|
+
error: '',
|
|
164
|
+
success: '',
|
|
165
|
+
size: 'medium',
|
|
166
|
+
disabled: false,
|
|
167
|
+
},
|
|
168
|
+
};
|
|
169
|
+
/**
|
|
170
|
+
* ```ts
|
|
171
|
+
* import { Field } from '@adobe/elsie/components/Field';
|
|
172
|
+
* import { TextSwatch } from '@adobe/elsie/components/TextSwatch';
|
|
173
|
+
* ```
|
|
174
|
+
*/
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Field.test.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
+
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
+
import { Field } from '@adobe/elsie/components/Field';
|
|
4
|
+
import { Input } from '@adobe/elsie/components/Input';
|
|
5
|
+
describe('Base/Components/Field', () => {
|
|
6
|
+
test('renders', () => {
|
|
7
|
+
const { container } = render(<Field label="Label">
|
|
8
|
+
<Input name="foo"/>
|
|
9
|
+
</Field>);
|
|
10
|
+
const elem = container.querySelector('.dropin-field');
|
|
11
|
+
expect(!!elem).toEqual(true);
|
|
12
|
+
});
|
|
13
|
+
test('uses generated id as label "for" attribute value, if no id provided', () => {
|
|
14
|
+
const { container } = render(<Field label="Label">
|
|
15
|
+
<Input name="foo"/>
|
|
16
|
+
</Field>);
|
|
17
|
+
const input = container.querySelector('input');
|
|
18
|
+
const label = container.querySelector('.dropin-field__label');
|
|
19
|
+
expect(label?.getAttribute('for')).toEqual(input?.id);
|
|
20
|
+
});
|
|
21
|
+
test('uses child id as label "for" attribute value', () => {
|
|
22
|
+
const { container } = render(<Field label="Label">
|
|
23
|
+
<Input id="foo" name="foo"/>
|
|
24
|
+
</Field>);
|
|
25
|
+
const label = container.querySelector('.dropin-field__label');
|
|
26
|
+
expect(label?.getAttribute('for')).toEqual('foo');
|
|
27
|
+
});
|
|
28
|
+
test('shows error', () => {
|
|
29
|
+
const { container } = render(<Field label="Label" error="Oops!">
|
|
30
|
+
<Input name="foo"/>
|
|
31
|
+
</Field>);
|
|
32
|
+
const footer = container.querySelector('.dropin-field__hint');
|
|
33
|
+
expect(footer?.classList.contains('dropin-field__hint--error')).toEqual(true);
|
|
34
|
+
expect(footer?.textContent).toEqual('Oops!');
|
|
35
|
+
});
|
|
36
|
+
test('shows success', () => {
|
|
37
|
+
const { container } = render(<Field label="Label" success="Yay!">
|
|
38
|
+
<Input name="foo"/>
|
|
39
|
+
</Field>);
|
|
40
|
+
const footer = container.querySelector('.dropin-field__hint');
|
|
41
|
+
expect(footer?.classList.contains('dropin-field__hint--success')).toEqual(true);
|
|
42
|
+
expect(footer?.textContent).toEqual('Yay!');
|
|
43
|
+
});
|
|
44
|
+
test('shows hint', () => {
|
|
45
|
+
const { container } = render(<Field label="Label" hint="Howdy!">
|
|
46
|
+
<Input name="foo"/>
|
|
47
|
+
</Field>);
|
|
48
|
+
const hint = container.querySelector('.dropin-field__hint');
|
|
49
|
+
expect(hint?.classList.contains('dropin-field__hint')).toEqual(true);
|
|
50
|
+
expect(hint?.textContent).toEqual('Howdy!');
|
|
51
|
+
});
|
|
52
|
+
test('shows error over hint', () => {
|
|
53
|
+
const { container } = render(<Field label="Label" hint="Howdy!" error="Nope!">
|
|
54
|
+
<Input name="foo"/>
|
|
55
|
+
</Field>);
|
|
56
|
+
const footer = container.querySelector('.dropin-field__hint');
|
|
57
|
+
expect(footer?.classList.contains('dropin-field__hint--error')).toEqual(true);
|
|
58
|
+
expect(footer?.textContent).toEqual('Nope!');
|
|
59
|
+
});
|
|
60
|
+
test('shows success over hint', () => {
|
|
61
|
+
const { container } = render(<Field label="Label" hint="Howdy!" success="Yay!">
|
|
62
|
+
<Input name="foo"/>
|
|
63
|
+
</Field>);
|
|
64
|
+
const footer = container.querySelector('.dropin-field__hint');
|
|
65
|
+
expect(footer?.classList.contains('dropin-field__hint--success')).toEqual(true);
|
|
66
|
+
expect(footer?.textContent).toEqual('Yay!');
|
|
67
|
+
});
|
|
68
|
+
test('shows error over success', () => {
|
|
69
|
+
const { container } = render(<Field label="Label" success="Yay!" error="Nope!">
|
|
70
|
+
<Input name="foo"/>
|
|
71
|
+
</Field>);
|
|
72
|
+
const footer = container.querySelector('.dropin-field__hint');
|
|
73
|
+
expect(footer?.classList.contains('dropin-field__hint--error')).toEqual(true);
|
|
74
|
+
expect(footer?.textContent).toEqual('Nope!');
|
|
75
|
+
const input = container.querySelector('.dropin-input');
|
|
76
|
+
expect(input?.classList).toContain('dropin-input--error');
|
|
77
|
+
expect(input?.classList).not.toContain('dropin-input--success');
|
|
78
|
+
});
|
|
79
|
+
test('children as string returns empty', () => {
|
|
80
|
+
// @ts-ignore
|
|
81
|
+
const { container } = render(<Field label="Label">Howdy!</Field>);
|
|
82
|
+
const elem = container.querySelector('.dropin-field');
|
|
83
|
+
expect(elem?.querySelector('.dropin-field__content')?.innerHTML).toEqual('');
|
|
84
|
+
});
|
|
85
|
+
test('returns children', () => {
|
|
86
|
+
const { container } = render(<Field label="Label">
|
|
87
|
+
<Input name="foo"/>
|
|
88
|
+
</Field>);
|
|
89
|
+
expect(container?.querySelector('input')?.getAttribute('name')).toEqual(`foo`);
|
|
90
|
+
});
|
|
91
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Field/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@adobe/elsie/components/Field/Field';
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { JSX, FunctionComponent } from 'preact';
|
|
2
|
+
import '@adobe/elsie/components/Icon/Icon.css';
|
|
3
|
+
export type IconType = keyof typeof import('@adobe/elsie/icons');
|
|
4
|
+
export interface IconProps extends Omit<JSX.SVGAttributes, 'size'> {
|
|
5
|
+
source: FunctionComponent<JSX.SVGAttributes<SVGElement>> | IconType;
|
|
6
|
+
size?: '12' | '16' | '24' | '32' | '64' | '80';
|
|
7
|
+
stroke?: '1' | '2' | '3' | '4';
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function Icon({ source: Source, size, stroke, viewBox, className, ...props }: IconProps): JSX.Element;
|
|
11
|
+
//# sourceMappingURL=Icon.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAIhD,OAAO,uCAAuC,CAAC;AAE/C,MAAM,MAAM,QAAQ,GAAG,MAAM,cAAc,oBAAoB,CAAC,CAAC;AAuCjE,MAAM,WAAW,SAAU,SAAQ,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,MAAM,CAAC;IAChE,MAAM,EAAE,iBAAiB,CAAC,GAAG,CAAC,aAAa,CAAC,UAAU,CAAC,CAAC,GAAG,QAAQ,CAAC;IACpE,IAAI,CAAC,EAAE,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;IAC/C,MAAM,CAAC,EAAE,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,GAAG,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,IAAI,CAAC,EACnB,MAAM,EAAE,MAAM,EACd,IAAW,EACX,MAAY,EACZ,OAAqB,EACrB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,SAAS,eAyBX"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { classes } from '@adobe/elsie/lib/classes';
|
|
2
|
+
import { lazy, Suspense } from 'preact/compat';
|
|
3
|
+
import '@adobe/elsie/components/Icon/Icon.css';
|
|
4
|
+
const lazyIcons = {
|
|
5
|
+
Add: lazy(() => import('@adobe/elsie/icons/Add.svg')),
|
|
6
|
+
Bulk: lazy(() => import('@adobe/elsie/icons/Bulk.svg')),
|
|
7
|
+
Burger: lazy(() => import('@adobe/elsie/icons/Burger.svg')),
|
|
8
|
+
Cart: lazy(() => import('@adobe/elsie/icons/Cart.svg')),
|
|
9
|
+
Check: lazy(() => import('@adobe/elsie/icons/Check.svg')),
|
|
10
|
+
ChevronDown: lazy(() => import('@adobe/elsie/icons/ChevronDown.svg')),
|
|
11
|
+
ChevronUp: lazy(() => import('@adobe/elsie/icons/ChevronUp.svg')),
|
|
12
|
+
ChevronRight: lazy(() => import('@adobe/elsie/icons/ChevronRight.svg')),
|
|
13
|
+
Close: lazy(() => import('@adobe/elsie/icons/Close.svg')),
|
|
14
|
+
Heart: lazy(() => import('@adobe/elsie/icons/Heart.svg')),
|
|
15
|
+
Minus: lazy(() => import('@adobe/elsie/icons/Minus.svg')),
|
|
16
|
+
Placeholder: lazy(() => import('@adobe/elsie/icons/Placeholder.svg')),
|
|
17
|
+
PlaceholderFilled: lazy(() => import('@adobe/elsie/icons/PlaceholderFilled.svg')),
|
|
18
|
+
Search: lazy(() => import('@adobe/elsie/icons/Search.svg')),
|
|
19
|
+
SearchFilled: lazy(() => import('@adobe/elsie/icons/SearchFilled.svg')),
|
|
20
|
+
Sort: lazy(() => import('@adobe/elsie/icons/Sort.svg')),
|
|
21
|
+
Star: lazy(() => import('@adobe/elsie/icons/Star.svg')),
|
|
22
|
+
View: lazy(() => import('@adobe/elsie/icons/View.svg')),
|
|
23
|
+
User: lazy(() => import('@adobe/elsie/icons/User.svg')),
|
|
24
|
+
Warning: lazy(() => import('@adobe/elsie/icons/Warning.svg')),
|
|
25
|
+
Locker: lazy(() => import('@adobe/elsie/icons/Locker.svg')),
|
|
26
|
+
Wallet: lazy(() => import('@adobe/elsie/icons/Wallet.svg')),
|
|
27
|
+
Card: lazy(() => import('@adobe/elsie/icons/Card.svg')),
|
|
28
|
+
Order: lazy(() => import('@adobe/elsie/icons/Order.svg')),
|
|
29
|
+
Delivery: lazy(() => import('@adobe/elsie/icons/Delivery.svg')),
|
|
30
|
+
OrderError: lazy(() => import('@adobe/elsie/icons/OrderError.svg')),
|
|
31
|
+
OrderSuccess: lazy(() => import('@adobe/elsie/icons/OrderSuccess.svg')),
|
|
32
|
+
PaymentError: lazy(() => import('@adobe/elsie/icons/PaymentError.svg')),
|
|
33
|
+
CheckWithCircle: lazy(() => import('@adobe/elsie/icons/CheckWithCircle.svg')),
|
|
34
|
+
WarningWithCircle: lazy(() => import('@adobe/elsie/icons/WarningWithCircle.svg')),
|
|
35
|
+
WarningFilled: lazy(() => import('@adobe/elsie/icons/WarningFilled.svg')),
|
|
36
|
+
InfoFilled: lazy(() => import('@adobe/elsie/icons/InfoFilled.svg')),
|
|
37
|
+
HeartFilled: lazy(() => import('@adobe/elsie/icons/HeartFilled.svg')),
|
|
38
|
+
Trash: lazy(() => import('@adobe/elsie/icons/Trash.svg')),
|
|
39
|
+
};
|
|
40
|
+
export function Icon({ source: Source, size = '24', stroke = '2', viewBox = '0 0 24 24', className, ...props }) {
|
|
41
|
+
const LazyIcon = typeof Source === 'string' ? lazyIcons[Source] : null;
|
|
42
|
+
const defaultProps = {
|
|
43
|
+
className: classes([
|
|
44
|
+
'dropin-icon',
|
|
45
|
+
`dropin-icon--shape-stroke-${stroke}`,
|
|
46
|
+
className,
|
|
47
|
+
]),
|
|
48
|
+
width: size,
|
|
49
|
+
height: size,
|
|
50
|
+
viewBox,
|
|
51
|
+
};
|
|
52
|
+
return (<Suspense fallback={null}>
|
|
53
|
+
{LazyIcon ? (<LazyIcon {...props} {...defaultProps}/>) : (
|
|
54
|
+
// @ts-ignore
|
|
55
|
+
<Source {...props} {...defaultProps}/>)}
|
|
56
|
+
</Suspense>);
|
|
57
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { IconProps } from '@adobe/elsie/components/Icon';
|
|
3
|
+
/**
|
|
4
|
+
* Use Icons as symbols or metaphors to communicate and enhance the user experience.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<IconProps>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<IconProps>;
|
|
9
|
+
/**
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { Icon } from '@adobe/elsie/components/Icon';
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const Primary: Story;
|
|
15
|
+
export declare const Lazy: Story;
|
|
16
|
+
//# sourceMappingURL=Icon.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAQ,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI/D;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CAoBzB,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC;;;;GAIG;AAEH,eAAO,MAAM,OAAO,EAAE,KAIrB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KASlB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.stories.helpers.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.stories.helpers.jsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as Icons from '@adobe/elsie/icons';
|
|
2
|
+
import { Icon } from './Icon';
|
|
3
|
+
const iconNames = Object.keys(Icons);
|
|
4
|
+
export const IconsList = iconNames.reduce((acc, name) => {
|
|
5
|
+
acc[name] = <Icon source={Icons[name]} size="24" stroke="1"/>;
|
|
6
|
+
return acc;
|
|
7
|
+
}, { none: null });
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Icon } from '@adobe/elsie/components/Icon';
|
|
2
|
+
import { Cart } from '@adobe/elsie/icons/index';
|
|
3
|
+
import * as Icons from '@adobe/elsie/icons';
|
|
4
|
+
/**
|
|
5
|
+
* Use Icons as symbols or metaphors to communicate and enhance the user experience.
|
|
6
|
+
*/
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Icon',
|
|
9
|
+
component: Icon,
|
|
10
|
+
argTypes: {
|
|
11
|
+
source: {
|
|
12
|
+
options: Object.keys(Icons),
|
|
13
|
+
mapping: Icons,
|
|
14
|
+
control: {
|
|
15
|
+
type: 'select',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
size: {
|
|
19
|
+
control: 'select',
|
|
20
|
+
options: ['12', '16', '24', '32', '64', '80'],
|
|
21
|
+
},
|
|
22
|
+
stroke: {
|
|
23
|
+
control: 'select',
|
|
24
|
+
options: ['1', '2', '3', '4'],
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export default meta;
|
|
29
|
+
/**
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { Icon } from '@adobe/elsie/components/Icon';
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export const Primary = {
|
|
35
|
+
args: {
|
|
36
|
+
source: Cart,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
export const Lazy = {
|
|
40
|
+
argTypes: {
|
|
41
|
+
source: {
|
|
42
|
+
mapping: Object.keys(Icons),
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
args: {
|
|
46
|
+
source: 'Cart',
|
|
47
|
+
},
|
|
48
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Icon.test.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/Icon.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
+
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
+
import { Icon } from '@adobe/elsie/components/Icon';
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
import Burger from '@adobe/elsie/icons/Burger.svg';
|
|
6
|
+
import * as icons from '@adobe/elsie/icons';
|
|
7
|
+
jest.mock('@adobe/elsie/icons/Icon.svg', () => {
|
|
8
|
+
return function TestIcon(props) {
|
|
9
|
+
return (<svg {...props} data-testid="icon">
|
|
10
|
+
Icon
|
|
11
|
+
</svg>);
|
|
12
|
+
};
|
|
13
|
+
});
|
|
14
|
+
describe('Foundations/Assets/Icon', () => {
|
|
15
|
+
test('renders', async () => {
|
|
16
|
+
const { findByTestId } = render(<Icon source={Burger}/>);
|
|
17
|
+
const icon = await findByTestId('icon');
|
|
18
|
+
expect(icon).toMatchInlineSnapshot(`
|
|
19
|
+
<svg
|
|
20
|
+
class="dropin-icon dropin-icon--shape-stroke-2"
|
|
21
|
+
data-testid="icon"
|
|
22
|
+
height="24"
|
|
23
|
+
viewBox="0 0 24 24"
|
|
24
|
+
width="24"
|
|
25
|
+
>
|
|
26
|
+
Icon
|
|
27
|
+
</svg>
|
|
28
|
+
`);
|
|
29
|
+
});
|
|
30
|
+
test('renders Icons with different size', async () => {
|
|
31
|
+
const size = '32';
|
|
32
|
+
const { findByTestId } = render(<Icon source={Burger} size={size}/>);
|
|
33
|
+
const icon = await findByTestId('icon');
|
|
34
|
+
expect(icon.getAttribute('width')).toEqual(size);
|
|
35
|
+
expect(icon.getAttribute('height')).toEqual(size);
|
|
36
|
+
});
|
|
37
|
+
test('renders Icons with stroke', async () => {
|
|
38
|
+
const stroke = '2';
|
|
39
|
+
const { findByTestId } = render(<Icon source={Burger} stroke={stroke}/>);
|
|
40
|
+
const icon = await findByTestId('icon');
|
|
41
|
+
expect(icon.classList).toMatchInlineSnapshot(`
|
|
42
|
+
DOMTokenList {
|
|
43
|
+
"0": "dropin-icon",
|
|
44
|
+
"1": "dropin-icon--shape-stroke-2",
|
|
45
|
+
}
|
|
46
|
+
`);
|
|
47
|
+
});
|
|
48
|
+
// Test lazy icons
|
|
49
|
+
for (const iconName of Object.keys(icons)) {
|
|
50
|
+
test(`renders ${iconName} Icon`, async () => {
|
|
51
|
+
// @ts-ignore
|
|
52
|
+
const { findByTestId } = render(<Icon source={iconName}/>);
|
|
53
|
+
const icon = await findByTestId('icon');
|
|
54
|
+
expect(icon).toMatchInlineSnapshot(`
|
|
55
|
+
<svg
|
|
56
|
+
class="dropin-icon dropin-icon--shape-stroke-2"
|
|
57
|
+
data-testid="icon"
|
|
58
|
+
height="24"
|
|
59
|
+
viewBox="0 0 24 24"
|
|
60
|
+
width="24"
|
|
61
|
+
>
|
|
62
|
+
Icon
|
|
63
|
+
</svg>
|
|
64
|
+
`);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Icon/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@adobe/elsie/components/Icon/Icon';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
import '@adobe/elsie/components/IllustratedMessage/IllustratedMessage.css';
|
|
4
|
+
export interface IllustratedMessageProps extends Omit<HTMLAttributes<HTMLDivElement>, 'icon' | 'action'> {
|
|
5
|
+
icon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
6
|
+
heading?: string;
|
|
7
|
+
headingLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
8
|
+
message?: VNode<HTMLAttributes<HTMLElement>>;
|
|
9
|
+
action?: VNode;
|
|
10
|
+
variant?: 'primary' | 'secondary';
|
|
11
|
+
}
|
|
12
|
+
export declare const IllustratedMessage: FunctionComponent<IllustratedMessageProps>;
|
|
13
|
+
//# sourceMappingURL=IllustratedMessage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IllustratedMessage.d.ts","sourceRoot":"","sources":["../../../src/components/IllustratedMessage/IllustratedMessage.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,cAAc,EAAO,MAAM,eAAe,CAAC;AAEpD,OAAO,mEAAmE,CAAC;AAG3E,MAAM,WAAW,uBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/D,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IACrC,OAAO,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IAC7C,MAAM,CAAC,EAAE,KAAK,CAAC;IACf,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CACnC;AAED,eAAO,MAAM,kBAAkB,EAAE,iBAAiB,CAAC,uBAAuB,CAoDzE,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { classes, VComponent } from '@adobe/elsie/lib';
|
|
2
|
+
import '@adobe/elsie/components/IllustratedMessage/IllustratedMessage.css';
|
|
3
|
+
import { Card } from '@adobe/elsie/components';
|
|
4
|
+
export const IllustratedMessage = ({ className, icon, heading, headingLevel = 2, message, action, variant = 'secondary', ...props }) => {
|
|
5
|
+
const Heading = headingLevel >= 1 && headingLevel <= 6
|
|
6
|
+
? `h${headingLevel}`
|
|
7
|
+
: 'h2';
|
|
8
|
+
return (<div {...props} className={classes(['dropin-illustrated-message', className])}>
|
|
9
|
+
<Card variant={variant}>
|
|
10
|
+
{icon && (<VComponent node={icon} aria-hidden="true" size="80" className="dropin-illustrated-message__icon"/>)}
|
|
11
|
+
|
|
12
|
+
{heading && (<Heading className="dropin-illustrated-message__heading">
|
|
13
|
+
{heading}
|
|
14
|
+
</Heading>)}
|
|
15
|
+
|
|
16
|
+
{message && (<VComponent node={message} className="dropin-illustrated-message__message"/>)}
|
|
17
|
+
|
|
18
|
+
{action && (<VComponent node={action} className="dropin-illustrated-message__action"/>)}
|
|
19
|
+
</Card>
|
|
20
|
+
</div>);
|
|
21
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { IllustratedMessageProps } from '@adobe/elsie/components/IllustratedMessage';
|
|
3
|
+
/**
|
|
4
|
+
* Use IllustratedMessages to display an illustration and a message, usually for an empty state or an error page.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<IllustratedMessageProps>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<IllustratedMessageProps>;
|
|
9
|
+
export declare const IllustratedMessage: Story;
|
|
10
|
+
//# sourceMappingURL=IllustratedMessage.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IllustratedMessage.stories.d.ts","sourceRoot":"","sources":["../../../src/components/IllustratedMessage/IllustratedMessage.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,uBAAuB,EACxB,MAAM,4CAA4C,CAAC;AAMpD;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,uBAAuB,CA4DvC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,uBAAuB,CAAC,CAAC;AAE/C,eAAO,MAAM,kBAAkB,EAAE,KAoChC,CAAC"}
|