@pibit.ai/cure-design-system 0.3.17 → 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 (126) hide show
  1. package/dist/assets/icons/group-by.svg.js +4 -0
  2. package/dist/assets/icons/reorder-dots-new.svg.js +4 -0
  3. package/dist/assets/icons/reorder-dots.svg.js +4 -0
  4. package/dist/assets/icons/resize-1.svg.js +4 -0
  5. package/dist/assets/icons/resize-2.svg.js +4 -0
  6. package/dist/assets/icons/resize-4.svg.js +4 -0
  7. package/dist/assets/icons/resize-5.svg.js +4 -0
  8. package/dist/assets/icons/show-summary.svg.js +4 -0
  9. package/dist/index.d.ts +3 -1
  10. package/dist/index.d.ts.map +1 -1
  11. package/dist/index.js +125 -64
  12. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Group.js +46 -0
  13. package/dist/node_modules/framer-motion/dist/es/components/Reorder/Item.js +34 -0
  14. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/auto-scroll.js +65 -0
  15. package/dist/node_modules/framer-motion/dist/es/components/Reorder/utils/check-reorder.js +17 -0
  16. package/dist/node_modules/framer-motion/dist/es/context/ReorderContext.js +5 -0
  17. package/dist/node_modules/framer-motion/dist/es/gestures/drag/use-drag-controls.js +70 -0
  18. package/dist/node_modules/framer-motion/dist/es/value/use-combine-values.js +15 -0
  19. package/dist/node_modules/framer-motion/dist/es/value/use-computed.js +10 -0
  20. package/dist/node_modules/framer-motion/dist/es/value/use-motion-value.js +15 -0
  21. package/dist/node_modules/framer-motion/dist/es/value/use-transform.js +23 -0
  22. package/dist/node_modules/motion-dom/dist/es/projection/node/create-projection-node.js +1 -1
  23. package/dist/node_modules/motion-dom/dist/es/utils/transform.js +8 -0
  24. package/dist/node_modules/motion-dom/dist/es/value/index.js +21 -18
  25. package/dist/node_modules/motion-utils/dist/es/array.js +15 -6
  26. package/dist/patterns/table/TablePagination.d.ts +23 -0
  27. package/dist/patterns/table/TablePagination.d.ts.map +1 -0
  28. package/dist/patterns/table/TablePagination.js +60 -0
  29. package/dist/patterns/table/TableWrapper.d.ts +2 -72
  30. package/dist/patterns/table/TableWrapper.d.ts.map +1 -1
  31. package/dist/patterns/table/TableWrapper.js +730 -75
  32. package/dist/patterns/table/index.d.ts +11 -1
  33. package/dist/patterns/table/index.d.ts.map +1 -1
  34. package/dist/patterns/table/pagination-base.d.ts +78 -0
  35. package/dist/patterns/table/pagination-base.d.ts.map +1 -0
  36. package/dist/patterns/table/pagination-base.js +127 -0
  37. package/dist/patterns/table/pagination-card.d.ts +9 -0
  38. package/dist/patterns/table/pagination-card.d.ts.map +1 -0
  39. package/dist/patterns/table/pagination-card.js +65 -0
  40. package/dist/patterns/table/row-height-icons.d.ts +9 -0
  41. package/dist/patterns/table/row-height-icons.d.ts.map +1 -0
  42. package/dist/patterns/table/row-height-icons.js +13 -0
  43. package/dist/patterns/table/storyHelpers/mockToolbarSlots.d.ts +7 -0
  44. package/dist/patterns/table/storyHelpers/mockToolbarSlots.d.ts.map +1 -0
  45. package/dist/patterns/table/storyHelpers/useMockTableState.d.ts +31 -0
  46. package/dist/patterns/table/storyHelpers/useMockTableState.d.ts.map +1 -0
  47. package/dist/patterns/table/storyHelpers/useMockTableToolbar.d.ts +3 -0
  48. package/dist/patterns/table/storyHelpers/useMockTableToolbar.d.ts.map +1 -0
  49. package/dist/patterns/table/table.d.ts +10 -13
  50. package/dist/patterns/table/table.d.ts.map +1 -1
  51. package/dist/patterns/table/table.js +235 -312
  52. package/dist/patterns/table/toolbar/AlignDropdown.d.ts +11 -0
  53. package/dist/patterns/table/toolbar/AlignDropdown.d.ts.map +1 -0
  54. package/dist/patterns/table/toolbar/AlignDropdown.js +77 -0
  55. package/dist/patterns/table/toolbar/BasicSortPanel.d.ts +6 -0
  56. package/dist/patterns/table/toolbar/BasicSortPanel.d.ts.map +1 -0
  57. package/dist/patterns/table/toolbar/BulkActionBar.d.ts +12 -0
  58. package/dist/patterns/table/toolbar/BulkActionBar.d.ts.map +1 -0
  59. package/dist/patterns/table/toolbar/BulkActionBar.js +62 -0
  60. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts +41 -0
  61. package/dist/patterns/table/toolbar/ColumnHeaderMenu.d.ts.map +1 -0
  62. package/dist/patterns/table/toolbar/ColumnHeaderMenu.js +171 -0
  63. package/dist/patterns/table/toolbar/GroupByDropdown.d.ts +11 -0
  64. package/dist/patterns/table/toolbar/GroupByDropdown.d.ts.map +1 -0
  65. package/dist/patterns/table/toolbar/GroupByDropdown.js +80 -0
  66. package/dist/patterns/table/toolbar/HideFieldsDropdown.d.ts +13 -0
  67. package/dist/patterns/table/toolbar/HideFieldsDropdown.d.ts.map +1 -0
  68. package/dist/patterns/table/toolbar/HideFieldsDropdown.js +180 -0
  69. package/dist/patterns/table/toolbar/LegacySortFilterTools.d.ts +9 -0
  70. package/dist/patterns/table/toolbar/LegacySortFilterTools.d.ts.map +1 -0
  71. package/dist/patterns/table/toolbar/RowActionsMenu.d.ts +19 -0
  72. package/dist/patterns/table/toolbar/RowActionsMenu.d.ts.map +1 -0
  73. package/dist/patterns/table/toolbar/RowActionsMenu.js +84 -0
  74. package/dist/patterns/table/toolbar/RowHeightDropdown.d.ts +9 -0
  75. package/dist/patterns/table/toolbar/RowHeightDropdown.d.ts.map +1 -0
  76. package/dist/patterns/table/toolbar/RowHeightDropdown.js +60 -0
  77. package/dist/patterns/table/toolbar/ShowSummaryDropdown.d.ts +8 -0
  78. package/dist/patterns/table/toolbar/ShowSummaryDropdown.d.ts.map +1 -0
  79. package/dist/patterns/table/toolbar/ShowSummaryDropdown.js +22 -0
  80. package/dist/patterns/table/toolbar/SummaryFooter.d.ts +16 -0
  81. package/dist/patterns/table/toolbar/SummaryFooter.d.ts.map +1 -0
  82. package/dist/patterns/table/toolbar/SummaryFooter.js +83 -0
  83. package/dist/patterns/table/toolbar/TableToolbar.d.ts +55 -0
  84. package/dist/patterns/table/toolbar/TableToolbar.d.ts.map +1 -0
  85. package/dist/patterns/table/toolbar/TableToolbar.js +234 -0
  86. package/dist/patterns/table/toolbar/ToolbarRadio.d.ts +18 -0
  87. package/dist/patterns/table/toolbar/ToolbarRadio.d.ts.map +1 -0
  88. package/dist/patterns/table/toolbar/ToolbarRadio.js +63 -0
  89. package/dist/patterns/table/toolbar/index.d.ts +24 -0
  90. package/dist/patterns/table/toolbar/index.d.ts.map +1 -0
  91. package/dist/patterns/table/toolbar/legacyToolbarTypes.d.ts +69 -0
  92. package/dist/patterns/table/toolbar/legacyToolbarTypes.d.ts.map +1 -0
  93. package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts +35 -0
  94. package/dist/patterns/table/toolbar/tableToolbarHelpers.d.ts.map +1 -0
  95. package/dist/patterns/table/toolbar/tableToolbarHelpers.js +259 -0
  96. package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts +2 -0
  97. package/dist/patterns/table/toolbar/tableToolbarHelpers.test.d.ts.map +1 -0
  98. package/dist/patterns/table/toolbar/toolbarExtensions.d.ts +12 -0
  99. package/dist/patterns/table/toolbar/toolbarExtensions.d.ts.map +1 -0
  100. package/dist/patterns/table/toolbar/toolbarExtensions.js +18 -0
  101. package/dist/patterns/table/toolbar-icons.d.ts +8 -0
  102. package/dist/patterns/table/toolbar-icons.d.ts.map +1 -0
  103. package/dist/patterns/table/toolbar-icons.js +13 -0
  104. package/dist/patterns/table/types.d.ts +141 -0
  105. package/dist/patterns/table/types.d.ts.map +1 -0
  106. package/dist/patterns/table/useGridKeyboardNavigation.d.ts +38 -0
  107. package/dist/patterns/table/useGridKeyboardNavigation.d.ts.map +1 -0
  108. package/dist/patterns/table/useGridKeyboardNavigation.js +65 -0
  109. package/dist/primitives/checkbox/checkbox.d.ts +2 -2
  110. package/dist/primitives/checkbox/checkbox.d.ts.map +1 -1
  111. package/dist/primitives/dropdown/dropdown.d.ts +32 -0
  112. package/dist/primitives/dropdown/dropdown.d.ts.map +1 -0
  113. package/dist/primitives/dropdown/dropdown.js +118 -0
  114. package/dist/primitives/dropdown/index.d.ts +2 -0
  115. package/dist/primitives/dropdown/index.d.ts.map +1 -0
  116. package/dist/primitives/select/ExpandableSearchInput.d.ts +5 -1
  117. package/dist/primitives/select/ExpandableSearchInput.d.ts.map +1 -1
  118. package/dist/primitives/select/ExpandableSearchInput.js +80 -77
  119. package/dist/primitives/shimmer/index.d.ts +2 -0
  120. package/dist/primitives/shimmer/index.d.ts.map +1 -0
  121. package/dist/primitives/shimmer/shimmer.d.ts +24 -0
  122. package/dist/primitives/shimmer/shimmer.d.ts.map +1 -0
  123. package/dist/primitives/shimmer/shimmer.js +37 -0
  124. package/dist/styles/components.css +1 -1
  125. package/dist/styles/theme.css +1 -1
  126. package/package.json +1 -1
