@adobe-commerce/elsie 2.0.0 → 2.0.1-alpha-20260728135101

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.
Files changed (249) hide show
  1. package/.elsie.js +3 -3
  2. package/CHANGELOG.md +385 -112
  3. package/LICENSE.md +257 -157
  4. package/README.md +4 -2
  5. package/__mocks__/svg.js +3 -3
  6. package/bin/builders/build/index.js +2 -1
  7. package/bin/builders/changeset/index.js +1 -1
  8. package/bin/builders/concurrently/index.js +1 -1
  9. package/bin/builders/generate/api/index.js +7 -7
  10. package/bin/builders/generate/component/index.js +8 -8
  11. package/bin/builders/generate/config/index.js +5 -5
  12. package/bin/builders/generate/config/templates/elsie.js +1 -1
  13. package/bin/builders/generate/container/index.js +7 -7
  14. package/bin/builders/generate/index.js +36 -36
  15. package/bin/builders/gql/index.js +28 -28
  16. package/bin/builders/gql/validate.js +116 -105
  17. package/bin/builders/lint/index.js +1 -1
  18. package/bin/builders/serve/index.js +1 -1
  19. package/bin/builders/storybook/index.js +9 -1
  20. package/bin/builders/types/index.js +1 -2
  21. package/bin/builders/types/validate-tsconfig.js +5 -5
  22. package/bin/index.js +12 -6
  23. package/bin/lib/cli.js +9 -8
  24. package/bin/lib/resolve-bin.js +9 -0
  25. package/bin/lib/validate-typeof.js +3 -3
  26. package/bin/lib/write-file.js +3 -3
  27. package/bin/lib/write-parent-index.js +4 -4
  28. package/config/eslint.mjs +2 -1
  29. package/config/jest.mjs +7 -2
  30. package/config/plugins/dts-normalize-relative-replacer.cjs +1 -1
  31. package/config/plugins/dts.mjs +4 -3
  32. package/config/prettier.json +25 -3
  33. package/config/setEnvVars.mjs +2 -2
  34. package/config/storybook/addon.js +5 -5
  35. package/config/storybook/components/FileTree/FileTree.jsx +4 -4
  36. package/config/storybook/components/FileTree/index.js +4 -4
  37. package/config/storybook/components/Flex/Flex.jsx +3 -3
  38. package/config/storybook/components/Flex/index.js +3 -3
  39. package/config/storybook/components/OptionsTable/OptionsTable.jsx +3 -3
  40. package/config/storybook/components/OptionsTable/index.js +4 -4
  41. package/config/storybook/components/Panel/Panel.tsx +7 -7
  42. package/config/storybook/components/Panel/index.ts +3 -3
  43. package/config/storybook/components/Screenshot/Screenshot.jsx +3 -3
  44. package/config/storybook/components/Screenshot/index.js +4 -4
  45. package/config/storybook/components/Steps/Steps.jsx +3 -3
  46. package/config/storybook/components/Steps/index.js +4 -4
  47. package/config/storybook/components/StoryWrapper/StoryWrapper.jsx +3 -3
  48. package/config/storybook/components/StoryWrapper/index.js +3 -3
  49. package/config/storybook/components/Summary/Summary.jsx +3 -3
  50. package/config/storybook/components/Summary/index.js +3 -3
  51. package/config/storybook/components/Variants/Variants.jsx +11 -7
  52. package/config/storybook/components/Variants/index.js +3 -3
  53. package/config/storybook/manager.js +3 -3
  54. package/config/storybook/preview.jsx +3 -3
  55. package/config/storybook/theming/fonts.css +12 -4
  56. package/config/storybook/theming/preview.css +3 -1
  57. package/config/storybook/theming/theme.js +3 -3
  58. package/config/vite.mjs +53 -26
  59. package/package.json +36 -34
  60. package/src/components/Accordion/Accordion.css +1 -1
  61. package/src/components/Accordion/Accordion.stories.tsx +18 -18
  62. package/src/components/Accordion/Accordion.tsx +12 -8
  63. package/src/components/Accordion/index.ts +3 -3
  64. package/src/components/ActionButton/ActionButton.stories.tsx +8 -8
  65. package/src/components/ActionButton/ActionButton.tsx +7 -5
  66. package/src/components/ActionButton/index.ts +3 -3
  67. package/src/components/ActionButtonGroup/ActionButtonGroup.stories.tsx +3 -3
  68. package/src/components/ActionButtonGroup/ActionButtonGroup.tsx +2 -2
  69. package/src/components/ActionButtonGroup/index.ts +3 -3
  70. package/src/components/AlertBanner/AlertBanner.stories.tsx +6 -6
  71. package/src/components/AlertBanner/AlertBanner.tsx +12 -10
  72. package/src/components/AlertBanner/index.ts +3 -3
  73. package/src/components/Breadcrumbs/Breadcrumbs.stories.tsx +14 -14
  74. package/src/components/Breadcrumbs/Breadcrumbs.tsx +3 -3
  75. package/src/components/Breadcrumbs/index.ts +3 -3
  76. package/src/components/Button/Button.mdx +24 -11
  77. package/src/components/Button/Button.stories.tsx +6 -6
  78. package/src/components/Button/Button.tsx +7 -8
  79. package/src/components/Button/index.ts +3 -3
  80. package/src/components/Card/Card.stories.tsx +6 -6
  81. package/src/components/Card/Card.tsx +3 -3
  82. package/src/components/Card/index.ts +3 -3
  83. package/src/components/CartItem/CartItem.stories.tsx +12 -12
  84. package/src/components/CartItem/CartItem.tsx +4 -2
  85. package/src/components/CartItem/CartItemSkeleton.tsx +3 -3
  86. package/src/components/CartItem/index.ts +3 -3
  87. package/src/components/CartList/CartList.tsx +3 -3
  88. package/src/components/CartList/index.ts +3 -3
  89. package/src/components/Checkbox/Checkbox.stories.tsx +17 -14
  90. package/src/components/Checkbox/Checkbox.tsx +8 -6
  91. package/src/components/Checkbox/index.ts +3 -3
  92. package/src/components/ColorSwatch/ColorSwatch.css +8 -4
  93. package/src/components/ColorSwatch/ColorSwatch.stories.tsx +6 -6
  94. package/src/components/ColorSwatch/ColorSwatch.tsx +8 -6
  95. package/src/components/ColorSwatch/index.ts +3 -3
  96. package/src/components/ContentGrid/ContentGrid.css +15 -15
  97. package/src/components/ContentGrid/ContentGrid.stories.tsx +4 -4
  98. package/src/components/ContentGrid/ContentGrid.tsx +3 -3
  99. package/src/components/ContentGrid/index.ts +3 -3
  100. package/src/components/Divider/Divider.stories.tsx +7 -4
  101. package/src/components/Divider/Divider.tsx +3 -3
  102. package/src/components/Divider/index.ts +4 -4
  103. package/src/components/Field/Field.stories.tsx +7 -7
  104. package/src/components/Field/Field.tsx +4 -2
  105. package/src/components/Field/index.ts +3 -3
  106. package/src/components/Header/Header.stories.tsx +9 -10
  107. package/src/components/Header/Header.tsx +11 -7
  108. package/src/components/Header/index.ts +3 -3
  109. package/src/components/Icon/Icon.stories.helpers.jsx +4 -4
  110. package/src/components/Icon/Icon.stories.tsx +74 -60
  111. package/src/components/Icon/Icon.tsx +77 -44
  112. package/src/components/Icon/index.ts +3 -3
  113. package/src/components/IllustratedMessage/IllustratedMessage.stories.tsx +8 -8
  114. package/src/components/IllustratedMessage/IllustratedMessage.tsx +7 -5
  115. package/src/components/IllustratedMessage/index.ts +3 -3
  116. package/src/components/Image/Image.stories.tsx +3 -3
  117. package/src/components/Image/Image.tsx +4 -4
  118. package/src/components/Image/index.ts +3 -3
  119. package/src/components/ImageSwatch/ImageSwatch.css +8 -4
  120. package/src/components/ImageSwatch/ImageSwatch.stories.tsx +10 -10
  121. package/src/components/ImageSwatch/ImageSwatch.tsx +25 -23
  122. package/src/components/ImageSwatch/index.ts +3 -3
  123. package/src/components/InLineAlert/InLineAlert.stories.tsx +12 -7
  124. package/src/components/InLineAlert/InLineAlert.tsx +4 -2
  125. package/src/components/InLineAlert/index.ts +3 -3
  126. package/src/components/Incrementer/Incrementer.stories.tsx +9 -9
  127. package/src/components/Incrementer/Incrementer.tsx +75 -37
  128. package/src/components/Incrementer/index.ts +3 -3
  129. package/src/components/Input/Input.css +4 -1
  130. package/src/components/Input/Input.stories.tsx +5 -5
  131. package/src/components/Input/Input.tsx +5 -3
  132. package/src/components/Input/index.ts +3 -3
  133. package/src/components/InputDate/InputDate.tsx +3 -3
  134. package/src/components/InputDate/index.ts +3 -3
  135. package/src/components/InputFile/InputFile.css +16 -16
  136. package/src/components/InputFile/InputFile.stories.tsx +21 -16
  137. package/src/components/InputFile/InputFile.tsx +8 -6
  138. package/src/components/InputFile/index.ts +5 -5
  139. package/src/components/InputPassword/InputPassword.stories.tsx +4 -4
  140. package/src/components/InputPassword/InputPassword.tsx +5 -4
  141. package/src/components/InputPassword/PasswordStatusIndicator/PasswordStatusIndicator.tsx +1 -1
  142. package/src/components/InputPassword/PasswordStatusIndicator/index.ts +3 -3
  143. package/src/components/InputPassword/index.ts +3 -3
  144. package/src/components/Modal/Modal.stories.tsx +27 -16
  145. package/src/components/Modal/Modal.tsx +10 -11
  146. package/src/components/Modal/index.ts +3 -3
  147. package/src/components/MultiSelect/MultiSelect.stories.tsx +15 -15
  148. package/src/components/MultiSelect/MultiSelect.tsx +15 -15
  149. package/src/components/Pagination/Pagination.css +1 -1
  150. package/src/components/Pagination/Pagination.stories.tsx +0 -1
  151. package/src/components/Pagination/Pagination.tsx +17 -12
  152. package/src/components/Pagination/PaginationButton.tsx +2 -3
  153. package/src/components/Pagination/index.ts +3 -3
  154. package/src/components/Picker/Picker.css +3 -1
  155. package/src/components/Picker/Picker.stories.tsx +1 -1
  156. package/src/components/Picker/Picker.tsx +8 -6
  157. package/src/components/Picker/index.ts +3 -3
  158. package/src/components/Portal/Portal.stories.tsx +50 -44
  159. package/src/components/Portal/Portal.tsx +4 -4
  160. package/src/components/Price/Price.stories.tsx +3 -3
  161. package/src/components/Price/Price.tsx +4 -2
  162. package/src/components/Price/index.ts +3 -3
  163. package/src/components/PriceRange/PriceRange.stories.tsx +3 -3
  164. package/src/components/PriceRange/PriceRange.tsx +8 -6
  165. package/src/components/PriceRange/index.ts +3 -3
  166. package/src/components/ProductItemCard/ProductItemCard.tsx +4 -2
  167. package/src/components/ProductItemCard/ProductItemCardSkeleton.tsx +16 -16
  168. package/src/components/ProductItemCard/index.ts +4 -4
  169. package/src/components/ProgressSpinner/ProgressSpinner.stories.tsx +8 -8
  170. package/src/components/ProgressSpinner/ProgressSpinner.tsx +7 -5
  171. package/src/components/ProgressSpinner/index.ts +3 -3
  172. package/src/components/RadioButton/RadioButton.stories.tsx +1 -1
  173. package/src/components/RadioButton/RadioButton.tsx +4 -2
  174. package/src/components/Skeleton/Skeleton.stories.tsx +4 -4
  175. package/src/components/Skeleton/Skeleton.tsx +11 -7
  176. package/src/components/Skeleton/index.ts +3 -3
  177. package/src/components/Table/Table.css +106 -99
  178. package/src/components/Table/Table.stories.tsx +404 -227
  179. package/src/components/Table/Table.tsx +11 -7
  180. package/src/components/Table/index.ts +4 -4
  181. package/src/components/Tag/Tag.stories.tsx +6 -6
  182. package/src/components/Tag/Tag.tsx +7 -5
  183. package/src/components/Tag/index.ts +3 -3
  184. package/src/components/TextArea/TextArea.css +3 -1
  185. package/src/components/TextArea/TextArea.stories.tsx +9 -6
  186. package/src/components/TextArea/TextArea.tsx +3 -3
  187. package/src/components/TextArea/index.ts +3 -3
  188. package/src/components/TextSwatch/TextSwatch.css +4 -2
  189. package/src/components/TextSwatch/TextSwatch.stories.tsx +8 -8
  190. package/src/components/TextSwatch/TextSwatch.tsx +12 -7
  191. package/src/components/TextSwatch/index.ts +3 -3
  192. package/src/components/ToggleButton/ToggleButton.css +6 -2
  193. package/src/components/ToggleButton/ToggleButton.stories.tsx +10 -6
  194. package/src/components/ToggleButton/ToggleButton.tsx +8 -3
  195. package/src/components/ToggleButton/index.ts +3 -3
  196. package/src/components/UIProvider/UIProvider.css +3 -2
  197. package/src/components/UIProvider/UIProvider.tsx +11 -7
  198. package/src/components/UIProvider/debugger.css +5 -6
  199. package/src/components/UIProvider/index.ts +3 -3
  200. package/src/docs/API/event-bus.mdx +64 -37
  201. package/src/docs/API/graphql.mdx +69 -36
  202. package/src/docs/API/initializer.mdx +58 -35
  203. package/src/docs/API/render.mdx +45 -32
  204. package/src/docs/Design/colors.mdx +10 -12
  205. package/src/docs/Design/grid.mdx +41 -14
  206. package/src/docs/Design/overview.mdx +20 -4
  207. package/src/docs/Design/shapes.mdx +8 -7
  208. package/src/docs/Design/spacing.mdx +3 -1
  209. package/src/docs/Design/typography.mdx +3 -2
  210. package/src/docs/Utilities/VComponent.mdx +27 -10
  211. package/src/docs/Utilities/classList.mdx +7 -5
  212. package/src/docs/Utilities/debounce.mdx +6 -7
  213. package/src/docs/Utilities/getCookie.mdx +1 -2
  214. package/src/docs/Utilities/getFormErrors.mdx +1 -2
  215. package/src/docs/Utilities/getFormValues.mdx +1 -2
  216. package/src/docs/Utilities/getPathValue.mdx +2 -4
  217. package/src/docs/Utilities/links.mdx +16 -7
  218. package/src/docs/cli-usage.mdx +8 -3
  219. package/src/docs/components/overview.mdx +14 -4
  220. package/src/docs/quick-start.mdx +69 -22
  221. package/src/docs/slots.mdx +74 -37
  222. package/src/docs/welcome.mdx +13 -4
  223. package/src/i18n/index.ts +3 -3
  224. package/src/lib/aem/assets.ts +9 -9
  225. package/src/lib/aem/configs.ts +16 -8
  226. package/src/lib/classes.ts +4 -4
  227. package/src/lib/config.ts +3 -3
  228. package/src/lib/debounce.ts +3 -3
  229. package/src/lib/deepmerge.ts +6 -13
  230. package/src/lib/deviceUtils.ts +3 -3
  231. package/src/lib/form-values.ts +3 -3
  232. package/src/lib/get-price-formatter.ts +8 -3
  233. package/src/lib/i18n.ts +3 -3
  234. package/src/lib/image-params-keymap.ts +4 -5
  235. package/src/lib/initializer.ts +11 -12
  236. package/src/lib/is-number.ts +3 -3
  237. package/src/lib/locale-config.ts +4 -4
  238. package/src/lib/render.tsx +14 -8
  239. package/src/lib/resolve-image.ts +19 -16
  240. package/src/lib/signals.ts +4 -4
  241. package/src/lib/slot.tsx +34 -27
  242. package/src/lib/tests.tsx +6 -8
  243. package/src/lib/types.ts +3 -3
  244. package/src/lib/vcomponent.tsx +3 -3
  245. package/src/shims/importmap.js +3107 -20
  246. package/static/assets/images/index.ts +3 -3
  247. package/storybook-stories.js +3 -3
  248. package/tests/__mocks__/browserMocks.ts +3 -3
  249. package/tests/__mocks__/fileMocks.ts +3 -3
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  export * from '@adobe-commerce/elsie/components/CartItem/CartItem';
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  import { FunctionComponent } from 'preact';
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  export * from '@adobe-commerce/elsie/components/CartList/CartList';
@@ -2,14 +2,17 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  // https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
11
11
  import type { Meta, StoryObj } from '@storybook/preact-vite';
