@lec-space/liquidglass 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +60 -2
- package/dist/button-DSXdLDuQ.js +1051 -0
- package/dist/button-EFLg6M7I.cjs +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +8931 -0
- package/dist/styles.css +7101 -0
- package/dist/types/accordion.d.ts +33 -0
- package/dist/types/activity-calendar.d.ts +18 -0
- package/dist/types/alert.d.ts +18 -0
- package/dist/types/aspect-ratio.d.ts +10 -0
- package/dist/types/autocomplete.d.ts +41 -0
- package/dist/types/avatar-group.d.ts +16 -0
- package/dist/types/avatar.d.ts +12 -0
- package/dist/types/badge.d.ts +13 -0
- package/dist/types/box.d.ts +12 -0
- package/dist/types/breadcrumbs.d.ts +31 -0
- package/dist/types/button-group.d.ts +12 -0
- package/dist/types/button.d.ts +16 -0
- package/dist/types/calendar.d.ts +23 -0
- package/dist/types/card.d.ts +10 -0
- package/dist/types/checkbox-group.d.ts +39 -0
- package/dist/types/checkbox.d.ts +9 -0
- package/dist/types/close-button.d.ts +11 -0
- package/dist/types/color-area.d.ts +15 -0
- package/dist/types/color-field.d.ts +15 -0
- package/dist/types/color-picker.d.ts +21 -0
- package/dist/types/color-slider.d.ts +21 -0
- package/dist/types/color-swatch-picker.d.ts +24 -0
- package/dist/types/color-swatch.d.ts +15 -0
- package/dist/types/combo-box.d.ts +37 -0
- package/dist/types/command-palette.d.ts +22 -0
- package/dist/types/config-provider.d.ts +100 -0
- package/dist/types/confirm.d.ts +22 -0
- package/dist/types/container.d.ts +12 -0
- package/dist/types/context-menu.d.ts +17 -0
- package/dist/types/data-table.d.ts +32 -0
- package/dist/types/date-field.d.ts +25 -0
- package/dist/types/date-picker.d.ts +29 -0
- package/dist/types/date-range-picker.d.ts +23 -0
- package/dist/types/description.d.ts +8 -0
- package/dist/types/descriptions.d.ts +13 -0
- package/dist/types/dialog.d.ts +19 -0
- package/dist/types/disclosure-group.d.ts +18 -0
- package/dist/types/disclosure.d.ts +31 -0
- package/dist/types/drawer.d.ts +7 -0
- package/dist/types/empty.d.ts +8 -0
- package/dist/types/field-error.d.ts +12 -0
- package/dist/types/fieldset.d.ts +12 -0
- package/dist/types/filter-bar.d.ts +9 -0
- package/dist/types/flex.d.ts +32 -0
- package/dist/types/form-field.d.ts +19 -0
- package/dist/types/form.d.ts +12 -0
- package/dist/types/glass-group.d.ts +10 -0
- package/dist/types/glass.d.ts +3 -0
- package/dist/types/grid.d.ts +30 -0
- package/dist/types/import-wizard.d.ts +11 -0
- package/dist/types/index.d.ts +107 -0
- package/dist/types/input-group.d.ts +22 -0
- package/dist/types/input-otp.d.ts +29 -0
- package/dist/types/input.d.ts +13 -0
- package/dist/types/internal/bend.d.ts +15 -0
- package/dist/types/internal/calendar-day.d.ts +13 -0
- package/dist/types/internal/chevron.d.ts +6 -0
- package/dist/types/internal/color.d.ts +29 -0
- package/dist/types/internal/contour.d.ts +10 -0
- package/dist/types/internal/controllable.d.ts +1 -0
- package/dist/types/internal/cx.d.ts +1 -0
- package/dist/types/internal/date-only.d.ts +4 -0
- package/dist/types/internal/field-error.d.ts +6 -0
- package/dist/types/internal/floating.d.ts +15 -0
- package/dist/types/internal/form-context.d.ts +5 -0
- package/dist/types/internal/form-reset.d.ts +3 -0
- package/dist/types/internal/hold.d.ts +8 -0
- package/dist/types/internal/href.d.ts +7 -0
- package/dist/types/internal/jelly.d.ts +22 -0
- package/dist/types/internal/layout-style.d.ts +62 -0
- package/dist/types/internal/modal.d.ts +11 -0
- package/dist/types/internal/placement.d.ts +33 -0
- package/dist/types/internal/press.d.ts +2 -0
- package/dist/types/internal/range-calendar-navigation.d.ts +6 -0
- package/dist/types/internal/range-calendar.d.ts +11 -0
- package/dist/types/internal/refraction.d.ts +20 -0
- package/dist/types/internal/schedule-utils.d.ts +32 -0
- package/dist/types/internal/scroller.d.ts +2 -0
- package/dist/types/internal/sheet-drag.d.ts +17 -0
- package/dist/types/internal/spring.d.ts +13 -0
- package/dist/types/internal/styles.d.ts +5 -0
- package/dist/types/internal/tab-motion.d.ts +2 -0
- package/dist/types/internal/tree-branch.d.ts +13 -0
- package/dist/types/kbd.d.ts +13 -0
- package/dist/types/label.d.ts +12 -0
- package/dist/types/link.d.ts +19 -0
- package/dist/types/list-box.d.ts +39 -0
- package/dist/types/loading-overlay.d.ts +17 -0
- package/dist/types/member-picker.d.ts +15 -0
- package/dist/types/mention.d.ts +44 -0
- package/dist/types/menu.d.ts +61 -0
- package/dist/types/message.d.ts +12 -0
- package/dist/types/meter.d.ts +28 -0
- package/dist/types/multi-select.d.ts +25 -0
- package/dist/types/navigation-bar.d.ts +25 -0
- package/dist/types/number-field.d.ts +25 -0
- package/dist/types/page-control.d.ts +13 -0
- package/dist/types/pagination.d.ts +12 -0
- package/dist/types/popover.d.ts +20 -0
- package/dist/types/progress-circle.d.ts +20 -0
- package/dist/types/progress.d.ts +10 -0
- package/dist/types/radio-group.d.ts +39 -0
- package/dist/types/radio.d.ts +8 -0
- package/dist/types/range-calendar.d.ts +24 -0
- package/dist/types/schedule-calendar.d.ts +103 -0
- package/dist/types/scroll-shadow.d.ts +16 -0
- package/dist/types/search-field.d.ts +5 -0
- package/dist/types/section.d.ts +10 -0
- package/dist/types/segmented-control.d.ts +14 -0
- package/dist/types/select.d.ts +20 -0
- package/dist/types/separator.d.ts +13 -0
- package/dist/types/sheet.d.ts +14 -0
- package/dist/types/skeleton.d.ts +9 -0
- package/dist/types/slider.d.ts +10 -0
- package/dist/types/statistic.d.ts +11 -0
- package/dist/types/stepper.d.ts +12 -0
- package/dist/types/steps.d.ts +30 -0
- package/dist/types/style-entry.d.ts +1 -0
- package/dist/types/surface.d.ts +17 -0
- package/dist/types/switch.d.ts +7 -0
- package/dist/types/tab-bar.d.ts +23 -0
- package/dist/types/table.d.ts +22 -0
- package/dist/types/tabs.d.ts +19 -0
- package/dist/types/tag-group.d.ts +40 -0
- package/dist/types/tag.d.ts +10 -0
- package/dist/types/tags-input.d.ts +29 -0
- package/dist/types/text-area.d.ts +13 -0
- package/dist/types/time-field.d.ts +25 -0
- package/dist/types/toast.d.ts +35 -0
- package/dist/types/toggle-button-group.d.ts +24 -0
- package/dist/types/toggle-button.d.ts +27 -0
- package/dist/types/toolbar.d.ts +13 -0
- package/dist/types/tooltip.d.ts +16 -0
- package/dist/types/tree.d.ts +18 -0
- package/dist/types/typography.d.ts +11 -0
- package/dist/types/upload.d.ts +15 -0
- package/dist/types/workspace.d.ts +22 -0
- package/dist/workspace.cjs +1 -0
- package/dist/workspace.js +42 -0
- package/package.json +65 -3
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { type CSSProperties, type JSX, type ReactNode } from "react";
|
|
2
|
+
import { type ButtonProps } from "./button.js";
|
|
3
|
+
export interface MenuItem {
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
/**
|
|
7
|
+
* Makes the item a link. Choosing it calls `onSelect` if there is one, such as a router's
|
|
8
|
+
* navigate, and follows the link if not; with ⌘, Ctrl, Shift or the middle button it opens
|
|
9
|
+
* a new tab.
|
|
10
|
+
*/
|
|
11
|
+
href?: string;
|
|
12
|
+
onSelect?: () => void;
|
|
13
|
+
destructive?: boolean;
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Makes the item one of a set of choices, such as a sort order or an appearance, with a
|
|
17
|
+
* checkmark beside the one that's chosen.
|
|
18
|
+
*/
|
|
19
|
+
checked?: boolean;
|
|
20
|
+
/** Choosing the item leaves the menu open, so what it changed can be seen, as for a setting. */
|
|
21
|
+
keepOpen?: boolean;
|
|
22
|
+
className?: string;
|
|
23
|
+
}
|
|
24
|
+
/** A line of small text above the items it introduces, such as the title of a section. */
|
|
25
|
+
export interface MenuHeading {
|
|
26
|
+
heading: ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export type MenuEntry = MenuItem | MenuHeading | "separator";
|
|
29
|
+
interface MenuBaseProps {
|
|
30
|
+
/** Names the menu for assistive technology, and the trigger too when it has no `label`. */
|
|
31
|
+
"aria-label": string;
|
|
32
|
+
/** The trigger's icon. Defaults to an ellipsis when there's no `label`. */
|
|
33
|
+
icon?: ReactNode;
|
|
34
|
+
/** Turns the trigger into a pill with this label, like an iOS pull-down button. */
|
|
35
|
+
label?: ReactNode;
|
|
36
|
+
/** Adds a chevron after a `label`. iOS doesn't draw one on a glass pull-down, so it's off by default. */
|
|
37
|
+
chevron?: boolean;
|
|
38
|
+
/** Anything else for the trigger button, such as its `variant` or `className`. */
|
|
39
|
+
trigger?: Omit<ButtonProps, "icon" | "children" | "onClick">;
|
|
40
|
+
/** The trigger edge the menu lines up with as it opens across it. */
|
|
41
|
+
align?: "start" | "center" | "end";
|
|
42
|
+
/** Whether the menu is open. Pass it with `onOpenChange` to open and close the menu yourself. */
|
|
43
|
+
open?: boolean;
|
|
44
|
+
defaultOpen?: boolean;
|
|
45
|
+
/** Called when the trigger, Escape, Tab, a chosen item or a press outside asks to open or close the menu. */
|
|
46
|
+
onOpenChange?: (open: boolean) => void;
|
|
47
|
+
className?: string;
|
|
48
|
+
style?: CSSProperties;
|
|
49
|
+
}
|
|
50
|
+
export type MenuProps = MenuBaseProps & ({
|
|
51
|
+
items: MenuEntry[];
|
|
52
|
+
renderContent?: never;
|
|
53
|
+
} | {
|
|
54
|
+
items?: never;
|
|
55
|
+
/** 在同一个动画容器中渲染自定义内容,由调用方管理条目交互。 */
|
|
56
|
+
renderContent: (controls: {
|
|
57
|
+
close: () => void;
|
|
58
|
+
}) => ReactNode;
|
|
59
|
+
});
|
|
60
|
+
export declare function Menu({ items, renderContent, "aria-label": name, icon: iconProp, label, trigger, align, chevron, open: openProp, defaultOpen, onOpenChange, className, style, }: MenuProps): JSX.Element;
|
|
61
|
+
export {};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { JSX, ReactNode } from "react";
|
|
2
|
+
export interface MessageProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
tone?: "info" | "error";
|
|
5
|
+
action?: {
|
|
6
|
+
label: string;
|
|
7
|
+
onClick: () => void;
|
|
8
|
+
};
|
|
9
|
+
className?: string;
|
|
10
|
+
}
|
|
11
|
+
/** 在当前界面反馈操作结果,关闭或重试由调用方控制。 */
|
|
12
|
+
export declare function Message({ children, tone, action, className }: MessageProps): JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/** 液态玻璃语义度量条:用于容量、配额、评分等已知范围标量展示,支持阈值自动变色。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export type MeterTone = "accent" | "success" | "warning" | "danger";
|
|
4
|
+
export interface MeterProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** 当前数值。 */
|
|
6
|
+
value: number;
|
|
7
|
+
/** 最小值,默认 0。 */
|
|
8
|
+
min?: number;
|
|
9
|
+
/** 最大值,默认 100。 */
|
|
10
|
+
max?: number;
|
|
11
|
+
/** 低阈值:用于按 HTML meter 语义自动推导颜色。 */
|
|
12
|
+
low?: number;
|
|
13
|
+
/** 高阈值:超过时进入警示或危险态。 */
|
|
14
|
+
high?: number;
|
|
15
|
+
/** 理想值所在区间参考。 */
|
|
16
|
+
optimum?: number;
|
|
17
|
+
/** 手动指定颜色语义;不传时根据阈值自动计算。 */
|
|
18
|
+
tone?: MeterTone;
|
|
19
|
+
/** 顶部标题文案。 */
|
|
20
|
+
label?: ReactNode;
|
|
21
|
+
/** 自定义数值文案;不传时默认显示百分比。 */
|
|
22
|
+
valueLabel?: ReactNode;
|
|
23
|
+
/** 是否显示数值文案,默认在提供 `label` 或 `valueLabel` 时显示。 */
|
|
24
|
+
showValue?: boolean;
|
|
25
|
+
/** 轨道高度规格。 */
|
|
26
|
+
size?: "small" | "regular" | "large";
|
|
27
|
+
}
|
|
28
|
+
export declare const Meter: ForwardRefExoticComponent<MeterProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** 可搜索多选,异步搜索由 onSearchChange 通知上层,支持原生 FormData 与 reset。 */
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface MultiSelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
group?: string;
|
|
9
|
+
icon?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export interface MultiSelectProps {
|
|
12
|
+
options: readonly MultiSelectOption[];
|
|
13
|
+
value?: readonly string[];
|
|
14
|
+
defaultValue?: readonly string[];
|
|
15
|
+
onValueChange?: (values: string[]) => void;
|
|
16
|
+
onSearchChange?: (search: string) => void;
|
|
17
|
+
placeholder?: string;
|
|
18
|
+
name?: string;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
loading?: boolean;
|
|
22
|
+
maxSelected?: number;
|
|
23
|
+
"aria-label": string;
|
|
24
|
+
}
|
|
25
|
+
export declare function MultiSelect({ options, value, defaultValue, onValueChange, onSearchChange, placeholder, name, required, disabled, loading, maxSelected, "aria-label": label, }: MultiSelectProps): JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
import { type ToolbarProps } from "./toolbar.js";
|
|
3
|
+
export interface NavigationBarProps extends Omit<ToolbarProps, "title" | "children"> {
|
|
4
|
+
/** The screen's name. Large under the bar, then in the bar once it has scrolled under. */
|
|
5
|
+
title: string;
|
|
6
|
+
/** Show the title large below the bar. Without it the title sits in the bar from the start. Defaults to true. */
|
|
7
|
+
large?: boolean;
|
|
8
|
+
/** Adds the round back button at the leading edge, and is called when it's pressed. */
|
|
9
|
+
onBack?: () => void;
|
|
10
|
+
/** What the back button is called to a screen reader. Defaults to "Back". */
|
|
11
|
+
backLabel?: string;
|
|
12
|
+
/** Actions at the leading edge, after the back button. Put buttons in `ToolbarGroup`s, or use a `Menu`. */
|
|
13
|
+
leading?: ReactNode;
|
|
14
|
+
/** Actions at the trailing edge. */
|
|
15
|
+
trailing?: ReactNode;
|
|
16
|
+
/** The heading level of the title. Defaults to 1. */
|
|
17
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The bar at the top of a screen: an optional back button, actions, and the
|
|
21
|
+
* screen's title. It sticks to the top of what scrolls beneath it like a
|
|
22
|
+
* `Toolbar`, and the large title scrolls away with the content while its
|
|
23
|
+
* smaller twin fades into the bar.
|
|
24
|
+
*/
|
|
25
|
+
export declare const NavigationBar: ForwardRefExoticComponent<NavigationBarProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** 液态玻璃数字输入框:支持 Intl 格式化、边界钳制、步进按钮、键盘上下调节与原生表单提交。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type InputHTMLAttributes, type RefAttributes } from "react";
|
|
3
|
+
export interface NumberFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step" | "size"> {
|
|
4
|
+
/** 受控数值;`null` 表示空值。 */
|
|
5
|
+
value?: number | null;
|
|
6
|
+
/** 非受控初始数值。 */
|
|
7
|
+
defaultValue?: number | null;
|
|
8
|
+
/** 数值变化回调。 */
|
|
9
|
+
onValueChange?: (value: number | null) => void;
|
|
10
|
+
/** 最小值限制。 */
|
|
11
|
+
min?: number;
|
|
12
|
+
/** 最大值限制。 */
|
|
13
|
+
max?: number;
|
|
14
|
+
/** 每次增减步长,默认 1。 */
|
|
15
|
+
step?: number;
|
|
16
|
+
/** 可选 `Intl.NumberFormat` 格式化配置(例如货币、百分比或小数位)。 */
|
|
17
|
+
formatOptions?: Intl.NumberFormatOptions;
|
|
18
|
+
/** 是否显示内嵌加减步进按钮,默认显示。 */
|
|
19
|
+
showStepper?: boolean;
|
|
20
|
+
/** 控件尺寸。 */
|
|
21
|
+
size?: "small" | "regular" | "large";
|
|
22
|
+
/** 表面变体。 */
|
|
23
|
+
variant?: "glass" | "filled";
|
|
24
|
+
}
|
|
25
|
+
export declare const NumberField: ForwardRefExoticComponent<NumberFieldProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
|
|
2
|
+
export interface PageControlProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
3
|
+
/** How many pages there are. */
|
|
4
|
+
count: number;
|
|
5
|
+
/** The current page, from 0. */
|
|
6
|
+
value?: number;
|
|
7
|
+
defaultValue?: number;
|
|
8
|
+
onValueChange?: (value: number) => void;
|
|
9
|
+
/** Draw the dots on a capsule of glass, as the iOS "prominent" page control does. Default true. */
|
|
10
|
+
glass?: boolean;
|
|
11
|
+
}
|
|
12
|
+
/** The iOS page control: a row of dots with the current page filled, on a capsule of glass. */
|
|
13
|
+
export declare const PageControl: ForwardRefExoticComponent<PageControlProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { JSX } from "react";
|
|
2
|
+
export interface PaginationProps {
|
|
3
|
+
total: number;
|
|
4
|
+
page: number;
|
|
5
|
+
pageSize?: number;
|
|
6
|
+
onPageChange: (page: number) => void;
|
|
7
|
+
pageSizeOptions?: readonly number[];
|
|
8
|
+
onPageSizeChange?: (size: number) => void;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
"aria-label"?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare function Pagination({ total, page, pageSize, onPageChange, pageSizeOptions, onPageSizeChange, disabled, "aria-label": label, }: PaginationProps): JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type CSSProperties, type JSX, type ReactNode } from "react";
|
|
2
|
+
import { type ButtonProps } from "./button.js";
|
|
3
|
+
import { type FloatingSide } from "./internal/floating.js";
|
|
4
|
+
export interface PopoverProps {
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
"aria-label": string;
|
|
7
|
+
title?: ReactNode;
|
|
8
|
+
children: ReactNode | ((controls: {
|
|
9
|
+
close: () => void;
|
|
10
|
+
}) => ReactNode);
|
|
11
|
+
trigger?: Omit<ButtonProps, "children" | "onClick">;
|
|
12
|
+
side?: FloatingSide;
|
|
13
|
+
align?: "start" | "center" | "end";
|
|
14
|
+
width?: CSSProperties["width"];
|
|
15
|
+
open?: boolean;
|
|
16
|
+
defaultOpen?: boolean;
|
|
17
|
+
onOpenChange?: (open: boolean) => void;
|
|
18
|
+
className?: string;
|
|
19
|
+
}
|
|
20
|
+
export declare function Popover({ label, "aria-label": name, title, children, trigger, side, align, width, open: controlled, defaultOpen, onOpenChange, className, }: PopoverProps): JSX.Element;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** 液态玻璃环形进度指示器:支持确定进度(0..1)与不确定旋转模式,内置居中百分比文案。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export type ProgressCircleTone = "accent" | "success" | "warning" | "danger";
|
|
4
|
+
export interface ProgressCircleProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
/** 进度比例(0 到 1);未传或开启 `indeterminate` 时显示旋转态。 */
|
|
6
|
+
value?: number;
|
|
7
|
+
/** 不确定进度模式。 */
|
|
8
|
+
indeterminate?: boolean;
|
|
9
|
+
/** 直径规格,也可直接传像素值。 */
|
|
10
|
+
size?: "small" | "regular" | "large" | number;
|
|
11
|
+
/** 环线宽度(像素)。 */
|
|
12
|
+
strokeWidth?: number;
|
|
13
|
+
/** 语义色调。 */
|
|
14
|
+
tone?: ProgressCircleTone;
|
|
15
|
+
/** 是否在圆环中央展示百分比。 */
|
|
16
|
+
showValue?: boolean;
|
|
17
|
+
/** 自定义中心展示内容或下方说明标签。 */
|
|
18
|
+
label?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const ProgressCircle: ForwardRefExoticComponent<ProgressCircleProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
|
|
2
|
+
export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** How far along, from 0 to 1. */
|
|
4
|
+
value: number;
|
|
5
|
+
}
|
|
6
|
+
/** A thin bar that fills as work goes on. */
|
|
7
|
+
export declare const Progress: ForwardRefExoticComponent<ProgressProps & RefAttributes<HTMLDivElement>>;
|
|
8
|
+
export type SpinnerProps = HTMLAttributes<HTMLSpanElement>;
|
|
9
|
+
/** The iOS activity indicator: eight blades that fade round in turn. */
|
|
10
|
+
export declare const Spinner: ForwardRefExoticComponent<SpinnerProps & RefAttributes<HTMLSpanElement>>;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/** 单选框组:统一管理互斥单选值、原生 name 分组、方向键切换与卡片样式。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface RadioGroupOption {
|
|
4
|
+
/** 选项唯一值。 */
|
|
5
|
+
value: string;
|
|
6
|
+
/** 展示标签。 */
|
|
7
|
+
label: ReactNode;
|
|
8
|
+
/** 可选说明文案。 */
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
/** 单项禁用。 */
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface RadioGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
|
|
14
|
+
/** 单选项集合。 */
|
|
15
|
+
options: readonly RadioGroupOption[];
|
|
16
|
+
/** 受控选中值。 */
|
|
17
|
+
value?: string;
|
|
18
|
+
/** 非受控初始选中值。 */
|
|
19
|
+
defaultValue?: string;
|
|
20
|
+
/** 选中值变化回调。 */
|
|
21
|
+
onValueChange?: (value: string) => void;
|
|
22
|
+
/** 原生单选分组名;不传时自动生成唯一名确保组内互斥。 */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** 分组标题。 */
|
|
25
|
+
label?: ReactNode;
|
|
26
|
+
/** 分组说明。 */
|
|
27
|
+
description?: ReactNode;
|
|
28
|
+
/** 校验错误提示。 */
|
|
29
|
+
error?: ReactNode;
|
|
30
|
+
/** 排列方向。 */
|
|
31
|
+
orientation?: "vertical" | "horizontal";
|
|
32
|
+
/** 展示变体:`default` 为列表,`card` 为可选玻璃质感卡片。 */
|
|
33
|
+
variant?: "default" | "card";
|
|
34
|
+
/** 禁用整个单选组。 */
|
|
35
|
+
disabled?: boolean;
|
|
36
|
+
/** 必填约束。 */
|
|
37
|
+
required?: boolean;
|
|
38
|
+
}
|
|
39
|
+
export declare function RadioGroup({ options, value: controlledValue, defaultValue, onValueChange, name, label, description, error, orientation, variant, disabled, required, className, ...props }: RadioGroupProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type InputHTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "children"> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
6
|
+
}
|
|
7
|
+
/** 同组 Radio 使用相同 name,浏览器负责互斥选择、方向键导航和表单提交。 */
|
|
8
|
+
export declare const Radio: ForwardRefExoticComponent<RadioProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/** 独立液态玻璃日期范围日历组件:直接内嵌展示单月或双月范围选择,无需弹出浮层。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX } from "react";
|
|
3
|
+
import type { DateRange } from "./date-range-picker.js";
|
|
4
|
+
export interface RangeCalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
|
|
5
|
+
/** 受控日期范围(`YYYY-MM-DD`)。 */
|
|
6
|
+
value?: DateRange;
|
|
7
|
+
/** 非受控初始日期范围。 */
|
|
8
|
+
defaultValue?: DateRange;
|
|
9
|
+
/** 范围变化回调。 */
|
|
10
|
+
onValueChange?: (value: DateRange) => void;
|
|
11
|
+
/** 最小可选日期。 */
|
|
12
|
+
min?: string;
|
|
13
|
+
/** 最大可选日期。 */
|
|
14
|
+
max?: string;
|
|
15
|
+
/** 指定今天日期。 */
|
|
16
|
+
today?: string;
|
|
17
|
+
/** 显式指定同时展示的月份数;未传时桌面 2 个月、窄屏自动 1 个月。 */
|
|
18
|
+
numberOfMonths?: number;
|
|
19
|
+
/** 禁用交互。 */
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
/** 外观变体。 */
|
|
22
|
+
variant?: "glass" | "plain";
|
|
23
|
+
}
|
|
24
|
+
export declare function RangeCalendar({ value: controlledValue, defaultValue, onValueChange, min, max, today, numberOfMonths, disabled, variant, className, ...props }: RangeCalendarProps): JSX.Element;
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/** 通用日程日历工作台组件(ScheduleCalendar):支持月/周/日三视图、多日历分组筛选、迷你月历联动、跨天色条与玻璃详情浮层,供业务自由组装。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export type ScheduleCalendarView = "month" | "week" | "day";
|
|
4
|
+
export type ScheduleEventStatus = "accepted" | "tentative" | "declined";
|
|
5
|
+
export interface ScheduleCalendarSource {
|
|
6
|
+
/** 日历唯一标识。 */
|
|
7
|
+
id: string;
|
|
8
|
+
/** 日历展示名称。 */
|
|
9
|
+
name: string;
|
|
10
|
+
/** 分组名称(例如「我管理的」「我订阅的」)。 */
|
|
11
|
+
group?: string;
|
|
12
|
+
/** 日历主题色(CSS 颜色值,例如 `#3370ff`、`#147d4a`)。 */
|
|
13
|
+
color: string;
|
|
14
|
+
/** 初始是否勾选展示,默认 `true`。 */
|
|
15
|
+
visible?: boolean;
|
|
16
|
+
/** 是否禁止切换勾选状态。 */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
}
|
|
19
|
+
export interface ScheduleEvent {
|
|
20
|
+
/** 日程唯一标识。 */
|
|
21
|
+
id: string;
|
|
22
|
+
/** 日程标题。 */
|
|
23
|
+
title: string;
|
|
24
|
+
/** 所属日历 ID;若传入 `calendars` 将自动继承颜色并受其显隐控制。 */
|
|
25
|
+
calendarId?: string;
|
|
26
|
+
/** 开始时间(`YYYY-MM-DD` 或 `YYYY-MM-DDTHH:mm`)。 */
|
|
27
|
+
start: string;
|
|
28
|
+
/** 结束时间(`YYYY-MM-DD` 或 `YYYY-MM-DDTHH:mm`);省略时默认与开始时间同日。 */
|
|
29
|
+
end?: string;
|
|
30
|
+
/** 是否全天或跨天日程(渲染为飞书同款色条胶囊)。 */
|
|
31
|
+
allDay?: boolean;
|
|
32
|
+
/** 显式覆盖该日程颜色。 */
|
|
33
|
+
color?: string;
|
|
34
|
+
/** 参与状态:`accepted` 实心圆点、`tentative` 空心圆点、`declined` 删除线降权。 */
|
|
35
|
+
status?: ScheduleEventStatus;
|
|
36
|
+
/** 会议室或地点。 */
|
|
37
|
+
location?: string;
|
|
38
|
+
/** 日程备注或议程描述。 */
|
|
39
|
+
description?: string;
|
|
40
|
+
/** 参与人名称列表。 */
|
|
41
|
+
attendees?: readonly string[];
|
|
42
|
+
}
|
|
43
|
+
export interface ScheduleSlotSelection {
|
|
44
|
+
/** 被点击的日期(`YYYY-MM-DD`)。 */
|
|
45
|
+
date: string;
|
|
46
|
+
/** 若点击周/日时间轴的具体小时格,返回 `HH:mm`。 */
|
|
47
|
+
time?: string;
|
|
48
|
+
/** 是否点击在全天区域或月视图日期格。 */
|
|
49
|
+
allDay: boolean;
|
|
50
|
+
}
|
|
51
|
+
export interface ScheduleCalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
|
|
52
|
+
/** 日程条目集合。 */
|
|
53
|
+
events: readonly ScheduleEvent[];
|
|
54
|
+
/** 可选多日历源;传入后支持按日历分组勾选过滤并自动配色。 */
|
|
55
|
+
calendars?: readonly ScheduleCalendarSource[];
|
|
56
|
+
/** 受控视图模式(`month` | `week` | `day`)。 */
|
|
57
|
+
view?: ScheduleCalendarView;
|
|
58
|
+
/** 非受控初始视图模式,默认 `month`。 */
|
|
59
|
+
defaultView?: ScheduleCalendarView;
|
|
60
|
+
/** 视图模式变化回调。 */
|
|
61
|
+
onViewChange?: (view: ScheduleCalendarView) => void;
|
|
62
|
+
/** 受控焦点日期(`YYYY-MM-DD`)。 */
|
|
63
|
+
date?: string;
|
|
64
|
+
/** 非受控初始焦点日期。 */
|
|
65
|
+
defaultDate?: string;
|
|
66
|
+
/** 焦点日期变化回调。 */
|
|
67
|
+
onDateChange?: (date: string) => void;
|
|
68
|
+
/** 稳定的「今天」日期(`YYYY-MM-DD`),用于 SSR 或固定日期高亮。 */
|
|
69
|
+
today?: string;
|
|
70
|
+
/** 当前时间指示线分钟数(如 `14 * 60 + 30`);未传时客户端自动读取当前本地时间。 */
|
|
71
|
+
nowMinutes?: number;
|
|
72
|
+
/** 受控可见日历 ID 列表。 */
|
|
73
|
+
visibleCalendarIds?: readonly string[];
|
|
74
|
+
/** 非受控初始可见日历 ID 列表。 */
|
|
75
|
+
defaultVisibleCalendarIds?: readonly string[];
|
|
76
|
+
/** 日历勾选变化回调。 */
|
|
77
|
+
onVisibleCalendarsChange?: (ids: string[]) => void;
|
|
78
|
+
/** 一周起始日:`0` 为周日(默认,与飞书一致),`1` 为周一。 */
|
|
79
|
+
weekStartsOn?: 0 | 1;
|
|
80
|
+
/** 是否展示左侧迷你月历与多日历分组栏;默认在传入 `calendars` 时显示。 */
|
|
81
|
+
showSidebar?: boolean;
|
|
82
|
+
/** 月视图单日格子最多直接展示的日程数,超出折叠为「还有 N 项」,默认 `5`。 */
|
|
83
|
+
maxEventsPerDay?: number;
|
|
84
|
+
/** 顶栏左侧扩展插槽。 */
|
|
85
|
+
toolbarStart?: ReactNode;
|
|
86
|
+
/** 顶栏右侧扩展插槽。 */
|
|
87
|
+
toolbarEnd?: ReactNode;
|
|
88
|
+
/** 侧边栏底部扩展插槽。 */
|
|
89
|
+
sidebarFooter?: ReactNode;
|
|
90
|
+
/** 点击日程时的回调;若同时不提供 `renderEventPopover` 则仍展示内置玻璃详情卡。 */
|
|
91
|
+
onEventClick?: (event: ScheduleEvent) => void;
|
|
92
|
+
/** 自定义日程详情玻璃浮层内容,适合业务放入编辑、删除、入会等操作。 */
|
|
93
|
+
renderEventPopover?: (event: ScheduleEvent, helpers: {
|
|
94
|
+
close: () => void;
|
|
95
|
+
}) => ReactNode;
|
|
96
|
+
/** 点击空白日期格或时间轴小时格时的回调(可用于唤起新建日程弹窗)。 */
|
|
97
|
+
onSlotClick?: (slot: ScheduleSlotSelection) => void;
|
|
98
|
+
/** 传入后在顶栏右侧自动渲染「创建日程」蓝色主按钮。 */
|
|
99
|
+
onCreateClick?: () => void;
|
|
100
|
+
/** 整体高度(CSS 长度,如 `680px`),默认自适应且具备合理最小高度。 */
|
|
101
|
+
height?: number | string;
|
|
102
|
+
}
|
|
103
|
+
export declare function ScheduleCalendar({ events, calendars, view: controlledView, defaultView, onViewChange, date: controlledDate, defaultDate, onDateChange, today: configuredToday, nowMinutes: configuredNowMinutes, visibleCalendarIds: controlledVisibleIds, defaultVisibleCalendarIds, onVisibleCalendarsChange, weekStartsOn, showSidebar: configuredShowSidebar, maxEventsPerDay, toolbarStart, toolbarEnd, sidebarFooter, onEventClick, renderEventPopover, onSlotClick, onCreateClick, height, className, style, ...props }: ScheduleCalendarProps): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** 滚动边缘渐隐阴影容器:自动感知可滚动方向并施加平滑渐隐遮罩。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export interface ScrollShadowProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** 滚动方向。 */
|
|
5
|
+
orientation?: "vertical" | "horizontal";
|
|
6
|
+
/** 边缘渐隐阴影的像素宽度。 */
|
|
7
|
+
size?: number;
|
|
8
|
+
/** 触发阴影显隐的滚动阈值(像素)。 */
|
|
9
|
+
offset?: number;
|
|
10
|
+
/** 是否隐藏原生滚动条。 */
|
|
11
|
+
hideScrollBar?: boolean;
|
|
12
|
+
/** 是否开启阴影遮罩,默认开启。 */
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
children?: ReactNode;
|
|
15
|
+
}
|
|
16
|
+
export declare const ScrollShadow: ForwardRefExoticComponent<ScrollShadowProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type RefAttributes } from "react";
|
|
2
|
+
import { type InputProps } from "./input.js";
|
|
3
|
+
export type SearchFieldProps = Omit<InputProps, "type">;
|
|
4
|
+
/** An `Input` for searching: a magnifier icon, a "Search" placeholder and a clear button. */
|
|
5
|
+
export declare const SearchField: ForwardRefExoticComponent<SearchFieldProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** 页面垂直节奏区块(参考 Radix UI Section):以 4 档纵向留白组织页面段落。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
import { type LayoutSpaceProps } from "./internal/layout-style.js";
|
|
4
|
+
export type SectionSize = "1" | "2" | "3" | "4";
|
|
5
|
+
export interface SectionProps extends HTMLAttributes<HTMLElement>, LayoutSpaceProps {
|
|
6
|
+
/** 纵向内边距档位:`1`(24px) / `2`(40px) / `3`(64px) / `4`(80px),默认 `3`。 */
|
|
7
|
+
size?: SectionSize;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
}
|
|
10
|
+
export declare const Section: ForwardRefExoticComponent<SectionProps & RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
export interface SegmentedItem {
|
|
3
|
+
value: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
}
|
|
7
|
+
export interface SegmentedControlProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
8
|
+
items: SegmentedItem[];
|
|
9
|
+
value?: string;
|
|
10
|
+
defaultValue?: string;
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
}
|
|
13
|
+
/** A row of mutually exclusive choices, with a thumb that slides to the chosen one and lifts into a lens under a finger. */
|
|
14
|
+
export declare const SegmentedControl: ForwardRefExoticComponent<SegmentedControlProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ForwardRefExoticComponent, type ReactNode, type RefAttributes, type SelectHTMLAttributes } from "react";
|
|
2
|
+
export interface SelectOption {
|
|
3
|
+
/** 非空、唯一的值;空字符串保留给 placeholder。 */
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "defaultValue" | "onChange" | "children" | "type" | "onInvalid"> {
|
|
9
|
+
options: readonly SelectOption[];
|
|
10
|
+
value?: string;
|
|
11
|
+
defaultValue?: string;
|
|
12
|
+
onValueChange?: (value: string) => void;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
required?: boolean;
|
|
15
|
+
autoComplete?: string;
|
|
16
|
+
onInvalid?: SelectHTMLAttributes<HTMLSelectElement>["onInvalid"];
|
|
17
|
+
/** 业务校验错误,覆盖原生必填校验的行内提示。 */
|
|
18
|
+
error?: ReactNode;
|
|
19
|
+
}
|
|
20
|
+
export declare const Select: ForwardRefExoticComponent<SelectProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** 液态玻璃分割线:支持水平与垂直方向、渐隐边缘与居中说明标签。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export interface SeparatorProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** 分割线方向。 */
|
|
5
|
+
orientation?: "horizontal" | "vertical";
|
|
6
|
+
/** 可选中间文字标签,仅在水平方向显示。 */
|
|
7
|
+
label?: ReactNode;
|
|
8
|
+
/** 视觉变体:`solid` 为均匀细线,`fade` 在两端柔和渐隐。 */
|
|
9
|
+
variant?: "solid" | "fade";
|
|
10
|
+
/** 纯视觉装饰时设为 true,不向辅助技术暴露 separator 角色。 */
|
|
11
|
+
decorative?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const Separator: ForwardRefExoticComponent<SeparatorProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
export type SheetDetent = "medium" | "large";
|
|
3
|
+
export interface SheetProps {
|
|
4
|
+
open?: boolean;
|
|
5
|
+
defaultOpen?: boolean;
|
|
6
|
+
onOpenChange?: (open: boolean) => void;
|
|
7
|
+
/** The heights it rests at, smallest first. */
|
|
8
|
+
detents?: SheetDetent[];
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
"aria-label"?: string;
|
|
12
|
+
}
|
|
13
|
+
/** The iOS sheet: rises from the bottom, drags between its detents, and drags away. */
|
|
14
|
+
export declare function Sheet({ open: openProp, defaultOpen, onOpenChange, detents, children, className, "aria-label": label }: SheetProps): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { CSSProperties, HTMLAttributes, JSX } from "react";
|
|
2
|
+
export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
width?: CSSProperties["width"];
|
|
4
|
+
height?: CSSProperties["height"];
|
|
5
|
+
shape?: "text" | "circle" | "rounded";
|
|
6
|
+
animated?: boolean;
|
|
7
|
+
}
|
|
8
|
+
/** 仅提供视觉占位;在内容容器设置 aria-busy,并提供一条加载说明,避免逐条播报。 */
|
|
9
|
+
export declare function Skeleton({ width, height, shape, animated, className, style, ...props }: SkeletonProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type InputHTMLAttributes, type RefAttributes } from "react";
|
|
2
|
+
export interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step"> {
|
|
3
|
+
value?: number;
|
|
4
|
+
defaultValue?: number;
|
|
5
|
+
onValueChange?: (value: number) => void;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
}
|
|
10
|
+
export declare const Slider: ForwardRefExoticComponent<SliderProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 看板中的单个指标,业务计算、单位换算与格式化由调用方提供。 */
|
|
2
|
+
import type { JSX, ReactNode } from "react";
|
|
3
|
+
export interface StatisticProps {
|
|
4
|
+
title: ReactNode;
|
|
5
|
+
value: string | number;
|
|
6
|
+
formatter?: (value: string | number) => ReactNode;
|
|
7
|
+
prefix?: ReactNode;
|
|
8
|
+
suffix?: ReactNode;
|
|
9
|
+
description?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function Statistic({ title, value, formatter, prefix, suffix, description, }: StatisticProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
|
|
2
|
+
export interface StepperProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
3
|
+
value?: number;
|
|
4
|
+
defaultValue?: number;
|
|
5
|
+
onValueChange?: (value: number) => void;
|
|
6
|
+
min?: number;
|
|
7
|
+
max?: number;
|
|
8
|
+
step?: number;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Two buttons that step a number down and up. */
|
|
12
|
+
export declare const Stepper: ForwardRefExoticComponent<StepperProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** 液态玻璃步骤条(Steps):引导分步任务流程,支持水平/垂直方向、状态标记与点击跳转。 */
|
|
2
|
+
import type { HTMLAttributes, JSX, ReactNode } from "react";
|
|
3
|
+
export type StepStatus = "wait" | "process" | "finish" | "error";
|
|
4
|
+
export interface StepItem {
|
|
5
|
+
/** 唯一标识。 */
|
|
6
|
+
key: string;
|
|
7
|
+
/** 步骤主标题。 */
|
|
8
|
+
title: ReactNode;
|
|
9
|
+
/** 可选步骤说明。 */
|
|
10
|
+
description?: ReactNode;
|
|
11
|
+
/** 自定义图标(未传时已完成显示对勾、错误显示叹号、其余显示序号)。 */
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
/** 显式覆盖当前步状态;未传时根据 `current` 自动推导。 */
|
|
14
|
+
status?: StepStatus;
|
|
15
|
+
/** 禁止点击该步。 */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface StepsProps extends HTMLAttributes<HTMLOListElement> {
|
|
19
|
+
/** 步骤条目列表。 */
|
|
20
|
+
items: readonly StepItem[];
|
|
21
|
+
/** 当前所处步骤索引(从 0 开始)。 */
|
|
22
|
+
current?: number;
|
|
23
|
+
/** 排列方向。 */
|
|
24
|
+
direction?: "horizontal" | "vertical";
|
|
25
|
+
/** 尺寸规格。 */
|
|
26
|
+
size?: "small" | "regular";
|
|
27
|
+
/** 点击步骤时的回调;传入后步骤节点自动成为可点击按钮。 */
|
|
28
|
+
onStepClick?: (index: number, item: StepItem) => void;
|
|
29
|
+
}
|
|
30
|
+
export declare function Steps({ items, current, direction, size, onStepClick, className, ...props }: StepsProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|