@burdenoff/microfe-bigconsole 2026.1029.4 → 2026.1030.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.
@@ -1,149 +1,172 @@
1
- import { Section as e } from "../common/Section.js";
1
+ import { classifyBigConsoleQuotaError as e } from "../../utils/quota.js";
2
+ import { useBigConsoleViewBilling as t } from "../../providers/BigConsoleQuotaProvider.js";
3
+ import { Section as n } from "../common/Section.js";
2
4
  import "../common/index.js";
3
- import t from "./StoreTemplatePicker.js";
4
- import { TemplateInstallOptions as n } from "./TemplateInstallOptions.js";
5
- import { TemplateLayoutPreview as r } from "./TemplateLayoutPreview.js";
6
- import { templateInputDefaults as ee, templateInputError as te } from "../../utils/templateInstallInputs.js";
7
- import ne from "../../hooks/useStoreDashboardTemplates.js";
8
- import { memo as i, useCallback as a, useEffect as o, useRef as s, useState as c } from "react";
9
- import { Copy as re, LayoutDashboard as ie, Plus as l, Tag as ae, X as oe } from "lucide-react";
10
- import { Badge as se, Button as u, Dialog as ce, DialogContent as le, DialogDescription as ue, DialogFooter as de, DialogHeader as fe, DialogTitle as d, Input as f, Spinner as p, Textarea as pe } from "@burdenoff/fe-libs/ui";
11
- import { useI18n as me } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
12
- import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
13
- import { useActiveContext as he } from "@burdenoff/fe-libs/shared/providers/shell/ActiveContextProvider";
5
+ import r from "./StoreTemplatePicker.js";
6
+ import { TemplateInstallOptions as ee } from "./TemplateInstallOptions.js";
7
+ import { TemplateLayoutPreview as te } from "./TemplateLayoutPreview.js";
8
+ import { templateInputDefaults as ne, templateInputError as re } from "../../utils/templateInstallInputs.js";
9
+ import ie from "../../hooks/useStoreDashboardTemplates.js";
10
+ import ae from "./QuotaLimitNotice.js";
11
+ import { memo as i, useCallback as a, useEffect as o, useMemo as oe, useRef as s, useState as c } from "react";
12
+ import { Copy as se, LayoutDashboard as ce, Plus as l, Tag as le, X as ue } from "lucide-react";
13
+ import { Badge as de, Button as u, Dialog as fe, DialogContent as pe, DialogDescription as me, DialogFooter as he, DialogHeader as ge, DialogTitle as _e, Input as d, Spinner as f, Textarea as ve } from "@burdenoff/fe-libs/ui";
14
+ import { useI18n as ye } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
15
+ import { Fragment as be, jsx as p, jsxs as m } from "react/jsx-runtime";
16
+ import { useActiveContext as xe } from "@burdenoff/fe-libs/shared/providers/shell/ActiveContextProvider";
14
17
  //#region src/bigconsole/components/dashboard/CreateDashboardDialog.tsx