12
- import { Checkbox, CheckboxProps } from '@adobe-commerce/elsie/components/Checkbox';
12
+ import {
13
+ Checkbox,
14
+ CheckboxProps,
15
+ } from '@adobe-commerce/elsie/components/Checkbox';
13
16
  import { expect, within, userEvent } from 'storybook/test';
14
17
 
15
18
  /**
@@ -98,7 +101,7 @@ export const Primary: Story = {
98
101
  play: async ({ canvasElement }) => {
99
102
  const canvas = within(canvasElement);
100
103
  const checkboxField = document.querySelector(
101
- 'input[name="checkboxField"]'
104
+ 'input[name="checkboxField"]',
102
105
  ) as HTMLElement;
103
106
  await expect(checkboxField).not.toBeChecked();
104
107
  await userEvent.click(canvas.getByText('Option'));
@@ -119,7 +122,7 @@ export const CheckboxEnabledAndActive: Story = {
119
122
  play: async ({ canvasElement }) => {
120
123
  const canvas = within(canvasElement);
121
124
  const checkboxField = document.querySelector(
122
- 'input[name="checkboxField"]'
125
+ 'input[name="checkboxField"]',
123
126
  ) as HTMLElement;
124
127
  await expect(checkboxField).toBeChecked();
125
128
  await userEvent.click(canvas.getByText('Option'));
@@ -160,7 +163,7 @@ export const CheckboxDisabled: Story = {
160
163
  },
161
164
  play: async () => {
162
165
  const checkboxField = document.querySelector(
163
- 'input[name="checkboxField"]'
166
+ 'input[name="checkboxField"]',
164
167
  ) as HTMLElement;
165
168
  await expect(checkboxField).not.toBeChecked();
166
169
  await expect(checkboxField).toBeDisabled();
@@ -184,7 +187,7 @@ export const CheckboxDisabledWithALink: Story = {
184
187
  },
185
188
  play: async () => {
186
189
  const checkboxField = document.querySelector(
187
- 'input[name="checkboxField"]'
190
+ 'input[name="checkboxField"]',
188
191
  ) as HTMLElement;
189
192
  await expect(checkboxField).not.toBeChecked();
190
193
  await expect(checkboxField).toBeDisabled();
@@ -202,7 +205,7 @@ export const CheckboxDisabledAndActive: Story = {
202
205
  },
203
206
  play: async () => {
204
207
  const checkboxField = document.querySelector(
205
- 'input[name="checkboxField"]'
208
+ 'input[name="checkboxField"]',
206
209
  ) as HTMLElement;
207
210
  await expect(checkboxField).toBeChecked();
208
211
  await expect(checkboxField).toBeDisabled();
@@ -219,7 +222,7 @@ export const CheckboxWithNodeLabelAndDescription: Story = {
219
222
  },
220
223
  play: async () => {
221
224
  const checkboxField = document.querySelector(
222
- 'input[name="checkboxField"]'
225
+ 'input[name="checkboxField"]',
223
226
  ) as HTMLElement;
224
227
  await expect(checkboxField).toBeChecked();
225
228
  },
@@ -246,10 +249,10 @@ export const CheckboxWithALink: Story = {
246
249
  },
247
250
  play: async () => {
248
251
  const checkboxField = document.querySelector(
249
- 'input[name="checkboxField"]'
252
+ 'input[name="checkboxField"]',
250
253
  ) as HTMLElement;
251
254
  const checkboxLink = document.querySelector(
252
- '.dropin-checkbox a'
255
+ '.dropin-checkbox a',
253
256
  ) as HTMLElement;
254
257
  await expect(checkboxField).not.toBeChecked();
255
258
  await expect(checkboxLink).toBeDefined();
@@ -279,10 +282,10 @@ export const CheckboxWithLongLabel: Story = {
279
282
  },
280
283
  play: async () => {
281
284
  const checkboxField = document.querySelector(
282
- 'input[name="checkboxField"]'
285
+ 'input[name="checkboxField"]',
283
286
  ) as HTMLElement;
284
287
  const checkboxLink = document.querySelector(
285
- '.dropin-checkbox a'
288
+ '.dropin-checkbox a',
286
289
  ) as HTMLElement;
287
290
  await expect(checkboxField).not.toBeChecked();
288
291
  await expect(checkboxLink).toBeDefined();
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  import { FunctionComponent, VNode } from 'preact';
@@ -15,8 +15,10 @@ import { Icon } from '@adobe-commerce/elsie/components/Icon';
15
15
  import '@adobe-commerce/elsie/components/Checkbox/Checkbox.css';
16
16
  import { useEffect } from 'preact/hooks';
17
17
 
18
- export interface CheckboxProps
19
- extends Omit<HTMLAttributes<HTMLInputElement>, 'size' | 'label'> {
18
+ export interface CheckboxProps extends Omit<
19
+ HTMLAttributes<HTMLInputElement>,
20
+ 'size' | 'label'
21
+ > {
20
22
  name: string;
21
23
  size?: 'medium' | 'large';
22
24
  disabled?: boolean;
@@ -38,7 +40,7 @@ export const Checkbox: FunctionComponent<CheckboxProps> = ({
38
40
  ...props
39
41
  }) => {
40
42
  const [isChecked, setIsChecked] = useState(
41
- checked === undefined ? false : checked
43
+ checked === undefined ? false : checked,
42
44
  );
43
45
  const ref = useRef<HTMLInputElement>(null);
44
46
 
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  export * from '@adobe-commerce/elsie/components/Checkbox/Checkbox';
@@ -55,7 +55,8 @@
55
55
  input[type='checkbox']:checked
56
56
  ~ .dropin-color-swatch__span,
57
57
  .dropin-color-swatch--selected {
58
- box-shadow: 0 0 0 var(--shape-border-width-3) var(--color-neutral-50),
58
+ box-shadow:
59
+ 0 0 0 var(--shape-border-width-3) var(--color-neutral-50),
59
60
  0 0 0 3px var(--color-neutral-800);
60
61
  }
61
62
 
@@ -65,7 +66,8 @@
65
66
  .dropin-color-swatch__container
66
67
  input[type='checkbox']:checked:active
67
68
  ~ .dropin-color-swatch__span {
68
- box-shadow: 0 0 0 var(--shape-border-width-3) var(--color-neutral-50),
69
+ box-shadow:
70
+ 0 0 0 var(--shape-border-width-3) var(--color-neutral-50),
69
71
  0 0 0 var(--shape-border-width-4) var(--color-neutral-900);
70
72
  }
71
73
 
@@ -75,7 +77,8 @@
75
77
  .dropin-color-swatch__container
76
78
  input[type='checkbox']:focus-visible
77
79
  + .dropin-color-swatch__span {
78
- box-shadow: 0 0 0 var(--shape-border-width-3) var(--color-neutral-900),
80
+ box-shadow:
81
+ 0 0 0 var(--shape-border-width-3) var(--color-neutral-900),
79
82
  0 0 0 6px var(--color-neutral-600);
80
83
  }
81
84
 
@@ -99,7 +102,8 @@
99
102
 
100
103
  .dropin-color-swatch__span--out-of-stock {
101
104
  box-shadow: 0 0 0 var(--shape-border-width-1) var(--color-neutral-700);
102
- background: linear-gradient(
105
+ background:
106
+ linear-gradient(
103
107
  to top left,
104
108
  rgba(0, 0, 0, 0) 0%,
105
109
  rgba(0, 0, 0, 0) calc(50% - 0.8px),
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  // https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
@@ -148,7 +148,7 @@ export const DefaultColorSwatch: Story = {
148
148
  const canvas = within(canvasElement);
149
149
  const textSwatch = await canvas.findByRole('radio');
150
150
  const spanElement = document.querySelector(
151
- '.dropin-color-swatch__span'
151
+ '.dropin-color-swatch__span',
152
152
  ) as HTMLElement;
153
153
  expect(spanElement).toBeVisible();
154
154
  await expect(textSwatch).not.toBeChecked();
@@ -173,12 +173,12 @@ export const SelectedColorSwatch: Story = {
173
173
  const canvas = within(canvasElement);
174
174
  const textSwatch = await canvas.findByRole('radio');
175
175
  const spanElement = document.querySelector(
176
- '.dropin-color-swatch__span'
176
+ '.dropin-color-swatch__span',
177
177
  ) as HTMLElement;
178
178
  expect(spanElement).toBeVisible();
179
179
  await expect(textSwatch).toBeChecked();
180
180
  await expect(
181
- canvas.getByLabelText('Color Swatch: gray swatch selected')
181
+ canvas.getByLabelText('Color Swatch: gray swatch selected'),
182
182
  ).toBeChecked();
183
183
  },
184
184
  };
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  import { FunctionComponent } from 'preact';
@@ -13,8 +13,10 @@ import { classes } from '@adobe-commerce/elsie/lib';
13
13
  import '@adobe-commerce/elsie/components/ColorSwatch/ColorSwatch.css';
14
14
  import { useText } from '@adobe-commerce/elsie/i18n';
15
15
 
16
- export interface ColorSwatchProps
17
- extends Omit<HTMLAttributes<HTMLInputElement>, 'label' | 'size'> {
16
+ export interface ColorSwatchProps extends Omit<
17
+ HTMLAttributes<HTMLInputElement>,
18
+ 'label' | 'size'
19
+ > {
18
20
  name?: string;
19
21
  label?: string;
20
22
  groupAriaLabel?: string;
@@ -64,7 +66,7 @@ export const ColorSwatch: FunctionComponent<ColorSwatchProps> = ({
64
66
  }
65
67
  }
66
68
  },
67
- [onValue, onUpdateError]
69
+ [onValue, onUpdateError],
68
70
  );
69
71
 
70
72
  const handleOnValue = (e: Event) => {
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  export * from '@adobe-commerce/elsie/components/ColorSwatch/ColorSwatch';
@@ -10,36 +10,36 @@
10
10
  /* https://cssguidelin.es/#bem-like-naming */
