@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/README.md +14 -4
- package/dist/components.css +205 -0
- package/dist/index.cjs +401 -75
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +190 -2
- package/dist/index.d.ts +190 -2
- package/dist/index.js +381 -77
- package/dist/index.js.map +1 -1
- package/dist/logos/AWG4-black.svg +14 -0
- package/dist/logos/AWG4-white.svg +14 -0
- package/dist/logos/JZ-Factory1-logo-grey-night.svg +20 -0
- package/dist/logos/JZ-Factory1-logo-night.svg +20 -0
- package/dist/logos/JZ-Factory1-logo-white-night.svg +20 -0
- package/dist/logos/JZ-Factory1-logo-white.svg +20 -0
- package/dist/logos/JZ-Jet1-grey-night.svg +19 -0
- package/dist/logos/JZ-Jet1-night-white.svg +19 -0
- package/dist/logos/JZ-Jet1-night.svg +19 -0
- package/dist/logos/JZ-Jet1-white-night.svg +19 -0
- package/dist/logos/JZ-Jet1-white.svg +19 -0
- package/dist/logos/JZ-Z4-night.svg +15 -0
- package/dist/logos/JZ-Z4-white.svg +17 -0
- package/dist/logos/Z-square-fire-white.svg +15 -0
- package/dist/logos/Z-square-night-white.svg +15 -0
- package/dist/logos/Z-square-white-fire.svg +15 -0
- package/dist/logos/Z-square-white-night.svg +15 -0
- package/dist/tokens.css +30 -0
- package/package.json +2 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,45 @@
|
|
|
1
1
|
export { accents, categoricalSeries, dataviz, fontSizes, fontWeights, fonts, lineHeights, motion, onAccents, onBackground, onCategoricalSeries, onPalette, palette, radii, shadows, spacing, default as tokens, tracking } from './tokens.js';
|
|
2
2
|
import * as React from 'react';
|
|
3
3
|
|
|
4
|
+
interface NavItem {
|
|
5
|
+
/** Stable id; matched against `active`. */
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
/** Lucide icon element, e.g. <Table2 size={14} strokeWidth={1.75} />. */
|
|
9
|
+
icon?: React.ReactNode;
|
|
10
|
+
/** Route or URL. Rendered through `renderLink` when provided. */
|
|
11
|
+
href?: string;
|
|
12
|
+
}
|
|
13
|
+
interface NavGroup {
|
|
14
|
+
label?: string;
|
|
15
|
+
items: NavItem[];
|
|
16
|
+
}
|
|
4
17
|
interface AppShellProps {
|
|
18
|
+
/** Id of the current nav item (or its label, for the legacy API). */
|
|
5
19
|
active?: string;
|
|
6
20
|
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
21
|
+
/** Optional custom wordmark image URL. By default the shell renders the built-in JetZero wordmark. */
|
|
8
22
|
logoSrc?: string;
|
|
23
|
+
/** Hide the light/dark toggle (default: shown). */
|
|
24
|
+
hideThemeToggle?: boolean;
|
|
25
|
+
/** App name shown under the wordmark and used as the default top-bar title. */
|
|
26
|
+
appName?: string;
|
|
27
|
+
/** Sidebar navigation. Omit for the legacy Investor Portal nav (kept for backward compatibility). */
|
|
28
|
+
nav?: NavGroup[];
|
|
29
|
+
/** Page title in the top bar. Defaults to the active item's label. */
|
|
30
|
+
title?: string;
|
|
31
|
+
/** Right side of the top bar: status, buttons, etc. */
|
|
32
|
+
actions?: React.ReactNode;
|
|
9
33
|
user?: {
|
|
10
34
|
initials: string;
|
|
35
|
+
name?: string;
|
|
11
36
|
};
|
|
37
|
+
/**
|
|
38
|
+
* Router integration. Return your router's link element so navigation is client-side, e.g.
|
|
39
|
+
* `renderLink={(item, props) => <NavLink to={item.href!} {...props} />}`.
|
|
40
|
+
* `props` carries the shell's className, aria-current and children — pass them through.
|
|
41
|
+
*/
|
|
42
|
+
renderLink?: (item: NavItem, props: React.AnchorHTMLAttributes<HTMLAnchorElement>) => React.ReactNode;
|
|
12
43
|
}
|
|
13
44
|
declare const AppShell: React.FC<AppShellProps>;
|
|
14
45
|
|
|
@@ -106,4 +137,161 @@ declare function toneHex(tone: BackgroundTone): string;
|
|
|
106
137
|
/** Throws in dev if a wordmark/tone combo violates the brand rule. No-op in production. */
|
|
107
138
|
declare function assertValidLogoBackground(variant: WordmarkVariant, tone: BackgroundTone): void;
|
|
108
139
|
|
|
109
|
-
|
|
140
|
+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
|
|
141
|
+
/** `primary` = the one main action per view (uses the fire accent). */
|
|
142
|
+
variant?: 'primary' | 'secondary' | 'ghost' | 'danger';
|
|
143
|
+
size?: 'sm' | 'md' | 'lg';
|
|
144
|
+
loading?: boolean;
|
|
145
|
+
block?: boolean;
|
|
146
|
+
/** Square icon-only button. Requires `aria-label`. */
|
|
147
|
+
iconOnly?: boolean;
|
|
148
|
+
leadingIcon?: React.ReactNode;
|
|
149
|
+
}
|
|
150
|
+
declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
|
|
151
|
+
|
|
152
|
+
interface FieldProps {
|
|
153
|
+
label: string;
|
|
154
|
+
hint?: string;
|
|
155
|
+
error?: string;
|
|
156
|
+
required?: boolean;
|
|
157
|
+
/** Provide to control the id; otherwise generated. */
|
|
158
|
+
id?: string;
|
|
159
|
+
/** A single Input / Select / Textarea. Its id and aria-* are wired automatically. */
|
|
160
|
+
children: React.ReactElement;
|
|
161
|
+
className?: string;
|
|
162
|
+
}
|
|
163
|
+
declare const Field: React.FC<FieldProps>;
|
|
164
|
+
declare const Input: React.ForwardRefExoticComponent<React.InputHTMLAttributes<HTMLInputElement> & React.RefAttributes<HTMLInputElement>>;
|
|
165
|
+
declare const Textarea: React.ForwardRefExoticComponent<React.TextareaHTMLAttributes<HTMLTextAreaElement> & React.RefAttributes<HTMLTextAreaElement>>;
|
|
166
|
+
declare const Select: React.ForwardRefExoticComponent<React.SelectHTMLAttributes<HTMLSelectElement> & React.RefAttributes<HTMLSelectElement>>;
|
|
167
|
+
interface CheckProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
168
|
+
label: React.ReactNode;
|
|
169
|
+
}
|
|
170
|
+
declare const Checkbox: React.ForwardRefExoticComponent<CheckProps & React.RefAttributes<HTMLInputElement>>;
|
|
171
|
+
declare const Radio: React.ForwardRefExoticComponent<CheckProps & React.RefAttributes<HTMLInputElement>>;
|
|
172
|
+
declare const Switch: React.ForwardRefExoticComponent<CheckProps & React.RefAttributes<HTMLInputElement>>;
|
|
173
|
+
|
|
174
|
+
type Tone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
175
|
+
declare const Spinner: React.FC<{
|
|
176
|
+
size?: 'md' | 'lg';
|
|
177
|
+
label?: string;
|
|
178
|
+
}>;
|
|
179
|
+
interface BadgeProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
180
|
+
tone?: Tone;
|
|
181
|
+
}
|
|
182
|
+
declare const Badge: React.FC<BadgeProps>;
|
|
183
|
+
interface EmptyStateProps {
|
|
184
|
+
title: string;
|
|
185
|
+
description?: React.ReactNode;
|
|
186
|
+
icon?: React.ReactNode;
|
|
187
|
+
/** Typically a single <Button variant="primary">. */
|
|
188
|
+
action?: React.ReactNode;
|
|
189
|
+
}
|
|
190
|
+
declare const EmptyState: React.FC<EmptyStateProps>;
|
|
191
|
+
interface ToastOptions {
|
|
192
|
+
title: string;
|
|
193
|
+
description?: string;
|
|
194
|
+
tone?: Tone;
|
|
195
|
+
/** ms before auto-dismiss. 0 = sticky. Default 5000. */
|
|
196
|
+
duration?: number;
|
|
197
|
+
}
|
|
198
|
+
interface ToastApi {
|
|
199
|
+
toast: (opts: ToastOptions) => void;
|
|
200
|
+
}
|
|
201
|
+
/** Mount once near the app root. Then call `useToast().toast({...})` anywhere. */
|
|
202
|
+
declare const ToastProvider: React.FC<{
|
|
203
|
+
children?: React.ReactNode;
|
|
204
|
+
}>;
|
|
205
|
+
declare function useToast(): ToastApi;
|
|
206
|
+
|
|
207
|
+
interface Column<T> {
|
|
208
|
+
key: string;
|
|
209
|
+
header: React.ReactNode;
|
|
210
|
+
/** Defaults to `row[key]`. */
|
|
211
|
+
render?: (row: T) => React.ReactNode;
|
|
212
|
+
align?: 'left' | 'right';
|
|
213
|
+
/** Monospace (IDs, numbers, codes). */
|
|
214
|
+
mono?: boolean;
|
|
215
|
+
sortable?: boolean;
|
|
216
|
+
}
|
|
217
|
+
interface SortState {
|
|
218
|
+
key: string;
|
|
219
|
+
direction: 'asc' | 'desc';
|
|
220
|
+
}
|
|
221
|
+
interface TableProps<T> {
|
|
222
|
+
columns: Column<T>[];
|
|
223
|
+
rows: T[];
|
|
224
|
+
rowKey: (row: T) => string;
|
|
225
|
+
/** Accessible table name; rendered visibly as a caption. */
|
|
226
|
+
caption?: string;
|
|
227
|
+
/** Controlled sort — the app sorts the data; the table only shows state and fires the event. */
|
|
228
|
+
sort?: SortState;
|
|
229
|
+
onSortChange?: (next: SortState) => void;
|
|
230
|
+
onRowClick?: (row: T) => void;
|
|
231
|
+
emptyTitle?: string;
|
|
232
|
+
emptyDescription?: React.ReactNode;
|
|
233
|
+
}
|
|
234
|
+
declare function Table<T>({ columns, rows, rowKey, caption, sort, onSortChange, onRowClick, emptyTitle, emptyDescription, }: TableProps<T>): React.ReactElement;
|
|
235
|
+
|
|
236
|
+
interface TabItem {
|
|
237
|
+
id: string;
|
|
238
|
+
label: React.ReactNode;
|
|
239
|
+
content: React.ReactNode;
|
|
240
|
+
}
|
|
241
|
+
interface TabsProps {
|
|
242
|
+
items: TabItem[];
|
|
243
|
+
/** Controlled. Omit for uncontrolled (uses `defaultValue` or the first tab). */
|
|
244
|
+
value?: string;
|
|
245
|
+
defaultValue?: string;
|
|
246
|
+
onValueChange?: (id: string) => void;
|
|
247
|
+
'aria-label'?: string;
|
|
248
|
+
}
|
|
249
|
+
declare const Tabs: React.FC<TabsProps>;
|
|
250
|
+
|
|
251
|
+
interface ModalProps {
|
|
252
|
+
open: boolean;
|
|
253
|
+
onClose: () => void;
|
|
254
|
+
title: string;
|
|
255
|
+
size?: 'md' | 'lg';
|
|
256
|
+
children?: React.ReactNode;
|
|
257
|
+
/** Buttons, right-aligned. Put the primary action last. */
|
|
258
|
+
footer?: React.ReactNode;
|
|
259
|
+
}
|
|
260
|
+
/** Built on native <dialog>: focus trap, Esc to close and inert background come from the browser. */
|
|
261
|
+
declare const Modal: React.FC<ModalProps>;
|
|
262
|
+
|
|
263
|
+
interface WordmarkProps extends Omit<React.SVGProps<SVGSVGElement>, 'children'> {
|
|
264
|
+
/** Rendered height in px. Width follows the 344:77 aspect ratio. */
|
|
265
|
+
height?: number;
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* The JetZero wordmark, inlined so it needs no asset path or bundler config.
|
|
269
|
+
* Fire stays fire; the letters flip with the theme (white on dark / Night on light),
|
|
270
|
+
* which follows the logo background rules in Brandbook 2026 (fire-white on dark, fire-night on light).
|
|
271
|
+
* Defaults to `aria-label="JetZero"`; pass `aria-hidden` if the surrounding link already names the app.
|
|
272
|
+
*/
|
|
273
|
+
declare const Wordmark: React.FC<WordmarkProps>;
|
|
274
|
+
|
|
275
|
+
type Theme = 'dark' | 'light';
|
|
276
|
+
/** Same resolution order as JetZero-Map-Tools: saved choice → system preference → dark. */
|
|
277
|
+
declare function resolveTheme(): Theme;
|
|
278
|
+
/**
|
|
279
|
+
* Call once before first render (e.g. top of main.tsx) to set data-theme before paint and avoid a flash.
|
|
280
|
+
* Returns the applied theme.
|
|
281
|
+
*/
|
|
282
|
+
declare function initTheme(): Theme;
|
|
283
|
+
declare function useTheme(): {
|
|
284
|
+
theme: Theme;
|
|
285
|
+
setTheme: (t: Theme) => void;
|
|
286
|
+
toggle: () => void;
|
|
287
|
+
};
|
|
288
|
+
/**
|
|
289
|
+
* Icon-only ghost Button for the top bar (sun in dark, moon in light) — the JetZero-Map-Tools pattern. Inherits size and radius from Button.
|
|
290
|
+
* The shell already includes one; use this directly only for custom layouts.
|
|
291
|
+
*/
|
|
292
|
+
declare const ThemeToggle: React.FC<{
|
|
293
|
+
className?: string;
|
|
294
|
+
size?: 'sm' | 'md' | 'lg';
|
|
295
|
+
}>;
|
|
296
|
+
|
|
297
|
+
export { AnnouncementCard, type AnnouncementCardProps, AppShell, type AppShellProps, type BackgroundTone, Badge, type BadgeProps, Button, type ButtonProps, type CheckProps, Checkbox, type Column, DocumentList, type DocumentListProps, type DocumentRow, EmptyState, type EmptyStateProps, Field, type FieldProps, Input, type KPI, KPIGrid, type KPIGridProps, type Milestone, Modal, type ModalProps, type NavGroup, type NavItem, Radio, Select, type SortState, Spinner, Switch, type TabItem, Table, type TableProps, Tabs, type TabsProps, TelemetryCard, type TelemetryCardProps, Textarea, type Theme, ThemeToggle, Timeline, type TimelineProps, type ToastOptions, ToastProvider, type Tone, Wordmark, type WordmarkProps, type WordmarkVariant, assertValidLogoBackground, initTheme, isValidLogoBackground, logoForBackground, resolveTheme, toneHex, useTheme, useToast };
|