@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,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,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,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>>;
@@ -27,6 +27,7 @@ export { Tooltip, type TooltipProps } from "./tooltip.js";
27
27
  export { Popover, type PopoverProps } from "./popover.js";
28
28
  export { Toast, ToastProvider, useToast, type ToastProps, type ToastOptions, type ToastProviderProps, type ToastApi, } from "./toast.js";
29
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";
30
31
  export { Badge, type BadgeProps } from "./badge.js";
31
32
  export { Avatar, type AvatarProps } from "./avatar.js";
32
33
  export { Empty, type EmptyProps } from "./empty.js";
@@ -51,3 +52,56 @@ export { MemberPicker, type MemberPickerProps, type MemberOption, } from "./memb
51
52
  export { ImportWizard, type ImportWizardProps } from "./import-wizard.js";
52
53
  export { ActivityCalendar, type ActivityCalendarProps, type ActivityDay, } from "./activity-calendar.js";
53
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;
@@ -7,5 +7,7 @@ export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>,
7
7
  icon?: ReactNode;
8
8
  /** `glass` floats over content; `fill` is the plain field iOS puts under a large title. */
9
9
  variant?: "glass" | "fill";
10
+ /** Show an eye toggle button when `type="password"`. Defaults to `true`. */
11
+ passwordToggle?: boolean;
10
12
  }
11
13
  export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,29 @@
