@dmsi/wedgekit-react 0.0.387 → 0.0.389

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 (113) hide show
  1. package/dist/{chunk-PH76F7QS.js → chunk-2HMCS25C.js} +1 -1
  2. package/dist/{chunk-HPQWEZJL.js → chunk-3X3Y4TMS.js} +7 -2
  3. package/dist/{chunk-3XOYPT5O.js → chunk-44TDIHUP.js} +1 -1
  4. package/dist/{chunk-F4CV7SBS.js → chunk-6I5LZ2ZC.js} +2 -2
  5. package/dist/{chunk-2FADUKPP.js → chunk-AA6GE3TH.js} +1 -1
  6. package/dist/{chunk-DCCTNHNL.js → chunk-ERW5DEIO.js} +1 -1
  7. package/dist/{chunk-4LXG6QNT.js → chunk-EZCH4PQS.js} +2 -1
  8. package/dist/{chunk-CQFPNZTN.js → chunk-G5DEC7H3.js} +15 -5
  9. package/dist/{chunk-MX57T3HP.js → chunk-GB4ZTUQV.js} +8 -4
  10. package/dist/{chunk-TPXHOAY3.js → chunk-JIMJIJOF.js} +2 -2
  11. package/dist/{chunk-R4SFLYOZ.js → chunk-KZZKQLKF.js} +1 -1
  12. package/dist/{chunk-KKESN5SF.js → chunk-LCJZRP5S.js} +11 -2
  13. package/dist/{chunk-GNHKKYCY.js → chunk-LLZ3SSZJ.js} +2 -2
  14. package/dist/{chunk-A7CEYUVE.js → chunk-LZGYABCX.js} +3 -3
  15. package/dist/{chunk-FSLETAX4.js → chunk-MQX7GFLX.js} +11 -4
  16. package/dist/{chunk-2T2GISEG.js → chunk-OW3WN3JV.js} +3 -3
  17. package/dist/components/Accordion.cjs +10 -5
  18. package/dist/components/Accordion.js +3 -3
  19. package/dist/components/CalendarRange.cjs +24 -21
  20. package/dist/components/CalendarRange.css +18 -0
  21. package/dist/components/CalendarRange.js +15 -15
  22. package/dist/components/Card.cjs +2 -1
  23. package/dist/components/Card.js +1 -1
  24. package/dist/components/CompactImagesPreview.cjs +18 -7
  25. package/dist/components/CompactImagesPreview.js +2 -2
  26. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +14 -11
  27. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +18 -0
  28. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +15 -15
  29. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +17 -14
  30. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +18 -0
  31. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +15 -15
  32. package/dist/components/DataGrid/PinnedColumns.cjs +19 -16
  33. package/dist/components/DataGrid/PinnedColumns.css +18 -0
  34. package/dist/components/DataGrid/PinnedColumns.js +15 -15
  35. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +12 -9
  36. package/dist/components/DataGrid/TableBody/LoadingCell.css +18 -0
  37. package/dist/components/DataGrid/TableBody/LoadingCell.js +15 -15
  38. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +14 -11
  39. package/dist/components/DataGrid/TableBody/TableBodyRow.css +18 -0
  40. package/dist/components/DataGrid/TableBody/TableBodyRow.js +15 -15
  41. package/dist/components/DataGrid/TableBody/index.cjs +14 -11
  42. package/dist/components/DataGrid/TableBody/index.css +18 -0
  43. package/dist/components/DataGrid/TableBody/index.js +15 -15
  44. package/dist/components/DataGrid/index.cjs +36 -33
  45. package/dist/components/DataGrid/index.css +18 -0
  46. package/dist/components/DataGrid/index.js +15 -15
  47. package/dist/components/DataGrid/utils.cjs +12 -9
  48. package/dist/components/DataGrid/utils.css +18 -0
  49. package/dist/components/DataGrid/utils.js +15 -15
  50. package/dist/components/DateInput.cjs +37 -34
  51. package/dist/components/DateInput.css +18 -0
  52. package/dist/components/DateInput.js +15 -15
  53. package/dist/components/DateRangeInput.cjs +37 -34
  54. package/dist/components/DateRangeInput.css +18 -0
  55. package/dist/components/DateRangeInput.js +15 -15
  56. package/dist/components/FilterGroup.cjs +11 -2
  57. package/dist/components/FilterGroup.js +1 -1
  58. package/dist/components/MobileDataGrid/ColumnList.cjs +8 -4
  59. package/dist/components/MobileDataGrid/ColumnList.js +3 -3
  60. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +16 -13
  61. package/dist/components/MobileDataGrid/ColumnSelector/index.css +18 -0
  62. package/dist/components/MobileDataGrid/ColumnSelector/index.js +15 -15
  63. package/dist/components/MobileDataGrid/MobileDataGridCard/index.cjs +8 -4
  64. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +2 -2
  65. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +24 -17
  66. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +18 -0
  67. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +15 -15
  68. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.cjs +8 -4
  69. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +2 -2
  70. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.cjs +8 -4
  71. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +3 -3
  72. package/dist/components/MobileDataGrid/index.cjs +50 -43
  73. package/dist/components/MobileDataGrid/index.css +18 -0
  74. package/dist/components/MobileDataGrid/index.js +15 -15
  75. package/dist/components/Notification.cjs +8 -4
  76. package/dist/components/Notification.js +1 -1
  77. package/dist/components/OptionPill.cjs +11 -2
  78. package/dist/components/OptionPill.js +1 -1
  79. package/dist/components/PDFViewer/PDFElement.cjs +8 -4
  80. package/dist/components/PDFViewer/PDFElement.js +2 -2
  81. package/dist/components/PDFViewer/PDFNavigation.cjs +8 -4
  82. package/dist/components/PDFViewer/PDFNavigation.js +2 -2
  83. package/dist/components/PDFViewer/index.cjs +8 -4
  84. package/dist/components/PDFViewer/index.js +4 -4
  85. package/dist/components/ProductImagePreview/ProductPrimaryImage.cjs +15 -5
  86. package/dist/components/ProductImagePreview/ProductPrimaryImage.js +1 -1
  87. package/dist/components/ProductImagePreview/Thumbnail.cjs +7 -2
  88. package/dist/components/ProductImagePreview/Thumbnail.js +1 -1
  89. package/dist/components/ProductImagePreview/index.cjs +84 -63
  90. package/dist/components/ProductImagePreview/index.js +4 -4
  91. package/dist/components/SideMenuGroup.cjs +8 -4
  92. package/dist/components/SideMenuGroup.js +1 -1
  93. package/dist/components/SideMenuItem.cjs +8 -4
  94. package/dist/components/SideMenuItem.js +1 -1
  95. package/dist/components/Stack.cjs +8 -4
  96. package/dist/components/Stack.js +1 -1
  97. package/dist/components/Swatch.cjs +8 -4
  98. package/dist/components/Swatch.js +1 -1
  99. package/dist/components/Time.cjs +8 -4
  100. package/dist/components/Time.js +1 -1
  101. package/dist/components/Upload.cjs +8 -4
  102. package/dist/components/Upload.js +1 -1
  103. package/dist/components/index.cjs +100 -71
  104. package/dist/components/index.css +18 -0
  105. package/dist/components/index.js +15 -15
  106. package/dist/index.css +18 -0
  107. package/package.json +1 -1
  108. package/src/components/Card.tsx +15 -4
  109. package/src/components/CompactImagesPreview.tsx +10 -3
  110. package/src/components/OptionPill.tsx +13 -1
  111. package/src/components/ProductImagePreview/ProductPrimaryImage.tsx +16 -5
  112. package/src/components/ProductImagePreview/Thumbnail.tsx +7 -1
  113. package/src/components/Stack.tsx +4 -0
