@jetzeroaero/design-system 1.2.1 → 1.4.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.
package/dist/index.cjs CHANGED
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
+ var React6 = require('react');
3
4
  var lucideReact = require('lucide-react');
4
5
  var jsxRuntime = require('react/jsx-runtime');
5
- var React = require('react');
6
6
 
7
7
  function _interopNamespace(e) {
8
8
  if (e && e.__esModule) return e;
@@ -22,7 +22,7 @@ function _interopNamespace(e) {
22
22
  return Object.freeze(n);
23
23
  }
24
24
 
25
- var React__namespace = /*#__PURE__*/_interopNamespace(React);
25
+ var React6__namespace = /*#__PURE__*/_interopNamespace(React6);
26
26
 
27
27
  // src/tokens.ts
28
28
  var palette = {
@@ -176,86 +176,214 @@ var tokens = {
176
176
  tracking
177
177
  };
178
178
  var tokens_default = tokens;
179
- var NAV_ICONS = {
180
- "Overview": lucideReact.LayoutDashboard,
181
- "Milestones": lucideReact.Target,
182
- "Telemetry": lucideReact.Activity,
183
- "Documents": lucideReact.FileText,
184
- "Cap table": lucideReact.Table2,
185
- "Reports": lucideReact.BarChart2,
186
- "Filings": lucideReact.FolderOpen,
187
- "Team": lucideReact.Users,
188
- "Partners": lucideReact.Handshake,
189
- "Settings": lucideReact.Settings
179
+
180
+ // src/components/cx.ts
181
+ var cx = (...parts) => parts.filter(Boolean).join(" ");
182
+ var Spinner = ({ size = "md", label = "Loading" }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("jz-spinner", size === "lg" && "jz-spinner--lg"), role: "status", "aria-label": label });
183
+ var Badge = ({ tone = "neutral", className, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx("span", { className: cx("jz-badge", `jz-badge--${tone}`, className), ...rest });
184
+ var EmptyState = ({ title, description, icon, action }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "jz-empty", children: [
185
+ icon,
186
+ /* @__PURE__ */ jsxRuntime.jsx("h3", { className: "jz-empty__title", children: title }),
187
+ description && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "jz-empty__desc", children: description }),
188
+ action
189
+ ] });
190
+ var ToastContext = React6__namespace.createContext(null);
191
+ var ToastProvider = ({ children }) => {
192
+ const [items, setItems] = React6__namespace.useState([]);
193
+ const nextId = React6__namespace.useRef(1);
194
+ const dismiss = React6__namespace.useCallback((id) => setItems((xs) => xs.filter((x) => x.id !== id)), []);
195
+ const toast = React6__namespace.useCallback((opts) => {
196
+ const id = nextId.current++;
197
+ setItems((xs) => [...xs, { ...opts, id }]);
198
+ const ms = opts.duration ?? 5e3;
199
+ if (ms > 0) setTimeout(() => dismiss(id), ms);
200
+ }, [dismiss]);
201
+ const api = React6__namespace.useMemo(() => ({ toast }), [toast]);
202
+ return /* @__PURE__ */ jsxRuntime.jsxs(ToastContext.Provider, { value: api, children: [
203
+ children,
204
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-toasts", "aria-live": "polite", "aria-atomic": "false", children: items.map((t) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("jz-toast", t.tone && t.tone !== "neutral" && `jz-toast--${t.tone}`), role: t.tone === "danger" ? "alert" : "status", children: [
205
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
206
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-toast__title", children: t.title }),
207
+ t.description && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-toast__desc", children: t.description })
208
+ ] }),
209
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "jz-toast__x", "aria-label": "Dismiss", onClick: () => dismiss(t.id), children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 14 14", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.5 2.5l9 9M11.5 2.5l-9 9" }) }) })
210
+ ] }, t.id)) })
211
+ ] });
190
212
  };
