@dmsi/wedgekit-react 0.0.494 → 0.0.495

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 (70) 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-Y5GD2FJA.js +32 -0
  5. package/dist/{chunk-QBSEKZWX.js → chunk-ZKTHUXKS.js} +1 -1
  6. package/dist/components/CalendarRange.cjs +526 -398
  7. package/dist/components/CalendarRange.css +5 -0
  8. package/dist/components/CalendarRange.js +6 -4
  9. package/dist/components/Caption.cjs +6 -3
  10. package/dist/components/Caption.js +5 -129
  11. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.cjs +517 -389
  12. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.css +5 -0
  13. package/dist/components/DataGrid/ColumnSelectorHeaderCell/ColumnSelectorMenuOption.js +6 -4
  14. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.cjs +520 -392
  15. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.css +5 -0
  16. package/dist/components/DataGrid/ColumnSelectorHeaderCell/index.js +6 -4
  17. package/dist/components/DataGrid/PinnedColumns.cjs +521 -393
  18. package/dist/components/DataGrid/PinnedColumns.css +5 -0
  19. package/dist/components/DataGrid/PinnedColumns.js +6 -4
  20. package/dist/components/DataGrid/TableBody/LoadingCell.cjs +515 -387
  21. package/dist/components/DataGrid/TableBody/LoadingCell.css +5 -0
  22. package/dist/components/DataGrid/TableBody/LoadingCell.js +6 -4
  23. package/dist/components/DataGrid/TableBody/TableBodyRow.cjs +516 -388
  24. package/dist/components/DataGrid/TableBody/TableBodyRow.css +5 -0
  25. package/dist/components/DataGrid/TableBody/TableBodyRow.js +6 -4
  26. package/dist/components/DataGrid/TableBody/index.cjs +516 -388
  27. package/dist/components/DataGrid/TableBody/index.css +5 -0
  28. package/dist/components/DataGrid/TableBody/index.js +6 -4
  29. package/dist/components/DataGrid/index.cjs +536 -408
  30. package/dist/components/DataGrid/index.css +5 -0
  31. package/dist/components/DataGrid/index.js +6 -4
  32. package/dist/components/DataGrid/utils.cjs +515 -387
  33. package/dist/components/DataGrid/utils.css +5 -0
  34. package/dist/components/DataGrid/utils.js +6 -4
  35. package/dist/components/DataGridCell.cjs +212 -88
  36. package/dist/components/DataGridCell.js +3 -2
  37. package/dist/components/DateInput.cjs +508 -380
  38. package/dist/components/DateInput.css +5 -0
  39. package/dist/components/DateInput.js +6 -4
  40. package/dist/components/DateRangeInput.cjs +514 -386
  41. package/dist/components/DateRangeInput.css +5 -0
  42. package/dist/components/DateRangeInput.js +6 -4
  43. package/dist/components/MenuOption.cjs +147 -23
  44. package/dist/components/MenuOption.js +2 -1
  45. package/dist/components/MobileDataGrid/ColumnList.js +1 -1
  46. package/dist/components/MobileDataGrid/ColumnSelector/index.cjs +526 -398
  47. package/dist/components/MobileDataGrid/ColumnSelector/index.css +5 -0
  48. package/dist/components/MobileDataGrid/ColumnSelector/index.js +6 -4
  49. package/dist/components/MobileDataGrid/MobileDataGridCard/index.js +1 -1
  50. package/dist/components/MobileDataGrid/MobileDataGridHeader.cjs +505 -377
  51. package/dist/components/MobileDataGrid/MobileDataGridHeader.css +5 -0
  52. package/dist/components/MobileDataGrid/MobileDataGridHeader.js +6 -4
  53. package/dist/components/MobileDataGrid/RowDetailModalProvider/ModalContent.js +1 -1
  54. package/dist/components/MobileDataGrid/RowDetailModalProvider/index.js +1 -1
  55. package/dist/components/MobileDataGrid/index.cjs +560 -432
  56. package/dist/components/MobileDataGrid/index.css +5 -0
  57. package/dist/components/MobileDataGrid/index.js +6 -4
  58. package/dist/components/NestedMenu.cjs +170 -46
  59. package/dist/components/NestedMenu.js +2 -1
  60. package/dist/components/SearchResultImage/index.cjs +92 -0
  61. package/dist/components/SearchResultImage/index.js +8 -0
  62. package/dist/components/index.cjs +707 -556
  63. package/dist/components/index.css +5 -0
  64. package/dist/components/index.js +9 -4
  65. package/dist/index.css +5 -0
  66. package/package.json +1 -1
  67. package/src/components/Caption.tsx +3 -0
  68. package/src/components/MenuOption.tsx +16 -6
  69. package/src/components/SearchResultImage/index.tsx +39 -0
  70. package/src/components/index.ts +1 -0
@@ -4091,6 +4091,11 @@
4091
4091
  margin-top: var(--spacing-desktop-container-padding);
4092
4092
  }
4093
4093
  }
4094
+ .desktop\:mt-px {
4095
+ @container root (width >= 48rem) {
4096
+ margin-top: 1px;
4097
+ }
4098
+ }
4094
4099
  .desktop\:mb-desktop-container-padding {
4095
4100
  @container root (width >= 48rem) {
4096
4101
  margin-bottom: var(--spacing-desktop-container-padding);
@@ -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";
@@ -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
@@ -4069,6 +4069,11 @@
4069
4069
  margin-top: var(--spacing-desktop-container-padding);
4070
4070
  }
4071
4071
  }
4072
+ .desktop\:mt-px {
4073
+ @container root (width >= 48rem) {
4074
+ margin-top: 1px;
4075
+ }
4076
+ }
4072
4077
  .desktop\:mb-desktop-container-padding {
4073
4078
  @container root (width >= 48rem) {
4074
4079
  margin-bottom: var(--spacing-desktop-container-padding);
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.495",
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
+ }
@@ -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";