@adobe-commerce/elsie 1.5.1-alpha003 → 1.5.1-alpha2861

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 (31) hide show
  1. package/bin/builders/serve/index.js +3 -1
  2. package/config/jest.js +3 -3
  3. package/config/vite.mjs +13 -8
  4. package/package.json +3 -3
  5. package/src/components/Button/Button.tsx +2 -0
  6. package/src/components/Incrementer/Incrementer.css +6 -0
  7. package/src/components/Incrementer/Incrementer.stories.tsx +18 -0
  8. package/src/components/Incrementer/Incrementer.tsx +66 -59
  9. package/src/components/MultiSelect/MultiSelect.css +273 -0
  10. package/src/components/MultiSelect/MultiSelect.stories.tsx +457 -0
  11. package/src/components/MultiSelect/MultiSelect.tsx +763 -0
  12. package/src/components/MultiSelect/index.ts +11 -0
  13. package/src/components/Picker/Picker.tsx +5 -3
  14. package/src/components/ProductItemCard/ProductItemCard.css +1 -39
  15. package/src/components/ProductItemCard/ProductItemCard.stories.tsx +7 -10
  16. package/src/components/ProductItemCard/ProductItemCard.tsx +4 -21
  17. package/src/components/Table/Table.css +110 -0
  18. package/src/components/Table/Table.stories.tsx +761 -0
  19. package/src/components/Table/Table.tsx +249 -0
  20. package/src/components/Table/index.ts +11 -0
  21. package/src/components/TextSwatch/TextSwatch.tsx +5 -2
  22. package/src/components/ToggleButton/ToggleButton.css +13 -1
  23. package/src/components/ToggleButton/ToggleButton.stories.tsx +13 -6
  24. package/src/components/ToggleButton/ToggleButton.tsx +4 -0
  25. package/src/components/index.ts +5 -3
  26. package/src/docs/API/render.mdx +16 -0
  27. package/src/docs/slots.mdx +9 -1
  28. package/src/i18n/en_US.json +38 -0
  29. package/src/lib/aem/configs.ts +7 -4
  30. package/src/lib/render.tsx +21 -7
  31. package/src/lib/slot.tsx +99 -30
@@ -0,0 +1,11 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
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.
8
+ *******************************************************************/
9
+
10
+ export * from '@adobe-commerce/elsie/components/MultiSelect/MultiSelect';
11
+ export { MultiSelect as default } from '@adobe-commerce/elsie/components/MultiSelect/MultiSelect';
@@ -8,12 +8,13 @@
8
8
  *******************************************************************/
9
9
 
10
10
  import { Icon } from '@adobe-commerce/elsie/components';
11
- import '@adobe-commerce/elsie/components/Picker/Picker.css';
12
11
  import { ChevronDown } from '@adobe-commerce/elsie/icons';
13
12
  import { classes } from '@adobe-commerce/elsie/lib';
14
13
  import { FunctionComponent, VNode } from 'preact';
15
14
  import { HTMLAttributes, useEffect, useState } from 'preact/compat';
16
15
 
16
+ import '@adobe-commerce/elsie/components/Picker/Picker.css';
17
+
17
18
  type PickerValue = string | null;
18
19
 
