@lec-space/liquidglass 0.0.0-stage → 1.0.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 (90) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +58 -2
  3. package/dist/button-BCSOcrTI.cjs +1 -0
  4. package/dist/button-SXD_7EGY.js +970 -0
  5. package/dist/index.cjs +2 -0
  6. package/dist/index.js +4440 -0
  7. package/dist/styles.css +3804 -0
  8. package/dist/types/activity-calendar.d.ts +18 -0
  9. package/dist/types/alert.d.ts +18 -0
  10. package/dist/types/avatar.d.ts +12 -0
  11. package/dist/types/badge.d.ts +13 -0
  12. package/dist/types/button.d.ts +16 -0
  13. package/dist/types/card.d.ts +10 -0
  14. package/dist/types/checkbox.d.ts +9 -0
  15. package/dist/types/command-palette.d.ts +22 -0
  16. package/dist/types/config-provider.d.ts +62 -0
  17. package/dist/types/context-menu.d.ts +17 -0
  18. package/dist/types/data-table.d.ts +32 -0
  19. package/dist/types/date-range-picker.d.ts +23 -0
  20. package/dist/types/descriptions.d.ts +13 -0
  21. package/dist/types/dialog.d.ts +19 -0
  22. package/dist/types/drawer.d.ts +7 -0
  23. package/dist/types/empty.d.ts +8 -0
  24. package/dist/types/filter-bar.d.ts +9 -0
  25. package/dist/types/form-field.d.ts +19 -0
  26. package/dist/types/glass-group.d.ts +10 -0
  27. package/dist/types/glass.d.ts +3 -0
  28. package/dist/types/import-wizard.d.ts +11 -0
  29. package/dist/types/index.d.ts +53 -0
  30. package/dist/types/input.d.ts +11 -0
  31. package/dist/types/internal/bend.d.ts +15 -0
  32. package/dist/types/internal/calendar-day.d.ts +13 -0
  33. package/dist/types/internal/chevron.d.ts +6 -0
  34. package/dist/types/internal/contour.d.ts +10 -0
  35. package/dist/types/internal/controllable.d.ts +1 -0
  36. package/dist/types/internal/cx.d.ts +1 -0
  37. package/dist/types/internal/date-only.d.ts +4 -0
  38. package/dist/types/internal/field-error.d.ts +6 -0
  39. package/dist/types/internal/floating.d.ts +15 -0
  40. package/dist/types/internal/form-reset.d.ts +3 -0
  41. package/dist/types/internal/hold.d.ts +8 -0
  42. package/dist/types/internal/href.d.ts +7 -0
  43. package/dist/types/internal/jelly.d.ts +22 -0
  44. package/dist/types/internal/modal.d.ts +11 -0
  45. package/dist/types/internal/placement.d.ts +33 -0
  46. package/dist/types/internal/press.d.ts +2 -0
  47. package/dist/types/internal/range-calendar-navigation.d.ts +6 -0
  48. package/dist/types/internal/range-calendar.d.ts +11 -0
  49. package/dist/types/internal/refraction.d.ts +20 -0
  50. package/dist/types/internal/scroller.d.ts +2 -0
  51. package/dist/types/internal/sheet-drag.d.ts +17 -0
  52. package/dist/types/internal/spring.d.ts +13 -0
  53. package/dist/types/internal/styles.d.ts +5 -0
  54. package/dist/types/internal/tab-motion.d.ts +2 -0
  55. package/dist/types/internal/tree-branch.d.ts +13 -0
  56. package/dist/types/member-picker.d.ts +15 -0
  57. package/dist/types/menu.d.ts +61 -0
  58. package/dist/types/message.d.ts +12 -0
  59. package/dist/types/multi-select.d.ts +25 -0
  60. package/dist/types/navigation-bar.d.ts +25 -0
  61. package/dist/types/page-control.d.ts +13 -0
  62. package/dist/types/pagination.d.ts +12 -0
  63. package/dist/types/popover.d.ts +20 -0
  64. package/dist/types/progress.d.ts +10 -0
  65. package/dist/types/radio.d.ts +8 -0
  66. package/dist/types/search-field.d.ts +5 -0
  67. package/dist/types/segmented-control.d.ts +14 -0
  68. package/dist/types/select.d.ts +20 -0
  69. package/dist/types/sheet.d.ts +14 -0
  70. package/dist/types/skeleton.d.ts +9 -0
  71. package/dist/types/slider.d.ts +10 -0
  72. package/dist/types/statistic.d.ts +11 -0
  73. package/dist/types/stepper.d.ts +12 -0
  74. package/dist/types/style-entry.d.ts +1 -0
  75. package/dist/types/switch.d.ts +7 -0
  76. package/dist/types/tab-bar.d.ts +23 -0
  77. package/dist/types/table.d.ts +22 -0
  78. package/dist/types/tabs.d.ts +19 -0
  79. package/dist/types/tag.d.ts +10 -0
  80. package/dist/types/text-area.d.ts +13 -0
  81. package/dist/types/toast.d.ts +35 -0
  82. package/dist/types/toolbar.d.ts +13 -0
  83. package/dist/types/tooltip.d.ts +16 -0
  84. package/dist/types/tree.d.ts +18 -0
  85. package/dist/types/typography.d.ts +11 -0
  86. package/dist/types/upload.d.ts +15 -0
  87. package/dist/types/workspace.d.ts +22 -0
  88. package/dist/workspace.cjs +1 -0
  89. package/dist/workspace.js +42 -0
  90. package/package.json +65 -3