15
- var _ = i(function({ isOpen: i, isCreating: _ = !1, onClose: v, onCreate: y, showTemplates: b = !0, onTemplateInstalled: x }) {
16
- let { t: S } = me(), { templates: ge, loading: _e, error: C, fetchTemplateContent: w, installTemplate: T } = ne({ autoLoad: b }), [E, D] = c(!1), { workspaceId: O } = he(), k = s(O);
17
- k.current = O;
18
- let [ve, A] = c(null), [ye, be] = c(null), [j, M] = c(!1), [N, P] = c({}), [F, I] = c({}), [L, R] = c("blank"), [z, B] = c(""), [V, H] = c(""), [U, W] = c([]), [G, K] = c(""), [q, J] = c(null), [Y, X] = c(null), Z = s(null), Q = ye === `${q?.id}:${O}` ? ve : null;
18
+ var h = i(function({ isOpen: i, isCreating: h = !1, onClose: g, onCreate: _, showTemplates: v = !0, onTemplateInstalled: y }) {
19
+ let { t: b } = ye(), { templates: Se, loading: Ce, error: we, fetchTemplateContent: x, installTemplate: S } = ie({ autoLoad: v }), [C, w] = c(!1), { workspaceId: T } = xe(), E = s(T);
20
+ E.current = T;
21
+ let [Te, D] = c(null), [Ee, De] = c(null), [O, k] = c(!1), [A, j] = c({}), [M, N] = c({}), [P, F] = c("blank"), [I, L] = c(""), [R, z] = c(""), [B, V] = c([]), [H, U] = c(""), [W, G] = c(null), [K, q] = c(null), [J, Y] = c(null), X = t(), Z = s(null), Q = Ee === `${W?.id}:${T}` ? Te : null;
19
22
  o(() => {
20
- i && (R("blank"), B(""), H(""), W([]), K(""), J(null), X(null), setTimeout(() => {
23
+ i && (F("blank"), L(""), z(""), V([]), U(""), G(null), q(null), Y(null), setTimeout(() => {
21
24
  Z.current?.focus();
22
25
  }, 100));
23
26
  }, [i]);
24
27
  let $ = a(() => {
25
- let e = G.trim().toLowerCase();
26
- e && !U.includes(e) && U.length < 10 && (W((t) => [...t, e]), K(""));
27
- }, [G, U]);
28
+ let e = H.trim().toLowerCase();
29
+ e && !B.includes(e) && B.length < 10 && (V((t) => [...t, e]), U(""));
30
+ }, [H, B]);
28
31
  o(() => {
29
32
  let e = !1;
30
- if (A(null), P({}), I({}), M(!!q), !(!q || !i)) return w(q.id).then((t) => {
31
- e || (A(t), be(`${q.id}:${O}`), M(!1), I(t ? ee(t.requiredInputs) : {}), t || X(S("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed.")));
33
+ if (D(null), j({}), N({}), k(!!W), !(!W || !i)) return x(W.id).then((t) => {
34
+ e || (D(t), De(`${W.id}:${T}`), k(!1), N(t ? ne(t.requiredInputs) : {}), t || q(b("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed.")));
32
35
  }), () => {
33
36
  e = !0;
34
37
  };
35
38
  }, [
36
- q,
37
- w,
38
- O,
39
+ W,
40
+ x,
41
+ T,
39
42
  i,
40
- S
43
+ b
41
44
  ]);
42
- let xe = a((e) => {
43
- W((t) => t.filter((t) => t !== e));
44
- }, []), Se = a((e) => {
45
- e.key === "Enter" ? (e.preventDefault(), $()) : e.key === "Backspace" && !G && U.length > 0 && W((e) => e.slice(0, -1));
45
+ let Oe = a((e) => {
46
+ V((t) => t.filter((t) => t !== e));
47
+ }, []), ke = a((e) => {
48
+ e.key === "Enter" ? (e.preventDefault(), $()) : e.key === "Backspace" && !H && B.length > 0 && V((e) => e.slice(0, -1));
46
49
  }, [
47
50
  $,
48
- G,
49
- U.length
50
- ]), Ce = a((e) => {
51
- J(e), X(null), B(e.name), H(e.description || "");
52
- }, []), we = a(async (e) => {
53
- if (e.preventDefault(), L === "template" && !q) {
54
- X(S("bigconsole.dashboards.createDialog.error.selectTemplate", "Please select a template"));
51
+ H,
52
+ B.length
53
+ ]), Ae = a((e) => {
54
+ G(e), q(null), L(e.name), z(e.description || "");
55
+ }, []), je = a(async (t) => {
56
+ if (t.preventDefault(), P === "template" && !W) {
57
+ q(b("bigconsole.dashboards.createDialog.error.selectTemplate", "Please select a template"));
55
58
  return;
56
59
  }
57
- let t = z.trim();
58
- if (!t) {
59
- X(S("bigconsole.dashboards.createDialog.error.nameRequired", "Dashboard name is required")), Z.current?.focus();
60
+ let n = I.trim();
61
+ if (!n) {
62
+ q(b("bigconsole.dashboards.createDialog.error.nameRequired", "Dashboard name is required")), Z.current?.focus();
60
63
  return;
61
64
  }
62
- if (t.length < 3) {
63
- X(S("bigconsole.dashboards.createDialog.error.nameTooShort", "Dashboard name must be at least 3 characters")), Z.current?.focus();
65
+ if (n.length < 3) {
66
+ q(b("bigconsole.dashboards.createDialog.error.nameTooShort", "Dashboard name must be at least 3 characters")), Z.current?.focus();
64
67
  return;
65
68
  }
66
- if (t.length > 100) {
67
- X(S("bigconsole.dashboards.createDialog.error.nameTooLong", "Dashboard name must be less than 100 characters")), Z.current?.focus();
69
+ if (n.length > 100) {
70
+ q(b("bigconsole.dashboards.createDialog.error.nameTooLong", "Dashboard name must be less than 100 characters")), Z.current?.focus();
68
71
  return;
69
72
  }
70
- if (X(null), L === "template" && q) {
71
- D(!0);
73
+ if (q(null), Y(null), P === "template" && W) {
74
+ w(!0);
72
75
  try {
73
- let e = await w(q.id);
74
- if (k.current !== O) {
75
- X(S("bigconsole.dashboards.templateSetup.workspaceChanged", "The workspace changed. Review the template setup before creating your dashboard."));
76
+ let e = await x(W.id);
77
+ if (E.current !== T) {
78
+ q(b("bigconsole.dashboards.templateSetup.workspaceChanged", "The workspace changed. Review the template setup before creating your dashboard."));
76
79
  return;
77
80
  }
78
81
  if (!e) {
79
- X(S("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed."));
82
+ q(b("bigconsole.dashboards.createDialog.error.noDefinition", "This template has no dashboard definition attached and cannot be installed."));
80
83
  return;
81
84
  }
82
- let n = te(e.requiredInputs, F, S);
83
- if (n) {
84
- X(n);
85
+ let t = re(e.requiredInputs, M, b);
86
+ if (t) {
87
+ q(t);
85
88
  return;
86
89
  }
87
- let r = await T({
88
- templateId: q.id,
89
- templateName: q.name,
90
+ let r = await S({
91
+ templateId: W.id,
92
+ templateName: W.name,
90
93
  content: e,
91
- name: t,
92
- description: V.trim(),
93
- tags: U,
94
- dataSinkBindings: Object.entries(N).filter(([, e]) => e).map(([e, t]) => ({
94
+ name: n,
95
+ description: R.trim(),
96
+ tags: B,
97
+ dataSinkBindings: Object.entries(A).filter(([, e]) => e).map(([e, t]) => ({
95
98
  slot: e,
96
99
  dataSinkId: t
97
100
  })),
98
- inputValues: F
101
+ inputValues: M
99
102
  });
100
103
  if (!r.success) {
101
- X(r.errorMessage ?? S("bigconsole.dashboards.createDialog.error.installFailed", "Failed to create dashboard from template."));
104
+ q(r.errorMessage ?? b("bigconsole.dashboards.createDialog.error.installFailed", "Failed to create dashboard from template."));
102
105
  return;
103
106
  }
104
- r.dashboardId && x?.({
107
+ r.dashboardId && y?.({
105
108
  dashboardId: r.dashboardId,
106
109
  widgetsNeedingData: r.widgetsNeedingData
107
- }), v();
108
- } catch (e) {
109
- X(e instanceof Error ? e.message : S("bigconsole.dashboards.createDialog.error.installFailed", "Failed to create dashboard from template."));
110
+ }), g();
111
+ } catch (t) {
112
+ let n = e(t, "project");
113
+ if (n) {
114
+ Y(n);
115
+ return;
116
+ }
117
+ q(t instanceof Error ? t.message : b("bigconsole.dashboards.createDialog.error.installFailed", "Failed to create dashboard from template."));
110
118
  } finally {
111
- D(!1);
119
+ w(!1);
112
120
  }
113
121
  return;
114
122
  }
115
123
  try {
116
- await y({
117
- name: t,
118
- description: V.trim(),
124
+ await _({
125
+ name: n,
126
+ description: R.trim(),
119
127
  category: "CUSTOM",
120
- tags: U.length > 0 ? U : void 0
128
+ tags: B.length > 0 ? B : void 0
121
129
  });
122
- } catch (e) {
123
- X(e instanceof Error ? e.message : S("bigconsole.dashboards.createDialog.error.createFailed", "Failed to create dashboard. Please try again."));
130
+ } catch (t) {
131
+ let n = e(t, "project");
132
+ if (n) {
133
+ Y(n);
134
+ return;
135
+ }
136
+ q(t instanceof Error ? t.message : b("bigconsole.dashboards.createDialog.error.createFailed", "Failed to create dashboard. Please try again."));
124
137
  }
125
138
  }, [
126
- z,
127
- V,
128
- U,
129
- L,
130
- q,
131
- O,
132
- N,
133
- F,
134
- y,
135
- v,
136
- w,
139
+ I,
140
+ R,
141
+ B,
142
+ P,
143
+ W,
137
144
  T,
145
+ A,
146
+ M,
147
+ _,
148
+ g,
138
149
  x,
139
- S
150
+ S,
151
+ y,
152
+ b
153
+ ]), Me = a(() => Y(null), []), Ne = oe(() => {
154
+ if (!X || !J) return;
155
+ let e = J.kind;
156
+ return () => {
157
+ g(), X(e);
158
+ };
159
+ }, [
160
+ X,
161
+ J,
162
+ g
140
163
  ]);
141
- return /* @__PURE__ */ h(ce, {
164
+ return /* @__PURE__ */ p(fe, {
142
165
  open: i,
143
- onOpenChange: (e) => !e && !_ && !E && v(),
144
- children: /* @__PURE__ */ g(le, {
166
+ onOpenChange: (e) => !e && !h && !C && g(),
167
+ children: /* @__PURE__ */ m(pe, {
145
168
  style: {
146
- maxWidth: L === "template" ? "900px" : "480px",
169
+ maxWidth: P === "template" ? "900px" : "480px",
147
170
  width: "calc(100vw - 2 * var(--space-pagePadding))",
148
171
  maxHeight: "calc(100dvh - 2 * var(--space-pagePadding))",
149
172
  display: "flex",
@@ -151,18 +174,18 @@ var _ = i(function({ isOpen: i, isCreating: _ = !1, onClose: v, onCreate: y, sho
151
174
  overflow: "hidden",
152
175
  padding: 0
153
176
  },
154
- children: [/* @__PURE__ */ h(fe, {
177
+ children: [/* @__PURE__ */ p(ge, {
155
178
  style: {
156
179
  padding: "var(--space-pagePadding) var(--space-pagePadding) 0",
157
180
  flexShrink: 0
158
181
  },
159
- children: /* @__PURE__ */ g("div", {
182
+ children: /* @__PURE__ */ m("div", {
160
183
  style: {
161
184
  display: "flex",
162
185
  alignItems: "center",
163
186
  gap: "var(--space-formGap)"
164
187
  },
165
- children: [/* @__PURE__ */ h("div", {
188
+ children: [/* @__PURE__ */ p("div", {
166
189
  style: {
167
190
  display: "flex",
168
191
  height: "var(--size-controlHeight-lg)",
@@ -173,7 +196,7 @@ var _ = i(function({ isOpen: i, isCreating: _ = !1, onClose: v, onCreate: y, sho
173
196
  borderRadius: "var(--radius-card)",
174
197
  backgroundColor: "var(--color-bg-accentSubtle)"
175
198
  },
176
- children: /* @__PURE__ */ h(ie, {
199
+ children: /* @__PURE__ */ p(ce, {
177
200
  "aria-hidden": "true",
178
201
  style: {
179
202
  height: "var(--size-icon-lg)",
@@ -181,152 +204,199 @@ var _ = i(function({ isOpen: i, isCreating: _ = !1, onClose: v, onCreate: y, sho
181
204
  color: "var(--color-action-primary-bg)"
182
205
  }
183
206
  })
184
- }), /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h(d, {
207
+ }), /* @__PURE__ */ m("div", { children: [/* @__PURE__ */ p(_e, {
185
208
  style: {
186
209
  fontSize: "var(--font-size-heading-h4)",
187
210
  fontWeight: "var(--font-weight-bold)",
188
211
  color: "var(--color-text-primary)",
189
212
  margin: 0
190
213
  },
191
- children: S("bigconsole.dashboards.createDialog.title", "Create New Dashboard")
192
- }), /* @__PURE__ */ h(ue, {
214
+ children: b("bigconsole.dashboards.createDialog.title", "Create New Dashboard")
215
+ }), /* @__PURE__ */ p(me, {
193
216
  style: {
194
217
  fontSize: "var(--font-size-body-sm)",
195
218
  color: "var(--color-text-secondary)",
196
219
  margin: "var(--space-controlGap) 0 0 0"
197
220
  },
198
- children: S("bigconsole.dashboards.createDialog.subtitle", "Create a new dashboard to visualize your data")
221
+ children: b("bigconsole.dashboards.createDialog.subtitle", "Create a new dashboard to visualize your data")
199
222
  })] })]
200
223
  })
201
- }), /* @__PURE__ */ g("form", {
202
- onSubmit: we,
224
+ }), /* @__PURE__ */ m("form", {
225
+ onSubmit: je,
203
226
  style: {
204
227
  display: "flex",
205
228
  flexDirection: "column",
206
229
  minHeight: 0,
207
230
  flex: "1 1 auto"
208
231
  },
209
- children: [/* @__PURE__ */ g("div", {
210
- style: {
211
- overflowY: "auto",
212
- minHeight: 0,
213
- flex: "1 1 auto"
214
- },
215
- children: [
216
- b && /* @__PURE__ */ h("div", {
217
- style: { padding: "var(--space-pagePadding) var(--space-pagePadding) 0" },
218
- children: /* @__PURE__ */ g("div", {
219
- role: "group",
220
- "aria-label": "How to start",
221
- style: {
222
- display: "flex",
223
- flexWrap: "wrap",
224
- gap: "var(--space-controlGap)",
225
- padding: "var(--space-controlGap)",
226
- backgroundColor: "var(--color-bg-sunken)",
227
- borderRadius: "var(--radius-button)"
228
- },
229
- children: [/* @__PURE__ */ g("button", {
230
- type: "button",
231
- disabled: _ || E,
232
- onClick: () => {
233
- R("blank"), J(null);
234
- },
235
- style: {
236
- flex: 1,
237
- display: "flex",
238
- alignItems: "center",
239
- justifyContent: "center",
240
- gap: "var(--space-iconGap)",
241
- padding: "var(--space-controlGap) var(--space-formGap)",
242
- borderRadius: "var(--radius-button)",
243
- border: "none",
244
- backgroundColor: L === "blank" ? "var(--color-bg-surface)" : "transparent",
245
- color: L === "blank" ? "var(--color-text-primary)" : "var(--color-text-secondary)",
246
- fontWeight: L === "blank" ? "var(--font-weight-semibold)" : "var(--font-weight-regular)",
247
- fontSize: "var(--font-size-body-sm)",
248
- cursor: "pointer",
249
- boxShadow: L === "blank" ? "var(--shadow-elevation-1)" : "none",
250
- transition: "all 0.15s ease"
251
- },
252
- children: [/* @__PURE__ */ h(l, { style: {
253
- height: "var(--size-icon-sm)",
254
- width: "var(--size-icon-sm)"
255
- } }), S("bigconsole.dashboards.createDialog.tab.blank", "Blank Dashboard")]
256
- }), /* @__PURE__ */ g("button", {
257
- type: "button",
258
- disabled: _ || E,
259
- onClick: () => R("template"),
232
+ children: [
233
+ /* @__PURE__ */ m("div", {
234
+ style: {
235
+ overflowY: "auto",
236
+ minHeight: 0,
237
+ flex: "1 1 auto"
238
+ },
239
+ children: [
240
+ v && /* @__PURE__ */ p("div", {
241
+ style: { padding: "var(--space-pagePadding) var(--space-pagePadding) 0" },
242
+ children: /* @__PURE__ */ m("div", {
243
+ role: "group",
244
+ "aria-label": "How to start",
260
245
  style: {
261
- flex: 1,
262
246
  display: "flex",
263
- alignItems: "center",
264
- justifyContent: "center",
265
- gap: "var(--space-iconGap)",
266
- padding: "var(--space-controlGap) var(--space-formGap)",
267
- borderRadius: "var(--radius-button)",
268
- border: "none",
269
- backgroundColor: L === "template" ? "var(--color-bg-surface)" : "transparent",
270
- color: L === "template" ? "var(--color-text-primary)" : "var(--color-text-secondary)",
271
- fontWeight: L === "template" ? "var(--font-weight-semibold)" : "var(--font-weight-regular)",
272
- fontSize: "var(--font-size-body-sm)",
273
- cursor: "pointer",
274
- boxShadow: L === "template" ? "var(--shadow-elevation-1)" : "none",
275
- transition: "all 0.15s ease"
247
+ flexWrap: "wrap",
248
+ gap: "var(--space-controlGap)",
249
+ padding: "var(--space-controlGap)",
250
+ backgroundColor: "var(--color-bg-sunken)",
251
+ borderRadius: "var(--radius-button)"
276
252
  },
277
- children: [/* @__PURE__ */ h(re, { style: {
278
- height: "var(--size-icon-sm)",
279
- width: "var(--size-icon-sm)"
280
- } }), S("bigconsole.dashboards.createDialog.tab.template", "From Template")]
281
- })]
282
- })
283
- }),
284
- L === "template" && /* @__PURE__ */ h("div", {
285
- style: {
286
- padding: "var(--space-pagePadding)",
287
- maxHeight: "400px",
288
- overflowY: "auto"
289
- },
290
- children: /* @__PURE__ */ h(t, {
291
- templates: ge,
292
- loading: _e,
293
- error: C,
294
- selectedTemplateId: q?.id,
295
- onSelect: Ce
296
- })
297
- }),
298
- L === "template" && q && /* @__PURE__ */ g("div", {
299
- style: { padding: "var(--space-pagePadding)" },
300
- children: [j && /* @__PURE__ */ h(p, {}), Q && /* @__PURE__ */ g(m, { children: [/* @__PURE__ */ h(r, { content: Q }), /* @__PURE__ */ h(n, {
301
- content: Q,
302
- bindings: N,
303
- onBindingChange: (e, t) => P((n) => ({
304
- ...n,
305
- [e]: t
306
- })),
307
- inputValues: F,
308
- onInputChange: (e, t) => I((n) => ({
309
- ...n,
310
- [e]: t
311
- })),
312
- disabled: _ || E
313
- })] })]
314
- }),
315
- /* @__PURE__ */ h("div", {
316
- style: { padding: "var(--space-pagePadding)" },
317
- children: /* @__PURE__ */ g(e, {
318
- headingLevel: 3,
319
- emphasis: "bare",
320
- padding: "none",
321
- title: "Dashboard details",
322
- description: "Name it now — everything else can change later.",
323
- "data-testid": "create-dashboard-details",
324
- children: [
325
- /* @__PURE__ */ g("div", {
326
- style: { marginBottom: "var(--space-formGap)" },
327
- children: [
328
- /* @__PURE__ */ g("label", {
329
- htmlFor: "dashboard-name",
253
+ children: [/* @__PURE__ */ m("button", {
254
+ type: "button",
255
+ disabled: h || C,
256
+ onClick: () => {
257
+ F("blank"), G(null);
258
+ },
259
+ style: {
260
+ flex: 1,
261
+ display: "flex",
262
+ alignItems: "center",
263
+ justifyContent: "center",
264
+ gap: "var(--space-iconGap)",
265
+ padding: "var(--space-controlGap) var(--space-formGap)",
266
+ borderRadius: "var(--radius-button)",
267
+ border: "none",
268
+ backgroundColor: P === "blank" ? "var(--color-bg-surface)" : "transparent",
269
+ color: P === "blank" ? "var(--color-text-primary)" : "var(--color-text-secondary)",
270
+ fontWeight: P === "blank" ? "var(--font-weight-semibold)" : "var(--font-weight-regular)",
271
+ fontSize: "var(--font-size-body-sm)",
272
+ cursor: "pointer",
273
+ boxShadow: P === "blank" ? "var(--shadow-elevation-1)" : "none",
274
+ transition: "all 0.15s ease"
275
+ },
276
+ children: [/* @__PURE__ */ p(l, { style: {
277
+ height: "var(--size-icon-sm)",
278
+ width: "var(--size-icon-sm)"
279
+ } }), b("bigconsole.dashboards.createDialog.tab.blank", "Blank Dashboard")]
280
+ }), /* @__PURE__ */ m("button", {
281
+ type: "button",
282
+ disabled: h || C,
283
+ onClick: () => F("template"),
284
+ style: {
285
+ flex: 1,
286
+ display: "flex",
287
+ alignItems: "center",
288
+ justifyContent: "center",
289
+ gap: "var(--space-iconGap)",
290
+ padding: "var(--space-controlGap) var(--space-formGap)",
291
+ borderRadius: "var(--radius-button)",
292
+ border: "none",
293
+ backgroundColor: P === "template" ? "var(--color-bg-surface)" : "transparent",
294
+ color: P === "template" ? "var(--color-text-primary)" : "var(--color-text-secondary)",
295
+ fontWeight: P === "template" ? "var(--font-weight-semibold)" : "var(--font-weight-regular)",
296
+ fontSize: "var(--font-size-body-sm)",
297
+ cursor: "pointer",
298
+ boxShadow: P === "template" ? "var(--shadow-elevation-1)" : "none",
299
+ transition: "all 0.15s ease"
300
+ },
301
+ children: [/* @__PURE__ */ p(se, { style: {
302
+ height: "var(--size-icon-sm)",
303
+ width: "var(--size-icon-sm)"
304
+ } }), b("bigconsole.dashboards.createDialog.tab.template", "From Template")]
305
+ })]
306
+ })
307
+ }),
308
+ P === "template" && /* @__PURE__ */ p("div", {
309
+ style: {
310
+ padding: "var(--space-pagePadding)",
311
+ maxHeight: "400px",
312
+ overflowY: "auto"
313
+ },
314
+ children: /* @__PURE__ */ p(r, {
315
+ templates: Se,
316
+ loading: Ce,
317
+ error: we,
318
+ selectedTemplateId: W?.id,
319
+ onSelect: Ae
320
+ })
321
+ }),
322
+ P === "template" && W && /* @__PURE__ */ m("div", {
323
+ style: { padding: "var(--space-pagePadding)" },
324
+ children: [O && /* @__PURE__ */ p(f, {}), Q && /* @__PURE__ */ m(be, { children: [/* @__PURE__ */ p(te, { content: Q }), /* @__PURE__ */ p(ee, {
325
+ content: Q,
326
+ bindings: A,
327
+ onBindingChange: (e, t) => j((n) => ({
328
+ ...n,
329
+ [e]: t
330
+ })),
331
+ inputValues: M,
332
+ onInputChange: (e, t) => N((n) => ({
333
+ ...n,
334
+ [e]: t
335
+ })),
336
+ disabled: h || C
337
+ })] })]
338
+ }),
339
+ /* @__PURE__ */ p("div", {
340
+ style: { padding: "var(--space-pagePadding)" },
341
+ children: /* @__PURE__ */ m(n, {
342
+ headingLevel: 3,
343
+ emphasis: "bare",
344
+ padding: "none",
345
+ title: "Dashboard details",
346
+ description: "Name it now — everything else can change later.",
347
+ "data-testid": "create-dashboard-details",
348
+ children: [
349
+ /* @__PURE__ */ m("div", {
350
+ style: { marginBottom: "var(--space-formGap)" },
351
+ children: [
352
+ /* @__PURE__ */ m("label", {
353
+ htmlFor: "dashboard-name",
354
+ style: {
355
+ display: "block",
356
+ fontSize: "var(--font-size-body-sm)",
357
+ fontWeight: "var(--font-weight-semibold)",
358
+ color: "var(--color-text-primary)",
359
+ marginBottom: "var(--space-controlGap)"
360
+ },
361
+ children: [b("bigconsole.dashboards.createDialog.field.name", "Dashboard Name"), /* @__PURE__ */ p("span", {
362
+ style: {
363
+ color: "var(--color-status-error-text)",
364
+ marginLeft: "var(--space-controlGap)"
365
+ },
366
+ children: "*"
367
+ })]
368
+ }),
369
+ /* @__PURE__ */ p(d, {
370
+ ref: Z,
371
+ id: "dashboard-name",
372
+ type: "text",
373
+ value: I,
374
+ onChange: (e) => {
375
+ L(e.target.value), K && q(null);
376
+ },
377
+ placeholder: b("bigconsole.dashboards.createDialog.field.namePlaceholder", "Enter dashboard name"),
378
+ disabled: h || C,
379
+ style: {
380
+ height: "var(--size-controlHeight-md)",
381
+ fontSize: "var(--font-size-body-sm)",
382
+ borderColor: K ? "var(--color-status-error-border)" : void 0
383
+ }
384
+ }),
385
+ K && /* @__PURE__ */ p("p", {
386
+ style: {
387
+ fontSize: "var(--font-size-body-sm)",
388
+ color: "var(--color-status-error-text)",
389
+ marginTop: "var(--space-controlGap)",
390
+ fontWeight: "var(--font-weight-medium)"
391
+ },
392
+ children: K
393
+ })
394
+ ]
395
+ }),
396
+ /* @__PURE__ */ m("div", {
397
+ style: { marginBottom: "var(--space-formGap)" },
398
+ children: [/* @__PURE__ */ m("label", {
399
+ htmlFor: "dashboard-description",
330
400
  style: {
331
401
  display: "block",
332
402
  fontSize: "var(--font-size-body-sm)",
@@ -334,230 +404,197 @@ var _ = i(function({ isOpen: i, isCreating: _ = !1, onClose: v, onCreate: y, sho
334
404
  color: "var(--color-text-primary)",
335
405
  marginBottom: "var(--space-controlGap)"
336
406
  },
337
- children: [S("bigconsole.dashboards.createDialog.field.name", "Dashboard Name"), /* @__PURE__ */ h("span", {
407
+ children: [b("bigconsole.dashboards.createDialog.field.description", "Description"), /* @__PURE__ */ p("span", {
338
408
  style: {
339
- color: "var(--color-status-error-text)",
409
+ color: "var(--color-text-muted)",
410
+ fontWeight: "var(--font-weight-regular)",
340
411
  marginLeft: "var(--space-controlGap)"
341
412
  },
342
- children: "*"
413
+ children: b("bigconsole.dashboards.createDialog.field.optional", "(optional)")
343
414
  })]
344
- }),
345
- /* @__PURE__ */ h(f, {
346
- ref: Z,
347
- id: "dashboard-name",
348
- type: "text",
349
- value: z,
350
- onChange: (e) => {
351
- B(e.target.value), Y && X(null);
352
- },
353
- placeholder: S("bigconsole.dashboards.createDialog.field.namePlaceholder", "Enter dashboard name"),
354
- disabled: _ || E,
415
+ }), /* @__PURE__ */ p(ve, {
416
+ id: "dashboard-description",
417
+ value: R,
418
+ onChange: (e) => z(e.target.value),
419
+ placeholder: b("bigconsole.dashboards.createDialog.field.descriptionPlaceholder", "Enter a brief description for this dashboard"),
420
+ rows: 3,
421
+ disabled: h || C,
355
422
  style: {
356
- height: "var(--size-controlHeight-md)",
357
423
  fontSize: "var(--font-size-body-sm)",
358
- borderColor: Y ? "var(--color-status-error-border)" : void 0
424
+ resize: "none"
359
425
  }
360
- }),
361
- Y && /* @__PURE__ */ h("p", {
426
+ })]
427
+ }),
428
+ /* @__PURE__ */ m("div", { children: [
429
+ /* @__PURE__ */ m("label", {
430
+ htmlFor: "dashboard-tags",
362
431
  style: {
432
+ display: "flex",
433
+ alignItems: "center",
434
+ gap: "var(--space-iconGap)",
363
435
  fontSize: "var(--font-size-body-sm)",
364
- color: "var(--color-status-error-text)",
365
- marginTop: "var(--space-controlGap)",
366
- fontWeight: "var(--font-weight-medium)"
436
+ fontWeight: "var(--font-weight-semibold)",
437
+ color: "var(--color-text-primary)",
438
+ marginBottom: "var(--space-controlGap)"
367
439
  },
368
- children: Y
369
- })
370
- ]
371
- }),
372
- /* @__PURE__ */ g("div", {
373
- style: { marginBottom: "var(--space-formGap)" },
374
- children: [/* @__PURE__ */ g("label", {
375
- htmlFor: "dashboard-description",
376
- style: {
377
- display: "block",
378
- fontSize: "var(--font-size-body-sm)",
379
- fontWeight: "var(--font-weight-semibold)",
380
- color: "var(--color-text-primary)",
381
- marginBottom: "var(--space-controlGap)"
382
- },
383
- children: [S("bigconsole.dashboards.createDialog.field.description", "Description"), /* @__PURE__ */ h("span", {
440
+ children: [
441
+ /* @__PURE__ */ p(le, { style: {
442
+ height: "var(--size-icon-sm)",
443
+ width: "var(--size-icon-sm)"
444
+ } }),
445
+ b("bigconsole.dashboards.createDialog.field.tags", "Tags"),
446
+ /* @__PURE__ */ p("span", {
447
+ style: {
448
+ color: "var(--color-text-muted)",
449
+ fontWeight: "var(--font-weight-regular)"
450
+ },
451
+ children: b("bigconsole.dashboards.createDialog.field.tagsOptional", "(optional, max 10)")
452
+ })
453
+ ]
454
+ }),
455
+ B.length > 0 && /* @__PURE__ */ p("div", {
384
456
  style: {
385
- color: "var(--color-text-muted)",
386
- fontWeight: "var(--font-weight-regular)",
387
- marginLeft: "var(--space-controlGap)"
457
+ display: "flex",
458
+ flexWrap: "wrap",
459
+ gap: "var(--space-controlGap)",
460
+ marginBottom: "var(--space-controlGap)"
388
461
  },
389
- children: S("bigconsole.dashboards.createDialog.field.optional", "(optional)")
390
- })]
391
- }), /* @__PURE__ */ h(pe, {
392
- id: "dashboard-description",
393
- value: V,
394
- onChange: (e) => H(e.target.value),
395
- placeholder: S("bigconsole.dashboards.createDialog.field.descriptionPlaceholder", "Enter a brief description for this dashboard"),
396
- rows: 3,
397
- disabled: _ || E,
398
- style: {
399
- fontSize: "var(--font-size-body-sm)",
400
- resize: "none"
401
- }
402
- })]
403
- }),
404
- /* @__PURE__ */ g("div", { children: [
405
- /* @__PURE__ */ g("label", {
406
- htmlFor: "dashboard-tags",
407
- style: {
408
- display: "flex",
409
- alignItems: "center",
410
- gap: "var(--space-iconGap)",
411
- fontSize: "var(--font-size-body-sm)",
412
- fontWeight: "var(--font-weight-semibold)",
413
- color: "var(--color-text-primary)",
414
- marginBottom: "var(--space-controlGap)"
415
- },
416
- children: [
417
- /* @__PURE__ */ h(ae, { style: {
418
- height: "var(--size-icon-sm)",
419
- width: "var(--size-icon-sm)"
420
- } }),
421
- S("bigconsole.dashboards.createDialog.field.tags", "Tags"),
422
- /* @__PURE__ */ h("span", {
462
+ children: B.map((e) => /* @__PURE__ */ m(de, {
463
+ variant: "secondary",
423
464
  style: {
424
- color: "var(--color-text-muted)",
425
- fontWeight: "var(--font-weight-regular)"
465
+ display: "flex",
466
+ alignItems: "center",
467
+ gap: "4px",
468
+ paddingRight: "4px"
426
469
  },
427
- children: S("bigconsole.dashboards.createDialog.field.tagsOptional", "(optional, max 10)")
428
- })
429
- ]
430
- }),
431
- U.length > 0 && /* @__PURE__ */ h("div", {
432
- style: {
433
- display: "flex",
434
- flexWrap: "wrap",
435
- gap: "var(--space-controlGap)",
436
- marginBottom: "var(--space-controlGap)"
437
- },
438
- children: U.map((e) => /* @__PURE__ */ g(se, {
439
- variant: "secondary",
470
+ children: [e, /* @__PURE__ */ p("button", {
471
+ type: "button",
472
+ onClick: () => Oe(e),
473
+ disabled: h || C,
474
+ style: {
475
+ display: "flex",
476
+ alignItems: "center",
477
+ justifyContent: "center",
478
+ background: "none",
479
+ border: "none",
480
+ cursor: "pointer",
481
+ padding: "2px",
482
+ borderRadius: "50%",
483
+ color: "inherit",
484
+ opacity: .7
485
+ },
486
+ onMouseOver: (e) => e.currentTarget.style.opacity = "1",
487
+ onMouseOut: (e) => e.currentTarget.style.opacity = "0.7",
488
+ children: /* @__PURE__ */ p(ue, { style: {
489
+ height: "12px",
490
+ width: "12px"
491
+ } })
492
+ })]
493
+ }, e))
494
+ }),
495
+ /* @__PURE__ */ m("div", {
440
496
  style: {
441
497
  display: "flex",
442
- alignItems: "center",
443
- gap: "4px",
444
- paddingRight: "4px"
498
+ gap: "var(--space-controlGap)"
445
499
  },
446
- children: [e, /* @__PURE__ */ h("button", {
447
- type: "button",
448
- onClick: () => xe(e),
449
- disabled: _ || E,
500
+ children: [/* @__PURE__ */ p(d, {
501
+ id: "dashboard-tags",
502
+ type: "text",
503
+ value: H,
504
+ onChange: (e) => U(e.target.value),
505
+ onKeyDown: ke,
506
+ placeholder: B.length >= 10 ? b("bigconsole.dashboards.createDialog.field.tagsMaxReached", "Max tags reached") : b("bigconsole.dashboards.createDialog.field.tagsInputPlaceholder", "Type a tag and press Enter"),
507
+ disabled: h || C || B.length >= 10,
450
508
  style: {
451
- display: "flex",
452
- alignItems: "center",
453
- justifyContent: "center",
454
- background: "none",
455
- border: "none",
456
- cursor: "pointer",
457
- padding: "2px",
458
- borderRadius: "50%",
459
- color: "inherit",
460
- opacity: .7
461
- },
462
- onMouseOver: (e) => e.currentTarget.style.opacity = "1",
463
- onMouseOut: (e) => e.currentTarget.style.opacity = "0.7",
464
- children: /* @__PURE__ */ h(oe, { style: {
465
- height: "12px",
466
- width: "12px"
467
- } })
509
+ flex: 1,
510
+ height: "var(--size-controlHeight-md)",
511
+ fontSize: "var(--font-size-body-sm)"
512
+ }
513
+ }), /* @__PURE__ */ p(u, {
514
+ type: "button",
515
+ variant: "outline",
516
+ onClick: $,
517
+ disabled: h || C || !H.trim() || B.length >= 10,
518
+ style: { height: "var(--size-controlHeight-md)" },
519
+ children: b("bigconsole.dashboards.createDialog.action.addTag", "Add")
468
520
  })]
469
- }, e))
470
- }),
471
- /* @__PURE__ */ g("div", {
472
- style: {
473
- display: "flex",
474
- gap: "var(--space-controlGap)"
475
- },
476
- children: [/* @__PURE__ */ h(f, {
477
- id: "dashboard-tags",
478
- type: "text",
479
- value: G,
480
- onChange: (e) => K(e.target.value),
481
- onKeyDown: Se,
482
- placeholder: U.length >= 10 ? S("bigconsole.dashboards.createDialog.field.tagsMaxReached", "Max tags reached") : S("bigconsole.dashboards.createDialog.field.tagsInputPlaceholder", "Type a tag and press Enter"),
483
- disabled: _ || E || U.length >= 10,
521
+ }),
522
+ /* @__PURE__ */ p("p", {
484
523
  style: {
485
- flex: 1,
486
- height: "var(--size-controlHeight-md)",
487
- fontSize: "var(--font-size-body-sm)"
488
- }
489
- }), /* @__PURE__ */ h(u, {
490
- type: "button",
491
- variant: "outline",
492
- onClick: $,
493
- disabled: _ || E || !G.trim() || U.length >= 10,
494
- style: { height: "var(--size-controlHeight-md)" },
495
- children: S("bigconsole.dashboards.createDialog.action.addTag", "Add")
496
- })]
497
- }),
498
- /* @__PURE__ */ h("p", {
499
- style: {
500
- fontSize: "var(--font-size-xs)",
501
- color: "var(--color-text-muted)",
502
- marginTop: "var(--space-controlGap)"
503
- },
504
- children: S("bigconsole.dashboards.createDialog.field.tagsHelp", "Press Enter to add a tag, or click Add")
505
- })
506
- ] })
507
- ]
524
+ fontSize: "var(--font-size-xs)",
525
+ color: "var(--color-text-muted)",
526
+ marginTop: "var(--space-controlGap)"
527
+ },
528
+ children: b("bigconsole.dashboards.createDialog.field.tagsHelp", "Press Enter to add a tag, or click Add")
529
+ })
530
+ ] })
531
+ ]
532
+ })
508
533
  })
534
+ ]
535
+ }),
536
+ J && /* @__PURE__ */ p("div", {
537
+ style: {
538
+ padding: "var(--space-formGap) var(--space-pagePadding) 0",
539
+ flexShrink: 0
540
+ },
541
+ children: /* @__PURE__ */ p(ae, {
542
+ quota: J,
543
+ onViewBilling: Ne,
544
+ onDismiss: Me
509
545
  })
510
- ]
511
- }), /* @__PURE__ */ g(de, {
512
- style: {
513
- padding: "var(--space-formGap) var(--space-pagePadding)",
514
- borderTop: "1px solid var(--color-border)",
515
- backgroundColor: "var(--color-bg-sunken)",
516
- flexShrink: 0,
517
- display: "flex",
518
- justifyContent: "flex-end",
519
- gap: "var(--space-controlGap)"
520
- },
521
- children: [/* @__PURE__ */ h(u, {
522
- type: "button",
523
- variant: "outline",
524
- onClick: v,
525
- disabled: _ || E,
526
- style: { height: "var(--size-controlHeight-md)" },
527
- children: S("bigconsole.dashboards.createDialog.action.cancel", "Cancel")
528
- }), /* @__PURE__ */ h(u, {
529
- type: "submit",
530
- disabled: _ || E || !z.trim() || L === "template" && (!q || !Q || j),
546
+ }),
547
+ /* @__PURE__ */ m(he, {
531
548
  style: {
532
- height: "var(--size-controlHeight-md)",
533
- backgroundColor: "var(--color-action-primary-bg)"
549
+ padding: "var(--space-formGap) var(--space-pagePadding)",
550
+ borderTop: "1px solid var(--color-border)",
551
+ backgroundColor: "var(--color-bg-sunken)",
552
+ flexShrink: 0,
553
+ display: "flex",
554
+ justifyContent: "flex-end",
555
+ gap: "var(--space-controlGap)"
534
556
  },
535
- children: _ || E ? /* @__PURE__ */ g("span", {
536
- style: {
537
- display: "flex",
538
- alignItems: "center",
539
- gap: "var(--space-iconGap)"
540
- },
541
- children: [/* @__PURE__ */ h(p, { style: {
542
- height: "var(--size-icon-sm)",
543
- width: "var(--size-icon-sm)"
544
- } }), S("bigconsole.dashboards.createDialog.action.creating", "Creating...")]
545
- }) : /* @__PURE__ */ g("span", {
557
+ children: [/* @__PURE__ */ p(u, {
558
+ type: "button",
559
+ variant: "outline",
560
+ onClick: g,
561
+ disabled: h || C,
562
+ style: { height: "var(--size-controlHeight-md)" },
563
+ children: b("bigconsole.dashboards.createDialog.action.cancel", "Cancel")
564
+ }), /* @__PURE__ */ p(u, {
565
+ type: "submit",
566
+ disabled: h || C || J !== null || !I.trim() || P === "template" && (!W || !Q || O),
546
567
  style: {
547
- display: "flex",
548
- alignItems: "center",
549
- gap: "var(--space-iconGap)"
568
+ height: "var(--size-controlHeight-md)",
569
+ backgroundColor: "var(--color-action-primary-bg)"
550
570
  },
551
- children: [/* @__PURE__ */ h(l, { style: {
552
- height: "var(--size-icon-sm)",
553
- width: "var(--size-icon-sm)"
554
- } }), S("bigconsole.dashboards.createDialog.action.create", "Create Dashboard")]
555
- })
556
- })]
557
- })]
571
+ children: h || C ? /* @__PURE__ */ m("span", {
572
+ style: {
573
+ display: "flex",
574
+ alignItems: "center",
575
+ gap: "var(--space-iconGap)"
576
+ },
577
+ children: [/* @__PURE__ */ p(f, { style: {
578
+ height: "var(--size-icon-sm)",
579
+ width: "var(--size-icon-sm)"
580
+ } }), b("bigconsole.dashboards.createDialog.action.creating", "Creating...")]
581
+ }) : /* @__PURE__ */ m("span", {
582
+ style: {
583
+ display: "flex",
584
+ alignItems: "center",
585
+ gap: "var(--space-iconGap)"
586
+ },
587
+ children: [/* @__PURE__ */ p(l, { style: {
588
+ height: "var(--size-icon-sm)",
589
+ width: "var(--size-icon-sm)"
590
+ } }), b("bigconsole.dashboards.createDialog.action.create", "Create Dashboard")]
591
+ })
592
+ })]
593
+ })
594
+ ]
558
595
  })]
559
596
  })
560
597
  });
561
598
  });
562
599
  //#endregion
563
- export { _ as default };
600
+ export { h as default };