@pstdio/ui 0.21.0 → 0.22.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.
- package/dist/{MermaidComponent-BVMyKttu.js → MermaidComponent-D92GMhht.js} +3 -3
- package/dist/{MermaidComponent-BVMyKttu.js.map → MermaidComponent-D92GMhht.js.map} +1 -1
- package/dist/chat-ui.d.ts +2 -0
- package/dist/chat-ui.js +2 -2
- package/dist/components/data-table/build-columns.d.ts +1 -0
- package/dist/components/data-table/data-table-column-menu.d.ts +2 -0
- package/dist/components/data-table/data-table-row-display.d.ts +11 -0
- package/dist/components/data-table/data-table-table-parts.d.ts +1 -0
- package/dist/components/data-table/edit-mode-data-table-body.d.ts +1 -0
- package/dist/components/data-table/edit-mode-data-table-cell.d.ts +1 -0
- package/dist/components/data-table/edit-mode-data-table-header.d.ts +1 -0
- package/dist/components/diff-viewer/code-editor.d.ts +8 -2
- package/dist/components/kanban-renderer/collection-badge.d.ts +7 -0
- package/dist/components/kanban-renderer/index.d.ts +1 -1
- package/dist/components/kanban-renderer/kanban-renderer-helpers.d.ts +2 -1
- package/dist/components/kanban-renderer/types.d.ts +20 -1
- package/dist/components/list-row/list-row-content.d.ts +1 -0
- package/dist/components/param-editor/param-editor-presentation.d.ts +1 -1
- package/dist/components/param-editor/param-editor.types.d.ts +5 -193
- package/dist/components/rich-text/shared/markdown-ast.d.ts +1 -0
- package/dist/components/rich-text/shared/markdown-source-document.d.ts +7 -0
- package/dist/components/rich-text/shared/markdown-source-links.d.ts +11 -0
- package/dist/components/rich-text/shared/markdown-source-map.d.ts +10 -0
- package/dist/components/rich-text/utils/inferResourceType.d.ts +1 -1
- package/dist/components/tag-editor/tag-editor-row.d.ts +1 -1
- package/dist/components/tag-editor/tag-editor.types.d.ts +12 -0
- package/dist/components/tag-editor/tag-settings-panel.d.ts +1 -1
- package/dist/components/tree-list/tree-list-drag-provider.d.ts +13 -0
- package/dist/components/tree-list/tree-list-order.store.d.ts +4 -1
- package/dist/components/tree-list/tree-list-reorder.d.ts +14 -3
- package/dist/components/tree-list/tree-list-sortable.d.ts +2 -0
- package/dist/components/tree-list/tree-list-visibility-filter.d.ts +2 -2
- package/dist/components/tree-list/tree-list.d.ts +3 -0
- package/dist/components/tree-list/tree-list.types.d.ts +4 -0
- package/dist/data-table.d.ts +2 -0
- package/dist/data-table.js +806 -793
- package/dist/data-table.js.map +1 -1
- package/dist/diff.d.ts +2 -0
- package/dist/diff.js +529 -533
- package/dist/diff.js.map +1 -1
- package/dist/edit-mode-data-table-DGgRuSW3.js +846 -0
- package/dist/edit-mode-data-table-DGgRuSW3.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +1516 -1413
- package/dist/index.js.map +1 -1
- package/dist/{kanban-renderer-toolbar-CpegGbwq.js → kanban-renderer-toolbar-Bl8xXdwU.js} +527 -469
- package/dist/kanban-renderer-toolbar-Bl8xXdwU.js.map +1 -0
- package/dist/kanban-renderer.d.ts +2 -0
- package/dist/kanban-renderer.js +21 -21
- package/dist/kanban-renderer.js.map +1 -1
- package/dist/lazy-markdown-editor-CCOchoJX.js +235 -0
- package/dist/lazy-markdown-editor-CCOchoJX.js.map +1 -0
- package/dist/list-row-DCgdza1i.js +812 -0
- package/dist/list-row-DCgdza1i.js.map +1 -0
- package/dist/markdown-CASvn1Z2.js +1643 -0
- package/dist/markdown-CASvn1Z2.js.map +1 -0
- package/dist/markdown-editor-C4GCyebp.js +1019 -0
- package/dist/markdown-editor-C4GCyebp.js.map +1 -0
- package/dist/{mermaid-renderer-H3IhLqnQ.js → mermaid-renderer-CVnuKs-A.js} +2 -2
- package/dist/{mermaid-renderer-H3IhLqnQ.js.map → mermaid-renderer-CVnuKs-A.js.map} +1 -1
- package/dist/mermaid.d.ts +2 -0
- package/dist/mermaid.js +1 -1
- package/dist/monaco-browser-CgvlArN7.js +21 -0
- package/dist/monaco-browser-CgvlArN7.js.map +1 -0
- package/dist/{param-editor-B8Ff9Nm8.js → param-editor-CkDq623X.js} +2 -2
- package/dist/{param-editor-B8Ff9Nm8.js.map → param-editor-CkDq623X.js.map} +1 -1
- package/dist/param-editor-field-DRgbnL7-.js +2809 -0
- package/dist/param-editor-field-DRgbnL7-.js.map +1 -0
- package/dist/rich-message-DARuDVOX.js +628 -0
- package/dist/{rich-message-DdFYRzTo.js.map → rich-message-DARuDVOX.js.map} +1 -1
- package/dist/rich-text.d.ts +2 -0
- package/dist/rich-text.js +48 -47
- package/dist/rich-text.js.map +1 -1
- package/dist/style.css +1 -1
- package/dist/terminal.d.ts +2 -0
- package/dist/theme/primitives/sizes.d.ts +9 -0
- package/dist/{theme-BH4fSst9.js → theme-B-l5_a6F.js} +69 -50
- package/dist/theme-B-l5_a6F.js.map +1 -0
- package/dist/theme-preference-Bpobguh4.js +114 -0
- package/dist/theme-preference-Bpobguh4.js.map +1 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +1 -1
- package/dist/tree-list-AlO5ZmxQ.js +1262 -0
- package/dist/tree-list-AlO5ZmxQ.js.map +1 -0
- package/dist/utils/theme-preference.d.ts +4 -1
- package/dist/workspace-badge-BR_GgsAG.js +175 -0
- package/dist/workspace-badge-BR_GgsAG.js.map +1 -0
- package/package.json +5 -42
- package/dist/dialog-accept-shortcut-DAEBsoWW.js +0 -7
- package/dist/dialog-accept-shortcut-DAEBsoWW.js.map +0 -1
- package/dist/edit-mode-data-table-D6NeiDJx.js +0 -775
- package/dist/edit-mode-data-table-D6NeiDJx.js.map +0 -1
- package/dist/editor-config-D9OksZ93.js +0 -2416
- package/dist/editor-config-D9OksZ93.js.map +0 -1
- package/dist/kanban-renderer-toolbar-CpegGbwq.js.map +0 -1
- package/dist/lazy-markdown-editor-B7uP2ALS.js +0 -26
- package/dist/lazy-markdown-editor-B7uP2ALS.js.map +0 -1
- package/dist/list-row-9oxy-F0v.js +0 -796
- package/dist/list-row-9oxy-F0v.js.map +0 -1
- package/dist/monaco-browser-CO0NxK_Z.js +0 -19
- package/dist/monaco-browser-CO0NxK_Z.js.map +0 -1
- package/dist/number-input-WUfejtNx.js +0 -343
- package/dist/number-input-WUfejtNx.js.map +0 -1
- package/dist/param-editor-field-Cu4pto_a.js +0 -2845
- package/dist/param-editor-field-Cu4pto_a.js.map +0 -1
- package/dist/rich-message-DdFYRzTo.js +0 -658
- package/dist/theme-BH4fSst9.js.map +0 -1
- package/dist/theme-preference-DyymrYpR.js +0 -123
- package/dist/theme-preference-DyymrYpR.js.map +0 -1
- package/dist/tree-list-uV4UFj0x.js +0 -1116
- package/dist/tree-list-uV4UFj0x.js.map +0 -1
|
@@ -0,0 +1,812 @@
|
|
|
1
|
+
import { jsx as i, jsxs as D, Fragment as Je } from "react/jsx-runtime";
|
|
2
|
+
import { c as L } from "react/compiler-runtime";
|
|
3
|
+
import { Menu as I, useMenu as ct, chakra as De, Portal as Ne, HStack as he, Stack as nt, Text as je, Box as j, Icon as Me, InputGroup as dt, Input as ut, IconButton as Ue } from "@chakra-ui/react";
|
|
4
|
+
import * as ht from "react";
|
|
5
|
+
import { Fragment as Ke, useState as Ve, useRef as Ze, useEffect as et, forwardRef as ft, useId as pt } from "react";
|
|
6
|
+
import { Search as mt, ChevronDown as ot, ChevronRight as gt } from "lucide-react";
|
|
7
|
+
import { T as Qe, S as bt } from "./browser-storage-DPtOQJx0.js";
|
|
8
|
+
const lt = (n) => {
|
|
9
|
+
const e = L(6), {
|
|
10
|
+
actions: t,
|
|
11
|
+
contentBackground: o,
|
|
12
|
+
contentMinWidth: r
|
|
13
|
+
} = n;
|
|
14
|
+
let s;
|
|
15
|
+
e[0] !== t ? (s = t.map(xt), e[0] = t, e[1] = s) : s = e[1];
|
|
16
|
+
let l;
|
|
17
|
+
return e[2] !== o || e[3] !== r || e[4] !== s ? (l = /* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i(I.Positioner, { children: /* @__PURE__ */ i(I.Content, { minW: r, bg: o, children: s }) }) }), e[2] = o, e[3] = r, e[4] = s, e[5] = l) : l = e[5], l;
|
|
18
|
+
}, sn = (n) => {
|
|
19
|
+
const e = L(13), {
|
|
20
|
+
actions: t,
|
|
21
|
+
children: o,
|
|
22
|
+
contentMinWidth: r,
|
|
23
|
+
contentBackground: s,
|
|
24
|
+
positioning: l,
|
|
25
|
+
closeOnSelect: c
|
|
26
|
+
} = n, u = r === void 0 ? "17.5rem" : r, a = s === void 0 ? "bg" : s;
|
|
27
|
+
let d;
|
|
28
|
+
e[0] !== l ? (d = l === void 0 ? {
|
|
29
|
+
placement: "bottom-start"
|
|
30
|
+
} : l, e[0] = l, e[1] = d) : d = e[1];
|
|
31
|
+
const p = d;
|
|
32
|
+
if (t.length === 0)
|
|
33
|
+
return o;
|
|
34
|
+
let g;
|
|
35
|
+
e[2] !== o ? (g = /* @__PURE__ */ i(I.Trigger, { asChild: !0, children: o }), e[2] = o, e[3] = g) : g = e[3];
|
|
36
|
+
let h;
|
|
37
|
+
e[4] !== t || e[5] !== a || e[6] !== u ? (h = /* @__PURE__ */ i(lt, { actions: t, contentMinWidth: u, contentBackground: a }), e[4] = t, e[5] = a, e[6] = u, e[7] = h) : h = e[7];
|
|
38
|
+
let f;
|
|
39
|
+
return e[8] !== c || e[9] !== p || e[10] !== g || e[11] !== h ? (f = /* @__PURE__ */ D(I.Root, { positioning: p, closeOnSelect: c, children: [
|
|
40
|
+
g,
|
|
41
|
+
h
|
|
42
|
+
] }), e[8] = c, e[9] = p, e[10] = g, e[11] = h, e[12] = f) : f = e[12], f;
|
|
43
|
+
}, vt = (n) => {
|
|
44
|
+
const e = L(25), {
|
|
45
|
+
actions: t,
|
|
46
|
+
children: o,
|
|
47
|
+
contentMinWidth: r,
|
|
48
|
+
contentBackground: s,
|
|
49
|
+
positioning: l,
|
|
50
|
+
closeOnSelect: c,
|
|
51
|
+
keepMountedWhenEmpty: u
|
|
52
|
+
} = n, a = r === void 0 ? "17.5rem" : r, d = s === void 0 ? "bg" : s;
|
|
53
|
+
let p;
|
|
54
|
+
e[0] !== l ? (p = l === void 0 ? {
|
|
55
|
+
placement: "bottom-start"
|
|
56
|
+
} : l, e[0] = l, e[1] = p) : p = e[1];
|
|
57
|
+
const g = p, h = u === void 0 ? !1 : u;
|
|
58
|
+
let f;
|
|
59
|
+
e[2] !== c || e[3] !== g ? (f = {
|
|
60
|
+
positioning: g,
|
|
61
|
+
closeOnSelect: c
|
|
62
|
+
}, e[2] = c, e[3] = g, e[4] = f) : f = e[4];
|
|
63
|
+
const x = ct(f);
|
|
64
|
+
let v;
|
|
65
|
+
e[5] !== x.api ? (v = x.api.getContextTriggerProps(), e[5] = x.api, e[6] = v) : v = e[6];
|
|
66
|
+
const m = v;
|
|
67
|
+
if (t.length === 0 && !h) {
|
|
68
|
+
let P;
|
|
69
|
+
return e[7] !== o ? (P = /* @__PURE__ */ i(Je, { children: o }), e[7] = o, e[8] = P) : P = e[8], P;
|
|
70
|
+
}
|
|
71
|
+
let W;
|
|
72
|
+
e[9] !== m ? (W = (P) => {
|
|
73
|
+
P.defaultPrevented || m.onContextMenu?.(P);
|
|
74
|
+
}, e[9] = m, e[10] = W) : W = e[10];
|
|
75
|
+
let $;
|
|
76
|
+
e[11] !== o || e[12] !== W || e[13] !== m ? ($ = /* @__PURE__ */ i(De.div, { asChild: !0, ...m, onContextMenu: W, children: o }), e[11] = o, e[12] = W, e[13] = m, e[14] = $) : $ = e[14];
|
|
77
|
+
let b;
|
|
78
|
+
e[15] !== t || e[16] !== d || e[17] !== a ? (b = t.length > 0 ? /* @__PURE__ */ i(lt, { actions: t, contentMinWidth: a, contentBackground: d }) : null, e[15] = t, e[16] = d, e[17] = a, e[18] = b) : b = e[18];
|
|
79
|
+
let M;
|
|
80
|
+
e[19] !== x || e[20] !== b ? (M = /* @__PURE__ */ i(I.RootProvider, { value: x, lazyMount: !0, unmountOnExit: !0, children: b }), e[19] = x, e[20] = b, e[21] = M) : M = e[21];
|
|
81
|
+
let O;
|
|
82
|
+
return e[22] !== M || e[23] !== $ ? (O = /* @__PURE__ */ D(Je, { children: [
|
|
83
|
+
$,
|
|
84
|
+
M
|
|
85
|
+
] }), e[22] = M, e[23] = $, e[24] = O) : O = e[24], O;
|
|
86
|
+
};
|
|
87
|
+
function xt(n) {
|
|
88
|
+
return /* @__PURE__ */ D(Ke, { children: [
|
|
89
|
+
n.separatorBefore ? /* @__PURE__ */ i(I.Separator, {}) : null,
|
|
90
|
+
/* @__PURE__ */ i(I.Item, { value: n.key, disabled: n.isDisabled, asChild: !0, children: /* @__PURE__ */ i(Fe, { asChild: !0, variant: "full-width", label: n.label, icon: n.icon, endContent: n.endContent, disabled: n.isDisabled, onActivate: n.onClick }) })
|
|
91
|
+
] }, n.key);
|
|
92
|
+
}
|
|
93
|
+
const St = (n) => {
|
|
94
|
+
const e = L(4), {
|
|
95
|
+
item: t
|
|
96
|
+
} = n;
|
|
97
|
+
if (!t.icon)
|
|
98
|
+
return null;
|
|
99
|
+
let o;
|
|
100
|
+
e[0] !== t.icon ? (o = typeof t.icon == "function" ? /* @__PURE__ */ i(Me, { as: t.icon, boxSize: "14px" }) : t.icon, e[0] = t.icon, e[1] = o) : o = e[1];
|
|
101
|
+
let r;
|
|
102
|
+
return e[2] !== o ? (r = /* @__PURE__ */ i(j, { color: "fg.muted", flexShrink: 0, display: "inline-flex", children: o }), e[2] = o, e[3] = r) : r = e[3], r;
|
|
103
|
+
}, Ct = (n) => {
|
|
104
|
+
const e = L(20), {
|
|
105
|
+
children: t,
|
|
106
|
+
items: o,
|
|
107
|
+
onOpenChange: r,
|
|
108
|
+
onSelect: s,
|
|
109
|
+
open: l,
|
|
110
|
+
placement: c
|
|
111
|
+
} = n, u = c === void 0 ? "right-start" : c;
|
|
112
|
+
let a;
|
|
113
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
114
|
+
mainAxis: 4
|
|
115
|
+
}, e[0] = a) : a = e[0];
|
|
116
|
+
let d;
|
|
117
|
+
e[1] !== u ? (d = {
|
|
118
|
+
placement: u,
|
|
119
|
+
offset: a
|
|
120
|
+
}, e[1] = u, e[2] = d) : d = e[2];
|
|
121
|
+
let p;
|
|
122
|
+
e[3] !== r ? (p = (v) => r(v.open), e[3] = r, e[4] = p) : p = e[4];
|
|
123
|
+
let g;
|
|
124
|
+
e[5] !== t ? (g = /* @__PURE__ */ i(I.Trigger, { asChild: !0, children: t }), e[5] = t, e[6] = g) : g = e[6];
|
|
125
|
+
let h;
|
|
126
|
+
if (e[7] !== o || e[8] !== s) {
|
|
127
|
+
let v;
|
|
128
|
+
e[10] !== s ? (v = (m) => /* @__PURE__ */ D(Ke, { children: [
|
|
129
|
+
m.separatorBefore ? /* @__PURE__ */ i(I.Separator, {}) : null,
|
|
130
|
+
/* @__PURE__ */ i(I.Item, { value: m.id, disabled: m.disabled || m.readOnly, _disabled: m.readOnly ? {
|
|
131
|
+
opacity: 1,
|
|
132
|
+
cursor: "default"
|
|
133
|
+
} : void 0, onClick: () => {
|
|
134
|
+
m.readOnly || s(m);
|
|
135
|
+
}, children: /* @__PURE__ */ D(he, { gap: "2", minW: "0", w: "full", justify: "space-between", alignItems: "center", children: [
|
|
136
|
+
/* @__PURE__ */ D(he, { gap: "2", minW: "0", flex: "1", alignItems: m.description ? "flex-start" : "center", children: [
|
|
137
|
+
/* @__PURE__ */ i(St, { item: m }),
|
|
138
|
+
/* @__PURE__ */ D(nt, { gap: "0", minW: "0", children: [
|
|
139
|
+
/* @__PURE__ */ i(je, { textStyle: "label/S/regular", truncate: !0, children: m.label }),
|
|
140
|
+
m.description ? /* @__PURE__ */ i(je, { textStyle: "label/XS", color: "fg.menu-item.secondary", truncate: !0, children: m.description }) : null
|
|
141
|
+
] })
|
|
142
|
+
] }),
|
|
143
|
+
m.endContent ? /* @__PURE__ */ i(j, { flexShrink: 0, children: m.endContent }) : null
|
|
144
|
+
] }) })
|
|
145
|
+
] }, m.id), e[10] = s, e[11] = v) : v = e[11], h = o.map(v), e[7] = o, e[8] = s, e[9] = h;
|
|
146
|
+
} else
|
|
147
|
+
h = e[9];
|
|
148
|
+
let f;
|
|
149
|
+
e[12] !== h ? (f = /* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i(I.Positioner, { children: /* @__PURE__ */ i(I.Content, { minW: "200px", bg: "bg", children: h }) }) }), e[12] = h, e[13] = f) : f = e[13];
|
|
150
|
+
let x;
|
|
151
|
+
return e[14] !== l || e[15] !== d || e[16] !== p || e[17] !== g || e[18] !== f ? (x = /* @__PURE__ */ D(I.Root, { open: l, positioning: d, onOpenChange: p, children: [
|
|
152
|
+
g,
|
|
153
|
+
f
|
|
154
|
+
] }), e[14] = l, e[15] = d, e[16] = p, e[17] = g, e[18] = f, e[19] = x) : x = e[19], x;
|
|
155
|
+
}, It = (n) => n.map((e) => ({
|
|
156
|
+
key: e.id,
|
|
157
|
+
label: e.label,
|
|
158
|
+
icon: typeof e.icon == "function" ? /* @__PURE__ */ i(Me, { as: e.icon, boxSize: "16px" }) : e.icon,
|
|
159
|
+
endContent: e.endContent,
|
|
160
|
+
isDisabled: e.disabled,
|
|
161
|
+
separatorBefore: e.separatorBefore,
|
|
162
|
+
onClick: () => e.onAction?.()
|
|
163
|
+
})), wt = (n) => {
|
|
164
|
+
const e = L(15), {
|
|
165
|
+
children: t,
|
|
166
|
+
item: o,
|
|
167
|
+
menuOpen: r,
|
|
168
|
+
onMenuOpenChange: s,
|
|
169
|
+
onMenuSelect: l
|
|
170
|
+
} = n;
|
|
171
|
+
if (o.menuItems && o.menuItems.length > 0) {
|
|
172
|
+
let p;
|
|
173
|
+
return e[0] !== t || e[1] !== o.menuItems || e[2] !== o.menuPlacement || e[3] !== r || e[4] !== s || e[5] !== l ? (p = /* @__PURE__ */ i(Ct, { items: o.menuItems, open: r, placement: o.menuPlacement, onOpenChange: s, onSelect: l, children: t }), e[0] = t, e[1] = o.menuItems, e[2] = o.menuPlacement, e[3] = r, e[4] = s, e[5] = l, e[6] = p) : p = e[6], p;
|
|
174
|
+
}
|
|
175
|
+
let c;
|
|
176
|
+
e[7] !== t || e[8] !== o.tooltip ? (c = o.tooltip ? /* @__PURE__ */ i(Qe, { content: o.tooltip, children: t }) : t, e[7] = t, e[8] = o.tooltip, e[9] = c) : c = e[9];
|
|
177
|
+
const u = c;
|
|
178
|
+
if (!o.contextMenuItems || o.contextMenuItems.length === 0)
|
|
179
|
+
return u;
|
|
180
|
+
let a;
|
|
181
|
+
e[10] !== o.contextMenuItems ? (a = It(o.contextMenuItems), e[10] = o.contextMenuItems, e[11] = a) : a = e[11];
|
|
182
|
+
let d;
|
|
183
|
+
return e[12] !== u || e[13] !== a ? (d = /* @__PURE__ */ i(vt, { actions: a, children: u }), e[12] = u, e[13] = a, e[14] = d) : d = e[14], d;
|
|
184
|
+
}, yt = {
|
|
185
|
+
main: {
|
|
186
|
+
h: "2.5rem",
|
|
187
|
+
px: "xs"
|
|
188
|
+
},
|
|
189
|
+
narrow: {
|
|
190
|
+
h: "2rem",
|
|
191
|
+
px: "xs"
|
|
192
|
+
},
|
|
193
|
+
input: {
|
|
194
|
+
h: "3rem",
|
|
195
|
+
px: "0"
|
|
196
|
+
}
|
|
197
|
+
}, it = ht.forwardRef(function(e, t) {
|
|
198
|
+
const o = L(9);
|
|
199
|
+
let r, s, l;
|
|
200
|
+
o[0] !== e ? ({
|
|
201
|
+
variant: l,
|
|
202
|
+
children: r,
|
|
203
|
+
...s
|
|
204
|
+
} = e, o[0] = e, o[1] = r, o[2] = s, o[3] = l) : (r = o[1], s = o[2], l = o[3]);
|
|
205
|
+
const u = yt[l === void 0 ? "main" : l];
|
|
206
|
+
let a;
|
|
207
|
+
return o[4] !== r || o[5] !== t || o[6] !== s || o[7] !== u ? (a = /* @__PURE__ */ i(he, { ref: t, as: "header", alignItems: "center", borderWidth: "0", ...u, ...s, children: r }), o[4] = r, o[5] = t, o[6] = s, o[7] = u, o[8] = a) : a = o[8], a;
|
|
208
|
+
}), Mt = (n) => {
|
|
209
|
+
const e = L(8), {
|
|
210
|
+
inputRef: t,
|
|
211
|
+
value: o,
|
|
212
|
+
placeholder: r,
|
|
213
|
+
onValueChange: s
|
|
214
|
+
} = n;
|
|
215
|
+
let l;
|
|
216
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (l = /* @__PURE__ */ i(mt, { size: 14 }), e[0] = l) : l = e[0];
|
|
217
|
+
let c;
|
|
218
|
+
e[1] !== s ? (c = (a) => s(a.target.value), e[1] = s, e[2] = c) : c = e[2];
|
|
219
|
+
let u;
|
|
220
|
+
return e[3] !== t || e[4] !== r || e[5] !== c || e[6] !== o ? (u = /* @__PURE__ */ i(it, { variant: "input", borderBottomWidth: "1px", borderColor: "border.subtle", flexShrink: 0, children: /* @__PURE__ */ i(dt, { startElement: l, width: "full", children: /* @__PURE__ */ i(ut, { ref: t, mx: "xs", variant: "borderless", value: o, placeholder: r, "aria-label": r, autoComplete: "off", onChange: c, onKeyDown: Pt }) }) }), e[3] = t, e[4] = r, e[5] = c, e[6] = o, e[7] = u) : u = e[7], u;
|
|
221
|
+
};
|
|
222
|
+
function Pt(n) {
|
|
223
|
+
return n.stopPropagation();
|
|
224
|
+
}
|
|
225
|
+
const kt = (n, e) => {
|
|
226
|
+
const t = e.trim().toLowerCase();
|
|
227
|
+
return t ? n.filter((o) => [o.label, o.searchText].filter(Boolean).join(" ").toLowerCase().includes(t)) : n;
|
|
228
|
+
}, Rt = (n, e) => !n || !e ? !1 : n !== e, Ot = (n, e, t) => !n || !e ? t : {
|
|
229
|
+
items: e.items,
|
|
230
|
+
filterItems: e.filterItems ?? t.filterItems,
|
|
231
|
+
showSearch: e.showSearch ?? t.showSearch,
|
|
232
|
+
searchPlaceholder: e.searchPlaceholder ?? t.searchPlaceholder,
|
|
233
|
+
emptyState: e.emptyState ?? t.emptyState,
|
|
234
|
+
contentTestId: e.contentTestId ?? t.contentTestId,
|
|
235
|
+
closeOnSelect: !1,
|
|
236
|
+
listId: "parent"
|
|
237
|
+
}, Bt = (n) => {
|
|
238
|
+
const e = L(47), {
|
|
239
|
+
trigger: t,
|
|
240
|
+
items: o,
|
|
241
|
+
searchPlaceholder: r,
|
|
242
|
+
emptyState: s,
|
|
243
|
+
filterItems: l,
|
|
244
|
+
listId: c,
|
|
245
|
+
header: u,
|
|
246
|
+
width: a,
|
|
247
|
+
maxListHeight: d,
|
|
248
|
+
showSearch: p,
|
|
249
|
+
closeOnSelect: g,
|
|
250
|
+
lazyMount: h,
|
|
251
|
+
open: f,
|
|
252
|
+
positioning: x,
|
|
253
|
+
onOpenChange: v,
|
|
254
|
+
onFocusOutside: m,
|
|
255
|
+
contentTestId: W,
|
|
256
|
+
portalled: $,
|
|
257
|
+
parentList: b
|
|
258
|
+
} = n, M = l === void 0 ? kt : l, O = a === void 0 ? "260px" : a, P = d === void 0 ? "18rem" : d, F = p === void 0 ? !0 : p, N = g === void 0 ? !0 : g, A = h === void 0 ? !1 : h, Z = $ === void 0 ? !0 : $, ee = !!b, [$e, Te] = Ve(!1), [Pe, ke] = Ve(""), [Ge, fe] = Ve("child"), H = Ze(null), G = f ?? $e, le = ee && Ge === "parent", w = Ot(le, b, {
|
|
259
|
+
items: o,
|
|
260
|
+
filterItems: M,
|
|
261
|
+
showSearch: F,
|
|
262
|
+
searchPlaceholder: r,
|
|
263
|
+
emptyState: s,
|
|
264
|
+
contentTestId: W,
|
|
265
|
+
closeOnSelect: N,
|
|
266
|
+
listId: ee ? "child" : c ?? ""
|
|
267
|
+
}), be = w.filterItems(w.items, Pe), X = Ze(w.listId);
|
|
268
|
+
et(() => {
|
|
269
|
+
if (!G) {
|
|
270
|
+
X.current = w.listId;
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
Rt(X.current, w.listId) && ke(""), X.current = w.listId;
|
|
274
|
+
}, [G, w.listId]);
|
|
275
|
+
let ie;
|
|
276
|
+
e[0] !== w.showSearch || e[1] !== G ? (ie = [G, w.showSearch], e[0] = w.showSearch, e[1] = G, e[2] = ie) : ie = e[2], et(() => {
|
|
277
|
+
if (!G || !w.showSearch)
|
|
278
|
+
return;
|
|
279
|
+
const C = setTimeout(() => H.current?.focus(), 0);
|
|
280
|
+
return () => clearTimeout(C);
|
|
281
|
+
}, ie);
|
|
282
|
+
let pe;
|
|
283
|
+
e[3] !== ee || e[4] !== v || e[5] !== f ? (pe = (C) => {
|
|
284
|
+
f === void 0 && Te(C.open), ke(""), C.open && ee && fe("child"), v?.(C);
|
|
285
|
+
}, e[3] = ee, e[4] = v, e[5] = f, e[6] = pe) : pe = e[6];
|
|
286
|
+
const Re = pe;
|
|
287
|
+
let ve;
|
|
288
|
+
e[7] !== le || e[8] !== b ? (ve = (C) => {
|
|
289
|
+
if (!le || !b)
|
|
290
|
+
return;
|
|
291
|
+
const He = b.items.find((we) => we.id === C.value);
|
|
292
|
+
He && (b.onSelect?.(He), fe("child"));
|
|
293
|
+
}, e[7] = le, e[8] = b, e[9] = ve) : ve = e[9];
|
|
294
|
+
const xe = ve, Le = Dt;
|
|
295
|
+
let re;
|
|
296
|
+
e[10] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (re = (C) => ({
|
|
297
|
+
id: C.id,
|
|
298
|
+
label: C.label,
|
|
299
|
+
description: C.secondaryLabel,
|
|
300
|
+
icon: Le(C.icon),
|
|
301
|
+
disabled: C.isDisabled,
|
|
302
|
+
tooltip: C.tooltipLabel
|
|
303
|
+
}), e[10] = re) : re = e[10];
|
|
304
|
+
const se = re;
|
|
305
|
+
let te;
|
|
306
|
+
e[11] !== b ? (te = b ? /* @__PURE__ */ i(it, { as: "div", role: "menuitem", "aria-label": b.ariaLabel, "aria-disabled": b.disabled || void 0, tabIndex: b.disabled ? -1 : 0, variant: "narrow", px: "0", borderBottomWidth: "1px", borderColor: "border.subtle", flexShrink: 0, onPointerDownCapture: $t, onClickCapture: (C) => {
|
|
307
|
+
C.stopPropagation(), !b.disabled && fe(Tt);
|
|
308
|
+
}, children: /* @__PURE__ */ i(Fe, { asChild: !0, role: "presentation", variant: "full-width", id: "__parent-toggle", label: b.selectedLabel, icon: Le(b.selectedIcon), disabled: b.disabled, endContent: b.disabled ? void 0 : /* @__PURE__ */ i(Me, { as: ot, boxSize: "14px" }) }) }) : null, e[11] = b, e[12] = te) : te = e[12];
|
|
309
|
+
const Se = b ? te : u, Oe = !!Se && !w.showSearch, me = w.showSearch ? /* @__PURE__ */ i(Mt, { inputRef: H, value: Pe, placeholder: w.searchPlaceholder, onValueChange: ke }) : null, E = I, ae = I, Ce = "bg", k = "0", Ie = "0";
|
|
310
|
+
let R;
|
|
311
|
+
e[13] !== Oe ? (R = Oe ? /* @__PURE__ */ i(I.Separator, { margin: "0" }) : null, e[13] = Oe, e[14] = R) : R = e[14];
|
|
312
|
+
const Be = bt;
|
|
313
|
+
let B;
|
|
314
|
+
e[15] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (B = {
|
|
315
|
+
overscrollBehavior: "contain"
|
|
316
|
+
}, e[15] = B) : B = e[15];
|
|
317
|
+
const Xe = "0", q = "0", y = be.length > 0 ? be.map((C) => /* @__PURE__ */ i(I.Item, { value: C.id, disabled: C.isDisabled, onClick: C.onSelect, asChild: !0, children: /* @__PURE__ */ i(j, { bg: "transparent", h: "auto", p: "0", _hover: {
|
|
318
|
+
bg: "transparent"
|
|
319
|
+
}, _focus: {
|
|
320
|
+
bg: "transparent"
|
|
321
|
+
}, _active: {
|
|
322
|
+
bg: "transparent"
|
|
323
|
+
}, children: /* @__PURE__ */ i(Fe, { asChild: !0, ...se(C), role: "presentation", variant: C.variant ?? "full-width", isSelected: C.isSelected }) }) }, C.id)) : w.emptyState;
|
|
324
|
+
let K;
|
|
325
|
+
e[16] !== Be || e[17] !== w.contentTestId || e[18] !== P || e[19] !== B || e[20] !== y ? (K = /* @__PURE__ */ i(Be, { maxH: P, "data-testid": w.contentTestId, viewportProps: B, p: Xe, gap: q, children: y }), e[16] = Be, e[17] = w.contentTestId, e[18] = P, e[19] = B, e[20] = y, e[21] = K) : K = e[21];
|
|
326
|
+
let z;
|
|
327
|
+
e[22] !== Se || e[23] !== me || e[24] !== ae.Content || e[25] !== R || e[26] !== K || e[27] !== O ? (z = /* @__PURE__ */ D(ae.Content, { w: O, bg: Ce, gap: k, p: Ie, children: [
|
|
328
|
+
Se,
|
|
329
|
+
me,
|
|
330
|
+
R,
|
|
331
|
+
K
|
|
332
|
+
] }), e[22] = Se, e[23] = me, e[24] = ae.Content, e[25] = R, e[26] = K, e[27] = O, e[28] = z) : z = e[28];
|
|
333
|
+
let ne;
|
|
334
|
+
e[29] !== E.Positioner || e[30] !== z ? (ne = /* @__PURE__ */ i(E.Positioner, { children: z }), e[29] = E.Positioner, e[30] = z, e[31] = ne) : ne = e[31];
|
|
335
|
+
const J = ne, ce = ee ? xe : void 0;
|
|
336
|
+
let U;
|
|
337
|
+
e[32] !== t ? (U = /* @__PURE__ */ i(I.Trigger, { asChild: !0, children: t }), e[32] = t, e[33] = U) : U = e[33];
|
|
338
|
+
const de = !Z;
|
|
339
|
+
let Y;
|
|
340
|
+
e[34] !== J || e[35] !== de ? (Y = /* @__PURE__ */ i(Ne, { disabled: de, children: J }), e[34] = J, e[35] = de, e[36] = Y) : Y = e[36];
|
|
341
|
+
let ge;
|
|
342
|
+
return e[37] !== w.closeOnSelect || e[38] !== Re || e[39] !== A || e[40] !== m || e[41] !== f || e[42] !== x || e[43] !== ce || e[44] !== U || e[45] !== Y ? (ge = /* @__PURE__ */ D(I.Root, { lazyMount: A, closeOnSelect: w.closeOnSelect, open: f, positioning: x, onOpenChange: Re, onFocusOutside: m, onSelect: ce, children: [
|
|
343
|
+
U,
|
|
344
|
+
Y
|
|
345
|
+
] }), e[37] = w.closeOnSelect, e[38] = Re, e[39] = A, e[40] = m, e[41] = f, e[42] = x, e[43] = ce, e[44] = U, e[45] = Y, e[46] = ge) : ge = e[46], ge;
|
|
346
|
+
};
|
|
347
|
+
function Dt(n) {
|
|
348
|
+
return n ? /* @__PURE__ */ i(Me, { as: n, boxSize: "14px" }) : void 0;
|
|
349
|
+
}
|
|
350
|
+
function $t(n) {
|
|
351
|
+
return n.stopPropagation();
|
|
352
|
+
}
|
|
353
|
+
function Tt(n) {
|
|
354
|
+
return n === "child" ? "parent" : "child";
|
|
355
|
+
}
|
|
356
|
+
const Wt = (n) => {
|
|
357
|
+
const e = L(14), {
|
|
358
|
+
action: t
|
|
359
|
+
} = n;
|
|
360
|
+
let o;
|
|
361
|
+
e[0] !== t.menuItems ? (o = t.menuItems ?? [], e[0] = t.menuItems, e[1] = o) : o = e[1];
|
|
362
|
+
let r;
|
|
363
|
+
e[2] !== o ? (r = o.map(Lt), e[2] = o, e[3] = r) : r = e[3];
|
|
364
|
+
const s = r;
|
|
365
|
+
let l;
|
|
366
|
+
e[4] !== t.icon || e[5] !== t.label ? (l = /* @__PURE__ */ i(Ue, { variant: "ghost", size: "2xs", "aria-label": t.label, children: t.icon }), e[4] = t.icon, e[5] = t.label, e[6] = l) : l = e[6];
|
|
367
|
+
const c = t.searchPlaceholder ?? "Search...", u = t.emptyMenuLabel ?? "No results found";
|
|
368
|
+
let a;
|
|
369
|
+
e[7] !== u ? (a = /* @__PURE__ */ i(I.Item, { value: "empty", asChild: !0, children: /* @__PURE__ */ i(Fe, { asChild: !0, variant: "full-width", label: u, disabled: !0 }) }), e[7] = u, e[8] = a) : a = e[8];
|
|
370
|
+
let d;
|
|
371
|
+
return e[9] !== s || e[10] !== l || e[11] !== c || e[12] !== a ? (d = /* @__PURE__ */ i(Bt, { trigger: l, items: s, searchPlaceholder: c, emptyState: a, onFocusOutside: Ht }), e[9] = s, e[10] = l, e[11] = c, e[12] = a, e[13] = d) : d = e[13], d;
|
|
372
|
+
};
|
|
373
|
+
function Lt(n) {
|
|
374
|
+
return {
|
|
375
|
+
id: n.id,
|
|
376
|
+
label: n.label,
|
|
377
|
+
searchText: [n.label, n.description].filter(Boolean).join(" "),
|
|
378
|
+
tooltipLabel: n.description,
|
|
379
|
+
variant: "full-width",
|
|
380
|
+
onSelect: () => n.onAction?.()
|
|
381
|
+
};
|
|
382
|
+
}
|
|
383
|
+
function Ht(n) {
|
|
384
|
+
return n.preventDefault();
|
|
385
|
+
}
|
|
386
|
+
const tt = (n, e) => n.tooltip ? /* @__PURE__ */ i(Qe, { content: n.tooltip, openDelay: 300, children: e }, n.id) : /* @__PURE__ */ i(Ke, { children: e }, n.id), Et = (n) => {
|
|
387
|
+
const e = L(11), {
|
|
388
|
+
actions: t,
|
|
389
|
+
alwaysVisible: o,
|
|
390
|
+
context: r
|
|
391
|
+
} = n, s = o === void 0 ? !1 : o;
|
|
392
|
+
if (t.length === 0)
|
|
393
|
+
return null;
|
|
394
|
+
const l = s ? "1" : "0", c = s ? "auto" : "none";
|
|
395
|
+
let u, a;
|
|
396
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = {
|
|
397
|
+
opacity: "1",
|
|
398
|
+
pointerEvents: "auto"
|
|
399
|
+
}, a = {
|
|
400
|
+
opacity: "1",
|
|
401
|
+
pointerEvents: "auto"
|
|
402
|
+
}, e[0] = u, e[1] = a) : (u = e[0], a = e[1]);
|
|
403
|
+
let d;
|
|
404
|
+
if (e[2] !== t || e[3] !== r) {
|
|
405
|
+
let g;
|
|
406
|
+
e[5] !== r ? (g = (h) => h.menuItems && h.menuItems.length >= 8 ? /* @__PURE__ */ i(Wt, { action: h }, h.id) : h.menuItems && h.menuItems.length > 0 ? tt(h, /* @__PURE__ */ D(I.Root, { children: [
|
|
407
|
+
/* @__PURE__ */ i(I.Trigger, { asChild: !0, children: /* @__PURE__ */ i(Ue, { variant: "ghost", size: "2xs", "aria-label": h.label, children: h.icon }) }),
|
|
408
|
+
/* @__PURE__ */ i(Ne, { children: /* @__PURE__ */ i(I.Positioner, { children: /* @__PURE__ */ i(I.Content, { minW: "160px", bg: "bg", children: h.menuItems.map(zt) }) }) })
|
|
409
|
+
] })) : tt(h, /* @__PURE__ */ i(Ue, { variant: "ghost", size: "2xs", "aria-label": h.label, onClick: (f) => {
|
|
410
|
+
f.stopPropagation(), h.onAction?.(r);
|
|
411
|
+
}, children: h.icon })), e[5] = r, e[6] = g) : g = e[6], d = t.map(g), e[2] = t, e[3] = r, e[4] = d;
|
|
412
|
+
} else
|
|
413
|
+
d = e[4];
|
|
414
|
+
let p;
|
|
415
|
+
return e[7] !== l || e[8] !== c || e[9] !== d ? (p = /* @__PURE__ */ i(he, { gap: "0", opacity: l, pointerEvents: c, _groupHover: u, _groupFocusWithin: a, transition: "opacity 120ms ease", onClick: At, children: d }), e[7] = l, e[8] = c, e[9] = d, e[10] = p) : p = e[10], p;
|
|
416
|
+
};
|
|
417
|
+
function At(n) {
|
|
418
|
+
return n.stopPropagation();
|
|
419
|
+
}
|
|
420
|
+
function zt(n) {
|
|
421
|
+
return /* @__PURE__ */ D(Ke, { children: [
|
|
422
|
+
n.separatorBefore ? /* @__PURE__ */ i(I.Separator, {}) : null,
|
|
423
|
+
/* @__PURE__ */ i(Qe, { content: n.description, disabled: !n.description, openDelay: 300, children: /* @__PURE__ */ i(I.Item, { value: n.id, disabled: n.disabled || n.readOnly, onClick: () => {
|
|
424
|
+
n.readOnly || n.onAction?.();
|
|
425
|
+
}, children: /* @__PURE__ */ D(he, { gap: "2", minW: "0", w: "full", justify: "space-between", children: [
|
|
426
|
+
/* @__PURE__ */ D(he, { gap: "2", minW: "0", children: [
|
|
427
|
+
n.icon ? /* @__PURE__ */ i(j, { children: n.icon }) : null,
|
|
428
|
+
/* @__PURE__ */ i(j, { minW: "0", children: n.label })
|
|
429
|
+
] }),
|
|
430
|
+
n.endContent ? /* @__PURE__ */ i(j, { flexShrink: 0, children: n.endContent }) : null
|
|
431
|
+
] }) }) })
|
|
432
|
+
] }, n.id);
|
|
433
|
+
}
|
|
434
|
+
const _t = (n, e = !0) => {
|
|
435
|
+
const t = n.contextMenuItems ?? [];
|
|
436
|
+
if (t.length === 0 || !e) return n.actions ?? [];
|
|
437
|
+
const o = n.actions?.flatMap((l) => l.menuItems?.length ? l.menuItems : [{
|
|
438
|
+
id: l.id,
|
|
439
|
+
label: l.label,
|
|
440
|
+
icon: l.icon,
|
|
441
|
+
onAction: () => l.onAction?.({
|
|
442
|
+
nodeId: n.id
|
|
443
|
+
})
|
|
444
|
+
}]) ?? [], r = new Set(o.map((l) => l.id)), s = t.filter((l) => !r.has(l.id)).map((l, c) => ({
|
|
445
|
+
...l,
|
|
446
|
+
separatorBefore: l.separatorBefore || c === 0 && o.length > 0
|
|
447
|
+
}));
|
|
448
|
+
return [{
|
|
449
|
+
id: "resource-actions",
|
|
450
|
+
label: "Resource actions",
|
|
451
|
+
icon: /* @__PURE__ */ i(Me, { as: ot, boxSize: "14px" }),
|
|
452
|
+
menuItems: [...o, ...s]
|
|
453
|
+
}];
|
|
454
|
+
}, Vt = (n) => n.isEmptyStateVariant ? "fg.menu-item.secondary" : n.isDisabled ? "fg.muted" : n.tone === "danger" ? "red.500" : "fg", jt = (n) => {
|
|
455
|
+
const e = L(7), {
|
|
456
|
+
label: t,
|
|
457
|
+
textStyle: o,
|
|
458
|
+
color: r
|
|
459
|
+
} = n;
|
|
460
|
+
if (typeof t == "string") {
|
|
461
|
+
let l;
|
|
462
|
+
return e[0] !== r || e[1] !== t || e[2] !== o ? (l = /* @__PURE__ */ i(je, { textStyle: o, color: r, truncate: !0, children: t }), e[0] = r, e[1] = t, e[2] = o, e[3] = l) : l = e[3], l;
|
|
463
|
+
}
|
|
464
|
+
let s;
|
|
465
|
+
return e[4] !== r || e[5] !== t ? (s = /* @__PURE__ */ i(j, { minW: "0", maxW: "full", overflow: "hidden", color: r, children: t }), e[4] = r, e[5] = t, e[6] = s) : s = e[6], s;
|
|
466
|
+
}, Ft = (n) => {
|
|
467
|
+
const e = L(8), {
|
|
468
|
+
description: t,
|
|
469
|
+
textStyle: o,
|
|
470
|
+
color: r,
|
|
471
|
+
marginLeft: s
|
|
472
|
+
} = n;
|
|
473
|
+
if (!t)
|
|
474
|
+
return null;
|
|
475
|
+
if (typeof t == "string") {
|
|
476
|
+
let c;
|
|
477
|
+
return e[0] !== r || e[1] !== t || e[2] !== s || e[3] !== o ? (c = /* @__PURE__ */ i(je, { ml: s, textStyle: o, color: r, truncate: !0, children: t }), e[0] = r, e[1] = t, e[2] = s, e[3] = o, e[4] = c) : c = e[4], c;
|
|
478
|
+
}
|
|
479
|
+
let l;
|
|
480
|
+
return e[5] !== t || e[6] !== s ? (l = /* @__PURE__ */ i(j, { ml: s, minW: "0", maxW: "full", overflow: "hidden", children: t }), e[5] = t, e[6] = s, e[7] = l) : l = e[7], l;
|
|
481
|
+
}, Nt = (n) => {
|
|
482
|
+
const e = L(34), {
|
|
483
|
+
item: t,
|
|
484
|
+
isExpanded: o,
|
|
485
|
+
showChevron: r,
|
|
486
|
+
isDisabled: s,
|
|
487
|
+
variant: l,
|
|
488
|
+
tone: c,
|
|
489
|
+
labelId: u
|
|
490
|
+
} = n, a = l === "empty-state", d = l === "compact" || l === "collection" || l === "full-width" || l === "tree" || a, p = d ? "label/S/regular" : "label/M/regular", g = d ? "label/XS" : "label/S/regular", h = d ? "0" : "2px", f = l === "tree" || l === "collection" ? "16px" : "14px", x = l === "collection" ? "compact" : l === "tree" ? "1" : "2";
|
|
491
|
+
let v;
|
|
492
|
+
e[0] !== s || e[1] !== a || e[2] !== c ? (v = Vt({
|
|
493
|
+
isEmptyStateVariant: a,
|
|
494
|
+
isDisabled: s,
|
|
495
|
+
tone: c
|
|
496
|
+
}), e[0] = s, e[1] = a, e[2] = c, e[3] = v) : v = e[3];
|
|
497
|
+
const m = v, W = t.iconColor ?? (c === "danger" ? "red.500" : "fg.muted"), $ = c === "danger" ? "red.400" : "fg.menu-item.secondary";
|
|
498
|
+
let b;
|
|
499
|
+
e[4] !== o || e[5] !== r ? (b = r ? /* @__PURE__ */ i(j, { color: "fg.muted", flexShrink: 0, display: "flex", alignItems: "center", children: /* @__PURE__ */ i(Me, { as: gt, boxSize: "12px", transform: o ? "rotate(90deg)" : "rotate(0deg)", transition: "transform 120ms ease" }) }) : null, e[4] = o, e[5] = r, e[6] = b) : b = e[6];
|
|
500
|
+
let M;
|
|
501
|
+
e[7] !== W || e[8] !== f || e[9] !== t.icon ? (M = t.icon ? /* @__PURE__ */ i(j, { color: W, flexShrink: 0, display: "inline-flex", alignItems: "center", justifyContent: "center", boxSize: f, fontSize: f, lineHeight: "1", css: {
|
|
502
|
+
"& > svg": {
|
|
503
|
+
width: f,
|
|
504
|
+
height: f
|
|
505
|
+
}
|
|
506
|
+
}, children: t.icon }) : null, e[7] = W, e[8] = f, e[9] = t.icon, e[10] = M) : M = e[10];
|
|
507
|
+
let O;
|
|
508
|
+
e[11] !== t.indicator ? (O = t.indicator ? /* @__PURE__ */ i(Qe, { content: t.indicator.tooltip, disabled: !t.indicator.tooltip, openDelay: 300, children: /* @__PURE__ */ i(j, { color: t.indicator.color ?? "fg.muted", flexShrink: 0, children: t.indicator.icon }) }) : null, e[11] = t.indicator, e[12] = O) : O = e[12];
|
|
509
|
+
let P;
|
|
510
|
+
e[13] !== t.label || e[14] !== m || e[15] !== p ? (P = /* @__PURE__ */ i(jt, { label: t.label, textStyle: p, color: m }), e[13] = t.label, e[14] = m, e[15] = p, e[16] = P) : P = e[16];
|
|
511
|
+
let F;
|
|
512
|
+
e[17] !== x || e[18] !== M || e[19] !== O || e[20] !== P ? (F = /* @__PURE__ */ D(he, { gap: x, minW: "0", alignItems: "center", children: [
|
|
513
|
+
M,
|
|
514
|
+
O,
|
|
515
|
+
P
|
|
516
|
+
] }), e[17] = x, e[18] = M, e[19] = O, e[20] = P, e[21] = F) : F = e[21];
|
|
517
|
+
let N;
|
|
518
|
+
e[22] !== $ || e[23] !== h || e[24] !== g || e[25] !== t.description ? (N = /* @__PURE__ */ i(Ft, { description: t.description, textStyle: g, color: $, marginLeft: h }), e[22] = $, e[23] = h, e[24] = g, e[25] = t.description, e[26] = N) : N = e[26];
|
|
519
|
+
let A;
|
|
520
|
+
e[27] !== F || e[28] !== N ? (A = /* @__PURE__ */ D(nt, { gap: "0", minW: "0", flex: "1", children: [
|
|
521
|
+
F,
|
|
522
|
+
N
|
|
523
|
+
] }), e[27] = F, e[28] = N, e[29] = A) : A = e[29];
|
|
524
|
+
let Z;
|
|
525
|
+
return e[30] !== u || e[31] !== b || e[32] !== A ? (Z = /* @__PURE__ */ D(he, { id: u, gap: "2", minW: "0", flex: "1", overflow: "hidden", alignItems: "center", children: [
|
|
526
|
+
b,
|
|
527
|
+
A
|
|
528
|
+
] }), e[30] = u, e[31] = b, e[32] = A, e[33] = Z) : Z = e[33], Z;
|
|
529
|
+
}, Kt = (n) => {
|
|
530
|
+
const e = L(23), {
|
|
531
|
+
labelId: t,
|
|
532
|
+
item: o,
|
|
533
|
+
isDisabled: r,
|
|
534
|
+
isExpanded: s,
|
|
535
|
+
showChevron: l,
|
|
536
|
+
tone: c,
|
|
537
|
+
variant: u,
|
|
538
|
+
showContextMenuTrigger: a
|
|
539
|
+
} = n, d = c === void 0 ? "default" : c, p = u === void 0 ? "default" : u;
|
|
540
|
+
let g;
|
|
541
|
+
e[0] !== o || e[1] !== a ? (g = _t(o, a), e[0] = o, e[1] = a, e[2] = g) : g = e[2];
|
|
542
|
+
const h = g;
|
|
543
|
+
let f;
|
|
544
|
+
e[3] !== r || e[4] !== s || e[5] !== o || e[6] !== t || e[7] !== l || e[8] !== d || e[9] !== p ? (f = /* @__PURE__ */ i(Nt, { labelId: t, item: o, isExpanded: s, showChevron: l, isDisabled: r, tone: d, variant: p }), e[3] = r, e[4] = s, e[5] = o, e[6] = t, e[7] = l, e[8] = d, e[9] = p, e[10] = f) : f = e[10];
|
|
545
|
+
let x;
|
|
546
|
+
e[11] !== o.endContent || e[12] !== t ? (x = o.endContent ? /* @__PURE__ */ i(j, { id: `${t}-end`, flexShrink: 0, color: "fg.muted", display: "flex", alignItems: "center", children: o.endContent }) : null, e[11] = o.endContent, e[12] = t, e[13] = x) : x = e[13];
|
|
547
|
+
let v;
|
|
548
|
+
e[14] !== h || e[15] !== o.contextMenuItems?.length || e[16] !== o.id || e[17] !== a ? (v = h.length > 0 ? /* @__PURE__ */ i(Et, { actions: h, context: {
|
|
549
|
+
nodeId: o.id
|
|
550
|
+
}, alwaysVisible: a && (o.contextMenuItems?.length ?? 0) > 0 }) : null, e[14] = h, e[15] = o.contextMenuItems?.length, e[16] = o.id, e[17] = a, e[18] = v) : v = e[18];
|
|
551
|
+
let m;
|
|
552
|
+
return e[19] !== f || e[20] !== x || e[21] !== v ? (m = /* @__PURE__ */ D(Je, { children: [
|
|
553
|
+
f,
|
|
554
|
+
x,
|
|
555
|
+
v
|
|
556
|
+
] }), e[19] = f, e[20] = x, e[21] = v, e[22] = m) : m = e[22], m;
|
|
557
|
+
}, Qt = (n) => {
|
|
558
|
+
if (!(n <= 0))
|
|
559
|
+
return `calc(var(--chakra-spacing-1) + ${n} * 12px)`;
|
|
560
|
+
}, Gt = (n) => n === "compact" || n === "full-width" || n === "empty-state", Xt = (n, e) => n === "collection" && !e ? {
|
|
561
|
+
rowHeight: "collection-row",
|
|
562
|
+
minHeight: void 0
|
|
563
|
+
} : Gt(n) && !e ? {
|
|
564
|
+
rowHeight: "1.75rem",
|
|
565
|
+
minHeight: void 0
|
|
566
|
+
} : {
|
|
567
|
+
rowHeight: "auto",
|
|
568
|
+
minHeight: n === "default" ? "2.25rem" : "1.75rem"
|
|
569
|
+
}, qt = (n) => ({
|
|
570
|
+
bg: n.isSelected ? n.selectedBg : "transparent",
|
|
571
|
+
_hover: n.variant === "empty-state" ? {
|
|
572
|
+
bg: "transparent"
|
|
573
|
+
} : n.isSelected ? {
|
|
574
|
+
bg: n.selectedBg
|
|
575
|
+
} : n.tone === "danger" ? {
|
|
576
|
+
outline: "1px solid",
|
|
577
|
+
outlineColor: "red.500",
|
|
578
|
+
outlineOffset: "-1px"
|
|
579
|
+
} : {
|
|
580
|
+
bg: n.hoverBg
|
|
581
|
+
},
|
|
582
|
+
_active: n.variant === "empty-state" ? {
|
|
583
|
+
bg: "transparent"
|
|
584
|
+
} : {
|
|
585
|
+
bg: n.selectedBg
|
|
586
|
+
}
|
|
587
|
+
}), Jt = (n, e) => e ? `${n} ${n}-end` : n, Ut = (n) => ({
|
|
588
|
+
"aria-labelledby": n.rootProps["aria-label"] ? void 0 : Jt(n.labelId, n.hasEndContent),
|
|
589
|
+
...n.rootProps,
|
|
590
|
+
role: n.rowRole,
|
|
591
|
+
"aria-selected": n.rootProps["aria-selected"] ?? (n.rowRole === "option" ? n.isSelected : void 0),
|
|
592
|
+
"aria-expanded": n.showChevron ? n.isExpanded : void 0,
|
|
593
|
+
className: n.className ? `group ${n.className}` : "group",
|
|
594
|
+
width: "full",
|
|
595
|
+
minWidth: "0",
|
|
596
|
+
maxWidth: "full",
|
|
597
|
+
height: n.rowHeight,
|
|
598
|
+
minHeight: n.minHeight,
|
|
599
|
+
display: "flex",
|
|
600
|
+
alignItems: "center",
|
|
601
|
+
justifyContent: "space-between",
|
|
602
|
+
gap: "xs",
|
|
603
|
+
px: "sm",
|
|
604
|
+
py: n.verticalPadding,
|
|
605
|
+
pl: n.paddingLeft,
|
|
606
|
+
borderRadius: n.variant === "full-width" || n.variant === "collection" ? "0" : "xs",
|
|
607
|
+
...qt({
|
|
608
|
+
...n
|
|
609
|
+
}),
|
|
610
|
+
cursor: n.variant === "empty-state" ? "default" : n.isDisabled ? "not-allowed" : "pointer",
|
|
611
|
+
overflow: "hidden",
|
|
612
|
+
textAlign: "left",
|
|
613
|
+
color: "inherit",
|
|
614
|
+
textDecoration: "none"
|
|
615
|
+
}), Fe = ft((n, e) => {
|
|
616
|
+
const t = L(108), {
|
|
617
|
+
id: o,
|
|
618
|
+
label: r,
|
|
619
|
+
description: s,
|
|
620
|
+
icon: l,
|
|
621
|
+
iconColor: c,
|
|
622
|
+
indicator: u,
|
|
623
|
+
endContent: a,
|
|
624
|
+
tooltip: d,
|
|
625
|
+
disabled: p,
|
|
626
|
+
isContainer: g,
|
|
627
|
+
isNavigable: h,
|
|
628
|
+
href: f,
|
|
629
|
+
navigationIntent: x,
|
|
630
|
+
menuItems: v,
|
|
631
|
+
menuPlacement: m,
|
|
632
|
+
contextMenuItems: W,
|
|
633
|
+
actions: $,
|
|
634
|
+
children: b,
|
|
635
|
+
onActivate: M,
|
|
636
|
+
depth: O,
|
|
637
|
+
isSelected: P,
|
|
638
|
+
isExpanded: F,
|
|
639
|
+
showExpandToggle: N,
|
|
640
|
+
showContextMenuTrigger: A,
|
|
641
|
+
variant: Z,
|
|
642
|
+
tone: ee,
|
|
643
|
+
selectedBg: $e,
|
|
644
|
+
hoverBg: Te,
|
|
645
|
+
asChild: Pe,
|
|
646
|
+
className: ke,
|
|
647
|
+
role: Ge,
|
|
648
|
+
onToggleExpand: fe,
|
|
649
|
+
onPointerMove: H,
|
|
650
|
+
draggable: G,
|
|
651
|
+
onDragStart: le,
|
|
652
|
+
onDragOver: We,
|
|
653
|
+
onDragEnd: w,
|
|
654
|
+
onDrop: be,
|
|
655
|
+
onClick: X,
|
|
656
|
+
onKeyDown: ie,
|
|
657
|
+
...pe
|
|
658
|
+
} = n, Re = O === void 0 ? 0 : O, ve = P === void 0 ? !1 : P, xe = F === void 0 ? !1 : F, Le = N === void 0 ? !1 : N, re = A === void 0 ? !0 : A, se = Z === void 0 ? "default" : Z, te = ee === void 0 ? "default" : ee, Ye = $e === void 0 ? "bg.active" : $e, Se = Te === void 0 ? "bg.hover" : Te, Oe = Pe === void 0 ? !1 : Pe, [me, E] = Ve(!1), ae = pt();
|
|
659
|
+
let Ce;
|
|
660
|
+
t[0] !== $ || t[1] !== b || t[2] !== W || t[3] !== s || t[4] !== p || t[5] !== a || t[6] !== f || t[7] !== l || t[8] !== c || t[9] !== o || t[10] !== u || t[11] !== g || t[12] !== h || t[13] !== r || t[14] !== v || t[15] !== m || t[16] !== x || t[17] !== M || t[18] !== d ? (Ce = {
|
|
661
|
+
id: o,
|
|
662
|
+
label: r,
|
|
663
|
+
description: s,
|
|
664
|
+
icon: l,
|
|
665
|
+
iconColor: c,
|
|
666
|
+
indicator: u,
|
|
667
|
+
endContent: a,
|
|
668
|
+
tooltip: d,
|
|
669
|
+
disabled: p,
|
|
670
|
+
isContainer: g,
|
|
671
|
+
isNavigable: h,
|
|
672
|
+
href: f,
|
|
673
|
+
navigationIntent: x,
|
|
674
|
+
menuItems: v,
|
|
675
|
+
menuPlacement: m,
|
|
676
|
+
contextMenuItems: W,
|
|
677
|
+
actions: $,
|
|
678
|
+
children: b,
|
|
679
|
+
onActivate: M
|
|
680
|
+
}, t[0] = $, t[1] = b, t[2] = W, t[3] = s, t[4] = p, t[5] = a, t[6] = f, t[7] = l, t[8] = c, t[9] = o, t[10] = u, t[11] = g, t[12] = h, t[13] = r, t[14] = v, t[15] = m, t[16] = x, t[17] = M, t[18] = d, t[19] = Ce) : Ce = t[19];
|
|
681
|
+
const k = Ce;
|
|
682
|
+
let Ie;
|
|
683
|
+
t[20] !== G || t[21] !== w || t[22] !== We || t[23] !== le || t[24] !== be ? (Ie = {
|
|
684
|
+
draggable: G,
|
|
685
|
+
onDragStart: le,
|
|
686
|
+
onDragOver: We,
|
|
687
|
+
onDragEnd: w,
|
|
688
|
+
onDrop: be
|
|
689
|
+
}, t[20] = G, t[21] = w, t[22] = We, t[23] = le, t[24] = be, t[25] = Ie) : Ie = t[25];
|
|
690
|
+
const R = Ie, Be = (k.children?.length ?? 0) > 0 || k.isContainer === !0, B = (k.menuItems?.length ?? 0) > 0, Xe = (k.actions?.length ?? 0) > 0 || (k.contextMenuItems?.length ?? 0) > 0, q = Le && Be, y = k.disabled === !0;
|
|
691
|
+
let K;
|
|
692
|
+
t[26] !== B || t[27] !== y || t[28] !== M || t[29] !== fe || t[30] !== q ? (K = () => {
|
|
693
|
+
if (!y && !B) {
|
|
694
|
+
if (q) {
|
|
695
|
+
fe?.();
|
|
696
|
+
return;
|
|
697
|
+
}
|
|
698
|
+
M?.();
|
|
699
|
+
}
|
|
700
|
+
}, t[26] = B, t[27] = y, t[28] = M, t[29] = fe, t[30] = q, t[31] = K) : K = t[31];
|
|
701
|
+
const z = K;
|
|
702
|
+
let ne;
|
|
703
|
+
t[32] !== z || t[33] !== y || t[34] !== X ? (ne = (S) => {
|
|
704
|
+
if (X?.(S), !S.defaultPrevented) {
|
|
705
|
+
if (y) {
|
|
706
|
+
S.preventDefault();
|
|
707
|
+
return;
|
|
708
|
+
}
|
|
709
|
+
z();
|
|
710
|
+
}
|
|
711
|
+
}, t[32] = z, t[33] = y, t[34] = X, t[35] = ne) : ne = t[35];
|
|
712
|
+
const J = ne;
|
|
713
|
+
let ce;
|
|
714
|
+
t[36] !== y || t[37] !== X || t[38] !== E ? (ce = (S) => {
|
|
715
|
+
if (X?.(S), !S.defaultPrevented) {
|
|
716
|
+
if (y) {
|
|
717
|
+
S.preventDefault();
|
|
718
|
+
return;
|
|
719
|
+
}
|
|
720
|
+
E(Yt);
|
|
721
|
+
}
|
|
722
|
+
}, t[36] = y, t[37] = X, t[38] = E, t[39] = ce) : ce = t[39];
|
|
723
|
+
const U = ce;
|
|
724
|
+
let de;
|
|
725
|
+
t[40] !== z || t[41] !== B || t[42] !== y || t[43] !== ie || t[44] !== E ? (de = (S) => {
|
|
726
|
+
if (ie?.(S), !S.defaultPrevented && !(S.key !== "Enter" && S.key !== " ") && (S.preventDefault(), !y)) {
|
|
727
|
+
if (B) {
|
|
728
|
+
E(Zt);
|
|
729
|
+
return;
|
|
730
|
+
}
|
|
731
|
+
z();
|
|
732
|
+
}
|
|
733
|
+
}, t[40] = z, t[41] = B, t[42] = y, t[43] = ie, t[44] = E, t[45] = de) : de = t[45];
|
|
734
|
+
const Y = de, ge = k.description !== void 0, C = Qt(Re), He = se === "default" || ge ? "xs" : "2xs";
|
|
735
|
+
let we;
|
|
736
|
+
t[46] !== J || t[47] !== U || t[48] !== B ? (we = B ? {
|
|
737
|
+
onClick: U
|
|
738
|
+
} : {
|
|
739
|
+
onClick: J
|
|
740
|
+
}, t[46] = J, t[47] = U, t[48] = B, t[49] = we) : we = t[49];
|
|
741
|
+
const oe = we, {
|
|
742
|
+
rowHeight: rt,
|
|
743
|
+
minHeight: st
|
|
744
|
+
} = Xt(se, ge), at = Ge ?? (B ? "button" : "option"), ue = Ut({
|
|
745
|
+
rootProps: pe,
|
|
746
|
+
labelId: ae,
|
|
747
|
+
hasEndContent: !!k.endContent,
|
|
748
|
+
rowRole: at,
|
|
749
|
+
className: ke,
|
|
750
|
+
isSelected: ve,
|
|
751
|
+
isExpanded: xe,
|
|
752
|
+
showChevron: q,
|
|
753
|
+
rowHeight: rt,
|
|
754
|
+
minHeight: st,
|
|
755
|
+
verticalPadding: He,
|
|
756
|
+
paddingLeft: C,
|
|
757
|
+
selectedBg: Ye,
|
|
758
|
+
hoverBg: Se,
|
|
759
|
+
tone: te,
|
|
760
|
+
isDisabled: y,
|
|
761
|
+
variant: se
|
|
762
|
+
});
|
|
763
|
+
let Ee;
|
|
764
|
+
t[50] !== y || t[51] !== xe || t[52] !== k || t[53] !== ae || t[54] !== q || t[55] !== re || t[56] !== te || t[57] !== se ? (Ee = /* @__PURE__ */ i(Kt, { labelId: ae, item: k, isExpanded: xe, showChevron: q, isDisabled: y, tone: te, variant: se, showContextMenuTrigger: re }), t[50] = y, t[51] = xe, t[52] = k, t[53] = ae, t[54] = q, t[55] = re, t[56] = te, t[57] = se, t[58] = Ee) : Ee = t[58];
|
|
765
|
+
const _ = Ee;
|
|
766
|
+
let Ae;
|
|
767
|
+
t[59] !== k || t[60] !== me || t[61] !== E ? (Ae = (S) => /* @__PURE__ */ i(wt, { item: k, menuOpen: me, onMenuOpenChange: E, onMenuSelect: (T) => {
|
|
768
|
+
E(!1), T.onAction?.();
|
|
769
|
+
}, children: S }), t[59] = k, t[60] = me, t[61] = E, t[62] = Ae) : Ae = t[62];
|
|
770
|
+
const V = Ae;
|
|
771
|
+
if (Oe) {
|
|
772
|
+
let S;
|
|
773
|
+
t[63] !== oe || t[64] !== _ || t[65] !== R || t[66] !== H || t[67] !== e || t[68] !== ue ? (S = /* @__PURE__ */ i(De.div, { ref: e, ...ue, ...R, ...oe, onPointerMove: H, children: _ }), t[63] = oe, t[64] = _, t[65] = R, t[66] = H, t[67] = e, t[68] = ue, t[69] = S) : S = t[69];
|
|
774
|
+
let T;
|
|
775
|
+
return t[70] !== S || t[71] !== V ? (T = V(S), t[70] = S, t[71] = V, t[72] = T) : T = t[72], T;
|
|
776
|
+
}
|
|
777
|
+
if (k.href && !q && !y && !B) {
|
|
778
|
+
const S = ue;
|
|
779
|
+
let T;
|
|
780
|
+
t[73] !== _ || t[74] !== R || t[75] !== J || t[76] !== k.href || t[77] !== H || t[78] !== e || t[79] !== S ? (T = /* @__PURE__ */ i(De.a, { ref: e, href: k.href, ...S, ...R, onClick: J, onPointerMove: H, children: _ }), t[73] = _, t[74] = R, t[75] = J, t[76] = k.href, t[77] = H, t[78] = e, t[79] = S, t[80] = T) : T = t[80];
|
|
781
|
+
let Q;
|
|
782
|
+
return t[81] !== T || t[82] !== V ? (Q = V(T), t[81] = T, t[82] = V, t[83] = Q) : Q = t[83], Q;
|
|
783
|
+
}
|
|
784
|
+
if (Xe) {
|
|
785
|
+
const S = y || void 0, T = pe.tabIndex ?? 0;
|
|
786
|
+
let Q;
|
|
787
|
+
t[84] !== oe || t[85] !== _ || t[86] !== R || t[87] !== Y || t[88] !== H || t[89] !== e || t[90] !== ue || t[91] !== S || t[92] !== T ? (Q = /* @__PURE__ */ i(De.div, { ref: e, "aria-disabled": S, ...ue, ...R, ...oe, tabIndex: T, onKeyDown: Y, onPointerMove: H, children: _ }), t[84] = oe, t[85] = _, t[86] = R, t[87] = Y, t[88] = H, t[89] = e, t[90] = ue, t[91] = S, t[92] = T, t[93] = Q) : Q = t[93];
|
|
788
|
+
let _e;
|
|
789
|
+
return t[94] !== Q || t[95] !== V ? (_e = V(Q), t[94] = Q, t[95] = V, t[96] = _e) : _e = t[96], _e;
|
|
790
|
+
}
|
|
791
|
+
const qe = ue;
|
|
792
|
+
let ye;
|
|
793
|
+
t[97] !== oe || t[98] !== _ || t[99] !== R || t[100] !== y || t[101] !== H || t[102] !== e || t[103] !== qe ? (ye = /* @__PURE__ */ i(De.button, { ref: e, type: "button", disabled: y, ...qe, ...R, ...oe, onPointerMove: H, children: _ }), t[97] = oe, t[98] = _, t[99] = R, t[100] = y, t[101] = H, t[102] = e, t[103] = qe, t[104] = ye) : ye = t[104];
|
|
794
|
+
let ze;
|
|
795
|
+
return t[105] !== ye || t[106] !== V ? (ze = V(ye), t[105] = ye, t[106] = V, t[107] = ze) : ze = t[107], ze;
|
|
796
|
+
});
|
|
797
|
+
function Yt(n) {
|
|
798
|
+
return !n;
|
|
799
|
+
}
|
|
800
|
+
function Zt(n) {
|
|
801
|
+
return !n;
|
|
802
|
+
}
|
|
803
|
+
export {
|
|
804
|
+
it as H,
|
|
805
|
+
Fe as L,
|
|
806
|
+
vt as R,
|
|
807
|
+
Mt as S,
|
|
808
|
+
Wt as a,
|
|
809
|
+
Bt as b,
|
|
810
|
+
sn as c
|
|
811
|
+
};
|
|
812
|
+
//# sourceMappingURL=list-row-DCgdza1i.js.map
|