@kazee-ds/react 0.0.0-stage → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +3436 -0
- package/dist/index.js.map +1 -0
- package/dist/types/Alert.d.ts +12 -0
- package/dist/types/Badge.d.ts +7 -0
- package/dist/types/Breadcrumb.d.ts +8 -0
- package/dist/types/Button.d.ts +53 -0
- package/dist/types/ButtonGroup.d.ts +18 -0
- package/dist/types/Card.d.ts +14 -0
- package/dist/types/Chart.d.ts +15 -0
- package/dist/types/Checkbox.d.ts +16 -0
- package/dist/types/Combobox.d.ts +27 -0
- package/dist/types/DataTable.d.ts +18 -0
- package/dist/types/DateRangePicker.d.ts +12 -0
- package/dist/types/Dialog.d.ts +29 -0
- package/dist/types/DropdownMenu.d.ts +25 -0
- package/dist/types/Empty.d.ts +10 -0
- package/dist/types/FieldComponent.d.ts +33 -0
- package/dist/types/Form.d.ts +17 -0
- package/dist/types/Input.d.ts +47 -0
- package/dist/types/Label.d.ts +8 -0
- package/dist/types/Listbox.d.ts +17 -0
- package/dist/types/NumberField.d.ts +24 -0
- package/dist/types/OverlayDirection.d.ts +5 -0
- package/dist/types/Pagination.d.ts +16 -0
- package/dist/types/Popover.d.ts +14 -0
- package/dist/types/RadioGroup.d.ts +20 -0
- package/dist/types/Select.d.ts +50 -0
- package/dist/types/SelectGroup.d.ts +13 -0
- package/dist/types/SelectionValidation.d.ts +8 -0
- package/dist/types/Separator.d.ts +6 -0
- package/dist/types/Sidebar.d.ts +13 -0
- package/dist/types/Skeleton.d.ts +7 -0
- package/dist/types/Spinner.d.ts +10 -0
- package/dist/types/Switch.d.ts +13 -0
- package/dist/types/Table.d.ts +5 -0
- package/dist/types/Tabs.d.ts +33 -0
- package/dist/types/Textarea.d.ts +24 -0
- package/dist/types/Toast.d.ts +26 -0
- package/dist/types/ToggleButton.d.ts +23 -0
- package/dist/types/ToggleButtonGroup.d.ts +30 -0
- package/dist/types/ToggleGroup.d.ts +33 -0
- package/dist/types/Tooltip.d.ts +16 -0
- package/dist/types/chart-model.d.ts +12 -0
- package/dist/types/dashboard-types.d.ts +27 -0
- package/dist/types/data-table-types.d.ts +13 -0
- package/dist/types/date-range-model.d.ts +69 -0
- package/dist/types/field.d.ts +9 -0
- package/dist/types/form-context.d.ts +3 -0
- package/dist/types/icons.d.ts +7 -0
- package/dist/types/index.d.ts +87 -0
- package/dist/types/listbox-selection.d.ts +8 -0
- package/dist/types/overlay-model.d.ts +14 -0
- package/dist/types/pagination-model.d.ts +5 -0
- package/dist/types/selection-options.d.ts +8 -0
- package/dist/types/tabs-indicator.d.ts +1 -0
- package/dist/types/toast-model.d.ts +64 -0
- package/dist/types/toggle-group-model.d.ts +9 -0
- package/dist/types/useDisclosure.d.ts +4 -0
- package/package.json +56 -3
- package/README.md +0 -3
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { BadgeTone } from './Badge.js';
|
|
3
|
+
export interface AlertProps {
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
tone?: BadgeTone;
|
|
7
|
+
announcement?: 'off' | 'polite' | 'assertive';
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
actions?: ReactNode;
|
|
10
|
+
id?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Alert({ title, description, tone, announcement, children, actions, id, }: AlertProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type BadgeTone = 'neutral' | 'info' | 'success' | 'warning' | 'danger';
|
|
3
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
tone?: BadgeTone;
|
|
5
|
+
}
|
|
6
|
+
/** Static status text. Dynamic announcements belong in an application-owned live region. */
|
|
7
|
+
export declare function Badge({ tone, className, ...props }: BadgeProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { BreadcrumbItem } from './dashboard-types.js';
|
|
2
|
+
export interface BreadcrumbProps {
|
|
3
|
+
items: BreadcrumbItem[];
|
|
4
|
+
label?: string;
|
|
5
|
+
dir?: 'ltr' | 'rtl';
|
|
6
|
+
id?: string;
|
|
7
|
+
}
|
|
8
|
+
export declare function Breadcrumb({ items, label, dir, id }: BreadcrumbProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { type ButtonProps as AriaButtonProps } from 'react-aria-components/Button';
|
|
2
|
+
import { type ReactNode } from 'react';
|
|
3
|
+
export type ButtonVariant = 'primary' | 'secondary' | 'danger' | 'outline' | 'tertiary' | 'ghost' | 'danger-soft' | 'ai';
|
|
4
|
+
export type ButtonSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
/** The event passed to `onPress`: pointer type, modifier keys, and the target element. */
|
|
6
|
+
export type ButtonPressEvent = Parameters<NonNullable<AriaButtonProps['onPress']>>[0];
|
|
7
|
+
/** Public flags supplied to the Button render function. */
|
|
8
|
+
export interface ButtonRenderProps {
|
|
9
|
+
isPending: boolean;
|
|
10
|
+
isDisabled: boolean;
|
|
11
|
+
isHovered: boolean;
|
|
12
|
+
isPressed: boolean;
|
|
13
|
+
isFocused: boolean;
|
|
14
|
+
isFocusVisible: boolean;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* The props the design system supports on `Button`. Anything not listed here is not part of the
|
|
18
|
+
* public API, even if the underlying React Aria button would accept it.
|
|
19
|
+
*/
|
|
20
|
+
export interface ButtonProps {
|
|
21
|
+
/** Label or content of the button. */
|
|
22
|
+
children?: ReactNode | ((state: ButtonRenderProps) => ReactNode);
|
|
23
|
+
/** Square icon button. Supply aria-label or aria-labelledby. */
|
|
24
|
+
isIconOnly?: boolean;
|
|
25
|
+
/** Blocks actions while retaining focus. Render a Spinner through children if desired. */
|
|
26
|
+
isPending?: boolean;
|
|
27
|
+
/** Visual style. Use `danger` for destructive actions such as delete. */
|
|
28
|
+
variant?: ButtonVariant;
|
|
29
|
+
/** Size of the button. */
|
|
30
|
+
size?: ButtonSize;
|
|
31
|
+
/** Fill the container width. Icon-only buttons retain their square shape. */
|
|
32
|
+
fullWidth?: boolean;
|
|
33
|
+
/** Disables the button. The button is not focusable and `onPress` is not called. */
|
|
34
|
+
isDisabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Called when the button is activated by mouse, touch, keyboard, or screen reader. Use this
|
|
37
|
+
* instead of `onClick`.
|
|
38
|
+
*/
|
|
39
|
+
onPress?: (event: ButtonPressEvent) => void;
|
|
40
|
+
/** Button type inside a form. Defaults to `button`. */
|
|
41
|
+
type?: 'button' | 'submit' | 'reset';
|
|
42
|
+
/** Accessible name when the button has no visible text, such as an icon-only button. */
|
|
43
|
+
'aria-label'?: string;
|
|
44
|
+
/** Id of an element that labels the button. */
|
|
45
|
+
'aria-labelledby'?: string;
|
|
46
|
+
/** Id of an element that describes the button. */
|
|
47
|
+
'aria-describedby'?: string;
|
|
48
|
+
/** Id of the button element. */
|
|
49
|
+
id?: string;
|
|
50
|
+
/** Focuses the button when it first renders. */
|
|
51
|
+
autoFocus?: boolean;
|
|
52
|
+
}
|
|
53
|
+
export declare function Button({ variant, size, isIconOnly, isPending, isDisabled, fullWidth, type, children, ...props }: ButtonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type ButtonSize, type ButtonVariant } from './Button.js';
|
|
3
|
+
export interface ButtonGroupProps {
|
|
4
|
+
label: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
variant?: ButtonVariant;
|
|
7
|
+
size?: ButtonSize;
|
|
8
|
+
isDisabled?: boolean;
|
|
9
|
+
fullWidth?: boolean;
|
|
10
|
+
orientation?: 'horizontal' | 'vertical';
|
|
11
|
+
dir?: 'ltr' | 'rtl';
|
|
12
|
+
}
|
|
13
|
+
export declare function ButtonGroupSeparator(): import("react").JSX.Element;
|
|
14
|
+
declare function Root({ children, label, variant, size, isDisabled, fullWidth, orientation, dir, }: ButtonGroupProps): import("react").JSX.Element;
|
|
15
|
+
export declare const ButtonGroup: typeof Root & {
|
|
16
|
+
Separator: typeof ButtonGroupSeparator;
|
|
17
|
+
};
|
|
18
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
title?: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
/** Custom leading header content; replaces title/description, preserving actions. */
|
|
7
|
+
header?: ReactNode;
|
|
8
|
+
/** Badge or supplementary controls next to the title, outside its heading. */
|
|
9
|
+
titleExtras?: ReactNode;
|
|
10
|
+
actions?: ReactNode;
|
|
11
|
+
footer?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/** A content container; place links and buttons inside rather than making it clickable. */
|
|
14
|
+
export declare function Card({ title, description, headingLevel, actions, header, titleExtras, footer, children, className, ...props }: CardProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { ChartDatum } from './dashboard-types.js';
|
|
2
|
+
export interface ChartProps {
|
|
3
|
+
label: string;
|
|
4
|
+
data: ChartDatum[];
|
|
5
|
+
type?: 'bar' | 'line';
|
|
6
|
+
description?: string;
|
|
7
|
+
locale?: string;
|
|
8
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
9
|
+
categoryLabel?: string;
|
|
10
|
+
valueLabel?: string;
|
|
11
|
+
emptyMessage?: string;
|
|
12
|
+
id?: string;
|
|
13
|
+
dir?: 'ltr' | 'rtl';
|
|
14
|
+
}
|
|
15
|
+
export declare function Chart({ label, data, type, description, locale, formatOptions, categoryLabel, valueLabel, emptyMessage, id, dir, }: ChartProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type FieldFeedbackProps } from './field.js';
|
|
2
|
+
export interface CheckboxProps extends FieldFeedbackProps {
|
|
3
|
+
label: string;
|
|
4
|
+
isSelected?: boolean;
|
|
5
|
+
defaultSelected?: boolean;
|
|
6
|
+
onChange?: (selected: boolean) => void;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
isRequired?: boolean;
|
|
9
|
+
/** Presentational mixed state; the application clears it after a change. */
|
|
10
|
+
isIndeterminate?: boolean;
|
|
11
|
+
name?: string;
|
|
12
|
+
value?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
dir?: 'ltr' | 'rtl';
|
|
15
|
+
}
|
|
16
|
+
export declare function Checkbox({ label, description, errorMessage, isInvalid, isSelected, defaultSelected, onChange, isDisabled, isRequired, isIndeterminate, name, value, id, dir, }: CheckboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type SelectOption } from './selection-options.js';
|
|
3
|
+
export interface ComboboxProps {
|
|
4
|
+
label: string;
|
|
5
|
+
options: SelectOption[];
|
|
6
|
+
value?: string | null;
|
|
7
|
+
defaultValue?: string | null;
|
|
8
|
+
onChange?: (value: string | null) => void;
|
|
9
|
+
/** Decorative noninteractive icon before the value/input. */
|
|
10
|
+
startContent?: ReactNode;
|
|
11
|
+
placeholder?: string;
|
|
12
|
+
name?: string;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
isRequired?: boolean;
|
|
15
|
+
isInvalid?: boolean;
|
|
16
|
+
description?: string;
|
|
17
|
+
errorMessage?: string;
|
|
18
|
+
requiredMessage?: string;
|
|
19
|
+
isClearable?: boolean;
|
|
20
|
+
clearLabel?: string;
|
|
21
|
+
toggleLabel?: string;
|
|
22
|
+
emptyMessage?: string;
|
|
23
|
+
dir?: 'ltr' | 'rtl';
|
|
24
|
+
renderOption?: (option: SelectOption) => ReactNode;
|
|
25
|
+
}
|
|
26
|
+
/** Searchable single selection. Draft text is never submitted as a value. */
|
|
27
|
+
export declare function Combobox(props: ComboboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { DataTableColumn, DataTableRow, TableSort } from './data-table-types.js';
|
|
3
|
+
export interface DataTableProps {
|
|
4
|
+
caption: string;
|
|
5
|
+
columns: DataTableColumn[];
|
|
6
|
+
rows: DataTableRow[];
|
|
7
|
+
sort?: TableSort | null;
|
|
8
|
+
onSortChange?: (sort: TableSort) => void;
|
|
9
|
+
isLoading?: boolean;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
emptyMessage?: string;
|
|
12
|
+
loadingMessage?: string;
|
|
13
|
+
errorMessage?: string;
|
|
14
|
+
renderCell?: (row: DataTableRow, column: DataTableColumn) => ReactNode;
|
|
15
|
+
dir?: 'ltr' | 'rtl';
|
|
16
|
+
id?: string;
|
|
17
|
+
}
|
|
18
|
+
export declare function DataTable({ caption, columns, rows, sort, onSortChange, isLoading, isDisabled, emptyMessage, loadingMessage, errorMessage, renderCell, dir, id, }: DataTableProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type DateRange, type DateRangeOptions } from './date-range-model.js';
|
|
2
|
+
export interface DateRangePickerProps extends DateRangeOptions {
|
|
3
|
+
value?: DateRange | null;
|
|
4
|
+
onChange?: (value: DateRange | null) => void;
|
|
5
|
+
onApply?: (value: DateRange | null) => void;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
isReadOnly?: boolean;
|
|
9
|
+
isRequired?: boolean;
|
|
10
|
+
isInvalid?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare function DateRangePicker(props: DateRangePickerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import type { ButtonVariant } from './Button.js';
|
|
3
|
+
import type { DialogSize, DialogPlacement, DialogScroll, DialogBackdrop } from './overlay-model.js';
|
|
4
|
+
export interface DialogProps {
|
|
5
|
+
triggerLabel: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
footer?: ReactNode;
|
|
10
|
+
open?: boolean;
|
|
11
|
+
defaultOpen?: boolean;
|
|
12
|
+
onOpenChange?: (open: boolean) => void;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
closeLabel?: string;
|
|
15
|
+
dir?: 'ltr' | 'rtl';
|
|
16
|
+
triggerContent?: ReactNode;
|
|
17
|
+
triggerIconOnly?: boolean;
|
|
18
|
+
triggerVariant?: ButtonVariant;
|
|
19
|
+
size?: DialogSize;
|
|
20
|
+
placement?: DialogPlacement;
|
|
21
|
+
scroll?: DialogScroll;
|
|
22
|
+
backdrop?: DialogBackdrop;
|
|
23
|
+
isDismissable?: boolean;
|
|
24
|
+
isKeyboardDismissDisabled?: boolean;
|
|
25
|
+
showCloseButton?: boolean;
|
|
26
|
+
showFooterClose?: boolean;
|
|
27
|
+
closeIconLabel?: string;
|
|
28
|
+
}
|
|
29
|
+
export declare function Dialog(props: DialogProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type MenuSelectionMode, type MenuPlacement } from './overlay-model.js';
|
|
3
|
+
import type { DropdownMenuItem } from './dashboard-types.js';
|
|
4
|
+
import type { ButtonVariant } from './Button.js';
|
|
5
|
+
export interface DropdownMenuProps {
|
|
6
|
+
triggerLabel: string;
|
|
7
|
+
items: DropdownMenuItem[];
|
|
8
|
+
onAction?: (id: string) => void;
|
|
9
|
+
open?: boolean;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
isDisabled?: boolean;
|
|
13
|
+
dir?: 'ltr' | 'rtl';
|
|
14
|
+
triggerContent?: ReactNode;
|
|
15
|
+
triggerIconOnly?: boolean;
|
|
16
|
+
triggerVariant?: ButtonVariant;
|
|
17
|
+
renderIcon?: (item: DropdownMenuItem) => ReactNode;
|
|
18
|
+
selectionMode?: MenuSelectionMode;
|
|
19
|
+
selectedKeys?: string[];
|
|
20
|
+
defaultSelectedKeys?: string[];
|
|
21
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
22
|
+
closeOnSelect?: boolean;
|
|
23
|
+
placement?: MenuPlacement;
|
|
24
|
+
}
|
|
25
|
+
export declare function DropdownMenu(props: DropdownMenuProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface EmptyProps {
|
|
3
|
+
title: string;
|
|
4
|
+
description?: string;
|
|
5
|
+
headingLevel?: 2 | 3 | 4 | 5 | 6;
|
|
6
|
+
actions?: ReactNode;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
id?: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function Empty({ title, description, headingLevel, actions, children, id }: EmptyProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
/** Bind these props to exactly one native input, textarea, or select. */
|
|
3
|
+
export interface FieldControlProps {
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
className: string;
|
|
7
|
+
disabled: boolean;
|
|
8
|
+
readOnly: boolean;
|
|
9
|
+
required: boolean;
|
|
10
|
+
'aria-required': true | undefined;
|
|
11
|
+
'aria-invalid': true | undefined;
|
|
12
|
+
'aria-describedby': string | undefined;
|
|
13
|
+
}
|
|
14
|
+
export interface FieldRenderProps {
|
|
15
|
+
controlProps: FieldControlProps;
|
|
16
|
+
isInvalid: boolean;
|
|
17
|
+
errorMessage: string | undefined;
|
|
18
|
+
}
|
|
19
|
+
/** Experimental composition API; the application owns the control value. */
|
|
20
|
+
export interface FieldProps {
|
|
21
|
+
label: string;
|
|
22
|
+
name: string;
|
|
23
|
+
children: (field: FieldRenderProps) => ReactNode;
|
|
24
|
+
id?: string;
|
|
25
|
+
description?: string;
|
|
26
|
+
errorMessage?: string;
|
|
27
|
+
isInvalid?: boolean;
|
|
28
|
+
isDisabled?: boolean;
|
|
29
|
+
isReadOnly?: boolean;
|
|
30
|
+
isRequired?: boolean;
|
|
31
|
+
dir?: 'ltr' | 'rtl';
|
|
32
|
+
}
|
|
33
|
+
export declare function Field({ label, name, children, id, description, errorMessage, isInvalid, isDisabled, isReadOnly, isRequired, dir, }: FieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { FormEvent, ReactNode } from 'react';
|
|
2
|
+
import { type ValidationErrors } from './form-context.js';
|
|
3
|
+
/** Experimental client form. Submission always prevents page navigation. */
|
|
4
|
+
export interface FormProps {
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
validationErrors?: ValidationErrors;
|
|
7
|
+
onSubmit?: (data: FormData, event: FormEvent<HTMLFormElement>) => void;
|
|
8
|
+
/** Prevent default and reset application state when using controlled values. */
|
|
9
|
+
onReset?: (event: FormEvent<HTMLFormElement>) => void;
|
|
10
|
+
/** Skips browser constraints; explicit aria-invalid state still blocks submission. */
|
|
11
|
+
noValidate?: boolean;
|
|
12
|
+
id?: string;
|
|
13
|
+
'aria-label'?: string;
|
|
14
|
+
'aria-labelledby'?: string;
|
|
15
|
+
dir?: 'ltr' | 'rtl';
|
|
16
|
+
}
|
|
17
|
+
export declare function Form({ children, validationErrors, onSubmit, onReset, noValidate, id, 'aria-label': ariaLabel, 'aria-labelledby': labelledBy, dir, }: FormProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { type FocusEventHandler, type KeyboardEventHandler, type ReactNode } from 'react';
|
|
2
|
+
export type InputSize = 'sm' | 'md' | 'lg';
|
|
3
|
+
export type InputType = 'text' | 'email' | 'password' | 'search' | 'tel' | 'url';
|
|
4
|
+
export type InputVariant = 'primary' | 'secondary';
|
|
5
|
+
export type InputMode = 'none' | 'text' | 'tel' | 'url' | 'email' | 'numeric' | 'decimal' | 'search';
|
|
6
|
+
export type InputEnterKeyHint = 'enter' | 'done' | 'go' | 'next' | 'previous' | 'search' | 'send';
|
|
7
|
+
/** A labeled single-line string field. Numeric/date parsing is a separate contract. */
|
|
8
|
+
export interface InputProps {
|
|
9
|
+
label: string;
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
/** Receives the string value, not a DOM event. Clear with an empty string. */
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
description?: string;
|
|
15
|
+
/** Shown only when isInvalid is true; the application owns validation. */
|
|
16
|
+
errorMessage?: string;
|
|
17
|
+
isInvalid?: boolean;
|
|
18
|
+
isDisabled?: boolean;
|
|
19
|
+
isReadOnly?: boolean;
|
|
20
|
+
isRequired?: boolean;
|
|
21
|
+
placeholder?: string;
|
|
22
|
+
type?: InputType;
|
|
23
|
+
size?: InputSize;
|
|
24
|
+
variant?: InputVariant;
|
|
25
|
+
/** Fill the available width. Defaults to true to preserve the existing field layout. */
|
|
26
|
+
fullWidth?: boolean;
|
|
27
|
+
/** Leading/trailing content. Mark decorative icons aria-hidden; name interactive buttons. */
|
|
28
|
+
prefix?: ReactNode;
|
|
29
|
+
suffix?: ReactNode;
|
|
30
|
+
name?: string;
|
|
31
|
+
id?: string;
|
|
32
|
+
autoComplete?: string;
|
|
33
|
+
maxLength?: number;
|
|
34
|
+
minLength?: number;
|
|
35
|
+
pattern?: string;
|
|
36
|
+
inputMode?: InputMode;
|
|
37
|
+
enterKeyHint?: InputEnterKeyHint;
|
|
38
|
+
autoFocus?: boolean;
|
|
39
|
+
spellCheck?: boolean;
|
|
40
|
+
form?: string;
|
|
41
|
+
onFocus?: FocusEventHandler<HTMLInputElement>;
|
|
42
|
+
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
43
|
+
onKeyDown?: KeyboardEventHandler<HTMLInputElement>;
|
|
44
|
+
onKeyUp?: KeyboardEventHandler<HTMLInputElement>;
|
|
45
|
+
dir?: 'ltr' | 'rtl';
|
|
46
|
+
}
|
|
47
|
+
export declare const Input: import("react").ForwardRefExoticComponent<InputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface LabelProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
htmlFor?: string;
|
|
5
|
+
id?: string;
|
|
6
|
+
}
|
|
7
|
+
/** Associates visible text with a separately rendered control. */
|
|
8
|
+
export declare function Label({ children, htmlFor, id }: LabelProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type FieldFeedbackProps } from './field.js';
|
|
2
|
+
import { type ListboxOption, type ListboxSelectionMode } from './listbox-selection.js';
|
|
3
|
+
export interface ListboxProps extends FieldFeedbackProps {
|
|
4
|
+
label: string;
|
|
5
|
+
options: ListboxOption[];
|
|
6
|
+
/** Always an array; empty selection is []. */
|
|
7
|
+
value?: string[];
|
|
8
|
+
defaultValue?: string[];
|
|
9
|
+
onChange?: (value: string[]) => void;
|
|
10
|
+
selectionMode?: ListboxSelectionMode;
|
|
11
|
+
isDisabled?: boolean;
|
|
12
|
+
name?: string;
|
|
13
|
+
id?: string;
|
|
14
|
+
dir?: 'ltr' | 'rtl';
|
|
15
|
+
emptyMessage?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare function Listbox({ label, options, value, defaultValue, onChange, selectionMode, isDisabled, description, errorMessage, isInvalid, name, id, dir, emptyMessage, }: ListboxProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export interface NumberFieldProps {
|
|
2
|
+
label: string;
|
|
3
|
+
value?: number | null;
|
|
4
|
+
defaultValue?: number | null;
|
|
5
|
+
/** Committed numeric value; empty or non-finite values become null. */
|
|
6
|
+
onChange?: (value: number | null) => void;
|
|
7
|
+
min?: number;
|
|
8
|
+
max?: number;
|
|
9
|
+
step?: number;
|
|
10
|
+
locale?: string;
|
|
11
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
12
|
+
description?: string;
|
|
13
|
+
errorMessage?: string;
|
|
14
|
+
isInvalid?: boolean;
|
|
15
|
+
isDisabled?: boolean;
|
|
16
|
+
isReadOnly?: boolean;
|
|
17
|
+
isRequired?: boolean;
|
|
18
|
+
name?: string;
|
|
19
|
+
id?: string;
|
|
20
|
+
dir?: 'ltr' | 'rtl';
|
|
21
|
+
incrementLabel?: string;
|
|
22
|
+
decrementLabel?: string;
|
|
23
|
+
}
|
|
24
|
+
export declare function NumberField({ label, value, defaultValue, onChange, min, max, step, locale, formatOptions, description, errorMessage, isInvalid, isDisabled, isReadOnly, isRequired, name, id, dir, incrementLabel, decrementLabel, }: NumberFieldProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export declare function OverlayDirection({ dir, children }: {
|
|
3
|
+
dir?: 'ltr' | 'rtl';
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
}): string | number | bigint | boolean | import("react").JSX.Element | Iterable<ReactNode> | Promise<string | number | bigint | boolean | import("react").ReactPortal | import("react").ReactElement<unknown, string | import("react").JSXElementConstructor<any>> | Iterable<ReactNode> | null | undefined> | null | undefined;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface PaginationProps {
|
|
2
|
+
totalItems: number;
|
|
3
|
+
pageSize?: number;
|
|
4
|
+
value?: number;
|
|
5
|
+
defaultValue?: number;
|
|
6
|
+
onChange?: (page: number) => void;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
siblingCount?: number;
|
|
9
|
+
label?: string;
|
|
10
|
+
previousLabel?: string;
|
|
11
|
+
nextLabel?: string;
|
|
12
|
+
pageLabel?: string;
|
|
13
|
+
dir?: 'ltr' | 'rtl';
|
|
14
|
+
id?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare function Pagination({ totalItems, pageSize, value, defaultValue, onChange, isDisabled, siblingCount, label, previousLabel, nextLabel, pageLabel, dir, id, }: PaginationProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
export interface PopoverProps {
|
|
3
|
+
triggerLabel: string;
|
|
4
|
+
title: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
open?: boolean;
|
|
8
|
+
defaultOpen?: boolean;
|
|
9
|
+
onOpenChange?: (open: boolean) => void;
|
|
10
|
+
isDisabled?: boolean;
|
|
11
|
+
closeLabel?: string;
|
|
12
|
+
dir?: 'ltr' | 'rtl';
|
|
13
|
+
}
|
|
14
|
+
export declare function Popover({ triggerLabel, title, description, children, open, defaultOpen, onOpenChange, isDisabled, closeLabel, dir, }: PopoverProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type FieldFeedbackProps } from './field.js';
|
|
2
|
+
export interface RadioOption {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
isDisabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface RadioGroupProps extends FieldFeedbackProps {
|
|
8
|
+
label: string;
|
|
9
|
+
options: RadioOption[];
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onChange?: (value: string) => void;
|
|
13
|
+
isDisabled?: boolean;
|
|
14
|
+
isRequired?: boolean;
|
|
15
|
+
name?: string;
|
|
16
|
+
id?: string;
|
|
17
|
+
orientation?: 'vertical' | 'horizontal';
|
|
18
|
+
dir?: 'ltr' | 'rtl';
|
|
19
|
+
}
|
|
20
|
+
export declare function RadioGroup({ label, options, value, defaultValue, onChange, description, errorMessage, isInvalid, isDisabled, isRequired, name, id, orientation, dir, }: RadioGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type SelectOption } from './selection-options.js';
|
|
3
|
+
export type { SelectOption } from './selection-options.js';
|
|
4
|
+
export type SelectSize = 'sm' | 'md' | 'lg';
|
|
5
|
+
export type SelectVariant = 'primary' | 'secondary' | 'outline';
|
|
6
|
+
interface SelectCommonProps {
|
|
7
|
+
/** Activates an option even when it is already selected (for linked editors). */
|
|
8
|
+
onAction?: (value: string) => void;
|
|
9
|
+
label: string;
|
|
10
|
+
options: SelectOption[];
|
|
11
|
+
size?: SelectSize;
|
|
12
|
+
variant?: SelectVariant;
|
|
13
|
+
/** Hide visually while retaining the accessible label. */
|
|
14
|
+
hideLabel?: boolean;
|
|
15
|
+
/** Defaults to true to preserve the existing full-width trigger. */
|
|
16
|
+
fullWidth?: boolean;
|
|
17
|
+
/** Decorative noninteractive icon before the value/input. */
|
|
18
|
+
startContent?: ReactNode;
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
isDisabled?: boolean;
|
|
21
|
+
isRequired?: boolean;
|
|
22
|
+
isInvalid?: boolean;
|
|
23
|
+
description?: string;
|
|
24
|
+
errorMessage?: string;
|
|
25
|
+
requiredMessage?: string;
|
|
26
|
+
name?: string;
|
|
27
|
+
dir?: 'ltr' | 'rtl';
|
|
28
|
+
isClearable?: boolean;
|
|
29
|
+
clearLabel?: string;
|
|
30
|
+
onClear?: () => void;
|
|
31
|
+
renderOption?: (option: SelectOption) => ReactNode;
|
|
32
|
+
renderValue?: (selected: SelectOption[]) => ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export type SelectProps = SelectCommonProps & ({
|
|
35
|
+
selectionMode?: 'single';
|
|
36
|
+
value?: string | null;
|
|
37
|
+
defaultValue?: string | null;
|
|
38
|
+
onChange?: (value: string) => void;
|
|
39
|
+
} | {
|
|
40
|
+
selectionMode: 'multiple';
|
|
41
|
+
value?: string[];
|
|
42
|
+
defaultValue?: string[];
|
|
43
|
+
onChange?: (value: string[]) => void;
|
|
44
|
+
});
|
|
45
|
+
export declare function Select(props: Extract<SelectProps, {
|
|
46
|
+
selectionMode: 'multiple';
|
|
47
|
+
}>): ReactNode;
|
|
48
|
+
export declare function Select(props: Exclude<SelectProps, {
|
|
49
|
+
selectionMode: 'multiple';
|
|
50
|
+
}>): ReactNode;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ReactNode } from 'react';
|
|
2
|
+
import { type SelectSize, type SelectVariant } from './Select.js';
|
|
3
|
+
export interface SelectGroupProps {
|
|
4
|
+
label: string;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
size?: SelectSize;
|
|
7
|
+
variant?: SelectVariant;
|
|
8
|
+
fullWidth?: boolean;
|
|
9
|
+
isDisabled?: boolean;
|
|
10
|
+
dir?: 'ltr' | 'rtl';
|
|
11
|
+
}
|
|
12
|
+
/** Joins direct Select children. Each child retains its own value and accessible label. */
|
|
13
|
+
export declare function SelectGroup({ label, children, size, variant, fullWidth, isDisabled, dir, }: SelectGroupProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export declare function SelectionValidation({ hasValue, required, disabled, onInvalid, onReset, onResetStart, }: {
|
|
2
|
+
hasValue: boolean;
|
|
3
|
+
required?: boolean;
|
|
4
|
+
disabled?: boolean;
|
|
5
|
+
onInvalid: () => void;
|
|
6
|
+
onReset: (cancelled: boolean) => void;
|
|
7
|
+
onResetStart: () => void;
|
|
8
|
+
}): import("react").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SeparatorProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children' | 'role' | 'aria-hidden' | 'aria-orientation'> {
|
|
3
|
+
orientation?: 'horizontal' | 'vertical';
|
|
4
|
+
decorative?: boolean;
|
|
5
|
+
}
|
|
6
|
+
export declare function Separator({ orientation, decorative, className, ...props }: SeparatorProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { NavigationItem } from './dashboard-types.js';
|
|
2
|
+
export interface SidebarProps {
|
|
3
|
+
label: string;
|
|
4
|
+
items: NavigationItem[];
|
|
5
|
+
currentId?: string;
|
|
6
|
+
open?: boolean;
|
|
7
|
+
defaultOpen?: boolean;
|
|
8
|
+
onOpenChange?: (open: boolean) => void;
|
|
9
|
+
toggleLabel?: string;
|
|
10
|
+
dir?: 'ltr' | 'rtl';
|
|
11
|
+
id?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function Sidebar({ label, items, currentId, open, defaultOpen, onOpenChange, toggleLabel, dir, id, }: SidebarProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export interface SkeletonProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children' | 'aria-hidden'> {
|
|
3
|
+
shape?: 'rectangle' | 'circle';
|
|
4
|
+
animated?: boolean;
|
|
5
|
+
}
|
|
6
|
+
/** Decorative placeholder. Set aria-busy and loading text on the surrounding content. */
|
|
7
|
+
export declare function Skeleton({ shape, animated, className, ...props }: SkeletonProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export type SpinnerSize = 'sm' | 'md' | 'lg';
|
|
2
|
+
export type SpinnerColor = 'current' | 'primary';
|
|
3
|
+
export interface SpinnerProps {
|
|
4
|
+
size?: SpinnerSize;
|
|
5
|
+
color?: SpinnerColor;
|
|
6
|
+
label?: string;
|
|
7
|
+
id?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Decorative by default. Use label for a standalone loading status; omit it inside a labeled Button. */
|
|
10
|
+
export declare function Spinner({ size, color, label, id }: SpinnerProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { FieldFeedbackProps } from './field.js';
|
|
2
|
+
export interface SwitchProps extends FieldFeedbackProps {
|
|
3
|
+
label: string;
|
|
4
|
+
isSelected?: boolean;
|
|
5
|
+
defaultSelected?: boolean;
|
|
6
|
+
onChange?: (selected: boolean) => void;
|
|
7
|
+
isDisabled?: boolean;
|
|
8
|
+
name?: string;
|
|
9
|
+
value?: string;
|
|
10
|
+
id?: string;
|
|
11
|
+
dir?: 'ltr' | 'rtl';
|
|
12
|
+
}
|
|
13
|
+
export declare function Switch({ label, description, errorMessage, isInvalid, isSelected, defaultSelected, onChange, isDisabled, name, value, id, dir, }: SwitchProps): import("react").JSX.Element;
|