@zango-core/components 0.2.0-rc.2 → 0.2.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/LICENSE +21 -0
- package/NOTICE +29 -0
- package/README.md +56 -376
- package/dist/components/Accordion/Accordion.d.ts +3 -1
- package/dist/components/Accordion/index.d.ts +1 -1
- package/dist/components/Alert/Alert.d.ts +14 -0
- package/dist/components/Alert/index.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +13 -0
- package/dist/components/Avatar/index.d.ts +1 -1
- package/dist/components/Badge/Badge.d.ts +8 -1
- package/dist/components/Badge/index.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +24 -1
- package/dist/components/Button/index.d.ts +1 -1
- package/dist/components/Card/Card.d.ts +34 -0
- package/dist/components/Card/index.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +6 -0
- package/dist/components/ContextMenu/ContextMenu.d.ts +33 -1
- package/dist/components/ContextMenu/index.d.ts +1 -1
- package/dist/components/Dialog/index.d.ts +1 -1
- package/dist/components/Divider/Divider.d.ts +12 -0
- package/dist/components/Divider/index.d.ts +1 -1
- package/dist/components/Drawer/Drawer.d.ts +2 -0
- package/dist/components/Drawer/index.d.ts +1 -1
- package/dist/components/Empty/Empty.d.ts +9 -0
- package/dist/components/Empty/index.d.ts +1 -1
- package/dist/components/Form/Form.d.ts +34 -0
- package/dist/components/Form/index.d.ts +1 -1
- package/dist/components/FormWidgets/index.d.ts +4 -4
- package/dist/components/InfoSection/InfoSection.d.ts +35 -0
- package/dist/components/InfoSection/index.d.ts +1 -1
- package/dist/components/Input/Input.d.ts +12 -1
- package/dist/components/Layout/Layout.d.ts +36 -0
- package/dist/components/Layout/index.d.ts +1 -1
- package/dist/components/Loader/Loader.d.ts +0 -1
- package/dist/components/Loader/index.d.ts +1 -0
- package/dist/components/MobileInput/MobileInput.d.ts +9 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +6 -1
- package/dist/components/PhoneNumberInput/PhoneNumberInput.d.ts +45 -0
- package/dist/components/PhoneNumberInput/PhoneNumberInput.example.d.ts +7 -5
- package/dist/components/PhoneNumberInput/index.d.ts +1 -1
- package/dist/components/Progress/Progress.d.ts +18 -0
- package/dist/components/Progress/index.d.ts +1 -1
- package/dist/components/Result/Result.d.ts +11 -0
- package/dist/components/Result/index.d.ts +1 -1
- package/dist/components/Segmented/Segmented.d.ts +16 -0
- package/dist/components/Segmented/index.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +30 -2
- package/dist/components/Select/index.d.ts +1 -1
- package/dist/components/Space/Space.d.ts +11 -0
- package/dist/components/Space/index.d.ts +1 -1
- package/dist/components/Spin/Spin.d.ts +10 -0
- package/dist/components/Spin/index.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +18 -0
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tag/Tag.d.ts +11 -0
- package/dist/components/Tag/index.d.ts +1 -1
- package/dist/components/Textarea/Textarea.d.ts +7 -0
- package/dist/components/Timeline/Timeline.d.ts +31 -6
- package/dist/components/Timeline/index.d.ts +1 -1
- package/dist/components/Toast/Toast.d.ts +29 -0
- package/dist/components/Toast/index.d.ts +1 -1
- package/dist/components/Typography/Typography.d.ts +26 -1
- package/dist/components/Typography/index.d.ts +1 -1
- package/dist/demo/App.d.ts +1 -1
- package/dist/index.d.ts +45 -46
- package/dist/test/axe.d.ts +1 -0
- package/dist/test/setup.d.ts +1 -0
- package/dist/utils/cn.d.ts +6 -0
- package/dist/utils/gradient.d.ts +30 -0
- package/dist/zango-components.js +5897 -4263
- package/dist/zango-components.js.map +1 -1
- package/dist/zango-components.umd.cjs +37 -98
- package/dist/zango-components.umd.cjs.map +1 -1
- package/package.json +70 -28
- package/dist/components/Message/Message.d.ts +0 -35
- package/dist/components/Message/index.d.ts +0 -2
|
@@ -1,15 +1,49 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
import { GradientDirection, GradientType } from '../../utils/gradient';
|
|
2
3
|
|
|
3
4
|
export interface CardProps {
|
|
5
|
+
/** Main content rendered in the card body */
|
|
4
6
|
children: React.ReactNode;
|
|
7
|
+
/** Additional className for the root element */
|
|
5
8
|
className?: string;
|
|
9
|
+
/** Inline styles for the root element */
|
|
6
10
|
style?: React.CSSProperties;
|
|
11
|
+
/** Surface style. 'gradient' renders a gradient background instead of white. */
|
|
12
|
+
variant?: 'default' | 'gradient';
|
|
13
|
+
/**
|
|
14
|
+
* Preset gradient stops; only applies when variant is "gradient".
|
|
15
|
+
* 'soft' = brand-50→white, 'solid' = brand-500→brand-700 (default).
|
|
16
|
+
*/
|
|
17
|
+
gradientType?: GradientType;
|
|
18
|
+
/** Custom gradient start color (any CSS color). Requires gradientTo; overrides gradientType. */
|
|
19
|
+
gradientFrom?: string;
|
|
20
|
+
/** Custom gradient end color (any CSS color). Requires gradientFrom; overrides gradientType. */
|
|
21
|
+
gradientTo?: string;
|
|
22
|
+
/** Gradient direction; only applies when variant is "gradient". */
|
|
23
|
+
gradientDirection?: GradientDirection;
|
|
24
|
+
/** Whether to render a border and subtle shadow */
|
|
7
25
|
bordered?: boolean;
|
|
26
|
+
/** Whether to elevate the card shadow on hover */
|
|
8
27
|
hoverable?: boolean;
|
|
28
|
+
/** Padding size preset */
|
|
9
29
|
size?: 'default' | 'small';
|
|
30
|
+
/**
|
|
31
|
+
* Heading level (h1–h6) for the card title so it participates in the document
|
|
32
|
+
* outline. Defaults to a non-heading `<div>` to avoid injecting an out-of-order
|
|
33
|
+
* heading; set this when the title is a real section heading.
|
|
34
|
+
*/
|
|
35
|
+
titleLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
36
|
+
/** Card header title content */
|
|
10
37
|
title?: React.ReactNode;
|
|
38
|
+
/** Extra content rendered in the header on the right side */
|
|
11
39
|
extra?: React.ReactNode;
|
|
40
|
+
/** Full-width cover image or media rendered above the header */
|
|
12
41
|
cover?: React.ReactNode;
|
|
42
|
+
/** Action nodes rendered in a row at the card footer */
|
|
13
43
|
actions?: React.ReactNode[];
|
|
14
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Card is a content container with optional title, header extra, cover media, and footer actions.
|
|
47
|
+
* Supports bordered, hoverable, and size variants.
|
|
48
|
+
*/
|
|
15
49
|
export declare const Card: React.FC<CardProps>;
|
|
@@ -1,8 +1,14 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
interface CheckboxProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
/** Text label rendered adjacent to the checkbox */
|
|
4
5
|
label?: string;
|
|
6
|
+
/** Whether to apply error styling to the checkbox and label */
|
|
5
7
|
error?: boolean;
|
|
6
8
|
}
|
|
9
|
+
/**
|
|
10
|
+
* Checkbox renders a styled boolean input with an optional text label and error state.
|
|
11
|
+
* Supports both controlled and uncontrolled usage; forwards refs to the underlying input element.
|
|
12
|
+
*/
|
|
7
13
|
declare const Checkbox: React.ForwardRefExoticComponent<CheckboxProps & React.RefAttributes<HTMLInputElement>>;
|
|
8
14
|
export default Checkbox;
|
|
@@ -1,33 +1,65 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
interface ContextMenuProps {
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Element that triggers the menu to open. Must be a single focusable React
|
|
6
|
+
* element (e.g. a `<button>`); the menu injects the ref, click/keydown
|
|
7
|
+
* handlers, and ARIA popup attributes onto it rather than wrapping it in an
|
|
8
|
+
* extra button (which would nest interactive elements).
|
|
9
|
+
*/
|
|
10
|
+
trigger: React.ReactElement;
|
|
11
|
+
/** Menu items rendered inside the dropdown */
|
|
5
12
|
children: React.ReactNode;
|
|
13
|
+
/** Horizontal alignment of the menu relative to the trigger */
|
|
6
14
|
align?: 'left' | 'center' | 'right';
|
|
15
|
+
/** Custom className for the root container */
|
|
7
16
|
className?: string;
|
|
17
|
+
/** Custom className for the menu content panel */
|
|
8
18
|
contentClassName?: string;
|
|
19
|
+
/** Gap in pixels between the trigger and the menu */
|
|
9
20
|
offset?: number;
|
|
21
|
+
/** Whether the menu closes when a menu item is clicked */
|
|
10
22
|
closeOnClick?: boolean;
|
|
23
|
+
/** Whether the trigger and menu are non-interactive */
|
|
11
24
|
disabled?: boolean;
|
|
12
25
|
}
|
|
26
|
+
/**
|
|
27
|
+
* Dropdown context menu with keyboard navigation and focus management.
|
|
28
|
+
* Renders a trigger element that toggles a positioned menu panel containing ContextMenuItem entries.
|
|
29
|
+
*/
|
|
13
30
|
export declare const ContextMenu: React.FC<ContextMenuProps>;
|
|
14
31
|
interface ContextMenuItemProps {
|
|
32
|
+
/** Label content for the menu item */
|
|
15
33
|
children: React.ReactNode;
|
|
34
|
+
/** Click handler invoked when the item is selected */
|
|
16
35
|
onClick?: (e: React.MouseEvent) => void;
|
|
36
|
+
/** Whether the item is non-interactive */
|
|
17
37
|
disabled?: boolean;
|
|
38
|
+
/** Custom className for the item button */
|
|
18
39
|
className?: string;
|
|
40
|
+
/** Optional icon displayed to the left of the label */
|
|
19
41
|
icon?: React.ReactNode;
|
|
42
|
+
/** Keyboard shortcut hint displayed on the right */
|
|
20
43
|
shortcut?: string;
|
|
44
|
+
/** Whether to render the item in a destructive (red) style */
|
|
21
45
|
danger?: boolean;
|
|
22
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Individual item inside a ContextMenu. Renders as a button with optional icon, label, and shortcut hint.
|
|
49
|
+
*/
|
|
23
50
|
export declare const ContextMenuItem: React.FC<ContextMenuItemProps>;
|
|
24
51
|
interface ContextMenuSeparatorProps {
|
|
52
|
+
/** Custom className for the separator element */
|
|
25
53
|
className?: string;
|
|
26
54
|
}
|
|
55
|
+
/** Horizontal rule that visually separates groups of ContextMenuItem entries. */
|
|
27
56
|
export declare const ContextMenuSeparator: React.FC<ContextMenuSeparatorProps>;
|
|
28
57
|
interface ContextMenuLabelProps {
|
|
58
|
+
/** Text or content displayed as the group label */
|
|
29
59
|
children: React.ReactNode;
|
|
60
|
+
/** Custom className for the label container */
|
|
30
61
|
className?: string;
|
|
31
62
|
}
|
|
63
|
+
/** Non-interactive label used to title a group of ContextMenuItem entries. */
|
|
32
64
|
export declare const ContextMenuLabel: React.FC<ContextMenuLabelProps>;
|
|
33
65
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ContextMenu, ContextMenuItem, ContextMenuSeparator,
|
|
1
|
+
export { ContextMenu, ContextMenuItem, ContextMenuLabel, ContextMenuSeparator, } from './ContextMenu';
|
|
@@ -1,13 +1,25 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface DividerProps {
|
|
4
|
+
/** Optional text or node rendered inside the divider line */
|
|
4
5
|
children?: React.ReactNode;
|
|
6
|
+
/** Custom className for the root element */
|
|
5
7
|
className?: string;
|
|
8
|
+
/** Inline styles applied to the root element */
|
|
6
9
|
style?: React.CSSProperties;
|
|
10
|
+
/** Direction of the divider line */
|
|
7
11
|
type?: 'horizontal' | 'vertical';
|
|
12
|
+
/** Horizontal position of the inner text when children are provided */
|
|
8
13
|
orientation?: 'left' | 'right' | 'center';
|
|
14
|
+
/** Extra margin applied to the side of the text opposite to the orientation */
|
|
9
15
|
orientationMargin?: string | number;
|
|
16
|
+
/** Whether the line is rendered as dashed instead of solid */
|
|
10
17
|
dashed?: boolean;
|
|
18
|
+
/** Whether the inner text is rendered in normal weight instead of medium */
|
|
11
19
|
plain?: boolean;
|
|
12
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* Visual separator between sections of content. Supports horizontal and vertical orientations,
|
|
23
|
+
* dashed style, and optional inner text with configurable alignment.
|
|
24
|
+
*/
|
|
13
25
|
export declare const Divider: React.FC<DividerProps>;
|
|
@@ -25,5 +25,7 @@ export interface DrawerProps {
|
|
|
25
25
|
showCloseButton?: boolean;
|
|
26
26
|
/** Custom close button content */
|
|
27
27
|
closeButton?: React.ReactNode;
|
|
28
|
+
/** Accessible name for the drawer when no visible `title` is provided */
|
|
29
|
+
'aria-label'?: string;
|
|
28
30
|
}
|
|
29
31
|
export declare const Drawer: React.FC<DrawerProps>;
|
|
@@ -1,10 +1,19 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface EmptyProps {
|
|
4
|
+
/** Text or node shown below the image; defaults to "No data" */
|
|
4
5
|
description?: React.ReactNode;
|
|
6
|
+
/** Custom image or illustration; pass null to hide the image entirely */
|
|
5
7
|
image?: React.ReactNode;
|
|
8
|
+
/** Custom className for the root container */
|
|
6
9
|
className?: string;
|
|
10
|
+
/** Inline styles applied to the root container */
|
|
7
11
|
style?: React.CSSProperties;
|
|
12
|
+
/** Optional action or content rendered below the description */
|
|
8
13
|
children?: React.ReactNode;
|
|
9
14
|
}
|
|
15
|
+
/**
|
|
16
|
+
* Empty state placeholder displayed when a list or data container has no content.
|
|
17
|
+
* Shows a default illustration and description, both of which can be overridden.
|
|
18
|
+
*/
|
|
10
19
|
export declare const Empty: React.FC<EmptyProps>;
|
|
@@ -1,17 +1,27 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface FormRule {
|
|
4
|
+
/** Whether the field must have a non-empty value */
|
|
4
5
|
required?: boolean;
|
|
6
|
+
/** Error message shown when this rule fails */
|
|
5
7
|
message?: string;
|
|
8
|
+
/** Built-in format validator applied to the field value */
|
|
6
9
|
type?: 'email' | 'url' | 'number';
|
|
10
|
+
/** Minimum numeric value or minimum string/array length depending on type */
|
|
7
11
|
min?: number;
|
|
12
|
+
/** Maximum numeric value or maximum string/array length depending on type */
|
|
8
13
|
max?: number;
|
|
14
|
+
/** Regular expression the value must match */
|
|
9
15
|
pattern?: RegExp;
|
|
16
|
+
/** Custom async validator function; throw or reject with an Error to fail validation */
|
|
10
17
|
validator?: (rule: any, value: any) => Promise<void> | void;
|
|
11
18
|
}
|
|
12
19
|
export interface FormProps {
|
|
20
|
+
/** Form fields and other content */
|
|
13
21
|
children: React.ReactNode;
|
|
22
|
+
/** Called with all field values when the form passes validation */
|
|
14
23
|
onFinish?: (values: Record<string, any>) => void;
|
|
24
|
+
/** Called with field values and error details when validation fails on submit */
|
|
15
25
|
onFinishFailed?: (errorInfo: {
|
|
16
26
|
values: Record<string, any>;
|
|
17
27
|
errorFields: Array<{
|
|
@@ -19,28 +29,52 @@ export interface FormProps {
|
|
|
19
29
|
errors: string[];
|
|
20
30
|
}>;
|
|
21
31
|
}) => void;
|
|
32
|
+
/** Layout direction for labels and controls */
|
|
22
33
|
layout?: 'horizontal' | 'vertical' | 'inline';
|
|
34
|
+
/** Custom className for the form element */
|
|
23
35
|
className?: string;
|
|
36
|
+
/** HTML name attribute for the form element */
|
|
24
37
|
name?: string;
|
|
38
|
+
/** Initial values keyed by field name */
|
|
25
39
|
initialValues?: Record<string, any>;
|
|
40
|
+
/** Form instance for external control; for Ant Design compatibility */
|
|
26
41
|
form?: any;
|
|
27
42
|
}
|
|
28
43
|
export interface FormItemProps {
|
|
44
|
+
/** Field name used to read and write the value in form state */
|
|
29
45
|
name?: string;
|
|
46
|
+
/** Label text displayed above or beside the control */
|
|
30
47
|
label?: string;
|
|
48
|
+
/** Validation rules evaluated on blur and on form submit */
|
|
31
49
|
rules?: FormRule[];
|
|
50
|
+
/** The form control element to wrap */
|
|
32
51
|
children: React.ReactElement;
|
|
52
|
+
/** Custom className for the form item wrapper */
|
|
33
53
|
className?: string;
|
|
54
|
+
/** Static help text shown below the control when there is no error */
|
|
34
55
|
help?: string;
|
|
56
|
+
/** Explicit validation status; overrides the derived error state */
|
|
35
57
|
validateStatus?: 'success' | 'warning' | 'error' | 'validating';
|
|
58
|
+
/** Whether to mark the field as required in the label */
|
|
36
59
|
required?: boolean;
|
|
60
|
+
/** When true, renders the control without the label/error wrapper */
|
|
37
61
|
noStyle?: boolean;
|
|
62
|
+
/** Prop name on the child element used to supply its value */
|
|
38
63
|
valuePropName?: string;
|
|
39
64
|
}
|
|
65
|
+
/**
|
|
66
|
+
* Form container that manages field values, validation, and submission.
|
|
67
|
+
* Wrap form controls in FormItem to connect them to the form state.
|
|
68
|
+
*/
|
|
40
69
|
export declare const Form: React.FC<FormProps> & {
|
|
41
70
|
Item: typeof FormItem;
|
|
42
71
|
};
|
|
72
|
+
/**
|
|
73
|
+
* Connects a single form control to the parent Form's state and validation.
|
|
74
|
+
* Injects value, onChange, onBlur, and ARIA attributes into its direct child.
|
|
75
|
+
*/
|
|
43
76
|
export declare const FormItem: React.FC<FormItemProps>;
|
|
77
|
+
/** Hook that returns a stub form instance for Ant Design API compatibility. */
|
|
44
78
|
export declare const useForm: () => {
|
|
45
79
|
resetFields: () => void;
|
|
46
80
|
setFieldsValue: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { default as Input, type InputProps } from '../Input';
|
|
2
|
-
export { default as Textarea } from '../Textarea';
|
|
3
1
|
export { default as Checkbox } from '../Checkbox';
|
|
4
|
-
export { default as
|
|
2
|
+
export { default as Input, type InputProps } from '../Input';
|
|
5
3
|
export { default as MobileInput } from '../MobileInput';
|
|
6
|
-
export { default as
|
|
4
|
+
export { default as PasswordInput } from '../PasswordInput';
|
|
5
|
+
export { type Country, default as PhoneNumberInput, type PhoneNumberInputProps, } from '../PhoneNumberInput';
|
|
6
|
+
export { default as Textarea } from '../Textarea';
|
|
@@ -3,36 +3,71 @@ import { default as React } from 'react';
|
|
|
3
3
|
type InfoSectionVariant = 'default' | 'card' | 'bordered';
|
|
4
4
|
type InfoSectionSize = 'small' | 'medium' | 'large';
|
|
5
5
|
interface InfoSectionProps {
|
|
6
|
+
/** Primary heading displayed in the section header */
|
|
6
7
|
title?: React.ReactNode;
|
|
8
|
+
/** Secondary line of text shown below the title */
|
|
7
9
|
subtitle?: React.ReactNode;
|
|
10
|
+
/** Additional descriptive text shown below the subtitle */
|
|
8
11
|
description?: React.ReactNode;
|
|
12
|
+
/** Content rendered in the section body */
|
|
9
13
|
children?: React.ReactNode;
|
|
14
|
+
/** Custom className for the root container */
|
|
10
15
|
className?: string;
|
|
16
|
+
/** Custom className for the header row */
|
|
11
17
|
headerClassName?: string;
|
|
18
|
+
/** Custom className for the content area */
|
|
12
19
|
contentClassName?: string;
|
|
20
|
+
/** Icon displayed to the left of the title */
|
|
13
21
|
icon?: React.ReactNode;
|
|
22
|
+
/** Badge element rendered inline next to the title */
|
|
14
23
|
badge?: React.ReactNode;
|
|
24
|
+
/** Action buttons or controls rendered on the right side of the header */
|
|
15
25
|
actions?: React.ReactNode;
|
|
26
|
+
/** Visual presentation style of the section container */
|
|
16
27
|
variant?: InfoSectionVariant;
|
|
28
|
+
/** Controls spacing and text sizes throughout the section */
|
|
17
29
|
size?: InfoSectionSize;
|
|
30
|
+
/** Heading level (h1–h6) for the section title so it fits the page outline (default 3) */
|
|
31
|
+
titleLevel?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Structured content section with an optional header containing a title, subtitle, icon, badge, and actions.
|
|
35
|
+
* Use with InfoItem and InfoGrid to display labelled data inside the section body.
|
|
36
|
+
*/
|
|
19
37
|
export declare const InfoSection: React.FC<InfoSectionProps>;
|
|
20
38
|
type InfoItemOrientation = 'vertical' | 'horizontal';
|
|
21
39
|
interface InfoItemProps {
|
|
40
|
+
/** Descriptive label for the data point */
|
|
22
41
|
label: React.ReactNode;
|
|
42
|
+
/** Value displayed alongside the label */
|
|
23
43
|
value: React.ReactNode;
|
|
44
|
+
/** Custom className for the root element */
|
|
24
45
|
className?: string;
|
|
46
|
+
/** Custom className for the label element */
|
|
25
47
|
labelClassName?: string;
|
|
48
|
+
/** Custom className for the value element */
|
|
26
49
|
valueClassName?: string;
|
|
50
|
+
/** Layout of label and value relative to each other */
|
|
27
51
|
orientation?: InfoItemOrientation;
|
|
28
52
|
}
|
|
53
|
+
/**
|
|
54
|
+
* Single label-value pair for use inside an InfoSection or InfoGrid.
|
|
55
|
+
* Supports vertical (stacked) and horizontal (side-by-side) orientations.
|
|
56
|
+
*/
|
|
29
57
|
export declare const InfoItem: React.FC<InfoItemProps>;
|
|
30
58
|
type InfoGridGap = 'small' | 'medium' | 'large';
|
|
31
59
|
interface InfoGridProps {
|
|
60
|
+
/** InfoItem elements to arrange in the grid */
|
|
32
61
|
children: React.ReactNode;
|
|
62
|
+
/** Number of columns in the responsive grid */
|
|
33
63
|
columns?: 1 | 2 | 3 | 4;
|
|
64
|
+
/** Custom className for the grid container */
|
|
34
65
|
className?: string;
|
|
66
|
+
/** Spacing between grid cells */
|
|
35
67
|
gap?: InfoGridGap;
|
|
36
68
|
}
|
|
69
|
+
/**
|
|
70
|
+
* Responsive CSS grid container for laying out InfoItem components in multiple columns.
|
|
71
|
+
*/
|
|
37
72
|
export declare const InfoGrid: React.FC<InfoGridProps>;
|
|
38
73
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { InfoGrid, InfoItem, InfoSection } from './InfoSection';
|
|
@@ -1,13 +1,24 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
/** Icon rendered inside the input on the left side */
|
|
4
5
|
leftIcon?: ReactNode;
|
|
6
|
+
/** Icon rendered inside the input on the right side */
|
|
5
7
|
rightIcon?: ReactNode;
|
|
8
|
+
/** Whether to render the input in its error state */
|
|
6
9
|
error?: boolean;
|
|
10
|
+
/** Helper or error message displayed below the input */
|
|
7
11
|
helperText?: string;
|
|
12
|
+
/** Size variant controlling height, padding, and font size */
|
|
8
13
|
inputSize?: 'sm' | 'md' | 'lg';
|
|
14
|
+
/** Custom className for the outer wrapper div */
|
|
9
15
|
containerClassName?: string;
|
|
16
|
+
/** Custom className applied to both icon wrappers */
|
|
10
17
|
iconClassName?: string;
|
|
11
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* Text input field with optional left/right icons, error state, and helper text.
|
|
21
|
+
* Forwards refs to the underlying input element and supports all standard HTML input attributes.
|
|
22
|
+
*/
|
|
12
23
|
declare const Input: import('react').ForwardRefExoticComponent<InputProps & import('react').RefAttributes<HTMLInputElement>>;
|
|
13
24
|
export default Input;
|
|
@@ -1,32 +1,68 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface LayoutProps {
|
|
4
|
+
/** Content rendered inside the layout */
|
|
4
5
|
children: React.ReactNode;
|
|
6
|
+
/** Additional CSS class names */
|
|
5
7
|
className?: string;
|
|
8
|
+
/** Inline styles applied to the layout wrapper */
|
|
6
9
|
style?: React.CSSProperties;
|
|
7
10
|
}
|
|
8
11
|
export interface HeaderProps {
|
|
12
|
+
/** Content rendered inside the header */
|
|
9
13
|
children: React.ReactNode;
|
|
14
|
+
/** Additional CSS class names */
|
|
10
15
|
className?: string;
|
|
16
|
+
/** Inline styles applied to the header element */
|
|
11
17
|
style?: React.CSSProperties;
|
|
12
18
|
}
|
|
13
19
|
export interface ContentProps {
|
|
20
|
+
/** Content rendered inside the main area */
|
|
14
21
|
children: React.ReactNode;
|
|
22
|
+
/** Additional CSS class names */
|
|
15
23
|
className?: string;
|
|
24
|
+
/** Inline styles applied to the main element */
|
|
16
25
|
style?: React.CSSProperties;
|
|
26
|
+
/**
|
|
27
|
+
* Landmark element to render. Defaults to `<main>`. Only one `<main>` is
|
|
28
|
+
* allowed per page, so nested Layout.Content instances should pass `as="div"`.
|
|
29
|
+
*/
|
|
30
|
+
as?: 'main' | 'div' | 'section';
|
|
31
|
+
/** Accessible label, useful to disambiguate multiple regions */
|
|
32
|
+
'aria-label'?: string;
|
|
17
33
|
}
|
|
18
34
|
export interface FooterProps {
|
|
35
|
+
/** Content rendered inside the footer */
|
|
19
36
|
children: React.ReactNode;
|
|
37
|
+
/** Additional CSS class names */
|
|
20
38
|
className?: string;
|
|
39
|
+
/** Inline styles applied to the footer element */
|
|
21
40
|
style?: React.CSSProperties;
|
|
22
41
|
}
|
|
23
42
|
export interface SiderProps {
|
|
43
|
+
/** Content rendered inside the sidebar */
|
|
24
44
|
children: React.ReactNode;
|
|
45
|
+
/** Additional CSS class names */
|
|
25
46
|
className?: string;
|
|
47
|
+
/** Inline styles applied to the aside element */
|
|
26
48
|
style?: React.CSSProperties;
|
|
49
|
+
/** Width of the sidebar when expanded */
|
|
27
50
|
width?: number | string;
|
|
51
|
+
/** Whether the sidebar is in collapsed (narrow) state */
|
|
28
52
|
collapsed?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Landmark element to render. Defaults to `<aside>` (complementary). Use
|
|
55
|
+
* `as="nav"` when the sidebar holds the primary navigation.
|
|
56
|
+
*/
|
|
57
|
+
as?: 'aside' | 'nav' | 'div';
|
|
58
|
+
/** Accessible label, useful to disambiguate multiple nav/aside regions */
|
|
59
|
+
'aria-label'?: string;
|
|
29
60
|
}
|
|
61
|
+
/**
|
|
62
|
+
* Compound page-layout component that composes Header, Content, Footer, and Sider sub-components
|
|
63
|
+
* into a full-height flex column. Use the attached sub-components (Layout.Header, Layout.Content,
|
|
64
|
+
* Layout.Footer, Layout.Sider) to build structured application shells.
|
|
65
|
+
*/
|
|
30
66
|
export declare const Layout: React.FC<LayoutProps> & {
|
|
31
67
|
Header: React.FC<HeaderProps>;
|
|
32
68
|
Content: React.FC<ContentProps>;
|
|
@@ -21,4 +21,3 @@ export interface LoaderProps {
|
|
|
21
21
|
delay?: number;
|
|
22
22
|
}
|
|
23
23
|
export declare const Loader: React.FC<LoaderProps>;
|
|
24
|
-
export declare const loaderStyles = "\n @keyframes page-loader {\n 0% {\n transform: translateX(-150%);\n }\n 100% {\n transform: translateX(250%);\n }\n }\n\n @keyframes page-loader-secondary {\n 0% {\n transform: translateX(-150%);\n }\n 66% {\n transform: translateX(-150%);\n }\n 100% {\n transform: translateX(250%);\n }\n }\n\n @keyframes inline-loader {\n 0% {\n transform: translateX(-100%);\n }\n 100% {\n transform: translateX(200%);\n }\n }\n\n .animate-page-loader {\n animation: page-loader 2s linear infinite;\n }\n\n .animate-page-loader-secondary {\n animation: page-loader-secondary 2s linear infinite;\n }\n\n .animate-inline-loader {\n animation: inline-loader 1.5s ease-in-out infinite;\n }\n";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Loader, type LoaderProps } from './Loader';
|
|
@@ -1,8 +1,17 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
interface MobileInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
4
|
+
/** Country dial code prefix displayed before the input (e.g. "+1") */
|
|
4
5
|
countryCode?: string;
|
|
6
|
+
/** Whether to render the input in an error/invalid state */
|
|
5
7
|
error?: boolean;
|
|
8
|
+
/** Helper or error message displayed below the input */
|
|
9
|
+
helperText?: string;
|
|
6
10
|
}
|
|
11
|
+
/**
|
|
12
|
+
* Telephone input with a static country-code prefix badge on the left.
|
|
13
|
+
* The dial code is grouped with the field so screen readers announce them
|
|
14
|
+
* together. Forwards its ref to the underlying `<input type="tel">` element.
|
|
15
|
+
*/
|
|
7
16
|
declare const MobileInput: React.ForwardRefExoticComponent<MobileInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
8
17
|
export default MobileInput;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
|
-
interface PasswordInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>,
|
|
3
|
+
interface PasswordInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'type'> {
|
|
4
|
+
/** Whether to render the input in an error/invalid state */
|
|
4
5
|
error?: boolean;
|
|
5
6
|
}
|
|
7
|
+
/**
|
|
8
|
+
* Password input field with a show/hide toggle button. Renders the base Input component
|
|
9
|
+
* internally and forwards its ref to the underlying `<input>` element.
|
|
10
|
+
*/
|
|
6
11
|
declare const PasswordInput: React.ForwardRefExoticComponent<PasswordInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
7
12
|
export default PasswordInput;
|
|
@@ -1,44 +1,89 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
2
|
|
|
3
3
|
export interface Country {
|
|
4
|
+
/** ISO 3166-1 alpha-2 country code (e.g. "US") */
|
|
4
5
|
code: string;
|
|
6
|
+
/** Human-readable country name */
|
|
5
7
|
name: string;
|
|
8
|
+
/** International dial code including leading "+" (e.g. "+1") */
|
|
6
9
|
dialCode: string;
|
|
10
|
+
/** Emoji flag representation of the country */
|
|
7
11
|
flag: string;
|
|
12
|
+
/** Optional number format mask where "#" represents a digit */
|
|
8
13
|
format?: string;
|
|
14
|
+
/** Optional sort priority; lower values appear first in the list */
|
|
9
15
|
priority?: number;
|
|
10
16
|
}
|
|
11
17
|
export interface PhoneNumberInputProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'value' | 'onChange' | 'size'> {
|
|
18
|
+
/** Controlled phone number value (digits and formatting characters) */
|
|
12
19
|
value?: string;
|
|
20
|
+
/** Uncontrolled initial phone number value */
|
|
13
21
|
defaultValue?: string;
|
|
22
|
+
/** Callback fired when the phone number or selected country changes */
|
|
14
23
|
onChange?: (value: string, country: Country) => void;
|
|
24
|
+
/** Callback fired when the user selects a different country */
|
|
15
25
|
onCountryChange?: (country: Country) => void;
|
|
26
|
+
/** Whether to show the country selector dropdown button */
|
|
16
27
|
enableCountryDropdown?: boolean;
|
|
28
|
+
/** ISO country code for the initially selected country */
|
|
17
29
|
defaultCountry?: string;
|
|
30
|
+
/** Country codes to pin at the top of the dropdown list */
|
|
18
31
|
preferredCountries?: string[];
|
|
32
|
+
/** Country codes to remove from the dropdown list */
|
|
19
33
|
excludeCountries?: string[];
|
|
34
|
+
/** When non-empty, only these country codes will appear in the dropdown */
|
|
20
35
|
onlyCountries?: string[];
|
|
36
|
+
/** Whether to display emoji flags in the dropdown and selector button */
|
|
21
37
|
showCountryFlags?: boolean;
|
|
38
|
+
/** Whether to auto-format the phone number using the country's format mask */
|
|
22
39
|
autoFormat?: boolean;
|
|
40
|
+
/** Whether to validate the entered phone number and show an error message */
|
|
23
41
|
validatePhoneNumber?: boolean;
|
|
42
|
+
/** Callback fired when phone number validity changes */
|
|
24
43
|
onValidationChange?: (isValid: boolean) => void;
|
|
44
|
+
/** Custom placeholder text for the phone input */
|
|
25
45
|
placeholder?: string;
|
|
46
|
+
/** Whether to auto-generate a placeholder from the selected country's format */
|
|
26
47
|
autoPlaceholder?: boolean;
|
|
48
|
+
/** Preferred position of the country dropdown relative to the input */
|
|
27
49
|
dropdownPosition?: 'auto' | 'top' | 'bottom';
|
|
50
|
+
/** Whether the country dropdown includes a search field */
|
|
28
51
|
searchable?: boolean;
|
|
52
|
+
/** Visual size of the input */
|
|
29
53
|
size?: 'sm' | 'md' | 'lg';
|
|
54
|
+
/** Whether to render the input in an error/invalid state */
|
|
30
55
|
error?: boolean;
|
|
56
|
+
/** Whether the input is disabled */
|
|
31
57
|
disabled?: boolean;
|
|
58
|
+
/** Whether to show a loading spinner inside the input */
|
|
32
59
|
loading?: boolean;
|
|
60
|
+
/** Accessible label for the phone number input */
|
|
33
61
|
ariaLabel?: string;
|
|
62
|
+
/** ID of an element that describes the phone number input */
|
|
34
63
|
ariaDescribedBy?: string;
|
|
64
|
+
/** Accessible label/placeholder for the country search field (localizable) */
|
|
65
|
+
searchLabel?: string;
|
|
66
|
+
/** Message shown when the country search returns no matches (localizable) */
|
|
67
|
+
noResultsText?: string;
|
|
68
|
+
/** Additional CSS class names for the outer border wrapper */
|
|
35
69
|
className?: string;
|
|
70
|
+
/** Additional CSS class names for the outermost container div */
|
|
36
71
|
containerClassName?: string;
|
|
72
|
+
/** Additional CSS class names for the country dropdown panel */
|
|
37
73
|
dropdownClassName?: string;
|
|
74
|
+
/** Additional CSS class names for the phone number input element */
|
|
38
75
|
inputClassName?: string;
|
|
76
|
+
/** HTML name attribute for form submission */
|
|
39
77
|
name?: string;
|
|
78
|
+
/** HTML id attribute for the phone number input */
|
|
40
79
|
id?: string;
|
|
80
|
+
/** Whether the field is required in a form */
|
|
41
81
|
required?: boolean;
|
|
42
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* International phone number input with a searchable country selector dropdown. Supports
|
|
85
|
+
* auto-formatting, built-in validation, preferred/excluded country lists, and three size
|
|
86
|
+
* variants. Forwards its ref to the underlying `<input type="tel">` element.
|
|
87
|
+
*/
|
|
43
88
|
export declare const PhoneNumberInput: React.ForwardRefExoticComponent<PhoneNumberInputProps & React.RefAttributes<HTMLInputElement>>;
|
|
44
89
|
export default PhoneNumberInput;
|