@@ -1,27 +1,27 @@
1
1
  import {
2
2
  DataGrid,
3
3
  MobileDataGrid
4
- } from "../chunk-2T2GISEG.js";
4
+ } from "../chunk-OW3WN3JV.js";
5
5
  import "../chunk-M7INAUAJ.js";
6
- import "../chunk-F4CV7SBS.js";
7
- import "../chunk-3XOYPT5O.js";
6
+ import "../chunk-6I5LZ2ZC.js";
7
+ import "../chunk-44TDIHUP.js";
8
8
  import {
9
9
  ProductImagePreview
10
- } from "../chunk-A7CEYUVE.js";
11
- import "../chunk-CQFPNZTN.js";
12
- import "../chunk-HPQWEZJL.js";
10
+ } from "../chunk-LZGYABCX.js";
11
+ import "../chunk-G5DEC7H3.js";
12
+ import "../chunk-3X3Y4TMS.js";
13
13
  import "../chunk-BQNPOGD5.js";
14
14
  import {
15
15
  PDFViewer
16
- } from "../chunk-GNHKKYCY.js";
16
+ } from "../chunk-LLZ3SSZJ.js";
17
17
  import "../chunk-EJSPFQCY.js";
18
- import "../chunk-DCCTNHNL.js";
19
- import "../chunk-PH76F7QS.js";
18
+ import "../chunk-ERW5DEIO.js";
19
+ import "../chunk-2HMCS25C.js";
20
20
  import "../chunk-VJVY6NPF.js";
