@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,22 @@
|
|
|
1
|
+
/** 命令式液态玻璃确认弹窗(ConfirmProvider + useConfirm):以 Promise 形式唤起 Alert 确认,适合替代命令式确认模态框。 */
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface ConfirmOptions {
|
|
4
|
+
/** 弹窗标题。 */
|
|
5
|
+
title: ReactNode;
|
|
6
|
+
/** 可选正文说明。 */
|
|
7
|
+
message?: ReactNode;
|
|
8
|
+
/** 确认按钮文案,默认「确认」/「Confirm」。 */
|
|
9
|
+
confirmText?: ReactNode;
|
|
10
|
+
/** 取消按钮文案,默认读取 ConfigProvider `locale.cancel`。 */
|
|
11
|
+
cancelText?: ReactNode;
|
|
12
|
+
/** 是否标记为危险/不可逆操作(确认按钮显示红色)。 */
|
|
13
|
+
destructive?: boolean;
|
|
14
|
+
}
|
|
15
|
+
export type ConfirmFn = (options: ConfirmOptions) => Promise<boolean>;
|
|
16
|
+
export interface ConfirmProviderProps {
|
|
17
|
+
children: ReactNode;
|
|
18
|
+
}
|
|
19
|
+
/** 在应用根部或局部区域挂载 ConfirmProvider,即可在任意子组件通过 useConfirm() 命令式发起确认。 */
|
|
20
|
+
export declare function ConfirmProvider({ children, }: ConfirmProviderProps): JSX.Element;
|
|
21
|
+
/** 获取命令式确认函数;需在 ConfirmProvider 内使用。 */
|
|
22
|
+
export declare function useConfirm(): ConfirmFn;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** 定宽内容容器(参考 Radix UI Container):提供 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 ContainerSize = "1" | "2" | "3" | "4";
|
|
5
|
+
export interface ContainerProps extends HTMLAttributes<HTMLDivElement>, LayoutSpaceProps {
|
|
6
|
+
/** 容器最大宽度档位:`1`(448px) / `2`(688px) / `3`(880px) / `4`(1136px),默认 `4`。 */
|
|
7
|
+
size?: ContainerSize;
|
|
8
|
+
/** 容器水平对齐方式,默认居中。 */
|
|
9
|
+
align?: "left" | "center" | "right";
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Container: ForwardRefExoticComponent<ContainerProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
import type { MenuEntry } from "./menu.js";
|
|
3
|
+
export interface ContextMenuProps {
|
|
4
|
+
items: MenuEntry[];
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
/** The element to hold down, or right-click. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
"aria-label"?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Holding the element down, or right-clicking it, lifts a copy of it over a dimmed
|
|
15
|
+
* page and opens a menu beside it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ContextMenu({ items, open: openProp, defaultOpen, onOpenChange, children, className, "aria-label": label }: ContextMenuProps): JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** 管理列表组合,支持可控排序、跨页选择、列显隐和服务端分页,不负责请求数据。 */
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
import { type PaginationProps } from "./pagination.js";
|
|
4
|
+
import { type TableColumn, type TableProps } from "./table.js";
|
|
5
|
+
export interface DataTableColumn<T> extends TableColumn<T> {
|
|
6
|
+
/** 提供比较器可在本页排序,manualSorting 时只发送排序事件。 */
|
|
7
|
+
compare?: (left: T, right: T) => number;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TableSort {
|
|
11
|
+
key: string;
|
|
12
|
+
direction: "asc" | "desc";
|
|
13
|
+
}
|
|
14
|
+
export interface RowSelection {
|
|
15
|
+
keys: readonly string[];
|
|
16
|
+
onChange: (keys: string[]) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface DataTableProps<T> extends Omit<TableProps<T>, "columns"> {
|
|
19
|
+
columns: readonly DataTableColumn<T>[];
|
|
20
|
+
sort?: TableSort | null;
|
|
21
|
+
defaultSort?: TableSort | null;
|
|
22
|
+
onSortChange?: (sort: TableSort | null) => void;
|
|
23
|
+
manualSorting?: boolean;
|
|
24
|
+
selection?: RowSelection;
|
|
25
|
+
pagination?: PaginationProps;
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
error?: string;
|
|
28
|
+
onRetry?: () => void;
|
|
29
|
+
toolbar?: ReactNode;
|
|
30
|
+
bulkActions?: (keys: readonly string[]) => ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare function DataTable<T>({ columns, data, rowKey, sort, defaultSort, onSortChange, manualSorting, selection, pagination, loading, error, onRetry, toolbar, bulkActions, ...tableProps }: DataTableProps<T>): JSX.Element;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/** 液态玻璃分段日期输入框:年/月/日独立可聚焦段,支持键盘直输数字、方向键调节与表单提交。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface DateFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
|
|
4
|
+
/** 受控日期字符串(`YYYY-MM-DD`)。 */
|
|
5
|
+
value?: string;
|
|
6
|
+
/** 非受控初始日期字符串。 */
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
/** 日期完整有效或清空时回调。 */
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
/** 原生表单字段名。 */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** 最小日期(`YYYY-MM-DD`)。 */
|
|
13
|
+
min?: string;
|
|
14
|
+
/** 最大日期(`YYYY-MM-DD`)。 */
|
|
15
|
+
max?: string;
|
|
16
|
+
/** 禁用输入。 */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** 只读态。 */
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
/** 错误提示文案。 */
|
|
21
|
+
error?: ReactNode;
|
|
22
|
+
/** 尺寸规格。 */
|
|
23
|
+
size?: "small" | "regular" | "large";
|
|
24
|
+
}
|
|
25
|
+
export declare function DateField({ value: controlledValue, defaultValue, onValueChange, name, min, max, disabled, readOnly, error, size: configuredSize, className, "aria-label": ariaLabel, ...props }: DateFieldProps): JSX.Element;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** 液态玻璃单日期选择器:融合玻璃触发框、一键清除与日历浮层,始终以 YYYY-MM-DD 字符串传递业务值。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface DatePickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
|
|
4
|
+
/** 受控日期值(`YYYY-MM-DD`)。 */
|
|
5
|
+
value?: string;
|
|
6
|
+
/** 非受控初始日期值。 */
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
/** 选中日期变化回调。 */
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
/** 原生表单字段名。 */
|
|
11
|
+
name?: string;
|
|
12
|
+
/** 最小可选日期。 */
|
|
13
|
+
min?: string;
|
|
14
|
+
/** 最大可选日期。 */
|
|
15
|
+
max?: string;
|
|
16
|
+
/** 稳定今天日期(用于 SSR 或测试)。 */
|
|
17
|
+
today?: string;
|
|
18
|
+
/** 未选日期时的占位文案。 */
|
|
19
|
+
placeholder?: string;
|
|
20
|
+
/** 是否显示清除按钮。 */
|
|
21
|
+
clearable?: boolean;
|
|
22
|
+
/** 禁用交互。 */
|
|
23
|
+
disabled?: boolean;
|
|
24
|
+
/** 必填约束。 */
|
|
25
|
+
required?: boolean;
|
|
26
|
+
/** 校验错误提示。 */
|
|
27
|
+
error?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare function DatePicker({ value: controlledValue, defaultValue, onValueChange, name, min, max, today, placeholder, clearable, disabled, required, error, className, "aria-label": ariaLabel, ...props }: DatePickerProps): JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** 日期范围选择:统一玻璃触发框与日历浮层,业务值始终是日期字符串。 */
|
|
2
|
+
import { type JSX } from "react";
|
|
3
|
+
export interface DateRange {
|
|
4
|
+
start: string;
|
|
5
|
+
end: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DateRangePickerProps {
|
|
8
|
+
value?: DateRange;
|
|
9
|
+
defaultValue?: DateRange;
|
|
10
|
+
onValueChange?: (value: DateRange) => void;
|
|
11
|
+
names?: {
|
|
12
|
+
start: string;
|
|
13
|
+
end: string;
|
|
14
|
+
};
|
|
15
|
+
min?: string;
|
|
16
|
+
max?: string;
|
|
17
|
+
/** 由业务按所用时区提供今天,截图或服务端渲染时可传入稳定值。 */
|
|
18
|
+
today?: string;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
"aria-label"?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function DateRangePicker({ value, defaultValue, onValueChange, names, min, max, today, required, disabled, "aria-label": label, }: DateRangePickerProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/** 表单与字段辅助说明文本:保持低干扰层次,支持通过 id 与 aria-describedby 关联。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export interface DescriptionProps extends HTMLAttributes<HTMLParagraphElement> {
|
|
4
|
+
/** 禁用态视觉降权。 */
|
|
5
|
+
disabled?: boolean;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare const Description: ForwardRefExoticComponent<DescriptionProps & RefAttributes<HTMLParagraphElement>>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** 详情页的只读字段展示,使用 dl/dt/dd 保持标签和值的语义。 */
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface DescriptionItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface DescriptionsProps {
|
|
9
|
+
items: readonly DescriptionItem[];
|
|
10
|
+
columns?: 1 | 2 | 3;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function Descriptions({ items, columns, className, }: DescriptionsProps): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** 通用模态内容容器,用于详情、表单与确认流程;原生 dialog 管理焦点与嵌套层级。 */
|
|
2
|
+
import { type JSX, type ReactNode, type RefObject } from "react";
|
|
3
|
+
export interface DialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
footer?: ReactNode;
|
|
10
|
+
size?: "small" | "regular" | "large";
|
|
11
|
+
/** 异步提交期间可禁用关闭,退出动画仍由受控 open 驱动。 */
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
/** 内容进入模态层后聚焦的控件,省略时聚焦容器。 */
|
|
14
|
+
initialFocusRef?: RefObject<HTMLElement | null>;
|
|
15
|
+
/** 关闭后返回的触发控件,受控弹窗应提供,以兼容 Safari 的鼠标焦点行为。 */
|
|
16
|
+
returnFocusRef?: RefObject<HTMLElement | null>;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function Dialog({ open, onOpenChange, title, description, children, footer, size, dismissible, initialFocusRef, returnFocusRef, className, }: DialogProps): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** 分组折叠控制器:协调多个 Disclosure 的展开状态,支持单展与多展模式。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface DisclosureGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** 是否允许同时展开多个子项,默认仅展开一项。 */
|
|
5
|
+
allowsMultiple?: boolean;
|
|
6
|
+
/** 受控展开项键集合。 */
|
|
7
|
+
expandedKeys?: readonly string[];
|
|
8
|
+
/** 非受控初始展开项键集合。 */
|
|
9
|
+
defaultExpandedKeys?: readonly string[];
|
|
10
|
+
/** 展开项变化回调。 */
|
|
11
|
+
onExpandedChange?: (keys: string[]) => void;
|
|
12
|
+
/** 统一禁用组内所有折叠项。 */
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
/** 统一子项表面风格。 */
|
|
15
|
+
variant?: "glass" | "surface" | "ghost";
|
|
16
|
+
children?: ReactNode;
|
|
17
|
+
}
|
|
18
|
+
export declare function DisclosureGroup({ allowsMultiple, expandedKeys: controlledKeys, defaultExpandedKeys, onExpandedChange, disabled, variant, className, children, ...props }: DisclosureGroupProps): JSX.Element;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/** 液态玻璃折叠展开容器:点击标题或图标平滑展开内容,可独立使用或放入 DisclosureGroup。 */
|
|
2
|
+
import { type Context, type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface DisclosureGroupContextValue {
|
|
4
|
+
isExpanded: (id: string) => boolean;
|
|
5
|
+
toggle: (id: string) => void;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
variant?: "glass" | "surface" | "ghost";
|
|
8
|
+
}
|
|
9
|
+
export declare const DisclosureGroupContext: Context<DisclosureGroupContextValue | null>;
|
|
10
|
+
export interface DisclosureProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
11
|
+
/** 在 DisclosureGroup 中使用的唯一键。 */
|
|
12
|
+
itemKey?: string;
|
|
13
|
+
/** 折叠触发区主标题。 */
|
|
14
|
+
title: ReactNode;
|
|
15
|
+
/** 可选副标题或状态摘要。 */
|
|
16
|
+
description?: ReactNode;
|
|
17
|
+
/** 可选前置图标。 */
|
|
18
|
+
icon?: ReactNode;
|
|
19
|
+
/** 受控展开状态。 */
|
|
20
|
+
open?: boolean;
|
|
21
|
+
/** 非受控初始展开状态。 */
|
|
22
|
+
defaultOpen?: boolean;
|
|
23
|
+
/** 展开状态变化回调。 */
|
|
24
|
+
onOpenChange?: (open: boolean) => void;
|
|
25
|
+
/** 禁用交互。 */
|
|
26
|
+
disabled?: boolean;
|
|
27
|
+
/** 表面变体。 */
|
|
28
|
+
variant?: "glass" | "surface" | "ghost";
|
|
29
|
+
children?: ReactNode;
|
|
30
|
+
}
|
|
31
|
+
export declare function Disclosure({ itemKey, title, description, icon, open: controlledOpen, defaultOpen, onOpenChange, disabled: configuredDisabled, variant: configuredVariant, className, children, ...props }: DisclosureProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** 桌面侧边面板,共用 Dialog 的焦点、关闭与异步操作约束。 */
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
import { type DialogProps } from "./dialog.js";
|
|
4
|
+
export interface DrawerProps extends DialogProps {
|
|
5
|
+
side?: "start" | "end";
|
|
6
|
+
}
|
|
7
|
+
export declare function Drawer({ side, className, ...props }: DrawerProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes, JSX, ReactNode } from "react";
|
|
2
|
+
export interface EmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
title?: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function Empty({ title, description, icon, children, className, ...props }: EmptyProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** 独立字段校验错误提示:支持直接传入错误内容,或通过 `name` 自动读取所属 Form 的校验错误。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export interface FieldErrorProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** 可选字段名;未传 `children` 时自动从上层 `Form` 的 `validationErrors[name]` 读取。 */
|
|
5
|
+
name?: string;
|
|
6
|
+
/** 错误信息,支持单条节点或字符串数组。 */
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare const FieldError: ForwardRefExoticComponent<FieldErrorProps & RefAttributes<HTMLDivElement>>;
|
|
10
|
+
/** 与 HeroUI ErrorMessage 对齐的语义别名,行为与 FieldError 完全一致。 */
|
|
11
|
+
export type ErrorMessageProps = FieldErrorProps;
|
|
12
|
+
export declare const ErrorMessage: ForwardRefExoticComponent<ErrorMessageProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** 语义化表单分组域:封装原生 fieldset 与 legend,支持分组说明、禁用继承与玻璃表面。 */
|
|
2
|
+
import { type FieldsetHTMLAttributes, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export interface FieldsetProps extends FieldsetHTMLAttributes<HTMLFieldSetElement> {
|
|
4
|
+
/** 分组标题,渲染为原生 `<legend>`。 */
|
|
5
|
+
legend?: ReactNode;
|
|
6
|
+
/** 分组说明文案。 */
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
/** 容器外观:`plain` 仅排版,`surface` 实底卡片,`glass` 液态玻璃卡片。 */
|
|
9
|
+
variant?: "plain" | "surface" | "glass";
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Fieldset: ForwardRefExoticComponent<FieldsetProps & RefAttributes<HTMLFieldSetElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 列表筛选操作区,由页面持有查询条件并处理提交和重置。 */
|
|
2
|
+
import type { FormHTMLAttributes, JSX, ReactNode } from "react";
|
|
3
|
+
export interface FilterBarProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onClear?: () => void;
|
|
6
|
+
clearLabel?: string;
|
|
7
|
+
actions?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function FilterBar({ children, onClear, clearLabel, actions, className, ...props }: FilterBarProps): JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** 弹性布局原语(参考 Radix UI Flex),同时导出 Stack(纵向)与 Center(居中)语义快捷封装。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
import type { BoxElement } from "./box.js";
|
|
4
|
+
import { type LayoutAlign, type LayoutJustify, type LayoutSpaceProps, type SpaceScale } from "./internal/layout-style.js";
|
|
5
|
+
export interface FlexProps extends HTMLAttributes<HTMLElement>, LayoutSpaceProps {
|
|
6
|
+
/** 渲染的语义标签,默认 `div`。 */
|
|
7
|
+
as?: BoxElement;
|
|
8
|
+
/** 是否使用 `inline-flex`。 */
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
/** 主轴方向。 */
|
|
11
|
+
direction?: "row" | "column" | "row-reverse" | "column-reverse";
|
|
12
|
+
/** 交叉轴对齐方式。 */
|
|
13
|
+
align?: LayoutAlign;
|
|
14
|
+
/** 主轴对齐方式。 */
|
|
15
|
+
justify?: LayoutJustify;
|
|
16
|
+
/** 换行策略。 */
|
|
17
|
+
wrap?: "nowrap" | "wrap" | "wrap-reverse";
|
|
18
|
+
/** 统一子项间距(支持 0–9 阶梯或任意 CSS 长度)。 */
|
|
19
|
+
gap?: SpaceScale;
|
|
20
|
+
/** 水平列间距。 */
|
|
21
|
+
gapX?: SpaceScale;
|
|
22
|
+
/** 垂直行间距。 */
|
|
23
|
+
gapY?: SpaceScale;
|
|
24
|
+
children?: ReactNode;
|
|
25
|
+
}
|
|
26
|
+
export declare const Flex: ForwardRefExoticComponent<FlexProps & RefAttributes<HTMLElement>>;
|
|
27
|
+
export type StackProps = Omit<FlexProps, "direction">;
|
|
28
|
+
/** 纵向堆叠布局(Flex direction="column" 的语义封装,便于对齐 Mantine Stack)。 */
|
|
29
|
+
export declare const Stack: ForwardRefExoticComponent<StackProps & RefAttributes<HTMLElement>>;
|
|
30
|
+
export type CenterProps = Omit<FlexProps, "align" | "justify">;
|
|
31
|
+
/** 水平与垂直居中容器(便于对齐 Mantine Center)。 */
|
|
32
|
+
export declare const Center: ForwardRefExoticComponent<CenterProps & RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** 表单项布局与可访问性关联,可接入原生表单或任意表单状态库。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface FieldControlProps {
|
|
4
|
+
id: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
"aria-describedby"?: string;
|
|
8
|
+
"aria-invalid"?: true;
|
|
9
|
+
}
|
|
10
|
+
export interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
11
|
+
id?: string;
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
error?: ReactNode;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
children: (props: FieldControlProps) => ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function FormField({ id, label, description, error, required, disabled, children, className, ...props }: FormFieldProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/** 表单容器:封装原生 `<form>`,支持统一下发字段校验错误映射与布局间距控制。 */
|
|
2
|
+
import { type FormHTMLAttributes, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
import { type FormValidationErrors } from "./internal/form-context.js";
|
|
4
|
+
export type { FormValidationErrors };
|
|
5
|
+
export interface FormProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
6
|
+
/** 按字段 `name` 映射的校验错误信息,自动提供给内部 `FieldError` / `ErrorMessage`。 */
|
|
7
|
+
validationErrors?: FormValidationErrors;
|
|
8
|
+
/** 字段间距规格。 */
|
|
9
|
+
gap?: "small" | "regular" | "large";
|
|
10
|
+
children?: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare const Form: ForwardRefExoticComponent<FormProps & RefAttributes<HTMLFormElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
|
|
2
|
+
export interface GlassGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Glass closer together than this flows into one shape, in points. */
|
|
4
|
+
spacing?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The glass inside share one surface, as in an iOS `GlassEffectContainer`: pieces
|
|
8
|
+
* that come close flow together, and part again as they move away.
|
|
9
|
+
*/
|
|
10
|
+
export declare const GlassGroup: ForwardRefExoticComponent<GlassGroupProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/** 网格布局原语(参考 Radix UI Grid):支持数字等分列、模板字符串、自动流向与间距阶梯。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
import type { BoxElement } from "./box.js";
|
|
4
|
+
import { type LayoutAlign, type LayoutJustify, type LayoutSpaceProps, type SpaceScale } from "./internal/layout-style.js";
|
|
5
|
+
export interface GridProps extends HTMLAttributes<HTMLElement>, LayoutSpaceProps {
|
|
6
|
+
/** 渲染的语义标签,默认 `div`。 */
|
|
7
|
+
as?: BoxElement;
|
|
8
|
+
/** 是否使用 `inline-grid`。 */
|
|
9
|
+
inline?: boolean;
|
|
10
|
+
/** 列定义:传入正整数自动转为 `repeat(N, minmax(0, 1fr))`,也可传自定义 CSS `grid-template-columns`。 */
|
|
11
|
+
columns?: number | string;
|
|
12
|
+
/** 行定义:传入正整数自动转为 `repeat(N, minmax(0, 1fr))`,也可传自定义 CSS `grid-template-rows`。 */
|
|
13
|
+
rows?: number | string;
|
|
14
|
+
/** 网格区域模板(`grid-template-areas`)。 */
|
|
15
|
+
areas?: string;
|
|
16
|
+
/** 网格自动排列方向。 */
|
|
17
|
+
flow?: "row" | "column" | "dense" | "row-dense" | "column-dense";
|
|
18
|
+
/** 单元格垂直对齐。 */
|
|
19
|
+
align?: LayoutAlign;
|
|
20
|
+
/** 网格主轴对齐。 */
|
|
21
|
+
justify?: LayoutJustify;
|
|
22
|
+
/** 统一网格间距(支持 0–9 阶梯或任意 CSS 长度)。 */
|
|
23
|
+
gap?: SpaceScale;
|
|
24
|
+
/** 列间距。 */
|
|
25
|
+
gapX?: SpaceScale;
|
|
26
|
+
/** 行间距。 */
|
|
27
|
+
gapY?: SpaceScale;
|
|
28
|
+
children?: ReactNode;
|
|
29
|
+
}
|
|
30
|
+
export declare const Grid: ForwardRefExoticComponent<GridProps & RefAttributes<HTMLElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 文件导入流程。解析和发布由回调提供,状态分支保留当前文件与预览。 */
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface ImportWizardProps<T> {
|
|
4
|
+
inspect: (files: readonly File[], signal: AbortSignal) => Promise<T>;
|
|
5
|
+
publish: (preview: T, signal: AbortSignal) => Promise<void>;
|
|
6
|
+
renderPreview: (preview: T) => ReactNode;
|
|
7
|
+
accept?: string;
|
|
8
|
+
maxBytes?: number;
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function ImportWizard<T>({ inspect, publish, renderPreview, accept, maxBytes, title, }: ImportWizardProps<T>): JSX.Element;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import "./style-entry.js";
|
|
2
|
+
export { Alert, type AlertAction, type AlertProps } from "./alert.js";
|
|
3
|
+
export { Button, type ButtonProps } from "./button.js";
|
|
4
|
+
export { Glass, type GlassProps } from "./glass.js";
|
|
5
|
+
export { ContextMenu, type ContextMenuProps } from "./context-menu.js";
|
|
6
|
+
export { GlassGroup, type GlassGroupProps } from "./glass-group.js";
|
|
7
|
+
export { Input, type InputProps } from "./input.js";
|
|
8
|
+
export { Menu, type MenuEntry, type MenuItem, type MenuProps } from "./menu.js";
|
|
9
|
+
export { Message, type MessageProps } from "./message.js";
|
|
10
|
+
export { NavigationBar, type NavigationBarProps } from "./navigation-bar.js";
|
|
11
|
+
export { PageControl, type PageControlProps } from "./page-control.js";
|
|
12
|
+
export { Progress, Spinner, type ProgressProps, type SpinnerProps, } from "./progress.js";
|
|
13
|
+
export { SearchField, type SearchFieldProps } from "./search-field.js";
|
|
14
|
+
export { SegmentedControl, type SegmentedControlProps, type SegmentedItem, } from "./segmented-control.js";
|
|
15
|
+
export { Sheet, type SheetDetent, type SheetProps } from "./sheet.js";
|
|
16
|
+
export { Slider, type SliderProps } from "./slider.js";
|
|
17
|
+
export { Stepper, type StepperProps } from "./stepper.js";
|
|
18
|
+
export { Switch, type SwitchProps } from "./switch.js";
|
|
19
|
+
export { TabBar, type TabBarItem, type TabBarProps } from "./tab-bar.js";
|
|
20
|
+
export { Toolbar, ToolbarGroup, type ToolbarGroupProps, type ToolbarProps, } from "./toolbar.js";
|
|
21
|
+
export { Checkbox, type CheckboxProps } from "./checkbox.js";
|
|
22
|
+
export { Radio, type RadioProps } from "./radio.js";
|
|
23
|
+
export { Select, type SelectOption, type SelectProps } from "./select.js";
|
|
24
|
+
export { TextArea, type TextAreaProps } from "./text-area.js";
|
|
25
|
+
export { Card, type CardProps } from "./card.js";
|
|
26
|
+
export { Tooltip, type TooltipProps } from "./tooltip.js";
|
|
27
|
+
export { Popover, type PopoverProps } from "./popover.js";
|
|
28
|
+
export { Toast, ToastProvider, useToast, type ToastProps, type ToastOptions, type ToastProviderProps, type ToastApi, } from "./toast.js";
|
|
29
|
+
export { Tag, type TagProps, type TagTone } from "./tag.js";
|
|
30
|
+
export { Mention, MentionGroup, type MentionProps, type MentionGroupProps, type MentionGroupItem, type MentionSize, type MentionTone, } from "./mention.js";
|
|
31
|
+
export { Badge, type BadgeProps } from "./badge.js";
|
|
32
|
+
export { Avatar, type AvatarProps } from "./avatar.js";
|
|
33
|
+
export { Empty, type EmptyProps } from "./empty.js";
|
|
34
|
+
export { Skeleton, type SkeletonProps } from "./skeleton.js";
|
|
35
|
+
export { ConfigProvider, useConfig, zhCN, enUS, type Locale, type ConfigProviderProps, type LiquidGlassConfig, } from "./config-provider.js";
|
|
36
|
+
export { Typography, type TypographyProps } from "./typography.js";
|
|
37
|
+
export { FormField, type FormFieldProps, type FieldControlProps, } from "./form-field.js";
|
|
38
|
+
export { Dialog, type DialogProps } from "./dialog.js";
|
|
39
|
+
export { Tabs, type TabsProps, type TabItem } from "./tabs.js";
|
|
40
|
+
export { Table, type TableProps, type TableColumn } from "./table.js";
|
|
41
|
+
export { Pagination, type PaginationProps } from "./pagination.js";
|
|
42
|
+
export { DateRangePicker, type DateRangePickerProps, type DateRange, } from "./date-range-picker.js";
|
|
43
|
+
export { DataTable, type DataTableProps, type DataTableColumn, type TableSort, type RowSelection, } from "./data-table.js";
|
|
44
|
+
export { FilterBar, type FilterBarProps } from "./filter-bar.js";
|
|
45
|
+
export { MultiSelect, type MultiSelectProps, type MultiSelectOption, } from "./multi-select.js";
|
|
46
|
+
export { Upload, type UploadProps } from "./upload.js";
|
|
47
|
+
export { Drawer, type DrawerProps } from "./drawer.js";
|
|
48
|
+
export { Tree, type TreeProps, type TreeNode } from "./tree.js";
|
|
49
|
+
export { Descriptions, type DescriptionsProps, type DescriptionItem, } from "./descriptions.js";
|
|
50
|
+
export { Statistic, type StatisticProps } from "./statistic.js";
|
|
51
|
+
export { MemberPicker, type MemberPickerProps, type MemberOption, } from "./member-picker.js";
|
|
52
|
+
export { ImportWizard, type ImportWizardProps } from "./import-wizard.js";
|
|
53
|
+
export { ActivityCalendar, type ActivityCalendarProps, type ActivityDay, } from "./activity-calendar.js";
|
|
54
|
+
export { CommandPalette, type CommandPaletteProps, type PaletteCommand, } from "./command-palette.js";
|
|
55
|
+
export { Surface, type SurfaceProps, type SurfaceVariant, type SurfacePadding, type SurfaceRadius, } from "./surface.js";
|
|
56
|
+
export { Separator, type SeparatorProps } from "./separator.js";
|
|
57
|
+
export { Link, type LinkProps, type LinkTone, type LinkUnderline, } from "./link.js";
|
|
58
|
+
export { Kbd, type KbdProps, type KbdKey } from "./kbd.js";
|
|
59
|
+
export { CloseButton, type CloseButtonProps } from "./close-button.js";
|
|
60
|
+
export { ScrollShadow, type ScrollShadowProps } from "./scroll-shadow.js";
|
|
61
|
+
export { ButtonGroup, type ButtonGroupProps } from "./button-group.js";
|
|
62
|
+
export { ToggleButton, type ToggleButtonProps } from "./toggle-button.js";
|
|
63
|
+
export { ToggleButtonGroup, type ToggleButtonGroupProps, } from "./toggle-button-group.js";
|
|
64
|
+
export { AvatarGroup, type AvatarGroupProps } from "./avatar-group.js";
|
|
65
|
+
export { Breadcrumbs, type BreadcrumbsProps, type BreadcrumbItem, } from "./breadcrumbs.js";
|
|
66
|
+
export { TagGroup, type TagGroupProps, type TagGroupItem, } from "./tag-group.js";
|
|
67
|
+
export { Meter, type MeterProps, type MeterTone } from "./meter.js";
|
|
68
|
+
export { ProgressCircle, type ProgressCircleProps, type ProgressCircleTone, } from "./progress-circle.js";
|
|
69
|
+
export { Disclosure, type DisclosureProps } from "./disclosure.js";
|
|
70
|
+
export { DisclosureGroup, type DisclosureGroupProps, } from "./disclosure-group.js";
|
|
71
|
+
export { Accordion, type AccordionProps, type AccordionItem, } from "./accordion.js";
|
|
72
|
+
export { ListBox, type ListBoxProps, type ListBoxItem } from "./list-box.js";
|
|
73
|
+
export { Label, type LabelProps } from "./label.js";
|
|
74
|
+
export { Description, type DescriptionProps } from "./description.js";
|
|
75
|
+
export { FieldError, ErrorMessage, type FieldErrorProps, type ErrorMessageProps, } from "./field-error.js";
|
|
76
|
+
export { Fieldset, type FieldsetProps } from "./fieldset.js";
|
|
77
|
+
export { Form, type FormProps, type FormValidationErrors, } from "./form.js";
|
|
78
|
+
export { CheckboxGroup, type CheckboxGroupProps, type CheckboxGroupOption, } from "./checkbox-group.js";
|
|
79
|
+
export { RadioGroup, type RadioGroupProps, type RadioGroupOption, } from "./radio-group.js";
|
|
80
|
+
export { InputGroup, type InputGroupProps } from "./input-group.js";
|
|
81
|
+
export { NumberField, type NumberFieldProps } from "./number-field.js";
|
|
82
|
+
export { InputOTP, type InputOTPProps } from "./input-otp.js";
|
|
83
|
+
export { ComboBox, type ComboBoxProps, type ComboBoxOption, } from "./combo-box.js";
|
|
84
|
+
export { Autocomplete, type AutocompleteProps, type AutocompleteOption, } from "./autocomplete.js";
|
|
85
|
+
export { Calendar, type CalendarProps } from "./calendar.js";
|
|
86
|
+
export { RangeCalendar, type RangeCalendarProps } from "./range-calendar.js";
|
|
87
|
+
export { DateField, type DateFieldProps } from "./date-field.js";
|
|
88
|
+
export { DatePicker, type DatePickerProps } from "./date-picker.js";
|
|
89
|
+
export { TimeField, type TimeFieldProps } from "./time-field.js";
|
|
90
|
+
export { ColorSwatch, type ColorSwatchProps } from "./color-swatch.js";
|
|
91
|
+
export { ColorSwatchPicker, type ColorSwatchPickerProps, type ColorSwatchOption, } from "./color-swatch-picker.js";
|
|
92
|
+
export { ColorArea, type ColorAreaProps } from "./color-area.js";
|
|
93
|
+
export { ColorSlider, type ColorSliderProps, type ColorChannel, } from "./color-slider.js";
|
|
94
|
+
export { ColorField, type ColorFieldProps } from "./color-field.js";
|
|
95
|
+
export { ColorPicker, type ColorPickerProps } from "./color-picker.js";
|
|
96
|
+
export { ScheduleCalendar, type ScheduleCalendarProps, type ScheduleCalendarSource, type ScheduleCalendarView, type ScheduleEvent, type ScheduleEventStatus, type ScheduleSlotSelection, } from "./schedule-calendar.js";
|
|
97
|
+
export { Box, type BoxProps, type BoxElement } from "./box.js";
|
|
98
|
+
export { Flex, Stack, Center, type FlexProps, type StackProps, type CenterProps, } from "./flex.js";
|
|
99
|
+
export { Grid, type GridProps } from "./grid.js";
|
|
100
|
+
export { Container, type ContainerProps, type ContainerSize, } from "./container.js";
|
|
101
|
+
export { Section, type SectionProps, type SectionSize } from "./section.js";
|
|
102
|
+
export { AspectRatio, type AspectRatioProps } from "./aspect-ratio.js";
|
|
103
|
+
export { LoadingOverlay, type LoadingOverlayProps, } from "./loading-overlay.js";
|
|
104
|
+
export { Steps, type StepsProps, type StepItem, type StepStatus, } from "./steps.js";
|
|
105
|
+
export { TagsInput, type TagsInputProps } from "./tags-input.js";
|
|
106
|
+
export { ConfirmProvider, useConfirm, type ConfirmProviderProps, type ConfirmOptions, type ConfirmFn, } from "./confirm.js";
|
|
107
|
+
export type { SpaceScale, LayoutAlign, LayoutJustify, LayoutSpaceProps, } from "./internal/layout-style.js";
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** 液态玻璃输入框组合容器:为文本输入附加前缀、后缀图标、固定文本段或尾缀操作按钮。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export interface InputGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "prefix"> {
|
|
4
|
+
/** 内部前置图标或符号(无分割线)。 */
|
|
5
|
+
prefix?: ReactNode;
|
|
6
|
+
/** 内部后置图标、单位或动作按钮(无分割线)。 */
|
|
7
|
+
suffix?: ReactNode;
|
|
8
|
+
/** 左侧附加段(如 `https://`),与输入区以细分割线隔开。 */
|
|
9
|
+
addonBefore?: ReactNode;
|
|
10
|
+
/** 右侧附加段(如 `.lecspace.top` 或按钮),与输入区以细分割线隔开。 */
|
|
11
|
+
addonAfter?: ReactNode;
|
|
12
|
+
/** 表面变体:`glass` 玻璃质感,`filled` 柔和填充底色。 */
|
|
13
|
+
variant?: "glass" | "filled";
|
|
14
|
+
/** 尺寸规格。 */
|
|
15
|
+
size?: "small" | "regular" | "large";
|
|
16
|
+
/** 校验错误高亮态。 */
|
|
17
|
+
invalid?: boolean;
|
|
18
|
+
/** 禁用态。 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
children?: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare const InputGroup: ForwardRefExoticComponent<InputGroupProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** 液态玻璃验证码 / 一次性密码分格输入:支持自动跳格、退格回退、整串粘贴与分组分隔。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX } from "react";
|
|
3
|
+
export interface InputOTPProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
|
|
4
|
+
/** 验证码格数,默认 6。 */
|
|
5
|
+
length?: number;
|
|
6
|
+
/** 受控字符串值。 */
|
|
7
|
+
value?: string;
|
|
8
|
+
/** 非受控初始值。 */
|
|
9
|
+
defaultValue?: string;
|
|
10
|
+
/** 值变化回调。 */
|
|
11
|
+
onValueChange?: (value: string) => void;
|
|
12
|
+
/** 全部格数输入完成时触发。 */
|
|
13
|
+
onComplete?: (value: string) => void;
|
|
14
|
+
/** 允许字符的正则(按单字符过滤),默认仅允许数字 `[0-9]`。 */
|
|
15
|
+
pattern?: RegExp;
|
|
16
|
+
/** 每隔多少格插入视觉分隔符(如 3 格一组)。 */
|
|
17
|
+
groupSize?: number;
|
|
18
|
+
/** 是否掩码显示输入字符。 */
|
|
19
|
+
mask?: boolean;
|
|
20
|
+
/** 尺寸规格。 */
|
|
21
|
+
size?: "small" | "regular" | "large";
|
|
22
|
+
/** 原生表单字段名。 */
|
|
23
|
+
name?: string;
|
|
24
|
+
/** 禁用输入。 */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** 错误高亮态。 */
|
|
27
|
+
invalid?: boolean;
|
|
28
|
+
}
|
|
29
|
+
export declare function InputOTP({ length, value: controlledValue, defaultValue, onValueChange, onComplete, pattern, groupSize, mask, size, name, disabled, invalid, className, "aria-label": ariaLabel, ...props }: InputOTPProps): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type InputHTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
/** Shown before the text, such as a person or envelope glyph. */
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/** `glass` floats over content; `fill` is the plain field iOS puts under a large title. */
|
|
9
|
+
variant?: "glass" | "fill";
|
|
10
|
+
/** Show an eye toggle button when `type="password"`. Defaults to `true`. */
|
|
11
|
+
passwordToggle?: boolean;
|
|
12
|
+
}
|
|
13
|
+
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|