@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.js CHANGED
@@ -1,89 +1,216 @@
1
1
  import { palette, onPalette } from './chunk-5UTDPTKJ.js';
2
2
  export { accents, categoricalSeries, dataviz, fontSizes, fontWeights, fonts, lineHeights, motion, onAccents, onBackground, onCategoricalSeries, onPalette, palette, radii, shadows, spacing, tokens_default as tokens, tracking } from './chunk-5UTDPTKJ.js';
3
- import { Settings, Handshake, Users, FolderOpen, BarChart2, Table2, FileText, Activity, Target, LayoutDashboard, ArrowRight, Megaphone, TrendingUp, TrendingDown, Minus, Check } from 'lucide-react';
4
- import { jsxs, jsx } from 'react/jsx-runtime';
5
- import * as React from 'react';
3
+ import * as React6 from 'react';
4
+ import { Menu, Megaphone, TrendingUp, TrendingDown, Minus, Activity, Check, ArrowRight, FileText, LayoutDashboard, Target, Table2, BarChart2, FolderOpen, Users, Handshake, Settings } from 'lucide-react';
5
+ import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
6
6
 
7
- var NAV_ICONS = {
8
- "Overview": LayoutDashboard,
9
- "Milestones": Target,
10
- "Telemetry": Activity,
11
- "Documents": FileText,
12
- "Cap table": Table2,
13
- "Reports": BarChart2,
14
- "Filings": FolderOpen,
15
- "Team": Users,
16
- "Partners": Handshake,
17
- "Settings": Settings
7
+ // src/components/cx.ts
8
+ var cx = (...parts) => parts.filter(Boolean).join(" ");
9
+ var Spinner = ({ size = "md", label = "Loading" }) => /* @__PURE__ */ jsx("span", { className: cx("jz-spinner", size === "lg" && "jz-spinner--lg"), role: "status", "aria-label": label });
10
+ var Badge = ({ tone = "neutral", className, ...rest }) => /* @__PURE__ */ jsx("span", { className: cx("jz-badge", `jz-badge--${tone}`, className), ...rest });
11
+ var EmptyState = ({ title, description, icon, action }) => /* @__PURE__ */ jsxs("div", { className: "jz-empty", children: [
12
+ icon,
13
+ /* @__PURE__ */ jsx("h3", { className: "jz-empty__title", children: title }),
14
+ description && /* @__PURE__ */ jsx("p", { className: "jz-empty__desc", children: description }),
15
+ action
16
+ ] });
17
+ var ToastContext = React6.createContext(null);
18
+ var ToastProvider = ({ children }) => {
19
+ const [items, setItems] = React6.useState([]);
20
+ const nextId = React6.useRef(1);
21
+ const dismiss = React6.useCallback((id) => setItems((xs) => xs.filter((x) => x.id !== id)), []);
22
+ const toast = React6.useCallback((opts) => {
23
+ const id = nextId.current++;
24
+ setItems((xs) => [...xs, { ...opts, id }]);
25
+ const ms = opts.duration ?? 5e3;
26
+ if (ms > 0) setTimeout(() => dismiss(id), ms);
27
+ }, [dismiss]);
28
+ const api = React6.useMemo(() => ({ toast }), [toast]);
29
+ return /* @__PURE__ */ jsxs(ToastContext.Provider, { value: api, children: [
30
+ children,
31
+ /* @__PURE__ */ jsx("div", { className: "jz-toasts", "aria-live": "polite", "aria-atomic": "false", children: items.map((t) => /* @__PURE__ */ jsxs("div", { className: cx("jz-toast", t.tone && t.tone !== "neutral" && `jz-toast--${t.tone}`), role: t.tone === "danger" ? "alert" : "status", children: [
32
+ /* @__PURE__ */ jsxs("div", { children: [
33
+ /* @__PURE__ */ jsx("div", { className: "jz-toast__title", children: t.title }),
34
+ t.description && /* @__PURE__ */ jsx("div", { className: "jz-toast__desc", children: t.description })
35
+ ] }),
36
+ /* @__PURE__ */ jsx("button", { type: "button", className: "jz-toast__x", "aria-label": "Dismiss", onClick: () => dismiss(t.id), children: /* @__PURE__ */ 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__ */ jsx("path", { d: "M2.5 2.5l9 9M11.5 2.5l-9 9" }) }) })
37
+ ] }, t.id)) })
38
+ ] });
18
39
  };
