asterui 0.12.13 → 0.12.15
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/Autocomplete.d.ts +22 -2
- package/dist/components/Button.d.ts +14 -5
- package/dist/components/Drawer.d.ts +47 -6
- package/dist/components/Dropdown.d.ts +65 -9
- package/dist/components/Form.d.ts +11 -1
- package/dist/components/Input.d.ts +15 -1
- package/dist/components/Modal.d.ts +5 -1
- package/dist/components/Navbar.d.ts +15 -1
- package/dist/components/Rating.d.ts +12 -4
- package/dist/components/SidebarDrawer.d.ts +21 -0
- package/dist/components/Tabs.d.ts +30 -4
- package/dist/index.d.ts +6 -4
- package/dist/index.js +169 -167
- package/dist/index.js.map +1 -1
- package/dist/index100.js +44 -11
- package/dist/index100.js.map +1 -1
- package/dist/index101.js +10 -12
- package/dist/index101.js.map +1 -1
- package/dist/index102.js +14 -7
- package/dist/index102.js.map +1 -1
- package/dist/index103.js +7 -12
- package/dist/index103.js.map +1 -1
- package/dist/index104.js +11 -29
- package/dist/index104.js.map +1 -1
- package/dist/index105.js +29 -16
- package/dist/index105.js.map +1 -1
- package/dist/index106.js +21 -0
- package/dist/index106.js.map +1 -0
- package/dist/index21.js +1 -1
- package/dist/index26.js +171 -40
- package/dist/index26.js.map +1 -1
- package/dist/index27.js +41 -17
- package/dist/index27.js.map +1 -1
- package/dist/index28.js +17 -33
- package/dist/index28.js.map +1 -1
- package/dist/index29.js +33 -52
- package/dist/index29.js.map +1 -1
- package/dist/index30.js +50 -61
- package/dist/index30.js.map +1 -1
- package/dist/index31.js +60 -181
- package/dist/index31.js.map +1 -1
- package/dist/index32.js +184 -18
- package/dist/index32.js.map +1 -1
- package/dist/index33.js +15 -217
- package/dist/index33.js.map +1 -1
- package/dist/index34.js +230 -1083
- package/dist/index34.js.map +1 -1
- package/dist/index35.js +1086 -16
- package/dist/index35.js.map +1 -1
- package/dist/index36.js +16 -121
- package/dist/index36.js.map +1 -1
- package/dist/index37.js +119 -37
- package/dist/index37.js.map +1 -1
- package/dist/index38.js +34 -208
- package/dist/index38.js.map +1 -1
- package/dist/index39.js +390 -89
- package/dist/index39.js.map +1 -1
- package/dist/index40.js +93 -158
- package/dist/index40.js.map +1 -1
- package/dist/index41.js +211 -135
- package/dist/index41.js.map +1 -1
- package/dist/index42.js +155 -15
- package/dist/index42.js.map +1 -1
- package/dist/index43.js +15 -17
- package/dist/index43.js.map +1 -1
- package/dist/index44.js +17 -21
- package/dist/index44.js.map +1 -1
- package/dist/index45.js +18 -134
- package/dist/index45.js.map +1 -1
- package/dist/index46.js +134 -10
- package/dist/index46.js.map +1 -1
- package/dist/index47.js +13 -35
- package/dist/index47.js.map +1 -1
- package/dist/index48.js +35 -34
- package/dist/index48.js.map +1 -1
- package/dist/index49.js +34 -81
- package/dist/index49.js.map +1 -1
- package/dist/index5.js +161 -80
- package/dist/index5.js.map +1 -1
- package/dist/index50.js +71 -166
- package/dist/index50.js.map +1 -1
- package/dist/index51.js +167 -144
- package/dist/index51.js.map +1 -1
- package/dist/index52.js +152 -11
- package/dist/index52.js.map +1 -1
- package/dist/index53.js +10 -20
- package/dist/index53.js.map +1 -1
- package/dist/index54.js +22 -14
- package/dist/index54.js.map +1 -1
- package/dist/index55.js +14 -7
- package/dist/index55.js.map +1 -1
- package/dist/index56.js +6 -310
- package/dist/index56.js.map +1 -1
- package/dist/index57.js +334 -17
- package/dist/index57.js.map +1 -1
- package/dist/index58.js +47 -122
- package/dist/index58.js.map +1 -1
- package/dist/index59.js +120 -108
- package/dist/index59.js.map +1 -1
- package/dist/index60.js +107 -167
- package/dist/index60.js.map +1 -1
- package/dist/index61.js +167 -29
- package/dist/index61.js.map +1 -1
- package/dist/index62.js +30 -120
- package/dist/index62.js.map +1 -1
- package/dist/index63.js +116 -80
- package/dist/index63.js.map +1 -1
- package/dist/index64.js +85 -19
- package/dist/index64.js.map +1 -1
- package/dist/index65.js +19 -73
- package/dist/index65.js.map +1 -1
- package/dist/index66.js +71 -54
- package/dist/index66.js.map +1 -1
- package/dist/index67.js +56 -44
- package/dist/index67.js.map +1 -1
- package/dist/index68.js +42 -49
- package/dist/index68.js.map +1 -1
- package/dist/index69.js +52 -62
- package/dist/index69.js.map +1 -1
- package/dist/index70.js +118 -102
- package/dist/index70.js.map +1 -1
- package/dist/index71.js +107 -41
- package/dist/index71.js.map +1 -1
- package/dist/index72.js +41 -68
- package/dist/index72.js.map +1 -1
- package/dist/index73.js +66 -19
- package/dist/index73.js.map +1 -1
- package/dist/index74.js +18 -55
- package/dist/index74.js.map +1 -1
- package/dist/index75.js +55 -251
- package/dist/index75.js.map +1 -1
- package/dist/index76.js +254 -22
- package/dist/index76.js.map +1 -1
- package/dist/index77.js +22 -31
- package/dist/index77.js.map +1 -1
- package/dist/index78.js +30 -93
- package/dist/index78.js.map +1 -1
- package/dist/index79.js +89 -324
- package/dist/index79.js.map +1 -1
- package/dist/index80.js +323 -50
- package/dist/index80.js.map +1 -1
- package/dist/index81.js +79 -39
- package/dist/index81.js.map +1 -1
- package/dist/index82.js +40 -23
- package/dist/index82.js.map +1 -1
- package/dist/index83.js +21 -93
- package/dist/index83.js.map +1 -1
- package/dist/index84.js +87 -148
- package/dist/index84.js.map +1 -1
- package/dist/index85.js +147 -152
- package/dist/index85.js.map +1 -1
- package/dist/index86.js +159 -63
- package/dist/index86.js.map +1 -1
- package/dist/index87.js +65 -35
- package/dist/index87.js.map +1 -1
- package/dist/index88.js +35 -234
- package/dist/index88.js.map +1 -1
- package/dist/index89.js +231 -31
- package/dist/index89.js.map +1 -1
- package/dist/index9.js +73 -46
- package/dist/index9.js.map +1 -1
- package/dist/index90.js +34 -210
- package/dist/index90.js.map +1 -1
- package/dist/index91.js +195 -198
- package/dist/index91.js.map +1 -1
- package/dist/index92.js +159 -241
- package/dist/index92.js.map +1 -1
- package/dist/index93.js +283 -166
- package/dist/index93.js.map +1 -1
- package/dist/index94.js +173 -253
- package/dist/index94.js.map +1 -1
- package/dist/index95.js +258 -14
- package/dist/index95.js.map +1 -1
- package/dist/index96.js +12 -31
- package/dist/index96.js.map +1 -1
- package/dist/index97.js +32 -5
- package/dist/index97.js.map +1 -1
- package/dist/index98.js +5 -13
- package/dist/index98.js.map +1 -1
- package/dist/index99.js +11 -43
- package/dist/index99.js.map +1 -1
- package/package.json +1 -1
|
@@ -2,17 +2,37 @@ import { default as React } from 'react';
|
|
|
2
2
|
export interface AutocompleteOption {
|
|
3
3
|
value: string;
|
|
4
4
|
label: string;
|
|
5
|
+
disabled?: boolean;
|
|
5
6
|
}
|
|
6
|
-
export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
7
|
+
export interface AutocompleteProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'onSelect'> {
|
|
7
8
|
value?: string;
|
|
8
9
|
defaultValue?: string;
|
|
9
10
|
onChange?: (value: string) => void;
|
|
11
|
+
onSelect?: (value: string, option: AutocompleteOption) => void;
|
|
12
|
+
onSearch?: (value: string) => void;
|
|
10
13
|
options: AutocompleteOption[] | string[];
|
|
11
14
|
placeholder?: string;
|
|
12
15
|
disabled?: boolean;
|
|
13
|
-
size?: 'xs' | 'sm' | 'md' | 'lg';
|
|
16
|
+
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
17
|
+
color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error';
|
|
18
|
+
/** Validation status */
|
|
19
|
+
status?: 'error' | 'warning';
|
|
14
20
|
allowCustomValue?: boolean;
|
|
15
21
|
filterOption?: (option: AutocompleteOption, inputValue: string) => boolean;
|
|
16
22
|
notFoundContent?: React.ReactNode;
|
|
23
|
+
/** Show clear button when input has value */
|
|
24
|
+
allowClear?: boolean | {
|
|
25
|
+
clearIcon?: React.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
/** Callback when clear button is clicked */
|
|
28
|
+
onClear?: () => void;
|
|
29
|
+
/** Controlled open state */
|
|
30
|
+
open?: boolean;
|
|
31
|
+
/** Default open state */
|
|
32
|
+
defaultOpen?: boolean;
|
|
33
|
+
/** Callback when open state changes */
|
|
34
|
+
onOpenChange?: (open: boolean) => void;
|
|
35
|
+
/** Activate first option by default */
|
|
36
|
+
defaultActiveFirstOption?: boolean;
|
|
17
37
|
}
|
|
18
38
|
export declare const Autocomplete: React.FC<AutocompleteProps>;
|
|
@@ -1,20 +1,27 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
type BaseButtonProps = {
|
|
3
|
-
|
|
3
|
+
/** Button color */
|
|
4
|
+
color?: 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error' | 'neutral';
|
|
5
|
+
/** Button style variant */
|
|
6
|
+
variant?: 'solid' | 'outline' | 'dash' | 'soft' | 'ghost' | 'link';
|
|
7
|
+
/** Button size */
|
|
4
8
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
|
-
|
|
6
|
-
dash?: boolean;
|
|
7
|
-
soft?: boolean;
|
|
9
|
+
/** Active/pressed visual state */
|
|
8
10
|
active?: boolean;
|
|
11
|
+
/** Show loading spinner and disable button */
|
|
9
12
|
loading?: boolean;
|
|
13
|
+
/** Button shape */
|
|
10
14
|
shape?: 'square' | 'circle' | 'wide' | 'block' | 'round';
|
|
15
|
+
/** Disable click animation */
|
|
11
16
|
noAnimation?: boolean;
|
|
12
17
|
/** Icon element to display */
|
|
13
18
|
icon?: React.ReactNode;
|
|
14
19
|
/** Position of the icon */
|
|
15
20
|
iconPosition?: 'start' | 'end';
|
|
16
|
-
/** Applies error/danger styling (shorthand for
|
|
21
|
+
/** Applies error/danger styling (shorthand for color="error") */
|
|
17
22
|
danger?: boolean;
|
|
23
|
+
/** Toggle button pressed state (sets aria-pressed) */
|
|
24
|
+
pressed?: boolean;
|
|
18
25
|
};
|
|
19
26
|
type ButtonAsButton = BaseButtonProps & Omit<React.ButtonHTMLAttributes<HTMLButtonElement>, 'type'> & {
|
|
20
27
|
href?: undefined;
|
|
@@ -23,6 +30,8 @@ type ButtonAsButton = BaseButtonProps & Omit<React.ButtonHTMLAttributes<HTMLButt
|
|
|
23
30
|
type ButtonAsAnchor = BaseButtonProps & Omit<React.AnchorHTMLAttributes<HTMLAnchorElement>, 'type'> & {
|
|
24
31
|
href: string;
|
|
25
32
|
htmlType?: undefined;
|
|
33
|
+
/** Disable the link button */
|
|
34
|
+
disabled?: boolean;
|
|
26
35
|
};
|
|
27
36
|
export type ButtonProps = ButtonAsButton | ButtonAsAnchor;
|
|
28
37
|
export declare const Button: React.FC<ButtonProps>;
|
|
@@ -1,10 +1,51 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type DrawerPlacement = 'top' | 'right' | 'bottom' | 'left';
|
|
3
|
+
export type DrawerSize = 'default' | 'large' | number;
|
|
4
|
+
export interface DrawerProps {
|
|
5
|
+
/** Drawer content */
|
|
3
6
|
children: React.ReactNode;
|
|
4
|
-
|
|
7
|
+
/** Whether the drawer is visible */
|
|
5
8
|
open?: boolean;
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
/** Callback when drawer is closed */
|
|
10
|
+
onClose?: () => void;
|
|
11
|
+
/** Drawer title */
|
|
12
|
+
title?: React.ReactNode;
|
|
13
|
+
/** Direction drawer slides from */
|
|
14
|
+
placement?: DrawerPlacement;
|
|
15
|
+
/** Preset size or custom width/height in pixels */
|
|
16
|
+
size?: DrawerSize;
|
|
17
|
+
/** Custom width (overrides size for left/right placement) */
|
|
18
|
+
width?: number | string;
|
|
19
|
+
/** Custom height (overrides size for top/bottom placement) */
|
|
20
|
+
height?: number | string;
|
|
21
|
+
/** Whether to show close button */
|
|
22
|
+
closable?: boolean;
|
|
23
|
+
/** Whether to show mask/backdrop */
|
|
24
|
+
mask?: boolean;
|
|
25
|
+
/** Whether clicking mask closes drawer */
|
|
26
|
+
maskClosable?: boolean;
|
|
27
|
+
/** Whether ESC closes drawer */
|
|
28
|
+
keyboard?: boolean;
|
|
29
|
+
/** Footer content */
|
|
30
|
+
footer?: React.ReactNode;
|
|
31
|
+
/** Extra content in header (right side) */
|
|
32
|
+
extra?: React.ReactNode;
|
|
33
|
+
/** CSS class for drawer panel */
|
|
34
|
+
className?: string;
|
|
35
|
+
/** CSS class for drawer wrapper */
|
|
36
|
+
rootClassName?: string;
|
|
37
|
+
/** Style for drawer panel */
|
|
38
|
+
style?: React.CSSProperties;
|
|
39
|
+
/** z-index of drawer */
|
|
40
|
+
zIndex?: number;
|
|
41
|
+
/** Destroy content when closed */
|
|
42
|
+
destroyOnClose?: boolean;
|
|
43
|
+
/** Where to place initial focus */
|
|
44
|
+
initialFocus?: 'close' | 'content';
|
|
9
45
|
}
|
|
10
|
-
|
|
46
|
+
/**
|
|
47
|
+
* Drawer - A panel that slides in from the edge of the screen.
|
|
48
|
+
* Use for forms, details, or task panels.
|
|
49
|
+
* For responsive sidebar navigation, use SidebarDrawer instead.
|
|
50
|
+
*/
|
|
51
|
+
export declare function Drawer({ children, open, onClose, title, placement, size, width, height, closable, mask, maskClosable, keyboard, footer, extra, className, rootClassName, style, zIndex, destroyOnClose, initialFocus, }: DrawerProps): React.ReactPortal | null;
|
|
@@ -1,28 +1,67 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export
|
|
3
|
-
|
|
2
|
+
export type DropdownTriggerType = 'click' | 'hover' | 'contextMenu';
|
|
3
|
+
export interface DropdownMenuItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: React.ReactNode;
|
|
6
|
+
icon?: React.ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
danger?: boolean;
|
|
9
|
+
onClick?: () => void;
|
|
10
|
+
children?: DropdownMenuItem[];
|
|
11
|
+
}
|
|
12
|
+
export interface DropdownMenuDivider {
|
|
13
|
+
type: 'divider';
|
|
14
|
+
key?: string;
|
|
15
|
+
}
|
|
16
|
+
export type DropdownMenuItemType = DropdownMenuItem | DropdownMenuDivider;
|
|
17
|
+
export interface DropdownProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
18
|
+
/** Trigger element and dropdown content (compound pattern) */
|
|
19
|
+
children?: React.ReactNode;
|
|
20
|
+
/** Menu items (data-driven pattern) */
|
|
21
|
+
items?: DropdownMenuItemType[];
|
|
22
|
+
/** @deprecated Use trigger={['hover']} instead */
|
|
4
23
|
hover?: boolean;
|
|
24
|
+
/** Trigger mode(s) for dropdown */
|
|
25
|
+
trigger?: DropdownTriggerType[];
|
|
5
26
|
position?: 'top' | 'bottom' | 'left' | 'right';
|
|
6
27
|
align?: 'start' | 'center' | 'end';
|
|
7
28
|
/** Controlled open state */
|
|
8
29
|
open?: boolean;
|
|
9
30
|
/** Callback when open state changes */
|
|
10
|
-
onOpenChange?: (open: boolean
|
|
31
|
+
onOpenChange?: (open: boolean, info?: {
|
|
32
|
+
source: 'trigger' | 'menu';
|
|
33
|
+
}) => void;
|
|
11
34
|
/** Disable the dropdown */
|
|
12
35
|
disabled?: boolean;
|
|
13
36
|
/** Show arrow pointing to trigger */
|
|
14
|
-
arrow?: boolean
|
|
37
|
+
arrow?: boolean | {
|
|
38
|
+
pointAtCenter?: boolean;
|
|
39
|
+
};
|
|
40
|
+
/** Delay before showing dropdown on hover (seconds) */
|
|
41
|
+
mouseEnterDelay?: number;
|
|
42
|
+
/** Delay before hiding dropdown on mouse leave (seconds) */
|
|
43
|
+
mouseLeaveDelay?: number;
|
|
44
|
+
/** Container for the dropdown menu */
|
|
45
|
+
getPopupContainer?: (triggerNode: HTMLElement) => HTMLElement;
|
|
46
|
+
/** Destroy dropdown when hidden */
|
|
47
|
+
destroyOnHidden?: boolean;
|
|
15
48
|
}
|
|
16
49
|
export interface DropdownTriggerProps {
|
|
17
50
|
children: React.ReactNode;
|
|
18
51
|
className?: string;
|
|
19
52
|
}
|
|
20
53
|
export interface DropdownMenuProps {
|
|
21
|
-
children
|
|
54
|
+
children?: React.ReactNode;
|
|
22
55
|
className?: string;
|
|
23
56
|
}
|
|
24
57
|
export interface DropdownItemProps {
|
|
25
|
-
children
|
|
58
|
+
children?: React.ReactNode;
|
|
59
|
+
/** Unique key for the item */
|
|
60
|
+
itemKey?: string;
|
|
61
|
+
/** Icon to display before label */
|
|
62
|
+
icon?: React.ReactNode;
|
|
63
|
+
/** Item label (alternative to children) */
|
|
64
|
+
label?: React.ReactNode;
|
|
26
65
|
onClick?: () => void;
|
|
27
66
|
active?: boolean;
|
|
28
67
|
disabled?: boolean;
|
|
@@ -30,18 +69,35 @@ export interface DropdownItemProps {
|
|
|
30
69
|
className?: string;
|
|
31
70
|
_index?: number;
|
|
32
71
|
}
|
|
72
|
+
export interface DropdownSubMenuProps {
|
|
73
|
+
children: React.ReactNode;
|
|
74
|
+
/** Unique key for the submenu */
|
|
75
|
+
itemKey?: string;
|
|
76
|
+
/** Submenu title/label */
|
|
77
|
+
title: React.ReactNode;
|
|
78
|
+
/** Icon to display before title */
|
|
79
|
+
icon?: React.ReactNode;
|
|
80
|
+
disabled?: boolean;
|
|
81
|
+
className?: string;
|
|
82
|
+
}
|
|
33
83
|
export interface DropdownDividerProps {
|
|
34
84
|
className?: string;
|
|
35
85
|
}
|
|
36
|
-
declare function DropdownRoot({ children, hover, position, align, open: controlledOpen, onOpenChange, disabled, arrow, className, ...rest }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
37
|
-
declare function DropdownTrigger({ children, className }: DropdownTriggerProps):
|
|
86
|
+
declare function DropdownRoot({ children, items, hover, trigger, position, align, open: controlledOpen, onOpenChange, disabled, arrow, mouseEnterDelay, mouseLeaveDelay, getPopupContainer, destroyOnHidden, className, ...rest }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
87
|
+
declare function DropdownTrigger({ children, className }: DropdownTriggerProps): React.ReactElement<React.HTMLAttributes<HTMLElement> & {
|
|
88
|
+
onClick?: (e: React.MouseEvent) => void;
|
|
89
|
+
onKeyDown?: (e: React.KeyboardEvent) => void;
|
|
90
|
+
className?: string;
|
|
91
|
+
}, string | React.JSXElementConstructor<any>>;
|
|
38
92
|
declare function DropdownMenu({ children, className }: DropdownMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
-
declare function DropdownItem({ children, onClick, active, disabled, danger, className, }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
93
|
+
declare function DropdownItem({ children, itemKey, icon, label, onClick, active, disabled, danger, className, }: DropdownItemProps): import("react/jsx-runtime").JSX.Element;
|
|
94
|
+
declare function DropdownSubMenu({ children, itemKey, title, icon, disabled, className, }: DropdownSubMenuProps): import("react/jsx-runtime").JSX.Element;
|
|
40
95
|
declare function DropdownDivider({ className }: DropdownDividerProps): import("react/jsx-runtime").JSX.Element;
|
|
41
96
|
export declare const Dropdown: typeof DropdownRoot & {
|
|
42
97
|
Trigger: typeof DropdownTrigger;
|
|
43
98
|
Menu: typeof DropdownMenu;
|
|
44
99
|
Item: typeof DropdownItem;
|
|
100
|
+
SubMenu: typeof DropdownSubMenu;
|
|
45
101
|
Divider: typeof DropdownDivider;
|
|
46
102
|
};
|
|
47
103
|
export {};
|
|
@@ -3,11 +3,21 @@ import { UseFormReturn, FieldValues, SubmitHandler, UseFormProps, FieldArrayPath
|
|
|
3
3
|
export interface FormProps<TFieldValues extends FieldValues = FieldValues> extends Omit<React.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {
|
|
4
4
|
form?: UseFormReturn<TFieldValues>;
|
|
5
5
|
onFinish?: SubmitHandler<TFieldValues>;
|
|
6
|
+
/** Called when form validation fails */
|
|
7
|
+
onFinishFailed?: (errorInfo: {
|
|
8
|
+
values: TFieldValues;
|
|
9
|
+
errorFields: Array<{
|
|
10
|
+
name: string;
|
|
11
|
+
errors: string[];
|
|
12
|
+
}>;
|
|
13
|
+
}) => void;
|
|
6
14
|
initialValues?: UseFormProps<TFieldValues>['defaultValues'];
|
|
7
15
|
layout?: 'vertical' | 'horizontal' | 'inline';
|
|
8
16
|
/** Label width in pixels for horizontal layout (default: 80) */
|
|
9
17
|
labelWidth?: number;
|
|
10
18
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
19
|
+
/** Disable all form fields */
|
|
20
|
+
disabled?: boolean;
|
|
11
21
|
children: React.ReactNode;
|
|
12
22
|
}
|
|
13
23
|
export interface FormRule {
|
|
@@ -62,7 +72,7 @@ export interface FormListProps<TFieldValues extends FieldValues = FieldValues> {
|
|
|
62
72
|
move: (from: number, to: number) => void;
|
|
63
73
|
}) => React.ReactNode;
|
|
64
74
|
}
|
|
65
|
-
declare function FormRoot<TFieldValues extends FieldValues = FieldValues>({ form: externalForm, onFinish, initialValues, layout, labelWidth, size, children, className, noValidate, ...props }: FormProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
|
|
75
|
+
declare function FormRoot<TFieldValues extends FieldValues = FieldValues>({ form: externalForm, onFinish, onFinishFailed, initialValues, layout, labelWidth, size, disabled, children, className, noValidate, ...props }: FormProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
|
|
66
76
|
declare function FormItem({ name, label, help, required, rules, valuePropName, inline, className, children, tooltip, extra, hasFeedback, dependencies, validateTrigger, initialValue, hidden, }: FormItemProps): import("react/jsx-runtime").JSX.Element;
|
|
67
77
|
declare function FormList<TFieldValues extends FieldValues = FieldValues>({ name, children, }: FormListProps<TFieldValues>): import("react/jsx-runtime").JSX.Element;
|
|
68
78
|
export declare function useFormInstance<TFieldValues extends FieldValues = FieldValues>(): UseFormReturn<TFieldValues, any, TFieldValues> & {
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size'> {
|
|
2
|
+
export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix'> {
|
|
3
3
|
type?: 'text' | 'password' | 'email' | 'number' | 'date' | 'datetime-local' | 'week' | 'month' | 'tel' | 'url' | 'search' | 'time';
|
|
4
4
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
5
5
|
color?: 'neutral' | 'primary' | 'secondary' | 'accent' | 'info' | 'success' | 'warning' | 'error';
|
|
6
|
+
/** Validation status */
|
|
7
|
+
status?: 'error' | 'warning';
|
|
6
8
|
ghost?: boolean;
|
|
7
9
|
bordered?: boolean;
|
|
8
10
|
className?: string;
|
|
@@ -10,5 +12,17 @@ export interface InputProps extends Omit<React.InputHTMLAttributes<HTMLInputElem
|
|
|
10
12
|
mask?: string;
|
|
11
13
|
/** Placeholder character shown in mask (default: _) */
|
|
12
14
|
maskPlaceholder?: string;
|
|
15
|
+
/** Show clear button when input has value */
|
|
16
|
+
allowClear?: boolean | {
|
|
17
|
+
clearIcon?: React.ReactNode;
|
|
18
|
+
};
|
|
19
|
+
/** Callback when clear button is clicked */
|
|
20
|
+
onClear?: () => void;
|
|
21
|
+
/** Prefix icon or element */
|
|
22
|
+
prefix?: React.ReactNode;
|
|
23
|
+
/** Suffix icon or element */
|
|
24
|
+
suffix?: React.ReactNode;
|
|
25
|
+
/** ID for error message element (for aria-describedby) */
|
|
26
|
+
errorId?: string;
|
|
13
27
|
}
|
|
14
28
|
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -23,6 +23,10 @@ export interface ModalProps extends Omit<React.HTMLAttributes<HTMLDialogElement>
|
|
|
23
23
|
centered?: boolean;
|
|
24
24
|
/** Callback when modal is closed */
|
|
25
25
|
onClose?: () => void;
|
|
26
|
+
/** Where to place initial focus: 'ok', 'cancel', or 'close' button */
|
|
27
|
+
initialFocus?: 'ok' | 'cancel' | 'close';
|
|
28
|
+
/** Use alertdialog role for urgent messages */
|
|
29
|
+
alertDialog?: boolean;
|
|
26
30
|
}
|
|
27
31
|
export interface ModalFuncProps {
|
|
28
32
|
title?: React.ReactNode;
|
|
@@ -33,7 +37,7 @@ export interface ModalFuncProps {
|
|
|
33
37
|
cancelText?: string;
|
|
34
38
|
type?: 'info' | 'success' | 'warning' | 'error';
|
|
35
39
|
}
|
|
36
|
-
export declare function Modal({ children, title, footer, open, onOk, onCancel, okText, cancelText, maskClosable, closable, position, align, width, centered, onClose, className, ...rest }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function Modal({ children, title, footer, open, onOk, onCancel, okText, cancelText, maskClosable, closable, position, align, width, centered, onClose, initialFocus, alertDialog, className, ...rest }: ModalProps): import("react/jsx-runtime").JSX.Element;
|
|
37
41
|
export declare namespace Modal {
|
|
38
42
|
var confirm: (config: ModalFuncProps) => {
|
|
39
43
|
destroy: () => void;
|
|
@@ -1,8 +1,22 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type NavbarColor = 'base' | 'neutral' | 'primary' | 'secondary' | 'accent';
|
|
3
|
+
export type NavbarShadow = 'none' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export type NavbarRounded = 'none' | 'sm' | 'md' | 'lg' | 'xl' | 'full';
|
|
5
|
+
export interface NavbarProps extends Omit<React.HTMLAttributes<HTMLElement>, 'color'> {
|
|
3
6
|
children?: React.ReactNode;
|
|
7
|
+
/** Content for the start section of the navbar (typically logo/brand) */
|
|
4
8
|
start?: React.ReactNode;
|
|
9
|
+
/** Content for the center section of the navbar */
|
|
5
10
|
center?: React.ReactNode;
|
|
11
|
+
/** Content for the end section of the navbar (typically actions/menu) */
|
|
6
12
|
end?: React.ReactNode;
|
|
13
|
+
/** Background color variant */
|
|
14
|
+
color?: NavbarColor;
|
|
15
|
+
/** Make navbar sticky at the top */
|
|
16
|
+
sticky?: boolean;
|
|
17
|
+
/** Shadow depth */
|
|
18
|
+
shadow?: NavbarShadow;
|
|
19
|
+
/** Border radius */
|
|
20
|
+
rounded?: NavbarRounded;
|
|
7
21
|
}
|
|
8
22
|
export declare const Navbar: React.FC<NavbarProps>;
|
|
@@ -1,21 +1,29 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
export interface RatingProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
3
|
-
children
|
|
3
|
+
children?: React.ReactNode;
|
|
4
4
|
value?: number;
|
|
5
5
|
defaultValue?: number;
|
|
6
6
|
onChange?: (value: number) => void;
|
|
7
|
+
onHoverChange?: (value: number) => void;
|
|
8
|
+
count?: number;
|
|
7
9
|
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
8
|
-
|
|
10
|
+
gap?: 'none' | 'xs' | 'sm' | 'md' | 'lg';
|
|
11
|
+
color?: string;
|
|
12
|
+
mask?: 'star' | 'star-2' | 'heart';
|
|
13
|
+
allowClear?: boolean;
|
|
14
|
+
allowHalf?: boolean;
|
|
15
|
+
disabled?: boolean;
|
|
9
16
|
}
|
|
10
17
|
export interface RatingItemProps {
|
|
11
18
|
value: number;
|
|
12
19
|
mask?: 'star' | 'star-2' | 'heart';
|
|
13
20
|
color?: string;
|
|
14
21
|
hidden?: boolean;
|
|
22
|
+
half?: 'first' | 'second';
|
|
15
23
|
className?: string;
|
|
16
24
|
}
|
|
17
|
-
declare function RatingRoot({ children, value, defaultValue, onChange, size,
|
|
18
|
-
declare function RatingItem({ value, mask, color, hidden, className }: RatingItemProps): import("react/jsx-runtime").JSX.Element;
|
|
25
|
+
declare function RatingRoot({ children, value, defaultValue, onChange, onHoverChange, count, size, gap, color, mask, allowClear, allowHalf, disabled, className, ...rest }: RatingProps): import("react/jsx-runtime").JSX.Element;
|
|
26
|
+
declare function RatingItem({ value, mask, color, hidden, half, className }: RatingItemProps): import("react/jsx-runtime").JSX.Element;
|
|
19
27
|
export declare const Rating: typeof RatingRoot & {
|
|
20
28
|
Item: typeof RatingItem;
|
|
21
29
|
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
export interface SidebarDrawerProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
3
|
+
/** Main content area */
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
/** Sidebar content */
|
|
6
|
+
sidebar: React.ReactNode;
|
|
7
|
+
/** Controlled open state */
|
|
8
|
+
open?: boolean;
|
|
9
|
+
/** Callback when open state changes */
|
|
10
|
+
onOpenChange?: (open: boolean) => void;
|
|
11
|
+
/** Position sidebar on the right side */
|
|
12
|
+
end?: boolean;
|
|
13
|
+
/** Additional classes for sidebar container */
|
|
14
|
+
sidebarClassName?: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* SidebarDrawer - A responsive sidebar layout component using DaisyUI's drawer.
|
|
18
|
+
* Use for navigation sidebars that toggle on mobile.
|
|
19
|
+
* For overlay panel drawers (forms, details), use the Drawer component instead.
|
|
20
|
+
*/
|
|
21
|
+
export declare const SidebarDrawer: React.FC<SidebarDrawerProps>;
|
|
@@ -1,19 +1,45 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
export type TabsVariant = 'box' | 'border' | 'lift';
|
|
3
|
+
export type TabsSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export type TabsPosition = 'top' | 'bottom';
|
|
5
|
+
export interface TabItem {
|
|
6
|
+
key: string;
|
|
7
|
+
label: React.ReactNode;
|
|
8
|
+
children?: React.ReactNode;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
icon?: React.ReactNode;
|
|
11
|
+
}
|
|
2
12
|
export interface TabsProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
3
|
-
|
|
13
|
+
/** Tab panels (compound pattern) */
|
|
14
|
+
children?: React.ReactNode;
|
|
15
|
+
/** Tab items (data-driven pattern) */
|
|
16
|
+
items?: TabItem[];
|
|
17
|
+
/** Current active tab key (controlled) */
|
|
4
18
|
activeKey?: string;
|
|
19
|
+
/** Default active tab key (uncontrolled) */
|
|
5
20
|
defaultActiveKey?: string;
|
|
21
|
+
/** Callback when tab changes */
|
|
6
22
|
onChange?: (key: string) => void;
|
|
7
|
-
|
|
8
|
-
|
|
23
|
+
/** Visual style variant */
|
|
24
|
+
variant?: TabsVariant;
|
|
25
|
+
/** Tab size */
|
|
26
|
+
size?: TabsSize;
|
|
27
|
+
/** Tab position relative to content */
|
|
28
|
+
position?: TabsPosition;
|
|
9
29
|
}
|
|
10
30
|
export interface TabPanelProps {
|
|
31
|
+
/** Tab button label */
|
|
11
32
|
tab: React.ReactNode;
|
|
33
|
+
/** Unique identifier for the tab */
|
|
12
34
|
tabKey: string;
|
|
35
|
+
/** Disable the tab */
|
|
13
36
|
disabled?: boolean;
|
|
37
|
+
/** Tab panel content */
|
|
14
38
|
children?: React.ReactNode;
|
|
39
|
+
/** Tab icon */
|
|
40
|
+
icon?: React.ReactNode;
|
|
15
41
|
}
|
|
16
|
-
declare function TabsRoot({ children, activeKey, defaultActiveKey, onChange, variant, size, className, ...rest }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
42
|
+
declare function TabsRoot({ children, items, activeKey, defaultActiveKey, onChange, variant, size, position, className, ...rest }: TabsProps): import("react/jsx-runtime").JSX.Element;
|
|
17
43
|
declare function TabPanel({ children }: TabPanelProps): import("react/jsx-runtime").JSX.Element;
|
|
18
44
|
export declare const Tabs: typeof TabsRoot & {
|
|
19
45
|
Panel: typeof TabPanel;
|
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,9 @@ export type { DockProps, DockItemProps, DockItemConfig } from './components/Dock
|
|
|
47
47
|
export { Divider } from './components/Divider';
|
|
48
48
|
export type { DividerProps } from './components/Divider';
|
|
49
49
|
export { Drawer } from './components/Drawer';
|
|
50
|
-
export type { DrawerProps } from './components/Drawer';
|
|
50
|
+
export type { DrawerProps, DrawerPlacement, DrawerSize } from './components/Drawer';
|
|
51
|
+
export { SidebarDrawer } from './components/SidebarDrawer';
|
|
52
|
+
export type { SidebarDrawerProps } from './components/SidebarDrawer';
|
|
51
53
|
export { Fieldset } from './components/Fieldset';
|
|
52
54
|
export type { FieldsetProps, FieldsetLegendProps } from './components/Fieldset';
|
|
53
55
|
export { FileInput } from './components/FileInput';
|
|
@@ -71,7 +73,7 @@ export type { ImageProps } from './components/Image';
|
|
|
71
73
|
export { Indicator } from './components/Indicator';
|
|
72
74
|
export type { IndicatorProps, IndicatorPosition } from './components/Indicator';
|
|
73
75
|
export { Dropdown } from './components/Dropdown';
|
|
74
|
-
export type { DropdownProps, DropdownTriggerProps, DropdownMenuProps, DropdownItemProps, DropdownDividerProps } from './components/Dropdown';
|
|
76
|
+
export type { DropdownProps, DropdownTriggerProps, DropdownMenuProps, DropdownItemProps, DropdownSubMenuProps, DropdownDividerProps, DropdownMenuItem, DropdownMenuDivider, DropdownMenuItemType, DropdownTriggerType, } from './components/Dropdown';
|
|
75
77
|
export { Empty } from './components/Empty';
|
|
76
78
|
export type { EmptyProps } from './components/Empty';
|
|
77
79
|
export { Input } from './components/Input';
|
|
@@ -109,7 +111,7 @@ export type { WindowProps } from './components/Window';
|
|
|
109
111
|
export { Modal } from './components/Modal';
|
|
110
112
|
export type { ModalProps, ModalFuncProps, ModalPosition, ModalAlign, ResponsivePosition } from './components/Modal';
|
|
111
113
|
export { Navbar } from './components/Navbar';
|
|
112
|
-
export type { NavbarProps } from './components/Navbar';
|
|
114
|
+
export type { NavbarProps, NavbarColor, NavbarShadow, NavbarRounded } from './components/Navbar';
|
|
113
115
|
export { notification } from './components/Notification';
|
|
114
116
|
export type { NotificationConfig, NotificationType, NotificationPlacement } from './components/Notification';
|
|
115
117
|
export { OTPInput } from './components/OTPInput';
|
|
@@ -155,7 +157,7 @@ export type { StepsProps, StepProps, StepItem, StepsDirection } from './componen
|
|
|
155
157
|
export { Table } from './components/Table';
|
|
156
158
|
export type { TableProps, ColumnType, PaginationConfig, FilterConfig, RowSelection } from './components/Table';
|
|
157
159
|
export { Tabs } from './components/Tabs';
|
|
158
|
-
export type { TabsProps, TabPanelProps } from './components/Tabs';
|
|
160
|
+
export type { TabsProps, TabPanelProps, TabItem, TabsVariant, TabsSize, TabsPosition } from './components/Tabs';
|
|
159
161
|
export { Textarea } from './components/Textarea';
|
|
160
162
|
export type { TextareaProps } from './components/Textarea';
|
|
161
163
|
export { TextRotate } from './components/TextRotate';
|