@dropins/tools 0.21.2-alpha3 → 0.22.0-alpha1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/event-bus.js +1 -49
- package/fetch-graphql.js +1 -62
- package/initializer.js +1 -64
- package/package.json +1 -1
- package/preact-compat.js +1 -93
- package/preact-hooks.js +1 -40
- package/preact-jsx-runtime.js +1 -35
- package/preact.js +1 -21
- package/runtime.js +1 -69
- package/components/Accordion/Accordion.d.ts +0 -25
- package/components/Accordion/Accordion.d.ts.map +0 -1
- package/components/Accordion/Accordion.jsx +0 -59
- package/components/Accordion/Accordion.stories.d.ts +0 -22
- package/components/Accordion/Accordion.stories.d.ts.map +0 -1
- package/components/Accordion/Accordion.stories.jsx +0 -320
- package/components/Accordion/Accordion.test.d.ts +0 -3
- package/components/Accordion/Accordion.test.d.ts.map +0 -1
- package/components/Accordion/Accordion.test.jsx +0 -79
- package/components/Accordion/index.d.ts +0 -3
- package/components/Accordion/index.d.ts.map +0 -1
- package/components/Accordion/index.js +0 -2
- package/components/ActionButton/ActionButton.d.ts +0 -11
- package/components/ActionButton/ActionButton.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.jsx +0 -14
- package/components/ActionButton/ActionButton.stories.d.ts +0 -16
- package/components/ActionButton/ActionButton.stories.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.stories.jsx +0 -119
- package/components/ActionButton/ActionButton.test.d.ts +0 -3
- package/components/ActionButton/ActionButton.test.d.ts.map +0 -1
- package/components/ActionButton/ActionButton.test.jsx +0 -47
- package/components/ActionButton/index.d.ts +0 -2
- package/components/ActionButton/index.d.ts.map +0 -1
- package/components/ActionButton/index.js +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.d.ts +0 -20
- package/components/ActionButtonGroup/ActionButtonGroup.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.jsx +0 -39
- package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts +0 -16
- package/components/ActionButtonGroup/ActionButtonGroup.stories.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.stories.jsx +0 -72
- package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts +0 -3
- package/components/ActionButtonGroup/ActionButtonGroup.test.d.ts.map +0 -1
- package/components/ActionButtonGroup/ActionButtonGroup.test.jsx +0 -78
- package/components/ActionButtonGroup/index.d.ts +0 -2
- package/components/ActionButtonGroup/index.d.ts.map +0 -1
- package/components/ActionButtonGroup/index.js +0 -1
- package/components/AlertBanner/AlertBanner.d.ts +0 -15
- package/components/AlertBanner/AlertBanner.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.jsx +0 -30
- package/components/AlertBanner/AlertBanner.stories.d.ts +0 -17
- package/components/AlertBanner/AlertBanner.stories.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.stories.jsx +0 -128
- package/components/AlertBanner/AlertBanner.test.d.ts +0 -3
- package/components/AlertBanner/AlertBanner.test.d.ts.map +0 -1
- package/components/AlertBanner/AlertBanner.test.jsx +0 -40
- package/components/AlertBanner/index.d.ts +0 -3
- package/components/AlertBanner/index.d.ts.map +0 -1
- package/components/AlertBanner/index.js +0 -2
- package/components/Breadcrumbs/Breadcrumbs.d.ts +0 -9
- package/components/Breadcrumbs/Breadcrumbs.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.jsx +0 -26
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts +0 -15
- package/components/Breadcrumbs/Breadcrumbs.stories.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.stories.jsx +0 -110
- package/components/Breadcrumbs/Breadcrumbs.test.d.ts +0 -3
- package/components/Breadcrumbs/Breadcrumbs.test.d.ts.map +0 -1
- package/components/Breadcrumbs/Breadcrumbs.test.jsx +0 -67
- package/components/Breadcrumbs/index.d.ts +0 -3
- package/components/Breadcrumbs/index.d.ts.map +0 -1
- package/components/Breadcrumbs/index.js +0 -2
- package/components/Button/Button.d.ts +0 -15
- package/components/Button/Button.d.ts.map +0 -1
- package/components/Button/Button.jsx +0 -59
- package/components/Button/Button.stories.d.ts +0 -135
- package/components/Button/Button.stories.d.ts.map +0 -1
- package/components/Button/Button.stories.jsx +0 -354
- package/components/Button/Button.test.d.ts +0 -2
- package/components/Button/Button.test.d.ts.map +0 -1
- package/components/Button/Button.test.jsx +0 -134
- package/components/Button/index.d.ts +0 -3
- package/components/Button/index.d.ts.map +0 -1
- package/components/Button/index.js +0 -2
- package/components/Card/Card.d.ts +0 -9
- package/components/Card/Card.d.ts.map +0 -1
- package/components/Card/Card.jsx +0 -7
- package/components/Card/Card.stories.d.ts +0 -16
- package/components/Card/Card.stories.d.ts.map +0 -1
- package/components/Card/Card.stories.jsx +0 -47
- package/components/Card/Card.test.d.ts +0 -3
- package/components/Card/Card.test.d.ts.map +0 -1
- package/components/Card/Card.test.jsx +0 -26
- package/components/Card/index.d.ts +0 -2
- package/components/Card/index.d.ts.map +0 -1
- package/components/Card/index.js +0 -1
- package/components/CartItem/CartItem.d.ts +0 -25
- package/components/CartItem/CartItem.d.ts.map +0 -1
- package/components/CartItem/CartItem.jsx +0 -124
- package/components/CartItem/CartItem.stories.d.ts +0 -54
- package/components/CartItem/CartItem.stories.d.ts.map +0 -1
- package/components/CartItem/CartItem.stories.jsx +0 -309
- package/components/CartItem/CartItem.test.d.ts +0 -3
- package/components/CartItem/CartItem.test.d.ts.map +0 -1
- package/components/CartItem/CartItem.test.jsx +0 -71
- package/components/CartItem/CartItemSkeleton.d.ts +0 -3
- package/components/CartItem/CartItemSkeleton.d.ts.map +0 -1
- package/components/CartItem/CartItemSkeleton.jsx +0 -25
- package/components/CartItem/CartItemSkeleton.test.d.ts +0 -3
- package/components/CartItem/CartItemSkeleton.test.d.ts.map +0 -1
- package/components/CartItem/CartItemSkeleton.test.jsx +0 -11
- package/components/CartItem/index.d.ts +0 -4
- package/components/CartItem/index.d.ts.map +0 -1
- package/components/CartItem/index.js +0 -3
- package/components/CartList/CartList.d.ts +0 -7
- package/components/CartList/CartList.d.ts.map +0 -1
- package/components/CartList/CartList.jsx +0 -14
- package/components/CartList/CartList.stories.d.ts +0 -17
- package/components/CartList/CartList.stories.d.ts.map +0 -1
- package/components/CartList/CartList.stories.jsx +0 -54
- package/components/CartList/CartList.test.d.ts +0 -3
- package/components/CartList/CartList.test.d.ts.map +0 -1
- package/components/CartList/CartList.test.jsx +0 -12
- package/components/CartList/index.d.ts +0 -3
- package/components/CartList/index.d.ts.map +0 -1
- package/components/CartList/index.js +0 -2
- package/components/Checkbox/Checkbox.d.ts +0 -13
- package/components/Checkbox/Checkbox.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.jsx +0 -51
- package/components/Checkbox/Checkbox.stories.d.ts +0 -22
- package/components/Checkbox/Checkbox.stories.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.stories.jsx +0 -157
- package/components/Checkbox/Checkbox.test.d.ts +0 -3
- package/components/Checkbox/Checkbox.test.d.ts.map +0 -1
- package/components/Checkbox/Checkbox.test.jsx +0 -136
- package/components/Checkbox/index.d.ts +0 -2
- package/components/Checkbox/index.d.ts.map +0 -1
- package/components/Checkbox/index.js +0 -1
- package/components/ColorSwatch/ColorSwatch.d.ts +0 -20
- package/components/ColorSwatch/ColorSwatch.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.jsx +0 -57
- package/components/ColorSwatch/ColorSwatch.stories.d.ts +0 -20
- package/components/ColorSwatch/ColorSwatch.stories.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.stories.jsx +0 -206
- package/components/ColorSwatch/ColorSwatch.test.d.ts +0 -3
- package/components/ColorSwatch/ColorSwatch.test.d.ts.map +0 -1
- package/components/ColorSwatch/ColorSwatch.test.jsx +0 -87
- package/components/ColorSwatch/index.d.ts +0 -3
- package/components/ColorSwatch/index.d.ts.map +0 -1
- package/components/ColorSwatch/index.js +0 -2
- package/components/Divider/Divider.d.ts +0 -8
- package/components/Divider/Divider.d.ts.map +0 -1
- package/components/Divider/Divider.jsx +0 -9
- package/components/Divider/Divider.stories.d.ts +0 -11
- package/components/Divider/Divider.stories.d.ts.map +0 -1
- package/components/Divider/Divider.stories.jsx +0 -43
- package/components/Divider/Divider.test.d.ts +0 -2
- package/components/Divider/Divider.test.d.ts.map +0 -1
- package/components/Divider/Divider.test.jsx +0 -19
- package/components/Divider/index.d.ts +0 -3
- package/components/Divider/index.d.ts.map +0 -1
- package/components/Divider/index.js +0 -2
- package/components/Field/Field.d.ts +0 -14
- package/components/Field/Field.d.ts.map +0 -1
- package/components/Field/Field.jsx +0 -29
- package/components/Field/Field.stories.d.ts +0 -37
- package/components/Field/Field.stories.d.ts.map +0 -1
- package/components/Field/Field.stories.jsx +0 -174
- package/components/Field/Field.test.d.ts +0 -3
- package/components/Field/Field.test.d.ts.map +0 -1
- package/components/Field/Field.test.jsx +0 -91
- package/components/Field/index.d.ts +0 -2
- package/components/Field/index.d.ts.map +0 -1
- package/components/Field/index.js +0 -1
- package/components/Icon/Icon.d.ts +0 -11
- package/components/Icon/Icon.d.ts.map +0 -1
- package/components/Icon/Icon.jsx +0 -57
- package/components/Icon/Icon.stories.d.ts +0 -16
- package/components/Icon/Icon.stories.d.ts.map +0 -1
- package/components/Icon/Icon.stories.helpers.d.ts +0 -4
- package/components/Icon/Icon.stories.helpers.d.ts.map +0 -1
- package/components/Icon/Icon.stories.helpers.jsx +0 -7
- package/components/Icon/Icon.stories.jsx +0 -48
- package/components/Icon/Icon.test.d.ts +0 -3
- package/components/Icon/Icon.test.d.ts.map +0 -1
- package/components/Icon/Icon.test.jsx +0 -67
- package/components/Icon/index.d.ts +0 -2
- package/components/Icon/index.d.ts.map +0 -1
- package/components/Icon/index.js +0 -1
- package/components/IllustratedMessage/IllustratedMessage.d.ts +0 -13
- package/components/IllustratedMessage/IllustratedMessage.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.jsx +0 -21
- package/components/IllustratedMessage/IllustratedMessage.stories.d.ts +0 -10
- package/components/IllustratedMessage/IllustratedMessage.stories.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.stories.jsx +0 -90
- package/components/IllustratedMessage/IllustratedMessage.test.d.ts +0 -3
- package/components/IllustratedMessage/IllustratedMessage.test.d.ts.map +0 -1
- package/components/IllustratedMessage/IllustratedMessage.test.jsx +0 -42
- package/components/IllustratedMessage/index.d.ts +0 -3
- package/components/IllustratedMessage/index.d.ts.map +0 -1
- package/components/IllustratedMessage/index.js +0 -2
- package/components/Image/Image.d.ts +0 -11
- package/components/Image/Image.d.ts.map +0 -1
- package/components/Image/Image.jsx +0 -26
- package/components/Image/Image.stories.d.ts +0 -11
- package/components/Image/Image.stories.d.ts.map +0 -1
- package/components/Image/Image.stories.jsx +0 -66
- package/components/Image/Image.test.d.ts +0 -3
- package/components/Image/Image.test.d.ts.map +0 -1
- package/components/Image/Image.test.jsx +0 -82
- package/components/Image/index.d.ts +0 -2
- package/components/Image/index.d.ts.map +0 -1
- package/components/Image/index.js +0 -1
- package/components/ImageSwatch/ImageSwatch.d.ts +0 -20
- package/components/ImageSwatch/ImageSwatch.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.jsx +0 -49
- package/components/ImageSwatch/ImageSwatch.stories.d.ts +0 -20
- package/components/ImageSwatch/ImageSwatch.stories.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.stories.jsx +0 -206
- package/components/ImageSwatch/ImageSwatch.test.d.ts +0 -3
- package/components/ImageSwatch/ImageSwatch.test.d.ts.map +0 -1
- package/components/ImageSwatch/ImageSwatch.test.jsx +0 -64
- package/components/ImageSwatch/index.d.ts +0 -3
- package/components/ImageSwatch/index.d.ts.map +0 -1
- package/components/ImageSwatch/index.js +0 -2
- package/components/InLineAlert/InLineAlert.d.ts +0 -16
- package/components/InLineAlert/InLineAlert.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.jsx +0 -38
- package/components/InLineAlert/InLineAlert.stories.d.ts +0 -86
- package/components/InLineAlert/InLineAlert.stories.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.stories.jsx +0 -193
- package/components/InLineAlert/InLineAlert.test.d.ts +0 -3
- package/components/InLineAlert/InLineAlert.test.d.ts.map +0 -1
- package/components/InLineAlert/InLineAlert.test.jsx +0 -77
- package/components/InLineAlert/index.d.ts +0 -3
- package/components/InLineAlert/index.d.ts.map +0 -1
- package/components/InLineAlert/index.js +0 -2
- package/components/Incrementer/Incrementer.d.ts +0 -17
- package/components/Incrementer/Incrementer.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.jsx +0 -87
- package/components/Incrementer/Incrementer.stories.d.ts +0 -10
- package/components/Incrementer/Incrementer.stories.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.stories.jsx +0 -68
- package/components/Incrementer/Incrementer.test.d.ts +0 -3
- package/components/Incrementer/Incrementer.test.d.ts.map +0 -1
- package/components/Incrementer/Incrementer.test.jsx +0 -112
- package/components/Incrementer/index.d.ts +0 -2
- package/components/Incrementer/index.d.ts.map +0 -1
- package/components/Incrementer/index.js +0 -1
- package/components/Input/Input.d.ts +0 -19
- package/components/Input/Input.d.ts.map +0 -1
- package/components/Input/Input.jsx +0 -73
- package/components/Input/Input.stories.d.ts +0 -11
- package/components/Input/Input.stories.d.ts.map +0 -1
- package/components/Input/Input.stories.jsx +0 -115
- package/components/Input/Input.test.d.ts +0 -3
- package/components/Input/Input.test.d.ts.map +0 -1
- package/components/Input/Input.test.jsx +0 -111
- package/components/Input/index.d.ts +0 -3
- package/components/Input/index.d.ts.map +0 -1
- package/components/Input/index.js +0 -2
- package/components/Modal/Modal.d.ts +0 -15
- package/components/Modal/Modal.d.ts.map +0 -1
- package/components/Modal/Modal.jsx +0 -93
- package/components/Modal/Modal.stories.d.ts +0 -56
- package/components/Modal/Modal.stories.d.ts.map +0 -1
- package/components/Modal/Modal.stories.jsx +0 -189
- package/components/Modal/Modal.test.d.ts +0 -3
- package/components/Modal/Modal.test.d.ts.map +0 -1
- package/components/Modal/Modal.test.jsx +0 -85
- package/components/Modal/index.d.ts +0 -2
- package/components/Modal/index.d.ts.map +0 -1
- package/components/Modal/index.js +0 -14
- package/components/Picker/Picker.d.ts +0 -26
- package/components/Picker/Picker.d.ts.map +0 -1
- package/components/Picker/Picker.jsx +0 -81
- package/components/Picker/Picker.stories.d.ts +0 -22
- package/components/Picker/Picker.stories.d.ts.map +0 -1
- package/components/Picker/Picker.stories.jsx +0 -236
- package/components/Picker/Picker.test.d.ts +0 -2
- package/components/Picker/Picker.test.d.ts.map +0 -1
- package/components/Picker/Picker.test.jsx +0 -190
- package/components/Picker/index.d.ts +0 -2
- package/components/Picker/index.d.ts.map +0 -1
- package/components/Picker/index.js +0 -1
- package/components/Price/Price.d.ts +0 -17
- package/components/Price/Price.d.ts.map +0 -1
- package/components/Price/Price.jsx +0 -24
- package/components/Price/Price.stories.d.ts +0 -17
- package/components/Price/Price.stories.d.ts.map +0 -1
- package/components/Price/Price.stories.jsx +0 -78
- package/components/Price/Price.test.d.ts +0 -3
- package/components/Price/Price.test.d.ts.map +0 -1
- package/components/Price/Price.test.jsx +0 -68
- package/components/Price/index.d.ts +0 -2
- package/components/Price/index.d.ts.map +0 -1
- package/components/Price/index.js +0 -1
- package/components/PriceRange/PriceRange.d.ts +0 -17
- package/components/PriceRange/PriceRange.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.jsx +0 -75
- package/components/PriceRange/PriceRange.stories.d.ts +0 -107
- package/components/PriceRange/PriceRange.stories.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.stories.jsx +0 -210
- package/components/PriceRange/PriceRange.test.d.ts +0 -3
- package/components/PriceRange/PriceRange.test.d.ts.map +0 -1
- package/components/PriceRange/PriceRange.test.jsx +0 -188
- package/components/PriceRange/index.d.ts +0 -3
- package/components/PriceRange/index.d.ts.map +0 -1
- package/components/PriceRange/index.js +0 -2
- package/components/PriceSummary/PriceSummary.d.ts +0 -43
- package/components/PriceSummary/PriceSummary.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.jsx +0 -228
- package/components/PriceSummary/PriceSummary.stories.d.ts +0 -127
- package/components/PriceSummary/PriceSummary.stories.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.stories.jsx +0 -456
- package/components/PriceSummary/PriceSummary.test.d.ts +0 -3
- package/components/PriceSummary/PriceSummary.test.d.ts.map +0 -1
- package/components/PriceSummary/PriceSummary.test.jsx +0 -275
- package/components/PriceSummary/index.d.ts +0 -3
- package/components/PriceSummary/index.d.ts.map +0 -1
- package/components/PriceSummary/index.js +0 -2
- package/components/ProgressSpinner/ProgressSpinner.d.ts +0 -14
- package/components/ProgressSpinner/ProgressSpinner.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.jsx +0 -31
- package/components/ProgressSpinner/ProgressSpinner.stories.d.ts +0 -19
- package/components/ProgressSpinner/ProgressSpinner.stories.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.stories.jsx +0 -195
- package/components/ProgressSpinner/ProgressSpinner.test.d.ts +0 -3
- package/components/ProgressSpinner/ProgressSpinner.test.d.ts.map +0 -1
- package/components/ProgressSpinner/ProgressSpinner.test.jsx +0 -40
- package/components/ProgressSpinner/index.d.ts +0 -3
- package/components/ProgressSpinner/index.d.ts.map +0 -1
- package/components/ProgressSpinner/index.js +0 -2
- package/components/RadioButton/RadioButton.d.ts +0 -15
- package/components/RadioButton/RadioButton.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.jsx +0 -31
- package/components/RadioButton/RadioButton.stories.d.ts +0 -15
- package/components/RadioButton/RadioButton.stories.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.stories.jsx +0 -92
- package/components/RadioButton/RadioButton.test.d.ts +0 -3
- package/components/RadioButton/RadioButton.test.d.ts.map +0 -1
- package/components/RadioButton/RadioButton.test.jsx +0 -62
- package/components/RadioButton/index.d.ts +0 -3
- package/components/RadioButton/index.d.ts.map +0 -1
- package/components/RadioButton/index.js +0 -2
- package/components/Skeleton/Skeleton.d.ts +0 -17
- package/components/Skeleton/Skeleton.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.jsx +0 -52
- package/components/Skeleton/Skeleton.stories.d.ts +0 -67
- package/components/Skeleton/Skeleton.stories.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.stories.jsx +0 -184
- package/components/Skeleton/Skeleton.test.d.ts +0 -3
- package/components/Skeleton/Skeleton.test.d.ts.map +0 -1
- package/components/Skeleton/Skeleton.test.jsx +0 -62
- package/components/Skeleton/index.d.ts +0 -2
- package/components/Skeleton/index.d.ts.map +0 -1
- package/components/Skeleton/index.js +0 -1
- package/components/TextSwatch/TextSwatch.d.ts +0 -18
- package/components/TextSwatch/TextSwatch.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.jsx +0 -56
- package/components/TextSwatch/TextSwatch.stories.d.ts +0 -21
- package/components/TextSwatch/TextSwatch.stories.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.stories.jsx +0 -211
- package/components/TextSwatch/TextSwatch.test.d.ts +0 -3
- package/components/TextSwatch/TextSwatch.test.d.ts.map +0 -1
- package/components/TextSwatch/TextSwatch.test.jsx +0 -85
- package/components/TextSwatch/index.d.ts +0 -3
- package/components/TextSwatch/index.d.ts.map +0 -1
- package/components/TextSwatch/index.js +0 -2
- package/components/UIProvider/UIProvider.d.ts +0 -18
- package/components/UIProvider/UIProvider.d.ts.map +0 -1
- package/components/UIProvider/UIProvider.jsx +0 -26
- package/components/UIProvider/UIProvider.test.d.ts +0 -2
- package/components/UIProvider/UIProvider.test.d.ts.map +0 -1
- package/components/UIProvider/UIProvider.test.jsx +0 -9
- package/components/UIProvider/index.d.ts +0 -2
- package/components/UIProvider/index.d.ts.map +0 -1
- package/components/UIProvider/index.js +0 -1
- package/components/index.d.ts +0 -34
- package/components/index.d.ts.map +0 -1
- package/components/index.js +0 -33
- package/docs/Design/designBlocks.d.ts +0 -21
- package/docs/Design/designBlocks.d.ts.map +0 -1
- package/docs/Design/designBlocks.jsx +0 -59
- package/docs/Design/getTokenData.d.ts +0 -7
- package/docs/Design/getTokenData.d.ts.map +0 -1
- package/docs/Design/getTokenData.js +0 -18
- package/docs/Design/getTokenData.test.d.ts +0 -2
- package/docs/Design/getTokenData.test.d.ts.map +0 -1
- package/docs/Design/getTokenData.test.js +0 -92
- package/i18n/en_US.json +0 -112
- package/i18n/index.d.ts +0 -341
- package/i18n/index.d.ts.map +0 -1
- package/i18n/index.js +0 -12
- package/i18n/index.test.d.ts +0 -2
- package/i18n/index.test.d.ts.map +0 -1
- package/i18n/index.test.js +0 -11
- package/icons/index.d.ts +0 -35
- package/icons/index.d.ts.map +0 -1
- package/icons/index.js +0 -34
- package/lib/classes.d.ts +0 -5
- package/lib/classes.d.ts.map +0 -1
- package/lib/classes.js +0 -16
- package/lib/classes.test.d.ts +0 -2
- package/lib/classes.test.d.ts.map +0 -1
- package/lib/classes.test.js +0 -18
- package/lib/config.d.ts +0 -7
- package/lib/config.d.ts.map +0 -1
- package/lib/config.js +0 -12
- package/lib/config.test.d.ts +0 -2
- package/lib/config.test.d.ts.map +0 -1
- package/lib/config.test.js +0 -12
- package/lib/debounce.d.ts +0 -2
- package/lib/debounce.d.ts.map +0 -1
- package/lib/debounce.js +0 -7
- package/lib/debounce.test.d.ts +0 -2
- package/lib/debounce.test.d.ts.map +0 -1
- package/lib/debounce.test.js +0 -40
- package/lib/deepmerge.d.ts +0 -2
- package/lib/deepmerge.d.ts.map +0 -1
- package/lib/deepmerge.js +0 -1
- package/lib/form-values.d.ts +0 -5
- package/lib/form-values.d.ts.map +0 -1
- package/lib/form-values.js +0 -17
- package/lib/form-values.test.d.ts +0 -2
- package/lib/form-values.test.d.ts.map +0 -1
- package/lib/form-values.test.jsx +0 -29
- package/lib/i18n.d.ts +0 -8
- package/lib/i18n.d.ts.map +0 -1
- package/lib/i18n.js +0 -9
- package/lib/i18n.test.d.ts +0 -2
- package/lib/i18n.test.d.ts.map +0 -1
- package/lib/i18n.test.jsx +0 -8
- package/lib/image-params-keymap.d.ts +0 -4
- package/lib/image-params-keymap.d.ts.map +0 -1
- package/lib/image-params-keymap.js +0 -19
- package/lib/image-params-keymap.test.d.ts +0 -2
- package/lib/image-params-keymap.test.d.ts.map +0 -1
- package/lib/image-params-keymap.test.js +0 -7
- package/lib/index.d.ts +0 -14
- package/lib/index.d.ts.map +0 -1
- package/lib/index.js +0 -13
- package/lib/initializer.d.ts +0 -81
- package/lib/initializer.d.ts.map +0 -1
- package/lib/initializer.js +0 -96
- package/lib/initializer.test.d.ts +0 -2
- package/lib/initializer.test.d.ts.map +0 -1
- package/lib/initializer.test.js +0 -64
- package/lib/render.d.ts +0 -10
- package/lib/render.d.ts.map +0 -1
- package/lib/render.jsx +0 -34
- package/lib/render.test.d.ts +0 -2
- package/lib/render.test.d.ts.map +0 -1
- package/lib/render.test.jsx +0 -70
- package/lib/resolve-image.d.ts +0 -10
- package/lib/resolve-image.d.ts.map +0 -1
- package/lib/resolve-image.js +0 -57
- package/lib/resolve-image.test.d.ts +0 -2
- package/lib/resolve-image.test.d.ts.map +0 -1
- package/lib/resolve-image.test.jsx +0 -146
- package/lib/slot.d.ts +0 -43
- package/lib/slot.d.ts.map +0 -1
- package/lib/slot.jsx +0 -184
- package/lib/slot.test.d.ts +0 -2
- package/lib/slot.test.d.ts.map +0 -1
- package/lib/slot.test.jsx +0 -325
- package/lib/tests.d.ts +0 -4
- package/lib/tests.d.ts.map +0 -1
- package/lib/tests.jsx +0 -19
- package/lib/tests.test.d.ts +0 -2
- package/lib/tests.test.d.ts.map +0 -1
- package/lib/tests.test.jsx +0 -13
- package/lib/types.d.ts +0 -9
- package/lib/types.d.ts.map +0 -1
- package/lib/types.js +0 -1
- package/lib/vcomponent.d.ts +0 -8
- package/lib/vcomponent.d.ts.map +0 -1
- package/lib/vcomponent.jsx +0 -27
- package/lib/vcomponent.test.d.ts +0 -2
- package/lib/vcomponent.test.d.ts.map +0 -1
- package/lib/vcomponent.test.jsx +0 -51
|
@@ -1,354 +0,0 @@
|
|
|
1
|
-
import { Button as component, } from '@adobe/elsie/components/Button';
|
|
2
|
-
import { Cart, Check, Search, SearchFilled } 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
|
-
import { action } from '@storybook/addon-actions';
|
|
8
|
-
/**
|
|
9
|
-
* Use Buttons to highlight or guide user actions.
|
|
10
|
-
*/
|
|
11
|
-
const meta = {
|
|
12
|
-
title: 'Components/Button',
|
|
13
|
-
component,
|
|
14
|
-
argTypes: {
|
|
15
|
-
value: {
|
|
16
|
-
description: 'Add string to pass to the clickHandler.',
|
|
17
|
-
table: {
|
|
18
|
-
type: { summary: 'string' },
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
children: {
|
|
22
|
-
description: 'Add text to the button.',
|
|
23
|
-
table: {
|
|
24
|
-
type: { summary: 'ComponentChildren' },
|
|
25
|
-
},
|
|
26
|
-
control: 'text',
|
|
27
|
-
},
|
|
28
|
-
variant: {
|
|
29
|
-
description: 'Change the button style.',
|
|
30
|
-
table: {
|
|
31
|
-
type: { summary: 'string' },
|
|
32
|
-
defaultValue: { summary: 'primary' },
|
|
33
|
-
},
|
|
34
|
-
options: ['primary', 'secondary', 'tertiary'],
|
|
35
|
-
control: 'radio',
|
|
36
|
-
},
|
|
37
|
-
size: {
|
|
38
|
-
description: 'Change the button size.',
|
|
39
|
-
table: {
|
|
40
|
-
type: { summary: 'string' },
|
|
41
|
-
defaultValue: { summary: 'medium' },
|
|
42
|
-
},
|
|
43
|
-
options: ['medium', 'large'],
|
|
44
|
-
control: 'radio',
|
|
45
|
-
},
|
|
46
|
-
icon: {
|
|
47
|
-
description: 'Add Icon component to the button.',
|
|
48
|
-
table: {
|
|
49
|
-
type: { summary: 'FunctionComponent' },
|
|
50
|
-
},
|
|
51
|
-
options: Object.keys(IconsList),
|
|
52
|
-
mapping: IconsList,
|
|
53
|
-
control: 'select',
|
|
54
|
-
},
|
|
55
|
-
disabled: {
|
|
56
|
-
description: 'Disable the button.',
|
|
57
|
-
table: {
|
|
58
|
-
type: { summary: 'boolean' },
|
|
59
|
-
defaultValue: { summary: 'false' },
|
|
60
|
-
},
|
|
61
|
-
control: { type: 'boolean' },
|
|
62
|
-
},
|
|
63
|
-
active: {
|
|
64
|
-
description: 'Activate the button.',
|
|
65
|
-
table: {
|
|
66
|
-
type: { summary: 'boolean' },
|
|
67
|
-
defaultValue: { summary: 'false' },
|
|
68
|
-
},
|
|
69
|
-
control: { type: 'boolean' },
|
|
70
|
-
},
|
|
71
|
-
activeChildren: {
|
|
72
|
-
description: 'Replace value of children prop when button is active.',
|
|
73
|
-
table: {
|
|
74
|
-
type: { summary: 'ComponentChildren' },
|
|
75
|
-
},
|
|
76
|
-
control: 'text',
|
|
77
|
-
},
|
|
78
|
-
activeIcon: {
|
|
79
|
-
description: 'Replace value of icon prop when when button is active.',
|
|
80
|
-
table: {
|
|
81
|
-
type: { summary: 'FunctionComponent' },
|
|
82
|
-
},
|
|
83
|
-
options: Object.keys(IconsList),
|
|
84
|
-
mapping: IconsList,
|
|
85
|
-
control: 'select',
|
|
86
|
-
},
|
|
87
|
-
onClick: {
|
|
88
|
-
description: 'Add a click handler.',
|
|
89
|
-
table: {
|
|
90
|
-
type: { summary: 'function' },
|
|
91
|
-
},
|
|
92
|
-
action: 'onClick',
|
|
93
|
-
},
|
|
94
|
-
href: {
|
|
95
|
-
description: 'Set this value to render the component as a link',
|
|
96
|
-
table: {
|
|
97
|
-
type: { summary: 'string' },
|
|
98
|
-
},
|
|
99
|
-
control: 'text',
|
|
100
|
-
},
|
|
101
|
-
},
|
|
102
|
-
};
|
|
103
|
-
export default meta;
|
|
104
|
-
/**
|
|
105
|
-
* ```tsx
|
|
106
|
-
* <Button
|
|
107
|
-
* active={false}
|
|
108
|
-
* activeChildren="Active"
|
|
109
|
-
* activeIcon={<Icon source={Check} size="24" />}
|
|
110
|
-
* children="Button"
|
|
111
|
-
* disabled={false}
|
|
112
|
-
* icon={<Icon source={Cart} size="24" />}
|
|
113
|
-
* onClick={handleAddToCart}
|
|
114
|
-
* size="medium"
|
|
115
|
-
* value={undefined}
|
|
116
|
-
* variant="primary"
|
|
117
|
-
* />
|
|
118
|
-
* ```
|
|
119
|
-
*/
|
|
120
|
-
export const Button = {
|
|
121
|
-
tags: ['isHidden'],
|
|
122
|
-
args: {
|
|
123
|
-
active: false,
|
|
124
|
-
activeChildren: 'Active',
|
|
125
|
-
activeIcon: <Icon source={Check} size="24"/>,
|
|
126
|
-
children: 'Button',
|
|
127
|
-
disabled: false,
|
|
128
|
-
icon: <Icon source={Cart} size="24"/>,
|
|
129
|
-
onClick: action('onClick'),
|
|
130
|
-
size: 'medium',
|
|
131
|
-
value: undefined,
|
|
132
|
-
variant: 'primary',
|
|
133
|
-
},
|
|
134
|
-
};
|
|
135
|
-
/**
|
|
136
|
-
* ```tsx
|
|
137
|
-
* <Button>Button</Button>
|
|
138
|
-
* ```
|
|
139
|
-
* ```tsx
|
|
140
|
-
* <Button children="Button" />
|
|
141
|
-
* ```
|
|
142
|
-
*/
|
|
143
|
-
export const Children = {
|
|
144
|
-
tags: ['isHidden'],
|
|
145
|
-
args: {
|
|
146
|
-
children: 'Button',
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
/**
|
|
150
|
-
* ```tsx
|
|
151
|
-
* <Button variant="primary">Primary</Button>
|
|
152
|
-
* ```
|
|
153
|
-
*/
|
|
154
|
-
export const Primary = {
|
|
155
|
-
args: {
|
|
156
|
-
...Button.args,
|
|
157
|
-
activeIcon: undefined,
|
|
158
|
-
icon: undefined,
|
|
159
|
-
children: 'Primary',
|
|
160
|
-
variant: 'primary',
|
|
161
|
-
},
|
|
162
|
-
play: async ({ canvasElement }) => {
|
|
163
|
-
const canvas = within(canvasElement);
|
|
164
|
-
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
165
|
-
},
|
|
166
|
-
};
|
|
167
|
-
/**
|
|
168
|
-
* ```tsx
|
|
169
|
-
* <Button variant='secondary'>Secondary</Button>
|
|
170
|
-
* ```
|
|
171
|
-
*/
|
|
172
|
-
export const Secondary = {
|
|
173
|
-
args: {
|
|
174
|
-
...Primary.args,
|
|
175
|
-
children: 'Secondary',
|
|
176
|
-
variant: 'secondary',
|
|
177
|
-
},
|
|
178
|
-
};
|
|
179
|
-
/**
|
|
180
|
-
* ```tsx
|
|
181
|
-
* <Button variant='tertiary'>Tertiary</Button>
|
|
182
|
-
* ```
|
|
183
|
-
*/
|
|
184
|
-
export const Tertiary = {
|
|
185
|
-
args: {
|
|
186
|
-
...Primary.args,
|
|
187
|
-
children: 'Tertiary',
|
|
188
|
-
variant: 'tertiary',
|
|
189
|
-
},
|
|
190
|
-
};
|
|
191
|
-
/**
|
|
192
|
-
* ```tsx
|
|
193
|
-
* <Button size='large'>Large</Button>
|
|
194
|
-
* ```
|
|
195
|
-
*/
|
|
196
|
-
export const LargeSize = {
|
|
197
|
-
args: {
|
|
198
|
-
...Primary.args,
|
|
199
|
-
children: 'Large',
|
|
200
|
-
size: 'large',
|
|
201
|
-
value: '123',
|
|
202
|
-
},
|
|
203
|
-
};
|
|
204
|
-
/**
|
|
205
|
-
* ```tsx
|
|
206
|
-
* <Button size='medium'>Medium</Button>
|
|
207
|
-
* ```
|
|
208
|
-
*/
|
|
209
|
-
export const MediumSize = {
|
|
210
|
-
args: {
|
|
211
|
-
...Primary.args,
|
|
212
|
-
children: 'Medium',
|
|
213
|
-
size: 'medium',
|
|
214
|
-
},
|
|
215
|
-
};
|
|
216
|
-
/**
|
|
217
|
-
* ```tsx
|
|
218
|
-
* <Button
|
|
219
|
-
* icon={<Icon
|
|
220
|
-
* source={Cart}
|
|
221
|
-
* size="24"
|
|
222
|
-
* stroke="2"
|
|
223
|
-
* viewBox="0 0 24 24"
|
|
224
|
-
* aria-label="Search" />}
|
|
225
|
-
* />
|
|
226
|
-
* ```
|
|
227
|
-
*/
|
|
228
|
-
export const IconOnly = {
|
|
229
|
-
args: {
|
|
230
|
-
...Primary.args,
|
|
231
|
-
children: undefined,
|
|
232
|
-
icon: (<Icon source={Search} size="24" stroke="2" viewBox="0 0 24 24" aria-label="Search"/>),
|
|
233
|
-
},
|
|
234
|
-
play: async ({ canvasElement }) => {
|
|
235
|
-
const canvas = within(canvasElement);
|
|
236
|
-
const searchIcon = document.querySelector('g[data-name="Search icon"]');
|
|
237
|
-
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
238
|
-
await expect(searchIcon).toBeVisible();
|
|
239
|
-
},
|
|
240
|
-
};
|
|
241
|
-
/**
|
|
242
|
-
* ```tsx
|
|
243
|
-
* <Button
|
|
244
|
-
* icon={<Icon
|
|
245
|
-
* source={Cart}
|
|
246
|
-
* size="24"
|
|
247
|
-
* stroke="2"
|
|
248
|
-
* viewBox="0 0 24 24"
|
|
249
|
-
* aria-label="Search" />}
|
|
250
|
-
* >
|
|
251
|
-
* Search
|
|
252
|
-
* </Button>
|
|
253
|
-
* ```
|
|
254
|
-
*/
|
|
255
|
-
export const TextAndIcon = {
|
|
256
|
-
args: {
|
|
257
|
-
...IconOnly.args,
|
|
258
|
-
children: 'Search',
|
|
259
|
-
},
|
|
260
|
-
play: async ({ canvasElement }) => {
|
|
261
|
-
const canvas = within(canvasElement);
|
|
262
|
-
const searchIcon = document.querySelector('g[data-name="Search icon"]');
|
|
263
|
-
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
264
|
-
await expect(searchIcon).toBeVisible();
|
|
265
|
-
await expect(canvas.getByText('Search')).toBeVisible();
|
|
266
|
-
},
|
|
267
|
-
};
|
|
268
|
-
/**
|
|
269
|
-
* ```tsx
|
|
270
|
-
* <Button disabled>Button</Button>
|
|
271
|
-
* ```
|
|
272
|
-
* ```tsx
|
|
273
|
-
* <Button disabled={true}>Button</Button>
|
|
274
|
-
* ```
|
|
275
|
-
* ```tsx
|
|
276
|
-
* <Button disabled={loop ? false : current < 1}>Button</Button>
|
|
277
|
-
* ```
|
|
278
|
-
*/
|
|
279
|
-
export const Disabled = {
|
|
280
|
-
args: {
|
|
281
|
-
...Primary.args,
|
|
282
|
-
children: 'Button',
|
|
283
|
-
disabled: true,
|
|
284
|
-
},
|
|
285
|
-
play: async ({ canvasElement }) => {
|
|
286
|
-
const canvas = within(canvasElement);
|
|
287
|
-
await expect(await canvas.findByRole('button')).toBeDisabled();
|
|
288
|
-
await expect(canvas.getByText('Button')).toBeVisible();
|
|
289
|
-
},
|
|
290
|
-
};
|
|
291
|
-
/**
|
|
292
|
-
* ```tsx
|
|
293
|
-
* <Button
|
|
294
|
-
* active={true}
|
|
295
|
-
* activeChildren="Active"
|
|
296
|
-
* activeIcon={<Icon source={SearchFilled} />}
|
|
297
|
-
* children="Not Active"
|
|
298
|
-
* icon={<Icon source={Search} />}
|
|
299
|
-
* />
|
|
300
|
-
* ```
|
|
301
|
-
*/
|
|
302
|
-
export const Active = {
|
|
303
|
-
args: {
|
|
304
|
-
...Primary.args,
|
|
305
|
-
active: true,
|
|
306
|
-
activeChildren: 'Active',
|
|
307
|
-
activeIcon: (<Icon source={SearchFilled} size="24" stroke="2" viewBox="0 0 24 24"/>),
|
|
308
|
-
children: 'Not Active',
|
|
309
|
-
icon: <Icon source={Search} size="24" stroke="2" viewBox="0 0 24 24"/>,
|
|
310
|
-
},
|
|
311
|
-
play: async ({ canvasElement }) => {
|
|
312
|
-
const canvas = within(canvasElement);
|
|
313
|
-
const searchIcon = document.querySelector('[data-name="Search icon filled"]');
|
|
314
|
-
await expect(await canvas.findByRole('button')).toBeVisible();
|
|
315
|
-
await expect(canvas.getByText('Active')).toBeVisible();
|
|
316
|
-
await expect(searchIcon).toBeVisible();
|
|
317
|
-
},
|
|
318
|
-
};
|
|
319
|
-
/**
|
|
320
|
-
* ```tsx
|
|
321
|
-
* <Button
|
|
322
|
-
* active={false}
|
|
323
|
-
* activeChildren="Active"
|
|
324
|
-
* activeIcon={<Icon source={SearchFilled} />}
|
|
325
|
-
* children="Not Active"
|
|
326
|
-
* icon={<Icon source={Search} />}
|
|
327
|
-
* />
|
|
328
|
-
* ```
|
|
329
|
-
*/
|
|
330
|
-
export const NotActive = {
|
|
331
|
-
args: {
|
|
332
|
-
...Active.args,
|
|
333
|
-
active: false,
|
|
334
|
-
},
|
|
335
|
-
};
|
|
336
|
-
/**
|
|
337
|
-
* ```tsx
|
|
338
|
-
* <Button href="https://google.com">Link</Button>
|
|
339
|
-
* ```
|
|
340
|
-
*/
|
|
341
|
-
export const AsLink = {
|
|
342
|
-
args: {
|
|
343
|
-
...Primary.args,
|
|
344
|
-
href: 'https://google.com',
|
|
345
|
-
children: 'Link',
|
|
346
|
-
icon: undefined,
|
|
347
|
-
onClick: undefined,
|
|
348
|
-
},
|
|
349
|
-
play: async ({ canvasElement }) => {
|
|
350
|
-
const canvas = within(canvasElement);
|
|
351
|
-
await expect(await canvas.findByRole('link')).toBeVisible();
|
|
352
|
-
await expect(canvas.getByText('Link')).toBeVisible();
|
|
353
|
-
},
|
|
354
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Button.test.d.ts","sourceRoot":"","sources":["../../../src/components/Button/Button.test.tsx"],"names":[],"mappings":""}
|
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
2
|
-
import { Button } from '@adobe/elsie/components';
|
|
3
|
-
//test rendering of button
|
|
4
|
-
describe('Base Components/Button', () => {
|
|
5
|
-
//test rendering of button
|
|
6
|
-
test('renders', () => {
|
|
7
|
-
const { container } = render(<Button icon={<div>icon</div>} children="test"/>);
|
|
8
|
-
const elem = container.querySelector('.dropin-button, .dropin-icon, .dropin-iconButton');
|
|
9
|
-
expect(!!elem).toEqual(true);
|
|
10
|
-
expect(elem.tagName).toEqual('BUTTON');
|
|
11
|
-
});
|
|
12
|
-
test('renders as link', () => {
|
|
13
|
-
const { container } = render(<Button href="https://google.com" icon={<div>icon</div>} children="test"/>);
|
|
14
|
-
const elem = container.querySelector('.dropin-button, .dropin-icon, .dropin-iconButton');
|
|
15
|
-
expect(!!elem).toEqual(true);
|
|
16
|
-
expect(elem.tagName).toEqual('A');
|
|
17
|
-
expect(elem.getAttribute('href')).toEqual('https://google.com');
|
|
18
|
-
});
|
|
19
|
-
//test rendering of button with text
|
|
20
|
-
test('renders with text', () => {
|
|
21
|
-
const { container } = render(<Button children="test"/>);
|
|
22
|
-
const elem = container.querySelector('.dropin-button');
|
|
23
|
-
expect(elem.classList.contains('dropin-button')).toEqual(true);
|
|
24
|
-
});
|
|
25
|
-
//test rendering of button with children
|
|
26
|
-
test('renders with children', () => {
|
|
27
|
-
const { container } = render(<Button children={<span>test</span>}/>);
|
|
28
|
-
const elem = container.querySelector('.dropin-button');
|
|
29
|
-
expect(elem.classList.contains('dropin-button')).toEqual(true);
|
|
30
|
-
});
|
|
31
|
-
//test rendering of button with icon only
|
|
32
|
-
test('renders with icon only', () => {
|
|
33
|
-
const { container } = render(<Button icon={<div>icon</div>} children=""/>);
|
|
34
|
-
const elem2 = container.querySelector('.dropin-iconButton');
|
|
35
|
-
expect(elem2.classList.contains('dropin-iconButton')).toEqual(true);
|
|
36
|
-
});
|
|
37
|
-
//test rendering of button with text and icon
|
|
38
|
-
test('renders with text and icon', () => {
|
|
39
|
-
const { container } = render(<Button icon={<div>icon</div>} children="test"/>);
|
|
40
|
-
const elem = container.querySelector('.dropin-button-icon');
|
|
41
|
-
expect(elem.classList.contains('dropin-button-icon')).toEqual(true);
|
|
42
|
-
const elem2 = container.querySelector('.dropin-button');
|
|
43
|
-
expect(elem2.classList.contains('dropin-button')).toEqual(true);
|
|
44
|
-
});
|
|
45
|
-
//test rendering of button variants
|
|
46
|
-
test('renders correct variants', () => {
|
|
47
|
-
//test rendering correct button variants with icon only
|
|
48
|
-
const { container, rerender } = render(<Button variant="primary" icon={<div>icon</div>} children=""/>);
|
|
49
|
-
const primary = container.querySelector('.dropin-iconButton');
|
|
50
|
-
expect(primary.classList.contains('dropin-iconButton--primary')).toEqual(true);
|
|
51
|
-
rerender(<Button variant="secondary" icon={<div>icon</div>} children=""/>);
|
|
52
|
-
const secondary = container.querySelector('.dropin-iconButton');
|
|
53
|
-
expect(secondary.classList.contains('dropin-iconButton--secondary')).toEqual(true);
|
|
54
|
-
rerender(<Button variant="tertiary" icon={<div>icon</div>} children=""/>);
|
|
55
|
-
const tertiary = container.querySelector('.dropin-iconButton');
|
|
56
|
-
expect(tertiary.classList.contains('dropin-iconButton--tertiary')).toEqual(true);
|
|
57
|
-
//test rendering correct button variants with text and icon
|
|
58
|
-
rerender(<Button variant="primary" icon={<div>icon</div>} children="test"/>);
|
|
59
|
-
const primaryText = container.querySelector('.dropin-button');
|
|
60
|
-
expect(primaryText.classList.contains('dropin-button--primary')).toEqual(true);
|
|
61
|
-
rerender(<Button variant="secondary" icon={<div>icon</div>} children="test"/>);
|
|
62
|
-
const secondaryText = container.querySelector('.dropin-button');
|
|
63
|
-
expect(secondaryText.classList.contains('dropin-button--secondary')).toEqual(true);
|
|
64
|
-
rerender(<Button variant="tertiary" icon={<div>icon</div>} children="test"/>);
|
|
65
|
-
const tertiaryText = container.querySelector('.dropin-button');
|
|
66
|
-
expect(tertiaryText.classList.contains('dropin-button--tertiary')).toEqual(true);
|
|
67
|
-
//test rendering correct button variants with no icon / text only
|
|
68
|
-
rerender(<Button variant="primary" children="test" icon={undefined}/>);
|
|
69
|
-
const primaryTextNoIcon = container.querySelector('.dropin-button');
|
|
70
|
-
expect(primaryTextNoIcon.classList.contains('dropin-button--primary')).toEqual(true);
|
|
71
|
-
rerender(<Button variant="secondary" children="test" icon={undefined}/>);
|
|
72
|
-
const secondaryTextNoIcon = container.querySelector('.dropin-button');
|
|
73
|
-
expect(secondaryTextNoIcon.classList.contains('dropin-button--secondary')).toEqual(true);
|
|
74
|
-
rerender(<Button variant="tertiary" children="test" icon={undefined}/>);
|
|
75
|
-
const tertiaryTextNoIcon = container.querySelector('.dropin-button');
|
|
76
|
-
expect(tertiaryTextNoIcon.classList.contains('dropin-button--tertiary')).toEqual(true);
|
|
77
|
-
});
|
|
78
|
-
//test rendering of button disabled with button variants
|
|
79
|
-
test('renders correct disabled variants', () => {
|
|
80
|
-
//test rendering correct button disabled variants with icon only
|
|
81
|
-
const { container, rerender } = render(<Button variant="primary" icon={<div>icon</div>} children="" disabled/>);
|
|
82
|
-
const primary = container.querySelector('.dropin-iconButton');
|
|
83
|
-
expect(primary.classList.contains('dropin-iconButton--primary--disabled')).toEqual(true);
|
|
84
|
-
rerender(<Button variant="secondary" icon={<div>icon</div>} children="" disabled/>);
|
|
85
|
-
const secondary = container.querySelector('.dropin-iconButton');
|
|
86
|
-
expect(secondary.classList.contains('dropin-iconButton--secondary--disabled')).toEqual(true);
|
|
87
|
-
rerender(<Button variant="tertiary" icon={<div>icon</div>} children="" disabled/>);
|
|
88
|
-
const tertiary = container.querySelector('.dropin-iconButton');
|
|
89
|
-
expect(tertiary.classList.contains('dropin-iconButton--tertiary--disabled')).toEqual(true);
|
|
90
|
-
//test rendering correct button disabled variants with text and icon
|
|
91
|
-
rerender(<Button variant="primary" icon={<div>icon</div>} children="test" disabled/>);
|
|
92
|
-
const primaryText = container.querySelector('.dropin-button');
|
|
93
|
-
expect(primaryText.classList.contains('dropin-button--primary--disabled')).toEqual(true);
|
|
94
|
-
rerender(<Button variant="secondary" icon={<div>icon</div>} children="test" disabled/>);
|
|
95
|
-
const secondaryText = container.querySelector('.dropin-button');
|
|
96
|
-
expect(secondaryText.classList.contains('dropin-button--secondary--disabled')).toEqual(true);
|
|
97
|
-
rerender(<Button variant="tertiary" icon={<div>icon</div>} children="test" disabled/>);
|
|
98
|
-
const tertiaryText = container.querySelector('.dropin-button');
|
|
99
|
-
expect(tertiaryText.classList.contains('dropin-button--tertiary--disabled')).toEqual(true);
|
|
100
|
-
});
|
|
101
|
-
//test rendering of button sizes
|
|
102
|
-
test('renders correct sizes', () => {
|
|
103
|
-
//test rendering correct button sizes with text
|
|
104
|
-
const { container, rerender } = render(<Button children="test" size="medium"/>);
|
|
105
|
-
const primaryText = container.querySelector('.dropin-button');
|
|
106
|
-
expect(primaryText.classList.contains('dropin-button--medium')).toEqual(true);
|
|
107
|
-
rerender(<Button children="test" size="large"/>);
|
|
108
|
-
const secondaryText = container.querySelector('.dropin-button');
|
|
109
|
-
expect(secondaryText.classList.contains('dropin-button--large')).toEqual(true);
|
|
110
|
-
});
|
|
111
|
-
//tests rending of active state variations
|
|
112
|
-
test('renders correct active variants', () => {
|
|
113
|
-
//test rendering active state with icon
|
|
114
|
-
const { container, rerender } = render(<Button activeIcon={<div>icon</div>} children="" active={true}/>);
|
|
115
|
-
const active = container.querySelector('.dropin-iconButton');
|
|
116
|
-
expect(active.classList.contains('dropin-iconButton--primary')).toEqual(true);
|
|
117
|
-
//test rending of active state with icon active, no children, active is true, and activeChidlren is available
|
|
118
|
-
rerender(<Button variant="primary" icon={<div>icon</div>} children="" active={true} activeIcon={<div>icon</div>} activeChildren="test"/>);
|
|
119
|
-
const active2 = container.querySelector('.dropin-button');
|
|
120
|
-
expect(active2.classList.contains('dropin-button--primary')).toEqual(true);
|
|
121
|
-
//test with children, active, and active children
|
|
122
|
-
rerender(<Button variant="primary" icon={<div>icon</div>} children="test" active={true} activeIcon={<div>icon</div>} activeChildren="test"/>);
|
|
123
|
-
const active3 = container.querySelector('.dropin-button');
|
|
124
|
-
expect(active3.classList.contains('dropin-button--primary')).toEqual(true);
|
|
125
|
-
//test with children, active, and active children with non-string in activeChildren
|
|
126
|
-
rerender(<Button variant="primary" icon={<div>icon</div>} children="test" active={true} activeIcon={<div>icon</div>} activeChildren={<div>icon</div>}/>);
|
|
127
|
-
const active4 = container.querySelector('.dropin-button');
|
|
128
|
-
expect(active4.classList.contains('dropin-button--primary')).toEqual(true);
|
|
129
|
-
//test with no children, active, and active children
|
|
130
|
-
rerender(<Button variant="primary" icon={<div>icon</div>} children={undefined} active={true} activeIcon={<div>icon</div>} activeChildren={<div>icon</div>}/>);
|
|
131
|
-
const active5 = container.querySelector('.dropin-button');
|
|
132
|
-
expect(active5.classList.contains('dropin-button--primary')).toEqual(true);
|
|
133
|
-
});
|
|
134
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Button/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC;AACtD,OAAO,EAAE,MAAM,IAAI,OAAO,EAAE,MAAM,uCAAuC,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { ComponentChildren, FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/Card/Card.css';
|
|
4
|
-
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
-
variant?: 'primary' | 'secondary';
|
|
6
|
-
children: ComponentChildren | ComponentChildren[];
|
|
7
|
-
}
|
|
8
|
-
export declare const Card: FunctionComponent<CardProps>;
|
|
9
|
-
//# sourceMappingURL=Card.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Card.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC9D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAE/C,OAAO,uCAAuC,CAAC;AAE/C,MAAM,WAAW,SAAU,SAAQ,cAAc,CAAC,cAAc,CAAC;IAC/D,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;IAClC,QAAQ,EAAE,iBAAiB,GAAG,iBAAiB,EAAE,CAAC;CACnD;AAED,eAAO,MAAM,IAAI,EAAE,iBAAiB,CAAC,SAAS,CAc7C,CAAC"}
|
package/components/Card/Card.jsx
DELETED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { classes } from '@adobe/elsie/lib';
|
|
2
|
-
import '@adobe/elsie/components/Card/Card.css';
|
|
3
|
-
export const Card = ({ variant = 'primary', className, children, ...props }) => {
|
|
4
|
-
return (<div {...props} className={classes(['dropin-card', `dropin-card--${variant}`, className])}>
|
|
5
|
-
<div class="dropin-card__content">{children}</div>
|
|
6
|
-
</div>);
|
|
7
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { CardProps } from '@adobe/elsie/components/Card';
|
|
3
|
-
/**
|
|
4
|
-
* Use Cards to group content into a single container.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<CardProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<CardProps>;
|
|
9
|
-
/**
|
|
10
|
-
* ```ts
|
|
11
|
-
* import { Card } from '@adobe/elsie/components/Card';
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare const Primary: Story;
|
|
15
|
-
export declare const Secondary: Story;
|
|
16
|
-
//# sourceMappingURL=Card.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Card.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAQ,SAAS,EAAE,MAAM,8BAA8B,CAAC;AAI/D;;GAEG;AAEH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,SAAS,CASzB,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,SAAS,CAAC,CAAC;AAEjC;;;;GAIG;AAEH,eAAO,MAAM,OAAO,EAAE,KAuBrB,CAAC;AAEF,eAAO,MAAM,SAAS,EAAE,KAMvB,CAAC"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Card } from '@adobe/elsie/components/Card';
|
|
2
|
-
import { within } from '@storybook/testing-library';
|
|
3
|
-
import { expect } from '@storybook/jest';
|
|
4
|
-
/**
|
|
5
|
-
* Use Cards to group content into a single container.
|
|
6
|
-
*/
|
|
7
|
-
const meta = {
|
|
8
|
-
title: 'Components/Card',
|
|
9
|
-
component: Card,
|
|
10
|
-
argTypes: {
|
|
11
|
-
variant: {
|
|
12
|
-
options: ['primary', 'secondary'],
|
|
13
|
-
control: { type: 'radio' },
|
|
14
|
-
},
|
|
15
|
-
},
|
|
16
|
-
};
|
|
17
|
-
export default meta;
|
|
18
|
-
/**
|
|
19
|
-
* ```ts
|
|
20
|
-
* import { Card } from '@adobe/elsie/components/Card';
|
|
21
|
-
* ```
|
|
22
|
-
*/
|
|
23
|
-
export const Primary = {
|
|
24
|
-
name: 'Primary Card',
|
|
25
|
-
args: {
|
|
26
|
-
variant: 'primary',
|
|
27
|
-
},
|
|
28
|
-
render: ({ variant }) => (<Card variant={variant}>
|
|
29
|
-
<h2 style={{ font: 'var(--type-headline-2-strong-font)' }}>Title</h2>
|
|
30
|
-
<p style={{ font: 'var(--type-body-2-default-font)' }}>
|
|
31
|
-
This is a short description of the item and should be kept to two or
|
|
32
|
-
three lines as maximum.
|
|
33
|
-
</p>
|
|
34
|
-
</Card>),
|
|
35
|
-
play: async ({ canvasElement }) => {
|
|
36
|
-
const canvas = within(canvasElement);
|
|
37
|
-
await expect(await canvas.getByText('Title')).toBeVisible();
|
|
38
|
-
await expect(await canvas.getByText('This is a short description of the item and should be kept to two or three lines as maximum.')).toBeVisible();
|
|
39
|
-
},
|
|
40
|
-
};
|
|
41
|
-
export const Secondary = {
|
|
42
|
-
name: 'Secondary Card',
|
|
43
|
-
args: {
|
|
44
|
-
variant: 'secondary',
|
|
45
|
-
},
|
|
46
|
-
render: Primary.render,
|
|
47
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Card.test.d.ts","sourceRoot":"","sources":["../../../src/components/Card/Card.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { Card } from '@adobe/elsie/components/Card';
|
|
4
|
-
describe('Containment/Card', () => {
|
|
5
|
-
test('it renders', () => {
|
|
6
|
-
const { container } = render(<Card children="some content"/>);
|
|
7
|
-
const elem = container.querySelector('.dropin-card');
|
|
8
|
-
expect(!!elem).toEqual(true);
|
|
9
|
-
});
|
|
10
|
-
test('it renders with some extra content', () => {
|
|
11
|
-
const { container } = render(<Card children={<>
|
|
12
|
-
<h2>Title</h2>
|
|
13
|
-
<p>some content</p>
|
|
14
|
-
</>}/>);
|
|
15
|
-
const elem = container.querySelector('.dropin-card');
|
|
16
|
-
expect(!!elem).toEqual(true);
|
|
17
|
-
});
|
|
18
|
-
test('it renders correct variants', () => {
|
|
19
|
-
const { container, rerender } = render(<Card variant="primary" children="some content"/>);
|
|
20
|
-
const primary = container.querySelector('.dropin-card');
|
|
21
|
-
expect(primary.classList.contains('dropin-card--primary')).toEqual(true);
|
|
22
|
-
rerender(<Card variant="secondary" children="some content"/>);
|
|
23
|
-
const secondary = container.querySelector('.dropin-card');
|
|
24
|
-
expect(secondary.classList.contains('dropin-card--secondary')).toEqual(true);
|
|
25
|
-
});
|
|
26
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Card/index.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAC"}
|
package/components/Card/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@adobe/elsie/components/Card/Card';
|