21
21
  import "../chunk-MBZ55T2D.js";
22
22
  import "../chunk-2IKT6IHB.js";
23
- import "../chunk-2FADUKPP.js";
24
- import "../chunk-R4SFLYOZ.js";
23
+ import "../chunk-AA6GE3TH.js";
24
+ import "../chunk-KZZKQLKF.js";
25
25
  import "../chunk-5IFPG6TS.js";
26
26
  import "../chunk-AJ5M6MVX.js";
27
27
  import "../chunk-M6TSTDNZ.js";
@@ -48,7 +48,7 @@ import {
48
48
  } from "../chunk-NO5BIKWS.js";
49
49
  import {
50
50
  CompactImagesPreview
51
- } from "../chunk-FSLETAX4.js";
51
+ } from "../chunk-MQX7GFLX.js";
52
52
  import {
53
53
  DataCellHeader,
54
54
  DataGridCell,
@@ -81,11 +81,11 @@ import {
81
81
  } from "../chunk-FA7IFW66.js";
82
82
  import {
83
83
  Accordion
84
- } from "../chunk-TPXHOAY3.js";
84
+ } from "../chunk-JIMJIJOF.js";
85
85
  import {
86
86
  Card
87
- } from "../chunk-4LXG6QNT.js";
88
- import "../chunk-MX57T3HP.js";
87
+ } from "../chunk-EZCH4PQS.js";
88
+ import "../chunk-GB4ZTUQV.js";
89
89
  import {
90
90
  Paragraph
91
91
  } from "../chunk-OGIFIPKH.js";
package/dist/index.css CHANGED
@@ -801,6 +801,9 @@
801
801
  .min-h-\[120px\] {
802
802
  min-height: 120px;
803
803
  }
804
+ .min-h-full {
805
+ min-height: 100%;
806
+ }
804
807
  .min-h-min {
805
808
  min-height: min-content;
806
809
  }
@@ -3572,6 +3575,21 @@
3572
3575
  outline-style: none;
3573
3576
  }
3574
3577
  }