191
- var NAV = [
192
- { group: "PROGRAM", items: ["Overview", "Milestones", "Telemetry", "Documents"] },
193
- { group: "FINANCE", items: ["Cap table", "Reports", "Filings"] },
194
- { group: "ACCESS", items: ["Team", "Partners", "Settings"] }
213
+ function useToast() {
214
+ const ctx = React6__namespace.useContext(ToastContext);
215
+ if (!ctx) throw new Error("useToast must be used inside <ToastProvider>.");
216
+ return ctx;
217
+ }
218
+ var Button = React6__namespace.forwardRef(function Button2({ variant = "secondary", size = "md", loading, block, iconOnly, leadingIcon, className, children, disabled, type = "button", ...rest }, ref) {
219
+ return /* @__PURE__ */ jsxRuntime.jsxs(
220
+ "button",
221
+ {
222
+ ref,
223
+ type,
224
+ className: cx("jz-btn", `jz-btn--${variant}`, size !== "md" && `jz-btn--${size}`, block && "jz-btn--block", iconOnly && "jz-btn--icon", className),
225
+ disabled: disabled || loading,
226
+ "aria-busy": loading || void 0,
227
+ ...rest,
228
+ children: [
229
+ loading ? /* @__PURE__ */ jsxRuntime.jsx(Spinner, {}) : leadingIcon,
230
+ children
231
+ ]
232
+ }
233
+ );
234
+ });
235
+ var Wordmark = ({ height = 22, ...rest }) => /* @__PURE__ */ jsxRuntime.jsx(
236
+ "svg",
237
+ {
238
+ xmlns: "http://www.w3.org/2000/svg",
239
+ viewBox: "0 0 344.34 76.72",
240
+ height,
241
+ width: height * 344.34 / 76.72,
242
+ role: "img",
243
+ "aria-label": "JetZero",
244
+ ...rest,
245
+ children: /* @__PURE__ */ jsxRuntime.jsx("g", { children: /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
246
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
247
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "var(--jz-fire)", d: "M6.88,75.74c-3.78,0-6.85-.7-6.85-.7l-.03-12.78s2.43.82,5.11.82c3.94,0,7.19-2,9.67-4.47,2.65-2.63,3.96-6.38,3.96-10.87V0h13.64v47.73c0,8.2-2.57,15.23-7.45,20.39-4.64,4.91-11.06,7.62-18.07,7.62Z" }),
248
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "var(--jz-fire)", d: "M131.23,20.46V6.83h-18.75V0h-13.64v47.73c0,8.2,2.57,15.23,7.45,20.39,4.64,4.91,11.06,7.62,18.07,7.62,3.78,0,6.85-.7,6.85-.7l.03-12.78s-2.43.82-5.11.82c-3.94,0-7.19-2-9.67-4.47-2.65-2.63-3.96-6.38-3.96-10.87v-27.29h18.75Z" }),
249
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
250
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "var(--jz-fire)", d: "M95.3,46.03c.16-1.62.25-3.29.25-5.02,0-22.07-10.72-35.9-28.98-35.9s-30.68,13.64-30.68,35.9c0,24.12,12.68,35.71,31.49,35.71,14.19,0,26.31-6.12,26.31-6.12l-4.94-10.51s-11.71,4.69-22.12,4.69c-6.42,0-9.97-2.64-12.8-6.13-2.31-2.84-3.64-6.92-4.11-12.62h45.59ZM50.06,34.11c1.47-7.59,5.68-17.05,16.51-17.05s15.39,10.22,15.39,17.05h-31.9Z" }),
251
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "var(--jz-fire)", d: "M95.3,46.03c.16-1.62.25-3.29.25-5.02,0-22.07-10.72-35.9-28.98-35.9s-30.68,13.64-30.68,35.9c0,24.12,12.68,35.71,31.49,35.71,14.19,0,26.31-6.12,26.31-6.12l-4.94-10.51s-11.71,4.69-22.12,4.69c-6.42,0-9.97-2.64-12.8-6.13-2.31-2.84-3.64-6.92-4.11-12.62h45.59ZM50.06,34.11c1.47-7.59,5.68-17.05,16.51-17.05s15.39,10.22,15.39,17.05h-31.9Z" })
252
+ ] })
253
+ ] }),
254
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
255
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "var(--wordmark-ink)", d: "M255.8,74.92V6.83h13.46v5.05c4.2-3.89,11.9-6.72,18.94-6.72l-4.98,15.3c-6.58,0-11.47,1.56-13.9,4.97l-.07,49.48h-13.46Z" }),
256
+ /* @__PURE__ */ jsxRuntime.jsxs("g", { children: [
257
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "var(--wordmark-ink)", d: "M195.96,10.69c.03-.06.06-.12.08-.19.02-.05.05-.1.06-.15.02-.05.03-.1.04-.15.02-.07.04-.14.06-.2,0-.05.01-.09.02-.14.01-.07.02-.14.03-.22,0-.06,0-.12,0-.18s0-.12,0-.18c0-.09-.02-.18-.04-.27,0-.03,0-.06-.01-.09-.02-.12-.06-.23-.1-.35,0,0,0,0,0,0-.04-.12-.09-.23-.15-.35-.45-.86-1.31-1.4-2.27-1.44-.04,0-.07,0-.1,0h-49.19l-9.64,13.64h37.59l.16-.05-.13.1-21.7,30.69h16.7s28.4-40.16,28.4-40.16c.06-.08.1-.16.15-.25.01-.02.03-.05.04-.07Z" }),
258
+ /* @__PURE__ */ jsxRuntime.jsx("polygon", { fill: "var(--wordmark-ink)", points: "133.87 75.02 143.48 61.39 193.46 61.39 193.46 75.03 133.87 75.02" })
259
+ ] }),
260
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "var(--wordmark-ink)", d: "M282.97,41.01c0-22.25,12.43-35.9,30.68-35.9s30.69,13.83,30.69,35.9-13.64,35.7-30.69,35.7-30.68-13.45-30.68-35.7ZM313.66,17.06c-14.7,0-17.21,17.45-17.21,23.95,0,13.65,7.22,23.78,17.21,23.78s17.21-10.55,17.21-23.78c0-6.4-2.51-23.95-17.21-23.95Z" }),
261
+ /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "var(--wordmark-ink)", d: "M252.1,46.03c.16-1.62.25-3.29.25-5.02,0-22.07-10.72-35.9-28.98-35.9s-30.68,13.64-30.68,35.9c0,24.12,12.68,35.71,31.49,35.71,14.19,0,26.31-6.12,26.31-6.12l-4.94-10.51s-11.71,4.69-22.12,4.69c-6.42,0-9.97-2.64-12.8-6.13-2.31-2.84-3.64-6.92-4.11-12.62h45.59ZM206.86,34.11c1.47-7.59,5.68-17.05,16.51-17.05s15.39,10.22,15.39,17.05h-31.9Z" })
262
+ ] })
263
+ ] }) })
264
+ }
265
+ );
266
+ var KEY = "jz-theme";
267
+ function resolveTheme() {
268
+ try {
269
+ const s = localStorage.getItem(KEY);
270
+ if (s === "light" || s === "dark") return s;
271
+ } catch {
272
+ }
273
+ if (typeof matchMedia === "function" && matchMedia("(prefers-color-scheme: light)").matches) return "light";
274
+ return "dark";
275
+ }
276
+ function apply(theme, persist) {
277
+ document.documentElement.dataset.theme = theme;
278
+ if (persist) {
279
+ try {
280
+ localStorage.setItem(KEY, theme);
281
+ } catch {
282
+ }
283
+ }
284
+ }
285
+ function initTheme() {
286
+ const t = resolveTheme();
287
+ apply(t, false);
288
+ return t;
289
+ }
290
+ function useTheme() {
291
+ const [theme, set] = React6__namespace.useState(() => resolveTheme());
292
+ React6__namespace.useEffect(() => {
293
+ apply(theme, false);
294
+ }, [theme]);
295
+ const setTheme = React6__namespace.useCallback((t) => {
296
+ apply(t, true);
297
+ set(t);
298
+ }, []);
299
+ const toggle = React6__namespace.useCallback(() => setTheme(theme === "dark" ? "light" : "dark"), [theme, setTheme]);
300
+ return { theme, setTheme, toggle };
301
+ }
302
+ var ThemeToggle = ({ className, size = "md" }) => {
303
+ const { theme, toggle } = useTheme();
304
+ const dark = theme === "dark";
305
+ const label = dark ? "Switch to light interface" : "Switch to dark interface";
306
+ return /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size, iconOnly: true, className: ["jz-theme-toggle", className].filter(Boolean).join(" "), onClick: toggle, title: label, "aria-label": label, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 14 14", fill: "currentColor", "aria-hidden": "true", children: dark ? /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
307
+ /* @__PURE__ */ jsxRuntime.jsx("circle", { cx: "7", cy: "7", r: "3" }),
308
+ /* @__PURE__ */ jsxRuntime.jsx("path", { stroke: "currentColor", strokeWidth: "1.4", strokeLinecap: "round", fill: "none", d: "M7 1v1.5M7 11.5V13M1 7h1.5M11.5 7H13M2.9 2.9l1.1 1.1M10 10l1.1 1.1M2.9 11.1L4 10M10 4l1.1-1.1" })
309
+ ] }) : /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M7.5 2a5.5 5.5 0 1 0 5 7.8A4 4 0 0 1 7.5 2z" }) }) });
310
+ };
311
+ var I = { size: 14, strokeWidth: 1.75 };
312
+ var LEGACY_NAV = [
313
+ { label: "PROGRAM", items: [
314
+ { id: "Overview", label: "Overview", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.LayoutDashboard, { ...I }) },
315
+ { id: "Milestones", label: "Milestones", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Target, { ...I }) },
316
+ { id: "Telemetry", label: "Telemetry", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Activity, { ...I }) },
317
+ { id: "Documents", label: "Documents", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { ...I }) }
318
+ ] },
319
+ { label: "FINANCE", items: [
320
+ { id: "Cap table", label: "Cap table", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Table2, { ...I }) },
321
+ { id: "Reports", label: "Reports", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.BarChart2, { ...I }) },
322
+ { id: "Filings", label: "Filings", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.FolderOpen, { ...I }) }
323
+ ] },
324
+ { label: "ACCESS", items: [
325
+ { id: "Team", label: "Team", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Users, { ...I }) },
326
+ { id: "Partners", label: "Partners", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Handshake, { ...I }) },
327
+ { id: "Settings", label: "Settings", icon: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Settings, { ...I }) }
328
+ ] }
195
329
  ];
