impact-nova 0.1.13 → 1.0.0

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 (115) hide show
  1. package/dist/components/layout/dashboard-layout.d.ts +21 -6
  2. package/dist/components/ui/accordion-nested-list/accordion-nested-list.js +32 -33
  3. package/dist/components/ui/accordion.js +25 -23
  4. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.d.ts +5 -0
  5. package/dist/components/ui/ag-grid-react/cell-renderers/editors/split-cell-editor.js +50 -52
  6. package/dist/components/ui/ag-grid-react/cell-renderers/input-display-renderer.d.ts +1 -1
  7. package/dist/components/ui/ag-grid-react/cell-renderers/split-cell-renderer.js +34 -34
  8. package/dist/components/ui/ag-grid-react/headers/advanced-filter/column-filter-section.js +8 -11
  9. package/dist/components/ui/ag-grid-react/headers/column-menu/column-settings-menu.js +17 -17
  10. package/dist/components/ui/ag-grid-react/headers/header-search-input.js +3 -3
  11. package/dist/components/ui/alert-dialog.js +45 -40
  12. package/dist/components/ui/alert.d.ts +21 -4
  13. package/dist/components/ui/alert.js +45 -25
  14. package/dist/components/ui/avatar.js +19 -16
  15. package/dist/components/ui/badge.js +8 -1
  16. package/dist/components/ui/breadcrumb.js +1 -0
  17. package/dist/components/ui/button-group.d.ts +1 -1
  18. package/dist/components/ui/button-group.js +27 -32
  19. package/dist/components/ui/button-variants.d.ts +1 -1
  20. package/dist/components/ui/button.d.ts +11 -0
  21. package/dist/components/ui/button.js +11 -9
  22. package/dist/components/ui/calendar.d.ts +14 -2
  23. package/dist/components/ui/calendar.js +443 -376
  24. package/dist/components/ui/card.js +7 -6
  25. package/dist/components/ui/checkbox.js +64 -48
  26. package/dist/components/ui/chips.d.ts +1 -0
  27. package/dist/components/ui/chips.js +27 -19
  28. package/dist/components/ui/data-table/data-table-column-list.d.ts +4 -1
  29. package/dist/components/ui/data-table/data-table-column-list.js +58 -54
  30. package/dist/components/ui/data-table/data-table-sheet.d.ts +1 -1
  31. package/dist/components/ui/data-table/data-table-sheet.js +43 -40
  32. package/dist/components/ui/data-table/data-table-view-options.js +17 -17
  33. package/dist/components/ui/data-table/data-table.js +21 -20
  34. package/dist/components/ui/date-picker/date-picker.js +83 -87
  35. package/dist/components/ui/date-picker/date-range-picker.js +129 -125
  36. package/dist/components/ui/date-picker/month-picker.js +90 -93
  37. package/dist/components/ui/date-picker/month-range-picker.js +132 -129
  38. package/dist/components/ui/date-picker/multi-date-picker.js +37 -38
  39. package/dist/components/ui/date-picker/multi-month-picker.js +29 -30
  40. package/dist/components/ui/date-picker/multi-week-picker.js +49 -38
  41. package/dist/components/ui/date-picker/week-picker.js +116 -112
  42. package/dist/components/ui/date-picker/week-range-picker.js +153 -142
  43. package/dist/components/ui/dialog.js +15 -6
  44. package/dist/components/ui/drawer.js +16 -13
  45. package/dist/components/ui/dropdown-menu.js +4 -2
  46. package/dist/components/ui/dynamic-layout.d.ts +2 -2
  47. package/dist/components/ui/dynamic-layout.js +18 -15
  48. package/dist/components/ui/empty-container.js +69 -64
  49. package/dist/components/ui/file-upload.js +113 -106
  50. package/dist/components/ui/filter-panel/filter-panel.js +49 -46
  51. package/dist/components/ui/filter-strip/filter-strip.js +41 -37
  52. package/dist/components/ui/header.js +26 -25
  53. package/dist/components/ui/horizontal-scroller/horizontal-scroller.js +43 -40
  54. package/dist/components/ui/hover-card.js +6 -5
  55. package/dist/components/ui/input.d.ts +1 -1
  56. package/dist/components/ui/input.js +79 -68
  57. package/dist/components/ui/loader.d.ts +1 -0
  58. package/dist/components/ui/loader.js +23 -13
  59. package/dist/components/ui/nested-list/components/NestedListContent.d.ts +1 -3
  60. package/dist/components/ui/nested-list/components/NestedListContent.js +16 -15
  61. package/dist/components/ui/nested-list/components/SortableItem.js +116 -80
  62. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.d.ts +13 -1
  63. package/dist/components/ui/nested-list/hooks/useNestedListDragDrop.js +162 -112
  64. package/dist/components/ui/nested-list/nested-list.js +182 -189
  65. package/dist/components/ui/notification-panel/notification-item.js +19 -17
  66. package/dist/components/ui/notification-panel/notification-list.js +21 -21
  67. package/dist/components/ui/notification-panel/notification-panel.js +25 -25
  68. package/dist/components/ui/popover.js +37 -34
  69. package/dist/components/ui/progress.js +12 -10
  70. package/dist/components/ui/prompt.js +29 -27
  71. package/dist/components/ui/radio-group.js +55 -46
  72. package/dist/components/ui/select/components/Submenu.d.ts +1 -2
  73. package/dist/components/ui/select/components/Submenu.js +52 -48
  74. package/dist/components/ui/select/select.js +321 -324
  75. package/dist/components/ui/sheet.js +18 -15
  76. package/dist/components/ui/sidebar.d.ts +2 -2
  77. package/dist/components/ui/sidebar.js +3 -3
  78. package/dist/components/ui/skeleton.d.ts +2 -1
  79. package/dist/components/ui/skeleton.js +12 -11
  80. package/dist/components/ui/slider.js +39 -12
  81. package/dist/components/ui/smart-input.js +44 -39
  82. package/dist/components/ui/stepper.js +33 -29
  83. package/dist/components/ui/switch.js +6 -4
  84. package/dist/components/ui/tabs.js +50 -45
  85. package/dist/components/ui/tag-group.d.ts +2 -1
  86. package/dist/components/ui/tag-group.js +29 -25
  87. package/dist/components/ui/tag.d.ts +1 -0
  88. package/dist/components/ui/tag.js +26 -20
  89. package/dist/components/ui/textarea.js +18 -17
  90. package/dist/components/ui/toast.d.ts +1 -1
  91. package/dist/components/ui/toast.js +47 -41
  92. package/dist/components/ui/toaster.js +42 -42
  93. package/dist/components/ui/tooltip.js +18 -16
  94. package/dist/components/ui/types/date-picker.types.d.ts +33 -0
  95. package/dist/components/ui/types/empty-container.types.d.ts +5 -0
  96. package/dist/components/ui/types/nested-list.types.d.ts +1 -0
  97. package/dist/components/ui/types/select.types.d.ts +0 -1
  98. package/dist/icons/assets/bookmark.svg.js +4 -0
  99. package/dist/icons/assets/bookmark.svg2.js +5 -0
  100. package/dist/icons/assets/bookmarkFilled.svg.js +4 -0
  101. package/dist/icons/assets/bookmarkFilled.svg2.js +5 -0
  102. package/dist/icons/assets/download.svg.js +4 -0
  103. package/dist/icons/assets/download.svg2.js +5 -0
  104. package/dist/icons/index.d.ts +20 -6
  105. package/dist/icons/index.js +398 -370
  106. package/dist/impact-nova.css +1 -1
  107. package/dist/index.d.ts +1 -0
  108. package/dist/index.js +318 -314
  109. package/dist/lib/fiscal-calendar.d.ts +62 -0
  110. package/dist/lib/fiscal-calendar.js +99 -0
  111. package/package.json +5 -5
  112. package/dist/components/ui/select/hooks/useClickOutside.d.ts +0 -15
  113. package/dist/components/ui/select/hooks/useClickOutside.js +0 -43
  114. package/dist/components/ui/select/hooks/useMenuPosition.d.ts +0 -2
  115. package/dist/components/ui/select/hooks/useMenuPosition.js +0 -89
