@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,77 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { InLineAlert, } from '@adobe/elsie/components/InLineAlert';
|
|
4
|
-
// mock icons
|
|
5
|
-
jest.mock('@adobe/elsie/icons', () => ({
|
|
6
|
-
CheckWithCircle: jest.fn(({ className }) => (<svg className={className} id="CheckWithCircle"/>)),
|
|
7
|
-
Close: jest.fn(({ className }) => <svg className={className} id="Close"/>),
|
|
8
|
-
WarningFilled: jest.fn(({ className }) => (<svg className={className} id="WarningFilled"/>)),
|
|
9
|
-
}));
|
|
10
|
-
describe('Base/Components/InLineAlert', () => {
|
|
11
|
-
const defaultProps = {
|
|
12
|
-
heading: 'InLineAlert heading',
|
|
13
|
-
description: 'InLineAlert description',
|
|
14
|
-
type: 'error',
|
|
15
|
-
icon: <div>icon</div>,
|
|
16
|
-
onDismiss: jest.fn(),
|
|
17
|
-
};
|
|
18
|
-
test('renders', () => {
|
|
19
|
-
const { container } = render(<InLineAlert {...defaultProps}/>);
|
|
20
|
-
const element = container.querySelector('.dropin-in-line-alert');
|
|
21
|
-
expect(!!container).toEqual(true);
|
|
22
|
-
expect(container).toMatchSnapshot();
|
|
23
|
-
expect(element).not.toBeNull();
|
|
24
|
-
const icon = container.querySelector('.dropin-in-line-alert__icon');
|
|
25
|
-
expect(icon).not.toBeNull();
|
|
26
|
-
});
|
|
27
|
-
test('renders warning variant if no variant is provided', () => {
|
|
28
|
-
const { container } = render(<InLineAlert {...defaultProps} type={undefined}/>);
|
|
29
|
-
const element = container.querySelector('.dropin-in-line-alert--warning');
|
|
30
|
-
const icon = container.querySelector('.dropin-in-line-alert__icon');
|
|
31
|
-
expect(!!container).toEqual(true);
|
|
32
|
-
expect(element).not.toBeNull();
|
|
33
|
-
expect(icon).not.toBeNull();
|
|
34
|
-
});
|
|
35
|
-
test('renders additional action', () => {
|
|
36
|
-
const additionalAction = {
|
|
37
|
-
label: 'Additional action',
|
|
38
|
-
onClick: jest.fn(),
|
|
39
|
-
};
|
|
40
|
-
const { container } = render(<InLineAlert {...defaultProps} additionalActions={[additionalAction]}/>);
|
|
41
|
-
const element = container.querySelector('.dropin-in-line-alert__additional-action');
|
|
42
|
-
expect(!!container).toEqual(true);
|
|
43
|
-
expect(element).not.toBeNull();
|
|
44
|
-
element.click();
|
|
45
|
-
expect(additionalAction.onClick).toHaveBeenCalled();
|
|
46
|
-
});
|
|
47
|
-
test('renders multiple additional actions', () => {
|
|
48
|
-
const additionalActions = [
|
|
49
|
-
{
|
|
50
|
-
label: 'Additional action 1',
|
|
51
|
-
onClick: jest.fn(),
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
label: 'Additional action 2',
|
|
55
|
-
onClick: jest.fn(),
|
|
56
|
-
},
|
|
57
|
-
];
|
|
58
|
-
const { container } = render(<InLineAlert {...defaultProps} additionalActions={additionalActions}/>);
|
|
59
|
-
const elements = container.querySelectorAll('.dropin-in-line-alert__additional-action'
|
|
60
|
-
// eslint-disable-next-line
|
|
61
|
-
);
|
|
62
|
-
expect(!!container).toEqual(true);
|
|
63
|
-
expect(elements.length).toEqual(2);
|
|
64
|
-
elements.forEach((element, index) => {
|
|
65
|
-
element.click();
|
|
66
|
-
expect(additionalActions[index].onClick).toHaveBeenCalled();
|
|
67
|
-
});
|
|
68
|
-
});
|
|
69
|
-
describe('Interactions:', () => {
|
|
70
|
-
test('calls onDismiss when dismiss button is clicked', () => {
|
|
71
|
-
const { container } = render(<InLineAlert {...defaultProps}/>);
|
|
72
|
-
const dismissButton = container.querySelector('.dropin-in-line-alert__dismiss-button');
|
|
73
|
-
dismissButton.click();
|
|
74
|
-
expect(defaultProps.onDismiss).toHaveBeenCalled();
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/InLineAlert/index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC;AAChE,OAAO,EAAE,WAAW,IAAI,OAAO,EAAE,MAAM,iDAAiD,CAAC"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/Incrementer/Incrementer.css';
|
|
4
|
-
export interface IncrementerProps extends Omit<HTMLAttributes<HTMLInputElement>, 'size'> {
|
|
5
|
-
name?: string;
|
|
6
|
-
size?: 'medium' | 'large';
|
|
7
|
-
onValue?: (value: any) => void;
|
|
8
|
-
onUpdateError?: (error: Error) => void;
|
|
9
|
-
error?: boolean;
|
|
10
|
-
success?: boolean;
|
|
11
|
-
min?: number;
|
|
12
|
-
max?: number;
|
|
13
|
-
disabled?: boolean;
|
|
14
|
-
maxLength?: number;
|
|
15
|
-
}
|
|
16
|
-
export declare const Incrementer: FunctionComponent<IncrementerProps>;
|
|
17
|
-
//# sourceMappingURL=Incrementer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Incrementer.d.ts","sourceRoot":"","sources":["../../../src/components/Incrementer/Incrementer.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAE3C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAK/C,OAAO,qDAAqD,CAAC;AAE7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACtD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAkJ3D,CAAC"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { useState, useEffect, useCallback } from 'preact/hooks';
|
|
2
|
-
import { classes, debounce } from '@adobe/elsie/lib';
|
|
3
|
-
import { Add, Minus } from '@adobe/elsie/icons';
|
|
4
|
-
import { Icon } from '@adobe/elsie/components/Icon';
|
|
5
|
-
import { Localizer, Text } from '@adobe/elsie/i18n';
|
|
6
|
-
import '@adobe/elsie/components/Incrementer/Incrementer.css';
|
|
7
|
-
export const Incrementer = ({ name, value = '1', className, disabled, error, success, min, max, onValue, onUpdateError, size = 'medium', ...props }) => {
|
|
8
|
-
const [currentValue, setCurrentValue] = useState(Number(value));
|
|
9
|
-
const minValue = Number(min);
|
|
10
|
-
const maxValue = Number(max);
|
|
11
|
-
useEffect(() => {
|
|
12
|
-
setCurrentValue(Number(value));
|
|
13
|
-
}, [value]);
|
|
14
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
15
|
-
const debouncedOnValueHandler = useCallback(debounce(async (newValue) => {
|
|
16
|
-
if (onValue) {
|
|
17
|
-
try {
|
|
18
|
-
await onValue(newValue);
|
|
19
|
-
}
|
|
20
|
-
catch (e) {
|
|
21
|
-
if (onUpdateError) {
|
|
22
|
-
onUpdateError(e);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}, 200), [onValue, onUpdateError]);
|
|
27
|
-
const handleIncrementer = (_value) => {
|
|
28
|
-
let newValue = _value;
|
|
29
|
-
if (_value < minValue)
|
|
30
|
-
newValue = minValue;
|
|
31
|
-
if (_value > maxValue)
|
|
32
|
-
newValue = maxValue;
|
|
33
|
-
debouncedOnValueHandler(newValue);
|
|
34
|
-
setCurrentValue(newValue);
|
|
35
|
-
};
|
|
36
|
-
return (<div className={classes([
|
|
37
|
-
'dropin-incrementer',
|
|
38
|
-
`dropin-incrementer--${size}`,
|
|
39
|
-
className,
|
|
40
|
-
])}>
|
|
41
|
-
<div className={classes([
|
|
42
|
-
'dropin-incrementer__content',
|
|
43
|
-
`dropin-incrementer__content--${size}`,
|
|
44
|
-
[`dropin-incrementer__content--error`, error],
|
|
45
|
-
[`dropin-incrementer__content--success`, success],
|
|
46
|
-
[`dropin-incrementer__content--disabled`, disabled],
|
|
47
|
-
])}>
|
|
48
|
-
{/* Minus Button */}
|
|
49
|
-
<div className={classes([
|
|
50
|
-
'dropin-incrementer__button-container',
|
|
51
|
-
[`dropin-incrementer__button-container--disabled`, disabled],
|
|
52
|
-
])}>
|
|
53
|
-
<Localizer>
|
|
54
|
-
<button type="button" className={classes([
|
|
55
|
-
'dropin-incrementer__decrease-button',
|
|
56
|
-
[`dropin-incrementer__decrease-button--disabled`, disabled],
|
|
57
|
-
])} onClick={() => handleIncrementer(currentValue - 1)} disabled={disabled || currentValue < minValue + 1} aria-label={(<Text id="Dropin.Incrementer.decreaseLabel"/>)}>
|
|
58
|
-
<Icon source={Minus} size="16" stroke="1" viewBox="4 2 20 20" className="dropin-incrementer__down"/>
|
|
59
|
-
</button>
|
|
60
|
-
</Localizer>
|
|
61
|
-
</div>
|
|
62
|
-
|
|
63
|
-
{/* Input Field */}
|
|
64
|
-
<input className="dropin-incrementer__input" max={max} min={min} step={1} type="number" name={name} value={currentValue} disabled={disabled} onChange={(e) => {
|
|
65
|
-
const newValue = e.currentTarget.value;
|
|
66
|
-
if (newValue !== '') {
|
|
67
|
-
handleIncrementer(Number(newValue));
|
|
68
|
-
}
|
|
69
|
-
}} {...props}/>
|
|
70
|
-
|
|
71
|
-
<div className={classes([
|
|
72
|
-
'dropin-incrementer__button-container',
|
|
73
|
-
[`dropin-incrementer__button-container--disabled`, disabled],
|
|
74
|
-
])}>
|
|
75
|
-
{/* Plus/Add button */}
|
|
76
|
-
<Localizer>
|
|
77
|
-
<button type="button" className={classes([
|
|
78
|
-
'dropin-incrementer__increase-button',
|
|
79
|
-
[`dropin-incrementer__increase-button--disabled`, disabled],
|
|
80
|
-
])} onClick={() => handleIncrementer(currentValue + 1)} disabled={disabled || currentValue > maxValue - 1} aria-label={(<Text id="Dropin.Incrementer.increaseLabel"/>)}>
|
|
81
|
-
<Icon source={Add} size="16" stroke="1" viewBox="4 2 20 20" className="dropin-incrementer__add"/>
|
|
82
|
-
</button>
|
|
83
|
-
</Localizer>
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
</div>);
|
|
87
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { IncrementerProps } from '@adobe/elsie/components/Incrementer';
|
|
3
|
-
/**
|
|
4
|
-
* Use Incrementers to let users increase or decrease a value.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<IncrementerProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<IncrementerProps>;
|
|
9
|
-
export declare const Primary: Story;
|
|
10
|
-
//# sourceMappingURL=Incrementer.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Incrementer.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Incrementer/Incrementer.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,gBAAgB,EACjB,MAAM,qCAAqC,CAAC;AAK7C;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,gBAAgB,CAuBhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAExC,eAAO,MAAM,OAAO,EAAE,KAgDrB,CAAC"}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
import { Incrementer, } from '@adobe/elsie/components/Incrementer';
|
|
2
|
-
import { action } from '@storybook/addon-actions';
|
|
3
|
-
import { userEvent, within } from '@storybook/testing-library';
|
|
4
|
-
import { expect } from '@storybook/jest';
|
|
5
|
-
/**
|
|
6
|
-
* Use Incrementers to let users increase or decrease a value.
|
|
7
|
-
*/
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Components/Incrementer',
|
|
10
|
-
component: Incrementer,
|
|
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
|
-
value: {
|
|
20
|
-
description: 'Field value',
|
|
21
|
-
type: 'string',
|
|
22
|
-
},
|
|
23
|
-
size: {
|
|
24
|
-
description: 'medium | large',
|
|
25
|
-
defaultValue: { summary: 'medium' },
|
|
26
|
-
options: ['medium', 'large'],
|
|
27
|
-
control: { type: 'radio' },
|
|
28
|
-
type: 'string',
|
|
29
|
-
},
|
|
30
|
-
},
|
|
31
|
-
};
|
|
32
|
-
export default meta;
|
|
33
|
-
export const Primary = {
|
|
34
|
-
args: {
|
|
35
|
-
size: 'medium',
|
|
36
|
-
onValue: action('onValue'),
|
|
37
|
-
name: 'incrementerField',
|
|
38
|
-
value: '0',
|
|
39
|
-
min: 0,
|
|
40
|
-
max: 100,
|
|
41
|
-
disabled: false,
|
|
42
|
-
'aria-label': 'Quantity',
|
|
43
|
-
},
|
|
44
|
-
play: async () => {
|
|
45
|
-
const canvasElement = document.querySelector('#storybook-root');
|
|
46
|
-
const canvas = within(canvasElement);
|
|
47
|
-
const decreaseButton = document.querySelector('button[aria-label="Decrease Quantity"]');
|
|
48
|
-
const inputField = document.querySelector('input');
|
|
49
|
-
const increaseButton = document.querySelector('button[aria-label="Increase Quantity"]');
|
|
50
|
-
// Without this wait test failing intermittently as click event is triggerning before even element fully loaded
|
|
51
|
-
await new Promise((resolve) => setTimeout(resolve, 500));
|
|
52
|
-
await userEvent.click(increaseButton);
|
|
53
|
-
await expect(await canvas.findByDisplayValue('1')).toBeTruthy();
|
|
54
|
-
await userEvent.click(decreaseButton);
|
|
55
|
-
await expect(await canvas.findByDisplayValue('0')).toBeTruthy();
|
|
56
|
-
await userEvent.type(inputField, '99');
|
|
57
|
-
await expect(await canvas.findByDisplayValue('99')).toBeTruthy();
|
|
58
|
-
await userEvent.click(increaseButton);
|
|
59
|
-
await expect(await canvas.findByDisplayValue('100')).toBeTruthy();
|
|
60
|
-
await userEvent.click(increaseButton);
|
|
61
|
-
await expect(await canvas.findByDisplayValue('100')).toBeTruthy();
|
|
62
|
-
await userEvent.click(decreaseButton);
|
|
63
|
-
await expect(await canvas.findByDisplayValue('99')).toBeTruthy();
|
|
64
|
-
await userEvent.clear(inputField);
|
|
65
|
-
await userEvent.type(inputField, '0');
|
|
66
|
-
await expect(await canvas.findByDisplayValue('0')).toBeTruthy();
|
|
67
|
-
},
|
|
68
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Incrementer.test.d.ts","sourceRoot":"","sources":["../../../src/components/Incrementer/Incrementer.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render, fireEvent } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { Incrementer, } from '@adobe/elsie/components/Incrementer';
|
|
4
|
-
jest.useFakeTimers();
|
|
5
|
-
describe('Base/Components/Incrementer', () => {
|
|
6
|
-
const DEFAULT_PROPS = {
|
|
7
|
-
name: 'testIncrementer',
|
|
8
|
-
};
|
|
9
|
-
test('renders', () => {
|
|
10
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS}/>);
|
|
11
|
-
const elem = container.querySelector('.dropin-incrementer');
|
|
12
|
-
expect(!!elem).toEqual(true);
|
|
13
|
-
});
|
|
14
|
-
test('triggers onChange with empty value()', () => {
|
|
15
|
-
const mockFn = jest.fn();
|
|
16
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS} onValue={mockFn}/>);
|
|
17
|
-
const field = container.querySelector('.dropin-incrementer__input');
|
|
18
|
-
fireEvent.input(field, {
|
|
19
|
-
target: { value: '' },
|
|
20
|
-
});
|
|
21
|
-
jest.runAllTimers();
|
|
22
|
-
expect(mockFn).toHaveBeenCalledTimes(0);
|
|
23
|
-
});
|
|
24
|
-
test('renders the correct shape', () => {
|
|
25
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS} aria-label="Item Quantity"/>);
|
|
26
|
-
const elem = container.querySelector('.dropin-incrementer');
|
|
27
|
-
expect(elem).toMatchSnapshot();
|
|
28
|
-
});
|
|
29
|
-
test('only allow value changes between min and max range.', () => {
|
|
30
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS} value="0" min={1} max={2}/>);
|
|
31
|
-
const input = container.querySelector('.dropin-incrementer__input');
|
|
32
|
-
const increase = container.querySelector('.dropin-incrementer__increase-button');
|
|
33
|
-
const decrease = container.querySelector('.dropin-incrementer__decrease-button');
|
|
34
|
-
jest.runAllTimers();
|
|
35
|
-
// Increase
|
|
36
|
-
fireEvent.click(increase); // 1
|
|
37
|
-
expect(input.value).toEqual('1');
|
|
38
|
-
fireEvent.click(increase); // 2 (reached max limit)
|
|
39
|
-
expect(input.value).toEqual('2');
|
|
40
|
-
expect(increase.disabled).toEqual(true);
|
|
41
|
-
// Decrease
|
|
42
|
-
fireEvent.click(decrease); // 1
|
|
43
|
-
expect(input.value).toEqual('1');
|
|
44
|
-
fireEvent.click(decrease); // 1 (reached min limit)
|
|
45
|
-
expect(input.value).toEqual('1');
|
|
46
|
-
expect(decrease.disabled).toEqual(true);
|
|
47
|
-
});
|
|
48
|
-
test('if value is greater than maxValue test.', () => {
|
|
49
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS} value="4" min={0} max={5}/>);
|
|
50
|
-
const input = container.querySelector('.dropin-incrementer__input');
|
|
51
|
-
const increase = container.querySelector('.dropin-incrementer__increase-button');
|
|
52
|
-
jest.runAllTimers();
|
|
53
|
-
// Increase
|
|
54
|
-
fireEvent.click(increase); // 1
|
|
55
|
-
expect(input.value).toEqual('5');
|
|
56
|
-
fireEvent.click(increase); // 2 (reached max limit)
|
|
57
|
-
expect(input.value).toEqual('5');
|
|
58
|
-
expect(increase.disabled).toEqual(true);
|
|
59
|
-
});
|
|
60
|
-
test('handles input update error with error handler given', () => {
|
|
61
|
-
const mockFn = jest.fn(() => {
|
|
62
|
-
throw new Error('Mock error!');
|
|
63
|
-
});
|
|
64
|
-
const mockErrorHandler = jest.fn();
|
|
65
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS} onValue={mockFn} onUpdateError={mockErrorHandler}/>);
|
|
66
|
-
const field = container.querySelector('.dropin-incrementer__input');
|
|
67
|
-
fireEvent.input(field, { target: { value: '1' } });
|
|
68
|
-
jest.runAllTimers();
|
|
69
|
-
expect(field.value).toEqual('1');
|
|
70
|
-
expect(mockErrorHandler).toHaveBeenCalledTimes(1);
|
|
71
|
-
expect(mockErrorHandler.mock.calls[0][0]).toMatchInlineSnapshot(`[Error: Mock error!]`);
|
|
72
|
-
});
|
|
73
|
-
test('handles quantity update error with no error handler given', () => {
|
|
74
|
-
const mockFn = jest.fn(() => {
|
|
75
|
-
throw new Error('Mock error!');
|
|
76
|
-
});
|
|
77
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS} value="3" onValue={mockFn}/>);
|
|
78
|
-
const field = container.querySelector('.dropin-incrementer__input');
|
|
79
|
-
fireEvent.input(field, { target: { value: '2' } });
|
|
80
|
-
expect(mockFn).not.toHaveBeenCalled();
|
|
81
|
-
jest.runAllTimers();
|
|
82
|
-
expect(mockFn).toHaveBeenCalledTimes(1);
|
|
83
|
-
expect(field.value).toEqual('2');
|
|
84
|
-
});
|
|
85
|
-
test('throws error when handleIncrementer() is called with an error', () => {
|
|
86
|
-
const mockFn = jest.fn(() => {
|
|
87
|
-
throw new Error('Mock error!');
|
|
88
|
-
});
|
|
89
|
-
const mockErrorHandler = jest.fn();
|
|
90
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS} onValue={mockFn} onUpdateError={mockErrorHandler}/>);
|
|
91
|
-
const field = container.querySelector('.dropin-incrementer__input');
|
|
92
|
-
fireEvent.input(field, { target: { value: 1 } });
|
|
93
|
-
expect(mockFn).not.toHaveBeenCalled();
|
|
94
|
-
expect(mockFn).toThrow('Mock error!');
|
|
95
|
-
jest.runAllTimers();
|
|
96
|
-
expect(mockFn).toHaveBeenCalledTimes(2);
|
|
97
|
-
});
|
|
98
|
-
test('reach the max value range', () => {
|
|
99
|
-
const { container } = render(<Incrementer {...DEFAULT_PROPS} value="0" min={1} max={2}/>);
|
|
100
|
-
const input = container.querySelector('.dropin-incrementer__input');
|
|
101
|
-
const decrease = container.querySelector('.dropin-incrementer__decrease-button');
|
|
102
|
-
jest.runAllTimers();
|
|
103
|
-
// Decrease
|
|
104
|
-
fireEvent.click(decrease); // 1
|
|
105
|
-
expect(input.value).toEqual('1');
|
|
106
|
-
fireEvent.click(decrease); // 1 (reached min limit)
|
|
107
|
-
expect(input.value).toEqual('1');
|
|
108
|
-
expect(decrease.disabled).toEqual(true);
|
|
109
|
-
fireEvent.change(input, { target: { value: '0' } });
|
|
110
|
-
expect(input.value).toEqual('0');
|
|
111
|
-
});
|
|
112
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Incrementer/index.ts"],"names":[],"mappings":"AAAA,cAAc,iDAAiD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@adobe/elsie/components/Incrementer/Incrementer';
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import '@adobe/elsie/components/Input/Input.css';
|
|
2
|
-
import { FunctionComponent, VNode } from 'preact';
|
|
3
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
4
|
-
export interface InputProps extends Omit<HTMLAttributes<HTMLInputElement>, 'size' | 'icon'> {
|
|
5
|
-
id?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
variant?: 'primary' | 'secondary';
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
error?: boolean;
|
|
10
|
-
floatingLabel?: string;
|
|
11
|
-
onUpdateError?: (error: Error) => void;
|
|
12
|
-
onValue?: (value: any) => void;
|
|
13
|
-
size?: 'medium' | 'large';
|
|
14
|
-
success?: boolean;
|
|
15
|
-
icon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
16
|
-
maxLength?: number;
|
|
17
|
-
}
|
|
18
|
-
export declare const Input: FunctionComponent<InputProps>;
|
|
19
|
-
//# sourceMappingURL=Input.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.tsx"],"names":[],"mappings":"AACA,OAAO,yCAAyC,CAAC;AAGjD,OAAO,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AAClD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAG/C,MAAM,WAAW,UACf,SAAQ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IACvC,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,CAAC;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CAoI/C,CAAC"}
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { Icon } from '@adobe/elsie/components/Icon';
|
|
2
|
-
import '@adobe/elsie/components/Input/Input.css';
|
|
3
|
-
import { CheckWithCircle, WarningWithCircle } from '@adobe/elsie/icons';
|
|
4
|
-
import { VComponent, classes, debounce } from '@adobe/elsie/lib';
|
|
5
|
-
import { useCallback } from 'preact/hooks';
|
|
6
|
-
export const Input = ({ name, value, variant = 'primary', className, disabled, error, floatingLabel, onValue, onUpdateError, size = 'medium', icon, maxLength, success, ...props }) => {
|
|
7
|
-
const id = props?.id || name || `dropin-input-${Math.random().toString(36)}`;
|
|
8
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
9
|
-
const debouncedOnValueHandler = useCallback(debounce(async (newValue) => {
|
|
10
|
-
if (onValue) {
|
|
11
|
-
try {
|
|
12
|
-
await onValue(newValue);
|
|
13
|
-
}
|
|
14
|
-
catch (e) {
|
|
15
|
-
if (onUpdateError) {
|
|
16
|
-
onUpdateError(e);
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}, 200), [onValue, onUpdateError]);
|
|
21
|
-
const handleOnValue = (e) => {
|
|
22
|
-
const input = e.target;
|
|
23
|
-
debouncedOnValueHandler(input.value.trim());
|
|
24
|
-
};
|
|
25
|
-
return (<div className={classes([
|
|
26
|
-
'dropin-input-container',
|
|
27
|
-
`dropin-input-container--${variant}`,
|
|
28
|
-
[`dropin-input-container--floating`, !!floatingLabel],
|
|
29
|
-
['dropin-input-container--disabled', disabled],
|
|
30
|
-
])}>
|
|
31
|
-
{icon && (<VComponent node={icon} className={classes([
|
|
32
|
-
'dropin-input__field-icon--left',
|
|
33
|
-
icon.props.className,
|
|
34
|
-
])}/>)}
|
|
35
|
-
<div className="dropin-input-label-container">
|
|
36
|
-
{/* Input */}
|
|
37
|
-
<input id={id} onChange={handleOnValue} type="text" maxLength={maxLength} name={name} value={value} {...props} className={classes([
|
|
38
|
-
'dropin-input',
|
|
39
|
-
`dropin-input--${size}`,
|
|
40
|
-
`dropin-input--${variant}`,
|
|
41
|
-
[`dropin-input--error`, !!error],
|
|
42
|
-
[`dropin-input--success`, !!success],
|
|
43
|
-
['dropin-input--disabled', disabled],
|
|
44
|
-
[`dropin-input--floating`, !!floatingLabel],
|
|
45
|
-
[`dropin-input--icon-left`, !!icon],
|
|
46
|
-
className,
|
|
47
|
-
])} disabled={disabled}/>
|
|
48
|
-
|
|
49
|
-
{/* Floating Label */}
|
|
50
|
-
{floatingLabel && (<label htmlFor={id} className={classes([
|
|
51
|
-
[`dropin-input__label--floating`, !!floatingLabel],
|
|
52
|
-
[`dropin-input__label--floating--icon-left`, !!icon],
|
|
53
|
-
[`dropin-input__label--floating--error`, !!error],
|
|
54
|
-
])}>
|
|
55
|
-
{floatingLabel}
|
|
56
|
-
</label>)}
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
{error && (<div className={classes([
|
|
60
|
-
'dropin-input__field-icon--right',
|
|
61
|
-
'dropin-input__field-icon--error',
|
|
62
|
-
])}>
|
|
63
|
-
<Icon source={WarningWithCircle} size="16" stroke="2" className="dropin-input--warning-icon" viewBox="-1 -1 26 26"/>
|
|
64
|
-
</div>)}
|
|
65
|
-
|
|
66
|
-
{success && (<div className={classes([
|
|
67
|
-
'dropin-input__field-icon--right',
|
|
68
|
-
'dropin-input__field-icon--success',
|
|
69
|
-
])}>
|
|
70
|
-
<Icon source={CheckWithCircle} size="16" stroke="2" className="dropin-input--success-icon" viewBox="-1 -1 26 26"/>
|
|
71
|
-
</div>)}
|
|
72
|
-
</div>);
|
|
73
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { InputProps } from '@adobe/elsie/components/Input';
|
|
3
|
-
/**
|
|
4
|
-
* Use Input to let users enter and edit text.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<InputProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<InputProps>;
|
|
9
|
-
export declare const Primary: Story;
|
|
10
|
-
export declare const Secondary: Story;
|
|
11
|
-
//# sourceMappingURL=Input.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAExD,OAAO,EAAS,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAOlE;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CAuD1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAyBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAyBvB,CAAC"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { action } from '@storybook/addon-actions';
|
|
2
|
-
import { Input } from '@adobe/elsie/components/Input';
|
|
3
|
-
import { Cart } from '@adobe/elsie/icons';
|
|
4
|
-
import { Icon } from '@adobe/elsie/components/Icon';
|
|
5
|
-
import { userEvent, within } from '@storybook/testing-library';
|
|
6
|
-
import { expect } from '@storybook/jest';
|
|
7
|
-
import { IconsList } from '@adobe/elsie/components/Icon/Icon.stories.helpers';
|
|
8
|
-
/**
|
|
9
|
-
* Use Input to let users enter and edit text.
|
|
10
|
-
*/
|
|
11
|
-
const meta = {
|
|
12
|
-
title: 'Components/Input',
|
|
13
|
-
component: Input,
|
|
14
|
-
argTypes: {
|
|
15
|
-
name: {
|
|
16
|
-
description: 'Field name (used for mapping the value in a form)',
|
|
17
|
-
type: {
|
|
18
|
-
required: false,
|
|
19
|
-
name: 'string',
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
value: {
|
|
23
|
-
description: 'Field value',
|
|
24
|
-
type: 'string',
|
|
25
|
-
},
|
|
26
|
-
variant: {
|
|
27
|
-
description: 'Button variant: `primary`, or `secondary`',
|
|
28
|
-
defaultValue: { summary: 'primary' },
|
|
29
|
-
type: 'string',
|
|
30
|
-
options: ['primary', 'secondary'],
|
|
31
|
-
control: { type: 'radio' },
|
|
32
|
-
},
|
|
33
|
-
size: {
|
|
34
|
-
options: ['medium', 'large'],
|
|
35
|
-
control: { type: 'radio' },
|
|
36
|
-
},
|
|
37
|
-
placeholder: {
|
|
38
|
-
description: 'placeholder text',
|
|
39
|
-
control: 'text',
|
|
40
|
-
},
|
|
41
|
-
floatingLabel: {
|
|
42
|
-
description: 'enable floating label',
|
|
43
|
-
control: 'text',
|
|
44
|
-
},
|
|
45
|
-
disabled: {
|
|
46
|
-
description: 'disable input field',
|
|
47
|
-
control: 'boolean',
|
|
48
|
-
},
|
|
49
|
-
error: {
|
|
50
|
-
description: 'enable error handling',
|
|
51
|
-
control: 'boolean',
|
|
52
|
-
},
|
|
53
|
-
success: {
|
|
54
|
-
description: 'enable success handling',
|
|
55
|
-
control: 'boolean',
|
|
56
|
-
},
|
|
57
|
-
icon: {
|
|
58
|
-
description: 'left ornamental icon',
|
|
59
|
-
options: Object.keys(IconsList),
|
|
60
|
-
mapping: IconsList,
|
|
61
|
-
control: {
|
|
62
|
-
type: 'select',
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
},
|
|
66
|
-
};
|
|
67
|
-
export default meta;
|
|
68
|
-
export const Primary = {
|
|
69
|
-
args: {
|
|
70
|
-
name: 'inputField',
|
|
71
|
-
value: '',
|
|
72
|
-
variant: 'primary',
|
|
73
|
-
size: 'medium',
|
|
74
|
-
floatingLabel: '',
|
|
75
|
-
placeholder: 'Placeholder',
|
|
76
|
-
disabled: false,
|
|
77
|
-
error: false,
|
|
78
|
-
success: false,
|
|
79
|
-
onValue: action('onValue'),
|
|
80
|
-
maxLength: 20,
|
|
81
|
-
icon: <Icon source={Cart}/>,
|
|
82
|
-
},
|
|
83
|
-
play: async ({ canvasElement }) => {
|
|
84
|
-
const canvas = within(canvasElement);
|
|
85
|
-
const inputField = document.querySelector('input');
|
|
86
|
-
await userEvent.type(inputField, 'Storybook Test Text! input max length');
|
|
87
|
-
await expect(await canvas.findByDisplayValue('Storybook Test Text!')).toBeTruthy();
|
|
88
|
-
await userEvent.clear(inputField);
|
|
89
|
-
await expect(await canvas.findByDisplayValue('')).toBeTruthy();
|
|
90
|
-
},
|
|
91
|
-
};
|
|
92
|
-
export const Secondary = {
|
|
93
|
-
args: {
|
|
94
|
-
name: 'inputField',
|
|
95
|
-
value: 'Storybook Test Text!',
|
|
96
|
-
variant: 'secondary',
|
|
97
|
-
size: 'medium',
|
|
98
|
-
floatingLabel: '',
|
|
99
|
-
placeholder: 'Placeholder',
|
|
100
|
-
disabled: false,
|
|
101
|
-
error: false,
|
|
102
|
-
success: false,
|
|
103
|
-
onValue: action('onValue'),
|
|
104
|
-
maxLength: 20,
|
|
105
|
-
icon: <Icon source={Cart}/>,
|
|
106
|
-
},
|
|
107
|
-
play: async ({ canvasElement }) => {
|
|
108
|
-
const canvas = within(canvasElement);
|
|
109
|
-
const inputField = document.querySelector('input');
|
|
110
|
-
await userEvent.type(inputField, 'Storybook Test Text! input max length');
|
|
111
|
-
await expect(await canvas.findByDisplayValue('Storybook Test Text!')).toBeTruthy();
|
|
112
|
-
await userEvent.clear(inputField);
|
|
113
|
-
await expect(await canvas.findByDisplayValue('')).toBeTruthy();
|
|
114
|
-
},
|
|
115
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Input.test.d.ts","sourceRoot":"","sources":["../../../src/components/Input/Input.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|