@burdenoff/microfe-bigconsole 2026.825.1 → 2026.828.1

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 (41) hide show
  1. package/dist/bigconsole/assistant/attachmentExtract.js +1 -1
  2. package/dist/bigconsole/assistant/attachmentExtract.js.map +1 -1
  3. package/dist/bigconsole/components/builder/inspector/LayoutSection.js +71 -0
  4. package/dist/bigconsole/components/builder/inspector/LayoutSection.js.map +1 -0
  5. package/dist/bigconsole/components/builder/inspector/index.js +1 -0
  6. package/dist/bigconsole/components/dashboard/DashboardCanvas.js +137 -121
  7. package/dist/bigconsole/components/dashboard/DashboardCanvas.js.map +1 -1
  8. package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js +204 -93
  9. package/dist/bigconsole/components/dashboard/ExportDashboardDialog.js.map +1 -1
  10. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js +259 -133
  11. package/dist/bigconsole/components/dashboard/ShareDialog/ShareDialog.js.map +1 -1
  12. package/dist/bigconsole/components/dashboard/StoreTemplatePicker.js +87 -39
  13. package/dist/bigconsole/components/dashboard/StoreTemplatePicker.js.map +1 -1
  14. package/dist/bigconsole/components/datasink/DataSinkCard.js +88 -68
  15. package/dist/bigconsole/components/datasink/DataSinkCard.js.map +1 -1
  16. package/dist/bigconsole/components/widgets/PropertiesPanel.js +213 -199
  17. package/dist/bigconsole/components/widgets/PropertiesPanel.js.map +1 -1
  18. package/dist/bigconsole/components/workflow/WorkflowCard.js +46 -27
  19. package/dist/bigconsole/components/workflow/WorkflowCard.js.map +1 -1
  20. package/dist/bigconsole/customWidget/proposalSource.js +1 -1
  21. package/dist/bigconsole/customWidget/proposalSource.js.map +1 -1
  22. package/dist/bigconsole/hooks/useDashboardOperations.js +74 -64
  23. package/dist/bigconsole/hooks/useDashboardOperations.js.map +1 -1
  24. package/dist/bigconsole/pages/DashboardBuilderPage.js +1 -1
  25. package/dist/bigconsole/pages/DashboardsPage.js +386 -316
  26. package/dist/bigconsole/pages/DashboardsPage.js.map +1 -1
  27. package/dist/bigconsole/pages/DataSinksPage.js +251 -206
  28. package/dist/bigconsole/pages/DataSinksPage.js.map +1 -1
  29. package/dist/bigconsole/pages/InsightsPage.js +646 -378
  30. package/dist/bigconsole/pages/InsightsPage.js.map +1 -1
  31. package/dist/bigconsole/pages/WorkflowsPage.js +153 -108
  32. package/dist/bigconsole/pages/WorkflowsPage.js.map +1 -1
  33. package/dist/bigconsole/utils/format.js +18 -0
  34. package/dist/bigconsole/utils/format.js.map +1 -0
  35. package/dist/bigconsole/utils/widgetPositioning.js +1 -1
  36. package/dist/generated/wspace-operations.js +3 -0
  37. package/dist/generated/wspace-operations.js.map +1 -1
  38. package/dist/node_modules/{xlsx → @e965/xlsx}/xlsx.js +5194 -4132
  39. package/dist/node_modules/@e965/xlsx/xlsx.js.map +1 -0
  40. package/package.json +2 -2
  41. package/dist/node_modules/xlsx/xlsx.js.map +0 -1
@@ -4,7 +4,8 @@ import "../../../hooks/index.js";
4
4
  import n from "./EmbedTab.js";
5
5
  import { useCallback as r, useEffect as i, useMemo as a, useState as o } from "react";
6
6
  import { jsx as s, jsxs as c } from "react/jsx-runtime";
