canny-ui-react 6.0.0 → 6.1.1
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 +38 -28
- package/dist/components/Button/ToggleButtonGroup.d.ts +39 -4
- package/dist/components/Checkbox/Checkbox.d.ts +13 -3
- package/dist/components/Dialog/Dialog.d.ts +6 -4
- package/dist/components/Drawer/Drawer.d.ts +6 -4
- package/dist/components/Menu/Menu.d.ts +27 -8
- package/dist/components/Popover/Popover.d.ts +10 -6
- package/dist/components/Radio/Radio.d.ts +16 -4
- package/dist/components/Select/Select.d.ts +16 -4
- package/dist/components/Switch/Switch.d.ts +12 -3
- package/dist/components/Tabs/Tabs.d.ts +12 -3
- package/dist/components/Tooltip/Tooltip.d.ts +23 -6
- package/dist/index.cjs +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +610 -598
- package/dist/index.js.map +1 -1
- package/dist/utils/primitiveProps.d.ts +94 -0
- package/package.json +6 -5
|
@@ -1,11 +1,33 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import
|
|
2
|
+
import type { Direction } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
|
-
|
|
4
|
+
interface AccordionRootBase extends Omit<ComponentPropsWithoutRef<'div'>, 'defaultValue' | 'onChange' | 'dir'> {
|
|
5
|
+
/** Disable every item. */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Reading direction. */
|
|
8
|
+
dir?: Direction;
|
|
9
|
+
/** Layout axis. Default: `vertical`. */
|
|
10
|
+
orientation?: 'horizontal' | 'vertical';
|
|
11
|
+
}
|
|
12
|
+
type RootSingle = AccordionRootBase & {
|
|
5
13
|
type: 'single';
|
|
14
|
+
/** Controlled open item. */
|
|
15
|
+
value?: string;
|
|
16
|
+
/** Uncontrolled initial open item. */
|
|
17
|
+
defaultValue?: string;
|
|
18
|
+
/** Fires when the open item changes. */
|
|
19
|
+
onValueChange?: (value: string) => void;
|
|
20
|
+
/** Allow closing the open item by clicking it again. */
|
|
21
|
+
collapsible?: boolean;
|
|
6
22
|
};
|
|
7
|
-
type RootMultiple =
|
|
23
|
+
type RootMultiple = AccordionRootBase & {
|
|
8
24
|
type: 'multiple';
|
|
25
|
+
/** Controlled set of open items. */
|
|
26
|
+
value?: string[];
|
|
27
|
+
/** Uncontrolled initial set of open items. */
|
|
28
|
+
defaultValue?: string[];
|
|
29
|
+
/** Fires when the open set changes. */
|
|
30
|
+
onValueChange?: (value: string[]) => void;
|
|
9
31
|
};
|
|
10
32
|
export type AccordionProps = (RootSingle | RootMultiple) & {
|
|
11
33
|
variant?: 'plain' | 'bordered' | 'separated';
|
|
@@ -16,29 +38,14 @@ export type AccordionProps = (RootSingle | RootMultiple) & {
|
|
|
16
38
|
*/
|
|
17
39
|
sx?: SxProp;
|
|
18
40
|
};
|
|
19
|
-
export declare const Accordion: import("react").ForwardRefExoticComponent<
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
*/
|
|
28
|
-
sx?: SxProp;
|
|
29
|
-
}) | (Omit<AccordionPrimitive.AccordionMultipleProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & {
|
|
30
|
-
type: "multiple";
|
|
31
|
-
} & {
|
|
32
|
-
variant?: "plain" | "bordered" | "separated";
|
|
33
|
-
/**
|
|
34
|
-
* One-off CSS, same as `Box`'s `sx`: each value may be a scalar or a
|
|
35
|
-
* responsive breakpoint map (`{ base, sm, md, lg, xl }`). Scalar-only sx
|
|
36
|
-
* merges into inline style; responsive sx injects a scoped class.
|
|
37
|
-
*/
|
|
38
|
-
sx?: SxProp;
|
|
39
|
-
})) & import("react").RefAttributes<HTMLDivElement>>;
|
|
40
|
-
export type AccordionItemProps = ComponentPropsWithoutRef<typeof AccordionPrimitive.Item>;
|
|
41
|
-
export declare const AccordionItem: import("react").ForwardRefExoticComponent<Omit<AccordionPrimitive.AccordionItemProps & import("react").RefAttributes<HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
41
|
+
export declare const Accordion: import("react").ForwardRefExoticComponent<AccordionProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
|
+
export interface AccordionItemProps extends ComponentPropsWithoutRef<'div'> {
|
|
43
|
+
/** Value identifying this item. */
|
|
44
|
+
value: string;
|
|
45
|
+
/** Disables just this item. */
|
|
46
|
+
disabled?: boolean;
|
|
47
|
+
}
|
|
48
|
+
export declare const AccordionItem: import("react").ForwardRefExoticComponent<AccordionItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
42
49
|
export interface AccordionTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
43
50
|
/** Optional leading icon in the trigger row. */
|
|
44
51
|
icon?: ReactNode;
|
|
@@ -46,6 +53,9 @@ export interface AccordionTriggerProps extends ComponentPropsWithoutRef<'button'
|
|
|
46
53
|
hideIndicator?: boolean;
|
|
47
54
|
}
|
|
48
55
|
export declare const AccordionTrigger: import("react").ForwardRefExoticComponent<AccordionTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
49
|
-
export
|
|
50
|
-
|
|
56
|
+
export interface AccordionContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
57
|
+
/** Keep mounted while collapsed (useful for animations). */
|
|
58
|
+
forceMount?: true;
|
|
59
|
+
}
|
|
60
|
+
export declare const AccordionContent: import("react").ForwardRefExoticComponent<AccordionContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
51
61
|
export {};
|
|
@@ -1,8 +1,43 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import {
|
|
1
|
+
import type { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { Direction } from '../../utils/primitiveProps';
|
|
3
3
|
import type { ButtonColor, ButtonShape, ButtonSize, ButtonVariant } from './Button.types';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
interface GroupRootBase extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'dir'> {
|
|
5
|
+
/** Disable every item in the group. */
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
/** Reading direction. */
|
|
8
|
+
dir?: Direction;
|
|
9
|
+
/** Layout axis. Default: `horizontal`. */
|
|
10
|
+
orientation?: 'horizontal' | 'vertical';
|
|
11
|
+
/** Allow arrow-key navigation to wrap around. Default: true. */
|
|
12
|
+
loop?: boolean;
|
|
13
|
+
/** Keep at least one item pressed. */
|
|
14
|
+
rovingFocus?: boolean;
|
|
15
|
+
}
|
|
16
|
+
type GroupSingle = GroupRootBase & {
|
|
17
|
+
type?: 'single';
|
|
18
|
+
/** Controlled pressed value. */
|
|
19
|
+
value?: string;
|
|
20
|
+
/** Uncontrolled initial pressed value. */
|
|
21
|
+
defaultValue?: string;
|
|
22
|
+
/** Fires when the pressed value changes. */
|
|
23
|
+
onValueChange?: (value: string) => void;
|
|
24
|
+
};
|
|
25
|
+
type GroupMultiple = GroupRootBase & {
|
|
26
|
+
type: 'multiple';
|
|
27
|
+
/** Controlled set of pressed values. */
|
|
28
|
+
value?: string[];
|
|
29
|
+
/** Uncontrolled initial set of pressed values. */
|
|
30
|
+
defaultValue?: string[];
|
|
31
|
+
/** Fires when the pressed set changes. */
|
|
32
|
+
onValueChange?: (value: string[]) => void;
|
|
33
|
+
};
|
|
34
|
+
type GroupRootProps = GroupSingle | GroupMultiple;
|
|
35
|
+
interface GroupItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'type'> {
|
|
36
|
+
/** Value identifying this item within the group. */
|
|
37
|
+
value: string;
|
|
38
|
+
/** Disables just this item. */
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
}
|
|
6
41
|
type GroupVariant = Extract<ButtonVariant, 'ghost' | 'outline' | 'soft' | 'dashed'>;
|
|
7
42
|
export type ToggleButtonGroupProps = GroupRootProps & {
|
|
8
43
|
variant?: GroupVariant;
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { FormControlProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
|
-
type
|
|
4
|
+
export type CheckedState = boolean | 'indeterminate';
|
|
5
|
+
interface CheckboxRootProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange' | 'checked' | 'defaultChecked' | 'type'>, FormControlProps {
|
|
6
|
+
/** Controlled checked state; `'indeterminate'` renders the dash. */
|
|
7
|
+
checked?: CheckedState;
|
|
8
|
+
/** Uncontrolled initial checked state. */
|
|
9
|
+
defaultChecked?: CheckedState;
|
|
10
|
+
/** Fires when the checked state changes. */
|
|
11
|
+
onCheckedChange?: (checked: CheckedState) => void;
|
|
12
|
+
/** Value submitted with the form when checked. Default: `'on'`. */
|
|
13
|
+
value?: string;
|
|
14
|
+
}
|
|
5
15
|
export interface CheckboxProps extends Omit<CheckboxRootProps, 'children'> {
|
|
6
16
|
/** Label text or node rendered next to the box. */
|
|
7
17
|
children?: ReactNode;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import type { TriggerProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
4
|
import type { CSSProperties } from 'react';
|
|
5
5
|
export type DialogSize = 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
@@ -47,6 +47,8 @@ export interface DialogProps {
|
|
|
47
47
|
*/
|
|
48
48
|
export declare const Dialog: import("react").ForwardRefExoticComponent<DialogProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
49
49
|
/** Trigger button to open a Dialog when wired with a controlled root. */
|
|
50
|
-
export
|
|
50
|
+
export type DialogTriggerProps = TriggerProps;
|
|
51
|
+
export declare const DialogTrigger: FC<DialogTriggerProps>;
|
|
51
52
|
/** Close button — typically used inside the body or footer. */
|
|
52
|
-
export
|
|
53
|
+
export type DialogCloseProps = TriggerProps;
|
|
54
|
+
export declare const DialogClose: FC<DialogCloseProps>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
2
|
-
import
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import type { TriggerProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
4
|
import type { CSSProperties } from 'react';
|
|
5
5
|
export type DrawerSide = 'left' | 'right' | 'top' | 'bottom';
|
|
@@ -49,5 +49,7 @@ export interface DrawerProps {
|
|
|
49
49
|
* </Drawer>
|
|
50
50
|
*/
|
|
51
51
|
export declare const Drawer: import("react").ForwardRefExoticComponent<DrawerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
52
|
-
export
|
|
53
|
-
export declare const
|
|
52
|
+
export type DrawerTriggerProps = TriggerProps;
|
|
53
|
+
export declare const DrawerTrigger: FC<DrawerTriggerProps>;
|
|
54
|
+
export type DrawerCloseProps = TriggerProps;
|
|
55
|
+
export declare const DrawerClose: FC<DrawerCloseProps>;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import
|
|
1
|
+
import type { ComponentPropsWithoutRef, FC, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { OpenStateProps, PopperContentProps, TriggerProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
|
-
export
|
|
5
|
-
export declare const
|
|
4
|
+
export type MenuProps = OpenStateProps;
|
|
5
|
+
export declare const Menu: FC<MenuProps>;
|
|
6
|
+
export type MenuTriggerProps = TriggerProps;
|
|
7
|
+
export declare const MenuTrigger: FC<MenuTriggerProps>;
|
|
6
8
|
export interface MenuContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
7
9
|
className?: string;
|
|
8
10
|
/** Preferred side of the trigger to render against. */
|
|
@@ -65,7 +67,13 @@ export interface MenuCheckboxItemProps extends Omit<ComponentPropsWithoutRef<'di
|
|
|
65
67
|
shortcut?: ReactNode;
|
|
66
68
|
}
|
|
67
69
|
export declare const MenuCheckboxItem: import("react").ForwardRefExoticComponent<MenuCheckboxItemProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
68
|
-
export
|
|
70
|
+
export interface MenuRadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
71
|
+
/** Controlled selected value. */
|
|
72
|
+
value?: string;
|
|
73
|
+
/** Fires when the selected value changes. */
|
|
74
|
+
onValueChange?: (value: string) => void;
|
|
75
|
+
}
|
|
76
|
+
export declare const MenuRadioGroup: FC<MenuRadioGroupProps>;
|
|
69
77
|
export interface MenuRadioItemProps extends Omit<ComponentPropsWithoutRef<'div'>, 'onSelect'> {
|
|
70
78
|
/** The value of this radio item within its group. */
|
|
71
79
|
value: string;
|
|
@@ -81,8 +89,18 @@ export declare const MenuRadioItem: import("react").ForwardRefExoticComponent<Me
|
|
|
81
89
|
export interface MenuLabelProps extends ComponentPropsWithoutRef<'div'> {
|
|
82
90
|
}
|
|
83
91
|
export declare const MenuLabel: import("react").ForwardRefExoticComponent<MenuLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
84
|
-
export
|
|
85
|
-
export declare const
|
|
92
|
+
export type MenuSeparatorProps = HTMLAttributes<HTMLDivElement>;
|
|
93
|
+
export declare const MenuSeparator: import("react").ForwardRefExoticComponent<MenuSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
94
|
+
export interface MenuSubProps {
|
|
95
|
+
/** Controlled open state of the submenu. */
|
|
96
|
+
open?: boolean;
|
|
97
|
+
/** Uncontrolled initial open state. */
|
|
98
|
+
defaultOpen?: boolean;
|
|
99
|
+
/** Fires when the submenu opens or closes. */
|
|
100
|
+
onOpenChange?: (open: boolean) => void;
|
|
101
|
+
children?: ReactNode;
|
|
102
|
+
}
|
|
103
|
+
export declare const MenuSub: FC<MenuSubProps>;
|
|
86
104
|
export interface MenuSubTriggerProps extends ComponentPropsWithoutRef<'div'> {
|
|
87
105
|
/** Disable opening this submenu. */
|
|
88
106
|
disabled?: boolean;
|
|
@@ -91,4 +109,5 @@ export interface MenuSubTriggerProps extends ComponentPropsWithoutRef<'div'> {
|
|
|
91
109
|
icon?: ReactNode;
|
|
92
110
|
}
|
|
93
111
|
export declare const MenuSubTrigger: import("react").ForwardRefExoticComponent<MenuSubTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
94
|
-
export
|
|
112
|
+
export type MenuSubContentProps = PopperContentProps;
|
|
113
|
+
export declare const MenuSubContent: import("react").ForwardRefExoticComponent<PopperContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef } from 'react';
|
|
2
|
-
import
|
|
1
|
+
import type { ComponentPropsWithoutRef, FC, HTMLAttributes } from 'react';
|
|
2
|
+
import type { AsChildProps, OpenStateProps, TriggerProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
4
|
/**
|
|
5
5
|
* Popover root. Controlled (`open` + `onOpenChange`) or uncontrolled.
|
|
@@ -13,10 +13,14 @@ import type { SxProp } from '../Layout/sx';
|
|
|
13
13
|
* </PopoverContent>
|
|
14
14
|
* </Popover>
|
|
15
15
|
*/
|
|
16
|
-
export
|
|
17
|
-
export declare const
|
|
18
|
-
export
|
|
19
|
-
export declare const
|
|
16
|
+
export type PopoverProps = OpenStateProps;
|
|
17
|
+
export declare const Popover: FC<PopoverProps>;
|
|
18
|
+
export type PopoverTriggerProps = TriggerProps;
|
|
19
|
+
export declare const PopoverTrigger: FC<PopoverTriggerProps>;
|
|
20
|
+
export type PopoverAnchorProps = HTMLAttributes<HTMLDivElement> & AsChildProps;
|
|
21
|
+
export declare const PopoverAnchor: FC<PopoverAnchorProps>;
|
|
22
|
+
export type PopoverCloseProps = TriggerProps;
|
|
23
|
+
export declare const PopoverClose: FC<PopoverCloseProps>;
|
|
20
24
|
export interface PopoverContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
21
25
|
className?: string;
|
|
22
26
|
/** Render the small directional arrow on the popover. Default: false. */
|
|
@@ -1,8 +1,20 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { ButtonHTMLAttributes, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { Direction, FormControlProps, ValueStateProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
interface RadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue' | 'dir'>, ValueStateProps, FormControlProps {
|
|
5
|
+
/** Reading direction. */
|
|
6
|
+
dir?: Direction;
|
|
7
|
+
/** Allow arrow-key navigation to wrap around. Default: true. */
|
|
8
|
+
loop?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface RadioItemProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'type'> {
|
|
11
|
+
/** Value this item submits when selected. */
|
|
12
|
+
value: string;
|
|
13
|
+
/** Disables just this option. */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** Marks the option required for form validation. */
|
|
16
|
+
required?: boolean;
|
|
17
|
+
}
|
|
6
18
|
export interface RadioGroupRootProps extends RadioGroupProps {
|
|
7
19
|
/** Stack direction. Default: `'column'`. */
|
|
8
20
|
orientation?: 'horizontal' | 'vertical';
|
|
@@ -1,9 +1,20 @@
|
|
|
1
|
-
import type { ComponentPropsWithoutRef, CSSProperties, ReactNode } from 'react';
|
|
2
|
-
import
|
|
1
|
+
import type { ComponentPropsWithoutRef, CSSProperties, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { Direction, FormControlProps, ValueStateProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
4
|
export type SelectColor = 'primary' | 'danger' | 'warning' | 'success';
|
|
5
5
|
export type SelectSize = 'sm' | 'md' | 'lg';
|
|
6
|
-
|
|
6
|
+
interface SelectRootProps extends ValueStateProps, FormControlProps {
|
|
7
|
+
/** Controlled open state of the dropdown. */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
/** Uncontrolled initial open state. */
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
/** Fires when the dropdown opens or closes. */
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
/** Reading direction. */
|
|
14
|
+
dir?: Direction;
|
|
15
|
+
/** Autocomplete hint forwarded to the hidden native select. */
|
|
16
|
+
autoComplete?: string;
|
|
17
|
+
}
|
|
7
18
|
export interface SelectProps extends SelectRootProps {
|
|
8
19
|
/** Placeholder shown when nothing is selected. */
|
|
9
20
|
placeholder?: string;
|
|
@@ -63,5 +74,6 @@ export declare const SelectGroup: import("react").ForwardRefExoticComponent<Sele
|
|
|
63
74
|
export interface SelectLabelProps extends ComponentPropsWithoutRef<'div'> {
|
|
64
75
|
}
|
|
65
76
|
export declare const SelectLabel: import("react").ForwardRefExoticComponent<SelectLabelProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
66
|
-
export
|
|
77
|
+
export type SelectSeparatorProps = HTMLAttributes<HTMLDivElement>;
|
|
78
|
+
export declare const SelectSeparator: import("react").ForwardRefExoticComponent<SelectSeparatorProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
67
79
|
export {};
|
|
@@ -1,7 +1,16 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import
|
|
1
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
import type { FormControlProps } from '../../utils/primitiveProps';
|
|
3
3
|
import type { SxProp } from '../Layout/sx';
|
|
4
|
-
|
|
4
|
+
interface SwitchRootProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, 'value' | 'onChange' | 'checked' | 'defaultChecked' | 'type'>, FormControlProps {
|
|
5
|
+
/** Controlled checked state. */
|
|
6
|
+
checked?: boolean;
|
|
7
|
+
/** Uncontrolled initial checked state. */
|
|
8
|
+
defaultChecked?: boolean;
|
|
9
|
+
/** Fires when the checked state changes. */
|
|
10
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
11
|
+
/** Value submitted with the form when checked. Default: `'on'`. */
|
|
12
|
+
value?: string;
|
|
13
|
+
}
|
|
5
14
|
export interface SwitchProps extends Omit<SwitchRootProps, 'children'> {
|
|
6
15
|
children?: ReactNode;
|
|
7
16
|
/**
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { ComponentPropsWithoutRef, ReactNode } from 'react';
|
|
2
|
-
import * as RadixTabs from '@radix-ui/react-tabs';
|
|
3
2
|
import type { SxProp } from '../Layout/sx';
|
|
4
3
|
export type TabsVariant = 'line' | 'pills' | 'segmented';
|
|
5
4
|
export type TabsSize = 'sm' | 'md' | 'lg';
|
|
@@ -44,7 +43,11 @@ export interface TabsProps extends Omit<ComponentPropsWithoutRef<'div'>, 'dir'>
|
|
|
44
43
|
sx?: SxProp;
|
|
45
44
|
}
|
|
46
45
|
export declare const Tabs: import("react").ForwardRefExoticComponent<TabsProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
47
|
-
export
|
|
46
|
+
export interface TabsListProps extends ComponentPropsWithoutRef<'div'> {
|
|
47
|
+
/** Keep arrow-key navigation inside the list. Default: true. */
|
|
48
|
+
loop?: boolean;
|
|
49
|
+
}
|
|
50
|
+
export declare const TabsList: import("react").ForwardRefExoticComponent<TabsListProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
48
51
|
export interface TabsTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
49
52
|
/** Value identifying which panel this trigger activates. */
|
|
50
53
|
value: string;
|
|
@@ -54,4 +57,10 @@ export interface TabsTriggerProps extends ComponentPropsWithoutRef<'button'> {
|
|
|
54
57
|
badge?: ReactNode;
|
|
55
58
|
}
|
|
56
59
|
export declare const TabsTrigger: import("react").ForwardRefExoticComponent<TabsTriggerProps & import("react").RefAttributes<HTMLButtonElement>>;
|
|
57
|
-
export
|
|
60
|
+
export interface TabsContentProps extends ComponentPropsWithoutRef<'div'> {
|
|
61
|
+
/** Value of the trigger that reveals this panel. */
|
|
62
|
+
value: string;
|
|
63
|
+
/** Keep mounted while hidden (useful for forms and animations). */
|
|
64
|
+
forceMount?: true;
|
|
65
|
+
}
|
|
66
|
+
export declare const TabsContent: import("react").ForwardRefExoticComponent<TabsContentProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type { ReactNode } from 'react';
|
|
1
|
+
import type { FC, ReactNode } from 'react';
|
|
2
|
+
import type { OpenStateProps, PopperContentProps, TriggerProps } from '../../utils/primitiveProps';
|
|
2
3
|
import type { CSSProperties } from 'react';
|
|
3
|
-
import * as RadixTooltip from '@radix-ui/react-tooltip';
|
|
4
4
|
import type { SxProp } from '../Layout/sx';
|
|
5
5
|
/**
|
|
6
6
|
* Tooltip provider — wrap your app once. Controls the global delay so the
|
|
@@ -12,7 +12,16 @@ import type { SxProp } from '../Layout/sx';
|
|
|
12
12
|
* <App />
|
|
13
13
|
* </TooltipProvider>
|
|
14
14
|
*/
|
|
15
|
-
export
|
|
15
|
+
export interface TooltipProviderProps {
|
|
16
|
+
/** Delay before the first tooltip in a group opens, in ms. Default: 700. */
|
|
17
|
+
delayDuration?: number;
|
|
18
|
+
/** Window in which subsequent tooltips open instantly, in ms. Default: 300. */
|
|
19
|
+
skipDelayDuration?: number;
|
|
20
|
+
/** Prevent the content itself from keeping the tooltip open on hover. */
|
|
21
|
+
disableHoverableContent?: boolean;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const TooltipProvider: FC<TooltipProviderProps>;
|
|
16
25
|
export interface TooltipProps {
|
|
17
26
|
/** The element that triggers the tooltip on hover/focus. */
|
|
18
27
|
children: ReactNode;
|
|
@@ -51,6 +60,14 @@ export interface TooltipProps {
|
|
|
51
60
|
* </Tooltip>
|
|
52
61
|
*/
|
|
53
62
|
export declare const Tooltip: import("react").ForwardRefExoticComponent<TooltipProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
54
|
-
export
|
|
55
|
-
|
|
56
|
-
|
|
63
|
+
export interface TooltipRootProps extends Omit<OpenStateProps, 'modal'> {
|
|
64
|
+
/** Delay before opening, in ms. Overrides the provider default. */
|
|
65
|
+
delayDuration?: number;
|
|
66
|
+
/** Prevent the content itself from keeping the tooltip open on hover. */
|
|
67
|
+
disableHoverableContent?: boolean;
|
|
68
|
+
}
|
|
69
|
+
export declare const TooltipRoot: FC<TooltipRootProps>;
|
|
70
|
+
export type TooltipTriggerProps = TriggerProps;
|
|
71
|
+
export declare const TooltipTrigger: FC<TooltipTriggerProps>;
|
|
72
|
+
export type TooltipContentProps = PopperContentProps;
|
|
73
|
+
export declare const TooltipContent: import("react").ForwardRefExoticComponent<PopperContentProps & import("react").RefAttributes<HTMLDivElement>>;
|