11
11
 
12
12
  .dropin-content-grid {
13
- container-type: inline-size;
14
- container-name: dropin-content-grid;
15
- max-width: inherit;
16
- overflow: scroll;
13
+ container-type: inline-size;
14
+ container-name: dropin-content-grid;
15
+ max-width: inherit;
16
+ overflow: scroll;
17
17
  }
18
18
 
19
19
  /* Container for the cart summary grid */
20
20
  .dropin-content-grid__content {
21
- display: grid;
22
- gap: var(--spacing-small);
23
- margin: auto;
24
- justify-items: center;
21
+ display: grid;
22
+ gap: var(--spacing-small);
23
+ margin: auto;
24
+ justify-items: center;
25
25
  }
26
26
 
27
27
  .dropin-content-grid__dynamic-columns-content {
28
- display: flex;
29
- flex-wrap: wrap;
28
+ display: flex;
29
+ flex-wrap: wrap;
30
30
  }
31
31
 
32
32
  /* Empty grid message */
33
33
  .dropin-content-grid__content--empty {
34
- grid-template-columns: repeat(1, 1fr);
34
+ grid-template-columns: repeat(1, 1fr);
35
35
  }
36
36
 
37
37
  /* Container rules */
38
38
  @container dropin-content-grid (width < 360) {
39
- .dropin-content-grid__content {
40
- grid-template-columns: repeat(4, 1fr);
41
- gap: var(--spacing-xsmall);
42
- }
39
+ .dropin-content-grid__content {
40
+ grid-template-columns: repeat(4, 1fr);
41
+ gap: var(--spacing-xsmall);
42
+ }
43
43
  }