@@ -0,0 +1,6 @@
1
+ /** 日期范围浮层的月份导航,复用玻璃按钮并交给 DayPicker 管理月份边界。 */
2
+ import type { NavProps } from "@daypicker/react";
3
+ import type { JSX } from "react";
4
+ export interface RangeCalendarNavigationProps extends NavProps {
5
+ }
6
+ export declare function RangeCalendarNavigation({ previousMonth, nextMonth, onPreviousClick, onNextClick, ...props }: RangeCalendarNavigationProps): JSX.Element;
@@ -0,0 +1,11 @@
1
+ /** 范围日历适配层,复用 DayPicker 的日期与键盘逻辑,视觉由组件库自己的样式控制。 */
2
+ import { type JSX } from "react";
3
+ import { type DateRange } from "@daypicker/react";
4
+ export interface RangeCalendarProps {
5
+ value?: DateRange;
6
+ onValueChange: (value: DateRange | undefined) => void;
7
+ min?: string;
8
+ max?: string;
9
+ today?: string;
10
+ }
11
+ export declare function RangeCalendar({ value, onValueChange, min, max, today, }: RangeCalendarProps): JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { type RefObject } from "react";
2
+ /**
3
+ * Lights the edge of glass that's being held, as clear glass's is: iOS shows its rim
4
+ * brightest when a finger is on it. `on` false puts back the rim it was drawn with.
5
+ */
6
+ export declare function lightRim(element: HTMLElement, on: boolean): void;
7
+ /** Only Chromium applies SVG filters to the live backdrop. */
8
+ export declare const refractsBackdrop: () => boolean;
9
+ /** The rim alone, kept fitted as the element changes size. */
10
+ export declare const fitRim: (element: HTMLElement) => (() => void);
11
+ /** The rim for a size the element is about to reach, so it needn't be worked out on the way there. */
12
+ export declare function rimAt(element: HTMLElement, width: number, height: number, radius: number): () => void;
13
+ /** The lens for an element at its final size, where the browser can run it. Stop it before the size changes. */
14
+ export declare function fitLens(element: HTMLElement): () => void;
15
+ /**
16
+ * Refracts what's behind the element. Chromium filters the live backdrop.
17
+ * Safari and Firefox filter a copy of content marked `data-liquidglass-backdrop`
18
+ * nearby, and otherwise keep the blur with the rim highlight.
19
+ */
20
+ export declare function useRefraction(ref: RefObject<HTMLElement | null>, selection?: boolean): void;
@@ -0,0 +1,2 @@
1
+ /** The nearest ancestor that scrolls, or null for the page. */
2
+ export declare function scroller(element: HTMLElement): HTMLElement | null;
@@ -0,0 +1,17 @@
1
+ /** How far, in px, a drag has to go before it's known which way it's going. */
2
+ export declare const SLOP = 8;
3
+ /** Whether a drag that starts on `target` belongs to the thing itself, not the sheet. */
4
+ export declare function ownsDrag(target: Element): boolean;
5
+ /** Which of the elements from `target` up to `boundary` scroll up and down, innermost first. */
6
+ export declare function scrollers(target: Element, boundary: Element): HTMLElement[];
7
+ /** What a drag does: `dy` is the finger's travel in px, down positive. */
8
+ export declare function whose(dy: number, height: number, top: number, scrolled: boolean): "sheet" | "content";
9
+ /**
10
+ * Splits a drag's reach between the sheet and its content. `want` is the height
11
+ * the finger asks for. The sheet stops at `top`, the content scrolls by what's
12
+ * beyond it, up to `room`, and past that the sheet resists rather than following.
13
+ */
14
+ export declare function split(want: number, top: number, room: number): {
15
+ height: number;
16
+ scroll: number;
17
+ };
@@ -0,0 +1,13 @@
1
+ export interface Spring {
2
+ paint(): void;
3
+ set(target: number, instant?: boolean): void;
4
+ tune(stiffness: number, damping: number): void;
5
+ stop(): void;
6
+ }
7
+ /**
8
+ * Runs after a few frames. Glass takes a moment to reach the screen when it's first
9
+ * shown, and motion started at once would be half over by the time it did.
10
+ */
11
+ export declare function afterGlassShows(callback: () => void, frames?: number): () => void;
12
+ export declare function prefersReducedMotion(): boolean;
13
+ export declare function createSpring(value: number, stiffness: number, damping: number, paint: (value: number) => void): Spring;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Adds the stylesheet to the document once. It goes first in <head>, so the
3
+ * app's own CSS comes after it and wins ties, as it would if imported after.
4
+ */
5
+ export declare function insertStyles(css: string): void;
@@ -0,0 +1,2 @@
1
+ export declare const REST: readonly [225, 21, 676, 47.8];
2
+ export declare const DRAG: readonly [2500, 94, 576, 44.2];
@@ -0,0 +1,13 @@
1
+ /** Tree 的递归节点,隔离层级渲染与根组件的键盘导航逻辑。 */
2
+ import { type JSX } from "react";
3
+ import type { TreeNode } from "../tree.js";
4
+ export interface TreeBranchProps {
5
+ node: TreeNode;
6
+ selected: string;
7
+ active?: string;
8
+ expanded: ReadonlySet<string>;
9
+ onToggle: (key: string) => void;
10
+ onSelect: (key: string) => void;
11
+ onFocus: (key: string) => void;
12
+ }
13
+ export declare function TreeBranch({ node, selected, active, expanded, onToggle, onSelect, onFocus, }: TreeBranchProps): JSX.Element;
@@ -0,0 +1,15 @@
1
+ /** 成员选择组合,仅展示传入的成员资料;搜索和权限范围由接入项目控制。 */
2
+ import type { JSX } from "react";
3
+ import { type MultiSelectProps } from "./multi-select.js";
4
+ export interface MemberOption {
5
+ id: string;
6
+ name: string;
7
+ description?: string;
8
+ avatar?: string;
9
+ group?: string;
10
+ disabled?: boolean;
11
+ }
12
+ export interface MemberPickerProps extends Omit<MultiSelectProps, "options"> {
13
+ members: readonly MemberOption[];
14
+ }
15
+ export declare function MemberPicker({ members, ...props }: MemberPickerProps): JSX.Element;
@@ -0,0 +1,61 @@
1
+ import { type CSSProperties, type JSX, type ReactNode } from "react";
2
+ import { type ButtonProps } from "./button.js";
3
+ export interface MenuItem {
4
+ label: ReactNode;
5
+ icon?: ReactNode;
6
+ /**
7
+ * Makes the item a link. Choosing it calls `onSelect` if there is one, such as a router's
8
+ * navigate, and follows the link if not; with ⌘, Ctrl, Shift or the middle button it opens
9
+ * a new tab.
10
+ */
11
+ href?: string;
12
+ onSelect?: () => void;
13
+ destructive?: boolean;
14
+ disabled?: boolean;
15
+ /**
16
+ * Makes the item one of a set of choices, such as a sort order or an appearance, with a
17
+ * checkmark beside the one that's chosen.
18
+ */
19
+ checked?: boolean;
20
+ /** Choosing the item leaves the menu open, so what it changed can be seen, as for a setting. */
21
+ keepOpen?: boolean;
22
+ className?: string;
23
+ }
24
+ /** A line of small text above the items it introduces, such as the title of a section. */
25
+ export interface MenuHeading {
26
+ heading: ReactNode;
27
+ }
28
+ export type MenuEntry = MenuItem | MenuHeading | "separator";
29
+ interface MenuBaseProps {
30
+ /** Names the menu for assistive technology, and the trigger too when it has no `label`. */
31
+ "aria-label": string;
32
+ /** The trigger's icon. Defaults to an ellipsis when there's no `label`. */
33
+ icon?: ReactNode;
34
+ /** Turns the trigger into a pill with this label, like an iOS pull-down button. */
35
+ label?: ReactNode;
36
+ /** Adds a chevron after a `label`. iOS doesn't draw one on a glass pull-down, so it's off by default. */
37
+ chevron?: boolean;
38
+ /** Anything else for the trigger button, such as its `variant` or `className`. */
39
+ trigger?: Omit<ButtonProps, "icon" | "children" | "onClick">;
40
+ /** The trigger edge the menu lines up with as it opens across it. */
41
+ align?: "start" | "center" | "end";
42
+ /** Whether the menu is open. Pass it with `onOpenChange` to open and close the menu yourself. */
43
+ open?: boolean;
44
+ defaultOpen?: boolean;
45
+ /** Called when the trigger, Escape, Tab, a chosen item or a press outside asks to open or close the menu. */
46
+ onOpenChange?: (open: boolean) => void;
47
+ className?: string;
48
+ style?: CSSProperties;
49
+ }
50
+ export type MenuProps = MenuBaseProps & ({
51
+ items: MenuEntry[];
52
+ renderContent?: never;
53
+ } | {
54
+ items?: never;
55
+ /** 在同一个动画容器中渲染自定义内容,由调用方管理条目交互。 */
56
+ renderContent: (controls: {
57
+ close: () => void;
58
+ }) => ReactNode;
59
+ });
60
+ export declare function Menu({ items, renderContent, "aria-label": name, icon: iconProp, label, trigger, align, chevron, open: openProp, defaultOpen, onOpenChange, className, style, }: MenuProps): JSX.Element;
61
+ export {};
@@ -0,0 +1,12 @@
1
+ import type { JSX, ReactNode } from "react";
2
+ export interface MessageProps {
3
+ children: ReactNode;
4
+ tone?: "info" | "error";
5
+ action?: {
6
+ label: string;
7
+ onClick: () => void;
8
+ };
9
+ className?: string;
10
+ }
11
+ /** 在当前界面反馈操作结果,关闭或重试由调用方控制。 */
12
+ export declare function Message({ children, tone, action, className }: MessageProps): JSX.Element;
@@ -0,0 +1,25 @@
1
+ /** 可搜索多选,异步搜索由 onSearchChange 通知上层,支持原生 FormData 与 reset。 */
2
+ import { type JSX, type ReactNode } from "react";
3
+ export interface MultiSelectOption {
4
+ value: string;
5
+ label: string;
6
+ description?: string;
7
+ disabled?: boolean;
8
+ group?: string;
9
+ icon?: ReactNode;
10
+ }
11
+ export interface MultiSelectProps {
12
+ options: readonly MultiSelectOption[];
13
+ value?: readonly string[];
14
+ defaultValue?: readonly string[];
15
+ onValueChange?: (values: string[]) => void;
16
+ onSearchChange?: (search: string) => void;
17
+ placeholder?: string;
18
+ name?: string;
19
+ required?: boolean;
20
+ disabled?: boolean;
21
+ loading?: boolean;
22
+ maxSelected?: number;
23
+ "aria-label": string;
24
+ }
25
+ export declare function MultiSelect({ options, value, defaultValue, onValueChange, onSearchChange, placeholder, name, required, disabled, loading, maxSelected, "aria-label": label, }: MultiSelectProps): JSX.Element;
@@ -0,0 +1,25 @@
1
+ import { type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
2
+ import { type ToolbarProps } from "./toolbar.js";
3
+ export interface NavigationBarProps extends Omit<ToolbarProps, "title" | "children"> {
4
+ /** The screen's name. Large under the bar, then in the bar once it has scrolled under. */
5
+ title: string;
6
+ /** Show the title large below the bar. Without it the title sits in the bar from the start. Defaults to true. */
7
+ large?: boolean;
8
+ /** Adds the round back button at the leading edge, and is called when it's pressed. */
9
+ onBack?: () => void;
10
+ /** What the back button is called to a screen reader. Defaults to "Back". */
11
+ backLabel?: string;
12
+ /** Actions at the leading edge, after the back button. Put buttons in `ToolbarGroup`s, or use a `Menu`. */
13
+ leading?: ReactNode;
14
+ /** Actions at the trailing edge. */
15
+ trailing?: ReactNode;
16
+ /** The heading level of the title. Defaults to 1. */
17
+ level?: 1 | 2 | 3 | 4 | 5 | 6;
18
+ }
19
+ /**
20
+ * The bar at the top of a screen: an optional back button, actions, and the
21
+ * screen's title. It sticks to the top of what scrolls beneath it like a
22
+ * `Toolbar`, and the large title scrolls away with the content while its
23
+ * smaller twin fades into the bar.
24
+ */
25
+ export declare const NavigationBar: ForwardRefExoticComponent<NavigationBarProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,13 @@
1
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
2
+ export interface PageControlProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
3
+ /** How many pages there are. */
4
+ count: number;
5
+ /** The current page, from 0. */
6
+ value?: number;
7
+ defaultValue?: number;
8
+ onValueChange?: (value: number) => void;
9
+ /** Draw the dots on a capsule of glass, as the iOS "prominent" page control does. Default true. */
10
+ glass?: boolean;
11
+ }
12
+ /** The iOS page control: a row of dots with the current page filled, on a capsule of glass. */
13
+ export declare const PageControl: ForwardRefExoticComponent<PageControlProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,12 @@
1
+ import type { JSX } from "react";
2
+ export interface PaginationProps {
3
+ total: number;
4
+ page: number;
5
+ pageSize?: number;
6
+ onPageChange: (page: number) => void;
7
+ pageSizeOptions?: readonly number[];
8
+ onPageSizeChange?: (size: number) => void;
9
+ disabled?: boolean;
10
+ "aria-label"?: string;
11
+ }
12
+ export declare function Pagination({ total, page, pageSize, onPageChange, pageSizeOptions, onPageSizeChange, disabled, "aria-label": label, }: PaginationProps): JSX.Element;
@@ -0,0 +1,20 @@
1
+ import { type CSSProperties, type JSX, type ReactNode } from "react";
2
+ import { type ButtonProps } from "./button.js";
3
+ import { type FloatingSide } from "./internal/floating.js";
4
+ export interface PopoverProps {
5
+ label: ReactNode;
6
+ "aria-label": string;
7
+ title?: ReactNode;
8
+ children: ReactNode | ((controls: {
9
+ close: () => void;
10
+ }) => ReactNode);
11
+ trigger?: Omit<ButtonProps, "children" | "onClick">;
12
+ side?: FloatingSide;
13
+ align?: "start" | "center" | "end";
14
+ width?: CSSProperties["width"];
15
+ open?: boolean;
16
+ defaultOpen?: boolean;
17
+ onOpenChange?: (open: boolean) => void;
18
+ className?: string;
19
+ }
20
+ export declare function Popover({ label, "aria-label": name, title, children, trigger, side, align, width, open: controlled, defaultOpen, onOpenChange, className, }: PopoverProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
2
+ export interface ProgressProps extends HTMLAttributes<HTMLDivElement> {
3
+ /** How far along, from 0 to 1. */
4
+ value: number;
5
+ }
6
+ /** A thin bar that fills as work goes on. */
7
+ export declare const Progress: ForwardRefExoticComponent<ProgressProps & RefAttributes<HTMLDivElement>>;
8
+ export type SpinnerProps = HTMLAttributes<HTMLSpanElement>;
9
+ /** The iOS activity indicator: eight blades that fade round in turn. */
10
+ export declare const Spinner: ForwardRefExoticComponent<SpinnerProps & RefAttributes<HTMLSpanElement>>;
@@ -0,0 +1,8 @@
1
+ import { type ForwardRefExoticComponent, type InputHTMLAttributes, type ReactNode, type RefAttributes } from "react";
2
+ export interface RadioProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "children"> {
3
+ children?: ReactNode;
4
+ description?: ReactNode;
5
+ onCheckedChange?: (checked: boolean) => void;
6
+ }
7
+ /** 同组 Radio 使用相同 name,浏览器负责互斥选择、方向键导航和表单提交。 */
8
+ export declare const Radio: ForwardRefExoticComponent<RadioProps & RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,5 @@
1
+ import { type ForwardRefExoticComponent, type RefAttributes } from "react";
2
+ import { type InputProps } from "./input.js";
3
+ export type SearchFieldProps = Omit<InputProps, "type">;
4
+ /** An `Input` for searching: a magnifier icon, a "Search" placeholder and a clear button. */
5
+ export declare const SearchField: ForwardRefExoticComponent<SearchFieldProps & RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,14 @@
1
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
2
+ export interface SegmentedItem {
3
+ value: string;
4
+ label: ReactNode;
5
+ disabled?: boolean;
6
+ }
7
+ export interface SegmentedControlProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
8
+ items: SegmentedItem[];
9
+ value?: string;
10
+ defaultValue?: string;
11
+ onValueChange?: (value: string) => void;
12
+ }
13
+ /** A row of mutually exclusive choices, with a thumb that slides to the chosen one and lifts into a lens under a finger. */
14
+ export declare const SegmentedControl: ForwardRefExoticComponent<SegmentedControlProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,20 @@
1
+ import { type ButtonHTMLAttributes, type ForwardRefExoticComponent, type ReactNode, type RefAttributes, type SelectHTMLAttributes } from "react";
2
+ export interface SelectOption {
3
+ /** 非空、唯一的值;空字符串保留给 placeholder。 */
4
+ value: string;
5
+ label: string;
6
+ disabled?: boolean;
7
+ }
8
+ export interface SelectProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "defaultValue" | "onChange" | "children" | "type" | "onInvalid"> {
9
+ options: readonly SelectOption[];
10
+ value?: string;
11
+ defaultValue?: string;
12
+ onValueChange?: (value: string) => void;
13
+ placeholder?: string;
14
+ required?: boolean;
15
+ autoComplete?: string;
16
+ onInvalid?: SelectHTMLAttributes<HTMLSelectElement>["onInvalid"];
17
+ /** 业务校验错误,覆盖原生必填校验的行内提示。 */
18
+ error?: ReactNode;
19
+ }
20
+ export declare const Select: ForwardRefExoticComponent<SelectProps & RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,14 @@
1
+ import { type JSX, type ReactNode } from "react";
2
+ export type SheetDetent = "medium" | "large";
3
+ export interface SheetProps {
4
+ open?: boolean;
5
+ defaultOpen?: boolean;
6
+ onOpenChange?: (open: boolean) => void;
7
+ /** The heights it rests at, smallest first. */
8
+ detents?: SheetDetent[];
9
+ children?: ReactNode;
10
+ className?: string;
11
+ "aria-label"?: string;
12
+ }
13
+ /** The iOS sheet: rises from the bottom, drags between its detents, and drags away. */
14
+ export declare function Sheet({ open: openProp, defaultOpen, onOpenChange, detents, children, className, "aria-label": label }: SheetProps): JSX.Element;
@@ -0,0 +1,9 @@
1
+ import type { CSSProperties, HTMLAttributes, JSX } from "react";
2
+ export interface SkeletonProps extends HTMLAttributes<HTMLSpanElement> {
3
+ width?: CSSProperties["width"];
4
+ height?: CSSProperties["height"];
5
+ shape?: "text" | "circle" | "rounded";
6
+ animated?: boolean;
7
+ }
8
+ /** 仅提供视觉占位;在内容容器设置 aria-busy,并提供一条加载说明,避免逐条播报。 */
9
+ export declare function Skeleton({ width, height, shape, animated, className, style, ...props }: SkeletonProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type ForwardRefExoticComponent, type InputHTMLAttributes, type RefAttributes } from "react";
2
+ export interface SliderProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "value" | "defaultValue" | "onChange" | "min" | "max" | "step"> {
3
+ value?: number;
4
+ defaultValue?: number;
5
+ onValueChange?: (value: number) => void;
6
+ min?: number;
7
+ max?: number;
8
+ step?: number;
9
+ }
10
+ export declare const Slider: ForwardRefExoticComponent<SliderProps & RefAttributes<HTMLInputElement>>;
@@ -0,0 +1,11 @@
1
+ /** 看板中的单个指标,业务计算、单位换算与格式化由调用方提供。 */
2
+ import type { JSX, ReactNode } from "react";
3
+ export interface StatisticProps {
4
+ title: ReactNode;
5
+ value: string | number;
6
+ formatter?: (value: string | number) => ReactNode;
7
+ prefix?: ReactNode;
8
+ suffix?: ReactNode;
9
+ description?: ReactNode;
10
+ }
11
+ export declare function Statistic({ title, value, formatter, prefix, suffix, description, }: StatisticProps): JSX.Element;
@@ -0,0 +1,12 @@
1
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
2
+ export interface StepperProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
3
+ value?: number;
4
+ defaultValue?: number;
5
+ onValueChange?: (value: number) => void;
6
+ min?: number;
7
+ max?: number;
8
+ step?: number;
9
+ disabled?: boolean;
10
+ }
11
+ /** Two buttons that step a number down and up. */
12
+ export declare const Stepper: ForwardRefExoticComponent<StepperProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,7 @@
1
+ import { type ButtonHTMLAttributes, type ForwardRefExoticComponent, type RefAttributes } from "react";
2
+ export interface SwitchProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value" | "defaultValue" | "defaultChecked" | "onChange"> {
3
+ checked?: boolean;
4
+ defaultChecked?: boolean;
5
+ onCheckedChange?: (checked: boolean) => void;
6
+ }
7
+ export declare const Switch: ForwardRefExoticComponent<SwitchProps & RefAttributes<HTMLButtonElement>>;
@@ -0,0 +1,23 @@
1
+ import { type ElementType, type HTMLAttributes, type JSX, type ReactNode } from "react";
2
+ export interface TabBarItem {
3
+ value: string;
4
+ label: ReactNode;
5
+ /** Shown above the label, as in an iOS tab bar. */
6
+ icon?: ReactNode;
7
+ /** Renders the tab as a link. Clicking it navigates; the bar still tracks selection. */
8
+ href?: string;
9
+ }
10
+ export interface TabBarProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue" | "onChange"> {
11
+ items: TabBarItem[];
12
+ /** The selected tab's `value`, or `null` for none. */
13
+ value?: string | null;
14
+ defaultValue?: string | null;
15
+ onValueChange?: (value: string) => void;
16
+ /** Shrinks the bar to the current tab's icon, as iOS does when a page scrolls down. */
17
+ minimized?: boolean;
18
+ /** Called when the minimised bar is tapped, to ask for it back. */
19
+ onExpand?: () => void;
20
+ /** The component used for tabs with an `href`, such as Next.js's `Link`. */
21
+ link?: ElementType;
22
+ }
23
+ export declare function TabBar({ items, value: valueProp, defaultValue, onValueChange, minimized, onExpand, link: Link, className, style, ...props }: TabBarProps): JSX.Element;
@@ -0,0 +1,22 @@
1
+ /** 通用语义表格。列使用稳定 key,数据和排序由调用方控制。 */
2
+ import type { CSSProperties, JSX, ReactNode } from "react";
3
+ export interface TableColumn<T> {
4
+ key: string;
5
+ title: ReactNode;
6
+ render: (row: T) => ReactNode;
7
+ align?: "start" | "center" | "end";
8
+ width?: CSSProperties["width"];
9
+ /** 默认单行展示结构化字段;长描述可以按列启用换行。 */
10
+ wrap?: boolean;
11
+ ariaSort?: "none" | "ascending" | "descending";
12
+ }
13
+ export interface TableProps<T> {
14
+ columns: readonly TableColumn<T>[];
15
+ data: readonly T[];
16
+ rowKey: (row: T) => string;
17
+ caption: string;
18
+ empty?: ReactNode;
19
+ rowClassName?: (row: T) => string | undefined;
20
+ className?: string;
21
+ }
22
+ export declare function Table<T>({ columns, data, rowKey, caption, empty, rowClassName, className, }: TableProps<T>): JSX.Element;
@@ -0,0 +1,19 @@
1
+ /** 页面内容分组,使用 tablist/tab/tabpanel 语义并支持禁用项与方向键。 */
2
+ import { type JSX, type ReactNode } from "react";
3
+ export interface TabItem {
4
+ value: string;
5
+ label: ReactNode;
6
+ content: ReactNode;
7
+ disabled?: boolean;
8
+ }
9
+ export interface TabsProps {
10
+ items: readonly TabItem[];
11
+ value?: string;
12
+ defaultValue?: string;
13
+ onValueChange?: (value: string) => void;
14
+ "aria-label": string;
15
+ /** 默认保留面板,以免切换标签清空表单或编辑器状态。 */
16
+ keepMounted?: boolean;
17
+ className?: string;
18
+ }
19
+ export declare function Tabs({ items, value, defaultValue, onValueChange, "aria-label": name, keepMounted, className, }: TabsProps): JSX.Element;
@@ -0,0 +1,10 @@
1
+ import { type HTMLAttributes, type JSX, type ReactNode } from "react";
2
+ export type TagTone = "neutral" | "info" | "success" | "warning" | "danger";
3
+ export interface TagProps extends HTMLAttributes<HTMLSpanElement> {
4
+ tone?: TagTone;
5
+ icon?: ReactNode;
6
+ /** 传入后显示关闭按钮;列表删除由调用方完成,组件不自行隐藏。 */
7
+ onClose?: () => void;
8
+ closeLabel?: string;
9
+ }
10
+ export declare function Tag({ tone, icon, onClose, closeLabel, children, className, ...props }: TagProps): JSX.Element;
@@ -0,0 +1,13 @@
1
+ import { type ForwardRefExoticComponent, type ReactNode, type RefAttributes, type TextareaHTMLAttributes } from "react";
2
+ export interface TextAreaProps extends Omit<TextareaHTMLAttributes<HTMLTextAreaElement>, "value" | "defaultValue"> {
3
+ value?: string;
4
+ defaultValue?: string;
5
+ onValueChange?: (value: string) => void;
6
+ variant?: "glass" | "fill";
7
+ showCount?: boolean;
8
+ /** 默认不显示原生缩放手柄,保持玻璃边缘完整;需要拖拽时显式开启。 */
9
+ resize?: "none" | "vertical" | "both";
10
+ /** 业务校验错误,覆盖原生约束校验生成的行内提示。 */
11
+ error?: ReactNode;
12
+ }
13
+ export declare const TextArea: ForwardRefExoticComponent<TextAreaProps & RefAttributes<HTMLTextAreaElement>>;
@@ -0,0 +1,35 @@
1
+ import { type JSX, type ReactNode } from "react";
2
+ export interface ToastOptions {
3
+ title: string;
4
+ description?: string;
5
+ tone?: "info" | "success" | "warning" | "error";
6
+ /** 毫秒,0 表示不自动关闭;鼠标悬停、内部焦点或页面隐藏时暂停计时。 */
7
+ duration?: number;
8
+ action?: {
9
+ label: string;
10
+ onClick: () => void;
11
+ };
12
+ onDismiss?: () => void;
13
+ }
14
+ export interface ToastProps extends ToastOptions {
15
+ className?: string;
16
+ closeLabel?: string;
17
+ }
18
+ /** 独立提示视图。全局提示推荐通过 ToastProvider / useToast 管理生命周期。 */
19
+ export declare function Toast({ title, description, tone, duration, action, onDismiss, closeLabel, className, }: ToastProps): JSX.Element;
20
+ export interface ToastApi {
21
+ toast: (options: ToastOptions) => string;
22
+ dismiss: (id: string) => void;
23
+ dismissAll: () => void;
24
+ }
25
+ export interface ToastProviderProps {
26
+ children: ReactNode;
27
+ duration?: number;
28
+ /** 超出数量的提示按顺序等待,显示时才开始计时。 */
29
+ maxVisible?: number;
30
+ position?: "top-right" | "bottom-right" | "bottom-center";
31
+ label?: string;
32
+ closeLabel?: string;
33
+ }
34
+ export declare function ToastProvider({ children, duration, maxVisible, position, label, closeLabel, }: ToastProviderProps): JSX.Element;
35
+ export declare function useToast(): ToastApi;
@@ -0,0 +1,13 @@
1
+ import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
2
+ export interface ToolbarProps extends HTMLAttributes<HTMLDivElement> {
3
+ /**
4
+ * What the bar does when content scrolls under it. `uniform` frosts a band
5
+ * across the whole bar, as on iOS 27; `soft` only blurs it, as on iOS 26.
6
+ */
7
+ edge?: "uniform" | "soft" | "none";
8
+ }
9
+ export type ToolbarGroupProps = HTMLAttributes<HTMLDivElement>;
10
+ /** A bar of actions that stays at the top of what scrolls beneath it. Put its buttons in `ToolbarGroup`s. */
11
+ export declare const Toolbar: ForwardRefExoticComponent<ToolbarProps & RefAttributes<HTMLDivElement>>;
12
+ /** Actions that share one piece of glass in a `Toolbar`. */
13
+ export declare const ToolbarGroup: ForwardRefExoticComponent<ToolbarGroupProps & RefAttributes<HTMLDivElement>>;
@@ -0,0 +1,16 @@
1
+ import { type JSX, type ReactElement, type ReactNode } from "react";
2
+ import { type FloatingSide } from "./internal/floating.js";
3
+ export interface TooltipProps {
4
+ /** 单个可聚焦元素(例如 Button);它需要将 aria-describedby 传到 DOM。 */
5
+ children: ReactElement<{
6
+ "aria-describedby"?: string;
7
+ }>;
8
+ content: ReactNode;
9
+ side?: FloatingSide;
10
+ delay?: number;
11
+ disabled?: boolean;
12
+ open?: boolean;
13
+ defaultOpen?: boolean;
14
+ onOpenChange?: (open: boolean) => void;
15
+ }
16
+ export declare function Tooltip({ children, content, side, delay, disabled, open: controlled, defaultOpen, onOpenChange, }: TooltipProps): JSX.Element;
@@ -0,0 +1,18 @@
1
+ /** 层级资源导航,支持方向键、受控展开与选中;权限和加载由业务决定。 */
2
+ import { type JSX, type ReactNode } from "react";
3
+ export interface TreeNode {
4
+ key: string;
5
+ label: ReactNode;
6
+ children?: readonly TreeNode[];
7
+ disabled?: boolean;
8
+ }
9
+ export interface TreeProps {
10
+ nodes: readonly TreeNode[];
11
+ selectedKey?: string;
12
+ onSelect?: (key: string) => void;
13
+ expandedKeys?: readonly string[];
14
+ defaultExpandedKeys?: readonly string[];
15
+ onExpandedChange?: (keys: string[]) => void;
16
+ "aria-label": string;
17
+ }
18
+ export declare function Tree({ nodes, selectedKey, onSelect, expandedKeys, defaultExpandedKeys, onExpandedChange, "aria-label": label, }: TreeProps): JSX.Element;
@@ -0,0 +1,11 @@
1
+ /** 通用正文与标题排版,调用方决定文档标题层级。 */
2
+ import type { HTMLAttributes, JSX } from "react";
3
+ export interface TypographyProps extends HTMLAttributes<HTMLElement> {
4
+ as?: "p" | "span" | "h1" | "h2" | "h3" | "h4" | "label" | "code";
5
+ tone?: "default" | "muted" | "success" | "warning" | "danger";
6
+ size?: "small" | "regular" | "large";
7
+ weight?: "regular" | "medium" | "semibold";
8
+ truncate?: boolean;
9
+ htmlFor?: string;
10
+ }
11
+ export declare function Typography({ as: Tag, tone, size, weight, truncate, className, ...props }: TypographyProps): JSX.Element;