@lec-space/liquidglass 1.0.0 → 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.
Files changed (71) hide show
  1. package/README.md +5 -3
  2. package/dist/button-DSXdLDuQ.js +1051 -0
  3. package/dist/button-EFLg6M7I.cjs +1 -0
  4. package/dist/index.cjs +2 -2
  5. package/dist/index.js +5798 -1307
  6. package/dist/styles.css +3300 -3
  7. package/dist/types/accordion.d.ts +33 -0
  8. package/dist/types/aspect-ratio.d.ts +10 -0
  9. package/dist/types/autocomplete.d.ts +41 -0
  10. package/dist/types/avatar-group.d.ts +16 -0
  11. package/dist/types/box.d.ts +12 -0
  12. package/dist/types/breadcrumbs.d.ts +31 -0
  13. package/dist/types/button-group.d.ts +12 -0
  14. package/dist/types/calendar.d.ts +23 -0
  15. package/dist/types/checkbox-group.d.ts +39 -0
  16. package/dist/types/close-button.d.ts +11 -0
  17. package/dist/types/color-area.d.ts +15 -0
  18. package/dist/types/color-field.d.ts +15 -0
  19. package/dist/types/color-picker.d.ts +21 -0
  20. package/dist/types/color-slider.d.ts +21 -0
  21. package/dist/types/color-swatch-picker.d.ts +24 -0
  22. package/dist/types/color-swatch.d.ts +15 -0
  23. package/dist/types/combo-box.d.ts +37 -0
  24. package/dist/types/config-provider.d.ts +38 -0
  25. package/dist/types/confirm.d.ts +22 -0
  26. package/dist/types/container.d.ts +12 -0
  27. package/dist/types/date-field.d.ts +25 -0
  28. package/dist/types/date-picker.d.ts +29 -0
  29. package/dist/types/description.d.ts +8 -0
  30. package/dist/types/disclosure-group.d.ts +18 -0
  31. package/dist/types/disclosure.d.ts +31 -0
  32. package/dist/types/field-error.d.ts +12 -0
  33. package/dist/types/fieldset.d.ts +12 -0
  34. package/dist/types/flex.d.ts +32 -0
  35. package/dist/types/form.d.ts +12 -0
  36. package/dist/types/grid.d.ts +30 -0
  37. package/dist/types/index.d.ts +54 -0
  38. package/dist/types/input-group.d.ts +22 -0
  39. package/dist/types/input-otp.d.ts +29 -0
  40. package/dist/types/input.d.ts +2 -0
  41. package/dist/types/internal/color.d.ts +29 -0
  42. package/dist/types/internal/form-context.d.ts +5 -0
  43. package/dist/types/internal/layout-style.d.ts +62 -0
  44. package/dist/types/internal/schedule-utils.d.ts +32 -0
  45. package/dist/types/kbd.d.ts +13 -0
  46. package/dist/types/label.d.ts +12 -0
  47. package/dist/types/link.d.ts +19 -0
  48. package/dist/types/list-box.d.ts +39 -0
  49. package/dist/types/loading-overlay.d.ts +17 -0
  50. package/dist/types/mention.d.ts +44 -0
  51. package/dist/types/meter.d.ts +28 -0
  52. package/dist/types/number-field.d.ts +25 -0
  53. package/dist/types/progress-circle.d.ts +20 -0
  54. package/dist/types/radio-group.d.ts +39 -0
  55. package/dist/types/range-calendar.d.ts +24 -0
  56. package/dist/types/schedule-calendar.d.ts +103 -0
  57. package/dist/types/scroll-shadow.d.ts +16 -0
  58. package/dist/types/section.d.ts +10 -0
  59. package/dist/types/separator.d.ts +13 -0
  60. package/dist/types/steps.d.ts +30 -0
  61. package/dist/types/surface.d.ts +17 -0
  62. package/dist/types/tag-group.d.ts +40 -0
  63. package/dist/types/tags-input.d.ts +29 -0
  64. package/dist/types/time-field.d.ts +25 -0
  65. package/dist/types/toggle-button-group.d.ts +24 -0
  66. package/dist/types/toggle-button.d.ts +27 -0
  67. package/dist/workspace.cjs +1 -1
  68. package/dist/workspace.js +1 -1
  69. package/package.json +1 -1
  70. package/dist/button-BCSOcrTI.cjs +0 -1
  71. package/dist/button-SXD_7EGY.js +0 -970
