@lagroon/inkwell-design-system 0.1.2
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 +18 -0
- package/dist/index.d.ts +728 -0
- package/dist/index.js +1366 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +5160 -0
- package/package.json +52 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,728 @@
|
|
|
1
|
+
import { ButtonHTMLAttributes } from 'react';
|
|
2
|
+
import { HTMLAttributes } from 'react';
|
|
3
|
+
import { InputHTMLAttributes } from 'react';
|
|
4
|
+
import { JSX } from 'react';
|
|
5
|
+
import { ReactNode } from 'react';
|
|
6
|
+
import { TextareaHTMLAttributes } from 'react';
|
|
7
|
+
|
|
8
|
+
export declare type AlignItems = "start" | "center" | "end" | "stretch" | "baseline";
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* A compact circular (or square) identity mark showing an image or an initials
|
|
12
|
+
* fallback. Seeded from the app's account avatar. When `decorative` isn't set it
|
|
13
|
+
* exposes an accessible name (the image `alt`/`name`, or `role="img"` +
|
|
14
|
+
* `aria-label` for the initials fallback).
|
|
15
|
+
*/
|
|
16
|
+
export declare function Avatar({ name, src, alt, size, shape, children, decorative, interactive, onClick, buttonLabel, id, className, }: AvatarProps): JSX.Element;
|
|
17
|
+
|
|
18
|
+
export declare interface AvatarProps {
|
|
19
|
+
/** Person/entity name. Drives the initials fallback and the accessible label. */
|
|
20
|
+
name?: string;
|
|
21
|
+
/** Image URL. When set (and it loads), shows the image instead of initials. */
|
|
22
|
+
src?: string;
|
|
23
|
+
/** Alt text for the image. Defaults to `name`. */
|
|
24
|
+
alt?: string;
|
|
25
|
+
/** Size preset. Defaults to "md" (matches the app's 34px avatar). */
|
|
26
|
+
size?: AvatarSize;
|
|
27
|
+
/** Circle (default) or square with a soft corner. */
|
|
28
|
+
shape?: AvatarShape;
|
|
29
|
+
/** Custom fallback (e.g. an icon) shown when there's no image. Overrides initials. */
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
/** Hide from assistive tech — use when the name is already shown adjacently. */
|
|
32
|
+
decorative?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Make the avatar a button. Wraps it in a `<button>` that brightens the ring
|
|
35
|
+
* on hover/focus, matching the app's account trigger. Provide `onClick`.
|
|
36
|
+
*/
|
|
37
|
+
interactive?: boolean;
|
|
38
|
+
/** Click handler when `interactive` is set. */
|
|
39
|
+
onClick?: () => void;
|
|
40
|
+
/** Accessible label for the interactive button. Defaults to `name`. */
|
|
41
|
+
buttonLabel?: string;
|
|
42
|
+
id?: string;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export declare type AvatarShape = "circle" | "square";
|
|
47
|
+
|
|
48
|
+
export declare type AvatarSize = "sm" | "md" | "lg";
|
|
49
|
+
|
|
50
|
+
/**
|
|
51
|
+
* A compact count / notification indicator. Show a small count or short label,
|
|
52
|
+
* or set `dot` for a bare indicator. For inline status labels use `Pill`
|
|
53
|
+
* instead.
|
|
54
|
+
*/
|
|
55
|
+
export declare function Badge({ tone, dot, className, children, ...props }: BadgeProps): JSX.Element;
|
|
56
|
+
|
|
57
|
+
export declare interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
58
|
+
/** Color tone. Defaults to `brand` (the notification color). */
|
|
59
|
+
tone?: BadgeTone;
|
|
60
|
+
/**
|
|
61
|
+
* Render a bare dot with no content — a presence indicator (generalizes the
|
|
62
|
+
* app's nav notification dot). Provide an `aria-label` if it's meaningful, or
|
|
63
|
+
* `aria-hidden` if it's purely decorative.
|
|
64
|
+
*/
|
|
65
|
+
dot?: boolean;
|
|
66
|
+
children?: ReactNode;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export declare type BadgeTone = "brand" | "neutral" | "danger";
|
|
70
|
+
|
|
71
|
+
export declare function BrandIcon({ id }: {
|
|
72
|
+
id: any;
|
|
73
|
+
}): JSX.Element;
|
|
74
|
+
|
|
75
|
+
/**
|
|
76
|
+
* The primary action control. `variant` selects the visual role and `size`
|
|
77
|
+
* the density; extra `className` values are appended for composition.
|
|
78
|
+
*/
|
|
79
|
+
export declare function Button({ variant, size, type, className, children, ...props }: ButtonProps): JSX.Element;
|
|
80
|
+
|
|
81
|
+
export declare interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
82
|
+
/** Visual role in the action hierarchy. */
|
|
83
|
+
variant?: ButtonVariant;
|
|
84
|
+
/** Control height/density. `md` is the default and adds no modifier. */
|
|
85
|
+
size?: ButtonSize;
|
|
86
|
+
children?: ReactNode;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
export declare type ButtonSize = "xs" | "sm" | "md" | "lg" | "xl";
|
|
90
|
+
|
|
91
|
+
export declare type ButtonVariant = "primary" | "secondary" | "ghost" | "danger";
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* A padded content surface. Borderless and raised by default (a content-unit
|
|
95
|
+
* sibling to the section-level `Panel`). Compose it with `SectionHeading` for a
|
|
96
|
+
* header and `CardActions` for a footer row.
|
|
97
|
+
*/
|
|
98
|
+
export declare function Card({ variant, tone, className, children, ...props }: CardProps): JSX.Element;
|
|
99
|
+
|
|
100
|
+
/** A footer row of actions inside a `Card` — a wrapping, gap-spaced flex row. */
|
|
101
|
+
export declare function CardActions({ className, children, ...props }: CardActionsProps): JSX.Element;
|
|
102
|
+
|
|
103
|
+
export declare interface CardActionsProps extends HTMLAttributes<HTMLDivElement> {
|
|
104
|
+
children?: ReactNode;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export declare interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
108
|
+
/**
|
|
109
|
+
* Surface treatment. `plain` (default) is borderless on the raised surface —
|
|
110
|
+
* the app's common look. `outlined` adds a subtle border on the default
|
|
111
|
+
* surface for the rare case that needs a hard edge.
|
|
112
|
+
*/
|
|
113
|
+
variant?: CardVariant;
|
|
114
|
+
/** `danger` flags a destructive zone with a danger-soft border. */
|
|
115
|
+
tone?: CardTone;
|
|
116
|
+
children?: ReactNode;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export declare type CardTone = "default" | "danger";
|
|
120
|
+
|
|
121
|
+
export declare type CardVariant = "plain" | "outlined";
|
|
122
|
+
|
|
123
|
+
/**
|
|
124
|
+
* Checkbox with an inline label. Unlike {@link TextInput}, the checkbox owns its
|
|
125
|
+
* own label rather than pairing with a stacked `FormField` label, so it stays
|
|
126
|
+
* self-contained.
|
|
127
|
+
*/
|
|
128
|
+
export declare function Checkbox({ id, label, invalid, className, ...props }: CheckboxProps): JSX.Element;
|
|
129
|
+
|
|
130
|
+
export declare interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type"> {
|
|
131
|
+
/** Inline label text. */
|
|
132
|
+
label?: ReactNode;
|
|
133
|
+
/** Force the invalid state. */
|
|
134
|
+
invalid?: boolean;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* A disclosure: the whole header is the toggle button, with a chevron that
|
|
139
|
+
* rotates when open. The chevron sits in a contained box that carries the
|
|
140
|
+
* hover/focus fill, so the affordance reads as a control even though the full
|
|
141
|
+
* row is clickable. Works controlled (`open` + `onOpenChange`) or uncontrolled
|
|
142
|
+
* (`defaultOpen`). The content stays mounted and is hidden via the `hidden`
|
|
143
|
+
* attribute so `aria-controls` always resolves.
|
|
144
|
+
*/
|
|
145
|
+
export declare function Collapsible({ title, description, meta, defaultOpen, open, onOpenChange, divided, children, id, className, }: CollapsibleProps): JSX.Element;
|
|
146
|
+
|
|
147
|
+
export declare interface CollapsibleProps {
|
|
148
|
+
/** The trigger's main label. */
|
|
149
|
+
title: ReactNode;
|
|
150
|
+
/** Optional secondary line under the title. */
|
|
151
|
+
description?: ReactNode;
|
|
152
|
+
/** Optional trailing meta (e.g. a count), before the chevron. */
|
|
153
|
+
meta?: ReactNode;
|
|
154
|
+
/** Uncontrolled initial open state. Ignored when `open` is provided. */
|
|
155
|
+
defaultOpen?: boolean;
|
|
156
|
+
/** Controlled open state. */
|
|
157
|
+
open?: boolean;
|
|
158
|
+
/** Called with the next open state when the trigger is activated. */
|
|
159
|
+
onOpenChange?: (open: boolean) => void;
|
|
160
|
+
/** Adds a hairline divider under the row — matches the app's stacked submission rows. */
|
|
161
|
+
divided?: boolean;
|
|
162
|
+
/** The revealed content. */
|
|
163
|
+
children?: ReactNode;
|
|
164
|
+
id?: string;
|
|
165
|
+
className?: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* A thin rule that separates content. Horizontal by default (a native `<hr>`);
|
|
170
|
+
* pass `orientation="vertical"` for an inline rule, or `label` for a labeled
|
|
171
|
+
* separator with the text centered between two lines. Uses the app's hairline
|
|
172
|
+
* (`--line-soft`) and carries no margins — space it with layout primitives.
|
|
173
|
+
*/
|
|
174
|
+
export declare function Divider({ orientation, label, id, className }: DividerProps): JSX.Element;
|
|
175
|
+
|
|
176
|
+
export declare interface DividerProps {
|
|
177
|
+
/** Direction of the rule. Vertical needs a flex/grid parent to take height. */
|
|
178
|
+
orientation?: "horizontal" | "vertical";
|
|
179
|
+
/** Optional centered label (horizontal only), e.g. "or". */
|
|
180
|
+
label?: ReactNode;
|
|
181
|
+
id?: string;
|
|
182
|
+
className?: string;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
export declare function EmptyState({ children, className, ...props }: {
|
|
186
|
+
[x: string]: any;
|
|
187
|
+
children: any;
|
|
188
|
+
className?: string | undefined;
|
|
189
|
+
}): JSX.Element;
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Labelled field wrapper. Owns the control's id and forwards hint/error wiring
|
|
193
|
+
* to whichever Inkwell control it wraps.
|
|
194
|
+
*/
|
|
195
|
+
export declare function FormField({ label, hint, error, htmlFor, required, className, children, }: FormFieldProps): JSX.Element;
|
|
196
|
+
|
|
197
|
+
export declare interface FormFieldProps {
|
|
198
|
+
/** Visible label text. */
|
|
199
|
+
label?: ReactNode;
|
|
200
|
+
/** Helper text shown below the control. */
|
|
201
|
+
hint?: ReactNode;
|
|
202
|
+
/** Error text; sets the field invalid and replaces the hint. */
|
|
203
|
+
error?: ReactNode;
|
|
204
|
+
/** Explicit control id. Auto-generated when omitted. */
|
|
205
|
+
htmlFor?: string;
|
|
206
|
+
/** Marks the field required (visual marker + inherited by the control). */
|
|
207
|
+
required?: boolean;
|
|
208
|
+
/** Extra class names on the field wrapper. */
|
|
209
|
+
className?: string;
|
|
210
|
+
/** The control (TextInput, Textarea, Select, …). */
|
|
211
|
+
children: ReactNode;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
/** Equal-column grid using the app's `repeat(n, minmax(0, 1fr))` convention. */
|
|
215
|
+
export declare function Grid({ gap, columns, align, className, style, children, ...props }: GridProps): JSX.Element;
|
|
216
|
+
|
|
217
|
+
export declare interface GridProps extends HTMLAttributes<HTMLDivElement> {
|
|
218
|
+
/** Space between cells. Defaults to `md` (12px). */
|
|
219
|
+
gap?: SpaceScale;
|
|
220
|
+
/** Number of equal columns (`repeat(n, minmax(0, 1fr))`). Defaults to 2. */
|
|
221
|
+
columns?: number;
|
|
222
|
+
/** Cross-axis alignment (`align-items`). */
|
|
223
|
+
align?: AlignItems;
|
|
224
|
+
children?: ReactNode;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
export declare function IconArrowDown(props: any): JSX.Element;
|
|
228
|
+
|
|
229
|
+
export declare function IconAward(props: any): JSX.Element;
|
|
230
|
+
|
|
231
|
+
/**
|
|
232
|
+
* A square, icon-only button. Provide an accessible name via `aria-label`.
|
|
233
|
+
*/
|
|
234
|
+
export declare function IconButton({ icon, size, className, type, ...props }: IconButtonProps): JSX.Element;
|
|
235
|
+
|
|
236
|
+
export declare interface IconButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
237
|
+
/** The icon element to render. */
|
|
238
|
+
icon?: ReactNode;
|
|
239
|
+
/** Control size. `md` is the default and adds no modifier. */
|
|
240
|
+
size?: IconButtonSize;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export declare type IconButtonSize = "sm" | "md" | "lg";
|
|
244
|
+
|
|
245
|
+
export declare function IconCheck(props: any): JSX.Element;
|
|
246
|
+
|
|
247
|
+
export declare function IconClose(props: any): JSX.Element;
|
|
248
|
+
|
|
249
|
+
export declare function IconCopy(props: any): JSX.Element;
|
|
250
|
+
|
|
251
|
+
export declare function IconDiscord(props: any): JSX.Element;
|
|
252
|
+
|
|
253
|
+
export declare function IconDotsVertical({ style, ...rest }: {
|
|
254
|
+
[x: string]: any;
|
|
255
|
+
style: any;
|
|
256
|
+
}): JSX.Element;
|
|
257
|
+
|
|
258
|
+
export declare function IconEye(props: any): JSX.Element;
|
|
259
|
+
|
|
260
|
+
export declare function IconGoogle(props: any): JSX.Element;
|
|
261
|
+
|
|
262
|
+
export declare function IconList(props: any): JSX.Element;
|
|
263
|
+
|
|
264
|
+
export declare function IconLogin(props: any): JSX.Element;
|
|
265
|
+
|
|
266
|
+
export declare function IconLogout(props: any): JSX.Element;
|
|
267
|
+
|
|
268
|
+
export declare function IconRestart(props: any): JSX.Element;
|
|
269
|
+
|
|
270
|
+
export declare function IconSettings(props: any): JSX.Element;
|
|
271
|
+
|
|
272
|
+
export declare function IconShirt(props: any): JSX.Element;
|
|
273
|
+
|
|
274
|
+
export declare function IconTrophy(props: any): JSX.Element;
|
|
275
|
+
|
|
276
|
+
export declare function IconUsers(props: any): JSX.Element;
|
|
277
|
+
|
|
278
|
+
/** Horizontal flow with gap, wrapping, and alignment. */
|
|
279
|
+
export declare function Inline({ gap, align, justify, wrap, className, style, children, ...props }: InlineProps): JSX.Element;
|
|
280
|
+
|
|
281
|
+
export declare interface InlineProps extends HTMLAttributes<HTMLDivElement> {
|
|
282
|
+
/** Space between children. Defaults to `md` (12px). */
|
|
283
|
+
gap?: SpaceScale;
|
|
284
|
+
/** Cross-axis alignment (`align-items`). Defaults to `center`. */
|
|
285
|
+
align?: AlignItems;
|
|
286
|
+
/** Main-axis distribution (`justify-content`). */
|
|
287
|
+
justify?: JustifyContent;
|
|
288
|
+
/** Whether children wrap onto multiple rows. Defaults to `true`. */
|
|
289
|
+
wrap?: boolean;
|
|
290
|
+
children?: ReactNode;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export declare type JustifyContent = "start" | "center" | "end" | "between" | "around";
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* A grid-based list of rows. Not a semantic table — use for content that reads
|
|
297
|
+
* tabularly but isn't structured data (e.g. the app's roster). Each row is a
|
|
298
|
+
* grid with the column template set on the parent via `columns`.
|
|
299
|
+
*/
|
|
300
|
+
export declare function List({ columns, density, bordered, children, id, className, }: ListProps): JSX.Element;
|
|
301
|
+
|
|
302
|
+
export declare namespace List {
|
|
303
|
+
var Row: ({ children, id, className }: ListRowProps) => JSX.Element;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export declare type ListDensity = "comfortable" | "compact";
|
|
307
|
+
|
|
308
|
+
export declare interface ListProps {
|
|
309
|
+
/**
|
|
310
|
+
* Grid template for row columns (e.g. `"1fr 1fr auto"`,
|
|
311
|
+
* `"minmax(0, 1.1fr) minmax(0, 1fr) auto"`). Applied to every child row via
|
|
312
|
+
* a CSS custom property, so all rows share the same column geometry.
|
|
313
|
+
*/
|
|
314
|
+
columns: string;
|
|
315
|
+
/** Row padding preset. Defaults to "comfortable". */
|
|
316
|
+
density?: ListDensity;
|
|
317
|
+
/** Hide the hairline divider between rows. */
|
|
318
|
+
bordered?: boolean;
|
|
319
|
+
children?: ReactNode;
|
|
320
|
+
id?: string;
|
|
321
|
+
className?: string;
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
export declare interface ListRowProps {
|
|
325
|
+
children?: ReactNode;
|
|
326
|
+
id?: string;
|
|
327
|
+
className?: string;
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/**
|
|
331
|
+
* A dialog surface with a titled header and close control. When `open` it:
|
|
332
|
+
* moves focus into the dialog, traps Tab within it, closes on Escape, locks
|
|
333
|
+
* background scroll, and restores focus to the previously focused element on
|
|
334
|
+
* close.
|
|
335
|
+
*
|
|
336
|
+
* Note: intentionally rendered in place (not portalled). `.modal` is
|
|
337
|
+
* `position: fixed`, and portalling to `document.body` would break Storybook's
|
|
338
|
+
* canvas rendering, which relies on the story container to scope fixed
|
|
339
|
+
* positioning. Consumers who need portal behavior can wrap it themselves.
|
|
340
|
+
*/
|
|
341
|
+
export declare function ModalFrame({ id, titleId, title, onClose, children, size, cardClassName, describedBy, open, className, }: ModalFrameProps): JSX.Element;
|
|
342
|
+
|
|
343
|
+
export declare interface ModalFrameProps {
|
|
344
|
+
id?: string;
|
|
345
|
+
/** id of the element that labels the dialog (`aria-labelledby`). */
|
|
346
|
+
titleId?: string;
|
|
347
|
+
/** Heading rendered at the top of the modal card. */
|
|
348
|
+
title?: ReactNode;
|
|
349
|
+
/** Called when the backdrop, close button, or Escape is activated. */
|
|
350
|
+
onClose?: () => void;
|
|
351
|
+
children?: ReactNode;
|
|
352
|
+
/** Preset card sizing. */
|
|
353
|
+
size?: ModalSize;
|
|
354
|
+
/** Overrides the size preset's card class entirely. */
|
|
355
|
+
cardClassName?: string;
|
|
356
|
+
/** id of the element that describes the dialog (`aria-describedby`). */
|
|
357
|
+
describedBy?: string;
|
|
358
|
+
/** Whether the modal is visible. */
|
|
359
|
+
open?: boolean;
|
|
360
|
+
className?: string;
|
|
361
|
+
}
|
|
362
|
+
|
|
363
|
+
export declare type ModalSize = "default" | "compact" | "picker" | "settings";
|
|
364
|
+
|
|
365
|
+
export declare function Panel({ children, className, ...props }: {
|
|
366
|
+
[x: string]: any;
|
|
367
|
+
children: any;
|
|
368
|
+
className?: string | undefined;
|
|
369
|
+
}): JSX.Element;
|
|
370
|
+
|
|
371
|
+
/**
|
|
372
|
+
* A small status/label chip. Use `tone` to signal state; keep the label short.
|
|
373
|
+
*/
|
|
374
|
+
export declare function Pill({ tone, children, className, ...props }: PillProps): JSX.Element;
|
|
375
|
+
|
|
376
|
+
export declare interface PillProps extends HTMLAttributes<HTMLSpanElement> {
|
|
377
|
+
/** Semantic tone. `default` is neutral and adds no modifier. */
|
|
378
|
+
tone?: PillTone;
|
|
379
|
+
children?: ReactNode;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export declare type PillTone = "default" | "success" | "warning" | "danger";
|
|
383
|
+
|
|
384
|
+
/**
|
|
385
|
+
* A trigger + popover surface. Fully keyboard operable: ArrowDown opens and
|
|
386
|
+
* focuses the first item; Up/Down and Home/End move between items; Escape
|
|
387
|
+
* closes and returns focus to the trigger; Tab closes.
|
|
388
|
+
*/
|
|
389
|
+
export declare function PopoverMenu({ trigger, children, menuClassName, popoverClassName, menuRole, menuLabel, }: PopoverMenuProps): JSX.Element;
|
|
390
|
+
|
|
391
|
+
export declare interface PopoverMenuProps {
|
|
392
|
+
/** Render prop for the trigger; receives the open state and a toggle handler. */
|
|
393
|
+
trigger: (props: PopoverMenuTriggerProps) => ReactNode;
|
|
394
|
+
children?: ReactNode;
|
|
395
|
+
menuClassName?: string;
|
|
396
|
+
popoverClassName?: string;
|
|
397
|
+
menuRole?: string;
|
|
398
|
+
menuLabel?: string;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
export declare interface PopoverMenuTriggerProps {
|
|
402
|
+
open: boolean;
|
|
403
|
+
onToggle: () => void;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* A horizontal progress bar. Pass `value` for determinate progress; omit it for
|
|
408
|
+
* an indeterminate sliding-bar animation. Exposes `role="progressbar"` with
|
|
409
|
+
* `aria-valuemin/max/now` (or `aria-valuetext="indeterminate"` when unknown).
|
|
410
|
+
*/
|
|
411
|
+
export declare function Progress({ value, tone, size, label, valueFormatter, ariaLabel, id, className, }: ProgressProps): JSX.Element;
|
|
412
|
+
|
|
413
|
+
export declare interface ProgressProps {
|
|
414
|
+
/** Current progress (0–100). Omit for an indeterminate bar. */
|
|
415
|
+
value?: number;
|
|
416
|
+
/** Fill color. Defaults to "brand". */
|
|
417
|
+
tone?: ProgressTone;
|
|
418
|
+
/** Track height. `md` (default) ≈ 6px; `sm` ≈ 3px. */
|
|
419
|
+
size?: ProgressSize;
|
|
420
|
+
/** Optional visible label rendered above the track. Also becomes the accessible name. */
|
|
421
|
+
label?: ReactNode;
|
|
422
|
+
/** Value formatter shown next to the label (determinate only). Defaults to `${value}%`. */
|
|
423
|
+
valueFormatter?: (value: number) => string;
|
|
424
|
+
/** Fallback accessible name when `label` isn't set. */
|
|
425
|
+
ariaLabel?: string;
|
|
426
|
+
id?: string;
|
|
427
|
+
className?: string;
|
|
428
|
+
}
|
|
429
|
+
|
|
430
|
+
export declare type ProgressSize = "sm" | "md";
|
|
431
|
+
|
|
432
|
+
export declare type ProgressTone = "brand" | "success" | "danger";
|
|
433
|
+
|
|
434
|
+
/**
|
|
435
|
+
* @param {Object} props
|
|
436
|
+
* @param {import("react").ReactNode} [props.eyebrow]
|
|
437
|
+
* @param {import("react").ReactNode} [props.title]
|
|
438
|
+
* @param {string} [props.titleId] id applied to the title heading (for `aria-labelledby`).
|
|
439
|
+
* @param {import("react").ReactNode} [props.copy]
|
|
440
|
+
* @param {boolean} [props.compact]
|
|
441
|
+
* @param {import("react").ReactNode} [props.children]
|
|
442
|
+
* @param {string} [props.className]
|
|
443
|
+
*/
|
|
444
|
+
export declare function SectionHeading({ eyebrow, title, titleId, copy, compact, children, className }: {
|
|
445
|
+
eyebrow?: ReactNode;
|
|
446
|
+
title?: ReactNode;
|
|
447
|
+
titleId?: string | undefined;
|
|
448
|
+
copy?: ReactNode;
|
|
449
|
+
compact?: boolean | undefined;
|
|
450
|
+
children?: ReactNode;
|
|
451
|
+
className?: string | undefined;
|
|
452
|
+
}): JSX.Element;
|
|
453
|
+
|
|
454
|
+
/**
|
|
455
|
+
* A custom listbox select. Fully keyboard operable: the trigger opens on
|
|
456
|
+
* Arrow/Enter/Space; the open list supports Up/Down, Home/End, type-ahead,
|
|
457
|
+
* Enter/Space to choose, and Escape to close (returning focus to the trigger).
|
|
458
|
+
*/
|
|
459
|
+
export declare function Select({ value, onChange, options, placeholder, variant, disabled, "aria-label": ariaLabel, id, }: SelectProps): JSX.Element;
|
|
460
|
+
|
|
461
|
+
export declare interface SelectOption {
|
|
462
|
+
value: string;
|
|
463
|
+
label: string;
|
|
464
|
+
disabled?: boolean;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
export declare interface SelectProps {
|
|
468
|
+
value?: string;
|
|
469
|
+
onChange?: (value: string) => void;
|
|
470
|
+
options?: SelectOption[];
|
|
471
|
+
placeholder?: string;
|
|
472
|
+
variant?: "form" | "control";
|
|
473
|
+
disabled?: boolean;
|
|
474
|
+
"aria-label"?: string;
|
|
475
|
+
id?: string;
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/**
|
|
479
|
+
* A placeholder block that shimmers while content is loading. `text` reads as a
|
|
480
|
+
* single line (or `lines`-many); `circle` is a 1:1 avatar-style placeholder;
|
|
481
|
+
* `rect` is a generic block sized by width/height. Always decorative — a
|
|
482
|
+
* surrounding region should announce the loading state.
|
|
483
|
+
*/
|
|
484
|
+
export declare function Skeleton({ variant, width, height, size, lines, id, className }: SkeletonProps): JSX.Element;
|
|
485
|
+
|
|
486
|
+
export declare interface SkeletonProps {
|
|
487
|
+
/** Shape preset. `text` is a single-line placeholder; `circle` is 1:1; `rect` is generic. Defaults to "text". */
|
|
488
|
+
variant?: SkeletonVariant;
|
|
489
|
+
/** CSS width. Defaults to `100%` for text/rect, or `size` for circles. */
|
|
490
|
+
width?: number | string;
|
|
491
|
+
/** CSS height. Defaults to `1em` for text, `size` for circle, and requires a value for rect. */
|
|
492
|
+
height?: number | string;
|
|
493
|
+
/** Convenience for circles — sets both width and height. Defaults to 40. */
|
|
494
|
+
size?: number | string;
|
|
495
|
+
/** Number of stacked text lines. Only applies to `variant="text"`. */
|
|
496
|
+
lines?: number;
|
|
497
|
+
id?: string;
|
|
498
|
+
className?: string;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
export declare type SkeletonVariant = "text" | "rect" | "circle";
|
|
502
|
+
|
|
503
|
+
/**
|
|
504
|
+
* Layout primitives for Inkwell.
|
|
505
|
+
*
|
|
506
|
+
* Stack / Inline / Grid arrange children with token-backed spacing so consumers
|
|
507
|
+
* stop hand-rolling flexbox and arbitrary gap values. The `gap` scale maps to
|
|
508
|
+
* the same spacing rhythm the source app used — `md` (12px / --space-3) is the
|
|
509
|
+
* default, matching the app's `.stacked-form` / `.grid` layout rhythm.
|
|
510
|
+
*
|
|
511
|
+
* Each primitive renders a `div` with a base class and sets CSS variables inline
|
|
512
|
+
* so the props drive the values while the rules live in the stylesheet.
|
|
513
|
+
*/
|
|
514
|
+
export declare type SpaceScale = "none" | "xs" | "sm" | "md" | "lg" | "xl";
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* A small rotating indeterminate loader. Use for short waits inside a control
|
|
518
|
+
* or beside a label. For loading larger regions of content, use `Skeleton`
|
|
519
|
+
* instead so the layout doesn't jump when data arrives.
|
|
520
|
+
*/
|
|
521
|
+
export declare function Spinner({ size, tone, label, decorative, id, className, }: SpinnerProps): JSX.Element;
|
|
522
|
+
|
|
523
|
+
export declare interface SpinnerProps {
|
|
524
|
+
/** Diameter preset. Defaults to "md" (20px). */
|
|
525
|
+
size?: SpinnerSize;
|
|
526
|
+
/** Spinner color. `current` inherits `currentColor`. Defaults to "muted". */
|
|
527
|
+
tone?: SpinnerTone;
|
|
528
|
+
/** Announced by screen readers. Defaults to "Loading". */
|
|
529
|
+
label?: string;
|
|
530
|
+
/** Skip the announcement (use when a surrounding region already announces state). */
|
|
531
|
+
decorative?: boolean;
|
|
532
|
+
id?: string;
|
|
533
|
+
className?: string;
|
|
534
|
+
}
|
|
535
|
+
|
|
536
|
+
export declare type SpinnerSize = "sm" | "md" | "lg";
|
|
537
|
+
|
|
538
|
+
export declare type SpinnerTone = "muted" | "brand" | "current";
|
|
539
|
+
|
|
540
|
+
export declare function SplitButton({ primaryLabel, onPrimaryClick, items }: {
|
|
541
|
+
primaryLabel: any;
|
|
542
|
+
onPrimaryClick: any;
|
|
543
|
+
items?: never[] | undefined;
|
|
544
|
+
}): JSX.Element;
|
|
545
|
+
|
|
546
|
+
/** Vertical flow with a consistent, token-backed gap. */
|
|
547
|
+
export declare function Stack({ gap, align, className, style, children, ...props }: StackProps): JSX.Element;
|
|
548
|
+
|
|
549
|
+
export declare interface StackProps extends HTMLAttributes<HTMLDivElement> {
|
|
550
|
+
/** Space between children. Defaults to `md` (12px). */
|
|
551
|
+
gap?: SpaceScale;
|
|
552
|
+
/** Cross-axis alignment (`align-items`). */
|
|
553
|
+
align?: AlignItems;
|
|
554
|
+
children?: ReactNode;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
/**
|
|
558
|
+
* An inline, persistent status message for a surface or form. Use for state
|
|
559
|
+
* that should stay visible (vs. a transient Toast).
|
|
560
|
+
*/
|
|
561
|
+
export declare function StatusBanner({ message, tone, onDismiss }: StatusBannerProps): JSX.Element | null;
|
|
562
|
+
|
|
563
|
+
export declare interface StatusBannerProps {
|
|
564
|
+
/** Banner copy. When empty/falsy the banner renders nothing. */
|
|
565
|
+
message?: ReactNode;
|
|
566
|
+
/** Semantic tone. `success` uses the default styling (no modifier). */
|
|
567
|
+
tone?: StatusBannerTone;
|
|
568
|
+
/** When provided, renders a dismiss button that calls this handler. */
|
|
569
|
+
onDismiss?: () => void;
|
|
570
|
+
}
|
|
571
|
+
|
|
572
|
+
export declare type StatusBannerTone = "success" | "warning" | "error";
|
|
573
|
+
|
|
574
|
+
export declare interface TabItem {
|
|
575
|
+
value: string;
|
|
576
|
+
label: ReactNode;
|
|
577
|
+
disabled?: boolean;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* A semantic HTML table with optional sortable columns, sticky header, row
|
|
582
|
+
* hover, and density presets. Sorting is caller-controlled: the component
|
|
583
|
+
* surfaces the click and shows the indicator, but the data must already be in
|
|
584
|
+
* the desired order (use `onSortChange` to react).
|
|
585
|
+
*/
|
|
586
|
+
export declare function Table<T>({ columns, data, getRowKey, sortBy, sortDirection, onSortChange, defaultSortBy, defaultSortDirection, density, stickyHeader, hoverable, caption, empty, id, className, }: TableProps<T>): JSX.Element;
|
|
587
|
+
|
|
588
|
+
export declare type TableAlign = "start" | "center" | "end";
|
|
589
|
+
|
|
590
|
+
export declare interface TableColumn<T> {
|
|
591
|
+
/** Stable id used for sort state and React keys. */
|
|
592
|
+
id: string;
|
|
593
|
+
/** Header cell content. */
|
|
594
|
+
header: ReactNode;
|
|
595
|
+
/** Renders the body cell for a row. */
|
|
596
|
+
render: (row: T) => ReactNode;
|
|
597
|
+
/** Show the sort affordance on the header; clicks call `onSortChange`. */
|
|
598
|
+
sortable?: boolean;
|
|
599
|
+
/** Text alignment for this column's cells and header. Defaults to "start". */
|
|
600
|
+
align?: TableAlign;
|
|
601
|
+
/** Optional width, applied via `<colgroup>` (e.g. "12ch", "20%"). */
|
|
602
|
+
width?: string;
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
export declare type TableDensity = "comfortable" | "compact";
|
|
606
|
+
|
|
607
|
+
export declare interface TableProps<T> {
|
|
608
|
+
columns: TableColumn<T>[];
|
|
609
|
+
data: readonly T[];
|
|
610
|
+
/** Stable React key for each row. */
|
|
611
|
+
getRowKey: (row: T) => string | number;
|
|
612
|
+
/** Controlled sort column id. */
|
|
613
|
+
sortBy?: string;
|
|
614
|
+
/** Controlled sort direction. */
|
|
615
|
+
sortDirection?: TableSortDirection;
|
|
616
|
+
/** Called when a sortable header is activated. */
|
|
617
|
+
onSortChange?: (sortBy: string, direction: TableSortDirection) => void;
|
|
618
|
+
/** Uncontrolled starting sort column. */
|
|
619
|
+
defaultSortBy?: string;
|
|
620
|
+
/** Uncontrolled starting sort direction. Defaults to "asc". */
|
|
621
|
+
defaultSortDirection?: TableSortDirection;
|
|
622
|
+
/** Row height / padding. Defaults to "comfortable". */
|
|
623
|
+
density?: TableDensity;
|
|
624
|
+
/** Pin `<thead>` when the parent scrolls. */
|
|
625
|
+
stickyHeader?: boolean;
|
|
626
|
+
/** Subtle hover fill on rows. */
|
|
627
|
+
hoverable?: boolean;
|
|
628
|
+
/** Renders as `<caption>`. */
|
|
629
|
+
caption?: ReactNode;
|
|
630
|
+
/** Empty-state content shown when `data` is empty. */
|
|
631
|
+
empty?: ReactNode;
|
|
632
|
+
id?: string;
|
|
633
|
+
className?: string;
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
export declare type TableSortDirection = "asc" | "desc";
|
|
637
|
+
|
|
638
|
+
/**
|
|
639
|
+
* A segmented tab bar with a sliding underline indicator. Controlled: it renders
|
|
640
|
+
* the tablist and reports selection via `onChange`; render the matching panel
|
|
641
|
+
* yourself. Fully keyboard operable (Left/Right/Up/Down move and activate,
|
|
642
|
+
* Home/End jump to the ends, disabled tabs are skipped).
|
|
643
|
+
*/
|
|
644
|
+
export declare function Tabs({ tabs, value, onChange, "aria-label": ariaLabel, id }: TabsProps): JSX.Element;
|
|
645
|
+
|
|
646
|
+
export declare interface TabsProps {
|
|
647
|
+
/** The tabs to render, in order. */
|
|
648
|
+
tabs: TabItem[];
|
|
649
|
+
/** The selected tab's value (controlled). */
|
|
650
|
+
value: string;
|
|
651
|
+
/** Called with the new value when the selection changes. */
|
|
652
|
+
onChange: (value: string) => void;
|
|
653
|
+
/** Accessible name for the tablist. */
|
|
654
|
+
"aria-label"?: string;
|
|
655
|
+
/**
|
|
656
|
+
* Base id. When set, each tab gets `${id}-tab-${value}` and references its
|
|
657
|
+
* panel via `aria-controls="${id}-panel-${value}"` — give the matching panel
|
|
658
|
+
* that id, `role="tabpanel"`, and `aria-labelledby` the tab id.
|
|
659
|
+
*/
|
|
660
|
+
id?: string;
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Multi-line text input. Same field-wiring behaviour as {@link TextInput}.
|
|
665
|
+
*/
|
|
666
|
+
export declare function Textarea({ id, rows, invalid, describedBy, className, ...props }: TextareaProps): JSX.Element;
|
|
667
|
+
|
|
668
|
+
export declare interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
669
|
+
/** Force the invalid state when used outside a `FormField`. */
|
|
670
|
+
invalid?: boolean;
|
|
671
|
+
/** Explicit `aria-describedby`. Falls back to the FormField value. */
|
|
672
|
+
describedBy?: string;
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
/**
|
|
676
|
+
* Single-line text input. Inherits field wiring when rendered inside a
|
|
677
|
+
* `FormField`; all native input props pass through.
|
|
678
|
+
*/
|
|
679
|
+
export declare function TextInput({ id, type, invalid, describedBy, className, ...props }: TextInputProps): JSX.Element;
|
|
680
|
+
|
|
681
|
+
export declare interface TextInputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
682
|
+
/** Force the invalid state when used outside a `FormField`. */
|
|
683
|
+
invalid?: boolean;
|
|
684
|
+
/** Explicit `aria-describedby`. Falls back to the FormField value. */
|
|
685
|
+
describedBy?: string;
|
|
686
|
+
}
|
|
687
|
+
|
|
688
|
+
export declare function Toast({ id, message, tone, onDismiss }: {
|
|
689
|
+
id: any;
|
|
690
|
+
message: any;
|
|
691
|
+
tone: any;
|
|
692
|
+
onDismiss: any;
|
|
693
|
+
}): JSX.Element;
|
|
694
|
+
|
|
695
|
+
export declare function ToastRegion({ toasts, onDismiss }: {
|
|
696
|
+
toasts?: never[] | undefined;
|
|
697
|
+
onDismiss: any;
|
|
698
|
+
}): JSX.Element;
|
|
699
|
+
|
|
700
|
+
/**
|
|
701
|
+
* A tooltip: a trigger paired with a popover shown above it on hover or focus.
|
|
702
|
+
* Seeded from the app's info tooltip. The reveal is CSS-driven (`:hover` /
|
|
703
|
+
* `:focus-within`), so it works for pointer and keyboard alike; `Escape`
|
|
704
|
+
* dismisses it while focused. The content carries `role="tooltip"` and is wired
|
|
705
|
+
* to the trigger with `aria-describedby`.
|
|
706
|
+
*/
|
|
707
|
+
export declare function Tooltip({ content, placement, trigger, triggerLabel, id, className, }: TooltipProps): JSX.Element;
|
|
708
|
+
|
|
709
|
+
export declare type TooltipPlacement = "top" | "bottom" | "left" | "right";
|
|
710
|
+
|
|
711
|
+
export declare interface TooltipProps {
|
|
712
|
+
/** The tooltip body, revealed on hover/focus. */
|
|
713
|
+
content: ReactNode;
|
|
714
|
+
/** Which side of the trigger the popover appears on. Defaults to "top". */
|
|
715
|
+
placement?: TooltipPlacement;
|
|
716
|
+
/**
|
|
717
|
+
* The trigger. Defaults to a small round "i" info button. Pass a custom
|
|
718
|
+
* element (it should be focusable so keyboard users can reveal the tooltip);
|
|
719
|
+
* it will be wired to the content via `aria-describedby`.
|
|
720
|
+
*/
|
|
721
|
+
trigger?: ReactNode;
|
|
722
|
+
/** Accessible label for the default info trigger. Defaults to "More information". */
|
|
723
|
+
triggerLabel?: string;
|
|
724
|
+
id?: string;
|
|
725
|
+
className?: string;
|
|
726
|
+
}
|
|
727
|
+
|
|
728
|
+
export { }
|