196
330
  var AppShell = ({
197
- active = "Overview",
331
+ active,
198
332
  children,
199
333
  logoSrc,
200
- user = { initials: "JK" }
201
- }) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "grid", gridTemplateColumns: "240px 1fr", minHeight: "100vh", background: "var(--jz-haze, #F4F8FC)" }, children: [
202
- /* @__PURE__ */ jsxRuntime.jsxs("aside", { style: { background: "#FFFFFF", borderRight: "1px solid #C9D0D4", padding: "20px 0" }, children: [
203
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "0 20px 20px", borderBottom: "1px solid #C9D0D4" }, children: [
204
- logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, style: { height: 20 }, alt: "JetZero" }) : /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontFamily: "Titillium Web", fontWeight: 700, fontSize: 18, color: "#0D1921" }, children: [
205
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { color: "#FF5500" }, children: "JET" }),
206
- "ZERO"
334
+ hideThemeToggle,
335
+ appName,
336
+ nav,
337
+ title,
338
+ actions,
339
+ user,
340
+ renderLink
341
+ }) => {
342
+ const legacy = !nav;
343
+ const groups = nav ?? LEGACY_NAV;
344
+ const current = active ?? groups[0]?.items[0]?.id;
345
+ const app = appName ?? (legacy ? "Investor Portal" : void 0);
346
+ const heading = title ?? groups.flatMap((g) => g.items).find((i) => i.id === current)?.label ?? current;
347
+ const [open, setOpen] = React6__namespace.useState(false);
348
+ const initials = user?.initials ?? (legacy ? "JK" : void 0);
349
+ const renderItem = (item) => {
350
+ const props = {
351
+ className: "jz-nav__item",
352
+ "aria-current": item.id === current ? "page" : void 0,
353
+ onClick: () => setOpen(false),
354
+ children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
355
+ item.icon,
356
+ item.label
357
+ ] })
358
+ };
359
+ if (renderLink && item.href) return /* @__PURE__ */ jsxRuntime.jsx(React6__namespace.Fragment, { children: renderLink(item, props) }, item.id);
360
+ if (item.href) return /* @__PURE__ */ jsxRuntime.jsx("a", { href: item.href, ...props }, item.id);
361
+ return /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", ...props }, item.id);
362
+ };
363
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("jz-root", "jz-shell"), "data-nav-open": open, children: [
364
+ /* @__PURE__ */ jsxRuntime.jsxs("aside", { className: "jz-shell__side", "aria-label": "Primary", children: [
365
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "jz-shell__brand", children: [
366
+ logoSrc ? /* @__PURE__ */ jsxRuntime.jsx("img", { src: logoSrc, style: { height: 22 }, alt: "JetZero" }) : /* @__PURE__ */ jsxRuntime.jsx(Wordmark, { height: 22 }),
367
+ app && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-shell__app", children: app })
207
368
  ] }),
208
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 9, color: "#778C99", marginTop: 6, letterSpacing: "0.2em", textTransform: "uppercase", fontFamily: "Martian Mono" }, children: "Investor Portal" })
369
+ /* @__PURE__ */ jsxRuntime.jsx("nav", { children: groups.map((g, gi) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "jz-nav__group", children: [
370
+ g.label && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-nav__label", children: g.label }),
371
+ g.items.map(renderItem)
372
+ ] }, g.label ?? gi)) })
209
373
  ] }),
