@dropins/tools 0.21.2-alpha3 → 0.21.2-alpha389
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,57 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'preact/compat';
|
|
2
|
-
import { classes } from '@adobe/elsie/lib';
|
|
3
|
-
import '@adobe/elsie/components/ColorSwatch/ColorSwatch.css';
|
|
4
|
-
import { useText } from '@adobe/elsie/i18n';
|
|
5
|
-
export const ColorSwatch = ({ className, name, value, id, label, groupAriaLabel, size = 'medium', color, disabled = false, selected = false, outOfStock = false, multi = false, onValue, onUpdateError, ...props }) => {
|
|
6
|
-
// i18n
|
|
7
|
-
const outOfStockLabel = useText('Dropin.Swatches.outOfStock.label').label;
|
|
8
|
-
const selectedLabel = useText('Dropin.Swatches.selected.label').label;
|
|
9
|
-
const swatchLabel = useText('Dropin.Swatches.swatch.label').label;
|
|
10
|
-
const onValueHandler = useCallback(async (newValue) => {
|
|
11
|
-
if (onValue) {
|
|
12
|
-
try {
|
|
13
|
-
await onValue(newValue);
|
|
14
|
-
}
|
|
15
|
-
catch (e) {
|
|
16
|
-
if (onUpdateError) {
|
|
17
|
-
onUpdateError(e);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}, [onValue, onUpdateError]);
|
|
22
|
-
const handleOnValue = (e) => {
|
|
23
|
-
const input = e.target;
|
|
24
|
-
onValueHandler(input.value);
|
|
25
|
-
};
|
|
26
|
-
const isValidColor = (color) => {
|
|
27
|
-
const colorStyle = new Option().style;
|
|
28
|
-
colorStyle.color = color;
|
|
29
|
-
return colorStyle.color !== ''; // Returns true if the browser accepts this as a valid color
|
|
30
|
-
};
|
|
31
|
-
const defaultColor = 'var(--color-gray-300);';
|
|
32
|
-
const validColor = color && isValidColor(color) ? color : defaultColor;
|
|
33
|
-
const handleAriaLabel = () => {
|
|
34
|
-
if (outOfStock)
|
|
35
|
-
return `${groupAriaLabel}: ${label} ${outOfStockLabel}`;
|
|
36
|
-
if (selected)
|
|
37
|
-
return `${groupAriaLabel}: ${label} ${selectedLabel}`;
|
|
38
|
-
return `${groupAriaLabel}: ${label} ${swatchLabel}`;
|
|
39
|
-
};
|
|
40
|
-
return (<label className={classes([
|
|
41
|
-
'dropin-color-swatch__container',
|
|
42
|
-
`dropin-color-swatch__container--${size}`,
|
|
43
|
-
className,
|
|
44
|
-
])}>
|
|
45
|
-
<input type={multi ? 'checkbox' : 'radio'} name={name} id={id} value={value} aria-label={handleAriaLabel()} checked={selected} disabled={disabled} onChange={handleOnValue} {...props} className={classes([
|
|
46
|
-
'dropin-color-swatch',
|
|
47
|
-
['dropin-color-swatch--selected', selected],
|
|
48
|
-
['dropin-color-swatch--disabled', disabled],
|
|
49
|
-
className,
|
|
50
|
-
])}/>
|
|
51
|
-
<span style={{ '--bg-color': validColor }} className={classes([
|
|
52
|
-
'dropin-color-swatch__span',
|
|
53
|
-
['dropin-color-swatch__span--out-of-stock', outOfStock],
|
|
54
|
-
className,
|
|
55
|
-
])}/>
|
|
56
|
-
</label>);
|
|
57
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { ColorSwatchProps } from '@adobe/elsie/components/ColorSwatch';
|
|
3
|
-
/**
|
|
4
|
-
* Use Color Swatches to display fills — such as colors, gradients, and textures — that can be applied to an object.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<ColorSwatchProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<ColorSwatchProps>;
|
|
9
|
-
/**
|
|
10
|
-
* ```ts
|
|
11
|
-
* import { ColorSwatch } from '@adobe/elsie/components/ColorSwatch';
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare const DefaultColorSwatch: Story;
|
|
15
|
-
export declare const SelectedColorSwatch: Story;
|
|
16
|
-
export declare const DisabledColorSwatch: Story;
|
|
17
|
-
export declare const OutOfStockColorSwatch: Story;
|
|
18
|
-
export declare const SelectedOutOfStockColorSwatch: Story;
|
|
19
|
-
export declare const MultiColorSwatch: Story;
|
|
20
|
-
//# sourceMappingURL=ColorSwatch.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSwatch.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ColorSwatch/ColorSwatch.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIxD,OAAO,EAEL,gBAAgB,EACjB,MAAM,qCAAqC,CAAC;AAE7C;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,gBAAgB,CA8EhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAExC;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,EAAE,KAuBhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KA0BjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAkBjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAcnC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KAc3C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAoC9B,CAAC"}
|
|
@@ -1,206 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { within } from '@storybook/testing-library';
|
|
3
|
-
import { expect } from '@storybook/jest';
|
|
4
|
-
import { ColorSwatch, } from '@adobe/elsie/components/ColorSwatch';
|
|
5
|
-
/**
|
|
6
|
-
* Use Color Swatches to display fills — such as colors, gradients, and textures — that can be applied to an object.
|
|
7
|
-
*/
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Components/ColorSwatch',
|
|
10
|
-
component: ColorSwatch,
|
|
11
|
-
argTypes: {
|
|
12
|
-
name: {
|
|
13
|
-
description: 'Field name (used for mapping the value in a form)',
|
|
14
|
-
type: {
|
|
15
|
-
required: false,
|
|
16
|
-
name: 'string',
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
label: {
|
|
20
|
-
description: 'Field label',
|
|
21
|
-
type: {
|
|
22
|
-
required: true,
|
|
23
|
-
name: 'string',
|
|
24
|
-
},
|
|
25
|
-
groupAriaLabel: {
|
|
26
|
-
description: 'Label name for the swatch group',
|
|
27
|
-
type: {
|
|
28
|
-
required: true,
|
|
29
|
-
name: 'string',
|
|
30
|
-
},
|
|
31
|
-
},
|
|
32
|
-
},
|
|
33
|
-
id: {
|
|
34
|
-
description: 'Field id',
|
|
35
|
-
type: {
|
|
36
|
-
required: false,
|
|
37
|
-
name: 'string',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
size: {
|
|
41
|
-
description: 'Size of the color swatch',
|
|
42
|
-
type: {
|
|
43
|
-
required: false,
|
|
44
|
-
name: 'string',
|
|
45
|
-
},
|
|
46
|
-
defaultValue: { summary: 'medium' },
|
|
47
|
-
options: ['medium', 'large'],
|
|
48
|
-
control: { type: 'radio' },
|
|
49
|
-
},
|
|
50
|
-
color: {
|
|
51
|
-
description: 'Color of the swatch',
|
|
52
|
-
type: {
|
|
53
|
-
required: false,
|
|
54
|
-
name: 'string',
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
value: {
|
|
58
|
-
description: 'Field value',
|
|
59
|
-
type: {
|
|
60
|
-
required: false,
|
|
61
|
-
name: 'string',
|
|
62
|
-
},
|
|
63
|
-
},
|
|
64
|
-
disabled: {
|
|
65
|
-
description: 'Whether or not the color swatch is disabled',
|
|
66
|
-
type: {
|
|
67
|
-
required: false,
|
|
68
|
-
name: 'boolean',
|
|
69
|
-
},
|
|
70
|
-
},
|
|
71
|
-
selected: {
|
|
72
|
-
description: 'Whether or not the color swatch is active',
|
|
73
|
-
type: {
|
|
74
|
-
required: false,
|
|
75
|
-
name: 'boolean',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
multi: {
|
|
79
|
-
description: 'Whether or not the color swatch allows multiple selection',
|
|
80
|
-
type: {
|
|
81
|
-
required: false,
|
|
82
|
-
name: 'boolean',
|
|
83
|
-
},
|
|
84
|
-
},
|
|
85
|
-
},
|
|
86
|
-
};
|
|
87
|
-
export default meta;
|
|
88
|
-
/**
|
|
89
|
-
* ```ts
|
|
90
|
-
* import { ColorSwatch } from '@adobe/elsie/components/ColorSwatch';
|
|
91
|
-
* ```
|
|
92
|
-
*/
|
|
93
|
-
export const DefaultColorSwatch = {
|
|
94
|
-
args: {
|
|
95
|
-
name: 'colorSwatchField',
|
|
96
|
-
id: 'graySwatch',
|
|
97
|
-
label: 'gray',
|
|
98
|
-
groupAriaLabel: 'Color Swatch',
|
|
99
|
-
value: 'gray',
|
|
100
|
-
size: 'medium',
|
|
101
|
-
color: '#E8E8E8',
|
|
102
|
-
selected: false,
|
|
103
|
-
disabled: false,
|
|
104
|
-
outOfStock: false,
|
|
105
|
-
onValue: action('onValue'),
|
|
106
|
-
},
|
|
107
|
-
play: async ({ canvasElement }) => {
|
|
108
|
-
const canvas = within(canvasElement);
|
|
109
|
-
const textSwatch = await canvas.findByRole('radio');
|
|
110
|
-
const spanElement = document.querySelector('.dropin-color-swatch__span');
|
|
111
|
-
expect(spanElement).toBeVisible();
|
|
112
|
-
await expect(textSwatch).not.toBeChecked();
|
|
113
|
-
},
|
|
114
|
-
};
|
|
115
|
-
export const SelectedColorSwatch = {
|
|
116
|
-
args: {
|
|
117
|
-
name: 'colorSwatchField',
|
|
118
|
-
id: 'graySwatch',
|
|
119
|
-
value: 'gray',
|
|
120
|
-
label: 'gray',
|
|
121
|
-
groupAriaLabel: 'Color Swatch',
|
|
122
|
-
size: 'medium',
|
|
123
|
-
color: '#E8E8E8',
|
|
124
|
-
selected: true,
|
|
125
|
-
disabled: false,
|
|
126
|
-
outOfStock: false,
|
|
127
|
-
onValue: action('onValue'),
|
|
128
|
-
},
|
|
129
|
-
play: async ({ canvasElement }) => {
|
|
130
|
-
const canvas = within(canvasElement);
|
|
131
|
-
const textSwatch = await canvas.findByRole('radio');
|
|
132
|
-
const spanElement = document.querySelector('.dropin-color-swatch__span');
|
|
133
|
-
expect(spanElement).toBeVisible();
|
|
134
|
-
await expect(textSwatch).toBeChecked();
|
|
135
|
-
await expect(canvas.getByLabelText('Color Swatch: gray swatch selected')).toBeChecked();
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
export const DisabledColorSwatch = {
|
|
139
|
-
args: {
|
|
140
|
-
name: 'colorSwatchField',
|
|
141
|
-
id: 'graySwatch',
|
|
142
|
-
value: 'gray',
|
|
143
|
-
label: 'gray',
|
|
144
|
-
groupAriaLabel: 'Color Swatch',
|
|
145
|
-
size: 'medium',
|
|
146
|
-
color: '#E8E8E8',
|
|
147
|
-
selected: false,
|
|
148
|
-
disabled: true,
|
|
149
|
-
outOfStock: false,
|
|
150
|
-
onValue: action('onValue'),
|
|
151
|
-
},
|
|
152
|
-
play: async ({ canvasElement }) => {
|
|
153
|
-
const canvas = within(canvasElement);
|
|
154
|
-
await expect(await canvas.findByRole('radio')).toBeDisabled();
|
|
155
|
-
},
|
|
156
|
-
};
|
|
157
|
-
export const OutOfStockColorSwatch = {
|
|
158
|
-
args: {
|
|
159
|
-
name: 'colorSwatchField',
|
|
160
|
-
id: 'graySwatch',
|
|
161
|
-
label: 'gray',
|
|
162
|
-
groupAriaLabel: 'Color Swatch',
|
|
163
|
-
value: 'gray',
|
|
164
|
-
size: 'medium',
|
|
165
|
-
color: '#E8E8E8',
|
|
166
|
-
selected: false,
|
|
167
|
-
disabled: false,
|
|
168
|
-
outOfStock: true,
|
|
169
|
-
onValue: action('onValue'),
|
|
170
|
-
},
|
|
171
|
-
};
|
|
172
|
-
export const SelectedOutOfStockColorSwatch = {
|
|
173
|
-
args: {
|
|
174
|
-
name: 'colorSwatch_Field',
|
|
175
|
-
id: 'graySwatch',
|
|
176
|
-
value: 'gray',
|
|
177
|
-
label: 'gray',
|
|
178
|
-
groupAriaLabel: 'Color Swatch',
|
|
179
|
-
size: 'medium',
|
|
180
|
-
color: '#E8E8E8',
|
|
181
|
-
selected: true,
|
|
182
|
-
disabled: false,
|
|
183
|
-
outOfStock: true,
|
|
184
|
-
onValue: action('onValue'),
|
|
185
|
-
},
|
|
186
|
-
};
|
|
187
|
-
export const MultiColorSwatch = {
|
|
188
|
-
args: {
|
|
189
|
-
name: 'colorSwatchField',
|
|
190
|
-
id: 'graySwatch',
|
|
191
|
-
value: 'gray',
|
|
192
|
-
size: 'medium',
|
|
193
|
-
color: '#E8E8E8',
|
|
194
|
-
selected: false,
|
|
195
|
-
disabled: false,
|
|
196
|
-
outOfStock: false,
|
|
197
|
-
multi: true,
|
|
198
|
-
onValue: action('onValue'),
|
|
199
|
-
'aria-label': 'Grey Color Swatch',
|
|
200
|
-
},
|
|
201
|
-
render: (args) => (<div style="display: flex; flex-wrap:wrap; gap: 25px">
|
|
202
|
-
<ColorSwatch {...args} id={'colorSwatch1'} value={'green'} color={'green'}/>
|
|
203
|
-
<ColorSwatch {...args} id={'colorSwatch2'} value={'blue'} color={'blue'}/>
|
|
204
|
-
<ColorSwatch {...args} id={'colorSwatch3'} value={'yellow'} color={'yellow'}/>
|
|
205
|
-
</div>),
|
|
206
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSwatch.test.d.ts","sourceRoot":"","sources":["../../../src/components/ColorSwatch/ColorSwatch.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render, fireEvent, waitFor } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { ColorSwatch } from '@adobe/elsie/components/ColorSwatch';
|
|
4
|
-
describe('Base/Components/ColorSwatch', () => {
|
|
5
|
-
test('renders', () => {
|
|
6
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="Gray" value="gray" size="medium" color="#E8E8E8"/>);
|
|
7
|
-
expect(!!container).toEqual(true);
|
|
8
|
-
});
|
|
9
|
-
test('Renders the correct shape for default props', () => {
|
|
10
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="#E8E8E8"/>);
|
|
11
|
-
// Ensure the component with default properties matches the snapshot
|
|
12
|
-
const elem = container.querySelector('.dropin-color-swatch');
|
|
13
|
-
expect(elem).toMatchSnapshot();
|
|
14
|
-
});
|
|
15
|
-
test('Renders the colorSwatch in selected state', () => {
|
|
16
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="#E8E8E8" selected={true}/>);
|
|
17
|
-
// Ensure the colorSwatch is selected
|
|
18
|
-
const selected = container.querySelector('.dropin-color-swatch');
|
|
19
|
-
expect(selected.classList.contains('dropin-color-swatch--selected')).toEqual(true);
|
|
20
|
-
});
|
|
21
|
-
test('Renders the colorSwatch in disabled state', () => {
|
|
22
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="#E8E8E8" disabled={true}/>);
|
|
23
|
-
// Ensure the colorSwatch is disabled
|
|
24
|
-
const disabled = container.querySelector('.dropin-color-swatch');
|
|
25
|
-
expect(disabled.classList.contains('dropin-color-swatch--disabled')).toEqual(true);
|
|
26
|
-
});
|
|
27
|
-
test('colorSwatch default size is medium', () => {
|
|
28
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" label="gray" id="graySwatch" value="gray" color="#E8E8E8"/>);
|
|
29
|
-
// Ensure the colorSwatch is medium
|
|
30
|
-
const medium = container.querySelector('.dropin-color-swatch__container');
|
|
31
|
-
expect(medium.classList.contains('dropin-color-swatch__container--medium')).toEqual(true);
|
|
32
|
-
});
|
|
33
|
-
test('Renders the colorSwatch in large size', () => {
|
|
34
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="large" color="#E8E8E8"/>);
|
|
35
|
-
// Ensure the colorSwatch is large
|
|
36
|
-
const large = container.querySelector('.dropin-color-swatch__container');
|
|
37
|
-
expect(large.classList.contains('dropin-color-swatch__container--large')).toEqual(true);
|
|
38
|
-
});
|
|
39
|
-
test('Does not break when onValue() is not provided', () => {
|
|
40
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="#E8E8E8"/>);
|
|
41
|
-
const colorSwatch = container.querySelector('.dropin-color-swatch');
|
|
42
|
-
fireEvent.click(colorSwatch);
|
|
43
|
-
expect(!!container).toEqual(true);
|
|
44
|
-
});
|
|
45
|
-
test('Triggers onValue()', async () => {
|
|
46
|
-
const mockFn = jest.fn();
|
|
47
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="#E8E8E8" onValue={mockFn}/>);
|
|
48
|
-
const colorSwatch = container.querySelector('.dropin-color-swatch');
|
|
49
|
-
fireEvent.click(colorSwatch);
|
|
50
|
-
await waitFor(() => expect(mockFn).toHaveBeenCalledWith('gray'));
|
|
51
|
-
});
|
|
52
|
-
test('Calls onUpdateError() when onValue() throws an error', async () => {
|
|
53
|
-
const mockFn = jest.fn();
|
|
54
|
-
const mockError = new Error('onValue() error');
|
|
55
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="#E8E8E8" onValue={() => {
|
|
56
|
-
throw mockError;
|
|
57
|
-
}} onUpdateError={mockFn}/>);
|
|
58
|
-
const colorSwatch = container.querySelector('.dropin-color-swatch');
|
|
59
|
-
fireEvent.click(colorSwatch);
|
|
60
|
-
await waitFor(() => expect(mockFn).toHaveBeenCalled());
|
|
61
|
-
await waitFor(() => expect(mockFn).toHaveBeenCalledWith(mockError));
|
|
62
|
-
});
|
|
63
|
-
test('Calls onUpdateError() when onValue() returns a rejected promise', async () => {
|
|
64
|
-
const mockFn = jest.fn(() => {
|
|
65
|
-
throw new Error('Mock error!');
|
|
66
|
-
});
|
|
67
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="#E8E8E8" onValue={mockFn}/>);
|
|
68
|
-
const colorSwatch = container.querySelector('.dropin-color-swatch');
|
|
69
|
-
fireEvent.click(colorSwatch);
|
|
70
|
-
await waitFor(() => expect(mockFn).toHaveBeenCalled());
|
|
71
|
-
});
|
|
72
|
-
test('Renders default color when color prop is not valid string', () => {
|
|
73
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="not a valid color"/>);
|
|
74
|
-
const colorSwatch = container.querySelector('.dropin-color-swatch__span');
|
|
75
|
-
expect(colorSwatch.style.getPropertyValue('--bg-color')).toEqual('var(--color-gray-300);');
|
|
76
|
-
});
|
|
77
|
-
test('Renders out of stock color when outOfStock prop is true', () => {
|
|
78
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" label="gray" value="gray" size="medium" color="#E8E8E8" outOfStock={true}/>);
|
|
79
|
-
const colorSwatch = container.querySelector('.dropin-color-swatch__span');
|
|
80
|
-
expect(colorSwatch.classList.contains('dropin-color-swatch__span--out-of-stock')).toEqual(true);
|
|
81
|
-
});
|
|
82
|
-
test('Renders when multi prop is true', () => {
|
|
83
|
-
const { container } = render(<ColorSwatch name="colorSwatchField" id="graySwatch" value="gray" size="medium" color="#E8E8E8" multi={true}/>);
|
|
84
|
-
const colorSwatch = container.querySelector('.dropin-color-swatch');
|
|
85
|
-
expect(colorSwatch.type === 'checkbox').toEqual(true);
|
|
86
|
-
});
|
|
87
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ColorSwatch/index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC;AAChE,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,iDAAiD,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/Divider/Divider.css';
|
|
4
|
-
export interface DividerProps extends HTMLAttributes<HTMLHRElement> {
|
|
5
|
-
variant?: 'primary' | 'secondary';
|
|
6
|
-
}
|
|
7
|
-
export declare const Divider: FunctionComponent<DividerProps>;
|
|
8
|
-
//# sourceMappingURL=Divider.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,6CAA6C,CAAC;AAErD,MAAM,WAAW,YAAa,SAAQ,cAAc,CAAC,aAAa,CAAC;IACjE,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CACnC;AAED,eAAO,MAAM,OAAO,EAAE,iBAAiB,CAAC,YAAY,CAcnD,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { classes } from '@adobe/elsie/lib';
|
|
2
|
-
import '@adobe/elsie/components/Divider/Divider.css';
|
|
3
|
-
export const Divider = ({ variant = 'primary', className, }) => {
|
|
4
|
-
return (<hr role="separator" className={classes([
|
|
5
|
-
'dropin-divider',
|
|
6
|
-
`dropin-divider--${variant}`,
|
|
7
|
-
className,
|
|
8
|
-
])}/>);
|
|
9
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { DividerProps } from '@adobe/elsie/components/Divider';
|
|
3
|
-
/**
|
|
4
|
-
* Use Dividers to separate and group content or build rhythm and structure.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<DividerProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<DividerProps>;
|
|
9
|
-
export declare const Primary: Story;
|
|
10
|
-
export declare const Secondary: Story;
|
|
11
|
-
//# sourceMappingURL=Divider.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.stories.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAW,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAIxE;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,YAAY,CAW5B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,YAAY,CAAC,CAAC;AAEpC,eAAO,MAAM,OAAO,EAAE,KAarB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAavB,CAAC"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
import { Divider } from '@adobe/elsie/components/Divider';
|
|
2
|
-
import { within } from '@storybook/testing-library';
|
|
3
|
-
import { expect } from '@storybook/jest';
|
|
4
|
-
/**
|
|
5
|
-
* Use Dividers to separate and group content or build rhythm and structure.
|
|
6
|
-
*/
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'Components/Divider',
|
|
9
|
-
component: Divider,
|
|
10
|
-
argTypes: {
|
|
11
|
-
variant: {
|
|
12
|
-
description: 'Divider variant: `primary` or `secondary`',
|
|
13
|
-
defaultValue: { summary: 'primary' },
|
|
14
|
-
options: ['primary', 'secondary'],
|
|
15
|
-
control: { type: 'radio' },
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
export default meta;
|
|
20
|
-
export const Primary = {
|
|
21
|
-
args: {
|
|
22
|
-
variant: 'primary',
|
|
23
|
-
},
|
|
24
|
-
render: ({ variant }) => (<div style="width: 400px">
|
|
25
|
-
<Divider variant={variant}/>
|
|
26
|
-
</div>),
|
|
27
|
-
play: async ({ canvasElement }) => {
|
|
28
|
-
const canvas = within(canvasElement);
|
|
29
|
-
await expect(await canvas.findByRole('separator')).toBeVisible();
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export const Secondary = {
|
|
33
|
-
args: {
|
|
34
|
-
variant: 'secondary',
|
|
35
|
-
},
|
|
36
|
-
render: ({ variant }) => (<div style="width: 400px">
|
|
37
|
-
<Divider variant={variant}/>
|
|
38
|
-
</div>),
|
|
39
|
-
play: async ({ canvasElement }) => {
|
|
40
|
-
const canvas = within(canvasElement);
|
|
41
|
-
await expect(await canvas.findByRole('separator')).toBeVisible();
|
|
42
|
-
},
|
|
43
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Divider.test.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/Divider.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
2
|
-
import { Divider } from '@adobe/elsie/components';
|
|
3
|
-
//test rendering of divider
|
|
4
|
-
describe('Base/Divider', () => {
|
|
5
|
-
test('renders', () => {
|
|
6
|
-
const { container } = render(<Divider />);
|
|
7
|
-
const elem = container.querySelector('.dropin-divider');
|
|
8
|
-
expect(elem.classList.contains('dropin-divider')).toEqual(true);
|
|
9
|
-
});
|
|
10
|
-
//test rendering of divider with variant
|
|
11
|
-
test('renders with variant', () => {
|
|
12
|
-
const { container } = render(<Divider variant="primary"/>);
|
|
13
|
-
const elem = container.querySelector('.dropin-divider');
|
|
14
|
-
expect(elem.classList.contains('dropin-divider--primary')).toEqual(true);
|
|
15
|
-
const { container: container2 } = render(<Divider variant="secondary"/>);
|
|
16
|
-
const elem2 = container2.querySelector('.dropin-divider');
|
|
17
|
-
expect(elem2.classList.contains('dropin-divider--secondary')).toEqual(true);
|
|
18
|
-
});
|
|
19
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Divider/index.ts"],"names":[],"mappings":"AAAA,cAAc,yCAAyC,CAAC;AACxD,OAAO,EAAE,OAAO,IAAI,OAAO,EAAE,MAAM,yCAAyC,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import '@adobe/elsie/components/Field/Field.css';
|
|
2
|
-
import { FunctionComponent, VNode } from 'preact';
|
|
3
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
4
|
-
export interface FieldProps extends Omit<HTMLAttributes<HTMLDivElement>, 'size'> {
|
|
5
|
-
label?: string;
|
|
6
|
-
error?: string;
|
|
7
|
-
hint?: string;
|
|
8
|
-
success?: string;
|
|
9
|
-
disabled?: boolean;
|
|
10
|
-
children?: VNode;
|
|
11
|
-
size?: 'medium' | 'large';
|
|
12
|
-
}
|
|
13
|
-
export declare const Field: FunctionComponent<FieldProps>;
|
|
14
|
-
//# sourceMappingURL=Field.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.tsx"],"names":[],"mappings":"AAAA,OAAO,yCAAyC,CAAC;AAEjD,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,cAAc,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAC;IACjB,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;CAC3B;AAED,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CA0D/C,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import '@adobe/elsie/components/Field/Field.css';
|
|
2
|
-
import { classes } from '@adobe/elsie/lib';
|
|
3
|
-
export const Field = ({ className, label, error, hint, success, size = 'medium', disabled = false, children, ...props }) => {
|
|
4
|
-
const id = children?.props?.id ?? `dropin-field-${Math.random().toString(36)}`;
|
|
5
|
-
const ChildComponent = children && typeof children.type !== 'string' ? children.type : null;
|
|
6
|
-
return (<div {...props} className={classes(['dropin-field', className])}>
|
|
7
|
-
{label && (<label className={classes([
|
|
8
|
-
'dropin-field__label',
|
|
9
|
-
['dropin-field__label--disabled', disabled],
|
|
10
|
-
`dropin-field__label--${size}`,
|
|
11
|
-
])} htmlFor={id}>
|
|
12
|
-
{label}
|
|
13
|
-
</label>)}
|
|
14
|
-
|
|
15
|
-
<div className={classes(['dropin-field__content'])}>
|
|
16
|
-
{ChildComponent && children && (<ChildComponent {...children.props} id={id} key={children.key} disabled={disabled} size={size} error={!!error} success={!!success && !error}/>)}
|
|
17
|
-
</div>
|
|
18
|
-
|
|
19
|
-
<div className={classes([
|
|
20
|
-
'dropin-field__hint',
|
|
21
|
-
[`dropin-field__hint--${size}`, size],
|
|
22
|
-
['dropin-field__hint--error', !!error],
|
|
23
|
-
['dropin-field__hint--success', !!success && !error],
|
|
24
|
-
['dropin-field__hint--disabled', !!disabled],
|
|
25
|
-
])}>
|
|
26
|
-
{error || success || hint}
|
|
27
|
-
</div>
|
|
28
|
-
</div>);
|
|
29
|
-
};
|
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { FieldProps } from '@adobe/elsie/components';
|
|
3
|
-
/**
|
|
4
|
-
* Use Field Labels to wrap form inputs with titles and help text.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<FieldProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<FieldProps>;
|
|
9
|
-
/**
|
|
10
|
-
* ```ts
|
|
11
|
-
* import { Field } from '@adobe/elsie/components/Field';
|
|
12
|
-
* import { Input } from '@adobe/elsie/components/Input';
|
|
13
|
-
* ```
|
|
14
|
-
*/
|
|
15
|
-
export declare const InputField: Story;
|
|
16
|
-
/**
|
|
17
|
-
* ```ts
|
|
18
|
-
* import { Field } from '@adobe/elsie/components/Field';
|
|
19
|
-
* import { Incrementer } from '@adobe/elsie/components/Incrementer';
|
|
20
|
-
* ```
|
|
21
|
-
*/
|
|
22
|
-
export declare const IncrementerField: Story;
|
|
23
|
-
/**
|
|
24
|
-
* ```ts
|
|
25
|
-
* import { Field } from '@adobe/elsie/components/Field';
|
|
26
|
-
* import { Picker } from '@adobe/elsie/components/Picker';
|
|
27
|
-
* ```
|
|
28
|
-
*/
|
|
29
|
-
export declare const PickerField: Story;
|
|
30
|
-
export declare const CheckboxField: Story;
|
|
31
|
-
/**
|
|
32
|
-
* ```ts
|
|
33
|
-
* import { Field } from '@adobe/elsie/components/Field';
|
|
34
|
-
* import { TextSwatch } from '@adobe/elsie/components/TextSwatch';
|
|
35
|
-
* ```
|
|
36
|
-
*/
|
|
37
|
-
//# sourceMappingURL=Field.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Field.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Field/Field.stories.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,UAAU,EAKX,MAAM,yBAAyB,CAAC;AAIjC;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAoC1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC;;;;;GAKG;AACH,eAAO,MAAM,UAAU,EAAE,KAqBxB,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,EAAE,KAmD9B,CAAC;AAEF;;;;;GAKG;AACH,eAAO,MAAM,WAAW,EAAE,KAiDzB,CAAC;AAEF,eAAO,MAAM,aAAa,EAAE,KAkB3B,CAAC;AAEF;;;;;GAKG"}
|