@mirror-physics/fractal-ui 0.2.0-next.9 → 0.2.0-next.90

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.d.ts CHANGED
@@ -1,19 +1,27 @@
1
1
  import * as React from 'react';
2
- import { ReactNode } from 'react';
2
+ import { HTMLAttributes, ReactNode, CSSProperties, ReactElement } from 'react';
3
3
  import { ClassValue } from 'clsx';
4
+ export { ColumnEditor, ColumnEditorItem, ColumnEditorProps } from './column-editor.js';
5
+
6
+ /** Shared density scale for single-line controls and their labels. */
7
+ type ControlSize = 'sm' | 'md' | 'lg' | 'xl';
4
8
 
5
9
  type ButtonType = 'primary' | 'secondary' | 'ghost' | 'danger';
6
- type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
10
+ type ButtonSize = ControlSize;
7
11
  type ButtonColor = 'blue' | 'pink' | 'orange' | 'green';
8
12
  interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
9
13
  /** Visual hierarchy. Primary = strongest action, Secondary = neutral bordered, Ghost = minimal, Danger = destructive. */
10
14
  buttonType?: ButtonType;
11
- /** Size preset matching the component height scale. */
15
+ /** Shared visual density; takes precedence over the buttonSize alias. */
16
+ controlSize?: ControlSize;
17
+ /** Backward-compatible alias for controlSize. */
12
18
  buttonSize?: ButtonSize;
13
- /** Color theme — maps to the design system's color scales. */
19
+ /** Explicit primary color preset. Omit to inherit the application's primary tokens. */
14
20
  color?: ButtonColor;
15
21
  /** Icon element. */
16
22
  icon?: React.ReactNode;
23
+ /** Decorative keyboard shortcut hint shown after the label. Set aria-keyshortcuts separately when applicable. */
24
+ shortcut?: React.ReactNode;
17
25
  /** Whether the button displays only an icon (no text). Must include aria-label. */
18
26
  hasIconOnly?: boolean;
19
27
  /** Position of the icon relative to the label. */
@@ -21,6 +29,48 @@ interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
21
29
  }
22
30
  declare const Button: React.ForwardRefExoticComponent<ButtonProps & React.RefAttributes<HTMLButtonElement>>;
23
31
 
32
+ interface CodeBlockProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'onChange'> {
33
+ /** Code or structured text displayed by the component. */
34
+ value: string;
35
+ /** Language name or common alias, such as `json`, `typescript`, `python`, or `bash`. */
36
+ language?: string;
37
+ /** Optional file name. Used for display and language detection when `language` is omitted. */
38
+ fileName?: string;
39
+ /** Optional title shown in the toolbar. */
40
+ label?: ReactNode;
41
+ /** Enables editing. Read-only viewer mode is the default. */
42
+ editable?: boolean;
43
+ /** Called when an editable block changes. */
44
+ onChange?: (value: string) => void;
45
+ /** Shows line numbers and a fold gutter. */
46
+ lineNumbers?: boolean;
47
+ /** Wraps long lines instead of requiring horizontal scrolling. */
48
+ wrap?: boolean;
49
+ /** Shows a copy action in the toolbar. */
50
+ copyable?: boolean;
51
+ /** Accessible name for the editing or viewing surface. */
52
+ ariaLabel?: string;
53
+ /** CodeMirror height constraints. Any valid CSS length is accepted. */
54
+ height?: string;
55
+ minHeight?: string;
56
+ maxHeight?: string;
57
+ placeholder?: string;
58
+ autoFocus?: boolean;
59
+ }
60
+ declare function CodeBlock({ value, language, fileName, label, editable, onChange, lineNumbers, wrap, copyable, ariaLabel, height, minHeight, maxHeight, placeholder, autoFocus, className, ...props }: CodeBlockProps): React.JSX.Element;
61
+
62
+ interface BreadcrumbItem {
63
+ label: React.ReactNode;
64
+ href?: string;
65
+ onClick?: React.MouseEventHandler<HTMLAnchorElement>;
66
+ }
67
+ interface BreadcrumbsProps extends Omit<React.HTMLAttributes<HTMLElement>, 'children'> {
68
+ items: BreadcrumbItem[];
69
+ ariaLabel?: string;
70
+ separator?: React.ReactNode;
71
+ }
72
+ declare function Breadcrumbs({ items, ariaLabel, separator, className, ...props }: BreadcrumbsProps): React.JSX.Element | null;
73
+
24
74
  declare const Card: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
25
75
  declare const CardHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
26
76
  declare const CardTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
@@ -57,10 +107,59 @@ interface PromptGridProps extends React.HTMLAttributes<HTMLDivElement> {
57
107
  declare const PromptGrid: React.ForwardRefExoticComponent<PromptGridProps & React.RefAttributes<HTMLDivElement>>;
58
108
 
59
109
  interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
110
+ /** Visual density; native `size` still controls the character-width hint. */
111
+ controlSize?: ControlSize;
112
+ /** Persistent title that floats into the border on focus or when filled. Search uses it only as an accessible name. */
113
+ fieldLabel?: string;
60
114
  }
61
115
  declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
62
116
 
