@ufoui/core 0.0.88 → 0.0.125
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/spinners.d.ts +70 -0
- package/components/accordion/accordion.d.ts +4 -8
- package/components/accordion/accordionItem.d.ts +3 -5
- package/components/base/checkboxBase.d.ts +3 -7
- package/components/base/dialogBase.d.ts +3 -7
- package/components/base/textBase.d.ts +4 -3
- package/components/breadcrumbs/breadcrumbs.d.ts +2 -4
- package/components/card/card.d.ts +3 -7
- package/components/collapse/collapse.d.ts +4 -8
- package/components/item/item.d.ts +43 -0
- package/components/item/item.guards.d.ts +12 -0
- 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 +19 -3
- package/components/toast/toast.d.ts +3 -7
- package/hooks/index.d.ts +2 -0
- package/hooks/useAnimate.d.ts +4 -0
- package/hooks/useMotion.d.ts +27 -0
- package/hooks/useUpdateEffect.d.ts +26 -0
- package/index.css +1 -1
- package/index.d.ts +4 -0
- package/index.js +3464 -2979
- package/package.json +6 -5
- package/types/color.d.ts +45 -3
- package/types/motion.d.ts +24 -0
- package/utils/color.d.ts +3 -2
- 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/uniqueID.d.ts +0 -14
package/assets/spinners.d.ts
CHANGED
|
@@ -1,16 +1,86 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
+
/** Generic SVG props used by spinner assets. */
|
|
2
3
|
type SvgProps = React.ComponentPropsWithoutRef<'svg'>;
|
|
4
|
+
/** Circle-specific SVG props for spinner ring parts. */
|
|
3
5
|
type CircleProps = React.ComponentPropsWithoutRef<'circle'>;
|
|
6
|
+
/**
|
|
7
|
+
* Props for {@link SpinnerRingSvg}.
|
|
8
|
+
*
|
|
9
|
+
* @category Assets
|
|
10
|
+
*/
|
|
4
11
|
interface SpinnerRingSvgProps extends SvgProps {
|
|
12
|
+
/** Props forwarded to the ring track circle element. */
|
|
5
13
|
trackProps?: CircleProps;
|
|
14
|
+
/** Props forwarded to the ring indicator circle element. */
|
|
6
15
|
indicatorProps?: CircleProps;
|
|
7
16
|
}
|
|
17
|
+
/**
|
|
18
|
+
* Ring spinner SVG asset.
|
|
19
|
+
*
|
|
20
|
+
* @category Assets
|
|
21
|
+
* @function
|
|
22
|
+
* @param props - SVG props including optional `trackProps` and `indicatorProps`.
|
|
23
|
+
* @param props.trackProps - Props forwarded to the track `<circle>`.
|
|
24
|
+
* @param props.indicatorProps - Props forwarded to the indicator `<circle>`.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* <SpinnerRingSvg className="uui-spinner" />
|
|
28
|
+
*/
|
|
8
29
|
export declare const SpinnerRingSvg: ({ trackProps, indicatorProps, ...props }: SpinnerRingSvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
/**
|
|
31
|
+
* Three-dots spinner SVG asset.
|
|
32
|
+
*
|
|
33
|
+
* @category Assets
|
|
34
|
+
* @function
|
|
35
|
+
* @param props - Standard SVG props.
|
|
36
|
+
*/
|
|
9
37
|
export declare const SpinnerDotsSvg: (props: SvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
38
|
+
/**
|
|
39
|
+
* Blade-style spinner SVG asset.
|
|
40
|
+
*
|
|
41
|
+
* @category Assets
|
|
42
|
+
* @function
|
|
43
|
+
* @param props - Standard SVG props.
|
|
44
|
+
*/
|
|
10
45
|
export declare const SpinnerBladeSvg: (props: SvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
/**
|
|
47
|
+
* Vertical-bars spinner SVG asset.
|
|
48
|
+
*
|
|
49
|
+
* @category Assets
|
|
50
|
+
* @function
|
|
51
|
+
* @param props - Standard SVG props.
|
|
52
|
+
*/
|
|
11
53
|
export declare const SpinnerBarsSvg: (props: SvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
54
|
+
/**
|
|
55
|
+
* Orbit spinner SVG asset.
|
|
56
|
+
*
|
|
57
|
+
* @category Assets
|
|
58
|
+
* @function
|
|
59
|
+
* @param props - Standard SVG props.
|
|
60
|
+
*/
|
|
12
61
|
export declare const SpinnerOrbitSvg: (props: SvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
62
|
+
/**
|
|
63
|
+
* Arc spinner SVG asset.
|
|
64
|
+
*
|
|
65
|
+
* @category Assets
|
|
66
|
+
* @function
|
|
67
|
+
* @param props - Standard SVG props.
|
|
68
|
+
*/
|
|
13
69
|
export declare const SpinnerArcSvg: (props: SvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
/**
|
|
71
|
+
* Step-bar spinner SVG asset.
|
|
72
|
+
*
|
|
73
|
+
* @category Assets
|
|
74
|
+
* @function
|
|
75
|
+
* @param props - Standard SVG props.
|
|
76
|
+
*/
|
|
14
77
|
export declare const SpinnerStepBarSvg: (props: SvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
78
|
+
/**
|
|
79
|
+
* Dual-ring spinner SVG asset.
|
|
80
|
+
*
|
|
81
|
+
* @category Assets
|
|
82
|
+
* @function
|
|
83
|
+
* @param props - Standard SVG props.
|
|
84
|
+
*/
|
|
15
85
|
export declare const SpinnerDualRingSvg: (props: SvgProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
86
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BoxBaseProps } from '../base';
|
|
3
3
|
import { BaseColor, BorderColor, ElementBorder, ElementDensity, ElementElevation, ElementFont, ElementShape } from '../../utils';
|
|
4
|
-
import {
|
|
4
|
+
import { ElementAnimation } from '../../types';
|
|
5
5
|
export type AccordionVariant = 'text' | 'pills' | 'grouped' | 'segmented';
|
|
6
6
|
export type AccordionConfig = {
|
|
7
7
|
variant?: AccordionVariant;
|
|
@@ -12,9 +12,7 @@ export type AccordionConfig = {
|
|
|
12
12
|
border?: ElementBorder;
|
|
13
13
|
borderColor?: BorderColor;
|
|
14
14
|
shape?: ElementShape;
|
|
15
|
-
animation?:
|
|
16
|
-
motionStyle?: MotionStyle;
|
|
17
|
-
duration?: number;
|
|
15
|
+
animation?: ElementAnimation;
|
|
18
16
|
color?: BaseColor;
|
|
19
17
|
disabled?: boolean;
|
|
20
18
|
};
|
|
@@ -35,9 +33,7 @@ export interface AccordionProps extends Omit<BoxBaseProps, 'type' | 'gap' | 'gap
|
|
|
35
33
|
border?: ElementBorder;
|
|
36
34
|
borderColor?: BorderColor;
|
|
37
35
|
font?: ElementFont;
|
|
38
|
-
animation?:
|
|
39
|
-
motionStyle?: MotionStyle;
|
|
40
|
-
duration?: number;
|
|
36
|
+
animation?: ElementAnimation;
|
|
41
37
|
}
|
|
42
38
|
/**
|
|
43
39
|
* Container component that manages accordion selection state.
|
|
@@ -49,4 +45,4 @@ export interface AccordionProps extends Omit<BoxBaseProps, 'type' | 'gap' | 'gap
|
|
|
49
45
|
*
|
|
50
46
|
* @category Accordion
|
|
51
47
|
*/
|
|
52
|
-
export declare const Accordion: ({ type, variant, children, density, border, borderColor, elevation, showIcon, font, shape, animation,
|
|
48
|
+
export declare const Accordion: ({ type, variant, children, density, border, borderColor, elevation, showIcon, font, shape, animation, color, disabled, }: AccordionProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { default as React, ReactNode } from 'react';
|
|
|
2
2
|
import { IS_ACCORDION_ITEM } from './accordionItem.guards';
|
|
3
3
|
import { AccordionVariant } from './accordion';
|
|
4
4
|
import { ElementFocusEffect, ElementFont, ElementHoverEffect, ElementPressedEffect, ElementSelectedEffect, ElementTouchEffect, SurfaceColor } from '../../utils';
|
|
5
|
-
import {
|
|
5
|
+
import { ElementAnimation } from '../../types';
|
|
6
6
|
/**
|
|
7
7
|
* Props for {@link AccordionItem}.
|
|
8
8
|
*
|
|
@@ -21,9 +21,7 @@ export interface AccordionItemProps {
|
|
|
21
21
|
showIcon?: boolean;
|
|
22
22
|
variant?: AccordionVariant;
|
|
23
23
|
font?: ElementFont;
|
|
24
|
-
animation?:
|
|
25
|
-
motionStyle?: MotionStyle;
|
|
26
|
-
duration?: number;
|
|
24
|
+
animation?: ElementAnimation;
|
|
27
25
|
flush?: boolean;
|
|
28
26
|
divided?: boolean;
|
|
29
27
|
onFocus?: React.FocusEventHandler<HTMLButtonElement>;
|
|
@@ -52,7 +50,7 @@ export interface AccordionItemProps {
|
|
|
52
50
|
* @category Accordion
|
|
53
51
|
*/
|
|
54
52
|
export declare const AccordionItem: {
|
|
55
|
-
({ value, label, children, leading, trailing, showIcon, icon, font, variant, animation,
|
|
53
|
+
({ value, label, children, leading, trailing, showIcon, icon, font, variant, animation, flush, divided, onFocus, onBlur, color, disabled, hoverEffects, focusEffects, pressedEffects, touchEffects, selectedEffects, }: AccordionItemProps): import("react/jsx-runtime").JSX.Element;
|
|
56
54
|
/**
|
|
57
55
|
* Marks this component as an AccordionItem for runtime type guards.
|
|
58
56
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, ReactNode } from 'react';
|
|
2
2
|
import { BorderColor, ElementBorder, ElementDensity, ElementElevation, ElementFocusEffect, ElementFont, ElementHoverEffect, ElementOutline, ElementPlacement, ElementPressedEffect, ElementSelectedEffect, ElementShape, ElementSize, ElementTextPlacement, ElementTouchEffect, SemanticColor, SurfaceColor } from '../../utils';
|
|
3
|
-
import {
|
|
3
|
+
import { ElementAnimation } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the CheckboxBase component.
|
|
6
6
|
*
|
|
@@ -10,8 +10,8 @@ import { MotionAnimation, MotionStyle } from '../../types';
|
|
|
10
10
|
* @category Base components
|
|
11
11
|
*/
|
|
12
12
|
export interface CheckboxBaseProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'color' | 'size'> {
|
|
13
|
-
/**
|
|
14
|
-
animation?:
|
|
13
|
+
/** Motion value (`MotionAnimation` or full motion config). */
|
|
14
|
+
animation?: ElementAnimation;
|
|
15
15
|
/** Border style. */
|
|
16
16
|
border?: ElementBorder;
|
|
17
17
|
/** Border color override. */
|
|
@@ -30,8 +30,6 @@ export interface CheckboxBaseProps extends Omit<React.InputHTMLAttributes<HTMLIn
|
|
|
30
30
|
descriptionColor?: SurfaceColor;
|
|
31
31
|
/** Font applied to the description text. */
|
|
32
32
|
descriptionFont?: ElementFont;
|
|
33
|
-
/** Duration in milliseconds for the check or uncheck animation. */
|
|
34
|
-
duration?: number;
|
|
35
33
|
/** Required root class name for styling. */
|
|
36
34
|
elementClass: string;
|
|
37
35
|
/** Elevation level applied to the glyph. */
|
|
@@ -60,8 +58,6 @@ export interface CheckboxBaseProps extends Omit<React.InputHTMLAttributes<HTMLIn
|
|
|
60
58
|
label?: string;
|
|
61
59
|
/** Text color override for the label. */
|
|
62
60
|
labelColor?: SurfaceColor;
|
|
63
|
-
/** Motion style applied to animated elements. */
|
|
64
|
-
motionStyle?: MotionStyle;
|
|
65
61
|
/** DOM name attribute. */
|
|
66
62
|
name?: string;
|
|
67
63
|
/** Change event handler. */
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { BorderColor, ElementElevation, ElementFont, ElementOutline, ElementShape, ElementSize, SurfaceColor } from '../../utils';
|
|
3
|
-
import { DialogIconSlot, DialogType,
|
|
3
|
+
import { DialogIconSlot, DialogType, ElementAnimation } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the DialogBase component.
|
|
6
6
|
*
|
|
@@ -38,10 +38,8 @@ export interface DialogBaseProps {
|
|
|
38
38
|
fit?: boolean;
|
|
39
39
|
/** Renders the panel in detached layout style. */
|
|
40
40
|
detached?: boolean;
|
|
41
|
-
/**
|
|
42
|
-
animation?:
|
|
43
|
-
/** Duration in milliseconds for open and close animations. Default: 500 */
|
|
44
|
-
duration?: number;
|
|
41
|
+
/** Motion value (`MotionAnimation` or full motion config). */
|
|
42
|
+
animation?: ElementAnimation;
|
|
45
43
|
/** Whether the dialog closes when the backdrop is clicked. Default: true */
|
|
46
44
|
closeOnBackdrop?: boolean;
|
|
47
45
|
/** Whether the dialog closes when Escape is pressed. Default: true */
|
|
@@ -90,8 +88,6 @@ export interface DialogBaseProps {
|
|
|
90
88
|
onBack?: () => void;
|
|
91
89
|
/** Additional class names for the dialog panel. */
|
|
92
90
|
className?: string;
|
|
93
|
-
/** Motion style helper classes for the panel. */
|
|
94
|
-
motionStyle?: MotionStyle;
|
|
95
91
|
/** Enables modal behaviour, focus trap, aria-modal, and body scroll lock when applicable. */
|
|
96
92
|
modal?: boolean;
|
|
97
93
|
/** Focuses the dialog when opened (with modal focus trap). */
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { default as React, HTMLAttributes, ReactNode } from 'react';
|
|
2
|
-
import { BorderColor, ElementBorder, ElementElevation, ElementFont, ElementShape
|
|
2
|
+
import { BorderColor, ElementBorder, ElementElevation, ElementFont, ElementShape } from '../../utils';
|
|
3
|
+
import { TextColor } from '../../types';
|
|
3
4
|
/**
|
|
4
5
|
* Props for {@link TextBase}.
|
|
5
6
|
*
|
|
@@ -17,8 +18,8 @@ export interface TextBaseProps extends Omit<HTMLAttributes<HTMLElement>, 'color'
|
|
|
17
18
|
borderColor?: BorderColor;
|
|
18
19
|
/** Text content. */
|
|
19
20
|
children?: ReactNode;
|
|
20
|
-
/**
|
|
21
|
-
color?:
|
|
21
|
+
/** Text color token. */
|
|
22
|
+
color?: TextColor;
|
|
22
23
|
/** Semantic UUI element class (e.g. uui-text, uui-heading). */
|
|
23
24
|
elementClass?: string;
|
|
24
25
|
/** Elevation level (0–5). */
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { default as React, ElementType, ReactNode } from 'react';
|
|
2
2
|
import { BoxBaseProps } from '../base';
|
|
3
3
|
import { ElementDensity, ElementFont, SurfaceColor } from '../../utils';
|
|
4
|
-
import {
|
|
4
|
+
import { ElementAnimation } from '../../types';
|
|
5
5
|
/**
|
|
6
6
|
* Breadcrumb item.
|
|
7
7
|
*
|
|
@@ -35,9 +35,7 @@ export interface BreadcrumbsProps extends BoxBaseProps {
|
|
|
35
35
|
density?: ElementDensity;
|
|
36
36
|
font?: ElementFont;
|
|
37
37
|
color?: SurfaceColor;
|
|
38
|
-
animation?:
|
|
39
|
-
motionStyle?: MotionStyle;
|
|
40
|
-
duration?: number;
|
|
38
|
+
animation?: ElementAnimation;
|
|
41
39
|
}
|
|
42
40
|
/**
|
|
43
41
|
* Breadcrumbs navigation component.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { default as React, ElementType, ReactNode } from 'react';
|
|
2
2
|
import { BorderColor, ElementElevation, ElementShape, SurfaceColor } from '../../utils';
|
|
3
|
-
import {
|
|
3
|
+
import { ElementAnimation } from '../../types';
|
|
4
4
|
import { BoxBaseProps } from '../base';
|
|
5
5
|
export type CardVariant = 'elevated' | 'filled' | 'outlined';
|
|
6
6
|
/**
|
|
@@ -21,12 +21,8 @@ export interface CardProps extends Omit<BoxBaseProps, 'type' | 'elementClass' |
|
|
|
21
21
|
variant?: CardVariant;
|
|
22
22
|
/** Whether the card is visible. */
|
|
23
23
|
open?: boolean;
|
|
24
|
-
/**
|
|
25
|
-
animation?:
|
|
26
|
-
/** Animation duration in ms. */
|
|
27
|
-
duration?: number;
|
|
28
|
-
/** Motion style helper classes. */
|
|
29
|
-
motionStyle?: MotionStyle;
|
|
24
|
+
/** Motion value (`MotionAnimation` or full motion config). */
|
|
25
|
+
animation?: ElementAnimation;
|
|
30
26
|
/** Surface color token override. */
|
|
31
27
|
color?: SurfaceColor;
|
|
32
28
|
/** Elevation override. */
|
|
@@ -1,24 +1,20 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
2
|
import { BoxBaseProps } from '../base';
|
|
3
|
-
import {
|
|
3
|
+
import { ElementAnimation } from '../../types';
|
|
4
4
|
/**
|
|
5
5
|
* Props for the Collapse component.
|
|
6
6
|
*
|
|
7
7
|
* @category Collapse
|
|
8
8
|
*/
|
|
9
9
|
export interface CollapseProps extends Omit<BoxBaseProps, 'elevation'> {
|
|
10
|
-
/** Motion
|
|
11
|
-
animation?:
|
|
10
|
+
/** Motion value (`MotionAnimation` or full motion config). */
|
|
11
|
+
animation?: ElementAnimation;
|
|
12
12
|
/** Content rendered inside the container. */
|
|
13
13
|
children?: ReactNode;
|
|
14
14
|
/** Additional root class name. */
|
|
15
15
|
className?: string;
|
|
16
|
-
/** Animation duration in milliseconds. Default: 220. */
|
|
17
|
-
duration?: number;
|
|
18
|
-
/** Motion style variant. */
|
|
19
|
-
motionStyle?: MotionStyle;
|
|
20
16
|
/** Controls whether the container is expanded. */
|
|
21
|
-
open
|
|
17
|
+
open?: boolean;
|
|
22
18
|
}
|
|
23
19
|
/**
|
|
24
20
|
* Animated container that expands and collapses vertically.
|
|
@@ -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>;
|
|
@@ -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
|
+
};
|