@bricks-toolkit/toolkit 0.1.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/LICENSE +21 -0
- package/README.md +214 -0
- package/dist/components/Accordion/Accordion.d.ts +5 -0
- package/dist/components/Accordion/Accordion.types.d.ts +32 -0
- package/dist/components/Accordion/index.d.ts +2 -0
- package/dist/components/Avatar/Avatar.d.ts +2 -0
- package/dist/components/Avatar/Avatar.stories.d.ts +11 -0
- package/dist/components/Avatar/Avatar.test.d.ts +1 -0
- package/dist/components/Avatar/Avatar.types.d.ts +24 -0
- package/dist/components/Avatar/index.d.ts +2 -0
- package/dist/components/Badge/Badge.d.ts +11 -0
- package/dist/components/Badge/Badge.stories.d.ts +21 -0
- package/dist/components/Badge/Badge.test.d.ts +1 -0
- package/dist/components/Badge/Badge.types.d.ts +43 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.d.ts +2 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.stories.d.ts +13 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.test.d.ts +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.types.d.ts +27 -0
- package/dist/components/Breadcrumbs/index.d.ts +2 -0
- package/dist/components/Button/Button.d.ts +2 -0
- package/dist/components/Button/Button.stories.d.ts +20 -0
- package/dist/components/Button/Button.test.d.ts +1 -0
- package/dist/components/Button/Button.types.d.ts +24 -0
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Card/Card.d.ts +25 -0
- package/dist/components/Card/Card.stories.d.ts +8 -0
- package/dist/components/Card/Card.test.d.ts +1 -0
- package/dist/components/Card/Card.types.d.ts +14 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.stories.d.ts +16 -0
- package/dist/components/Checkbox/Checkbox.test.d.ts +1 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +31 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/ComboBox/ComboBox.d.ts +2 -0
- package/dist/components/ComboBox/ComboBox.stories.d.ts +12 -0
- package/dist/components/ComboBox/ComboBox.test.d.ts +1 -0
- package/dist/components/ComboBox/ComboBox.types.d.ts +57 -0
- package/dist/components/ComboBox/index.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.d.ts +2 -0
- package/dist/components/DatePicker/DatePicker.stories.d.ts +25 -0
- package/dist/components/DatePicker/DatePicker.test.d.ts +1 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +27 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/Dialog/Dialog.d.ts +6 -0
- package/dist/components/Dialog/Dialog.stories.d.ts +9 -0
- package/dist/components/Dialog/Dialog.test.d.ts +1 -0
- package/dist/components/Dialog/Dialog.types.d.ts +52 -0
- package/dist/components/Dialog/index.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -0
- package/dist/components/DropdownMenu/DropdownMenu.stories.d.ts +9 -0
- package/dist/components/DropdownMenu/DropdownMenu.test.d.ts +1 -0
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +24 -0
- package/dist/components/DropdownMenu/index.d.ts +2 -0
- package/dist/components/Email/Email.d.ts +2 -0
- package/dist/components/Email/Email.stories.d.ts +11 -0
- package/dist/components/Email/Email.test.d.ts +1 -0
- package/dist/components/Email/Email.types.d.ts +33 -0
- package/dist/components/Email/index.d.ts +2 -0
- package/dist/components/FileUpload/FileUpload.d.ts +2 -0
- package/dist/components/FileUpload/FileUpload.stories.d.ts +10 -0
- package/dist/components/FileUpload/FileUpload.test.d.ts +1 -0
- package/dist/components/FileUpload/FileUpload.types.d.ts +22 -0
- package/dist/components/FileUpload/index.d.ts +2 -0
- package/dist/components/Header/Header.d.ts +7 -0
- package/dist/components/Header/Header.stories.d.ts +8 -0
- package/dist/components/Header/Header.test.d.ts +1 -0
- package/dist/components/Header/Header.types.d.ts +19 -0
- package/dist/components/Header/index.d.ts +2 -0
- package/dist/components/IconButton/IconButton.d.ts +2 -0
- package/dist/components/IconButton/IconButton.stories.d.ts +17 -0
- package/dist/components/IconButton/IconButton.types.d.ts +10 -0
- package/dist/components/IconButton/index.d.ts +2 -0
- package/dist/components/Image/Image.d.ts +6 -0
- package/dist/components/Image/Image.stories.d.ts +13 -0
- package/dist/components/Image/Image.test.d.ts +1 -0
- package/dist/components/Image/Image.types.d.ts +40 -0
- package/dist/components/Image/index.d.ts +2 -0
- package/dist/components/Link/Link.d.ts +2 -0
- package/dist/components/Link/Link.stories.d.ts +15 -0
- package/dist/components/Link/Link.test.d.ts +1 -0
- package/dist/components/Link/Link.types.d.ts +20 -0
- package/dist/components/Link/index.d.ts +2 -0
- package/dist/components/Loader/Loader.d.ts +2 -0
- package/dist/components/Loader/Loader.stories.d.ts +12 -0
- package/dist/components/Loader/Loader.test.d.ts +1 -0
- package/dist/components/Loader/Loader.types.d.ts +17 -0
- package/dist/components/Loader/index.d.ts +2 -0
- package/dist/components/Modal/Modal.d.ts +14 -0
- package/dist/components/Modal/Modal.stories.d.ts +14 -0
- package/dist/components/Modal/Modal.test.d.ts +1 -0
- package/dist/components/Modal/Modal.types.d.ts +100 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.d.ts +2 -0
- package/dist/components/MultiSelect/MultiSelect.stories.d.ts +15 -0
- package/dist/components/MultiSelect/MultiSelect.test.d.ts +1 -0
- package/dist/components/MultiSelect/MultiSelect.types.d.ts +55 -0
- package/dist/components/MultiSelect/index.d.ts +2 -0
- package/dist/components/OtpInput/OtpInput.d.ts +2 -0
- package/dist/components/OtpInput/OtpInput.stories.d.ts +10 -0
- package/dist/components/OtpInput/OtpInput.test.d.ts +1 -0
- package/dist/components/OtpInput/OtpInput.types.d.ts +53 -0
- package/dist/components/OtpInput/index.d.ts +2 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +2 -0
- package/dist/components/PasswordInput/PasswordInput.stories.d.ts +23 -0
- package/dist/components/PasswordInput/PasswordInput.test.d.ts +1 -0
- package/dist/components/PasswordInput/PasswordInput.types.d.ts +27 -0
- package/dist/components/PasswordInput/index.d.ts +2 -0
- package/dist/components/Phone/Phone.d.ts +2 -0
- package/dist/components/Phone/Phone.stories.d.ts +11 -0
- package/dist/components/Phone/Phone.test.d.ts +1 -0
- package/dist/components/Phone/Phone.types.d.ts +36 -0
- package/dist/components/Phone/countries.d.ts +8 -0
- package/dist/components/Phone/index.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.d.ts +2 -0
- package/dist/components/RadioButton/RadioButton.stories.d.ts +21 -0
- package/dist/components/RadioButton/RadioButton.test.d.ts +1 -0
- package/dist/components/RadioButton/RadioButton.types.d.ts +51 -0
- package/dist/components/RadioButton/index.d.ts +2 -0
- package/dist/components/SearchInput/SearchInput.d.ts +6 -0
- package/dist/components/SearchInput/SearchInput.stories.d.ts +8 -0
- package/dist/components/SearchInput/SearchInput.test.d.ts +1 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts +12 -0
- package/dist/components/SearchInput/index.d.ts +2 -0
- package/dist/components/Select/Select.d.ts +2 -0
- package/dist/components/Select/Select.stories.d.ts +12 -0
- package/dist/components/Select/Select.test.d.ts +1 -0
- package/dist/components/Select/Select.types.d.ts +31 -0
- package/dist/components/Select/index.d.ts +2 -0
- package/dist/components/Sidebar/Sidebar.d.ts +7 -0
- package/dist/components/Sidebar/Sidebar.stories.d.ts +10 -0
- package/dist/components/Sidebar/Sidebar.test.d.ts +1 -0
- package/dist/components/Sidebar/Sidebar.types.d.ts +87 -0
- package/dist/components/Sidebar/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +26 -0
- package/dist/components/Skeleton/Skeleton.stories.d.ts +13 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +47 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Stepper/Stepper.d.ts +2 -0
- package/dist/components/Stepper/Stepper.stories.d.ts +23 -0
- package/dist/components/Stepper/Stepper.test.d.ts +1 -0
- package/dist/components/Stepper/Stepper.types.d.ts +47 -0
- package/dist/components/Stepper/index.d.ts +2 -0
- package/dist/components/Table/Pagination.d.ts +3 -0
- package/dist/components/Table/Table.d.ts +3 -0
- package/dist/components/Table/Table.stories.d.ts +13 -0
- package/dist/components/Table/Table.test.d.ts +1 -0
- package/dist/components/Table/Table.types.d.ts +85 -0
- package/dist/components/Table/index.d.ts +3 -0
- package/dist/components/Tabs/Tabs.d.ts +2 -0
- package/dist/components/Tabs/Tabs.stories.d.ts +17 -0
- package/dist/components/Tabs/Tabs.test.d.ts +1 -0
- package/dist/components/Tabs/Tabs.types.d.ts +21 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/TextInput/TextInput.d.ts +2 -0
- package/dist/components/TextInput/TextInput.stories.d.ts +25 -0
- package/dist/components/TextInput/TextInput.test.d.ts +1 -0
- package/dist/components/TextInput/TextInput.types.d.ts +29 -0
- package/dist/components/TextInput/index.d.ts +2 -0
- package/dist/components/ThemeProvider/ThemeProvider.d.ts +8 -0
- package/dist/components/ThemeProvider/ThemeProvider.stories.d.ts +16 -0
- package/dist/components/ThemeProvider/ThemeProvider.test.d.ts +1 -0
- package/dist/components/ThemeProvider/ThemeProvider.types.d.ts +112 -0
- package/dist/components/ThemeProvider/index.d.ts +2 -0
- package/dist/components/TimePicker/TimePicker.d.ts +2 -0
- package/dist/components/TimePicker/TimePicker.stories.d.ts +23 -0
- package/dist/components/TimePicker/TimePicker.test.d.ts +1 -0
- package/dist/components/TimePicker/TimePicker.types.d.ts +27 -0
- package/dist/components/TimePicker/index.d.ts +2 -0
- package/dist/components/Toaster/Toaster.d.ts +2 -0
- package/dist/components/Toaster/Toaster.stories.d.ts +13 -0
- package/dist/components/Toaster/Toaster.test.d.ts +1 -0
- package/dist/components/Toaster/Toaster.types.d.ts +23 -0
- package/dist/components/Toaster/index.d.ts +2 -0
- package/dist/components/Toggle/Toggle.d.ts +2 -0
- package/dist/components/Toggle/Toggle.stories.d.ts +11 -0
- package/dist/components/Toggle/Toggle.types.d.ts +10 -0
- package/dist/components/Toggle/index.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.d.ts +2 -0
- package/dist/components/Tooltip/Tooltip.stories.d.ts +13 -0
- package/dist/components/Tooltip/Tooltip.test.d.ts +1 -0
- package/dist/components/Tooltip/Tooltip.types.d.ts +33 -0
- package/dist/components/Tooltip/index.d.ts +2 -0
- package/dist/index.d.ts +75 -0
- package/dist/utils/cn.d.ts +2 -0
- package/dist/utils/index.d.ts +1 -0
- package/package.json +481 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { ComboBox } from './ComboBox';
|
|
3
|
+
declare const meta: Meta<typeof ComboBox>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Searchable: Story;
|
|
8
|
+
export declare const MultiSelect: Story;
|
|
9
|
+
export declare const Sizes: Story;
|
|
10
|
+
export declare const ValidationStates: Story;
|
|
11
|
+
export declare const Clearable: Story;
|
|
12
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type ComboBoxSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type ComboBoxState = 'default' | 'error' | 'success' | 'warning';
|
|
4
|
+
export interface ComboBoxOption {
|
|
5
|
+
/** The underlying value submitted/returned. */
|
|
6
|
+
value: string;
|
|
7
|
+
/** The human-readable label shown in the dropdown and input. */
|
|
8
|
+
label: string;
|
|
9
|
+
/** When true the option is shown but cannot be selected. */
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface ComboBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'value' | 'onChange' | 'multiple'> {
|
|
13
|
+
/** List of selectable options. */
|
|
14
|
+
options: ComboBoxOption[];
|
|
15
|
+
/** Currently selected value(s). Pass string for single, string[] for multi. */
|
|
16
|
+
value?: string | string[];
|
|
17
|
+
/** Fired when selection changes. */
|
|
18
|
+
onChange?: (value: string | string[]) => void;
|
|
19
|
+
/** Allow selecting multiple options. Defaults to false. */
|
|
20
|
+
multiple?: boolean;
|
|
21
|
+
/** Allow the user to type and filter options. Defaults to true. */
|
|
22
|
+
searchable?: boolean;
|
|
23
|
+
/** Show a clear (Ă—) button when a value is selected. Defaults to false. */
|
|
24
|
+
clearable?: boolean;
|
|
25
|
+
/** Field label rendered above the input. */
|
|
26
|
+
label?: string;
|
|
27
|
+
/** Makes the label show a required asterisk. */
|
|
28
|
+
required?: boolean;
|
|
29
|
+
/** Helper text shown below the field. */
|
|
30
|
+
helperText?: string;
|
|
31
|
+
/** Message shown when state = 'error'. */
|
|
32
|
+
errorMessage?: string;
|
|
33
|
+
/** Message shown when state = 'success'. */
|
|
34
|
+
successMessage?: string;
|
|
35
|
+
/** Message shown when state = 'warning'. */
|
|
36
|
+
warningMessage?: string;
|
|
37
|
+
/** Visual / validation state. Defaults to 'default'. */
|
|
38
|
+
state?: ComboBoxState;
|
|
39
|
+
/** Input size. Defaults to 'md'. */
|
|
40
|
+
size?: ComboBoxSize;
|
|
41
|
+
/** Stretch to fill its container. Defaults to true. */
|
|
42
|
+
fullWidth?: boolean;
|
|
43
|
+
/** Placeholder shown in the input when nothing is selected. */
|
|
44
|
+
placeholder?: string;
|
|
45
|
+
/** Rendered when no options match the current search query. */
|
|
46
|
+
noOptionsMessage?: ReactNode;
|
|
47
|
+
/** Additional class for the outer wrapper div. */
|
|
48
|
+
wrapperClassName?: string;
|
|
49
|
+
/** Additional class for the trigger / input element. */
|
|
50
|
+
inputClassName?: string;
|
|
51
|
+
/** Additional class for the dropdown list. */
|
|
52
|
+
listClassName?: string;
|
|
53
|
+
/** Additional class for the label element. */
|
|
54
|
+
labelClassName?: string;
|
|
55
|
+
/** Additional class for helper / state message text. */
|
|
56
|
+
helperClassName?: string;
|
|
57
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { DatePicker } from './DatePicker';
|
|
3
|
+
declare const meta: Meta<typeof DatePicker>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
/** The default date picker with a label and helper text. */
|
|
7
|
+
export declare const Default: Story;
|
|
8
|
+
/** All five size variants stacked vertically. */
|
|
9
|
+
export declare const Sizes: Story;
|
|
10
|
+
/** All four visual variants. */
|
|
11
|
+
export declare const Variants: Story;
|
|
12
|
+
/** All four validation states. */
|
|
13
|
+
export declare const ValidationStates: Story;
|
|
14
|
+
/** Inline left and right elements (SVG icons). */
|
|
15
|
+
export declare const WithIcons: Story;
|
|
16
|
+
/** External prefix and suffix addon elements. */
|
|
17
|
+
export declare const WithPrefixSuffix: Story;
|
|
18
|
+
/** Required fields show a red asterisk beside the label. */
|
|
19
|
+
export declare const Required: Story;
|
|
20
|
+
/** Disabled input — read-only and non-interactive. */
|
|
21
|
+
export declare const Disabled: Story;
|
|
22
|
+
/** Override styles via `inputClassName` and `wrapperClassName`. */
|
|
23
|
+
export declare const CustomClassName: Story;
|
|
24
|
+
/** Input without a label — uses `aria-label` on the `<input>` instead. */
|
|
25
|
+
export declare const NoLabel: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type DatePickerVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
|
|
3
|
+
export type DatePickerSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export type DatePickerState = 'default' | 'error' | 'success' | 'warning';
|
|
5
|
+
export interface DatePickerProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
|
|
6
|
+
label?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
helperText?: string;
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
successMessage?: string;
|
|
11
|
+
warningMessage?: string;
|
|
12
|
+
variant?: DatePickerVariant;
|
|
13
|
+
size?: DatePickerSize;
|
|
14
|
+
state?: DatePickerState;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
leftElement?: ReactNode;
|
|
17
|
+
rightElement?: ReactNode;
|
|
18
|
+
prefix?: ReactNode;
|
|
19
|
+
suffix?: ReactNode;
|
|
20
|
+
wrapperClassName?: string;
|
|
21
|
+
inputGroupClassName?: string;
|
|
22
|
+
inputClassName?: string;
|
|
23
|
+
labelClassName?: string;
|
|
24
|
+
helperClassName?: string;
|
|
25
|
+
clearable?: boolean;
|
|
26
|
+
isLoading?: boolean;
|
|
27
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { DialogProps, DialogHeaderProps, DialogBodyProps, DialogFooterProps, DialogCloseButtonProps } from './Dialog.types';
|
|
2
|
+
export declare function Dialog({ isOpen, onClose, children, size, isCentered, closeOnOverlayClick, closeOnEsc, trapFocus, lockScroll, contentClassName, overlayClassName, showBackdrop, isModal, ariaLabel, ariaLabelledby, ariaDescribedby, }: DialogProps): React.ReactPortal | null;
|
|
3
|
+
export declare function DialogHeader({ children, className }: DialogHeaderProps): React.JSX.Element;
|
|
4
|
+
export declare function DialogBody({ children, className }: DialogBodyProps): React.JSX.Element;
|
|
5
|
+
export declare function DialogFooter({ children, className }: DialogFooterProps): React.JSX.Element;
|
|
6
|
+
export declare function DialogCloseButton({ onClick, className, }: DialogCloseButtonProps): React.JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Dialog } from './Dialog';
|
|
3
|
+
declare const meta: Meta<typeof Dialog>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const Sizes: Story;
|
|
8
|
+
export declare const Centered: Story;
|
|
9
|
+
export declare const Popup: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export type DialogSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | '3xl' | '4xl' | '5xl' | '6xl' | '7xl' | 'full';
|
|
3
|
+
export interface DialogProps {
|
|
4
|
+
/** If true, the dialog will be open. */
|
|
5
|
+
isOpen: boolean;
|
|
6
|
+
/** Callback invoked when the dialog should close. */
|
|
7
|
+
onClose: () => void;
|
|
8
|
+
/** The content of the dialog. Usually includes DialogHeader, DialogBody, and DialogFooter. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
/** The size of the dialog. Defaults to 'md'. */
|
|
11
|
+
size?: DialogSize;
|
|
12
|
+
/** If true, the dialog will be centered on the screen. Defaults to false. */
|
|
13
|
+
isCentered?: boolean;
|
|
14
|
+
/** If true, the dialog will close when the overlay is clicked. Defaults to true. */
|
|
15
|
+
closeOnOverlayClick?: boolean;
|
|
16
|
+
/** If true, the dialog will close when the ESC key is pressed. Defaults to true. */
|
|
17
|
+
closeOnEsc?: boolean;
|
|
18
|
+
/** If true, focus will be trapped inside the dialog. Defaults to true. */
|
|
19
|
+
trapFocus?: boolean;
|
|
20
|
+
/** If true, the body scroll will be locked when the dialog is open. Defaults to true. */
|
|
21
|
+
lockScroll?: boolean;
|
|
22
|
+
/** Additional class names for the dialog content. */
|
|
23
|
+
contentClassName?: string;
|
|
24
|
+
/** Additional class names for the overlay. */
|
|
25
|
+
overlayClassName?: string;
|
|
26
|
+
/** If true, the backdrop will be visible. Defaults to true. */
|
|
27
|
+
showBackdrop?: boolean;
|
|
28
|
+
/** If true, the dialog will be treated as a modal (traps focus, locked scroll). Defaults to true. */
|
|
29
|
+
isModal?: boolean;
|
|
30
|
+
/** ARIA label for the dialog. */
|
|
31
|
+
ariaLabel?: string;
|
|
32
|
+
/** ID of the element that labels the dialog. */
|
|
33
|
+
ariaLabelledby?: string;
|
|
34
|
+
/** ID of the element that describes the dialog. */
|
|
35
|
+
ariaDescribedby?: string;
|
|
36
|
+
}
|
|
37
|
+
export interface DialogHeaderProps {
|
|
38
|
+
children: ReactNode;
|
|
39
|
+
className?: string;
|
|
40
|
+
}
|
|
41
|
+
export interface DialogBodyProps {
|
|
42
|
+
children: ReactNode;
|
|
43
|
+
className?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface DialogFooterProps {
|
|
46
|
+
children: ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
}
|
|
49
|
+
export interface DialogCloseButtonProps {
|
|
50
|
+
onClick?: () => void;
|
|
51
|
+
className?: string;
|
|
52
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
import type { DropdownMenuProps, DropdownMenuTriggerProps, DropdownMenuContentProps, DropdownMenuItemProps, DropdownMenuSeparatorProps } from './DropdownMenu.types';
|
|
3
|
+
export declare const DropdownMenu: React.FC<DropdownMenuProps>;
|
|
4
|
+
export declare const DropdownMenuTrigger: React.ForwardRefExoticComponent<DropdownMenuTriggerProps & React.RefAttributes<HTMLButtonElement>>;
|
|
5
|
+
export declare const DropdownMenuContent: React.ForwardRefExoticComponent<DropdownMenuContentProps & React.RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export declare const DropdownMenuItem: React.ForwardRefExoticComponent<DropdownMenuItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
7
|
+
export declare const DropdownMenuSeparator: React.FC<DropdownMenuSeparatorProps>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { DropdownMenu } from './DropdownMenu';
|
|
3
|
+
declare const meta: Meta<typeof DropdownMenu>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithIcons: Story;
|
|
8
|
+
export declare const Variants: Story;
|
|
9
|
+
export declare const Alignment: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ReactNode, ButtonHTMLAttributes, HTMLAttributes } from 'react';
|
|
2
|
+
export type DropdownMenuSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type DropdownMenuVariant = 'default' | 'subtle' | 'ghost';
|
|
4
|
+
export interface DropdownMenuProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DropdownMenuTriggerProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
11
|
+
size?: DropdownMenuSize;
|
|
12
|
+
variant?: DropdownMenuVariant;
|
|
13
|
+
}
|
|
14
|
+
export interface DropdownMenuContentProps extends HTMLAttributes<HTMLDivElement> {
|
|
15
|
+
align?: 'left' | 'right' | 'center';
|
|
16
|
+
width?: string | number;
|
|
17
|
+
}
|
|
18
|
+
export interface DropdownMenuItemProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
destructive?: boolean;
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
shortcut?: string;
|
|
23
|
+
}
|
|
24
|
+
export type DropdownMenuSeparatorProps = HTMLAttributes<HTMLDivElement>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Email } from './Email';
|
|
3
|
+
declare const meta: Meta<typeof Email>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Email>;
|
|
6
|
+
export declare const Basic: Story;
|
|
7
|
+
export declare const WithIcon: Story;
|
|
8
|
+
export declare const MultipleAllowed: Story;
|
|
9
|
+
export declare const ErrorState: Story;
|
|
10
|
+
export declare const FilledVariant: Story;
|
|
11
|
+
export declare const SuccessState: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type EmailVariant = 'default' | 'filled' | 'flushed' | 'unstyled';
|
|
3
|
+
export type EmailSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export type EmailState = 'default' | 'error' | 'success' | 'warning';
|
|
5
|
+
export interface EmailProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'prefix' | 'type'> {
|
|
6
|
+
label?: string;
|
|
7
|
+
required?: boolean;
|
|
8
|
+
helperText?: string;
|
|
9
|
+
errorMessage?: string;
|
|
10
|
+
successMessage?: string;
|
|
11
|
+
warningMessage?: string;
|
|
12
|
+
variant?: EmailVariant;
|
|
13
|
+
size?: EmailSize;
|
|
14
|
+
state?: EmailState;
|
|
15
|
+
fullWidth?: boolean;
|
|
16
|
+
leftElement?: ReactNode;
|
|
17
|
+
rightElement?: ReactNode;
|
|
18
|
+
prefix?: ReactNode;
|
|
19
|
+
suffix?: ReactNode;
|
|
20
|
+
wrapperClassName?: string;
|
|
21
|
+
inputGroupClassName?: string;
|
|
22
|
+
inputClassName?: string;
|
|
23
|
+
labelClassName?: string;
|
|
24
|
+
helperClassName?: string;
|
|
25
|
+
clearable?: boolean;
|
|
26
|
+
isLoading?: boolean;
|
|
27
|
+
/**
|
|
28
|
+
* If true, allows the user to enter multiple email addresses separated by commas.
|
|
29
|
+
* Useful for "To" fields in email composers.
|
|
30
|
+
* @default false
|
|
31
|
+
*/
|
|
32
|
+
multiple?: boolean;
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { FileUpload } from './FileUpload';
|
|
3
|
+
declare const meta: Meta<typeof FileUpload>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const MultiFileUpload: Story;
|
|
8
|
+
export declare const States: Story;
|
|
9
|
+
export declare const Sizes: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type FileUploadSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type FileUploadState = 'default' | 'error' | 'success' | 'warning';
|
|
4
|
+
export interface FileUploadProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'size' | 'type' | 'value' | 'onChange'> {
|
|
5
|
+
label?: string;
|
|
6
|
+
required?: boolean;
|
|
7
|
+
helperText?: string;
|
|
8
|
+
errorMessage?: string;
|
|
9
|
+
successMessage?: string;
|
|
10
|
+
warningMessage?: string;
|
|
11
|
+
size?: FileUploadSize;
|
|
12
|
+
state?: FileUploadState;
|
|
13
|
+
fullWidth?: boolean;
|
|
14
|
+
wrapperClassName?: string;
|
|
15
|
+
labelClassName?: string;
|
|
16
|
+
helperClassName?: string;
|
|
17
|
+
dropzoneClassName?: string;
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
maxSize?: number;
|
|
20
|
+
maxFiles?: number;
|
|
21
|
+
onFilesSelected?: (files: File[]) => void;
|
|
22
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Header } from './Header';
|
|
3
|
+
declare const meta: Meta<typeof Header>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Header>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Simple: Story;
|
|
8
|
+
export declare const WithGlassEffect: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface HeaderProps {
|
|
3
|
+
/** Logo or brand element to display on the left. */
|
|
4
|
+
logo?: ReactNode;
|
|
5
|
+
/** Middle section content, often used for search. */
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
/** Array of menu items or icons for the right side actions. */
|
|
8
|
+
actions?: ReactNode;
|
|
9
|
+
/** Optional user profile section content. */
|
|
10
|
+
userSection?: ReactNode;
|
|
11
|
+
/** Whether the header is sticky at the top. */
|
|
12
|
+
isSticky?: boolean;
|
|
13
|
+
/** Additional CSS classes for the container. */
|
|
14
|
+
className?: string;
|
|
15
|
+
/** Whether to show the glass effect. */
|
|
16
|
+
glass?: boolean;
|
|
17
|
+
/** Sidebar toggle click handler (for mobile). */
|
|
18
|
+
onMenuToggle?: () => void;
|
|
19
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { IconButton } from './IconButton';
|
|
3
|
+
declare const meta: Meta<typeof IconButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof IconButton>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const Round: Story;
|
|
8
|
+
export declare const Secondary: Story;
|
|
9
|
+
export declare const Outline: Story;
|
|
10
|
+
export declare const Ghost: Story;
|
|
11
|
+
export declare const Danger: Story;
|
|
12
|
+
export declare const Success: Story;
|
|
13
|
+
export declare const Warning: Story;
|
|
14
|
+
export declare const Info: Story;
|
|
15
|
+
export declare const Loading: Story;
|
|
16
|
+
export declare const Sizes: Story;
|
|
17
|
+
export declare const WithTooltip: Story;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { ButtonProps } from '../Button/Button.types';
|
|
3
|
+
export interface IconButtonProps extends Omit<ButtonProps, 'children' | 'leftIcon' | 'rightIcon' | 'loadingText' | 'fullWidth'> {
|
|
4
|
+
/** The icon to display inside the button */
|
|
5
|
+
icon: ReactNode;
|
|
6
|
+
/** Accessible label for the icon button */
|
|
7
|
+
'aria-label': string;
|
|
8
|
+
/** Whether the button should be rounded/circular */
|
|
9
|
+
isRound?: boolean;
|
|
10
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ImageProps } from './Image.types';
|
|
3
|
+
/**
|
|
4
|
+
* A robust Image component with built-in loading states and error handling.
|
|
5
|
+
*/
|
|
6
|
+
export declare const Image: React.ForwardRefExoticComponent<ImageProps & React.RefAttributes<HTMLImageElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Image } from './Image';
|
|
3
|
+
declare const meta: Meta<typeof Image>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Image>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const WithAspectRatio: Story;
|
|
8
|
+
export declare const Square: Story;
|
|
9
|
+
export declare const ObjectContain: Story;
|
|
10
|
+
export declare const LoadingState: Story;
|
|
11
|
+
export declare const ErrorState: Story;
|
|
12
|
+
export declare const CustomFallback: Story;
|
|
13
|
+
export declare const FallbackImage: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { ImgHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface ImageProps extends ImgHTMLAttributes<HTMLImageElement> {
|
|
3
|
+
/**
|
|
4
|
+
* The source URL of the image.
|
|
5
|
+
*/
|
|
6
|
+
src: string;
|
|
7
|
+
/**
|
|
8
|
+
* The alt text for the image.
|
|
9
|
+
*/
|
|
10
|
+
alt: string;
|
|
11
|
+
/**
|
|
12
|
+
* Optional fallback component or image URL to show if the image fails to load.
|
|
13
|
+
*/
|
|
14
|
+
fallback?: ReactNode;
|
|
15
|
+
/**
|
|
16
|
+
* Optional component to show while the image is loading.
|
|
17
|
+
* If not provided, a default Skeleton will be used.
|
|
18
|
+
*/
|
|
19
|
+
loadingComponent?: ReactNode;
|
|
20
|
+
/**
|
|
21
|
+
* Whether to show a skeleton loader while loading.
|
|
22
|
+
* @default true
|
|
23
|
+
*/
|
|
24
|
+
showSkeleton?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* The aspect ratio of the image container.
|
|
27
|
+
* Useful to prevent layout shift.
|
|
28
|
+
* Example: '16/9', '1/1', '4/3'
|
|
29
|
+
*/
|
|
30
|
+
aspectRatio?: string;
|
|
31
|
+
/**
|
|
32
|
+
* How the image should be fitted in its container.
|
|
33
|
+
* @default 'cover'
|
|
34
|
+
*/
|
|
35
|
+
objectFit?: 'cover' | 'contain' | 'fill' | 'none' | 'scale-down';
|
|
36
|
+
/**
|
|
37
|
+
* Container className.
|
|
38
|
+
*/
|
|
39
|
+
containerClassName?: string;
|
|
40
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Link } from './Link';
|
|
3
|
+
declare const meta: Meta<typeof Link>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Link>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const Secondary: Story;
|
|
8
|
+
export declare const Danger: Story;
|
|
9
|
+
export declare const Ghost: Story;
|
|
10
|
+
export declare const ExternalLink: Story;
|
|
11
|
+
export declare const WithLeftIcon: Story;
|
|
12
|
+
export declare const WithRightIcon: Story;
|
|
13
|
+
export declare const Disabled: Story;
|
|
14
|
+
export declare const Sizes: Story;
|
|
15
|
+
export declare const InlineParagraph: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { AnchorHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export type LinkVariant = 'primary' | 'secondary' | 'danger' | 'ghost';
|
|
3
|
+
export type LinkSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
4
|
+
export type LinkUnderline = 'always' | 'hover' | 'none';
|
|
5
|
+
export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
|
|
6
|
+
/** The styling variant of the link */
|
|
7
|
+
variant?: LinkVariant;
|
|
8
|
+
/** The text size of the link */
|
|
9
|
+
size?: LinkSize;
|
|
10
|
+
/** Controls when the underline decoration is visible */
|
|
11
|
+
underline?: LinkUnderline;
|
|
12
|
+
/** If true, natively configures target="_blank" and secure rel attributes */
|
|
13
|
+
isExternal?: boolean;
|
|
14
|
+
/** Disables the link securely (removes pointer events and sets aria-disabled) */
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
/** An optional icon element to display before the text */
|
|
17
|
+
leftIcon?: ReactNode;
|
|
18
|
+
/** An optional icon element to display after the text */
|
|
19
|
+
rightIcon?: ReactNode;
|
|
20
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
+
import { Loader } from './Loader';
|
|
3
|
+
declare const meta: Meta<typeof Loader>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof meta>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Variants: Story;
|
|
8
|
+
export declare const Sizes: Story;
|
|
9
|
+
export declare const Colors: Story;
|
|
10
|
+
export declare const DotsVariant: Story;
|
|
11
|
+
export declare const PulseVariant: Story;
|
|
12
|
+
export declare const BarVariant: Story;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export type LoaderVariant = 'spinner' | 'dots' | 'pulse' | 'bar';
|
|
2
|
+
export type LoaderSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
3
|
+
export type LoaderColor = 'primary' | 'secondary' | 'success' | 'error' | 'warning' | 'white' | 'current';
|
|
4
|
+
export interface LoaderProps {
|
|
5
|
+
/** Visual style of the loader. Defaults to 'spinner'. */
|
|
6
|
+
variant?: LoaderVariant;
|
|
7
|
+
/** Size of the loader. Defaults to 'md'. */
|
|
8
|
+
size?: LoaderSize;
|
|
9
|
+
/** Color theme. Defaults to 'primary'. */
|
|
10
|
+
color?: LoaderColor;
|
|
11
|
+
/** Screen-reader label. Defaults to 'Loading…'. */
|
|
12
|
+
label?: string;
|
|
13
|
+
/** When true the loader is centred inside a full-page overlay. */
|
|
14
|
+
fullscreen?: boolean;
|
|
15
|
+
/** Additional class for the outermost element. */
|
|
16
|
+
className?: string;
|
|
17
|
+
}
|