@dmsi/wedgekit-react 0.0.494 → 0.0.496

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 (75) hide show
  1. package/dist/{chunk-BYY2NTJH.js → chunk-2A7H5GVB.js} +2 -2
  2. package/dist/{chunk-IPAKWF2V.js → chunk-5R4C5F63.js} +13 -7
  3. package/dist/chunk-BTKWHCUE.js +137 -0
  4. package/dist/{chunk-ETAEB3TA.js → chunk-L3BXRDLP.js} +8 -2
  5. package/dist/chunk-Y5GD2FJA.js +32 -0
  6. package/dist/{chunk-QBSEKZWX.js → chunk-ZKTHUXKS.js} +1 -1
  7. package/dist/components/CalendarRange.cjs +526 -398
  8. package/dist/components/CalendarRange.css +26 -3
  9. package/dist/components/CalendarRange.js +7 -5
  10. package/dist/components/Caption.cjs +6 -3
  11. package/dist/components/Caption.js +5 -129
  12. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +517 -389
  13. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +26 -3
  14. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +7 -5
  15. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +520 -392
  16. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +26 -3
  17. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +7 -5
  18. package/dist/components/DataGrid/PinnedColumns.cjs +521 -393
  19. package/dist/components/DataGrid/PinnedColumns.css +26 -3
  20. package/dist/components/DataGrid/PinnedColumns.js +7 -5
  21. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +515 -387
  22. package/dist/components/DataGrid/TableBody/LoadingCell.css +26 -3
  23. package/dist/components/DataGrid/TableBody/LoadingCell.js +7 -5
  24. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +516 -388
  25. package/dist/components/DataGrid/TableBody/TableBodyRow.css +26 -3
  26. package/dist/components/DataGrid/TableBody/TableBodyRow.js +7 -5
  27. package/dist/components/DataGrid/TableBody/index.cjs +516 -388
  28. package/dist/components/DataGrid/TableBody/index.css +26 -3
  29. package/dist/components/DataGrid/TableBody/index.js +7 -5
  30. package/dist/components/DataGrid/index.cjs +536 -408
  31. package/dist/components/DataGrid/index.css +26 -3
  32. package/dist/components/DataGrid/index.js +7 -5
  33. package/dist/components/DataGrid/utils.cjs +515 -387
  34. package/dist/components/DataGrid/utils.css +26 -3
  35. package/dist/components/DataGrid/utils.js +7 -5
  36. package/dist/components/DataGridCell.cjs +212 -88
  37. package/dist/components/DataGridCell.js +3 -2
  38. package/dist/components/DateInput.cjs +508 -380
  39. package/dist/components/DateInput.css +26 -3
  40. package/dist/components/DateInput.js +7 -5
  41. package/dist/components/DateRangeInput.cjs +514 -386
  42. package/dist/components/DateRangeInput.css +26 -3
  43. package/dist/components/DateRangeInput.js +7 -5
  44. package/dist/components/MenuOption.cjs +147 -23
  45. package/dist/components/MenuOption.js +2 -1
  46. package/dist/components/MobileDataGrid/ColumnList.js +1 -1
  47. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +526 -398
  48. package/dist/components/MobileDataGrid/ColumnSelector/index.css +26 -3
  49. package/dist/components/MobileDataGrid/ColumnSelector/index.js +7 -5
  50. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +1 -1
  51. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +505 -377
  52. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +26 -3
  53. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +7 -5
  54. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +1 -1
  55. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +1 -1
  56. package/dist/components/MobileDataGrid/index.cjs +560 -432
  57. package/dist/components/MobileDataGrid/index.css +26 -3
  58. package/dist/components/MobileDataGrid/index.js +7 -5
  59. package/dist/components/NestedMenu.cjs +170 -46
  60. package/dist/components/NestedMenu.js +2 -1
  61. package/dist/components/SearchResultImage/index.cjs +92 -0
  62. package/dist/components/SearchResultImage/index.js +8 -0
  63. package/dist/components/SkeletonParagraph.cjs +8 -2
  64. package/dist/components/SkeletonParagraph.js +1 -1
  65. package/dist/components/index.cjs +715 -558
  66. package/dist/components/index.css +26 -3
  67. package/dist/components/index.js +10 -5
  68. package/dist/index.css +26 -3
  69. package/package.json +1 -1
  70. package/src/components/Caption.tsx +3 -0
  71. package/src/components/MenuOption.tsx +16 -6
  72. package/src/components/SearchResultImage/index.tsx +39 -0
  73. package/src/components/SkeletonParagraph.tsx +9 -1
  74. package/src/components/index.ts +1 -0
  75. package/src/index.css +4 -3
