@pstdio/ui 0.40.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 (108) hide show
  1. package/dist/{MermaidComponent-81jr28u4.js → MermaidComponent-D7vhkpka.js} +3 -3
  2. package/dist/{MermaidComponent-81jr28u4.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 +129 -23
  6. package/dist/chat-ui.js +2596 -1591
  7. package/dist/chat-ui.js.map +1 -1
  8. package/dist/{types-DWA3enV6.d.ts → collection-view-fields-D3cysHNT.d.ts} +87 -37
  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-CpRe_xK2.js → data-table-stats-row-64magT2g.js} +2 -2
  16. package/dist/{data-table-stats-row-CpRe_xK2.js.map → data-table-stats-row-64magT2g.js.map} +1 -1
  17. package/dist/data-table.d.ts +29 -7
  18. package/dist/data-table.js +1043 -878
  19. package/dist/data-table.js.map +1 -1
  20. package/dist/diff-bubble-DewUd_2w.js +61 -0
  21. package/dist/diff-bubble-DewUd_2w.js.map +1 -0
  22. package/dist/{diff-drawer-45rpk3aq.js → diff-drawer-IYpQ-QQK.js} +264 -242
  23. package/dist/diff-drawer-IYpQ-QQK.js.map +1 -0
  24. package/dist/diff-viewer-C-0VAt9P.js +574 -0
  25. package/dist/diff-viewer-C-0VAt9P.js.map +1 -0
  26. package/dist/diff.d.ts +11 -0
  27. package/dist/diff.js +107 -98
  28. package/dist/diff.js.map +1 -1
  29. package/dist/display-sort-control-f3rbILsV.js +588 -0
  30. package/dist/display-sort-control-f3rbILsV.js.map +1 -0
  31. package/dist/drop-indicator-HjlBSIeV.js +27 -0
  32. package/dist/drop-indicator-HjlBSIeV.js.map +1 -0
  33. package/dist/edit-mode-data-table-DnMB2jiy.js +1449 -0
  34. package/dist/edit-mode-data-table-DnMB2jiy.js.map +1 -0
  35. package/dist/host-storage-BIo5azql.js +31 -0
  36. package/dist/host-storage-BIo5azql.js.map +1 -0
  37. package/dist/host-storage-J0089Hyk.d.ts +17 -0
  38. package/dist/{slider-hwHYe98I.js → icon-options-Tt6Wzhtv.js} +86 -201
  39. package/dist/icon-options-Tt6Wzhtv.js.map +1 -0
  40. package/dist/{index-Bfddrlz8.d.ts → index-B79hwNcB.d.ts} +66 -14
  41. package/dist/index-CKsd23jv.d.ts +80 -0
  42. package/dist/{index-CbtbcvKm.d.ts → index-DlmvvQ6x.d.ts} +1 -1
  43. package/dist/index-ICoad2I_.d.ts +282 -0
  44. package/dist/index.d.ts +63 -22
  45. package/dist/index.js +1149 -1054
  46. package/dist/index.js.map +1 -1
  47. package/dist/kanban-renderer.d.ts +3 -326
  48. package/dist/kanban-renderer.js +980 -596
  49. package/dist/kanban-renderer.js.map +1 -1
  50. package/dist/list-row-Z4SHkseA.js +1195 -0
  51. package/dist/list-row-Z4SHkseA.js.map +1 -0
  52. package/dist/markdown-editor-Dd4mor7l.js +3236 -0
  53. package/dist/markdown-editor-Dd4mor7l.js.map +1 -0
  54. package/dist/{mermaid-renderer-DImi0fDp.js → mermaid-renderer-0PmNkOXI.js} +29 -29
  55. package/dist/mermaid-renderer-0PmNkOXI.js.map +1 -0
  56. package/dist/mermaid.js +1 -1
  57. package/dist/number-input-7K66wnSC.js +63 -0
  58. package/dist/number-input-7K66wnSC.js.map +1 -0
  59. package/dist/{param-editor-BQd4AOUP.js → param-editor-Dnix-fJo.js} +2 -2
  60. package/dist/{param-editor-BQd4AOUP.js.map → param-editor-Dnix-fJo.js.map} +1 -1
  61. package/dist/{param-editor-field-BJ_rLUnV.js → param-editor-field-B3vLST-B.js} +1436 -1427
  62. package/dist/param-editor-field-B3vLST-B.js.map +1 -0
  63. package/dist/param-editor.js +4 -3
  64. package/dist/prism-OG4H7Hu4.js +334 -0
  65. package/dist/prism-OG4H7Hu4.js.map +1 -0
  66. package/dist/queued-follow-up-Bj_vtMgd.js +208 -0
  67. package/dist/queued-follow-up-Bj_vtMgd.js.map +1 -0
  68. package/dist/{resource-badge-95WPVlZf.d.ts → resource-badge-nOWPqxFU.d.ts} +1 -0
  69. package/dist/rich-text-BgEnAHr2.js +1160 -0
  70. package/dist/rich-text-BgEnAHr2.js.map +1 -0
  71. package/dist/rich-text.d.ts +2 -2
  72. package/dist/rich-text.js +4 -2
  73. package/dist/style.css +1 -1
  74. package/dist/terminal.d.ts +5 -63
  75. package/dist/terminal.js +102 -122
  76. package/dist/terminal.js.map +1 -1
  77. package/dist/{theme-CbmSEbRF.js → theme-CMJdH59Z.js} +589 -265
  78. package/dist/theme-CMJdH59Z.js.map +1 -0
  79. package/dist/theme-kKuLN2jb.js +80 -0
  80. package/dist/theme-kKuLN2jb.js.map +1 -0
  81. package/dist/theme-preference-BV4cbJNB.js +115 -0
  82. package/dist/theme-preference-BV4cbJNB.js.map +1 -0
  83. package/dist/theme.js +3 -2
  84. package/dist/tree-list-jarhD31R.js +1652 -0
  85. package/dist/tree-list-jarhD31R.js.map +1 -0
  86. package/dist/use-virtualizer-uj43XjBp.js +10 -0
  87. package/dist/use-virtualizer-uj43XjBp.js.map +1 -0
  88. package/dist/{workspace-badge-Brm3Xr3m.d.ts → workspace-badge-BKtB805G.d.ts} +5 -1
  89. package/package.json +8 -4
  90. package/dist/diff-bubble-DZsarmSG.js +0 -61
  91. package/dist/diff-bubble-DZsarmSG.js.map +0 -1
  92. package/dist/diff-drawer-45rpk3aq.js.map +0 -1
  93. package/dist/diff-viewer-BP_mI6Wx.js +0 -558
  94. package/dist/diff-viewer-BP_mI6Wx.js.map +0 -1
  95. package/dist/list-row-uqD-q4gv.js +0 -1018
  96. package/dist/list-row-uqD-q4gv.js.map +0 -1
  97. package/dist/mermaid-renderer-DImi0fDp.js.map +0 -1
  98. package/dist/param-editor-field-BJ_rLUnV.js.map +0 -1
  99. package/dist/prism-BStPsJSB.js +0 -658
  100. package/dist/prism-BStPsJSB.js.map +0 -1
  101. package/dist/rich-text-VYAmEigU.js +0 -6979
  102. package/dist/rich-text-VYAmEigU.js.map +0 -1
  103. package/dist/slider-hwHYe98I.js.map +0 -1
  104. package/dist/theme-CbmSEbRF.js.map +0 -1
  105. package/dist/theme-preference-pzfuK5cH.js +0 -101
  106. package/dist/theme-preference-pzfuK5cH.js.map +0 -1
  107. package/dist/tree-list-BNZwjQZA.js +0 -1616
  108. package/dist/tree-list-BNZwjQZA.js.map +0 -1