7
- import { createPortal as l } from "react-dom";
7
+ import { createPortal as ee } from "react-dom";
8
+ import { formatDistanceToNow as l } from "date-fns";
8
9
  //#region src/bigconsole/components/dashboard/ShareDialog/ShareDialog.tsx
9
10
  var u = (e) => ({
10
11
  bgPrimary: e ? "#1a1a2e" : "#ffffff",
@@ -18,7 +19,23 @@ var u = (e) => ({
18
19
  actionPrimaryBgHover: "#4f46e5",
19
20
  statusSuccessBg: "#22c55e",
20
21
  statusErrorText: "#ef4444"
21
- }), d = [{
22
+ }), d = [
23
+ {
24
+ value: "PRIVATE",
25
+ label: "Private",
26
+ description: "Only people added below"
27
+ },
28
+ {
29
+ value: "WORKSPACE",
30
+ label: "Workspace",
31
+ description: "Anyone in this workspace"
32
+ },
33
+ {
34
+ value: "PUBLIC",
35
+ label: "Public",
36
+ description: "Anyone with the link"
37
+ }
38
+ ], f = [{
22
39
  value: "VIEW",
23
40
  label: "View",
24
41
  description: "Can view the dashboard"
@@ -27,49 +44,60 @@ var u = (e) => ({
27
44
  label: "Edit",
28
45
  description: "Can edit widgets, layout, and share"
29
46
  }];
30
- function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
31
- let { shares: _, loading: v, fetchShares: y, shareWithUser: b, shareWithGroup: x, updateShare: S, revokeShare: C, revokeAllShares: w } = t(), T = e(), [E, D] = o(""), [O, k] = o(null), [A, j] = o("VIEW"), [M, N] = o(""), [P, F] = o(!1), [I, L] = o("people");
47
+ function p({ dashboardId: l, dashboardName: p, isOpen: m, onClose: g, visibility: _, onVisibilityChange: v, canChangeVisibility: y = !0 }) {
48
+ let { shares: b, loading: x, fetchShares: S, shareWithUser: C, shareWithGroup: w, updateShare: T, revokeShare: E, revokeAllShares: D } = t(), O = e(), [k, A] = o(""), [j, M] = o(null), [N, P] = o("VIEW"), [F, I] = o(""), [L, R] = o(!1), [z, B] = o("people"), [V, H] = o(!1), [U, W] = o(null);
32
49
  i(() => {
33
- h && f && (y(f), N(`${window.location.origin}/dashboard/${f}?shared=true`));
50
+ m && l && (S(l), I(`${window.location.origin}/dashboard/${l}?shared=true`));
34
51
  }, [
35
- h,
36
- f,
37
- y
52
+ m,
53
+ l,
54
+ S
38
55
  ]);
39
- let R = r(async () => {
40
- if (!O) return;
41
- T("bigconsole.dashboard.share_clicked", {
42
- dashboardId: f,
43
- permission: A,
44
- recipientType: O.type
56
+ let G = r(async () => {
57
+ if (!j) return;
58
+ O("bigconsole.dashboard.share_clicked", {
59
+ dashboardId: l,
60
+ permission: N,
61
+ recipientType: j.type
45
62
  });
46
63
  let e = null;
47
- O.type === "USER" ? e = await b(f, O.id, A) : O.type === "GROUP" && (e = await x(f, O.id, A)), e && T("bigconsole.dashboard.shared", {
48
- dashboardId: f,
49
- permission: A,
50
- recipientType: O.type
51
- }), k(null), D("");
64
+ j.type === "USER" ? e = await C(l, j.id, N) : j.type === "GROUP" && (e = await w(l, j.id, N)), e && O("bigconsole.dashboard.shared", {
65
+ dashboardId: l,
66
+ permission: N,
67
+ recipientType: j.type
68
+ }), M(null), A("");
52
69
  }, [
53
- f,
54
- T,
70
+ l,
55
71
  O,
56
- A,
57
- x,
58
- b
59
- ]), z = r(async (e, t) => {
60
- await S({
72
+ j,
73
+ N,
74
+ w,
75
+ C
76
+ ]), K = r(async (e, t) => {
77
+ await T({
61
78
  id: e,
62
79
  permission: t
63
80
  });
64
- }, [S]), B = r(async (e) => {
65
- window.confirm("Are you sure you want to revoke this access?") && await C(e);
66
- }, [C]), V = r(async () => {
67
- window.confirm("Are you sure you want to revoke all shared access?") && await w(f);
68
- }, [f, w]), H = r(async () => {
81
+ }, [T]), q = r(async (e) => {
82
+ window.confirm("Are you sure you want to revoke this access?") && await E(e);
83
+ }, [E]), J = r(async () => {
84
+ window.confirm("Are you sure you want to revoke all shared access?") && await D(l);
85
+ }, [l, D]), Y = r(async (e) => {
86
+ if (!(!v || e === _)) {
87
+ W(null), H(!0);
88
+ try {
89
+ await v(e);
90
+ } catch (e) {
91
+ W(e instanceof Error ? e.message : "Could not update general access.");
92
+ } finally {
93
+ H(!1);
94
+ }
95
+ }
96
+ }, [v, _]), X = r(async () => {
69
97
  try {
70
- await navigator.clipboard.writeText(M), F(!0), setTimeout(() => F(!1), 2e3);
98
+ await navigator.clipboard.writeText(F), R(!0), setTimeout(() => R(!1), 2e3);
71
99
  } catch {}
72
- }, [M]), U = E ? [
100
+ }, [F]), Z = k ? [
73
101
  {
74
102
  id: "user-1",
75
103
  name: "John Doe",
@@ -92,8 +120,8 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
92
120
  name: "Editors",
93
121
  type: "GROUP"
94
122
  }
95
- ].filter((e) => e.name.toLowerCase().includes(E.toLowerCase()) || e.email?.toLowerCase().includes(E.toLowerCase())) : [], W = typeof document < "u" && document.documentElement.classList.contains("dark"), G = a(() => u(W), [W]);
96
- return h ? l(/* @__PURE__ */ s("div", {
123
+ ].filter((e) => e.name.toLowerCase().includes(k.toLowerCase()) || e.email?.toLowerCase().includes(k.toLowerCase())) : [], Q = typeof document < "u" && document.documentElement.classList.contains("dark"), $ = a(() => u(Q), [Q]);
124
+ return m ? ee(/* @__PURE__ */ s("div", {
97
125
  style: {
98
126
  position: "fixed",
99
127
  top: 0,
@@ -121,13 +149,13 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
121
149
  maxHeight: "85vh",
122
150
  display: "flex",
123
151
  flexDirection: "column",
124
- backgroundColor: G.bgPrimary,
152
+ backgroundColor: $.bgPrimary,
125
153
  borderRadius: "var(--radius-card)",
126
154
  boxShadow: "var(--shadow-elevation-3)",
127
155
  overflow: "hidden",
128
156
  position: "relative",
129
157
  zIndex: 1e5,
130
- color: G.textPrimary
158
+ color: $.textPrimary
131
159
  },
132
160
  onClick: (e) => e.stopPropagation(),
133
161
  children: [
@@ -135,11 +163,11 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
135
163
  style: {
136
164
  flexShrink: 0,
137
165
  padding: "20px 24px",
138
- borderBottom: `1px solid ${G.borderDefault}`,
166
+ borderBottom: `1px solid ${$.borderDefault}`,
139
167
  display: "flex",
140
168
  alignItems: "center",
141
169
  justifyContent: "space-between",
142
- backgroundColor: G.bgPrimary
170
+ backgroundColor: $.bgPrimary
143
171
  },
144
172
  children: [/* @__PURE__ */ c("div", { children: [/* @__PURE__ */ s("h2", {
145
173
  id: "share-dialog-title",
@@ -147,16 +175,16 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
147
175
  margin: 0,
148
176
  fontSize: "18px",
149
177
  fontWeight: 600,
150
- color: G.textPrimary
178
+ color: $.textPrimary
151
179
  },
152
180
  children: "Share Dashboard"
153
181
  }), /* @__PURE__ */ s("p", {
154
182
  style: {
155
183
  margin: "4px 0 0",
156
184
  fontSize: "13px",
157
- color: G.textSecondary
185
+ color: $.textSecondary
158
186
  },
159
- children: m
187
+ children: p
160
188
  })] }), /* @__PURE__ */ s("button", {
161
189
  onClick: g,
162
190
  style: {
@@ -164,7 +192,7 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
164
192
  border: "none",
165
193
  fontSize: "24px",
166
194
  cursor: "pointer",
167
- color: G.textSecondary,
195
+ color: $.textSecondary,
168
196
  padding: "4px",
169
197
  lineHeight: 1
170
198
  },
@@ -179,20 +207,20 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
179
207
  display: "flex",
180
208
  gap: "4px",
181
209
  padding: "0 24px",
182
- borderBottom: `1px solid ${G.borderDefault}`,
183
- backgroundColor: G.bgPrimary
210
+ borderBottom: `1px solid ${$.borderDefault}`,
211
+ backgroundColor: $.bgPrimary
184
212
  },
185
213
  children: ["people", "embed"].map((e) => /* @__PURE__ */ s("button", {
186
214
  type: "button",
187
215
  role: "tab",
188
- "aria-selected": I === e,
189
- onClick: () => L(e),
216
+ "aria-selected": z === e,
217
+ onClick: () => B(e),
190
218
  style: {
191
219
  padding: "10px 12px",
192
220
  background: "none",
193
221
  border: "none",
194
- borderBottom: `2px solid ${I === e ? G.actionPrimaryBg : "transparent"}`,
195
- color: I === e ? G.textPrimary : G.textSecondary,
222
+ borderBottom: `2px solid ${z === e ? $.actionPrimaryBg : "transparent"}`,
223
+ color: z === e ? $.textPrimary : $.textSecondary,
196
224
  fontSize: "13px",
197
225
  fontWeight: 600,
198
226
  cursor: "pointer"
@@ -200,24 +228,86 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
200
228
  children: e === "people" ? "People" : "Publish to web"
201
229
  }, e))
202
230
  }),
203
- I === "embed" && /* @__PURE__ */ s("div", {
231
+ z === "embed" && /* @__PURE__ */ s("div", {
204
232
  className: "min-h-0 flex-1 overflow-y-auto",
205
- style: { backgroundColor: G.bgPrimary },
233
+ style: { backgroundColor: $.bgPrimary },
206
234
  children: /* @__PURE__ */ s(n, {
207
- dashboardId: f,
208
- colors: G
235
+ dashboardId: l,
236
+ colors: $
209
237
  })
210
238
  }),
211
- I === "people" && /* @__PURE__ */ c("div", {
239
+ z === "people" && /* @__PURE__ */ c("div", {
212
240
  className: "flex min-h-0 flex-1 flex-col gap-section-gap overflow-y-auto p-card-padding",
213
- style: { backgroundColor: G.bgPrimary },
241
+ style: { backgroundColor: $.bgPrimary },
214
242
  children: [
243
+ _ && v && /* @__PURE__ */ c("section", {
244
+ "aria-labelledby": "share-visibility-heading",
245
+ children: [
246
+ /* @__PURE__ */ s("h3", {
247
+ id: "share-visibility-heading",
248
+ className: "mb-form-gap text-sm font-semibold",
249
+ style: { color: $.textPrimary },
250
+ children: "General access"
251
+ }),
252
+ /* @__PURE__ */ c("div", {
253
+ style: {
254
+ display: "flex",
255
+ alignItems: "center",
256
+ gap: "8px",
257
+ flexWrap: "wrap"
258
+ },
259
+ children: [/* @__PURE__ */ s("select", {
260
+ "aria-label": "General access",
261
+ "data-testid": "share-visibility",
262
+ value: _,
263
+ disabled: !y || V,
264
+ onChange: (e) => void Y(e.target.value),
265
+ style: {
266
+ padding: "10px 12px",
267
+ border: `1px solid ${$.borderDefault}`,
268
+ borderRadius: "6px",
269
+ fontSize: "13px",
270
+ backgroundColor: $.bgPrimary,
271
+ color: $.textPrimary,
272
+ cursor: !y || V ? "not-allowed" : "pointer",
273
+ opacity: !y || V ? .6 : 1
274
+ },
275
+ children: d.map((e) => /* @__PURE__ */ s("option", {
276
+ value: e.value,
277
+ children: e.label
278
+ }, e.value))
279
+ }), /* @__PURE__ */ s("span", {
280
+ style: {
281
+ fontSize: "12px",
282
+ color: $.textSecondary
283
+ },
284
+ children: d.find((e) => e.value === _)?.description
285
+ })]
286
+ }),
287
+ !y && /* @__PURE__ */ s("p", {
288
+ style: {
289
+ margin: "6px 0 0",
290
+ fontSize: "11px",
291
+ color: $.textSecondary
292
+ },
293
+ children: "You don't have permission to change general access."
294
+ }),
295
+ U && /* @__PURE__ */ s("p", {
296
+ style: {
297
+ margin: "6px 0 0",
298
+ fontSize: "11px",
299
+ color: $.statusErrorText
300
+ },
301
+ children: U
302
+ })
303
+ ]
304
+ }),
215
305
  /* @__PURE__ */ c("section", {
216
306
  "aria-labelledby": "share-link-heading",
217
307
  children: [/* @__PURE__ */ s("h3", {
218
308
  id: "share-link-heading",
219
309
  className: "mb-form-gap text-sm font-semibold",
220
- style: { color: G.textPrimary },
310
+ style: { color: $.textPrimary },
221
311
  children: "Share link"
222
312
  }), /* @__PURE__ */ c("div", {
223
313
  style: {
@@ -227,22 +317,22 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
227
317
  },
228
318
  children: [/* @__PURE__ */ s("input", {
229
319
  type: "text",
230
- value: M,
320
+ value: F,
231
321
  readOnly: !0,
232
322
  style: {
233
323
  flex: 1,
234
324
  padding: "10px 12px",
235
- border: `1px solid ${G.borderDefault}`,
325
+ border: `1px solid ${$.borderDefault}`,
236
326
  borderRadius: "6px",
237
327
  fontSize: "13px",
238
- backgroundColor: G.bgSecondary,
239
- color: G.textPrimary
328
+ backgroundColor: $.bgSecondary,
329
+ color: $.textPrimary
240
330
  }
241
331
  }), /* @__PURE__ */ s("button", {
242
- onClick: H,
332
+ onClick: X,
243
333
  style: {
244
334
  padding: "10px 16px",
245
- backgroundColor: P ? G.statusSuccessBg : G.actionPrimaryBg,
335
+ backgroundColor: L ? $.statusSuccessBg : $.actionPrimaryBg,
246
336
  color: "var(--color-action-primary-text)",
247
337
  border: "none",
248
338
  borderRadius: "6px",
@@ -251,7 +341,7 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
251
341
  fontWeight: 500,
252
342
  minWidth: "80px"
253
343
  },
254
- children: P ? "Copied!" : "Copy"
344
+ children: L ? "Copied!" : "Copy"
255
345
  })]
256
346
  })]
257
347
  }),
@@ -260,7 +350,7 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
260
350
  children: [/* @__PURE__ */ s("h3", {
261
351
  id: "share-invite-heading",
262
352
  className: "mb-form-gap text-sm font-semibold",
263
- style: { color: G.textPrimary },
353
+ style: { color: $.textPrimary },
264
354
  children: "Invite people"
265
355
  }), /* @__PURE__ */ c("div", {
266
356
  style: {
@@ -277,37 +367,37 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
277
367
  },
278
368
  children: [/* @__PURE__ */ s("input", {
279
369
  type: "text",
280
- value: O ? O.name : E,
370
+ value: j ? j.name : k,
281
371
  onChange: (e) => {
282
- D(e.target.value), k(null);
372
+ A(e.target.value), M(null);
283
373
  },
284
374
  placeholder: "Search by name or email...",
285
375
  style: {
286
376
  width: "100%",
287
377
  padding: "10px 12px",
288
- border: `1px solid ${G.borderDefault}`,
378
+ border: `1px solid ${$.borderDefault}`,
289
379
  borderRadius: "6px",
290
380
  fontSize: "13px",
291
- backgroundColor: G.bgPrimary,
292
- color: G.textPrimary
381
+ backgroundColor: $.bgPrimary,
382
+ color: $.textPrimary
293
383
  }
294
- }), E && !O && U.length > 0 && /* @__PURE__ */ s("div", {
384
+ }), k && !j && Z.length > 0 && /* @__PURE__ */ s("div", {
295
385
  style: {
296
386
  position: "absolute",
297
387
  top: "100%",
298
388
  left: 0,
299
389
  right: 0,
300
390
  marginTop: "4px",
301
- backgroundColor: G.bgPrimary,
302
- border: `1px solid ${G.borderDefault}`,
391
+ backgroundColor: $.bgPrimary,
392
+ border: `1px solid ${$.borderDefault}`,
303
393
  borderRadius: "6px",
304
394
  boxShadow: "var(--shadow-elevation-3)",
305
395
  zIndex: 100001,
306
396
  maxHeight: "200px",
307
397
  overflowY: "auto"
308
398
  },
309
- children: U.map((e) => /* @__PURE__ */ c("button", {
310
- onClick: () => k(e),
399
+ children: Z.map((e) => /* @__PURE__ */ c("button", {
400
+ onClick: () => M(e),
311
401
  style: {
312
402
  display: "block",
313
403
  width: "100%",
@@ -316,28 +406,28 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
316
406
  backgroundColor: "transparent",
317
407
  border: "none",
318
408
  cursor: "pointer",
319
- borderBottom: `1px solid ${G.borderDefault}`
409
+ borderBottom: `1px solid ${$.borderDefault}`
320
410
  },
321
411
  children: [
322
412
  /* @__PURE__ */ s("div", {
323
413
  style: {
324
414
  fontSize: "13px",
325
415
  fontWeight: 500,
326
- color: G.textPrimary
416
+ color: $.textPrimary
327
417
  },
328
418
  children: e.name
329
419
  }),
330
420
  e.email && /* @__PURE__ */ s("div", {
331
421
  style: {
332
422
  fontSize: "11px",
333
- color: G.textSecondary
423
+ color: $.textSecondary
334
424
  },
335
425
  children: e.email
336
426
  }),
337
427
  /* @__PURE__ */ s("span", {
338
428
  style: {
339
429
  fontSize: "10px",
340
- color: G.textTertiary,
430
+ color: $.textTertiary,
341
431
  textTransform: "uppercase"
342
432
  },
343
433
  children: e.type
@@ -347,31 +437,31 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
347
437
  })]
348
438
  }),
349
439
  /* @__PURE__ */ s("select", {
350
- value: A,
351
- onChange: (e) => j(e.target.value),
440
+ value: N,
441
+ onChange: (e) => P(e.target.value),
352
442
  style: {
353
443
  padding: "10px 12px",
354
- border: `1px solid ${G.borderDefault}`,
444
+ border: `1px solid ${$.borderDefault}`,
355
445
  borderRadius: "6px",
356
446
  fontSize: "13px",
357
- backgroundColor: G.bgPrimary,
358
- color: G.textPrimary
447
+ backgroundColor: $.bgPrimary,
448
+ color: $.textPrimary
359
449
  },
360
- children: d.map((e) => /* @__PURE__ */ s("option", {
450
+ children: f.map((e) => /* @__PURE__ */ s("option", {
361
451
  value: e.value,
362
452
  children: e.label
363
453
  }, e.value))
364
454
  }),
365
455
  /* @__PURE__ */ s("button", {
366
- onClick: R,
367
- disabled: !O || v,
456
+ onClick: G,
457
+ disabled: !j || x,
368
458
  style: {
369
459
  padding: "10px 16px",
370
- backgroundColor: O ? G.actionPrimaryBg : G.bgTertiary,
371
- color: O ? "var(--color-action-primary-text)" : G.textSecondary,
460
+ backgroundColor: j ? $.actionPrimaryBg : $.bgTertiary,
461
+ color: j ? "var(--color-action-primary-text)" : $.textSecondary,
372
462
  border: "none",
373
463
  borderRadius: "6px",
374
- cursor: O ? "pointer" : "not-allowed",
464
+ cursor: j ? "pointer" : "not-allowed",
375
465
  fontSize: "13px",
376
466
  fontWeight: 500
377
467
  },
@@ -394,33 +484,33 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
394
484
  children: [/* @__PURE__ */ c("h3", {
395
485
  id: "share-access-heading",
396
486
  className: "text-sm font-semibold",
397
- style: { color: G.textPrimary },
487
+ style: { color: $.textPrimary },
398
488
  children: [
399
489
  "People with access (",
400
- _.length,
490
+ b.length,
401
491
  ")"
402
492
  ]
403
- }), _.length > 0 && /* @__PURE__ */ s("button", {
404
- onClick: V,
493
+ }), b.length > 0 && /* @__PURE__ */ s("button", {
494
+ onClick: J,
405
495
  style: {
406
496
  padding: "4px 8px",
407
497
  backgroundColor: "transparent",
408
- color: G.statusErrorText,
498
+ color: $.statusErrorText,
409
499
  border: "none",
410
500
  cursor: "pointer",
411
501
  fontSize: "12px"
412
502
  },
413
503
  children: "Revoke All"
414
504
  })]
415
- }), v && _.length === 0 ? /* @__PURE__ */ s("p", {
505
+ }), x && b.length === 0 ? /* @__PURE__ */ s("p", {
416
506
  style: {
417
- color: G.textSecondary,
507
+ color: $.textSecondary,
418
508
  fontSize: "13px"
419
509
  },
420
510
  children: "Loading..."
421
- }) : _.length === 0 ? /* @__PURE__ */ s("p", {
511
+ }) : b.length === 0 ? /* @__PURE__ */ s("p", {
422
512
  style: {
423
- color: G.textSecondary,
513
+ color: $.textSecondary,
424
514
  fontSize: "13px"
425
515
  },
426
516
  children: "No one has access to this dashboard yet."
@@ -430,11 +520,11 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
430
520
  flexDirection: "column",
431
521
  gap: "8px"
432
522
  },
433
- children: _.map((e) => /* @__PURE__ */ s(p, {
523
+ children: b.map((e) => /* @__PURE__ */ s(h, {
434
524
  share: e,
435
- onUpdatePermission: z,
436
- onRevoke: B,
437
- colors: G
525
+ onUpdatePermission: K,
526
+ onRevoke: q,
527
+ colors: $
438
528
  }, e.id))
439
529
  })]
440
530
  })
@@ -444,7 +534,25 @@ function f({ dashboardId: f, dashboardName: m, isOpen: h, onClose: g }) {
444
534
  })
445
535
  }), document.body) : null;
446
536
  }
447
- function p({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
537
+ function m(e) {
538
+ if (!e) return {
539
+ label: "No expiry",
540
+ expired: !1
541
+ };
542
+ let t = new Date(e);
543
+ return Number.isNaN(t.getTime()) ? {
544
+ label: "No expiry",
545
+ expired: !1
546
+ } : t.getTime() <= Date.now() ? {
547
+ label: `Expired ${l(t, { addSuffix: !0 })}`,
548
+ expired: !0
549
+ } : {
550
+ label: `Expires ${l(t, { addSuffix: !0 })}`,
551
+ expired: !1
552
+ };
553
+ }
554
+ function h({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
555
+ let i = m(e.expiresAt);
448
556
  return /* @__PURE__ */ c("div", {
449
557
  style: {
450
558
  display: "flex",
@@ -496,40 +604,58 @@ function p({ share: e, onUpdatePermission: t, onRevoke: n, colors: r }) {
496
604
  style: {
497
605
  display: "flex",
498
606
  alignItems: "center",
499
- gap: "8px"
607
+ gap: "8px",
608
+ flexWrap: "wrap"
500
609
  },
501
- children: [/* @__PURE__ */ s("select", {
502
- value: e.permission,
503
- onChange: (n) => t(e.id, n.target.value),
504
- style: {
505
- padding: "6px 10px",
506
- border: `1px solid ${r.borderDefault}`,
507
- borderRadius: "4px",
508
- fontSize: "12px",
509
- backgroundColor: r.bgPrimary,
510
- color: r.textPrimary
511
- },
512
- children: d.map((e) => /* @__PURE__ */ s("option", {
513
- value: e.value,
514
- children: e.label
515
- }, e.value))
516
- }), /* @__PURE__ */ s("button", {
517
- onClick: () => n(e.id),
518
- style: {
519
- padding: "6px 10px",
520
- backgroundColor: "transparent",
521
- color: r.statusErrorText,
522
- border: `1px solid ${r.statusErrorText}`,
523
- borderRadius: "4px",
524
- cursor: "pointer",
525
- fontSize: "12px"
526
- },
527
- children: "Revoke"
528
- })]
610
+ children: [
611
+ /* @__PURE__ */ s("span", {
612
+ "data-testid": "share-expiry",
613
+ title: e.expiresAt ? new Date(e.expiresAt).toLocaleString() : "Access does not expire",
614
+ style: {
615
+ fontSize: "11px",
616
+ padding: "4px 8px",
617
+ borderRadius: "999px",
618
+ whiteSpace: "nowrap",
619
+ backgroundColor: r.bgTertiary,
620
+ color: i.expired ? r.statusErrorText : r.textSecondary,
621
+ fontWeight: i.expired ? 600 : 400
622
+ },
623
+ children: i.label
624
+ }),
625
+ /* @__PURE__ */ s("select", {
626
+ value: e.permission,
627
+ onChange: (n) => t(e.id, n.target.value),
628
+ style: {
629
+ padding: "6px 10px",
630
+ border: `1px solid ${r.borderDefault}`,
631
+ borderRadius: "4px",
632
+ fontSize: "12px",
633
+ backgroundColor: r.bgPrimary,
634
+ color: r.textPrimary
635
+ },
636
+ children: f.map((e) => /* @__PURE__ */ s("option", {
637
+ value: e.value,
638
+ children: e.label
639
+ }, e.value))
640
+ }),
641
+ /* @__PURE__ */ s("button", {
642
+ onClick: () => n(e.id),
643
+ style: {
644
+ padding: "6px 10px",
645
+ backgroundColor: "transparent",
646
+ color: r.statusErrorText,
647
+ border: `1px solid ${r.statusErrorText}`,
648
+ borderRadius: "4px",
649
+ cursor: "pointer",
650
+ fontSize: "12px"
651
+ },
652
+ children: "Revoke"
653
+ })
654
+ ]
529
655
  })]
530
656
  });
531
657
  }
532
658
  //#endregion
533
- export { f as default };
659
+ export { p as default };
534
660
 
535
661
  //# sourceMappingURL=ShareDialog.js.map