210
- NAV.map((group) => /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { padding: "18px 0" }, children: [
211
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 9, color: "#778C99", letterSpacing: "0.22em", textTransform: "uppercase", padding: "0 20px 10px", fontFamily: "Martian Mono" }, children: group.group }),
212
- group.items.map((it) => {
213
- const on = active === it;
214
- const Icon = NAV_ICONS[it];
215
- const labelColor = on ? "#0D1921" : "#46535C";
216
- return /* @__PURE__ */ jsxRuntime.jsxs("a", { style: {
217
- display: "flex",
218
- alignItems: "center",
219
- gap: 10,
220
- padding: "8px 20px",
221
- borderLeft: on ? "2px solid #FF5500" : "2px solid transparent",
222
- fontSize: 13,
223
- fontWeight: on ? 600 : 400,
224
- color: labelColor,
225
- background: on ? "#F4F8FC" : "transparent",
226
- cursor: "pointer"
227
- }, children: [
228
- Icon && /* @__PURE__ */ jsxRuntime.jsx(Icon, { size: 14, color: labelColor, strokeWidth: 1.75 }),
229
- it
230
- ] }, it);
231
- })
232
- ] }, group.group))
233
- ] }),
234
- /* @__PURE__ */ jsxRuntime.jsxs("main", { style: { display: "flex", flexDirection: "column" }, children: [
235
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: {
236
- height: 56,
237
- borderBottom: "1px solid #C9D0D4",
238
- display: "flex",
239
- alignItems: "center",
240
- padding: "0 32px",
241
- gap: 16,
242
- background: "#FFFFFF"
243
- }, children: [
244
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { fontSize: 10, color: "#778C99", letterSpacing: "0.18em", textTransform: "uppercase", fontFamily: "Martian Mono", display: "flex", alignItems: "center", gap: 6 }, children: [
245
- "Program",
246
- /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowRight, { size: 12, color: "#778C99", strokeWidth: 1.75 })
374
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "jz-shell__main", children: [
375
+ /* @__PURE__ */ jsxRuntime.jsxs("header", { className: "jz-shell__bar", children: [
376
+ /* @__PURE__ */ jsxRuntime.jsx(Button, { variant: "ghost", size: "sm", iconOnly: true, className: "jz-shell__menu", "aria-label": "Open navigation", "aria-expanded": open, onClick: () => setOpen((o) => !o), children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Menu, { size: 16 }) }),
377
+ /* @__PURE__ */ jsxRuntime.jsx("h1", { className: "jz-shell__title", children: heading }),
378
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-shell__spacer" }),
379
+ actions,
380
+ !hideThemeToggle && /* @__PURE__ */ jsxRuntime.jsx(ThemeToggle, { size: "sm" }),
381
+ initials && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-avatar", title: user?.name, "aria-label": user?.name ?? "Account", children: initials })
247
382
  ] }),
248
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { fontSize: 13, color: "#0D1921", fontWeight: 600 }, children: active }),
249
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { flex: 1 } }),
250
- /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11, color: "#FF5500", fontFamily: "Martian Mono", letterSpacing: "0.1em", textTransform: "uppercase" }, children: [
251
- /* @__PURE__ */ jsxRuntime.jsx("span", { style: { width: 6, height: 6, borderRadius: "50%", background: "#FF5500" } }),
252
- "LIVE"
253
- ] }),
254
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { width: 28, height: 28, borderRadius: "50%", background: palette.dusk, color: onPalette.dusk, display: "flex", alignItems: "center", justifyContent: "center", fontSize: 11, fontWeight: 600 }, children: user.initials })
255
- ] }),
256
- /* @__PURE__ */ jsxRuntime.jsx("div", { style: { padding: 32, flex: 1 }, children })
257
- ] })
258
- ] });
383
+ /* @__PURE__ */ jsxRuntime.jsx("main", { className: "jz-shell__content", children })
384
+ ] })
385
+ ] });
386
+ };
259
387
  var AnnouncementCard = ({
260
388
  eyebrow,
261
389
  title,
@@ -328,7 +456,7 @@ var TelemetryCard = ({
328
456
  const step = w / (points.length - 1);
329
457
  const path = points.map((v, i) => `${i === 0 ? "M" : "L"} ${i * step} ${h - v / ceiling * h}`).join(" ");
330
458
  const fill = `${path} L ${w} ${h} L 0 ${h} Z`;
331
- const gradId = React__namespace.useId();
459
+ const gradId = React6__namespace.useId();
332
460
  return /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { background: "#FFFFFF", border: "1px solid #C9D0D4", borderRadius: 4, padding: 24, marginBottom: 32 }, children: [
333
461
  /* @__PURE__ */ jsxRuntime.jsxs("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: 20 }, children: [
334
462
  /* @__PURE__ */ jsxRuntime.jsxs("div", { children: [
@@ -458,13 +586,207 @@ function assertValidLogoBackground(variant, tone) {
458
586
  );
459
587
  }
460
588
  }
589
+ var Field = ({ label, hint, error, required, id, children, className }) => {
590
+ const auto = React6__namespace.useId();
591
+ const fid = id ?? auto;
592
+ const hintId = hint ? `${fid}-hint` : void 0;
593
+ const errId = error ? `${fid}-err` : void 0;
594
+ const control = React6__namespace.cloneElement(children, {
595
+ id: fid,
596
+ required,
597
+ "aria-invalid": error ? true : void 0,
598
+ "aria-describedby": [hintId, errId].filter(Boolean).join(" ") || void 0
599
+ });
600
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: cx("jz-field", error && "jz-field--invalid", className), children: [
601
+ /* @__PURE__ */ jsxRuntime.jsxs("label", { className: "jz-field__label", htmlFor: fid, children: [
602
+ label,
603
+ required && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "jz-field__req", "aria-hidden": "true", children: "*" })
604
+ ] }),
605
+ control,
606
+ hint && !error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-field__hint", id: hintId, children: hint }),
607
+ error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-field__error", id: errId, role: "alert", children: error })
608
+ ] });
609
+ };
610
+ var Input = React6__namespace.forwardRef(
611
+ function Input2({ className, ...rest }, ref) {
612
+ return /* @__PURE__ */ jsxRuntime.jsx("input", { ref, className: cx("jz-input", className), ...rest });
613
+ }
614
+ );
615
+ var Textarea = React6__namespace.forwardRef(
616
+ function Textarea2({ className, ...rest }, ref) {
617
+ return /* @__PURE__ */ jsxRuntime.jsx("textarea", { ref, className: cx("jz-textarea", className), ...rest });
618
+ }
619
+ );
620
+ var Select = React6__namespace.forwardRef(
621
+ function Select2({ className, ...rest }, ref) {
622
+ return /* @__PURE__ */ jsxRuntime.jsx("select", { ref, className: cx("jz-select", className), ...rest });
623
+ }
624
+ );
625
+ var Checkbox = React6__namespace.forwardRef(function Checkbox2({ label, className, ...rest }, ref) {
626
+ return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx("jz-check", className), children: [
627
+ /* @__PURE__ */ jsxRuntime.jsx("input", { ref, type: "checkbox", ...rest }),
628
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "jz-check__box", "aria-hidden": "true" }),
629
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
630
+ ] });
631
+ });
632
+ var Radio = React6__namespace.forwardRef(function Radio2({ label, className, ...rest }, ref) {
633
+ return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx("jz-check", className), children: [
634
+ /* @__PURE__ */ jsxRuntime.jsx("input", { ref, type: "radio", ...rest }),
635
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "jz-check__box", "aria-hidden": "true" }),
636
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
637
+ ] });
638
+ });
639
+ var Switch = React6__namespace.forwardRef(function Switch2({ label, className, ...rest }, ref) {
640
+ return /* @__PURE__ */ jsxRuntime.jsxs("label", { className: cx("jz-switch", className), children: [
641
+ /* @__PURE__ */ jsxRuntime.jsx("input", { ref, type: "checkbox", role: "switch", ...rest }),
642
+ /* @__PURE__ */ jsxRuntime.jsx("span", { className: "jz-switch__track", "aria-hidden": "true" }),
643
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
644
+ ] });
645
+ });
646
+ function Table({
647
+ columns,
648
+ rows,
649
+ rowKey,
650
+ caption,
651
+ sort,
652
+ onSortChange,
653
+ onRowClick,
654
+ emptyTitle = "Nothing here yet",
655
+ emptyDescription
656
+ }) {
657
+ if (rows.length === 0) return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-table-wrap", children: /* @__PURE__ */ jsxRuntime.jsx(EmptyState, { title: emptyTitle, description: emptyDescription }) });
658
+ const toggle = (c) => {
659
+ if (!c.sortable || !onSortChange) return;
660
+ onSortChange({ key: c.key, direction: sort?.key === c.key && sort.direction === "asc" ? "desc" : "asc" });
661
+ };
662
+ return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-table-wrap", children: /* @__PURE__ */ jsxRuntime.jsxs("table", { className: cx("jz-table", onRowClick && "jz-table--hover"), children: [
663
+ caption && /* @__PURE__ */ jsxRuntime.jsx("caption", { children: caption }),
664
+ /* @__PURE__ */ jsxRuntime.jsx("thead", { children: /* @__PURE__ */ jsxRuntime.jsx("tr", { children: columns.map((c) => {
665
+ const active = sort?.key === c.key;
666
+ const sortable = c.sortable && onSortChange;
667
+ return /* @__PURE__ */ jsxRuntime.jsxs(
668
+ "th",
669
+ {
670
+ scope: "col",
671
+ className: cx("jz-th", c.align === "right" && "jz-th--right", sortable && "jz-th--sortable"),
672
+ "aria-sort": active ? sort.direction === "asc" ? "ascending" : "descending" : void 0,
673
+ tabIndex: sortable ? 0 : void 0,
674
+ onClick: sortable ? () => toggle(c) : void 0,
675
+ onKeyDown: sortable ? (e) => {
676
+ if (e.key === "Enter" || e.key === " ") {
677
+ e.preventDefault();
678
+ toggle(c);
679
+ }
680
+ } : void 0,
681
+ children: [
682
+ c.header,
683
+ active ? sort.direction === "asc" ? " \u2191" : " \u2193" : ""
684
+ ]
685
+ },
686
+ c.key
687
+ );
688
+ }) }) }),
689
+ /* @__PURE__ */ jsxRuntime.jsx("tbody", { children: rows.map((r) => /* @__PURE__ */ jsxRuntime.jsx("tr", { "data-clickable": onRowClick ? "" : void 0, onClick: onRowClick ? () => onRowClick(r) : void 0, children: columns.map((c) => /* @__PURE__ */ jsxRuntime.jsx("td", { className: cx("jz-td", c.align === "right" && "jz-td--right", c.mono && "jz-td--mono"), children: c.render ? c.render(r) : r[c.key] }, c.key)) }, rowKey(r))) })
690
+ ] }) });
691
+ }
692
+ var Tabs = ({ items, value, defaultValue, onValueChange, "aria-label": ariaLabel }) => {
693
+ const base = React6__namespace.useId();
694
+ const [inner, setInner] = React6__namespace.useState(defaultValue ?? items[0]?.id);
695
+ const current = value ?? inner;
696
+ const refs = React6__namespace.useRef({});
697
+ const select = (id) => {
698
+ setInner(id);
699
+ onValueChange?.(id);
700
+ refs.current[id]?.focus();
701
+ };
702
+ const onKeyDown = (e) => {
703
+ const i = items.findIndex((t) => t.id === current);
704
+ let n = -1;
705
+ if (e.key === "ArrowRight") n = (i + 1) % items.length;
706
+ else if (e.key === "ArrowLeft") n = (i - 1 + items.length) % items.length;
707
+ else if (e.key === "Home") n = 0;
708
+ else if (e.key === "End") n = items.length - 1;
709
+ if (n >= 0) {
710
+ e.preventDefault();
711
+ select(items[n].id);
712
+ }
713
+ };
714
+ return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "jz-tabs", children: [
715
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-tabs__list", role: "tablist", "aria-label": ariaLabel, onKeyDown, children: items.map((t) => /* @__PURE__ */ jsxRuntime.jsx(
716
+ "button",
717
+ {
718
+ type: "button",
719
+ role: "tab",
720
+ className: "jz-tab",
721
+ id: `${base}-t-${t.id}`,
722
+ "aria-controls": `${base}-p-${t.id}`,
723
+ "aria-selected": t.id === current,
724
+ tabIndex: t.id === current ? 0 : -1,
725
+ ref: (el) => {
726
+ refs.current[t.id] = el;
727
+ },
728
+ onClick: () => select(t.id),
729
+ children: t.label
730
+ },
731
+ t.id
732
+ )) }),
733
+ items.map((t) => t.id === current && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-tabs__panel", role: "tabpanel", id: `${base}-p-${t.id}`, "aria-labelledby": `${base}-t-${t.id}`, tabIndex: 0, children: t.content }, t.id))
734
+ ] });
735
+ };
736
+ var Modal = ({ open, onClose, title, size = "md", children, footer }) => {
737
+ const ref = React6__namespace.useRef(null);
738
+ const titleId = React6__namespace.useId();
739
+ React6__namespace.useEffect(() => {
740
+ const d = ref.current;
741
+ if (!d) return;
742
+ if (open && !d.open) d.showModal();
743
+ if (!open && d.open) d.close();
744
+ }, [open]);
745
+ return /* @__PURE__ */ jsxRuntime.jsxs(
746
+ "dialog",
747
+ {
748
+ ref,
749
+ className: cx("jz-modal", size === "lg" && "jz-modal--lg"),
750
+ "aria-labelledby": titleId,
751
+ onClose,
752
+ onClick: (e) => {
753
+ if (e.target === ref.current) onClose();
754
+ },
755
+ children: [
756
+ /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "jz-modal__head", children: [
757
+ /* @__PURE__ */ jsxRuntime.jsx("h2", { className: "jz-modal__title", id: titleId, children: title }),
758
+ /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "jz-modal__close", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 14 14", width: "18", height: "18", fill: "none", stroke: "currentColor", strokeWidth: "1.6", strokeLinecap: "round", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("path", { d: "M2.5 2.5l9 9M11.5 2.5l-9 9" }) }) })
759
+ ] }),
760
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-modal__body", children }),
761
+ footer && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "jz-modal__foot", children: footer })
762
+ ]
763
+ }
764
+ );
765
+ };
461
766
 
