canny-ui-react 4.0.0 → 5.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/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Button/ToggleButton.d.ts +7 -4
- package/dist/components/Dialog/Dialog.d.ts +10 -2
- package/dist/components/Drawer/Drawer.d.ts +10 -2
- package/dist/components/Layout/Box.d.ts +1 -0
- package/dist/components/Layout/Grid.d.ts +18 -2
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/layout.types.d.ts +10 -0
- package/dist/components/Layout/sx.d.ts +31 -0
- package/dist/components/Menu/Menu.d.ts +42 -6
- package/dist/components/Popover/Popover.d.ts +9 -1
- package/dist/components/Select/Select.d.ts +9 -3
- package/dist/components/Slider/Slider.d.ts +25 -2
- package/dist/components/Tabs/Tabs.d.ts +21 -5
- package/dist/index.cjs +37 -37
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +3430 -3341
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -20,7 +20,7 @@ export declare const Accordion: import("react").ForwardRefExoticComponent<((Omit
|
|
|
20
20
|
})) & import("react").RefAttributes<HTMLDivElement>>;
|
|
21
21
|
export type AccordionItemProps = ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;
|
|
22
22
|
export declare const AccordionItem: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
23
|
-
export interface AccordionTriggerProps extends ComponentPropsWithoutRef<
|
|
23
|
+
export interface AccordionTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
24
24
|
/** Optional leading icon in the trigger row. */
|
|
25
25
|
icon?: ReactNode;
|
|
26
26
|
/** Hide the chevron indicator. */
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import { Root as RadixToggle } from '@radix-ui/react-toggle';
|
|
3
2
|
import type { ButtonColor, ButtonShape, ButtonSize, ButtonVariant } from './Button.types';
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
export interface ToggleButtonProps extends ComponentPropsWithoutRef<'button'> {
|
|
4
|
+
/** Controlled pressed state. */
|
|
5
|
+
pressed?: boolean;
|
|
6
|
+
/** Uncontrolled initial pressed state. */
|
|
7
|
+
defaultPressed?: boolean;
|
|
8
|
+
/** Fires when the pressed state changes. */
|
|
9
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
6
10
|
variant?: Extract<ButtonVariant, 'ghost' | 'outline' | 'soft' | 'dashed'>;
|
|
7
11
|
color?: ButtonColor;
|
|
8
12
|
size?: ButtonSize;
|
|
@@ -15,4 +19,3 @@ export interface ToggleButtonProps extends Omit<RadixToggleProps, 'asChild'> {
|
|
|
15
19
|
* Handles `aria-pressed` / `data-state` natively; CSS hooks into both.
|
|
16
20
|
*/
|
|
17
21
|
export declare const ToggleButton: import("react").ForwardRefExoticComponent<ToggleButtonProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
18
|
-
export {};
|
|
@@ -1,7 +1,15 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
3
|
export type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
4
|
-
export interface DialogProps
|
|
4
|
+
export interface DialogProps {
|
|
5
|
+
/** Controlled open state. */
|
|
6
|
+
open?: boolean;
|
|
7
|
+
/** Uncontrolled initial open state. */
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
/** Fires when the open state changes (Esc, backdrop, or close button). */
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
/** Whether the dialog blocks interaction with the rest of the page. Default: true. */
|
|
12
|
+
modal?: boolean;
|
|
5
13
|
/** Title rendered as the visible h2. Required for accessibility. */
|
|
6
14
|
title: ReactNode;
|
|
7
15
|
/** Optional descriptive subhead under the title. */
|
|
@@ -1,8 +1,16 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
2
|
import * as RadixDialog from '@radix-ui/react-dialog';
|
|
3
3
|
export type DrawerSide = 'left' | 'right' | 'top' | 'bottom';
|
|
4
4
|
export type DrawerSize = 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
-
export interface DrawerProps
|
|
5
|
+
export interface DrawerProps {
|
|
6
|
+
/** Controlled open state. */
|
|
7
|
+
open?: boolean;
|
|
8
|
+
/** Uncontrolled initial open state. */
|
|
9
|
+
defaultOpen?: boolean;
|
|
10
|
+
/** Fires when the open state changes (Esc, backdrop, or close button). */
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
/** Whether the drawer blocks interaction with the rest of the page. Default: true. */
|
|
13
|
+
modal?: boolean;
|
|
6
14
|
/** Visible heading for the drawer. Required for AT. */
|
|
7
15
|
title: ReactNode;
|
|
8
16
|
/** Optional subhead under the title. */
|
|
@@ -13,6 +13,7 @@ export type BoxProps<E extends ElementType = 'div'> = LayoutProps & Omit<Compone
|
|
|
13
13
|
* @example
|
|
14
14
|
* <Box p={4} gap={2} direction="column">...</Box>
|
|
15
15
|
* <Box as="section" py={6} px={4}>...</Box>
|
|
16
|
+
* <Box sx={{ gridTemplateColumns: { base: '1fr', lg: '3fr 1fr' } }}>...</Box>
|
|
16
17
|
*/
|
|
17
18
|
export declare const Box: <E extends ElementType = "div">(props: BoxProps<E> & {
|
|
18
19
|
ref?: ForwardedRef<Element>;
|
|
@@ -1,16 +1,32 @@
|
|
|
1
1
|
import type { ElementType, ForwardedRef, ReactElement } from 'react';
|
|
2
2
|
import type { BoxProps } from './Box';
|
|
3
|
+
import type { Breakpoint } from './sx';
|
|
3
4
|
type GridCols = 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12;
|
|
5
|
+
/** Column weights, e.g. `[3, 1]` → `minmax(0,3fr) minmax(0,1fr)`. */
|
|
6
|
+
type Ratio = number[];
|
|
7
|
+
/** A ratio, or a per-breakpoint map for responsive tracks (e.g. `{ base: [1], lg: [3, 1] }`). */
|
|
8
|
+
type ResponsiveRatio = Ratio | Partial<Record<Breakpoint, Ratio>>;
|
|
4
9
|
export type GridProps<E extends ElementType = 'div'> = Omit<BoxProps<E>, 'display' | 'direction'> & {
|
|
5
|
-
/** Fixed column count. Maps to `.grid-cols-{n}` utility. Ignored if
|
|
10
|
+
/** Fixed column count. Maps to `.grid-cols-{n}` utility. Ignored if another track prop is set. */
|
|
6
11
|
cols?: GridCols;
|
|
7
12
|
/**
|
|
8
13
|
* Auto-fit responsive grid: `repeat(auto-fit, minmax(minColWidth, 1fr))`.
|
|
9
14
|
* Pass a CSS length (e.g. `'240px'`, `'18rem'`).
|
|
10
15
|
*/
|
|
11
16
|
minColWidth?: string;
|
|
17
|
+
/**
|
|
18
|
+
* Asymmetric tracks via column weights. `[3, 1]` → a 75/25 split. Responsive
|
|
19
|
+
* with a breakpoint map: `ratio={{ base: [1], lg: [3, 1] }}` stacks below `lg`
|
|
20
|
+
* and splits 3:1 at/above it — no custom CSS needed.
|
|
21
|
+
*/
|
|
22
|
+
ratio?: ResponsiveRatio;
|
|
23
|
+
/** Explicit `grid-template-columns` string (e.g. `'200px 1fr auto'`). */
|
|
24
|
+
template?: string;
|
|
12
25
|
};
|
|
13
|
-
/**
|
|
26
|
+
/**
|
|
27
|
+
* CSS Grid container. Choose one track model: `cols` (equal), `minColWidth`
|
|
28
|
+
* (auto-fit), `ratio` (asymmetric, responsive), or `template` (explicit).
|
|
29
|
+
*/
|
|
14
30
|
export declare const Grid: <E extends ElementType = "div">(props: GridProps<E> & {
|
|
15
31
|
ref?: ForwardedRef<Element>;
|
|
16
32
|
}) => ReactElement;
|
|
@@ -17,3 +17,5 @@ export type { AspectRatioProps } from './AspectRatio';
|
|
|
17
17
|
export type { CenterProps } from './Center';
|
|
18
18
|
export type { GroupProps } from './Group';
|
|
19
19
|
export type { Space, Align, Justify, Direction, Display, LayoutProps } from './layout.types';
|
|
20
|
+
export type { SxProp, Breakpoint } from './sx';
|
|
21
|
+
export { BREAKPOINTS, resolveSx } from './sx';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ElementType, ReactNode } from 'react';
|
|
2
|
+
import type { SxProp } from './sx';
|
|
2
3
|
/** Spacing scale token — maps 1:1 to `.p-{n}`, `.m-{n}`, `.gap-{n}` utilities. */
|
|
3
4
|
export type Space = 0 | 1 | 2 | 3 | 4 | 5 | 6 | 8 | 10 | 12 | 16;
|
|
4
5
|
export type Align = 'start' | 'center' | 'end' | 'stretch' | 'baseline';
|
|
@@ -32,6 +33,15 @@ export interface LayoutProps {
|
|
|
32
33
|
wrap?: boolean;
|
|
33
34
|
w?: 'full' | 'auto' | 'fit';
|
|
34
35
|
h?: 'full' | 'auto' | 'fit';
|
|
36
|
+
/** Grow to fill remaining space along the parent flex axis (`flex: 1 1 0`). */
|
|
37
|
+
grow?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* MUI-like escape hatch for one-off CSS. Each value may be a scalar or a
|
|
40
|
+
* responsive map keyed by breakpoint (base/sm/md/lg/xl), e.g.
|
|
41
|
+
* `sx={{ p: 8, gridTemplateColumns: { base: '1fr', lg: '3fr 1fr' } }}`.
|
|
42
|
+
* Scalar-only sx becomes inline style; responsive sx injects a scoped class.
|
|
43
|
+
*/
|
|
44
|
+
sx?: SxProp;
|
|
35
45
|
children?: ReactNode;
|
|
36
46
|
}
|
|
37
47
|
/** Maps layout props to the utility class names emitted by core. */
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { CSSProperties } from 'react';
|
|
2
|
+
/** Responsive breakpoint keys. `base` has no media query (applies at all widths). */
|
|
3
|
+
export type Breakpoint = 'base' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
/** Mobile-first min-width breakpoints (px). Mirrors the common sm/md/lg/xl scale. */
|
|
5
|
+
export declare const BREAKPOINTS: Record<Exclude<Breakpoint, 'base'>, number>;
|
|
6
|
+
type Responsive<T> = T | Partial<Record<Breakpoint, T>>;
|
|
7
|
+
/**
|
|
8
|
+
* MUI-like style object: any CSS property, each value either a scalar or a
|
|
9
|
+
* responsive map keyed by breakpoint, e.g.
|
|
10
|
+
* `sx={{ padding: 8, gridTemplateColumns: { base: '1fr', lg: '3fr 1fr' } }}`.
|
|
11
|
+
*/
|
|
12
|
+
export type SxProp = {
|
|
13
|
+
[K in keyof CSSProperties]?: Responsive<CSSProperties[K]>;
|
|
14
|
+
};
|
|
15
|
+
export interface SxResult {
|
|
16
|
+
/** Inline style for all-scalar sx. */
|
|
17
|
+
style?: CSSProperties;
|
|
18
|
+
/** Generated class for responsive sx. */
|
|
19
|
+
className?: string;
|
|
20
|
+
/** CSS text (base rules + min-width @media blocks) to inject in a <style>. */
|
|
21
|
+
css?: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Resolve an `sx` object into what a component needs to render:
|
|
25
|
+
* - All-scalar sx → merged into inline `style` (no <style> element needed).
|
|
26
|
+
* - Any responsive value → a deterministic hashed class plus a `css` string of
|
|
27
|
+
* base rules and min-width @media blocks. The hash is content-derived, so SSR
|
|
28
|
+
* and client output match exactly.
|
|
29
|
+
*/
|
|
30
|
+
export declare function resolveSx(sx: SxProp): SxResult;
|
|
31
|
+
export {};
|
|
@@ -2,8 +2,16 @@ import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
|
2
2
|
import * as RadixMenu from '@radix-ui/react-dropdown-menu';
|
|
3
3
|
export declare const Menu: import("react").FC<RadixMenu.DropdownMenuProps>;
|
|
4
4
|
export declare const MenuTrigger: import("react").ForwardRefExoticComponent<RadixMenu.DropdownMenuTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
5
|
-
export interface MenuContentProps extends ComponentPropsWithoutRef<
|
|
5
|
+
export interface MenuContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
6
6
|
className?: string;
|
|
7
|
+
/** Preferred side of the trigger to render against. */
|
|
8
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
9
|
+
/** Distance in px from the trigger. Default: 6. */
|
|
10
|
+
sideOffset?: number;
|
|
11
|
+
/** Alignment against the trigger. */
|
|
12
|
+
align?: 'start' | 'center' | 'end';
|
|
13
|
+
/** Offset in px from the aligned edge. */
|
|
14
|
+
alignOffset?: number;
|
|
7
15
|
/** Visual size — controls padding + font size. Default: `md`. */
|
|
8
16
|
size?: 'sm' | 'md';
|
|
9
17
|
}
|
|
@@ -21,7 +29,13 @@ export interface MenuContentProps extends ComponentPropsWithoutRef<typeof RadixM
|
|
|
21
29
|
* </Menu>
|
|
22
30
|
*/
|
|
23
31
|
export declare const MenuContent: import("react").ForwardRefExoticComponent<MenuContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
|
-
export interface MenuItemProps extends ComponentPropsWithoutRef<
|
|
32
|
+
export interface MenuItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
|
|
33
|
+
/** Disable selecting this item. */
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
/** Fires when the item is selected (click or Enter). */
|
|
36
|
+
onSelect?: (event: Event) => void;
|
|
37
|
+
/** Optional text used for typeahead matching. */
|
|
38
|
+
textValue?: string;
|
|
25
39
|
/** Leading icon. */
|
|
26
40
|
icon?: ReactNode;
|
|
27
41
|
/** Right-aligned shortcut hint (e.g. `⌘C`). */
|
|
@@ -30,21 +44,43 @@ export interface MenuItemProps extends ComponentPropsWithoutRef<typeof RadixMenu
|
|
|
30
44
|
destructive?: boolean;
|
|
31
45
|
}
|
|
32
46
|
export declare const MenuItem: import("react").ForwardRefExoticComponent<MenuItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
33
|
-
export interface MenuCheckboxItemProps extends ComponentPropsWithoutRef<
|
|
47
|
+
export interface MenuCheckboxItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
|
|
48
|
+
/** Controlled checked state. */
|
|
49
|
+
checked?: boolean;
|
|
50
|
+
/** Fires when the checked state changes. */
|
|
51
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
52
|
+
/** Disable selecting this item. */
|
|
53
|
+
disabled?: boolean;
|
|
54
|
+
/** Fires when the item is selected (click or Enter). */
|
|
55
|
+
onSelect?: (event: Event) => void;
|
|
56
|
+
/** Optional text used for typeahead matching. */
|
|
57
|
+
textValue?: string;
|
|
34
58
|
shortcut?: ReactNode;
|
|
35
59
|
}
|
|
36
60
|
export declare const MenuCheckboxItem: import("react").ForwardRefExoticComponent<MenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
37
61
|
export declare const MenuRadioGroup: import("react").ForwardRefExoticComponent<RadixMenu.DropdownMenuRadioGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
38
|
-
export interface MenuRadioItemProps extends ComponentPropsWithoutRef<
|
|
62
|
+
export interface MenuRadioItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
|
|
63
|
+
/** The value of this radio item within its group. */
|
|
64
|
+
value: string;
|
|
65
|
+
/** Disable selecting this item. */
|
|
66
|
+
disabled?: boolean;
|
|
67
|
+
/** Fires when the item is selected (click or Enter). */
|
|
68
|
+
onSelect?: (event: Event) => void;
|
|
69
|
+
/** Optional text used for typeahead matching. */
|
|
70
|
+
textValue?: string;
|
|
39
71
|
shortcut?: ReactNode;
|
|
40
72
|
}
|
|
41
73
|
export declare const MenuRadioItem: import("react").ForwardRefExoticComponent<MenuRadioItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
|
-
export interface MenuLabelProps extends ComponentPropsWithoutRef<
|
|
74
|
+
export interface MenuLabelProps extends ComponentPropsWithoutRef<'div'> {
|
|
43
75
|
}
|
|
44
76
|
export declare const MenuLabel: import("react").ForwardRefExoticComponent<MenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
45
77
|
export declare const MenuSeparator: import("react").ForwardRefExoticComponent<Omit<RadixMenu.DropdownMenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
46
78
|
export declare const MenuSub: import("react").FC<RadixMenu.DropdownMenuSubProps>;
|
|
47
|
-
export interface MenuSubTriggerProps extends ComponentPropsWithoutRef<
|
|
79
|
+
export interface MenuSubTriggerProps extends ComponentPropsWithoutRef<'div'> {
|
|
80
|
+
/** Disable opening this submenu. */
|
|
81
|
+
disabled?: boolean;
|
|
82
|
+
/** Optional text used for typeahead matching. */
|
|
83
|
+
textValue?: string;
|
|
48
84
|
icon?: ReactNode;
|
|
49
85
|
}
|
|
50
86
|
export declare const MenuSubTrigger: import("react").ForwardRefExoticComponent<MenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -16,9 +16,17 @@ export declare const Popover: import("react").FC<RadixPopover.PopoverProps>;
|
|
|
16
16
|
export declare const PopoverTrigger: import("react").ForwardRefExoticComponent<RadixPopover.PopoverTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
17
17
|
export declare const PopoverAnchor: import("react").ForwardRefExoticComponent<RadixPopover.PopoverAnchorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
18
18
|
export declare const PopoverClose: import("react").ForwardRefExoticComponent<RadixPopover.PopoverCloseProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
19
|
-
export interface PopoverContentProps extends ComponentPropsWithoutRef<
|
|
19
|
+
export interface PopoverContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
20
20
|
className?: string;
|
|
21
21
|
/** Render the small directional arrow on the popover. Default: false. */
|
|
22
22
|
withArrow?: boolean;
|
|
23
|
+
/** Preferred side of the trigger to render against. */
|
|
24
|
+
side?: 'top' | 'right' | 'bottom' | 'left';
|
|
25
|
+
/** Distance in px from the trigger. Default: 8. */
|
|
26
|
+
sideOffset?: number;
|
|
27
|
+
/** Alignment against the trigger. */
|
|
28
|
+
align?: 'start' | 'center' | 'end';
|
|
29
|
+
/** Offset in px from the aligned edge. */
|
|
30
|
+
alignOffset?: number;
|
|
23
31
|
}
|
|
24
32
|
export declare const PopoverContent: import("react").ForwardRefExoticComponent<PopoverContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -38,13 +38,19 @@ export interface SelectProps extends SelectRootProps {
|
|
|
38
38
|
* </Select>
|
|
39
39
|
*/
|
|
40
40
|
export declare function Select({ placeholder, size, color, triggerIcon, triggerClassName, contentClassName, id, className, disabled, children, 'aria-invalid': ariaInvalid, 'aria-describedby': ariaDescribedBy, ...rootProps }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
41
|
-
export interface SelectItemProps extends ComponentPropsWithoutRef<
|
|
41
|
+
export interface SelectItemProps extends ComponentPropsWithoutRef<'div'> {
|
|
42
|
+
/** The value submitted when this item is selected. */
|
|
43
|
+
value: string;
|
|
44
|
+
/** Disable selecting this item. */
|
|
45
|
+
disabled?: boolean;
|
|
46
|
+
/** Optional text used for typeahead matching. */
|
|
47
|
+
textValue?: string;
|
|
42
48
|
}
|
|
43
49
|
export declare const SelectItem: import("react").ForwardRefExoticComponent<SelectItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
44
|
-
export interface SelectGroupProps extends ComponentPropsWithoutRef<
|
|
50
|
+
export interface SelectGroupProps extends ComponentPropsWithoutRef<'div'> {
|
|
45
51
|
}
|
|
46
52
|
export declare const SelectGroup: import("react").ForwardRefExoticComponent<SelectGroupProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
-
export interface SelectLabelProps extends ComponentPropsWithoutRef<
|
|
53
|
+
export interface SelectLabelProps extends ComponentPropsWithoutRef<'div'> {
|
|
48
54
|
}
|
|
49
55
|
export declare const SelectLabel: import("react").ForwardRefExoticComponent<SelectLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
50
56
|
export declare const SelectSeparator: import("react").ForwardRefExoticComponent<Omit<RadixSelect.SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,29 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
export interface SliderProps extends Omit<ComponentPropsWithoutRef<'span'>, 'defaultValue' | 'dir' | 'onChange'> {
|
|
3
|
+
/** Controlled value (one entry per thumb). */
|
|
4
|
+
value?: number[];
|
|
5
|
+
/** Uncontrolled initial value (one entry per thumb). */
|
|
6
|
+
defaultValue?: number[];
|
|
7
|
+
/** Fires continuously as the value changes. */
|
|
8
|
+
onValueChange?: (value: number[]) => void;
|
|
9
|
+
/** Fires when the user finishes dragging. */
|
|
10
|
+
onValueCommit?: (value: number[]) => void;
|
|
11
|
+
/** Minimum value. Default: 0. */
|
|
12
|
+
min?: number;
|
|
13
|
+
/** Maximum value. Default: 100. */
|
|
14
|
+
max?: number;
|
|
15
|
+
/** Step increment. Default: 1. */
|
|
16
|
+
step?: number;
|
|
17
|
+
/** Minimum steps allowed between two thumbs. */
|
|
18
|
+
minStepsBetweenThumbs?: number;
|
|
19
|
+
/** Orientation. Default: `horizontal`. */
|
|
20
|
+
orientation?: 'horizontal' | 'vertical';
|
|
21
|
+
/** Disable the slider. */
|
|
22
|
+
disabled?: boolean;
|
|
23
|
+
/** Reading direction. */
|
|
24
|
+
dir?: 'ltr' | 'rtl';
|
|
25
|
+
/** Name for form submission. */
|
|
26
|
+
name?: string;
|
|
4
27
|
size?: 'sm' | 'md' | 'lg';
|
|
5
28
|
color?: 'primary' | 'success' | 'warning' | 'danger';
|
|
6
29
|
/** Show inline value bubble above the active thumb on hover/focus. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
1
|
+
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
2
|
import * as RadixTabs from '@radix-ui/react-tabs';
|
|
3
3
|
export type TabsVariant = 'line' | 'pills' | 'segmented';
|
|
4
4
|
export type TabsSize = 'sm' | 'md' | 'lg';
|
|
@@ -16,7 +16,21 @@ export type TabsSize = 'sm' | 'md' | 'lg';
|
|
|
16
16
|
* <TabsContent value="activity">…</TabsContent>
|
|
17
17
|
* </Tabs>
|
|
18
18
|
*/
|
|
19
|
-
export interface TabsProps extends ComponentPropsWithoutRef<
|
|
19
|
+
export interface TabsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'dir'> {
|
|
20
|
+
/** Controlled active tab value. */
|
|
21
|
+
value?: string;
|
|
22
|
+
/** Uncontrolled initial active tab value. */
|
|
23
|
+
defaultValue?: string;
|
|
24
|
+
/** Fires when the active tab changes. */
|
|
25
|
+
onValueChange?: (value: string) => void;
|
|
26
|
+
/** Orientation of the tab list. Default: `horizontal`. */
|
|
27
|
+
orientation?: 'horizontal' | 'vertical';
|
|
28
|
+
/** Reading direction. */
|
|
29
|
+
dir?: 'ltr' | 'rtl';
|
|
30
|
+
/** Whether tabs activate on focus or only on click. Default: `automatic`. */
|
|
31
|
+
activationMode?: 'automatic' | 'manual';
|
|
32
|
+
/** Tab list and panels. */
|
|
33
|
+
children?: ReactNode;
|
|
20
34
|
/** Visual style. Default: `line`. */
|
|
21
35
|
variant?: TabsVariant;
|
|
22
36
|
/** Size preset. Default: `md`. */
|
|
@@ -24,11 +38,13 @@ export interface TabsProps extends ComponentPropsWithoutRef<typeof RadixTabs.Roo
|
|
|
24
38
|
}
|
|
25
39
|
export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
26
40
|
export declare const TabsList: import("react").ForwardRefExoticComponent<Omit<RadixTabs.TabsListProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
27
|
-
export interface TabsTriggerProps extends ComponentPropsWithoutRef<
|
|
41
|
+
export interface TabsTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
42
|
+
/** Value identifying which panel this trigger activates. */
|
|
43
|
+
value: string;
|
|
28
44
|
/** Optional leading icon. */
|
|
29
|
-
icon?:
|
|
45
|
+
icon?: ReactNode;
|
|
30
46
|
/** Optional right-aligned badge (count, status). */
|
|
31
|
-
badge?:
|
|
47
|
+
badge?: ReactNode;
|
|
32
48
|
}
|
|
33
49
|
export declare const TabsTrigger: import("react").ForwardRefExoticComponent<TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
34
50
|
export declare const TabsContent: import("react").ForwardRefExoticComponent<Omit<RadixTabs.TabsContentProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|