@@ -838,6 +838,12 @@
838
838
  .\!w-20 {
839
839
  width: calc(var(--spacing) * 20) !important;
840
840
  }
841
+ .w-1\/2 {
842
+ width: calc(1/2 * 100%);
843
+ }
844
+ .w-1\/4 {
845
+ width: calc(1/4 * 100%);
846
+ }
841
847
  .w-2\/3 {
842
848
  width: calc(2/3 * 100%);
843
849
  }
@@ -922,6 +928,9 @@
922
928
  .min-w-0 {
923
929
  min-width: calc(var(--spacing) * 0);
924
930
  }
931
+ .min-w-10 {
932
+ min-width: calc(var(--spacing) * 10);
933
+ }
925
934
  .min-w-20 {
926
935
  min-width: calc(var(--spacing) * 20);
927
936
  }
@@ -4091,6 +4100,11 @@
4091
4100
  margin-top: var(--spacing-desktop-container-padding);
4092
4101
  }
4093
4102
  }
4103
+ .desktop\:mt-px {
4104
+ @container root (width >= 48rem) {
4105
+ margin-top: 1px;
4106
+ }
4107
+ }
4094
4108
  .desktop\:mb-desktop-container-padding {
4095
4109
  @container root (width >= 48rem) {
4096
4110
  margin-bottom: var(--spacing-desktop-container-padding);
@@ -4673,6 +4687,7 @@
4673
4687
  position: relative;
4674
4688
  overflow: hidden;
4675
4689
  background-color: #f7f7f7;
4690
+ opacity: 0.85;
4676
4691
  }
4677
4692
  .skeleton-paragraph::after {
4678
4693
  content: "";
@@ -4682,9 +4697,17 @@
4682
4697
  background-image:
4683
4698
  linear-gradient(
4684
4699
  90deg,
4685
- rgba(255, 255, 255, 0) 0%,
4686
- rgba(255, 255, 255, 0.6) 50%,
4687
- rgba(255, 255, 255, 0) 100%);
4700
+ transparent 0%,
4701
+ color-mix(in srgb, #ffffff 60%, transparent) 50%,
4702
+ transparent 100%);
4703
+ @supports (color: color-mix(in lab, red, red)) {
4704
+ background-image:
4705
+ linear-gradient(
4706
+ 90deg,
4707
+ transparent 0%,
4708
+ color-mix(in srgb, var(--color-neutral-000) 60%, transparent) 50%,
4709
+ transparent 100%);
4710
+ }
4688
4711
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
4689
4712
  }
4690
4713
  @keyframes skeleton-shimmer {
@@ -2,13 +2,16 @@ import {
2
2
  DataGrid,
3
3
  DateInput,
4
4
  MobileDataGrid
5
- } from "../chunk-BYY2NTJH.js";
5
+ } from "../chunk-2A7H5GVB.js";
6
6
  import "../chunk-M7INAUAJ.js";
7
7
  import "../chunk-4Q7T4GJ2.js";
8
8
  import "../chunk-3DEYCNUE.js";
9
9
  import {
10
10
  ProductImagePreview
11
11
  } from "../chunk-DYBJUTGK.js";
12
+ import {
13
+ SearchResultImage
14
+ } from "../chunk-Y5GD2FJA.js";
12
15
  import {
13
16
  PDFViewer
14
17
  } from "../chunk-TPBEID5X.js";
@@ -21,8 +24,8 @@ import "../chunk-BQNPOGD5.js";
21
24
  import "../chunk-QMSPTD6L.js";
22
25
  import "../chunk-XIXQUEYC.js";
23
26
  import "../chunk-5IFPG6TS.js";
24
- import "../chunk-KW6V7O3H.js";
25
27
  import "../chunk-AJ5M6MVX.js";
28
+ import "../chunk-KW6V7O3H.js";
26
29
  import "../chunk-JUFBGNWW.js";
27
30
  import "../chunk-YEZBNQZI.js";
28
31
  import "../chunk-S5ZJ3Q7P.js";
@@ -36,7 +39,7 @@ import {
36
39
  } from "../chunk-7BVUTFZ5.js";
37
40
  import {
38
41
  SkeletonParagraph
39
- } from "../chunk-ETAEB3TA.js";
42
+ } from "../chunk-L3BXRDLP.js";
40
43
  import {
41
44
  Pagination
42
45
  } from "../chunk-GRGDX7JC.js";
