@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.
- package/LICENSE +22 -0
- package/README.md +58 -2
- package/dist/button-BCSOcrTI.cjs +1 -0
- package/dist/button-SXD_7EGY.js +970 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +4440 -0
- package/dist/styles.css +3804 -0
- package/dist/types/activity-calendar.d.ts +18 -0
- package/dist/types/alert.d.ts +18 -0
- package/dist/types/avatar.d.ts +12 -0
- package/dist/types/badge.d.ts +13 -0
- package/dist/types/button.d.ts +16 -0
- package/dist/types/card.d.ts +10 -0
- package/dist/types/checkbox.d.ts +9 -0
- package/dist/types/command-palette.d.ts +22 -0
- package/dist/types/config-provider.d.ts +62 -0
- package/dist/types/context-menu.d.ts +17 -0
- package/dist/types/data-table.d.ts +32 -0
- package/dist/types/date-range-picker.d.ts +23 -0
- package/dist/types/descriptions.d.ts +13 -0
- package/dist/types/dialog.d.ts +19 -0
- package/dist/types/drawer.d.ts +7 -0
- package/dist/types/empty.d.ts +8 -0
- package/dist/types/filter-bar.d.ts +9 -0
- package/dist/types/form-field.d.ts +19 -0
- package/dist/types/glass-group.d.ts +10 -0
- package/dist/types/glass.d.ts +3 -0
- package/dist/types/import-wizard.d.ts +11 -0
- package/dist/types/index.d.ts +53 -0
- package/dist/types/input.d.ts +11 -0
- package/dist/types/internal/bend.d.ts +15 -0
- package/dist/types/internal/calendar-day.d.ts +13 -0
- package/dist/types/internal/chevron.d.ts +6 -0
- package/dist/types/internal/contour.d.ts +10 -0
- package/dist/types/internal/controllable.d.ts +1 -0
- package/dist/types/internal/cx.d.ts +1 -0
- package/dist/types/internal/date-only.d.ts +4 -0
- package/dist/types/internal/field-error.d.ts +6 -0
- package/dist/types/internal/floating.d.ts +15 -0
- package/dist/types/internal/form-reset.d.ts +3 -0
- package/dist/types/internal/hold.d.ts +8 -0
- package/dist/types/internal/href.d.ts +7 -0
- package/dist/types/internal/jelly.d.ts +22 -0
- package/dist/types/internal/modal.d.ts +11 -0
- package/dist/types/internal/placement.d.ts +33 -0
- package/dist/types/internal/press.d.ts +2 -0
- package/dist/types/internal/range-calendar-navigation.d.ts +6 -0
- package/dist/types/internal/range-calendar.d.ts +11 -0
- package/dist/types/internal/refraction.d.ts +20 -0
- package/dist/types/internal/scroller.d.ts +2 -0
- package/dist/types/internal/sheet-drag.d.ts +17 -0
- package/dist/types/internal/spring.d.ts +13 -0
- package/dist/types/internal/styles.d.ts +5 -0
- package/dist/types/internal/tab-motion.d.ts +2 -0
- package/dist/types/internal/tree-branch.d.ts +13 -0
- package/dist/types/member-picker.d.ts +15 -0
- package/dist/types/menu.d.ts +61 -0
- package/dist/types/message.d.ts +12 -0
- package/dist/types/multi-select.d.ts +25 -0
- package/dist/types/navigation-bar.d.ts +25 -0
- package/dist/types/page-control.d.ts +13 -0
- package/dist/types/pagination.d.ts +12 -0
- package/dist/types/popover.d.ts +20 -0
- package/dist/types/progress.d.ts +10 -0
- package/dist/types/radio.d.ts +8 -0
- package/dist/types/search-field.d.ts +5 -0
- package/dist/types/segmented-control.d.ts +14 -0
- package/dist/types/select.d.ts +20 -0
- package/dist/types/sheet.d.ts +14 -0
- package/dist/types/skeleton.d.ts +9 -0
- package/dist/types/slider.d.ts +10 -0
- package/dist/types/statistic.d.ts +11 -0
- package/dist/types/stepper.d.ts +12 -0
- package/dist/types/style-entry.d.ts +1 -0
- package/dist/types/switch.d.ts +7 -0
- package/dist/types/tab-bar.d.ts +23 -0
- package/dist/types/table.d.ts +22 -0
- package/dist/types/tabs.d.ts +19 -0
- package/dist/types/tag.d.ts +10 -0
- package/dist/types/text-area.d.ts +13 -0
- package/dist/types/toast.d.ts +35 -0
- package/dist/types/toolbar.d.ts +13 -0
- package/dist/types/tooltip.d.ts +16 -0
- package/dist/types/tree.d.ts +18 -0
- package/dist/types/typography.d.ts +11 -0
- package/dist/types/upload.d.ts +15 -0
- package/dist/types/workspace.d.ts +22 -0
- package/dist/workspace.cjs +1 -0
- package/dist/workspace.js +42 -0
- package/package.json +65 -3
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/** 按日期展示活动强度,可用于提交、考勤等数据;日期与统计口径由业务提供。 */
|
|
2
|
+
import { type JSX } from "react";
|
|
3
|
+
export interface ActivityDay {
|
|
4
|
+
date: string;
|
|
5
|
+
value: number;
|
|
6
|
+
label?: string;
|
|
7
|
+
}
|
|
8
|
+
export interface ActivityCalendarProps {
|
|
9
|
+
month: string;
|
|
10
|
+
days: readonly ActivityDay[];
|
|
11
|
+
selectedDate?: string;
|
|
12
|
+
/** 由宿主按业务时区传入今天,避免服务器渲染与浏览器时区不一致。 */
|
|
13
|
+
today?: string;
|
|
14
|
+
onDateSelect?: (date: string) => void;
|
|
15
|
+
onMonthChange?: (month: string) => void;
|
|
16
|
+
"aria-label": string;
|
|
17
|
+
}
|
|
18
|
+
export declare function ActivityCalendar({ month, days, selectedDate, today, onDateSelect, onMonthChange, "aria-label": label, }: ActivityCalendarProps): JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
export interface AlertAction {
|
|
3
|
+
label: ReactNode;
|
|
4
|
+
/** `cancel` is also what Escape does. `destructive` is red. */
|
|
5
|
+
role?: "cancel" | "destructive";
|
|
6
|
+
onSelect?: () => void;
|
|
7
|
+
}
|
|
8
|
+
export interface AlertProps {
|
|
9
|
+
open?: boolean;
|
|
10
|
+
defaultOpen?: boolean;
|
|
11
|
+
onOpenChange?: (open: boolean) => void;
|
|
12
|
+
title: ReactNode;
|
|
13
|
+
message?: ReactNode;
|
|
14
|
+
actions: AlertAction[];
|
|
15
|
+
className?: string;
|
|
16
|
+
}
|
|
17
|
+
/** The iOS alert: a modal question with a row of pill buttons. Closes when an action is chosen. */
|
|
18
|
+
export declare function Alert({ open: openProp, defaultOpen, onOpenChange, title, message, actions, className, }: AlertProps): JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
2
|
+
export interface AvatarProps extends HTMLAttributes<HTMLSpanElement> {
|
|
3
|
+
src?: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
/** 图片加载失败或未提供时,优先显示 children,再显示姓名首字。 */
|
|
6
|
+
name?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
size?: "small" | "regular" | "large" | number;
|
|
9
|
+
shape?: "circle" | "rounded";
|
|
10
|
+
onImageError?: () => void;
|
|
11
|
+
}
|
|
12
|
+
export declare function Avatar({ src, alt, name, children, size, shape, onImageError, className, style, ...props }: AvatarProps): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { HTMLAttributes, JSX, ReactNode } from "react";
|
|
2
|
+
import type { TagTone } from "./tag.js";
|
|
3
|
+
export interface BadgeProps extends HTMLAttributes<HTMLSpanElement> {
|
|
4
|
+
count?: number;
|
|
5
|
+
max?: number;
|
|
6
|
+
dot?: boolean;
|
|
7
|
+
showZero?: boolean;
|
|
8
|
+
tone?: TagTone;
|
|
9
|
+
children?: ReactNode;
|
|
10
|
+
/** 点状徽标应提供描述,例如“有未读消息”。 */
|
|
11
|
+
label?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function Badge({ count, max, dot, showZero, tone, label, children, className, ...props }: BadgeProps): JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ButtonHTMLAttributes, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
3
|
+
/** 等待期间保留按钮名称,阻止重复点击和表单提交。 */
|
|
4
|
+
loading?: boolean;
|
|
5
|
+
/** Shown before the label. On its own, the button is a circle; give it an `aria-label`. */
|
|
6
|
+
icon?: ReactNode;
|
|
7
|
+
/** `glass` is clear; `filled` fills it with the accent colour, for the primary action. */
|
|
8
|
+
variant?: "glass" | "filled";
|
|
9
|
+
/** 统一控件高度:小号 32、常规 40、大号 48px;触屏至少 44px。 */
|
|
10
|
+
size?: "small" | "regular" | "large";
|
|
11
|
+
/** Marks an action that deletes or can't be undone. Shorthand for a red `tint`. */
|
|
12
|
+
destructive?: boolean;
|
|
13
|
+
/** Any CSS colour. Tints a glass button's label, or a filled button's fill. */
|
|
14
|
+
tint?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare const Button: ForwardRefExoticComponent<ButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
export interface CardProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
title?: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
extra?: ReactNode;
|
|
6
|
+
cover?: ReactNode;
|
|
7
|
+
footer?: ReactNode;
|
|
8
|
+
padding?: "small" | "regular" | "large";
|
|
9
|
+
}
|
|
10
|
+
export declare const Card: ForwardRefExoticComponent<CardProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type InputHTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
export interface CheckboxProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "type" | "children"> {
|
|
3
|
+
children?: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
/** 半选状态独立于 checked,适合“全选”;由调用方根据子项计算。 */
|
|
6
|
+
indeterminate?: boolean;
|
|
7
|
+
onCheckedChange?: (checked: boolean) => void;
|
|
8
|
+
}
|
|
9
|
+
export declare const Checkbox: ForwardRefExoticComponent<CheckboxProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** 应用级快捷命令入口。命令、搜索范围和执行行为由接入项目提供。 */
|
|
2
|
+
import { type JSX, type RefObject } from "react";
|
|
3
|
+
export interface PaletteCommand {
|
|
4
|
+
id: string;
|
|
5
|
+
title: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
group?: string;
|
|
8
|
+
keywords?: readonly string[];
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
onSelect: () => void;
|
|
11
|
+
}
|
|
12
|
+
export interface CommandPaletteProps {
|
|
13
|
+
open: boolean;
|
|
14
|
+
onOpenChange: (open: boolean) => void;
|
|
15
|
+
commands: readonly PaletteCommand[];
|
|
16
|
+
title?: string;
|
|
17
|
+
/** 应用只为一个命令面板启用全局 Cmd/Ctrl+K。 */
|
|
18
|
+
shortcut?: boolean;
|
|
19
|
+
/** 按钮打开时传入触发按钮;快捷键打开时可传入工作区的返回入口。 */
|
|
20
|
+
returnFocusRef?: RefObject<HTMLElement | null>;
|
|
21
|
+
}
|
|
22
|
+
export declare function CommandPalette({ open, onOpenChange, commands, title, shortcut, returnFocusRef, }: CommandPaletteProps): JSX.Element;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/** 跨页面的主题、语言与布局配置。嵌套配置继承未指定的选项。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface Locale {
|
|
4
|
+
languageTag: string;
|
|
5
|
+
cancel: string;
|
|
6
|
+
applyRange: string;
|
|
7
|
+
invalidDateRange: string;
|
|
8
|
+
requiredDateRange: string;
|
|
9
|
+
close: string;
|
|
10
|
+
choose: string;
|
|
11
|
+
pagination: string;
|
|
12
|
+
dateRange: string;
|
|
13
|
+
resetFilters: string;
|
|
14
|
+
increase: string;
|
|
15
|
+
decrease: string;
|
|
16
|
+
showTabs: string;
|
|
17
|
+
previousMonth: string;
|
|
18
|
+
nextMonth: string;
|
|
19
|
+
calendarMonth: (month: string) => string;
|
|
20
|
+
activeDays: (count: number) => string;
|
|
21
|
+
lessActivity: string;
|
|
22
|
+
moreActivity: string;
|
|
23
|
+
weekdays: readonly string[];
|
|
24
|
+
selectRow: (key: string) => string;
|
|
25
|
+
chooseAtLeastOne: string;
|
|
26
|
+
dropFiles: string;
|
|
27
|
+
tooManyFiles: (maximum: number) => string;
|
|
28
|
+
invalidFile: (name: string) => string;
|
|
29
|
+
clear: string;
|
|
30
|
+
previous: string;
|
|
31
|
+
next: string;
|
|
32
|
+
loading: string;
|
|
33
|
+
empty: string;
|
|
34
|
+
retry: string;
|
|
35
|
+
selectAll: string;
|
|
36
|
+
columns: string;
|
|
37
|
+
search: string;
|
|
38
|
+
startDate: string;
|
|
39
|
+
endDate: string;
|
|
40
|
+
page: (page: number) => string;
|
|
41
|
+
pageSize: string;
|
|
42
|
+
pageSizeOption: (size: number) => string;
|
|
43
|
+
total: (total: number) => string;
|
|
44
|
+
}
|
|
45
|
+
export declare const zhCN: Locale;
|
|
46
|
+
export declare const enUS: Locale;
|
|
47
|
+
export interface LiquidGlassConfig {
|
|
48
|
+
locale: Locale;
|
|
49
|
+
density: "comfortable" | "compact";
|
|
50
|
+
direction: "ltr" | "rtl";
|
|
51
|
+
}
|
|
52
|
+
export declare function useConfig(): LiquidGlassConfig;
|
|
53
|
+
export interface ConfigProviderProps extends Omit<HTMLAttributes<HTMLDivElement>, "dir"> {
|
|
54
|
+
children: ReactNode;
|
|
55
|
+
locale?: Partial<Locale>;
|
|
56
|
+
density?: LiquidGlassConfig["density"];
|
|
57
|
+
direction?: LiquidGlassConfig["direction"];
|
|
58
|
+
theme?: "light" | "dark";
|
|
59
|
+
/** 仅覆盖显式指定的 CSS token,例如 --lg-fill、--lg-foreground。 */
|
|
60
|
+
tokens?: Record<`--lg-${string}`, string | number>;
|
|
61
|
+
}
|
|
62
|
+
export declare function ConfigProvider({ locale, density, direction, theme, tokens, children, style, ...props }: ConfigProviderProps): JSX.Element;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { type JSX, type ReactNode } from "react";
|
|
2
|
+
import type { MenuEntry } from "./menu.js";
|
|
3
|
+
export interface ContextMenuProps {
|
|
4
|
+
items: MenuEntry[];
|
|
5
|
+
open?: boolean;
|
|
6
|
+
defaultOpen?: boolean;
|
|
7
|
+
onOpenChange?: (open: boolean) => void;
|
|
8
|
+
/** The element to hold down, or right-click. */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
className?: string;
|
|
11
|
+
"aria-label"?: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Holding the element down, or right-clicking it, lifts a copy of it over a dimmed
|
|
15
|
+
* page and opens a menu beside it.
|
|
16
|
+
*/
|
|
17
|
+
export declare function ContextMenu({ items, open: openProp, defaultOpen, onOpenChange, children, className, "aria-label": label }: ContextMenuProps): JSX.Element;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/** 管理列表组合,支持可控排序、跨页选择、列显隐和服务端分页,不负责请求数据。 */
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
import { type PaginationProps } from "./pagination.js";
|
|
4
|
+
import { type TableColumn, type TableProps } from "./table.js";
|
|
5
|
+
export interface DataTableColumn<T> extends TableColumn<T> {
|
|
6
|
+
/** 提供比较器可在本页排序,manualSorting 时只发送排序事件。 */
|
|
7
|
+
compare?: (left: T, right: T) => number;
|
|
8
|
+
sortable?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TableSort {
|
|
11
|
+
key: string;
|
|
12
|
+
direction: "asc" | "desc";
|
|
13
|
+
}
|
|
14
|
+
export interface RowSelection {
|
|
15
|
+
keys: readonly string[];
|
|
16
|
+
onChange: (keys: string[]) => void;
|
|
17
|
+
}
|
|
18
|
+
export interface DataTableProps<T> extends Omit<TableProps<T>, "columns"> {
|
|
19
|
+
columns: readonly DataTableColumn<T>[];
|
|
20
|
+
sort?: TableSort | null;
|
|
21
|
+
defaultSort?: TableSort | null;
|
|
22
|
+
onSortChange?: (sort: TableSort | null) => void;
|
|
23
|
+
manualSorting?: boolean;
|
|
24
|
+
selection?: RowSelection;
|
|
25
|
+
pagination?: PaginationProps;
|
|
26
|
+
loading?: boolean;
|
|
27
|
+
error?: string;
|
|
28
|
+
onRetry?: () => void;
|
|
29
|
+
toolbar?: ReactNode;
|
|
30
|
+
bulkActions?: (keys: readonly string[]) => ReactNode;
|
|
31
|
+
}
|
|
32
|
+
export declare function DataTable<T>({ columns, data, rowKey, sort, defaultSort, onSortChange, manualSorting, selection, pagination, loading, error, onRetry, toolbar, bulkActions, ...tableProps }: DataTableProps<T>): JSX.Element;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/** 日期范围选择:统一玻璃触发框与日历浮层,业务值始终是日期字符串。 */
|
|
2
|
+
import { type JSX } from "react";
|
|
3
|
+
export interface DateRange {
|
|
4
|
+
start: string;
|
|
5
|
+
end: string;
|
|
6
|
+
}
|
|
7
|
+
export interface DateRangePickerProps {
|
|
8
|
+
value?: DateRange;
|
|
9
|
+
defaultValue?: DateRange;
|
|
10
|
+
onValueChange?: (value: DateRange) => void;
|
|
11
|
+
names?: {
|
|
12
|
+
start: string;
|
|
13
|
+
end: string;
|
|
14
|
+
};
|
|
15
|
+
min?: string;
|
|
16
|
+
max?: string;
|
|
17
|
+
/** 由业务按所用时区提供今天,截图或服务端渲染时可传入稳定值。 */
|
|
18
|
+
today?: string;
|
|
19
|
+
required?: boolean;
|
|
20
|
+
disabled?: boolean;
|
|
21
|
+
"aria-label"?: string;
|
|
22
|
+
}
|
|
23
|
+
export declare function DateRangePicker({ value, defaultValue, onValueChange, names, min, max, today, required, disabled, "aria-label": label, }: DateRangePickerProps): JSX.Element;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** 详情页的只读字段展示,使用 dl/dt/dd 保持标签和值的语义。 */
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface DescriptionItem {
|
|
4
|
+
key: string;
|
|
5
|
+
label: ReactNode;
|
|
6
|
+
value: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export interface DescriptionsProps {
|
|
9
|
+
items: readonly DescriptionItem[];
|
|
10
|
+
columns?: 1 | 2 | 3;
|
|
11
|
+
className?: string;
|
|
12
|
+
}
|
|
13
|
+
export declare function Descriptions({ items, columns, className, }: DescriptionsProps): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** 通用模态内容容器,用于详情、表单与确认流程;原生 dialog 管理焦点与嵌套层级。 */
|
|
2
|
+
import { type JSX, type ReactNode, type RefObject } from "react";
|
|
3
|
+
export interface DialogProps {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onOpenChange: (open: boolean) => void;
|
|
6
|
+
title: ReactNode;
|
|
7
|
+
description?: ReactNode;
|
|
8
|
+
children?: ReactNode;
|
|
9
|
+
footer?: ReactNode;
|
|
10
|
+
size?: "small" | "regular" | "large";
|
|
11
|
+
/** 异步提交期间可禁用关闭,退出动画仍由受控 open 驱动。 */
|
|
12
|
+
dismissible?: boolean;
|
|
13
|
+
/** 内容进入模态层后聚焦的控件,省略时聚焦容器。 */
|
|
14
|
+
initialFocusRef?: RefObject<HTMLElement | null>;
|
|
15
|
+
/** 关闭后返回的触发控件,受控弹窗应提供,以兼容 Safari 的鼠标焦点行为。 */
|
|
16
|
+
returnFocusRef?: RefObject<HTMLElement | null>;
|
|
17
|
+
className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function Dialog({ open, onOpenChange, title, description, children, footer, size, dismissible, initialFocusRef, returnFocusRef, className, }: DialogProps): JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/** 桌面侧边面板,共用 Dialog 的焦点、关闭与异步操作约束。 */
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
import { type DialogProps } from "./dialog.js";
|
|
4
|
+
export interface DrawerProps extends DialogProps {
|
|
5
|
+
side?: "start" | "end";
|
|
6
|
+
}
|
|
7
|
+
export declare function Drawer({ side, className, ...props }: DrawerProps): JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HTMLAttributes, JSX, ReactNode } from "react";
|
|
2
|
+
export interface EmptyProps extends Omit<HTMLAttributes<HTMLDivElement>, "title"> {
|
|
3
|
+
title?: ReactNode;
|
|
4
|
+
description?: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
children?: ReactNode;
|
|
7
|
+
}
|
|
8
|
+
export declare function Empty({ title, description, icon, children, className, ...props }: EmptyProps): JSX.Element;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/** 列表筛选操作区,由页面持有查询条件并处理提交和重置。 */
|
|
2
|
+
import type { FormHTMLAttributes, JSX, ReactNode } from "react";
|
|
3
|
+
export interface FilterBarProps extends FormHTMLAttributes<HTMLFormElement> {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
onClear?: () => void;
|
|
6
|
+
clearLabel?: string;
|
|
7
|
+
actions?: ReactNode;
|
|
8
|
+
}
|
|
9
|
+
export declare function FilterBar({ children, onClear, clearLabel, actions, className, ...props }: FilterBarProps): JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** 表单项布局与可访问性关联,可接入原生表单或任意表单状态库。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface FieldControlProps {
|
|
4
|
+
id: string;
|
|
5
|
+
required?: boolean;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
"aria-describedby"?: string;
|
|
8
|
+
"aria-invalid"?: true;
|
|
9
|
+
}
|
|
10
|
+
export interface FormFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "children"> {
|
|
11
|
+
id?: string;
|
|
12
|
+
label: ReactNode;
|
|
13
|
+
description?: ReactNode;
|
|
14
|
+
error?: ReactNode;
|
|
15
|
+
required?: boolean;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
children: (props: FieldControlProps) => ReactNode;
|
|
18
|
+
}
|
|
19
|
+
export declare function FormField({ id, label, description, error, required, disabled, children, className, ...props }: FormFieldProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type RefAttributes } from "react";
|
|
2
|
+
export interface GlassGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
3
|
+
/** Glass closer together than this flows into one shape, in points. */
|
|
4
|
+
spacing?: number;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* The glass inside share one surface, as in an iOS `GlassEffectContainer`: pieces
|
|
8
|
+
* that come close flow together, and part again as they move away.
|
|
9
|
+
*/
|
|
10
|
+
export declare const GlassGroup: ForwardRefExoticComponent<GlassGroupProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/** 文件导入流程。解析和发布由回调提供,状态分支保留当前文件与预览。 */
|
|
2
|
+
import { type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface ImportWizardProps<T> {
|
|
4
|
+
inspect: (files: readonly File[], signal: AbortSignal) => Promise<T>;
|
|
5
|
+
publish: (preview: T, signal: AbortSignal) => Promise<void>;
|
|
6
|
+
renderPreview: (preview: T) => ReactNode;
|
|
7
|
+
accept?: string;
|
|
8
|
+
maxBytes?: number;
|
|
9
|
+
title?: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
export declare function ImportWizard<T>({ inspect, publish, renderPreview, accept, maxBytes, title, }: ImportWizardProps<T>): JSX.Element;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import "./style-entry.js";
|
|
2
|
+
export { Alert, type AlertAction, type AlertProps } from "./alert.js";
|
|
3
|
+
export { Button, type ButtonProps } from "./button.js";
|
|
4
|
+
export { Glass, type GlassProps } from "./glass.js";
|
|
5
|
+
export { ContextMenu, type ContextMenuProps } from "./context-menu.js";
|
|
6
|
+
export { GlassGroup, type GlassGroupProps } from "./glass-group.js";
|
|
7
|
+
export { Input, type InputProps } from "./input.js";
|
|
8
|
+
export { Menu, type MenuEntry, type MenuItem, type MenuProps } from "./menu.js";
|
|
9
|
+
export { Message, type MessageProps } from "./message.js";
|
|
10
|
+
export { NavigationBar, type NavigationBarProps } from "./navigation-bar.js";
|
|
11
|
+
export { PageControl, type PageControlProps } from "./page-control.js";
|
|
12
|
+
export { Progress, Spinner, type ProgressProps, type SpinnerProps, } from "./progress.js";
|
|
13
|
+
export { SearchField, type SearchFieldProps } from "./search-field.js";
|
|
14
|
+
export { SegmentedControl, type SegmentedControlProps, type SegmentedItem, } from "./segmented-control.js";
|
|
15
|
+
export { Sheet, type SheetDetent, type SheetProps } from "./sheet.js";
|
|
16
|
+
export { Slider, type SliderProps } from "./slider.js";
|
|
17
|
+
export { Stepper, type StepperProps } from "./stepper.js";
|
|
18
|
+
export { Switch, type SwitchProps } from "./switch.js";
|
|
19
|
+
export { TabBar, type TabBarItem, type TabBarProps } from "./tab-bar.js";
|
|
20
|
+
export { Toolbar, ToolbarGroup, type ToolbarGroupProps, type ToolbarProps, } from "./toolbar.js";
|
|
21
|
+
export { Checkbox, type CheckboxProps } from "./checkbox.js";
|
|
22
|
+
export { Radio, type RadioProps } from "./radio.js";
|
|
23
|
+
export { Select, type SelectOption, type SelectProps } from "./select.js";
|
|
24
|
+
export { TextArea, type TextAreaProps } from "./text-area.js";
|
|
25
|
+
export { Card, type CardProps } from "./card.js";
|
|
26
|
+
export { Tooltip, type TooltipProps } from "./tooltip.js";
|
|
27
|
+
export { Popover, type PopoverProps } from "./popover.js";
|
|
28
|
+
export { Toast, ToastProvider, useToast, type ToastProps, type ToastOptions, type ToastProviderProps, type ToastApi, } from "./toast.js";
|
|
29
|
+
export { Tag, type TagProps, type TagTone } from "./tag.js";
|
|
30
|
+
export { Badge, type BadgeProps } from "./badge.js";
|
|
31
|
+
export { Avatar, type AvatarProps } from "./avatar.js";
|
|
32
|
+
export { Empty, type EmptyProps } from "./empty.js";
|
|
33
|
+
export { Skeleton, type SkeletonProps } from "./skeleton.js";
|
|
34
|
+
export { ConfigProvider, useConfig, zhCN, enUS, type Locale, type ConfigProviderProps, type LiquidGlassConfig, } from "./config-provider.js";
|
|
35
|
+
export { Typography, type TypographyProps } from "./typography.js";
|
|
36
|
+
export { FormField, type FormFieldProps, type FieldControlProps, } from "./form-field.js";
|
|
37
|
+
export { Dialog, type DialogProps } from "./dialog.js";
|
|
38
|
+
export { Tabs, type TabsProps, type TabItem } from "./tabs.js";
|
|
39
|
+
export { Table, type TableProps, type TableColumn } from "./table.js";
|
|
40
|
+
export { Pagination, type PaginationProps } from "./pagination.js";
|
|
41
|
+
export { DateRangePicker, type DateRangePickerProps, type DateRange, } from "./date-range-picker.js";
|
|
42
|
+
export { DataTable, type DataTableProps, type DataTableColumn, type TableSort, type RowSelection, } from "./data-table.js";
|
|
43
|
+
export { FilterBar, type FilterBarProps } from "./filter-bar.js";
|
|
44
|
+
export { MultiSelect, type MultiSelectProps, type MultiSelectOption, } from "./multi-select.js";
|
|
45
|
+
export { Upload, type UploadProps } from "./upload.js";
|
|
46
|
+
export { Drawer, type DrawerProps } from "./drawer.js";
|
|
47
|
+
export { Tree, type TreeProps, type TreeNode } from "./tree.js";
|
|
48
|
+
export { Descriptions, type DescriptionsProps, type DescriptionItem, } from "./descriptions.js";
|
|
49
|
+
export { Statistic, type StatisticProps } from "./statistic.js";
|
|
50
|
+
export { MemberPicker, type MemberPickerProps, type MemberOption, } from "./member-picker.js";
|
|
51
|
+
export { ImportWizard, type ImportWizardProps } from "./import-wizard.js";
|
|
52
|
+
export { ActivityCalendar, type ActivityCalendarProps, type ActivityDay, } from "./activity-calendar.js";
|
|
53
|
+
export { CommandPalette, type CommandPaletteProps, type PaletteCommand, } from "./command-palette.js";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type ForwardRefExoticComponent, type InputHTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
2
|
+
export interface InputProps extends Omit<InputHTMLAttributes<HTMLInputElement>, "value" | "defaultValue" | "onChange"> {
|
|
3
|
+
value?: string;
|
|
4
|
+
defaultValue?: string;
|
|
5
|
+
onValueChange?: (value: string) => void;
|
|
6
|
+
/** Shown before the text, such as a person or envelope glyph. */
|
|
7
|
+
icon?: ReactNode;
|
|
8
|
+
/** `glass` floats over content; `fill` is the plain field iOS puts under a large title. */
|
|
9
|
+
variant?: "glass" | "fill";
|
|
10
|
+
}
|
|
11
|
+
export declare const Input: ForwardRefExoticComponent<InputProps & RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** How far in, in px, the rim reaches for what it shows at its very edge. */
|
|
2
|
+
export declare const BEND_REACH = 7;
|
|
3
|
+
/** How wide the band round the rim that bends is, in px. */
|
|
4
|
+
export declare const BEND_BAND = 15;
|
|
5
|
+
/** How much further red bends than green, and blue less, as a share of the bend. */
|
|
6
|
+
export declare const BEND_SPLIT = 0.14;
|
|
7
|
+
/** How far, in px, what the rim bends is softened, as iOS softens it. */
|
|
8
|
+
export declare const BEND_BLUR = 0.9;
|
|
9
|
+
/** The bend grows with the lift in this many steps. Each is a filter of its own. */
|
|
10
|
+
export declare const BEND_STEPS = 8;
|
|
11
|
+
/**
|
|
12
|
+
* Filters that bend the rim of a capsule `width` by `height`, from barely to
|
|
13
|
+
* fully, one for each step of the lift. Index 0 is the first step, not none.
|
|
14
|
+
*/
|
|
15
|
+
export declare function bendFilters(width: number, height: number, dark: boolean): string[];
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** 活动日历的单个日期单元,分开表达日期、活动强度、今天与选中状态。 */
|
|
2
|
+
import type { JSX } from "react";
|
|
3
|
+
export interface CalendarDayProps {
|
|
4
|
+
date: string;
|
|
5
|
+
label: string;
|
|
6
|
+
level: number;
|
|
7
|
+
selected: boolean;
|
|
8
|
+
today: boolean;
|
|
9
|
+
focusable: boolean;
|
|
10
|
+
onFocus: (date: string) => void;
|
|
11
|
+
onSelect?: (date: string) => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function CalendarDay({ date, label, level, selected, today, focusable, onFocus, onSelect, }: CalendarDayProps): JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export interface RoundedRect {
|
|
2
|
+
x: number;
|
|
3
|
+
y: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
radius: number;
|
|
7
|
+
}
|
|
8
|
+
export declare function blended(rects: RoundedRect[], spacing: number, px: number, py: number): number;
|
|
9
|
+
/** The outline of the blended shapes, as an SVG path, by marching squares. */
|
|
10
|
+
export declare function outline(rects: RoundedRect[], spacing: number, width: number, height: number, step?: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function useControllable<T, U extends T = T>(value: T | undefined, defaultValue: T, onChange: ((value: U) => void) | undefined): [T, (next: U) => void];
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function cx(...names: (string | false | null | undefined)[]): string;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type HTMLAttributes, type JSX, type RefObject } from "react";
|
|
2
|
+
export type FloatingSide = "top" | "bottom" | "left" | "right";
|
|
3
|
+
export type DismissReason = "escape" | "outside" | "focus";
|
|
4
|
+
interface FloatingProps extends HTMLAttributes<HTMLDivElement> {
|
|
5
|
+
anchor: RefObject<HTMLElement | null>;
|
|
6
|
+
side?: FloatingSide;
|
|
7
|
+
align?: "start" | "center" | "end";
|
|
8
|
+
onDismiss: (reason: DismissReason) => void;
|
|
9
|
+
focusOnOpen?: boolean;
|
|
10
|
+
dismissOnBlur?: boolean;
|
|
11
|
+
/** 大型日历可在空间不足时覆盖触发器,优先使用完整视口高度。 */
|
|
12
|
+
allowAnchorOverlap?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function Floating({ anchor, side, align, onDismiss, focusOnOpen, dismissOnBlur, allowAnchorOverlap, className, children, ...props }: FloatingProps): JSX.Element;
|
|
15
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How long a touch rests on a control before it belongs to the control rather
|
|
3
|
+
* than the page, as with UIScrollView's delay before its controls take a
|
|
4
|
+
* touch. A quick swipe that starts on a control still scrolls the page; a
|
|
5
|
+
* press held this long, or a drag already under way, keeps the touch.
|
|
6
|
+
*/
|
|
7
|
+
export declare const HOLD = 150;
|
|
8
|
+
export declare const held: (at: number, moved: boolean) => boolean;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns `href` if it is safe to navigate to, and `undefined` if it isn't.
|
|
3
|
+
* Relative links and http, https, mailto, tel and sms links are safe; anything
|
|
4
|
+
* else, such as `javascript:` or `data:`, would run script from a string that
|
|
5
|
+
* may have come from untrusted data.
|
|
6
|
+
*/
|
|
7
|
+
export declare function safeHref(href: string | undefined): string | undefined;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface Squash {
|
|
2
|
+
/** Scale along the drag. */
|
|
3
|
+
x: number;
|
|
4
|
+
/** Scale across it. */
|
|
5
|
+
y: number;
|
|
6
|
+
/** How far the body trails the place it was taken to, in px, negative behind it. */
|
|
7
|
+
shift: number;
|
|
8
|
+
}
|
|
9
|
+
export declare const FLAT: Squash;
|
|
10
|
+
/** The shape of a lens `length` long that trails its place by `lag` px, as far as `trail` of it shows. */
|
|
11
|
+
export declare function squash(lag: number, length: number, trail?: number): Squash;
|
|
12
|
+
export interface Jelly {
|
|
13
|
+
/** Takes the lens to a place along its drag. `instant` puts it there with nothing trailing. */
|
|
14
|
+
follow(position: number, instant?: boolean): void;
|
|
15
|
+
stop(): void;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Follows a lens's place and reports its shape each frame it changes. `trail` is how much
|
|
19
|
+
* of the lag the body itself shows, for a lens that's moved straight to the finger: one
|
|
20
|
+
* already carried on a spring of its own trails enough by itself, and passes 0.
|
|
21
|
+
*/
|
|
22
|
+
export declare function createJelly(length: () => number, paint: (shape: Squash) => void, trail?: number): Jelly;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type RefObject } from "react";
|
|
2
|
+
export type ModalPhase = "closed" | "open" | "leaving";
|
|
3
|
+
/**
|
|
4
|
+
* Keeps a <dialog> in the top layer from when `open` turns true until `finished`
|
|
5
|
+
* is called after it turns false, so it has time to animate out.
|
|
6
|
+
*/
|
|
7
|
+
export declare function useModal(ref: RefObject<HTMLDialogElement | null>, open: boolean, requestClose: () => void, returnFocusRef?: RefObject<HTMLElement | null>): {
|
|
8
|
+
phase: ModalPhase;
|
|
9
|
+
finished: () => void;
|
|
10
|
+
};
|
|
11
|
+
export declare const reducedMotion: () => boolean;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface Rect {
|
|
2
|
+
left: number;
|
|
3
|
+
top: number;
|
|
4
|
+
width: number;
|
|
5
|
+
height: number;
|
|
6
|
+
}
|
|
7
|
+
export interface Placement {
|
|
8
|
+
left: number;
|
|
9
|
+
top: number;
|
|
10
|
+
/** Which way the menu grows from its trigger. */
|
|
11
|
+
side: "bottom" | "top";
|
|
12
|
+
/** The menu's height once placed: its own, or the room there is, when that's less. */
|
|
13
|
+
height: number;
|
|
14
|
+
/** Whether the menu is taller than the room, so its items scroll. */
|
|
15
|
+
scrolls: boolean;
|
|
16
|
+
}
|
|
17
|
+
/** The space kept between a menu and the edges of the window. */
|
|
18
|
+
export declare const EDGE = 8;
|
|
19
|
+
/**
|
|
20
|
+
* Where a menu goes, given its trigger and its own size.
|
|
21
|
+
*
|
|
22
|
+
* As on iOS, the menu covers its trigger: it starts at the trigger's top and grows down, or,
|
|
23
|
+
* when there isn't room below, starts at its bottom and grows up. It centres on the trigger, or lines
|
|
24
|
+
* up with its leading or trailing edge, then moves in from the window's edge if it would cross
|
|
25
|
+
* it. A menu taller than either side takes the bigger one and scrolls.
|
|
26
|
+
*/
|
|
27
|
+
export declare function placeMenu(trigger: Rect, menu: {
|
|
28
|
+
width: number;
|
|
29
|
+
height: number;
|
|
30
|
+
}, align: "start" | "center" | "end", viewport: {
|
|
31
|
+
width: number;
|
|
32
|
+
height: number;
|
|
33
|
+
}): Placement;
|