1
+ /** 内部色彩解析与通道转换工具,零外部依赖,支持 Hex / RGB / RGBA 与 HSVA 互转。 */
2
+ export interface RgbaColor {
3
+ r: number;
4
+ g: number;
5
+ b: number;
6
+ a: number;
7
+ }
8
+ export interface HsvaColor {
9
+ h: number;
10
+ s: number;
11
+ v: number;
12
+ a: number;
13
+ }
14
+ export type ColorChannel = "hue" | "saturation" | "brightness" | "alpha" | "red" | "green" | "blue";
15
+ export declare function clamp(value: number, min: number, max: number): number;
16
+ /** 解析 Hex(#RGB / #RGBA / #RRGGBB / #RRGGBBAA)或 rgb()/rgba() 为 RGBA。 */
17
+ export declare function parseColor(input?: string): RgbaColor | null;
18
+ export declare function rgbaToHsva({ r, g, b, a }: RgbaColor): HsvaColor;
19
+ export declare function hsvaToRgba({ h, s, v, a }: HsvaColor): RgbaColor;
20
+ /** 序列化 RGBA 为 Hex(若包含透明度则输出 8 位 #RRGGBBAA,否则 6 位 #RRGGBB)。 */
21
+ export declare function formatHex(rgba: RgbaColor, includeAlpha?: boolean): string;
22
+ export declare function formatCssRgba(rgba: RgbaColor): string;
23
+ export declare function getChannelRange(channel: ColorChannel): {
24
+ min: number;
25
+ max: number;
26
+ step: number;
27
+ };
28
+ export declare function getChannelValue(hsva: HsvaColor, channel: ColorChannel): number;
29
+ export declare function setChannelValue(hsva: HsvaColor, channel: ColorChannel, next: number): HsvaColor;
@@ -0,0 +1,5 @@
1
+ /** 表单校验错误共享上下文:由 Form 注入,供 FieldError 按字段名读取。 */
2
+ import { type Context } from "react";
3
+ export type FormValidationErrors = Record<string, string | readonly string[] | undefined>;
4
+ export declare const FormErrorsContext: Context<FormValidationErrors | undefined>;
5
+ export declare function useFormFieldError(name?: string): string | readonly string[] | undefined;
@@ -0,0 +1,62 @@
1
+ /** Radix 风格布局原语共享工具:将语义间距阶梯(0-9)与布局简写属性转换为内联 CSSProperties。 */
2
+ import type { CSSProperties } from "react";
3
+ export type SpaceScale = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9" | (string & {}) | number;
4
+ export type LayoutAlign = "start" | "center" | "end" | "baseline" | "stretch";
5
+ export type LayoutJustify = "start" | "center" | "end" | "between" | "around" | "evenly";
6
+ export declare function resolveSpace(value?: SpaceScale): string | undefined;
7
+ export declare function resolveLength(value?: number | string): string | undefined;
8
+ export declare function resolveAlign(value?: LayoutAlign): string | undefined;
9
+ export declare function resolveJustify(value?: LayoutJustify): string | undefined;
10
+ export interface LayoutSpaceProps {
11
+ /** 四周内边距(支持 0–9 阶梯或任意 CSS 长度)。 */
12
+ p?: SpaceScale;
13
+ /** 水平内边距。 */
14
+ px?: SpaceScale;
15
+ /** 垂直内边距。 */
16
+ py?: SpaceScale;
17
+ /** 上内边距。 */
18
+ pt?: SpaceScale;
19
+ /** 右内边距。 */
20
+ pr?: SpaceScale;
21
+ /** 下内边距。 */
22
+ pb?: SpaceScale;
23
+ /** 左内边距。 */
24
+ pl?: SpaceScale;
25
+ /** 四周外边距。 */
26
+ m?: SpaceScale;
27
+ /** 水平外边距。 */
28
+ mx?: SpaceScale;
29
+ /** 垂直外边距。 */
30
+ my?: SpaceScale;
31
+ /** 上外边距。 */
32
+ mt?: SpaceScale;
33
+ /** 右外边距。 */
34
+ mr?: SpaceScale;
35
+ /** 下外边距。 */
36
+ mb?: SpaceScale;
37
+ /** 左外边距。 */
38
+ ml?: SpaceScale;
39
+ /** 宽度。 */
40
+ width?: number | string;
41
+ /** 最小宽度。 */
42
+ minWidth?: number | string;
43
+ /** 最大宽度。 */
44
+ maxWidth?: number | string;
45
+ /** 高度。 */
46
+ height?: number | string;
47
+ /** 最小高度。 */
48
+ minHeight?: number | string;
49
+ /** 最大高度。 */
50
+ maxHeight?: number | string;
51
+ /** 弹性放大比例。 */
52
+ flexGrow?: CSSProperties["flexGrow"];
53
+ /** 弹性收缩比例。 */
54
+ flexShrink?: CSSProperties["flexShrink"];
55
+ /** 弹性初始尺寸。 */
56
+ flexBasis?: number | string;
57
+ /** 溢出策略。 */
58
+ overflow?: CSSProperties["overflow"];
59
+ /** 定位方式。 */
60
+ position?: CSSProperties["position"];
61
+ }
62
+ export declare function buildLayoutStyle(props: LayoutSpaceProps, extra?: CSSProperties): CSSProperties | undefined;
@@ -0,0 +1,32 @@
1
+ /** 日程日历纯函数工具:处理本地日期偏移、月/周网格生成、跨天判断与时间轴并发分栏布局。 */
2
+ export interface ParsedDateTime {
3
+ dateKey: string;
4
+ /** 距离当天 00:00 的分钟数;纯日期串返回 null。 */
5
+ minutes: number | null;
6
+ }
7
+ export declare function pad2(n: number): string;
8
+ export declare function dateToKey(date: Date): string;
9
+ export declare function keyToDate(dateKey: string): Date;
10
+ /** 解析 `YYYY-MM-DD`、`YYYY-MM-DDTHH:mm` 或 `YYYY-MM-DD HH:mm`。 */
11
+ export declare function parseScheduleDateTime(raw: string): ParsedDateTime;
12
+ export declare function formatMinutes(minutes: number): string;
13
+ export declare function addDays(dateKey: string, delta: number): string;
14
+ export declare function addMonths(dateKey: string, delta: number): string;
15
+ export declare function getDayOfWeek(dateKey: string): number;
16
+ export declare function getWeekDays(anchorDateKey: string, weekStartsOn: 0 | 1): string[];
17
+ /** 生成完整月网格(5 行或 6 行,自动贴合当月实际周数)。 */
18
+ export declare function getMonthGrid(anchorDateKey: string, weekStartsOn: 0 | 1, alwaysSixRows?: boolean): string[];
19
+ export interface TimedLayoutInput {
20
+ id: string;
21
+ startMinutes: number;
22
+ endMinutes: number;
23
+ }
24
+ export interface TimedLayoutResult {
25
+ id: string;
26
+ column: number;
27
+ columnCount: number;
28
+ topPercent: number;
29
+ heightPercent: number;
30
+ }
31
+ /** 对同一天内的时段日程做重叠聚类与分栏计算,确保并发日程并排展示不互相覆盖。 */
32
+ export declare function layoutDayTimedEvents(items: readonly TimedLayoutInput[]): Map<string, TimedLayoutResult>;
@@ -0,0 +1,13 @@
1
+ /** 液态玻璃快捷键键帽:支持常用修饰键符号快捷映射与常规按键展示。 */
2
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
3
+ export type KbdKey = "command" | "shift" | "ctrl" | "option" | "enter" | "delete" | "escape" | "tab" | "capslock" | "up" | "right" | "down" | "left" | "pageup" | "pagedown" | "home" | "end" | "space";
4
+ export interface KbdProps extends HTMLAttributes<HTMLElement> {
5
+ /** 修饰键或功能键列表,按顺序渲染在主按键文字前。 */
6
+ keys?: KbdKey | readonly KbdKey[];
7
+ /** 尺寸规格。 */
8
+ size?: "small" | "regular";
9
+ /** 视觉材质:`glass` 带轻玻璃光泽,`subtle` 为柔和浅底。 */
10
+ variant?: "glass" | "subtle";
11
+ children?: ReactNode;
12
+ }
13
+ export declare const Kbd: ForwardRefExoticComponent<KbdProps & RefAttributes<HTMLElement>>;
@@ -0,0 +1,12 @@
1
+ /** 语义表单标签:关联输入控件,支持必填星标与禁用视觉状态。 */
2
+ import { type ForwardRefExoticComponent, type LabelHTMLAttributes, type ReactNode, type RefAttributes } from "react";
3
+ export interface LabelProps extends LabelHTMLAttributes<HTMLLabelElement> {
4
+ /** 是否显示必填星标。 */
5
+ required?: boolean;
6
+ /** 禁用状态视觉降权。 */
7
+ disabled?: boolean;
8
+ /** 字号规格。 */
9
+ size?: "small" | "regular";
10
+ children?: ReactNode;
11
+ }
12
+ export declare const Label: ForwardRefExoticComponent<LabelProps & RefAttributes<HTMLLabelElement>>;
@@ -0,0 +1,19 @@
1
+ /** 液态玻璃语义超链接:支持下划线策略、色调、外链安全属性与禁用状态。 */
2
+ import { type AnchorHTMLAttributes, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
3
+ export type LinkTone = "accent" | "foreground" | "muted" | "danger";
4
+ export type LinkUnderline = "none" | "hover" | "always";
5
+ export interface LinkProps extends AnchorHTMLAttributes<HTMLAnchorElement> {
6
+ /** 颜色语义。 */
7
+ tone?: LinkTone;
8
+ /** 下划线显示时机。 */
9
+ underline?: LinkUnderline;
10
+ /** 外部链接:自动补充 `target="_blank"`、`rel="noopener noreferrer"` 并显示外链图标。 */
11
+ external?: boolean;
12
+ /** 是否显示外链尾标图标,默认随 `external` 开启。 */
13
+ showExternalIcon?: boolean;
14
+ /** 禁用链接交互并移除焦点顺序。 */
15
+ disabled?: boolean;
16
+ /** 可选前置图标。 */
17
+ icon?: ReactNode;
18
+ }
19
+ export declare const Link: ForwardRefExoticComponent<LinkProps & RefAttributes<HTMLAnchorElement>>;
@@ -0,0 +1,39 @@
1
+ /** 液态玻璃列表选择框:支持单选/多选、分组标题、图标描述与完整键盘导航。 */
2
+ import { type HTMLAttributes, type JSX, type ReactNode } from "react";
3
+ export interface ListBoxItem {
4
+ /** 唯一键值。 */
5
+ key: string;
6
+ /** 主标题。 */
7
+ label: ReactNode;
8
+ /** 可选辅助说明。 */
9
+ description?: ReactNode;
10
+ /** 可选前置图标。 */
11
+ icon?: ReactNode;
12
+ /** 可选右侧附属信息(如快捷键或计数)。 */
13
+ trailing?: ReactNode;
14
+ /** 语义色调:`danger` 用于危险操作项。 */
15
+ tone?: "default" | "danger";
16
+ /** 分组名称;连续相同分组会自动合并显示分组头。 */
17
+ group?: string;
18
+ /** 禁用该项。 */
19
+ disabled?: boolean;
20
+ }
21
+ export interface ListBoxProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
22
+ /** 列表选项集合。 */
23
+ items: readonly ListBoxItem[];
24
+ /** 选择模式。 */
25
+ selectionMode?: "none" | "single" | "multiple";
26
+ /** 受控选中键集合。 */
27
+ selectedKeys?: readonly string[];
28
+ /** 非受控初始选中键集合。 */
29
+ defaultSelectedKeys?: readonly string[];
30
+ /** 选中集合变化回调。 */
31
+ onSelectionChange?: (keys: string[]) => void;
32
+ /** 点击或按回车触发某项时的动作回调(适合作为命令或导航列表)。 */
33
+ onAction?: (key: string) => void;
34
+ /** 列表为空时的自定义占位内容。 */
35
+ empty?: ReactNode;
36
+ /** 外观变体。 */
37
+ variant?: "glass" | "surface";
38
+ }
39
+ export declare function ListBox({ items, selectionMode, selectedKeys: controlledSelected, defaultSelectedKeys, onSelectionChange, onAction, empty, variant, className, onKeyDown, ...props }: ListBoxProps): JSX.Element;
@@ -0,0 +1,17 @@
1
+ /** 局部液态玻璃加载遮罩(LoadingOverlay):放置在 position: relative 容器内,在异步加载期间柔和模糊并阻断交互。 */
2
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
3
+ export interface LoadingOverlayProps extends HTMLAttributes<HTMLDivElement> {
4
+ /** 是否显示加载遮罩。 */
5
+ visible: boolean;
6
+ /** 可选加载提示文案(如「正在保存…」)。 */
7
+ label?: ReactNode;
8
+ /** 自定义加载指示器,默认使用液态玻璃 Spinner。 */
9
+ loader?: ReactNode;
10
+ /** 背景毛玻璃模糊半径(像素),默认 `6`。 */
11
+ blur?: number;
12
+ /** 圆角继承或显式覆盖,默认 `inherit`。 */
13
+ radius?: number | string;
14
+ /** 层级,默认 `20`。 */
15
+ zIndex?: number;
16
+ }
17
+ export declare const LoadingOverlay: ForwardRefExoticComponent<LoadingOverlayProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,44 @@
1
+ /** 液态玻璃「@提及」胶囊组件:用于行内或卡片中展示负责人、提交者、审阅者与协作贡献者,支持头像、角色副标与点击回调。 */
2
+ import { type HTMLAttributes, type JSX, type MouseEventHandler, type ReactNode } from "react";
3
+ export type MentionTone = "accent" | "neutral" | "success" | "warning";
4
+ export type MentionSize = "small" | "regular";
5
+ export interface MentionProps extends Omit<HTMLAttributes<HTMLElement>, "onClick"> {
6
+ /** 展示名称(如真名或用户名)。 */
7
+ name: string;
8
+ /** 可选头像链接;加载失败或未传时自动展示姓名首字徽章。 */
9
+ avatar?: string;
10
+ /** 前缀符号,默认 `@`;传空字符串可隐藏。 */
11
+ prefix?: string;
12
+ /** 尺寸:`small` 适合行内与提交记录,`regular` 适合贡献者与负责人区块。 */
13
+ size?: MentionSize;
14
+ /** 视觉色调:默认 `accent`(液态玻璃蓝调微光),未绑定外部账号可用 `neutral`。 */
15
+ tone?: MentionTone;
16
+ /** 可选角色副标(如 `负责人`、`提交者`、`联合提交`)。 */
17
+ roleLabel?: string;
18
+ /** 可选尾标图标(如第三方来源小标)。 */
19
+ badge?: ReactNode;
20
+ /** 传入后渲染为可点击的交互按钮(用于打开成员名片或主页)。 */
21
+ onClick?: MouseEventHandler<HTMLButtonElement>;
22
+ }
23
+ export declare function Mention({ name, avatar, prefix, size, tone, roleLabel, badge, onClick, className, ...props }: MentionProps): JSX.Element;
24
+ export interface MentionGroupItem {
25
+ id: string;
26
+ name: string;
27
+ avatar?: string;
28
+ roleLabel?: string;
29
+ tone?: MentionTone;
30
+ badge?: ReactNode;
31
+ title?: string;
32
+ }
33
+ export interface MentionGroupProps extends Omit<HTMLAttributes<HTMLDivElement>, "onSelect"> {
34
+ /** 要展示的成员列表。 */
35
+ items: readonly MentionGroupItem[];
36
+ /** 胶囊尺寸。 */
37
+ size?: MentionSize;
38
+ /** 最多直接显示的胶囊数量,超出后折叠为 `+N` 提示。 */
39
+ maxVisible?: number;
40
+ /** 点击某位成员胶囊时的回调。 */
41
+ onSelect?: (item: MentionGroupItem) => void;
42
+ }
43
+ /** 多人 @提及 列表容器:自动换行并支持超量折叠为 `+N` 液态胶囊。 */
44
+ export declare function MentionGroup({ items, size, maxVisible, onSelect, className, ...props }: MentionGroupProps): 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
+ /** 液态玻璃数字输入框:支持 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,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,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,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;