@@ -60,14 +63,14 @@ import {
60
63
  DataGridCell,
61
64
  DragAlongCell,
62
65
  DraggableCellHeader
63
- } from "../chunk-QBSEKZWX.js";
66
+ } from "../chunk-ZKTHUXKS.js";
64
67
  import {
65
68
  Menu
66
69
  } from "../chunk-TCMOGTPB.js";
67
70
  import "../chunk-DVU5XV7L.js";
68
71
  import {
69
72
  MenuOption
70
- } from "../chunk-IPAKWF2V.js";
73
+ } from "../chunk-5R4C5F63.js";
71
74
  import {
72
75
  Search
73
76
  } from "../chunk-RQRR4FEF.js";
@@ -81,6 +84,7 @@ import "../chunk-WVUIIBRR.js";
81
84
  import {
82
85
  EmptyCartIcon
83
86
  } from "../chunk-75USUR3I.js";
87
+ import "../chunk-BTKWHCUE.js";
84
88
  import {
85
89
  Checkbox
86
90
  } from "../chunk-WEAVZEE4.js";
@@ -142,6 +146,7 @@ export {
142
146
  Paragraph,
143
147
  ProductImagePreview,
144
148
  Search,
149
+ SearchResultImage,
145
150
  Select,
146
151
  SimpleTable,
147
152
  SkeletonParagraph,
package/dist/index.css CHANGED
@@ -816,6 +816,12 @@
816
816
  .\!w-20 {
817
817
  width: calc(var(--spacing) * 20) !important;
818
818
  }
819
+ .w-1\/2 {
820
+ width: calc(1/2 * 100%);
821
+ }
822
+ .w-1\/4 {
823
+ width: calc(1/4 * 100%);
824
+ }
819
825
  .w-2\/3 {
820
826
  width: calc(2/3 * 100%);
821
827
  }
@@ -900,6 +906,9 @@
900
906
  .min-w-0 {
901
907
  min-width: calc(var(--spacing) * 0);
902
908
  }
909
+ .min-w-10 {
910
+ min-width: calc(var(--spacing) * 10);
911
+ }
903
912
  .min-w-20 {
904
913
  min-width: calc(var(--spacing) * 20);
905
914
  }
@@ -4069,6 +4078,11 @@
4069
4078
  margin-top: var(--spacing-desktop-container-padding);
4070
4079
  }
4071
4080
  }
