@sovereignfs/ui 0.41.0 → 0.45.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/Accordion.module.css +3 -0
- package/dist/Alert.module.css +62 -0
- package/dist/AspectRatio.module.css +15 -0
- package/dist/Badge.module.css +75 -9
- package/dist/Breadcrumb.module.css +49 -0
- package/dist/Button.module.css +12 -3
- package/dist/ButtonGroup.module.css +29 -0
- package/dist/Card.module.css +6 -0
- package/dist/Checkbox.module.css +3 -1
- package/dist/Collapsible.module.css +70 -0
- package/dist/Combobox.module.css +122 -0
- package/dist/Command.module.css +80 -0
- package/dist/ConfirmDialog.module.css +5 -1
- package/dist/DataTable.module.css +28 -0
- package/dist/DatePicker.module.css +6 -2
- package/dist/Dialog.module.css +3 -0
- package/dist/HoverCard.module.css +3 -0
- package/dist/Input.module.css +6 -1
- package/dist/Item.module.css +70 -0
- package/dist/Kbd.module.css +14 -0
- package/dist/Label.module.css +11 -0
- package/dist/Marker.module.css +33 -0
- package/dist/Menu.module.css +8 -1
- package/dist/Message.module.css +99 -0
- package/dist/MessageScroller.module.css +54 -0
- package/dist/NavigationMenu.module.css +53 -0
- package/dist/Pagination.module.css +98 -0
- package/dist/Progress.module.css +20 -0
- package/dist/RadioGroup.module.css +88 -0
- package/dist/Resizable.module.css +70 -0
- package/dist/ScrollArea.module.css +20 -0
- package/dist/Select.module.css +7 -3
- package/dist/Slider.module.css +95 -0
- package/dist/Table.module.css +45 -0
- package/dist/Tabs.module.css +6 -1
- package/dist/Toggle.module.css +6 -1
- package/dist/Typography.module.css +47 -0
- package/dist/index.d.ts +617 -5
- package/dist/index.js +1847 -499
- package/dist/tokens/primitives.css +22 -8
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.module.css +3 -0
- package/src/components/Accordion/Accordion.stories.tsx +110 -0
- package/src/components/Accordion/Accordion.tsx +53 -0
- package/src/components/Accordion/__tests__/Accordion.test.tsx +61 -0
- package/src/components/Alert/Alert.module.css +62 -0
- package/src/components/Alert/Alert.stories.tsx +96 -0
- package/src/components/Alert/Alert.tsx +58 -0
- package/src/components/Alert/__tests__/Alert.test.tsx +75 -0
- package/src/components/AspectRatio/AspectRatio.module.css +15 -0
- package/src/components/AspectRatio/AspectRatio.stories.tsx +78 -0
- package/src/components/AspectRatio/AspectRatio.tsx +21 -0
- package/src/components/AspectRatio/__tests__/AspectRatio.test.tsx +27 -0
- package/src/components/Badge/Badge.module.css +75 -9
- package/src/components/Badge/Badge.stories.tsx +109 -1
- package/src/components/Badge/Badge.tsx +30 -2
- package/src/components/Badge/__tests__/Badge.test.tsx +26 -2
- package/src/components/Breadcrumb/Breadcrumb.module.css +49 -0
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +47 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +57 -0
- package/src/components/Breadcrumb/__tests__/Breadcrumb.test.tsx +52 -0
- package/src/components/Button/Button.module.css +12 -3
- package/src/components/Button/Button.stories.tsx +3 -2
- package/src/components/Button/Button.tsx +1 -1
- package/src/components/Button/__tests__/Button.test.tsx +10 -0
- package/src/components/ButtonGroup/ButtonGroup.module.css +29 -0
- package/src/components/ButtonGroup/ButtonGroup.stories.tsx +57 -0
- package/src/components/ButtonGroup/ButtonGroup.tsx +27 -0
- package/src/components/ButtonGroup/__tests__/ButtonGroup.test.tsx +29 -0
- package/src/components/Card/Card.module.css +6 -0
- package/src/components/Checkbox/Checkbox.module.css +3 -1
- package/src/components/Collapsible/Collapsible.module.css +70 -0
- package/src/components/Collapsible/Collapsible.stories.tsx +62 -0
- package/src/components/Collapsible/Collapsible.tsx +66 -0
- package/src/components/Collapsible/__tests__/Collapsible.test.tsx +71 -0
- package/src/components/Combobox/Combobox.module.css +122 -0
- package/src/components/Combobox/Combobox.stories.tsx +79 -0
- package/src/components/Combobox/Combobox.tsx +186 -0
- package/src/components/Combobox/__tests__/Combobox.test.tsx +158 -0
- package/src/components/Command/Command.module.css +80 -0
- package/src/components/Command/Command.stories.tsx +104 -0
- package/src/components/Command/Command.tsx +168 -0
- package/src/components/Command/__tests__/Command.test.tsx +162 -0
- package/src/components/ConfirmDialog/ConfirmDialog.module.css +5 -1
- package/src/components/ContextMenu/ContextMenu.stories.tsx +81 -0
- package/src/components/ContextMenu/ContextMenu.tsx +100 -0
- package/src/components/ContextMenu/__tests__/ContextMenu.test.tsx +87 -0
- package/src/components/DataTable/DataTable.module.css +28 -0
- package/src/components/DataTable/DataTable.stories.tsx +74 -0
- package/src/components/DataTable/DataTable.tsx +154 -0
- package/src/components/DataTable/__tests__/DataTable.test.tsx +123 -0
- package/src/components/DatePicker/DatePicker.module.css +6 -2
- package/src/components/Dialog/Dialog.module.css +3 -0
- package/src/components/HoverCard/HoverCard.module.css +3 -0
- package/src/components/HoverCard/HoverCard.stories.tsx +66 -0
- package/src/components/HoverCard/HoverCard.tsx +111 -0
- package/src/components/HoverCard/__tests__/HoverCard.test.tsx +99 -0
- package/src/components/Icon/icons/circle-check.tsx +21 -0
- package/src/components/Icon/icons/circle-x.tsx +22 -0
- package/src/components/Icon/icons/index.ts +8 -0
- package/src/components/Input/Input.module.css +6 -1
- package/src/components/Item/Item.module.css +70 -0
- package/src/components/Item/Item.stories.tsx +62 -0
- package/src/components/Item/Item.tsx +54 -0
- package/src/components/Item/__tests__/Item.test.tsx +39 -0
- package/src/components/Kbd/Kbd.module.css +14 -0
- package/src/components/Kbd/Kbd.stories.tsx +32 -0
- package/src/components/Kbd/Kbd.tsx +12 -0
- package/src/components/Kbd/__tests__/Kbd.test.tsx +14 -0
- package/src/components/Label/Label.module.css +11 -0
- package/src/components/Label/Label.stories.tsx +40 -0
- package/src/components/Label/Label.tsx +24 -0
- package/src/components/Label/__tests__/Label.test.tsx +32 -0
- package/src/components/Marker/Marker.module.css +33 -0
- package/src/components/Marker/Marker.stories.tsx +39 -0
- package/src/components/Marker/Marker.tsx +34 -0
- package/src/components/Marker/__tests__/Marker.test.tsx +23 -0
- package/src/components/Menu/Menu.module.css +8 -1
- package/src/components/Menu/Menu.tsx +30 -8
- package/src/components/Menubar/Menubar.stories.tsx +52 -0
- package/src/components/Menubar/Menubar.tsx +42 -0
- package/src/components/Menubar/__tests__/Menubar.test.tsx +45 -0
- package/src/components/Message/Message.module.css +99 -0
- package/src/components/Message/Message.stories.tsx +79 -0
- package/src/components/Message/Message.tsx +41 -0
- package/src/components/Message/__tests__/Message.test.tsx +46 -0
- package/src/components/MessageScroller/MessageScroller.module.css +54 -0
- package/src/components/MessageScroller/MessageScroller.stories.tsx +84 -0
- package/src/components/MessageScroller/MessageScroller.tsx +72 -0
- package/src/components/MessageScroller/__tests__/MessageScroller.test.tsx +105 -0
- package/src/components/NavigationMenu/NavigationMenu.module.css +53 -0
- package/src/components/NavigationMenu/NavigationMenu.stories.tsx +58 -0
- package/src/components/NavigationMenu/NavigationMenu.tsx +125 -0
- package/src/components/NavigationMenu/__tests__/NavigationMenu.test.tsx +93 -0
- package/src/components/Pagination/Pagination.module.css +98 -0
- package/src/components/Pagination/Pagination.stories.tsx +49 -0
- package/src/components/Pagination/Pagination.tsx +87 -0
- package/src/components/Pagination/__tests__/Pagination.test.tsx +56 -0
- package/src/components/Progress/Progress.module.css +20 -0
- package/src/components/Progress/Progress.stories.tsx +40 -0
- package/src/components/Progress/Progress.tsx +35 -0
- package/src/components/Progress/__tests__/Progress.test.tsx +31 -0
- package/src/components/RadioGroup/RadioGroup.module.css +88 -0
- package/src/components/RadioGroup/RadioGroup.stories.tsx +69 -0
- package/src/components/RadioGroup/RadioGroup.tsx +99 -0
- package/src/components/RadioGroup/__tests__/RadioGroup.test.tsx +59 -0
- package/src/components/Resizable/Resizable.module.css +70 -0
- package/src/components/Resizable/Resizable.stories.tsx +82 -0
- package/src/components/Resizable/Resizable.tsx +313 -0
- package/src/components/Resizable/__tests__/Resizable.test.tsx +128 -0
- package/src/components/ScrollArea/ScrollArea.module.css +20 -0
- package/src/components/ScrollArea/ScrollArea.stories.tsx +57 -0
- package/src/components/ScrollArea/ScrollArea.tsx +27 -0
- package/src/components/ScrollArea/__tests__/ScrollArea.test.tsx +39 -0
- package/src/components/Select/Select.module.css +7 -3
- package/src/components/Slider/Slider.module.css +95 -0
- package/src/components/Slider/Slider.stories.tsx +64 -0
- package/src/components/Slider/Slider.tsx +77 -0
- package/src/components/Slider/__tests__/Slider.test.tsx +45 -0
- package/src/components/Table/Table.module.css +45 -0
- package/src/components/Table/Table.stories.tsx +125 -0
- package/src/components/Table/Table.tsx +51 -0
- package/src/components/Table/__tests__/Table.test.tsx +50 -0
- package/src/components/Tabs/Tabs.module.css +6 -1
- package/src/components/Toggle/Toggle.module.css +6 -1
- package/src/components/Typography/Typography.module.css +47 -0
- package/src/components/Typography/Typography.stories.tsx +62 -0
- package/src/components/Typography/Typography.tsx +30 -0
- package/src/components/Typography/__tests__/Typography.test.tsx +34 -0
- package/src/index.ts +78 -1
- package/src/stories/DesignSystemOverview.stories.tsx +614 -2
- package/src/stories/MobilePatterns.stories.tsx +8 -2
- package/src/stories/TokenGallery.stories.tsx +112 -16
- package/src/tokens/primitives.css +22 -8
package/dist/index.d.ts
CHANGED
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
|
-
import { ReactNode, ButtonHTMLAttributes, SelectHTMLAttributes, ReactElement, CSSProperties, InputHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes,
|
|
2
|
+
import { ReactNode, ButtonHTMLAttributes, SelectHTMLAttributes, ReactElement, CSSProperties, InputHTMLAttributes, TextareaHTMLAttributes, HTMLAttributes, TdHTMLAttributes, ThHTMLAttributes, LabelHTMLAttributes, ElementType, PointerEvent, KeyboardEvent, MouseEvent } from 'react';
|
|
3
3
|
|
|
4
4
|
type BadgeVariant = 'role' | 'status' | 'mono';
|
|
5
|
+
type BadgeSize = 'sm' | 'md' | 'lg';
|
|
5
6
|
type BadgeStatus = 'active' | 'enabled' | 'deactivated' | 'failed' | 'invited' | 'pending' | 'neutral';
|
|
6
7
|
interface BadgeProps {
|
|
7
8
|
variant?: BadgeVariant;
|
|
9
|
+
/** 'sm' | 'md' (default) | 'lg'. 'md' is the badge's original — and until
|
|
10
|
+
* now, only — size, so the default renders unchanged. */
|
|
11
|
+
size?: BadgeSize;
|
|
8
12
|
/** Only relevant when variant="status" — determines the dot colour. */
|
|
9
13
|
status?: BadgeStatus;
|
|
14
|
+
/** Forces ALL CAPS display regardless of the case `children` is passed
|
|
15
|
+
* in. Defaults to `true` — every existing badge in the app relies on
|
|
16
|
+
* this. Set `false` for a title-case badge that renders exactly the text
|
|
17
|
+
* passed in (e.g. "Owner" instead of "OWNER"). */
|
|
18
|
+
uppercase?: boolean;
|
|
10
19
|
children: ReactNode;
|
|
11
20
|
}
|
|
12
21
|
/**
|
|
@@ -15,10 +24,13 @@ interface BadgeProps {
|
|
|
15
24
|
* - `role` neutral surface + border, semibold — for Owner / Admin / User
|
|
16
25
|
* - `status` tinted chip with leading colour dot — for Active / Deactivated / etc.
|
|
17
26
|
* - `mono` monospace font, neutral surface — for platform / community / v0.1.0
|
|
27
|
+
*
|
|
28
|
+
* Three sizes (`sm`/`md`/`lg`, default `md`). ALL CAPS by default
|
|
29
|
+
* (`uppercase`) — set `uppercase={false}` for a title-case badge instead.
|
|
18
30
|
*/
|
|
19
|
-
declare function Badge({ variant, status, children }: BadgeProps): react.JSX.Element;
|
|
31
|
+
declare function Badge({ variant, size, status, uppercase, children, }: BadgeProps): react.JSX.Element;
|
|
20
32
|
|
|
21
|
-
type IconName = 'house' | 'settings' | 'log-out' | 'chevron-right' | 'chevron-left' | 'chevron-down' | 'chevron-up' | 'x' | 'check' | 'plus' | 'trash-2' | 'pencil' | 'rotate-ccw' | 'search' | 'user' | 'shield' | 'lock' | 'eye' | 'eye-off' | 'mail' | 'bell' | 'activity' | 'package' | 'grid-2x2' | 'info' | 'alert-triangle' | 'calendar' | 'sliders-horizontal' | 'ellipsis-vertical' | 'file' | 'upload' | 'external-link' | 'banana' | 'apple' | 'carrot' | 'egg' | 'beef' | 'fish' | 'coffee' | 'wine' | 'beer' | 'cookie' | 'pizza' | 'candy' | 'salad' | 'milk' | 'drumstick' | 'croissant' | 'cup-soda' | 'spray-can' | 'snowflake' | 'shopping-basket';
|
|
33
|
+
type IconName = 'house' | 'settings' | 'log-out' | 'chevron-right' | 'chevron-left' | 'chevron-down' | 'chevron-up' | 'x' | 'check' | 'plus' | 'trash-2' | 'pencil' | 'rotate-ccw' | 'search' | 'user' | 'shield' | 'lock' | 'eye' | 'eye-off' | 'mail' | 'bell' | 'activity' | 'package' | 'grid-2x2' | 'info' | 'alert-triangle' | 'circle-check' | 'circle-x' | 'calendar' | 'sliders-horizontal' | 'ellipsis-vertical' | 'file' | 'upload' | 'external-link' | 'banana' | 'apple' | 'carrot' | 'egg' | 'beef' | 'fish' | 'coffee' | 'wine' | 'beer' | 'cookie' | 'pizza' | 'candy' | 'salad' | 'milk' | 'drumstick' | 'croissant' | 'cup-soda' | 'spray-can' | 'snowflake' | 'shopping-basket';
|
|
22
34
|
|
|
23
35
|
/** Decorative icon — visually meaningful but described by surrounding text. */
|
|
24
36
|
type DecorativeProps = {
|
|
@@ -194,7 +206,7 @@ interface PopoverProps {
|
|
|
194
206
|
declare function Popover({ trigger, open, onClose, align, width, panelStyle, 'aria-label': ariaLabel, children, }: PopoverProps): react.JSX.Element;
|
|
195
207
|
|
|
196
208
|
type ButtonVariant = 'primary' | 'secondary' | 'ghost' | 'destructive';
|
|
197
|
-
type ButtonSize = 'sm' | 'md';
|
|
209
|
+
type ButtonSize = 'sm' | 'md' | 'lg';
|
|
198
210
|
interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
199
211
|
variant?: ButtonVariant;
|
|
200
212
|
size?: ButtonSize;
|
|
@@ -569,6 +581,17 @@ interface MenuProps {
|
|
|
569
581
|
* Selecting an item both closes the menu and calls its `onSelect` — a
|
|
570
582
|
* consumer's `onSelect` never needs to call `onClose` itself.
|
|
571
583
|
*/
|
|
584
|
+
/**
|
|
585
|
+
* MenuEntries — the `<ul role="menu">` item list itself, factored out of
|
|
586
|
+
* `Menu` so other adaptive-surface components (e.g. `ContextMenu`) can
|
|
587
|
+
* render the exact same items/destructive/checked/icon markup inside their
|
|
588
|
+
* own positioning shell, instead of re-deriving it and risking drift.
|
|
589
|
+
*/
|
|
590
|
+
declare function MenuEntries({ items, onSelect, }: {
|
|
591
|
+
items: MenuEntry[];
|
|
592
|
+
/** Called after an item's own onSelect — typically the surface's onClose. */
|
|
593
|
+
onSelect: (entry: MenuItem) => void;
|
|
594
|
+
}): react.JSX.Element;
|
|
572
595
|
declare function Menu({ trigger, open, onClose, items, 'aria-label': ariaLabel, align }: MenuProps): react.JSX.Element;
|
|
573
596
|
|
|
574
597
|
interface ToastItem {
|
|
@@ -689,6 +712,595 @@ interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'typ
|
|
|
689
712
|
}
|
|
690
713
|
declare function Checkbox({ checked, onChange, label, strikeThrough, disabled, className, id, ...rest }: CheckboxProps): react.JSX.Element;
|
|
691
714
|
|
|
715
|
+
interface RadioGroupItem {
|
|
716
|
+
label: string;
|
|
717
|
+
value: string;
|
|
718
|
+
disabled?: boolean;
|
|
719
|
+
}
|
|
720
|
+
interface RadioGroupProps {
|
|
721
|
+
items: RadioGroupItem[];
|
|
722
|
+
value: string;
|
|
723
|
+
onChange: (value: string) => void;
|
|
724
|
+
/** Groups the underlying native radios. Auto-generated when omitted —
|
|
725
|
+
* only pass this to participate in a native, non-React form submission. */
|
|
726
|
+
name?: string;
|
|
727
|
+
/** Disables every item. Use `items[].disabled` to disable one. */
|
|
728
|
+
disabled?: boolean;
|
|
729
|
+
id?: string;
|
|
730
|
+
className?: string;
|
|
731
|
+
'aria-label'?: string;
|
|
732
|
+
'aria-labelledby'?: string;
|
|
733
|
+
'aria-describedby'?: string;
|
|
734
|
+
'aria-invalid'?: boolean;
|
|
735
|
+
required?: boolean;
|
|
736
|
+
}
|
|
737
|
+
/**
|
|
738
|
+
* RadioGroup — single-select list of options.
|
|
739
|
+
*
|
|
740
|
+
* Renders real `<input type="radio">` elements sharing one `name`, visually
|
|
741
|
+
* hidden behind a custom circle (same technique as `Checkbox`). Keyboard
|
|
742
|
+
* arrow-key navigation between options is native browser behavior for
|
|
743
|
+
* grouped radio inputs — nothing to hand-roll here.
|
|
744
|
+
*/
|
|
745
|
+
declare function RadioGroup({ items, value, onChange, name, disabled, id, className, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, required, }: RadioGroupProps): react.JSX.Element;
|
|
746
|
+
|
|
747
|
+
interface SliderProps {
|
|
748
|
+
value: number;
|
|
749
|
+
onChange: (value: number) => void;
|
|
750
|
+
min: number;
|
|
751
|
+
max: number;
|
|
752
|
+
step?: number;
|
|
753
|
+
/** Renders a visible label above the track. Omit and pass `aria-label`
|
|
754
|
+
* instead for a standalone, unlabeled slider. */
|
|
755
|
+
label?: string;
|
|
756
|
+
disabled?: boolean;
|
|
757
|
+
id?: string;
|
|
758
|
+
className?: string;
|
|
759
|
+
'aria-label'?: string;
|
|
760
|
+
'aria-describedby'?: string;
|
|
761
|
+
'aria-invalid'?: boolean;
|
|
762
|
+
required?: boolean;
|
|
763
|
+
}
|
|
764
|
+
/**
|
|
765
|
+
* Slider — single-thumb range input.
|
|
766
|
+
*
|
|
767
|
+
* A native `<input type="range">` under custom track/thumb styling — arrow
|
|
768
|
+
* key (adjust by `step`), Home/End (jump to min/max), and touch-drag
|
|
769
|
+
* support all come from the browser, nothing hand-rolled. Dual-thumb/range
|
|
770
|
+
* selection is out of scope until a consumer needs it.
|
|
771
|
+
*/
|
|
772
|
+
declare function Slider({ value, onChange, min, max, step, label, disabled, id, className, 'aria-label': ariaLabel, 'aria-describedby': ariaDescribedBy, 'aria-invalid': ariaInvalid, required, }: SliderProps): react.JSX.Element;
|
|
773
|
+
|
|
774
|
+
interface ProgressProps {
|
|
775
|
+
/** 0–100. Values outside that range are clamped. */
|
|
776
|
+
value: number;
|
|
777
|
+
/** Accessible name — Progress has no visible text of its own. */
|
|
778
|
+
label?: string;
|
|
779
|
+
id?: string;
|
|
780
|
+
className?: string;
|
|
781
|
+
}
|
|
782
|
+
/**
|
|
783
|
+
* Progress — determinate bar.
|
|
784
|
+
*
|
|
785
|
+
* `role="progressbar"` with `aria-valuenow`/`aria-valuemin`/`aria-valuemax`
|
|
786
|
+
* so screen readers announce the current value. Indeterminate state is out
|
|
787
|
+
* of scope until a consumer needs it.
|
|
788
|
+
*/
|
|
789
|
+
declare function Progress({ value, label, id, className }: ProgressProps): react.JSX.Element;
|
|
790
|
+
|
|
791
|
+
interface TableProps {
|
|
792
|
+
children: ReactNode;
|
|
793
|
+
className?: string;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Table — thin, styled wrappers around the native table elements.
|
|
797
|
+
*
|
|
798
|
+
* Not a data grid: no sort, filter, or virtualization. `Table` wraps its
|
|
799
|
+
* content in a horizontally-scrolling container (masked-edge fade, hidden
|
|
800
|
+
* scrollbar — same technique as `NavTabs`) so a table wider than its
|
|
801
|
+
* container scrolls instead of overflowing the page, at any viewport size.
|
|
802
|
+
*/
|
|
803
|
+
declare function Table({ children, className }: TableProps): react.JSX.Element;
|
|
804
|
+
declare function TableHead({ children }: {
|
|
805
|
+
children: ReactNode;
|
|
806
|
+
}): react.JSX.Element;
|
|
807
|
+
declare function TableBody({ children }: {
|
|
808
|
+
children: ReactNode;
|
|
809
|
+
}): react.JSX.Element;
|
|
810
|
+
declare function TableRow({ children }: {
|
|
811
|
+
children: ReactNode;
|
|
812
|
+
}): react.JSX.Element;
|
|
813
|
+
declare function TableHeaderCell({ children, ...rest }: ThHTMLAttributes<HTMLTableCellElement>): react.JSX.Element;
|
|
814
|
+
declare function TableCell({ children, ...rest }: TdHTMLAttributes<HTMLTableCellElement>): react.JSX.Element;
|
|
815
|
+
|
|
816
|
+
type AlertVariant = 'info' | 'success' | 'warning' | 'error' | 'neutral';
|
|
817
|
+
interface AlertProps {
|
|
818
|
+
variant: AlertVariant;
|
|
819
|
+
heading?: string;
|
|
820
|
+
/** Leading icon next to the heading. Defaults to a per-variant icon (see
|
|
821
|
+
* `DEFAULT_ICON`) — pass an `IconName` to override it, or `false` to
|
|
822
|
+
* suppress the icon entirely. Purely decorative: the variant's colour and
|
|
823
|
+
* `heading`/`children` text already carry the meaning. */
|
|
824
|
+
icon?: IconName | false;
|
|
825
|
+
children: ReactNode;
|
|
826
|
+
id?: string;
|
|
827
|
+
className?: string;
|
|
828
|
+
}
|
|
829
|
+
/**
|
|
830
|
+
* Alert — inline, non-dismissible banner.
|
|
831
|
+
*
|
|
832
|
+
* Distinct from `Toast` (transient, auto-dismissing) and `SystemBanner`
|
|
833
|
+
* (instance-wide): Alert is for in-context messaging — form-level errors,
|
|
834
|
+
* or explaining an empty/blocked state.
|
|
835
|
+
*
|
|
836
|
+
* `role="alert"` for `error` (interrupts screen readers immediately, since
|
|
837
|
+
* an error demands attention); `role="status"` for the other variants
|
|
838
|
+
* (announced politely, without interrupting).
|
|
839
|
+
*/
|
|
840
|
+
declare function Alert({ variant, heading, icon, children, id, className }: AlertProps): react.JSX.Element;
|
|
841
|
+
|
|
842
|
+
interface BreadcrumbItem {
|
|
843
|
+
label: string;
|
|
844
|
+
/** Omit for the current page — rendered as plain text with aria-current. */
|
|
845
|
+
href?: string;
|
|
846
|
+
}
|
|
847
|
+
interface BreadcrumbProps {
|
|
848
|
+
items: BreadcrumbItem[];
|
|
849
|
+
/** Renders a linked item. Defaults to a plain `<a href>`, which causes a
|
|
850
|
+
* full page reload — pass Next's `<Link>` (or equivalent) to keep
|
|
851
|
+
* navigation client-side, which matters inside overlay-shell plugins
|
|
852
|
+
* where a full reload breaks the router.back()-driven dismiss flow. */
|
|
853
|
+
renderLink?: (item: BreadcrumbItem, children: ReactNode) => ReactNode;
|
|
854
|
+
className?: string;
|
|
855
|
+
'aria-label'?: string;
|
|
856
|
+
}
|
|
857
|
+
declare function Breadcrumb({ items, renderLink, className, 'aria-label': ariaLabel, }: BreadcrumbProps): react.JSX.Element;
|
|
858
|
+
|
|
859
|
+
interface PaginationProps {
|
|
860
|
+
/** 1-indexed current page. */
|
|
861
|
+
page: number;
|
|
862
|
+
totalPages: number;
|
|
863
|
+
onChange: (page: number) => void;
|
|
864
|
+
className?: string;
|
|
865
|
+
'aria-label'?: string;
|
|
866
|
+
}
|
|
867
|
+
declare function Pagination({ page, totalPages, onChange, className, 'aria-label': ariaLabel, }: PaginationProps): react.JSX.Element;
|
|
868
|
+
|
|
869
|
+
interface KbdProps {
|
|
870
|
+
children: ReactNode;
|
|
871
|
+
className?: string;
|
|
872
|
+
}
|
|
873
|
+
/** Kbd — inline keyboard-key styling. Renders a real `<kbd>` element. */
|
|
874
|
+
declare function Kbd({ children, className }: KbdProps): react.JSX.Element;
|
|
875
|
+
|
|
876
|
+
interface CollapsibleProps {
|
|
877
|
+
open: boolean;
|
|
878
|
+
onOpenChange: (open: boolean) => void;
|
|
879
|
+
trigger: ReactNode;
|
|
880
|
+
children: ReactNode;
|
|
881
|
+
id?: string;
|
|
882
|
+
className?: string;
|
|
883
|
+
}
|
|
884
|
+
/**
|
|
885
|
+
* Collapsible — single expand/collapse primitive. Independently useful
|
|
886
|
+
* (e.g. a "show more" toggle), and composed internally by `Accordion`.
|
|
887
|
+
*
|
|
888
|
+
* The expand/collapse animation uses `grid-template-rows: 0fr` → `1fr`
|
|
889
|
+
* rather than animating `height`, which can't transition to/from `auto`
|
|
890
|
+
* in CSS without JS-measuring pixel heights. Collapsed content stays in
|
|
891
|
+
* the DOM (so no layout jump on re-open) but is marked `inert` — removed
|
|
892
|
+
* from the tab order and the accessibility tree — so it isn't reachable
|
|
893
|
+
* while hidden.
|
|
894
|
+
*/
|
|
895
|
+
declare function Collapsible({ open, onOpenChange, trigger, children, id, className, }: CollapsibleProps): react.JSX.Element;
|
|
896
|
+
|
|
897
|
+
interface AccordionItem {
|
|
898
|
+
id: string;
|
|
899
|
+
trigger: ReactNode;
|
|
900
|
+
content: ReactNode;
|
|
901
|
+
}
|
|
902
|
+
interface AccordionProps {
|
|
903
|
+
items: AccordionItem[];
|
|
904
|
+
/** `single` closes other sections when one opens. `multiple` allows any
|
|
905
|
+
* number of sections open at once. */
|
|
906
|
+
type: 'single' | 'multiple';
|
|
907
|
+
openIds: string[];
|
|
908
|
+
onOpenIdsChange: (openIds: string[]) => void;
|
|
909
|
+
className?: string;
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* Accordion — one or more `Collapsible` sections.
|
|
913
|
+
*
|
|
914
|
+
* Keyboard support (Enter/Space toggles the focused trigger) comes from
|
|
915
|
+
* `Collapsible`'s real `<button>` — no arrow-key roving-tabindex handling
|
|
916
|
+
* here, since accordion sections aren't a roving-tabindex widget per the
|
|
917
|
+
* WAI-ARIA accordion pattern (each trigger is independently Tab-focusable).
|
|
918
|
+
*/
|
|
919
|
+
declare function Accordion({ items, type, openIds, onOpenIdsChange, className }: AccordionProps): react.JSX.Element;
|
|
920
|
+
|
|
921
|
+
interface AspectRatioProps {
|
|
922
|
+
/** Width / height, e.g. 16 / 9 or 1. */
|
|
923
|
+
ratio: number;
|
|
924
|
+
children: ReactNode;
|
|
925
|
+
className?: string;
|
|
926
|
+
}
|
|
927
|
+
/** AspectRatio — constrains content (image, video, embed) to a fixed ratio. */
|
|
928
|
+
declare function AspectRatio({ ratio, children, className }: AspectRatioProps): react.JSX.Element;
|
|
929
|
+
|
|
930
|
+
interface ButtonGroupProps {
|
|
931
|
+
/** Adjacent Button elements. */
|
|
932
|
+
children: ReactNode;
|
|
933
|
+
className?: string;
|
|
934
|
+
'aria-label'?: string;
|
|
935
|
+
}
|
|
936
|
+
/**
|
|
937
|
+
* ButtonGroup — visually joins adjacent `Button`s into one control (shared
|
|
938
|
+
* border, connected corners). Targets its children's rendered `<button>`/
|
|
939
|
+
* `<a>` elements directly rather than requiring a special child component,
|
|
940
|
+
* so it works with plain `Button`.
|
|
941
|
+
*/
|
|
942
|
+
declare function ButtonGroup({ children, className, 'aria-label': ariaLabel }: ButtonGroupProps): react.JSX.Element;
|
|
943
|
+
|
|
944
|
+
interface ItemProps {
|
|
945
|
+
leading?: ReactNode;
|
|
946
|
+
title: ReactNode;
|
|
947
|
+
description?: ReactNode;
|
|
948
|
+
trailing?: ReactNode;
|
|
949
|
+
/** Renders as a button when given; a plain row otherwise. */
|
|
950
|
+
onClick?: () => void;
|
|
951
|
+
disabled?: boolean;
|
|
952
|
+
className?: string;
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Item — generic row primitive: leading slot, title + optional description,
|
|
956
|
+
* trailing slot. The building block for settings rows, list rows, and
|
|
957
|
+
* menu-adjacent rows that don't fit `Menu`'s own item shape.
|
|
958
|
+
*/
|
|
959
|
+
declare function Item({ leading, title, description, trailing, onClick, disabled, className, }: ItemProps): react.JSX.Element;
|
|
960
|
+
|
|
961
|
+
interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
|
|
962
|
+
disabled?: boolean;
|
|
963
|
+
}
|
|
964
|
+
/**
|
|
965
|
+
* Label — standalone accessible form label, independent of `FormField`.
|
|
966
|
+
* Use `FormField` when a control needs hint/error text too; use `Label`
|
|
967
|
+
* directly for a bare label (e.g. next to a `Checkbox` group heading).
|
|
968
|
+
*/
|
|
969
|
+
declare function Label({ disabled, className, children, ...rest }: LabelProps): react.JSX.Element;
|
|
970
|
+
|
|
971
|
+
interface ScrollAreaProps {
|
|
972
|
+
children: ReactNode;
|
|
973
|
+
/** Constrains the scrollable direction; content taller/wider than this scrolls. */
|
|
974
|
+
maxHeight?: string | number;
|
|
975
|
+
maxWidth?: string | number;
|
|
976
|
+
className?: string;
|
|
977
|
+
}
|
|
978
|
+
/**
|
|
979
|
+
* ScrollArea — a styled scrollable container (thin, token-colored scrollbar
|
|
980
|
+
* instead of the OS default). Native overflow scrolling underneath — no
|
|
981
|
+
* virtualization, no custom scroll physics.
|
|
982
|
+
*/
|
|
983
|
+
declare function ScrollArea({ children, maxHeight, maxWidth, className }: ScrollAreaProps): react.JSX.Element;
|
|
984
|
+
|
|
985
|
+
type TypographyVariant = 'h1' | 'h2' | 'h3' | 'h4' | 'body' | 'caption' | 'label';
|
|
986
|
+
interface TypographyProps {
|
|
987
|
+
variant: TypographyVariant;
|
|
988
|
+
children: ReactNode;
|
|
989
|
+
/** Override the rendered tag while keeping the variant's visual style —
|
|
990
|
+
* e.g. `variant="h1" as="div"` to avoid a second `<h1>` on a page that
|
|
991
|
+
* already has one. */
|
|
992
|
+
as?: ElementType;
|
|
993
|
+
className?: string;
|
|
994
|
+
}
|
|
995
|
+
/** Typography — text bound to the design system's font-size/weight scale. */
|
|
996
|
+
declare function Typography({ variant, children, as, className }: TypographyProps): react.JSX.Element;
|
|
997
|
+
|
|
998
|
+
interface MarkerProps {
|
|
999
|
+
/** The number shown in the marker, e.g. 1, 2, 3. */
|
|
1000
|
+
index: number;
|
|
1001
|
+
/** Accessible label describing the citation, e.g. "Source: Notes". */
|
|
1002
|
+
label: string;
|
|
1003
|
+
/** Reveals source details (e.g. opens a source trace panel) when given. */
|
|
1004
|
+
onClick?: () => void;
|
|
1005
|
+
className?: string;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Marker — inline citation/reference marker, for attributing part of an
|
|
1009
|
+
* assistant's answer to a source (matches RFC 0040's "source trace" —
|
|
1010
|
+
* Harness shows which plugin/data source informed an answer).
|
|
1011
|
+
*/
|
|
1012
|
+
declare function Marker({ index, label, onClick, className }: MarkerProps): react.JSX.Element;
|
|
1013
|
+
|
|
1014
|
+
type MessageSender = 'user' | 'assistant' | 'tool';
|
|
1015
|
+
interface MessageProps {
|
|
1016
|
+
/** Matches the three roles Sovereign Harness stores per RFC 0040:
|
|
1017
|
+
* user, assistant, and tool messages. Named `sender`, not `role`, to
|
|
1018
|
+
* avoid colliding with the ARIA `role` attribute in JSX tooling. */
|
|
1019
|
+
sender: MessageSender;
|
|
1020
|
+
children?: ReactNode;
|
|
1021
|
+
/** Shows a "thinking" indicator instead of children — before the first
|
|
1022
|
+
* token of a streaming response arrives. Once content starts streaming
|
|
1023
|
+
* in, pass it as children and stop passing `pending`. */
|
|
1024
|
+
pending?: boolean;
|
|
1025
|
+
/** Rendered in a small row below the bubble — e.g. "Forget this" (RFC
|
|
1026
|
+
* 0040's per-message memory action), "Copy", "Regenerate". */
|
|
1027
|
+
actions?: ReactNode;
|
|
1028
|
+
className?: string;
|
|
1029
|
+
}
|
|
1030
|
+
/** Message — a single chat turn. Content is caller-controlled `ReactNode`
|
|
1031
|
+
* (markdown rendering, if any, is the consumer's choice, not baked in here). */
|
|
1032
|
+
declare function Message({ sender, children, pending, actions, className }: MessageProps): react.JSX.Element;
|
|
1033
|
+
|
|
1034
|
+
interface MessageScrollerProps {
|
|
1035
|
+
children: ReactNode;
|
|
1036
|
+
className?: string;
|
|
1037
|
+
}
|
|
1038
|
+
/**
|
|
1039
|
+
* MessageScroller — auto-scrolling chat container.
|
|
1040
|
+
*
|
|
1041
|
+
* Scrolls to the newest message automatically, but only while the user is
|
|
1042
|
+
* already near the bottom. If they've scrolled up to read history, new
|
|
1043
|
+
* content does not yank them back down — a "New messages" button appears
|
|
1044
|
+
* instead, matching the pattern every chat product (Slack, Discord,
|
|
1045
|
+
* ChatGPT) already uses.
|
|
1046
|
+
*/
|
|
1047
|
+
declare function MessageScroller({ children, className }: MessageScrollerProps): react.JSX.Element;
|
|
1048
|
+
|
|
1049
|
+
interface HoverCardProps {
|
|
1050
|
+
/** The element that opens the card — cloned with hover/focus handlers
|
|
1051
|
+
* (desktop) or a tap handler (touch). */
|
|
1052
|
+
trigger: ReactElement;
|
|
1053
|
+
children: ReactNode;
|
|
1054
|
+
align?: 'left' | 'right';
|
|
1055
|
+
width?: number | 'trigger';
|
|
1056
|
+
'aria-label': string;
|
|
1057
|
+
}
|
|
1058
|
+
/**
|
|
1059
|
+
* HoverCard — hover-triggered popover on desktop, tap-to-toggle on touch.
|
|
1060
|
+
*
|
|
1061
|
+
* Built on `Popover` rather than reimplementing positioning/collision
|
|
1062
|
+
* detection: this only adds the hover-intent open/close timing (avoids
|
|
1063
|
+
* flicker on an accidental mouse pass-over, and gives the pointer time to
|
|
1064
|
+
* travel from the trigger to the card itself across the gap between them)
|
|
1065
|
+
* and the touch fallback. Also opens on keyboard focus and closes on blur —
|
|
1066
|
+
* a hover-only trigger is a WCAG failure, since keyboard users can't hover.
|
|
1067
|
+
*/
|
|
1068
|
+
declare function HoverCard({ trigger, children, align, width, 'aria-label': ariaLabel, }: HoverCardProps): react.JSX.Element;
|
|
1069
|
+
|
|
1070
|
+
interface ContextMenuProps {
|
|
1071
|
+
/** The element that gets right-click (desktop) / long-press (touch)
|
|
1072
|
+
* behavior — cloned with the trigger handlers, rendered as-is otherwise.
|
|
1073
|
+
* Typed with `<any>` props (not a bare `ReactElement`, whose implicit
|
|
1074
|
+
* `unknown` props type makes `cloneElement` reject *both* branches of
|
|
1075
|
+
* the long-press/onContextMenu union below — an interface value like
|
|
1076
|
+
* `LongPressHandlers` isn't assignable to an indexed props type without
|
|
1077
|
+
* its own index signature) — the standard, narrowly-scoped escape hatch
|
|
1078
|
+
* for "clone an arbitrary child with props not known ahead of time". */
|
|
1079
|
+
children: ReactElement<any>;
|
|
1080
|
+
items: MenuEntry[];
|
|
1081
|
+
'aria-label': string;
|
|
1082
|
+
}
|
|
1083
|
+
/**
|
|
1084
|
+
* ContextMenu — right-click menu on desktop, long-press on touch.
|
|
1085
|
+
*
|
|
1086
|
+
* Desktop positioning reuses `Popover`'s existing collision-detection logic
|
|
1087
|
+
* rather than reimplementing it: the panel is wrapped in a zero-size,
|
|
1088
|
+
* `position: fixed` anchor placed at the click coordinates, so `Popover`
|
|
1089
|
+
* measures and flips against *that* point exactly as it would a normal
|
|
1090
|
+
* trigger element.
|
|
1091
|
+
*
|
|
1092
|
+
* Touch uses `useLongPress` (which already handles the OS's own long-press
|
|
1093
|
+
* callout/context-menu suppression) and opens the same items in a `Drawer`
|
|
1094
|
+
* bottom sheet — the same adaptive-surface split `Menu` already uses,
|
|
1095
|
+
* because a floating panel positioned at a touch point isn't a pattern
|
|
1096
|
+
* touch interfaces have in the first place.
|
|
1097
|
+
*/
|
|
1098
|
+
declare function ContextMenu({ children, items, 'aria-label': ariaLabel }: ContextMenuProps): react.JSX.Element;
|
|
1099
|
+
|
|
1100
|
+
interface NavigationMenuItem {
|
|
1101
|
+
label: string;
|
|
1102
|
+
/** A plain link with no flyout — mutually exclusive with `content`. */
|
|
1103
|
+
href?: string;
|
|
1104
|
+
/** Flyout panel content shown when this item is triggered. Pass a
|
|
1105
|
+
* function instead of a plain node when the content needs to close its
|
|
1106
|
+
* own flyout after an action (e.g. `Menubar`'s menu items) — it receives
|
|
1107
|
+
* a `close` callback. */
|
|
1108
|
+
content?: ReactNode | ((close: () => void) => ReactNode);
|
|
1109
|
+
}
|
|
1110
|
+
interface NavigationMenuProps {
|
|
1111
|
+
items: NavigationMenuItem[];
|
|
1112
|
+
/** Renders a plain-link item's anchor. Defaults to `<a href>`, which
|
|
1113
|
+
* causes a full page reload — pass Next's `<Link>` (or equivalent) to
|
|
1114
|
+
* keep navigation client-side. */
|
|
1115
|
+
renderLink?: (href: string, children: ReactNode) => ReactNode;
|
|
1116
|
+
'aria-label'?: string;
|
|
1117
|
+
}
|
|
1118
|
+
/**
|
|
1119
|
+
* NavigationMenu — top-level nav bar where some items open a flyout panel.
|
|
1120
|
+
*
|
|
1121
|
+
* Desktop-oriented by design — a hover-triggered flyout bar has no mobile
|
|
1122
|
+
* equivalent (Research 0004); it renders as-is on touch rather than
|
|
1123
|
+
* attempting a redesign no consumer has asked for yet.
|
|
1124
|
+
*
|
|
1125
|
+
* Each flyout is its own `Popover` instance rather than one shared
|
|
1126
|
+
* positioned panel, reusing its collision detection per item. Once one
|
|
1127
|
+
* flyout is open, moving the pointer to a sibling trigger switches directly
|
|
1128
|
+
* to that one — standard menu-bar behavior — and ArrowLeft/ArrowRight move
|
|
1129
|
+
* focus between top-level triggers (a roving-tabindex bar, per the
|
|
1130
|
+
* WAI-ARIA menu pattern), Escape closes.
|
|
1131
|
+
*/
|
|
1132
|
+
declare function NavigationMenu({ items, renderLink, 'aria-label': ariaLabel, }: NavigationMenuProps): react.JSX.Element;
|
|
1133
|
+
|
|
1134
|
+
interface MenubarMenu {
|
|
1135
|
+
label: string;
|
|
1136
|
+
items: MenuEntry[];
|
|
1137
|
+
}
|
|
1138
|
+
interface MenubarProps {
|
|
1139
|
+
menus: MenubarMenu[];
|
|
1140
|
+
'aria-label'?: string;
|
|
1141
|
+
}
|
|
1142
|
+
/**
|
|
1143
|
+
* Menubar — desktop app-style menu bar (File / Edit / View...). A thin
|
|
1144
|
+
* composition of `NavigationMenu` (top-level triggers, per-item flyout
|
|
1145
|
+
* positioning, hover-switches-when-one-is-open, arrow-key navigation) with
|
|
1146
|
+
* `MenuEntries` (the same item list markup `Menu`'s dropdowns use) as each
|
|
1147
|
+
* item's flyout content — no positioning or list-rendering logic
|
|
1148
|
+
* duplicated from either.
|
|
1149
|
+
*/
|
|
1150
|
+
declare function Menubar({ menus, 'aria-label': ariaLabel }: MenubarProps): react.JSX.Element;
|
|
1151
|
+
|
|
1152
|
+
interface CommandItem {
|
|
1153
|
+
id: string;
|
|
1154
|
+
label: string;
|
|
1155
|
+
onSelect: () => void;
|
|
1156
|
+
icon?: IconName;
|
|
1157
|
+
/** Section header this item is grouped under. */
|
|
1158
|
+
group?: string;
|
|
1159
|
+
/** Extra searchable text beyond the label (keywords, description). */
|
|
1160
|
+
keywords?: string;
|
|
1161
|
+
}
|
|
1162
|
+
interface CommandProps {
|
|
1163
|
+
open: boolean;
|
|
1164
|
+
onClose: () => void;
|
|
1165
|
+
items: CommandItem[];
|
|
1166
|
+
placeholder?: string;
|
|
1167
|
+
'aria-label'?: string;
|
|
1168
|
+
}
|
|
1169
|
+
/**
|
|
1170
|
+
* Command — a ⌘K-style palette. Opened via `Dialog`, which supplies the
|
|
1171
|
+
* modal shell (scrim, panel, mobile full-screen sheet, focus handling) —
|
|
1172
|
+
* this only adds the search input, filtering, and arrow-key/Enter
|
|
1173
|
+
* selection on top of it. Controlled (`open`/`onClose`): the consumer wires
|
|
1174
|
+
* up their own global shortcut listener to flip `open` — a DS primitive
|
|
1175
|
+
* shouldn't own a document-level keydown listener itself.
|
|
1176
|
+
*/
|
|
1177
|
+
declare function Command({ open, onClose, items, placeholder, 'aria-label': ariaLabel, }: CommandProps): react.JSX.Element;
|
|
1178
|
+
|
|
1179
|
+
type ResizableDirection = 'horizontal' | 'vertical';
|
|
1180
|
+
interface ResizablePanelProps {
|
|
1181
|
+
/** Initial size as a percentage of the group's main axis. Defaults to an
|
|
1182
|
+
* equal split across all panels in the group. */
|
|
1183
|
+
defaultSize?: number;
|
|
1184
|
+
/** Minimum size as a percentage. Defaults to 10. */
|
|
1185
|
+
minSize?: number;
|
|
1186
|
+
/** Maximum size as a percentage. Defaults to 90. */
|
|
1187
|
+
maxSize?: number;
|
|
1188
|
+
children?: ReactNode;
|
|
1189
|
+
className?: string;
|
|
1190
|
+
/** Injected by ResizablePanelGroup — not part of the public API. */
|
|
1191
|
+
style?: CSSProperties;
|
|
1192
|
+
}
|
|
1193
|
+
/** One pane of a ResizablePanelGroup. Sizing is computed and injected by the
|
|
1194
|
+
* group (via defaultSize/minSize/maxSize read off this element's props) —
|
|
1195
|
+
* this component only renders the scrollable content box. */
|
|
1196
|
+
declare function ResizablePanel({ children, className, style }: ResizablePanelProps): react.JSX.Element;
|
|
1197
|
+
interface ResizableHandleProps {
|
|
1198
|
+
'aria-label'?: string;
|
|
1199
|
+
/** Injected by ResizablePanelGroup — not part of the public API. */
|
|
1200
|
+
direction?: ResizableDirection;
|
|
1201
|
+
onPointerDown?: (e: PointerEvent<HTMLDivElement>) => void;
|
|
1202
|
+
onKeyDown?: (e: KeyboardEvent<HTMLDivElement>) => void;
|
|
1203
|
+
'aria-valuenow'?: number;
|
|
1204
|
+
'aria-valuemin'?: number;
|
|
1205
|
+
'aria-valuemax'?: number;
|
|
1206
|
+
}
|
|
1207
|
+
/** The draggable divider between two ResizablePanels. Placed directly
|
|
1208
|
+
* between the two ResizablePanel elements it resizes — the group pairs each
|
|
1209
|
+
* handle with its preceding and following panel by position.
|
|
1210
|
+
*
|
|
1211
|
+
* A `div` with `role="separator"` and `tabIndex=0` (the WAI-ARIA "window
|
|
1212
|
+
* splitter" pattern), not a `<button>` — `separator` is a non-interactive
|
|
1213
|
+
* role, and a native button's implicit role can't be overridden to it. */
|
|
1214
|
+
declare function ResizableHandle({ 'aria-label': ariaLabel, direction, onPointerDown, onKeyDown, 'aria-valuenow': valueNow, 'aria-valuemin': valueMin, 'aria-valuemax': valueMax, }: ResizableHandleProps): react.JSX.Element;
|
|
1215
|
+
interface ResizablePanelGroupProps {
|
|
1216
|
+
direction: ResizableDirection;
|
|
1217
|
+
/** Alternating ResizablePanel / ResizableHandle elements — N panels
|
|
1218
|
+
* separated by N-1 handles. */
|
|
1219
|
+
children: ReactNode;
|
|
1220
|
+
className?: string;
|
|
1221
|
+
}
|
|
1222
|
+
/**
|
|
1223
|
+
* ResizablePanelGroup — a row or column of resizable panes (editor layouts,
|
|
1224
|
+
* multi-pane inspectors). Each handle resizes only its two immediate
|
|
1225
|
+
* neighbor panels (drag redistributes size between them, clamped to both
|
|
1226
|
+
* panels' own min/max, so their combined size is a fixed invariant for the
|
|
1227
|
+
* duration of one drag) — the same handle-local model most resizable-panel
|
|
1228
|
+
* implementations use, rather than redistributing across the whole group.
|
|
1229
|
+
*
|
|
1230
|
+
* Desktop-oriented, like NavigationMenu — a drag handle has no direct touch
|
|
1231
|
+
* equivalent; panels render at their default sizes on touch rather than
|
|
1232
|
+
* attempting a redesign no consumer has asked for yet. For a two-pane
|
|
1233
|
+
* layout that also needs a mobile single-column fallback, use SplitPane
|
|
1234
|
+
* instead.
|
|
1235
|
+
*
|
|
1236
|
+
* `direction="vertical"` needs a definite-height ancestor — percentage
|
|
1237
|
+
* flex-basis on a column's children only resolves against one.
|
|
1238
|
+
*/
|
|
1239
|
+
declare function ResizablePanelGroup({ direction, children, className }: ResizablePanelGroupProps): react.JSX.Element;
|
|
1240
|
+
|
|
1241
|
+
type SortDirection = 'asc' | 'desc';
|
|
1242
|
+
interface DataTableColumn<T> {
|
|
1243
|
+
key: string;
|
|
1244
|
+
header: string;
|
|
1245
|
+
sortable?: boolean;
|
|
1246
|
+
/** Cell content. Defaults to String(row[key]) when omitted. */
|
|
1247
|
+
render?: (row: T) => ReactNode;
|
|
1248
|
+
/** Value compared when sorting by this column. Defaults to row[key].
|
|
1249
|
+
* Required if `key` isn't a property on T (a computed/joined column). */
|
|
1250
|
+
sortValue?: (row: T) => string | number;
|
|
1251
|
+
align?: 'start' | 'end';
|
|
1252
|
+
}
|
|
1253
|
+
interface DataTableProps<T> {
|
|
1254
|
+
columns: DataTableColumn<T>[];
|
|
1255
|
+
data: T[];
|
|
1256
|
+
getRowKey: (row: T) => string;
|
|
1257
|
+
/** Initial sort — uncontrolled after mount, like Table itself has no
|
|
1258
|
+
* externally-controlled state. */
|
|
1259
|
+
defaultSortKey?: string;
|
|
1260
|
+
defaultSortDirection?: SortDirection;
|
|
1261
|
+
emptyMessage?: string;
|
|
1262
|
+
className?: string;
|
|
1263
|
+
}
|
|
1264
|
+
/**
|
|
1265
|
+
* DataTable — sortable table built on Table's own primitives (no
|
|
1266
|
+
* virtualization or filtering — those stay out of scope, matching Table's
|
|
1267
|
+
* own "not a data grid" boundary). Column-driven: pass `columns` + `data`
|
|
1268
|
+
* rather than composing `<TableRow>`/`<TableCell>` by hand.
|
|
1269
|
+
*
|
|
1270
|
+
* Sort state is internal (uncontrolled) and click-cycles
|
|
1271
|
+
* ascending → descending → unsorted for a sortable column, mirroring the
|
|
1272
|
+
* "toggle → toggle → clear" pattern most sortable tables use rather than
|
|
1273
|
+
* being permanently stuck in whichever direction was clicked last.
|
|
1274
|
+
*/
|
|
1275
|
+
declare function DataTable<T>({ columns, data, getRowKey, defaultSortKey, defaultSortDirection, emptyMessage, className, }: DataTableProps<T>): react.JSX.Element;
|
|
1276
|
+
|
|
1277
|
+
interface ComboboxOption {
|
|
1278
|
+
value: string;
|
|
1279
|
+
label: string;
|
|
1280
|
+
}
|
|
1281
|
+
interface ComboboxProps {
|
|
1282
|
+
options: ComboboxOption[];
|
|
1283
|
+
value: string | null;
|
|
1284
|
+
onChange: (value: string) => void;
|
|
1285
|
+
placeholder?: string;
|
|
1286
|
+
searchPlaceholder?: string;
|
|
1287
|
+
emptyMessage?: string;
|
|
1288
|
+
'aria-label': string;
|
|
1289
|
+
disabled?: boolean;
|
|
1290
|
+
className?: string;
|
|
1291
|
+
}
|
|
1292
|
+
/**
|
|
1293
|
+
* Combobox — a searchable single-select: `Popover` on desktop, a bottom-sheet
|
|
1294
|
+
* `Drawer` on mobile (the platform's standard adaptive-surface pattern,
|
|
1295
|
+
* matching `Menu` and `DatePicker`). For a fixed, short option list where
|
|
1296
|
+
* search adds no value, use `Select`'s native `<select>` instead — this is
|
|
1297
|
+
* for option lists long enough that typing to filter beats scanning.
|
|
1298
|
+
*
|
|
1299
|
+
* The trigger is built in, like `DatePicker` — a combobox is a form field,
|
|
1300
|
+
* not an arbitrary action-menu trigger.
|
|
1301
|
+
*/
|
|
1302
|
+
declare function Combobox({ options, value, onChange, placeholder, searchPlaceholder, emptyMessage, 'aria-label': ariaLabel, disabled, className, }: ComboboxProps): react.JSX.Element;
|
|
1303
|
+
|
|
692
1304
|
interface DragHandleRowProps extends HTMLAttributes<HTMLDivElement> {
|
|
693
1305
|
children: ReactNode;
|
|
694
1306
|
/** Pass drag-listener and drag-control props from dnd-kit here. */
|
|
@@ -1127,4 +1739,4 @@ interface CommitOnEnterOrBlurHandlers {
|
|
|
1127
1739
|
*/
|
|
1128
1740
|
declare function useCommitOnEnterOrBlur(onCommit: () => void): CommitOnEnterOrBlurHandlers;
|
|
1129
1741
|
|
|
1130
|
-
export { Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeStatus, type BadgeVariant, BalanceChip, type BalanceChipProps, type BannerVariant, Button, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, CheckableListRow, type CheckableListRowProps, Checkbox, type CheckboxProps, CodeTextarea, type CodeTextareaProps, type CommitOnEnterOrBlurHandlers, ConfirmDialog, type ConfirmDialogProps, CurrencyInput, type CurrencyInputProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, type DialogSize, DragHandleRow, type DragHandleRowProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, FileDropzone, type FileDropzoneProps, FormField, type FormFieldProps, type FormFieldRenderProps, Icon, type IconName, IconPicker, type IconPickerProps, type IconProps, Input, type InputProps, type LongPressHandlers, MOBILE_BREAKPOINT_PX, MemberMultiSelect, type MemberMultiSelectOption, type MemberMultiSelectProps, Menu, type MenuEntry, type MenuItem, type MenuLabel, type MenuProps, type MenuSeparator, type NavTabItem, NavTabs, type NavTabsProps, OverlayHeader, type OverlayHeaderProps, PageHeader, type PageHeaderProps, Popover, type PopoverProps, QuantityStepper, type QuantityStepperProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, Sheet, type SheetProps, Spinner, type SpinnerProps, type SplitMethod, SplitMethodSelector, type SplitMethodSelectorProps, SplitPane, type SplitPaneProps, StatusBadge, type StatusBadgeProps, type StatusBadgeStatus, SuggestionInput, type SuggestionInputProps, type SuggestionOption, SystemBanner, type SystemBannerProps, type TabItem, Tabs, type TabsProps, TagInput, type TagInputProps, Textarea, type TextareaProps, type ToastContextValue, type ToastItem, ToastProvider, Toggle, type ToggleProps, Tooltip, type TooltipProps, type UseLongPressOptions, useCommitOnEnterOrBlur, useDoubleTapHandler, useIsMobile, useLongPress, useOverlaySecondRow, useSingleOrDoubleTap, useToast };
|
|
1742
|
+
export { Accordion, type AccordionItem, type AccordionProps, Alert, type AlertProps, type AlertVariant, AspectRatio, type AspectRatioProps, Avatar, type AvatarProps, Badge, type BadgeProps, type BadgeStatus, type BadgeVariant, BalanceChip, type BalanceChipProps, type BannerVariant, Breadcrumb, type BreadcrumbItem, type BreadcrumbProps, Button, ButtonGroup, type ButtonGroupProps, type ButtonProps, type ButtonSize, type ButtonVariant, Calendar, type CalendarProps, Card, type CardProps, CheckableListRow, type CheckableListRowProps, Checkbox, type CheckboxProps, CodeTextarea, type CodeTextareaProps, Collapsible, type CollapsibleProps, Combobox, type ComboboxOption, type ComboboxProps, Command, type CommandItem, type CommandProps, type CommitOnEnterOrBlurHandlers, ConfirmDialog, type ConfirmDialogProps, ContextMenu, type ContextMenuProps, CurrencyInput, type CurrencyInputProps, DataTable, type DataTableColumn, type DataTableProps, DatePicker, type DatePickerProps, Dialog, type DialogProps, type DialogSize, DragHandleRow, type DragHandleRowProps, Drawer, type DrawerProps, EmptyState, type EmptyStateProps, FileDropzone, type FileDropzoneProps, FormField, type FormFieldProps, type FormFieldRenderProps, HoverCard, type HoverCardProps, Icon, type IconName, IconPicker, type IconPickerProps, type IconProps, Input, type InputProps, Item, type ItemProps, Kbd, type KbdProps, Label, type LabelProps, type LongPressHandlers, MOBILE_BREAKPOINT_PX, Marker, type MarkerProps, MemberMultiSelect, type MemberMultiSelectOption, type MemberMultiSelectProps, Menu, MenuEntries, type MenuEntry, type MenuItem, type MenuLabel, type MenuProps, type MenuSeparator, Menubar, type MenubarMenu, type MenubarProps, Message, type MessageProps, MessageScroller, type MessageScrollerProps, type MessageSender, type NavTabItem, NavTabs, type NavTabsProps, NavigationMenu, type NavigationMenuItem, type NavigationMenuProps, OverlayHeader, type OverlayHeaderProps, PageHeader, type PageHeaderProps, Pagination, type PaginationProps, Popover, type PopoverProps, Progress, type ProgressProps, QuantityStepper, type QuantityStepperProps, RadioGroup, type RadioGroupItem, type RadioGroupProps, type ResizableDirection, ResizableHandle, type ResizableHandleProps, ResizablePanel, ResizablePanelGroup, type ResizablePanelGroupProps, type ResizablePanelProps, ScrollArea, type ScrollAreaProps, SegmentedControl, type SegmentedControlProps, type SegmentedOption, Select, type SelectProps, Sheet, type SheetProps, Slider, type SliderProps, type SortDirection, Spinner, type SpinnerProps, type SplitMethod, SplitMethodSelector, type SplitMethodSelectorProps, SplitPane, type SplitPaneProps, StatusBadge, type StatusBadgeProps, type StatusBadgeStatus, SuggestionInput, type SuggestionInputProps, type SuggestionOption, SystemBanner, type SystemBannerProps, type TabItem, Table, TableBody, TableCell, TableHead, TableHeaderCell, type TableProps, TableRow, Tabs, type TabsProps, TagInput, type TagInputProps, Textarea, type TextareaProps, type ToastContextValue, type ToastItem, ToastProvider, Toggle, type ToggleProps, Tooltip, type TooltipProps, Typography, type TypographyProps, type TypographyVariant, type UseLongPressOptions, useCommitOnEnterOrBlur, useDoubleTapHandler, useIsMobile, useLongPress, useOverlaySecondRow, useSingleOrDoubleTap, useToast };
|