19
20
  export interface PickerOption {
@@ -68,9 +69,10 @@ export const Picker: FunctionComponent<PickerProps> = ({
68
69
  defaultOption,
69
70
  icon,
70
71
  className,
72
+ id,
71
73
  ...props
72
74
  }) => {
73
- const id = props?.id || name || `dropin-picker-${Math.random().toString(36)}`;
75
+ const uniqueId = id ?? name ?? `dropin-picker-${Math.random().toString(36)}`;
74
76
  const isRequired = !!props?.required;
75
77
 
76
78
  // find the first option that is not disabled
@@ -154,7 +156,7 @@ export const Picker: FunctionComponent<PickerProps> = ({
154
156
  )}
155
157
 
156
158
  <select
157
- id={id}
159
+ id={uniqueId}
158
160
  className={classes([
159
161
  'dropin-picker__select',
160
162
  `dropin-picker__select--${variant}`,
@@ -23,16 +23,14 @@
23
23
  }
24
24
 
25
25
  .dropin-product-item-card__image-container {
26
- overflow: visible;
26
+ overflow: hidden;
27
27
  width: 100%;
28
28
  height: auto;
29
29
  }
30
30
 
31
31
  .dropin-product-item-card__image img {
32
- display: block;
33
32
  width: 100%;
34
33
  max-height: 375px;
35
- border-radius: var(--border-radius-xsmall, 4px);
36
34
  }
37
35
 
38
36
  .dropin-product-item-card__content {
@@ -76,42 +74,6 @@
76
74
  width: 100%;
77
75
  }
78
76
 
79
- .dropin-product-item-card__image a:focus {
80
- outline: 1px solid var(--color-neutral-400);
81
- outline-offset: 1px;
82
- }
83
-
84
- .dropin-product-item-card__image {
85
- display: inline-block;
86
- border-radius: var(--border-radius-xsmall, 4px);
87
- outline: none;
88
- }
89
-
90
- .dropin-product-item-card__image:focus-visible {
91
- outline: 2px solid var(--color-interactive-focus, #005fcc);
92
- outline-offset: 2px;
93
- z-index: 2;
94
- }
95
-
96
- .dropin-product-item-card__image-container {
97
- overflow: visible;
98
- width: 100%;
99
- height: auto;
100
- }
101
-
102
- .dropin-product-item-card__image-link {
103
- display: block;
104
- border-radius: var(--border-radius-xsmall, 4px);
105
- outline: none;
106
- }
107
-
108
- .dropin-product-item-card__image-link:focus-visible {
109
- outline: 3px solid var(--color-interactive-focus, #333333);
110
- outline-offset: 3px;
111
- position: relative;
112
- z-index: 1;
113
- }
114
-
115
77
  /* Medium (portrait tablets and large phones, 768px and up) */
116
78
  /* @media only screen and (min-width: 768px) { } */
117
79
 
@@ -47,15 +47,13 @@ const meta: Meta<ProductItemCardProps> = {
47
47
  options: ['DefaultImage', 'Empty'],
48
48
  mapping: {
49
49
  DefaultImage: (
50
- <a href="#" className="dropin-product-item-card__image-link">
51
- <Image
52
- src="https://picsum.photos/300/375"
53
- width="300"
54
- height="375"
55
- alt="Product Image"
56
- loading="lazy"
57
- />
58
- </a>
50
+ <Image
51
+ src="https://picsum.photos/300/375"
52
+ width="300"
53
+ height="375"
54
+ alt="Product Image"
55
+ loading="lazy"
56
+ />
59
57
  ),
60
58
  Empty: null,
61
59
  },
@@ -255,7 +253,6 @@ export const Default: Story = {
255
253
  sku: 'DefaultSku' as any,
256
254
  swatches: 'DefaultSwatches' as any,
257
255
  actionButton: 'DefaultButton' as any,
258
- imageHref: '#',
259
256
  },
260
257
  };
261
258
 
@@ -22,8 +22,6 @@ export interface ProductItemCardProps
22
22
  actionButton?: VNode;
23
23
  swatches?: VNode;
24
24
  initialized?: boolean;
25
- imageHref?: string;
26
- imageLinkLabel?: string;
27
25
  }
28
26
 
29
27
  export const ProductItemCard: FunctionComponent<ProductItemCardProps> = ({
@@ -35,8 +33,6 @@ export const ProductItemCard: FunctionComponent<ProductItemCardProps> = ({
35
33
  actionButton,
36
34
  swatches,
37
35
  initialized = false,
38
- imageHref,
39
- imageLinkLabel,
40
36
  ...props
41
37
  }) => {
42
38
  if (!initialized) {
@@ -49,23 +45,10 @@ export const ProductItemCard: FunctionComponent<ProductItemCardProps> = ({
49
45
  >
50
46
  <div className="dropin-product-item-card__image-container">
51
47
  {image && (
52
- imageHref ? (
53
- <a
54
- href={imageHref}
55
- className="dropin-product-item-card__image-link"
56
- aria-label={imageLinkLabel}
57
- >
58
- <VComponent
59
- node={image}
60
- className={classes(['dropin-product-item-card__image'])}
61
- />
62
- </a>
63
- ) : (
64
- <VComponent
65
- node={image}
66
- className={classes(['dropin-product-item-card__image'])}
67
- />
68
- )
48
+ <VComponent
49
+ node={image}
50
+ className={classes(['dropin-product-item-card__image'])}
51
+ />
69
52
  )}
70
53
  </div>
71
54
  <div className="dropin-product-item-card__content">
@@ -0,0 +1,110 @@
1
+ /********************************************************************
2
+ * Copyright 2025 Adobe
3
+ * All Rights Reserved.
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.
8
+ *******************************************************************/
9
+
10
+ /* https://cssguidelin.es/#bem-like-naming */
11
+
12
+ .dropin-table {
13
+ container-type: inline-size;
14
+ overflow-x: auto;
15
+ font: var(--type-body-1-default-font);
16
+ letter-spacing: var(--type-body-1-default-letter-spacing);
17
+ }
18
+
19
+ .dropin-table__table {
20
+ border-collapse: collapse;
21
+ width: 100%;
22
+ }
23
+
24
+ .dropin-table__caption {
25
+ font: var(--type-details-caption-1-font);
26
+ letter-spacing: var(--type-details-caption-1-letter-spacing);
27
+ text-align: left;
28
+ margin-bottom: var(--spacing-small);
29
+ caption-side: top;
30
+ }
31
+
32
+ .dropin-table__header__cell {
33
+ font: var(--type-body-1-strong-font);
34
+ letter-spacing: var(--type-body-1-strong-letter-spacing);
35
+ }
36
+
37
+ .dropin-table__header__cell,
38
+ .dropin-table__body__cell {
39
+ padding: var(--spacing-xsmall);
40
+ text-align: left;
41
+ white-space: nowrap;
42
+ }
43
+
44
+ .dropin-table__header__cell--sortable {
45
+ cursor: pointer;
46
+ }
47
+
48
+ .dropin-table__header__row {
49
+ border-bottom: 2px solid var(--color-neutral-400);
50
+ }
51
+
52
+ .dropin-table__body__row {
53
+ border-bottom: 1px solid var(--color-neutral-400);
54
+ }
55
+
56
+ .dropin-table__header__sort-button {
57
+ margin-left: var(--spacing-xsmall);
58
+ vertical-align: middle;
59
+ }
60
+
61
+ .dropin-table__row-details {
62
+ display: none;
63
+ }
64
+
65
+ .dropin-table__row-details--expanded {
66
+ display: table-row;
67
+ }
68
+
69
+ .dropin-table__row-details__cell {
70
+ padding: var(--spacing-small);
71
+ background-color: var(--color-neutral-100);
72
+ border-top: 1px solid var(--color-neutral-300);
73
+ border-bottom: 1px solid var(--color-neutral-400);
74
+ }
75
+
76
+ /* Container query for mobile layout */
77
+ @container (max-width: 600px) {
78
+ /* Mobile layout Stacked */
79
+ .dropin-table--mobile-layout-stacked .dropin-table__header {
80
+ display: none;
81
+ }
82
+
83
+ .dropin-table--mobile-layout-stacked .dropin-table__body__cell {
84
+ display: block;
85
+ }
86
+
87
+ .dropin-table--mobile-layout-stacked .dropin-table__body__cell::before {
88
+ content: attr(data-label);
89
+ font-weight: bold;
90
+ display: block;
91
+ margin-bottom: var(--spacing-xxsmall);
92
+ }
93
+
94
+ .dropin-table--mobile-layout-stacked .dropin-table__row-details__cell {
95
+ display: block;
96
+ padding: var(--spacing-small);
97
+ }
98
+ }
99
+
100
+ /* Medium (portrait tablets and large phones, 768px and up) */
101
+ /* @media only screen and (min-width: 768px) { } */
102
+
103
+ /* Large (landscape tablets, 1024px and up) */
104
+ /* @media only screen and (min-width: 1024px) { } */
105
+
106
+ /* XLarge (laptops/desktops, 1366px and up) */
107
+ /* @media only screen and (min-width: 1366px) { } */
108
+
109
+ /* XXlarge (large laptops and desktops, 1920px and up) */
110
+ /* @media only screen and (min-width: 1920px) { } */