@@ -5,6 +5,7 @@ const s = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
5
5
  "div",
6
6
  {
7
7
  ref: r,
8
+ "data-component": "card",
8
9
  className: t(
9
10
  "rounded-xl border bg-card text-card-foreground shadow",
10
11
  a
@@ -31,7 +32,7 @@ const c = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
31
32
  }
32
33
  ));
33
34
  c.displayName = "CardTitle";
34
- const m = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
35
+ const n = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
35
36
  "div",
36
37
  {
37
38
  ref: r,
@@ -39,9 +40,9 @@ const m = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
39
40
  ...e
40
41
  }
41
42
  ));
42
- m.displayName = "CardDescription";
43
- const n = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d("div", { ref: r, className: t("p-6 pt-0", a), ...e }));
44
- n.displayName = "CardContent";
43
+ n.displayName = "CardDescription";
44
+ const m = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d("div", { ref: r, className: t("p-6 pt-0", a), ...e }));
45
+ m.displayName = "CardContent";
45
46
  const f = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
46
47
  "div",
47
48
  {
@@ -53,8 +54,8 @@ const f = o.forwardRef(({ className: a, ...e }, r) => /* @__PURE__ */ d(
53
54
  f.displayName = "CardFooter";
54
55
  export {
55
56
  s as Card,
56
- n as CardContent,
57
- m as CardDescription,
57
+ m as CardContent,
58
+ n as CardDescription,
58
59
  f as CardFooter,
59
60
  i as CardHeader,
60
61
  c as CardTitle
@@ -1,54 +1,70 @@
1
- import { jsxs as t, jsx as e } from "react/jsx-runtime";
2
- import * as l from "react";
3
- import * as o from "@radix-ui/react-checkbox";
4
- import { Check as b, Minus as u } from "lucide-react";
5
- import { cn as a } from "../../lib/utils.js";
6
- const h = l.forwardRef(({ className: n, label: r, helperText: d, isError: i, disabled: s, ...c }, m) => /* @__PURE__ */ t("div", { className: "flex items-center", children: [
7
- /* @__PURE__ */ e(
8
- o.Root,
9
- {
10
- ref: m,
11
- className: a(
12
- "peer h-4 w-4 shrink-0 rounded-[4px] border border-tertiary-border bg-white ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-accent data-[state=checked]:text-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-accent data-[state=indeterminate]:text-primary mr-[7px]",
13
- i && "border-destructive focus-visible:ring-destructive",
14
- s && "border-border text-disabled-text data-[state=checked]:bg-disabled-secondary-bg data-[state=checked]:text-disabled-text",
15
- n
16
- ),
17
- disabled: s,
18
- ...c,
19
- children: /* @__PURE__ */ t(
20
- o.Indicator,
21
- {
22
- className: a("flex items-center justify-center text-current group"),
23
- children: [
24
- /* @__PURE__ */ e(b, { className: "h-3 w-3 hidden group-data-[state=checked]:block", strokeWidth: 3 }),
25
- /* @__PURE__ */ e(u, { className: "h-3 w-3 hidden group-data-[state=indeterminate]:block", strokeWidth: 3 })
26
- ]
27
- }
28
- )
29
- }
30
- ),
31
- (r || d) && /* @__PURE__ */ t("div", { className: "grid gap-1.5 leading-none", children: [
32
- r && /* @__PURE__ */ t(
33
- "label",
1
+ import { jsxs as d, jsx as t } from "react/jsx-runtime";
2
+ import * as i from "react";
3
+ import * as m from "@radix-ui/react-checkbox";
4
+ import { Check as y, Minus as N } from "lucide-react";
5
+ import { cn as r } from "../../lib/utils.js";
6
+ const w = i.forwardRef(({ className: f, label: s, helperText: c, isError: n, disabled: a, checked: e, defaultChecked: u, onCheckedChange: g, ...o }, p) => {
7
+ const k = i.useId(), h = o.id || k, [b, l] = i.useState(
8
+ e !== void 0 ? e : u || !1
9
+ );
10
+ i.useEffect(() => {
11
+ e !== void 0 && l(e);
12
+ }, [e]);
13
+ const v = (x) => {
14
+ e === void 0 && l(x), g?.(x);
15
+ };
16
+ return /* @__PURE__ */ d("div", { className: "flex items-center", "data-component": "checkbox", "data-state": b === "indeterminate" ? "indeterminate" : b ? "checked" : "unchecked", "data-disabled": a || void 0, children: [
17
+ /* @__PURE__ */ t(
18
+ m.Root,
34
19
  {
35
- htmlFor: c.id,
36
- className: a(
37
- "text-sm font-medium leading-[20px] text-secondary-foreground peer-data-[state=checked]:text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
38
- i && "text-destructive",
39
- s && "text-disabled-text"
20
+ ref: p,
21
+ id: h,
22
+ className: r(
23
+ "peer h-4 w-4 shrink-0 rounded-[4px] border border-tertiary-border bg-white ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:border-primary data-[state=checked]:bg-accent data-[state=checked]:text-primary data-[state=indeterminate]:border-primary data-[state=indeterminate]:bg-accent data-[state=indeterminate]:text-primary mr-[7px]",
24
+ n && "border-destructive focus-visible:ring-destructive",
25
+ a && "border-border text-disabled-text data-[state=checked]:bg-disabled-secondary-bg data-[state=checked]:text-disabled-text",
26
+ f
40
27
  ),
41
- children: [
42
- r,
43
- " ",
44
- c.required && /* @__PURE__ */ e("span", { className: "text-destructive", children: "*" })
45
- ]
28
+ checked: e,
29
+ defaultChecked: u,
30
+ onCheckedChange: v,
31
+ disabled: a,
32
+ ...o,
33
+ children: /* @__PURE__ */ d(
34
+ m.Indicator,
35
+ {
36
+ "data-checkbox": "indicator",
37
+ className: r("flex items-center justify-center text-current group"),
38
+ children: [
39
+ /* @__PURE__ */ t(y, { className: "h-3 w-3 hidden group-data-[state=checked]:block", strokeWidth: 3 }),
40
+ /* @__PURE__ */ t(N, { className: "h-3 w-3 hidden group-data-[state=indeterminate]:block", strokeWidth: 3 })
41
+ ]
42
+ }
43
+ )
46
44
  }
47
45
  ),
48
- d && /* @__PURE__ */ e("p", { className: a("text-sm text-muted-foreground", i && "text-destructive"), children: d })
49
- ] })
50
- ] }));
51
- h.displayName = o.Root.displayName;
46
+ (s || c) && /* @__PURE__ */ d("div", { className: "grid gap-1.5 leading-none", children: [
47
+ s && /* @__PURE__ */ d(
48
+ "label",
49
+ {
50
+ htmlFor: h,
51
+ className: r(
52
+ "text-sm font-medium leading-[20px] text-secondary-foreground peer-data-[state=checked]:text-foreground peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
53
+ n && "text-destructive",
54
+ a && "text-disabled-text"
55
+ ),
56
+ children: [
57
+ s,
58
+ " ",
59
+ o.required && /* @__PURE__ */ t("span", { className: "text-destructive", children: "*" })
60
+ ]
61
+ }
62
+ ),
63
+ c && /* @__PURE__ */ t("p", { className: r("text-sm text-muted-foreground", n && "text-destructive"), children: c })
64
+ ] })
65
+ ] });
66
+ });
67
+ w.displayName = m.Root.displayName;
52
68
  export {
53
- h as Checkbox
69
+ w as Checkbox
54
70
  };
@@ -8,6 +8,7 @@ declare const chipVariants: (props?: {
8
8
  export interface ChipProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof chipVariants> {
9
9
  onRemove?: () => void;
10
10
  removable?: boolean;
11
+ asChild?: boolean;
11
12
  }
12
13
  declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLDivElement>>;
13
14
  export { Chip, chipVariants };
@@ -1,9 +1,10 @@
1
- import { jsxs as c, jsx as r } from "react/jsx-runtime";
2
- import * as p from "react";
3
- import { cva as f } from "class-variance-authority";
4
- import { Cross as l } from "../../icons/index.js";
5
- import { cn as m } from "../../lib/utils.js";
6
- const g = f(
1
+ import { jsxs as l, jsx as t } from "react/jsx-runtime";
2
+ import * as m from "react";
3
+ import { Slot as f } from "@radix-ui/react-slot";
4
+ import { cva as g } from "class-variance-authority";
5
+ import { Cross as x } from "../../icons/index.js";
6
+ import { cn as b } from "../../lib/utils.js";
7
+ const v = g(
7
8
  "inline-flex items-center gap-1.5 px-2.5 py-0.5 text-xs font-medium transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",
8
9
  {
9
10
  variants: {
@@ -30,31 +31,38 @@ const g = f(
30
31
  shape: "pill"
31
32
  }
32
33
  }
33
- ), x = p.forwardRef(
34
- ({ className: e, variant: o, size: t, shape: n, onRemove: i, removable: s, children: a, ...d }, u) => /* @__PURE__ */ c(
35
- "div",
34
+ ), h = m.forwardRef(
35
+ ({ className: n, variant: r, size: e, shape: o, onRemove: a, removable: i, asChild: d = !1, children: s, ...p }, c) => /* @__PURE__ */ l(
36
+ d ? f : "div",
36
37
  {
37
- ref: u,
38
- className: m(g({ variant: o, size: t, shape: n }), e),
39
- ...d,
38
+ ref: c,
39
+ className: b(v({ variant: r, size: e, shape: o }), n),
40
+ "data-component": "chip",
41
+ "data-variant": r ?? "default",
42
+ "data-size": e ?? "md",
43
+ "data-shape": o ?? "pill",
44
+ ...p,
40
45
  children: [
41
- a,
42
- s && /* @__PURE__ */ r(
46
+ s,
47
+ i && /* @__PURE__ */ t(
43
48
  "button",
44
49
  {
45
50
  type: "button",
46
- onClick: i,
51
+ onClick: (u) => {
52
+ u.stopPropagation(), a?.();
53
+ },
47
54
  className: "ml-1 p-1 rounded-full hover:bg-black/20 focus:outline-none focus:ring-2 focus:ring-ring",
48
55
  "aria-label": "Remove",
49
- children: /* @__PURE__ */ r(l, { size: 8 })
56
+ "data-component": "chip-remove",
57
+ children: /* @__PURE__ */ t(x, { size: 8 })
50
58
  }
51
59
  )
52
60
  ]
53
61
  }
54
62
  )
55
63
  );
56
- x.displayName = "Chip";
64
+ h.displayName = "Chip";
57
65
  export {
58
- x as Chip,
59
- g as chipVariants
66
+ h as Chip,
67
+ v as chipVariants
60
68
  };
@@ -1,6 +1,9 @@
1
1
  interface DataTableColumnListProps {
2
2
  enableApplyDiscard?: boolean;
3
3
  enableLazyHierarchy?: boolean;
4
+ showSearch?: boolean;
5
+ showSelectAll?: boolean;
6
+ showCollapse?: boolean;
4
7
  }
5
- export declare const DataTableColumnList: ({ enableApplyDiscard, enableLazyHierarchy }: DataTableColumnListProps) => import("react/jsx-runtime").JSX.Element;
8
+ export declare const DataTableColumnList: ({ enableApplyDiscard, enableLazyHierarchy, showSearch, showSelectAll, showCollapse }: DataTableColumnListProps) => import("react/jsx-runtime").JSX.Element;
6
9
  export {};
@@ -1,41 +1,44 @@
1
- import { jsx as D } from "react/jsx-runtime";
2
- import { useState as w, useRef as C, useCallback as a, useEffect as N } from "react";
3
- import { useDataTable as V } from "./data-table-context.js";
4
- import { NestedList as z } from "../nested-list/nested-list.js";
5
- import { SelectionMode as A } from "../types/nested-list.types.js";
6
- function j(u) {
1
+ import { jsx as y } from "react/jsx-runtime";
2
+ import { useState as N, useRef as b, useCallback as a, useEffect as T } from "react";
3
+ import { useDataTable as j } from "./data-table-context.js";
4
+ import { NestedList as P } from "../nested-list/nested-list.js";
5
+ import { SelectionMode as U } from "../types/nested-list.types.js";
6
+ function W(u) {
7
7
  return "getChildren" in u && typeof u.getChildren == "function";
8
8
  }
9
- function P(u, h) {
10
- let t = null;
11
- return ((...b) => {
12
- t && clearTimeout(t), t = setTimeout(() => u(...b), h);
9
+ function _(u, h) {
10
+ let f = null;
11
+ return ((...S) => {
12
+ f && clearTimeout(f), f = setTimeout(() => u(...S), h);
13
13
  });
14
14
  }
15
- const B = ({
15
+ const Q = ({
16
16
  enableApplyDiscard: u = !1,
17
- enableLazyHierarchy: h = !1
17
+ enableLazyHierarchy: h = !1,
18
+ showSearch: f = !0,
19
+ showSelectAll: S = !0,
20
+ showCollapse: I = !0
18
21
  }) => {
19
- const { gridApi: t } = V(), [b, y] = w([]), [T, I] = w(!1), S = C(!1), v = C(/* @__PURE__ */ new Set()), R = C(/* @__PURE__ */ new Map()), k = a((r, l) => {
22
+ const { gridApi: t } = j(), [L, v] = N([]), [M, F] = N(!1), G = b(!1), R = b(/* @__PURE__ */ new Set()), k = b(/* @__PURE__ */ new Map()), x = a((r, l) => {
20
23
  const n = (o, i) => {
21
- if (j(o)) {
22
- const e = o.getGroupId() || `${i.join("-")}-group`, c = [...i, e], d = v.current.has(e), s = !h || d, f = [];
24
+ if (W(o)) {
25
+ const e = o.getGroupId() || `${i.join("-")}-group`, c = [...i, e], d = R.current.has(e), s = !h || d, p = [];
23
26
  if (s) {
24
- const g = o.getChildren();
25
- g && g.forEach((O) => {
26
- f.push(n(O, c));
27
+ const C = o.getChildren();
28
+ C && C.forEach((A) => {
29
+ p.push(n(A, c));
27
30
  });
28
31
  }
29
- const F = f.length > 0 ? f.every((g) => g.checked) : !0;
32
+ const z = p.length > 0 ? p.every((C) => C.checked) : !0;
30
33
  return {
31
34
  id: e,
32
35
  label: o.getColGroupDef()?.headerName || "Column Group",
33
- checked: F,
34
- children: f.length > 0 ? f : h ? [] : void 0,
36
+ checked: z,
37
+ children: p.length > 0 ? p : h ? [] : void 0,
35
38
  category: "group"
36
39
  };
37
40
  } else {
38
- const e = o.getColId(), c = R.current.get(e), d = c ? !c.hide : o.isVisible();
41
+ const e = o.getColId(), c = k.current.get(e), d = c ? !c.hide : o.isVisible();
39
42
  return {
40
43
  id: e,
41
44
  label: o.getColDef().headerName || o.getColDef().field || e,
@@ -44,19 +47,19 @@ const B = ({
44
47
  }
45
48
  };
46
49
  return n(r, l);
47
- }, [h]), G = a((r, l) => r.map((n) => k(n, l)), [k]), m = a(() => {
48
- if (!t || S.current)
50
+ }, [h]), D = a((r, l) => r.map((n) => x(n, l)), [x]), m = a(() => {
51
+ if (!t || G.current)
49
52
  return;
50
53
  const r = t.getColumnState();
51
- R.current = new Map(r.map((s) => [s.colId, s]));
54
+ k.current = new Map(r.map((s) => [s.colId, s]));
52
55
  const l = t.getColumnGroupState();
53
- v.current = new Set(
56
+ R.current = new Set(
54
57
  l.filter((s) => s.open).map((s) => s.groupId)
55
58
  );
56
- const n = t.getLeftDisplayedColumnGroups() || [], o = t.getCenterDisplayedColumnGroups() || [], i = t.getRightDisplayedColumnGroups() || [], e = G(
59
+ const n = t.getLeftDisplayedColumnGroups() || [], o = t.getCenterDisplayedColumnGroups() || [], i = t.getRightDisplayedColumnGroups() || [], e = D(
57
60
  [...n, ...i],
58
61
  ["frozen"]
59
- ), c = G(
62
+ ), c = D(
60
63
  o,
61
64
  ["scrollable"]
62
65
  ), d = [
@@ -77,11 +80,11 @@ const B = ({
77
80
  isDragDisabled: !0
78
81
  }
79
82
  ];
80
- y(d), I(!0);
81
- }, [t, G]), x = C(null);
82
- N(() => {
83
- x.current = P(m, 150);
84
- }, [m]), N(() => {
83
+ v(d), F(!0);
84
+ }, [t, D]), E = b(null);
85
+ T(() => {
86
+ E.current = _(m, 150);
87
+ }, [m]), T(() => {
85
88
  if (!t) return;
86
89
  const r = setTimeout(() => m(), 0), l = [
87
90
  "columnVisible",
@@ -91,13 +94,13 @@ const B = ({
91
94
  "gridReady",
92
95
  "columnGroupOpened"
93
96
  ], n = () => {
94
- x.current?.();
97
+ E.current?.();
95
98
  };
96
99
  return t.isDestroyed() || l.forEach((o) => t.addEventListener(o, n)), () => {
97
100
  clearTimeout(r), t.isDestroyed() || l.forEach((o) => t.removeEventListener(o, n));
98
101
  };
99
102
  }, [t, m]);
100
- const E = a((r) => {
103
+ const w = a((r) => {
101
104
  const l = [], n = (o, i) => {
102
105
  o.forEach((e) => {
103
106
  if (e.id === "root-frozen") {
@@ -116,38 +119,39 @@ const B = ({
116
119
  });
117
120
  };
118
121
  return n(r, null), l;
119
- }, [t]), p = a((r) => {
122
+ }, [t]), g = a((r) => {
120
123
  if (!t) return;
121
- S.current = !0;
122
- const l = E(r);
124
+ G.current = !0;
125
+ const l = w(r);
123
126
  l.length > 0 && t.applyColumnState({
124
127
  state: l,
125
128
  applyOrder: !0
126
129
  }), setTimeout(() => {
127
- S.current = !1;
130
+ G.current = !1;
128
131
  }, 300);
129
- }, [t, E]), L = a((r) => {
130
- p(r);
131
- }, [p]), M = a((r) => {
132
- u || p(r), y(r);
133
- }, [u, p]);
134
- return T ? /* @__PURE__ */ D("div", { className: "flex flex-col h-full bg-white", children: /* @__PURE__ */ D(
135
- z,
132
+ }, [t, w]), O = a((r) => {
133
+ g(r);
134
+ }, [g]), V = a((r) => {
135
+ u || g(r), v(r);
136
+ }, [u, g]);
137
+ return M ? /* @__PURE__ */ y("div", { className: "flex flex-col h-full bg-white", children: /* @__PURE__ */ y(
138
+ P,
136
139
  {
137
- items: b,
138
- onChange: M,
139
- onSubmit: L,
140
+ items: L,
141
+ onChange: V,
142
+ onSubmit: O,
140
143
  enableApplyDiscard: u,
141
- enableSearch: !0,
142
- enableSelectAll: !0,
144
+ enableSearch: f,
145
+ enableSelectAll: S,
143
146
  enableDragDrop: !0,
144
147
  enableCollapse: !0,
145
- selectionMode: A.CASCADE_DOWN,
148
+ enableGlobalCollapse: I,
149
+ selectionMode: U.CASCADE_DOWN,
146
150
  searchPlaceholder: "Search columns...",
147
151
  className: "h-full"
148
152
  }
149
- ) }) : /* @__PURE__ */ D("div", { className: "p-4 text-[13px] text-slate-400", children: "Loading columns..." });
153
+ ) }) : /* @__PURE__ */ y("div", { className: "p-4 text-[13px] text-slate-400", children: "Loading columns..." });
150
154
  };
151
155
  export {
152
- B as DataTableColumnList
156
+ Q as DataTableColumnList
153
157
  };
@@ -17,4 +17,4 @@ export declare const DataTableSheetHeader: ({ title, children, className }: {
17
17
  export declare const DataTableSheetContent: ({ children, className }: {
18
18
  children: React.ReactNode;
19
19
  className?: string;
20
- }) => React.ReactPortal;
20
+ }) => import("react/jsx-runtime").JSX.Element;
@@ -1,77 +1,80 @@
1
- import { jsx as t, jsxs as i } from "react/jsx-runtime";
2
- import f, { useState as x, createContext as b, useContext as v } from "react";
1
+ import { jsx as n, jsxs as i } from "react/jsx-runtime";
2
+ import m, { useState as x, createContext as b, useContext as v } from "react";
3
3
  import { createPortal as w } from "react-dom";
4
4
  import { X as g } from "lucide-react";
5
- import { cn as m } from "../../../lib/utils.js";
5
+ import { cn as c } from "../../../lib/utils.js";
6
6
  import { Button as C } from "../button.js";
7
7
  import { useDataTable as T } from "./data-table-context.js";
8
- const p = b(null), c = () => {
9
- const e = v(p);
8
+ const u = b(null), d = () => {
9
+ const e = v(u);
10
10
  if (!e)
11
11
  throw new Error("useDataTableSheet must be used within DataTableSheet");
12
12
  return e;
13
13
  }, O = ({
14
14
  children: e,
15
- defaultOpen: o = !1,
16
- open: n,
17
- onOpenChange: a
15
+ defaultOpen: r = !1,
16
+ open: o,
17
+ onOpenChange: t
18
18
  }) => {
19
- const [r, s] = x(o), l = n !== void 0, u = l ? n : r, h = (d) => {
20
- l || s(d), a?.(d);
19
+ const [a, s] = x(r), l = o !== void 0, p = l ? o : a, h = (f) => {
20
+ l || s(f), t?.(f);
21
21
  };
22
- return /* @__PURE__ */ t(p.Provider, { value: { open: u, setOpen: h }, children: e });
22
+ return /* @__PURE__ */ n(u.Provider, { value: { open: p, setOpen: h }, children: e });
23
23
  }, E = ({
24
24
  children: e,
25
- asChild: o
25
+ asChild: r
26
26
  }) => {
27
- const { setOpen: n, open: a } = c(), r = (s) => {
28
- n(!a);
27
+ const { setOpen: o, open: t } = d(), a = (s) => {
28
+ o(!t);
29
29
  };
30
- if (o) {
31
- const s = f.Children.only(e);
32
- return f.cloneElement(s, {
30
+ if (r) {
31
+ const s = m.Children.only(e);
32
+ return m.cloneElement(s, {
33
33
  onClick: (l) => {
34
- s.props.onClick?.(l), r();
34
+ s.props.onClick?.(l), a();
35
35
  }
36
36
  });
37
37
  }
38
- return /* @__PURE__ */ t(C, { variant: "outline", onClick: r, children: e });
38
+ return /* @__PURE__ */ n(C, { variant: "outline", onClick: a, children: e });
39
39
  }, P = ({
40
40
  title: e,
41
- children: o,
42
- className: n
41
+ children: r,
42
+ className: o
43
43
  }) => {
44
- const { setOpen: a } = c();
45
- return /* @__PURE__ */ i("div", { className: m("flex shrink-0 flex-row justify-between items-center px-4 py-3 mb-2 bg-[#eceefd]", n), children: [
46
- /* @__PURE__ */ t("div", { className: "flex items-center gap-2", children: e && /* @__PURE__ */ t("h2", { className: "font-[Manrope] font-bold text-base text-[#0d152c]", children: e }) }),
44
+ const { setOpen: t } = d();
45
+ return /* @__PURE__ */ i("div", { className: c("flex shrink-0 flex-row justify-between items-center px-4 py-3 mb-2 bg-[#eceefd]", o), children: [
46
+ /* @__PURE__ */ n("div", { className: "flex items-center gap-2", children: e && /* @__PURE__ */ n("h2", { className: "font-[Manrope] font-bold text-base text-[#0d152c]", children: e }) }),
47
47
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
48
- o,
49
- /* @__PURE__ */ t(
48
+ r,
49
+ /* @__PURE__ */ n(
50
50
  "span",
51
51
  {
52
52
  role: "button",
53
53
  className: "close_icon cursor-pointer flex items-center justify-center w-6 h-6 rounded-full hover:bg-slate-200/50 transition-colors",
54
- onClick: () => a(!1),
55
- children: /* @__PURE__ */ t(g, { className: "h-4 w-4 text-slate-500" })
54
+ onClick: () => t(!1),
55
+ children: /* @__PURE__ */ n(g, { className: "h-4 w-4 text-slate-500" })
56
56
  }
57
57
  )
58
58
  ] })
59
59
  ] });
60
60
  }, z = ({
61
61
  children: e,
62
- className: o
62
+ className: r
63
63
  }) => {
64
- const { open: n, setOpen: a } = c(), { sheetTarget: r } = T();
65
- return !n || !r ? null : w(
66
- /* @__PURE__ */ t("div", { className: "absolute inset-0 z-[100] flex justify-end overflow-hidden pointer-events-none", children: /* @__PURE__ */ i("div", { className: "flex h-[calc(100%+2px)] -my-px animate-in slide-in-from-right-[100%] duration-200 ease-in-out fade-in fill-mode-forwards", children: [
67
- /* @__PURE__ */ t("div", { className: "w-[6px] bg-white border-l border-slate-200 shrink-0" }),
68
- /* @__PURE__ */ t("div", { className: m(
69
- "relative flex h-full w-[355px] flex-col overflow-y-auto bg-white border-t border-l border-slate-200 pointer-events-auto shadow-[0px_0px_4px_0px_rgba(0,0,0,0.12)]",
70
- o
71
- ), children: e })
72
- ] }) }),
73
- r
74
- );
64
+ const { open: o } = d(), { sheetTarget: t } = T();
65
+ if (!o) return null;
66
+ const a = /* @__PURE__ */ n("div", { className: c(
67
+ "absolute inset-0 z-[35] flex justify-end overflow-hidden pointer-events-none",
68
+ !t && "fixed"
69
+ // Fallback to fixed if no target
70
+ ), children: /* @__PURE__ */ i("div", { className: "flex h-[calc(100%+2px)] -my-px animate-in slide-in-from-right-[100%] duration-200 ease-in-out fade-in fill-mode-forwards", children: [
71
+ /* @__PURE__ */ n("div", { className: "w-[6px] bg-white border-l border-slate-200 shrink-0" }),
72
+ /* @__PURE__ */ n("div", { className: c(
73
+ "relative flex h-full w-[355px] flex-col overflow-y-auto bg-white border-t border-l border-slate-200 pointer-events-auto shadow-[0px_0px_4px_0px_rgba(0,0,0,0.12)]",
74
+ r
75
+ ), children: e })
76
+ ] }) });
77
+ return t ? w(a, t) : a;
75
78
  };
76
79
  export {
77
80
  O as DataTableSheet,
@@ -3,33 +3,33 @@ import "react";
3
3
  import { DropdownMenu as c, DropdownMenuTrigger as m, DropdownMenuContent as d, DropdownMenuItem as p, DropdownMenuSub as u, DropdownMenuSubTrigger as h, DropdownMenuSubContent as f, DropdownMenuRadioGroup as x, DropdownMenuRadioItem as t } from "../dropdown-menu.js";
4
4
  import { Button as g } from "../button.js";
5
5
  import { ThreeDots as D, Settings as N, Density as w, Stack as C, StackCompact as M, StackComfort as v } from "../../../icons/index.js";
6
- import { useDataTable as z } from "./data-table-context.js";
7
- import { DataTableSheetTrigger as S } from "./data-table-sheet.js";
6
+ import { useDataTable as S } from "./data-table-context.js";
7
+ import { DataTableSheetTrigger as b } from "./data-table-sheet.js";
8
8
  const I = ({
9
9
  enableTableSettings: r = !0,
10
- enableContentDensity: n = !0,
11
- trigger: l
10
+ enableContentDensity: s = !0,
11
+ trigger: n
12
12
  }) => {
13
- const { rowHeight: s, setRowHeight: o } = z();
13
+ const { rowHeight: l, setRowHeight: o } = S();
14
14
  return /* @__PURE__ */ a(c, { children: [
15
- /* @__PURE__ */ e(m, { asChild: !0, children: l || /* @__PURE__ */ a(g, { variant: "secondary", size: "icon", "aria-label": "More", children: [
16
- /* @__PURE__ */ e(D, { size: 14 }),
15
+ /* @__PURE__ */ e(m, { asChild: !0, children: n || /* @__PURE__ */ a(g, { variant: "secondary", size: "icon", "aria-label": "More", children: [
16
+ /* @__PURE__ */ e(D, { size: "sm" }),
17
17
  /* @__PURE__ */ e("span", { className: "sr-only", children: "Open menu" })
18
18
  ] }) }),
19
- /* @__PURE__ */ a(d, { align: "end", className: "w-[240px] z-[100] flex flex-col gap-[2px]", children: [
20
- r && /* @__PURE__ */ e(S, { asChild: !0, children: /* @__PURE__ */ e(p, { className: "flex cursor-pointer gap-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
21
- /* @__PURE__ */ e(N, { size: 13, className: "text-slate-500" }),
19
+ /* @__PURE__ */ a(d, { align: "end", className: "w-[240px] flex flex-col gap-[2px]", children: [
20
+ r && /* @__PURE__ */ e(b, { asChild: !0, children: /* @__PURE__ */ e(p, { className: "flex cursor-pointer gap-2", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
21
+ /* @__PURE__ */ e(N, { size: "sm", className: "text-slate-500" }),
22
22
  /* @__PURE__ */ e("span", { children: "Table Settings" })
23
23
  ] }) }) }),
24
- n && /* @__PURE__ */ a(u, { children: [
24
+ s && /* @__PURE__ */ a(u, { children: [
25
25
  /* @__PURE__ */ a(h, { className: "flex items-center gap-2 cursor-pointer", children: [
26
- /* @__PURE__ */ e(w, { size: 13, className: "text-slate-500" }),
26
+ /* @__PURE__ */ e(w, { size: "sm", className: "text-slate-500" }),
27
27
  /* @__PURE__ */ e("span", { children: "Content density" })
28
28
  ] }),
29
- /* @__PURE__ */ e(f, { className: "w-[190px] z-[100]", children: /* @__PURE__ */ a(
29
+ /* @__PURE__ */ e(f, { className: "w-[190px]", children: /* @__PURE__ */ a(
30
30
  x,
31
31
  {
32
- value: s,
32
+ value: l,
33
33
  onValueChange: (i) => o(i),
34
34
  className: "flex flex-col gap-0.5",
35
35
  children: [
@@ -38,7 +38,7 @@ const I = ({
38
38
  {
39
39
  value: "default",
40
40
  children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
41
- /* @__PURE__ */ e(C, { size: 13, className: "text-slate-500" }),
41
+ /* @__PURE__ */ e(C, { size: "sm", className: "text-slate-500" }),
42
42
  "Default"
43
43
  ] })
44
44
  }
@@ -48,7 +48,7 @@ const I = ({
48
48
  {
49
49
  value: "compact",
50
50
  children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
51
- /* @__PURE__ */ e(M, { size: 13, className: "text-slate-500" }),
51
+ /* @__PURE__ */ e(M, { size: "sm", className: "text-slate-500" }),
52
52
  "Compact"
53
53
  ] })
54
54
  }
@@ -58,7 +58,7 @@ const I = ({
58
58
  {
59
59
  value: "comfort",
60
60
  children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
61
- /* @__PURE__ */ e(v, { size: 13, className: "text-slate-500" }),
61
+ /* @__PURE__ */ e(v, { size: "sm", className: "text-slate-500" }),
62
62
  "Comfort"
63
63
  ] })
64
64
  }