117
+ type TableSearchType = 'text' | 'glob';
118
+ interface TableSearchProps extends Omit<InputProps, 'type'> {
119
+ /** Controls the search affordance. Filtering remains controlled by the table's data owner. */
120
+ searchType?: TableSearchType;
121
+ inputClassName?: string;
122
+ }
123
+ declare const TableSearch: React.ForwardRefExoticComponent<TableSearchProps & React.RefAttributes<HTMLInputElement>>;
124
+
125
+ interface NumberInputProps extends Omit<InputProps, 'type'> {
126
+ unit?: string;
127
+ }
128
+ declare function NumberInput({ unit, controlSize, className, value, defaultValue, disabled, readOnly, min, max, ...props }: NumberInputProps): React.JSX.Element;
129
+
130
+ type SliderBaseProps = {
131
+ min?: number;
132
+ max?: number;
133
+ step?: number;
134
+ disabled?: boolean;
135
+ className?: string;
136
+ showValues?: boolean;
137
+ formatValue?: (value: number) => React.ReactNode;
138
+ };
139
+ type SingleSliderProps = SliderBaseProps & {
140
+ knobs?: 1;
141
+ value: number;
142
+ onValueChange: (value: number) => void;
143
+ ariaLabel?: string;
144
+ };
145
+ type RangeSliderProps = SliderBaseProps & {
146
+ knobs: 2;
147
+ value: [number, number];
148
+ onValueChange: (value: [number, number]) => void;
149
+ lowerAriaLabel?: string;
150
+ upperAriaLabel?: string;
151
+ };
152
+ type SliderProps = SingleSliderProps | RangeSliderProps;
153
+ declare function Slider(props: SliderProps): React.JSX.Element;
154
+
155
+ interface PasswordInputProps extends Omit<InputProps, 'type'> {
156
+ showPasswordLabel?: string;
157
+ hidePasswordLabel?: string;
158
+ }
159
+ declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
160
+
63
161
  interface LabelProps extends React.LabelHTMLAttributes<HTMLLabelElement> {
162
+ controlSize?: ControlSize;
64
163
  }
65
164
  declare const Label: React.ForwardRefExoticComponent<LabelProps & React.RefAttributes<HTMLLabelElement>>;
66
165
 
@@ -73,6 +172,31 @@ declare const Alert: React.ForwardRefExoticComponent<AlertProps & React.RefAttri
73
172
  declare const AlertTitle: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLHeadingElement> & React.RefAttributes<HTMLHeadingElement>>;
74
173
  declare const AlertDescription: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
75
174
 