@@ -0,0 +1,588 @@
1
+ import { n as e } from "./scroll-area-Cr1lNXAr.js";
2
+ import { t } from "./empty-state-3mVV_pV-.js";
3
+ import { C as n, E as r, S as i, T as a, _ as o, b as s, c, d as l, f as u, g as d, m as f, p, u as m, x as h } from "./collection-view-search-CpjJy76w.js";
4
+ import { n as g, t as _ } from "./collection-view-grouping-D4nZk8-3.js";
5
+ import { Badge as v, Button as y, HStack as b, Icon as x, IconButton as ee, Menu as S, Popover as C, Portal as te, Stack as w, Text as T } from "@chakra-ui/react";
6
+ import { c as E } from "react/compiler-runtime";
7
+ import { Fragment as D, jsx as O, jsxs as k } from "react/jsx-runtime";
8
+ import { Fragment as A, createElement as j, useEffect as ne, useRef as M, useState as re } from "react";
9
+ import * as N from "lucide-react";
10
+ import { Check as P, ChevronDown as F, List as ie, SearchX as I, Settings2 as ae, SquareKanban as oe, X as L } from "lucide-react";
11
+ //#region src/components/kanban-renderer/collection-badge.tsx
12
+ var R = (e) => e.split(/[^a-zA-Z0-9]+/).filter(Boolean).map((e) => `${e.charAt(0).toUpperCase()}${e.slice(1)}`).join(""), z = (e) => {
13
+ if (!e) return;
14
+ let t = R(e);
15
+ for (let n of [
16
+ e,
17
+ t,
18
+ `${t}Icon`
19
+ ]) {
20
+ let e = N[n];
21
+ if (e && (typeof e == "function" || typeof e == "object")) return e;
22
+ }
23
+ }, B = (e) => {
24
+ let t = E(17), { label: n, icon: r, onClick: i } = e, a;
25
+ t[0] === r ? a = t[1] : (a = z(r), t[0] = r, t[1] = a);
26
+ let o = a, s;
27
+ t[2] === o ? s = t[3] : (s = o ? /* @__PURE__ */ O(x, {
28
+ as: o,
29
+ boxSize: "3.5",
30
+ flexShrink: 0,
31
+ "aria-hidden": "true"
32
+ }) : null, t[2] = o, t[3] = s);
33
+ let c;
34
+ t[4] === n ? c = t[5] : (c = /* @__PURE__ */ O(T, {
35
+ as: "span",
36
+ textStyle: "label/XS/medium",
37
+ color: "fg.muted",
38
+ minW: "0",
39
+ maxW: "10rem",
40
+ truncate: !0,
41
+ children: n
42
+ }), t[4] = n, t[5] = c);
43
+ let l;
44
+ t[6] !== s || t[7] !== c ? (l = /* @__PURE__ */ k(D, { children: [s, c] }), t[6] = s, t[7] = c, t[8] = l) : l = t[8];
45
+ let u = l, d;
46
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (d = {
47
+ display: "inline-flex",
48
+ gap: "2xs",
49
+ alignItems: "center",
50
+ minW: "0",
51
+ maxW: "100%",
52
+ variant: "subtle",
53
+ bg: {
54
+ _light: "bg.muted",
55
+ _dark: "bg.subtle"
56
+ },
57
+ color: "fg.muted",
58
+ textStyle: "label/XS/medium",
59
+ "data-testid": "collection-badge"
60
+ }, t[9] = d) : d = t[9];
61
+ let f = d;
62
+ if (i) {
63
+ let e;
64
+ t[10] === i ? e = t[11] : (e = (e) => {
65
+ e.stopPropagation(), i();
66
+ }, t[10] = i, t[11] = e);
67
+ let n;
68
+ return t[12] !== u || t[13] !== e ? (n = /* @__PURE__ */ O(v, {
69
+ asChild: !0,
70
+ ...f,
71
+ cursor: "pointer",
72
+ children: /* @__PURE__ */ O("button", {
73
+ type: "button",
74
+ onClick: e,
75
+ children: u
76
+ })
77
+ }), t[12] = u, t[13] = e, t[14] = n) : n = t[14], n;
78
+ }
79
+ let p;
80
+ return t[15] === u ? p = t[16] : (p = /* @__PURE__ */ O(v, {
81
+ as: "span",
82
+ ...f,
83
+ cursor: "default",
84
+ children: u
85
+ }), t[15] = u, t[16] = p), p;
86
+ }, V = (e, t) => e.length === 0 ? null : e.length <= 2 ? e.map((e) => s(t, e)).join(", ") : `${s(t, e[0])}, ${s(t, e[1])} +${e.length - 2}`, H = (e, t, r) => {
87
+ if (t.kind !== "enum") return null;
88
+ let a = typeof r == "string" ? r : null, o = e.editable === !0;
89
+ if (!a) return o ? {
90
+ attributeId: e.id,
91
+ attributeLabel: e.label,
92
+ label: e.label,
93
+ value: a ?? void 0,
94
+ options: i(t),
95
+ isEditable: !0
96
+ } : null;
97
+ let s = h(t, a);
98
+ return {
99
+ attributeId: e.id,
100
+ attributeLabel: e.label,
101
+ label: s?.label ?? n(a),
102
+ color: s?.color,
103
+ icon: s?.icon,
104
+ ...o ? {
105
+ value: a,
106
+ options: i(t),
107
+ isEditable: !0
108
+ } : {}
109
+ };
110
+ }, U = (e, t, n) => {
111
+ if (t.kind !== "enum-multi") return null;
112
+ let r = Array.isArray(n) ? n.filter((e) => typeof e == "string") : [], a = V(r, t), o = e.editable === !0;
113
+ if (!a) return o ? {
114
+ attributeId: e.id,
115
+ attributeLabel: e.label,
116
+ label: e.label,
117
+ value: r,
118
+ options: i(t),
119
+ isEditable: !0
120
+ } : null;
121
+ let s = r[0] ? h(t, r[0]) : void 0;
122
+ return {
123
+ attributeId: e.id,
124
+ attributeLabel: e.label,
125
+ label: a,
126
+ color: s?.color,
127
+ icon: s?.icon,
128
+ ...o ? {
129
+ value: r,
130
+ options: i(t),
131
+ isEditable: !0
132
+ } : {}
133
+ };
134
+ }, W = (e) => {
135
+ if (typeof e != "string" || e === "") return null;
136
+ let t = new Date(e);
137
+ return Number.isNaN(t.getTime()) ? null : t.toLocaleDateString();
138
+ }, G = (e) => typeof e == "number" && Number.isFinite(e) ? String(e) : typeof e == "string" && e !== "" && !Number.isNaN(Number(e)) ? e : null, K = (e) => e == null ? null : typeof e == "string" ? e === "" ? null : e : String(e), q = (e) => K(e), se = (e) => e != null && e !== !1, J = (e) => typeof e == "object" && !!e && !Array.isArray(e), Y = (e) => typeof e == "string" && e.trim() ? e.trim() : void 0, ce = (e) => J(e) && typeof e.type == "string" && typeof e.id == "string", le = (e) => Array.isArray(e) ? e.flatMap((e) => {
139
+ if (!J(e)) return [];
140
+ let t = Y(e.id);
141
+ if (!t) return [];
142
+ let n = Y(e.label) ?? t, r = Y(e.icon), i = ce(e.resource) ? e.resource : void 0;
143
+ return [{
144
+ id: t,
145
+ label: n,
146
+ ...r ? { icon: r } : {},
147
+ ...i ? { resource: i } : {}
148
+ }];
149
+ }) : [], X = (e, t, n, r) => {
150
+ if (e.display?.kind !== "badge-list") return null;
151
+ let i = le(n.attributes[e.display.itemsAttributeId]);
152
+ if (i.length === 0) return null;
153
+ let a = typeof t == "string" ? t : void 0, o = i.find((e) => e.id === a) ?? i[0];
154
+ return o ? [o, ...i.filter((e) => e.id !== o.id)].map((e) => j(B, {
155
+ key: e.id,
156
+ label: e.label,
157
+ icon: e.icon,
158
+ onClick: e.resource && r ? () => r(e.resource) : void 0
159
+ })) : null;
160
+ }, Z = (e, t) => {
161
+ let n = e.type, r = o(t, e);
162
+ if (e.render || e.display) return null;
163
+ if (n.kind === "enum") return H(e, n, r);
164
+ if (n.kind === "enum-multi") return U(e, n, r);
165
+ if (n.kind === "date") {
166
+ let t = W(r);
167
+ return t ? {
168
+ attributeId: e.id,
169
+ label: t
170
+ } : null;
171
+ }
172
+ if (n.kind === "number") {
173
+ let t = G(r);
174
+ return t ? {
175
+ attributeId: e.id,
176
+ label: t
177
+ } : null;
178
+ }
179
+ if (n.kind === "user") {
180
+ let t = q(r);
181
+ return t ? {
182
+ attributeId: e.id,
183
+ label: t,
184
+ color: "blue"
185
+ } : null;
186
+ }
187
+ let i = K(r);
188
+ return i ? {
189
+ attributeId: e.id,
190
+ label: i
191
+ } : null;
192
+ }, ue = (e, t, n) => {
193
+ let i = [];
194
+ for (let a of n) {
195
+ let n = r(t, a);
196
+ if (!n || n.displayable === !1) continue;
197
+ let o = Z(n, e);
198
+ o && i.push(o);
199
+ }
200
+ return i;
201
+ }, de = (e, t, n) => {
202
+ let i = [];
203
+ for (let a of n) {
204
+ let n = r(t, a);
205
+ if (!n || n.displayable === !1) continue;
206
+ let s = o(e, n), c = n.render ? n.render(s, e) : X(n, s, e);
207
+ se(c) && i.push(c);
208
+ }
209
+ return i;
210
+ }, Q = (e, t) => {
211
+ let n = /* @__PURE__ */ new Set();
212
+ for (let r of e) for (let e of d(r, t)) n.add(e);
213
+ return n;
214
+ }, fe = (e, t) => {
215
+ let r = [];
216
+ for (let a of e) {
217
+ if (!a.filterable) continue;
218
+ if (a.type.kind === "enum" || a.type.kind === "enum-multi") {
219
+ let e = i(a.type), o = Q(t, a), s = new Set(e.map((e) => e.value)), c = [...o].filter((e) => !s.has(e)).sort((e, t) => e.localeCompare(t, void 0, { numeric: !0 })).map((e) => ({
220
+ value: e,
221
+ label: n(e)
222
+ }));
223
+ r.push({
224
+ id: a.id,
225
+ label: a.label,
226
+ selectionMode: "multiple",
227
+ options: [...e.map((e) => ({
228
+ value: e.value,
229
+ label: e.label,
230
+ color: e.color,
231
+ icon: e.icon
232
+ })), ...c]
233
+ });
234
+ continue;
235
+ }
236
+ let e = [...Q(t, a)].sort((e, t) => e.localeCompare(t, void 0, { numeric: !0 })).map((e) => ({
237
+ value: e,
238
+ label: n(e)
239
+ }));
240
+ r.push({
241
+ id: a.id,
242
+ label: a.label,
243
+ selectionMode: "multiple",
244
+ options: e
245
+ });
246
+ }
247
+ return r;
248
+ }, pe = (e) => {
249
+ let t = [{
250
+ value: a,
251
+ label: "None"
252
+ }];
253
+ for (let n of e) n.groupable && n.type.kind !== "enum-multi" && t.push({
254
+ value: n.id,
255
+ label: n.label
256
+ });
257
+ return t;
258
+ }, me = (e) => {
259
+ let t = [];
260
+ for (let n of e) n.displayable && t.push({
261
+ value: n.id,
262
+ label: n.label
263
+ });
264
+ return t;
265
+ }, he = (e, t) => t === "none" ? e.filter((e) => e.value === a) : e.filter((e) => e.value === "none" || e.value !== t), ge = (e, t) => e === "none" ? "all" : t?.columnKey, _e = (e, t, n, a = []) => {
266
+ if (e === "none") return;
267
+ let o = r(t, e);
268
+ if (!o || o.type.kind !== "enum") return;
269
+ let s = i(o.type).map((e) => e.value), l = _(o);
270
+ if (a.some((e) => g(e, o) === l) && s.push(l), n?.conjunction !== "and") return s;
271
+ let u = s.map((t) => ({
272
+ id: t,
273
+ title: t,
274
+ attributes: t === l ? {} : { [e]: t }
275
+ }));
276
+ return c(u, {
277
+ conjunction: "and",
278
+ rules: n.rules.filter((t) => t.attributeId === e)
279
+ }, [o]).map((e) => e.id);
280
+ }, ve = (e) => {
281
+ let t = E(2), n;
282
+ return t[0] === e.children ? n = t[1] : (n = /* @__PURE__ */ O(T, {
283
+ paddingX: "xs",
284
+ paddingTop: "xs",
285
+ paddingBottom: "2xs",
286
+ textStyle: "label/XS/medium",
287
+ color: "fg.muted",
288
+ children: e.children
289
+ }), t[0] = e.children, t[1] = n), n;
290
+ }, $ = (e) => {
291
+ let t = E(21), n;
292
+ t[0] !== e.label || t[1] !== e.options || t[2] !== e.value ? (n = e.options.find((t) => t.value === e.value)?.label ?? e.label, t[0] = e.label, t[1] = e.options, t[2] = e.value, t[3] = n) : n = t[3];
293
+ let r = n, i = e.options[0]?.value === "none", a;
294
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (a = {
295
+ strategy: "fixed",
296
+ hideWhenDetached: !0
297
+ }, t[4] = a) : a = t[4];
298
+ let o;
299
+ t[5] === e.label ? o = t[6] : (o = /* @__PURE__ */ O(T, {
300
+ textStyle: "label/S/regular",
301
+ children: e.label
302
+ }), t[5] = e.label, t[6] = o);
303
+ let s;
304
+ t[7] === r ? s = t[8] : (s = /* @__PURE__ */ O(b, {
305
+ marginLeft: "auto",
306
+ minW: "0",
307
+ gap: "2xs",
308
+ color: "fg.muted",
309
+ children: /* @__PURE__ */ O(T, {
310
+ textStyle: "label/S/regular",
311
+ truncate: !0,
312
+ children: r
313
+ })
314
+ }), t[7] = r, t[8] = s);
315
+ let c;
316
+ t[9] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ O(F, { size: 12 }), t[9] = c) : c = t[9];
317
+ let l;
318
+ t[10] !== o || t[11] !== s ? (l = /* @__PURE__ */ O(S.Trigger, {
319
+ asChild: !0,
320
+ children: /* @__PURE__ */ k(y, {
321
+ size: "xs",
322
+ variant: "ghost",
323
+ width: "full",
324
+ justifyContent: "flex-start",
325
+ gap: "xs",
326
+ children: [
327
+ o,
328
+ s,
329
+ c
330
+ ]
331
+ })
332
+ }), t[10] = o, t[11] = s, t[12] = l) : l = t[12];
333
+ let u;
334
+ t[13] !== i || t[14] !== e ? (u = e.options.map((t, n) => /* @__PURE__ */ k(A, { children: [i && n === 1 ? /* @__PURE__ */ O(S.Separator, {}) : null, /* @__PURE__ */ O(S.Item, {
335
+ value: t.value,
336
+ onClick: () => e.onSelect(t.value),
337
+ children: /* @__PURE__ */ k(b, {
338
+ width: "full",
339
+ gap: "xs",
340
+ children: [/* @__PURE__ */ O(T, {
341
+ textStyle: "label/S/regular",
342
+ children: t.label
343
+ }), t.value === e.value ? /* @__PURE__ */ O(x, {
344
+ as: P,
345
+ marginLeft: "auto",
346
+ boxSize: "0.875rem"
347
+ }) : null]
348
+ })
349
+ })] }, t.value)), t[13] = i, t[14] = e, t[15] = u) : u = t[15];
350
+ let d;
351
+ t[16] === u ? d = t[17] : (d = /* @__PURE__ */ O(S.Positioner, { children: /* @__PURE__ */ O(S.Content, { children: u }) }), t[16] = u, t[17] = d);
352
+ let f;
353
+ return t[18] !== l || t[19] !== d ? (f = /* @__PURE__ */ k(S.Root, {
354
+ positioning: a,
355
+ children: [l, d]
356
+ }), t[18] = l, t[19] = d, t[20] = f) : f = t[20], f;
357
+ }, ye = (t) => {
358
+ let n = E(56), { settings: r, groupingOptions: i, displayPropertyOptions: a, onViewModeChange: o, onColumnGroupingChange: s, onRowGroupingChange: c, onDisplayPropertyToggle: l } = t, u = M(null), d = M(null), [f, p] = re(!1), m, h;
359
+ n[0] === f ? (m = n[1], h = n[2]) : (m = () => {
360
+ if (!f) return;
361
+ let e = (e) => {
362
+ let t = e.target;
363
+ t instanceof Node && (d.current?.contains(t) || u.current?.contains(t) || p(!1));
364
+ };
365
+ return document.addEventListener("pointerdown", e), () => document.removeEventListener("pointerdown", e);
366
+ }, h = [f], n[0] = f, n[1] = m, n[2] = h), ne(m, h);
367
+ let g, _;
368
+ n[3] === Symbol.for("react.memo_cache_sentinel") ? (g = {
369
+ placement: "bottom-end",
370
+ offset: { mainAxis: 8 },
371
+ getAnchorElement: () => u.current
372
+ }, _ = (e) => p(e.open), n[3] = g, n[4] = _) : (g = n[3], _ = n[4]);
373
+ let v;
374
+ n[5] === Symbol.for("react.memo_cache_sentinel") ? (v = /* @__PURE__ */ O(e, {
375
+ content: "Display",
376
+ children: /* @__PURE__ */ O(C.Trigger, {
377
+ asChild: !0,
378
+ children: /* @__PURE__ */ O(ee, {
379
+ ref: u,
380
+ "aria-label": "Display settings",
381
+ variant: "ghost",
382
+ size: "2xs",
383
+ children: /* @__PURE__ */ O(x, { as: ae })
384
+ })
385
+ })
386
+ }), n[5] = v) : v = n[5];
387
+ let S;
388
+ n[6] === Symbol.for("react.memo_cache_sentinel") ? (S = /* @__PURE__ */ O(ve, { children: "DISPLAY" }), n[6] = S) : S = n[6];
389
+ let w = r.viewMode === "list", T;
390
+ n[7] === o ? T = n[8] : (T = () => o("list"), n[7] = o, n[8] = T);
391
+ let D;
392
+ n[9] === Symbol.for("react.memo_cache_sentinel") ? (D = /* @__PURE__ */ O(ie, {}), n[9] = D) : D = n[9];
393
+ let A;
394
+ n[10] !== w || n[11] !== T ? (A = /* @__PURE__ */ k(y, {
395
+ flex: "1",
396
+ size: "2xs",
397
+ variant: "ghost",
398
+ "aria-pressed": w,
399
+ onClick: T,
400
+ children: [D, "List"]
401
+ }), n[10] = w, n[11] = T, n[12] = A) : A = n[12];
402
+ let j = r.viewMode === "board", N;
403
+ n[13] === o ? N = n[14] : (N = () => o("board"), n[13] = o, n[14] = N);
404
+ let P;
405
+ n[15] === Symbol.for("react.memo_cache_sentinel") ? (P = /* @__PURE__ */ O(oe, {}), n[15] = P) : P = n[15];
406
+ let F;
407
+ n[16] !== j || n[17] !== N ? (F = /* @__PURE__ */ k(y, {
408
+ flex: "1",
409
+ size: "2xs",
410
+ variant: "ghost",
411
+ "aria-pressed": j,
412
+ onClick: N,
413
+ children: [P, "Board"]
414
+ }), n[16] = j, n[17] = N, n[18] = F) : F = n[18];
415
+ let I;
416
+ n[19] !== F || n[20] !== A ? (I = /* @__PURE__ */ k(b, {
417
+ borderRadius: "sm",
418
+ bg: "bg.subtle",
419
+ padding: "2xs",
420
+ gap: "2xs",
421
+ children: [A, F]
422
+ }), n[19] = F, n[20] = A, n[21] = I) : I = n[21];
423
+ let L;
424
+ n[22] !== s || n[23] !== c || n[24] !== r.rowGrouping ? (L = (e) => {
425
+ s(e), (e === "none" || e === r.rowGrouping) && c("none");
426
+ }, n[22] = s, n[23] = c, n[24] = r.rowGrouping, n[25] = L) : L = n[25];
427
+ let R;
428
+ n[26] !== i || n[27] !== r.columnGrouping || n[28] !== L ? (R = /* @__PURE__ */ O($, {
429
+ label: "Grouping",
430
+ value: r.columnGrouping,
431
+ options: i,
432
+ onSelect: L
433
+ }), n[26] = i, n[27] = r.columnGrouping, n[28] = L, n[29] = R) : R = n[29];
434
+ let z = r.rowGrouping, B;
435
+ n[30] !== i || n[31] !== r.columnGrouping ? (B = he(i, r.columnGrouping), n[30] = i, n[31] = r.columnGrouping, n[32] = B) : B = n[32];
436
+ let V;
437
+ n[33] !== c || n[34] !== r.rowGrouping || n[35] !== B ? (V = /* @__PURE__ */ O($, {
438
+ label: "Sub-grouping",
439
+ value: z,
440
+ options: B,
441
+ onSelect: c
442
+ }), n[33] = c, n[34] = r.rowGrouping, n[35] = B, n[36] = V) : V = n[36];
443
+ let H = t.sortControl, U;
444
+ n[37] === Symbol.for("react.memo_cache_sentinel") ? (U = /* @__PURE__ */ O(ve, { children: "PROPERTIES" }), n[37] = U) : U = n[37];
445
+ let W;
446
+ if (n[38] !== a || n[39] !== l || n[40] !== r.displayProperties) {
447
+ let e;
448
+ n[42] !== l || n[43] !== r.displayProperties ? (e = (e) => {
449
+ let t = r.displayProperties.includes(e.value);
450
+ return /* @__PURE__ */ O(y, {
451
+ size: "2xs",
452
+ variant: "ghost",
453
+ "aria-pressed": t,
454
+ onClick: () => l(e.value),
455
+ children: e.label
456
+ }, e.value);
457
+ }, n[42] = l, n[43] = r.displayProperties, n[44] = e) : e = n[44], W = a.map(e), n[38] = a, n[39] = l, n[40] = r.displayProperties, n[41] = W;
458
+ } else W = n[41];
459
+ let G;
460
+ n[45] === W ? G = n[46] : (G = /* @__PURE__ */ O(b, {
461
+ paddingX: "xs",
462
+ paddingBottom: "xs",
463
+ flexWrap: "wrap",
464
+ gap: "2xs",
465
+ children: W
466
+ }), n[45] = W, n[46] = G);
467
+ let K;
468
+ n[47] !== t.sortControl || n[48] !== I || n[49] !== R || n[50] !== V || n[51] !== G ? (K = /* @__PURE__ */ O(te, { children: /* @__PURE__ */ O(C.Positioner, { children: /* @__PURE__ */ k(C.Content, {
469
+ ref: d,
470
+ width: "18.75rem",
471
+ padding: "xs",
472
+ gap: "1px",
473
+ children: [
474
+ S,
475
+ I,
476
+ R,
477
+ V,
478
+ H,
479
+ U,
480
+ G
481
+ ]
482
+ }) }) }), n[47] = t.sortControl, n[48] = I, n[49] = R, n[50] = V, n[51] = G, n[52] = K) : K = n[52];
483
+ let q;
484
+ return n[53] !== f || n[54] !== K ? (q = /* @__PURE__ */ k(C.Root, {
485
+ open: f,
486
+ closeOnInteractOutside: !1,
487
+ positioning: g,
488
+ onOpenChange: _,
489
+ children: [v, K]
490
+ }), n[53] = f, n[54] = K, n[55] = q) : q = n[55], q;
491
+ }, be = (e) => {
492
+ let n = E(9), { search: r, onClearSearch: i } = e, a;
493
+ n[0] === Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ O(x, { as: I }), n[0] = a) : a = n[0];
494
+ let o;
495
+ n[1] === r ? o = n[2] : (o = r.trim(), n[1] = r, n[2] = o);
496
+ let s = `No results for “${o}”`, c;
497
+ n[3] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ O(L, {}), n[3] = c) : c = n[3];
498
+ let l;
499
+ n[4] === i ? l = n[5] : (l = /* @__PURE__ */ k(y, {
500
+ size: "2xs",
501
+ variant: "outline",
502
+ onClick: i,
503
+ children: [c, " Clear search"]
504
+ }), n[4] = i, n[5] = l);
505
+ let u;
506
+ return n[6] !== s || n[7] !== l ? (u = /* @__PURE__ */ O(t, {
507
+ h: "full",
508
+ icon: a,
509
+ title: s,
510
+ description: "Search looks at the titles and properties this view shows.",
511
+ children: l
512
+ }), n[6] = s, n[7] = l, n[8] = u) : u = n[8], u;
513
+ }, xe = (e) => {
514
+ let t = E(15), { fields: n, sorts: r, onSortsChange: i } = e, a = r[0], o;
515
+ if (t[0] !== n || t[1] !== i || t[2] !== a) {
516
+ let e = a ? f(n, a.attributeId) : void 0, r;
517
+ t[4] === Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ O(T, {
518
+ textStyle: "label/S/regular",
519
+ flex: "1",
520
+ children: "Ordering"
521
+ }), t[4] = r) : r = t[4];
522
+ let s = a ? `field:${a.attributeId}` : "none", c;
523
+ t[5] === Symbol.for("react.memo_cache_sentinel") ? (c = {
524
+ value: "none",
525
+ label: "None"
526
+ }, t[5] = c) : c = t[5];
527
+ let u;
528
+ t[6] === n ? u = t[7] : (u = [c, ...n.filter(p).map(Se)], t[6] = n, t[7] = u);
529
+ let d;
530
+ t[8] !== i || t[9] !== a?.direction ? (d = (e) => i(e === "none" ? [] : [{
531
+ attributeId: e.slice(6),
532
+ direction: a?.direction ?? "asc"
533
+ }]), t[8] = i, t[9] = a?.direction, t[10] = d) : d = t[10];
534
+ let h;
535
+ t[11] !== s || t[12] !== u || t[13] !== d ? (h = /* @__PURE__ */ k(b, {
536
+ paddingX: "xs",
537
+ minH: "7",
538
+ gap: "xs",
539
+ children: [r, /* @__PURE__ */ O(l, {
540
+ "aria-label": "Ordering",
541
+ width: "9rem",
542
+ value: s,
543
+ options: u,
544
+ onSelect: d
545
+ })]
546
+ }), t[11] = s, t[12] = u, t[13] = d, t[14] = h) : h = t[14], o = /* @__PURE__ */ k(w, {
547
+ "data-testid": "display-sort-control",
548
+ gap: "1px",
549
+ children: [h, a ? /* @__PURE__ */ k(b, {
550
+ paddingX: "xs",
551
+ minH: "7",
552
+ gap: "xs",
553
+ children: [/* @__PURE__ */ O(T, {
554
+ textStyle: "label/S/regular",
555
+ flex: "1",
556
+ children: "Direction"
557
+ }), /* @__PURE__ */ O(l, {
558
+ "aria-label": "Sort direction",
559
+ width: "9rem",
560
+ value: a.direction,
561
+ options: [{
562
+ value: "asc",
563
+ label: m(e, "asc")
564
+ }, {
565
+ value: "desc",
566
+ label: m(e, "desc")
567
+ }],
568
+ onSelect: (e) => i([{
569
+ ...a,
570
+ direction: e
571
+ }])
572
+ })]
573
+ }) : null]
574
+ }), t[0] = n, t[1] = i, t[2] = a, t[3] = o;
575
+ } else o = t[3];
576
+ return o;
577
+ };
578
+ function Se(e) {
579
+ return {
580
+ value: `field:${e.id}`,
581
+ label: e.label,
582
+ icon: u(e)
583
+ };
584
+ }
585
+ //#endregion
586
+ export { me as a, ue as c, X as d, _e as f, $ as i, de as l, be as n, fe as o, ge as p, ye as r, pe as s, xe as t, Z as u };
587
+
588
+ //# sourceMappingURL=display-sort-control-f3rbILsV.js.map