@pstdio/ui 0.41.0 → 0.42.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 (85) hide show
  1. package/dist/{MermaidComponent-BCiI63_G.js → MermaidComponent-D7vhkpka.js} +2 -2
  2. package/dist/{MermaidComponent-BCiI63_G.js.map → MermaidComponent-D7vhkpka.js.map} +1 -1
  3. package/dist/alert-MQ47wy7f.js +388 -0
  4. package/dist/alert-MQ47wy7f.js.map +1 -0
  5. package/dist/chat-ui.d.ts +36 -5
  6. package/dist/chat-ui.js +1777 -1422
  7. package/dist/chat-ui.js.map +1 -1
  8. package/dist/collection-view-fields-D3cysHNT.d.ts +232 -0
  9. package/dist/collection-view-grouping-D4nZk8-3.js +90 -0
  10. package/dist/collection-view-grouping-D4nZk8-3.js.map +1 -0
  11. package/dist/collection-view-search-CpjJy76w.js +1973 -0
  12. package/dist/collection-view-search-CpjJy76w.js.map +1 -0
  13. package/dist/collection-view.d.ts +4 -0
  14. package/dist/collection-view.js +2 -0
  15. package/dist/{data-table-stats-row-EiTEONdY.js → data-table-stats-row-64magT2g.js} +2 -2
  16. package/dist/{data-table-stats-row-EiTEONdY.js.map → data-table-stats-row-64magT2g.js.map} +1 -1
  17. package/dist/data-table.d.ts +3 -1
  18. package/dist/data-table.js +279 -277
  19. package/dist/data-table.js.map +1 -1
  20. package/dist/{diff-drawer-BwZBOObe.js → diff-drawer-IYpQ-QQK.js} +192 -191
  21. package/dist/diff-drawer-IYpQ-QQK.js.map +1 -0
  22. package/dist/{diff-viewer-kOOd7C7h.js → diff-viewer-C-0VAt9P.js} +4 -4
  23. package/dist/{diff-viewer-kOOd7C7h.js.map → diff-viewer-C-0VAt9P.js.map} +1 -1
  24. package/dist/diff.js +2 -2
  25. package/dist/{display-sort-control-DPxc0e5z.js → display-sort-control-f3rbILsV.js} +87 -86
  26. package/dist/{display-sort-control-DPxc0e5z.js.map → display-sort-control-f3rbILsV.js.map} +1 -1
  27. package/dist/drop-indicator-HjlBSIeV.js +27 -0
  28. package/dist/drop-indicator-HjlBSIeV.js.map +1 -0
  29. package/dist/edit-mode-data-table-DnMB2jiy.js +1449 -0
  30. package/dist/edit-mode-data-table-DnMB2jiy.js.map +1 -0
  31. package/dist/host-storage-BIo5azql.js +31 -0
  32. package/dist/host-storage-BIo5azql.js.map +1 -0
  33. package/dist/host-storage-J0089Hyk.d.ts +17 -0
  34. package/dist/icon-options-Tt6Wzhtv.js +308 -0
  35. package/dist/icon-options-Tt6Wzhtv.js.map +1 -0
  36. package/dist/{index-C9mywhyX.d.ts → index-B79hwNcB.d.ts} +17 -1
  37. package/dist/index-CKsd23jv.d.ts +80 -0
  38. package/dist/{index-D3UJyWWh.d.ts → index-ICoad2I_.d.ts} +4 -223
  39. package/dist/index.d.ts +22 -6
  40. package/dist/index.js +1174 -1112
  41. package/dist/index.js.map +1 -1
  42. package/dist/kanban-renderer.d.ts +2 -1
  43. package/dist/kanban-renderer.js +531 -528
  44. package/dist/kanban-renderer.js.map +1 -1
  45. package/dist/list-row-Z4SHkseA.js +1195 -0
  46. package/dist/list-row-Z4SHkseA.js.map +1 -0
  47. package/dist/markdown-editor-Dd4mor7l.js +3236 -0
  48. package/dist/markdown-editor-Dd4mor7l.js.map +1 -0
  49. package/dist/number-input-7K66wnSC.js +63 -0
  50. package/dist/number-input-7K66wnSC.js.map +1 -0
  51. package/dist/param-editor-Dnix-fJo.js +225 -0
  52. package/dist/param-editor-Dnix-fJo.js.map +1 -0
  53. package/dist/param-editor-field-B3vLST-B.js +2394 -0
  54. package/dist/param-editor-field-B3vLST-B.js.map +1 -0
  55. package/dist/param-editor.js +4 -2
  56. package/dist/prism-OG4H7Hu4.js +334 -0
  57. package/dist/prism-OG4H7Hu4.js.map +1 -0
  58. package/dist/queued-follow-up-Bj_vtMgd.js +208 -0
  59. package/dist/queued-follow-up-Bj_vtMgd.js.map +1 -0
  60. package/dist/rich-text-BgEnAHr2.js +1160 -0
  61. package/dist/rich-text-BgEnAHr2.js.map +1 -0
  62. package/dist/rich-text.d.ts +1 -1
  63. package/dist/rich-text.js +4 -2
  64. package/dist/terminal.js +1 -1
  65. package/dist/{theme-at0rtSnX.js → theme-CMJdH59Z.js} +224 -90
  66. package/dist/theme-CMJdH59Z.js.map +1 -0
  67. package/dist/theme.js +1 -1
  68. package/dist/tree-list-jarhD31R.js +1652 -0
  69. package/dist/tree-list-jarhD31R.js.map +1 -0
  70. package/dist/use-virtualizer-uj43XjBp.js +10 -0
  71. package/dist/use-virtualizer-uj43XjBp.js.map +1 -0
  72. package/dist/{host-storage-DP0RLj4i.d.ts → workspace-badge-BKtB805G.d.ts} +6 -16
  73. package/package.json +6 -2
  74. package/dist/chat-question-bubble-w2vMbFsS.js +0 -68
  75. package/dist/chat-question-bubble-w2vMbFsS.js.map +0 -1
  76. package/dist/diff-drawer-BwZBOObe.js.map +0 -1
  77. package/dist/list-row-DM0DiIrN.js +0 -1167
  78. package/dist/list-row-DM0DiIrN.js.map +0 -1
  79. package/dist/prism-JVIsQMoJ.js +0 -1029
  80. package/dist/prism-JVIsQMoJ.js.map +0 -1
  81. package/dist/rich-text-DM24VNQZ.js +0 -10447
  82. package/dist/rich-text-DM24VNQZ.js.map +0 -1
  83. package/dist/theme-at0rtSnX.js.map +0 -1
  84. package/dist/tree-list-Cqgl8mnN.js +0 -1621
  85. package/dist/tree-list-Cqgl8mnN.js.map +0 -1
