@dropins/tools 0.21.2-alpha3 → 0.22.0-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/event-bus.js +1 -49
- package/fetch-graphql.js +1 -62
- package/initializer.js +1 -64
- package/package.json +1 -1
- package/preact-compat.js +1 -93
- package/preact-hooks.js +1 -40
- package/preact-jsx-runtime.js +1 -35
- package/preact.js +1 -21
- package/runtime.js +1 -69
- package/components/Accordion/Accordion.d.ts +0 -25
- package/components/Accordion/Accordion.d.ts.map +0 -1
- package/components/Accordion/Accordion.jsx +0 -59
- package/components/Accordion/Accordion.stories.d.ts +0 -22
- package/components/Accordion/Accordion.stories.d.ts.map +0 -1
- package/components/Accordion/Accordion.stories.jsx +0 -320
- package/components/Accordion/Accordion.test.d.ts +0 -3
- package/components/Accordion/Accordion.test.d.ts.map +0 -1
- package/components/Accordion/Accordion.test.jsx +0 -79
- package/components/Accordion/index.d.ts +0 -3
- package/components/Accordion/index.d.ts.map +0 -1
- package/components/Accordion/index.js +0 -2
- package/components/ActionButton/ActionButton.d.ts +0 -11
- package/components/ActionButton/ActionButton.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.jsx +0 -14
- package/components/ActionButton/ActionButton.stories.d.ts +0 -16
- package/components/ActionButton/ActionButton.stories.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.stories.jsx +0 -119
- package/components/ActionButton/ActionButton.test.d.ts +0 -3
- package/components/ActionButton/ActionButton.test.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.test.jsx +0 -47
- package/components/ActionButton/index.d.ts +0 -2
- package/components/ActionButton/index.d.ts.map +0 -1
- package/components/ActionButton/index.js +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.d.ts +0 -20
- package/components/ActionButtonGroup/ActionButtonGroup.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.jsx +0 -39
- package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts +0 -16
- package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.stories.jsx +0 -72
- package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts +0 -3
- package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.test.jsx +0 -78
- package/components/ActionButtonGroup/index.d.ts +0 -2
- package/components/ActionButtonGroup/index.d.ts.map +0 -1
- package/components/ActionButtonGroup/index.js +0 -1
- package/components/AlertBanner/AlertBanner.d.ts +0 -15
- package/components/AlertBanner/AlertBanner.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.jsx +0 -30
- package/components/AlertBanner/AlertBanner.stories.d.ts +0 -17
- package/components/AlertBanner/AlertBanner.stories.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.stories.jsx +0 -128
- package/components/AlertBanner/AlertBanner.test.d.ts +0 -3
- package/components/AlertBanner/AlertBanner.test.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.test.jsx +0 -40
- package/components/AlertBanner/index.d.ts +0 -3
- package/components/AlertBanner/index.d.ts.map +0 -1
- package/components/AlertBanner/index.js +0 -2
- package/components/Breadcrumbs/Breadcrumbs.d.ts +0 -9
- package/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.jsx +0 -26
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -15
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.stories.jsx +0 -110
- package/components/Breadcrumbs/Breadcrumbs.test.d.ts +0 -3
- package/components/Breadcrumbs/Breadcrumbs.test.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.test.jsx +0 -67
- package/components/Breadcrumbs/index.d.ts +0 -3
- package/components/Breadcrumbs/index.d.ts.map +0 -1
- package/components/Breadcrumbs/index.js +0 -2
- package/components/Button/Button.d.ts +0 -15
- package/components/Button/Button.d.ts.map +0 -1
- package/components/Button/Button.jsx +0 -59
- package/components/Button/Button.stories.d.ts +0 -135
- package/components/Button/Button.stories.d.ts.map +0 -1
- package/components/Button/Button.stories.jsx +0 -354
- package/components/Button/Button.test.d.ts +0 -2
- package/components/Button/Button.test.d.ts.map +0 -1
- package/components/Button/Button.test.jsx +0 -134
- package/components/Button/index.d.ts +0 -3
- package/components/Button/index.d.ts.map +0 -1
- package/components/Button/index.js +0 -2
- package/components/Card/Card.d.ts +0 -9
- package/components/Card/Card.d.ts.map +0 -1
- package/components/Card/Card.jsx +0 -7
- package/components/Card/Card.stories.d.ts +0 -16
- package/components/Card/Card.stories.d.ts.map +0 -1
- package/components/Card/Card.stories.jsx +0 -47
- package/components/Card/Card.test.d.ts +0 -3
- package/components/Card/Card.test.d.ts.map +0 -1
- package/components/Card/Card.test.jsx +0 -26
- package/components/Card/index.d.ts +0 -2
- package/components/Card/index.d.ts.map +0 -1
- package/components/Card/index.js +0 -1
- package/components/CartItem/CartItem.d.ts +0 -25
- package/components/CartItem/CartItem.d.ts.map +0 -1
- package/components/CartItem/CartItem.jsx +0 -124
- package/components/CartItem/CartItem.stories.d.ts +0 -54
- package/components/CartItem/CartItem.stories.d.ts.map +0 -1
- package/components/CartItem/CartItem.stories.jsx +0 -309
- package/components/CartItem/CartItem.test.d.ts +0 -3
- package/components/CartItem/CartItem.test.d.ts.map +0 -1
- package/components/CartItem/CartItem.test.jsx +0 -71
- package/components/CartItem/CartItemSkeleton.d.ts +0 -3
- package/components/CartItem/CartItemSkeleton.d.ts.map +0 -1
- package/components/CartItem/CartItemSkeleton.jsx +0 -25
- package/components/CartItem/CartItemSkeleton.test.d.ts +0 -3
- package/components/CartItem/CartItemSkeleton.test.d.ts.map +0 -1
- package/components/CartItem/CartItemSkeleton.test.jsx +0 -11
- package/components/CartItem/index.d.ts +0 -4
- package/components/CartItem/index.d.ts.map +0 -1
- package/components/CartItem/index.js +0 -3
- package/components/CartList/CartList.d.ts +0 -7
- package/components/CartList/CartList.d.ts.map +0 -1
- package/components/CartList/CartList.jsx +0 -14
- package/components/CartList/CartList.stories.d.ts +0 -17
- package/components/CartList/CartList.stories.d.ts.map +0 -1
- package/components/CartList/CartList.stories.jsx +0 -54
- package/components/CartList/CartList.test.d.ts +0 -3
- package/components/CartList/CartList.test.d.ts.map +0 -1
- package/components/CartList/CartList.test.jsx +0 -12
- package/components/CartList/index.d.ts +0 -3
- package/components/CartList/index.d.ts.map +0 -1
- package/components/CartList/index.js +0 -2
- package/components/Checkbox/Checkbox.d.ts +0 -13
- package/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.jsx +0 -51
- package/components/Checkbox/Checkbox.stories.d.ts +0 -22
- package/components/Checkbox/Checkbox.stories.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.stories.jsx +0 -157
- package/components/Checkbox/Checkbox.test.d.ts +0 -3
- package/components/Checkbox/Checkbox.test.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.test.jsx +0 -136
- package/components/Checkbox/index.d.ts +0 -2
- package/components/Checkbox/index.d.ts.map +0 -1
- package/components/Checkbox/index.js +0 -1
- package/components/ColorSwatch/ColorSwatch.d.ts +0 -20
- package/components/ColorSwatch/ColorSwatch.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.jsx +0 -57
- package/components/ColorSwatch/ColorSwatch.stories.d.ts +0 -20
- package/components/ColorSwatch/ColorSwatch.stories.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.stories.jsx +0 -206
- package/components/ColorSwatch/ColorSwatch.test.d.ts +0 -3
- package/components/ColorSwatch/ColorSwatch.test.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.test.jsx +0 -87
- package/components/ColorSwatch/index.d.ts +0 -3
- package/components/ColorSwatch/index.d.ts.map +0 -1
- package/components/ColorSwatch/index.js +0 -2
- package/components/Divider/Divider.d.ts +0 -8
- package/components/Divider/Divider.d.ts.map +0 -1
- package/components/Divider/Divider.jsx +0 -9
- package/components/Divider/Divider.stories.d.ts +0 -11
- package/components/Divider/Divider.stories.d.ts.map +0 -1
- package/components/Divider/Divider.stories.jsx +0 -43
- package/components/Divider/Divider.test.d.ts +0 -2
- package/components/Divider/Divider.test.d.ts.map +0 -1
- package/components/Divider/Divider.test.jsx +0 -19
- package/components/Divider/index.d.ts +0 -3
- package/components/Divider/index.d.ts.map +0 -1
- package/components/Divider/index.js +0 -2
- package/components/Field/Field.d.ts +0 -14
- package/components/Field/Field.d.ts.map +0 -1
- package/components/Field/Field.jsx +0 -29
- package/components/Field/Field.stories.d.ts +0 -37
- package/components/Field/Field.stories.d.ts.map +0 -1
- package/components/Field/Field.stories.jsx +0 -174
- package/components/Field/Field.test.d.ts +0 -3
- package/components/Field/Field.test.d.ts.map +0 -1
- package/components/Field/Field.test.jsx +0 -91
- package/components/Field/index.d.ts +0 -2
- package/components/Field/index.d.ts.map +0 -1
- package/components/Field/index.js +0 -1
- package/components/Icon/Icon.d.ts +0 -11
- package/components/Icon/Icon.d.ts.map +0 -1
- package/components/Icon/Icon.jsx +0 -57
- package/components/Icon/Icon.stories.d.ts +0 -16
- package/components/Icon/Icon.stories.d.ts.map +0 -1
- package/components/Icon/Icon.stories.helpers.d.ts +0 -4
- package/components/Icon/Icon.stories.helpers.d.ts.map +0 -1
- package/components/Icon/Icon.stories.helpers.jsx +0 -7
- package/components/Icon/Icon.stories.jsx +0 -48
- package/components/Icon/Icon.test.d.ts +0 -3
- package/components/Icon/Icon.test.d.ts.map +0 -1
- package/components/Icon/Icon.test.jsx +0 -67
- package/components/Icon/index.d.ts +0 -2
- package/components/Icon/index.d.ts.map +0 -1
- package/components/Icon/index.js +0 -1
- package/components/IllustratedMessage/IllustratedMessage.d.ts +0 -13
- package/components/IllustratedMessage/IllustratedMessage.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.jsx +0 -21
- package/components/IllustratedMessage/IllustratedMessage.stories.d.ts +0 -10
- package/components/IllustratedMessage/IllustratedMessage.stories.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.stories.jsx +0 -90
- package/components/IllustratedMessage/IllustratedMessage.test.d.ts +0 -3
- package/components/IllustratedMessage/IllustratedMessage.test.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.test.jsx +0 -42
- package/components/IllustratedMessage/index.d.ts +0 -3
- package/components/IllustratedMessage/index.d.ts.map +0 -1
- package/components/IllustratedMessage/index.js +0 -2
- package/components/Image/Image.d.ts +0 -11
- package/components/Image/Image.d.ts.map +0 -1
- package/components/Image/Image.jsx +0 -26
- package/components/Image/Image.stories.d.ts +0 -11
- package/components/Image/Image.stories.d.ts.map +0 -1
- package/components/Image/Image.stories.jsx +0 -66
- package/components/Image/Image.test.d.ts +0 -3
- package/components/Image/Image.test.d.ts.map +0 -1
- package/components/Image/Image.test.jsx +0 -82
- package/components/Image/index.d.ts +0 -2
- package/components/Image/index.d.ts.map +0 -1
- package/components/Image/index.js +0 -1
- package/components/ImageSwatch/ImageSwatch.d.ts +0 -20
- package/components/ImageSwatch/ImageSwatch.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.jsx +0 -49
- package/components/ImageSwatch/ImageSwatch.stories.d.ts +0 -20
- package/components/ImageSwatch/ImageSwatch.stories.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.stories.jsx +0 -206
- package/components/ImageSwatch/ImageSwatch.test.d.ts +0 -3
- package/components/ImageSwatch/ImageSwatch.test.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.test.jsx +0 -64
- package/components/ImageSwatch/index.d.ts +0 -3
- package/components/ImageSwatch/index.d.ts.map +0 -1
- package/components/ImageSwatch/index.js +0 -2
- package/components/InLineAlert/InLineAlert.d.ts +0 -16
- package/components/InLineAlert/InLineAlert.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.jsx +0 -38
- package/components/InLineAlert/InLineAlert.stories.d.ts +0 -86
- package/components/InLineAlert/InLineAlert.stories.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.stories.jsx +0 -193
- package/components/InLineAlert/InLineAlert.test.d.ts +0 -3
- package/components/InLineAlert/InLineAlert.test.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.test.jsx +0 -77
- package/components/InLineAlert/index.d.ts +0 -3
- package/components/InLineAlert/index.d.ts.map +0 -1
- package/components/InLineAlert/index.js +0 -2
- package/components/Incrementer/Incrementer.d.ts +0 -17
- package/components/Incrementer/Incrementer.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.jsx +0 -87
- package/components/Incrementer/Incrementer.stories.d.ts +0 -10
- package/components/Incrementer/Incrementer.stories.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.stories.jsx +0 -68
- package/components/Incrementer/Incrementer.test.d.ts +0 -3
- package/components/Incrementer/Incrementer.test.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.test.jsx +0 -112
- package/components/Incrementer/index.d.ts +0 -2
- package/components/Incrementer/index.d.ts.map +0 -1
- package/components/Incrementer/index.js +0 -1
- package/components/Input/Input.d.ts +0 -19
- package/components/Input/Input.d.ts.map +0 -1
- package/components/Input/Input.jsx +0 -73
- package/components/Input/Input.stories.d.ts +0 -11
- package/components/Input/Input.stories.d.ts.map +0 -1
- package/components/Input/Input.stories.jsx +0 -115
- package/components/Input/Input.test.d.ts +0 -3
- package/components/Input/Input.test.d.ts.map +0 -1
- package/components/Input/Input.test.jsx +0 -111
- package/components/Input/index.d.ts +0 -3
- package/components/Input/index.d.ts.map +0 -1
- package/components/Input/index.js +0 -2
- package/components/Modal/Modal.d.ts +0 -15
- package/components/Modal/Modal.d.ts.map +0 -1
- package/components/Modal/Modal.jsx +0 -93
- package/components/Modal/Modal.stories.d.ts +0 -56
- package/components/Modal/Modal.stories.d.ts.map +0 -1
- package/components/Modal/Modal.stories.jsx +0 -189
- package/components/Modal/Modal.test.d.ts +0 -3
- package/components/Modal/Modal.test.d.ts.map +0 -1
- package/components/Modal/Modal.test.jsx +0 -85
- package/components/Modal/index.d.ts +0 -2
- package/components/Modal/index.d.ts.map +0 -1
- package/components/Modal/index.js +0 -14
- package/components/Picker/Picker.d.ts +0 -26
- package/components/Picker/Picker.d.ts.map +0 -1
- package/components/Picker/Picker.jsx +0 -81
- package/components/Picker/Picker.stories.d.ts +0 -22
- package/components/Picker/Picker.stories.d.ts.map +0 -1
- package/components/Picker/Picker.stories.jsx +0 -236
- package/components/Picker/Picker.test.d.ts +0 -2
- package/components/Picker/Picker.test.d.ts.map +0 -1
- package/components/Picker/Picker.test.jsx +0 -190
- package/components/Picker/index.d.ts +0 -2
- package/components/Picker/index.d.ts.map +0 -1
- package/components/Picker/index.js +0 -1
- package/components/Price/Price.d.ts +0 -17
- package/components/Price/Price.d.ts.map +0 -1
- package/components/Price/Price.jsx +0 -24
- package/components/Price/Price.stories.d.ts +0 -17
- package/components/Price/Price.stories.d.ts.map +0 -1
- package/components/Price/Price.stories.jsx +0 -78
- package/components/Price/Price.test.d.ts +0 -3
- package/components/Price/Price.test.d.ts.map +0 -1
- package/components/Price/Price.test.jsx +0 -68
- package/components/Price/index.d.ts +0 -2
- package/components/Price/index.d.ts.map +0 -1
- package/components/Price/index.js +0 -1
- package/components/PriceRange/PriceRange.d.ts +0 -17
- package/components/PriceRange/PriceRange.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.jsx +0 -75
- package/components/PriceRange/PriceRange.stories.d.ts +0 -107
- package/components/PriceRange/PriceRange.stories.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.stories.jsx +0 -210
- package/components/PriceRange/PriceRange.test.d.ts +0 -3
- package/components/PriceRange/PriceRange.test.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.test.jsx +0 -188
- package/components/PriceRange/index.d.ts +0 -3
- package/components/PriceRange/index.d.ts.map +0 -1
- package/components/PriceRange/index.js +0 -2
- package/components/PriceSummary/PriceSummary.d.ts +0 -43
- package/components/PriceSummary/PriceSummary.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.jsx +0 -228
- package/components/PriceSummary/PriceSummary.stories.d.ts +0 -127
- package/components/PriceSummary/PriceSummary.stories.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.stories.jsx +0 -456
- package/components/PriceSummary/PriceSummary.test.d.ts +0 -3
- package/components/PriceSummary/PriceSummary.test.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.test.jsx +0 -275
- package/components/PriceSummary/index.d.ts +0 -3
- package/components/PriceSummary/index.d.ts.map +0 -1
- package/components/PriceSummary/index.js +0 -2
- package/components/ProgressSpinner/ProgressSpinner.d.ts +0 -14
- package/components/ProgressSpinner/ProgressSpinner.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.jsx +0 -31
- package/components/ProgressSpinner/ProgressSpinner.stories.d.ts +0 -19
- package/components/ProgressSpinner/ProgressSpinner.stories.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.stories.jsx +0 -195
- package/components/ProgressSpinner/ProgressSpinner.test.d.ts +0 -3
- package/components/ProgressSpinner/ProgressSpinner.test.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.test.jsx +0 -40
- package/components/ProgressSpinner/index.d.ts +0 -3
- package/components/ProgressSpinner/index.d.ts.map +0 -1
- package/components/ProgressSpinner/index.js +0 -2
- package/components/RadioButton/RadioButton.d.ts +0 -15
- package/components/RadioButton/RadioButton.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.jsx +0 -31
- package/components/RadioButton/RadioButton.stories.d.ts +0 -15
- package/components/RadioButton/RadioButton.stories.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.stories.jsx +0 -92
- package/components/RadioButton/RadioButton.test.d.ts +0 -3
- package/components/RadioButton/RadioButton.test.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.test.jsx +0 -62
- package/components/RadioButton/index.d.ts +0 -3
- package/components/RadioButton/index.d.ts.map +0 -1
- package/components/RadioButton/index.js +0 -2
- package/components/Skeleton/Skeleton.d.ts +0 -17
- package/components/Skeleton/Skeleton.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.jsx +0 -52
- package/components/Skeleton/Skeleton.stories.d.ts +0 -67
- package/components/Skeleton/Skeleton.stories.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.stories.jsx +0 -184
- package/components/Skeleton/Skeleton.test.d.ts +0 -3
- package/components/Skeleton/Skeleton.test.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.test.jsx +0 -62
- package/components/Skeleton/index.d.ts +0 -2
- package/components/Skeleton/index.d.ts.map +0 -1
- package/components/Skeleton/index.js +0 -1
- package/components/TextSwatch/TextSwatch.d.ts +0 -18
- package/components/TextSwatch/TextSwatch.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.jsx +0 -56
- package/components/TextSwatch/TextSwatch.stories.d.ts +0 -21
- package/components/TextSwatch/TextSwatch.stories.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.stories.jsx +0 -211
- package/components/TextSwatch/TextSwatch.test.d.ts +0 -3
- package/components/TextSwatch/TextSwatch.test.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.test.jsx +0 -85
- package/components/TextSwatch/index.d.ts +0 -3
- package/components/TextSwatch/index.d.ts.map +0 -1
- package/components/TextSwatch/index.js +0 -2
- package/components/UIProvider/UIProvider.d.ts +0 -18
- package/components/UIProvider/UIProvider.d.ts.map +0 -1
- package/components/UIProvider/UIProvider.jsx +0 -26
- package/components/UIProvider/UIProvider.test.d.ts +0 -2
- package/components/UIProvider/UIProvider.test.d.ts.map +0 -1
- package/components/UIProvider/UIProvider.test.jsx +0 -9
- package/components/UIProvider/index.d.ts +0 -2
- package/components/UIProvider/index.d.ts.map +0 -1
- package/components/UIProvider/index.js +0 -1
- package/components/index.d.ts +0 -34
- package/components/index.d.ts.map +0 -1
- package/components/index.js +0 -33
- package/docs/Design/designBlocks.d.ts +0 -21
- package/docs/Design/designBlocks.d.ts.map +0 -1
- package/docs/Design/designBlocks.jsx +0 -59
- package/docs/Design/getTokenData.d.ts +0 -7
- package/docs/Design/getTokenData.d.ts.map +0 -1
- package/docs/Design/getTokenData.js +0 -18
- package/docs/Design/getTokenData.test.d.ts +0 -2
- package/docs/Design/getTokenData.test.d.ts.map +0 -1
- package/docs/Design/getTokenData.test.js +0 -92
- package/i18n/en_US.json +0 -112
- package/i18n/index.d.ts +0 -341
- package/i18n/index.d.ts.map +0 -1
- package/i18n/index.js +0 -12
- package/i18n/index.test.d.ts +0 -2
- package/i18n/index.test.d.ts.map +0 -1
- package/i18n/index.test.js +0 -11
- package/icons/index.d.ts +0 -35
- package/icons/index.d.ts.map +0 -1
- package/icons/index.js +0 -34
- package/lib/classes.d.ts +0 -5
- package/lib/classes.d.ts.map +0 -1
- package/lib/classes.js +0 -16
- package/lib/classes.test.d.ts +0 -2
- package/lib/classes.test.d.ts.map +0 -1
- package/lib/classes.test.js +0 -18
- package/lib/config.d.ts +0 -7
- package/lib/config.d.ts.map +0 -1
- package/lib/config.js +0 -12
- package/lib/config.test.d.ts +0 -2
- package/lib/config.test.d.ts.map +0 -1
- package/lib/config.test.js +0 -12
- package/lib/debounce.d.ts +0 -2
- package/lib/debounce.d.ts.map +0 -1
- package/lib/debounce.js +0 -7
- package/lib/debounce.test.d.ts +0 -2
- package/lib/debounce.test.d.ts.map +0 -1
- package/lib/debounce.test.js +0 -40
- package/lib/deepmerge.d.ts +0 -2
- package/lib/deepmerge.d.ts.map +0 -1
- package/lib/deepmerge.js +0 -1
- package/lib/form-values.d.ts +0 -5
- package/lib/form-values.d.ts.map +0 -1
- package/lib/form-values.js +0 -17
- package/lib/form-values.test.d.ts +0 -2
- package/lib/form-values.test.d.ts.map +0 -1
- package/lib/form-values.test.jsx +0 -29
- package/lib/i18n.d.ts +0 -8
- package/lib/i18n.d.ts.map +0 -1
- package/lib/i18n.js +0 -9
- package/lib/i18n.test.d.ts +0 -2
- package/lib/i18n.test.d.ts.map +0 -1
- package/lib/i18n.test.jsx +0 -8
- package/lib/image-params-keymap.d.ts +0 -4
- package/lib/image-params-keymap.d.ts.map +0 -1
- package/lib/image-params-keymap.js +0 -19
- package/lib/image-params-keymap.test.d.ts +0 -2
- package/lib/image-params-keymap.test.d.ts.map +0 -1
- package/lib/image-params-keymap.test.js +0 -7
- package/lib/index.d.ts +0 -14
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -13
- package/lib/initializer.d.ts +0 -81
- package/lib/initializer.d.ts.map +0 -1
- package/lib/initializer.js +0 -96
- package/lib/initializer.test.d.ts +0 -2
- package/lib/initializer.test.d.ts.map +0 -1
- package/lib/initializer.test.js +0 -64
- package/lib/render.d.ts +0 -10
- package/lib/render.d.ts.map +0 -1
- package/lib/render.jsx +0 -34
- package/lib/render.test.d.ts +0 -2
- package/lib/render.test.d.ts.map +0 -1
- package/lib/render.test.jsx +0 -70
- package/lib/resolve-image.d.ts +0 -10
- package/lib/resolve-image.d.ts.map +0 -1
- package/lib/resolve-image.js +0 -57
- package/lib/resolve-image.test.d.ts +0 -2
- package/lib/resolve-image.test.d.ts.map +0 -1
- package/lib/resolve-image.test.jsx +0 -146
- package/lib/slot.d.ts +0 -43
- package/lib/slot.d.ts.map +0 -1
- package/lib/slot.jsx +0 -184
- package/lib/slot.test.d.ts +0 -2
- package/lib/slot.test.d.ts.map +0 -1
- package/lib/slot.test.jsx +0 -325
- package/lib/tests.d.ts +0 -4
- package/lib/tests.d.ts.map +0 -1
- package/lib/tests.jsx +0 -19
- package/lib/tests.test.d.ts +0 -2
- package/lib/tests.test.d.ts.map +0 -1
- package/lib/tests.test.jsx +0 -13
- package/lib/types.d.ts +0 -9
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -1
- package/lib/vcomponent.d.ts +0 -8
- package/lib/vcomponent.d.ts.map +0 -1
- package/lib/vcomponent.jsx +0 -27
- package/lib/vcomponent.test.d.ts +0 -2
- package/lib/vcomponent.test.d.ts.map +0 -1
- package/lib/vcomponent.test.jsx +0 -51
|
@@ -1,188 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { PriceRange } from '@adobe/elsie/components/PriceRange';
|
|
4
|
-
describe('Base/Components/PriceRange', () => {
|
|
5
|
-
test('renders', () => {
|
|
6
|
-
const { container } = render(<PriceRange />);
|
|
7
|
-
expect(!!container).toEqual(true);
|
|
8
|
-
});
|
|
9
|
-
test('Renders simple price range', () => {
|
|
10
|
-
const { container } = render(<PriceRange minimumAmount={100} maximumAmount={200} currency="USD" locale="en-US" display="dash"/>);
|
|
11
|
-
// Ensure the price range is rendered
|
|
12
|
-
const priceRange = container.querySelector('.dropin-price-range');
|
|
13
|
-
expect(priceRange).toMatchInlineSnapshot(`
|
|
14
|
-
<div
|
|
15
|
-
class="dropin-price-range"
|
|
16
|
-
>
|
|
17
|
-
<span
|
|
18
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
19
|
-
>
|
|
20
|
-
$100.00
|
|
21
|
-
</span>
|
|
22
|
-
<span
|
|
23
|
-
class="dropin-price-range__separator"
|
|
24
|
-
>
|
|
25
|
-
-
|
|
26
|
-
</span>
|
|
27
|
-
<span
|
|
28
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
29
|
-
>
|
|
30
|
-
$200.00
|
|
31
|
-
</span>
|
|
32
|
-
</div>
|
|
33
|
-
`);
|
|
34
|
-
});
|
|
35
|
-
test('Renders from to price range', () => {
|
|
36
|
-
const { container } = render(<PriceRange minimumAmount={100} maximumAmount={200} currency="USD" locale="en-US" display="from to"/>);
|
|
37
|
-
// Ensure the price range is rendered
|
|
38
|
-
const priceRange = container.querySelector('.dropin-price-range');
|
|
39
|
-
expect(priceRange).toMatchInlineSnapshot(`
|
|
40
|
-
<div
|
|
41
|
-
class="dropin-price-range"
|
|
42
|
-
>
|
|
43
|
-
<span
|
|
44
|
-
class="dropin-price-range__from dropin-price-range__from--small"
|
|
45
|
-
>
|
|
46
|
-
From
|
|
47
|
-
</span>
|
|
48
|
-
<span
|
|
49
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
50
|
-
>
|
|
51
|
-
$100.00
|
|
52
|
-
</span>
|
|
53
|
-
<span
|
|
54
|
-
class="dropin-price-range__to dropin-price-range__to--small"
|
|
55
|
-
>
|
|
56
|
-
to
|
|
57
|
-
</span>
|
|
58
|
-
<span
|
|
59
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
60
|
-
>
|
|
61
|
-
$200.00
|
|
62
|
-
</span>
|
|
63
|
-
</div>
|
|
64
|
-
`);
|
|
65
|
-
});
|
|
66
|
-
test('Renders as low as price range', () => {
|
|
67
|
-
const { container } = render(<PriceRange minimumAmount={100} maximumAmount={200} currency="USD" locale="en-US" display="as low as"/>);
|
|
68
|
-
// Ensure the price range is rendered
|
|
69
|
-
const priceRange = container.querySelector('.dropin-price-range');
|
|
70
|
-
expect(priceRange).toMatchInlineSnapshot(`
|
|
71
|
-
<div
|
|
72
|
-
class="dropin-price-range"
|
|
73
|
-
>
|
|
74
|
-
<span
|
|
75
|
-
class="dropin-price-range__as-low-as dropin-price-range__as-low-as--small"
|
|
76
|
-
>
|
|
77
|
-
As low as
|
|
78
|
-
</span>
|
|
79
|
-
<span
|
|
80
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
81
|
-
>
|
|
82
|
-
$100.00
|
|
83
|
-
</span>
|
|
84
|
-
</div>
|
|
85
|
-
`);
|
|
86
|
-
});
|
|
87
|
-
test('Renders simple price range with special price', () => {
|
|
88
|
-
const { container } = render(<PriceRange minimumAmount={100} maximumAmount={200} currency="USD" locale="en-US" display="dash" specialPrice={9.99} sale={false}/>);
|
|
89
|
-
// Ensure the price range is rendered
|
|
90
|
-
const priceRange = container.querySelector('.dropin-price-range');
|
|
91
|
-
expect(priceRange).toMatchInlineSnapshot(`
|
|
92
|
-
<div
|
|
93
|
-
class="dropin-price-range"
|
|
94
|
-
>
|
|
95
|
-
<span
|
|
96
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
97
|
-
>
|
|
98
|
-
$9.99
|
|
99
|
-
</span>
|
|
100
|
-
<span
|
|
101
|
-
class="dropin-price-range__separator"
|
|
102
|
-
>
|
|
103
|
-
-
|
|
104
|
-
</span>
|
|
105
|
-
<span
|
|
106
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
107
|
-
>
|
|
108
|
-
$200.00
|
|
109
|
-
</span>
|
|
110
|
-
</div>
|
|
111
|
-
`);
|
|
112
|
-
});
|
|
113
|
-
test('Renders from to price range with special price', () => {
|
|
114
|
-
const { container } = render(<PriceRange minimumAmount={100} maximumAmount={200} currency="USD" locale="en-US" display="from to" specialPrice={9.99} sale={false}/>);
|
|
115
|
-
// Ensure the price range is rendered
|
|
116
|
-
const priceRange = container.querySelector('.dropin-price-range');
|
|
117
|
-
expect(priceRange).toMatchInlineSnapshot(`
|
|
118
|
-
<div
|
|
119
|
-
class="dropin-price-range"
|
|
120
|
-
>
|
|
121
|
-
<span
|
|
122
|
-
class="dropin-price-range__from dropin-price-range__from--small"
|
|
123
|
-
>
|
|
124
|
-
From
|
|
125
|
-
</span>
|
|
126
|
-
<span
|
|
127
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
128
|
-
>
|
|
129
|
-
$9.99
|
|
130
|
-
</span>
|
|
131
|
-
<span
|
|
132
|
-
class="dropin-price-range__to dropin-price-range__to--small"
|
|
133
|
-
>
|
|
134
|
-
to
|
|
135
|
-
</span>
|
|
136
|
-
<span
|
|
137
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
138
|
-
>
|
|
139
|
-
$200.00
|
|
140
|
-
</span>
|
|
141
|
-
</div>
|
|
142
|
-
`);
|
|
143
|
-
});
|
|
144
|
-
test('Renders as low as price range with high contrast special price', () => {
|
|
145
|
-
const { container } = render(<PriceRange minimumAmount={100} maximumAmount={200} currency="USD" locale="en-US" display="as low as" specialPrice={9.99} sale={true}/>);
|
|
146
|
-
// Ensure the price range is rendered
|
|
147
|
-
const priceRange = container.querySelector('.dropin-price-range');
|
|
148
|
-
expect(priceRange).toMatchInlineSnapshot(`
|
|
149
|
-
<div
|
|
150
|
-
class="dropin-price-range"
|
|
151
|
-
>
|
|
152
|
-
<span
|
|
153
|
-
class="dropin-price-range__as-low-as dropin-price-range__as-low-as--small"
|
|
154
|
-
>
|
|
155
|
-
As low as
|
|
156
|
-
</span>
|
|
157
|
-
<div>
|
|
158
|
-
<span
|
|
159
|
-
class="dropin-price dropin-price--strikethrough dropin-price--small dropin-price--bold"
|
|
160
|
-
>
|
|
161
|
-
$200.00
|
|
162
|
-
</span>
|
|
163
|
-
<span
|
|
164
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold dropin-price--sale dropin-price-range__special"
|
|
165
|
-
>
|
|
166
|
-
$9.99
|
|
167
|
-
</span>
|
|
168
|
-
</div>
|
|
169
|
-
</div>
|
|
170
|
-
`);
|
|
171
|
-
});
|
|
172
|
-
test('Renders simple product price with amount prop', () => {
|
|
173
|
-
const { container } = render(<PriceRange amount={9.99} currency="USD" locale="en-US"/>);
|
|
174
|
-
// Ensure the price range is rendered
|
|
175
|
-
const priceRange = container.querySelector('.dropin-price-range');
|
|
176
|
-
expect(priceRange).toMatchInlineSnapshot(`
|
|
177
|
-
<div
|
|
178
|
-
class="dropin-price-range"
|
|
179
|
-
>
|
|
180
|
-
<span
|
|
181
|
-
class="dropin-price dropin-price--default dropin-price--small dropin-price--bold"
|
|
182
|
-
>
|
|
183
|
-
$9.99
|
|
184
|
-
</span>
|
|
185
|
-
</div>
|
|
186
|
-
`);
|
|
187
|
-
});
|
|
188
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/PriceRange/index.ts"],"names":[],"mappings":"AAAA,cAAc,+CAA+C,CAAC;AAC9D,OAAO,EAAE,UAAU,IAAI,OAAO,EAAE,MAAM,+CAA+C,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent, VNode } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/PriceSummary/PriceSummary.css';
|
|
4
|
-
export interface PriceSummaryProps extends Omit<HTMLAttributes<HTMLDivElement>, 'loading'> {
|
|
5
|
-
heading: string;
|
|
6
|
-
loading?: boolean;
|
|
7
|
-
total?: {
|
|
8
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
9
|
-
estimated?: boolean;
|
|
10
|
-
priceWithoutTax?: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
11
|
-
};
|
|
12
|
-
subTotal?: {
|
|
13
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
14
|
-
taxIncluded?: boolean;
|
|
15
|
-
};
|
|
16
|
-
shipping?: {
|
|
17
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
18
|
-
estimated?: boolean;
|
|
19
|
-
taxIncluded?: boolean;
|
|
20
|
-
countryField?: VNode<HTMLAttributes<HTMLInputElement>>;
|
|
21
|
-
stateField?: VNode<HTMLAttributes<HTMLInputElement>>;
|
|
22
|
-
zipField?: VNode<HTMLAttributes<HTMLInputElement>>;
|
|
23
|
-
destinationText?: string;
|
|
24
|
-
onEstimate?: (formData: any) => void;
|
|
25
|
-
estimateButton?: VNode<HTMLAttributes<HTMLButtonElement>>;
|
|
26
|
-
};
|
|
27
|
-
taxTotal?: {
|
|
28
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
29
|
-
estimated?: boolean;
|
|
30
|
-
};
|
|
31
|
-
taxesApplied?: {
|
|
32
|
-
label: string;
|
|
33
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
34
|
-
}[];
|
|
35
|
-
discounts?: {
|
|
36
|
-
label: string;
|
|
37
|
-
price: VNode<HTMLAttributes<HTMLSpanElement>>;
|
|
38
|
-
caption?: VNode<HTMLAttributes<HTMLDivElement>>;
|
|
39
|
-
}[];
|
|
40
|
-
primaryAction?: VNode<HTMLAttributes<HTMLButtonElement>>;
|
|
41
|
-
}
|
|
42
|
-
export declare const PriceSummary: FunctionComponent<PriceSummaryProps>;
|
|
43
|
-
//# sourceMappingURL=PriceSummary.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PriceSummary.d.ts","sourceRoot":"","sources":["../../../src/components/PriceSummary/PriceSummary.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,cAAc,EAAoB,MAAM,eAAe,CAAC;AAajE,OAAO,uDAAuD,CAAC;AAE/D,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,SAAS,CAAC;IACvD,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,KAAK,CAAC,EAAE;QACN,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;QAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,eAAe,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;KAC1D,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;QAC9C,WAAW,CAAC,EAAE,OAAO,CAAC;KACvB,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;QAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;QACpB,WAAW,CAAC,EAAE,OAAO,CAAC;QACtB,YAAY,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACvD,UAAU,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACrD,QAAQ,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,gBAAgB,CAAC,CAAC,CAAC;QACnD,eAAe,CAAC,EAAE,MAAM,CAAC;QACzB,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAC;QACrC,cAAc,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC;KAC3D,CAAC;IACF,QAAQ,CAAC,EAAE;QACT,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;QAC9C,SAAS,CAAC,EAAE,OAAO,CAAC;KACrB,CAAC;IACF,YAAY,CAAC,EAAE;QACb,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;KAC/C,EAAE,CAAC;IACJ,SAAS,CAAC,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,KAAK,EAAE,KAAK,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC,CAAC;QAC9C,OAAO,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC,CAAC;KACjD,EAAE,CAAC;IACJ,aAAa,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,CAAC;CAC1D;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA2b7D,CAAC"}
|
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
import { useRef, useState } from 'preact/compat';
|
|
2
|
-
import { VComponent, classes, getFormValues } from '@adobe/elsie/lib';
|
|
3
|
-
import { Text, useText } from '@adobe/elsie/i18n';
|
|
4
|
-
import { Accordion, AccordionSection, Divider, Skeleton, SkeletonRow, } from '@adobe/elsie/components';
|
|
5
|
-
import { ChevronDown, ChevronUp } from '@adobe/elsie/icons';
|
|
6
|
-
import '@adobe/elsie/components/PriceSummary/PriceSummary.css';
|
|
7
|
-
export const PriceSummary = ({ className, children, ...props }) => {
|
|
8
|
-
const { heading, loading = true, total, subTotal, shipping, taxTotal, taxesApplied, discounts, primaryAction, ...restProps } = props;
|
|
9
|
-
const [showTaxBreakdown, setShowTaxBreakdown] = useState(false);
|
|
10
|
-
const estimateFormRef = useRef(null);
|
|
11
|
-
const [showEstimateForm, setShowEstimateForm] = useState(true);
|
|
12
|
-
const [estimateField, setEstimateField] = useState('zip');
|
|
13
|
-
const translations = useText({
|
|
14
|
-
editZipAction: 'Dropin.PriceSummary.shipping.editZipAction',
|
|
15
|
-
destinationLinkAriaLabel: 'Dropin.PriceSummary.shipping.destinationLinkAriaLabel',
|
|
16
|
-
taxesBreakdownTitle: 'Dropin.PriceSummary.taxes.breakdown',
|
|
17
|
-
showTaxBreakdown: 'Dropin.PriceSummary.taxes.showBreakdown',
|
|
18
|
-
hideTaxBreakdown: 'Dropin.PriceSummary.taxes.hideBreakdown',
|
|
19
|
-
zipPlaceholder: 'Dropin.PriceSummary.shipping.zipPlaceholder',
|
|
20
|
-
});
|
|
21
|
-
const onDestinationLinkClick = (e) => {
|
|
22
|
-
e.preventDefault();
|
|
23
|
-
setShowEstimateForm((show) => !show);
|
|
24
|
-
};
|
|
25
|
-
const onAlternateFieldClick = (e) => {
|
|
26
|
-
e.preventDefault();
|
|
27
|
-
setShowEstimateForm(true);
|
|
28
|
-
setEstimateField((field) => (field === 'zip' ? 'state' : 'zip'));
|
|
29
|
-
};
|
|
30
|
-
const onSubmitEstimate = (e) => {
|
|
31
|
-
e.preventDefault();
|
|
32
|
-
setShowEstimateForm(false);
|
|
33
|
-
const formData = getFormValues(estimateFormRef.current);
|
|
34
|
-
shipping?.onEstimate?.(formData);
|
|
35
|
-
};
|
|
36
|
-
// Skeleton content to show while loading
|
|
37
|
-
const skeletonContent = (<Skeleton data-testid="loading-skeleton" rowGap="xsmall">
|
|
38
|
-
<SkeletonRow variant="row" size="small" lines={5} fullWidth={true} multilineGap="xsmall"/>
|
|
39
|
-
</Skeleton>);
|
|
40
|
-
// Entry for the shipping price
|
|
41
|
-
const shippingContent = shipping && (<>
|
|
42
|
-
<div data-testid="shipping-content" className={classes([
|
|
43
|
-
'dropin-price-summary__entry',
|
|
44
|
-
'dropin-price-summary__shipping',
|
|
45
|
-
])}>
|
|
46
|
-
<span className={'dropin-price-summary__label'}>
|
|
47
|
-
{shipping.estimated ? (shipping.destinationText ? (<>
|
|
48
|
-
<Text id="Dropin.PriceSummary.shipping.estimatedDestination"/>
|
|
49
|
-
<a className={'dropin-price-summary__shippingLink'} role="button" href="" onClick={onDestinationLinkClick} onKeyDown={(event) => {
|
|
50
|
-
if (event.key === 'Enter' || event.key === ' ') {
|
|
51
|
-
onDestinationLinkClick(event);
|
|
52
|
-
}
|
|
53
|
-
}} tabIndex={0} aria-label={translations.destinationLinkAriaLabel} data-testid="shipping-destination-link">
|
|
54
|
-
{shipping.destinationText}
|
|
55
|
-
</a>
|
|
56
|
-
</>) : (<Text id="Dropin.PriceSummary.shipping.estimated"/>)) : (<Text id="Dropin.PriceSummary.shipping.label"/>)}
|
|
57
|
-
</span>
|
|
58
|
-
<VComponent node={shipping.price} className={'dropin-price-summary__price'}/>
|
|
59
|
-
|
|
60
|
-
{shipping.estimated && (<>
|
|
61
|
-
<div className={classes(['dropin-price-summary__caption'])}>
|
|
62
|
-
<a href="#" className={'dropin-price-summary__shippingLink'} onClick={onAlternateFieldClick} data-testid="shipping-alternate-field-link">
|
|
63
|
-
{estimateField === 'zip' ? (<Text id="Dropin.PriceSummary.shipping.alternateField.state"/>) : (<Text id="Dropin.PriceSummary.shipping.alternateField.zip"/>)}
|
|
64
|
-
</a>
|
|
65
|
-
</div>
|
|
66
|
-
</>)}
|
|
67
|
-
|
|
68
|
-
{/* Edit shipping address form */}
|
|
69
|
-
{shipping.estimated && (<>
|
|
70
|
-
<form className={classes([
|
|
71
|
-
'dropin-price-summary__shipping--edit',
|
|
72
|
-
['dropin-price-summary__shipping--hide', !showEstimateForm],
|
|
73
|
-
])} ref={estimateFormRef} data-testid="shipping-estimate-form">
|
|
74
|
-
{shipping.countryField && (<VComponent node={shipping.countryField} className={classes([
|
|
75
|
-
'dropin-price-summary__shipping--country',
|
|
76
|
-
])}/>)}
|
|
77
|
-
{estimateField === 'state'
|
|
78
|
-
? shipping.stateField && (<VComponent node={shipping.stateField} className={classes([
|
|
79
|
-
'dropin-price-summary__shipping--state',
|
|
80
|
-
])}/>)
|
|
81
|
-
: shipping.zipField && (<VComponent node={shipping.zipField} className={classes([
|
|
82
|
-
'dropin-price-summary__shipping--zip',
|
|
83
|
-
])}/>)}
|
|
84
|
-
{shipping.estimateButton && (<VComponent node={shipping.estimateButton} className={classes([
|
|
85
|
-
'dropin-price-summary__shipping--action',
|
|
86
|
-
])} onClick={onSubmitEstimate} type="submit"/>)}
|
|
87
|
-
</form>
|
|
88
|
-
</>)}
|
|
89
|
-
|
|
90
|
-
{shipping.taxIncluded && (<div className={classes(['dropin-price-summary__caption'])}>
|
|
91
|
-
<span>
|
|
92
|
-
<Text id="Dropin.PriceSummary.shipping.withTaxes"/>
|
|
93
|
-
</span>
|
|
94
|
-
</div>)}
|
|
95
|
-
</div>
|
|
96
|
-
</>);
|
|
97
|
-
// Entry for the discounts
|
|
98
|
-
const discountContent = discounts && (<>
|
|
99
|
-
{discounts.map((discount) => (<div className={classes([
|
|
100
|
-
'dropin-price-summary__entry',
|
|
101
|
-
'dropin-price-summary__discount',
|
|
102
|
-
])} key={discount.label}>
|
|
103
|
-
<span className={classes(['dropin-price-summary__label'])}>
|
|
104
|
-
{discount.label}
|
|
105
|
-
</span>
|
|
106
|
-
<VComponent node={discount.price} className={classes(['dropin-price-summary__price'])}/>
|
|
107
|
-
{discount.caption && (<VComponent node={discount.caption} className={classes(['dropin-price-summary__caption'])}/>)}
|
|
108
|
-
</div>))}
|
|
109
|
-
</>);
|
|
110
|
-
// Entry for the total tax and breakdown (if provided)
|
|
111
|
-
const taxContent = taxesApplied ? (
|
|
112
|
-
/* Show breakdown if provided */
|
|
113
|
-
<>
|
|
114
|
-
<Accordion data-testid="tax-breakdown" className={'dropin-price-summary__taxes'} iconOpen={ChevronDown} iconClose={ChevronUp}>
|
|
115
|
-
<AccordionSection title={translations.taxesBreakdownTitle} secondaryText={!showTaxBreakdown && taxTotal ? (<VComponent node={taxTotal.price} className={'dropin-price-summary__price'}/>) : undefined} renderContentWhenClosed={false} onStateChange={setShowTaxBreakdown}>
|
|
116
|
-
<div className={classes(['dropin-price-summary__appliedTaxes'])}>
|
|
117
|
-
{taxesApplied.map((tax) => (<div className={classes([
|
|
118
|
-
'dropin-price-summary__entry',
|
|
119
|
-
'dropin-price-summary__taxEntry',
|
|
120
|
-
])} key={tax.label}>
|
|
121
|
-
<span className={classes([
|
|
122
|
-
'dropin-price-summary__label',
|
|
123
|
-
'dropin-price-summary__label--muted',
|
|
124
|
-
])}>
|
|
125
|
-
{tax.label}
|
|
126
|
-
</span>
|
|
127
|
-
|
|
128
|
-
<VComponent node={tax.price} className={classes([
|
|
129
|
-
'dropin-price-summary__price',
|
|
130
|
-
'dropin-price-summary__price--muted',
|
|
131
|
-
])}/>
|
|
132
|
-
</div>))}
|
|
133
|
-
</div>
|
|
134
|
-
|
|
135
|
-
<div className={classes(['dropin-price-summary__entry'])}>
|
|
136
|
-
<span className={'dropin-price-summary__label'}>
|
|
137
|
-
<Text id="Dropin.PriceSummary.taxes.total"/>
|
|
138
|
-
</span>
|
|
139
|
-
{taxTotal && (<VComponent node={taxTotal.price} className={'dropin-price-summary__price'}/>)}
|
|
140
|
-
</div>
|
|
141
|
-
</AccordionSection>
|
|
142
|
-
</Accordion>
|
|
143
|
-
</>) : (taxTotal && (
|
|
144
|
-
/* Otherwise, show total only */
|
|
145
|
-
<div data-testid="tax-total-only" className={classes([
|
|
146
|
-
'dropin-price-summary__entry',
|
|
147
|
-
'dropin-price-summary__taxTotal',
|
|
148
|
-
])}>
|
|
149
|
-
<span className={'dropin-price-summary__label'}>
|
|
150
|
-
{taxTotal.estimated ? (<Text id="Dropin.PriceSummary.taxes.estimated"/>) : (<Text id="Dropin.PriceSummary.taxes.totalOnly"/>)}
|
|
151
|
-
</span>
|
|
152
|
-
<VComponent node={taxTotal.price} className={'dropin-price-summary__price'}/>
|
|
153
|
-
</div>));
|
|
154
|
-
// Entry for the total
|
|
155
|
-
const totalContent = total && (<>
|
|
156
|
-
<div data-testid="total-content" className={classes([
|
|
157
|
-
'dropin-price-summary__entry',
|
|
158
|
-
'dropin-price-summary__total',
|
|
159
|
-
total.estimated && 'dropin-price-summary__total--padded',
|
|
160
|
-
])}>
|
|
161
|
-
<span className={classes([
|
|
162
|
-
'dropin-price-summary__label',
|
|
163
|
-
'dropin-price-summary__label--bold',
|
|
164
|
-
])}>
|
|
165
|
-
{total.estimated ? (<Text id="Dropin.PriceSummary.total.estimated"/>) : (<Text id="Dropin.PriceSummary.total.label"/>)}
|
|
166
|
-
</span>
|
|
167
|
-
<VComponent node={total.price} className={classes([
|
|
168
|
-
'dropin-price-summary__price',
|
|
169
|
-
'dropin-price-summary__price--bold',
|
|
170
|
-
])}/>
|
|
171
|
-
</div>
|
|
172
|
-
</>);
|
|
173
|
-
// Entry for the total without tax
|
|
174
|
-
const totalWithoutTaxContent = total && total.priceWithoutTax && (<div data-testid="total-without-tax" className={'dropin-price-summary__entry dropin-price-summary__totalWithoutTax'}>
|
|
175
|
-
<span className={classes([
|
|
176
|
-
'dropin-price-summary__label',
|
|
177
|
-
'dropin-price-summary__label--muted',
|
|
178
|
-
])}>
|
|
179
|
-
<Text id="Dropin.PriceSummary.total.withoutTax"/>
|
|
180
|
-
</span>
|
|
181
|
-
<VComponent node={total.priceWithoutTax} className={classes([
|
|
182
|
-
'dropin-price-summary__price',
|
|
183
|
-
'dropin-price-summary__price--muted',
|
|
184
|
-
])}/>
|
|
185
|
-
</div>);
|
|
186
|
-
// Entry for the primary action
|
|
187
|
-
const primaryActionContent = primaryAction && (<div className={classes([
|
|
188
|
-
'dropin-price-summary__entry',
|
|
189
|
-
'dropin-price-summary__primaryAction',
|
|
190
|
-
])}>
|
|
191
|
-
{primaryAction}
|
|
192
|
-
</div>);
|
|
193
|
-
const subTotalContent = subTotal && (<div className={classes([
|
|
194
|
-
'dropin-price-summary__entry',
|
|
195
|
-
'dropin-price-summary__subTotal',
|
|
196
|
-
])}>
|
|
197
|
-
<span className={'dropin-price-summary__label'}>
|
|
198
|
-
<Text id="Dropin.PriceSummary.subTotal.label"/>
|
|
199
|
-
</span>
|
|
200
|
-
<VComponent node={subTotal.price} className={'dropin-price-summary__price'}/>
|
|
201
|
-
{subTotal.taxIncluded && (<div data-testid="sub-total-tax-caption" className={classes(['dropin-price-summary__caption'])}>
|
|
202
|
-
<span>
|
|
203
|
-
<Text id="Dropin.PriceSummary.subTotal.withTaxes"/>
|
|
204
|
-
</span>
|
|
205
|
-
</div>)}
|
|
206
|
-
</div>);
|
|
207
|
-
return (<div {...restProps} className={classes(['dropin-price-summary', className])}>
|
|
208
|
-
<div className={'dropin-price-summary__heading'}>{heading}</div>
|
|
209
|
-
|
|
210
|
-
<Divider variant="primary" className={'dropin-price-summary__divider-primary'}/>
|
|
211
|
-
|
|
212
|
-
{loading ? (skeletonContent) : (<>
|
|
213
|
-
{subTotalContent}
|
|
214
|
-
|
|
215
|
-
{shippingContent}
|
|
216
|
-
|
|
217
|
-
{discountContent}
|
|
218
|
-
|
|
219
|
-
{taxContent}
|
|
220
|
-
|
|
221
|
-
{totalContent}
|
|
222
|
-
|
|
223
|
-
{totalWithoutTaxContent}
|
|
224
|
-
|
|
225
|
-
{primaryActionContent}
|
|
226
|
-
</>)}
|
|
227
|
-
</div>);
|
|
228
|
-
};
|
|
@@ -1,127 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { PriceSummaryProps } from '@adobe/elsie/components/PriceSummary';
|
|
3
|
-
/**
|
|
4
|
-
* Use PriceSummary to provide a summary of the total, subtotal, shipping, discounts, and tax amounts.
|
|
5
|
-
*
|
|
6
|
-
* Import the component like this:
|
|
7
|
-
*
|
|
8
|
-
* ```tsx
|
|
9
|
-
* import { PriceSummary } from '@adobe/elsie/componens/PriceSummary';
|
|
10
|
-
* ```
|
|
11
|
-
*
|
|
12
|
-
*/
|
|
13
|
-
declare const meta: Meta<PriceSummaryProps>;
|
|
14
|
-
export default meta;
|
|
15
|
-
type Story = StoryObj<PriceSummaryProps>;
|
|
16
|
-
/**
|
|
17
|
-
* Use the component like this to get a Checkout variation of the PriceSummary:
|
|
18
|
-
*
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <PriceSummary
|
|
21
|
-
* heading='Order Summary'
|
|
22
|
-
* loading={false}
|
|
23
|
-
* total={{
|
|
24
|
-
* price: <Price amount={100} currency="USD" />
|
|
25
|
-
* priceWithoutTax: <Price amount={90} currency="USD" />,
|
|
26
|
-
* }}
|
|
27
|
-
* subTotal={
|
|
28
|
-
* price: <Price amount={90} currency="USD" />,
|
|
29
|
-
* taxIncluded: true,
|
|
30
|
-
* }
|
|
31
|
-
* shipping={{
|
|
32
|
-
* price: <Price amount={10} currency="USD" />,
|
|
33
|
-
* taxIncluded: true,
|
|
34
|
-
* }}
|
|
35
|
-
* taxTotal={<Price amount={10} currency="USD" />},
|
|
36
|
-
* taxesApplied={[
|
|
37
|
-
* {
|
|
38
|
-
* label: 'VAT standard',
|
|
39
|
-
* price: <Price amount={5} currency="USD" />,
|
|
40
|
-
* },
|
|
41
|
-
* {
|
|
42
|
-
* label: 'VAT reduced',
|
|
43
|
-
* price: <Price amount={5} currency="USD" />,
|
|
44
|
-
* },
|
|
45
|
-
* ]}
|
|
46
|
-
* />
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export declare const Checkout: Story;
|
|
50
|
-
/**
|
|
51
|
-
* Use the component like this to get a Cart variation of the PriceSummary:
|
|
52
|
-
*
|
|
53
|
-
* ```tsx
|
|
54
|
-
* <PriceSummary
|
|
55
|
-
* heading='Order Summary'
|
|
56
|
-
* loading={false}
|
|
57
|
-
* subTotal={{
|
|
58
|
-
* price: <Price amount={90} currency="USD" />,
|
|
59
|
-
* }}
|
|
60
|
-
* shipping={{
|
|
61
|
-
* price: <Price amount={10} currency="USD" />,
|
|
62
|
-
* estimated: true,
|
|
63
|
-
* countryField: (
|
|
64
|
-
* <Picker
|
|
65
|
-
* name="shippingCountry"
|
|
66
|
-
* placeholder="Country"
|
|
67
|
-
* variant="primary"
|
|
68
|
-
* options={[
|
|
69
|
-
* { text: 'United States', value: 'US' },
|
|
70
|
-
* { text: 'Canada', value: 'CA' },
|
|
71
|
-
* ]}/>
|
|
72
|
-
* ),
|
|
73
|
-
* stateField: (
|
|
74
|
-
* <Picker name="shippingState" placeholder="State" variant="primary"
|
|
75
|
-
* options={
|
|
76
|
-
* [
|
|
77
|
-
* { text: 'Alabama', value: 'AL' },
|
|
78
|
-
* { text: 'Alaska', value: 'AK' },
|
|
79
|
-
* { text: 'Arizona', value: 'AZ' },
|
|
80
|
-
* ]} />
|
|
81
|
-
* ),
|
|
82
|
-
* zipField: (
|
|
83
|
-
* <Input
|
|
84
|
-
* aria-label="Zip"
|
|
85
|
-
* name="shippingZip"
|
|
86
|
-
* placeholder="Zip Code"
|
|
87
|
-
* variant="primary"
|
|
88
|
-
* value=""
|
|
89
|
-
* />
|
|
90
|
-
* ),
|
|
91
|
-
* destinationText: '12345',
|
|
92
|
-
* onEstimate: (value) => console.log(value),
|
|
93
|
-
* estimateButton: <Button variant="secondary">Apply</Button>,
|
|
94
|
-
* }}
|
|
95
|
-
* total={{
|
|
96
|
-
* price: <Price amount={100} currency="USD" />,
|
|
97
|
-
* estimated: true,
|
|
98
|
-
* }}
|
|
99
|
-
* taxTotal={<span>TBD</span>}
|
|
100
|
-
* discounts={[
|
|
101
|
-
* {
|
|
102
|
-
* label: '10% off',
|
|
103
|
-
* price: <Price amount={-10} currency="USD" sale={true} />,
|
|
104
|
-
* },
|
|
105
|
-
* {
|
|
106
|
-
* label: '100th Customer Discount',
|
|
107
|
-
* price: <Price amount={-2} currency="USD" sale={true} />,
|
|
108
|
-
* caption: <div>Discount for our 100th customer!</div>,
|
|
109
|
-
* },
|
|
110
|
-
* ]}
|
|
111
|
-
* primaryAction={<Button variant="primary">Checkout</Button>}
|
|
112
|
-
* />
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
export declare const Cart: Story;
|
|
116
|
-
/**
|
|
117
|
-
* Set the loading prop to true to show a loading state.
|
|
118
|
-
*
|
|
119
|
-
* ```tsx
|
|
120
|
-
* <PriceSummary
|
|
121
|
-
* heading='Order Summary',
|
|
122
|
-
* loading={true},
|
|
123
|
-
* />
|
|
124
|
-
* ```
|
|
125
|
-
*/
|
|
126
|
-
export declare const Loading: Story;
|
|
127
|
-
//# sourceMappingURL=PriceSummary.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PriceSummary.stories.d.ts","sourceRoot":"","sources":["../../../src/components/PriceSummary/PriceSummary.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAEL,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAK9C;;;;;;;;;GASG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAgOjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAgCzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,eAAO,MAAM,IAAI,EAAE,KA4GlB,CAAC;AAEF;;;;;;;;;GASG;AACH,eAAO,MAAM,OAAO,EAAE,KAKrB,CAAC"}
|