@dmsi/wedgekit-react 0.0.171 → 0.0.173

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.
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-SYEJVSE4.js";
10
10
  import {
11
11
  ModalHeader
12
- } from "./chunk-6A54FL75.js";
12
+ } from "./chunk-ZSKLCKIR.js";
13
13
  import {
14
14
  ModalScrim
15
15
  } from "./chunk-ZFOANBWG.js";
@@ -97,6 +97,7 @@ var Modal = ({
97
97
  showButtons = false,
98
98
  hideCloseIcon = false,
99
99
  headerIcon,
100
+ headerIconAlign,
100
101
  fixedHeightScrolling = false,
101
102
  customActions
102
103
  }) => {
@@ -126,7 +127,7 @@ var Modal = ({
126
127
  fadeInScale(modalRef.current);
127
128
  bgFadeIn(bgRef.current);
128
129
  }
129
- }, [mounted, open]);
130
+ }, [mounted, onClose, open, wasOpen]);
130
131
  const handleKeyDown = useCallback(
131
132
  (e) => {
132
133
  if (e.key === "Escape") {
@@ -136,7 +137,7 @@ var Modal = ({
136
137
  }
137
138
  }
138
139
  },
139
- [onClose, bgRef, modalRef]
140
+ [onClose]
140
141
  );
141
142
  const handleClose = useCallback(() => {
142
143
  if (onClose) {
@@ -221,7 +222,8 @@ var Modal = ({
221
222
  title,
222
223
  onClose: handleClose,
223
224
  hideCloseIcon,
224
- headerIcon
225
+ headerIcon,
226
+ headerIconAlign
225
227
  }
226
228
  ),
227
229
  children && /* @__PURE__ */ jsx(
@@ -185,7 +185,7 @@ function DataCellHeader(_a) {
185
185
  "testid",
186
186
  "useMenuDefaultMinWidth"
187
187
  ]);
188
- var _a2;
188
+ var _a2, _b2, _c;
189
189
  const [showMenu, setShowMenu] = useState(false);
190
190
  const [filter, setFilter] = useState(
191
191
  (_a2 = header.column.getFilterValue()) != null ? _a2 : ""
@@ -219,7 +219,7 @@ function DataCellHeader(_a) {
219
219
  const style = __spreadValues({
220
220
  position: "relative",
221
221
  whiteSpace: "nowrap",
222
- width: header.column.getSize(),
222
+ width: (_c = (_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.headerWidth) != null ? _c : header.column.getSize(),
223
223
  "--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
224
224
  "--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
225
225
  "--background-action-secondary-normal": "var(--color-text-brand-primary-normal)"
@@ -256,8 +256,8 @@ function DataCellHeader(_a) {
256
256
  id: id ? `${id}-filter-option` : void 0,
257
257
  testid: testid ? `${testid}-filter-option` : void 0
258
258
  }, subMenuListeners), {
259
- subMenu: (_b2) => {
260
- var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
259
+ subMenu: (_d) => {
260
+ var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
261
261
  return /* @__PURE__ */ jsxs(
262
262
  Menu,
263
263
  __spreadProps(__spreadValues({
@@ -330,8 +330,8 @@ function DataCellHeader(_a) {
330
330
  setShowMenu(!showMenu);
331
331
  }
332
332
  }, subMenuListeners), {
333
- subMenu: (_d) => {
334
- var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
333
+ subMenu: (_f) => {
334
+ var _g = _f, { menuId, subMenuLevel } = _g, props2 = __objRest(_g, ["menuId", "subMenuLevel"]);
335
335
  return /* @__PURE__ */ jsxs(
336
336
  Menu,
337
337
  __spreadProps(__spreadValues({}, props2), {
@@ -419,6 +419,7 @@ function DraggableCellHeader(_a) {
419
419
  "header",
420
420
  "children"
421
421
  ]);
422
+ var _a2, _b2;
422
423
  const { attributes, isDragging, listeners, setNodeRef, transform, node } = useSortable({
423
424
  id: header.column.id
424
425
  });
@@ -429,7 +430,7 @@ function DraggableCellHeader(_a) {
429
430
  transition: "width transform 0.2s ease-in-out",
430
431
  whiteSpace: "nowrap",
431
432
  zIndex: isDragging ? 1 : 0,
432
- width: header.column.getSize(),
433
+ width: (_b2 = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.headerWidth) != null ? _b2 : header.column.getSize(),
433
434
  "--color-text-primary-normal": "var(--color-action-000)",
434
435
  "--color-icon-on-action-primary-normal": "var(--color-action-000)",
435
436
  userSelect: "none"
@@ -455,6 +456,7 @@ function DragAlongCell(_a) {
455
456
  "cell",
456
457
  "children"
457
458
  ]);
459
+ var _a2, _b2, _c, _d;
458
460
  const { isDragging, setNodeRef, transform } = useSortable({
459
461
  id: cell.column.id
460
462
  });
@@ -463,10 +465,19 @@ function DragAlongCell(_a) {
463
465
  position: "relative",
464
466
  transform: CSS.Translate.toString(transform),
465
467
  transition: "width transform 0.2s ease-in-out",
466
- width: cell.column.getSize(),
468
+ width: (_b2 = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.headerWidth) != null ? _b2 : cell.column.getSize(),
467
469
  zIndex: isDragging ? 1 : 0
468
470
  };
469
- return /* @__PURE__ */ jsx(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
471
+ return /* @__PURE__ */ jsx(
472
+ DataGridCell,
473
+ __spreadProps(__spreadValues({
474
+ style,
475
+ ref: setNodeRef,
476
+ width: (_d = (_c = cell.column.columnDef.meta) == null ? void 0 : _c.headerWidth) != null ? _d : `${cell.column.getSize()}px`
477
+ }, props), {
478
+ children
479
+ })
480
+ );
470
481
  }
471
482
  DragAlongCell.displayName = "DragAlongCell";
472
483
 
@@ -19,6 +19,7 @@ var ModalHeader = ({
19
19
  title,
20
20
  hideCloseIcon,
21
21
  headerIcon,
22
+ headerIconAlign,
22
23
  onClose,
23
24
  id,
24
25
  testid
@@ -30,13 +31,24 @@ var ModalHeader = ({
30
31
  "data-testid": testid,
31
32
  className: clsx(
32
33
  "flex justify-between items-center",
34
+ headerIconAlign === "center" && "justify-center",
35
+ headerIconAlign === "right" && "justify-end",
36
+ headerIconAlign === "left" && "justify-start",
33
37
  layoutPaddding,
34
38
  layoutGroupGap
35
39
  ),
36
40
  children: [
37
41
  /* @__PURE__ */ jsxs("div", { className: clsx("flex items-center", layoutGroupGap), children: [
38
42
  headerIcon,
39
- title && /* @__PURE__ */ jsx(Heading2, { id: id ? `${id}-title` : void 0, testid: testid ? `${testid}-title` : void 0, as: "p", children: title })
43
+ title && /* @__PURE__ */ jsx(
44
+ Heading2,
45
+ {
46
+ id: id ? `${id}-title` : void 0,
47
+ testid: testid ? `${testid}-title` : void 0,
48
+ as: "p",
49
+ children: title
50
+ }
51
+ )
40
52
  ] }),
41
53
  !hideCloseIcon && /* @__PURE__ */ jsx(
42
54
  Button,
@@ -1839,7 +1839,7 @@ function DataCellHeader(_a) {
1839
1839
  "testid",
1840
1840
  "useMenuDefaultMinWidth"
1841
1841
  ]);
1842
- var _a2;
1842
+ var _a2, _b2, _c;
1843
1843
  const [showMenu, setShowMenu] = (0, import_react10.useState)(false);
1844
1844
  const [filter, setFilter] = (0, import_react10.useState)(
1845
1845
  (_a2 = header.column.getFilterValue()) != null ? _a2 : ""
@@ -1873,7 +1873,7 @@ function DataCellHeader(_a) {
1873
1873
  const style = __spreadValues({
1874
1874
  position: "relative",
1875
1875
  whiteSpace: "nowrap",
1876
- width: header.column.getSize(),
1876
+ width: (_c = (_b2 = header.column.columnDef.meta) == null ? void 0 : _b2.headerWidth) != null ? _c : header.column.getSize(),
1877
1877
  "--color-text-primary-normal": "var(--color-text-brand-primary-normal)",
1878
1878
  "--color-icon-on-action-primary-normal": "var(--color-text-brand-primary-normal)",
1879
1879
  "--background-action-secondary-normal": "var(--color-text-brand-primary-normal)"
@@ -1910,8 +1910,8 @@ function DataCellHeader(_a) {
1910
1910
  id: id ? `${id}-filter-option` : void 0,
1911
1911
  testid: testid ? `${testid}-filter-option` : void 0
1912
1912
  }, subMenuListeners), {
1913
- subMenu: (_b2) => {
1914
- var _c = _b2, { menuId, subMenuLevel } = _c, props2 = __objRest(_c, ["menuId", "subMenuLevel"]);
1913
+ subMenu: (_d) => {
1914
+ var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
1915
1915
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1916
1916
  Menu,
1917
1917
  __spreadProps(__spreadValues({
@@ -1984,8 +1984,8 @@ function DataCellHeader(_a) {
1984
1984
  setShowMenu(!showMenu);
1985
1985
  }
1986
1986
  }, subMenuListeners), {
1987
- subMenu: (_d) => {
1988
- var _e = _d, { menuId, subMenuLevel } = _e, props2 = __objRest(_e, ["menuId", "subMenuLevel"]);
1987
+ subMenu: (_f) => {
1988
+ var _g = _f, { menuId, subMenuLevel } = _g, props2 = __objRest(_g, ["menuId", "subMenuLevel"]);
1989
1989
  return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(
1990
1990
  Menu,
1991
1991
  __spreadProps(__spreadValues({}, props2), {
@@ -2073,6 +2073,7 @@ function DraggableCellHeader(_a) {
2073
2073
  "header",
2074
2074
  "children"
2075
2075
  ]);
2076
+ var _a2, _b2;
2076
2077
  const { attributes, isDragging, listeners, setNodeRef, transform, node } = (0, import_sortable.useSortable)({
2077
2078
  id: header.column.id
2078
2079
  });
@@ -2083,7 +2084,7 @@ function DraggableCellHeader(_a) {
2083
2084
  transition: "width transform 0.2s ease-in-out",
2084
2085
  whiteSpace: "nowrap",
2085
2086
  zIndex: isDragging ? 1 : 0,
2086
- width: header.column.getSize(),
2087
+ width: (_b2 = (_a2 = header.column.columnDef.meta) == null ? void 0 : _a2.headerWidth) != null ? _b2 : header.column.getSize(),
2087
2088
  "--color-text-primary-normal": "var(--color-action-000)",
2088
2089
  "--color-icon-on-action-primary-normal": "var(--color-action-000)",
2089
2090
  userSelect: "none"
@@ -2109,6 +2110,7 @@ function DragAlongCell(_a) {
2109
2110
  "cell",
2110
2111
  "children"
2111
2112
  ]);
2113
+ var _a2, _b2, _c, _d;
2112
2114
  const { isDragging, setNodeRef, transform } = (0, import_sortable.useSortable)({
2113
2115
  id: cell.column.id
2114
2116
  });
@@ -2117,10 +2119,19 @@ function DragAlongCell(_a) {
2117
2119
  position: "relative",
2118
2120
  transform: CSS.Translate.toString(transform),
2119
2121
  transition: "width transform 0.2s ease-in-out",
2120
- width: cell.column.getSize(),
2122
+ width: (_b2 = (_a2 = cell.column.columnDef.meta) == null ? void 0 : _a2.headerWidth) != null ? _b2 : cell.column.getSize(),
2121
2123
  zIndex: isDragging ? 1 : 0
2122
2124
  };
2123
- return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(DataGridCell, __spreadProps(__spreadValues({ style, ref: setNodeRef }, props), { children }));
2125
+ return /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
2126
+ DataGridCell,
2127
+ __spreadProps(__spreadValues({
2128
+ style,
2129
+ ref: setNodeRef,
2130
+ width: (_d = (_c = cell.column.columnDef.meta) == null ? void 0 : _c.headerWidth) != null ? _d : `${cell.column.getSize()}px`
2131
+ }, props), {
2132
+ children
2133
+ })
2134
+ );
2124
2135
  }
2125
2136
  DragAlongCell.displayName = "DragAlongCell";
2126
2137
  // Annotate the CommonJS export names for ESM import in node:
@@ -4,7 +4,7 @@ import {
4
4
  DataGridCell,
5
5
  DragAlongCell,
6
6
  DraggableCellHeader
7
- } from "../chunk-OJX75MY2.js";
7
+ } from "../chunk-TB7VTSDP.js";
8
8
  import "../chunk-FFU6FB3K.js";
9
9
  import "../chunk-UBU6IJML.js";
10
10
  import "../chunk-5GUW4DUY.js";
@@ -428,6 +428,7 @@ var ModalHeader = ({
428
428
  title,
429
429
  hideCloseIcon,
430
430
  headerIcon,
431
+ headerIconAlign,
431
432
  onClose,
432
433
  id,
433
434
  testid
@@ -439,13 +440,24 @@ var ModalHeader = ({
439
440
  "data-testid": testid,
440
441
  className: (0, import_clsx5.default)(
441
442
  "flex justify-between items-center",
443
+ headerIconAlign === "center" && "justify-center",
444
+ headerIconAlign === "right" && "justify-end",
445
+ headerIconAlign === "left" && "justify-start",
442
446
  layoutPaddding,
443
447
  layoutGroupGap
444
448
  ),
445
449
  children: [
446
450
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx5.default)("flex items-center", layoutGroupGap), children: [
447
451
  headerIcon,
448
- title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Heading2, { id: id ? `${id}-title` : void 0, testid: testid ? `${testid}-title` : void 0, as: "p", children: title })
452
+ title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
453
+ Heading2,
454
+ {
455
+ id: id ? `${id}-title` : void 0,
456
+ testid: testid ? `${testid}-title` : void 0,
457
+ as: "p",
458
+ children: title
459
+ }
460
+ )
449
461
  ] }),
450
462
  !hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
451
463
  Button,
@@ -705,6 +717,7 @@ var Modal = ({
705
717
  showButtons = false,
706
718
  hideCloseIcon = false,
707
719
  headerIcon,
720
+ headerIconAlign,
708
721
  fixedHeightScrolling = false,
709
722
  customActions
710
723
  }) => {
@@ -734,7 +747,7 @@ var Modal = ({
734
747
  fadeInScale(modalRef.current);
735
748
  bgFadeIn(bgRef.current);
736
749
  }
737
- }, [mounted, open]);
750
+ }, [mounted, onClose, open, wasOpen]);
738
751
  const handleKeyDown = (0, import_react5.useCallback)(
739
752
  (e) => {
740
753
  if (e.key === "Escape") {
@@ -744,7 +757,7 @@ var Modal = ({
744
757
  }
745
758
  }
746
759
  },
747
- [onClose, bgRef, modalRef]
760
+ [onClose]
748
761
  );
749
762
  const handleClose = (0, import_react5.useCallback)(() => {
750
763
  if (onClose) {
@@ -829,7 +842,8 @@ var Modal = ({
829
842
  title,
830
843
  onClose: handleClose,
831
844
  hideCloseIcon,
832
- headerIcon
845
+ headerIcon,
846
+ headerIconAlign
833
847
  }
834
848
  ),
835
849
  children && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(
@@ -1,11 +1,11 @@
1
1
  "use client";
2
2
  import {
3
3
  Modal
4
- } from "../chunk-GCBW2LDM.js";
4
+ } from "../chunk-REGRTR2Y.js";
5
5
  import "../chunk-4RJKB7LC.js";
6
6
  import "../chunk-T7NDKJDP.js";
7
7
  import "../chunk-SYEJVSE4.js";
8
- import "../chunk-6A54FL75.js";
8
+ import "../chunk-ZSKLCKIR.js";
9
9
  import "../chunk-ZFOANBWG.js";
10
10
  import "../chunk-AZ7LVLOK.js";
11
11
  import "../chunk-WNQ53SVY.js";
@@ -425,6 +425,7 @@ var ModalHeader = ({
425
425
  title,
426
426
  hideCloseIcon,
427
427
  headerIcon,
428
+ headerIconAlign,
428
429
  onClose,
429
430
  id,
430
431
  testid
@@ -436,13 +437,24 @@ var ModalHeader = ({
436
437
  "data-testid": testid,
437
438
  className: (0, import_clsx5.default)(
438
439
  "flex justify-between items-center",
440
+ headerIconAlign === "center" && "justify-center",
441
+ headerIconAlign === "right" && "justify-end",
442
+ headerIconAlign === "left" && "justify-start",
439
443
  layoutPaddding,
440
444
  layoutGroupGap
441
445
  ),
442
446
  children: [
443
447
  /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: (0, import_clsx5.default)("flex items-center", layoutGroupGap), children: [
444
448
  headerIcon,
445
- title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(Heading2, { id: id ? `${id}-title` : void 0, testid: testid ? `${testid}-title` : void 0, as: "p", children: title })
449
+ title && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
450
+ Heading2,
451
+ {
452
+ id: id ? `${id}-title` : void 0,
453
+ testid: testid ? `${testid}-title` : void 0,
454
+ as: "p",
455
+ children: title
456
+ }
457
+ )
446
458
  ] }),
447
459
  !hideCloseIcon && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
448
460
  Button,
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  ModalHeader
3
- } from "../chunk-6A54FL75.js";
3
+ } from "../chunk-ZSKLCKIR.js";
4
4
  import "../chunk-AZ7LVLOK.js";
5
5
  import "../chunk-NKUETCDA.js";
6
6
  import "../chunk-FKMKHLQH.js";