@@ -1,1167 +0,0 @@
1
- import { n as e, t } from "./scroll-area-Cr1lNXAr.js";
2
- import { Box as n, Checkbox as r, HStack as i, Icon as a, IconButton as o, Input as s, InputGroup as c, Menu as l, Portal as u, Stack as d, Text as f, chakra as p, useMenu as m } from "@chakra-ui/react";
3
- import { c as h } from "react/compiler-runtime";
4
- import { Fragment as g, jsx as _, jsxs as v } from "react/jsx-runtime";
5
- import * as y from "react";
6
- import { Fragment as b, forwardRef as x, useEffect as S, useId as C, useRef as w, useState as T } from "react";
7
- import { Check as E, ChevronDown as D, ChevronRight as O, Search as k } from "lucide-react";
8
- //#region src/components/overlays/resource-context-menu.tsx
9
- var A = (e) => {
10
- let n = h(9), { actions: r, contentBackground: i, contentMinWidth: a } = e, o;
11
- n[0] === Symbol.for("react.memo_cache_sentinel") ? (o = {
12
- overscrollBehavior: "contain",
13
- tabIndex: -1
14
- }, n[0] = o) : o = n[0];
15
- let s;
16
- n[1] === r ? s = n[2] : (s = r.map(N), n[1] = r, n[2] = s);
17
- let c;
18
- n[3] === s ? c = n[4] : (c = /* @__PURE__ */ _(t, {
19
- flex: "1",
20
- minH: "0",
21
- viewportProps: o,
22
- children: s
23
- }), n[3] = s, n[4] = c);
24
- let d;
25
- return n[5] !== i || n[6] !== a || n[7] !== c ? (d = /* @__PURE__ */ _(u, { children: /* @__PURE__ */ _(l.Positioner, { children: /* @__PURE__ */ _(l.Content, {
26
- minW: a,
27
- bg: i,
28
- maxH: "var(--available-height)",
29
- children: c
30
- }) }) }), n[5] = i, n[6] = a, n[7] = c, n[8] = d) : d = n[8], d;
31
- }, j = (e) => {
32
- let t = h(13), { actions: n, children: r, contentMinWidth: i, contentBackground: a, positioning: o, closeOnSelect: s } = e, c = i === void 0 ? "17.5rem" : i, u = a === void 0 ? "bg" : a, d;
33
- t[0] === o ? d = t[1] : (d = o === void 0 ? { placement: "bottom-start" } : o, t[0] = o, t[1] = d);
34
- let f = d;
35
- if (n.length === 0) return r;
36
- let p;
37
- t[2] === r ? p = t[3] : (p = /* @__PURE__ */ _(l.Trigger, {
38
- asChild: !0,
39
- children: r
40
- }), t[2] = r, t[3] = p);
41
- let m;
42
- t[4] !== n || t[5] !== u || t[6] !== c ? (m = /* @__PURE__ */ _(A, {
43
- actions: n,
44
- contentMinWidth: c,
45
- contentBackground: u
46
- }), t[4] = n, t[5] = u, t[6] = c, t[7] = m) : m = t[7];
47
- let g;
48
- return t[8] !== s || t[9] !== f || t[10] !== p || t[11] !== m ? (g = /* @__PURE__ */ v(l.Root, {
49
- positioning: f,
50
- closeOnSelect: s,
51
- children: [p, m]
52
- }), t[8] = s, t[9] = f, t[10] = p, t[11] = m, t[12] = g) : g = t[12], g;
53
- }, M = (e) => {
54
- let t = h(34), { actions: n, children: r, contentMinWidth: i, contentBackground: a, positioning: o, closeOnSelect: s, keepMountedWhenEmpty: c } = e, u = i === void 0 ? "17.5rem" : i, d = a === void 0 ? "bg" : a, f;
55
- t[0] === o ? f = t[1] : (f = o === void 0 ? { placement: "bottom-start" } : o, t[0] = o, t[1] = f);
56
- let y = f, b = c !== void 0 && c, x = w(null), S;
57
- t[2] === Symbol.for("react.memo_cache_sentinel") ? (S = () => {
58
- let e = x.current;
59
- x.current = null, e && requestAnimationFrame(() => e.focus());
60
- }, t[2] = S) : S = t[2];
61
- let C;
62
- t[3] !== s || t[4] !== y ? (C = {
63
- positioning: y,
64
- closeOnSelect: s,
65
- onEscapeKeyDown: S
66
- }, t[3] = s, t[4] = y, t[5] = C) : C = t[5];
67
- let T = m(C), E;
68
- t[6] === T.api ? E = t[7] : (E = T.api.getContextTriggerProps(), t[6] = T.api, t[7] = E);
69
- let D = E;
70
- if (n.length === 0 && !b) {
71
- let e;
72
- return t[8] === r ? e = t[9] : (e = /* @__PURE__ */ _(g, { children: r }), t[8] = r, t[9] = e), e;
73
- }
74
- let O;
75
- t[10] !== n.length || t[11] !== D ? (O = (e) => {
76
- n.length !== 0 && e.pointerType !== "mouse" && (x.current = null, e.stopPropagation(), D.onPointerDown?.(e));
77
- }, t[10] = n.length, t[11] = D, t[12] = O) : O = t[12];
78
- let k;
79
- t[13] === n.length ? k = t[14] : (k = (e) => {
80
- if (e.defaultPrevented || n.length === 0 || e.key !== "ContextMenu" && !(e.shiftKey && e.key === "F10")) return;
81
- e.preventDefault(), e.stopPropagation();
82
- let t = e.currentTarget.getBoundingClientRect();
83
- e.currentTarget.dispatchEvent(new MouseEvent("contextmenu", {
84
- bubbles: !0,
85
- cancelable: !0,
86
- clientX: t.left,
87
- clientY: t.bottom
88
- })), x.current = e.currentTarget;
89
- }, t[13] = n.length, t[14] = k);
90
- let j;
91
- t[15] !== n.length || t[16] !== D ? (j = (e) => {
92
- x.current = null, n.length > 0 && !e.defaultPrevented && D.onContextMenu?.(e);
93
- }, t[15] = n.length, t[16] = D, t[17] = j) : j = t[17];
94
- let M;
95
- t[18] !== r || t[19] !== j || t[20] !== O || t[21] !== k || t[22] !== D ? (M = /* @__PURE__ */ _(p.div, {
96
- asChild: !0,
97
- ...D,
98
- onPointerDown: O,
99
- onKeyDown: k,
100
- onContextMenu: j,
101
- children: r
102
- }), t[18] = r, t[19] = j, t[20] = O, t[21] = k, t[22] = D, t[23] = M) : M = t[23];
103
- let N;
104
- t[24] !== n || t[25] !== d || t[26] !== u ? (N = n.length > 0 ? /* @__PURE__ */ _(A, {
105
- actions: n,
106
- contentMinWidth: u,
107
- contentBackground: d
108
- }) : null, t[24] = n, t[25] = d, t[26] = u, t[27] = N) : N = t[27];
109
- let P;
110
- t[28] !== T || t[29] !== N ? (P = /* @__PURE__ */ _(l.RootProvider, {
111
- value: T,
112
- lazyMount: !0,
113
- unmountOnExit: !0,
114
- children: N
115
- }), t[28] = T, t[29] = N, t[30] = P) : P = t[30];
116
- let F;
117
- return t[31] !== M || t[32] !== P ? (F = /* @__PURE__ */ v(g, { children: [M, P] }), t[31] = M, t[32] = P, t[33] = F) : F = t[33], F;
118
- };
119
- function N(e) {
120
- return /* @__PURE__ */ v(b, { children: [e.separatorBefore ? /* @__PURE__ */ _(l.Separator, {}) : null, /* @__PURE__ */ _(l.Item, {
121
- value: e.key,
122
- disabled: e.isDisabled,
123
- asChild: !0,
124
- children: /* @__PURE__ */ _(G, {
125
- asChild: !0,
126
- variant: "full-width",
127
- label: e.label,
128
- icon: e.icon,
129
- endContent: e.endContent,
130
- disabled: e.isDisabled,
131
- onActivate: e.onClick
132
- })
133
- })] }, e.key);
134
- }
135
- //#endregion
136
- //#region src/components/list-row/list-row-menu.tsx
137
- var P = (e) => {
138
- let t = h(4), { item: r } = e;
139
- if (!r.icon) return null;
140
- let i;
141
- t[0] === r.icon ? i = t[1] : (i = typeof r.icon == "function" ? /* @__PURE__ */ _(a, {
142
- as: r.icon,
143
- boxSize: "14px"
144
- }) : r.icon, t[0] = r.icon, t[1] = i);
145
- let o;
146
- return t[2] === i ? o = t[3] : (o = /* @__PURE__ */ _(n, {
147
- color: "fg.muted",
148
- flexShrink: 0,
149
- display: "inline-flex",
150
- children: i
151
- }), t[2] = i, t[3] = o), o;
152
- }, F = (e) => {
153
- let t = h(20), { children: r, items: a, onOpenChange: o, onSelect: s, open: c, placement: p } = e, m = p === void 0 ? "right-start" : p, g;
154
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (g = { mainAxis: 4 }, t[0] = g) : g = t[0];
155
- let y;
156
- t[1] === m ? y = t[2] : (y = {
157
- placement: m,
158
- offset: g
159
- }, t[1] = m, t[2] = y);
160
- let x;
161
- t[3] === o ? x = t[4] : (x = (e) => o(e.open), t[3] = o, t[4] = x);
162
- let S;
163
- t[5] === r ? S = t[6] : (S = /* @__PURE__ */ _(l.Trigger, {
164
- asChild: !0,
165
- children: r
166
- }), t[5] = r, t[6] = S);
167
- let C;
168
- if (t[7] !== a || t[8] !== s) {
169
- let e;
170
- t[10] === s ? e = t[11] : (e = (e) => /* @__PURE__ */ v(b, { children: [e.separatorBefore ? /* @__PURE__ */ _(l.Separator, {}) : null, /* @__PURE__ */ _(l.Item, {
171
- value: e.id,
172
- disabled: e.disabled || e.readOnly,
173
- _disabled: e.readOnly ? {
174
- opacity: 1,
175
- cursor: "default"
176
- } : void 0,
177
- onClick: () => {
178
- e.readOnly || s(e);
179
- },
180
- children: /* @__PURE__ */ v(i, {
181
- gap: "2",
182
- minW: "0",
183
- w: "full",
184
- justify: "space-between",
185
- alignItems: "center",
186
- children: [/* @__PURE__ */ v(i, {
187
- gap: "2",
188
- minW: "0",
189
- flex: "1",
190
- alignItems: e.description ? "flex-start" : "center",
191
- children: [/* @__PURE__ */ _(P, { item: e }), /* @__PURE__ */ v(d, {
192
- gap: "0",
193
- minW: "0",
194
- children: [/* @__PURE__ */ _(f, {
195
- textStyle: "label/S/regular",
196
- truncate: !0,
197
- children: e.label
198
- }), e.description ? /* @__PURE__ */ _(f, {
199
- textStyle: "label/XS",
200
- color: "fg.menu-item.secondary",
201
- truncate: !0,
202
- children: e.description
203
- }) : null]
204
- })]
205
- }), e.endContent ? /* @__PURE__ */ _(n, {
206
- flexShrink: 0,
207
- children: e.endContent
208
- }) : null]
209
- })
210
- })] }, e.id), t[10] = s, t[11] = e), C = a.map(e), t[7] = a, t[8] = s, t[9] = C;
211
- } else C = t[9];
212
- let w;
213
- t[12] === C ? w = t[13] : (w = /* @__PURE__ */ _(u, { children: /* @__PURE__ */ _(l.Positioner, { children: /* @__PURE__ */ _(l.Content, {
214
- minW: "200px",
215
- bg: "bg",
216
- children: C
217
- }) }) }), t[12] = C, t[13] = w);
218
- let T;
219
- return t[14] !== c || t[15] !== y || t[16] !== x || t[17] !== S || t[18] !== w ? (T = /* @__PURE__ */ v(l.Root, {
220
- open: c,
221
- positioning: y,
222
- onOpenChange: x,
223
- children: [S, w]
224
- }), t[14] = c, t[15] = y, t[16] = x, t[17] = S, t[18] = w, t[19] = T) : T = t[19], T;
225
- }, ee = (e) => e.map((e) => ({
226
- key: e.id,
227
- label: e.label,
228
- icon: typeof e.icon == "function" ? /* @__PURE__ */ _(a, {
229
- as: e.icon,
230
- boxSize: "16px"
231
- }) : e.icon,
232
- endContent: e.endContent,
233
- isDisabled: e.disabled,
234
- separatorBefore: e.separatorBefore,
235
- onClick: () => e.onAction?.()
236
- })), te = (t) => {
237
- let n = h(15), { children: r, item: i, menuOpen: a, onMenuOpenChange: o, onMenuSelect: s } = t;
238
- if (i.menuItems && i.menuItems.length > 0) {
239
- let e;
240
- return n[0] !== r || n[1] !== i.menuItems || n[2] !== i.menuPlacement || n[3] !== a || n[4] !== o || n[5] !== s ? (e = /* @__PURE__ */ _(F, {
241
- items: i.menuItems,
242
- open: a,
243
- placement: i.menuPlacement,
244
- onOpenChange: o,
245
- onSelect: s,
246
- children: r
247
- }), n[0] = r, n[1] = i.menuItems, n[2] = i.menuPlacement, n[3] = a, n[4] = o, n[5] = s, n[6] = e) : e = n[6], e;
248
- }
249
- let c;
250
- n[7] !== r || n[8] !== i.tooltip ? (c = i.tooltip ? /* @__PURE__ */ _(e, {
251
- content: i.tooltip,
252
- children: r
253
- }) : r, n[7] = r, n[8] = i.tooltip, n[9] = c) : c = n[9];
254
- let l = c;
255
- if (!i.contextMenuItems || i.contextMenuItems.length === 0) return l;
256
- let u;
257
- n[10] === i.contextMenuItems ? u = n[11] : (u = ee(i.contextMenuItems), n[10] = i.contextMenuItems, n[11] = u);
258
- let d;
259
- return n[12] !== l || n[13] !== u ? (d = /* @__PURE__ */ _(M, {
260
- actions: u,
261
- children: l
262
- }), n[12] = l, n[13] = u, n[14] = d) : d = n[14], d;
263
- }, ne = {
264
- main: {
265
- h: "2.5rem",
266
- px: "xs"
267
- },
268
- narrow: {
269
- h: "2rem",
270
- px: "xs"
271
- },
272
- input: {
273
- h: "3rem",
274
- px: "0"
275
- }
276
- }, re = y.forwardRef(function(e, t) {
277
- let n = h(9), r, a, o;
278
- n[0] === e ? (r = n[1], a = n[2], o = n[3]) : ({variant: o, children: r, ...a} = e, n[0] = e, n[1] = r, n[2] = a, n[3] = o);
279
- let s = ne[o === void 0 ? "main" : o], c;
280
- return n[4] !== r || n[5] !== t || n[6] !== a || n[7] !== s ? (c = /* @__PURE__ */ _(i, {
281
- ref: t,
282
- as: "header",
283
- alignItems: "center",
284
- borderWidth: "0",
285
- ...s,
286
- ...a,
287
- children: r
288
- }), n[4] = r, n[5] = t, n[6] = a, n[7] = s, n[8] = c) : c = n[8], c;
289
- }), ie = (e) => {
290
- let t = h(8), { inputRef: n, value: r, placeholder: i, onValueChange: a } = e, o;
291
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ _(k, { size: 14 }), t[0] = o) : o = t[0];
292
- let l;
293
- t[1] === a ? l = t[2] : (l = (e) => a(e.target.value), t[1] = a, t[2] = l);
294
- let u;
295
- return t[3] !== n || t[4] !== i || t[5] !== l || t[6] !== r ? (u = /* @__PURE__ */ _(re, {
296
- variant: "input",
297
- borderBottomWidth: "1px",
298
- borderColor: "border.subtle",
299
- flexShrink: 0,
300
- children: /* @__PURE__ */ _(c, {
301
- startElement: o,
302
- width: "full",
303
- children: /* @__PURE__ */ _(s, {
304
- ref: n,
305
- mx: "xs",
306
- variant: "borderless",
307
- value: r,
308
- placeholder: i,
309
- "aria-label": i,
310
- autoComplete: "off",
311
- onChange: l,
312
- onKeyDown: I
313
- })
314
- })
315
- }), t[3] = n, t[4] = i, t[5] = l, t[6] = r, t[7] = u) : u = t[7], u;
316
- };
317
- function I(e) {
318
- return e.stopPropagation();
319
- }
320
- //#endregion
321
- //#region src/components/primitives/checkbox.tsx
322
- var ae = y.forwardRef(function(e, t) {
323
- let n = h(33), i, a, o, s, c, l, u;
324
- n[0] === e ? (i = n[1], a = n[2], o = n[3], s = n[4], c = n[5], l = n[6], u = n[7]) : ({icon: a, children: i, inputProps: o, rootRef: c, disabled: l, readOnly: u, ...s} = e, n[0] = e, n[1] = i, n[2] = a, n[3] = o, n[4] = s, n[5] = c, n[6] = l, n[7] = u);
325
- let d = l !== void 0 && l, f = u !== void 0 && u, p = d ? "not-allowed" : f ? "default" : "pointer", m;
326
- n[8] !== o || n[9] !== t ? (m = /* @__PURE__ */ _(r.HiddenInput, {
327
- ref: t,
328
- ...o
329
- }), n[8] = o, n[9] = t, n[10] = m) : m = n[10];
330
- let g, y, b;
331
- n[11] === Symbol.for("react.memo_cache_sentinel") ? (g = { borderColor: "border.accent-light" }, y = { borderColor: "border.accent-light" }, b = {
332
- borderColor: "border.accent-light",
333
- outline: "none",
334
- boxShadow: "none"
335
- }, n[11] = g, n[12] = y, n[13] = b) : (g = n[11], y = n[12], b = n[13]);
336
- let x;
337
- n[14] === Symbol.for("react.memo_cache_sentinel") ? (x = {
338
- bg: "bg.button.primary.default",
339
- borderColor: "bg.button.primary.default",
340
- color: "fg.button.primary.default",
341
- _hover: { borderColor: "bg.button.primary.default" },
342
- _active: { borderColor: "bg.button.primary.default" }
343
- }, n[14] = x) : x = n[14];
344
- let S;
345
- n[15] === Symbol.for("react.memo_cache_sentinel") ? (S = {
346
- bg: "bg.button.primary.default",
347
- borderColor: "bg.button.primary.default",
348
- color: "fg.button.primary.default",
349
- _hover: { borderColor: "bg.button.primary.default" },
350
- _active: { borderColor: "bg.button.primary.default" }
351
- }, n[15] = S) : S = n[15];
352
- let C;
353
- n[16] === a ? C = n[17] : (C = a ? /* @__PURE__ */ _(r.Indicator, { children: a }) : /* @__PURE__ */ _(r.Indicator, {}), n[16] = a, n[17] = C);
354
- let w;
355
- n[18] !== p || n[19] !== C ? (w = /* @__PURE__ */ _(r.Control, {
356
- bg: "bg",
357
- borderColor: "border",
358
- color: "fg.button.primary.default",
359
- cursor: p,
360
- transition: "border-color 0.2s ease-in-out",
361
- boxShadow: "none",
362
- _hover: g,
363
- _active: y,
364
- _focusVisible: b,
365
- _checked: x,
366
- _indeterminate: S,
367
- children: C
368
- }), n[18] = p, n[19] = C, n[20] = w) : w = n[20];
369
- let T;
370
- n[21] !== i || n[22] !== p ? (T = i != null && /* @__PURE__ */ _(r.Label, {
371
- cursor: p,
372
- children: i
373
- }), n[21] = i, n[22] = p, n[23] = T) : T = n[23];
374
- let E;
375
- return n[24] !== d || n[25] !== p || n[26] !== f || n[27] !== s || n[28] !== c || n[29] !== T || n[30] !== m || n[31] !== w ? (E = /* @__PURE__ */ v(r.Root, {
376
- ref: c,
377
- disabled: d,
378
- readOnly: f,
379
- cursor: p,
380
- ...s,
381
- children: [
382
- m,
383
- w,
384
- T
385
- ]
386
- }), n[24] = d, n[25] = p, n[26] = f, n[27] = s, n[28] = c, n[29] = T, n[30] = m, n[31] = w, n[32] = E) : E = n[32], E;
387
- }), oe = (e) => {
388
- let t = h(41), { item: r, multiple: o } = e, s = r.variant === "compact" ? "3" : "3.5", c;
389
- t[0] !== r.isSelected || t[1] !== r.secondaryLabel || t[2] !== r.variant || t[3] !== o ? (c = o ? /* @__PURE__ */ v(i, {
390
- gap: "xs",
391
- children: [r.secondaryLabel, /* @__PURE__ */ _(ae, {
392
- checked: !!r.isSelected,
393
- readOnly: !0,
394
- pointerEvents: "none",
395
- size: r.variant === "compact" ? "xs" : "sm",
396
- inputProps: {
397
- tabIndex: -1,
398
- "aria-hidden": !0
399
- }
400
- })]
401
- }) : void 0, t[0] = r.isSelected, t[1] = r.secondaryLabel, t[2] = r.variant, t[3] = o, t[4] = c) : c = t[4];
402
- let u = c;
403
- if (!o && r.isSelected) {
404
- let e;
405
- t[5] === Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ _(a, {
406
- as: E,
407
- boxSize: "3.5"
408
- }), t[5] = e) : e = t[5], u = e;
409
- }
410
- let d, p, m;
411
- t[6] === Symbol.for("react.memo_cache_sentinel") ? (d = { bg: "transparent" }, p = { bg: "transparent" }, m = { bg: "transparent" }, t[6] = d, t[7] = p, t[8] = m) : (d = t[6], p = t[7], m = t[8]);
412
- let g = r.variant ?? "full-width", y = o ? void 0 : r.secondaryLabel, b = !o && r.isSelected, x;
413
- t[9] !== s || t[10] !== r.icon || t[11] !== r.iconColor || t[12] !== r.label || t[13] !== o ? (x = o ? /* @__PURE__ */ v(i, {
414
- minW: "0",
415
- gap: "xs",
416
- children: [r.icon ? /* @__PURE__ */ _(a, {
417
- as: r.icon,
418
- boxSize: s,
419
- color: r.iconColor ?? "fg.muted"
420
- }) : null, /* @__PURE__ */ _(f, {
421
- textStyle: "label/S/regular",
422
- truncate: !0,
423
- children: r.label
424
- })]
425
- }) : r.label, t[9] = s, t[10] = r.icon, t[11] = r.iconColor, t[12] = r.label, t[13] = o, t[14] = x) : x = t[14];
426
- let S;
427
- t[15] !== s || t[16] !== r.icon || t[17] !== r.iconColor || t[18] !== o ? (S = !o && r.icon ? /* @__PURE__ */ _(a, {
428
- as: r.icon,
429
- boxSize: s,
430
- color: r.iconColor ?? "fg.muted"
431
- }) : void 0, t[15] = s, t[16] = r.icon, t[17] = r.iconColor, t[18] = o, t[19] = S) : S = t[19];
432
- let C;
433
- t[20] !== u || t[21] !== r.id || t[22] !== r.isDisabled || t[23] !== r.tooltipLabel || t[24] !== g || t[25] !== y || t[26] !== b || t[27] !== x || t[28] !== S ? (C = /* @__PURE__ */ _(n, {
434
- bg: "transparent",
435
- h: "auto",
436
- p: "0",
437
- _hover: d,
438
- _focus: p,
439
- _active: m,
440
- children: /* @__PURE__ */ _(G, {
441
- asChild: !0,
442
- id: r.id,
443
- role: "presentation",
444
- variant: g,
445
- disabled: r.isDisabled,
446
- tooltip: r.tooltipLabel,
447
- description: y,
448
- isSelected: b,
449
- label: x,
450
- icon: S,
451
- endContent: u
452
- })
453
- }), t[20] = u, t[21] = r.id, t[22] = r.isDisabled, t[23] = r.tooltipLabel, t[24] = g, t[25] = y, t[26] = b, t[27] = x, t[28] = S, t[29] = C) : C = t[29];
454
- let w = C;
455
- if (o) {
456
- let e = r.id, n = !!r.isSelected, i;
457
- return t[30] !== w || t[31] !== r.id || t[32] !== r.isDisabled || t[33] !== r.onSelect || t[34] !== n ? (i = /* @__PURE__ */ _(l.CheckboxItem, {
458
- value: e,
459
- checked: n,
460
- disabled: r.isDisabled,
461
- onCheckedChange: r.onSelect,
462
- asChild: !0,
463
- children: w
464
- }), t[30] = w, t[31] = r.id, t[32] = r.isDisabled, t[33] = r.onSelect, t[34] = n, t[35] = i) : i = t[35], i;
465
- }
466
- let T;
467
- return t[36] !== w || t[37] !== r.id || t[38] !== r.isDisabled || t[39] !== r.onSelect ? (T = /* @__PURE__ */ _(l.Item, {
468
- value: r.id,
469
- disabled: r.isDisabled,
470
- onClick: r.onSelect,
471
- asChild: !0,
472
- children: w
473
- }), t[36] = w, t[37] = r.id, t[38] = r.isDisabled, t[39] = r.onSelect, t[40] = T) : T = t[40], T;
474
- }, se = (e, t) => {
475
- let n = t.trim().toLowerCase();
476
- return n ? e.filter((e) => [e.label, e.searchText].filter(Boolean).join(" ").toLowerCase().includes(n)) : e;
477
- }, ce = (e, t) => !e || !t ? !1 : e !== t, le = (e, t, n) => !e || !t ? n : {
478
- items: t.items,
479
- filterItems: t.filterItems ?? n.filterItems,
480
- showSearch: t.showSearch ?? n.showSearch,
481
- searchPlaceholder: t.searchPlaceholder ?? n.searchPlaceholder,
482
- emptyState: t.emptyState ?? n.emptyState,
483
- contentTestId: t.contentTestId ?? n.contentTestId,
484
- closeOnSelect: !1,
485
- listId: "parent"
486
- }, L = (e) => {
487
- let n = h(46), { trigger: r, items: i, searchPlaceholder: o, emptyState: s, filterItems: c, listId: d, header: f, width: p, maxListHeight: m, showSearch: g, closeOnSelect: y, lazyMount: b, open: x, positioning: C, onOpenChange: E, onFocusOutside: O, contentTestId: k, portalled: A, parentList: j, multiple: M } = e, N = c === void 0 ? se : c, P = p === void 0 ? "260px" : p, F = m === void 0 ? "18rem" : m, ee = g === void 0 || g, te = y === void 0 || y, ne = b !== void 0 && b, I = A === void 0 || A, ae = M !== void 0 && M, L = !!j, [fe, pe] = T(!1), [me, he] = T(""), [ge, R] = T("child"), _e = w(null), ve = x ?? fe, ye = L && ge === "parent", z = le(ye, j, {
488
- items: i,
489
- filterItems: N,
490
- showSearch: ee,
491
- searchPlaceholder: o,
492
- emptyState: s,
493
- contentTestId: k,
494
- closeOnSelect: te,
495
- listId: L ? "child" : d ?? ""
496
- }), be = z.filterItems(z.items, me), B = w(z.listId);
497
- S(() => {
498
- if (!ve) {
499
- B.current = z.listId;
500
- return;
501
- }
502
- ce(B.current, z.listId) && he(""), B.current = z.listId;
503
- }, [ve, z.listId]);
504
- let V;
505
- n[0] !== z.showSearch || n[1] !== ve ? (V = [ve, z.showSearch], n[0] = z.showSearch, n[1] = ve, n[2] = V) : V = n[2], S(() => {
506
- if (!ve || !z.showSearch) return;
507
- let e = setTimeout(() => _e.current?.focus(), 0);
508
- return () => clearTimeout(e);
509
- }, V);
510
- let xe;
511
- n[3] !== L || n[4] !== E || n[5] !== x ? (xe = (e) => {
512
- x === void 0 && pe(e.open), he(""), e.open && L && R("child"), E?.(e);
513
- }, n[3] = L, n[4] = E, n[5] = x, n[6] = xe) : xe = n[6];
514
- let Se = xe, H;
515
- n[7] !== ye || n[8] !== j ? (H = (e) => {
516
- if (!ye || !j) return;
517
- let t = j.items.find((t) => t.id === e.value);
518
- t && (j.onSelect?.(t), R("child"));
519
- }, n[7] = ye, n[8] = j, n[9] = H) : H = n[9];
520
- let Ce = H, U;
521
- n[10] === j ? U = n[11] : (U = j ? /* @__PURE__ */ _(re, {
522
- as: "div",
523
- role: "menuitem",
524
- "aria-label": j.ariaLabel,
525
- "aria-disabled": j.disabled || void 0,
526
- tabIndex: j.disabled ? -1 : 0,
527
- variant: "narrow",
528
- px: "0",
529
- borderBottomWidth: "1px",
530
- borderColor: "border.subtle",
531
- flexShrink: 0,
532
- onPointerDownCapture: ue,
533
- onClickCapture: (e) => {
534
- e.stopPropagation(), !j.disabled && R(de);
535
- },
536
- children: /* @__PURE__ */ _(G, {
537
- asChild: !0,
538
- role: "presentation",
539
- variant: "full-width",
540
- id: "__parent-toggle",
541
- label: j.selectedLabel,
542
- icon: j.selectedIcon ? /* @__PURE__ */ _(a, {
543
- as: j.selectedIcon,
544
- boxSize: "14px"
545
- }) : void 0,
546
- disabled: j.disabled,
547
- endContent: j.disabled ? void 0 : /* @__PURE__ */ _(a, {
548
- as: D,
549
- boxSize: "14px"
550
- })
551
- })
552
- }) : null, n[10] = j, n[11] = U);
553
- let W = j ? U : f, we = !!W && !z.showSearch, Te = z.showSearch ? /* @__PURE__ */ _(ie, {
554
- inputRef: _e,
555
- value: me,
556
- placeholder: z.searchPlaceholder,
557
- onValueChange: he
558
- }) : null, Ee = l, De = l, K;
559
- n[12] === we ? K = n[13] : (K = we ? /* @__PURE__ */ _(l.Separator, { margin: "0" }) : null, n[12] = we, n[13] = K);
560
- let Oe = t, q;
561
- n[14] === Symbol.for("react.memo_cache_sentinel") ? (q = { overscrollBehavior: "contain" }, n[14] = q) : q = n[14];
562
- let J = be.length > 0 ? be.map((e) => /* @__PURE__ */ _(oe, {
563
- item: e,
564
- multiple: ae && !ye
565
- }, e.id)) : z.emptyState, Y;
566
- n[15] !== Oe || n[16] !== z.contentTestId || n[17] !== F || n[18] !== q || n[19] !== J ? (Y = /* @__PURE__ */ _(Oe, {
567
- maxH: F,
568
- "data-testid": z.contentTestId,
569
- viewportProps: q,
570
- p: "0",
571
- gap: "0",
572
- children: J
573
- }), n[15] = Oe, n[16] = z.contentTestId, n[17] = F, n[18] = q, n[19] = J, n[20] = Y) : Y = n[20];
574
- let X;
575
- n[21] !== W || n[22] !== Te || n[23] !== De.Content || n[24] !== K || n[25] !== Y || n[26] !== P ? (X = /* @__PURE__ */ v(De.Content, {
576
- w: P,
577
- bg: "bg",
578
- gap: "0",
579
- p: "0",
580
- children: [
581
- W,
582
- Te,
583
- K,
584
- Y
585
- ]
586
- }), n[21] = W, n[22] = Te, n[23] = De.Content, n[24] = K, n[25] = Y, n[26] = P, n[27] = X) : X = n[27];
587
- let ke;
588
- n[28] !== Ee.Positioner || n[29] !== X ? (ke = /* @__PURE__ */ _(Ee.Positioner, { children: X }), n[28] = Ee.Positioner, n[29] = X, n[30] = ke) : ke = n[30];
589
- let Z = ke, Ae = L ? Ce : void 0, je;
590
- n[31] === r ? je = n[32] : (je = /* @__PURE__ */ _(l.Trigger, {
591
- asChild: !0,
592
- children: r
593
- }), n[31] = r, n[32] = je);
594
- let Me = !I, Ne;
595
- n[33] !== Z || n[34] !== Me ? (Ne = /* @__PURE__ */ _(u, {
596
- disabled: Me,
597
- children: Z
598
- }), n[33] = Z, n[34] = Me, n[35] = Ne) : Ne = n[35];
599
- let Pe;
600
- return n[36] !== z.closeOnSelect || n[37] !== Se || n[38] !== ne || n[39] !== O || n[40] !== x || n[41] !== C || n[42] !== Ae || n[43] !== je || n[44] !== Ne ? (Pe = /* @__PURE__ */ v(l.Root, {
601
- lazyMount: ne,
602
- closeOnSelect: z.closeOnSelect,
603
- open: x,
604
- positioning: C,
605
- onOpenChange: Se,
606
- onFocusOutside: O,
607
- onSelect: Ae,
608
- children: [je, Ne]
609
- }), n[36] = z.closeOnSelect, n[37] = Se, n[38] = ne, n[39] = O, n[40] = x, n[41] = C, n[42] = Ae, n[43] = je, n[44] = Ne, n[45] = Pe) : Pe = n[45], Pe;
610
- };
611
- function ue(e) {
612
- return e.stopPropagation();
613
- }
614
- function de(e) {
615
- return e === "child" ? "parent" : "child";
616
- }
617
- //#endregion
618
- //#region src/components/list-row/searchable-action-menu.tsx
619
- var fe = (e) => {
620
- let t = h(14), { action: n } = e, r;
621
- t[0] === n.menuItems ? r = t[1] : (r = n.menuItems ?? [], t[0] = n.menuItems, t[1] = r);
622
- let i;
623
- t[2] === r ? i = t[3] : (i = r.map(pe), t[2] = r, t[3] = i);
624
- let a = i, s;
625
- t[4] !== n.icon || t[5] !== n.label ? (s = /* @__PURE__ */ _(o, {
626
- variant: "ghost",
627
- size: "2xs",
628
- "aria-label": n.label,
629
- children: n.icon
630
- }), t[4] = n.icon, t[5] = n.label, t[6] = s) : s = t[6];
631
- let c = n.searchPlaceholder ?? "Search...", u = n.emptyMenuLabel ?? "No results found", d;
632
- t[7] === u ? d = t[8] : (d = /* @__PURE__ */ _(l.Item, {
633
- value: "empty",
634
- asChild: !0,
635
- children: /* @__PURE__ */ _(G, {
636
- asChild: !0,
637
- variant: "full-width",
638
- label: u,
639
- disabled: !0
640
- })
641
- }), t[7] = u, t[8] = d);
642
- let f;
643
- return t[9] !== a || t[10] !== s || t[11] !== c || t[12] !== d ? (f = /* @__PURE__ */ _(L, {
644
- trigger: s,
645
- items: a,
646
- searchPlaceholder: c,
647
- emptyState: d,
648
- onFocusOutside: me
649
- }), t[9] = a, t[10] = s, t[11] = c, t[12] = d, t[13] = f) : f = t[13], f;
650
- };
651
- function pe(e) {
652
- return {
653
- id: e.id,
654
- label: e.label,
655
- searchText: [e.label, e.description].filter(Boolean).join(" "),
656
- tooltipLabel: e.description,
657
- variant: "full-width",
658
- onSelect: () => e.onAction?.()
659
- };
660
- }
661
- function me(e) {
662
- return e.preventDefault();
663
- }
664
- //#endregion
665
- //#region src/components/list-row/list-row-actions.tsx
666
- var he = (t, n) => t.tooltip ? /* @__PURE__ */ _(e, {
667
- content: t.tooltip,
668
- openDelay: 300,
669
- children: n
670
- }, t.id) : /* @__PURE__ */ _(b, { children: n }, t.id), ge = (e) => {
671
- let t = h(11), { actions: n, alwaysVisible: r, context: a } = e, s = r !== void 0 && r;
672
- if (n.length === 0) return null;
673
- let c = s ? "1" : "0", d = s ? "auto" : "none", f, p;
674
- t[0] === Symbol.for("react.memo_cache_sentinel") ? (f = {
675
- opacity: "1",
676
- pointerEvents: "auto"
677
- }, p = {
678
- opacity: "1",
679
- pointerEvents: "auto"
680
- }, t[0] = f, t[1] = p) : (f = t[0], p = t[1]);
681
- let m;
682
- if (t[2] !== n || t[3] !== a) {
683
- let e;
684
- t[5] === a ? e = t[6] : (e = (e) => e.menuItems && e.menuItems.length >= 8 ? /* @__PURE__ */ _(fe, { action: e }, e.id) : e.menuItems && e.menuItems.length > 0 ? he(e, /* @__PURE__ */ v(l.Root, { children: [/* @__PURE__ */ _(l.Trigger, {
685
- asChild: !0,
686
- children: /* @__PURE__ */ _(o, {
687
- variant: "ghost",
688
- size: "2xs",
689
- "aria-label": e.label,
690
- children: e.icon
691
- })
692
- }), /* @__PURE__ */ _(u, { children: /* @__PURE__ */ _(l.Positioner, { children: /* @__PURE__ */ _(l.Content, {
693
- minW: "160px",
694
- bg: "bg",
695
- children: e.menuItems.map(_e)
696
- }) }) })] })) : he(e, /* @__PURE__ */ _(o, {
697
- variant: "ghost",
698
- size: "2xs",
699
- "aria-label": e.label,
700
- onClick: (t) => {
701
- t.stopPropagation(), e.onAction?.(a);
702
- },
703
- children: e.icon
704
- })), t[5] = a, t[6] = e), m = n.map(e), t[2] = n, t[3] = a, t[4] = m;
705
- } else m = t[4];
706
- let g;
707
- return t[7] !== c || t[8] !== d || t[9] !== m ? (g = /* @__PURE__ */ _(i, {
708
- gap: "0",
709
- opacity: c,
710
- pointerEvents: d,
711
- _groupHover: f,
712
- _groupFocusWithin: p,
713
- transition: "opacity 120ms ease",
714
- onClick: R,
715
- children: m
716
- }), t[7] = c, t[8] = d, t[9] = m, t[10] = g) : g = t[10], g;
717
- };
718
- function R(e) {
719
- return e.stopPropagation();
720
- }
721
- function _e(t) {
722
- return /* @__PURE__ */ v(b, { children: [t.separatorBefore ? /* @__PURE__ */ _(l.Separator, {}) : null, /* @__PURE__ */ _(e, {
723
- content: t.description,
724
- disabled: !t.description,
725
- openDelay: 300,
726
- children: /* @__PURE__ */ _(l.Item, {
727
- value: t.id,
728
- disabled: t.disabled || t.readOnly,
729
- onClick: () => {
730
- t.readOnly || t.onAction?.();
731
- },
732
- children: /* @__PURE__ */ v(i, {
733
- gap: "2",
734
- minW: "0",
735
- w: "full",
736
- justify: "space-between",
737
- children: [/* @__PURE__ */ v(i, {
738
- gap: "2",
739
- minW: "0",
740
- children: [t.icon ? /* @__PURE__ */ _(n, { children: t.icon }) : null, /* @__PURE__ */ _(n, {
741
- minW: "0",
742
- children: t.label
743
- })]
744
- }), t.endContent ? /* @__PURE__ */ _(n, {
745
- flexShrink: 0,
746
- children: t.endContent
747
- }) : null]
748
- })
749
- })
750
- })] }, t.id);
751
- }
752
- //#endregion
753
- //#region src/components/list-row/list-row-content.tsx
754
- var ve = (e, t = !1) => {
755
- let n = e.contextMenuItems ?? [];
756
- if (n.length === 0 || !t) return e.actions ?? [];
757
- let r = e.actions?.flatMap((t) => t.menuItems?.length ? t.menuItems : [{
758
- id: t.id,
759
- label: t.label,
760
- icon: t.icon,
761
- onAction: () => t.onAction?.({ nodeId: e.id })
762
- }]) ?? [], i = new Set(r.map((e) => e.id)), o = n.filter((e) => !i.has(e.id)).map((e, t) => ({
763
- ...e,
764
- separatorBefore: e.separatorBefore || t === 0 && r.length > 0
765
- }));
766
- return [{
767
- id: "resource-actions",
768
- label: "Resource actions",
769
- icon: /* @__PURE__ */ _(a, {
770
- as: D,
771
- boxSize: "14px"
772
- }),
773
- menuItems: [...r, ...o]
774
- }];
775
- }, ye = {
776
- collection: "compact",
777
- tree: "1"
778
- }, z = (e) => e.isEmptyStateVariant ? "fg.menu-item.secondary" : e.isDisabled ? "fg.muted" : e.tone === "danger" ? "red.500" : "fg", be = (e) => {
779
- let t = h(7), { label: r, textStyle: i, color: a } = e;
780
- if (typeof r == "string") {
781
- let e;
782
- return t[0] !== a || t[1] !== r || t[2] !== i ? (e = /* @__PURE__ */ _(f, {
783
- textStyle: i,
784
- color: a,
785
- truncate: !0,
786
- children: r
787
- }), t[0] = a, t[1] = r, t[2] = i, t[3] = e) : e = t[3], e;
788
- }
789
- let o;
790
- return t[4] !== a || t[5] !== r ? (o = /* @__PURE__ */ _(n, {
791
- minW: "0",
792
- maxW: "full",
793
- overflow: "hidden",
794
- color: a,
795
- children: r
796
- }), t[4] = a, t[5] = r, t[6] = o) : o = t[6], o;
797
- }, B = (e) => {
798
- let t = h(8), { description: r, textStyle: i, color: a, marginLeft: o } = e;
799
- if (!r) return null;
800
- if (typeof r == "string") {
801
- let e;
802
- return t[0] !== a || t[1] !== r || t[2] !== o || t[3] !== i ? (e = /* @__PURE__ */ _(f, {
803
- ml: o,
804
- textStyle: i,
805
- color: a,
806
- truncate: !0,
807
- children: r
808
- }), t[0] = a, t[1] = r, t[2] = o, t[3] = i, t[4] = e) : e = t[4], e;
809
- }
810
- let s;
811
- return t[5] !== r || t[6] !== o ? (s = /* @__PURE__ */ _(n, {
812
- ml: o,
813
- minW: "0",
814
- maxW: "full",
815
- overflow: "hidden",
816
- children: r
817
- }), t[5] = r, t[6] = o, t[7] = s) : s = t[7], s;
818
- }, V = (t) => {
819
- let r = h(34), { item: o, isExpanded: s, showChevron: c, isDisabled: l, variant: u, tone: f, labelId: p } = t, m = u === "empty-state", g = u === "compact" || u === "collection" || u === "full-width" || u === "tree" || m, y = g ? "label/S/regular" : "label/M/regular", b = g ? "label/XS" : "label/S/regular", x = g ? "0" : "2px", S = u === "tree" || u === "collection" ? "16px" : "14px", C = ye[u ?? ""] ?? "2", w;
820
- r[0] !== l || r[1] !== m || r[2] !== f ? (w = z({
821
- isEmptyStateVariant: m,
822
- isDisabled: l,
823
- tone: f
824
- }), r[0] = l, r[1] = m, r[2] = f, r[3] = w) : w = r[3];
825
- let T = w, E = o.iconColor ?? (f === "danger" ? "red.500" : "fg.muted"), D = f === "danger" ? "red.400" : "fg.menu-item.secondary", k;
826
- r[4] !== s || r[5] !== c ? (k = c ? /* @__PURE__ */ _(n, {
827
- color: "fg.muted",
828
- flexShrink: 0,
829
- display: "flex",
830
- alignItems: "center",
831
- children: /* @__PURE__ */ _(a, {
832
- as: O,
833
- boxSize: "12px",
834
- transform: s ? "rotate(90deg)" : "rotate(0deg)",
835
- transition: "transform 120ms ease"
836
- })
837
- }) : null, r[4] = s, r[5] = c, r[6] = k) : k = r[6];
838
- let A;
839
- r[7] !== E || r[8] !== S || r[9] !== o.icon ? (A = o.icon ? /* @__PURE__ */ _(n, {
840
- color: E,
841
- flexShrink: 0,
842
- display: "inline-flex",
843
- alignItems: "center",
844
- justifyContent: "center",
845
- boxSize: S,
846
- fontSize: S,
847
- lineHeight: "1",
848
- css: { "& > svg": {
849
- width: S,
850
- height: S
851
- } },
852
- children: o.icon
853
- }) : null, r[7] = E, r[8] = S, r[9] = o.icon, r[10] = A) : A = r[10];
854
- let j;
855
- r[11] === o.indicator ? j = r[12] : (j = o.indicator ? /* @__PURE__ */ _(e, {
856
- content: o.indicator.tooltip,
857
- disabled: !o.indicator.tooltip,
858
- openDelay: 300,
859
- children: /* @__PURE__ */ _(n, {
860
- color: o.indicator.color ?? "fg.muted",
861
- flexShrink: 0,
862
- children: o.indicator.icon
863
- })
864
- }) : null, r[11] = o.indicator, r[12] = j);
865
- let M;
866
- r[13] !== o.label || r[14] !== T || r[15] !== y ? (M = /* @__PURE__ */ _(be, {
867
- label: o.label,
868
- textStyle: y,
869
- color: T
870
- }), r[13] = o.label, r[14] = T, r[15] = y, r[16] = M) : M = r[16];
871
- let N;
872
- r[17] !== C || r[18] !== A || r[19] !== j || r[20] !== M ? (N = /* @__PURE__ */ v(i, {
873
- gap: C,
874
- minW: "0",
875
- alignItems: "center",
876
- children: [
877
- A,
878
- j,
879
- M
880
- ]
881
- }), r[17] = C, r[18] = A, r[19] = j, r[20] = M, r[21] = N) : N = r[21];
882
- let P;
883
- r[22] !== D || r[23] !== x || r[24] !== b || r[25] !== o.description ? (P = /* @__PURE__ */ _(B, {
884
- description: o.description,
885
- textStyle: b,
886
- color: D,
887
- marginLeft: x
888
- }), r[22] = D, r[23] = x, r[24] = b, r[25] = o.description, r[26] = P) : P = r[26];
889
- let F;
890
- r[27] !== N || r[28] !== P ? (F = /* @__PURE__ */ v(d, {
891
- gap: "0",
892
- minW: "0",
893
- flex: "1",
894
- children: [N, P]
895
- }), r[27] = N, r[28] = P, r[29] = F) : F = r[29];
896
- let ee;
897
- return r[30] !== p || r[31] !== k || r[32] !== F ? (ee = /* @__PURE__ */ v(i, {
898
- id: p,
899
- gap: "2",
900
- minW: "0",
901
- flex: "1",
902
- overflow: "hidden",
903
- alignItems: "center",
904
- children: [k, F]
905
- }), r[30] = p, r[31] = k, r[32] = F, r[33] = ee) : ee = r[33], ee;
906
- }, xe = (e) => {
907
- let t = h(23), { labelId: r, item: i, isDisabled: a, isExpanded: o, showChevron: s, tone: c, variant: l, showContextMenuTrigger: u } = e, d = c === void 0 ? "default" : c, f = l === void 0 ? "default" : l, p;
908
- t[0] !== i || t[1] !== u ? (p = ve(i, u), t[0] = i, t[1] = u, t[2] = p) : p = t[2];
909
- let m = p, y;
910
- t[3] !== a || t[4] !== o || t[5] !== i || t[6] !== r || t[7] !== s || t[8] !== d || t[9] !== f ? (y = /* @__PURE__ */ _(V, {
911
- labelId: r,
912
- item: i,
913
- isExpanded: o,
914
- showChevron: s,
915
- isDisabled: a,
916
- tone: d,
917
- variant: f
918
- }), t[3] = a, t[4] = o, t[5] = i, t[6] = r, t[7] = s, t[8] = d, t[9] = f, t[10] = y) : y = t[10];
919
- let b;
920
- t[11] !== i.endContent || t[12] !== r ? (b = i.endContent ? /* @__PURE__ */ _(n, {
921
- id: `${r}-end`,
922
- flexShrink: 0,
923
- color: "fg.muted",
924
- display: "flex",
925
- alignItems: "center",
926
- children: i.endContent
927
- }) : null, t[11] = i.endContent, t[12] = r, t[13] = b) : b = t[13];
928
- let x;
929
- t[14] !== m || t[15] !== i.contextMenuItems?.length || t[16] !== i.id || t[17] !== u ? (x = m.length > 0 ? /* @__PURE__ */ _(ge, {
930
- actions: m,
931
- context: { nodeId: i.id },
932
- alwaysVisible: u && (i.contextMenuItems?.length ?? 0) > 0
933
- }) : null, t[14] = m, t[15] = i.contextMenuItems?.length, t[16] = i.id, t[17] = u, t[18] = x) : x = t[18];
934
- let S;
935
- return t[19] !== y || t[20] !== b || t[21] !== x ? (S = /* @__PURE__ */ v(g, { children: [
936
- y,
937
- b,
938
- x
939
- ] }), t[19] = y, t[20] = b, t[21] = x, t[22] = S) : S = t[22], S;
940
- }, Se = (e) => {
941
- if (!(e <= 0)) return `calc(var(--chakra-spacing-1) + ${e} * 12px)`;
942
- }, H = (e) => e === "compact" || e === "full-width" || e === "empty-state", Ce = (e, t) => e === "collection" && !t ? {
943
- rowHeight: "collection-row",
944
- minHeight: void 0
945
- } : H(e) && !t ? {
946
- rowHeight: "1.75rem",
947
- minHeight: void 0
948
- } : {
949
- rowHeight: "auto",
950
- minHeight: e === "default" ? "2.25rem" : "1.75rem"
951
- }, U = (e) => ({
952
- bg: e.isSelected ? e.selectedBg : "transparent",
953
- _hover: e.variant === "empty-state" ? { bg: "transparent" } : e.isSelected ? { bg: e.selectedBg } : e.tone === "danger" ? {
954
- outline: "1px solid",
955
- outlineColor: "red.500",
956
- outlineOffset: "-1px"
957
- } : { bg: e.hoverBg },
958
- _active: e.variant === "empty-state" ? { bg: "transparent" } : { bg: e.selectedBg }
959
- }), W = (e, t) => t ? `${e} ${e}-end` : e, we = (e) => {
960
- let t = e.isDisabled ? "not-allowed" : "pointer";
961
- return {
962
- "aria-labelledby": e.rootProps["aria-label"] ? void 0 : W(e.labelId, e.hasEndContent),
963
- ...e.rootProps,
964
- role: e.rowRole,
965
- "aria-selected": e.rootProps["aria-selected"] ?? (e.rowRole === "option" ? e.isSelected : void 0),
966
- "aria-expanded": e.showChevron ? e.isExpanded : void 0,
967
- className: e.className ? `group ${e.className}` : "group",
968
- width: "full",
969
- minWidth: "0",
970
- maxWidth: "full",
971
- height: e.rowHeight,
972
- minHeight: e.minHeight,
973
- display: "flex",
974
- alignItems: "center",
975
- justifyContent: "space-between",
976
- gap: "xs",
977
- px: "sm",
978
- py: e.verticalPadding,
979
- pl: e.paddingLeft,
980
- borderRadius: e.variant === "full-width" || e.variant === "collection" ? "0" : "xs",
981
- ...U({ ...e }),
982
- cursor: e.variant === "empty-state" ? "default" : t,
983
- overflow: "hidden",
984
- textAlign: "left",
985
- color: "inherit",
986
- textDecoration: "none"
987
- };
988
- }, G = x((e, t) => {
989
- let n = h(108), { id: r, label: i, description: a, icon: o, iconColor: s, indicator: c, endContent: l, tooltip: u, disabled: d, isContainer: f, isNavigable: m, href: g, navigationIntent: v, menuItems: y, menuPlacement: b, contextMenuItems: x, actions: S, children: w, onActivate: E, depth: D, isSelected: O, isExpanded: k, showExpandToggle: A, showContextMenuTrigger: j, variant: M, tone: N, selectedBg: P, hoverBg: F, asChild: ee, className: ne, role: re, onToggleExpand: ie, onPointerMove: I, draggable: ae, onDragStart: oe, onDragOver: se, onDragEnd: ce, onDrop: le, onClick: L, onKeyDown: ue, ...de } = e, fe = D === void 0 ? 0 : D, pe = O !== void 0 && O, me = k !== void 0 && k, he = A !== void 0 && A, ge = j !== void 0 && j, R = M === void 0 ? "default" : M, _e = N === void 0 ? "default" : N, ve = P === void 0 ? "bg.active" : P, ye = F === void 0 ? "bg.hover" : F, z = ee !== void 0 && ee, [be, B] = T(!1), V = C(), H;
990
- n[0] !== S || n[1] !== w || n[2] !== x || n[3] !== a || n[4] !== d || n[5] !== l || n[6] !== g || n[7] !== o || n[8] !== s || n[9] !== r || n[10] !== c || n[11] !== f || n[12] !== m || n[13] !== i || n[14] !== y || n[15] !== b || n[16] !== v || n[17] !== E || n[18] !== u ? (H = {
991
- id: r,
992
- label: i,
993
- description: a,
994
- icon: o,
995
- iconColor: s,
996
- indicator: c,
997
- endContent: l,
998
- tooltip: u,
999
- disabled: d,
1000
- isContainer: f,
1001
- isNavigable: m,
1002
- href: g,
1003
- navigationIntent: v,
1004
- menuItems: y,
1005
- menuPlacement: b,
1006
- contextMenuItems: x,
1007
- actions: S,
1008
- children: w,
1009
- onActivate: E
1010
- }, n[0] = S, n[1] = w, n[2] = x, n[3] = a, n[4] = d, n[5] = l, n[6] = g, n[7] = o, n[8] = s, n[9] = r, n[10] = c, n[11] = f, n[12] = m, n[13] = i, n[14] = y, n[15] = b, n[16] = v, n[17] = E, n[18] = u, n[19] = H) : H = n[19];
1011
- let U = H, W;
1012
- n[20] !== ae || n[21] !== ce || n[22] !== se || n[23] !== oe || n[24] !== le ? (W = {
1013
- draggable: ae,
1014
- onDragStart: oe,
1015
- onDragOver: se,
1016
- onDragEnd: ce,
1017
- onDrop: le
1018
- }, n[20] = ae, n[21] = ce, n[22] = se, n[23] = oe, n[24] = le, n[25] = W) : W = n[25];
1019
- let G = W, De = (U.children?.length ?? 0) > 0 || U.isContainer === !0, K = (U.menuItems?.length ?? 0) > 0, Oe = (U.actions?.length ?? 0) > 0 || (U.contextMenuItems?.length ?? 0) > 0, q = he && De, J = U.disabled === !0, Y;
1020
- n[26] !== K || n[27] !== J || n[28] !== E || n[29] !== ie || n[30] !== q ? (Y = () => {
1021
- if (!J && !K) {
1022
- if (q) {
1023
- ie?.();
1024
- return;
1025
- }
1026
- E?.();
1027
- }
1028
- }, n[26] = K, n[27] = J, n[28] = E, n[29] = ie, n[30] = q, n[31] = Y) : Y = n[31];
1029
- let X = Y, ke;
1030
- n[32] !== X || n[33] !== J || n[34] !== L ? (ke = (e) => {
1031
- if (L?.(e), !e.defaultPrevented) {
1032
- if (J) {
1033
- e.preventDefault();
1034
- return;
1035
- }
1036
- X();
1037
- }
1038
- }, n[32] = X, n[33] = J, n[34] = L, n[35] = ke) : ke = n[35];
1039
- let Z = ke, Ae;
1040
- n[36] !== J || n[37] !== L || n[38] !== B ? (Ae = (e) => {
1041
- if (L?.(e), !e.defaultPrevented) {
1042
- if (J) {
1043
- e.preventDefault();
1044
- return;
1045
- }
1046
- B(Te);
1047
- }
1048
- }, n[36] = J, n[37] = L, n[38] = B, n[39] = Ae) : Ae = n[39];
1049
- let je = Ae, Me;
1050
- n[40] !== X || n[41] !== K || n[42] !== J || n[43] !== ue || n[44] !== B ? (Me = (e) => {
1051
- if (ue?.(e), !e.defaultPrevented && (e.key === "Enter" || e.key === " ") && (e.preventDefault(), !J)) {
1052
- if (K) {
1053
- B(Ee);
1054
- return;
1055
- }
1056
- X();
1057
- }
1058
- }, n[40] = X, n[41] = K, n[42] = J, n[43] = ue, n[44] = B, n[45] = Me) : Me = n[45];
1059
- let Ne = Me, Pe = U.description !== void 0, Fe = Se(fe), Ie = R === "default" || Pe ? "xs" : "2xs", Le;
1060
- n[46] !== Z || n[47] !== je || n[48] !== K ? (Le = K ? { onClick: je } : { onClick: Z }, n[46] = Z, n[47] = je, n[48] = K, n[49] = Le) : Le = n[49];
1061
- let Re = Le, { rowHeight: ze, minHeight: Be } = Ce(R, Pe), Ve = re ?? (K ? "button" : "option"), He = we({
1062
- rootProps: de,
1063
- labelId: V,
1064
- hasEndContent: !!U.endContent,
1065
- rowRole: Ve,
1066
- className: ne,
1067
- isSelected: pe,
1068
- isExpanded: me,
1069
- showChevron: q,
1070
- rowHeight: ze,
1071
- minHeight: Be,
1072
- verticalPadding: Ie,
1073
- paddingLeft: Fe,
1074
- selectedBg: ve,
1075
- hoverBg: ye,
1076
- tone: _e,
1077
- isDisabled: J,
1078
- variant: R
1079
- }), Ue;
1080
- n[50] !== J || n[51] !== me || n[52] !== U || n[53] !== V || n[54] !== q || n[55] !== ge || n[56] !== _e || n[57] !== R ? (Ue = /* @__PURE__ */ _(xe, {
1081
- labelId: V,
1082
- item: U,
1083
- isExpanded: me,
1084
- showChevron: q,
1085
- isDisabled: J,
1086
- tone: _e,
1087
- variant: R,
1088
- showContextMenuTrigger: ge
1089
- }), n[50] = J, n[51] = me, n[52] = U, n[53] = V, n[54] = q, n[55] = ge, n[56] = _e, n[57] = R, n[58] = Ue) : Ue = n[58];
1090
- let Q = Ue, We;
1091
- n[59] !== U || n[60] !== be || n[61] !== B ? (We = (e) => /* @__PURE__ */ _(te, {
1092
- item: U,
1093
- menuOpen: be,
1094
- onMenuOpenChange: B,
1095
- onMenuSelect: (e) => {
1096
- B(!1), e.onAction?.();
1097
- },
1098
- children: e
1099
- }), n[59] = U, n[60] = be, n[61] = B, n[62] = We) : We = n[62];
1100
- let $ = We;
1101
- if (z) {
1102
- let e;
1103
- n[63] !== Re || n[64] !== Q || n[65] !== G || n[66] !== I || n[67] !== t || n[68] !== He ? (e = /* @__PURE__ */ _(p.div, {
1104
- ref: t,
1105
- ...He,
1106
- ...G,
1107
- ...Re,
1108
- onPointerMove: I,
1109
- children: Q
1110
- }), n[63] = Re, n[64] = Q, n[65] = G, n[66] = I, n[67] = t, n[68] = He, n[69] = e) : e = n[69];
1111
- let r;
1112
- return n[70] !== e || n[71] !== $ ? (r = $(e), n[70] = e, n[71] = $, n[72] = r) : r = n[72], r;
1113
- }
1114
- if (U.href && !q && !J && !K) {
1115
- let e = He, r;
1116
- n[73] !== Q || n[74] !== G || n[75] !== Z || n[76] !== U.href || n[77] !== I || n[78] !== t || n[79] !== e ? (r = /* @__PURE__ */ _(p.a, {
1117
- ref: t,
1118
- href: U.href,
1119
- ...e,
1120
- ...G,
1121
- onClick: Z,
1122
- onPointerMove: I,
1123
- children: Q
1124
- }), n[73] = Q, n[74] = G, n[75] = Z, n[76] = U.href, n[77] = I, n[78] = t, n[79] = e, n[80] = r) : r = n[80];
1125
- let i;
1126
- return n[81] !== r || n[82] !== $ ? (i = $(r), n[81] = r, n[82] = $, n[83] = i) : i = n[83], i;
1127
- }
1128
- if (Oe) {
1129
- let e = J || void 0, r = de.tabIndex ?? 0, i;
1130
- n[84] !== Re || n[85] !== Q || n[86] !== G || n[87] !== Ne || n[88] !== I || n[89] !== t || n[90] !== He || n[91] !== e || n[92] !== r ? (i = /* @__PURE__ */ _(p.div, {
1131
- ref: t,
1132
- "aria-disabled": e,
1133
- ...He,
1134
- ...G,
1135
- ...Re,
1136
- tabIndex: r,
1137
- onKeyDown: Ne,
1138
- onPointerMove: I,
1139
- children: Q
1140
- }), n[84] = Re, n[85] = Q, n[86] = G, n[87] = Ne, n[88] = I, n[89] = t, n[90] = He, n[91] = e, n[92] = r, n[93] = i) : i = n[93];
1141
- let a;
1142
- return n[94] !== i || n[95] !== $ ? (a = $(i), n[94] = i, n[95] = $, n[96] = a) : a = n[96], a;
1143
- }
1144
- let Ge = He, Ke;
1145
- n[97] !== Re || n[98] !== Q || n[99] !== G || n[100] !== J || n[101] !== I || n[102] !== t || n[103] !== Ge ? (Ke = /* @__PURE__ */ _(p.button, {
1146
- ref: t,
1147
- type: "button",
1148
- disabled: J,
1149
- ...Ge,
1150
- ...G,
1151
- ...Re,
1152
- onPointerMove: I,
1153
- children: Q
1154
- }), n[97] = Re, n[98] = Q, n[99] = G, n[100] = J, n[101] = I, n[102] = t, n[103] = Ge, n[104] = Ke) : Ke = n[104];
1155
- let qe;
1156
- return n[105] !== Ke || n[106] !== $ ? (qe = $(Ke), n[105] = Ke, n[106] = $, n[107] = qe) : qe = n[107], qe;
1157
- });
1158
- function Te(e) {
1159
- return !e;
1160
- }
1161
- function Ee(e) {
1162
- return !e;
1163
- }
1164
- //#endregion
1165
- export { ae as a, j as c, se as i, M as l, fe as n, ie as o, L as r, re as s, G as t };
1166
-
1167
- //# sourceMappingURL=list-row-DM0DiIrN.js.map