@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,119 @@
|
|
|
1
|
+
import { ActionButton as component, } from '@adobe/elsie/components/ActionButton';
|
|
2
|
+
import { Add } from '@adobe/elsie/icons';
|
|
3
|
+
import { Icon } from '@adobe/elsie/components/Icon';
|
|
4
|
+
import { IconsList } from '@adobe/elsie/components/Icon/Icon.stories.helpers';
|
|
5
|
+
import { within } from '@storybook/testing-library';
|
|
6
|
+
import { expect } from '@storybook/jest';
|
|
7
|
+
/**
|
|
8
|
+
* Use Action Buttons to let users complete actions or select items in a workflow.
|
|
9
|
+
*/
|
|
10
|
+
const meta = {
|
|
11
|
+
title: 'Components/ActionButton',
|
|
12
|
+
component,
|
|
13
|
+
argTypes: {
|
|
14
|
+
icon: {
|
|
15
|
+
options: Object.keys(IconsList),
|
|
16
|
+
mapping: IconsList,
|
|
17
|
+
control: {
|
|
18
|
+
type: 'select',
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
export const Default = {
|
|
25
|
+
name: 'Action Button',
|
|
26
|
+
args: {
|
|
27
|
+
children: 'Action',
|
|
28
|
+
active: false,
|
|
29
|
+
disabled: false,
|
|
30
|
+
},
|
|
31
|
+
play: async ({ canvasElement }) => {
|
|
32
|
+
const canvas = within(canvasElement);
|
|
33
|
+
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
34
|
+
await expect(await canvas.findByRole('button')).toHaveClass('dropin-action-button');
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export const IconOnly = {
|
|
38
|
+
name: 'Icon Action Button',
|
|
39
|
+
args: {
|
|
40
|
+
...Default.args,
|
|
41
|
+
children: '',
|
|
42
|
+
'aria-label': 'Action Button',
|
|
43
|
+
icon: (<Icon source={Add} size="32" className="storybook_icon" stroke="1" viewBox="0 0 24 24"/>),
|
|
44
|
+
},
|
|
45
|
+
play: async ({ canvasElement }) => {
|
|
46
|
+
const canvas = within(canvasElement);
|
|
47
|
+
const buttonIcon = document.querySelector('.dropin-action-button-icon');
|
|
48
|
+
const addIcon = document.querySelector('g[data-name="Add icon"]');
|
|
49
|
+
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
50
|
+
await expect(await buttonIcon).toBeVisible();
|
|
51
|
+
await expect(await addIcon).toBeVisible();
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const WithIcon = {
|
|
55
|
+
name: 'Action Button With Icon',
|
|
56
|
+
args: {
|
|
57
|
+
...Default.args,
|
|
58
|
+
icon: (<Icon source={Add} size="32" className="storybook_icon" stroke="1" viewBox="0 0 24 24"/>),
|
|
59
|
+
},
|
|
60
|
+
play: async ({ canvasElement }) => {
|
|
61
|
+
const canvas = within(canvasElement);
|
|
62
|
+
const buttonIcon = document.querySelector('.dropin-action-button-icon');
|
|
63
|
+
const addIcon = document.querySelector('g[data-name="Add icon"]');
|
|
64
|
+
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
65
|
+
await expect(await buttonIcon).toBeVisible();
|
|
66
|
+
await expect(await addIcon).toBeVisible();
|
|
67
|
+
await expect(await canvas.getByText('Action')).toBeVisible();
|
|
68
|
+
},
|
|
69
|
+
};
|
|
70
|
+
export const Disabled = {
|
|
71
|
+
name: 'Disabled Action Button',
|
|
72
|
+
parameters: {
|
|
73
|
+
a11y: {
|
|
74
|
+
config: {
|
|
75
|
+
rules: [{ id: 'color-contrast', enabled: false }],
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
args: {
|
|
80
|
+
...Default.args,
|
|
81
|
+
disabled: true,
|
|
82
|
+
},
|
|
83
|
+
play: async ({ canvasElement }) => {
|
|
84
|
+
const canvas = within(canvasElement);
|
|
85
|
+
await expect(await canvas.findByRole('button')).toBeDisabled();
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export const Active = {
|
|
89
|
+
name: 'Active Action Button',
|
|
90
|
+
args: {
|
|
91
|
+
...Default.args,
|
|
92
|
+
active: true,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
export const DisabledIcon = {
|
|
96
|
+
name: 'Disabled Action Button With Icon',
|
|
97
|
+
parameters: {
|
|
98
|
+
a11y: {
|
|
99
|
+
config: {
|
|
100
|
+
rules: [{ id: 'color-contrast', enabled: false }],
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
},
|
|
104
|
+
args: {
|
|
105
|
+
...WithIcon.args,
|
|
106
|
+
disabled: true,
|
|
107
|
+
},
|
|
108
|
+
play: async ({ canvasElement }) => {
|
|
109
|
+
const canvas = within(canvasElement);
|
|
110
|
+
await expect(await canvas.findByRole('button')).toBeDisabled();
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
export const ActiveIcon = {
|
|
114
|
+
name: 'Active Action Button With Icon',
|
|
115
|
+
args: {
|
|
116
|
+
...WithIcon.args,
|
|
117
|
+
active: true,
|
|
118
|
+
},
|
|
119
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButton.test.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
+
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
+
import { ActionButton } from '@adobe/elsie/components/ActionButton';
|
|
4
|
+
describe('Base/Components/ActionButton', () => {
|
|
5
|
+
test('renders', () => {
|
|
6
|
+
const { container } = render(<ActionButton />);
|
|
7
|
+
const elem = container.querySelector('.dropin-action-button');
|
|
8
|
+
expect(!!elem).toEqual(true);
|
|
9
|
+
});
|
|
10
|
+
// test rendering of button with text
|
|
11
|
+
test('renders with text', () => {
|
|
12
|
+
const { container } = render(<ActionButton children="test"/>);
|
|
13
|
+
const elem = container.querySelector('.dropin-action-button');
|
|
14
|
+
expect(elem.classList.contains('dropin-action-button')).toEqual(true);
|
|
15
|
+
});
|
|
16
|
+
// test rendering of button with children components
|
|
17
|
+
test('renders with children', () => {
|
|
18
|
+
const { container } = render(<ActionButton children={<span>test</span>}/>);
|
|
19
|
+
const elem = container.querySelector('.dropin-action-button');
|
|
20
|
+
expect(elem.classList.contains('dropin-action-button')).toEqual(true);
|
|
21
|
+
});
|
|
22
|
+
// test rendering of button with icon only
|
|
23
|
+
test('renders with icon only', () => {
|
|
24
|
+
const { container } = render(<ActionButton icon={<div>icon</div>} children=""/>);
|
|
25
|
+
const elem2 = container.querySelector('.dropin-action-button-icon');
|
|
26
|
+
expect(elem2.classList.contains('dropin-action-button-icon')).toEqual(true);
|
|
27
|
+
});
|
|
28
|
+
// test rendering of button with text and icon
|
|
29
|
+
test('renders with text and icon', () => {
|
|
30
|
+
const { container } = render(<ActionButton icon={<div>icon</div>} children="test"/>);
|
|
31
|
+
const elem = container.querySelector('.dropin-action-button-icon');
|
|
32
|
+
expect(elem.classList.contains('dropin-action-button-icon')).toEqual(true);
|
|
33
|
+
const elem2 = container.querySelector('.dropin-action-button');
|
|
34
|
+
expect(elem2.classList.contains('dropin-action-button')).toEqual(true);
|
|
35
|
+
});
|
|
36
|
+
test('renders disabled', () => {
|
|
37
|
+
const { container } = render(<ActionButton disabled={true}/>);
|
|
38
|
+
const elem = container.querySelector('.dropin-action-button');
|
|
39
|
+
expect(elem.disabled).toEqual(true);
|
|
40
|
+
expect(elem.classList.contains('dropin-action-button--disabled')).toEqual(true);
|
|
41
|
+
});
|
|
42
|
+
test('renders active', () => {
|
|
43
|
+
const { container } = render(<ActionButton active={true}/>);
|
|
44
|
+
const elem = container.querySelector('.dropin-action-button');
|
|
45
|
+
expect(elem.classList.contains('dropin-action-button--active')).toEqual(true);
|
|
46
|
+
});
|
|
47
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,mDAAmD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@adobe/elsie/components/ActionButton/ActionButton';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
import '@adobe/elsie/components/ActionButtonGroup/ActionButtonGroup.css';
|
|
4
|
+
import { ActionButtonProps } from '@adobe/elsie/components/ActionButton';
|
|
5
|
+
export interface ActionButtonGroupOption {
|
|
6
|
+
value: string | null;
|
|
7
|
+
text: string;
|
|
8
|
+
icon?: VNode<SVGElement>;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export interface ActionButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
12
|
+
variant?: 'primary' | 'secondary';
|
|
13
|
+
activeOption?: string;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
dividers?: boolean;
|
|
16
|
+
children: VNode<ActionButtonProps>[] | VNode<ActionButtonProps>;
|
|
17
|
+
handleSelect?(value: string): void;
|
|
18
|
+
}
|
|
19
|
+
export declare const ActionButtonGroup: FunctionComponent<ActionButtonGroupProps>;
|
|
20
|
+
//# sourceMappingURL=ActionButtonGroup.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButtonGroup.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButtonGroup/ActionButtonGroup.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAgB,MAAM,QAAQ,CAAC;AAChE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,iEAAiE,CAAC;AAGzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAEzE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,KAAK,CAAC,UAAU,CAAC,CAAC;IACzB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,sBAAuB,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC5E,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,EAAE,KAAK,CAAC,iBAAiB,CAAC,EAAE,GAAG,KAAK,CAAC,iBAAiB,CAAC,CAAC;IAChE,YAAY,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,EAAE,iBAAiB,CAAC,sBAAsB,CAyDvE,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { cloneElement } from 'preact';
|
|
2
|
+
import { classes } from '@adobe/elsie/lib';
|
|
3
|
+
import '@adobe/elsie/components/ActionButtonGroup/ActionButtonGroup.css';
|
|
4
|
+
import { useCallback, useState } from 'preact/hooks';
|
|
5
|
+
import { Children } from 'react';
|
|
6
|
+
export const ActionButtonGroup = ({ className, variant = 'primary', activeOption, disabled = false, dividers = true, children, handleSelect, ...props }) => {
|
|
7
|
+
const [activeOptionState, setActiveOptionState] = useState(activeOption);
|
|
8
|
+
const handleClick = useCallback((option) => {
|
|
9
|
+
const isOptionDisabled = disabled || option.props.disabled;
|
|
10
|
+
if (!isOptionDisabled) {
|
|
11
|
+
setActiveOptionState(option.props.value);
|
|
12
|
+
if (handleSelect) {
|
|
13
|
+
handleSelect(option.props.value);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}, [handleSelect, setActiveOptionState, disabled]);
|
|
17
|
+
const buttonGroupOptions = Children.map(children, (child) => {
|
|
18
|
+
const isOptionDisabled = disabled || child.props.disabled;
|
|
19
|
+
const isOptionActive = child.props.value === activeOptionState;
|
|
20
|
+
return cloneElement(child, {
|
|
21
|
+
disabled: isOptionDisabled,
|
|
22
|
+
active: isOptionActive,
|
|
23
|
+
onClick: () => handleClick(child),
|
|
24
|
+
className: classes([
|
|
25
|
+
'dropin-action-button-group__option',
|
|
26
|
+
`dropin-action-button-group__option--${variant}`,
|
|
27
|
+
['dropin-action-button-group__option--active', isOptionActive],
|
|
28
|
+
['dropin-action-button-group__option--with-dividers', dividers],
|
|
29
|
+
]),
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
return (<div role="group" {...props} className={classes([
|
|
33
|
+
'dropin-action-button-group',
|
|
34
|
+
`dropin-action-button-group--${variant}`,
|
|
35
|
+
className,
|
|
36
|
+
])}>
|
|
37
|
+
{buttonGroupOptions}
|
|
38
|
+
</div>);
|
|
39
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { ActionButtonGroupProps } from '@adobe/elsie/components/ActionButtonGroup';
|
|
3
|
+
/**
|
|
4
|
+
* Use Action Button Groups to group related actions.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<ActionButtonGroupProps>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<ActionButtonGroupProps>;
|
|
9
|
+
/**
|
|
10
|
+
* ```ts
|
|
11
|
+
* import { ActionButtonGroup } from '@adobe/elsie/components/ActionButtonGroup';
|
|
12
|
+
* ```
|
|
13
|
+
*/
|
|
14
|
+
export declare const Primary: Story;
|
|
15
|
+
export declare const Secondary: Story;
|
|
16
|
+
//# sourceMappingURL=ActionButtonGroup.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButtonGroup.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButtonGroup/ActionButtonGroup.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAEL,sBAAsB,EACvB,MAAM,2CAA2C,CAAC;AAInD;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,sBAAsB,CA4BtC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,sBAAsB,CAAC,CAAC;AAE9C;;;;GAIG;AAEH,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAoBvB,CAAC"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { ActionButton } from '..';
|
|
2
|
+
import { ActionButtonGroup as component, } from '@adobe/elsie/components/ActionButtonGroup';
|
|
3
|
+
import { Cart, Heart, Star } from '@adobe/elsie/icons';
|
|
4
|
+
import { Icon } from '../Icon';
|
|
5
|
+
/**
|
|
6
|
+
* Use Action Button Groups to group related actions.
|
|
7
|
+
*/
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/ActionButtonGroup',
|
|
10
|
+
component,
|
|
11
|
+
argTypes: {
|
|
12
|
+
variant: {
|
|
13
|
+
description: 'Action Button Group variant',
|
|
14
|
+
options: ['primary', 'secondary'],
|
|
15
|
+
control: { type: 'radio' },
|
|
16
|
+
},
|
|
17
|
+
disabled: {
|
|
18
|
+
description: 'Whether or not the field is disabled',
|
|
19
|
+
type: { name: 'boolean', required: false },
|
|
20
|
+
defaultValue: false,
|
|
21
|
+
},
|
|
22
|
+
dividers: {
|
|
23
|
+
description: 'Whether or not to show dividers between options',
|
|
24
|
+
type: { name: 'boolean', required: false },
|
|
25
|
+
defaultValue: true,
|
|
26
|
+
},
|
|
27
|
+
handleSelect: {
|
|
28
|
+
description: 'Callback function for when an option is selected',
|
|
29
|
+
type: 'function',
|
|
30
|
+
defaultValue: {
|
|
31
|
+
summary: '() => {}',
|
|
32
|
+
},
|
|
33
|
+
action: 'Value Selected',
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export default meta;
|
|
38
|
+
/**
|
|
39
|
+
* ```ts
|
|
40
|
+
* import { ActionButtonGroup } from '@adobe/elsie/components/ActionButtonGroup';
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
export const Primary = {
|
|
44
|
+
args: {
|
|
45
|
+
variant: 'primary',
|
|
46
|
+
children: [
|
|
47
|
+
<ActionButton key="option1" value="option1">
|
|
48
|
+
Option1
|
|
49
|
+
</ActionButton>,
|
|
50
|
+
<ActionButton key="option2" value="option2">
|
|
51
|
+
Option2
|
|
52
|
+
</ActionButton>,
|
|
53
|
+
],
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export const Secondary = {
|
|
57
|
+
args: {
|
|
58
|
+
variant: 'secondary',
|
|
59
|
+
activeOption: 'option2',
|
|
60
|
+
children: [
|
|
61
|
+
<ActionButton key="option1" value="option1" icon={<Icon source={Heart}/>}>
|
|
62
|
+
Option1
|
|
63
|
+
</ActionButton>,
|
|
64
|
+
<ActionButton key="option2" value="option2" icon={<Icon source={Star}/>}>
|
|
65
|
+
Option2
|
|
66
|
+
</ActionButton>,
|
|
67
|
+
<ActionButton key="option3" value="option3" icon={<Icon source={Cart}/>}>
|
|
68
|
+
Option3
|
|
69
|
+
</ActionButton>,
|
|
70
|
+
],
|
|
71
|
+
},
|
|
72
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionButtonGroup.test.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButtonGroup/ActionButtonGroup.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
+
import { render, fireEvent } from '@adobe/elsie/lib/tests';
|
|
3
|
+
import { ActionButtonGroup } from '@adobe/elsie/components/ActionButtonGroup';
|
|
4
|
+
import { ActionButton } from '..';
|
|
5
|
+
describe('Buttons/ActionButtonGroup', () => {
|
|
6
|
+
test('renders', () => {
|
|
7
|
+
const { container } = render(<ActionButtonGroup>
|
|
8
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
9
|
+
</ActionButtonGroup>);
|
|
10
|
+
const elem = container.querySelector('.dropin-action-button-group');
|
|
11
|
+
expect(!!elem).toEqual(true);
|
|
12
|
+
});
|
|
13
|
+
test('renders correct variants', () => {
|
|
14
|
+
const { container, rerender } = render(<ActionButtonGroup variant="primary">
|
|
15
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
16
|
+
</ActionButtonGroup>);
|
|
17
|
+
const primary = container.querySelector('.dropin-action-button-group');
|
|
18
|
+
expect(primary.classList.contains('dropin-action-button-group--primary')).toEqual(true);
|
|
19
|
+
rerender(<ActionButtonGroup variant="secondary">
|
|
20
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
21
|
+
</ActionButtonGroup>);
|
|
22
|
+
const secondary = container.querySelector('.dropin-action-button-group');
|
|
23
|
+
expect(secondary.classList.contains('dropin-action-button-group--secondary')).toEqual(true);
|
|
24
|
+
});
|
|
25
|
+
test('renders options', () => {
|
|
26
|
+
const { container } = render(<ActionButtonGroup activeOption="option2">
|
|
27
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
28
|
+
<ActionButton value={'option2'}>option2</ActionButton>
|
|
29
|
+
<ActionButton value={'option3'}>option3</ActionButton>
|
|
30
|
+
</ActionButtonGroup>);
|
|
31
|
+
const options = container.querySelectorAll('.dropin-action-button-group__option');
|
|
32
|
+
expect(options?.length).toEqual(3);
|
|
33
|
+
const activeOption = container.querySelector('.dropin-action-button-group__option--active');
|
|
34
|
+
expect(activeOption?.textContent).toEqual('option2');
|
|
35
|
+
});
|
|
36
|
+
test('renders dividers', () => {
|
|
37
|
+
const { container, rerender } = render(<ActionButtonGroup dividers={true}>
|
|
38
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
39
|
+
<ActionButton value={'option2'}>option2</ActionButton>
|
|
40
|
+
</ActionButtonGroup>);
|
|
41
|
+
const elemWithDividers = container.querySelectorAll('.dropin-action-button-group__button');
|
|
42
|
+
elemWithDividers.forEach((elem) => {
|
|
43
|
+
expect(elem.classList.contains('dropin-action-button-group__button--with-dividers')).toEqual(true);
|
|
44
|
+
});
|
|
45
|
+
rerender(<ActionButtonGroup dividers={false}>
|
|
46
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
47
|
+
<ActionButton value={'option2'}>option2</ActionButton>
|
|
48
|
+
</ActionButtonGroup>);
|
|
49
|
+
const elemWithoutDividers = container.querySelector('.dropin-action-button-group');
|
|
50
|
+
expect(elemWithoutDividers.classList.contains('dropin-action-button-group--with-dividers')).toEqual(false);
|
|
51
|
+
});
|
|
52
|
+
test('calls onClick callback', () => {
|
|
53
|
+
const mockFn = jest.fn();
|
|
54
|
+
const { container, rerender } = render(<ActionButtonGroup handleSelect={mockFn} activeOption="option1">
|
|
55
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
56
|
+
</ActionButtonGroup>);
|
|
57
|
+
const elem = container.querySelector('.dropin-action-button-group__option');
|
|
58
|
+
fireEvent.click(elem);
|
|
59
|
+
expect(mockFn).toBeCalledWith(expect.stringContaining('option1'));
|
|
60
|
+
expect(elem.classList.contains('dropin-action-button-group__option--active')).toEqual(true);
|
|
61
|
+
rerender(<ActionButtonGroup>
|
|
62
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
63
|
+
</ActionButtonGroup>);
|
|
64
|
+
const elemOption = container.querySelector('.dropin-action-button-group__option');
|
|
65
|
+
fireEvent.click(elemOption);
|
|
66
|
+
expect(elemOption.classList.contains('dropin-action-button-group__option--active')).toEqual(true);
|
|
67
|
+
});
|
|
68
|
+
test('disabled', () => {
|
|
69
|
+
const mockFn = jest.fn();
|
|
70
|
+
const { container } = render(<ActionButtonGroup handleSelect={mockFn} disabled={true}>
|
|
71
|
+
<ActionButton value={'option1'}>option1</ActionButton>
|
|
72
|
+
</ActionButtonGroup>);
|
|
73
|
+
const elem = container.querySelector('.dropin-action-button-group__option');
|
|
74
|
+
expect(elem.disabled).toEqual(true);
|
|
75
|
+
fireEvent.click(elem);
|
|
76
|
+
expect(mockFn).not.toHaveBeenCalled();
|
|
77
|
+
});
|
|
78
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButtonGroup/index.ts"],"names":[],"mappings":"AAAA,cAAc,6DAA6D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@adobe/elsie/components/ActionButtonGroup/ActionButtonGroup';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
import '@adobe/elsie/components/AlertBanner/AlertBanner.css';
|
|
4
|
+
export interface AlertBannerProps extends Omit<HTMLAttributes<HTMLDivElement>, 'icon' | 'action'> {
|
|
5
|
+
variant: 'brand' | 'neutral' | 'success' | 'warning';
|
|
6
|
+
icon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
7
|
+
message: VNode;
|
|
8
|
+
onDismiss: () => void;
|
|
9
|
+
action?: {
|
|
10
|
+
label: string;
|
|
11
|
+
onClick: (event: Event) => void;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
export declare const AlertBanner: FunctionComponent<AlertBannerProps>;
|
|
15
|
+
//# sourceMappingURL=AlertBanner.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertBanner.d.ts","sourceRoot":"","sources":["../../../src/components/AlertBanner/AlertBanner.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,qDAAqD,CAAC;AAK7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,GAAG,QAAQ,CAAC;IAC/D,OAAO,EAAE,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,SAAS,CAAC;IACrD,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C,OAAO,EAAE,KAAK,CAAC;IACf,SAAS,EAAE,MAAM,IAAI,CAAC;IACtB,MAAM,CAAC,EAAE;QACP,KAAK,EAAE,MAAM,CAAC;QACd,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;KACjC,CAAC;CACH;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CA4D3D,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { classes, VComponent } from '@adobe/elsie/lib';
|
|
2
|
+
import '@adobe/elsie/components/AlertBanner/AlertBanner.css';
|
|
3
|
+
import { Button, Icon } from '@adobe/elsie/components';
|
|
4
|
+
import { Close } from '@adobe/elsie/icons';
|
|
5
|
+
import { useText } from '@adobe/elsie/i18n';
|
|
6
|
+
export const AlertBanner = ({ className, variant, icon, message, onDismiss, action, ...props }) => {
|
|
7
|
+
const translations = useText({
|
|
8
|
+
dismiss: 'Dropin.InlineAlert.dismissLabel',
|
|
9
|
+
});
|
|
10
|
+
return (<div {...props} className={classes([
|
|
11
|
+
className,
|
|
12
|
+
'dropin-alert-banner',
|
|
13
|
+
`dropin-alert-banner--${variant}`,
|
|
14
|
+
])}>
|
|
15
|
+
<div className={'dropin-alert-banner__content'}>
|
|
16
|
+
{icon && (<VComponent node={icon} aria-hidden="true" className={'dropin-alert-banner__icon'}/>)}
|
|
17
|
+
|
|
18
|
+
{/* Message */}
|
|
19
|
+
<VComponent node={message} className={classes(['dropin-alert-banner__message'])}/>
|
|
20
|
+
</div>
|
|
21
|
+
|
|
22
|
+
<div className={'dropin-alert-banner__actions'}>
|
|
23
|
+
{action && (<Button variant="tertiary" className={'dropin-alert-banner__action'} onClick={action.onClick} aria-label={action.label}>
|
|
24
|
+
{action.label}
|
|
25
|
+
</Button>)}
|
|
26
|
+
|
|
27
|
+
<Button icon={<Icon source={Close} size="24" stroke="2"/>} className="dropin-alert-banner__dismiss-button" variant="primary" onClick={onDismiss} aria-label={translations.dismiss}/>
|
|
28
|
+
</div>
|
|
29
|
+
</div>);
|
|
30
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { AlertBannerProps } from '@adobe/elsie/components/AlertBanner';
|
|
3
|
+
/**
|
|
4
|
+
* Use AlertBanners to notify and prompt users to take action.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<AlertBannerProps>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<AlertBannerProps>;
|
|
9
|
+
/**
|
|
10
|
+
* <AlertBanner>👋 Hello from your new AlertBanner story!</AlertBanner>
|
|
11
|
+
*/
|
|
12
|
+
export declare const Neutral: Story;
|
|
13
|
+
export declare const Brand: Story;
|
|
14
|
+
export declare const Success: Story;
|
|
15
|
+
export declare const Warning: Story;
|
|
16
|
+
export declare const Action: Story;
|
|
17
|
+
//# sourceMappingURL=AlertBanner.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertBanner.stories.d.ts","sourceRoot":"","sources":["../../../src/components/AlertBanner/AlertBanner.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,gBAAgB,EACjB,MAAM,qCAAqC,CAAC;AAK7C;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAkDhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAExC;;GAEG;AACH,eAAO,MAAM,OAAO,EAAE,KA4BrB,CAAC;AAEF,eAAO,MAAM,KAAK,EAAE,KAMnB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,eAAO,MAAM,OAAO,EAAE,KAQrB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAwBpB,CAAC"}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { AlertBanner as component, } from '@adobe/elsie/components/AlertBanner';
|
|
2
|
+
import { action } from '@storybook/addon-actions';
|
|
3
|
+
import { expect } from '@storybook/jest';
|
|
4
|
+
import { IconsList } from '@adobe/elsie/components/Icon/Icon.stories.helpers';
|
|
5
|
+
/**
|
|
6
|
+
* Use AlertBanners to notify and prompt users to take action.
|
|
7
|
+
*/
|
|
8
|
+
const meta = {
|
|
9
|
+
title: 'Components/AlertBanner',
|
|
10
|
+
component,
|
|
11
|
+
argTypes: {
|
|
12
|
+
variant: {
|
|
13
|
+
description: 'The AlertBanner variant.',
|
|
14
|
+
table: {
|
|
15
|
+
type: { summary: 'string' },
|
|
16
|
+
},
|
|
17
|
+
options: ['brand', 'neutral', 'success', 'warning'],
|
|
18
|
+
control: 'radio',
|
|
19
|
+
},
|
|
20
|
+
icon: {
|
|
21
|
+
description: 'The AlertBanner icon.',
|
|
22
|
+
table: {
|
|
23
|
+
type: { summary: 'FunctionComponent' },
|
|
24
|
+
},
|
|
25
|
+
options: Object.keys(IconsList),
|
|
26
|
+
mapping: IconsList,
|
|
27
|
+
control: {
|
|
28
|
+
type: 'select',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
message: {
|
|
32
|
+
control: {
|
|
33
|
+
type: 'select',
|
|
34
|
+
labels: {
|
|
35
|
+
Short: 'Short message',
|
|
36
|
+
Long: 'Long message',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
description: 'The AlertBanner message.',
|
|
40
|
+
options: ['Short', 'Long'],
|
|
41
|
+
mapping: {
|
|
42
|
+
Short: <div>Short message</div>,
|
|
43
|
+
Long: <div>Alert banner with an extremely extremely long message</div>,
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
onDismiss: {
|
|
47
|
+
description: 'The AlertBanner dismiss handler.',
|
|
48
|
+
table: {
|
|
49
|
+
type: { summary: 'function' },
|
|
50
|
+
},
|
|
51
|
+
action: 'onDismiss',
|
|
52
|
+
},
|
|
53
|
+
action: {
|
|
54
|
+
description: 'Optional action that must contain `label` and `onClick()` properties',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export default meta;
|
|
59
|
+
/**
|
|
60
|
+
* <AlertBanner>👋 Hello from your new AlertBanner story!</AlertBanner>
|
|
61
|
+
*/
|
|
62
|
+
export const Neutral = {
|
|
63
|
+
args: {
|
|
64
|
+
variant: 'neutral',
|
|
65
|
+
//@ts-ignore
|
|
66
|
+
icon: IconsList.InfoFilled,
|
|
67
|
+
message: <span>Hello from your new AlertBanner!</span>,
|
|
68
|
+
onDismiss: action('Dismiss clicked'),
|
|
69
|
+
action: {
|
|
70
|
+
label: 'Action',
|
|
71
|
+
onClick: action('Action clicked'),
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
play: async () => {
|
|
75
|
+
const alertBanner = document.querySelector('div[class*="dropin-alert-banner"]');
|
|
76
|
+
await expect(alertBanner).toBeVisible();
|
|
77
|
+
const link = alertBanner.querySelector('.dropin-alert-banner__dismiss-button');
|
|
78
|
+
await expect(link).toBeVisible();
|
|
79
|
+
await expect(link?.ariaLabel).toBe('Dismiss Alert');
|
|
80
|
+
const icon = alertBanner.querySelector('.dropin-alert-banner__icon');
|
|
81
|
+
await expect(icon).toBeVisible();
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
export const Brand = {
|
|
85
|
+
args: {
|
|
86
|
+
variant: 'brand',
|
|
87
|
+
message: <span>Hello from your new AlertBanner!</span>,
|
|
88
|
+
onDismiss: action('Dismiss clicked'),
|
|
89
|
+
},
|
|
90
|
+
};
|
|
91
|
+
export const Success = {
|
|
92
|
+
args: {
|
|
93
|
+
variant: 'success',
|
|
94
|
+
//@ts-ignore
|
|
95
|
+
icon: IconsList.CheckWithCircle,
|
|
96
|
+
message: <span>Hello from your new AlertBanner!</span>,
|
|
97
|
+
onDismiss: action('Dismiss clicked'),
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
export const Warning = {
|
|
101
|
+
args: {
|
|
102
|
+
variant: 'warning',
|
|
103
|
+
//@ts-ignore
|
|
104
|
+
icon: IconsList.WarningFilled,
|
|
105
|
+
message: <span>Hello from your new AlertBanner!</span>,
|
|
106
|
+
onDismiss: action('Dismiss clicked'),
|
|
107
|
+
},
|
|
108
|
+
};
|
|
109
|
+
export const Action = {
|
|
110
|
+
args: {
|
|
111
|
+
variant: 'warning',
|
|
112
|
+
//@ts-ignore
|
|
113
|
+
icon: IconsList.WarningFilled,
|
|
114
|
+
message: <span>Hello from your new AlertBanner!</span>,
|
|
115
|
+
onDismiss: action('Dismiss clicked'),
|
|
116
|
+
action: {
|
|
117
|
+
label: 'Action',
|
|
118
|
+
onClick: action('Action clicked'),
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
play: async () => {
|
|
122
|
+
const alertBanner = document.querySelector('div[class*="dropin-alert-banner"]');
|
|
123
|
+
await expect(alertBanner).toBeVisible();
|
|
124
|
+
const action = alertBanner.querySelector('.dropin-alert-banner__action');
|
|
125
|
+
await expect(action).toBeVisible();
|
|
126
|
+
await expect(action).toHaveTextContent('Action');
|
|
127
|
+
},
|
|
128
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AlertBanner.test.d.ts","sourceRoot":"","sources":["../../../src/components/AlertBanner/AlertBanner.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|