@bfrs/agentic-components 0.7.9 → 0.8.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.
@@ -1,48 +1,50 @@
1
- import { jsxs as s, jsx as r, Fragment as Te } from "react/jsx-runtime";
2
- import { Root as _e, Portal as Re, Overlay as _t, Content as Rt, Title as Ct, Description as kt } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
- import { Root as At, Trigger as zt, Portal as Vt, Content as It } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
4
- import { BookmarkSimple as Ce } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
5
- import { CaretDown as Wt } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
6
- import { DotsThreeVertical as Ot } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
7
- import { Info as Bt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
8
- import { PencilSimple as Ht } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
9
- import { Star as le } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
10
- import { Trash as Ft } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
11
- import { useRef as k, useMemo as ie, useState as m, useId as Lt, useEffect as j, useCallback as N } from "react";
1
+ import { jsxs as s, jsx as r, Fragment as _e } from "react/jsx-runtime";
2
+ import { Root as Re, Portal as Ce, Overlay as Tt, Content as _t, Title as Rt, Description as Ct } from "../../../node_modules/@radix-ui/react-dialog/dist/index.js";
3
+ import { Root as kt, Trigger as At, Portal as zt, Content as Vt } from "../../../node_modules/@radix-ui/react-popover/dist/index.js";
4
+ import { BookmarkSimple as ke } from "../../../node_modules/@phosphor-icons/react/dist/csr/BookmarkSimple.es.js";
5
+ import { CaretDown as It } from "../../../node_modules/@phosphor-icons/react/dist/csr/CaretDown.es.js";
6
+ import { DotsThreeVertical as Wt } from "../../../node_modules/@phosphor-icons/react/dist/csr/DotsThreeVertical.es.js";
7
+ import { Info as Ht } from "../../../node_modules/@phosphor-icons/react/dist/csr/Info.es.js";
8
+ import { PencilSimple as Ot } from "../../../node_modules/@phosphor-icons/react/dist/csr/PencilSimple.es.js";
9
+ import { Star as se } from "../../../node_modules/@phosphor-icons/react/dist/csr/Star.es.js";
10
+ import { Trash as Bt } from "../../../node_modules/@phosphor-icons/react/dist/csr/Trash.es.js";
11
+ import { useRef as k, useMemo as ae, useState as m, useId as Ft, useEffect as j, useCallback as N } from "react";
12
12
  import n from "@emotion/styled";
13
- import { IconButton as Dt, Button as M } from "../../primitives/Button/Button.js";
14
- import { twRing as $, twTransform as He, kfContentIn as Pt, kfOverlayIn as Et, kfModalContentIn as jt } from "../../../lib/emotionTw.js";
15
- import { floatingCollisionPadding as Nt } from "../../ui/overlays/overlayPositioning.js";
16
- import { createTableViewSelectorStore as Mt, isReservedViewName as ke } from "./viewStore.js";
17
- import { BfrsPortalScope as ae } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
18
- import { Tooltip as $t } from "../../ui/overlays/Tooltip/Tooltip.js";
19
- import { ActionMenu as Kt } from "../../navigation/ActionMenu/ActionMenu.js";
13
+ import { IconButton as Lt, Button as M } from "../../primitives/Button/Button.js";
14
+ import { twRing as K, twTransform as Fe, kfContentIn as Dt, kfOverlayIn as Pt, kfModalContentIn as Et } from "../../../lib/emotionTw.js";
15
+ import { floatingCollisionPadding as jt } from "../../ui/overlays/overlayPositioning.js";
16
+ import { createTableViewSelectorStore as Nt, isReservedViewName as Ae } from "./viewStore.js";
17
+ import { BfrsPortalScope as le } from "../../ui/providers/BfrsProvider/BfrsProvider.js";
18
+ import { Tooltip as Mt } from "../../ui/overlays/Tooltip/Tooltip.js";
19
+ import { ActionMenu as $t } from "../../navigation/ActionMenu/ActionMenu.js";
20
20
  const A = {
21
21
  "--tw-text-opacity": "1",
22
22
  color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
23
- }, Fe = {
23
+ }, Kt = {
24
24
  "--tw-text-opacity": "1",
25
25
  color: "hsl(var(--bfrs-color-text-secondary) / var(--tw-text-opacity, 1))"
26
26
  }, z = {
27
27
  "--tw-text-opacity": "1",
28
28
  color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
29
- }, se = {
29
+ }, ce = {
30
30
  "--tw-bg-opacity": "1",
31
31
  backgroundColor: "hsl(var(--bfrs-color-surface-card) / var(--tw-bg-opacity, 1))"
32
- }, Le = {
32
+ }, $ = {
33
33
  "--tw-bg-opacity": "1",
34
34
  backgroundColor: "hsl(var(--bfrs-color-primary-soft) / var(--tw-bg-opacity, 1))"
35
35
  }, qt = {
36
+ backgroundColor: "var(--bfrs-sidenav-row-active-hover-bg, var(--bfrs-dcl-color-accent-light))"
37
+ }, Ut = {
36
38
  backgroundColor: "#F6F9F6"
37
- }, ce = {
39
+ }, de = {
38
40
  "--tw-border-opacity": "1",
39
41
  borderColor: "hsl(var(--bfrs-color-border) / var(--tw-border-opacity, 1))"
40
- }, Ut = /* @__PURE__ */ n("div", {
42
+ }, Yt = /* @__PURE__ */ n("div", {
41
43
  label: "AgenticTableViewSelector-root"
42
44
  })({
43
45
  display: "inline-flex",
44
46
  minWidth: "0px"
45
- }), Yt = /* @__PURE__ */ n("button", {
47
+ }), Gt = /* @__PURE__ */ n("button", {
46
48
  label: "AgenticTableViewSelector-trigger",
47
49
  shouldForwardProp: (o) => o !== "ownerState"
48
50
  })(({ ownerState: o }) => [
@@ -55,7 +57,7 @@ const A = {
55
57
  gap: ".5rem",
56
58
  borderRadius: "7px",
57
59
  borderWidth: "1px",
58
- ...qt,
60
+ ...Ut,
59
61
  paddingLeft: ".75rem",
60
62
  paddingRight: ".75rem",
61
63
  fontSize: "12px",
@@ -67,8 +69,8 @@ const A = {
67
69
  transitionProperty: "color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter",
68
70
  transitionTimingFunction: "cubic-bezier(0,0,.2,1)",
69
71
  transitionDuration: ".15s",
70
- "&:hover": Le,
71
- "&:focus-visible": $("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
72
+ "&:hover": $,
73
+ "&:focus-visible": K("2px", "hsl(var(--bfrs-color-border-focus) / .25)"),
72
74
  "&:disabled": {
73
75
  pointerEvents: "none",
74
76
  opacity: ".55"
@@ -85,9 +87,9 @@ const A = {
85
87
  o.open || o.filled || o.defaultSelected ? {
86
88
  "--tw-border-opacity": "1",
87
89
  borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))"
88
- } : ce,
90
+ } : de,
89
91
  o.empty && z
90
- ]), Gt = /* @__PURE__ */ n("span", {
92
+ ]), Jt = /* @__PURE__ */ n("span", {
91
93
  label: "AgenticTableViewSelector-triggerLabel"
92
94
  })({
93
95
  minWidth: "0px",
@@ -95,13 +97,13 @@ const A = {
95
97
  overflow: "hidden",
96
98
  textOverflow: "ellipsis",
97
99
  whiteSpace: "nowrap"
98
- }), Ae = /* @__PURE__ */ n(le, {
100
+ }), ze = /* @__PURE__ */ n(se, {
99
101
  label: "AgenticTableViewSelector-primaryStar"
100
102
  })({
101
103
  flexShrink: 0,
102
104
  "--tw-text-opacity": "1",
103
105
  color: "hsl(var(--bfrs-color-warning) / var(--tw-text-opacity, 1))"
104
- }), Jt = /* @__PURE__ */ n(Wt, {
106
+ }), Qt = /* @__PURE__ */ n(It, {
105
107
  label: "AgenticTableViewSelector-caret",
106
108
  shouldForwardProp: (o) => o !== "ownerState"
107
109
  })(({ ownerState: o }) => [
@@ -112,8 +114,8 @@ const A = {
112
114
  transitionTimingFunction: "cubic-bezier(.4,0,.2,1)",
113
115
  transitionDuration: ".15s"
114
116
  },
115
- o.open && He({ "--tw-rotate": "180deg" })
116
- ]), Qt = /* @__PURE__ */ n(It, {
117
+ o.open && Fe({ "--tw-rotate": "180deg" })
118
+ ]), Xt = /* @__PURE__ */ n(Vt, {
117
119
  label: "AgenticTableViewSelector-content"
118
120
  })({
119
121
  zIndex: 1e3,
@@ -121,16 +123,16 @@ const A = {
121
123
  overflow: "hidden",
122
124
  borderRadius: "var(--bfrs-radius-lg)",
123
125
  borderWidth: "1px",
126
+ ...de,
124
127
  ...ce,
125
- ...se,
126
128
  "--tw-shadow": "var(--bfrs-shadow-elevated)",
127
129
  "--tw-shadow-colored": "var(--bfrs-shadow-elevated)",
128
130
  boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
129
131
  outline: "2px solid transparent",
130
132
  outlineOffset: "2px",
131
- ...Pt,
133
+ ...Dt,
132
134
  animation: "bfrs-bfrs-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
133
- }), Xt = /* @__PURE__ */ n("div", {
135
+ }), Zt = /* @__PURE__ */ n("div", {
134
136
  label: "AgenticTableViewSelector-header"
135
137
  })({
136
138
  display: "flex",
@@ -146,7 +148,7 @@ const A = {
146
148
  letterSpacing: ".08em",
147
149
  textTransform: "uppercase",
148
150
  ...z
149
- }), Zt = /* @__PURE__ */ n("span", {
151
+ }), er = /* @__PURE__ */ n("span", {
150
152
  label: "AgenticTableViewSelector-headerInfo"
151
153
  })({
152
154
  display: "inline-flex",
@@ -165,7 +167,7 @@ const A = {
165
167
  "--tw-text-opacity": "1",
166
168
  color: "hsl(var(--bfrs-color-text-primary) / var(--tw-text-opacity, 1))"
167
169
  }
168
- }), er = /* @__PURE__ */ n("div", {
170
+ }), tr = /* @__PURE__ */ n("div", {
169
171
  label: "AgenticTableViewSelector-list"
170
172
  })({
171
173
  display: "flex",
@@ -173,7 +175,7 @@ const A = {
173
175
  flexDirection: "column",
174
176
  overflowY: "auto",
175
177
  paddingBottom: ".25rem"
176
- }), tr = /* @__PURE__ */ n("div", {
178
+ }), rr = /* @__PURE__ */ n("div", {
177
179
  label: "AgenticTableViewSelector-row"
178
180
  })({
179
181
  display: "flex",
@@ -182,7 +184,7 @@ const A = {
182
184
  gap: ".375rem",
183
185
  paddingLeft: ".5rem",
184
186
  paddingRight: ".625rem"
185
- }), rr = /* @__PURE__ */ n("button", {
187
+ }), or = /* @__PURE__ */ n("button", {
186
188
  label: "AgenticTableViewSelector-viewButton",
187
189
  shouldForwardProp: (o) => o !== "ownerState"
188
190
  })(({ ownerState: o }) => [
@@ -205,13 +207,15 @@ const A = {
205
207
  ...A,
206
208
  outline: "2px solid transparent",
207
209
  outlineOffset: "2px",
208
- "&:hover": Fe,
209
- "&:focus-visible": $("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
210
+ "&:hover": $,
211
+ "&:focus-visible": K("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
210
212
  },
211
213
  o.selected && {
212
- fontWeight: 700
214
+ ...$,
215
+ fontWeight: 700,
216
+ "&:hover": qt
213
217
  }
214
- ]), or = /* @__PURE__ */ n("span", {
218
+ ]), nr = /* @__PURE__ */ n("span", {
215
219
  label: "AgenticTableViewSelector-name"
216
220
  })({
217
221
  minWidth: "0px",
@@ -219,13 +223,13 @@ const A = {
219
223
  overflow: "hidden",
220
224
  textOverflow: "ellipsis",
221
225
  whiteSpace: "nowrap"
222
- }), nr = /* @__PURE__ */ n("div", {
226
+ }), ir = /* @__PURE__ */ n("div", {
223
227
  label: "AgenticTableViewSelector-divider"
224
228
  })({
225
229
  height: "1px",
226
230
  "--tw-bg-opacity": "1",
227
231
  backgroundColor: "hsl(var(--bfrs-color-border-light) / var(--tw-bg-opacity, 1))"
228
- }), ir = /* @__PURE__ */ n("button", {
232
+ }), ar = /* @__PURE__ */ n("button", {
229
233
  label: "AgenticTableViewSelector-resetButton"
230
234
  })({
231
235
  display: "flex",
@@ -238,12 +242,12 @@ const A = {
238
242
  fontSize: ".75rem",
239
243
  lineHeight: "1rem",
240
244
  fontWeight: 500,
241
- ...Fe,
245
+ ...Kt,
242
246
  outline: "2px solid transparent",
243
247
  outlineOffset: "2px",
244
- "&:hover": Le,
245
- "&:focus-visible": $("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
246
- }), ze = /* @__PURE__ */ n("div", {
248
+ "&:hover": $,
249
+ "&:focus-visible": K("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
250
+ }), Ve = /* @__PURE__ */ n("div", {
247
251
  label: "AgenticTableViewSelector-empty"
248
252
  })({
249
253
  paddingLeft: ".75rem",
@@ -253,16 +257,16 @@ const A = {
253
257
  fontSize: ".75rem",
254
258
  lineHeight: "1rem",
255
259
  ...z
256
- }), Ve = /* @__PURE__ */ n(_t, {
260
+ }), Ie = /* @__PURE__ */ n(Tt, {
257
261
  label: "AgenticTableViewSelector-renameOverlay"
258
262
  })({
259
263
  position: "fixed",
260
264
  inset: 0,
261
265
  zIndex: 1050,
262
266
  backgroundColor: "hsl(var(--bfrs-color-text-primary) / .45)",
263
- ...Et,
267
+ ...Pt,
264
268
  animation: "bfrs-bfrs-overlay-in var(--bfrs-motion-fast) var(--bfrs-ease-out)"
265
- }), Ie = /* @__PURE__ */ n(Rt, {
269
+ }), We = /* @__PURE__ */ n(_t, {
266
270
  label: "AgenticTableViewSelector-renameContent"
267
271
  })({
268
272
  position: "fixed",
@@ -275,8 +279,8 @@ const A = {
275
279
  overflow: "auto",
276
280
  borderRadius: "var(--bfrs-radius-lg)",
277
281
  borderWidth: "1px",
282
+ ...de,
278
283
  ...ce,
279
- ...se,
280
284
  padding: "1.25rem",
281
285
  ...A,
282
286
  "--tw-shadow": "var(--bfrs-shadow-overlay)",
@@ -284,24 +288,24 @@ const A = {
284
288
  boxShadow: "var(--tw-ring-offset-shadow, 0 0 #0000),var(--tw-ring-shadow, 0 0 #0000),var(--tw-shadow)",
285
289
  outline: "2px solid transparent",
286
290
  outlineOffset: "2px",
287
- ...He({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
288
- ...jt,
291
+ ...Fe({ "--tw-translate-x": "-50%", "--tw-translate-y": "-50%" }),
292
+ ...Et,
289
293
  animation: "bfrs-bfrs-modal-content-in var(--bfrs-motion-normal) var(--bfrs-ease-out)"
290
- }), We = /* @__PURE__ */ n(Ct, {
294
+ }), He = /* @__PURE__ */ n(Rt, {
291
295
  label: "AgenticTableViewSelector-renameTitle"
292
296
  })({
293
297
  fontSize: "1.125rem",
294
298
  lineHeight: "1.5rem",
295
299
  fontWeight: 700,
296
300
  ...A
297
- }), Oe = /* @__PURE__ */ n(kt, {
301
+ }), Oe = /* @__PURE__ */ n(Ct, {
298
302
  label: "AgenticTableViewSelector-renameDescription"
299
303
  })({
300
304
  marginTop: ".25rem",
301
305
  fontSize: ".75rem",
302
306
  lineHeight: "1.25rem",
303
307
  ...z
304
- }), ar = /* @__PURE__ */ n("label", {
308
+ }), lr = /* @__PURE__ */ n("label", {
305
309
  label: "AgenticTableViewSelector-renameLabel"
306
310
  })({
307
311
  display: "block",
@@ -310,7 +314,7 @@ const A = {
310
314
  lineHeight: "1rem",
311
315
  fontWeight: 700,
312
316
  ...A
313
- }), lr = /* @__PURE__ */ n("input", {
317
+ }), sr = /* @__PURE__ */ n("input", {
314
318
  label: "AgenticTableViewSelector-renameInput"
315
319
  })({
316
320
  marginTop: ".5rem",
@@ -320,7 +324,7 @@ const A = {
320
324
  borderWidth: "1.5px",
321
325
  "--tw-border-opacity": "1",
322
326
  borderColor: "hsl(var(--bfrs-color-border-focus) / var(--tw-border-opacity, 1))",
323
- ...se,
327
+ ...ce,
324
328
  paddingLeft: ".75rem",
325
329
  paddingRight: ".75rem",
326
330
  fontSize: ".875rem",
@@ -329,7 +333,7 @@ const A = {
329
333
  ...A,
330
334
  outline: "2px solid transparent",
331
335
  outlineOffset: "2px",
332
- "&:focus-visible": $("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
336
+ "&:focus-visible": K("2px", "hsl(var(--bfrs-color-border-focus) / .25)")
333
337
  }), Be = /* @__PURE__ */ n("div", {
334
338
  label: "AgenticTableViewSelector-renameFooter"
335
339
  })({
@@ -337,7 +341,7 @@ const A = {
337
341
  display: "flex",
338
342
  justifyContent: "flex-end",
339
343
  gap: ".625rem"
340
- }), sr = /* @__PURE__ */ n(M, {
344
+ }), cr = /* @__PURE__ */ n(M, {
341
345
  label: "AgenticTableViewSelector-renameSubmitButton"
342
346
  })({
343
347
  "&&:disabled": {
@@ -348,7 +352,7 @@ const A = {
348
352
  "--tw-text-opacity": "1",
349
353
  color: "hsl(var(--bfrs-color-text-muted) / var(--tw-text-opacity, 1))"
350
354
  }
351
- }), cr = /* @__PURE__ */ n("p", {
355
+ }), dr = /* @__PURE__ */ n("p", {
352
356
  label: "AgenticTableViewSelector-renameFieldError"
353
357
  })({
354
358
  marginTop: ".375rem",
@@ -357,14 +361,14 @@ const A = {
357
361
  "--tw-text-opacity": "1",
358
362
  color: "hsl(var(--bfrs-color-danger) / var(--tw-text-opacity, 1))"
359
363
  });
360
- function B(o, i) {
364
+ function O(o, i) {
361
365
  return i ? o.find((t) => t.view_id === i) ?? null : null;
362
366
  }
363
- function dr(o, i, t) {
367
+ function ur(o, i, t) {
364
368
  var p;
365
369
  const w = [], y = /* @__PURE__ */ new Set(), x = i ?? ((p = o.find((c) => c.is_default)) == null ? void 0 : p.view_id) ?? null, f = (c) => {
366
370
  if (!c || y.has(c)) return;
367
- const b = B(o, c);
371
+ const b = O(o, c);
368
372
  b && (w.push(b), y.add(b.view_id));
369
373
  };
370
374
  f(x), f(t);
@@ -372,14 +376,14 @@ function dr(o, i, t) {
372
376
  y.has(c.view_id) || (w.push(c), y.add(c.view_id));
373
377
  return w;
374
378
  }
375
- function ur(o) {
379
+ function mr(o) {
376
380
  return o ? [
377
381
  "api",
378
382
  o.viewType && o.tab ? "scoped" : "local",
379
383
  o.saveEndpoint || o.endpoint ? "remote-save" : "local-save"
380
384
  ].join(":") : "none";
381
385
  }
382
- function mr(o) {
386
+ function fr(o) {
383
387
  const i = () => o.current;
384
388
  return {
385
389
  get baseUrl() {
@@ -432,7 +436,7 @@ function mr(o) {
432
436
  }
433
437
  };
434
438
  }
435
- function Wr({
439
+ function Hr({
436
440
  screenName: o,
437
441
  store: i,
438
442
  saveApi: t,
@@ -443,87 +447,87 @@ function Wr({
443
447
  onViewSelect: p,
444
448
  onPrimaryViewChange: c,
445
449
  onUnsetPrimaryView: b,
446
- onRenameView: K,
447
- onDeleteView: q,
448
- onResetSavedFilters: U,
449
- onError: H,
450
- triggerLabel: De,
451
- placeholder: Pe = "Views",
452
- viewsLabel: Ee = "VIEWS",
453
- primaryHintLabel: de = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
454
- emptyLabel: je = "No saved views",
455
- loadingLabel: Ne = "Loading views",
456
- defaultViewLabel: Me = "Default",
457
- setPrimaryLabel: $e = "Set as Primary View",
458
- unsetPrimaryLabel: Ke = "Unset as Primary",
459
- renameLabel: qe = "Rename",
460
- deleteLabel: Ue = "Delete",
461
- renameTitle: Ye = "Rename view",
462
- renameDescription: ue = "Update the saved view name.",
463
- renameInputLabel: Ge = "View name",
464
- renameCancelLabel: Je = "Cancel",
465
- renameSaveLabel: Qe = "Save",
466
- deleteTitle: Xe = "Delete view",
467
- deleteDescription: Ze,
468
- deleteCancelLabel: et = "Cancel",
469
- deleteConfirmLabel: tt = "Delete",
470
- size: rt = "sm",
471
- disabled: ot = !1,
472
- className: nt,
473
- triggerClassName: it,
474
- contentClassName: at,
475
- actionMenuClassName: lt
450
+ onRenameView: q,
451
+ onDeleteView: U,
452
+ onResetSavedFilters: Y,
453
+ onError: B,
454
+ triggerLabel: Le,
455
+ placeholder: De = "Views",
456
+ viewsLabel: Pe = "VIEWS",
457
+ primaryHintLabel: ue = "Set a view as primary to load it automatically. With no primary view, the table opens in its default state.",
458
+ emptyLabel: Ee = "No saved views",
459
+ loadingLabel: je = "Loading views",
460
+ defaultViewLabel: Ne = "Default",
461
+ setPrimaryLabel: Me = "Set as Primary View",
462
+ unsetPrimaryLabel: $e = "Unset as Primary",
463
+ renameLabel: Ke = "Rename",
464
+ deleteLabel: qe = "Delete",
465
+ renameTitle: Ue = "Rename view",
466
+ renameDescription: me = "Update the saved view name.",
467
+ renameInputLabel: Ye = "View name",
468
+ renameCancelLabel: Ge = "Cancel",
469
+ renameSaveLabel: Je = "Save",
470
+ deleteTitle: Qe = "Delete view",
471
+ deleteDescription: Xe,
472
+ deleteCancelLabel: Ze = "Cancel",
473
+ deleteConfirmLabel: et = "Delete",
474
+ size: tt = "sm",
475
+ disabled: rt = !1,
476
+ className: ot,
477
+ triggerClassName: nt,
478
+ contentClassName: it,
479
+ actionMenuClassName: at
476
480
  }) {
477
- const me = k(t);
478
- me.current = t;
479
- const fe = ur(t), Y = ie(
480
- () => fe === "none" ? void 0 : mr(me),
481
- [fe]
482
- ), u = ie(
483
- () => i ?? Mt(o, Y ? { saveApi: Y } : void 0),
484
- [o, i, Y]
485
- ), F = w !== void 0, [G, J] = m(!1), [V, st] = m([]), [L, ct] = m(null), [dt, pe] = m(y ?? null), [be, he] = m(!1), [D, ge] = m(null), [I, Q] = m(""), [h, ve] = m(null), W = w ?? dt, O = k(W), P = k(F), X = k(!1), g = k(!1), S = k(null), we = Lt();
481
+ const fe = k(t);
482
+ fe.current = t;
483
+ const pe = mr(t), G = ae(
484
+ () => pe === "none" ? void 0 : fr(fe),
485
+ [pe]
486
+ ), u = ae(
487
+ () => i ?? Nt(o, G ? { saveApi: G } : void 0),
488
+ [o, i, G]
489
+ ), F = w !== void 0, [J, Q] = m(!1), [V, lt] = m([]), [L, st] = m(null), [ct, be] = m(y ?? null), [he, ge] = m(!1), [D, ve] = m(null), [I, X] = m(""), [h, we] = m(null), W = w ?? ct, H = k(W), P = k(F), Z = k(!1), g = k(!1), S = k(null), ye = Ft();
486
490
  j(() => {
487
- O.current = W, W && (g.current = !1);
491
+ H.current = W, W && (g.current = !1);
488
492
  }, [W]), j(() => {
489
493
  P.current = F;
490
494
  }, [F]), j(() => {
491
- S.current = null, X.current = !1, g.current = !1;
495
+ S.current = null, Z.current = !1, g.current = !1;
492
496
  }, [u, o]);
493
497
  const T = N(
494
498
  (e) => {
495
- H == null || H(e);
499
+ B == null || B(e);
496
500
  },
497
- [H]
501
+ [B]
498
502
  ), v = N(
499
503
  (e) => {
500
- e && (g.current = !1), P.current || pe((e == null ? void 0 : e.view_id) ?? null), f == null || f((e == null ? void 0 : e.view_id) ?? null, e), e && (p == null || p(e));
504
+ e && (g.current = !1), P.current || be((e == null ? void 0 : e.view_id) ?? null), f == null || f((e == null ? void 0 : e.view_id) ?? null, e), e && (p == null || p(e));
501
505
  },
502
506
  [f, p]
503
- ), Z = N(
507
+ ), ee = N(
504
508
  (e) => {
505
509
  v(e);
506
510
  },
507
511
  [v]
508
512
  ), _ = N(
509
513
  async (e) => {
510
- var xe;
514
+ var Se;
511
515
  const l = e === void 0 ? "__default__" : e ?? "__none__";
512
- if (((xe = S.current) == null ? void 0 : xe.key) === l) return S.current.promise;
516
+ if (((Se = S.current) == null ? void 0 : Se.key) === l) return S.current.promise;
513
517
  const d = { key: l, promise: Promise.resolve(null) };
514
518
  return S.current = d, d.promise = (async () => {
515
- he(!0);
519
+ ge(!0);
516
520
  try {
517
- const R = await u.list(), C = R.find((Tt) => Tt.is_default) ?? null, xt = e !== void 0 ? e : O.current, Se = B(R, xt), St = !g.current && (e !== void 0 || x || !P.current), ne = Se || !St ? null : B(R, C == null ? void 0 : C.view_id), E = Se ?? ne ?? null;
518
- return st(R), ct((C == null ? void 0 : C.view_id) ?? null), P.current || pe((E == null ? void 0 : E.view_id) ?? null), x && ne && e === void 0 && !O.current && !X.current && (X.current = !0, Z(ne)), E;
521
+ const R = await u.list(), C = R.find((St) => St.is_default) ?? null, yt = e !== void 0 ? e : H.current, Te = O(R, yt), xt = !g.current && (e !== void 0 || x || !P.current), ie = Te || !xt ? null : O(R, C == null ? void 0 : C.view_id), E = Te ?? ie ?? null;
522
+ return lt(R), st((C == null ? void 0 : C.view_id) ?? null), P.current || be((E == null ? void 0 : E.view_id) ?? null), x && ie && e === void 0 && !H.current && !Z.current && (Z.current = !0, ee(ie)), E;
519
523
  } catch (R) {
520
524
  return T(R), null;
521
525
  } finally {
522
- he(!1), S.current === d && (S.current = null);
526
+ ge(!1), S.current === d && (S.current = null);
523
527
  }
524
528
  })(), d.promise;
525
529
  },
526
- [Z, T, u, x, v]
530
+ [ee, T, u, x, v]
527
531
  );
528
532
  j(() => {
529
533
  const e = () => {
@@ -531,121 +535,121 @@ function Wr({
531
535
  };
532
536
  return e(), u.subscribe(e);
533
537
  }, [_, u]);
534
- const a = B(V, W) ?? (!g.current && (x || !F) ? B(V, L) : null), ut = ie(
535
- () => dr(V, L, a == null ? void 0 : a.view_id),
538
+ const a = O(V, W) ?? (!g.current && (x || !F) ? O(V, L) : null), dt = ae(
539
+ () => ur(V, L, a == null ? void 0 : a.view_id),
536
540
  [L, a == null ? void 0 : a.view_id, V]
537
- ), ye = !a && (g.current || !L), mt = De ?? (a == null ? void 0 : a.name) ?? (ye ? Me : Pe), ee = V.length > 0, ft = (e) => {
538
- J(!1), Z(e);
539
- }, pt = (e) => {
541
+ ), xe = !a && (g.current || !L), ut = Le ?? (a == null ? void 0 : a.name) ?? (xe ? Ne : De), te = V.length > 0, mt = (e) => {
542
+ Q(!1), ee(e);
543
+ }, ft = (e) => {
540
544
  u.setPrimary(e.view_id).then(async (l) => {
541
545
  const d = await _(e.view_id);
542
546
  v(d ?? l), c == null || c(l);
543
547
  }).catch(T);
544
- }, bt = (e) => {
548
+ }, pt = (e) => {
545
549
  u.unsetPrimary(e.view_id).then(async (l) => {
546
550
  const d = await _(e.view_id);
547
551
  v(d ?? l), b == null || b(l);
548
552
  }).catch(T);
549
- }, te = () => ve(null), ht = (e) => {
550
- const l = O.current === e.view_id;
553
+ }, re = () => we(null), bt = (e) => {
554
+ const l = H.current === e.view_id;
551
555
  u.remove(e.view_id).then(async () => {
552
- const d = await _(l ? null : O.current);
553
- l && v(d), q == null || q(e.view_id);
554
- }).catch(T).finally(te);
556
+ const d = await _(l ? null : H.current);
557
+ l && v(d), U == null || U(e.view_id);
558
+ }).catch(T).finally(re);
559
+ }, ht = () => {
560
+ h && bt(h);
555
561
  }, gt = () => {
556
- h && ht(h);
557
- }, vt = () => {
558
- g.current = !0, v(null), U == null || U(), J(!1);
562
+ g.current = !0, v(null), Y == null || Y(), Q(!1);
563
+ }, vt = (e) => {
564
+ ve(e), X(e.name);
565
+ }, oe = () => {
566
+ ve(null), X("");
559
567
  }, wt = (e) => {
560
- ge(e), Q(e.name);
561
- }, re = () => {
562
- ge(null), Q("");
563
- }, yt = (e) => {
564
568
  e.preventDefault();
565
569
  const l = I.trim();
566
- !D || !l || ke(l) || u.rename(D.view_id, l).then(async (d) => {
567
- await _(D.view_id), K == null || K(d), re();
570
+ !D || !l || Ae(l) || u.rename(D.view_id, l).then(async (d) => {
571
+ await _(D.view_id), q == null || q(d), oe();
568
572
  }).catch(T);
569
- }, oe = ke(I);
570
- return ee ? /* @__PURE__ */ s(Ut, { className: nt, children: [
571
- /* @__PURE__ */ s(At, { open: G, onOpenChange: J, children: [
572
- /* @__PURE__ */ r(zt, { asChild: !0, children: /* @__PURE__ */ s(
573
- Yt,
573
+ }, ne = Ae(I);
574
+ return te ? /* @__PURE__ */ s(Yt, { className: ot, children: [
575
+ /* @__PURE__ */ s(kt, { open: J, onOpenChange: Q, children: [
576
+ /* @__PURE__ */ r(At, { asChild: !0, children: /* @__PURE__ */ s(
577
+ Gt,
574
578
  {
575
579
  type: "button",
576
580
  "aria-label": "Saved views",
577
- className: it,
578
- disabled: ot,
581
+ className: nt,
582
+ disabled: rt,
579
583
  "data-filled": a ? "" : void 0,
580
- ownerState: { open: G, empty: !a, filled: !!a, defaultSelected: ye, size: rt },
584
+ ownerState: { open: J, empty: !a, filled: !!a, defaultSelected: xe, size: tt },
581
585
  children: [
582
- /* @__PURE__ */ r(Ce, { size: 13 }),
583
- /* @__PURE__ */ r(Gt, { children: mt }),
584
- a != null && a.is_default ? /* @__PURE__ */ r(Ae, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
585
- /* @__PURE__ */ r(Jt, { size: 13, ownerState: { open: G } })
586
+ /* @__PURE__ */ r(ke, { size: 13 }),
587
+ /* @__PURE__ */ r(Jt, { children: ut }),
588
+ a != null && a.is_default ? /* @__PURE__ */ r(ze, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null,
589
+ /* @__PURE__ */ r(Qt, { size: 13, ownerState: { open: J } })
586
590
  ]
587
591
  }
588
592
  ) }),
589
- /* @__PURE__ */ r(Vt, { children: /* @__PURE__ */ r(ae, { children: /* @__PURE__ */ s(
590
- Qt,
593
+ /* @__PURE__ */ r(zt, { children: /* @__PURE__ */ r(le, { children: /* @__PURE__ */ s(
594
+ Xt,
591
595
  {
592
596
  align: "start",
593
597
  sideOffset: 8,
594
- collisionPadding: Nt,
595
- className: at,
598
+ collisionPadding: jt,
599
+ className: it,
596
600
  children: [
597
- /* @__PURE__ */ s(Xt, { children: [
598
- Ee,
599
- de ? /* @__PURE__ */ r($t, { content: de, side: "right", variant: "white", children: /* @__PURE__ */ r(Zt, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ r(Bt, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
601
+ /* @__PURE__ */ s(Zt, { children: [
602
+ Pe,
603
+ ue ? /* @__PURE__ */ r(Mt, { content: ue, side: "right", variant: "white", children: /* @__PURE__ */ r(er, { role: "img", "aria-label": "About primary views", children: /* @__PURE__ */ r(Ht, { size: 13, weight: "fill", "aria-hidden": "true" }) }) }) : null
600
604
  ] }),
601
- /* @__PURE__ */ s(er, { children: [
602
- be && !ee ? /* @__PURE__ */ r(ze, { children: Ne }) : null,
603
- !be && !ee ? /* @__PURE__ */ r(ze, { children: je }) : null,
604
- ut.map((e) => {
605
+ /* @__PURE__ */ s(tr, { children: [
606
+ he && !te ? /* @__PURE__ */ r(Ve, { children: je }) : null,
607
+ !he && !te ? /* @__PURE__ */ r(Ve, { children: Ee }) : null,
608
+ dt.map((e) => {
605
609
  const l = (a == null ? void 0 : a.view_id) === e.view_id;
606
- return /* @__PURE__ */ s(tr, { children: [
607
- /* @__PURE__ */ s(rr, { type: "button", ownerState: { selected: l }, onClick: () => ft(e), children: [
608
- /* @__PURE__ */ r(or, { children: e.name }),
609
- e.is_default ? /* @__PURE__ */ r(Ae, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
610
+ return /* @__PURE__ */ s(rr, { children: [
611
+ /* @__PURE__ */ s(or, { type: "button", ownerState: { selected: l }, onClick: () => mt(e), children: [
612
+ /* @__PURE__ */ r(nr, { children: e.name }),
613
+ e.is_default ? /* @__PURE__ */ r(ze, { size: 13, "aria-hidden": "true", "data-primary-view-indicator": "outline" }) : null
610
614
  ] }),
611
615
  /* @__PURE__ */ r(
612
- Kt,
616
+ $t,
613
617
  {
614
618
  align: "start",
615
619
  side: "right",
616
620
  size: "sm",
617
- className: lt,
621
+ className: at,
618
622
  trigger: /* @__PURE__ */ r(
619
- Dt,
623
+ Lt,
620
624
  {
621
625
  variant: "secondary",
622
626
  size: "sm",
623
- icon: /* @__PURE__ */ r(Ot, { size: 14, weight: "bold" }),
627
+ icon: /* @__PURE__ */ r(Wt, { size: 14, weight: "bold" }),
624
628
  "aria-label": `View actions for ${e.name}`
625
629
  }
626
630
  ),
627
631
  items: [
628
632
  ...e.is_system_defined ? [] : [
629
633
  e.is_default ? {
630
- label: Ke,
631
- icon: /* @__PURE__ */ r(le, { size: 16 }),
632
- onSelect: () => bt(e)
633
- } : {
634
634
  label: $e,
635
- icon: /* @__PURE__ */ r(le, { size: 16 }),
635
+ icon: /* @__PURE__ */ r(se, { size: 16 }),
636
636
  onSelect: () => pt(e)
637
+ } : {
638
+ label: Me,
639
+ icon: /* @__PURE__ */ r(se, { size: 16 }),
640
+ onSelect: () => ft(e)
637
641
  }
638
642
  ],
639
643
  {
640
- label: qe,
641
- icon: /* @__PURE__ */ r(Ht, { size: 16 }),
642
- onSelect: () => wt(e)
644
+ label: Ke,
645
+ icon: /* @__PURE__ */ r(Ot, { size: 16 }),
646
+ onSelect: () => vt(e)
643
647
  },
644
648
  {
645
- label: Ue,
646
- icon: /* @__PURE__ */ r(Ft, { size: 16 }),
649
+ label: qe,
650
+ icon: /* @__PURE__ */ r(Bt, { size: 16 }),
647
651
  destructive: !0,
648
- onSelect: () => ve(e)
652
+ onSelect: () => we(e)
649
653
  }
650
654
  ]
651
655
  }
@@ -653,53 +657,53 @@ function Wr({
653
657
  ] }, e.view_id);
654
658
  })
655
659
  ] }),
656
- /* @__PURE__ */ r(nr, {}),
657
- /* @__PURE__ */ s(ir, { type: "button", onClick: vt, children: [
658
- /* @__PURE__ */ r(Ce, { size: 16 }),
660
+ /* @__PURE__ */ r(ir, {}),
661
+ /* @__PURE__ */ s(ar, { type: "button", onClick: gt, children: [
662
+ /* @__PURE__ */ r(ke, { size: 16 }),
659
663
  /* @__PURE__ */ r("span", { children: "Switch to default" })
660
664
  ] })
661
665
  ]
662
666
  }
663
667
  ) }) })
664
668
  ] }),
665
- /* @__PURE__ */ r(_e, { open: !!D, onOpenChange: (e) => {
666
- e || re();
667
- }, children: /* @__PURE__ */ r(Re, { children: /* @__PURE__ */ s(ae, { children: [
668
- /* @__PURE__ */ r(Ve, {}),
669
- /* @__PURE__ */ r(Ie, { children: /* @__PURE__ */ s("form", { onSubmit: yt, children: [
670
- /* @__PURE__ */ r(We, { children: Ye }),
671
- ue ? /* @__PURE__ */ r(Oe, { children: ue }) : null,
672
- /* @__PURE__ */ r(ar, { htmlFor: we, children: Ge }),
669
+ /* @__PURE__ */ r(Re, { open: !!D, onOpenChange: (e) => {
670
+ e || oe();
671
+ }, children: /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ s(le, { children: [
672
+ /* @__PURE__ */ r(Ie, {}),
673
+ /* @__PURE__ */ r(We, { children: /* @__PURE__ */ s("form", { onSubmit: wt, children: [
674
+ /* @__PURE__ */ r(He, { children: Ue }),
675
+ me ? /* @__PURE__ */ r(Oe, { children: me }) : null,
676
+ /* @__PURE__ */ r(lr, { htmlFor: ye, children: Ye }),
673
677
  /* @__PURE__ */ r(
674
- lr,
678
+ sr,
675
679
  {
676
- id: we,
680
+ id: ye,
677
681
  autoFocus: !0,
678
682
  value: I,
679
- onChange: (e) => Q(e.currentTarget.value),
680
- "aria-invalid": oe
683
+ onChange: (e) => X(e.currentTarget.value),
684
+ "aria-invalid": ne
681
685
  }
682
686
  ),
683
- oe ? /* @__PURE__ */ s(cr, { children: [
687
+ ne ? /* @__PURE__ */ s(dr, { children: [
684
688
  "“",
685
689
  I.trim(),
686
690
  "” is reserved. Choose a different name."
687
691
  ] }) : null,
688
692
  /* @__PURE__ */ s(Be, { children: [
689
- /* @__PURE__ */ r(M, { type: "button", variant: "secondary", onClick: re, children: Je }),
690
- /* @__PURE__ */ r(sr, { type: "submit", disabled: I.trim().length === 0 || oe, children: Qe })
693
+ /* @__PURE__ */ r(M, { type: "button", variant: "secondary", onClick: oe, children: Ge }),
694
+ /* @__PURE__ */ r(cr, { type: "submit", disabled: I.trim().length === 0 || ne, children: Je })
691
695
  ] })
692
696
  ] }) })
693
697
  ] }) }) }),
694
- /* @__PURE__ */ r(_e, { open: !!h, onOpenChange: (e) => {
695
- e || te();
696
- }, children: /* @__PURE__ */ r(Re, { children: /* @__PURE__ */ s(ae, { children: [
697
- /* @__PURE__ */ r(Ve, {}),
698
- /* @__PURE__ */ s(Ie, { children: [
699
- /* @__PURE__ */ r(We, { children: Xe }),
700
- /* @__PURE__ */ r(Oe, { children: Ze ?? /* @__PURE__ */ s(Te, { children: [
698
+ /* @__PURE__ */ r(Re, { open: !!h, onOpenChange: (e) => {
699
+ e || re();
700
+ }, children: /* @__PURE__ */ r(Ce, { children: /* @__PURE__ */ s(le, { children: [
701
+ /* @__PURE__ */ r(Ie, {}),
702
+ /* @__PURE__ */ s(We, { children: [
703
+ /* @__PURE__ */ r(He, { children: Qe }),
704
+ /* @__PURE__ */ r(Oe, { children: Xe ?? /* @__PURE__ */ s(_e, { children: [
701
705
  "Are you sure you want to delete",
702
- h != null && h.name ? /* @__PURE__ */ s(Te, { children: [
706
+ h != null && h.name ? /* @__PURE__ */ s(_e, { children: [
703
707
  " “",
704
708
  /* @__PURE__ */ r("strong", { children: h.name }),
705
709
  "”"
@@ -707,14 +711,14 @@ function Wr({
707
711
  "? This can’t be undone."
708
712
  ] }) }),
709
713
  /* @__PURE__ */ s(Be, { children: [
710
- /* @__PURE__ */ r(M, { type: "button", variant: "secondary", onClick: te, children: et }),
711
- /* @__PURE__ */ r(M, { type: "button", variant: "danger", onClick: gt, children: tt })
714
+ /* @__PURE__ */ r(M, { type: "button", variant: "secondary", onClick: re, children: Ze }),
715
+ /* @__PURE__ */ r(M, { type: "button", variant: "danger", onClick: ht, children: et })
712
716
  ] })
713
717
  ] })
714
718
  ] }) }) })
715
719
  ] }) : null;
716
720
  }
717
721
  export {
718
- Wr as TableViewSelector
722
+ Hr as TableViewSelector
719
723
  };
720
724
  //# sourceMappingURL=TableViewSelector.js.map