44
44
  /* Medium (portrait tablets and large phones, 768px and up) */
45
45
  /* @media only screen and (min-width: 768px) { } */
@@ -2,15 +2,15 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  // https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
11
11
  import {
12
12
  ContentGrid as component,
13
- ContentGridProps
13
+ ContentGridProps,
14
14
  } from '@adobe-commerce/elsie/components/ContentGrid';
15
15
  import type { Meta, StoryObj } from '@storybook/preact-vite';
16
16
 
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  import { FunctionComponent, VNode } from 'preact';
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  export * from '@adobe-commerce/elsie/components/ContentGrid/ContentGrid';
@@ -2,13 +2,16 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  import type { Meta, StoryObj } from '@storybook/preact-vite';
11
- import { Divider, DividerProps } from '@adobe-commerce/elsie/components/Divider';
11
+ import {
12
+ Divider,
13
+ DividerProps,
14
+ } from '@adobe-commerce/elsie/components/Divider';
12
15
  import { expect, within } from 'storybook/test';
13
16
 
14
17
  /**
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  import { FunctionComponent } from 'preact';
@@ -2,10 +2,10 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  export * from '@adobe-commerce/elsie/components/Divider/Divider';
11
- export { Divider as default } from '@adobe-commerce/elsie/components/Divider/Divider';
11
+ export { Divider as default } from '@adobe-commerce/elsie/components/Divider/Divider';
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  // https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
@@ -116,15 +116,15 @@ export const IncrementerField: Story = {
116
116
  },
117
117
  play: async () => {
118
118
  const canvasElement = document.querySelector(
119
- '#storybook-root'
119
+ '#storybook-root',
120
120
  ) as HTMLElement;
121
121
  const canvas = within(canvasElement);
122
122
  const decreaseButton = document.querySelector(
123
- 'button[aria-label="Decrease Quantity"]'
123
+ 'button[aria-label="Decrease Quantity"]',
124
124
  ) as HTMLElement;
125
125
  const inputField = document.querySelector('input') as HTMLElement;
126
126
  const increaseButton = document.querySelector(
127
- 'button[aria-label="Increase Quantity"]'
127
+ 'button[aria-label="Increase Quantity"]',
128
128
  ) as HTMLElement;
129
129
 
130
130
  // Without this wait test failing intermittently as click event is triggerning before even element fully loaded
@@ -201,7 +201,7 @@ export const PickerField: Story = {
201
201
  await expect(canvas.getByText('Option 2')).toBeVisible();
202
202
 
203
203
  const select = document.querySelector(
204
- '.dropin-picker__select'
204
+ '.dropin-picker__select',
205
205
  ) as HTMLSelectElement;
206
206
 
207
207
  await userEvent.selectOptions(select, 'option3');
@@ -12,8 +12,10 @@ import { classes, VComponent } from '@adobe-commerce/elsie/lib';
12
12
  import { FunctionComponent, VNode } from 'preact';
13
13
  import { HTMLAttributes } from 'preact/compat';
14
14
 
15
- export interface FieldProps
16
- extends Omit<HTMLAttributes<HTMLDivElement>, 'size'> {
15
+ export interface FieldProps extends Omit<
16
+ HTMLAttributes<HTMLDivElement>,
17
+ 'size'
18
+ > {
17
19
  label?: string;
18
20
  error?: string;
19
21
  hint?: string;
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  export * from '@adobe-commerce/elsie/components/Field/Field';
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  // https://storybook.js.org/docs/7.0/preact/writing-stories/introduction
@@ -70,8 +70,8 @@ export default {
70
70
  3: 'h3',
71
71
  4: 'h4',
72
72
  5: 'h5',
73
- 6: 'h6'
74
- }
73
+ 6: 'h6',
74
+ },
75
75
  },
76
76
  defaultValue: { summary: 2 },
77
77
  },
@@ -156,7 +156,6 @@ export const WithoutActions = {
156
156
  },
157
157
  };
158
158
 
159
-
160
159
  export const HeadingLevels = {
161
160
  ...Template,
162
161
  parameters: {
@@ -172,9 +171,9 @@ export const HeadingLevels = {
172
171
  level: {
173
172
  control: {
174
173
  type: 'select',
175
- options: [1, 2, 3, 4, 5, 6]
174
+ options: [1, 2, 3, 4, 5, 6],
176
175
  },
177
176
  description: 'Set the heading level',
178
- }
179
- }
180
- };
177
+ },
178
+ },
179
+ };
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  import { ComponentChildren, FunctionComponent, VNode, JSX } from 'preact';
@@ -13,7 +13,10 @@ import { classes, VComponent } from '@adobe-commerce/elsie/lib';
13
13
  import { Divider } from '@adobe-commerce/elsie/components';
14
14
  import '@adobe-commerce/elsie/components/Header/Header.css';
15
15
 
16
- export interface HeaderProps extends Omit<HTMLAttributes<HTMLDivElement>, 'size'> {
16
+ export interface HeaderProps extends Omit<
17
+ HTMLAttributes<HTMLDivElement>,
18
+ 'size'
19
+ > {
17
20
  title: string;
18
21
  size?: 'medium' | 'large';
19
22
  divider?: boolean;
@@ -30,9 +33,10 @@ const Heading = ({
30
33
  className?: string;
31
34
  children?: ComponentChildren;
32
35
  }) => {
33
- const HeadingTag = level && level >= 1 && level <= 6
34
- ? `h${level}` as keyof JSX.IntrinsicElements
35
- : 'span';
36
+ const HeadingTag =
37
+ level && level >= 1 && level <= 6
38
+ ? (`h${level}` as keyof JSX.IntrinsicElements)
39
+ : 'span';
36
40
 
37
41
  return <HeadingTag className={className}>{children as any}</HeadingTag>;
38
42
  };
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  export * from '@adobe-commerce/elsie/components/Header/Header';
@@ -2,9 +2,9 @@
2
2
  * Copyright 2024 Adobe
3
3
  * All Rights Reserved.
4
4
  *
5
- * NOTICE: Adobe permits you to use, modify, and distribute this
6
- * file in accordance with the terms of the Adobe license agreement
7
- * accompanying it.
5
+ * NOTICE: Adobe permits you to use, modify, and distribute this
6
+ * file in accordance with the terms of the Adobe license agreement
7
+ * accompanying it.
8
8
  *******************************************************************/
9
9
 
10
10
  import * as Icons from '@adobe-commerce/elsie/icons';
@@ -17,5 +17,5 @@ export const IconsList = iconNames.reduce(
17
17
  acc[name] = <Icon key={name} source={Icons[name]} size="24" stroke="1" />;
18
18
  return acc;
19
19
  },
20
- { none: null }
20
+ { none: null },
21
21
  );