@eschoolbase/client-ui 0.1.0 → 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/README.md +124 -11
- package/dist/components/Badge/Badge.d.ts +3 -0
- package/dist/components/Badge/Badge.types.d.ts +8 -0
- package/dist/components/Badge/index.d.ts +2 -0
- package/dist/components/Checkbox/Checkbox.d.ts +3 -0
- package/dist/components/Checkbox/Checkbox.types.d.ts +10 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.d.ts +3 -0
- package/dist/components/ConfirmDialog/ConfirmDialog.types.d.ts +21 -0
- package/dist/components/ConfirmDialog/index.d.ts +2 -0
- package/dist/components/DataTable/DataTable.d.ts +10 -0
- package/dist/components/DataTable/DataTable.types.d.ts +154 -0
- package/dist/components/DataTable/SelectionBar.d.ts +18 -0
- package/dist/components/DataTable/dataTableUtils.d.ts +13 -0
- package/dist/components/DataTable/dataTableUtils.test.d.ts +1 -0
- package/dist/components/DataTable/index.d.ts +6 -0
- package/dist/components/DataTable/remote.d.ts +36 -0
- package/dist/components/DataTable/remote.test.d.ts +1 -0
- package/dist/components/DataTable/useDebouncedValue.d.ts +2 -0
- package/dist/components/DatePicker/Calendar.d.ts +15 -0
- package/dist/components/DatePicker/DatePicker.d.ts +3 -0
- package/dist/components/DatePicker/DatePicker.types.d.ts +45 -0
- package/dist/components/DatePicker/MonthCalendar.d.ts +12 -0
- package/dist/components/DatePicker/PickerField.d.ts +40 -0
- package/dist/components/DatePicker/TimeColumns.d.ts +12 -0
- package/dist/components/DatePicker/createDisabledPredicate.test.d.ts +1 -0
- package/dist/components/DatePicker/dateUtils.d.ts +70 -0
- package/dist/components/DatePicker/dateUtils.test.d.ts +1 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/monthDateTimeUtils.test.d.ts +1 -0
- package/dist/components/DateTimePicker/DateTimePicker.d.ts +3 -0
- package/dist/components/DateTimePicker/DateTimePicker.types.d.ts +50 -0
- package/dist/components/DateTimePicker/index.d.ts +2 -0
- package/dist/components/Drawer/Drawer.d.ts +3 -0
- package/dist/components/Drawer/Drawer.types.d.ts +10 -0
- package/dist/components/Drawer/index.d.ts +2 -0
- package/dist/components/DropdownMenu/DropdownMenu.d.ts +7 -0
- package/dist/components/DropdownMenu/DropdownMenu.types.d.ts +21 -0
- package/dist/components/DropdownMenu/index.d.ts +2 -0
- package/dist/components/FileInput/FileInput.d.ts +6 -0
- package/dist/components/FileInput/FileInput.types.d.ts +55 -0
- package/dist/components/FileInput/ImageCropper.d.ts +21 -0
- package/dist/components/FileInput/fileUtils.d.ts +8 -0
- package/dist/components/FileInput/index.d.ts +3 -0
- package/dist/components/Input/Input.types.d.ts +16 -0
- package/dist/components/Input/PickerTypeInput.d.ts +14 -0
- package/dist/components/Input/index.d.ts +1 -1
- package/dist/components/Modal/Modal.d.ts +6 -0
- package/dist/components/Modal/Modal.types.d.ts +39 -0
- package/dist/components/Modal/index.d.ts +2 -0
- package/dist/components/MonthPicker/MonthPicker.d.ts +3 -0
- package/dist/components/MonthPicker/MonthPicker.types.d.ts +37 -0
- package/dist/components/MonthPicker/index.d.ts +2 -0
- package/dist/components/Overlay/Overlay.d.ts +25 -0
- package/dist/components/Overlay/OverlayContent.d.ts +14 -0
- package/dist/components/PageHeader/PageHeader.d.ts +12 -0
- package/dist/components/PageHeader/index.d.ts +2 -0
- package/dist/components/Pagination/Pagination.d.ts +6 -0
- package/dist/components/Pagination/Pagination.types.d.ts +29 -0
- package/dist/components/Pagination/index.d.ts +4 -0
- package/dist/components/Pagination/paginationUtils.d.ts +7 -0
- package/dist/components/Pagination/paginationUtils.test.d.ts +1 -0
- package/dist/components/PasswordInput/PasswordInput.d.ts +3 -0
- package/dist/components/PasswordInput/PasswordInput.types.d.ts +7 -0
- package/dist/components/PasswordInput/index.d.ts +2 -0
- package/dist/components/SearchInput/SearchInput.d.ts +3 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts +7 -0
- package/dist/components/SearchInput/index.d.ts +2 -0
- package/dist/components/Skeleton/Skeleton.d.ts +3 -0
- package/dist/components/Skeleton/Skeleton.types.d.ts +10 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/StatusPill/StatusPill.d.ts +10 -0
- package/dist/components/StatusPill/index.d.ts +2 -0
- package/dist/components/Switch/Switch.d.ts +3 -0
- package/dist/components/Switch/Switch.types.d.ts +8 -0
- package/dist/components/Switch/index.d.ts +2 -0
- package/dist/components/Table/Table.d.ts +16 -0
- package/dist/components/Table/Table.types.d.ts +31 -0
- package/dist/components/Table/index.d.ts +2 -0
- package/dist/components/TableFilters/DynamicFilterRows.d.ts +24 -0
- package/dist/components/TableFilters/FilterValueControl.d.ts +14 -0
- package/dist/components/TableFilters/TableFilters.d.ts +6 -0
- package/dist/components/TableFilters/TableFilters.types.d.ts +32 -0
- package/dist/components/TableFilters/filterUtils.d.ts +5 -0
- package/dist/components/TableFilters/index.d.ts +2 -0
- package/dist/components/Tabs/Tabs.d.ts +6 -0
- package/dist/components/Tabs/Tabs.types.d.ts +20 -0
- package/dist/components/Tabs/index.d.ts +2 -0
- package/dist/components/Textarea/Textarea.d.ts +3 -0
- package/dist/components/Textarea/Textarea.types.d.ts +12 -0
- package/dist/components/Textarea/index.d.ts +2 -0
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +6 -0
- package/dist/components/ThemeToggle/ThemeToggle.types.d.ts +13 -0
- package/dist/components/ThemeToggle/index.d.ts +2 -0
- package/dist/index.cjs +1 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +47 -1
- package/dist/index.js +4051 -495
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1 -1
- package/dist/theme/ThemeProvider.d.ts +3 -1
- package/dist/theme/ThemeProvider.types.d.ts +13 -2
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/themeStore.d.ts +5 -0
- package/package.json +1 -1
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { PasswordInputProps } from './PasswordInput.types';
|
|
2
|
+
/** `Input` for passwords, with a button to show or hide what is typed. */
|
|
3
|
+
export declare const PasswordInput: import("react").ForwardRefExoticComponent<PasswordInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InputProps } from '../Input';
|
|
2
|
+
export interface PasswordInputProps extends Omit<InputProps, 'type' | 'suffix'> {
|
|
3
|
+
/** Accessible name of the toggle while the password is hidden. Defaults to "Show password". */
|
|
4
|
+
showLabel?: string;
|
|
5
|
+
/** Accessible name of the toggle while the password is visible. Defaults to "Hide password". */
|
|
6
|
+
hideLabel?: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SearchInputProps } from './SearchInput.types';
|
|
2
|
+
/** `Input` for searching: a search icon, and a clear button once something is typed. */
|
|
3
|
+
export declare const SearchInput: import("react").ForwardRefExoticComponent<SearchInputProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { InputProps } from '../Input';
|
|
2
|
+
export interface SearchInputProps extends Omit<InputProps, 'type' | 'prefix' | 'suffix'> {
|
|
3
|
+
/** Called when the clear button is pressed. Controlled usage should reset its value here. */
|
|
4
|
+
onClear?: () => void;
|
|
5
|
+
/** Accessible name of the clear button. Defaults to "Clear search". */
|
|
6
|
+
clearLabel?: string;
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type SkeletonVariant = 'text' | 'rect' | 'circle';
|
|
3
|
+
export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
/** `text` is a rounded line, `rect` a block, `circle` a round avatar placeholder. Defaults to `rect`. */
|
|
5
|
+
variant?: SkeletonVariant;
|
|
6
|
+
/** CSS width, e.g. `120` (px) or `"60%"`. */
|
|
7
|
+
width?: number | string;
|
|
8
|
+
/** CSS height. Circles use `width` for both when `height` is omitted. */
|
|
9
|
+
height?: number | string;
|
|
10
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
export type StatusPillTone = 'success' | 'info' | 'danger' | 'warning' | 'neutral';
|
|
3
|
+
export interface StatusPillProps extends Omit<HTMLAttributes<HTMLSpanElement>, 'children'> {
|
|
4
|
+
/** Status text, e.g. "Active". Shown capitalized; empty shows an em dash. */
|
|
5
|
+
status?: string | null;
|
|
6
|
+
/** Override the colour that is otherwise chosen from the status text. */
|
|
7
|
+
tone?: StatusPillTone;
|
|
8
|
+
}
|
|
9
|
+
/** Small status badge with a dot, like the status column of the school app's tables. */
|
|
10
|
+
export declare function StatusPill({ status, tone, className, ...rest }: StatusPillProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { SwitchProps } from './Switch.types';
|
|
2
|
+
/** On/off toggle. A native checkbox with `role="switch"`, so it works in forms and with keyboards. */
|
|
3
|
+
export declare const Switch: import("react").ForwardRefExoticComponent<SwitchProps & import("react").RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { InputHTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface SwitchProps extends Omit<InputHTMLAttributes<HTMLInputElement>, 'type' | 'size'> {
|
|
3
|
+
/** Text shown next to the switch. Clicking it toggles the switch. */
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
helperText?: ReactNode;
|
|
6
|
+
/** Error message. When set, the switch is marked invalid. */
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type HTMLAttributes } from 'react';
|
|
2
|
+
import type { TableCellProps, TableHeaderCellProps, TableProps, TableRowProps } from './Table.types';
|
|
3
|
+
/**
|
|
4
|
+
* Styled semantic table. Compose it with `TableHead`, `TableBody`, `TableRow`, `TableHeaderCell`
|
|
5
|
+
* and `TableCell`. For sorting, filtering, paging and selection use `DataTable`.
|
|
6
|
+
*/
|
|
7
|
+
export declare const Table: import("react").ForwardRefExoticComponent<TableProps & import("react").RefAttributes<HTMLTableElement>>;
|
|
8
|
+
export declare const TableHead: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
9
|
+
export declare const TableBody: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
10
|
+
export declare const TableFoot: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableSectionElement> & import("react").RefAttributes<HTMLTableSectionElement>>;
|
|
11
|
+
export declare const TableRow: import("react").ForwardRefExoticComponent<TableRowProps & import("react").RefAttributes<HTMLTableRowElement>>;
|
|
12
|
+
export declare const TableHeaderCell: import("react").ForwardRefExoticComponent<TableHeaderCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
13
|
+
export declare const TableCell: import("react").ForwardRefExoticComponent<TableCellProps & import("react").RefAttributes<HTMLTableCellElement>>;
|
|
14
|
+
export declare const TableCaption: import("react").ForwardRefExoticComponent<HTMLAttributes<HTMLTableCaptionElement> & {
|
|
15
|
+
children?: import("react").ReactNode;
|
|
16
|
+
} & import("react").RefAttributes<HTMLTableCaptionElement>>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode, TableHTMLAttributes, TdHTMLAttributes, ThHTMLAttributes } from 'react';
|
|
2
|
+
export type TableAlign = 'start' | 'center' | 'end';
|
|
3
|
+
export type SortDirection = 'asc' | 'desc';
|
|
4
|
+
export interface TableProps extends TableHTMLAttributes<HTMLTableElement> {
|
|
5
|
+
/** Draw the border and rounded corners around the table. Defaults to true; `false` makes it flush with its surroundings. */
|
|
6
|
+
bordered?: boolean;
|
|
7
|
+
/** Keep the header visible while the body scrolls. Give `containerClassName` (or a parent) a fixed height. */
|
|
8
|
+
stickyHeader?: boolean;
|
|
9
|
+
/** Class for the scrolling wrapper around the table. */
|
|
10
|
+
containerClassName?: string;
|
|
11
|
+
/** Accessible name of the scroll area (keyboard users can scroll wide tables). */
|
|
12
|
+
scrollLabel?: string;
|
|
13
|
+
}
|
|
14
|
+
export interface TableRowProps extends HTMLAttributes<HTMLTableRowElement> {
|
|
15
|
+
/** Highlights the row as selected. */
|
|
16
|
+
selected?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface TableHeaderCellProps extends Omit<ThHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
19
|
+
align?: TableAlign;
|
|
20
|
+
/** Makes the header a button that calls `onSort`. */
|
|
21
|
+
sortable?: boolean;
|
|
22
|
+
/** Current sort of this column, shown as an arrow and announced as `aria-sort`. */
|
|
23
|
+
sortDirection?: SortDirection | null;
|
|
24
|
+
onSort?: () => void;
|
|
25
|
+
}
|
|
26
|
+
export interface TableCellProps extends Omit<TdHTMLAttributes<HTMLTableCellElement>, 'align'> {
|
|
27
|
+
align?: TableAlign;
|
|
28
|
+
}
|
|
29
|
+
export type TableCaptionProps = HTMLAttributes<HTMLTableCaptionElement> & {
|
|
30
|
+
children?: ReactNode;
|
|
31
|
+
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { TableFilterField } from './TableFilters.types';
|
|
2
|
+
export interface FilterRow {
|
|
3
|
+
id: number;
|
|
4
|
+
/** `key` of the chosen field, or '' while none is chosen. */
|
|
5
|
+
key: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
/** A fresh, unique row id (only used as a React key). */
|
|
9
|
+
export declare const nextRowId: () => number;
|
|
10
|
+
/** Turns the applied filter values into editable rows, one per active filter. */
|
|
11
|
+
export declare function rowsFromValues(values: Record<string, string>): FilterRow[];
|
|
12
|
+
/** The values the rows stand for: rows without a field or without a value filter nothing. */
|
|
13
|
+
export declare function valuesFromRows(rows: FilterRow[]): Record<string, string>;
|
|
14
|
+
interface DynamicFilterRowsProps {
|
|
15
|
+
fields: TableFilterField[];
|
|
16
|
+
rows: FilterRow[];
|
|
17
|
+
onChange: (rows: FilterRow[]) => void;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The editable part of the filter panel: each row is a field choice plus a value, rows can be added and
|
|
21
|
+
* removed, and a field can only be used once.
|
|
22
|
+
*/
|
|
23
|
+
export declare function DynamicFilterRows({ fields, rows, onChange }: DynamicFilterRowsProps): import("react").JSX.Element;
|
|
24
|
+
export {};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { TableFilterField } from './TableFilters.types';
|
|
2
|
+
interface FilterValueControlProps {
|
|
3
|
+
field: TableFilterField;
|
|
4
|
+
value: string;
|
|
5
|
+
onChange: (value: string) => void;
|
|
6
|
+
/** Visible label above the control. Without it, `ariaLabel` names the control. */
|
|
7
|
+
label?: string;
|
|
8
|
+
ariaLabel?: string;
|
|
9
|
+
size?: 'sm' | 'md';
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
}
|
|
12
|
+
/** The right input for a filter field: text, select or date. */
|
|
13
|
+
export declare function FilterValueControl({ field, value, onChange, label, ariaLabel, size, placeholder, }: FilterValueControlProps): import("react").JSX.Element;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TableFiltersProps } from './TableFilters.types';
|
|
2
|
+
/**
|
|
3
|
+
* Search box, a "Filters" button that opens a panel of fields (text, select, date) with Apply / Reset,
|
|
4
|
+
* and removable chips for the active filters. State lives in your hands: pass values, react to changes.
|
|
5
|
+
*/
|
|
6
|
+
export declare function TableFilters({ search, onSearchChange, searchPlaceholder, searchDelay, fields, values, onValuesChange, panelTitle, className, }: TableFiltersProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export interface TableFilterOption {
|
|
2
|
+
label: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface TableFilterField {
|
|
6
|
+
/** Key of the value in `values`. */
|
|
7
|
+
key: string;
|
|
8
|
+
label: string;
|
|
9
|
+
/** `text` (contains), `select` (one of `options`) or `date`. Defaults to `text`. */
|
|
10
|
+
type?: 'text' | 'select' | 'date';
|
|
11
|
+
options?: TableFilterOption[];
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
}
|
|
14
|
+
export type TableFilterValues = Record<string, string>;
|
|
15
|
+
export interface TableFiltersProps {
|
|
16
|
+
/** Text in the search box. */
|
|
17
|
+
search?: string;
|
|
18
|
+
/** Called when the search text changes (after `searchDelay`). Omit both to hide the search box. */
|
|
19
|
+
onSearchChange?: (search: string) => void;
|
|
20
|
+
searchPlaceholder?: string;
|
|
21
|
+
/** Wait this many ms after typing before calling `onSearchChange`. Defaults to 0 (call on every keystroke). */
|
|
22
|
+
searchDelay?: number;
|
|
23
|
+
/** Fields in the filter panel. Omit to hide the Filters button. */
|
|
24
|
+
fields?: TableFilterField[];
|
|
25
|
+
/** Current filter values, keyed by field `key`. Empty values mean "not filtering". */
|
|
26
|
+
values?: TableFilterValues;
|
|
27
|
+
/** Called with the new values when the user applies or resets the panel, or removes a chip. */
|
|
28
|
+
onValuesChange?: (values: TableFilterValues) => void;
|
|
29
|
+
/** Title of the filter panel. Defaults to "Filters". */
|
|
30
|
+
panelTitle?: string;
|
|
31
|
+
className?: string;
|
|
32
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { TableFilterField, TableFilterValues } from './TableFilters.types';
|
|
2
|
+
/** Only the filters that actually filter something. */
|
|
3
|
+
export declare function activeFilters(values: TableFilterValues | undefined): TableFilterValues;
|
|
4
|
+
/** Text to show for a filter's value: the option label for selects, the value itself otherwise. */
|
|
5
|
+
export declare function filterValueLabel(field: TableFilterField, value: string): string;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { TabsProps } from './Tabs.types';
|
|
2
|
+
/**
|
|
3
|
+
* Underlined tabs following the WAI-ARIA tabs pattern: arrow keys, Home and End
|
|
4
|
+
* move between tabs; the active tab's panel is shown below the list.
|
|
5
|
+
*/
|
|
6
|
+
export declare function Tabs<T extends string = string>({ items, value, defaultValue, onValueChange, className, 'aria-label': ariaLabel, ...rest }: TabsProps<T>): import("react").JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
2
|
+
export interface TabItem<T extends string = string> {
|
|
3
|
+
value: T;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
/** Icon element shown before the label. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
/** Panel content, rendered when the tab is active. Omit to manage content yourself. */
|
|
9
|
+
content?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface TabsProps<T extends string = string> extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
12
|
+
items: TabItem<T>[];
|
|
13
|
+
/** Active tab (controlled). */
|
|
14
|
+
value?: T;
|
|
15
|
+
/** Initially active tab (uncontrolled). Defaults to the first enabled tab. */
|
|
16
|
+
defaultValue?: T;
|
|
17
|
+
onValueChange?: (value: T) => void;
|
|
18
|
+
/** Accessible name of the tab list, e.g. "Lead sections". */
|
|
19
|
+
'aria-label'?: string;
|
|
20
|
+
}
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { TextareaProps } from './Textarea.types';
|
|
2
|
+
/** Multi-line text input with the same label, helper and error handling as `Input`. */
|
|
3
|
+
export declare const Textarea: import("react").ForwardRefExoticComponent<TextareaProps & import("react").RefAttributes<HTMLTextAreaElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { ReactNode, TextareaHTMLAttributes } from 'react';
|
|
2
|
+
export type TextareaResize = 'none' | 'vertical' | 'horizontal' | 'both';
|
|
3
|
+
export interface TextareaProps extends TextareaHTMLAttributes<HTMLTextAreaElement> {
|
|
4
|
+
label?: ReactNode;
|
|
5
|
+
helperText?: ReactNode;
|
|
6
|
+
/** Error message. When set, the textarea is marked invalid. */
|
|
7
|
+
error?: ReactNode;
|
|
8
|
+
/** Visible rows. Defaults to 3. */
|
|
9
|
+
rows?: number;
|
|
10
|
+
/** Which directions the user can resize. Defaults to `vertical`. */
|
|
11
|
+
resize?: TextareaResize;
|
|
12
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ThemeToggleProps } from './ThemeToggle.types';
|
|
2
|
+
/**
|
|
3
|
+
* Switch between themes (light / dark / system by default). Must be inside a
|
|
4
|
+
* `ThemeProvider`. Built on radio inputs, so arrow keys and screen readers work natively.
|
|
5
|
+
*/
|
|
6
|
+
export declare function ThemeToggle({ modes, compact, className, 'aria-label': ariaLabel, ...rest }: ThemeToggleProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes } from 'react';
|
|
2
|
+
import type { Theme } from '../../theme';
|
|
3
|
+
export interface ThemeToggleProps extends Omit<HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* The choices to offer, in order. Defaults to `['light', 'dark', 'system']`.
|
|
6
|
+
* Custom theme names are shown with their name as the label.
|
|
7
|
+
*/
|
|
8
|
+
modes?: Theme[];
|
|
9
|
+
/** Show only the icons, with the names as tooltips. */
|
|
10
|
+
compact?: boolean;
|
|
11
|
+
/** Accessible name of the group. Defaults to "Theme". */
|
|
12
|
+
'aria-label'?: string;
|
|
13
|
+
}
|