@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,320 +0,0 @@
|
|
|
1
|
-
import { Accordion, AccordionSection, } from '@adobe/elsie/components/Accordion';
|
|
2
|
-
import { Price, Card, Image, CartItem } from '..';
|
|
3
|
-
import { expect } from '@storybook/jest';
|
|
4
|
-
import { within, userEvent } from '@storybook/testing-library';
|
|
5
|
-
import * as Icons from '@adobe/elsie/icons';
|
|
6
|
-
const meta = {
|
|
7
|
-
title: 'Components/Accordion',
|
|
8
|
-
component: Accordion,
|
|
9
|
-
tags: ['autodocs'],
|
|
10
|
-
parameters: {
|
|
11
|
-
layout: 'centered', // centered | fullscreen
|
|
12
|
-
},
|
|
13
|
-
argTypes: {
|
|
14
|
-
actionIconPosition: {
|
|
15
|
-
description: 'Position of the action icon',
|
|
16
|
-
options: ['left', 'right'],
|
|
17
|
-
control: {
|
|
18
|
-
type: 'select',
|
|
19
|
-
},
|
|
20
|
-
defaultValue: 'left',
|
|
21
|
-
},
|
|
22
|
-
iconOpen: {
|
|
23
|
-
description: 'Icon for open button (svg)',
|
|
24
|
-
options: Object.keys(Icons),
|
|
25
|
-
mapping: Icons,
|
|
26
|
-
control: {
|
|
27
|
-
type: 'select',
|
|
28
|
-
},
|
|
29
|
-
defaultValue: 'Minus',
|
|
30
|
-
},
|
|
31
|
-
iconClose: {
|
|
32
|
-
description: 'Icon for close button (svg)',
|
|
33
|
-
options: Object.keys(Icons),
|
|
34
|
-
mapping: Icons,
|
|
35
|
-
control: {
|
|
36
|
-
type: 'select',
|
|
37
|
-
},
|
|
38
|
-
defaultValue: 'Minus',
|
|
39
|
-
},
|
|
40
|
-
iconLeft: {
|
|
41
|
-
description: 'Optional icon on left side (svg)',
|
|
42
|
-
options: Object.keys(Icons),
|
|
43
|
-
mapping: Icons,
|
|
44
|
-
control: {
|
|
45
|
-
type: 'select',
|
|
46
|
-
},
|
|
47
|
-
defaultValue: 'Minus',
|
|
48
|
-
},
|
|
49
|
-
showIconLeft: {
|
|
50
|
-
description: 'Whether or not the display the leftIcon',
|
|
51
|
-
type: 'boolean',
|
|
52
|
-
defaultValue: {
|
|
53
|
-
summary: false,
|
|
54
|
-
},
|
|
55
|
-
},
|
|
56
|
-
},
|
|
57
|
-
};
|
|
58
|
-
export default meta;
|
|
59
|
-
/**
|
|
60
|
-
* ```ts
|
|
61
|
-
* import { Accordion, AccordionSection } from '@adobe/elsie/components/Accordion';
|
|
62
|
-
*
|
|
63
|
-
* <Accordion>
|
|
64
|
-
* <AccordionSection title={"Title"}><p>Short product details should be kept to 6 lines maximum.</p></AccordionSection>
|
|
65
|
-
* </Accordion>
|
|
66
|
-
*
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
export const SingleSection = {
|
|
70
|
-
args: {
|
|
71
|
-
actionIconPosition: 'right',
|
|
72
|
-
iconOpen: Icons.Add,
|
|
73
|
-
iconClose: Icons.Minus,
|
|
74
|
-
},
|
|
75
|
-
render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
|
|
76
|
-
<h2 style={{
|
|
77
|
-
font: 'var(--type-body-1-strong-font)',
|
|
78
|
-
color: 'var(--color-neutral-800)',
|
|
79
|
-
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
80
|
-
}}>
|
|
81
|
-
This is the Accordion Component, this title will be longer in order to
|
|
82
|
-
increase width of the story
|
|
83
|
-
</h2>
|
|
84
|
-
|
|
85
|
-
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
86
|
-
<AccordionSection title={'Title'}>
|
|
87
|
-
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
88
|
-
</AccordionSection>
|
|
89
|
-
</Accordion>
|
|
90
|
-
</div>),
|
|
91
|
-
play: async () => {
|
|
92
|
-
const canvasElement = document.querySelector('#storybook-root');
|
|
93
|
-
const canvas = within(canvasElement);
|
|
94
|
-
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
95
|
-
await expect(loaderIcon).toBeVisible();
|
|
96
|
-
const header = document.querySelector('.dropin-accordion-section__heading');
|
|
97
|
-
await expect(header).toHaveTextContent('Title');
|
|
98
|
-
await userEvent.click(canvas.getByRole('button'));
|
|
99
|
-
const content = document.querySelector('.dropin-accordion-section__content-container');
|
|
100
|
-
await expect(content).toBeVisible();
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
export const SingleSectionWithLeftIcon = {
|
|
104
|
-
args: {
|
|
105
|
-
actionIconPosition: 'right',
|
|
106
|
-
iconOpen: Icons.Add,
|
|
107
|
-
iconClose: Icons.Minus,
|
|
108
|
-
iconLeft: Icons.Card,
|
|
109
|
-
showIconLeft: true,
|
|
110
|
-
},
|
|
111
|
-
render: ({ actionIconPosition, iconOpen, iconClose, iconLeft, showIconLeft, }) => (<div>
|
|
112
|
-
<h2 style={{
|
|
113
|
-
font: 'var(--type-body-1-strong-font)',
|
|
114
|
-
color: 'var(--color-neutral-800)',
|
|
115
|
-
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
116
|
-
}}>
|
|
117
|
-
This is the Accordion Component, this title will be longer in order to
|
|
118
|
-
increase width of the story
|
|
119
|
-
</h2>
|
|
120
|
-
|
|
121
|
-
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
122
|
-
<AccordionSection title={'Title'} secondaryText={'Optional Text'} iconLeft={iconLeft} showIconLeft={showIconLeft}>
|
|
123
|
-
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
124
|
-
</AccordionSection>
|
|
125
|
-
</Accordion>
|
|
126
|
-
</div>),
|
|
127
|
-
play: async () => {
|
|
128
|
-
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
129
|
-
await expect(loaderIcon).toBeVisible();
|
|
130
|
-
const leftHeader = document.querySelector('.dropin-accordion-section__title-container');
|
|
131
|
-
await expect(leftHeader).toBeVisible();
|
|
132
|
-
await expect(leftHeader).toContainHTML('<svg');
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
export const SingleSectionWithOptionalText = {
|
|
136
|
-
args: {
|
|
137
|
-
actionIconPosition: 'right',
|
|
138
|
-
iconOpen: Icons.Add,
|
|
139
|
-
iconClose: Icons.Minus,
|
|
140
|
-
iconLeft: Icons.Card,
|
|
141
|
-
secondaryText: 'Optional Text',
|
|
142
|
-
},
|
|
143
|
-
argTypes: {
|
|
144
|
-
secondaryText: {
|
|
145
|
-
description: 'Add text to the button.',
|
|
146
|
-
table: {
|
|
147
|
-
type: { summary: 'ComponentChildren' },
|
|
148
|
-
},
|
|
149
|
-
control: 'text',
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
render: ({ actionIconPosition, iconOpen, iconClose, iconLeft, secondaryText, }) => (<div>
|
|
153
|
-
<h2 style={{
|
|
154
|
-
font: 'var(--type-body-1-strong-font)',
|
|
155
|
-
color: 'var(--color-neutral-800)',
|
|
156
|
-
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
157
|
-
}}>
|
|
158
|
-
This is the Accordion Component, this title will be longer in order to
|
|
159
|
-
increase width of the story
|
|
160
|
-
</h2>
|
|
161
|
-
|
|
162
|
-
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
163
|
-
<AccordionSection title={'Title'} secondaryText={secondaryText} iconLeft={iconLeft}>
|
|
164
|
-
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
165
|
-
</AccordionSection>
|
|
166
|
-
</Accordion>
|
|
167
|
-
</div>),
|
|
168
|
-
play: async () => {
|
|
169
|
-
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
170
|
-
await expect(loaderIcon).toBeVisible();
|
|
171
|
-
const secondaryText = document.querySelector('.dropin-accordion-section__secondary-text');
|
|
172
|
-
await expect(secondaryText).toBeVisible();
|
|
173
|
-
await expect(secondaryText).toHaveTextContent('Optional Text');
|
|
174
|
-
},
|
|
175
|
-
};
|
|
176
|
-
export const SingleSectionWithPrice = {
|
|
177
|
-
args: {
|
|
178
|
-
actionIconPosition: 'right',
|
|
179
|
-
iconOpen: Icons.Add,
|
|
180
|
-
iconClose: Icons.Minus,
|
|
181
|
-
iconLeft: Icons.Card,
|
|
182
|
-
},
|
|
183
|
-
render: ({ actionIconPosition, iconOpen, iconClose, iconLeft }) => (<div>
|
|
184
|
-
<h2 style={{
|
|
185
|
-
font: 'var(--type-body-1-strong-font)',
|
|
186
|
-
color: 'var(--color-neutral-800)',
|
|
187
|
-
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
188
|
-
}}>
|
|
189
|
-
This is the Accordion Component, this title will be longer in order to
|
|
190
|
-
increase width of the story
|
|
191
|
-
</h2>
|
|
192
|
-
|
|
193
|
-
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
194
|
-
<AccordionSection title={'Title'} iconLeft={iconLeft} secondaryText={<Price amount={9.99}/>}>
|
|
195
|
-
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
196
|
-
</AccordionSection>
|
|
197
|
-
</Accordion>
|
|
198
|
-
</div>),
|
|
199
|
-
play: async () => {
|
|
200
|
-
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
201
|
-
await expect(loaderIcon).toBeVisible();
|
|
202
|
-
const secondaryText = document.querySelector('.dropin-accordion-section__secondary-text');
|
|
203
|
-
await expect(secondaryText).toBeVisible();
|
|
204
|
-
await expect(secondaryText).toHaveTextContent('$9.99');
|
|
205
|
-
},
|
|
206
|
-
};
|
|
207
|
-
export const SingleSectionWithLinkAndCartItem = {
|
|
208
|
-
args: {
|
|
209
|
-
actionIconPosition: 'left',
|
|
210
|
-
iconOpen: Icons.ChevronDown,
|
|
211
|
-
iconClose: Icons.ChevronUp,
|
|
212
|
-
},
|
|
213
|
-
render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
|
|
214
|
-
<h2 style={{
|
|
215
|
-
font: 'var(--type-body-1-strong-font)',
|
|
216
|
-
color: 'var(--color-neutral-800)',
|
|
217
|
-
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
218
|
-
}}>
|
|
219
|
-
This is the Accordion Component, this title will be longer in order to
|
|
220
|
-
increase width of the story
|
|
221
|
-
</h2>
|
|
222
|
-
|
|
223
|
-
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
224
|
-
<AccordionSection title={'Title'} secondaryText={<a rel="noreferrer" href="/cart">
|
|
225
|
-
Edit
|
|
226
|
-
</a>}>
|
|
227
|
-
<CartItem key={'uuid'} title={<div>Short Name</div>} description={<div>
|
|
228
|
-
Secondary product information such as brand name, description,
|
|
229
|
-
etc.
|
|
230
|
-
</div>} sku={<div>SKU: 59YK7</div>} quantity={1} image={<Image src="https://picsum.photos/132/184" width="132" height="184" alt="Some alternative text" loading="lazy"/>} price={<Price amount={53.99} style={{ fontWeight: 'inherit', color: 'inherit' }}/>} total={<>
|
|
231
|
-
<Price amount={59.98} variant="strikethrough"/>
|
|
232
|
-
<Price amount={55.95} sale/>
|
|
233
|
-
</>}/>
|
|
234
|
-
</AccordionSection>
|
|
235
|
-
</Accordion>
|
|
236
|
-
</div>),
|
|
237
|
-
play: async () => {
|
|
238
|
-
const accordionElement = document.querySelector('.dropin-accordion');
|
|
239
|
-
const link = accordionElement.querySelector('.dropin-accordion a');
|
|
240
|
-
await expect(accordionElement).toBeVisible();
|
|
241
|
-
await expect(link).toHaveTextContent('Edit');
|
|
242
|
-
await expect(link).toHaveAttribute('href', '/cart');
|
|
243
|
-
},
|
|
244
|
-
};
|
|
245
|
-
export const MultipleSection = {
|
|
246
|
-
args: {
|
|
247
|
-
actionIconPosition: 'right',
|
|
248
|
-
iconOpen: Icons.ChevronDown,
|
|
249
|
-
iconClose: Icons.ChevronUp,
|
|
250
|
-
iconLeft: Icons.Card,
|
|
251
|
-
showIconLeft: false,
|
|
252
|
-
},
|
|
253
|
-
argTypes: {
|
|
254
|
-
showIconLeft: {
|
|
255
|
-
table: {
|
|
256
|
-
disable: true,
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
iconLeft: {
|
|
260
|
-
table: {
|
|
261
|
-
disable: true,
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
},
|
|
265
|
-
render: ({ actionIconPosition, iconOpen, iconClose }) => (<div>
|
|
266
|
-
<h2 style={{
|
|
267
|
-
font: 'var(--type-body-1-strong-font)',
|
|
268
|
-
color: 'var(--color-neutral-800)',
|
|
269
|
-
letterSpacing: 'var(--type-body-1-strong-letter-spacing)',
|
|
270
|
-
}}>
|
|
271
|
-
This is the Accordion Component, this title will be longer in order to
|
|
272
|
-
increase width of the story
|
|
273
|
-
</h2>
|
|
274
|
-
|
|
275
|
-
<Accordion actionIconPosition={actionIconPosition} iconOpen={iconOpen} iconClose={iconClose}>
|
|
276
|
-
<AccordionSection title={'Cart summary'} iconLeft={Icons.Cart} showIconLeft={true} renderContentWhenClosed={false}>
|
|
277
|
-
<Card>
|
|
278
|
-
<h2 style={{ font: 'var(--type-headline-2-strong-font)' }}>
|
|
279
|
-
Title
|
|
280
|
-
</h2>
|
|
281
|
-
<p style={{ font: 'var(--type-body-2-default-font)' }}>
|
|
282
|
-
This is a short description of the item and should be kept to two
|
|
283
|
-
or three lines as maximum.
|
|
284
|
-
</p>
|
|
285
|
-
</Card>
|
|
286
|
-
</AccordionSection>
|
|
287
|
-
<AccordionSection title={'Card info'} iconLeft={Icons.Card} showIconLeft={true} secondaryText={'Optional Text'} renderContentWhenClosed={false}>
|
|
288
|
-
<p>
|
|
289
|
-
Short product details should be kept to 6 lines maximum.
|
|
290
|
-
<br />
|
|
291
|
-
Short product details should be kept to 6 lines maximum.
|
|
292
|
-
<br />
|
|
293
|
-
Short product details should be kept to 6 lines maximum.
|
|
294
|
-
<br />
|
|
295
|
-
Short product details should be kept to 6 lines maximum.
|
|
296
|
-
<br />
|
|
297
|
-
Short product details should be kept to 6 lines maximum.
|
|
298
|
-
<br />
|
|
299
|
-
</p>
|
|
300
|
-
</AccordionSection>
|
|
301
|
-
<AccordionSection title={'Wallet'} iconLeft={Icons.Wallet} showIconLeft={true}>
|
|
302
|
-
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
303
|
-
</AccordionSection>
|
|
304
|
-
<AccordionSection title={'Shipping'} iconLeft={Icons.Delivery} showIconLeft={true}>
|
|
305
|
-
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
306
|
-
</AccordionSection>
|
|
307
|
-
<AccordionSection title={'Notes'} iconLeft={Icons.Delivery} showIconLeft={false}>
|
|
308
|
-
<p>Short product details should be kept to 6 lines maximum.</p>
|
|
309
|
-
</AccordionSection>
|
|
310
|
-
</Accordion>
|
|
311
|
-
</div>),
|
|
312
|
-
play: async () => {
|
|
313
|
-
const loaderIcon = document.querySelector('div[class*="dropin-accordion"]');
|
|
314
|
-
await expect(loaderIcon).toBeVisible();
|
|
315
|
-
const section = document.querySelector('.dropin-accordion-section');
|
|
316
|
-
await expect(section).toBeVisible();
|
|
317
|
-
const divider = document.querySelector('.dropin-divider');
|
|
318
|
-
await expect(divider).toBeVisible();
|
|
319
|
-
},
|
|
320
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Accordion.test.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/Accordion.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render, fireEvent, act } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { Accordion, AccordionSection } from '@adobe/elsie/components/Accordion';
|
|
4
|
-
describe('Base/Components/Accordion', () => {
|
|
5
|
-
test('renders', () => {
|
|
6
|
-
const { container } = render(<Accordion>
|
|
7
|
-
<AccordionSection title={'Title'}>
|
|
8
|
-
<span>Content goes here</span>
|
|
9
|
-
</AccordionSection>
|
|
10
|
-
</Accordion>);
|
|
11
|
-
const element = container.querySelector('.dropin-accordion');
|
|
12
|
-
expect(element).toMatchSnapshot();
|
|
13
|
-
});
|
|
14
|
-
test('renders and open', () => {
|
|
15
|
-
const mockOnStateChange = jest.fn();
|
|
16
|
-
const { container } = render(<Accordion>
|
|
17
|
-
<AccordionSection showIconLeft={true} title={'Title'} onStateChange={mockOnStateChange}>
|
|
18
|
-
<span>Content goes here</span>
|
|
19
|
-
</AccordionSection>
|
|
20
|
-
<AccordionSection showIconLeft={true} title={'Title2'} secondaryText={'Optional Text'}>
|
|
21
|
-
<span>Content goes here2</span>
|
|
22
|
-
</AccordionSection>
|
|
23
|
-
</Accordion>);
|
|
24
|
-
const button = container.querySelector('.dropin-accordion-section__flex');
|
|
25
|
-
expect(button).not.toBeNull();
|
|
26
|
-
act(() => {
|
|
27
|
-
fireEvent.click(button);
|
|
28
|
-
});
|
|
29
|
-
expect(mockOnStateChange).toHaveBeenCalledTimes(1);
|
|
30
|
-
const element_new = container.querySelector('.dropin-accordion');
|
|
31
|
-
expect(element_new).toMatchSnapshot();
|
|
32
|
-
});
|
|
33
|
-
test('renders different sections with action icon on different positions', () => {
|
|
34
|
-
const mockOnStateChange = jest.fn();
|
|
35
|
-
const { container } = render(<>
|
|
36
|
-
<AccordionSection showIconLeft={true} title={'Title1'} onStateChange={mockOnStateChange} actionIconPosition={'right'}>
|
|
37
|
-
<span>Content goes here1</span>
|
|
38
|
-
</AccordionSection>
|
|
39
|
-
<AccordionSection showIconLeft={true} title={'Title2'} onStateChange={mockOnStateChange} actionIconPosition={'left'}>
|
|
40
|
-
<span>Content goes here2</span>
|
|
41
|
-
</AccordionSection>
|
|
42
|
-
<AccordionSection showIconLeft={true} title={'Title3'} onStateChange={mockOnStateChange}>
|
|
43
|
-
<span>Content goes here3</span>
|
|
44
|
-
</AccordionSection>
|
|
45
|
-
</>);
|
|
46
|
-
const element = container.querySelector('.dropin-accordion-section');
|
|
47
|
-
expect(!!container).toEqual(true);
|
|
48
|
-
expect(container).toMatchSnapshot();
|
|
49
|
-
expect(element).not.toBeNull();
|
|
50
|
-
const actionButton = container.querySelector('.dropin-accordion-section__open-icon');
|
|
51
|
-
expect(actionButton).not.toBeNull();
|
|
52
|
-
act(() => {
|
|
53
|
-
fireEvent.click(actionButton);
|
|
54
|
-
});
|
|
55
|
-
expect(mockOnStateChange).toHaveBeenCalledTimes(1);
|
|
56
|
-
});
|
|
57
|
-
test('should render content when section is closed and renderContentWhenClosed is true', () => {
|
|
58
|
-
const { container } = render(<Accordion>
|
|
59
|
-
<AccordionSection title={'Title'} renderContentWhenClosed={true}>
|
|
60
|
-
<span id="content">Content goes here</span>
|
|
61
|
-
</AccordionSection>
|
|
62
|
-
</Accordion>);
|
|
63
|
-
const element = container.querySelector('.dropin-accordion');
|
|
64
|
-
expect(element).toMatchSnapshot();
|
|
65
|
-
const content = container.querySelector('#content');
|
|
66
|
-
expect(content).not.toBeNull();
|
|
67
|
-
});
|
|
68
|
-
test('should not render content when section is closed and renderContentWhenClosed is false', () => {
|
|
69
|
-
const { container } = render(<Accordion>
|
|
70
|
-
<AccordionSection title={'Title'} renderContentWhenClosed={false}>
|
|
71
|
-
<span id="content">Content goes here</span>
|
|
72
|
-
</AccordionSection>
|
|
73
|
-
</Accordion>);
|
|
74
|
-
const element = container.querySelector('.dropin-accordion');
|
|
75
|
-
expect(element).toMatchSnapshot();
|
|
76
|
-
const content = container.querySelector('#content');
|
|
77
|
-
expect(content).toBeNull();
|
|
78
|
-
});
|
|
79
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Accordion/index.ts"],"names":[],"mappings":"AAAA,cAAc,6CAA6C,CAAC;AAC5D,OAAO,EAAE,SAAS,IAAI,OAAO,EAAE,MAAM,6CAA6C,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ComponentChildren, FunctionComponent, VNode } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/ActionButton/ActionButton.css';
|
|
4
|
-
export interface ActionButtonProps extends Omit<HTMLAttributes<HTMLButtonElement>, 'icon'> {
|
|
5
|
-
children?: ComponentChildren;
|
|
6
|
-
icon?: VNode<HTMLAttributes<SVGSVGElement>>;
|
|
7
|
-
active?: boolean;
|
|
8
|
-
disabled?: boolean;
|
|
9
|
-
}
|
|
10
|
-
export declare const ActionButton: FunctionComponent<ActionButtonProps>;
|
|
11
|
-
//# sourceMappingURL=ActionButton.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAC;AACrE,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,uDAAuD,CAAC;AAE/D,MAAM,WAAW,iBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACvD,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,eAAO,MAAM,YAAY,EAAE,iBAAiB,CAAC,iBAAiB,CA8B7D,CAAC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { VComponent, classes } from '@adobe/elsie/lib';
|
|
2
|
-
import '@adobe/elsie/components/ActionButton/ActionButton.css';
|
|
3
|
-
export const ActionButton = ({ icon, className, children, active = false, disabled = false, ...props }) => {
|
|
4
|
-
return (<button role="button" disabled={disabled} {...props} className={classes([
|
|
5
|
-
'dropin-action-button',
|
|
6
|
-
['dropin-action-button--active', active],
|
|
7
|
-
['dropin-action-button--disabled', disabled],
|
|
8
|
-
className,
|
|
9
|
-
])}>
|
|
10
|
-
{icon && (<VComponent node={icon} className={classes(['dropin-action-button-icon'])}/>)}
|
|
11
|
-
{children &&
|
|
12
|
-
(typeof children === 'string' ? <span>{children}</span> : children)}
|
|
13
|
-
</button>);
|
|
14
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { ActionButtonProps } from '@adobe/elsie/components/ActionButton';
|
|
3
|
-
/**
|
|
4
|
-
* Use Action Buttons to let users complete actions or select items in a workflow.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<ActionButtonProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<ActionButtonProps>;
|
|
9
|
-
export declare const Default: Story;
|
|
10
|
-
export declare const IconOnly: Story;
|
|
11
|
-
export declare const WithIcon: Story;
|
|
12
|
-
export declare const Disabled: Story;
|
|
13
|
-
export declare const Active: Story;
|
|
14
|
-
export declare const DisabledIcon: Story;
|
|
15
|
-
export declare const ActiveIcon: Story;
|
|
16
|
-
//# sourceMappingURL=ActionButton.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAEL,iBAAiB,EAClB,MAAM,sCAAsC,CAAC;AAO9C;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,iBAAiB,CAYjC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,iBAAiB,CAAC,CAAC;AAEzC,eAAO,MAAM,OAAO,EAAE,KAcrB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA4BtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KA2BtB,CAAC;AAEF,eAAO,MAAM,QAAQ,EAAE,KAiBtB,CAAC;AAEF,eAAO,MAAM,MAAM,EAAE,KAMpB,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAiB1B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KAMxB,CAAC"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { ActionButton as component, } from '@adobe/elsie/components/ActionButton';
|
|
2
|
-
import { Add } from '@adobe/elsie/icons';
|
|
3
|
-
import { Icon } from '@adobe/elsie/components/Icon';
|
|
4
|
-
import { IconsList } from '@adobe/elsie/components/Icon/Icon.stories.helpers';
|
|
5
|
-
import { within } from '@storybook/testing-library';
|
|
6
|
-
import { expect } from '@storybook/jest';
|
|
7
|
-
/**
|
|
8
|
-
* Use Action Buttons to let users complete actions or select items in a workflow.
|
|
9
|
-
*/
|
|
10
|
-
const meta = {
|
|
11
|
-
title: 'Components/ActionButton',
|
|
12
|
-
component,
|
|
13
|
-
argTypes: {
|
|
14
|
-
icon: {
|
|
15
|
-
options: Object.keys(IconsList),
|
|
16
|
-
mapping: IconsList,
|
|
17
|
-
control: {
|
|
18
|
-
type: 'select',
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
},
|
|
22
|
-
};
|
|
23
|
-
export default meta;
|
|
24
|
-
export const Default = {
|
|
25
|
-
name: 'Action Button',
|
|
26
|
-
args: {
|
|
27
|
-
children: 'Action',
|
|
28
|
-
active: false,
|
|
29
|
-
disabled: false,
|
|
30
|
-
},
|
|
31
|
-
play: async ({ canvasElement }) => {
|
|
32
|
-
const canvas = within(canvasElement);
|
|
33
|
-
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
34
|
-
await expect(await canvas.findByRole('button')).toHaveClass('dropin-action-button');
|
|
35
|
-
},
|
|
36
|
-
};
|
|
37
|
-
export const IconOnly = {
|
|
38
|
-
name: 'Icon Action Button',
|
|
39
|
-
args: {
|
|
40
|
-
...Default.args,
|
|
41
|
-
children: '',
|
|
42
|
-
'aria-label': 'Action Button',
|
|
43
|
-
icon: (<Icon source={Add} size="32" className="storybook_icon" stroke="1" viewBox="0 0 24 24"/>),
|
|
44
|
-
},
|
|
45
|
-
play: async ({ canvasElement }) => {
|
|
46
|
-
const canvas = within(canvasElement);
|
|
47
|
-
const buttonIcon = document.querySelector('.dropin-action-button-icon');
|
|
48
|
-
const addIcon = document.querySelector('g[data-name="Add icon"]');
|
|
49
|
-
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
50
|
-
await expect(await buttonIcon).toBeVisible();
|
|
51
|
-
await expect(await addIcon).toBeVisible();
|
|
52
|
-
},
|
|
53
|
-
};
|
|
54
|
-
export const WithIcon = {
|
|
55
|
-
name: 'Action Button With Icon',
|
|
56
|
-
args: {
|
|
57
|
-
...Default.args,
|
|
58
|
-
icon: (<Icon source={Add} size="32" className="storybook_icon" stroke="1" viewBox="0 0 24 24"/>),
|
|
59
|
-
},
|
|
60
|
-
play: async ({ canvasElement }) => {
|
|
61
|
-
const canvas = within(canvasElement);
|
|
62
|
-
const buttonIcon = document.querySelector('.dropin-action-button-icon');
|
|
63
|
-
const addIcon = document.querySelector('g[data-name="Add icon"]');
|
|
64
|
-
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
65
|
-
await expect(await buttonIcon).toBeVisible();
|
|
66
|
-
await expect(await addIcon).toBeVisible();
|
|
67
|
-
await expect(await canvas.getByText('Action')).toBeVisible();
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
export const Disabled = {
|
|
71
|
-
name: 'Disabled Action Button',
|
|
72
|
-
parameters: {
|
|
73
|
-
a11y: {
|
|
74
|
-
config: {
|
|
75
|
-
rules: [{ id: 'color-contrast', enabled: false }],
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
},
|
|
79
|
-
args: {
|
|
80
|
-
...Default.args,
|
|
81
|
-
disabled: true,
|
|
82
|
-
},
|
|
83
|
-
play: async ({ canvasElement }) => {
|
|
84
|
-
const canvas = within(canvasElement);
|
|
85
|
-
await expect(await canvas.findByRole('button')).toBeDisabled();
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
export const Active = {
|
|
89
|
-
name: 'Active Action Button',
|
|
90
|
-
args: {
|
|
91
|
-
...Default.args,
|
|
92
|
-
active: true,
|
|
93
|
-
},
|
|
94
|
-
};
|
|
95
|
-
export const DisabledIcon = {
|
|
96
|
-
name: 'Disabled Action Button With Icon',
|
|
97
|
-
parameters: {
|
|
98
|
-
a11y: {
|
|
99
|
-
config: {
|
|
100
|
-
rules: [{ id: 'color-contrast', enabled: false }],
|
|
101
|
-
},
|
|
102
|
-
},
|
|
103
|
-
},
|
|
104
|
-
args: {
|
|
105
|
-
...WithIcon.args,
|
|
106
|
-
disabled: true,
|
|
107
|
-
},
|
|
108
|
-
play: async ({ canvasElement }) => {
|
|
109
|
-
const canvas = within(canvasElement);
|
|
110
|
-
await expect(await canvas.findByRole('button')).toBeDisabled();
|
|
111
|
-
},
|
|
112
|
-
};
|
|
113
|
-
export const ActiveIcon = {
|
|
114
|
-
name: 'Active Action Button With Icon',
|
|
115
|
-
args: {
|
|
116
|
-
...WithIcon.args,
|
|
117
|
-
active: true,
|
|
118
|
-
},
|
|
119
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ActionButton.test.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/ActionButton.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { ActionButton } from '@adobe/elsie/components/ActionButton';
|
|
4
|
-
describe('Base/Components/ActionButton', () => {
|
|
5
|
-
test('renders', () => {
|
|
6
|
-
const { container } = render(<ActionButton />);
|
|
7
|
-
const elem = container.querySelector('.dropin-action-button');
|
|
8
|
-
expect(!!elem).toEqual(true);
|
|
9
|
-
});
|
|
10
|
-
// test rendering of button with text
|
|
11
|
-
test('renders with text', () => {
|
|
12
|
-
const { container } = render(<ActionButton children="test"/>);
|
|
13
|
-
const elem = container.querySelector('.dropin-action-button');
|
|
14
|
-
expect(elem.classList.contains('dropin-action-button')).toEqual(true);
|
|
15
|
-
});
|
|
16
|
-
// test rendering of button with children components
|
|
17
|
-
test('renders with children', () => {
|
|
18
|
-
const { container } = render(<ActionButton children={<span>test</span>}/>);
|
|
19
|
-
const elem = container.querySelector('.dropin-action-button');
|
|
20
|
-
expect(elem.classList.contains('dropin-action-button')).toEqual(true);
|
|
21
|
-
});
|
|
22
|
-
// test rendering of button with icon only
|
|
23
|
-
test('renders with icon only', () => {
|
|
24
|
-
const { container } = render(<ActionButton icon={<div>icon</div>} children=""/>);
|
|
25
|
-
const elem2 = container.querySelector('.dropin-action-button-icon');
|
|
26
|
-
expect(elem2.classList.contains('dropin-action-button-icon')).toEqual(true);
|
|
27
|
-
});
|
|
28
|
-
// test rendering of button with text and icon
|
|
29
|
-
test('renders with text and icon', () => {
|
|
30
|
-
const { container } = render(<ActionButton icon={<div>icon</div>} children="test"/>);
|
|
31
|
-
const elem = container.querySelector('.dropin-action-button-icon');
|
|
32
|
-
expect(elem.classList.contains('dropin-action-button-icon')).toEqual(true);
|
|
33
|
-
const elem2 = container.querySelector('.dropin-action-button');
|
|
34
|
-
expect(elem2.classList.contains('dropin-action-button')).toEqual(true);
|
|
35
|
-
});
|
|
36
|
-
test('renders disabled', () => {
|
|
37
|
-
const { container } = render(<ActionButton disabled={true}/>);
|
|
38
|
-
const elem = container.querySelector('.dropin-action-button');
|
|
39
|
-
expect(elem.disabled).toEqual(true);
|
|
40
|
-
expect(elem.classList.contains('dropin-action-button--disabled')).toEqual(true);
|
|
41
|
-
});
|
|
42
|
-
test('renders active', () => {
|
|
43
|
-
const { container } = render(<ActionButton active={true}/>);
|
|
44
|
-
const elem = container.querySelector('.dropin-action-button');
|
|
45
|
-
expect(elem.classList.contains('dropin-action-button--active')).toEqual(true);
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ActionButton/index.ts"],"names":[],"mappings":"AAAA,cAAc,mDAAmD,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@adobe/elsie/components/ActionButton/ActionButton';
|