175
+ type ToastVariant = 'default' | 'info' | 'success' | 'warning' | 'error';
176
+ type ToastPosition = 'top-center' | 'top-right' | 'bottom-center';
177
+ interface ToastProps extends React.HTMLAttributes<HTMLDivElement> {
178
+ /** Semantic tone. Error toasts announce assertively; all other tones announce politely. */
179
+ variant?: ToastVariant;
180
+ /** Replaces the default semantic icon. */
181
+ icon?: React.ReactNode;
182
+ /** Optional action control, such as an Undo or View button. */
183
+ action?: React.ReactNode;
184
+ /** Called by the close control or after the auto-dismiss duration. */
185
+ onDismiss: () => void;
186
+ /** Accessible label for the close control. */
187
+ dismissLabel?: string;
188
+ /** Auto-dismiss delay in milliseconds. Pass null to keep the toast open. Defaults to 5 seconds, except errors, which persist. */
189
+ duration?: number | null;
190
+ }
191
+ interface ToastViewportProps extends React.HTMLAttributes<HTMLDivElement> {
192
+ /** Screen edge used for the toast stack. */
193
+ position?: ToastPosition;
194
+ /** Render into document.body so the stack is not clipped by product layout. */
195
+ portal?: boolean;
196
+ }
197
+ declare const Toast: React.ForwardRefExoticComponent<ToastProps & React.RefAttributes<HTMLDivElement>>;
198
+ declare const ToastViewport: React.ForwardRefExoticComponent<ToastViewportProps & React.RefAttributes<HTMLDivElement>>;
199
+
76
200
  interface ToggleProps {
77
201
  checked: boolean;
78
202
  onChange: (checked: boolean) => void;
@@ -94,19 +218,61 @@ interface ModalProps {
94
218
  footer?: React.ReactNode;
95
219
  /** When true, prevents closing via overlay click or Escape. */
96
220
  noClose?: boolean;
221
+ /** Keeps the close control visible but disables every dismissal route. */
222
+ closeDisabled?: boolean;
97
223
  /** Modal width: 'sm' (420px), 'md' (756px), 'lg' (near-fullscreen). */
98
224
  size?: 'sm' | 'md' | 'lg';
225
+ /** Replaces the body with a whole-surface loading state while retaining the modal chrome. */
226
+ loading?: boolean;
227
+ loadingLabel?: string;
228
+ /** Constrains the modal to the viewport, scrolls the body, and separates the fixed footer with a full-width divider. */
229
+ scrollable?: boolean;
99
230
  className?: string;
100
231
  }
101
- declare function Modal({ open, onClose, title, children, danger, warn, footer, noClose, size, className }: ModalProps): React.ReactPortal | null;
232
+ declare function Modal({ open, onClose, title, children, danger, warn, footer, noClose, closeDisabled, size, loading, loadingLabel, scrollable, className }: ModalProps): React.ReactPortal | null;
233
+
234
+ interface TableOverflowMenuItem {
235
+ value: string;
236
+ label: string;
237
+ icon?: ReactNode;
238
+ disabled?: boolean;
239
+ }
240
+ interface TableOverflowMenuConfig<T> {
241
+ items: (row: T, index: number) => TableOverflowMenuItem[];
242
+ onSelect: (value: string, row: T, index: number) => void;
243
+ getLabel?: (row: T, index: number) => string;
244
+ isDisabled?: (row: T, index: number) => boolean;
245
+ }
246
+
247
+ interface TableColumnSizing {
248
+ /** Preferred column width. Percentage widths require layout="fill". */
249
+ width?: string;
250
+ /** Minimum content width, including cell padding. */
251
+ minWidth?: number | string;
252
+ /** Maximum content width, including cell padding. Defaults adapt to the table container. */
253
+ maxWidth?: number | string;
254
+ }
255
+ interface TableLayoutProps {
256
+ /** Defaults to fill: distribute spare width across content-sized columns; overflow at their preferred widths. Content opts out of expansion. */
257
+ layout?: 'content' | 'fill';
258
+ /** Keeps column headers at the top of this table's scroll viewport. */
259
+ stickyHeader?: boolean;
260
+ /** Keeps the first data column (and selection column, if present) visible. */
261
+ stickyFirstColumn?: boolean;
262
+ /** Bounds vertical scrolling. Required for sticky headers during vertical scrolling. */
263
+ maxHeight?: number | string;
264
+ }
102
265
 
103
- interface DataTableColumn<T> {
266
+ interface DataTableColumn<T> extends TableColumnSizing {
104
267
  key: string;
105
268
  header: string;
106
269
  width?: string;
107
270
  render: (row: T, index: number) => ReactNode;
108
271
  }
109
- interface DataTableProps<T> {
272
+ interface DataTableProps<T> extends TableLayoutProps {
273
+ 'aria-label'?: string;
274
+ /** Adds a trailing, sticky row-actions column with an overflow menu. */
275
+ overflowMenu?: TableOverflowMenuConfig<T>;
110
276
  columns: DataTableColumn<T>[];
111
277
  data: T[];
112
278
  emptyMessage?: string;
@@ -114,7 +280,7 @@ interface DataTableProps<T> {
114
280
  size?: 'sm' | 'md' | 'lg';
115
281
  className?: string;
116
282
  }
117
- declare function DataTable<T>({ columns, data, emptyMessage, header, size, className }: DataTableProps<T>): React.JSX.Element;
283
+ declare function DataTable<T>({ columns, data, emptyMessage, header, size, className, overflowMenu, layout, stickyHeader, stickyFirstColumn, maxHeight, 'aria-label': ariaLabel }: DataTableProps<T>): React.JSX.Element;
118
284
 
119
285
  interface DropdownItem {
120
286
  value: string;
@@ -126,22 +292,48 @@ interface DropdownItem {
126
292
  }
127
293
  interface DropdownProps {
128
294
  items: DropdownItem[];
129
- selectedValue: string;
130
- onSelect: (value: string) => void;
295
+ selectedValue?: string;
296
+ onSelect?: (value: string) => void;
297
+ /** Checkbox-style options that remain open after selection. */
298
+ multiple?: boolean;
299
+ selectedValues?: string[];
300
+ onSelectionChange?: (values: string[]) => void;
301
+ searchable?: boolean;
302
+ searchPlaceholder?: string;
303
+ emptyMessage?: string;
131
304
  triggerLabel?: string;
132
- direction?: 'up' | 'down';
305
+ /** Floating field title. Empty selectedValue is the unfilled state. */
306
+ fieldLabel?: string;
307
+ /** Show a clear action; defaults to true for floating fields. */
308
+ clearable?: boolean;
309
+ direction?: 'up' | 'down' | 'left' | 'right';
310
+ /** Preferred alignment; shifted as needed to stay inside visible bounds. */
133
311
  align?: 'left' | 'right';
312
+ /** Maximum menu height in pixels, further limited by available space. Default: 320. */
313
+ maxHeight?: number;
314
+ /** Minimum inset from the viewport and clipping ancestors in pixels. Default: 8. */
315
+ collisionPadding?: number;
316
+ /** Arranges the trigger content vertically without rotating the dropdown panel. */
317
+ triggerOrientation?: 'horizontal' | 'vertical';
134
318
  triggerContent?: React.ReactNode;
135
319
  label?: React.ReactNode;
320
+ /** Renders the trigger as a square icon button. Requires an accessible triggerLabel. */
321
+ iconOnly?: boolean;
136
322
  noChevron?: boolean;
137
- size?: 'sm' | 'md';
323
+ /** Shared visual density; takes precedence over size. */
324
+ controlSize?: ControlSize;
325
+ /** Backward-compatible size alias. */
326
+ size?: ControlSize;
327
+ /** Connect a persistent Label with htmlFor to the trigger. */
328
+ triggerId?: string;
138
329
  triggerVariant?: 'outline' | 'tertiary';
139
330
  className?: string;
140
331
  triggerClassName?: string;
141
332
  panelClassName?: string;
142
333
  closeOnSelect?: boolean;
334
+ disabled?: boolean;
143
335
  }
144
- declare function Dropdown({ items, selectedValue, onSelect, triggerLabel, direction, align, triggerContent, label, noChevron, size, triggerVariant, className, triggerClassName, panelClassName, closeOnSelect, }: DropdownProps): React.JSX.Element | null;
336
+ declare function Dropdown({ items, selectedValue, onSelect, multiple, selectedValues, onSelectionChange, searchable, searchPlaceholder, emptyMessage, triggerLabel, fieldLabel, clearable, direction, align, maxHeight, collisionPadding, triggerOrientation, triggerContent, label, iconOnly, noChevron, size: sizeAlias, controlSize, triggerId, triggerVariant, className, triggerClassName, panelClassName, closeOnSelect, disabled, }: DropdownProps): React.JSX.Element | null;
145
337
 
146
338
  type LinkTheme = 'default' | 'muted' | 'accent';
147
339
  type LinkSize = 'sm' | 'md' | 'lg';
@@ -157,8 +349,26 @@ interface ChipProps extends React.HTMLAttributes<HTMLSpanElement> {
157
349
  }
158
350
  declare const Chip: React.ForwardRefExoticComponent<ChipProps & React.RefAttributes<HTMLSpanElement>>;
159
351
 
352
+ interface CheckboxProps extends Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'onChange'> {
353
+ checked: boolean;
354
+ indeterminate?: boolean;
355
+ onCheckedChange: (checked: boolean) => void;
356
+ }
357
+ declare function Checkbox({ checked, indeterminate, onCheckedChange, className, disabled, onClick, onKeyDown, ...props }: CheckboxProps): React.JSX.Element;
358
+
359
+ interface RadioProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'children' | 'onChange' | 'type'> {
360
+ label: React.ReactNode;
361
+ description?: React.ReactNode;
362
+ onCheckedChange?: (checked: boolean) => void;
363
+ }
364
+ declare function Radio({ checked, className, description, disabled, label, onCheckedChange, ...props }: RadioProps): React.JSX.Element;
365
+
160
366
  type SortDirection = 'asc' | 'desc' | null;
161
- interface SortableTableColumn<T> {
367
+ interface SortableTableDefaultSort {
368
+ key: string;
369
+ direction: Exclude<SortDirection, null>;
370
+ }
371
+ interface SortableTableColumn<T> extends TableColumnSizing {
162
372
  key: string;
163
373
  header: string;
164
374
  width?: string;
@@ -167,23 +377,70 @@ interface SortableTableColumn<T> {
167
377
  render: (row: T, index: number) => ReactNode;
168
378
  align?: 'left' | 'right';
169
379
  }
170
- interface SortableTableProps<T> {
380
+ interface SortableTableRowAction<T> {
381
+ label: (row: T, index: number) => string;
382
+ icon: (row: T, index: number) => ReactNode;
383
+ }
384
+ interface SortableTableSelection<T> {
385
+ /** Returns whether a row is selected. Selection is controlled by the consumer. */
386
+ isSelected: (row: T) => boolean;
387
+ /** Called when an individual row changes selection. */
388
+ onSelectedChange: (row: T, selected: boolean) => void;
389
+ /**
390
+ * Handles the complete selectable row set in one update when the header
391
+ * checkbox changes. Falls back to `onSelectedChange` for each row when omitted.
392
+ */
393
+ onSelectAllChange?: (rows: T[], selected: boolean) => void;
394
+ /** Accessible name for an individual row's checkbox. */
395
+ getRowLabel: (row: T) => string;
396
+ /** Accessible name for the header checkbox. */
397
+ selectAllLabel?: string;
398
+ }
399
+ interface SortableTablePagination {
400
+ page: number;
401
+ pageSize: number;
402
+ }
403
+ interface SortableTableProps<T> extends TableLayoutProps {
404
+ /** Adds a trailing, sticky row-actions column with an overflow menu. */
405
+ overflowMenu?: TableOverflowMenuConfig<T>;
171
406
  columns: SortableTableColumn<T>[];
172
407
  data: T[];
408
+ /** Accessible name applied to the underlying table element. */
409
+ 'aria-label'?: string;
173
410
  emptyMessage?: string;
174
411
  header?: ReactNode;
175
412
  size?: 'sm' | 'md' | 'lg';
413
+ /** Removes the table's outer border and radius for use inside another framed surface. */
414
+ embedded?: boolean;
176
415
  className?: string;
416
+ /** Required baseline row ordering that does not appear as an active user sort. */
417
+ defaultSort: SortableTableDefaultSort;
418
+ /** Initial visible user sort state. */
177
419
  defaultSortKey?: string;
178
420
  defaultSortDirection?: SortDirection;
179
421
  sortKey?: string | null;
180
422
  sortDirection?: SortDirection;
181
423
  onSortChange?: (key: string | null, direction: SortDirection) => void;
424
+ /**
425
+ * Slices the globally sorted dataset for display. Always pass the complete
426
+ * filtered dataset in `data`; sorting is applied before pagination.
427
+ */
428
+ pagination?: SortableTablePagination;
182
429
  highlightRow?: (row: T, index: number) => boolean;
430
+ /** Adds a leading checkbox column with controlled row selection. */
431
+ selection?: SortableTableSelection<T>;
432
+ /** Disabled rows remain visible but cannot be selected or activated. */
433
+ isRowDisabled?: (row: T) => boolean;
434
+ /** Disables only a row's selection control while preserving row activation. */
435
+ isRowSelectionDisabled?: (row: T) => boolean;
183
436
  /** Invoked when a row is selected. Enables pointer and keyboard row activation. */
184
437
  onRowClick?: (row: T, index: number) => void;
438
+ /** Invoked when a row is double-clicked. */
439
+ onRowDoubleClick?: (row: T, index: number) => void;
440
+ /** Directional affordance displayed over the right edge of an interactive row. */
441
+ rowAction?: SortableTableRowAction<T>;
185
442
  }
186
- declare function SortableTable<T>({ columns, data, emptyMessage, header, size, className, defaultSortKey, defaultSortDirection, sortKey: controlledKey, sortDirection: controlledDirection, onSortChange, highlightRow, onRowClick, }: SortableTableProps<T>): React.JSX.Element;
443
+ declare function SortableTable<T>({ columns, data, 'aria-label': ariaLabel, emptyMessage, header, size, embedded, layout, stickyHeader, stickyFirstColumn, maxHeight, overflowMenu, className, defaultSort, defaultSortKey, defaultSortDirection, sortKey: controlledKey, sortDirection: controlledDirection, onSortChange, pagination, highlightRow, selection, isRowDisabled, isRowSelectionDisabled, onRowClick, onRowDoubleClick, rowAction, }: SortableTableProps<T>): React.JSX.Element;
187
444
 
188
445
  interface TabItem {
189
446
  id: string;
@@ -191,6 +448,7 @@ interface TabItem {
191
448
  content: ReactNode;
192
449
  disabled?: boolean;
193
450
  }
451
+ type TabsVariant = 'line' | 'surface';
194
452
  interface TabsProps {
195
453
  items: TabItem[];
196
454
  defaultValue?: string;
@@ -198,8 +456,27 @@ interface TabsProps {
198
456
  onValueChange?: (id: string) => void;
199
457
  className?: string;
200
458
  ariaLabel?: string;
459
+ /** Extends a subtle divider across the entire tab list. */
460
+ divider?: boolean;
461
+ /** Visual treatment. Surface tabs sit on a full-width secondary surface with the active tab connected to its panel. */
462
+ variant?: TabsVariant;
463
+ }
464
+ declare function Tabs({ items, defaultValue, value: controlledValue, onValueChange, className, ariaLabel, divider, variant, }: TabsProps): React.JSX.Element;
465
+
466
+ interface ContentSwitcherItem {
467
+ value: string;
468
+ label: React.ReactNode;
469
+ disabled?: boolean;
470
+ }
471
+ interface ContentSwitcherProps {
472
+ items: ContentSwitcherItem[];
473
+ value: string;
474
+ onValueChange: (value: string) => void;
475
+ ariaLabel: string;
476
+ fullWidth?: boolean;
477
+ className?: string;
201
478
  }
202
- declare function Tabs({ items, defaultValue, value: controlledValue, onValueChange, className, ariaLabel, }: TabsProps): React.JSX.Element;
479
+ declare function ContentSwitcher({ items, value, onValueChange, ariaLabel, fullWidth, className }: ContentSwitcherProps): React.JSX.Element;
203
480
 
204
481
  interface DisclosureProps {
205
482
  title: ReactNode;
@@ -208,18 +485,140 @@ interface DisclosureProps {
208
485
  defaultOpen?: boolean;
209
486
  open?: boolean;
210
487
  onOpenChange?: (open: boolean) => void;
488
+ disabled?: boolean;
211
489
  className?: string;
212
490
  variant?: 'card' | 'plain';
213
491
  }
214
- declare function Disclosure({ title, meta, children, defaultOpen, open: controlledOpen, onOpenChange, className, variant, }: DisclosureProps): React.JSX.Element;
492
+ declare function Disclosure({ title, meta, children, defaultOpen, open: controlledOpen, onOpenChange, disabled, className, variant, }: DisclosureProps): React.JSX.Element;
493
+
494
+ interface LatticeLoaderProps extends HTMLAttributes<HTMLSpanElement> {
495
+ label?: string;
496
+ }
497
+ declare function LatticeLoader({ className, label, ...props }: LatticeLoaderProps): React.JSX.Element;
498
+
499
+ type UILoaderTone = 'neutral' | 'blue' | 'green';
500
+ interface UILoaderProps {
501
+ /** Visual height. Width follows the mark's aspect ratio. */
502
+ size?: number | string;
503
+ tone?: UILoaderTone;
504
+ className?: string;
505
+ style?: CSSProperties;
506
+ label?: string;
507
+ /** Use when another nearby element already announces loading. */
508
+ ariaHidden?: boolean;
509
+ }
510
+ /** A branded shine loader for whole UI surfaces, not component-level content. */
511
+ declare function UILoader({ size, tone, className, style, label, ariaHidden }: UILoaderProps): React.JSX.Element;
512
+
513
+ type GhostLength = number | string;
514
+ interface GhostProps extends HTMLAttributes<HTMLDivElement> {
515
+ /** Width of the placeholder. Numbers are interpreted as pixels. */
516
+ width?: GhostLength;
517
+ /** Height of the placeholder. Numbers are interpreted as pixels. */
518
+ height?: GhostLength;
519
+ /** Border radius override. */
520
+ radius?: GhostLength;
521
+ }
522
+ interface GhostLineProps extends Omit<GhostProps, 'height'> {
523
+ /** Text-line size. */
524
+ size?: 'sm' | 'md' | 'lg';
525
+ }
526
+ /**
527
+ * An intentionally content-free, shimmering placeholder. Use the composed
528
+ * ghosts below for standard Fractal components; use this primitive for custom
529
+ * product layouts.
530
+ */
531
+ declare function Ghost({ className, width, height, radius, style, ...props }: GhostProps): React.JSX.Element;
532
+ declare function GhostLine({ className, size, width, ...props }: GhostLineProps): React.JSX.Element;
533
+ interface ButtonGhostProps extends Omit<GhostProps, 'height'> {
534
+ size?: ControlSize;
535
+ controlSize?: ControlSize;
536
+ iconOnly?: boolean;
537
+ }
538
+ declare function ButtonGhost({ className, size, controlSize, iconOnly, width, ...props }: ButtonGhostProps): React.JSX.Element;
539
+ interface CardGhostProps extends HTMLAttributes<HTMLDivElement> {
540
+ lines?: number;
541
+ showHeader?: boolean;
542
+ }
543
+ declare function CardGhost({ className, lines, showHeader, ...props }: CardGhostProps): React.JSX.Element;
544
+ interface DataTableGhostProps extends HTMLAttributes<HTMLDivElement> {
545
+ /** Display placeholder cells for a header that is itself still loading. */
546
+ showHeader?: boolean;
547
+ /** Static header labels to retain while only rows are loading. */
548
+ headers?: ReactNode[];
549
+ /** Number of column placeholders. */
550
+ columns?: number;
551
+ /** Number of data row placeholders. */
552
+ rows?: number;
553
+ /** Optional CSS widths mirroring the eventual table columns. */
554
+ columnWidths?: string[];
555
+ size?: 'sm' | 'md' | 'lg';
556
+ }
557
+ declare function DataTableGhost({ className, showHeader, headers, columns, rows, columnWidths, size, ...props }: DataTableGhostProps): React.JSX.Element;
558
+ interface FormFieldGhostProps extends HTMLAttributes<HTMLDivElement> {
559
+ labelWidth?: GhostLength;
560
+ controlSize?: ControlSize;
561
+ multiline?: boolean;
562
+ }
563
+ declare function InputGhost({ className, labelWidth, ...props }: FormFieldGhostProps): React.JSX.Element;
564
+ declare function TextareaGhost({ className, labelWidth, ...props }: FormFieldGhostProps): React.JSX.Element;
565
+ declare function LabelGhost({ className, width, ...props }: Omit<GhostLineProps, 'size'>): React.JSX.Element;
566
+ declare function AlertGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
567
+ declare function CheckboxGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
568
+ declare const ToggleGhost: typeof CheckboxGhost;
569
+ declare function ChipGhost({ className, width, ...props }: Omit<GhostProps, 'height'>): React.JSX.Element;
570
+ declare function LinkGhost({ className, width, ...props }: Omit<GhostLineProps, 'size'>): React.JSX.Element;
571
+ declare const TextButtonGhost: typeof LinkGhost;
572
+ declare function DropdownGhost({ className, controlSize, ...props }: HTMLAttributes<HTMLDivElement> & {
573
+ controlSize?: ControlSize;
574
+ }): React.JSX.Element;
575
+ declare function ContentSwitcherGhost({ className, options, ...props }: HTMLAttributes<HTMLDivElement> & {
576
+ options?: number;
577
+ }): React.JSX.Element;
578
+ declare const TabsGhost: typeof ContentSwitcherGhost;
579
+ declare function DisclosureGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
580
+ declare function PaginationGhost({ className, pages, ...props }: HTMLAttributes<HTMLDivElement> & {
581
+ pages?: number;
582
+ }): React.JSX.Element;
583
+ declare function FileDropzoneGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
584
+ declare function PromptCardGhost({ className, ...props }: HTMLAttributes<HTMLDivElement>): React.JSX.Element;
585
+ type ConversationGhostProps = HTMLAttributes<HTMLDivElement>;
586
+ declare function ConversationGhost({ className, 'aria-label': ariaLabel, ...props }: ConversationGhostProps): React.JSX.Element;
587
+ declare function SortableTableGhost(props: DataTableGhostProps): React.JSX.Element;
588
+ interface SidebarGhostProps extends HTMLAttributes<HTMLDivElement> {
589
+ items?: number;
590
+ }
591
+ declare function SidebarGhost({ className, items, ...props }: SidebarGhostProps): React.JSX.Element;
592
+ interface SurfaceGhostProps extends Omit<HTMLAttributes<HTMLDivElement>, 'title'> {
593
+ title?: ReactNode;
594
+ lines?: number;
595
+ }
596
+ declare function ModalGhost({ className, title, lines, ...props }: SurfaceGhostProps): React.JSX.Element;
597
+ declare function SidePanelGhost({ className, title, lines, ...props }: SurfaceGhostProps): React.JSX.Element;
215
598
 
216
599
  interface SidebarProps extends React.HTMLAttributes<HTMLElement> {
217
600
  /** Fixed sidebar width. Defaults to the standard application width. */
218
601
  width?: string;
602
+ /** Collapses the sidebar to an icon rail until it is hovered or receives focus. */
603
+ compact?: boolean;
219
604
  }
220
605
  declare const Sidebar: React.ForwardRefExoticComponent<SidebarProps & React.RefAttributes<HTMLElement>>;
221
606
  declare const SidebarHeader: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
222
607
  declare const SidebarBrand: React.ForwardRefExoticComponent<React.ButtonHTMLAttributes<HTMLButtonElement> & React.RefAttributes<HTMLButtonElement>>;
608
+ interface SidebarAccountMenuProps {
609
+ /** Person or workspace label shown in the sidebar header. */
610
+ name: string;
611
+ /** Available account actions. */
612
+ items: DropdownItem[];
613
+ /** Invoked when an account action is selected. */
614
+ onSelect: (value: string) => void;
615
+ /** Accessible label for the account actions menu. */
616
+ triggerLabel?: string;
617
+ /** Leading profile or workspace mark. */
618
+ icon?: React.ReactNode;
619
+ className?: string;
620
+ }
621
+ declare function SidebarAccountMenu({ name, items, onSelect, triggerLabel, icon, className, }: SidebarAccountMenuProps): React.JSX.Element;
223
622
  declare const SidebarNav: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLElement> & React.RefAttributes<HTMLElement>>;
224
623
  declare const SidebarSection: React.ForwardRefExoticComponent<React.HTMLAttributes<HTMLDivElement> & React.RefAttributes<HTMLDivElement>>;
225
624
  interface SidebarNavItemProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
@@ -240,16 +639,34 @@ interface SidePanelProps {
240
639
  description?: React.ReactNode;
241
640
  children: React.ReactNode;
242
641
  footer?: React.ReactNode;
243
- /** Panel width: sm (420px), md (540px), or lg (680px). */
244
- size?: 'sm' | 'md' | 'lg';
642
+ /** Panel width: sm (420px), md (540px), lg (680px), or xl (960px). */
643
+ size?: 'sm' | 'md' | 'lg' | 'xl';
644
+ /** Replaces the body with a whole-surface loading state while retaining the panel header. */
645
+ loading?: boolean;
646
+ loadingLabel?: string;
245
647
  className?: string;
246
648
  }
247
- declare function SidePanel({ open, onClose, title, description, children, footer, size, className }: SidePanelProps): React.ReactPortal | null;
649
+ declare function SidePanel({ open, onClose, title, description, children, footer, size, loading, loadingLabel, className }: SidePanelProps): React.ReactPortal | null;
248
650
 
249
651
  interface TextareaProps extends React.TextareaHTMLAttributes<HTMLTextAreaElement> {
652
+ /** Persistent title: starts on the first line, floats into the border on focus or when filled. */
653
+ fieldLabel?: string;
654
+ /** Prose uses the input font; source preserves the existing monospace treatment. */
655
+ textStyle?: 'prose' | 'source';
250
656
  }
251
657
  declare const Textarea: React.ForwardRefExoticComponent<TextareaProps & React.RefAttributes<HTMLTextAreaElement>>;
252
658
 
659
+ type TextButtonSize = 'sm' | 'md';
660
+ type TextButtonIconPosition = 'start' | 'end';
661
+ type TextButtonTone = 'primary' | 'secondary';
662
+ interface TextButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
663
+ icon?: React.ReactNode;
664
+ iconPosition?: TextButtonIconPosition;
665
+ size?: TextButtonSize;
666
+ tone?: TextButtonTone;
667
+ }
668
+ declare const TextButton: React.ForwardRefExoticComponent<TextButtonProps & React.RefAttributes<HTMLButtonElement>>;
669
+
253
670
  interface FileDropzoneProps {
254
671
  files: File[];
255
672
  onFilesChange: (files: File[]) => void;
@@ -262,6 +679,20 @@ interface FileDropzoneProps {
262
679
  }
263
680
  declare function FileDropzone({ files, onFilesChange, accept, multiple, disabled, title, description, className, }: FileDropzoneProps): React.JSX.Element;
264
681
 
682
+ interface PaginationProps {
683
+ /** One-based active page. */
684
+ page: number;
685
+ pageSize: number;
686
+ totalItems: number;
687
+ onPageChange: (page: number) => void;
688
+ /** Optional page sizes, rendered as an unframed selector in the pagination footer. */
689
+ pageSizeOptions?: number[];
690
+ onPageSizeChange?: (pageSize: number) => void;
691
+ ariaLabel?: string;
692
+ className?: string;
693
+ }
694
+ declare function Pagination({ page, pageSize, totalItems, onPageChange, pageSizeOptions, onPageSizeChange, ariaLabel, className, }: PaginationProps): React.JSX.Element;
695
+
265
696
  /**
266
697
  * Register an Escape-key dismiss handler with the global priority stack.
267
698
  *
@@ -273,4 +704,19 @@ declare function useEscapeDismiss(priority: number, handler: () => void, enabled
273
704
 
274
705
  declare function cn(...inputs: ClassValue[]): string;
275
706
 
276
- export { Alert, AlertDescription, AlertTitle, Button, type ButtonColor, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle, Chip, type ChipProps, type ChipTone, DataTable, type DataTableColumn, type DataTableProps, Disclosure, type DisclosureProps, Dropdown, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, type FileDropzoneProps, FolderCard, type FolderCardProps, Input, type InputProps, Label, type LabelProps, Link, type LinkProps, type LinkSize, type LinkTheme, Modal, type ModalProps, PromptCard, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, SidePanel, type SidePanelProps, Sidebar, SidebarBrand, SidebarFooter, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableProps, type TabItem, Tabs, type TabsProps, Textarea, type TextareaProps, Toggle, type ToggleProps, cn, useEscapeDismiss };
707
+ interface TooltipProps {
708
+ /** Supplementary, non-interactive help. Keep essential instructions visible. */
709
+ content: ReactNode;
710
+ /** One focusable element that forwards its props and ref (for example Button). */
711
+ children: ReactElement;
712
+ placement?: 'top' | 'right' | 'bottom' | 'left';
713
+ maxWidth?: number | string;
714
+ /** Delay before opening on hover, in milliseconds. Keyboard focus is immediate. */
715
+ delay?: number;
716
+ disabled?: boolean;
717
+ className?: string;
718
+ }
719
+ /** Inverse hover/focus help with an arrow, viewport collision handling and Escape dismissal. */
720
+ declare function Tooltip({ content, children, placement, maxWidth, delay, disabled, className, }: TooltipProps): React.JSX.Element;
721
+
722
+ export { Alert, AlertDescription, AlertGhost, AlertTitle, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, Button, type ButtonColor, ButtonGhost, type ButtonGhostProps, type ButtonProps, type ButtonSize, type ButtonType, Card, CardContent, CardDescription, CardFooter, CardGhost, type CardGhostProps, CardHeader, CardTitle, Checkbox, CheckboxGhost, type CheckboxProps, Chip, ChipGhost, type ChipProps, type ChipTone, CodeBlock, type CodeBlockProps, ContentSwitcher, ContentSwitcherGhost, type ContentSwitcherItem, type ContentSwitcherProps, type ControlSize, ConversationGhost, type ConversationGhostProps, DataTable, type DataTableColumn, DataTableGhost, type DataTableGhostProps, type DataTableProps, Disclosure, DisclosureGhost, type DisclosureProps, Dropdown, DropdownGhost, type DropdownItem, type DropdownProps, FeatureCard, type FeatureCardProps, FileDropzone, FileDropzoneGhost, type FileDropzoneProps, FolderCard, type FolderCardProps, type FormFieldGhostProps, Ghost, GhostLine, type GhostLineProps, type GhostProps, Input, InputGhost, type InputProps, Label, LabelGhost, type LabelProps, LatticeLoader, type LatticeLoaderProps, Link, LinkGhost, type LinkProps, type LinkSize, type LinkTheme, Modal, ModalGhost, type ModalProps, NumberInput, type NumberInputProps, Pagination, PaginationGhost, type PaginationProps, PasswordInput, type PasswordInputProps, PromptCard, PromptCardGhost, type PromptCardProps, type PromptCardTone, PromptGrid, type PromptGridProps, Radio, type RadioProps, type RangeSliderProps, SidePanel, SidePanelGhost, type SidePanelProps, Sidebar, SidebarAccountMenu, type SidebarAccountMenuProps, SidebarBrand, SidebarFooter, SidebarGhost, type SidebarGhostProps, SidebarHeader, SidebarNav, SidebarNavItem, type SidebarNavItemProps, type SidebarProps, SidebarSection, type SingleSliderProps, Slider, type SliderProps, type SortDirection, SortableTable, type SortableTableColumn, type SortableTableDefaultSort, SortableTableGhost, type SortableTablePagination, type SortableTableProps, type SortableTableRowAction, type SortableTableSelection, type SurfaceGhostProps, type TabItem, type TableColumnSizing, type TableLayoutProps, type TableOverflowMenuConfig, type TableOverflowMenuItem, TableSearch, type TableSearchProps, type TableSearchType, Tabs, TabsGhost, type TabsProps, type TabsVariant, TextButton, TextButtonGhost, type TextButtonIconPosition, type TextButtonProps, type TextButtonSize, type TextButtonTone, Textarea, TextareaGhost, type TextareaProps, Toast, type ToastPosition, type ToastProps, type ToastVariant, ToastViewport, type ToastViewportProps, Toggle, ToggleGhost, type ToggleProps, Tooltip, type TooltipProps, UILoader, type UILoaderProps, type UILoaderTone, cn, useEscapeDismiss };