4081
+ .desktop\:mt-px {
4082
+ @container root (width >= 48rem) {
4083
+ margin-top: 1px;
4084
+ }
4085
+ }
4072
4086
  .desktop\:mb-desktop-container-padding {
4073
4087
  @container root (width >= 48rem) {
4074
4088
  margin-bottom: var(--spacing-desktop-container-padding);
@@ -4651,6 +4665,7 @@
4651
4665
  position: relative;
4652
4666
  overflow: hidden;
4653
4667
  background-color: #f7f7f7;
4668
+ opacity: 0.85;
4654
4669
  }
4655
4670
  .skeleton-paragraph::after {
4656
4671
  content: "";
@@ -4660,9 +4675,17 @@
4660
4675
  background-image:
4661
4676
  linear-gradient(
4662
4677
  90deg,
4663
- rgba(255, 255, 255, 0) 0%,
4664
- rgba(255, 255, 255, 0.6) 50%,
4665
- rgba(255, 255, 255, 0) 100%);
4678
+ transparent 0%,
4679
+ color-mix(in srgb, #ffffff 60%, transparent) 50%,
4680
+ transparent 100%);
4681
+ @supports (color: color-mix(in lab, red, red)) {
4682
+ background-image:
4683
+ linear-gradient(
4684
+ 90deg,
4685
+ transparent 0%,
4686
+ color-mix(in srgb, var(--color-neutral-000) 60%, transparent) 50%,
4687
+ transparent 100%);
4688
+ }
4666
4689
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
4667
4690
  }
4668
4691
  @keyframes skeleton-shimmer {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dmsi/wedgekit-react",
3
3
  "private": false,
4
- "version": "0.0.494",
4
+ "version": "0.0.496",
5
5
  "type": "module",
6
6
  "scripts": {
7
7
  "build": "tsup",
@@ -13,6 +13,7 @@ type CaptionProps = {
13
13
  style?: Style["style"];
14
14
  id?: string;
15
15
  testid?: string;
16
+ marginTopDesktop?: boolean;
16
17
  } & AsProps<Tags> &
17
18
  TextAttributes &
18
19
  TypographyProps;
@@ -26,6 +27,7 @@ export const Caption = ({
26
27
  align,
27
28
  id,
28
29
  testid,
30
+ marginTopDesktop,
29
31
  ...props
30
32
  }: CaptionProps) => {
31
33
  const Element = as;
@@ -54,6 +56,7 @@ export const Caption = ({
54
56
  align === "center" && "text-center",
55
57
  align === "right" && "text-right",
56
58
  className,
59
+ marginTopDesktop && `desktop:mt-px`,
57
60
  )}
58
61
  {...props}
59
62
  style={{
@@ -2,13 +2,14 @@
2
2
 
3
3
  import clsx from "clsx";
4
4
  import { PropsWithChildren, ReactNode, RefObject, useId, useRef } from "react";
5
- import { baseTransition, componentGap, componentPadding } from "../classNames";
5
+ import { baseTransition, componentGap, componentPadding, layoutGroupGap } from "../classNames";
6
6
  import { AsProps } from "../types";
7
7
  import { Label, Tags } from "./Label";
8
8
  import { Paragraph } from "./Paragraph";
9
9
  import { Icon } from "./Icon";
10
10
  import { MenuPosition } from "./Menu";
11
11
  import { useMatchesMobile } from "../hooks";
12
+ import { Caption } from "./Caption";
12
13
 
13
14
  type BaseProps = PropsWithChildren<{
14
15
  id?: string;
@@ -22,6 +23,7 @@ type BaseProps = PropsWithChildren<{
22
23
  mobilePositionTo?: RefObject<HTMLElement | null>;
23
24
  selected?: boolean;
24
25
  currentSubMenuLevel?: number | null;
26
+ small?: boolean;
25
27
  }> &
26
28
  (
27
29
  | {
@@ -100,7 +102,8 @@ export const MenuOption = ({
100
102
  mobilePositionTo,
101
103
  highlightMatchingText = false,
102
104
  menuValue,
103
- onMouseMove
105
+ onMouseMove,
106
+ small = false,
104
107
  }: MenuOptionProps) => {
105
108
  const uniqueId = useId();
106
109
  const internalRef = useRef(null);
@@ -186,9 +189,15 @@ export const MenuOption = ({
186
189
  {processChildren}
187
190
  </Label>
188
191
  ) : (
192
+ !small ? (
189
193
  <Paragraph padded className={textLabelStyles}>
190
194
  {processChildren}
191
195
  </Paragraph>
196
+ ) : (
197
+ <Caption padded className={textLabelStyles}>
198
+ {processChildren}
199
+ </Caption>
200
+ )
192
201
  );
193
202
 
194
203
  return (
@@ -198,9 +207,9 @@ export const MenuOption = ({
198
207
  data-testid={testid}
199
208
  ref={actualRef}
200
209
  className={clsx(
201
- "flex items-center cursor-pointer w-full text-left relative outline-none",
210
+ "flex cursor-pointer w-full text-left relative outline-none",
202
211
  svgStyles,
203
- componentGap,
212
+ small ? layoutGroupGap : componentGap,
204
213
  componentPadding,
205
214
  baseTransition,
206
215
  normalStyles,
@@ -208,6 +217,7 @@ export const MenuOption = ({
208
217
  actionStyles,
209
218
  actionDisabledStyles,
210
219
  disabledStyles,
220
+ { "items-center": !small },
211
221
  )}
212
222
  data-value={value || children}
213
223
  onClick={() => {
@@ -224,7 +234,7 @@ export const MenuOption = ({
224
234
  role="menuitem"
225
235
  aria-haspopup={subMenu ? "menu" : undefined}
226
236
  >
227
- {before && <div className="shrink-0 flex items-center">{before}</div>}
237
+ {before && <div className={clsx("shrink-0", { "items-center flex": !small })}>{before}</div>}
228
238
 
229
239
  {renderChildren}
230
240
 
@@ -273,7 +283,7 @@ export const MenuOption = ({
273
283
  testid={testid ? `${testid}-back` : undefined}
274
284
  onClick={() => {
275
285
  closeSubMenuLevel?.(currentSubMenuLevel ?? 0);
276
- }}
286
+ }}
277
287
  variant="action"
278
288
  before={<Icon name="chevron_left" />}
279
289
  >
@@ -0,0 +1,39 @@
1
+ import { useState } from "react";
2
+ import { ImagePlaceholder } from "../ImagePlaceholder";
3
+
4
+ export type SearchResultImageProps = {
5
+ width?: number;
6
+ height?: number;
7
+ src?: string | null;
8
+ alt: string;
9
+ className?: string;
10
+ };
11
+
12
+ export function SearchResultImage({
13
+ width = 20,
14
+ height = 20,
15
+ src,
16
+ alt,
17
+ }: SearchResultImageProps) {
18
+ const [imageError, setImageError] = useState(false);
19
+
20
+ const showPlaceholder = imageError || !src;
21
+
22
+ return (
23
+ <>
24
+ {showPlaceholder ? (
25
+ <ImagePlaceholder width={width} height={height} />
26
+ ) : (
27
+ <img
28
+ src={src}
29
+ alt={alt}
30
+ width={width}
31
+ height={height}
32
+ draggable={false}
33
+ loading="lazy"
34
+ onError={() => setImageError(true)}
35
+ />
36
+ )}
37
+ </>
38
+ );
39
+ }
@@ -3,6 +3,8 @@ interface SkeletonParagraphProps {
3
3
  className?: string;
4
4
  /** Height of the skeleton (tailwind height utility), defaults to h-6 */
5
5
  heightClassName?: string;
6
+ /** Size of the skeleton, affects widthClassName */
7
+ size?: "small" | "medium" | "large";
6
8
  }
7
9
 
8
10
  /**
@@ -12,12 +14,18 @@ interface SkeletonParagraphProps {
12
14
  export function SkeletonParagraph({
13
15
  className = "",
14
16
  heightClassName = "h-6",
17
+ size = "large",
15
18
  }: SkeletonParagraphProps) {
19
+ const sizeClassMap: Record<string, string> = {
20
+ small: "min-w-10 w-1/4",
21
+ medium: "min-w-20 w-1/2",
22
+ large: "min-w-32 w-full",
23
+ };
16
24
  return (
17
25
  <div
18
26
  aria-label="Loading content"
19
27
  role="status"
20
- className={`skeleton-paragraph ${heightClassName} w-full min-w-32 rounded-xs ${className}`}
28
+ className={`skeleton-paragraph ${heightClassName} ${sizeClassMap[size]} rounded-xs ${className}`}
21
29
  />
22
30
  );
23
31
  }
@@ -30,4 +30,5 @@ export { ListGroup } from "./ListGroup";
30
30
  export { Pagination } from "./Pagination";
31
31
  export { SkeletonParagraph } from "./SkeletonParagraph";
32
32
  export { EmptyCartIcon } from "./EmptyCartIcon";
33
+ export { SearchResultImage } from "./SearchResultImage";
33
34
  export { Alert } from "./Alert";
package/src/index.css CHANGED
@@ -639,6 +639,7 @@
639
639
  position: relative;
640
640
  overflow: hidden;
641
641
  background-color: theme("colors.neutral.100");
642
+ opacity: 0.85;
642
643
  }
643
644
 
644
645
  .skeleton-paragraph::after {
@@ -648,9 +649,9 @@
648
649
  transform: translateX(-100%);
649
650
  background-image: linear-gradient(
650
651
  90deg,
651
- rgba(255, 255, 255, 0) 0%,
652
- rgba(255, 255, 255, 0.6) 50%,
653
- rgba(255, 255, 255, 0) 100%
652
+ transparent 0%,
653
+ color-mix(in srgb, var(--color-neutral-000) 60%, transparent) 50%,
654
+ transparent 100%
654
655
  );
655
656
  animation: skeleton-shimmer 1.4s ease-in-out infinite;
656
657
  }