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