@dropins/tools 0.21.1-beta1 → 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,40 @@
|
|
|
1
|
+
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
+
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
+
import { AlertBanner } from '@adobe/elsie/components/AlertBanner';
|
|
4
|
+
import { IconsList } from '@adobe/elsie/components/Icon/Icon.stories.helpers';
|
|
5
|
+
jest.mock('@adobe/elsie/icons', () => ({
|
|
6
|
+
WarningFilled: jest.fn(({ className }) => (<svg className={className} id="WarningFilled"/>)),
|
|
7
|
+
}));
|
|
8
|
+
describe('Base/Components/AlertBanner', () => {
|
|
9
|
+
test('renders', () => {
|
|
10
|
+
const { container } = render(<AlertBanner variant={'warning'}
|
|
11
|
+
//@ts-ignore
|
|
12
|
+
icon={IconsList.WarningFilled} message={<span>This is a warning message</span>} onDismiss={() => { }}/>);
|
|
13
|
+
expect(!!container).toEqual(true);
|
|
14
|
+
expect(container).toMatchSnapshot();
|
|
15
|
+
const element = container.querySelector('.dropin-alert-banner');
|
|
16
|
+
expect(element).not.toBeNull();
|
|
17
|
+
const icon = container.querySelector('.dropin-alert-banner__icon');
|
|
18
|
+
expect(icon).not.toBeNull();
|
|
19
|
+
});
|
|
20
|
+
test('renders without icon', () => {
|
|
21
|
+
const { container } = render(<AlertBanner variant={'warning'} message={<span>This is a warning message</span>} onDismiss={() => { }}/>);
|
|
22
|
+
expect(!!container).toEqual(true);
|
|
23
|
+
expect(container).toMatchSnapshot();
|
|
24
|
+
const icon = container.querySelector('.dropin-alert-banner__icon');
|
|
25
|
+
expect(icon).toBeNull();
|
|
26
|
+
});
|
|
27
|
+
test('renders with action', () => {
|
|
28
|
+
const { container } = render(<AlertBanner variant={'warning'}
|
|
29
|
+
//@ts-ignore
|
|
30
|
+
icon={IconsList.WarningFilled} message={<span>This is a warning message</span>} onDismiss={() => { }} action={{
|
|
31
|
+
label: 'Action',
|
|
32
|
+
onClick: () => { },
|
|
33
|
+
}}/>);
|
|
34
|
+
expect(!!container).toEqual(true);
|
|
35
|
+
expect(container).toMatchSnapshot();
|
|
36
|
+
const action = container.querySelector('.dropin-alert-banner__action');
|
|
37
|
+
expect(action).not.toBeNull();
|
|
38
|
+
expect(action?.textContent).toEqual('Action');
|
|
39
|
+
});
|
|
40
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/AlertBanner/index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC;AAChE,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,iDAAiD,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
2
|
+
import { FunctionComponent, VNode } from 'preact';
|
|
3
|
+
import '@adobe/elsie/components/Breadcrumbs/Breadcrumbs.css';
|
|
4
|
+
export interface BreadcrumbsProps extends HTMLAttributes<HTMLElement> {
|
|
5
|
+
categories: VNode[];
|
|
6
|
+
separator?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
7
|
+
}
|
|
8
|
+
export declare const Breadcrumbs: FunctionComponent<BreadcrumbsProps>;
|
|
9
|
+
//# sourceMappingURL=Breadcrumbs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAElD,OAAO,qDAAqD,CAAC;AAE7D,MAAM,WAAW,gBAAiB,SAAQ,cAAc,CAAC,WAAW,CAAC;IACnE,UAAU,EAAE,KAAK,EAAE,CAAC;IACpB,SAAS,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;CAClD;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAmD3D,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { VComponent, classes } from '@adobe/elsie/lib';
|
|
2
|
+
import '@adobe/elsie/components/Breadcrumbs/Breadcrumbs.css';
|
|
3
|
+
export const Breadcrumbs = ({ className, categories, separator, ...props }) => {
|
|
4
|
+
return (<>
|
|
5
|
+
{categories?.length > 1 && (<nav role="navigation" {...props} className={classes(['dropin-breadcrumbs__container', className])}>
|
|
6
|
+
<ul className="dropin-breadcrumbs__items">
|
|
7
|
+
{categories?.map((category, index) => {
|
|
8
|
+
return (<li key={index} className={classes([
|
|
9
|
+
'dropin-breadcrumbs__item',
|
|
10
|
+
[
|
|
11
|
+
'dropin-breadcrumbs__item--last',
|
|
12
|
+
index === categories.length - 1,
|
|
13
|
+
],
|
|
14
|
+
])}>
|
|
15
|
+
<VComponent node={category} className="dropin-breadcrumbs__link"/>
|
|
16
|
+
{!separator && index !== categories.length - 1 && (<span className="dropin-breadcrumbs__separator--default">
|
|
17
|
+
{' '}
|
|
18
|
+
/{' '}
|
|
19
|
+
</span>)}
|
|
20
|
+
{separator && index !== categories.length - 1 && (<VComponent node={separator} className="dropin-breadcrumbs__separator--icon"/>)}
|
|
21
|
+
</li>);
|
|
22
|
+
})}
|
|
23
|
+
</ul>
|
|
24
|
+
</nav>)}
|
|
25
|
+
</>);
|
|
26
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { BreadcrumbsProps } from '@adobe/elsie/components/Breadcrumbs';
|
|
3
|
+
declare const meta: Meta<BreadcrumbsProps>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<BreadcrumbsProps>;
|
|
6
|
+
/**
|
|
7
|
+
* ```ts
|
|
8
|
+
* import { Breadcrumbs } from '@adobe/elsie/components/Breadcrumbs';
|
|
9
|
+
* ```
|
|
10
|
+
*/
|
|
11
|
+
export declare const Breadcrumbs: Story;
|
|
12
|
+
export declare const BreadcrumbsWithLeadingIcon: Story;
|
|
13
|
+
export declare const BreadcrumbsWithSeparator: Story;
|
|
14
|
+
export declare const BreadcrumbsWithIcons: Story;
|
|
15
|
+
//# sourceMappingURL=Breadcrumbs.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,gBAAgB,EACjB,MAAM,qCAAqC,CAAC;AAM7C,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAqBhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAExC;;;;GAIG;AAEH,eAAO,MAAM,WAAW,EAAE,KAwBzB,CAAC;AAEF,eAAO,MAAM,0BAA0B,EAAE,KAoCxC,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KA0BtC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,KAiDlC,CAAC"}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { Breadcrumbs as component, } from '@adobe/elsie/components/Breadcrumbs';
|
|
2
|
+
import { Icon } from '@adobe/elsie/components/Icon';
|
|
3
|
+
import { IconsList } from '@adobe/elsie/components/Icon/Icon.stories.helpers';
|
|
4
|
+
import { ChevronRight, Placeholder } from '@adobe/elsie/icons';
|
|
5
|
+
import { expect } from '@storybook/jest';
|
|
6
|
+
const meta = {
|
|
7
|
+
title: 'Components/Breadcrumbs',
|
|
8
|
+
component,
|
|
9
|
+
tags: ['autodocs'],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: 'centered', // centered | fullscreen
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
categories: {
|
|
15
|
+
description: 'List of categories to display on the Breadcrumbs.',
|
|
16
|
+
type: { name: 'object', value: {} },
|
|
17
|
+
control: 'array',
|
|
18
|
+
},
|
|
19
|
+
separator: {
|
|
20
|
+
description: 'Icon used to separate the Breadcrumbs items.',
|
|
21
|
+
type: { name: 'symbol' },
|
|
22
|
+
options: Object.keys(IconsList),
|
|
23
|
+
mapping: IconsList,
|
|
24
|
+
control: 'select',
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
export default meta;
|
|
29
|
+
/**
|
|
30
|
+
* ```ts
|
|
31
|
+
* import { Breadcrumbs } from '@adobe/elsie/components/Breadcrumbs';
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export const Breadcrumbs = {
|
|
35
|
+
args: {
|
|
36
|
+
categories: [
|
|
37
|
+
<a href="#" key="1">
|
|
38
|
+
One
|
|
39
|
+
</a>,
|
|
40
|
+
<a href="/two" key="2">
|
|
41
|
+
Two
|
|
42
|
+
</a>,
|
|
43
|
+
<a key="3">Three</a>,
|
|
44
|
+
],
|
|
45
|
+
},
|
|
46
|
+
play: async () => {
|
|
47
|
+
const breadcrumbsElement = document.querySelector('.dropin-breadcrumbs__container');
|
|
48
|
+
const categories = breadcrumbsElement.querySelectorAll('.dropin-breadcrumbs__item a');
|
|
49
|
+
await expect(breadcrumbsElement).toBeVisible();
|
|
50
|
+
await expect(categories[0]).toHaveTextContent('One');
|
|
51
|
+
await expect(categories[1]).toHaveAttribute('href', '/two');
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
export const BreadcrumbsWithLeadingIcon = {
|
|
55
|
+
args: {
|
|
56
|
+
categories: [
|
|
57
|
+
<Icon key={0} source={Placeholder} size="16" className="storybook_icon" stroke="1" viewBox="0 0 24 24" aria-label="One" style={{ cursor: 'pointer' }} onClick={() => console.log('Go to Homepage')}/>,
|
|
58
|
+
<a href="/two" key="2">
|
|
59
|
+
Two
|
|
60
|
+
</a>,
|
|
61
|
+
<a key="3">Three</a>,
|
|
62
|
+
],
|
|
63
|
+
},
|
|
64
|
+
play: async () => {
|
|
65
|
+
const breadcrumbsElement = document.querySelector('.dropin-breadcrumbs__container');
|
|
66
|
+
const icon = breadcrumbsElement.querySelector('.dropin-breadcrumbs__item svg');
|
|
67
|
+
const categories = breadcrumbsElement.querySelectorAll('.dropin-breadcrumbs__item a');
|
|
68
|
+
await expect(breadcrumbsElement).toBeVisible();
|
|
69
|
+
await expect(icon).toBeVisible();
|
|
70
|
+
await expect(categories[0]).toHaveAttribute('href', '/two');
|
|
71
|
+
await expect(categories[1]).toHaveTextContent('Three');
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export const BreadcrumbsWithSeparator = {
|
|
75
|
+
args: {
|
|
76
|
+
...Breadcrumbs.args,
|
|
77
|
+
separator: (<Icon source={ChevronRight} size="16" className="storybook_icon" stroke="1" viewBox="0 0 24 24"/>),
|
|
78
|
+
},
|
|
79
|
+
play: async () => {
|
|
80
|
+
const breadcrumbsElement = document.querySelector('.dropin-breadcrumbs__container');
|
|
81
|
+
const separators = breadcrumbsElement.querySelectorAll('.dropin-breadcrumbs__separator--icon');
|
|
82
|
+
await expect(breadcrumbsElement).toBeVisible();
|
|
83
|
+
await expect(separators).toHaveLength(2);
|
|
84
|
+
await expect(separators[0]).toBeVisible();
|
|
85
|
+
await expect(separators[1]).toBeVisible();
|
|
86
|
+
},
|
|
87
|
+
};
|
|
88
|
+
export const BreadcrumbsWithIcons = {
|
|
89
|
+
args: {
|
|
90
|
+
categories: [
|
|
91
|
+
<Icon key={0} source={Placeholder} size="16" className="storybook_icon" stroke="1" viewBox="0 0 24 24" aria-label="One" style={{ cursor: 'pointer' }} onClick={() => console.log('Go to Homepage')}/>,
|
|
92
|
+
<a href="/two" key="2">
|
|
93
|
+
Two
|
|
94
|
+
</a>,
|
|
95
|
+
<a key="3">Three</a>,
|
|
96
|
+
],
|
|
97
|
+
separator: (<Icon source={ChevronRight} size="16" className="storybook_icon" stroke="1" viewBox="0 0 24 24"/>),
|
|
98
|
+
},
|
|
99
|
+
play: async () => {
|
|
100
|
+
const breadcrumbsElement = document.querySelector('.dropin-breadcrumbs__container');
|
|
101
|
+
const icon = breadcrumbsElement.querySelector('.dropin-breadcrumbs__item svg');
|
|
102
|
+
const categories = breadcrumbsElement.querySelectorAll('.dropin-breadcrumbs__item a');
|
|
103
|
+
const separators = breadcrumbsElement.querySelectorAll('.dropin-breadcrumbs__separator--icon');
|
|
104
|
+
await expect(breadcrumbsElement).toBeVisible();
|
|
105
|
+
await expect(icon).toBeVisible();
|
|
106
|
+
await expect(categories[0]).toHaveAttribute('href', '/two');
|
|
107
|
+
await expect(separators).toHaveLength(2);
|
|
108
|
+
await expect(separators[1]).toBeVisible();
|
|
109
|
+
},
|
|
110
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Breadcrumbs.test.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/Breadcrumbs.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 { Breadcrumbs } from '@adobe/elsie/components/Breadcrumbs';
|
|
4
|
+
const MOCK_CATEGORIES = [
|
|
5
|
+
<a href="/" key="1">
|
|
6
|
+
One
|
|
7
|
+
</a>,
|
|
8
|
+
<a href="/two" key="2">
|
|
9
|
+
Two
|
|
10
|
+
</a>,
|
|
11
|
+
<a key="3">Three</a>,
|
|
12
|
+
];
|
|
13
|
+
describe('Base/Components/Breadcrumbs', () => {
|
|
14
|
+
test('renders', () => {
|
|
15
|
+
const { container } = render(<Breadcrumbs categories={MOCK_CATEGORIES}/>);
|
|
16
|
+
expect(!!container).toEqual(true);
|
|
17
|
+
});
|
|
18
|
+
test('should not render when no categories', () => {
|
|
19
|
+
const { container } = render(<Breadcrumbs categories={[]}/>);
|
|
20
|
+
const elem = container.querySelector('.dropin-breadcrumbs__container');
|
|
21
|
+
expect(elem).toBeNull();
|
|
22
|
+
});
|
|
23
|
+
test('renders with custom separator', () => {
|
|
24
|
+
const { container } = render(<Breadcrumbs categories={MOCK_CATEGORIES} separator={<div>separator</div>}/>);
|
|
25
|
+
const elem = container.querySelector('.dropin-breadcrumbs__separator--icon');
|
|
26
|
+
expect(elem.classList.contains('dropin-breadcrumbs__separator--icon')).toEqual(true);
|
|
27
|
+
});
|
|
28
|
+
test('renders with default separator', () => {
|
|
29
|
+
const { container } = render(<Breadcrumbs categories={MOCK_CATEGORIES}/>);
|
|
30
|
+
const elem1 = container.querySelector('.dropin-breadcrumbs__separator--default');
|
|
31
|
+
expect(elem1.classList.contains('dropin-breadcrumbs__separator--default')).toEqual(true);
|
|
32
|
+
});
|
|
33
|
+
test('renders with leading icon and default separator', () => {
|
|
34
|
+
const { container } = render(<Breadcrumbs categories={[
|
|
35
|
+
<a href="/" key="1">
|
|
36
|
+
<div class="leading-icon">icon</div>
|
|
37
|
+
</a>,
|
|
38
|
+
<a href="/two" key="2">
|
|
39
|
+
Two
|
|
40
|
+
</a>,
|
|
41
|
+
<a key="3">Three</a>,
|
|
42
|
+
]}/>);
|
|
43
|
+
const elem1 = container.querySelector('.dropin-breadcrumbs__separator--default');
|
|
44
|
+
const elem2 = container.querySelector('.dropin-breadcrumbs__separator--icon');
|
|
45
|
+
const elem3 = container.querySelector('.leading-icon');
|
|
46
|
+
expect(elem1.classList.contains('dropin-breadcrumbs__separator--default')).toEqual(true);
|
|
47
|
+
expect(elem2).toBeNull();
|
|
48
|
+
expect(elem3).not.toBeNull();
|
|
49
|
+
});
|
|
50
|
+
test('renders with leading icon and custom separator', () => {
|
|
51
|
+
const { container } = render(<Breadcrumbs categories={[
|
|
52
|
+
<a href="/" key="1">
|
|
53
|
+
<div class="leading-icon">icon</div>
|
|
54
|
+
</a>,
|
|
55
|
+
<a href="/two" key="2">
|
|
56
|
+
Two
|
|
57
|
+
</a>,
|
|
58
|
+
<a key="3">Three</a>,
|
|
59
|
+
]} separator={<div>separator</div>}/>);
|
|
60
|
+
const elem1 = container.querySelector('.dropin-breadcrumbs__separator--default');
|
|
61
|
+
const elem2 = container.querySelector('.dropin-breadcrumbs__separator--icon');
|
|
62
|
+
const elem3 = container.querySelector('.leading-icon');
|
|
63
|
+
expect(elem1).toBeNull();
|
|
64
|
+
expect(elem2.classList.contains('dropin-breadcrumbs__separator--icon')).toEqual(true);
|
|
65
|
+
expect(elem3).not.toBeNull();
|
|
66
|
+
});
|
|
67
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Breadcrumbs/index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC;AAChE,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,iDAAiD,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ComponentChildren, FunctionComponent, VNode } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
import '@adobe/elsie/components/Button/Button.css';
|
|
4
|
+
export interface ButtonProps extends Omit<HTMLAttributes<HTMLButtonElement | HTMLAnchorElement>, 'size' | 'icon'> {
|
|
5
|
+
variant?: 'primary' | 'secondary' | 'tertiary';
|
|
6
|
+
size?: 'medium' | 'large';
|
|
7
|
+
children?: ComponentChildren;
|
|
8
|
+
icon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
active?: boolean;
|
|
11
|
+
activeChildren?: ComponentChildren;
|
|
12
|
+
activeIcon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
13
|
+
}
|
|
14
|
+
export declare const Button: FunctionComponent<ButtonProps>;
|
|
15
|
+
//# sourceMappingURL=Button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,2CAA2C,CAAC;AAEnD,MAAM,WAAW,WACf,SAAQ,IAAI,CACV,cAAc,CAAC,iBAAiB,GAAG,iBAAiB,CAAC,EACrD,MAAM,GAAG,MAAM,CAChB;IACD,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,GAAG,UAAU,CAAC;IAC/C,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,cAAc,CAAC,EAAE,iBAAiB,CAAC;IACnC,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;CACnD;AAED,eAAO,MAAM,MAAM,EAAE,iBAAiB,CAAC,WAAW,CAqFjD,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { VComponent, classes } from '@adobe/elsie/lib';
|
|
2
|
+
import '@adobe/elsie/components/Button/Button.css';
|
|
3
|
+
export const Button = ({ value, variant = 'primary', size = 'medium', icon, className, children, disabled = false, active = false, activeChildren, activeIcon, href, ...props }) => {
|
|
4
|
+
let buttonType = 'dropin-button';
|
|
5
|
+
if ((icon && !children) ||
|
|
6
|
+
(icon && active && !activeChildren) ||
|
|
7
|
+
(!icon && active && activeIcon)) {
|
|
8
|
+
buttonType = 'dropin-iconButton';
|
|
9
|
+
}
|
|
10
|
+
if (active && activeChildren) {
|
|
11
|
+
buttonType = 'dropin-button';
|
|
12
|
+
}
|
|
13
|
+
className = classes([
|
|
14
|
+
buttonType,
|
|
15
|
+
`${buttonType}--${size}`,
|
|
16
|
+
`${buttonType}--${variant}`,
|
|
17
|
+
[`${buttonType}--${variant}--disabled`, disabled],
|
|
18
|
+
children && icon && `${buttonType}--with-icon`,
|
|
19
|
+
!children && activeChildren && icon && `${buttonType}--with-icon`,
|
|
20
|
+
active && activeIcon && `${buttonType}--with-icon`,
|
|
21
|
+
className,
|
|
22
|
+
]);
|
|
23
|
+
const iconClassName = classes([
|
|
24
|
+
'dropin-button-icon',
|
|
25
|
+
`dropin-button-icon--${variant}`,
|
|
26
|
+
[`dropin-button-icon--${variant}--disabled`, disabled],
|
|
27
|
+
icon?.props.className,
|
|
28
|
+
]);
|
|
29
|
+
const attributes = href
|
|
30
|
+
? {
|
|
31
|
+
node: <a />,
|
|
32
|
+
role: 'link',
|
|
33
|
+
href,
|
|
34
|
+
...props,
|
|
35
|
+
disabled,
|
|
36
|
+
active,
|
|
37
|
+
}
|
|
38
|
+
: {
|
|
39
|
+
node: <button />,
|
|
40
|
+
role: 'button',
|
|
41
|
+
...props,
|
|
42
|
+
value,
|
|
43
|
+
disabled,
|
|
44
|
+
active,
|
|
45
|
+
};
|
|
46
|
+
return (<VComponent {...attributes} className={className}>
|
|
47
|
+
{icon && !active && <VComponent node={icon} className={iconClassName}/>}
|
|
48
|
+
|
|
49
|
+
{activeIcon && active && (<VComponent node={activeIcon} className={iconClassName}/>)}
|
|
50
|
+
|
|
51
|
+
{children &&
|
|
52
|
+
!active &&
|
|
53
|
+
(typeof children === 'string' ? <span>{children}</span> : children)}
|
|
54
|
+
|
|
55
|
+
{active &&
|
|
56
|
+
activeChildren &&
|
|
57
|
+
(typeof activeChildren === 'string' ? (<span>{activeChildren}</span>) : (activeChildren))}
|
|
58
|
+
</VComponent>);
|
|
59
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { ButtonProps } from '@adobe/elsie/components/Button';
|
|
3
|
+
/**
|
|
4
|
+
* Use Buttons to highlight or guide user actions.
|
|
5
|
+
*/
|
|
6
|
+
declare const meta: Meta<ButtonProps>;
|
|
7
|
+
export default meta;
|
|
8
|
+
type Story = StoryObj<ButtonProps>;
|
|
9
|
+
/**
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <Button
|
|
12
|
+
* active={false}
|
|
13
|
+
* activeChildren="Active"
|
|
14
|
+
* activeIcon={<Icon source={Check} size="24" />}
|
|
15
|
+
* children="Button"
|
|
16
|
+
* disabled={false}
|
|
17
|
+
* icon={<Icon source={Cart} size="24" />}
|
|
18
|
+
* onClick={handleAddToCart}
|
|
19
|
+
* size="medium"
|
|
20
|
+
* value={undefined}
|
|
21
|
+
* variant="primary"
|
|
22
|
+
* />
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
export declare const Button: Story;
|
|
26
|
+
/**
|
|
27
|
+
* ```tsx
|
|
28
|
+
* <Button>Button</Button>
|
|
29
|
+
* ```
|
|
30
|
+
* ```tsx
|
|
31
|
+
* <Button children="Button" />
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
export declare const Children: Story;
|
|
35
|
+
/**
|
|
36
|
+
* ```tsx
|
|
37
|
+
* <Button variant="primary">Primary</Button>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
40
|
+
export declare const Primary: Story;
|
|
41
|
+
/**
|
|
42
|
+
* ```tsx
|
|
43
|
+
* <Button variant='secondary'>Secondary</Button>
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
46
|
+
export declare const Secondary: Story;
|
|
47
|
+
/**
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <Button variant='tertiary'>Tertiary</Button>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
export declare const Tertiary: Story;
|
|
53
|
+
/**
|
|
54
|
+
* ```tsx
|
|
55
|
+
* <Button size='large'>Large</Button>
|
|
56
|
+
* ```
|
|
57
|
+
*/
|
|
58
|
+
export declare const LargeSize: Story;
|
|
59
|
+
/**
|
|
60
|
+
* ```tsx
|
|
61
|
+
* <Button size='medium'>Medium</Button>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
export declare const MediumSize: Story;
|
|
65
|
+
/**
|
|
66
|
+
* ```tsx
|
|
67
|
+
* <Button
|
|
68
|
+
* icon={<Icon
|
|
69
|
+
* source={Cart}
|
|
70
|
+
* size="24"
|
|
71
|
+
* stroke="2"
|
|
72
|
+
* viewBox="0 0 24 24"
|
|
73
|
+
* aria-label="Search" />}
|
|
74
|
+
* />
|
|
75
|
+
* ```
|
|
76
|
+
*/
|
|
77
|
+
export declare const IconOnly: Story;
|
|
78
|
+
/**
|
|
79
|
+
* ```tsx
|
|
80
|
+
* <Button
|
|
81
|
+
* icon={<Icon
|
|
82
|
+
* source={Cart}
|
|
83
|
+
* size="24"
|
|
84
|
+
* stroke="2"
|
|
85
|
+
* viewBox="0 0 24 24"
|
|
86
|
+
* aria-label="Search" />}
|
|
87
|
+
* >
|
|
88
|
+
* Search
|
|
89
|
+
* </Button>
|
|
90
|
+
* ```
|
|
91
|
+
*/
|
|
92
|
+
export declare const TextAndIcon: Story;
|
|
93
|
+
/**
|
|
94
|
+
* ```tsx
|
|
95
|
+
* <Button disabled>Button</Button>
|
|
96
|
+
* ```
|
|
97
|
+
* ```tsx
|
|
98
|
+
* <Button disabled={true}>Button</Button>
|
|
99
|
+
* ```
|
|
100
|
+
* ```tsx
|
|
101
|
+
* <Button disabled={loop ? false : current < 1}>Button</Button>
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
export declare const Disabled: Story;
|
|
105
|
+
/**
|
|
106
|
+
* ```tsx
|
|
107
|
+
* <Button
|
|
108
|
+
* active={true}
|
|
109
|
+
* activeChildren="Active"
|
|
110
|
+
* activeIcon={<Icon source={SearchFilled} />}
|
|
111
|
+
* children="Not Active"
|
|
112
|
+
* icon={<Icon source={Search} />}
|
|
113
|
+
* />
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
116
|
+
export declare const Active: Story;
|
|
117
|
+
/**
|
|
118
|
+
* ```tsx
|
|
119
|
+
* <Button
|
|
120
|
+
* active={false}
|
|
121
|
+
* activeChildren="Active"
|
|
122
|
+
* activeIcon={<Icon source={SearchFilled} />}
|
|
123
|
+
* children="Not Active"
|
|
124
|
+
* icon={<Icon source={Search} />}
|
|
125
|
+
* />
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
export declare const NotActive: Story;
|
|
129
|
+
/**
|
|
130
|
+
* ```tsx
|
|
131
|
+
* <Button href="https://google.com">Link</Button>
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
export declare const AsLink: Story;
|
|
135
|
+
//# sourceMappingURL=Button.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Button.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,WAAW,EACZ,MAAM,gCAAgC,CAAC;AAQxC;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,WAAW,CA2F3B,CAAC;AACF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAC;AAEnC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,MAAM,EAAE,KAcpB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,QAAQ,EAAE,KAKtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,QAAQ,EAAE,KAMtB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,SAAS,EAAE,KAOvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,QAAQ,EAAE,KAsBtB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,WAAW,EAAE,KAczB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,QAAQ,EAAE,KAWtB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,MAAM,EAAE,KAoBpB,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,SAAS,EAAE,KAKvB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,MAAM,EAAE,KAapB,CAAC"}
|