@ufoui/core 0.0.58 → 0.0.124
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/assets/index.d.ts +1 -0
- package/assets/spinners.d.ts +86 -0
- package/components/accordion/accordion.d.ts +4 -8
- package/components/accordion/accordionItem.d.ts +3 -5
- package/components/actions/actions.d.ts +55 -0
- package/components/actions/actions.guards.d.ts +15 -0
- package/components/avatar/avatar.d.ts +1 -1
- package/components/base/boxBase.d.ts +6 -6
- package/components/base/checkboxBase.d.ts +3 -7
- package/components/base/dialogBase.d.ts +3 -7
- package/components/base/textBase.d.ts +13 -12
- package/components/breadcrumbs/breadcrumbs.d.ts +3 -5
- package/components/button/button.d.ts +1 -1
- package/components/card/card.d.ts +8 -51
- package/components/card/cardHeader.d.ts +49 -0
- package/components/card/cardMedia.d.ts +9 -0
- package/components/card/cardTitle.d.ts +11 -0
- package/components/collapse/collapse.d.ts +4 -8
- package/components/dialogs/dialogHeader.d.ts +1 -1
- package/components/dialogs/index.d.ts +1 -1
- package/components/fieldset/fieldset.d.ts +1 -1
- package/components/item/item.d.ts +43 -0
- package/components/item/item.guards.d.ts +12 -0
- package/components/layout/article.d.ts +1 -1
- package/components/layout/aside.d.ts +1 -1
- package/components/layout/content.d.ts +1 -1
- package/components/layout/footer.d.ts +1 -1
- package/components/layout/header.d.ts +1 -1
- package/components/layout/main.d.ts +1 -1
- package/components/layout/nav.d.ts +1 -1
- package/components/layout/section.d.ts +1 -1
- package/components/list/list.d.ts +45 -4
- package/components/listbox/listBox.d.ts +25 -0
- package/components/progress/progress.d.ts +35 -11
- package/components/select/select.d.ts +26 -17
- package/components/slider/slider.d.ts +86 -8
- package/components/slider/sliderHandle.d.ts +24 -0
- package/components/spinner/spinner.d.ts +44 -3
- package/components/toast/toast.d.ts +3 -7
- package/components/toolbar/toolbar.d.ts +1 -1
- package/components/typography/h1.d.ts +1 -1
- package/components/typography/h2.d.ts +1 -1
- package/components/typography/h3.d.ts +1 -1
- package/components/typography/h4.d.ts +1 -1
- package/components/typography/h5.d.ts +1 -1
- package/components/typography/h6.d.ts +1 -1
- package/components/typography/label.d.ts +1 -1
- package/components/typography/p.d.ts +1 -1
- package/components/typography/span.d.ts +1 -1
- package/hooks/index.d.ts +2 -0
- package/hooks/useAnimate.d.ts +12 -6
- package/hooks/useMotion.d.ts +27 -0
- package/hooks/useUpdateEffect.d.ts +26 -0
- package/index.css +1 -1
- package/index.d.ts +7 -0
- package/index.js +3796 -3517
- package/package.json +1 -1
- package/types/color.d.ts +51 -8
- package/types/dialog.d.ts +0 -11
- package/types/motion.d.ts +55 -4
- package/utils/color.d.ts +5 -4
- package/utils/colorRegistry.d.ts +1 -1
- package/utils/generateMaterialColors.d.ts +38 -12
- package/utils/index.d.ts +1 -1
- package/utils/useUniqueId.d.ts +9 -0
- package/utils/utils.d.ts +1 -1
- package/components/dialogs/dialogActions.d.ts +0 -26
- package/components/dialogs/dialogActions.guards.d.ts +0 -15
- package/utils/uniqueID.d.ts +0 -14
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the {@link Item} component.
|
|
4
|
+
*
|
|
5
|
+
* @category Item
|
|
6
|
+
*/
|
|
7
|
+
export interface ItemProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {
|
|
8
|
+
/** Secondary supporting text. */
|
|
9
|
+
description?: string;
|
|
10
|
+
/** Disables interactions and focus. */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
/** Leading slot content. */
|
|
13
|
+
leading?: React.ReactNode;
|
|
14
|
+
/** Primary label text. */
|
|
15
|
+
label?: string;
|
|
16
|
+
/** Trailing slot content. */
|
|
17
|
+
trailing?: React.ReactNode;
|
|
18
|
+
/** Value identifier used for selection. */
|
|
19
|
+
value?: string;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* **Item** — dumb renderer for list, listbox and menu contexts.
|
|
23
|
+
*
|
|
24
|
+
* Reads ARIA role and density from {@link SelectionContext}. Registers
|
|
25
|
+
* itself with the roving focus controller provided by the parent `List`.
|
|
26
|
+
*
|
|
27
|
+
* @remarks
|
|
28
|
+
* Export aliases: `ListItem`, `Option`.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```tsx
|
|
32
|
+
* <List variant="listbox" type="single">
|
|
33
|
+
* <Item value="a" label="Apple" />
|
|
34
|
+
* <Item value="b" label="Banana" description="Yellow fruit" />
|
|
35
|
+
* </List>
|
|
36
|
+
* ```
|
|
37
|
+
*
|
|
38
|
+
* @function
|
|
39
|
+
* @category Item
|
|
40
|
+
*/
|
|
41
|
+
export declare const Item: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
42
|
+
/** @category Item */
|
|
43
|
+
export declare const Option: React.ForwardRefExoticComponent<ItemProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { default as React, ReactElement } from 'react';
|
|
2
|
+
import { ItemProps } from './item';
|
|
3
|
+
export declare const IS_ITEM: unique symbol;
|
|
4
|
+
/**
|
|
5
|
+
* Type guard that checks whether a React node is an Item component.
|
|
6
|
+
*
|
|
7
|
+
* @param el - React node to test.
|
|
8
|
+
* @returns `true` if the node is an Item element.
|
|
9
|
+
*
|
|
10
|
+
* @internal
|
|
11
|
+
*/
|
|
12
|
+
export declare function isItem(el: React.ReactNode): el is ReactElement<ItemProps>;
|
|
@@ -5,7 +5,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Box
|
|
7
7
|
*/
|
|
8
|
-
export type ArticleProps = Omit<BoxBaseProps, 'elementClass' | '
|
|
8
|
+
export type ArticleProps = Omit<BoxBaseProps, 'elementClass' | 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Semantic layout wrapper for the native `<article>` element.
|
|
11
11
|
* Intended for self-contained content units composed of Sections and optional Aside.
|
|
@@ -5,7 +5,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Box
|
|
7
7
|
*/
|
|
8
|
-
export type AsideProps = Omit<BoxBaseProps, 'elementClass' | '
|
|
8
|
+
export type AsideProps = Omit<BoxBaseProps, 'elementClass' | 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Semantic layout wrapper for the native `<aside>` element.
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Box
|
|
7
7
|
*/
|
|
8
|
-
export type ContentProps = Omit<BoxBaseProps, 'elementClass' | '
|
|
8
|
+
export type ContentProps = Omit<BoxBaseProps, 'elementClass' | 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Layout wrapper for the main article content.
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Box
|
|
7
7
|
*/
|
|
8
|
-
export type FooterProps = Omit<BoxBaseProps, 'elementClass' | '
|
|
8
|
+
export type FooterProps = Omit<BoxBaseProps, 'elementClass' | 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Semantic layout wrapper for the native `<footer>` element.
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Box
|
|
7
7
|
*/
|
|
8
|
-
export type HeaderProps = Omit<BoxBaseProps, 'elementClass' | '
|
|
8
|
+
export type HeaderProps = Omit<BoxBaseProps, 'elementClass' | 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Semantic layout wrapper for the native `<header>` element.
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Box
|
|
7
7
|
*/
|
|
8
|
-
export type MainProps = Omit<BoxBaseProps, 'elementClass' | '
|
|
8
|
+
export type MainProps = Omit<BoxBaseProps, 'elementClass' | 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Semantic layout wrapper for the native `<main>` element.
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Box
|
|
7
7
|
*/
|
|
8
|
-
export type NavProps = Omit<BoxBaseProps, 'elementClass' | '
|
|
8
|
+
export type NavProps = Omit<BoxBaseProps, 'elementClass' | 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Semantic layout wrapper for the native `<nav>` element.
|
|
11
11
|
*
|
|
@@ -5,7 +5,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Box
|
|
7
7
|
*/
|
|
8
|
-
export type SectionProps = Omit<BoxBaseProps, 'elementClass' | '
|
|
8
|
+
export type SectionProps = Omit<BoxBaseProps, 'elementClass' | 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Semantic layout wrapper for the native `<section>` element.
|
|
11
11
|
*
|
|
@@ -1,8 +1,49 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { ElementDensity } from '../../utils';
|
|
2
3
|
import { BoxBaseProps } from '../base/boxBase';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
/** @category List */
|
|
5
|
+
export type ListVariant = 'list' | 'listbox';
|
|
6
|
+
/** @category List */
|
|
7
|
+
export interface ListConfig {
|
|
8
|
+
density?: ElementDensity;
|
|
9
|
+
itemRole: 'listitem' | 'option';
|
|
10
|
+
variant: ListVariant;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Props for the {@link List} component.
|
|
14
|
+
*
|
|
15
|
+
* @category List
|
|
16
|
+
*/
|
|
17
|
+
export interface ListProps extends Omit<BoxBaseProps, 'type' | 'onChange'> {
|
|
6
18
|
children: ReactNode;
|
|
19
|
+
/** Uncontrolled initial selected value(s). */
|
|
20
|
+
defaultValue?: string | string[];
|
|
21
|
+
/** Density preset propagated to all child items. */
|
|
22
|
+
density?: ElementDensity;
|
|
23
|
+
/** Change handler called with the new selected values array. */
|
|
24
|
+
onChange?: (values: string[]) => void;
|
|
25
|
+
/** Selection type for listbox variant. */
|
|
26
|
+
type?: 'single' | 'multiple';
|
|
27
|
+
/** Controlled selected value(s). */
|
|
28
|
+
value?: string | string[];
|
|
29
|
+
/** Switches between display list and selectable listbox. */
|
|
30
|
+
variant?: ListVariant;
|
|
7
31
|
}
|
|
8
|
-
|
|
32
|
+
/**
|
|
33
|
+
* **List** — vertical container for {@link Item} elements.
|
|
34
|
+
*
|
|
35
|
+
* When `variant="listbox"` is set, enables keyboard navigation and
|
|
36
|
+
* selection via {@link SelectionContext}. Supports both controlled
|
|
37
|
+
* (`value` + `onChange`) and uncontrolled (`defaultValue`) modes.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```tsx
|
|
41
|
+
* <List variant="listbox" type="single" defaultValue="a">
|
|
42
|
+
* <Item value="a" label="Apple" />
|
|
43
|
+
* <Item value="b" label="Banana" />
|
|
44
|
+
* </List>
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @category List
|
|
48
|
+
*/
|
|
49
|
+
export declare const List: ({ children, className, variant, type, value, defaultValue, onChange, density, ...props }: ListProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { ListProps } from '../list/list';
|
|
2
|
+
/**
|
|
3
|
+
* Props for the {@link ListBox} component.
|
|
4
|
+
*
|
|
5
|
+
* @category ListBox
|
|
6
|
+
*/
|
|
7
|
+
export type ListBoxProps = Omit<ListProps, 'variant'>;
|
|
8
|
+
/**
|
|
9
|
+
* **ListBox** — thin semantic wrapper over `List` that presets `variant="listbox"`.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* Prefer using `List` with `variant="listbox"` directly when composing
|
|
13
|
+
* with `Select` or other controlled parents.
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```tsx
|
|
17
|
+
* <ListBox type="single" defaultValue="a">
|
|
18
|
+
* <Item value="a" label="Apple" />
|
|
19
|
+
* <Item value="b" label="Banana" />
|
|
20
|
+
* </ListBox>
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @category ListBox
|
|
24
|
+
*/
|
|
25
|
+
export declare const ListBox: (props: ListBoxProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,27 +1,51 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ElementSize, SemanticColor } from '../../utils';
|
|
3
|
-
import { BoxBaseProps } from '../base';
|
|
1
|
+
import { HTMLAttributes } from 'react';
|
|
2
|
+
import { ElementSize, SemanticColor, SurfaceColor, WrapperProps } from '../../utils';
|
|
4
3
|
/**
|
|
5
4
|
* Props for {@link Progress}.
|
|
6
5
|
*
|
|
6
|
+
* Supports both linear and circular progress indicators, in determinate
|
|
7
|
+
* (`value` provided) and indeterminate (`value` omitted) modes.
|
|
8
|
+
*
|
|
7
9
|
* @category Progress
|
|
8
10
|
*/
|
|
9
|
-
export interface ProgressProps extends Omit<
|
|
10
|
-
|
|
11
|
-
value?: number;
|
|
12
|
-
min?: number;
|
|
13
|
-
max?: number;
|
|
11
|
+
export interface ProgressProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'>, Omit<WrapperProps, 'shape'> {
|
|
12
|
+
/** Semantic color of the active indicator. */
|
|
14
13
|
color?: SemanticColor;
|
|
14
|
+
/** Maximum value of the progress range. */
|
|
15
|
+
max?: number;
|
|
16
|
+
/** Minimum value of the progress range. */
|
|
17
|
+
min?: number;
|
|
18
|
+
/** Size preset of the progress component. */
|
|
15
19
|
size?: ElementSize;
|
|
16
|
-
|
|
20
|
+
/** Surface color of the track/background. */
|
|
21
|
+
trackColor?: SurfaceColor;
|
|
22
|
+
/** Current value for determinate mode. Leave undefined for indeterminate mode. */
|
|
23
|
+
value?: number;
|
|
24
|
+
/** Visual style of the indicator. */
|
|
25
|
+
variant?: 'linear' | 'circular';
|
|
17
26
|
}
|
|
18
27
|
/**
|
|
19
28
|
* Visual progress indicator.
|
|
20
29
|
*
|
|
21
|
-
*
|
|
30
|
+
* Renders either a linear bar or a circular ring. The component is:
|
|
31
|
+
* - determinate when `value` is provided,
|
|
32
|
+
* - indeterminate when `value` is omitted.
|
|
22
33
|
*
|
|
34
|
+
* @function
|
|
23
35
|
* @param props - Component props.
|
|
24
36
|
*
|
|
25
37
|
* @category Progress
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* <Progress value={42} />
|
|
41
|
+
*
|
|
42
|
+
* @example
|
|
43
|
+
* <Progress variant="circular" value={75} />
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* <Progress variant="linear" />
|
|
26
47
|
*/
|
|
27
|
-
export declare const Progress:
|
|
48
|
+
export declare const Progress: {
|
|
49
|
+
({ variant, value, min, max, color, trackColor, size, className, style, ...rest }: ProgressProps): import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
displayName: string;
|
|
51
|
+
};
|
|
@@ -1,32 +1,41 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { FieldBaseProps } from '../base/fieldBase';
|
|
3
3
|
/**
|
|
4
|
-
* Props for {@link Select}.
|
|
4
|
+
* Props for the {@link Select} component.
|
|
5
5
|
*
|
|
6
6
|
* @category Field
|
|
7
7
|
*/
|
|
8
|
-
export interface SelectProps extends Omit<FieldBaseProps, 'elementClass' | 'value' | 'onChange'> {
|
|
9
|
-
/**
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
placeholder?: string;
|
|
13
|
-
/** Change handler called with the selected value. */
|
|
8
|
+
export interface SelectProps extends Omit<FieldBaseProps, 'elementClass' | 'value' | 'onChange' | 'trailing' | 'defaultValue'> {
|
|
9
|
+
/** Select options — `Item` or `Option` elements. */
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
/** Change handler called with the new selected value. */
|
|
14
12
|
onChange?: (value: string | string[] | undefined) => void;
|
|
13
|
+
/** Uncontrolled initial selected value. */
|
|
14
|
+
defaultValue?: string | string[];
|
|
15
15
|
/** Enables multiple value selection. */
|
|
16
16
|
multiple?: boolean;
|
|
17
|
-
/**
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
|
|
21
|
-
/** Select options. */
|
|
22
|
-
children?: ReactNode;
|
|
17
|
+
/** Placeholder displayed when no value is selected. */
|
|
18
|
+
placeholder?: string;
|
|
19
|
+
/** Controlled selected value. */
|
|
20
|
+
value?: string | string[];
|
|
23
21
|
}
|
|
24
22
|
/**
|
|
25
|
-
* **Select**
|
|
26
|
-
*
|
|
23
|
+
* **Select** — field control that opens a listbox dropdown for picking values.
|
|
24
|
+
*
|
|
25
|
+
* Composes `FieldBase` (trigger) with `List variant="listbox"` (dropdown).
|
|
26
|
+
* Supports single and multiple selection, controlled and uncontrolled modes.
|
|
27
27
|
*
|
|
28
|
-
* @
|
|
28
|
+
* @example
|
|
29
|
+
* ```tsx
|
|
30
|
+
* <Select label="Fruit" value={fruit} onChange={v => setFruit(v as string)}>
|
|
31
|
+
* <Item value="apple" label="Apple" />
|
|
32
|
+
* <Item value="banana" label="Banana" />
|
|
33
|
+
* </Select>
|
|
34
|
+
* ```
|
|
29
35
|
*
|
|
30
36
|
* @category Field
|
|
31
|
-
* @function
|
|
32
37
|
*/
|
|
38
|
+
export declare const Select: {
|
|
39
|
+
({ value, defaultValue, onChange, multiple, placeholder, children, density, ...props }: SelectProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
displayName: string;
|
|
41
|
+
};
|
|
@@ -1,11 +1,89 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ElementDensity, ElementFocusEffect, ElementFont, ElementOrientation, ElementSize, ElementTextPlacement, SemanticColor, SurfaceColor } from '../../utils';
|
|
3
|
+
/**
|
|
4
|
+
* Props for the {@link Slider} component.
|
|
5
|
+
* @category Slider
|
|
6
|
+
*/
|
|
7
|
+
export interface SliderProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange' | 'defaultValue'> {
|
|
8
|
+
/** Semantic color of the active track and handle. */
|
|
9
|
+
color?: SemanticColor;
|
|
10
|
+
/** Default value for uncontrolled mode. Use `[start, end]` with `type="range"`. */
|
|
11
|
+
defaultValue?: number | [number, number];
|
|
12
|
+
/** Visual density of the layout. */
|
|
13
|
+
density?: ElementDensity;
|
|
14
|
+
/** Supporting text displayed below the slider. */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** Disables interaction. */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** Error message. Overrides `description` when set. */
|
|
19
|
+
error?: string;
|
|
20
|
+
/** Focus ring effects. */
|
|
21
|
+
focusEffects?: ElementFocusEffect[];
|
|
22
|
+
/** Font token for the label. */
|
|
23
|
+
font?: ElementFont;
|
|
24
|
+
/** Format function for the value indicator. */
|
|
25
|
+
formatValue?: (value: number) => string;
|
|
26
|
+
/** DOM id of the slider. Auto-generated when omitted. */
|
|
27
|
+
id?: string;
|
|
28
|
+
/** Text label. */
|
|
29
|
+
label?: string;
|
|
30
|
+
/** Show stop indicators at each step position (MD3 discrete mode). */
|
|
31
|
+
stops?: boolean;
|
|
32
|
+
/** Maximum value. */
|
|
5
33
|
max?: number;
|
|
6
|
-
|
|
34
|
+
/** Minimum value. */
|
|
35
|
+
min?: number;
|
|
36
|
+
/** Name for the hidden form input. */
|
|
7
37
|
name?: string;
|
|
8
|
-
|
|
9
|
-
onChange?: (value: number) => void;
|
|
38
|
+
/** Change handler. Returns `number` for single or `[number, number]` for range. */
|
|
39
|
+
onChange?: (value: number | [number, number]) => void;
|
|
40
|
+
/** Called after a drag gesture ends. */
|
|
41
|
+
onChangeCommitted?: (value: number | [number, number]) => void;
|
|
42
|
+
/** Track orientation. */
|
|
43
|
+
orientation?: ElementOrientation;
|
|
44
|
+
/** Prevents value changes; sets `aria-readonly`. */
|
|
45
|
+
readOnly?: boolean;
|
|
46
|
+
/** Required field indicator. */
|
|
47
|
+
required?: boolean;
|
|
48
|
+
/** Value indicator display mode. `true`/`"hover"` → on hover+focus; `"always"` → always visible. */
|
|
49
|
+
showValue?: boolean | 'always' | 'hover';
|
|
50
|
+
/** Track thickness. MD3: XS=16dp, S=24dp, M=40dp (default), L=56dp, XL=96dp. */
|
|
51
|
+
size?: ElementSize;
|
|
52
|
+
/** Step increment for keyboard and stop indicators. */
|
|
53
|
+
step?: number;
|
|
54
|
+
/** Label placement relative to the slider. */
|
|
55
|
+
textPlacement?: ElementTextPlacement;
|
|
56
|
+
/**
|
|
57
|
+
* Slider behaviour type.
|
|
58
|
+
* - `"standard"` — single handle, active track from the left edge (default).
|
|
59
|
+
* - `"centered"` — single handle, active track grows from the midpoint.
|
|
60
|
+
* - `"range"` — two handles; pass `[start, end]` as `value` / `defaultValue`.
|
|
61
|
+
*/
|
|
62
|
+
type?: 'standard' | 'centered' | 'range';
|
|
63
|
+
/** Color of the inactive track. */
|
|
64
|
+
trackColor?: SurfaceColor;
|
|
65
|
+
/** Controlled value. Use `[start, end]` with `type="range"`. */
|
|
66
|
+
value?: number | [number, number];
|
|
10
67
|
}
|
|
11
|
-
|
|
68
|
+
/**
|
|
69
|
+
* MD3-compliant slider for selecting a value or range along a track.
|
|
70
|
+
*
|
|
71
|
+
* Track thickness is controlled by `size` (MD3: XS=16dp, S=24dp, M=40dp, L=56dp, XL=96dp).
|
|
72
|
+
* Use `orientation="vertical"` and set a height via `style` for vertical sliders.
|
|
73
|
+
*
|
|
74
|
+
* @function
|
|
75
|
+
* @category Slider
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
* <Slider defaultValue={40} label="Volume" />
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* <Slider type="range" defaultValue={[20, 80]} label="Price range" showValue />
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* <Slider type="centered" defaultValue={0} min={-100} max={100} label="Balance" />
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* <Slider orientation="vertical" defaultValue={60} style={{ height: '200px' }} />
|
|
88
|
+
*/
|
|
89
|
+
export declare const Slider: React.ForwardRefExoticComponent<SliderProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ElementFocusEffect } from '../../utils';
|
|
3
|
+
export interface SliderHandleProps {
|
|
4
|
+
ariaLabel?: string;
|
|
5
|
+
ariaLabelledby?: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
displayValue: string;
|
|
8
|
+
focusEffects: ElementFocusEffect[];
|
|
9
|
+
focusVisible: boolean;
|
|
10
|
+
handleRef: React.Ref<HTMLSpanElement>;
|
|
11
|
+
isFocused: boolean;
|
|
12
|
+
max: number;
|
|
13
|
+
min: number;
|
|
14
|
+
onBlur: React.FocusEventHandler<HTMLElement>;
|
|
15
|
+
onFocus: React.FocusEventHandler<HTMLElement>;
|
|
16
|
+
onKeyDown: (e: React.KeyboardEvent<HTMLElement>) => void;
|
|
17
|
+
onPointer: (e: React.PointerEvent<HTMLSpanElement>, type: 'down' | 'move' | 'up') => void;
|
|
18
|
+
orientation: 'horizontal' | 'vertical';
|
|
19
|
+
pct: number;
|
|
20
|
+
readOnly?: boolean;
|
|
21
|
+
showValue: 'always' | 'hover' | 'none';
|
|
22
|
+
value: number;
|
|
23
|
+
}
|
|
24
|
+
export declare const SliderHandle: ({ ariaLabel, ariaLabelledby, disabled, displayValue, focusEffects, focusVisible, handleRef, isFocused, max, min, onBlur, onFocus, onKeyDown, onPointer, orientation, pct, readOnly, showValue, value, }: SliderHandleProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,48 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { BaseColor, ElementSize, WrapperProps } from '../../utils';
|
|
3
|
+
export type SpinnerVariant = 'ring' | 'dots' | 'blade' | 'bars' | 'orbit' | 'arc' | 'stepBar' | 'dualRing';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the spinner component.
|
|
6
|
+
*
|
|
7
|
+
* @remarks
|
|
8
|
+
* Supports wrapper-level spacing and positioning props from {@link WrapperProps}
|
|
9
|
+
* such as `m`, `mx`, `my`, `top`, `left`, `position`, and `zIndex`.
|
|
10
|
+
*
|
|
11
|
+
* @category Spinner
|
|
12
|
+
*/
|
|
13
|
+
export interface SpinnerProps extends Omit<React.ComponentPropsWithoutRef<'svg'>, 'color' | 'children'>, WrapperProps {
|
|
14
|
+
/** Visual spinner variant. */
|
|
3
15
|
variant?: SpinnerVariant;
|
|
16
|
+
/** Semantic color token applied to the spinner. */
|
|
17
|
+
color?: BaseColor;
|
|
18
|
+
/** Size token controlling spinner dimensions. */
|
|
19
|
+
size?: ElementSize;
|
|
20
|
+
/** Additional class names for the root svg element. */
|
|
4
21
|
className?: string;
|
|
22
|
+
/** Applies inline alignment (`vertical-align: middle`) for text-flow usage. */
|
|
5
23
|
inline?: boolean;
|
|
24
|
+
/** Accessible label. When provided, spinner is announced as a status. */
|
|
25
|
+
ariaLabel?: string;
|
|
26
|
+
/** When true, spinner ignores token-based sizing and fills its container (`width/height: 100%`). */
|
|
27
|
+
fluid?: boolean;
|
|
6
28
|
}
|
|
7
|
-
|
|
29
|
+
/**
|
|
30
|
+
* Renders a loading spinner in one of the supported variants.
|
|
31
|
+
*
|
|
32
|
+
* By default spinner is decorative. Provide `ariaLabel` to expose it as an accessible status.
|
|
33
|
+
*
|
|
34
|
+
* @function Spinner
|
|
35
|
+
* @param props Component properties.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* <Spinner />
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* <Spinner variant="dots" size="medium" color="primary" />
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* <Spinner position="absolute" top={8} right={8} />
|
|
45
|
+
*
|
|
46
|
+
* @category Spinner
|
|
47
|
+
*/
|
|
48
|
+
export declare const Spinner: ({ variant, fluid, color, size, inline, className, ariaLabel, style, ...rest }: SpinnerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { ElementElevation, ElementShape, SurfaceColor, ToastStatus } from '../../utils';
|
|
3
3
|
import { BoxBaseProps } from '../base';
|
|
4
|
-
import {
|
|
4
|
+
import { ElementAnimation } from '../../types';
|
|
5
5
|
/**
|
|
6
6
|
* Props for Toast component.
|
|
7
7
|
*
|
|
@@ -30,12 +30,8 @@ export interface ToastProps extends Omit<BoxBaseProps, 'children'> {
|
|
|
30
30
|
status?: ToastStatus;
|
|
31
31
|
/** Shape token. Default: smooth */
|
|
32
32
|
shape?: ElementShape;
|
|
33
|
-
/**
|
|
34
|
-
animation?:
|
|
35
|
-
/** Animation duration in milliseconds. */
|
|
36
|
-
duration?: number;
|
|
37
|
-
/** Motion style applied to animated elements. */
|
|
38
|
-
motionStyle?: MotionStyle;
|
|
33
|
+
/** Motion value (`MotionAnimation` or full motion config). */
|
|
34
|
+
animation?: ElementAnimation;
|
|
39
35
|
leaving?: boolean;
|
|
40
36
|
onExitComplete?: (id: string) => void;
|
|
41
37
|
}
|
|
@@ -7,7 +7,7 @@ import { BoxBaseProps } from '../base/boxBase';
|
|
|
7
7
|
*
|
|
8
8
|
* @category Toolbar
|
|
9
9
|
*/
|
|
10
|
-
export interface ToolbarProps extends Omit<BoxBaseProps, '
|
|
10
|
+
export interface ToolbarProps extends Omit<BoxBaseProps, 'as' | 'elementClass' | 'direction' | 'row' | 'col'> {
|
|
11
11
|
/** Visual variant of the toolbar. */
|
|
12
12
|
variant?: 'docked' | 'floating';
|
|
13
13
|
/** Surface color token applied to container. */
|
|
@@ -5,7 +5,7 @@ import { TextBaseProps } from '../base/textBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Typography
|
|
7
7
|
*/
|
|
8
|
-
export type H1Props = Omit<TextBaseProps, '
|
|
8
|
+
export type H1Props = Omit<TextBaseProps, 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* H1 semantic heading.
|
|
11
11
|
* Renders native h1 element with default headlineLarge font.
|
|
@@ -5,7 +5,7 @@ import { TextBaseProps } from '../base/textBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Typography
|
|
7
7
|
*/
|
|
8
|
-
export type H2Props = Omit<TextBaseProps, '
|
|
8
|
+
export type H2Props = Omit<TextBaseProps, 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* H2 semantic heading.
|
|
11
11
|
* Renders native h2 element with default headlineMedium font.
|
|
@@ -5,7 +5,7 @@ import { TextBaseProps } from '../base/textBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Typography
|
|
7
7
|
*/
|
|
8
|
-
export type H3Props = Omit<TextBaseProps, '
|
|
8
|
+
export type H3Props = Omit<TextBaseProps, 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* H3 semantic heading.
|
|
11
11
|
* Renders native h3 element with default headlineSmall font.
|
|
@@ -5,7 +5,7 @@ import { TextBaseProps } from '../base/textBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Typography
|
|
7
7
|
*/
|
|
8
|
-
export type H4Props = Omit<TextBaseProps, '
|
|
8
|
+
export type H4Props = Omit<TextBaseProps, 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* H4 semantic heading.
|
|
11
11
|
* Renders native h4 element with default titleLarge font.
|
|
@@ -5,7 +5,7 @@ import { TextBaseProps } from '../base/textBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Typography
|
|
7
7
|
*/
|
|
8
|
-
export type H5Props = Omit<TextBaseProps, '
|
|
8
|
+
export type H5Props = Omit<TextBaseProps, 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* H5 semantic heading.
|
|
11
11
|
* Renders native h5 element with default titleMedium font.
|
|
@@ -5,7 +5,7 @@ import { TextBaseProps } from '../base/textBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Typography
|
|
7
7
|
*/
|
|
8
|
-
export type H6Props = Omit<TextBaseProps, '
|
|
8
|
+
export type H6Props = Omit<TextBaseProps, 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* H6 semantic heading.
|
|
11
11
|
* Renders native h6 element with default titleSmall font.
|
|
@@ -5,7 +5,7 @@ import { TextBaseProps } from '../base/textBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Typography
|
|
7
7
|
*/
|
|
8
|
-
export type LabelProps = Omit<TextBaseProps, '
|
|
8
|
+
export type LabelProps = Omit<TextBaseProps, 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Label semantic text.
|
|
11
11
|
* Renders native label element with default labelLarge font.
|
|
@@ -5,7 +5,7 @@ import { TextBaseProps } from '../base/textBase';
|
|
|
5
5
|
*
|
|
6
6
|
* @category Typography
|
|
7
7
|
*/
|
|
8
|
-
export type SpanProps = Omit<TextBaseProps, '
|
|
8
|
+
export type SpanProps = Omit<TextBaseProps, 'as'>;
|
|
9
9
|
/**
|
|
10
10
|
* Span semantic inline text wrapper.
|
|
11
11
|
* Renders native span element.
|