3578
+ .data-active\:border-transparent {
3579
+ &[data-active] {
3580
+ border-color: transparent;
3581
+ }
3582
+ }
3583
+ .data-active\:bg-background-action-primary-normal {
3584
+ &[data-active] {
3585
+ background-color: var(--color-background-action-primary-normal);
3586
+ }
3587
+ }
3588
+ .data-active\:text-white {
3589
+ &[data-active] {
3590
+ color: var(--color-white);
3591
+ }
3592
+ }
3575
3593
  .data-disabled\:cursor-default {
3576
3594
  &[data-disabled] {
3577
3595
  cursor: default;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.387",
4
+ "version": "0.0.389",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -1,19 +1,30 @@
1
1
  import clsx from "clsx";
2
2
  import { HTMLProps } from "react";
3
3
 
4
- export function Card(props: HTMLProps<HTMLDivElement> & { selected?: boolean; testid?: string; }) {
4
+ type Tags = "a" | "div" | React.ElementType;
5
+ export function Card(
6
+ props: HTMLProps<HTMLDivElement | HTMLAnchorElement> & {
7
+ selected?: boolean;
8
+ testid?: string;
9
+ as?: Tags;
10
+ },
11
+ ) {
5
12
  const { children, selected, testid, ...rest } = props;
13
+
14
+ const CardComponent = props.as || "div";
6
15
  return (
7
- <div
16
+ <CardComponent
8
17
  {...rest}
9
18
  data-testid={testid}
10
19
  className={clsx(
11
20
  "rounded-sm p-desktop-layout-padding",
12
- selected ? "border-2 border-border-primary-focus" : "border border-border-primary-normal",
21
+ selected
22
+ ? "border-2 border-border-primary-focus"
23
+ : "border border-border-primary-normal",
13
24
  rest.className,
14
25
  )}
15
26
  >
16
27
  {children}
17
- </div>
28
+ </CardComponent>
18
29
  );
19
30
  }
@@ -9,8 +9,8 @@ type CompactImagesPreviewProps = {
9
9
  sources: ImageSource[];
10
10
  currentSourceIndex: number;
11
11
  placeholderImageUri?: string;
12
- activeImageWidth?: number;
13
- activeImageHeight?: number;
12
+ activeImageWidth?: number | string;
13
+ activeImageHeight?: number | string;
14
14
  thumbnailWidth?: number;
15
15
  thumbnailHeight?: number;
16
16
  enableThumbnailBorder?: boolean;
@@ -48,7 +48,12 @@ export function CompactImagesPreview(props: CompactImagesPreviewProps) {
48
48
  return (
49
49
  <img
50
50
  className="object-center"
51
- style={{ width: activeImageWidth, height: activeImageHeight }}
51
+ style={{
52
+ width: activeImageWidth,
53
+ height: activeImageHeight,
54
+ objectPosition: "center",
55
+ objectFit: "cover",
56
+ }}
52
57
  src={placeholderImageUri}
53
58
  alt={"placeholder image"}
54
59
  />
@@ -61,6 +66,7 @@ export function CompactImagesPreview(props: CompactImagesPreviewProps) {
61
66
  width: isMobile ? "100%" : activeImageWidth,
62
67
  height: activeImageHeight,
63
68
  objectPosition: "center",
69
+ objectFit: "cover",
64
70
  }}
65
71
  src={currentSource.uri}
66
72
  alt={currentSource.name}
@@ -88,6 +94,7 @@ export function CompactImagesPreview(props: CompactImagesPreviewProps) {
88
94
  width: thumbnailWidth,
89
95
  height: thumbnailHeight,
90
96
  objectPosition: "center",
97
+ objectFit: "cover",
91
98
  }}
92
99
  />
93
100
  </button>
@@ -19,6 +19,7 @@ type OptionPillProps = {
19
19
  onRemove?: () => void;
20
20
  removable?: boolean;
21
21
  disabled?: boolean;
22
+ active?: boolean;
22
23
  };
23
24
 
24
25
  export const OptionPill = ({
@@ -28,6 +29,7 @@ export const OptionPill = ({
28
29
  onClick,
29
30
  onRemove,
30
31
  removable = false,
32
+ active = false,
31
33
  disabled = false,
32
34
  children,
33
35
  className,
@@ -36,18 +38,28 @@ export const OptionPill = ({
36
38
  const additionalAttributes = {
37
39
  "data-disabled": disabled || null,
38
40
  "data-selected": selected || null,
41
+ "data-active": active || null,
39
42
  };
40
43
 
41
44
  const classNames = clsx(
42
45
  {
46
+ // Base interactive (only when not disabled)
43
47
  "hover:border-border-action-hover active:border-border-action-active":
44
48
  !disabled,
49
+
50
+ // Disabled base
45
51
  "data-disabled:cursor-default data-disabled:border-border-primary-normal":
46
52
  disabled,
47
53
 
54
+ // Active (Figma: filled blue background, white text)
55
+ "data-active:bg-background-action-primary-normal data-active:text-white data-active:border-transparent":
56
+ active && !selected,
57
+
58
+ // Selected (filled style) overrides background & border, but keeps outline interaction chain.
48
59
  "data-selected:border-transparent data-selected:bg-background-action-secondary-hover data-selected:outline-border-action-normal data-selected:hover:outline-border-action-hover data-selected:active:outline-border-action-active":
49
60
  selected,
50
61
 
62
+ // Disabled + Selected combination
51
63
  "data-selected:data-disabled:bg-background-action-secondary-disabled data-selected:data-disabled:border-border-action-disabled data-selected:data-disabled:outline-transparent":
52
64
  disabled && selected,
53
65
  },
@@ -101,7 +113,7 @@ export const OptionPill = ({
101
113
  )}
102
114
  iconOnly
103
115
  variant="tertiary"
104
- leftIcon={<Icon name="close" />}
116
+ leftIcon={<Icon name="close" size={16} />}
105
117
  />
106
118
  )}
107
119
  </div>
@@ -83,7 +83,7 @@ export function ProductPrimaryImage({
83
83
  React.PointerEventHandler<HTMLDivElement>
84
84
  >(
85
85
  (e) => {
86
- if (!zoomEnabled || !active) return;
86
+ if (!zoomEnabled || !active || imageError) return;
87
87
 
88
88
  // Ignore touch events to prevent zoom on mobile
89
89
  if (e.pointerType === "touch") return;
@@ -123,7 +123,7 @@ export function ProductPrimaryImage({
123
123
  true,
124
124
  );
125
125
  },
126
- [zoomEnabled, active, onZoomPositionChange, zoomLensSize],
126
+ [zoomEnabled, active, imageError, zoomLensSize, onZoomPositionChange],
127
127
  );
128
128
 
129
129
  // Set up non-passive wheel event listener to properly prevent default
@@ -149,6 +149,11 @@ export function ProductPrimaryImage({
149
149
  };
150
150
  }, [scrollToZoomEnabled, zoomEnabled, active, onScrollZoom]);
151
151
 
152
+ useEffect(() => {
153
+ setImageLoading(true);
154
+ setImageError(false);
155
+ }, [image]);
156
+
152
157
  if (!image && !isPlaceholder) return null;
153
158
 
154
159
  const pt = lastPointRef.current;
@@ -174,7 +179,13 @@ export function ProductPrimaryImage({
174
179
  zoomEnabled ? "cursor-crosshair" : "",
175
180
  className,
176
181
  ].join(" ")}
177
- style={{ maxWidth: width, maxHeight: height, aspectRatio: "1 / 1" }}
182
+ style={{
183
+ maxWidth: width,
184
+ maxHeight: height,
185
+ minWidth: width,
186
+ minHeight: height,
187
+ aspectRatio: "1 / 1",
188
+ }}
178
189
  onPointerEnter={handlePointerEnter}
179
190
  onPointerLeave={handlePointerLeave}
180
191
  onPointerMove={handlePointerMove}
@@ -189,9 +200,9 @@ export function ProductPrimaryImage({
189
200
  ) : (
190
201
  <img
191
202
  key={imageSrc}
192
- src={imageSrc}
203
+ src={imageError ? "/placeholder.svg" : imageSrc}
193
204
  alt={image?.alt || "Product image"}
194
- className="object-cover w-full h-full select-none"
205
+ className="object-cover min-w-full min-h-full select-none"
195
206
  draggable={false}
196
207
  loading="lazy"
197
208
  onLoad={() => setImageLoading(false)}
@@ -1,3 +1,4 @@
1
+ import { useState } from "react";
1
2
  import { ImagePlaceholder } from "../ImagePlaceholder";
2
3
 
3
4
  export type ThumbnailProps = {
@@ -19,6 +20,8 @@ export function Thumbnail({
19
20
  onClick,
20
21
  isPlaceholder = false,
21
22
  }: ThumbnailProps) {
23
+ const [imageError, setImageError] = useState(false);
24
+
22
25
  return (
23
26
  <button
24
27
  type="button"
@@ -37,11 +40,14 @@ export function Thumbnail({
37
40
  <ImagePlaceholder width={115} height={115} />
38
41
  ) : (
39
42
  <img
40
- src={src}
43
+ src={imageError ? "/placeholder.svg" : src}
41
44
  alt={alt}
42
45
  className="object-cover w-full h-full select-none"
43
46
  draggable={false}
44
47
  loading="lazy"
48
+ onError={() => {
49
+ setImageError(true);
50
+ }}
45
51
  />
46
52
  )}
47
53
  </button>
@@ -55,6 +55,7 @@ export interface FlexProps {
55
55
  grow?: boolean;
56
56
  flexGrow?: string | number;
57
57
  flexShrink?: string | number;
58
+ flexWrap?: "wrap" | "wrap-reverse";
58
59
  }
59
60
 
60
61
  const getFlexClassNames = ({ items, justify, grow }: FlexProps) =>
@@ -126,6 +127,7 @@ export const Stack = ({
126
127
  testid,
127
128
  bottom,
128
129
  zIndex,
130
+ flexWrap,
129
131
  ...props
130
132
  }: StackProps) => {
131
133
  const flexClassNames = getFlexClassNames({ items, justify, grow });
@@ -182,6 +184,8 @@ export const Stack = ({
182
184
  borderBlock: props.style?.borderBlock,
183
185
  marginInline: props.style?.marginInline,
184
186
  zIndex: zIndex !== undefined ? zIndex : undefined,
187
+ flexWrap: flexWrap,
188
+ paddingInline: props.style?.paddingInline,
185
189
  gap: props.style?.gap,
186
190
  }}
187
191
  className={clsx(