@@ -1,132 +1,137 @@
1
- import { jsx as o, jsxs as h, Fragment as V } from "react/jsx-runtime";
2
- import { forwardRef as W, useContext as g, createContext as F, useState as T, isValidElement as A, useRef as G, useEffect as L, Children as M, cloneElement as I } from "react";
3
- import { Table as B, useTableOptions as C, Cell as z, TableBody as J, Column as S, Group as Q, TableHeader as X, Collection as P, Row as O } from "react-aria-components";
4
- import { cn as c } from "../../utils/cn.js";
5
- import { Badge as Y } from "../../primitives/badge/badge.js";
6
- import { Icon as w } from "../../primitives/icon/icon.js";
7
- import { Checkbox as _ } from "../../primitives/checkbox/checkbox.js";
8
- const b = F({
9
- size: "md",
1
+ import { jsxs as u, jsx as e, Fragment as V } from "react/jsx-runtime";
2
+ import { forwardRef as F, useContext as b, createContext as G, useState as R, isValidElement as q, useRef as L, useEffect as J, Children as Q, cloneElement as X } from "react";
3
+ import { Edit01 as Y, Copy01 as Z, Trash01 as ee, HelpCircle as te, ArrowDown as re, ChevronSelectorVertical as oe, ChevronRight as ne } from "@untitledui/icons";
4
+ import { Table as se, useTableOptions as C, Cell as T, TableBody as ie, Column as S, Group as le, TableHeader as ae, Collection as B, Row as k } from "react-aria-components";
5
+ import { cn as p } from "../../utils/cn.js";
6
+ import { isWithinCellEditor as ce } from "./useGridKeyboardNavigation.js";
7
+ import { Badge as de } from "../../primitives/badge/badge.js";
8
+ import { Dropdown as w } from "../../primitives/dropdown/dropdown.js";
9
+ import { Tooltip as D, TooltipTrigger as E } from "../../primitives/tooltip/tooltip.js";
10
+ import { Checkbox as A } from "../../primitives/checkbox/checkbox.js";
11
+ const be = () => /* @__PURE__ */ u(w.Root, { children: [
12
+ /* @__PURE__ */ e(w.DotsButton, {}),
13
+ /* @__PURE__ */ e(w.Popover, { className: "w-min", children: /* @__PURE__ */ u(w.Menu, { children: [
14
+ /* @__PURE__ */ e(w.Item, { icon: Y, children: /* @__PURE__ */ e("span", { className: "pr-4", children: "Edit" }) }),
15
+ /* @__PURE__ */ e(w.Item, { icon: Z, children: /* @__PURE__ */ e("span", { className: "pr-4", children: "Copy link" }) }),
16
+ /* @__PURE__ */ e(w.Item, { icon: ee, children: /* @__PURE__ */ e("span", { className: "pr-4", children: "Delete" }) })
17
+ ] }) })
18
+ ] }), g = G({
19
+ size: "sm",
10
20
  expandedRows: /* @__PURE__ */ new Set(),
11
21
  toggleRow: () => {
12
- }
13
- }), D = W(({ children: r, className: n, size: i = "md", ...d }, e) => {
14
- const s = G(null), [a, f] = T(!1), [p, l] = T(/* @__PURE__ */ new Set());
15
- L(() => {
16
- const t = s.current;
17
- if (!t) return;
18
- const x = () => {
19
- const { scrollWidth: R, clientWidth: N } = t;
20
- f(R > N);
22
+ },
23
+ inlineSelection: !1
24
+ }), O = F(({ children: n, className: i, size: s = "md", ...c }, o) => {
25
+ const t = L(null), [m, f] = R(!1), [a, x] = R(/* @__PURE__ */ new Set());
26
+ J(() => {
27
+ const r = t.current;
28
+ if (!r) return;
29
+ const l = () => {
30
+ const { scrollWidth: v, clientWidth: z } = r;
31
+ f(v > z);
21
32
  };
22
- x();
23
- const m = new ResizeObserver(x);
24
- return m.observe(t), () => {
25
- m.disconnect();
33
+ l();
34
+ const d = new ResizeObserver(l);
35
+ return d.observe(r), () => {
36
+ d.disconnect();
26
37
  };
27
38
  }, []);
28
- const u = (t) => {
29
- l((x) => {
30
- const m = new Set(x);
31
- return m.has(t) ? m.delete(t) : m.add(t), m;
39
+ const h = (r) => {
40
+ x((l) => {
41
+ const d = new Set(l);
42
+ return d.has(r) ? d.delete(r) : d.add(r), d;
32
43
  });
33
44
  };
34
- return /* @__PURE__ */ o(
35
- b.Provider,
45
+ return /* @__PURE__ */ e(g.Provider, { value: { size: s, hasOverflow: m, expandedRows: a, toggleRow: h }, children: /* @__PURE__ */ e(
46
+ "div",
36
47
  {
37
- value: { size: i, hasOverflow: a, expandedRows: p, toggleRow: u },
38
- children: /* @__PURE__ */ o(
39
- "div",
40
- {
41
- ref: (t) => {
42
- s.current = t, typeof e == "function" ? e(t) : e && (e.current = t);
43
- },
44
- ...d,
45
- className: c(
46
- "rounded-lg bg-primary overflow-x-auto overflow-y-clip",
47
- n
48
- ),
49
- children: r
50
- }
51
- )
48
+ ref: (r) => {
49
+ t.current = r, typeof o == "function" ? o(r) : o && (o.current = r);
50
+ },
51
+ ...c,
52
+ className: p("overflow-hidden rounded-lg bg-primary", i),
53
+ children: n
52
54
  }
53
- );
55
+ ) });
54
56
  });
55
- D.displayName = "TableCardRoot";
56
- const E = ({
57
- title: r,
58
- badge: n,
59
- description: i,
60
- contentTrailing: d,
61
- className: e
57
+ O.displayName = "TableCardRoot";
58
+ const P = ({
59
+ title: n,
60
+ badge: i,
61
+ description: s,
62
+ contentTrailing: c,
63
+ className: o
62
64
  }) => {
63
- const { size: s } = g(b);
64
- return /* @__PURE__ */ h(
65
+ const { size: t } = b(g);
66
+ return /* @__PURE__ */ u(
65
67
  "div",
66
68
  {
67
- className: c(
69
+ className: p(
68
70
  "relative flex flex-col items-start gap-4 border-b border-tertiary bg-primary px-4 md:flex-row",
69
- s === "sm" ? "py-2 md:px-4" : s === "xs" ? "py-0 md:px-3" : "py-3 md:px-6",
70
- e
71
+ t === "sm" ? "py-2 md:px-4" : t === "xs" ? "py-0 md:px-3" : "py-3 md:px-6",
72
+ o
71
73
  ),
72
74
  children: [
73
- /* @__PURE__ */ h("div", { className: "flex flex-1 flex-col gap-0.5", children: [
74
- /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
75
- /* @__PURE__ */ o(
75
+ /* @__PURE__ */ u("div", { className: "flex flex-1 flex-col gap-0.5", children: [
76
+ /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
77
+ /* @__PURE__ */ e(
76
78
  "h2",
77
79
  {
78
- className: c(
80
+ className: p(
79
81
  "font-semibold text-primary",
80
- s === "sm" ? "text-md" : s === "xs" ? "text-sm" : "text-lg"
82
+ t === "sm" ? "text-md" : t === "xs" ? "text-sm" : "text-lg"
81
83
  ),
82
- children: r
84
+ children: n
83
85
  }
84
86
  ),
85
- n ? A(n) ? n : /* @__PURE__ */ o(Y, { color: "brand", size: "sm", children: n }) : null
87
+ i ? q(i) ? i : /* @__PURE__ */ e(de, { color: "brand", size: "sm", children: i }) : null
86
88
  ] }),
87
- i && /* @__PURE__ */ o(
88
- "p",
89
- {
90
- className: c(
91
- "text-tertiary",
92
- s === "xs" ? "text-xs" : "text-sm"
93
- ),
94
- children: i
95
- }
96
- )
89
+ s && /* @__PURE__ */ e("p", { className: p("text-tertiary", t === "xs" ? "text-xs" : "text-sm"), children: s })
97
90
  ] }),
98
- d
91
+ c
99
92
  ]
100
93
  }
101
94
  );
102
95
  };
103
- E.displayName = "TableCardHeader";
104
- const j = ({
105
- className: r,
106
- size: n = "md",
107
- isEditable: i = !1,
108
- ...d
96
+ P.displayName = "TableCardHeader";
97
+ const _ = ({
98
+ className: n,
99
+ size: i = "sm",
100
+ isEditable: s = !1,
101
+ inlineSelection: c = !1,
102
+ ...o
109
103
  }) => {
110
- const e = g(b), [s, a] = T(/* @__PURE__ */ new Set()), f = (e == null ? void 0 : e.expandedRows) ?? s, p = (e == null ? void 0 : e.toggleRow) ?? ((l) => {
111
- a((u) => {
112
- const t = new Set(u);
113
- return t.has(l) ? t.delete(l) : t.add(l), t;
104
+ const t = b(g), [m, f] = R(/* @__PURE__ */ new Set()), a = (t == null ? void 0 : t.expandedRows) ?? m, x = (t == null ? void 0 : t.toggleRow) ?? ((r) => {
105
+ f((l) => {
106
+ const d = new Set(l);
107
+ return d.has(r) ? d.delete(r) : d.add(r), d;
114
108
  });
115
- });
116
- return /* @__PURE__ */ o(
117
- b.Provider,
109
+ }), h = /* @__PURE__ */ e(
110
+ se,
111
+ {
112
+ className: (r) => p(
113
+ "w-full overflow-x-hidden",
114
+ i === "xs" && "px-3 py-0",
115
+ typeof n == "function" ? n(r) : n
116
+ ),
117
+ ...o
118
+ }
119
+ );
120
+ return /* @__PURE__ */ e(
121
+ g.Provider,
118
122
  {
119
123
  value: {
120
- size: (e == null ? void 0 : e.size) ?? n,
121
- hasOverflow: e == null ? void 0 : e.hasOverflow,
122
- expandedRows: f,
123
- toggleRow: p
124
+ size: (t == null ? void 0 : t.size) ?? i,
125
+ hasOverflow: t == null ? void 0 : t.hasOverflow,
126
+ expandedRows: a,
127
+ toggleRow: x,
128
+ inlineSelection: c
124
129
  },
125
- children: i ? /* @__PURE__ */ o(
130
+ children: s ? /* @__PURE__ */ e(
126
131
  "div",
127
132
  {
128
- onKeyDownCapture: (l) => {
129
- if ((/* @__PURE__ */ new Set([
133
+ onKeyDownCapture: (r) => {
134
+ (/* @__PURE__ */ new Set([
130
135
  "ArrowLeft",
131
136
  "ArrowRight",
132
137
  "ArrowUp",
@@ -136,285 +141,203 @@ const j = ({
136
141
  "PageUp",
137
142
  "PageDown",
138
143
  " "
139
- // space
140
- ])).has(l.key)) {
141
- const t = l.target;
142
- t && (t.closest(
143
- '[contenteditable]:not([contenteditable="false"])'
144
- ) || t.closest("input, textarea") || t.closest('[role="textbox"]')) && l.stopPropagation();
145
- }
144
+ ])).has(r.key) && ce(r.target) && r.stopPropagation();
146
145
  },
147
- children: /* @__PURE__ */ o(
148
- B,
149
- {
150
- className: (l) => c(
151
- "w-full",
152
- n === "xs" && "px-3 py-0",
153
- typeof r == "function" ? r(l) : r
154
- ),
155
- ...d
156
- }
157
- )
158
- }
159
- ) : /* @__PURE__ */ o(
160
- B,
161
- {
162
- className: (l) => c(
163
- "w-full",
164
- n === "xs" && "px-3 py-0",
165
- typeof r == "function" ? r(l) : r
166
- ),
167
- ...d
146
+ children: h
168
147
  }
169
- )
148
+ ) : h
170
149
  }
171
150
  );
172
151
  };
173
- j.displayName = "Table";
174
- const q = ({
175
- columns: r,
176
- children: n,
177
- bordered: i = !1,
178
- hasExpandableRows: d = !1,
179
- className: e,
180
- ...s
152
+ _.displayName = "Table";
153
+ const W = ({
154
+ columns: n,
155
+ children: i,
156
+ bordered: s = !1,
157
+ hasExpandableRows: c = !1,
158
+ className: o,
159
+ ...t
181
160
  }) => {
182
- const { size: a } = g(b), { selectionBehavior: f, selectionMode: p } = C();
183
- return /* @__PURE__ */ h(
184
- X,
161
+ const { size: m, inlineSelection: f } = b(g), { selectionBehavior: a, selectionMode: x } = C();
162
+ return /* @__PURE__ */ u(
163
+ ae,
185
164
  {
186
- ...s,
187
- className: (l) => c(
188
- "sticky top-[-1px] z-30 bg-secondary_subtle rounded-lg h-9",
189
- // Row border—using an "after" pseudo-element to avoid the border taking up space.
190
- i && "[&>tr>th]:after:pointer-events-none [&>tr>th]:after:absolute [&>tr>th]:after:inset-x-0 [&>tr>th]:after:bottom-0 [&>tr>th]:after:h-px [&>tr>th]:after:bg-border-tertiary [&>tr>th]:focus-visible:after:bg-transparent",
191
- typeof e == "function" ? e(l) : e
165
+ ...t,
166
+ className: (h) => p(
167
+ "sticky top-0 z-30 h-9 rounded-t-lg bg-secondary_subtle [&>tr>th:first-child]:rounded-tl-lg [&>tr>th:last-child]:rounded-tr-lg",
168
+ s && "[&>tr>th]:after:pointer-events-none [&>tr>th]:after:absolute [&>tr>th]:after:inset-x-0 [&>tr>th]:after:bottom-0 [&>tr>th]:after:h-px [&>tr>th]:after:bg-border-tertiary [&>tr>th]:focus-visible:after:bg-transparent",
169
+ typeof o == "function" ? o(h) : o
192
170
  ),
193
171
  children: [
194
- d && /* @__PURE__ */ o(
195
- S,
196
- {
197
- className: c(
198
- "sticky top-[-1px] z-30 bg-secondary_subtle p-0",
199
- a === "sm" || a === "xs" ? "w-9" : "w-11"
200
- )
201
- }
202
- ),
203
- f === "toggle" && /* @__PURE__ */ o(
204
- S,
205
- {
206
- className: c(
207
- "sticky top-[-1px] z-30 bg-secondary_subtle p-0",
208
- a === "sm" || a === "xs" ? "w-9" : "w-11"
209
- ),
210
- children: p === "multiple" && /* @__PURE__ */ o("div", { className: "flex items-start", children: /* @__PURE__ */ o(_, { slot: "selection" }) })
211
- }
212
- ),
213
- /* @__PURE__ */ o(P, { items: r, children: n })
172
+ c && /* @__PURE__ */ e(S, { className: p("relative p-0", m === "sm" ? "w-9" : "w-11") }),
173
+ a === "toggle" && !f && /* @__PURE__ */ e(S, { className: p("relative p-0", m === "sm" ? "w-9" : "w-11"), children: x === "multiple" && /* @__PURE__ */ e("div", { className: "flex items-start", children: /* @__PURE__ */ e(A, { slot: "selection" }) }) }),
174
+ /* @__PURE__ */ e(B, { items: n, children: i })
214
175
  ]
215
176
  }
216
177
  );
217
178
  };
218
- q.displayName = "TableHeader";
219
- const K = ({
220
- className: r,
221
- tooltip: n,
222
- label: i,
223
- children: d,
224
- sticky: e,
225
- stickyOffset: s = 0,
226
- headerCellClass: a,
179
+ W.displayName = "TableHeader";
180
+ const j = ({
181
+ className: n,
182
+ tooltip: i,
183
+ label: s,
184
+ children: c,
185
+ sticky: o,
186
+ stickyOffset: t = 0,
187
+ headerCellClass: m,
227
188
  tooltipHeader: f = !1,
228
- ...p
189
+ ...a
229
190
  }) => {
230
- const { selectionBehavior: l } = C(), { size: u } = g(b);
231
- return /* @__PURE__ */ o(
191
+ const { selectionBehavior: x } = C(), { size: h, inlineSelection: r } = b(g);
192
+ return /* @__PURE__ */ e(
232
193
  S,
233
194
  {
234
- ...p,
235
- style: (t) => {
236
- const x = {
195
+ ...a,
196
+ style: (l) => {
197
+ const d = o ? {
237
198
  position: "sticky",
238
- top: -1,
239
- zIndex: e ? 40 : 30,
240
- ...e ? {
241
- [e]: s,
242
- boxShadow: e === "right" ? "inset 2px 0 0px 0px var(--color-border-tertiary)" : "inset -2px 0 0px 0px var(--color-border-tertiary)"
243
- } : {}
244
- };
245
- return { ...typeof p.style == "function" ? p.style(t) : p.style || {}, ...x };
199
+ [o]: t,
200
+ zIndex: 30
201
+ } : {};
202
+ return { ...typeof a.style == "function" ? a.style(l) : a.style || {}, ...d };
246
203
  },
247
- className: (t) => c(
248
- "sticky top-[-1px] bg-secondary_subtle p-0 outline-hidden focus-visible:z-[41] focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-bg-primary focus-visible:ring-inset",
249
- u === "xs" && "px-3 py-0",
250
- u === "sm" && "px-4 py-2",
251
- u === "md" && "px-6 py-2",
252
- l === "toggle" && "nth-2:pl-3",
253
- e ? "z-40" : "z-30",
254
- t.allowsSorting && "cursor-pointer",
255
- typeof r == "function" ? r(t) : r
204
+ className: (l) => p(
205
+ "relative p-0 outline-hidden focus-visible:z-1 focus-visible:ring-2 focus-visible:ring-focus-ring focus-visible:ring-offset-bg-primary focus-visible:ring-inset",
206
+ h === "xs" && "px-3 py-0",
207
+ h === "sm" && "px-4 py-2",
208
+ h === "md" && "px-6 py-2",
209
+ x === "toggle" && !r && "nth-2:pl-3",
210
+ o && "bg-secondary",
211
+ l.allowsSorting && "cursor-pointer",
212
+ typeof n == "function" ? n(l) : n
256
213
  ),
257
- children: (t) => /* @__PURE__ */ h(Q, { className: c("flex items-center gap-1", a), children: [
258
- /* @__PURE__ */ h("div", { className: "flex items-center gap-1 overflow-hidden", children: [
259
- i && /* @__PURE__ */ o("span", { className: "text-xs font-medium whitespace-nowrap overflow-hidden text-ellipsis text-secondary", children: i }),
260
- typeof d == "function" ? d(t) : d
214
+ children: (l) => /* @__PURE__ */ u(le, { className: p("flex items-center gap-1", m), children: [
215
+ f ? /* @__PURE__ */ e(D, { title: s, placement: "top", children: /* @__PURE__ */ e(E, { className: "cursor-pointer overflow-hidden text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover", children: /* @__PURE__ */ u("div", { className: "flex items-center gap-1 overflow-hidden", children: [
216
+ s && /* @__PURE__ */ e("span", { className: "overflow-hidden text-xs font-medium text-ellipsis whitespace-nowrap text-secondary", children: s }),
217
+ typeof c == "function" ? c(l) : c
218
+ ] }) }) }) : /* @__PURE__ */ u("div", { className: "flex items-center gap-1 overflow-hidden", children: [
219
+ s && /* @__PURE__ */ e("span", { className: "overflow-hidden text-xs font-medium text-ellipsis whitespace-nowrap text-secondary", children: s }),
220
+ typeof c == "function" ? c(l) : c
261
221
  ] }),
262
- n && /* @__PURE__ */ o(w, { name: "HelpCircle", size: 16, className: "text-fg-quaternary" }),
263
- t.allowsSorting && (t.sortDirection ? /* @__PURE__ */ o(
264
- w,
222
+ i && /* @__PURE__ */ e(D, { title: i, placement: "top", children: /* @__PURE__ */ e(E, { className: "cursor-pointer text-fg-quaternary transition duration-100 ease-linear hover:text-fg-quaternary_hover focus:text-fg-quaternary_hover", children: /* @__PURE__ */ e(te, { className: "size-4" }) }) }),
223
+ l.allowsSorting && (l.sortDirection ? /* @__PURE__ */ e(
224
+ re,
265
225
  {
266
- name: "ArrowDown",
267
- size: 12,
268
- className: c(
269
- "stroke-[3px] text-fg-quaternary",
270
- t.sortDirection === "ascending" && "rotate-180"
226
+ className: p(
227
+ "size-3 stroke-[3px] text-fg-quaternary",
228
+ l.sortDirection === "ascending" && "rotate-180"
271
229
  )
272
230
  }
273
- ) : /* @__PURE__ */ o(
274
- w,
275
- {
276
- name: "ChevronSelectorVertical",
277
- size: 12,
278
- className: "text-fg-quaternary"
279
- }
280
- ))
231
+ ) : /* @__PURE__ */ e(oe, { size: 12, strokeWidth: 3, className: "text-fg-quaternary" }))
281
232
  ] })
282
233
  }
283
234
  );
284
235
  };
285
- K.displayName = "TableHead";
286
- const $ = ({
287
- columns: r,
288
- children: n,
289
- className: i,
290
- highlightSelectedRow: d = !0,
291
- isExpandable: e = !1,
292
- renderExpandedContent: s,
293
- ...a
236
+ j.displayName = "TableHead";
237
+ const K = ({
238
+ columns: n,
239
+ children: i,
240
+ className: s,
241
+ highlightSelectedRow: c = !0,
242
+ isExpandable: o = !1,
243
+ renderExpandedContent: t,
244
+ expandedColSpan: m,
245
+ ...f
294
246
  }) => {
295
- const { size: f, expandedRows: p, toggleRow: l } = g(b), { selectionBehavior: u } = C(), t = typeof a.id == "string" ? a.id : String(a.id), x = p.has(t), R = e ? /* @__PURE__ */ o(
247
+ const { size: a, expandedRows: x, toggleRow: h, inlineSelection: r } = b(g), { selectionBehavior: l } = C(), d = typeof f.id == "string" ? f.id : String(f.id), v = x.has(d), I = o ? /* @__PURE__ */ e(
296
248
  "button",
297
249
  {
298
250
  type: "button",
299
251
  onClick: (y) => {
300
- y.stopPropagation(), l(t);
252
+ y.stopPropagation(), h(d);
301
253
  },
302
- className: c(
303
- "flex items-center justify-center transition-transform duration-200 ease-in-out cursor-pointer hover:bg-secondary_subtle rounded p-1 flex-shrink-0 -ml-1 mr-2",
304
- x && "rotate-90"
254
+ className: p(
255
+ "mr-2 -ml-1 flex flex-shrink-0 cursor-pointer items-center justify-center rounded p-1 transition-transform duration-200 ease-in-out hover:bg-secondary_subtle",
256
+ v && "rotate-90"
305
257
  ),
306
- "aria-label": x ? "Collapse row" : "Expand row",
307
- children: /* @__PURE__ */ o(w, { name: "ChevronRight", size: 16, className: "text-secondary" })
258
+ "aria-label": v ? "Collapse row" : "Expand row",
259
+ children: /* @__PURE__ */ e(ne, { className: "size-4 text-fg-quaternary" })
308
260
  }
309
- ) : null, N = e ? (() => {
310
- const y = M.toArray(n);
311
- if (y.length > 0 && A(y[0])) {
312
- const H = y[0], k = H.props;
261
+ ) : null, M = o ? (() => {
262
+ const y = Q.toArray(i);
263
+ if (y.length > 0 && q(y[0])) {
264
+ const H = y[0], U = H.props;
313
265
  return [
314
- I(H, {
315
- ...k,
316
- children: /* @__PURE__ */ h("div", { className: "flex items-center gap-2", children: [
317
- R,
318
- k.children
266
+ X(H, {
267
+ children: /* @__PURE__ */ u("div", { className: "flex items-center gap-2", children: [
268
+ I,
269
+ U.children
319
270
  ] })
320
271
  }),
321
272
  ...y.slice(1)
322
273
  ];
323
274
  }
324
- return n;
325
- })() : n;
326
- return /* @__PURE__ */ h(V, { children: [
327
- /* @__PURE__ */ h(
328
- O,
275
+ return i;
276
+ })() : i;
277
+ return /* @__PURE__ */ u(V, { children: [
278
+ /* @__PURE__ */ u(
279
+ k,
329
280
  {
330
- ...a,
331
- className: (y) => c(
281
+ ...f,
282
+ className: (y) => p(
332
283
  "relative outline-focus-ring transition-colors after:pointer-events-none hover:bg-secondary_subtle focus-visible:outline-2 focus-visible:-outline-offset-2",
333
- f === "xs" ? "h-10" : f === "sm" ? "h-12" : f === "md" ? "h-18" : "h-10",
334
- d && "selected:bg-secondary",
335
- // Row border—using an "after" pseudo-element to avoid the border taking up space.
336
- !x && "[&>td]:after:absolute [&>td]:after:inset-x-0 [&>td]:after:bottom-0 [&>td]:after:h-px [&>td]:after:w-full [&>td]:after:bg-border-tertiary last:[&>td]:after:hidden [&>td]:focus-visible:after:opacity-0 focus-visible:[&>td]:after:opacity-0",
337
- typeof i == "function" ? i(y) : i
284
+ a === "xs" ? "h-10" : a === "sm" ? "h-12" : a === "md" ? "h-18" : "h-10",
285
+ c && !r && "selected:bg-secondary",
286
+ r && "selected:!bg-transparent",
287
+ !v && "[&>td]:after:absolute [&>td]:after:inset-x-0 [&>td]:after:bottom-0 [&>td]:after:h-px [&>td]:after:w-full [&>td]:after:bg-border-tertiary last:[&>td]:after:hidden [&>td]:focus-visible:after:opacity-0 focus-visible:[&>td]:after:opacity-0",
288
+ typeof s == "function" ? s(y) : s
338
289
  ),
339
290
  children: [
340
- u === "toggle" && /* @__PURE__ */ o(
341
- z,
342
- {
343
- className: c(
344
- "relative p-0",
345
- f === "sm" || f === "xs" ? "w-9" : "w-11"
346
- ),
347
- children: /* @__PURE__ */ o("div", { className: "flex items-end", children: /* @__PURE__ */ o(_, { className: "hidden", slot: "selection" }) })
348
- }
349
- ),
350
- /* @__PURE__ */ o(P, { items: r, children: N })
291
+ l === "toggle" && !r && /* @__PURE__ */ e(T, { className: p("relative p-0", a === "sm" ? "w-9" : "w-11"), children: /* @__PURE__ */ e("div", { className: "flex items-end", children: /* @__PURE__ */ e(A, { className: "hidden", slot: "selection" }) }) }),
292
+ /* @__PURE__ */ e(B, { items: n, children: M })
351
293
  ]
352
294
  }
353
295
  ),
354
- e && x && s && /* @__PURE__ */ o(
355
- O,
356
- {
357
- id: `${t}-expanded`,
358
- className: "relative bg-secondary_subtle",
359
- children: /* @__PURE__ */ o(
360
- z,
361
- {
362
- className: "p-0",
363
- colSpan: (r == null ? void 0 : r.length) || 0,
364
- children: /* @__PURE__ */ o("div", { className: c("w-full"), children: s(a.value) })
365
- }
366
- )
367
- }
368
- )
296
+ o && v && t && f.value != null && /* @__PURE__ */ e(k, { id: `${d}-expanded`, className: "relative bg-secondary_subtle", children: /* @__PURE__ */ e(T, { className: "p-0", colSpan: m ?? (n == null ? void 0 : n.length) ?? 1, children: /* @__PURE__ */ e("div", { className: "w-full", children: t(f.value) }) }) })
369
297
  ] });
370
298
  };
371
- $.displayName = "TableRow";
372
- const U = ({
373
- className: r,
374
- children: n,
375
- sticky: i,
376
- stickyOffset: d = 0,
377
- ...e
378
- }) => {
379
- const { size: s } = g(b), { selectionBehavior: a } = C();
380
- return /* @__PURE__ */ o(
381
- z,
299
+ K.displayName = "TableRow";
300
+ const $ = ({ className: n, children: i, sticky: s, stickyOffset: c = 0, ...o }) => {
301
+ const { size: t, inlineSelection: m } = b(g), { selectionBehavior: f } = C();
302
+ return /* @__PURE__ */ e(
303
+ T,
382
304
  {
383
- ...e,
384
- style: (f) => {
385
- const p = i ? {
305
+ ...o,
306
+ style: (a) => {
307
+ const x = s ? {
386
308
  position: "sticky",
387
- [i]: d,
309
+ [s]: c,
388
310
  zIndex: 20,
389
311
  backgroundColor: "white",
390
- boxShadow: i === "right" ? "inset 2px 0 0px 0px var(--color-border-tertiary)" : "inset -2px 0 0px 0px var(--color-border-tertiary)"
312
+ boxShadow: s === "right" ? "inset 2px 0 0px 0px var(--color-border-tertiary)" : "inset -2px 0 0px 0px var(--color-border-tertiary)"
391
313
  } : {};
392
- return { ...typeof e.style == "function" ? e.style(f) : e.style || {}, ...p };
314
+ return { ...typeof o.style == "function" ? o.style(a) : o.style || {}, ...x };
393
315
  },
394
- className: (f) => c(
316
+ className: (a) => p(
395
317
  "relative text-secondary outline-focus-ring focus-visible:z-1 focus-visible:outline-2 focus-visible:-outline-offset-2",
396
- s === "xs" && "p-0 px-3 py-0 text-xs",
397
- s === "sm" && "p-0 px-4 py-2 text-sm",
398
- s === "md" && "p-0 px-6 py-2 text-base",
399
- a === "toggle" && "nth-2:pl-3",
400
- typeof r == "function" ? r(f) : r
318
+ t === "xs" && "p-0 px-3 py-0 text-xs",
319
+ t === "sm" && "p-0 px-4 py-2 text-sm",
320
+ t === "md" && "p-0 px-6 py-2 text-base",
321
+ f === "toggle" && !m && "nth-2:pl-3",
322
+ typeof n == "function" ? n(a) : n
401
323
  ),
402
- children: n
324
+ children: i
403
325
  }
404
326
  );
405
327
  };
406
- U.displayName = "TableCell";
407
- const le = {
408
- Root: D,
409
- Header: E
410
- }, v = j;
411
- v.Body = J;
412
- v.Cell = U;
413
- v.Head = K;
414
- v.Header = q;
415
- v.Row = $;
328
+ $.displayName = "TableCell";
329
+ const Ne = {
330
+ Root: O,
331
+ Header: P
332
+ }, N = _;
333
+ N.Body = ie;
334
+ N.Cell = $;
335
+ N.Head = j;
336
+ N.Header = W;
337
+ N.Row = K;
416
338
  export {
417
- v as Table,
418
- le as TableCard,
419
- U as TableCell
339
+ N as Table,
340
+ Ne as TableCard,
341
+ $ as TableCell,
342
+ be as TableRowActionsDropdown
420
343
  };