@lec-space/liquidglass 0.0.0-stage → 1.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +22 -0
- package/README.md +60 -2
- package/dist/button-DSXdLDuQ.js +1051 -0
- package/dist/button-EFLg6M7I.cjs +1 -0
- package/dist/index.cjs +2 -0
- package/dist/index.js +8931 -0
- package/dist/styles.css +7101 -0
- package/dist/types/accordion.d.ts +33 -0
- package/dist/types/activity-calendar.d.ts +18 -0
- package/dist/types/alert.d.ts +18 -0
- package/dist/types/aspect-ratio.d.ts +10 -0
- package/dist/types/autocomplete.d.ts +41 -0
- package/dist/types/avatar-group.d.ts +16 -0
- package/dist/types/avatar.d.ts +12 -0
- package/dist/types/badge.d.ts +13 -0
- package/dist/types/box.d.ts +12 -0
- package/dist/types/breadcrumbs.d.ts +31 -0
- package/dist/types/button-group.d.ts +12 -0
- package/dist/types/button.d.ts +16 -0
- package/dist/types/calendar.d.ts +23 -0
- package/dist/types/card.d.ts +10 -0
- package/dist/types/checkbox-group.d.ts +39 -0
- package/dist/types/checkbox.d.ts +9 -0
- package/dist/types/close-button.d.ts +11 -0
- package/dist/types/color-area.d.ts +15 -0
- package/dist/types/color-field.d.ts +15 -0
- package/dist/types/color-picker.d.ts +21 -0
- package/dist/types/color-slider.d.ts +21 -0
- package/dist/types/color-swatch-picker.d.ts +24 -0
- package/dist/types/color-swatch.d.ts +15 -0
- package/dist/types/combo-box.d.ts +37 -0
- package/dist/types/command-palette.d.ts +22 -0
- package/dist/types/config-provider.d.ts +100 -0
- package/dist/types/confirm.d.ts +22 -0
- package/dist/types/container.d.ts +12 -0
- package/dist/types/context-menu.d.ts +17 -0
- package/dist/types/data-table.d.ts +32 -0
- package/dist/types/date-field.d.ts +25 -0
- package/dist/types/date-picker.d.ts +29 -0
- package/dist/types/date-range-picker.d.ts +23 -0
- package/dist/types/description.d.ts +8 -0
- package/dist/types/descriptions.d.ts +13 -0
- package/dist/types/dialog.d.ts +19 -0
- package/dist/types/disclosure-group.d.ts +18 -0
- package/dist/types/disclosure.d.ts +31 -0
- package/dist/types/drawer.d.ts +7 -0
- package/dist/types/empty.d.ts +8 -0
- package/dist/types/field-error.d.ts +12 -0
- package/dist/types/fieldset.d.ts +12 -0
- package/dist/types/filter-bar.d.ts +9 -0
- package/dist/types/flex.d.ts +32 -0
- package/dist/types/form-field.d.ts +19 -0
- package/dist/types/form.d.ts +12 -0
- package/dist/types/glass-group.d.ts +10 -0
- package/dist/types/glass.d.ts +3 -0
- package/dist/types/grid.d.ts +30 -0
- package/dist/types/import-wizard.d.ts +11 -0
- package/dist/types/index.d.ts +107 -0
- package/dist/types/input-group.d.ts +22 -0
- package/dist/types/input-otp.d.ts +29 -0
- package/dist/types/input.d.ts +13 -0
- package/dist/types/internal/bend.d.ts +15 -0
- package/dist/types/internal/calendar-day.d.ts +13 -0
- package/dist/types/internal/chevron.d.ts +6 -0
- package/dist/types/internal/color.d.ts +29 -0
- package/dist/types/internal/contour.d.ts +10 -0
- package/dist/types/internal/controllable.d.ts +1 -0
- package/dist/types/internal/cx.d.ts +1 -0
- package/dist/types/internal/date-only.d.ts +4 -0
- package/dist/types/internal/field-error.d.ts +6 -0
- package/dist/types/internal/floating.d.ts +15 -0
- package/dist/types/internal/form-context.d.ts +5 -0
- package/dist/types/internal/form-reset.d.ts +3 -0
- package/dist/types/internal/hold.d.ts +8 -0
- package/dist/types/internal/href.d.ts +7 -0
- package/dist/types/internal/jelly.d.ts +22 -0
- package/dist/types/internal/layout-style.d.ts +62 -0
- package/dist/types/internal/modal.d.ts +11 -0
- package/dist/types/internal/placement.d.ts +33 -0
- package/dist/types/internal/press.d.ts +2 -0
- package/dist/types/internal/range-calendar-navigation.d.ts +6 -0
- package/dist/types/internal/range-calendar.d.ts +11 -0
- package/dist/types/internal/refraction.d.ts +20 -0
- package/dist/types/internal/schedule-utils.d.ts +32 -0
- package/dist/types/internal/scroller.d.ts +2 -0
- package/dist/types/internal/sheet-drag.d.ts +17 -0
- package/dist/types/internal/spring.d.ts +13 -0
- package/dist/types/internal/styles.d.ts +5 -0
- package/dist/types/internal/tab-motion.d.ts +2 -0
- package/dist/types/internal/tree-branch.d.ts +13 -0
- package/dist/types/kbd.d.ts +13 -0
- package/dist/types/label.d.ts +12 -0
- package/dist/types/link.d.ts +19 -0
- package/dist/types/list-box.d.ts +39 -0
- package/dist/types/loading-overlay.d.ts +17 -0
- package/dist/types/member-picker.d.ts +15 -0
- package/dist/types/mention.d.ts +44 -0
- package/dist/types/menu.d.ts +61 -0
- package/dist/types/message.d.ts +12 -0
- package/dist/types/meter.d.ts +28 -0
- package/dist/types/multi-select.d.ts +25 -0
- package/dist/types/navigation-bar.d.ts +25 -0
- package/dist/types/number-field.d.ts +25 -0
- package/dist/types/page-control.d.ts +13 -0
- package/dist/types/pagination.d.ts +12 -0
- package/dist/types/popover.d.ts +20 -0
- package/dist/types/progress-circle.d.ts +20 -0
- package/dist/types/progress.d.ts +10 -0
- package/dist/types/radio-group.d.ts +39 -0
- package/dist/types/radio.d.ts +8 -0
- package/dist/types/range-calendar.d.ts +24 -0
- package/dist/types/schedule-calendar.d.ts +103 -0
- package/dist/types/scroll-shadow.d.ts +16 -0
- package/dist/types/search-field.d.ts +5 -0
- package/dist/types/section.d.ts +10 -0
- package/dist/types/segmented-control.d.ts +14 -0
- package/dist/types/select.d.ts +20 -0
- package/dist/types/separator.d.ts +13 -0
- package/dist/types/sheet.d.ts +14 -0
- package/dist/types/skeleton.d.ts +9 -0
- package/dist/types/slider.d.ts +10 -0
- package/dist/types/statistic.d.ts +11 -0
- package/dist/types/stepper.d.ts +12 -0
- package/dist/types/steps.d.ts +30 -0
- package/dist/types/style-entry.d.ts +1 -0
- package/dist/types/surface.d.ts +17 -0
- package/dist/types/switch.d.ts +7 -0
- package/dist/types/tab-bar.d.ts +23 -0
- package/dist/types/table.d.ts +22 -0
- package/dist/types/tabs.d.ts +19 -0
- package/dist/types/tag-group.d.ts +40 -0
- package/dist/types/tag.d.ts +10 -0
- package/dist/types/tags-input.d.ts +29 -0
- package/dist/types/text-area.d.ts +13 -0
- package/dist/types/time-field.d.ts +25 -0
- package/dist/types/toast.d.ts +35 -0
- package/dist/types/toggle-button-group.d.ts +24 -0
- package/dist/types/toggle-button.d.ts +27 -0
- package/dist/types/toolbar.d.ts +13 -0
- package/dist/types/tooltip.d.ts +16 -0
- package/dist/types/tree.d.ts +18 -0
- package/dist/types/typography.d.ts +11 -0
- package/dist/types/upload.d.ts +15 -0
- package/dist/types/workspace.d.ts +22 -0
- package/dist/workspace.cjs +1 -0
- package/dist/workspace.js +42 -0
- package/package.json +65 -3
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/** 语义化表面层次容器:在实底阅读表面与液态玻璃表面之间建立清晰层级。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export type SurfaceVariant = "default" | "secondary" | "tertiary" | "transparent" | "glass";
|
|
4
|
+
export type SurfacePadding = "none" | "small" | "regular" | "large";
|
|
5
|
+
export type SurfaceRadius = "none" | "small" | "regular" | "large";
|
|
6
|
+
export interface SurfaceProps extends HTMLAttributes<HTMLDivElement> {
|
|
7
|
+
/** 表面层次:`default`/`secondary`/`tertiary` 用于内容承载,`glass` 启用液态玻璃折射。 */
|
|
8
|
+
variant?: SurfaceVariant;
|
|
9
|
+
/** 内边距尺寸。 */
|
|
10
|
+
padding?: SurfacePadding;
|
|
11
|
+
/** 圆角规格。 */
|
|
12
|
+
radius?: SurfaceRadius;
|
|
13
|
+
/** 是否显示细边框。 */
|
|
14
|
+
bordered?: boolean;
|
|
15
|
+
children?: ReactNode;
|
|
16
|
+
}
|
|
17
|
+
export declare const Surface: ForwardRefExoticComponent<SurfaceProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -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,40 @@
|
|
|
1
|
+
/** 液态玻璃标签组:支持单选/多选过滤、单项移除、键盘导航与空状态提示。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
import type { TagTone } from "./tag.js";
|
|
4
|
+
export interface TagGroupItem {
|
|
5
|
+
/** 标签唯一标识。 */
|
|
6
|
+
key: string;
|
|
7
|
+
/** 展示内容。 */
|
|
8
|
+
label: ReactNode;
|
|
9
|
+
/** 语义色调。 */
|
|
10
|
+
tone?: TagTone;
|
|
11
|
+
/** 可选前置图标。 */
|
|
12
|
+
icon?: ReactNode;
|
|
13
|
+
/** 是否禁用交互。 */
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/** 是否允许移除(覆盖组级 removable)。 */
|
|
16
|
+
removable?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface TagGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
19
|
+
/** 标签集合。 */
|
|
20
|
+
items: readonly TagGroupItem[];
|
|
21
|
+
/** 可选分组标题。 */
|
|
22
|
+
label?: ReactNode;
|
|
23
|
+
/** 辅助说明文案。 */
|
|
24
|
+
description?: ReactNode;
|
|
25
|
+
/** 选择模式:`none` 仅展示/可移除,`single` 单选,`multiple` 多选。 */
|
|
26
|
+
selectionMode?: "none" | "single" | "multiple";
|
|
27
|
+
/** 受控选中键列表。 */
|
|
28
|
+
selectedKeys?: readonly string[];
|
|
29
|
+
/** 非受控默认选中键列表。 */
|
|
30
|
+
defaultSelectedKeys?: readonly string[];
|
|
31
|
+
/** 选中变化回调。 */
|
|
32
|
+
onSelectionChange?: (keys: string[]) => void;
|
|
33
|
+
/** 移除回调;传入后默认显示关闭按钮。 */
|
|
34
|
+
onRemove?: (key: string) => void;
|
|
35
|
+
/** 列表为空时的自定义提示内容。 */
|
|
36
|
+
empty?: ReactNode;
|
|
37
|
+
/** 尺寸规格。 */
|
|
38
|
+
size?: "small" | "regular";
|
|
39
|
+
}
|
|
40
|
+
export declare function TagGroup({ items, label, description, selectionMode, selectedKeys: controlledSelected, defaultSelectedKeys, onSelectionChange, onRemove, empty, size, className, ...props }: TagGroupProps): 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,29 @@
|
|
|
1
|
+
/** 液态玻璃标签输入框(TagsInput):支持回车或分隔符创建标签、退格移除末尾标签与玻璃建议浮层。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface TagsInputProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
|
|
4
|
+
/** 受控标签字符串数组。 */
|
|
5
|
+
value?: readonly string[];
|
|
6
|
+
/** 非受控初始标签数组。 */
|
|
7
|
+
defaultValue?: readonly string[];
|
|
8
|
+
/** 标签数组变化回调。 */
|
|
9
|
+
onValueChange?: (tags: string[]) => void;
|
|
10
|
+
/** 可选自动建议列表;聚焦或输入时在玻璃浮层展示匹配项。 */
|
|
11
|
+
suggestions?: readonly string[];
|
|
12
|
+
/** 占位提示文案。 */
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
/** 最多允许创建的标签数。 */
|
|
15
|
+
maxTags?: number;
|
|
16
|
+
/** 是否允许重复标签,默认 `false`。 */
|
|
17
|
+
allowDuplicates?: boolean;
|
|
18
|
+
/** 触发分割生成标签的字符列表,默认逗号(中英文)。 */
|
|
19
|
+
splitChars?: readonly string[];
|
|
20
|
+
/** 原生表单字段名(同名多值隐藏字段提交)。 */
|
|
21
|
+
name?: string;
|
|
22
|
+
/** 是否显示一键清空按钮。 */
|
|
23
|
+
clearable?: boolean;
|
|
24
|
+
/** 禁用状态。 */
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
/** 校验错误提示。 */
|
|
27
|
+
error?: ReactNode;
|
|
28
|
+
}
|
|
29
|
+
export declare function TagsInput({ value: controlledValue, defaultValue, onValueChange, suggestions, placeholder, maxTags, allowDuplicates, splitChars, name, clearable, disabled, error, className, "aria-label": ariaLabel, ...props }: TagsInputProps): 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,25 @@
|
|
|
1
|
+
/** 液态玻璃分段时间输入框:支持小时/分钟/秒分段编辑、12/24 小时制式切换与键盘方向键调节。 */
|
|
2
|
+
import { type HTMLAttributes, type JSX, type ReactNode } from "react";
|
|
3
|
+
export interface TimeFieldProps extends Omit<HTMLAttributes<HTMLDivElement>, "defaultValue"> {
|
|
4
|
+
/** 受控时间值(24 小时制 `HH:mm` 或 `HH:mm:ss`)。 */
|
|
5
|
+
value?: string;
|
|
6
|
+
/** 非受控初始时间值。 */
|
|
7
|
+
defaultValue?: string;
|
|
8
|
+
/** 时间完整变化回调。 */
|
|
9
|
+
onValueChange?: (value: string) => void;
|
|
10
|
+
/** 时间粒度:精确到分钟或秒。 */
|
|
11
|
+
granularity?: "minute" | "second";
|
|
12
|
+
/** 小时制式:24 小时制或 12 小时制(含上午/下午切换)。 */
|
|
13
|
+
hourCycle?: 12 | 24;
|
|
14
|
+
/** 原生表单字段名。 */
|
|
15
|
+
name?: string;
|
|
16
|
+
/** 禁用状态。 */
|
|
17
|
+
disabled?: boolean;
|
|
18
|
+
/** 只读状态。 */
|
|
19
|
+
readOnly?: boolean;
|
|
20
|
+
/** 错误提示文案。 */
|
|
21
|
+
error?: ReactNode;
|
|
22
|
+
/** 尺寸规格。 */
|
|
23
|
+
size?: "small" | "regular" | "large";
|
|
24
|
+
}
|
|
25
|
+
export declare function TimeField({ value: controlledValue, defaultValue, onValueChange, granularity, hourCycle, name, disabled, readOnly, error, size: configuredSize, className, "aria-label": ariaLabel, ...props }: TimeFieldProps): JSX.Element;
|
|
@@ -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,24 @@
|
|
|
1
|
+
/** 液态玻璃切换按钮组:支持单选与多选模式,可与 ToggleButton 组合使用。 */
|
|
2
|
+
import { type ForwardRefExoticComponent, type HTMLAttributes, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export interface ToggleButtonGroupProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** 选择模式:单选或多选。 */
|
|
5
|
+
selectionMode?: "single" | "multiple";
|
|
6
|
+
/** 受控选中值数组。 */
|
|
7
|
+
value?: readonly string[];
|
|
8
|
+
/** 非受控默认选中值数组。 */
|
|
9
|
+
defaultValue?: readonly string[];
|
|
10
|
+
/** 选中值变化回调。 */
|
|
11
|
+
onValueChange?: (value: string[]) => void;
|
|
12
|
+
/** 是否禁止取消全部选中项。 */
|
|
13
|
+
disallowEmptySelection?: boolean;
|
|
14
|
+
/** 排列方向。 */
|
|
15
|
+
orientation?: "horizontal" | "vertical";
|
|
16
|
+
/** 统一覆盖组内按钮尺寸。 */
|
|
17
|
+
size?: "small" | "regular" | "large";
|
|
18
|
+
/** 禁用组内所有按钮。 */
|
|
19
|
+
disabled?: boolean;
|
|
20
|
+
/** 是否使用统一液态玻璃连体底座。 */
|
|
21
|
+
attached?: boolean;
|
|
22
|
+
children?: ReactNode;
|
|
23
|
+
}
|
|
24
|
+
export declare const ToggleButtonGroup: ForwardRefExoticComponent<ToggleButtonGroupProps & RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/** 液态玻璃开关按钮:带有 aria-pressed 选中状态,支持独立使用或放入 ToggleButtonGroup。 */
|
|
2
|
+
import { type ButtonHTMLAttributes, type Context, type ForwardRefExoticComponent, type ReactNode, type RefAttributes } from "react";
|
|
3
|
+
export interface ToggleButtonGroupContextValue {
|
|
4
|
+
isSelected: (value: string) => boolean;
|
|
5
|
+
toggle: (value: string) => void;
|
|
6
|
+
size?: "small" | "regular" | "large";
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
attached?: boolean;
|
|
9
|
+
}
|
|
10
|
+
export declare const ToggleButtonGroupContext: Context<ToggleButtonGroupContextValue | null>;
|
|
11
|
+
export interface ToggleButtonProps extends Omit<ButtonHTMLAttributes<HTMLButtonElement>, "value"> {
|
|
12
|
+
/** 在 ToggleButtonGroup 中使用的唯一标识值。 */
|
|
13
|
+
value?: string;
|
|
14
|
+
/** 受控选中状态。 */
|
|
15
|
+
pressed?: boolean;
|
|
16
|
+
/** 非受控初始选中状态。 */
|
|
17
|
+
defaultPressed?: boolean;
|
|
18
|
+
/** 选中状态变化时的回调。 */
|
|
19
|
+
onPressedChange?: (pressed: boolean) => void;
|
|
20
|
+
/** 可选前置或纯图标内容。 */
|
|
21
|
+
icon?: ReactNode;
|
|
22
|
+
/** 按钮尺寸。 */
|
|
23
|
+
size?: "small" | "regular" | "large";
|
|
24
|
+
/** 自定义选中强调色。 */
|
|
25
|
+
tint?: string;
|
|
26
|
+
}
|
|
27
|
+
export declare const ToggleButton: ForwardRefExoticComponent<ToggleButtonProps & RefAttributes<HTMLButtonElement>>;
|
|
@@ -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;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/** 文件选择与拖放入口,校验大小、数量和类型,网络上传由接入项目处理。 */
|
|
2
|
+
import { type JSX } from "react";
|
|
3
|
+
export interface UploadProps {
|
|
4
|
+
value?: readonly File[];
|
|
5
|
+
defaultValue?: readonly File[];
|
|
6
|
+
onValueChange?: (files: File[]) => void;
|
|
7
|
+
accept?: string;
|
|
8
|
+
multiple?: boolean;
|
|
9
|
+
maxFiles?: number;
|
|
10
|
+
maxBytes?: number;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
progress?: number;
|
|
13
|
+
"aria-label": string;
|
|
14
|
+
}
|
|
15
|
+
export declare function Upload({ value, defaultValue, onValueChange, accept, multiple, maxFiles, maxBytes, disabled, progress, "aria-label": label, }: UploadProps): JSX.Element;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/** 可选分栏工作区,复用项目已有的面板引擎;从独立 workspace 入口按需加载。 */
|
|
2
|
+
import "./style-entry.js";
|
|
3
|
+
import { type JSX, type ReactNode } from "react";
|
|
4
|
+
import { type Layout, type PanelProps } from "react-resizable-panels";
|
|
5
|
+
export interface WorkspacePanel {
|
|
6
|
+
id: string;
|
|
7
|
+
title: ReactNode;
|
|
8
|
+
content: ReactNode;
|
|
9
|
+
defaultSize?: PanelProps["defaultSize"];
|
|
10
|
+
minSize?: PanelProps["minSize"];
|
|
11
|
+
maxSize?: PanelProps["maxSize"];
|
|
12
|
+
collapsible?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface ResizableWorkspaceProps {
|
|
15
|
+
panels: readonly WorkspacePanel[];
|
|
16
|
+
direction?: "horizontal" | "vertical";
|
|
17
|
+
defaultLayout?: Layout;
|
|
18
|
+
onLayoutChange?: (layout: Layout) => void;
|
|
19
|
+
onReset?: () => void;
|
|
20
|
+
"aria-label": string;
|
|
21
|
+
}
|
|
22
|
+
export declare function ResizableWorkspace({ panels, direction, defaultLayout, onLayoutChange, onReset, "aria-label": label, }: ResizableWorkspaceProps): JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./button-EFLg6M7I.cjs");let t=require("react"),n=require("react/jsx-runtime"),r=require("react-resizable-panels");function i({panels:i,direction:a=`horizontal`,defaultLayout:o,onLayoutChange:s,onReset:c,"aria-label":l}){return(0,n.jsxs)(`div`,{className:`lg-workspace`,"aria-label":l,children:[c&&(0,n.jsx)(`div`,{className:`lg-workspace-tools`,children:(0,n.jsx)(e.t,{size:`small`,onClick:c,children:`重置布局`})}),(0,n.jsx)(r.Group,{style:{flex:1,minHeight:0},orientation:a,defaultLayout:o,onLayoutChanged:e=>s?.(e),children:i.map((e,i)=>(0,n.jsxs)(t.Fragment,{children:[i>0&&(0,n.jsx)(r.Separator,{className:`lg-workspace-separator`,"aria-label":`调整分栏`}),(0,n.jsx)(r.Panel,{id:e.id,defaultSize:e.defaultSize,minSize:e.minSize,maxSize:e.maxSize,collapsible:e.collapsible,children:(0,n.jsxs)(`section`,{className:`lg-workspace-panel`,children:[(0,n.jsx)(`header`,{children:e.title}),(0,n.jsx)(`div`,{children:e.content})]})})]},e.id))})]})}exports.ResizableWorkspace=i;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { t as e } from "./button-DSXdLDuQ.js";
|
|
2
|
+
import { Fragment as t } from "react";
|
|
3
|
+
import { jsx as n, jsxs as r } from "react/jsx-runtime";
|
|
4
|
+
import { Group as i, Panel as a, Separator as o } from "react-resizable-panels";
|
|
5
|
+
// src/workspace.tsx
|
|
6
|
+
function s({ panels: s, direction: c = "horizontal", defaultLayout: l, onLayoutChange: u, onReset: d, "aria-label": f }) {
|
|
7
|
+
return /* @__PURE__ */ r("div", {
|
|
8
|
+
className: "lg-workspace",
|
|
9
|
+
"aria-label": f,
|
|
10
|
+
children: [d && /* @__PURE__ */ n("div", {
|
|
11
|
+
className: "lg-workspace-tools",
|
|
12
|
+
children: /* @__PURE__ */ n(e, {
|
|
13
|
+
size: "small",
|
|
14
|
+
onClick: d,
|
|
15
|
+
children: "重置布局"
|
|
16
|
+
})
|
|
17
|
+
}), /* @__PURE__ */ n(i, {
|
|
18
|
+
style: {
|
|
19
|
+
flex: 1,
|
|
20
|
+
minHeight: 0
|
|
21
|
+
},
|
|
22
|
+
orientation: c,
|
|
23
|
+
defaultLayout: l,
|
|
24
|
+
onLayoutChanged: (e) => u?.(e),
|
|
25
|
+
children: s.map((e, i) => /* @__PURE__ */ r(t, { children: [i > 0 && /* @__PURE__ */ n(o, {
|
|
26
|
+
className: "lg-workspace-separator",
|
|
27
|
+
"aria-label": "调整分栏"
|
|
28
|
+
}), /* @__PURE__ */ n(a, {
|
|
29
|
+
id: e.id,
|
|
30
|
+
defaultSize: e.defaultSize,
|
|
31
|
+
minSize: e.minSize,
|
|
32
|
+
maxSize: e.maxSize,
|
|
33
|
+
collapsible: e.collapsible,
|
|
34
|
+
children: /* @__PURE__ */ r("section", {
|
|
35
|
+
className: "lg-workspace-panel",
|
|
36
|
+
children: [/* @__PURE__ */ n("header", { children: e.title }), /* @__PURE__ */ n("div", { children: e.content })]
|
|
37
|
+
})
|
|
38
|
+
})] }, e.id))
|
|
39
|
+
})]
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
export { s as ResizableWorkspace };
|
package/package.json
CHANGED
|
@@ -1,6 +1,68 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lec-space/liquidglass",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"sideEffects": [
|
|
7
|
+
"./src/style-entry.ts",
|
|
8
|
+
"./src/index.ts",
|
|
9
|
+
"./src/workspace.tsx",
|
|
10
|
+
"./dist/*.js",
|
|
11
|
+
"./dist/*.cjs",
|
|
12
|
+
"**/*.css"
|
|
13
|
+
],
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/types/index.d.ts",
|
|
17
|
+
"import": "./dist/index.js",
|
|
18
|
+
"require": "./dist/index.cjs"
|
|
19
|
+
},
|
|
20
|
+
"./workspace": {
|
|
21
|
+
"types": "./dist/types/workspace.d.ts",
|
|
22
|
+
"import": "./dist/workspace.js",
|
|
23
|
+
"require": "./dist/workspace.cjs"
|
|
24
|
+
},
|
|
25
|
+
"./styles.css": "./dist/styles.css"
|
|
26
|
+
},
|
|
27
|
+
"peerDependencies": {
|
|
28
|
+
"react": ">=18",
|
|
29
|
+
"react-dom": ">=18",
|
|
30
|
+
"react-resizable-panels": "^4.21.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/react": "19.3.0",
|
|
34
|
+
"@types/react-dom": "19.3.0",
|
|
35
|
+
"typescript": "5.9.3",
|
|
36
|
+
"vite": "8.3.7",
|
|
37
|
+
"react-resizable-panels": "4.21.0"
|
|
38
|
+
},
|
|
39
|
+
"files": [
|
|
40
|
+
"dist",
|
|
41
|
+
"LICENSE",
|
|
42
|
+
"README.md"
|
|
43
|
+
],
|
|
44
|
+
"peerDependenciesMeta": {
|
|
45
|
+
"react-resizable-panels": {
|
|
46
|
+
"optional": true
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
"publishConfig": {
|
|
50
|
+
"access": "public",
|
|
51
|
+
"registry": "https://registry.npmjs.org"
|
|
52
|
+
},
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@daypicker/react": "10.0.2"
|
|
55
|
+
},
|
|
56
|
+
"repository": {
|
|
57
|
+
"type": "git",
|
|
58
|
+
"url": "git+https://github.com/lec-org/liquidglass.git"
|
|
59
|
+
},
|
|
60
|
+
"homepage": "https://lec-org.github.io/liquidglass/",
|
|
61
|
+
"bugs": {
|
|
62
|
+
"url": "https://github.com/lec-org/liquidglass/issues"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"typecheck": "tsc --noEmit",
|
|
66
|
+
"build": "vite build && tsc -p tsconfig.build.json && node scripts/finalize-build.mjs"
|
|
67
|
+
}
|
|
6
68
|
}
|