19
- var NAV = [
20
- { group: "PROGRAM", items: ["Overview", "Milestones", "Telemetry", "Documents"] },
21
- { group: "FINANCE", items: ["Cap table", "Reports", "Filings"] },
22
- { group: "ACCESS", items: ["Team", "Partners", "Settings"] }
40
+ function useToast() {
41
+ const ctx = React6.useContext(ToastContext);
42
+ if (!ctx) throw new Error("useToast must be used inside <ToastProvider>.");
43
+ return ctx;
44
+ }
45
+ var Button = React6.forwardRef(function Button2({ variant = "secondary", size = "md", loading, block, iconOnly, leadingIcon, className, children, disabled, type = "button", ...rest }, ref) {
46
+ return /* @__PURE__ */ jsxs(
47
+ "button",
48
+ {
49
+ ref,
50
+ type,
51
+ className: cx("jz-btn", `jz-btn--${variant}`, size !== "md" && `jz-btn--${size}`, block && "jz-btn--block", iconOnly && "jz-btn--icon", className),
52
+ disabled: disabled || loading,
53
+ "aria-busy": loading || void 0,
54
+ ...rest,
55
+ children: [
56
+ loading ? /* @__PURE__ */ jsx(Spinner, {}) : leadingIcon,
57
+ children
58
+ ]
59
+ }
60
+ );
61
+ });
62
+ var Wordmark = ({ height = 22, ...rest }) => /* @__PURE__ */ jsx(
63
+ "svg",
64
+ {
65
+ xmlns: "http://www.w3.org/2000/svg",
66
+ viewBox: "0 0 344.34 76.72",
67
+ height,
68
+ width: height * 344.34 / 76.72,
69
+ role: "img",
70
+ "aria-label": "JetZero",
71
+ ...rest,
72
+ children: /* @__PURE__ */ jsx("g", { children: /* @__PURE__ */ jsxs("g", { children: [
73
+ /* @__PURE__ */ jsxs("g", { children: [
74
+ /* @__PURE__ */ 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" }),
75
+ /* @__PURE__ */ 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" }),
76
+ /* @__PURE__ */ jsxs("g", { children: [
77
+ /* @__PURE__ */ 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" }),
78
+ /* @__PURE__ */ 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" })
79
+ ] })
80
+ ] }),
81
+ /* @__PURE__ */ jsxs("g", { children: [
82
+ /* @__PURE__ */ 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" }),
83
+ /* @__PURE__ */ jsxs("g", { children: [
84
+ /* @__PURE__ */ 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" }),
85
+ /* @__PURE__ */ 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" })
86
+ ] }),
87
+ /* @__PURE__ */ 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" }),
88
+ /* @__PURE__ */ 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" })
89
+ ] })
90
+ ] }) })
91
+ }
92
+ );
93
+ var KEY = "jz-theme";
94
+ function resolveTheme() {
95
+ try {
96
+ const s = localStorage.getItem(KEY);
97
+ if (s === "light" || s === "dark") return s;
98
+ } catch {
99
+ }
100
+ if (typeof matchMedia === "function" && matchMedia("(prefers-color-scheme: light)").matches) return "light";
101
+ return "dark";
102
+ }
103
+ function apply(theme, persist) {
104
+ document.documentElement.dataset.theme = theme;
105
+ if (persist) {
106
+ try {
107
+ localStorage.setItem(KEY, theme);
108
+ } catch {
109
+ }
110
+ }
111
+ }
112
+ function initTheme() {
113
+ const t = resolveTheme();
114
+ apply(t, false);
115
+ return t;
116
+ }
117
+ function useTheme() {
118
+ const [theme, set] = React6.useState(() => resolveTheme());
119
+ React6.useEffect(() => {
120
+ apply(theme, false);
121
+ }, [theme]);
122
+ const setTheme = React6.useCallback((t) => {
123
+ apply(t, true);
124
+ set(t);
125
+ }, []);
126
+ const toggle = React6.useCallback(() => setTheme(theme === "dark" ? "light" : "dark"), [theme, setTheme]);
127
+ return { theme, setTheme, toggle };
128
+ }
129
+ var ThemeToggle = ({ className, size = "md" }) => {
130
+ const { theme, toggle } = useTheme();
131
+ const dark = theme === "dark";
132
+ const label = dark ? "Switch to light interface" : "Switch to dark interface";
133
+ return /* @__PURE__ */ jsx(Button, { variant: "ghost", size, iconOnly: true, className: ["jz-theme-toggle", className].filter(Boolean).join(" "), onClick: toggle, title: label, "aria-label": label, children: /* @__PURE__ */ jsx("svg", { viewBox: "0 0 14 14", fill: "currentColor", "aria-hidden": "true", children: dark ? /* @__PURE__ */ jsxs(Fragment, { children: [
134
+ /* @__PURE__ */ jsx("circle", { cx: "7", cy: "7", r: "3" }),
135
+ /* @__PURE__ */ 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" })
136
+ ] }) : /* @__PURE__ */ jsx("path", { d: "M7.5 2a5.5 5.5 0 1 0 5 7.8A4 4 0 0 1 7.5 2z" }) }) });
137
+ };
138
+ var I = { size: 14, strokeWidth: 1.75 };
139
+ var LEGACY_NAV = [
140
+ { label: "PROGRAM", items: [
141
+ { id: "Overview", label: "Overview", icon: /* @__PURE__ */ jsx(LayoutDashboard, { ...I }) },
142
+ { id: "Milestones", label: "Milestones", icon: /* @__PURE__ */ jsx(Target, { ...I }) },
143
+ { id: "Telemetry", label: "Telemetry", icon: /* @__PURE__ */ jsx(Activity, { ...I }) },
144
+ { id: "Documents", label: "Documents", icon: /* @__PURE__ */ jsx(FileText, { ...I }) }
145
+ ] },
146
+ { label: "FINANCE", items: [
147
+ { id: "Cap table", label: "Cap table", icon: /* @__PURE__ */ jsx(Table2, { ...I }) },
148
+ { id: "Reports", label: "Reports", icon: /* @__PURE__ */ jsx(BarChart2, { ...I }) },
149
+ { id: "Filings", label: "Filings", icon: /* @__PURE__ */ jsx(FolderOpen, { ...I }) }
150
+ ] },
151
+ { label: "ACCESS", items: [
152
+ { id: "Team", label: "Team", icon: /* @__PURE__ */ jsx(Users, { ...I }) },
153
+ { id: "Partners", label: "Partners", icon: /* @__PURE__ */ jsx(Handshake, { ...I }) },
154
+ { id: "Settings", label: "Settings", icon: /* @__PURE__ */ jsx(Settings, { ...I }) }
155
+ ] }
23
156
  ];
24
157
  var AppShell = ({
25
- active = "Overview",
158
+ active,
26
159
  children,
27
160
  logoSrc,
28
- user = { initials: "JK" }
29
- }) => /* @__PURE__ */ jsxs("div", { style: { display: "grid", gridTemplateColumns: "240px 1fr", minHeight: "100vh", background: "var(--jz-haze, #F4F8FC)" }, children: [
30
- /* @__PURE__ */ jsxs("aside", { style: { background: "#FFFFFF", borderRight: "1px solid #C9D0D4", padding: "20px 0" }, children: [
31
- /* @__PURE__ */ jsxs("div", { style: { padding: "0 20px 20px", borderBottom: "1px solid #C9D0D4" }, children: [
32
- logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, style: { height: 20 }, alt: "JetZero" }) : /* @__PURE__ */ jsxs("div", { style: { fontFamily: "Titillium Web", fontWeight: 700, fontSize: 18, color: "#0D1921" }, children: [
33
- /* @__PURE__ */ jsx("span", { style: { color: "#FF5500" }, children: "JET" }),
34
- "ZERO"
161
+ hideThemeToggle,
162
+ appName,
163
+ nav,
164
+ title,
165
+ actions,
166
+ user,
167
+ renderLink
168
+ }) => {
169
+ const legacy = !nav;
170
+ const groups = nav ?? LEGACY_NAV;
171
+ const current = active ?? groups[0]?.items[0]?.id;
172
+ const app = appName ?? (legacy ? "Investor Portal" : void 0);
173
+ const heading = title ?? groups.flatMap((g) => g.items).find((i) => i.id === current)?.label ?? current;
174
+ const [open, setOpen] = React6.useState(false);
175
+ const initials = user?.initials ?? (legacy ? "JK" : void 0);
176
+ const renderItem = (item) => {
177
+ const props = {
178
+ className: "jz-nav__item",
179
+ "aria-current": item.id === current ? "page" : void 0,
180
+ onClick: () => setOpen(false),
181
+ children: /* @__PURE__ */ jsxs(Fragment, { children: [
182
+ item.icon,
183
+ item.label
184
+ ] })
185
+ };
186
+ if (renderLink && item.href) return /* @__PURE__ */ jsx(React6.Fragment, { children: renderLink(item, props) }, item.id);
187
+ if (item.href) return /* @__PURE__ */ jsx("a", { href: item.href, ...props }, item.id);
188
+ return /* @__PURE__ */ jsx("button", { type: "button", ...props }, item.id);
189
+ };
190
+ return /* @__PURE__ */ jsxs("div", { className: cx("jz-root", "jz-shell"), "data-nav-open": open, children: [
191
+ /* @__PURE__ */ jsxs("aside", { className: "jz-shell__side", "aria-label": "Primary", children: [
192
+ /* @__PURE__ */ jsxs("div", { className: "jz-shell__brand", children: [
193
+ logoSrc ? /* @__PURE__ */ jsx("img", { src: logoSrc, style: { height: 22 }, alt: "JetZero" }) : /* @__PURE__ */ jsx(Wordmark, { height: 22 }),
194
+ app && /* @__PURE__ */ jsx("div", { className: "jz-shell__app", children: app })
35
195
  ] }),
36
- /* @__PURE__ */ jsx("div", { style: { fontSize: 9, color: "#778C99", marginTop: 6, letterSpacing: "0.2em", textTransform: "uppercase", fontFamily: "Martian Mono" }, children: "Investor Portal" })
196
+ /* @__PURE__ */ jsx("nav", { children: groups.map((g, gi) => /* @__PURE__ */ jsxs("div", { className: "jz-nav__group", children: [
197
+ g.label && /* @__PURE__ */ jsx("div", { className: "jz-nav__label", children: g.label }),
198
+ g.items.map(renderItem)
199
+ ] }, g.label ?? gi)) })
37
200
  ] }),
38
- NAV.map((group) => /* @__PURE__ */ jsxs("div", { style: { padding: "18px 0" }, children: [
39
- /* @__PURE__ */ jsx("div", { style: { fontSize: 9, color: "#778C99", letterSpacing: "0.22em", textTransform: "uppercase", padding: "0 20px 10px", fontFamily: "Martian Mono" }, children: group.group }),
40
- group.items.map((it) => {
41
- const on = active === it;
42
- const Icon = NAV_ICONS[it];
43
- const labelColor = on ? "#0D1921" : "#46535C";
44
- return /* @__PURE__ */ jsxs("a", { style: {
45
- display: "flex",
46
- alignItems: "center",
47
- gap: 10,
48
- padding: "8px 20px",
49
- borderLeft: on ? "2px solid #FF5500" : "2px solid transparent",
50
- fontSize: 13,
51
- fontWeight: on ? 600 : 400,
52
- color: labelColor,
53
- background: on ? "#F4F8FC" : "transparent",
54
- cursor: "pointer"
55
- }, children: [
56
- Icon && /* @__PURE__ */ jsx(Icon, { size: 14, color: labelColor, strokeWidth: 1.75 }),
57
- it
58
- ] }, it);
59
- })
60
- ] }, group.group))
61
- ] }),
62
- /* @__PURE__ */ jsxs("main", { style: { display: "flex", flexDirection: "column" }, children: [
63
- /* @__PURE__ */ jsxs("div", { style: {
64
- height: 56,
65
- borderBottom: "1px solid #C9D0D4",
66
- display: "flex",
67
- alignItems: "center",
68
- padding: "0 32px",
69
- gap: 16,
70
- background: "#FFFFFF"
71
- }, children: [
72
- /* @__PURE__ */ jsxs("div", { style: { fontSize: 10, color: "#778C99", letterSpacing: "0.18em", textTransform: "uppercase", fontFamily: "Martian Mono", display: "flex", alignItems: "center", gap: 6 }, children: [
73
- "Program",
74
- /* @__PURE__ */ jsx(ArrowRight, { size: 12, color: "#778C99", strokeWidth: 1.75 })
75
- ] }),
76
- /* @__PURE__ */ jsx("div", { style: { fontSize: 13, color: "#0D1921", fontWeight: 600 }, children: active }),
77
- /* @__PURE__ */ jsx("div", { style: { flex: 1 } }),
78
- /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "center", gap: 6, fontSize: 11, color: "#FF5500", fontFamily: "Martian Mono", letterSpacing: "0.1em", textTransform: "uppercase" }, children: [
79
- /* @__PURE__ */ jsx("span", { style: { width: 6, height: 6, borderRadius: "50%", background: "#FF5500" } }),
80
- "LIVE"
201
+ /* @__PURE__ */ jsxs("div", { className: "jz-shell__main", children: [
202
+ /* @__PURE__ */ jsxs("header", { className: "jz-shell__bar", children: [
203
+ /* @__PURE__ */ 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__ */ jsx(Menu, { size: 16 }) }),
204
+ /* @__PURE__ */ jsx("h1", { className: "jz-shell__title", children: heading }),
205
+ /* @__PURE__ */ jsx("div", { className: "jz-shell__spacer" }),
206
+ actions,
207
+ !hideThemeToggle && /* @__PURE__ */ jsx(ThemeToggle, { size: "sm" }),
208
+ initials && /* @__PURE__ */ jsx("div", { className: "jz-avatar", title: user?.name, "aria-label": user?.name ?? "Account", children: initials })
81
209
  ] }),
82
- /* @__PURE__ */ 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 })
83
- ] }),
84
- /* @__PURE__ */ jsx("div", { style: { padding: 32, flex: 1 }, children })
85
- ] })
86
- ] });
210
+ /* @__PURE__ */ jsx("main", { className: "jz-shell__content", children })
211
+ ] })
212
+ ] });
213
+ };
87
214
  var AnnouncementCard = ({
88
215
  eyebrow,
89
216
  title,
@@ -156,7 +283,7 @@ var TelemetryCard = ({
156
283
  const step = w / (points.length - 1);
157
284
  const path = points.map((v, i) => `${i === 0 ? "M" : "L"} ${i * step} ${h - v / ceiling * h}`).join(" ");
158
285
  const fill = `${path} L ${w} ${h} L 0 ${h} Z`;
159
- const gradId = React.useId();
286
+ const gradId = React6.useId();
160
287
  return /* @__PURE__ */ jsxs("div", { style: { background: "#FFFFFF", border: "1px solid #C9D0D4", borderRadius: 4, padding: 24, marginBottom: 32 }, children: [
161
288
  /* @__PURE__ */ jsxs("div", { style: { display: "flex", alignItems: "flex-start", justifyContent: "space-between", marginBottom: 20 }, children: [
162
289
  /* @__PURE__ */ jsxs("div", { children: [
@@ -286,7 +413,184 @@ function assertValidLogoBackground(variant, tone) {
286
413
  );
287
414
  }
288
415
  }
416
+ var Field = ({ label, hint, error, required, id, children, className }) => {
417
+ const auto = React6.useId();
418
+ const fid = id ?? auto;
419
+ const hintId = hint ? `${fid}-hint` : void 0;
420
+ const errId = error ? `${fid}-err` : void 0;
421
+ const control = React6.cloneElement(children, {
422
+ id: fid,
423
+ required,
424
+ "aria-invalid": error ? true : void 0,
425
+ "aria-describedby": [hintId, errId].filter(Boolean).join(" ") || void 0
426
+ });
427
+ return /* @__PURE__ */ jsxs("div", { className: cx("jz-field", error && "jz-field--invalid", className), children: [
428
+ /* @__PURE__ */ jsxs("label", { className: "jz-field__label", htmlFor: fid, children: [
429
+ label,
430
+ required && /* @__PURE__ */ jsx("span", { className: "jz-field__req", "aria-hidden": "true", children: "*" })
431
+ ] }),
432
+ control,
433
+ hint && !error && /* @__PURE__ */ jsx("div", { className: "jz-field__hint", id: hintId, children: hint }),
434
+ error && /* @__PURE__ */ jsx("div", { className: "jz-field__error", id: errId, role: "alert", children: error })
435
+ ] });
436
+ };
437
+ var Input = React6.forwardRef(
438
+ function Input2({ className, ...rest }, ref) {
439
+ return /* @__PURE__ */ jsx("input", { ref, className: cx("jz-input", className), ...rest });
440
+ }
441
+ );
442
+ var Textarea = React6.forwardRef(
443
+ function Textarea2({ className, ...rest }, ref) {
444
+ return /* @__PURE__ */ jsx("textarea", { ref, className: cx("jz-textarea", className), ...rest });
445
+ }
446
+ );
447
+ var Select = React6.forwardRef(
448
+ function Select2({ className, ...rest }, ref) {
449
+ return /* @__PURE__ */ jsx("select", { ref, className: cx("jz-select", className), ...rest });
450
+ }
451
+ );
452
+ var Checkbox = React6.forwardRef(function Checkbox2({ label, className, ...rest }, ref) {
453
+ return /* @__PURE__ */ jsxs("label", { className: cx("jz-check", className), children: [
454
+ /* @__PURE__ */ jsx("input", { ref, type: "checkbox", ...rest }),
455
+ /* @__PURE__ */ jsx("span", { className: "jz-check__box", "aria-hidden": "true" }),
456
+ /* @__PURE__ */ jsx("span", { children: label })
457
+ ] });
458
+ });
459
+ var Radio = React6.forwardRef(function Radio2({ label, className, ...rest }, ref) {
460
+ return /* @__PURE__ */ jsxs("label", { className: cx("jz-check", className), children: [
461
+ /* @__PURE__ */ jsx("input", { ref, type: "radio", ...rest }),
462
+ /* @__PURE__ */ jsx("span", { className: "jz-check__box", "aria-hidden": "true" }),
463
+ /* @__PURE__ */ jsx("span", { children: label })
464
+ ] });
465
+ });
466
+ var Switch = React6.forwardRef(function Switch2({ label, className, ...rest }, ref) {
467
+ return /* @__PURE__ */ jsxs("label", { className: cx("jz-switch", className), children: [
468
+ /* @__PURE__ */ jsx("input", { ref, type: "checkbox", role: "switch", ...rest }),
469
+ /* @__PURE__ */ jsx("span", { className: "jz-switch__track", "aria-hidden": "true" }),
470
+ /* @__PURE__ */ jsx("span", { children: label })
471
+ ] });
472
+ });
473
+ function Table({
474
+ columns,
475
+ rows,
476
+ rowKey,
477
+ caption,
478
+ sort,
479
+ onSortChange,
480
+ onRowClick,
481
+ emptyTitle = "Nothing here yet",
482
+ emptyDescription
483
+ }) {
484
+ if (rows.length === 0) return /* @__PURE__ */ jsx("div", { className: "jz-table-wrap", children: /* @__PURE__ */ jsx(EmptyState, { title: emptyTitle, description: emptyDescription }) });
485
+ const toggle = (c) => {
486
+ if (!c.sortable || !onSortChange) return;
487
+ onSortChange({ key: c.key, direction: sort?.key === c.key && sort.direction === "asc" ? "desc" : "asc" });
488
+ };
489
+ return /* @__PURE__ */ jsx("div", { className: "jz-table-wrap", children: /* @__PURE__ */ jsxs("table", { className: cx("jz-table", onRowClick && "jz-table--hover"), children: [
490
+ caption && /* @__PURE__ */ jsx("caption", { children: caption }),
491
+ /* @__PURE__ */ jsx("thead", { children: /* @__PURE__ */ jsx("tr", { children: columns.map((c) => {
492
+ const active = sort?.key === c.key;
493
+ const sortable = c.sortable && onSortChange;
494
+ return /* @__PURE__ */ jsxs(
495
+ "th",
496
+ {
497
+ scope: "col",
498
+ className: cx("jz-th", c.align === "right" && "jz-th--right", sortable && "jz-th--sortable"),
499
+ "aria-sort": active ? sort.direction === "asc" ? "ascending" : "descending" : void 0,
500
+ tabIndex: sortable ? 0 : void 0,
501
+ onClick: sortable ? () => toggle(c) : void 0,
502
+ onKeyDown: sortable ? (e) => {
503
+ if (e.key === "Enter" || e.key === " ") {
504
+ e.preventDefault();
505
+ toggle(c);
506
+ }
507
+ } : void 0,
508
+ children: [
509
+ c.header,
510
+ active ? sort.direction === "asc" ? " \u2191" : " \u2193" : ""
511
+ ]
512
+ },
513
+ c.key
514
+ );
515
+ }) }) }),
516
+ /* @__PURE__ */ jsx("tbody", { children: rows.map((r) => /* @__PURE__ */ jsx("tr", { "data-clickable": onRowClick ? "" : void 0, onClick: onRowClick ? () => onRowClick(r) : void 0, children: columns.map((c) => /* @__PURE__ */ 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))) })
517
+ ] }) });
518
+ }
519
+ var Tabs = ({ items, value, defaultValue, onValueChange, "aria-label": ariaLabel }) => {
520
+ const base = React6.useId();
521
+ const [inner, setInner] = React6.useState(defaultValue ?? items[0]?.id);
522
+ const current = value ?? inner;
523
+ const refs = React6.useRef({});
524
+ const select = (id) => {
525
+ setInner(id);
526
+ onValueChange?.(id);
527
+ refs.current[id]?.focus();
528
+ };
529
+ const onKeyDown = (e) => {
530
+ const i = items.findIndex((t) => t.id === current);
531
+ let n = -1;
532
+ if (e.key === "ArrowRight") n = (i + 1) % items.length;
533
+ else if (e.key === "ArrowLeft") n = (i - 1 + items.length) % items.length;
534
+ else if (e.key === "Home") n = 0;
535
+ else if (e.key === "End") n = items.length - 1;
536
+ if (n >= 0) {
537
+ e.preventDefault();
538
+ select(items[n].id);
539
+ }
540
+ };
541
+ return /* @__PURE__ */ jsxs("div", { className: "jz-tabs", children: [
542
+ /* @__PURE__ */ jsx("div", { className: "jz-tabs__list", role: "tablist", "aria-label": ariaLabel, onKeyDown, children: items.map((t) => /* @__PURE__ */ jsx(
543
+ "button",
544
+ {
545
+ type: "button",
546
+ role: "tab",
547
+ className: "jz-tab",
548
+ id: `${base}-t-${t.id}`,
549
+ "aria-controls": `${base}-p-${t.id}`,
550
+ "aria-selected": t.id === current,
551
+ tabIndex: t.id === current ? 0 : -1,
552
+ ref: (el) => {
553
+ refs.current[t.id] = el;
554
+ },
555
+ onClick: () => select(t.id),
556
+ children: t.label
557
+ },
558
+ t.id
559
+ )) }),
560
+ items.map((t) => t.id === current && /* @__PURE__ */ 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))
561
+ ] });
562
+ };
563
+ var Modal = ({ open, onClose, title, size = "md", children, footer }) => {
564
+ const ref = React6.useRef(null);
565
+ const titleId = React6.useId();
566
+ React6.useEffect(() => {
567
+ const d = ref.current;
568
+ if (!d) return;
569
+ if (open && !d.open) d.showModal();
570
+ if (!open && d.open) d.close();
571
+ }, [open]);
572
+ return /* @__PURE__ */ jsxs(
573
+ "dialog",
574
+ {
575
+ ref,
576
+ className: cx("jz-modal", size === "lg" && "jz-modal--lg"),
577
+ "aria-labelledby": titleId,
578
+ onClose,
579
+ onClick: (e) => {
580
+ if (e.target === ref.current) onClose();
581
+ },
582
+ children: [
583
+ /* @__PURE__ */ jsxs("div", { className: "jz-modal__head", children: [
584
+ /* @__PURE__ */ jsx("h2", { className: "jz-modal__title", id: titleId, children: title }),
585
+ /* @__PURE__ */ jsx("button", { type: "button", className: "jz-modal__close", "aria-label": "Close", onClick: onClose, children: /* @__PURE__ */ 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__ */ jsx("path", { d: "M2.5 2.5l9 9M11.5 2.5l-9 9" }) }) })
586
+ ] }),
587
+ /* @__PURE__ */ jsx("div", { className: "jz-modal__body", children }),
588
+ footer && /* @__PURE__ */ jsx("div", { className: "jz-modal__foot", children: footer })
589
+ ]
590
+ }
591
+ );
592
+ };
289
593
 
290
- export { AnnouncementCard, AppShell, DocumentList, KPIGrid, TelemetryCard, Timeline, assertValidLogoBackground, isValidLogoBackground, logoForBackground, toneHex };
594
+ export { AnnouncementCard, AppShell, Badge, Button, Checkbox, DocumentList, EmptyState, Field, Input, KPIGrid, Modal, Radio, Select, Spinner, Switch, Table, Tabs, TelemetryCard, Textarea, ThemeToggle, Timeline, ToastProvider, Wordmark, assertValidLogoBackground, initTheme, isValidLogoBackground, logoForBackground, resolveTheme, toneHex, useTheme, useToast };
291
595
  //# sourceMappingURL=index.js.map
292
596
  //# sourceMappingURL=index.js.map