462
767
  exports.AnnouncementCard = AnnouncementCard;
463
768
  exports.AppShell = AppShell;
769
+ exports.Badge = Badge;
770
+ exports.Button = Button;
771
+ exports.Checkbox = Checkbox;
464
772
  exports.DocumentList = DocumentList;
773
+ exports.EmptyState = EmptyState;
774
+ exports.Field = Field;
775
+ exports.Input = Input;
465
776
  exports.KPIGrid = KPIGrid;
777
+ exports.Modal = Modal;
778
+ exports.Radio = Radio;
779
+ exports.Select = Select;
780
+ exports.Spinner = Spinner;
781
+ exports.Switch = Switch;
782
+ exports.Table = Table;
783
+ exports.Tabs = Tabs;
466
784
  exports.TelemetryCard = TelemetryCard;
785
+ exports.Textarea = Textarea;
786
+ exports.ThemeToggle = ThemeToggle;
467
787
  exports.Timeline = Timeline;
788
+ exports.ToastProvider = ToastProvider;
789
+ exports.Wordmark = Wordmark;
468
790
  exports.accents = accents;
469
791
  exports.assertValidLogoBackground = assertValidLogoBackground;
470
792
  exports.categoricalSeries = categoricalSeries;
@@ -472,6 +794,7 @@ exports.dataviz = dataviz;
472
794
  exports.fontSizes = fontSizes;
473
795
  exports.fontWeights = fontWeights;
474
796
  exports.fonts = fonts;
797
+ exports.initTheme = initTheme;
475
798
  exports.isValidLogoBackground = isValidLogoBackground;
476
799
  exports.lineHeights = lineHeights;
477
800
  exports.logoForBackground = logoForBackground;
@@ -482,10 +805,13 @@ exports.onCategoricalSeries = onCategoricalSeries;
482
805
  exports.onPalette = onPalette;
483
806
  exports.palette = palette;
484
807
  exports.radii = radii;
808
+ exports.resolveTheme = resolveTheme;
485
809
  exports.shadows = shadows;
486
810
  exports.spacing = spacing;
487
811
  exports.tokens = tokens_default;
488
812
  exports.toneHex = toneHex;
489
813
  exports.tracking = tracking;
814
+ exports.useTheme = useTheme;
815
+ exports.useToast = useToast;
490
816
  //# sourceMappingURL=index.cjs.map
491
817
  //# sourceMappingURL=index.cjs.map