@@ -0,0 +1,33 @@
1
+ /** 液态玻璃手风琴面板:通过结构化 items 渲染带分割线与玻璃光泽的折叠列表。 */
2
+ import { type HTMLAttributes, type JSX, type ReactNode } from "react";
3
+ export interface AccordionItem {
4
+ /** 面板唯一标识。 */
5
+ key: string;
6
+ /** 标题文案。 */
7
+ title: ReactNode;
8
+ /** 可选副标题或补充说明。 */
9
+ subtitle?: ReactNode;
10
+ /** 可选前置图标。 */
11
+ icon?: ReactNode;
12
+ /** 展开后的内容。 */
13
+ content: ReactNode;
14
+ /** 是否禁用展开。 */
15
+ disabled?: boolean;
16
+ }
17
+ export interface AccordionProps extends HTMLAttributes<HTMLDivElement> {
18
+ /** 手风琴条目集合。 */
19
+ items: readonly AccordionItem[];
20
+ /** 是否允许同时展开多个面板,默认单展。 */
21
+ allowsMultiple?: boolean;
22
+ /** 受控已展开键数组。 */
23
+ expandedKeys?: readonly string[];
24
+ /** 非受控默认展开键数组。 */
25
+ defaultExpandedKeys?: readonly string[];
26
+ /** 展开键变化回调。 */
27
+ onExpandedChange?: (keys: string[]) => void;
28
+ /** 外观风格:`surface` 实底卡片,`glass` 液态玻璃容器,`separated` 独立分离玻璃项。 */
29
+ variant?: "surface" | "glass" | "separated";
30
+ /** 统一禁用所有面板。 */
31
+ disabled?: boolean;
32
+ }
33
+ export declare function Accordion({ items, allowsMultiple, expandedKeys: controlledKeys, defaultExpandedKeys, onExpandedChange, variant, disabled, className, ...props }: AccordionProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ /** 固定宽高比容器(参考 Radix UI AspectRatio):确保封面图、视频与嵌入画板在任意宽度下保持稳定比例。 */
2
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
3
+ export interface AspectRatioProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** 宽高比(例如 `16 / 9`、`4 / 3`、`1`),默认 `16 / 9`。 */
5
+ ratio?: number;
6
+ /** 圆角规格,默认无额外裁切。 */
7
+ radius?: "none" | "small" | "regular" | "large";
8
+ children?: ReactNode;
9
+ }
10
+ export declare const AspectRatio: ForwardRefExoticComponent<AspectRatioProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,41 @@
1
+ /** 液态玻璃浮层搜索自动补全(Autocomplete):点击触发胶囊后在玻璃浮层内实时搜索过滤并选择。 */
2
+ import { type HTMLAttributes, type JSX, type ReactNode } from "react";
3
+ export interface AutocompleteOption {
4
+ /** 唯一值。 */
5
+ value: string;
6
+ /** 展示名称。 */
7
+ label: string;
8
+ /** 可选说明。 */
9
+ description?: string;
10
+ /** 可选分组名。 */
11
+ group?: string;
12
+ /** 禁用该选项。 */
13
+ disabled?: boolean;
14
+ }
15
+ export interface AutocompleteProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
16
+ /** 可选数据列表。 */
17
+ options: readonly AutocompleteOption[];
18
+ /** 受控选中值。 */
19
+ value?: string;
20
+ /** 非受控初始值。 */
21
+ defaultValue?: string;
22
+ /** 选中值变化回调。 */
23
+ onValueChange?: (value: string) => void;
24
+ /** 触发按钮占位文案。 */
25
+ placeholder?: string;
26
+ /** 浮层内搜索框占位文案。 */
27
+ searchPlaceholder?: string;
28
+ /** 自定义过滤函数。 */
29
+ filter?: (option: AutocompleteOption, query: string) => boolean;
30
+ /** 无匹配时的自定义展示。 */
31
+ empty?: ReactNode;
32
+ /** 是否允许一键清除。 */
33
+ clearable?: boolean;
34
+ /** 原生表单字段名。 */
35
+ name?: string;
36
+ /** 禁用交互。 */
37
+ disabled?: boolean;
38
+ /** 校验错误提示。 */
39
+ error?: ReactNode;
40
+ }
41
+ export declare function Autocomplete({ options, value: controlledValue, defaultValue, onValueChange, placeholder, searchPlaceholder, filter, empty, clearable, name, disabled, error, className, "aria-label": ariaLabel, ...props }: AutocompleteProps): JSX.Element;
@@ -0,0 +1,16 @@
1
+ /** 液态玻璃堆叠头像组:自动折叠超量头像并展示玻璃质感 +N 溢出圆章。 */
2
+ import { type HTMLAttributes, type JSX, type ReactNode } from "react";
3
+ export interface AvatarGroupProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** 最多直接展示的头像数量,超出部分折叠为 `+N`。 */
5
+ max?: number;
6
+ /** 显式总数(当只渲染前几项但真实成员更多时使用)。 */
7
+ total?: number;
8
+ /** 统一覆盖子头像尺寸。 */
9
+ size?: "small" | "regular" | "large" | number;
10
+ /** 堆叠重叠紧凑度。 */
11
+ spacing?: "tight" | "regular" | "loose";
12
+ /** 自定义溢出计数渲染。 */
13
+ renderCount?: (overflowCount: number) => ReactNode;
14
+ children?: ReactNode;
15
+ }
16
+ export declare function AvatarGroup({ max, total, size, spacing, renderCount, className, style, children, ...props }: AvatarGroupProps): JSX.Element;
@@ -0,0 +1,12 @@
1
+ /** 基础布局原语(参考 Radix UI Box):提供统一的语义间距阶梯、尺寸与定位简写属性。 */
2
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
3
+ import { type LayoutSpaceProps } from "./internal/layout-style.js";
4
+ export type BoxElement = "div" | "span" | "section" | "article" | "main" | "aside" | "header" | "footer" | "nav";
5
+ export interface BoxProps extends HTMLAttributes<HTMLElement>, LayoutSpaceProps {
6
+ /** 渲染的语义 HTML 标签,默认 `div`。 */
7
+ as?: BoxElement;
8
+ /** CSS display 模式。 */
9
+ display?: "none" | "inline" | "inline-block" | "block" | "contents";
10
+ children?: ReactNode;
11
+ }
12
+ export declare const Box: ForwardRefExoticComponent<BoxProps & RefAttributes<HTMLElement>>;
@@ -0,0 +1,31 @@
1
+ /** 液态玻璃面包屑导航:支持路径折叠展开、自定义分隔符与当前页语义。 */
2
+ import { type HTMLAttributes, type JSX, type MouseEvent, type ReactNode } from "react";
3
+ export interface BreadcrumbItem {
4
+ /** 唯一标识。 */
5
+ key: string;
6
+ /** 展示文案。 */
7
+ label: ReactNode;
8
+ /** 可选链接地址;最后一项默认作为当前页不渲染链接。 */
9
+ href?: string;
10
+ /** 可选前置图标。 */
11
+ icon?: ReactNode;
12
+ /** 禁用点击。 */
13
+ disabled?: boolean;
14
+ /** 单项点击回调。 */
15
+ onClick?: (event: MouseEvent<HTMLElement>) => void;
16
+ }
17
+ export interface BreadcrumbsProps extends HTMLAttributes<HTMLElement> {
18
+ /** 路径节点列表,按从根到当前页顺序排列。 */
19
+ items: readonly BreadcrumbItem[];
20
+ /** 自定义分隔符,默认为精致右尖括号图标。 */
21
+ separator?: ReactNode;
22
+ /** 超出该数量时自动折叠中间层级为 `…` 展开按钮。 */
23
+ maxItems?: number;
24
+ /** 视觉变体:`plain` 简洁文字路径,`glass` 液态玻璃胶囊包裹。 */
25
+ variant?: "plain" | "glass";
26
+ /** 尺寸规格。 */
27
+ size?: "small" | "regular";
28
+ /** 点击非当前页节点时的统一回调。 */
29
+ onNavigate?: (item: BreadcrumbItem, index: number) => void;
30
+ }
31
+ export declare function Breadcrumbs({ items, separator, maxItems, variant, size, onNavigate, className, "aria-label": ariaLabel, ...props }: BreadcrumbsProps): JSX.Element;
@@ -0,0 +1,12 @@
1
+ /** 连体液态玻璃按钮组:统一组织相关动作,支持水平/垂直连体拼接与分割线。 */
2
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
3
+ export interface ButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** 排列方向。 */
5
+ orientation?: "horizontal" | "vertical";
6
+ /** 是否铺满容器宽度。 */
7
+ fullWidth?: boolean;
8
+ /** 是否使用独立液态玻璃底座包裹子按钮形成连体胶囊。 */
9
+ attached?: boolean;
10
+ children?: ReactNode;
11
+ }
12
+ export declare const ButtonGroup: ForwardRefExoticComponent<ButtonGroupProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,23 @@
1
+ /** 独立液态玻璃日历组件:基于 @daypicker/react,输出稳定 YYYY-MM-DD 日期字符串。 */
2
+ import { type HTMLAttributes, type JSX } from "react";
3
+ export interface CalendarProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
4
+ /** 受控日期字符串(`YYYY-MM-DD`)。 */
5
+ value?: string;
6
+ /** 非受控初始日期字符串。 */
7
+ defaultValue?: string;
8
+ /** 选中日期变化回调。 */
9
+ onValueChange?: (value: string) => void;
10
+ /** 允许选择的最小日期(`YYYY-MM-DD`)。 */
11
+ min?: string;
12
+ /** 允许选择的最大日期(`YYYY-MM-DD`)。 */
13
+ max?: string;
14
+ /** 指定今天日期(用于服务端渲染或稳定截图)。 */
15
+ today?: string;
16
+ /** 同时展示的月份数,默认 1。 */
17
+ numberOfMonths?: number;
18
+ /** 禁用日历交互。 */
19
+ disabled?: boolean;
20
+ /** 外观风格:`glass` 带液态玻璃卡片外壳,`plain` 嵌入已有浮层。 */
21
+ variant?: "glass" | "plain";
22
+ }
23
+ export declare function Calendar({ value: controlledValue, defaultValue, onValueChange, min, max, today, numberOfMonths, disabled, variant, className, ...props }: CalendarProps): JSX.Element;
@@ -0,0 +1,39 @@
1
+ /** 多选框组:统一管理多个 Checkbox 的受控值数组、布局方向、校验与表单重置。 */
2
+ import { type HTMLAttributes, type JSX, type ReactNode } from "react";
3
+ export interface CheckboxGroupOption {
4
+ /** 选项值。 */
5
+ value: string;
6
+ /** 展示标签。 */
7
+ label: ReactNode;
8
+ /** 可选说明文案。 */
9
+ description?: ReactNode;
10
+ /** 单项禁用。 */
11
+ disabled?: boolean;
12
+ }
13
+ export interface CheckboxGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
14
+ /** 数据驱动的选项集合。 */
15
+ options: readonly CheckboxGroupOption[];
16
+ /** 受控选中值数组。 */
17
+ value?: readonly string[];
18
+ /** 非受控初始选中值数组。 */
19
+ defaultValue?: readonly 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
+ /** 卡片风格选项展示。 */
33
+ variant?: "default" | "card";
34
+ /** 禁用整个多选组。 */
35
+ disabled?: boolean;
36
+ /** 标记必填。 */
37
+ required?: boolean;
38
+ }
39
+ export declare function CheckboxGroup({ options, value: controlledValue, defaultValue, onValueChange, name, label, description, error, orientation, variant, disabled, required, className, ...props }: CheckboxGroupProps): JSX.Element;
@@ -0,0 +1,11 @@
1
+ /** 独立液态玻璃关闭按钮:用于卡片、浮层、提示条与抽屉的统一关闭交互。 */
2
+ import { type ButtonHTMLAttributes, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
3
+ export interface CloseButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
4
+ /** 按钮尺寸。 */
5
+ size?: "small" | "regular" | "large";
6
+ /** 视觉样式:`glass` 使用液态玻璃材质,`subtle` 使用轻柔填充底色。 */
7
+ variant?: "glass" | "subtle";
8
+ /** 自定义关闭图标;默认使用精致圆角十字图标。 */
9
+ icon?: ReactNode;
10
+ }
11
+ export declare const CloseButton: ForwardRefExoticComponent<CloseButtonProps & RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,15 @@
1
+ /** 二维饱和度/明度拾色画布(ColorArea):支持指针平滑拖拽与方向键精确微调。 */
2
+ import { type HTMLAttributes, type JSX } from "react";
3
+ export interface ColorAreaProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
4
+ /** 受控颜色值(Hex 或 RGB 字符串)。 */
5
+ value?: string;
6
+ /** 非受控初始颜色值。 */
7
+ defaultValue?: string;
8
+ /** 颜色变化回调,返回标准 Hex 字符串。 */
9
+ onValueChange?: (color: string) => void;
10
+ /** 可选外部色相锁定(0-360),避免纯白/纯黑时色相漂移。 */
11
+ hue?: number;
12
+ /** 禁用交互。 */
13
+ disabled?: boolean;
14
+ }
15
+ export declare function ColorArea({ value: controlledValue, defaultValue, onValueChange, hue: externalHue, disabled, className, style, "aria-label": ariaLabel, ...props }: ColorAreaProps): JSX.Element;
@@ -0,0 +1,15 @@
1
+ /** 液态玻璃颜色文本输入框:支持 Hex / RGB 校验与自动规整,内置实时预览色块。 */
2
+ import { type ForwardRefExoticComponent, type InputHTMLAttributes, type RefAttributes } from "react";
3
+ export interface ColorFieldProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "size"> {
4
+ /** 受控颜色值。 */
5
+ value?: string;
6
+ /** 非受控初始颜色值。 */
7
+ defaultValue?: string;
8
+ /** 合法颜色变化回调。 */
9
+ onValueChange?: (color: string) => void;
10
+ /** 是否在左侧展示实时颜色预览色块,默认显示。 */
11
+ showSwatch?: boolean;
12
+ /** 尺寸规格。 */
13
+ size?: "small" | "regular" | "large";
14
+ }
15
+ export declare const ColorField: ForwardRefExoticComponent<ColorFieldProps & RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,21 @@
1
+ /** 完整液态玻璃拾色器(ColorPicker):集成触发色块胶囊、二维色域画布、色相/透明度滑块、文本输入与预设色板。 */
2
+ import { type HTMLAttributes, type JSX } from "react";
3
+ export interface ColorPickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
4
+ /** 受控颜色值。 */
5
+ value?: string;
6
+ /** 非受控初始颜色值。 */
7
+ defaultValue?: string;
8
+ /** 颜色变化回调。 */
9
+ onValueChange?: (color: string) => void;
10
+ /** 是否显示透明度通道滑块。 */
11
+ showAlpha?: boolean;
12
+ /** 预设快捷色板;传空数组可隐藏色板区。 */
13
+ presets?: readonly string[];
14
+ /** 触发按钮标签;默认展示当前色值。 */
15
+ label?: string;
16
+ /** 原生表单字段名。 */
17
+ name?: string;
18
+ /** 禁用交互。 */
19
+ disabled?: boolean;
20
+ }
21
+ export declare function ColorPicker({ value: controlledValue, defaultValue, onValueChange, showAlpha, presets, label, name, disabled, className, "aria-label": ariaLabel, ...props }: ColorPickerProps): JSX.Element;
@@ -0,0 +1,21 @@
1
+ /** 单通道液态玻璃颜色滑块:支持色相 Hue、透明度 Alpha、饱和度、明度与 RGB 通道调节。 */
2
+ import { type HTMLAttributes, type JSX, type ReactNode } from "react";
3
+ import { type ColorChannel } from "./internal/color.js";
4
+ export type { ColorChannel };
5
+ export interface ColorSliderProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
6
+ /** 要调节的颜色通道,默认 `hue`。 */
7
+ channel?: ColorChannel;
8
+ /** 受控颜色值。 */
9
+ value?: string;
10
+ /** 非受控初始颜色值。 */
11
+ defaultValue?: string;
12
+ /** 颜色变化回调。 */
13
+ onValueChange?: (color: string) => void;
14
+ /** 可选顶部标题。 */
15
+ label?: ReactNode;
16
+ /** 是否显示当前通道数值。 */
17
+ showValue?: boolean;
18
+ /** 禁用交互。 */
19
+ disabled?: boolean;
20
+ }
21
+ export declare function ColorSlider({ channel, value: controlledValue, defaultValue, onValueChange, label, showValue, disabled, className, style, "aria-label": ariaLabel, ...props }: ColorSliderProps): JSX.Element;
@@ -0,0 +1,24 @@
1
+ /** 预设色板选择器:基于 ColorSwatch 组合可选色板,支持键盘方向键切换与选中高亮。 */
2
+ import { type HTMLAttributes, type JSX } from "react";
3
+ export interface ColorSwatchOption {
4
+ color: string;
5
+ label?: string;
6
+ disabled?: boolean;
7
+ }
8
+ export interface ColorSwatchPickerProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
9
+ /** 可选色板,支持直接传色值字符串或含名称的对象。 */
10
+ colors: readonly (string | ColorSwatchOption)[];
11
+ /** 受控选中色值。 */
12
+ value?: string;
13
+ /** 非受控初始色值。 */
14
+ defaultValue?: string;
15
+ /** 选中变化回调。 */
16
+ onValueChange?: (color: string) => void;
17
+ /** 单个色块尺寸。 */
18
+ size?: "small" | "regular" | "large";
19
+ /** 单个色块形状。 */
20
+ shape?: "circle" | "rounded";
21
+ /** 禁用整个色板。 */
22
+ disabled?: boolean;
23
+ }
24
+ export declare function ColorSwatchPicker({ colors, value: controlledValue, defaultValue, onValueChange, size, shape, disabled, className, "aria-label": ariaLabel, ...props }: ColorSwatchPickerProps): JSX.Element;
@@ -0,0 +1,15 @@
1
+ /** 液态玻璃颜色色块:棋盘格透明底 + 玻璃边缘高光,清晰展示纯色与半透明色。 */
2
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
3
+ export interface ColorSwatchProps extends HTMLAttributes<HTMLSpanElement> {
4
+ /** CSS 颜色字符串(如 `#005FC9`、`rgba(0, 95, 201, 0.5)`)。 */
5
+ color: string;
6
+ /** 可读颜色名称(用于无障碍播报)。 */
7
+ colorName?: string;
8
+ /** 尺寸规格,也可传像素值。 */
9
+ size?: "small" | "regular" | "large" | number;
10
+ /** 外形:圆形或圆角矩形。 */
11
+ shape?: "circle" | "rounded";
12
+ /** 是否处于选中态。 */
13
+ selected?: boolean;
14
+ }
15
+ export declare const ColorSwatch: ForwardRefExoticComponent<ColorSwatchProps & RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,37 @@
1
+ /** 液态玻璃可搜索组合框(ComboBox):内联输入框 + 玻璃浮层列表,支持过滤、键盘导航与自由输入。 */
2
+ import { type ForwardRefExoticComponent, type InputHTMLAttributes, type ReactNode, type RefAttributes } from "react";
3
+ export interface ComboBoxOption {
4
+ /** 唯一选项值。 */
5
+ value: string;
6
+ /** 展示标签。 */
7
+ label: string;
8
+ /** 可选辅助说明。 */
9
+ description?: string;
10
+ /** 禁用该选项。 */
11
+ disabled?: boolean;
12
+ }
13
+ export interface ComboBoxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange" | "size"> {
14
+ /** 候选项列表。 */
15
+ options: readonly ComboBoxOption[];
16
+ /** 受控选中值。 */
17
+ value?: string;
18
+ /** 非受控初始选中值。 */
19
+ defaultValue?: string;
20
+ /** 选中值变化回调。 */
21
+ onValueChange?: (value: string) => void;
22
+ /** 受控输入文本。 */
23
+ inputValue?: string;
24
+ /** 输入文本变化回调。 */
25
+ onInputChange?: (input: string) => void;
26
+ /** 是否允许保留不在列表中的自定义输入值。 */
27
+ allowsCustomValue?: boolean;
28
+ /** 是否显示一键清除按钮。 */
29
+ clearable?: boolean;
30
+ /** 无匹配项时的提示文案。 */
31
+ emptyText?: ReactNode;
32
+ /** 校验错误提示。 */
33
+ error?: ReactNode;
34
+ /** 控件尺寸。 */
35
+ size?: "small" | "regular" | "large";
36
+ }
37
+ export declare const ComboBox: ForwardRefExoticComponent<ComboBoxProps & RefAttributes<HTMLInputElement>>;
@@ -27,6 +27,8 @@ export interface Locale {
27
27
  tooManyFiles: (maximum: number) => string;
28
28
  invalidFile: (name: string) => string;
29
29
  clear: string;
30
+ showPassword: string;
31
+ hidePassword: string;
30
32
  previous: string;
31
33
  next: string;
32
34
  loading: string;
@@ -41,6 +43,42 @@ export interface Locale {
41
43
  pageSize: string;
42
44
  pageSizeOption: (size: number) => string;
43
45
  total: (total: number) => string;
46
+ selectDate: string;
47
+ date: string;
48
+ time: string;
49
+ year: string;
50
+ month: string;
51
+ day: string;
52
+ hour: string;
53
+ minute: string;
54
+ second: string;
55
+ dayPeriod: string;
56
+ am: string;
57
+ pm: string;
58
+ breadcrumb: string;
59
+ moreItems: string;
60
+ noMatches: string;
61
+ remove: string;
62
+ verificationCode: string;
63
+ color: string;
64
+ colorPicker: string;
65
+ hue: string;
66
+ saturation: string;
67
+ brightness: string;
68
+ alpha: string;
69
+ red: string;
70
+ green: string;
71
+ blue: string;
72
+ today: string;
73
+ dayView: string;
74
+ weekView: string;
75
+ monthView: string;
76
+ allDay: string;
77
+ createEvent: string;
78
+ searchEvents: string;
79
+ moreEvents: (count: number) => string;
80
+ noEvents: string;
81
+ toggleSidebar: string;
44
82
  }
45
83
  export declare const zhCN: Locale;
46
84
  export declare const enUS: Locale;
@@ -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,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,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,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,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>>;