canny-ui-react 6.6.2 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/components/Accordion/Accordion.d.ts +7 -0
- package/dist/components/Alert/Alert.types.d.ts +5 -0
- package/dist/components/Autocomplete/Autocomplete.types.d.ts +19 -1
- package/dist/components/Avatar/Avatar.d.ts +3 -1
- package/dist/components/Avatar/Avatar.types.d.ts +14 -0
- package/dist/components/Avatar/index.d.ts +2 -2
- package/dist/components/Breadcrumb/Breadcrumb.d.ts +6 -0
- package/dist/components/Button/Button.types.d.ts +16 -0
- package/dist/components/Button/IconButton.d.ts +11 -1
- package/dist/components/Charts/BarChart.d.ts +16 -2
- package/dist/components/Charts/ChartA11y.d.ts +3 -1
- package/dist/components/Charts/ChartParts.d.ts +19 -0
- package/dist/components/Charts/DonutChart.d.ts +15 -0
- package/dist/components/Charts/FunnelChart.d.ts +16 -0
- package/dist/components/Charts/GanttChart.d.ts +75 -0
- package/dist/components/Charts/GaugeChart.d.ts +25 -0
- package/dist/components/Charts/Heatmap.d.ts +37 -0
- package/dist/components/Charts/LineChart.d.ts +15 -1
- package/dist/components/Charts/PieChart.d.ts +25 -3
- package/dist/components/Charts/RadarChart.d.ts +25 -0
- package/dist/components/Charts/ScatterChart.d.ts +33 -0
- package/dist/components/Charts/Sparkline.d.ts +17 -0
- package/dist/components/Charts/StatCard.d.ts +23 -0
- package/dist/components/Charts/cartesian.d.ts +23 -0
- package/dist/components/Charts/chartExtra.d.ts +90 -0
- package/dist/components/Charts/chartScale.d.ts +94 -0
- package/dist/components/Charts/chartUtils.d.ts +6 -0
- package/dist/components/Charts/gantt/ganttUtils.d.ts +54 -0
- package/dist/components/Charts/index.d.ts +18 -0
- package/dist/components/Chip/Chip.d.ts +4 -1
- package/dist/components/CommandPalette/CommandPalette.d.ts +1 -1
- package/dist/components/CommandPalette/CommandPalette.types.d.ts +18 -1
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +6 -1
- package/dist/components/ContextMenu/ContextMenu.d.ts +7 -2
- package/dist/components/DataTable/DataTable.d.ts +55 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +10 -0
- package/dist/components/DatePicker/dateUtils.d.ts +2 -0
- package/dist/components/DatePicker/index.d.ts +1 -1
- package/dist/components/Dialog/Dialog.d.ts +6 -0
- package/dist/components/Drawer/Drawer.d.ts +8 -0
- package/dist/components/FileUploader/FileUploader.d.ts +24 -0
- package/dist/components/FileUploader/index.d.ts +1 -1
- package/dist/components/FileUploader/useFileDrop.d.ts +1 -0
- package/dist/components/Input/Input.types.d.ts +2 -0
- package/dist/components/List/List.d.ts +17 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +10 -2
- package/dist/components/Navbar/Navbar.types.d.ts +12 -0
- package/dist/components/Pagination/Pagination.d.ts +34 -0
- package/dist/components/PanelGroup/PanelGroup.d.ts +1 -1
- package/dist/components/Popover/Popover.d.ts +11 -2
- package/dist/components/Progress/Progress.types.d.ts +5 -0
- package/dist/components/Scroll/Scroll.types.d.ts +0 -4
- package/dist/components/Scroll/index.d.ts +1 -1
- package/dist/components/Scroll/useScrollFocusable.d.ts +10 -0
- package/dist/components/Select/Select.d.ts +7 -1
- package/dist/components/Sidebar/Sidebar.types.d.ts +10 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +3 -1
- package/dist/components/Skeleton/SkeletonLayouts.d.ts +5 -0
- package/dist/components/Skeleton/index.d.ts +1 -0
- package/dist/components/Slider/Slider.d.ts +2 -0
- package/dist/components/Stepper/Stepper.d.ts +5 -1
- package/dist/components/Tabs/Tabs.d.ts +7 -0
- package/dist/components/Textarea/Textarea.d.ts +2 -0
- package/dist/components/Timeline/Timeline.d.ts +9 -0
- package/dist/components/Toast/Toast.d.ts +1 -5
- package/dist/components/Toast/Toast.types.d.ts +13 -3
- package/dist/components/Tooltip/Tooltip.d.ts +3 -11
- package/dist/components/TreeView/TreeView.d.ts +34 -0
- package/dist/index.cjs +80 -55
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +16459 -12433
- package/dist/index.js.map +1 -1
- package/dist/utils/overlayFocus.d.ts +13 -0
- package/dist/utils/useCloseGuard.d.ts +17 -0
- package/dist/utils/useVirtualWindow.d.ts +29 -0
- package/package.json +3 -3
|
@@ -31,6 +31,12 @@ export interface MultiSelectProps {
|
|
|
31
31
|
emptyText?: string;
|
|
32
32
|
/** Cap on how many can be selected. */
|
|
33
33
|
maxItems?: number;
|
|
34
|
+
/** Show a clear-all (×) button in the trigger while anything is selected. */
|
|
35
|
+
clearable?: boolean;
|
|
36
|
+
/** Show at most this many chips; the rest collapse into a "+N" chip. */
|
|
37
|
+
maxVisibleChips?: number;
|
|
38
|
+
/** Show a "Select all / Clear" row above the options. Respects `maxItems` and disabled options. */
|
|
39
|
+
showSelectAll?: boolean;
|
|
34
40
|
/** Size of the trigger. */
|
|
35
41
|
size?: MultiSelectSize;
|
|
36
42
|
/** Validation color. */
|
|
@@ -42,8 +48,10 @@ export interface MultiSelectProps {
|
|
|
42
48
|
/** aria-invalid / aria-describedby threaded in from Field. */
|
|
43
49
|
'aria-invalid'?: boolean;
|
|
44
50
|
'aria-describedby'?: string;
|
|
45
|
-
/** aria-label for the combobox
|
|
51
|
+
/** aria-label for the combobox. Falls back to the placeholder when no label is associated. */
|
|
46
52
|
'aria-label'?: string;
|
|
53
|
+
/** Id of the element that labels the combobox (Field threads this in). */
|
|
54
|
+
'aria-labelledby'?: string;
|
|
47
55
|
/** Extra class on the trigger. */
|
|
48
56
|
className?: string;
|
|
49
57
|
/** Inline style applied to the trigger (the inline field). */
|
|
@@ -61,4 +69,4 @@ export interface MultiSelectProps {
|
|
|
61
69
|
* the selected values. Built on @radix-ui/react-popover (positioning +
|
|
62
70
|
* focus management) and cmdk (search + filtering).
|
|
63
71
|
*/
|
|
64
|
-
export declare function MultiSelect({ options, value, defaultValue, onValueChange, placeholder, searchPlaceholder, emptyText, maxItems, size, color, disabled, id, className, style, sx, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
export declare function MultiSelect({ options, value, defaultValue, onValueChange, placeholder, searchPlaceholder, emptyText, maxItems, clearable, maxVisibleChips, showSelectAll, size, color, disabled, id, className, style, sx, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, }: MultiSelectProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,6 +2,10 @@ import type { AnchorHTMLAttributes, ButtonHTMLAttributes, HTMLAttributes, ReactN
|
|
|
2
2
|
import type { SxProp } from '../Layout/sx';
|
|
3
3
|
export interface NavbarProps extends HTMLAttributes<HTMLElement> {
|
|
4
4
|
solid?: boolean;
|
|
5
|
+
/** Renders a "skip to content" link (visible on keyboard focus) pointing at this selector, e.g. `#main`. */
|
|
6
|
+
skipLinkTarget?: string;
|
|
7
|
+
/** Text of the skip link. Default: `Skip to content`. */
|
|
8
|
+
skipLinkLabel?: string;
|
|
5
9
|
/**
|
|
6
10
|
* Background (solid, no glass, when raised). `'base'` (default) sits on the page tone; `'raised'` uses the
|
|
7
11
|
* surface of drawers, dialogs and menus (white in light mode).
|
|
@@ -20,6 +24,14 @@ export interface NavbarBrandProps extends AnchorHTMLAttributes<HTMLAnchorElement
|
|
|
20
24
|
children: ReactNode;
|
|
21
25
|
}
|
|
22
26
|
export interface NavbarNavProps extends HTMLAttributes<HTMLElement> {
|
|
27
|
+
/**
|
|
28
|
+
* Below 640px the items collapse into a menu opened by a built-in button
|
|
29
|
+
* (`aria-expanded`/`aria-controls`; Esc closes and returns focus; choosing a link closes it).
|
|
30
|
+
* Pass `false` to opt out and hide the nav at that width instead. Default `true`.
|
|
31
|
+
*/
|
|
32
|
+
mobileMenu?: boolean;
|
|
33
|
+
/** Noun used in the menu button's label ("Open navigation menu"). Default `navigation menu`. */
|
|
34
|
+
menuLabel?: string;
|
|
23
35
|
children: ReactNode;
|
|
24
36
|
}
|
|
25
37
|
export interface NavbarItemProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
@@ -14,6 +14,26 @@ export interface PaginationProps {
|
|
|
14
14
|
/** Hide the prev/next chevrons. */
|
|
15
15
|
hideControls?: boolean;
|
|
16
16
|
size?: 'sm' | 'md' | 'lg';
|
|
17
|
+
/** Show a "Go to page" number input (Enter to jump). */
|
|
18
|
+
showPageInput?: boolean;
|
|
19
|
+
/** Current rows per page — shows the page-size picker when `onPageSizeChange` is also set. */
|
|
20
|
+
pageSize?: number;
|
|
21
|
+
/** Choices for the page-size picker. Default `[10, 25, 50, 100]`. */
|
|
22
|
+
pageSizeOptions?: number[];
|
|
23
|
+
/** Fires with the new rows-per-page. */
|
|
24
|
+
onPageSizeChange?: (pageSize: number) => void;
|
|
25
|
+
/**
|
|
26
|
+
* Compact layout: prev / "Page 3 of 12" / next instead of numbered buttons.
|
|
27
|
+
* `'auto'` (default) switches to it at 480px wide and below.
|
|
28
|
+
*/
|
|
29
|
+
compact?: boolean | 'auto';
|
|
30
|
+
/** Show First / Last page buttons beside Previous / Next. Hidden in the compact layout. */
|
|
31
|
+
showFirstLast?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* Total row count. With `pageSize`, renders the range text "1–10 of 243"
|
|
34
|
+
* (localized numbers) ahead of the controls.
|
|
35
|
+
*/
|
|
36
|
+
totalCount?: number;
|
|
17
37
|
className?: string;
|
|
18
38
|
style?: CSSProperties;
|
|
19
39
|
/**
|
|
@@ -24,8 +44,22 @@ export interface PaginationProps {
|
|
|
24
44
|
sx?: SxProp;
|
|
25
45
|
'aria-label'?: string;
|
|
26
46
|
}
|
|
47
|
+
type Item = {
|
|
48
|
+
type: 'page';
|
|
49
|
+
page: number;
|
|
50
|
+
} | {
|
|
51
|
+
type: 'ellipsis';
|
|
52
|
+
key: string;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Constant-width page list: `1 … 4 5 [6] 7 8 … 25`. The slot count stays the
|
|
56
|
+
* same near either end, so the controls do not jump while paging.
|
|
57
|
+
* @internal exported for tests
|
|
58
|
+
*/
|
|
59
|
+
export declare function buildPageItems(page: number, pageCount: number, siblingCount?: number): Item[];
|
|
27
60
|
/**
|
|
28
61
|
* Pagination — page-number nav with prev/next chevrons. Server-driven:
|
|
29
62
|
* pass `page`, `pageCount`, and `onPageChange`.
|
|
30
63
|
*/
|
|
31
64
|
export declare const Pagination: import("react").ForwardRefExoticComponent<PaginationProps & import("react").RefAttributes<HTMLElement>>;
|
|
65
|
+
export {};
|
|
@@ -25,7 +25,7 @@ interface HandleInternal {
|
|
|
25
25
|
valueMin: number;
|
|
26
26
|
valueMax: number;
|
|
27
27
|
onResizeStart: (e: PointerEvent<HTMLDivElement>) => void;
|
|
28
|
-
onKeyResize: (dir: 1 | -1) => void;
|
|
28
|
+
onKeyResize: (dir: 1 | -1, toEdge?: boolean) => void;
|
|
29
29
|
}
|
|
30
30
|
export interface PanelResizeHandleProps extends HTMLAttributes<HTMLDivElement> {
|
|
31
31
|
disabled?: boolean;
|
|
@@ -13,10 +13,17 @@ import type { SxProp } from '../Layout/sx';
|
|
|
13
13
|
* </PopoverContent>
|
|
14
14
|
* </Popover>
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
16
|
+
export interface PopoverProps extends OpenStateProps {
|
|
17
|
+
/** Open on pointer hover (mouse only) and on keyboard focus, in addition to click. Default: false. */
|
|
18
|
+
openOnHover?: boolean;
|
|
19
|
+
/** Hover delay in ms before opening when `openOnHover`. Keyboard focus opens instantly. Default: 300. */
|
|
20
|
+
openDelay?: number;
|
|
21
|
+
/** Hover delay in ms before closing when `openOnHover`. Default: 150. */
|
|
22
|
+
closeDelay?: number;
|
|
23
|
+
}
|
|
17
24
|
export declare const Popover: FC<PopoverProps>;
|
|
18
25
|
export type PopoverTriggerProps = TriggerProps;
|
|
19
|
-
export declare const PopoverTrigger:
|
|
26
|
+
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<import("react").ButtonHTMLAttributes<HTMLButtonElement> & AsChildProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
20
27
|
export type PopoverAnchorProps = HTMLAttributes<HTMLDivElement> & AsChildProps;
|
|
21
28
|
export declare const PopoverAnchor: FC<PopoverAnchorProps>;
|
|
22
29
|
export type PopoverCloseProps = TriggerProps;
|
|
@@ -33,6 +40,8 @@ export interface PopoverContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
33
40
|
align?: 'start' | 'center' | 'end';
|
|
34
41
|
/** Offset in px from the aligned edge. */
|
|
35
42
|
alignOffset?: number;
|
|
43
|
+
/** Fires when focus moves into the popover on open; call `preventDefault()` to keep focus on the trigger. */
|
|
44
|
+
onOpenAutoFocus?: (event: Event) => void;
|
|
36
45
|
/**
|
|
37
46
|
* One-off CSS for the popover content panel, same as `Box`'s `sx`: each value
|
|
38
47
|
* may be a scalar or a responsive breakpoint map (`{ base, sm, md, lg, xl }`).
|
|
@@ -5,6 +5,11 @@ export interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'chi
|
|
|
5
5
|
value?: number;
|
|
6
6
|
color?: ProgressColor;
|
|
7
7
|
indeterminate?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* With `indeterminate`: a full-width shimmer sweep instead of the sliding
|
|
10
|
+
* chunk. Under `prefers-reduced-motion` both settle into a static, faded bar.
|
|
11
|
+
*/
|
|
12
|
+
shimmer?: boolean;
|
|
8
13
|
/**
|
|
9
14
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
10
15
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { SxProp } from '../Layout/sx';
|
|
3
|
-
export type ScrollVariant = 'default' | 'thin' | 'subtle' | 'overlay' | 'expand';
|
|
4
|
-
export type ScrollTone = 'neutral' | 'primary';
|
|
5
3
|
export type ScrollAxis = 'both' | 'x' | 'y';
|
|
6
4
|
export interface ScrollProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
-
variant?: ScrollVariant;
|
|
8
|
-
tone?: ScrollTone;
|
|
9
5
|
axis?: ScrollAxis;
|
|
10
6
|
maxHeight?: number | string;
|
|
11
7
|
maxWidth?: number | string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { Scroll, ScrollRegion } from './Scroll';
|
|
2
|
-
export type { ScrollProps,
|
|
2
|
+
export type { ScrollProps, ScrollAxis } from './Scroll.types';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tracks whether a scroll container actually overflows, so it can be made a
|
|
3
|
+
* keyboard tab stop only when there is something to scroll (axe:
|
|
4
|
+
* scrollable-region-focusable). Re-measured on resize and on child changes.
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
export declare function useScrollFocusable<T extends HTMLElement>(enabled?: boolean): {
|
|
8
|
+
ref: (n: T | null) => void;
|
|
9
|
+
overflowing: boolean;
|
|
10
|
+
};
|
|
@@ -22,6 +22,8 @@ export interface SelectProps extends SelectRootProps {
|
|
|
22
22
|
size?: SelectSize;
|
|
23
23
|
/** Validation color on the trigger. */
|
|
24
24
|
color?: SelectColor;
|
|
25
|
+
/** Show a clear (×) button while a value is selected. Clearing resets to the placeholder (`onValueChange('')`). */
|
|
26
|
+
clearable?: boolean;
|
|
25
27
|
/** Pre-label rendered next to the selected value (e.g. an icon). */
|
|
26
28
|
triggerIcon?: ReactNode;
|
|
27
29
|
/** Extra trigger className. */
|
|
@@ -34,6 +36,10 @@ export interface SelectProps extends SelectRootProps {
|
|
|
34
36
|
'aria-invalid'?: boolean;
|
|
35
37
|
/** aria-describedby — Field threads this in. */
|
|
36
38
|
'aria-describedby'?: string;
|
|
39
|
+
/** Accessible name for the trigger. Falls back to the placeholder when no label is associated. */
|
|
40
|
+
'aria-label'?: string;
|
|
41
|
+
/** Id of the element that labels the trigger (Field threads this in). */
|
|
42
|
+
'aria-labelledby'?: string;
|
|
37
43
|
/** Apply .danger/.warning/.success via Field's className thread. */
|
|
38
44
|
className?: string;
|
|
39
45
|
/**
|
|
@@ -58,7 +64,7 @@ export interface SelectProps extends SelectRootProps {
|
|
|
58
64
|
* <SelectItem value="staging">Staging</SelectItem>
|
|
59
65
|
* </Select>
|
|
60
66
|
*/
|
|
61
|
-
export declare function Select({ placeholder, size, color, triggerIcon, triggerClassName, contentClassName, id, className, style, sx, disabled, children, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, ...rootProps }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
export declare function Select({ placeholder, size, color, clearable, triggerIcon, triggerClassName, contentClassName, id, className, style, sx, disabled, children, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, 'aria-label': ariaLabel, 'aria-labelledby': ariaLabelledBy, ...rootProps }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
62
68
|
export interface SelectItemProps extends ComponentPropsWithoutRef<'div'> {
|
|
63
69
|
/** The value submitted when this item is selected. */
|
|
64
70
|
value: string;
|
|
@@ -5,6 +5,14 @@ export interface SidebarProps extends HTMLAttributes<HTMLElement> {
|
|
|
5
5
|
width?: SidebarWidth;
|
|
6
6
|
sticky?: boolean;
|
|
7
7
|
collapsed?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* Remember `collapsed` in localStorage under this key. The saved value is restored on
|
|
10
|
+
* mount (shown immediately and reported via `onCollapsedChange`) and updated whenever
|
|
11
|
+
* the `collapsed` prop changes.
|
|
12
|
+
*/
|
|
13
|
+
persistKey?: string;
|
|
14
|
+
/** Called with the restored value when `persistKey` finds a saved state that differs from `collapsed`. */
|
|
15
|
+
onCollapsedChange?: (collapsed: boolean) => void;
|
|
8
16
|
responsive?: boolean;
|
|
9
17
|
/**
|
|
10
18
|
* With `responsive`: below 900px the sidebar slides in from the left as a drawer
|
|
@@ -49,5 +57,7 @@ export interface SidebarItemProps extends AnchorHTMLAttributes<HTMLAnchorElement
|
|
|
49
57
|
disabled?: boolean;
|
|
50
58
|
icon?: ReactNode;
|
|
51
59
|
badge?: ReactNode;
|
|
60
|
+
/** Tooltip shown on the icon when the sidebar is collapsed. Defaults to the label when it is a string. */
|
|
61
|
+
tooltip?: ReactNode;
|
|
52
62
|
children: ReactNode;
|
|
53
63
|
}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import type { HTMLAttributes } from 'react';
|
|
2
2
|
import type { SxProp } from '../Layout/sx';
|
|
3
|
-
export type SkeletonShape = 'text' | 'title' | 'avatar' | 'button';
|
|
3
|
+
export type SkeletonShape = 'text' | 'title' | 'avatar' | 'button' | 'circle' | 'rect';
|
|
4
4
|
export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
5
5
|
shape?: SkeletonShape;
|
|
6
6
|
width?: number | string;
|
|
7
7
|
height?: number | string;
|
|
8
|
+
/** `shape="text"` only: render a paragraph of this many lines (last one shorter). */
|
|
9
|
+
lines?: number;
|
|
8
10
|
/**
|
|
9
11
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
10
12
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
/** Placeholder shaped like a media card: image, title, two lines of text. */
|
|
3
|
+
export declare const SkeletonCard: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
4
|
+
/** Placeholder shaped like a `ListItem`: avatar plus primary and secondary lines. */
|
|
5
|
+
export declare const SkeletonListItem: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLDivElement> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -29,6 +29,8 @@ export interface SliderProps extends Omit<ComponentPropsWithoutRef<'span'>, 'def
|
|
|
29
29
|
color?: 'primary' | 'success' | 'warning' | 'danger';
|
|
30
30
|
/** Show inline value bubble above the active thumb on hover/focus. */
|
|
31
31
|
showValue?: boolean;
|
|
32
|
+
/** Show a value tooltip above the thumb while dragging (or keyboard-focused). */
|
|
33
|
+
showValueTooltip?: boolean;
|
|
32
34
|
/** Format value for the bubble. Default: `String(v)`. */
|
|
33
35
|
formatValue?: (v: number) => ReactNode;
|
|
34
36
|
/**
|
|
@@ -4,6 +4,8 @@ export interface StepperStep {
|
|
|
4
4
|
label: ReactNode;
|
|
5
5
|
description?: ReactNode;
|
|
6
6
|
icon?: ReactNode;
|
|
7
|
+
/** Mark this step as failed (red marker, `aria-invalid`). Wins over complete/active styling. */
|
|
8
|
+
error?: boolean;
|
|
7
9
|
}
|
|
8
10
|
export interface StepperProps extends Omit<HTMLAttributes<HTMLOListElement>, 'children'> {
|
|
9
11
|
steps: StepperStep[];
|
|
@@ -11,8 +13,10 @@ export interface StepperProps extends Omit<HTMLAttributes<HTMLOListElement>, 'ch
|
|
|
11
13
|
active: number;
|
|
12
14
|
orientation?: 'horizontal' | 'vertical';
|
|
13
15
|
size?: 'sm' | 'md';
|
|
14
|
-
/** Fired when a
|
|
16
|
+
/** Fired when a clickable step is clicked. By default only completed steps are clickable. */
|
|
15
17
|
onStepClick?: (index: number) => void;
|
|
18
|
+
/** Let every step (including upcoming ones) fire `onStepClick`. Default: false. */
|
|
19
|
+
clickable?: boolean;
|
|
16
20
|
/**
|
|
17
21
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
18
22
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|
|
@@ -35,6 +35,13 @@ export interface TabsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'dir'>
|
|
|
35
35
|
variant?: TabsVariant;
|
|
36
36
|
/** Size preset. Default: `md`. */
|
|
37
37
|
size?: TabsSize;
|
|
38
|
+
/** Slide an animated indicator between tabs instead of snapping the active style. Respects reduced motion. */
|
|
39
|
+
indicator?: boolean;
|
|
40
|
+
/**
|
|
41
|
+
* How a horizontal list handles overflow. `wrap` (default) wraps onto more rows;
|
|
42
|
+
* `scroll` keeps one row that scrolls sideways with edge fades and arrow buttons.
|
|
43
|
+
*/
|
|
44
|
+
overflow?: 'wrap' | 'scroll';
|
|
38
45
|
/**
|
|
39
46
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
40
47
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|
|
@@ -9,6 +9,8 @@ export interface TextareaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaE
|
|
|
9
9
|
autoGrow?: boolean;
|
|
10
10
|
/** With autoGrow, limits how tall the textarea can get. Default 12. */
|
|
11
11
|
maxRows?: number;
|
|
12
|
+
/** Show a live character counter below the textarea (`n/max` when `maxLength` is set). */
|
|
13
|
+
showCount?: boolean;
|
|
12
14
|
/**
|
|
13
15
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
14
16
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|
|
@@ -14,6 +14,15 @@ export interface TimelineProps extends HTMLAttributes<HTMLOListElement> {
|
|
|
14
14
|
orientation?: TimelineOrientation;
|
|
15
15
|
/** Density preset. Default `'md'`. */
|
|
16
16
|
size?: TimelineSize;
|
|
17
|
+
/**
|
|
18
|
+
* Make the entries keyboard-navigable: one Tab stop, then Up/Down (Left/Right
|
|
19
|
+
* when horizontal) and Home/End move between items.
|
|
20
|
+
*/
|
|
21
|
+
navigable?: boolean;
|
|
22
|
+
/** Replace the items with skeleton entries and mark the timeline `aria-busy`. */
|
|
23
|
+
loading?: boolean;
|
|
24
|
+
/** Shown in place of the items when there are none (and not `loading`). */
|
|
25
|
+
empty?: ReactNode;
|
|
17
26
|
/**
|
|
18
27
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
19
28
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import type { ToastApi, ToastProviderProps } from './Toast.types';
|
|
2
|
-
|
|
3
|
-
* Wrap your app to enable `useToast()`. Renders a portaled viewport at the
|
|
4
|
-
* chosen `position`. Multiple providers will simply create separate viewports.
|
|
5
|
-
*/
|
|
6
|
-
export declare function ToastProvider({ children, position, defaultDuration, maxToasts, offset, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function ToastProvider({ children, position, defaultDuration, maxToasts, limit, offset, }: ToastProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
7
3
|
/**
|
|
8
4
|
* Imperative toast API. Must be called inside a `<ToastProvider>` tree.
|
|
9
5
|
*
|
|
@@ -2,13 +2,21 @@ import type { ReactNode } from 'react';
|
|
|
2
2
|
import type { SxProp } from '../Layout/sx';
|
|
3
3
|
export type ToastVariant = 'default' | 'success' | 'info' | 'warning' | 'danger' | 'loading';
|
|
4
4
|
export type ToastPosition = 'top-left' | 'top-center' | 'top-right' | 'bottom-left' | 'bottom-center' | 'bottom-right';
|
|
5
|
+
/** Declarative action (e.g. Undo). Clicking runs `onClick`, then dismisses the toast. */
|
|
6
|
+
export interface ToastActionConfig {
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
onClick: () => void;
|
|
9
|
+
}
|
|
5
10
|
export interface ToastOptions {
|
|
6
11
|
/** Visible title. Required unless `description` is supplied. */
|
|
7
12
|
title?: ReactNode;
|
|
8
13
|
/** Optional secondary line under the title. */
|
|
9
14
|
description?: ReactNode;
|
|
10
|
-
/**
|
|
11
|
-
|
|
15
|
+
/**
|
|
16
|
+
* Right-side action. A node (typically a Button), or `{ label, onClick }` for
|
|
17
|
+
* a ready-made action such as Undo that also dismisses the toast.
|
|
18
|
+
*/
|
|
19
|
+
action?: ReactNode | ToastActionConfig;
|
|
12
20
|
/** Override the default icon. Pass `false` to hide the icon. */
|
|
13
21
|
icon?: ReactNode | false;
|
|
14
22
|
/** Variant — drives color, icon, and ARIA role. */
|
|
@@ -32,7 +40,7 @@ export interface ToastInstance extends Required<Pick<ToastOptions, 'variant' | '
|
|
|
32
40
|
id: string;
|
|
33
41
|
title?: ReactNode;
|
|
34
42
|
description?: ReactNode;
|
|
35
|
-
action?: ReactNode;
|
|
43
|
+
action?: ReactNode | ToastActionConfig;
|
|
36
44
|
icon?: ReactNode | false;
|
|
37
45
|
onDismiss?: () => void;
|
|
38
46
|
sx?: SxProp;
|
|
@@ -60,6 +68,8 @@ export interface ToastProviderProps {
|
|
|
60
68
|
defaultDuration?: number;
|
|
61
69
|
/** Max number of toasts visible at once; older ones drop off. Default 5. */
|
|
62
70
|
maxToasts?: number;
|
|
71
|
+
/** Stack cap — alias of `maxToasts`; wins when both are set. */
|
|
72
|
+
limit?: number;
|
|
63
73
|
/** Distance from the viewport edges. Default `1rem`. */
|
|
64
74
|
offset?: string;
|
|
65
75
|
}
|
|
@@ -2,18 +2,8 @@ import type { FC, ReactNode } from 'react';
|
|
|
2
2
|
import type { OpenStateProps, PopperContentProps, TriggerProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { CSSProperties } from 'react';
|
|
4
4
|
import type { SxProp } from '../Layout/sx';
|
|
5
|
-
/**
|
|
6
|
-
* Tooltip provider — wrap your app once. Controls the global delay so the
|
|
7
|
-
* first tooltip in a group has a longer delay, then subsequent tooltips
|
|
8
|
-
* appear instantly.
|
|
9
|
-
*
|
|
10
|
-
* @example
|
|
11
|
-
* <TooltipProvider delayDuration={500}>
|
|
12
|
-
* <App />
|
|
13
|
-
* </TooltipProvider>
|
|
14
|
-
*/
|
|
15
5
|
export interface TooltipProviderProps {
|
|
16
|
-
/** Delay before the first tooltip in a group opens, in ms. Default:
|
|
6
|
+
/** Delay before the first tooltip in a group opens on hover, in ms. Keyboard focus opens instantly. Default: 300. */
|
|
17
7
|
delayDuration?: number;
|
|
18
8
|
/** Window in which subsequent tooltips open instantly, in ms. Default: 300. */
|
|
19
9
|
skipDelayDuration?: number;
|
|
@@ -37,6 +27,8 @@ export interface TooltipProps {
|
|
|
37
27
|
delayDuration?: number;
|
|
38
28
|
/** Controlled open state. Mostly for testing. */
|
|
39
29
|
open?: boolean;
|
|
30
|
+
/** Show on touch long-press (hover never fires on touch). Default: true. */
|
|
31
|
+
longPress?: boolean;
|
|
40
32
|
/** Disable the tooltip but keep the trigger interactive. */
|
|
41
33
|
disabled?: boolean;
|
|
42
34
|
/** Extra className on the popup. */
|
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
import type { SxProp } from '../Layout/sx';
|
|
3
|
+
/** Internal: per-item position info injected by the tree into its TreeItem children. */
|
|
4
|
+
interface TreeMeta {
|
|
5
|
+
level: number;
|
|
6
|
+
size: number;
|
|
7
|
+
pos: number;
|
|
8
|
+
/** Windowed mode only. */
|
|
9
|
+
flat?: boolean;
|
|
10
|
+
hasChildren?: boolean;
|
|
11
|
+
expanded?: boolean;
|
|
12
|
+
parentId?: string | null;
|
|
13
|
+
}
|
|
3
14
|
export interface TreeViewProps extends Omit<HTMLAttributes<HTMLUListElement>, 'onSelect'> {
|
|
4
15
|
/** Controlled set of expanded item ids. */
|
|
5
16
|
expandedIds?: string[];
|
|
@@ -17,6 +28,26 @@ export interface TreeViewProps extends Omit<HTMLAttributes<HTMLUListElement>, 'o
|
|
|
17
28
|
onItemExpandToggle?: (id: string, expanded: boolean) => void;
|
|
18
29
|
/** Auto folder/file icons for items without their own icon. Default `true`. */
|
|
19
30
|
defaultIcons?: boolean;
|
|
31
|
+
/** Show "Expand all" / "Collapse all" buttons above the tree. */
|
|
32
|
+
expandControls?: boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Remember the expanded ids in `localStorage` under this key (uncontrolled
|
|
35
|
+
* trees only). Restored after mount.
|
|
36
|
+
*/
|
|
37
|
+
persistKey?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Windowing: only the visible nodes inside (and just around) the scrollport are in the
|
|
40
|
+
* DOM. `'auto'` (default) turns it on above 200 visible nodes when the tree sits in a
|
|
41
|
+
* height-bounded scroll container (give the tree, or a parent, a `height` and
|
|
42
|
+
* `overflow: auto`). Needs `TreeItem` children (as `RichTreeView` renders). `false` disables it.
|
|
43
|
+
*/
|
|
44
|
+
virtualize?: boolean | 'auto';
|
|
45
|
+
/** Row height in px when windowed. Default 30. */
|
|
46
|
+
itemHeight?: number;
|
|
47
|
+
/** Replace the items with skeleton rows and mark the tree `aria-busy`. */
|
|
48
|
+
loading?: boolean;
|
|
49
|
+
/** Shown in place of the items when there are none (and not `loading`). */
|
|
50
|
+
empty?: ReactNode;
|
|
20
51
|
/**
|
|
21
52
|
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
22
53
|
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Applied to the
|
|
@@ -35,5 +66,8 @@ export interface TreeItemProps extends Omit<HTMLAttributes<HTMLLIElement>, 'id'>
|
|
|
35
66
|
icon?: ReactNode;
|
|
36
67
|
/** Child TreeItems. */
|
|
37
68
|
children?: ReactNode;
|
|
69
|
+
/** @internal Position info injected by the parent tree (aria-level / setsize / posinset). */
|
|
70
|
+
_meta?: TreeMeta;
|
|
38
71
|
}
|
|
39
72
|
export declare const TreeItem: import("react").ForwardRefExoticComponent<TreeItemProps & import("react").RefAttributes<HTMLLIElement>>;
|
|
73
|
+
export {};
|