@dropins/tools 0.21.2-alpha2 → 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 -61
- 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 -78
- package/lib/initializer.d.ts.map +0 -1
- package/lib/initializer.js +0 -93
- 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,11 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { CartItemSkeleton } from '@adobe/elsie/components';
|
|
4
|
-
describe('checkout/Components/CartSummary/CartItemSkeleton', () => {
|
|
5
|
-
test('renders', () => {
|
|
6
|
-
const { container } = render(<CartItemSkeleton />);
|
|
7
|
-
expect(!!container).toEqual(true);
|
|
8
|
-
const elem = container.querySelector('.dropin-cart-item-skeleton');
|
|
9
|
-
expect(elem).toMatchSnapshot();
|
|
10
|
-
});
|
|
11
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CartItem/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,cAAc,mDAAmD,CAAC;AAClE,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/CartList/CartList.css';
|
|
4
|
-
export interface CartListProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
}
|
|
6
|
-
export declare const CartList: FunctionComponent<CartListProps>;
|
|
7
|
-
//# sourceMappingURL=CartList.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CartList.d.ts","sourceRoot":"","sources":["../../../src/components/CartList/CartList.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAY,MAAM,eAAe,CAAC;AAGzD,OAAO,+CAA+C,CAAC;AAEvD,MAAM,WAAW,aAAc,SAAQ,cAAc,CAAC,cAAc,CAAC;CAAG;AAExE,eAAO,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,CAsBrD,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { Children } from 'preact/compat';
|
|
2
|
-
import { classes } from '@adobe/elsie/lib';
|
|
3
|
-
import '@adobe/elsie/components/CartList/CartList.css';
|
|
4
|
-
export const CartList = ({ className, children, ...props }) => {
|
|
5
|
-
return (<div {...props} className={classes(['dropin-cart-list', className])}>
|
|
6
|
-
<div className="dropin-cart-list__wrapper" aria-live="assertive" aria-relevant="all">
|
|
7
|
-
{Children.map(children, (child, key) => {
|
|
8
|
-
return (<div key={key} className="dropin-cart-list__item">
|
|
9
|
-
{child}
|
|
10
|
-
</div>);
|
|
11
|
-
})}
|
|
12
|
-
</div>
|
|
13
|
-
</div>);
|
|
14
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { CartListProps } from '@adobe/elsie/components';
|
|
3
|
-
/**
|
|
4
|
-
* Use CartList to display a list of product items in Cart.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<CartListProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<CartListProps>;
|
|
9
|
-
/**
|
|
10
|
-
* ```tsx
|
|
11
|
-
* <CartList>
|
|
12
|
-
* <CartItem .../>
|
|
13
|
-
* </CartList>
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare const CartList: Story;
|
|
17
|
-
//# sourceMappingURL=CartList.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CartList.stories.d.ts","sourceRoot":"","sources":["../../../src/components/CartList/CartList.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,aAAa,EAId,MAAM,yBAAyB,CAAC;AAEjC;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,aAAa,CA0B7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAErC;;;;;;GAMG;AACH,eAAO,MAAM,QAAQ,EAAE,KAItB,CAAC"}
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { CartList as component, CartItem, Image, Price, } from '@adobe/elsie/components';
|
|
2
|
-
/**
|
|
3
|
-
* Use CartList to display a list of product items in Cart.
|
|
4
|
-
*/
|
|
5
|
-
const meta = {
|
|
6
|
-
title: 'Components/CartList',
|
|
7
|
-
component,
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: 'padded', // centered | fullscreen
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
children: {
|
|
13
|
-
control: {
|
|
14
|
-
type: 'select',
|
|
15
|
-
labels: {
|
|
16
|
-
Products5: '5 Products',
|
|
17
|
-
Products3: '3 Products',
|
|
18
|
-
Products1: '1 Product',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
description: 'Items in the list.',
|
|
22
|
-
options: ['Products5', 'Products3', 'Products1'],
|
|
23
|
-
mapping: {
|
|
24
|
-
Products5: renderItems(5),
|
|
25
|
-
Products3: renderItems(3),
|
|
26
|
-
Products1: renderItems(1),
|
|
27
|
-
},
|
|
28
|
-
table: { defaultValue: { summary: 'null' } },
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export default meta;
|
|
33
|
-
/**
|
|
34
|
-
* ```tsx
|
|
35
|
-
* <CartList>
|
|
36
|
-
* <CartItem .../>
|
|
37
|
-
* </CartList>
|
|
38
|
-
* ```
|
|
39
|
-
*/
|
|
40
|
-
export const CartList = {
|
|
41
|
-
args: {
|
|
42
|
-
children: 'Products5',
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
function renderItems(count) {
|
|
46
|
-
return Array.from({ length: count }, (_, i) => i + 1).map((key) => (<CartItem key={key} image={<Image src="https://picsum.photos/132/184" width="132" height="184" alt="Some alternative text" loading="lazy"/>} title={<div>Product Name</div>} description={<div>
|
|
47
|
-
Secondary product information such as brand name, description, etc.
|
|
48
|
-
</div>} sku={<div>SKU: 59YK7</div>} quantity={1} price={<span>
|
|
49
|
-
<Price amount={53.99} style={{ fontWeight: 'inherit', color: 'inherit' }}/>
|
|
50
|
-
</span>} total={<span>
|
|
51
|
-
<Price amount={59.98} variant="strikethrough"/>{' '}
|
|
52
|
-
<Price amount={55.95} sale/>
|
|
53
|
-
</span>} configurations={{ Color: 'Blue', Size: 'L' }} onRemove={() => { }} onQuantity={() => { }} taxIncluded={true}/>));
|
|
54
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"CartList.test.d.ts","sourceRoot":"","sources":["../../../src/components/CartList/CartList.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { CartList } from '@adobe/elsie/components/CartList';
|
|
4
|
-
describe('Base/Components/CartList', () => {
|
|
5
|
-
test('renders', () => {
|
|
6
|
-
const { container } = render(<CartList>
|
|
7
|
-
<div>One</div>
|
|
8
|
-
<div>Two</div>
|
|
9
|
-
</CartList>);
|
|
10
|
-
expect(container.innerHTML).toMatchInlineSnapshot(`"<div class=\\"dropin-design\\"><div class=\\"dropin-cart-list\\"><div aria-live=\\"assertive\\" aria-relevant=\\"all\\" class=\\"dropin-cart-list__wrapper\\"><div class=\\"dropin-cart-list__item\\"><div>One</div></div><div class=\\"dropin-cart-list__item\\"><div>Two</div></div></div></div></div>"`);
|
|
11
|
-
});
|
|
12
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/CartList/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC;AAC1D,OAAO,EAAE,QAAQ,IAAI,OAAO,EAAE,MAAM,2CAA2C,CAAC"}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/Checkbox/Checkbox.css';
|
|
4
|
-
export interface CheckboxProps extends Omit<HTMLAttributes<HTMLInputElement>, 'size'> {
|
|
5
|
-
name: string;
|
|
6
|
-
size?: 'medium' | 'large';
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
error?: boolean;
|
|
9
|
-
label?: string;
|
|
10
|
-
description?: string;
|
|
11
|
-
}
|
|
12
|
-
export declare const Checkbox: FunctionComponent<CheckboxProps>;
|
|
13
|
-
//# sourceMappingURL=Checkbox.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAe,cAAc,EAAoB,MAAM,eAAe,CAAC;AAI9E,OAAO,+CAA+C,CAAC;AAEvD,MAAM,WAAW,aACf,SAAQ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,eAAO,MAAM,QAAQ,EAAE,iBAAiB,CAAC,aAAa,CA+FrD,CAAC"}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
import { useRef, useState } from 'preact/compat';
|
|
2
|
-
import { classes } from '@adobe/elsie/lib';
|
|
3
|
-
import { Check } from '@adobe/elsie/icons';
|
|
4
|
-
import { Icon } from '@adobe/elsie/components/Icon';
|
|
5
|
-
import '@adobe/elsie/components/Checkbox/Checkbox.css';
|
|
6
|
-
export const Checkbox = ({ name, value, size = 'medium', disabled = false, error = false, label = '', description = '', className, checked, ...props }) => {
|
|
7
|
-
const [isChecked, setIsChecked] = useState(checked === undefined ? false : checked);
|
|
8
|
-
const ref = useRef(null);
|
|
9
|
-
const handleCheckboxChange = (e) => {
|
|
10
|
-
props.onChange?.(e);
|
|
11
|
-
setIsChecked(e.currentTarget.checked);
|
|
12
|
-
};
|
|
13
|
-
const handleOnKeyDown = (e) => {
|
|
14
|
-
if (e.key === ' ') {
|
|
15
|
-
e.preventDefault();
|
|
16
|
-
ref?.current?.click();
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
return (<label className={classes([
|
|
20
|
-
'dropin-checkbox',
|
|
21
|
-
['dropin-checkbox--disabled', disabled],
|
|
22
|
-
])}>
|
|
23
|
-
<input ref={ref} name={name} value={value} type="checkbox" disabled={disabled} className={classes([
|
|
24
|
-
'dropin-checkbox__checkbox',
|
|
25
|
-
['dropin-checkbox__checkbox--error', error],
|
|
26
|
-
className,
|
|
27
|
-
])} {...props} onChange={handleCheckboxChange} checked={isChecked}/>
|
|
28
|
-
<span aria-checked={isChecked ? 'true' : 'false'} aria-labelledby={`${name}-label`} aria-describedby={`${name}-description`} className={classes([
|
|
29
|
-
'dropin-checkbox__box',
|
|
30
|
-
['dropin-checkbox__box--error', error],
|
|
31
|
-
['dropin-checkbox__box--disabled', disabled],
|
|
32
|
-
])} role="checkbox" tabIndex={disabled ? -1 : 0} onKeyDown={handleOnKeyDown}>
|
|
33
|
-
<Icon className={classes(['dropin-checkbox__checkmark'])} source={Check} size="16" stroke="3"/>
|
|
34
|
-
</span>
|
|
35
|
-
<div id={`${name}-label`} className={classes([
|
|
36
|
-
'dropin-checkbox__label',
|
|
37
|
-
`dropin-checkbox__label--${size}`,
|
|
38
|
-
['dropin-checkbox__label--disabled', disabled],
|
|
39
|
-
])}>
|
|
40
|
-
{label}
|
|
41
|
-
</div>
|
|
42
|
-
<div />
|
|
43
|
-
<div id={`${name}-description`} role={'note'} className={classes([
|
|
44
|
-
'dropin-checkbox__description',
|
|
45
|
-
`dropin-checkbox__description--${size}`,
|
|
46
|
-
['dropin-checkbox__description--disabled', disabled],
|
|
47
|
-
])}>
|
|
48
|
-
{description}
|
|
49
|
-
</div>
|
|
50
|
-
</label>);
|
|
51
|
-
};
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { CheckboxProps } from '@adobe/elsie/components/Checkbox';
|
|
3
|
-
/**
|
|
4
|
-
* Use Checkboxes to let users pick multiple options from a list or mark a single item as selected.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<CheckboxProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<CheckboxProps>;
|
|
9
|
-
/**
|
|
10
|
-
* Import the Checkbox component
|
|
11
|
-
*
|
|
12
|
-
* ```ts
|
|
13
|
-
* import { Checkbox } from '@adobe/elsie/components/Checkbox';
|
|
14
|
-
* ```
|
|
15
|
-
*/
|
|
16
|
-
export declare const Primary: Story;
|
|
17
|
-
export declare const CheckboxEnabledAndActive: Story;
|
|
18
|
-
export declare const CheckboxEnabledAndNotActiveWithError: Story;
|
|
19
|
-
export declare const CheckboxEnabledAndActiveWithError: Story;
|
|
20
|
-
export declare const CheckboxDisabled: Story;
|
|
21
|
-
export declare const CheckboxDisabledAndActive: Story;
|
|
22
|
-
//# sourceMappingURL=Checkbox.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAY,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAI3E;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,aAAa,CA4D7B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,CAAC;AAErC;;;;;;GAMG;AAEH,eAAO,MAAM,OAAO,EAAE,KAkBrB,CAAC;AAEF,eAAO,MAAM,wBAAwB,EAAE,KAmBtC,CAAC;AAEF,eAAO,MAAM,oCAAoC,EAAE,KAQlD,CAAC;AAEF,eAAO,MAAM,iCAAiC,EAAE,KAS/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAe9B,CAAC;AAEF,eAAO,MAAM,yBAAyB,EAAE,KAgBvC,CAAC"}
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
import { Checkbox } from '@adobe/elsie/components/Checkbox';
|
|
2
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
3
|
-
import { expect } from '@storybook/jest';
|
|
4
|
-
/**
|
|
5
|
-
* Use Checkboxes to let users pick multiple options from a list or mark a single item as selected.
|
|
6
|
-
*/
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'Components/Checkbox',
|
|
9
|
-
component: Checkbox,
|
|
10
|
-
argTypes: {
|
|
11
|
-
name: {
|
|
12
|
-
description: 'Field name (used for mapping the value in a form)',
|
|
13
|
-
type: {
|
|
14
|
-
required: false,
|
|
15
|
-
name: 'string',
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
value: {
|
|
19
|
-
description: 'Field value',
|
|
20
|
-
type: 'string',
|
|
21
|
-
},
|
|
22
|
-
label: {
|
|
23
|
-
description: 'Label to be shown beside of the checkbox',
|
|
24
|
-
type: 'string',
|
|
25
|
-
summary: 'Option',
|
|
26
|
-
},
|
|
27
|
-
description: {
|
|
28
|
-
description: 'Additional secondary description if needed',
|
|
29
|
-
type: 'string',
|
|
30
|
-
summary: 'Optional description text goes here',
|
|
31
|
-
},
|
|
32
|
-
size: {
|
|
33
|
-
description: 'Available sizes for the checkbox label and description texts',
|
|
34
|
-
type: 'string',
|
|
35
|
-
options: ['medium', 'large'],
|
|
36
|
-
defaultValue: {
|
|
37
|
-
summary: 'medium',
|
|
38
|
-
},
|
|
39
|
-
control: {
|
|
40
|
-
type: 'radio',
|
|
41
|
-
default: 'medium',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
|
-
disabled: {
|
|
45
|
-
description: 'Whether or not the checkbox is disabled',
|
|
46
|
-
type: 'boolean',
|
|
47
|
-
defaultValue: {
|
|
48
|
-
summary: false,
|
|
49
|
-
},
|
|
50
|
-
},
|
|
51
|
-
checked: {
|
|
52
|
-
description: 'Whether or not the checkbox is active',
|
|
53
|
-
type: 'boolean',
|
|
54
|
-
defaultValue: {
|
|
55
|
-
summary: false,
|
|
56
|
-
},
|
|
57
|
-
},
|
|
58
|
-
error: {
|
|
59
|
-
description: 'Whether or not the checkbox is on error status',
|
|
60
|
-
type: 'boolean',
|
|
61
|
-
defaultValue: {
|
|
62
|
-
summary: false,
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
export default meta;
|
|
68
|
-
/**
|
|
69
|
-
* Import the Checkbox component
|
|
70
|
-
*
|
|
71
|
-
* ```ts
|
|
72
|
-
* import { Checkbox } from '@adobe/elsie/components/Checkbox';
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
export const Primary = {
|
|
76
|
-
name: 'Enabled and not Active',
|
|
77
|
-
args: {
|
|
78
|
-
name: 'checkboxField',
|
|
79
|
-
label: 'Option',
|
|
80
|
-
description: 'Optional description text goes here',
|
|
81
|
-
},
|
|
82
|
-
play: async ({ canvasElement }) => {
|
|
83
|
-
const canvas = within(canvasElement);
|
|
84
|
-
const checkboxField = document.querySelector('input[name="checkboxField"]');
|
|
85
|
-
await expect(await checkboxField).not.toBeChecked();
|
|
86
|
-
await userEvent.click(canvas.getByText('Option'));
|
|
87
|
-
await expect(await checkboxField).toBeChecked();
|
|
88
|
-
await userEvent.click(checkboxField);
|
|
89
|
-
await expect(await checkboxField).not.toBeChecked();
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
export const CheckboxEnabledAndActive = {
|
|
93
|
-
name: 'Enabled and Active',
|
|
94
|
-
args: {
|
|
95
|
-
name: 'checkboxField',
|
|
96
|
-
label: 'Option',
|
|
97
|
-
description: 'Optional description text goes here',
|
|
98
|
-
checked: true,
|
|
99
|
-
},
|
|
100
|
-
play: async ({ canvasElement }) => {
|
|
101
|
-
const canvas = within(canvasElement);
|
|
102
|
-
const checkboxField = document.querySelector('input[name="checkboxField"]');
|
|
103
|
-
await expect(await checkboxField).toBeChecked();
|
|
104
|
-
await userEvent.click(canvas.getByText('Option'));
|
|
105
|
-
await expect(await checkboxField).not.toBeChecked();
|
|
106
|
-
await userEvent.click(checkboxField);
|
|
107
|
-
await expect(await checkboxField).toBeChecked();
|
|
108
|
-
},
|
|
109
|
-
};
|
|
110
|
-
export const CheckboxEnabledAndNotActiveWithError = {
|
|
111
|
-
name: 'Enabled and not Active with Error',
|
|
112
|
-
args: {
|
|
113
|
-
name: 'checkboxField',
|
|
114
|
-
label: 'Option',
|
|
115
|
-
description: 'Optional description text goes here',
|
|
116
|
-
error: true,
|
|
117
|
-
},
|
|
118
|
-
};
|
|
119
|
-
export const CheckboxEnabledAndActiveWithError = {
|
|
120
|
-
name: 'Enabled and Active with Error',
|
|
121
|
-
args: {
|
|
122
|
-
name: 'checkboxField',
|
|
123
|
-
label: 'Option',
|
|
124
|
-
description: 'Optional description text goes here',
|
|
125
|
-
checked: true,
|
|
126
|
-
error: true,
|
|
127
|
-
},
|
|
128
|
-
};
|
|
129
|
-
export const CheckboxDisabled = {
|
|
130
|
-
name: 'Disabled',
|
|
131
|
-
args: {
|
|
132
|
-
name: 'checkboxField',
|
|
133
|
-
label: 'Option',
|
|
134
|
-
description: 'Optional description text goes here',
|
|
135
|
-
disabled: true,
|
|
136
|
-
},
|
|
137
|
-
play: async () => {
|
|
138
|
-
const checkboxField = document.querySelector('input[name="checkboxField"]');
|
|
139
|
-
await expect(await checkboxField).not.toBeChecked();
|
|
140
|
-
await expect(await checkboxField).toBeDisabled();
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
export const CheckboxDisabledAndActive = {
|
|
144
|
-
name: 'Disabled and Active',
|
|
145
|
-
args: {
|
|
146
|
-
name: 'checkboxField',
|
|
147
|
-
label: 'Option',
|
|
148
|
-
description: 'Optional description text goes here',
|
|
149
|
-
disabled: true,
|
|
150
|
-
checked: true,
|
|
151
|
-
},
|
|
152
|
-
play: async () => {
|
|
153
|
-
const checkboxField = document.querySelector('input[name="checkboxField"]');
|
|
154
|
-
await expect(await checkboxField).toBeChecked();
|
|
155
|
-
await expect(await checkboxField).toBeDisabled();
|
|
156
|
-
},
|
|
157
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.test.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/Checkbox.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { fireEvent, render } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { Checkbox } from '@adobe/elsie/components/Checkbox';
|
|
4
|
-
import { getFormValues } from '@adobe/elsie/lib';
|
|
5
|
-
describe('Selection controls/Checkbox', () => {
|
|
6
|
-
const DEFAULT_PROPS = {
|
|
7
|
-
name: 'testCheckbox',
|
|
8
|
-
value: 'testValue',
|
|
9
|
-
label: 'Option',
|
|
10
|
-
description: 'Optional description text goes here',
|
|
11
|
-
};
|
|
12
|
-
test('renders', () => {
|
|
13
|
-
const { container } = render(<Checkbox name="testCheckbox"/>);
|
|
14
|
-
// Test that the component container is rendered
|
|
15
|
-
const elem = container.querySelector('.dropin-checkbox');
|
|
16
|
-
expect(elem).toBeTruthy();
|
|
17
|
-
});
|
|
18
|
-
test('Renders the correct shape for default props', () => {
|
|
19
|
-
const { container } = render(<Checkbox {...DEFAULT_PROPS}/>);
|
|
20
|
-
// Test that the component with default properties matches with the snapshot
|
|
21
|
-
const elem = container.querySelector('.dropin-checkbox');
|
|
22
|
-
expect(elem).toMatchSnapshot();
|
|
23
|
-
});
|
|
24
|
-
test('Renders the checkbox by default is enabled, not active and size medium', () => {
|
|
25
|
-
const { container } = render(<Checkbox {...DEFAULT_PROPS}/>);
|
|
26
|
-
// Test that the element checkbox is not disabled
|
|
27
|
-
const elem = container.querySelector('.dropin-checkbox');
|
|
28
|
-
expect(elem.classList.contains('dropin-checkbox--disabled')).toEqual(false);
|
|
29
|
-
// Test that the input checkbox is not checked
|
|
30
|
-
const elemUnchecked = container.querySelector('.dropin-checkbox__checkbox');
|
|
31
|
-
expect(elemUnchecked?.checked).toEqual(false);
|
|
32
|
-
// Test that the label size is medium
|
|
33
|
-
const elemTextMedium = container.querySelector('.dropin-checkbox__label');
|
|
34
|
-
expect(elemTextMedium.classList.contains('dropin-checkbox__label--medium')).toEqual(true);
|
|
35
|
-
// Test that the description size is medium
|
|
36
|
-
const elemDescriptionMedium = container.querySelector('.dropin-checkbox__description');
|
|
37
|
-
expect(elemDescriptionMedium.classList.contains('dropin-checkbox__description--medium')).toEqual(true);
|
|
38
|
-
});
|
|
39
|
-
test('Renders the correct text sizes', () => {
|
|
40
|
-
const { container, rerender } = render(<Checkbox {...DEFAULT_PROPS} size="medium"/>);
|
|
41
|
-
// Test that the label size is medium
|
|
42
|
-
const elemTextMedium = container.querySelector('.dropin-checkbox__label');
|
|
43
|
-
expect(elemTextMedium.classList.contains('dropin-checkbox__label--medium')).toEqual(true);
|
|
44
|
-
// Test that the description size is medium
|
|
45
|
-
const elemDescriptionMedium = container.querySelector('.dropin-checkbox__description');
|
|
46
|
-
expect(elemDescriptionMedium.classList.contains('dropin-checkbox__description--medium')).toEqual(true);
|
|
47
|
-
rerender(<Checkbox {...DEFAULT_PROPS} size="large"/>);
|
|
48
|
-
// Test that the label size is large
|
|
49
|
-
const elemTextLarge = container.querySelector('.dropin-checkbox__label');
|
|
50
|
-
expect(elemTextLarge.classList.contains('dropin-checkbox__label--large')).toEqual(true);
|
|
51
|
-
// Test that the description size is large
|
|
52
|
-
const elemDescriptionLarge = container.querySelector('.dropin-checkbox__description');
|
|
53
|
-
expect(elemDescriptionLarge.classList.contains('dropin-checkbox__description--large')).toEqual(true);
|
|
54
|
-
});
|
|
55
|
-
test('Renders the checkbox is disabled', () => {
|
|
56
|
-
const { container } = render(<Checkbox {...DEFAULT_PROPS} disabled={true}/>);
|
|
57
|
-
// Test that the element checkbox is disabled
|
|
58
|
-
const elem = container.querySelector('.dropin-checkbox');
|
|
59
|
-
expect(elem.classList.contains('dropin-checkbox--disabled')).toEqual(true);
|
|
60
|
-
});
|
|
61
|
-
test('Renders the checkbox is active or not', () => {
|
|
62
|
-
const { container, rerender } = render(<Checkbox {...DEFAULT_PROPS} checked={true}/>);
|
|
63
|
-
// Test that the input checkbox is checked
|
|
64
|
-
const elemChecked = container.querySelector('.dropin-checkbox__checkbox');
|
|
65
|
-
expect(elemChecked?.checked).toEqual(true);
|
|
66
|
-
rerender(<Checkbox {...DEFAULT_PROPS} checked={false}/>);
|
|
67
|
-
// Test that the input checkbox is not checked
|
|
68
|
-
const elemUnchecked = container.querySelector('.dropin-checkbox__checkbox');
|
|
69
|
-
expect(elemUnchecked?.checked).toEqual(false);
|
|
70
|
-
});
|
|
71
|
-
test('Renders the checkbox is on error', () => {
|
|
72
|
-
const { container } = render(<Checkbox {...DEFAULT_PROPS} error={true}/>);
|
|
73
|
-
// Test that the input checkbox has the error status
|
|
74
|
-
const elemCheckbox = container.querySelector('.dropin-checkbox__checkbox');
|
|
75
|
-
expect(elemCheckbox.classList.contains('dropin-checkbox__checkbox--error')).toEqual(true);
|
|
76
|
-
// Test that the element checkbox is shown with error status look and feel
|
|
77
|
-
const elemBox = container.querySelector('.dropin-checkbox__box');
|
|
78
|
-
expect(elemBox.classList.contains('dropin-checkbox__box--error')).toEqual(true);
|
|
79
|
-
});
|
|
80
|
-
test('Handles onKeyDown event', () => {
|
|
81
|
-
const { container } = render(<Checkbox {...DEFAULT_PROPS} checked={false}/>);
|
|
82
|
-
const elemBox = container.querySelector('.dropin-checkbox__box');
|
|
83
|
-
const elemChecked = container.querySelector('.dropin-checkbox__checkbox');
|
|
84
|
-
const eventKeyDownForSpaceKey = new KeyboardEvent('keydown', { key: ' ' });
|
|
85
|
-
// Test that the input checkbox is checked once it's clicked the space bar
|
|
86
|
-
// over the not active checkbox component
|
|
87
|
-
elemBox.dispatchEvent(eventKeyDownForSpaceKey);
|
|
88
|
-
expect(elemChecked?.checked).toEqual(true);
|
|
89
|
-
// Test that the input checkbox is unchecked once it's clicked again the
|
|
90
|
-
// space bar over the active checkbox component
|
|
91
|
-
elemBox.dispatchEvent(eventKeyDownForSpaceKey);
|
|
92
|
-
expect(elemChecked?.checked).toEqual(false);
|
|
93
|
-
const eventKeyDownForOtherKey = new KeyboardEvent('keydown', {
|
|
94
|
-
key: 'Return',
|
|
95
|
-
});
|
|
96
|
-
// Test that the input checkbox is still unchecked if it's clicked another key
|
|
97
|
-
// different than the space bar over the not active checkbox component; so it's
|
|
98
|
-
// status shouldn't have changed
|
|
99
|
-
elemBox.dispatchEvent(eventKeyDownForOtherKey);
|
|
100
|
-
expect(elemChecked?.checked).toEqual(false);
|
|
101
|
-
});
|
|
102
|
-
test('Calls onChange handler when changed', () => {
|
|
103
|
-
const onChangeMock = jest.fn();
|
|
104
|
-
const { container } = render(<Checkbox {...DEFAULT_PROPS} onChange={onChangeMock}/>);
|
|
105
|
-
const elem = container.querySelector('.dropin-checkbox__checkbox');
|
|
106
|
-
expect(onChangeMock).not.toHaveBeenCalled();
|
|
107
|
-
fireEvent.click(elem);
|
|
108
|
-
expect(onChangeMock).toHaveBeenCalled();
|
|
109
|
-
});
|
|
110
|
-
describe('When used inside a form', () => {
|
|
111
|
-
test('Sends the correct value on submit', () => {
|
|
112
|
-
const handleSubmit = jest.fn((e) => {
|
|
113
|
-
e.preventDefault();
|
|
114
|
-
});
|
|
115
|
-
const { container } = render(<form data-testid="testForm" onSubmit={handleSubmit}>
|
|
116
|
-
<Checkbox {...DEFAULT_PROPS}/>
|
|
117
|
-
<button type="submit">Submit</button>
|
|
118
|
-
</form>);
|
|
119
|
-
// Gets the checkbox element field
|
|
120
|
-
const field = container.querySelector('.dropin-checkbox');
|
|
121
|
-
// Clicks the checkbox
|
|
122
|
-
fireEvent.click(field);
|
|
123
|
-
// Gets the form button
|
|
124
|
-
const submitButton = container.querySelector('button[type="submit"]');
|
|
125
|
-
// Clicks the button
|
|
126
|
-
fireEvent.click(submitButton);
|
|
127
|
-
expect(handleSubmit).toHaveBeenCalled();
|
|
128
|
-
const values = getFormValues(handleSubmit.mock.calls[0][0].target);
|
|
129
|
-
expect(values).toMatchInlineSnapshot(`
|
|
130
|
-
Object {
|
|
131
|
-
"testCheckbox": "testValue",
|
|
132
|
-
}
|
|
133
|
-
`);
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Checkbox/index.ts"],"names":[],"mappings":"AAAA,cAAc,2CAA2C,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@adobe/elsie/components/Checkbox/Checkbox';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/ColorSwatch/ColorSwatch.css';
|
|
4
|
-
export interface ColorSwatchProps extends Omit<HTMLAttributes<HTMLInputElement>, 'label' | 'size'> {
|
|
5
|
-
name?: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
groupAriaLabel?: string;
|
|
8
|
-
id?: string;
|
|
9
|
-
size?: 'medium' | 'large';
|
|
10
|
-
color?: string;
|
|
11
|
-
value?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
outOfStock?: boolean;
|
|
15
|
-
multi?: boolean;
|
|
16
|
-
onValue?: (value: any) => void;
|
|
17
|
-
onUpdateError?: (error: Error) => void;
|
|
18
|
-
}
|
|
19
|
-
export declare const ColorSwatch: FunctionComponent<ColorSwatchProps>;
|
|
20
|
-
//# sourceMappingURL=ColorSwatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ColorSwatch.d.ts","sourceRoot":"","sources":["../../../src/components/ColorSwatch/ColorSwatch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAE5D,OAAO,qDAAqD,CAAC;AAG7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,CAAC;IAChE,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CA8F3D,CAAC"}
|