@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,78 @@
|
|
|
1
|
+
import { Price } from '@adobe/elsie/components/Price';
|
|
2
|
+
import { within } from '@storybook/testing-library';
|
|
3
|
+
import { expect } from '@storybook/jest';
|
|
4
|
+
/**
|
|
5
|
+
* Use Price components to display the cost of an item or service.
|
|
6
|
+
*/
|
|
7
|
+
const meta = {
|
|
8
|
+
title: 'Components/Price',
|
|
9
|
+
component: Price,
|
|
10
|
+
argTypes: {
|
|
11
|
+
currency: {
|
|
12
|
+
control: 'select',
|
|
13
|
+
options: ['USD', 'EUR'],
|
|
14
|
+
},
|
|
15
|
+
locale: {
|
|
16
|
+
control: 'select',
|
|
17
|
+
options: ['en-US', 'fr-FR'],
|
|
18
|
+
},
|
|
19
|
+
variant: {
|
|
20
|
+
description: 'Font variant',
|
|
21
|
+
defaultValue: 'default',
|
|
22
|
+
control: 'select',
|
|
23
|
+
options: ['default', 'strikethrough'],
|
|
24
|
+
},
|
|
25
|
+
size: {
|
|
26
|
+
control: 'select',
|
|
27
|
+
options: ['small', 'medium', 'large'],
|
|
28
|
+
},
|
|
29
|
+
weight: {
|
|
30
|
+
description: 'Font weight',
|
|
31
|
+
defaultValue: 'bold',
|
|
32
|
+
control: 'select',
|
|
33
|
+
options: ['bold', 'normal'],
|
|
34
|
+
},
|
|
35
|
+
formatOptions: {
|
|
36
|
+
control: { type: 'object' },
|
|
37
|
+
defaultValue: {
|
|
38
|
+
minimumFractionDigits: 2,
|
|
39
|
+
maximumFractionDigits: 2,
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
export default meta;
|
|
45
|
+
/**
|
|
46
|
+
* ```ts
|
|
47
|
+
* import { Price } from '@adobe/elsie/components/Price';
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
export const Primary = {
|
|
51
|
+
args: {
|
|
52
|
+
amount: 9.99,
|
|
53
|
+
sale: false,
|
|
54
|
+
size: 'small',
|
|
55
|
+
},
|
|
56
|
+
play: async ({ canvasElement }) => {
|
|
57
|
+
const canvas = within(canvasElement);
|
|
58
|
+
await expect(await canvas.findByText('$9.99')).toBeVisible();
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export const SpecialDefault = {
|
|
62
|
+
args: {
|
|
63
|
+
size: 'small',
|
|
64
|
+
},
|
|
65
|
+
render: (args) => (<div style="display: flex; flex-wrap:wrap; gap: 5px">
|
|
66
|
+
<Price {...args} amount={59.99} variant={'strikethrough'}/>
|
|
67
|
+
<Price {...args} amount={55.99} variant={'default'}/>
|
|
68
|
+
</div>),
|
|
69
|
+
};
|
|
70
|
+
export const HighContrast = {
|
|
71
|
+
args: {
|
|
72
|
+
size: 'small',
|
|
73
|
+
},
|
|
74
|
+
render: (args) => (<div style="display: flex; flex-wrap:wrap; gap: 5px">
|
|
75
|
+
<Price {...args} amount={59.99} variant={'strikethrough'}/>
|
|
76
|
+
<Price {...args} amount={55.99} variant={'default'} sale/>
|
|
77
|
+
</div>),
|
|
78
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Price.test.d.ts","sourceRoot":"","sources":["../../../src/components/Price/Price.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
+
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
+
import { Price } from '@adobe/elsie/components/Price';
|
|
4
|
+
describe('Patterns/Price', () => {
|
|
5
|
+
test('renders', () => {
|
|
6
|
+
const { container } = render(<Price />);
|
|
7
|
+
const elem = container.querySelector('.dropin-price');
|
|
8
|
+
expect(!!elem).toEqual(true);
|
|
9
|
+
});
|
|
10
|
+
test('renders the correct shape', () => {
|
|
11
|
+
const { container } = render(<Price amount={9.99}/>);
|
|
12
|
+
const elem = container.querySelector('.dropin-price');
|
|
13
|
+
expect(elem).toMatchSnapshot();
|
|
14
|
+
});
|
|
15
|
+
test('renders the price with strikethrough', () => {
|
|
16
|
+
const { container } = render(<Price amount={9.99} variant="strikethrough"/>);
|
|
17
|
+
const elem = container.querySelector('.dropin-price--strikethrough');
|
|
18
|
+
expect(elem).not.toBeNull();
|
|
19
|
+
});
|
|
20
|
+
test('renders the price with sale', () => {
|
|
21
|
+
const { container, rerender } = render(<Price amount={9.99} sale={false}/>);
|
|
22
|
+
const notSaleElem = container.querySelector('.dropin-price--sale');
|
|
23
|
+
expect(notSaleElem).toBeNull();
|
|
24
|
+
rerender(<Price amount={9.99} sale={true}/>);
|
|
25
|
+
const saleElem = container.querySelector('.dropin-price--sale');
|
|
26
|
+
expect(saleElem).not.toBeNull();
|
|
27
|
+
});
|
|
28
|
+
test('renders the price with normal weight', () => {
|
|
29
|
+
const { container, rerender } = render(<Price amount={9.99} weight="normal"/>);
|
|
30
|
+
const normalElem = container.querySelector('.dropin-price--normal');
|
|
31
|
+
expect(normalElem).not.toBeNull();
|
|
32
|
+
rerender(<Price amount={9.99}/>);
|
|
33
|
+
const boldElem = container.querySelector('.dropin-price--bold');
|
|
34
|
+
expect(boldElem).not.toBeNull();
|
|
35
|
+
});
|
|
36
|
+
test('renders the price with currency', () => {
|
|
37
|
+
const { container, rerender } = render(<Price amount={9.99} currency="USD"/>);
|
|
38
|
+
const usdElem = container.querySelector('.dropin-price');
|
|
39
|
+
expect(usdElem?.innerHTML).toContain('$');
|
|
40
|
+
rerender(<Price amount={9.99} currency="EUR"/>);
|
|
41
|
+
const eurElem = container.querySelector('.dropin-price');
|
|
42
|
+
expect(eurElem?.innerHTML).toContain('€');
|
|
43
|
+
});
|
|
44
|
+
test('renders the price with locale and format options', () => {
|
|
45
|
+
const { container, rerender } = render(<Price amount={9.9555} currency="USD" locale="en-US" formatOptions={{ minimumFractionDigits: 3, maximumFractionDigits: 3 }}/>);
|
|
46
|
+
const usdElem = container.querySelector('.dropin-price');
|
|
47
|
+
expect(usdElem?.textContent).toBe('$9.956');
|
|
48
|
+
rerender(<Price amount={9.9555} currency="USD" locale="fr-FR" formatOptions={{ minimumFractionDigits: 2, maximumFractionDigits: 2 }}/>);
|
|
49
|
+
const eurElem = container.querySelector('.dropin-price');
|
|
50
|
+
expect(eurElem?.innerHTML).toContain('9,96 $US');
|
|
51
|
+
});
|
|
52
|
+
test('renders the price with falsy currency', () => {
|
|
53
|
+
const { container } = render(<Price amount={9.99} currency=""/>);
|
|
54
|
+
const elem = container.querySelector('.dropin-price');
|
|
55
|
+
expect(elem?.innerHTML).toContain('$9.99');
|
|
56
|
+
});
|
|
57
|
+
test('renders the price with null currency', () => {
|
|
58
|
+
//@ts-ignore
|
|
59
|
+
const { container } = render(<Price amount={9.99} currency={null}/>);
|
|
60
|
+
const elem = container.querySelector('.dropin-price');
|
|
61
|
+
expect(elem?.innerHTML).toContain('$9.99');
|
|
62
|
+
});
|
|
63
|
+
test('renders the price with undefined currency', () => {
|
|
64
|
+
const { container } = render(<Price amount={9.99} currency={undefined}/>);
|
|
65
|
+
const elem = container.querySelector('.dropin-price');
|
|
66
|
+
expect(elem?.innerHTML).toContain('$9.99');
|
|
67
|
+
});
|
|
68
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Price/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@adobe/elsie/components/Price/Price';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FunctionComponent } from 'preact';
|
|
2
|
+
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
+
import '@adobe/elsie/components/PriceRange/PriceRange.css';
|
|
4
|
+
export interface PriceRangeProps extends Omit<HTMLAttributes<HTMLDivElement>, 'size'> {
|
|
5
|
+
locale?: string;
|
|
6
|
+
currency?: string;
|
|
7
|
+
amount?: number;
|
|
8
|
+
variant?: 'default' | 'strikethrough';
|
|
9
|
+
minimumAmount?: number;
|
|
10
|
+
maximumAmount?: number;
|
|
11
|
+
display?: 'dash' | 'from to' | 'as low as';
|
|
12
|
+
size?: 'small' | 'medium' | 'large';
|
|
13
|
+
specialPrice?: number;
|
|
14
|
+
sale?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export declare const PriceRange: FunctionComponent<PriceRangeProps>;
|
|
17
|
+
//# sourceMappingURL=PriceRange.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PriceRange.d.ts","sourceRoot":"","sources":["../../../src/components/PriceRange/PriceRange.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAW,MAAM,eAAe,CAAC;AAExD,OAAO,mDAAmD,CAAC;AAI3D,MAAM,WAAW,eACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACpD,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,SAAS,GAAG,eAAe,CAAC;IACtC,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,CAAC;IAC3C,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAC;IACpC,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAED,eAAO,MAAM,UAAU,EAAE,iBAAiB,CAAC,eAAe,CA+EzD,CAAC"}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { useMemo } from 'preact/compat';
|
|
2
|
+
import { classes } from '@adobe/elsie/lib';
|
|
3
|
+
import '@adobe/elsie/components/PriceRange/PriceRange.css';
|
|
4
|
+
import { Price } from '@adobe/elsie/components/Price';
|
|
5
|
+
import { useText } from '@adobe/elsie/i18n';
|
|
6
|
+
export const PriceRange = ({ className, children, locale, currency, amount, variant = 'default', minimumAmount, maximumAmount, size = 'small', display = 'dash', specialPrice, sale = false, ...props }) => {
|
|
7
|
+
const isSimpleProduct = useMemo(() => amount ||
|
|
8
|
+
minimumAmount === maximumAmount ||
|
|
9
|
+
(minimumAmount && !maximumAmount) ||
|
|
10
|
+
(maximumAmount && !minimumAmount), [amount, maximumAmount, minimumAmount]);
|
|
11
|
+
return (<div>
|
|
12
|
+
{/* Simple product price or when configurable product minimum price equals to maximum price */}
|
|
13
|
+
{isSimpleProduct ? (<div {...props} className={classes(['dropin-price-range', className])}>
|
|
14
|
+
<Price amount={amount ?? minimumAmount ?? maximumAmount} currency={currency} locale={locale} size={size} variant={variant} sale={sale}/>
|
|
15
|
+
</div>) : (<div {...props} className={classes(['dropin-price-range', className])}>
|
|
16
|
+
{display === 'dash' ? (<Dashed specialPrice={specialPrice} minimumAmount={minimumAmount} maximumAmount={maximumAmount} currency={currency} locale={locale} size={size} sale={sale}/>) : null}
|
|
17
|
+
|
|
18
|
+
{display === 'from to' ? (<FromTo specialPrice={specialPrice} minimumAmount={minimumAmount} maximumAmount={maximumAmount} currency={currency} locale={locale} size={size} sale={sale}/>) : null}
|
|
19
|
+
|
|
20
|
+
{display === 'as low as' ? (<SpecialPrice specialPrice={specialPrice} minimumAmount={minimumAmount} maximumAmount={maximumAmount} currency={currency} locale={locale} size={size} sale={sale}/>) : null}
|
|
21
|
+
</div>)}
|
|
22
|
+
</div>);
|
|
23
|
+
};
|
|
24
|
+
// Variations
|
|
25
|
+
function Dashed({ specialPrice, minimumAmount, maximumAmount, currency, locale, size, sale, }) {
|
|
26
|
+
return (<>
|
|
27
|
+
<Price amount={specialPrice ?? minimumAmount} currency={currency} locale={locale} size={size} sale={!!specialPrice && sale}/>
|
|
28
|
+
<span className="dropin-price-range__separator">-</span>
|
|
29
|
+
<Price amount={maximumAmount} currency={currency} locale={locale} size={size}/>
|
|
30
|
+
</>);
|
|
31
|
+
}
|
|
32
|
+
function FromTo({ specialPrice, minimumAmount, maximumAmount, currency, locale, size, sale, }) {
|
|
33
|
+
// Translations
|
|
34
|
+
const translations = useText({
|
|
35
|
+
from: 'Dropin.PriceRange.from.label',
|
|
36
|
+
to: 'Dropin.PriceRange.to.label',
|
|
37
|
+
asLowAs: 'Dropin.PriceRange.asLowAs.label',
|
|
38
|
+
});
|
|
39
|
+
return (<>
|
|
40
|
+
<span className={classes([
|
|
41
|
+
'dropin-price-range__from',
|
|
42
|
+
`dropin-price-range__from--${size}`,
|
|
43
|
+
])}>
|
|
44
|
+
{translations.from}
|
|
45
|
+
</span>
|
|
46
|
+
<Price amount={specialPrice ?? minimumAmount} currency={currency} locale={locale} size={size} sale={!!specialPrice && sale}/>
|
|
47
|
+
<span className={classes([
|
|
48
|
+
'dropin-price-range__to',
|
|
49
|
+
`dropin-price-range__to--${size}`,
|
|
50
|
+
])}>
|
|
51
|
+
{translations.to}
|
|
52
|
+
</span>
|
|
53
|
+
<Price amount={maximumAmount} currency={currency} locale={locale} size={size}/>
|
|
54
|
+
</>);
|
|
55
|
+
}
|
|
56
|
+
function SpecialPrice({ specialPrice, minimumAmount, maximumAmount, currency, locale, size, sale, }) {
|
|
57
|
+
// Translations
|
|
58
|
+
const translations = useText({
|
|
59
|
+
from: 'Dropin.PriceRange.from.label',
|
|
60
|
+
to: 'Dropin.PriceRange.to.label',
|
|
61
|
+
asLowAs: 'Dropin.PriceRange.asLowAs.label',
|
|
62
|
+
});
|
|
63
|
+
return (<>
|
|
64
|
+
<span className={classes([
|
|
65
|
+
'dropin-price-range__as-low-as',
|
|
66
|
+
`dropin-price-range__as-low-as--${size}`,
|
|
67
|
+
])}>
|
|
68
|
+
{translations.asLowAs}
|
|
69
|
+
</span>
|
|
70
|
+
{specialPrice ? (<div>
|
|
71
|
+
<Price amount={maximumAmount} currency={currency} locale={locale} size={size} variant="strikethrough"/>
|
|
72
|
+
<Price amount={specialPrice} currency={currency} locale={locale} size={size} className="dropin-price-range__special" sale={!!specialPrice && sale}/>
|
|
73
|
+
</div>) : (<Price amount={minimumAmount} currency={currency} locale={locale} size={size}/>)}
|
|
74
|
+
</>);
|
|
75
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
+
import { PriceRangeProps } from '@adobe/elsie/components/PriceRange';
|
|
3
|
+
/**
|
|
4
|
+
* Use PriceRanges to display price range.
|
|
5
|
+
*
|
|
6
|
+
* Import the component like this:
|
|
7
|
+
*
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { PriceRange } from '@adobe/elsie/components/PriceRange';
|
|
10
|
+
* ```
|
|
11
|
+
*
|
|
12
|
+
*/
|
|
13
|
+
declare const meta: Meta<PriceRangeProps>;
|
|
14
|
+
export default meta;
|
|
15
|
+
type Story = StoryObj<PriceRangeProps>;
|
|
16
|
+
/**
|
|
17
|
+
* Use the component like this to get a price for a simple product:
|
|
18
|
+
*
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <PriceRange
|
|
21
|
+
* currency: 'USD',
|
|
22
|
+
* amount: 36.0,
|
|
23
|
+
* size: 'small',
|
|
24
|
+
* variant: 'default',
|
|
25
|
+
* sale: false,
|
|
26
|
+
* />
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
29
|
+
export declare const SimplePrice: Story;
|
|
30
|
+
/**
|
|
31
|
+
* Use the component like this to get a simple PriceRange:
|
|
32
|
+
*
|
|
33
|
+
* ```tsx
|
|
34
|
+
* <PriceRange
|
|
35
|
+
* currency: 'USD',
|
|
36
|
+
* minimumAmount: 56.0,
|
|
37
|
+
* maximumAmount: 58.0,
|
|
38
|
+
* size: 'small',
|
|
39
|
+
* display: 'dash',
|
|
40
|
+
* sale: false,
|
|
41
|
+
* />
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export declare const PriceRangeDash: Story;
|
|
45
|
+
/**
|
|
46
|
+
* Use the component like this to get a from / to PriceRange:
|
|
47
|
+
*
|
|
48
|
+
* ```tsx
|
|
49
|
+
* <PriceRange
|
|
50
|
+
* currency: 'USD',
|
|
51
|
+
* minimumAmount: 56.0,
|
|
52
|
+
* maximumAmount: 58.0,
|
|
53
|
+
* size: 'small',
|
|
54
|
+
* display: 'from to',
|
|
55
|
+
* sale: false,
|
|
56
|
+
* />
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare const PriceRangeFromTo: Story;
|
|
60
|
+
/**
|
|
61
|
+
* Use the component like this to get a as low as PriceRange:
|
|
62
|
+
*
|
|
63
|
+
* ```tsx
|
|
64
|
+
* <PriceRange
|
|
65
|
+
* currency: 'USD',
|
|
66
|
+
* minimumAmount: 56.0,
|
|
67
|
+
* maximumAmount: 58.0,
|
|
68
|
+
* size: 'small',
|
|
69
|
+
* display: 'as low as',
|
|
70
|
+
* sale: false,
|
|
71
|
+
* />
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
export declare const PriceRangeAsLowAs: Story;
|
|
75
|
+
/**
|
|
76
|
+
* Use the component like this to get a simple PriceRange with special price:
|
|
77
|
+
*
|
|
78
|
+
* ```tsx
|
|
79
|
+
* <PriceRange
|
|
80
|
+
* currency: 'USD',
|
|
81
|
+
* minimumAmount: 56.0,
|
|
82
|
+
* maximumAmount: 58.0,
|
|
83
|
+
* size: 'small',
|
|
84
|
+
* display: 'dash',
|
|
85
|
+
* sale: false,
|
|
86
|
+
* specialPrice: 9.99,
|
|
87
|
+
* />
|
|
88
|
+
* ```
|
|
89
|
+
*/
|
|
90
|
+
export declare const PriceRangeSpecialPrice: Story;
|
|
91
|
+
/**
|
|
92
|
+
* Use the component like this to get a simple PriceRange with high contrast special price:
|
|
93
|
+
*
|
|
94
|
+
* ```tsx
|
|
95
|
+
* <PriceRange
|
|
96
|
+
* currency: 'USD',
|
|
97
|
+
* minimumAmount: 56.0,
|
|
98
|
+
* maximumAmount: 58.0,
|
|
99
|
+
* size: 'small',
|
|
100
|
+
* display: 'dash',
|
|
101
|
+
* sale: true,
|
|
102
|
+
* specialPrice: 9.99,
|
|
103
|
+
* />
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
export declare const PriceRangeSpecialPriceContrast: Story;
|
|
107
|
+
//# sourceMappingURL=PriceRange.stories.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PriceRange.stories.d.ts","sourceRoot":"","sources":["../../../src/components/PriceRange/PriceRange.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,eAAe,EAChB,MAAM,oCAAoC,CAAC;AAE5C;;;;;;;;;GASG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,eAAe,CAoD/B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,CAAC;AAEvC;;;;;;;;;;;;GAYG;AAEH,eAAO,MAAM,WAAW,EAAE,KAQzB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,cAAc,EAAE,KAS5B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,gBAAgB,EAAE,KAS9B,CAAC;AAEF;;;;;;;;;;;;;GAaG;AAEH,eAAO,MAAM,iBAAiB,EAAE,KAS/B,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,sBAAsB,EAAE,KAUpC,CAAC;AAEF;;;;;;;;;;;;;;GAcG;AAEH,eAAO,MAAM,8BAA8B,EAAE,KAU5C,CAAC"}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
import { PriceRange as component, } from '@adobe/elsie/components/PriceRange';
|
|
2
|
+
/**
|
|
3
|
+
* Use PriceRanges to display price range.
|
|
4
|
+
*
|
|
5
|
+
* Import the component like this:
|
|
6
|
+
*
|
|
7
|
+
* ```tsx
|
|
8
|
+
* import { PriceRange } from '@adobe/elsie/components/PriceRange';
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
*/
|
|
12
|
+
const meta = {
|
|
13
|
+
title: 'Components/PriceRange',
|
|
14
|
+
component,
|
|
15
|
+
argTypes: {
|
|
16
|
+
currency: {
|
|
17
|
+
description: 'Currency of price',
|
|
18
|
+
control: 'select',
|
|
19
|
+
options: ['USD', 'EUR'],
|
|
20
|
+
},
|
|
21
|
+
locale: {
|
|
22
|
+
description: 'Locale of price',
|
|
23
|
+
control: 'select',
|
|
24
|
+
options: ['en-US', 'fr-FR'],
|
|
25
|
+
},
|
|
26
|
+
amount: {
|
|
27
|
+
description: 'Price of a simple product',
|
|
28
|
+
control: 'number',
|
|
29
|
+
},
|
|
30
|
+
variant: {
|
|
31
|
+
description: 'Price display variant',
|
|
32
|
+
control: 'select',
|
|
33
|
+
options: ['default', 'strikethrough'],
|
|
34
|
+
},
|
|
35
|
+
minimumAmount: {
|
|
36
|
+
description: 'Minimum price of a product price range',
|
|
37
|
+
control: 'number',
|
|
38
|
+
},
|
|
39
|
+
maximumAmount: {
|
|
40
|
+
description: 'Maximum price of a product price range',
|
|
41
|
+
control: 'number',
|
|
42
|
+
},
|
|
43
|
+
size: {
|
|
44
|
+
description: 'Size of price',
|
|
45
|
+
control: 'select',
|
|
46
|
+
options: ['small', 'medium', 'large'],
|
|
47
|
+
},
|
|
48
|
+
display: {
|
|
49
|
+
description: 'Price range display option',
|
|
50
|
+
control: 'select',
|
|
51
|
+
options: ['dash', 'from to', 'as low as'],
|
|
52
|
+
},
|
|
53
|
+
specialPrice: {
|
|
54
|
+
description: 'Special price of a product',
|
|
55
|
+
control: 'select',
|
|
56
|
+
options: [undefined, 9.99],
|
|
57
|
+
},
|
|
58
|
+
sale: {
|
|
59
|
+
description: 'Whether or not to display contrast color for special sale price',
|
|
60
|
+
control: 'boolean',
|
|
61
|
+
},
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export default meta;
|
|
65
|
+
/**
|
|
66
|
+
* Use the component like this to get a price for a simple product:
|
|
67
|
+
*
|
|
68
|
+
* ```tsx
|
|
69
|
+
* <PriceRange
|
|
70
|
+
* currency: 'USD',
|
|
71
|
+
* amount: 36.0,
|
|
72
|
+
* size: 'small',
|
|
73
|
+
* variant: 'default',
|
|
74
|
+
* sale: false,
|
|
75
|
+
* />
|
|
76
|
+
* ```
|
|
77
|
+
*/
|
|
78
|
+
export const SimplePrice = {
|
|
79
|
+
args: {
|
|
80
|
+
currency: 'USD',
|
|
81
|
+
amount: 36.0,
|
|
82
|
+
size: 'small',
|
|
83
|
+
variant: 'default',
|
|
84
|
+
sale: false,
|
|
85
|
+
},
|
|
86
|
+
};
|
|
87
|
+
/**
|
|
88
|
+
* Use the component like this to get a simple PriceRange:
|
|
89
|
+
*
|
|
90
|
+
* ```tsx
|
|
91
|
+
* <PriceRange
|
|
92
|
+
* currency: 'USD',
|
|
93
|
+
* minimumAmount: 56.0,
|
|
94
|
+
* maximumAmount: 58.0,
|
|
95
|
+
* size: 'small',
|
|
96
|
+
* display: 'dash',
|
|
97
|
+
* sale: false,
|
|
98
|
+
* />
|
|
99
|
+
* ```
|
|
100
|
+
*/
|
|
101
|
+
export const PriceRangeDash = {
|
|
102
|
+
args: {
|
|
103
|
+
currency: 'USD',
|
|
104
|
+
minimumAmount: 56.0,
|
|
105
|
+
maximumAmount: 58.0,
|
|
106
|
+
size: 'small',
|
|
107
|
+
display: 'dash',
|
|
108
|
+
sale: false,
|
|
109
|
+
},
|
|
110
|
+
};
|
|
111
|
+
/**
|
|
112
|
+
* Use the component like this to get a from / to PriceRange:
|
|
113
|
+
*
|
|
114
|
+
* ```tsx
|
|
115
|
+
* <PriceRange
|
|
116
|
+
* currency: 'USD',
|
|
117
|
+
* minimumAmount: 56.0,
|
|
118
|
+
* maximumAmount: 58.0,
|
|
119
|
+
* size: 'small',
|
|
120
|
+
* display: 'from to',
|
|
121
|
+
* sale: false,
|
|
122
|
+
* />
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
125
|
+
export const PriceRangeFromTo = {
|
|
126
|
+
args: {
|
|
127
|
+
currency: 'USD',
|
|
128
|
+
minimumAmount: 56.0,
|
|
129
|
+
maximumAmount: 58.0,
|
|
130
|
+
size: 'small',
|
|
131
|
+
display: 'from to',
|
|
132
|
+
sale: false,
|
|
133
|
+
},
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Use the component like this to get a as low as PriceRange:
|
|
137
|
+
*
|
|
138
|
+
* ```tsx
|
|
139
|
+
* <PriceRange
|
|
140
|
+
* currency: 'USD',
|
|
141
|
+
* minimumAmount: 56.0,
|
|
142
|
+
* maximumAmount: 58.0,
|
|
143
|
+
* size: 'small',
|
|
144
|
+
* display: 'as low as',
|
|
145
|
+
* sale: false,
|
|
146
|
+
* />
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
export const PriceRangeAsLowAs = {
|
|
150
|
+
args: {
|
|
151
|
+
currency: 'USD',
|
|
152
|
+
minimumAmount: 56.0,
|
|
153
|
+
maximumAmount: 58.0,
|
|
154
|
+
size: 'small',
|
|
155
|
+
display: 'as low as',
|
|
156
|
+
sale: false,
|
|
157
|
+
},
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Use the component like this to get a simple PriceRange with special price:
|
|
161
|
+
*
|
|
162
|
+
* ```tsx
|
|
163
|
+
* <PriceRange
|
|
164
|
+
* currency: 'USD',
|
|
165
|
+
* minimumAmount: 56.0,
|
|
166
|
+
* maximumAmount: 58.0,
|
|
167
|
+
* size: 'small',
|
|
168
|
+
* display: 'dash',
|
|
169
|
+
* sale: false,
|
|
170
|
+
* specialPrice: 9.99,
|
|
171
|
+
* />
|
|
172
|
+
* ```
|
|
173
|
+
*/
|
|
174
|
+
export const PriceRangeSpecialPrice = {
|
|
175
|
+
args: {
|
|
176
|
+
currency: 'USD',
|
|
177
|
+
minimumAmount: 56.0,
|
|
178
|
+
maximumAmount: 58.0,
|
|
179
|
+
size: 'small',
|
|
180
|
+
display: 'dash',
|
|
181
|
+
sale: false,
|
|
182
|
+
specialPrice: 9.99,
|
|
183
|
+
},
|
|
184
|
+
};
|
|
185
|
+
/**
|
|
186
|
+
* Use the component like this to get a simple PriceRange with high contrast special price:
|
|
187
|
+
*
|
|
188
|
+
* ```tsx
|
|
189
|
+
* <PriceRange
|
|
190
|
+
* currency: 'USD',
|
|
191
|
+
* minimumAmount: 56.0,
|
|
192
|
+
* maximumAmount: 58.0,
|
|
193
|
+
* size: 'small',
|
|
194
|
+
* display: 'dash',
|
|
195
|
+
* sale: true,
|
|
196
|
+
* specialPrice: 9.99,
|
|
197
|
+
* />
|
|
198
|
+
* ```
|
|
199
|
+
*/
|
|
200
|
+
export const PriceRangeSpecialPriceContrast = {
|
|
201
|
+
args: {
|
|
202
|
+
currency: 'USD',
|
|
203
|
+
minimumAmount: 56.0,
|
|
204
|
+
maximumAmount: 58.0,
|
|
205
|
+
size: 'small',
|
|
206
|
+
display: 'dash',
|
|
207
|
+
sale: true,
|
|
208
|
+
specialPrice: 9.99,
|
|
209
|
+
},
|
|
210
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PriceRange.test.d.ts","sourceRoot":"","sources":["../../../src/components/PriceRange/PriceRange.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|