@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,90 +0,0 @@
|
|
|
1
|
-
import { IllustratedMessage as component, } from '@adobe/elsie/components/IllustratedMessage';
|
|
2
|
-
import { Placeholder } from '@adobe/elsie/icons';
|
|
3
|
-
import { Button, Icon } from '@adobe/elsie/components';
|
|
4
|
-
import { expect } from '@storybook/jest';
|
|
5
|
-
import { IconsList } from '@adobe/elsie/components/Icon/Icon.stories.helpers';
|
|
6
|
-
/**
|
|
7
|
-
* Use IllustratedMessages to display an illustration and a message, usually for an empty state or an error page.
|
|
8
|
-
*/
|
|
9
|
-
const meta = {
|
|
10
|
-
title: 'Components/IllustratedMessage',
|
|
11
|
-
component,
|
|
12
|
-
argTypes: {
|
|
13
|
-
icon: {
|
|
14
|
-
description: 'Icon to display in the IllustratedMessage.',
|
|
15
|
-
table: {
|
|
16
|
-
type: { summary: 'FunctionComponent', required: false },
|
|
17
|
-
},
|
|
18
|
-
options: Object.keys(IconsList),
|
|
19
|
-
mapping: IconsList,
|
|
20
|
-
control: { type: 'select', defaultValue: 'Placeholder' },
|
|
21
|
-
},
|
|
22
|
-
heading: {
|
|
23
|
-
description: 'Heading text to display in the IllustratedMessage.',
|
|
24
|
-
control: { type: 'text' },
|
|
25
|
-
type: { name: 'string', required: false },
|
|
26
|
-
},
|
|
27
|
-
headingLevel: {
|
|
28
|
-
description: 'Heading level to display in the IllustratedMessage.',
|
|
29
|
-
control: { type: 'select', default: 2 },
|
|
30
|
-
options: [1, 2, 3, 4, 5, 6],
|
|
31
|
-
type: { name: 'string', required: false },
|
|
32
|
-
},
|
|
33
|
-
message: {
|
|
34
|
-
description: 'Message to display in the IllustratedMessage.',
|
|
35
|
-
options: ['Short', 'Long'],
|
|
36
|
-
mapping: {
|
|
37
|
-
Short: <div>Short message</div>,
|
|
38
|
-
Long: (<div>
|
|
39
|
-
Illustrated message with an extremely extremely long message
|
|
40
|
-
</div>),
|
|
41
|
-
},
|
|
42
|
-
control: {
|
|
43
|
-
type: 'select',
|
|
44
|
-
labels: {
|
|
45
|
-
Short: 'Short message',
|
|
46
|
-
Long: 'Long message',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
table: {
|
|
50
|
-
type: { summary: 'FunctionComponent', required: false },
|
|
51
|
-
},
|
|
52
|
-
},
|
|
53
|
-
action: {
|
|
54
|
-
description: 'Action to display in the IllustratedMessage.',
|
|
55
|
-
control: { type: 'function' },
|
|
56
|
-
table: {
|
|
57
|
-
type: { summary: 'FunctionComponent', required: false },
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
variant: {
|
|
61
|
-
description: 'Variant to display in the IllustratedMessage.',
|
|
62
|
-
control: { type: 'radio', default: 'secondary' },
|
|
63
|
-
options: ['primary', 'secondary'],
|
|
64
|
-
type: { name: 'string', required: false },
|
|
65
|
-
},
|
|
66
|
-
},
|
|
67
|
-
};
|
|
68
|
-
export default meta;
|
|
69
|
-
export const IllustratedMessage = {
|
|
70
|
-
args: {
|
|
71
|
-
icon: <Icon source={Placeholder} size="80"/>,
|
|
72
|
-
heading: 'Illustrated Message heading',
|
|
73
|
-
headingLevel: 3,
|
|
74
|
-
message: <p>Illustrated Message text content</p>,
|
|
75
|
-
action: <Button>Illustrated Message action</Button>,
|
|
76
|
-
variant: 'secondary',
|
|
77
|
-
},
|
|
78
|
-
play: async () => {
|
|
79
|
-
const illustratedMessage = document.querySelector('div[class*="dropin-illustrated-message"]');
|
|
80
|
-
await expect(illustratedMessage).toBeVisible();
|
|
81
|
-
const icon = illustratedMessage.querySelector('.dropin-illustrated-message__icon');
|
|
82
|
-
await expect(icon).toBeVisible();
|
|
83
|
-
const heading = illustratedMessage.querySelector('.dropin-illustrated-message__heading');
|
|
84
|
-
await expect(heading).toBeVisible();
|
|
85
|
-
const message = illustratedMessage.querySelector('.dropin-illustrated-message__message');
|
|
86
|
-
await expect(message).toBeVisible();
|
|
87
|
-
const action = illustratedMessage.querySelector('.dropin-illustrated-message__action');
|
|
88
|
-
await expect(action).toBeVisible();
|
|
89
|
-
},
|
|
90
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"IllustratedMessage.test.d.ts","sourceRoot":"","sources":["../../../src/components/IllustratedMessage/IllustratedMessage.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { IllustratedMessage } from '@adobe/elsie/components/IllustratedMessage';
|
|
4
|
-
import { Button } from '@adobe/elsie/components';
|
|
5
|
-
describe('Base/Components/IllustratedMessage', () => {
|
|
6
|
-
test('renders', () => {
|
|
7
|
-
const { container } = render(<IllustratedMessage />);
|
|
8
|
-
expect(!!container).toEqual(true);
|
|
9
|
-
expect(container).toMatchSnapshot();
|
|
10
|
-
const component = container.querySelector('.dropin-illustrated-message');
|
|
11
|
-
expect(component).not.toBeNull();
|
|
12
|
-
});
|
|
13
|
-
test('renders with icon, heading and message', () => {
|
|
14
|
-
const { container } = render(<IllustratedMessage icon={<svg />} heading={'heading'} message={<p>message</p>} action={<Button>action</Button>}/>);
|
|
15
|
-
expect(!!container).toEqual(true);
|
|
16
|
-
expect(container).toMatchSnapshot();
|
|
17
|
-
const icon = container.querySelector('.dropin-illustrated-message__icon');
|
|
18
|
-
expect(icon).not.toBeNull();
|
|
19
|
-
const heading = container.querySelector('.dropin-illustrated-message__heading');
|
|
20
|
-
expect(heading).not.toBeNull();
|
|
21
|
-
const message = container.querySelector('.dropin-illustrated-message__message');
|
|
22
|
-
expect(message).not.toBeNull();
|
|
23
|
-
const action = container.querySelector('.dropin-illustrated-message__action');
|
|
24
|
-
expect(action).not.toBeNull();
|
|
25
|
-
});
|
|
26
|
-
test('renders H1 when heading level is 1', () => {
|
|
27
|
-
const { container } = render(<IllustratedMessage heading={'heading'} headingLevel={1}/>);
|
|
28
|
-
expect(!!container).toEqual(true);
|
|
29
|
-
expect(container).toMatchSnapshot();
|
|
30
|
-
const heading = container.querySelector('.dropin-illustrated-message__heading');
|
|
31
|
-
expect(heading?.tagName).toEqual('H1');
|
|
32
|
-
});
|
|
33
|
-
test('renders H2 when heading level is unknown', () => {
|
|
34
|
-
const { container } = render(
|
|
35
|
-
// @ts-ignore
|
|
36
|
-
<IllustratedMessage heading={'heading'} headingLevel={0}/>);
|
|
37
|
-
expect(!!container).toEqual(true);
|
|
38
|
-
expect(container).toMatchSnapshot();
|
|
39
|
-
const heading = container.querySelector('.dropin-illustrated-message__heading');
|
|
40
|
-
expect(heading?.tagName).toEqual('H2');
|
|
41
|
-
});
|
|
42
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/IllustratedMessage/index.ts"],"names":[],"mappings":"AAAA,cAAc,+DAA+D,CAAC;AAC9E,OAAO,EAAE,kBAAkB,IAAI,OAAO,EAAE,MAAM,+DAA+D,CAAC"}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import { ResolveImageUrlOptions } from '@adobe/elsie/lib';
|
|
4
|
-
import '@adobe/elsie/components/Image/Image.css';
|
|
5
|
-
export interface ImageProps extends HTMLAttributes<HTMLDivElement> {
|
|
6
|
-
params?: ResolveImageUrlOptions;
|
|
7
|
-
src: string;
|
|
8
|
-
onLoad?: (e: any) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare const Image: FunctionComponent<ImageProps>;
|
|
11
|
-
//# sourceMappingURL=Image.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Image.d.ts","sourceRoot":"","sources":["../../../src/components/Image/Image.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAqB,MAAM,eAAe,CAAC;AAClE,OAAO,EAGL,sBAAsB,EACvB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,yCAAyC,CAAC;AAEjD,MAAM,WAAW,UAAW,SAAQ,cAAc,CAAC,cAAc,CAAC;IAChE,MAAM,CAAC,EAAE,sBAAsB,CAAC;IAChC,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,GAAG,KAAK,IAAI,CAAC;CAC3B;AACD,eAAO,MAAM,KAAK,EAAE,iBAAiB,CAAC,UAAU,CA0C/C,CAAC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useMemo, useState } from 'preact/compat';
|
|
2
|
-
import { classes, generateSrcset, } from '@adobe/elsie/lib';
|
|
3
|
-
import '@adobe/elsie/components/Image/Image.css';
|
|
4
|
-
export const Image = ({ className, src, params, loading = 'lazy', srcSet, onLoad, ...props }) => {
|
|
5
|
-
const [loaded, setLoaded] = useState(false);
|
|
6
|
-
const _srcSet = useMemo(() => {
|
|
7
|
-
// If srcSet is provided, use it
|
|
8
|
-
if (srcSet)
|
|
9
|
-
return srcSet;
|
|
10
|
-
// If src is not provided, return "undefined"
|
|
11
|
-
if (!src || !params)
|
|
12
|
-
return;
|
|
13
|
-
// Otherwise, generate srcSet based on params
|
|
14
|
-
return generateSrcset(src, { ...params });
|
|
15
|
-
}, [params, src, srcSet]);
|
|
16
|
-
// Add class at image onLoad
|
|
17
|
-
const onLoadHandler = (e) => {
|
|
18
|
-
setLoaded(true);
|
|
19
|
-
onLoad?.(e);
|
|
20
|
-
};
|
|
21
|
-
return (<img {...props} className={classes([
|
|
22
|
-
'dropin-image',
|
|
23
|
-
['dropin-image--loaded', loaded],
|
|
24
|
-
className,
|
|
25
|
-
])} loading={loading} onLoad={onLoadHandler} src={src} srcSet={_srcSet}/>);
|
|
26
|
-
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { ImageProps } from '@adobe/elsie/components/Image';
|
|
3
|
-
/**
|
|
4
|
-
* Use Images to display visual content like photos and illustrations.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<ImageProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<ImageProps>;
|
|
9
|
-
export declare const Primary: Story;
|
|
10
|
-
export declare const WithParams: Story;
|
|
11
|
-
//# sourceMappingURL=Image.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Image.stories.d.ts","sourceRoot":"","sources":["../../../src/components/Image/Image.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAS,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAMlE;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,UAAU,CA+B1B,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,UAAU,CAAC,CAAC;AAElC,eAAO,MAAM,OAAO,EAAE,KAgBrB,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,KASxB,CAAC"}
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
import { Image } from '@adobe/elsie/components/Image';
|
|
2
|
-
import { expect } from '@storybook/jest';
|
|
3
|
-
const defaultWidth = 384;
|
|
4
|
-
const defaultHeight = 288;
|
|
5
|
-
/**
|
|
6
|
-
* Use Images to display visual content like photos and illustrations.
|
|
7
|
-
*/
|
|
8
|
-
const meta = {
|
|
9
|
-
title: 'Components/Image',
|
|
10
|
-
component: Image,
|
|
11
|
-
argTypes: {
|
|
12
|
-
width: {
|
|
13
|
-
description: 'Image width',
|
|
14
|
-
type: 'number',
|
|
15
|
-
},
|
|
16
|
-
height: {
|
|
17
|
-
description: 'Image height',
|
|
18
|
-
type: 'number',
|
|
19
|
-
},
|
|
20
|
-
loading: {
|
|
21
|
-
description: 'Loading strategy',
|
|
22
|
-
control: {
|
|
23
|
-
type: 'select',
|
|
24
|
-
},
|
|
25
|
-
table: {
|
|
26
|
-
defaultValue: {
|
|
27
|
-
summary: 'lazy',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
options: ['lazy', 'eager'],
|
|
31
|
-
},
|
|
32
|
-
params: {
|
|
33
|
-
description: 'Parameters appened to the image URL',
|
|
34
|
-
control: {
|
|
35
|
-
type: 'object',
|
|
36
|
-
},
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
};
|
|
40
|
-
export default meta;
|
|
41
|
-
export const Primary = {
|
|
42
|
-
args: {
|
|
43
|
-
src: `https://picsum.photos/${defaultWidth}/${defaultHeight}`,
|
|
44
|
-
alt: 'Some alternative text',
|
|
45
|
-
loading: 'lazy',
|
|
46
|
-
width: defaultWidth,
|
|
47
|
-
height: defaultHeight,
|
|
48
|
-
},
|
|
49
|
-
play: async () => {
|
|
50
|
-
const elem = document.querySelector('.dropin-image');
|
|
51
|
-
await expect(elem).toBeVisible();
|
|
52
|
-
// Without this wait test failing intermittently as Simulate loading delay (adjust the timeout as needed)
|
|
53
|
-
await new Promise((resolve) => setTimeout(resolve, 3500));
|
|
54
|
-
await expect(elem).toHaveClass('dropin-image--loaded');
|
|
55
|
-
},
|
|
56
|
-
};
|
|
57
|
-
export const WithParams = {
|
|
58
|
-
args: {
|
|
59
|
-
src: `https://picsum.photos/${defaultWidth}/${defaultHeight}`,
|
|
60
|
-
params: { width: defaultWidth },
|
|
61
|
-
alt: 'Some alternative text',
|
|
62
|
-
loading: 'lazy',
|
|
63
|
-
width: defaultWidth,
|
|
64
|
-
height: defaultHeight,
|
|
65
|
-
},
|
|
66
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Image.test.d.ts","sourceRoot":"","sources":["../../../src/components/Image/Image.test.tsx"],"names":[],"mappings":"AAAA,6DAA6D"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
/** https://preactjs.com/guide/v10/preact-testing-library/ */
|
|
2
|
-
import { render, waitFor } from '@adobe/elsie/lib/tests';
|
|
3
|
-
import { Image } from '@adobe/elsie/components/Image';
|
|
4
|
-
import { fireEvent } from '@storybook/testing-library';
|
|
5
|
-
describe('Image', () => {
|
|
6
|
-
test('renders plain', () => {
|
|
7
|
-
// @ts-ignore
|
|
8
|
-
const { container } = render(<Image />);
|
|
9
|
-
const elem = container.querySelector('.dropin-image');
|
|
10
|
-
expect(elem).toMatchInlineSnapshot(`
|
|
11
|
-
<img
|
|
12
|
-
class="dropin-image"
|
|
13
|
-
loading="lazy"
|
|
14
|
-
/>
|
|
15
|
-
`);
|
|
16
|
-
});
|
|
17
|
-
});
|
|
18
|
-
describe('onLoad of image', () => {
|
|
19
|
-
test('adds class', async () => {
|
|
20
|
-
const onLoadHandler = jest.fn();
|
|
21
|
-
const { container } = render(<Image src="/test.jpg" onLoad={onLoadHandler}/>);
|
|
22
|
-
const elem = container.querySelector('.dropin-image');
|
|
23
|
-
expect(elem.classList.contains('dropin-image--loaded')).toEqual(false);
|
|
24
|
-
await waitFor(() => {
|
|
25
|
-
fireEvent.load(elem);
|
|
26
|
-
});
|
|
27
|
-
expect(onLoadHandler).toHaveBeenCalledTimes(1);
|
|
28
|
-
expect(elem.classList.contains('dropin-image--loaded')).toEqual(true);
|
|
29
|
-
expect(elem).toMatchInlineSnapshot(`
|
|
30
|
-
<img
|
|
31
|
-
class="dropin-image dropin-image--loaded"
|
|
32
|
-
loading="lazy"
|
|
33
|
-
src="/test.jpg"
|
|
34
|
-
/>
|
|
35
|
-
`);
|
|
36
|
-
});
|
|
37
|
-
});
|
|
38
|
-
describe('renders with src', () => {
|
|
39
|
-
test('renders', () => {
|
|
40
|
-
const { container } = render(<Image src="/test2.jpg"/>);
|
|
41
|
-
const elem = container.querySelector('.dropin-image');
|
|
42
|
-
expect(elem).toMatchInlineSnapshot(`
|
|
43
|
-
<img
|
|
44
|
-
class="dropin-image"
|
|
45
|
-
loading="lazy"
|
|
46
|
-
src="/test2.jpg"
|
|
47
|
-
/>
|
|
48
|
-
`);
|
|
49
|
-
});
|
|
50
|
-
});
|
|
51
|
-
describe('renders with properties and custom srcSet', () => {
|
|
52
|
-
test('renders', () => {
|
|
53
|
-
const { container } = render(<Image src="/test3.jpg" alt="This is a test" width="900" height="600" loading="eager" srcSet="/test3.jpg 900w, /test3.jpg 1200w, /test3.jpg 1800w"/>);
|
|
54
|
-
const elem = container.querySelector('.dropin-image');
|
|
55
|
-
expect(elem).toMatchInlineSnapshot(`
|
|
56
|
-
<img
|
|
57
|
-
alt="This is a test"
|
|
58
|
-
class="dropin-image"
|
|
59
|
-
height="600"
|
|
60
|
-
loading="eager"
|
|
61
|
-
src="/test3.jpg"
|
|
62
|
-
srcset="/test3.jpg 900w, /test3.jpg 1200w, /test3.jpg 1800w"
|
|
63
|
-
width="900"
|
|
64
|
-
/>
|
|
65
|
-
`);
|
|
66
|
-
});
|
|
67
|
-
test('renders with params', () => {
|
|
68
|
-
const { container } = render(<Image src="/test4.jpg" params={{ width: 900 }}/>);
|
|
69
|
-
const elem = container.querySelector('.dropin-image');
|
|
70
|
-
expect(elem).toMatchInlineSnapshot(`
|
|
71
|
-
<img
|
|
72
|
-
class="dropin-image"
|
|
73
|
-
loading="lazy"
|
|
74
|
-
src="/test4.jpg"
|
|
75
|
-
srcset="/test4.jpg?auto=webp&quality=80&crop=false&fit=cover&width=360 768w,
|
|
76
|
-
/test4.jpg?auto=webp&quality=80&crop=false&fit=cover&width=480 1024w,
|
|
77
|
-
/test4.jpg?auto=webp&quality=80&crop=false&fit=cover&width=640.3125 1366w,
|
|
78
|
-
/test4.jpg?auto=webp&quality=80&crop=false&fit=cover&width=900 1920w"
|
|
79
|
-
/>
|
|
80
|
-
`);
|
|
81
|
-
});
|
|
82
|
-
});
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/Image/index.ts"],"names":[],"mappings":"AAAA,cAAc,qCAAqC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from '@adobe/elsie/components/Image/Image';
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { FunctionComponent } from 'preact';
|
|
2
|
-
import { HTMLAttributes } from 'preact/compat';
|
|
3
|
-
import '@adobe/elsie/components/ImageSwatch/ImageSwatch.css';
|
|
4
|
-
export interface ImageSwatchProps extends Omit<HTMLAttributes<HTMLInputElement>, 'label'> {
|
|
5
|
-
name?: string;
|
|
6
|
-
label?: string;
|
|
7
|
-
groupAriaLabel?: string;
|
|
8
|
-
id?: string;
|
|
9
|
-
src: string;
|
|
10
|
-
alt?: string;
|
|
11
|
-
value?: string;
|
|
12
|
-
disabled?: boolean;
|
|
13
|
-
selected?: boolean;
|
|
14
|
-
outOfStock?: boolean;
|
|
15
|
-
multi?: boolean;
|
|
16
|
-
onValue?: (value: any) => void;
|
|
17
|
-
onUpdateError?: (error: Error) => void;
|
|
18
|
-
}
|
|
19
|
-
export declare const ImageSwatch: FunctionComponent<ImageSwatchProps>;
|
|
20
|
-
//# sourceMappingURL=ImageSwatch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageSwatch.d.ts","sourceRoot":"","sources":["../../../src/components/ImageSwatch/ImageSwatch.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,QAAQ,CAAC;AAC3C,OAAO,EAAE,cAAc,EAAe,MAAM,eAAe,CAAC;AAE5D,OAAO,qDAAqD,CAAC;AAI7D,MAAM,WAAW,gBACf,SAAQ,IAAI,CAAC,cAAc,CAAC,gBAAgB,CAAC,EAAE,OAAO,CAAC;IACvD,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,GAAG,EAAE,MAAM,CAAC;IACZ,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,aAAa,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;CACxC;AAED,eAAO,MAAM,WAAW,EAAE,iBAAiB,CAAC,gBAAgB,CAsF3D,CAAC"}
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
import { useCallback } from 'preact/compat';
|
|
2
|
-
import { classes } from '@adobe/elsie/lib';
|
|
3
|
-
import '@adobe/elsie/components/ImageSwatch/ImageSwatch.css';
|
|
4
|
-
import { Image } from '@adobe/elsie/components/Image';
|
|
5
|
-
import { useText } from '@adobe/elsie/i18n';
|
|
6
|
-
export const ImageSwatch = ({ className, name, value, id, label, groupAriaLabel, src, alt, disabled = false, selected = false, outOfStock = false, multi = false, onValue, onUpdateError, ...props }) => {
|
|
7
|
-
const outOfStockLabel = useText('Dropin.Swatches.outOfStock.label').label;
|
|
8
|
-
const selectedLabel = useText('Dropin.Swatches.selected.label').label;
|
|
9
|
-
const swatchLabel = useText('Dropin.Swatches.swatch.label').label;
|
|
10
|
-
const onValueHandler = useCallback(async (newValue) => {
|
|
11
|
-
if (onValue) {
|
|
12
|
-
try {
|
|
13
|
-
await onValue(newValue);
|
|
14
|
-
}
|
|
15
|
-
catch (e) {
|
|
16
|
-
if (onUpdateError) {
|
|
17
|
-
onUpdateError(e);
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}, [onValue, onUpdateError]);
|
|
22
|
-
const handleOnValue = (e) => {
|
|
23
|
-
const input = e.target;
|
|
24
|
-
onValueHandler(input.value);
|
|
25
|
-
};
|
|
26
|
-
const handleAriaLabel = () => {
|
|
27
|
-
if (outOfStock)
|
|
28
|
-
return `${groupAriaLabel}: ${label} ${outOfStockLabel}`;
|
|
29
|
-
if (selected)
|
|
30
|
-
return `${groupAriaLabel}: ${label} ${selectedLabel}`;
|
|
31
|
-
return `${groupAriaLabel}: ${label} ${swatchLabel}`;
|
|
32
|
-
};
|
|
33
|
-
return (<label className={classes(['dropin-image-swatch__container', className])}>
|
|
34
|
-
<input type={multi ? 'checkbox' : 'radio'} name={name} id={id} value={value} aria-label={handleAriaLabel()} checked={selected} disabled={disabled} onChange={handleOnValue} {...props} className={classes([
|
|
35
|
-
'dropin-image-swatch',
|
|
36
|
-
['dropin-image-swatch--selected', selected],
|
|
37
|
-
['dropin-image-swatch--disabled', disabled],
|
|
38
|
-
className,
|
|
39
|
-
])}/>
|
|
40
|
-
|
|
41
|
-
<span className={classes([
|
|
42
|
-
'dropin-image-swatch__span',
|
|
43
|
-
['dropin-image-swatch__span--out-of-stock', outOfStock],
|
|
44
|
-
className,
|
|
45
|
-
])}>
|
|
46
|
-
<Image src={src} className={classes(['dropin-image-swatch__content'])} params={{ width: 100, fit: 'bounds', crop: true }} alt={alt} loading={'lazy'} onError={(e) => (e.target.style.display = 'none')}/>
|
|
47
|
-
</span>
|
|
48
|
-
</label>);
|
|
49
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from '@storybook/preact';
|
|
2
|
-
import { ImageSwatchProps } from '@adobe/elsie/components/ImageSwatch';
|
|
3
|
-
/**
|
|
4
|
-
* Use Image Swatches to display thumbnails of photos or illustrations.
|
|
5
|
-
*/
|
|
6
|
-
declare const meta: Meta<ImageSwatchProps>;
|
|
7
|
-
export default meta;
|
|
8
|
-
type Story = StoryObj<ImageSwatchProps>;
|
|
9
|
-
/**
|
|
10
|
-
* ```ts
|
|
11
|
-
* import { ImageSwatch } from '@adobe/elsie/components/ImageSwatch';
|
|
12
|
-
* ```
|
|
13
|
-
*/
|
|
14
|
-
export declare const DefaultImageSwatch: Story;
|
|
15
|
-
export declare const ImageSwatchSelected: Story;
|
|
16
|
-
export declare const ImageSwatchDisabled: Story;
|
|
17
|
-
export declare const OutOfStockImageSwatch: Story;
|
|
18
|
-
export declare const SelectedOutOfStockImageSwatch: Story;
|
|
19
|
-
export declare const MultiImageSwatch: Story;
|
|
20
|
-
//# sourceMappingURL=ImageSwatch.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageSwatch.stories.d.ts","sourceRoot":"","sources":["../../../src/components/ImageSwatch/ImageSwatch.stories.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAIxD,OAAO,EAEL,gBAAgB,EACjB,MAAM,qCAAqC,CAAC;AAK7C;;GAEG;AACH,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,gBAAgB,CA2EhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,gBAAgB,CAAC,CAAC;AAExC;;;;GAIG;AAEH,eAAO,MAAM,kBAAkB,EAAE,KAuBhC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KA4BjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,KAkBjC,CAAC;AAEF,eAAO,MAAM,qBAAqB,EAAE,KAcnC,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,KAe3C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,KAqB9B,CAAC"}
|