lingee-ui 0.0.7 → 0.0.8

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 (44) hide show
  1. package/dist/button/index.d.mts +1 -1
  2. package/dist/button/index.d.ts +1 -1
  3. package/dist/chunk-3U36GSZF.js +2 -0
  4. package/dist/chunk-7TZ6IXXG.js +1 -0
  5. package/dist/{chunk-T5QR25R6.js → chunk-AEPAJEIR.js} +1 -1
  6. package/dist/{chunk-RM4W5RV7.mjs → chunk-AP6UHKTU.mjs} +1 -1
  7. package/dist/chunk-PKNSR23I.mjs +2 -0
  8. package/dist/chunk-QBEHOXXU.mjs +1 -0
  9. package/dist/{chunk-FQRDHJQZ.mjs → chunk-TO3JLUBX.mjs} +1 -1
  10. package/dist/{chunk-KT3HSLBA.js → chunk-VHOWVMZ3.js} +1 -1
  11. package/dist/{index-BVXwKHfX.d.mts → index-7pb5YOcq.d.mts} +1 -1
  12. package/dist/{index-BVXwKHfX.d.ts → index-7pb5YOcq.d.ts} +1 -1
  13. package/dist/index.css +1 -1
  14. package/dist/index.d.mts +207 -53
  15. package/dist/index.d.ts +207 -53
  16. package/dist/index.js +2 -2
  17. package/dist/index.mjs +2 -2
  18. package/dist/input/index.js +1 -1
  19. package/dist/input/index.mjs +1 -1
  20. package/dist/tabs/index.d.mts +1 -1
  21. package/dist/tabs/index.d.ts +1 -1
  22. package/dist/tabs/index.js +1 -1
  23. package/dist/tabs/index.mjs +1 -1
  24. package/dist/toast/index.js +1 -1
  25. package/dist/toast/index.mjs +1 -1
  26. package/dist/tree/index.css +1 -0
  27. package/dist/tree/index.d.mts +229 -0
  28. package/dist/tree/index.d.ts +229 -0
  29. package/dist/tree/index.js +1 -0
  30. package/dist/tree/index.mjs +1 -0
  31. package/package.json +7 -2
  32. package/skill/AGENTS-SNIPPET.md +5 -4
  33. package/skill/SKILL.md +6 -5
  34. package/skill/VERSION.json +3 -3
  35. package/skill/references/components/dropdown.md +3 -0
  36. package/skill/references/components/empty.md +28 -2
  37. package/skill/references/components/sidebar.md +45 -29
  38. package/skill/references/components/tree.md +118 -0
  39. package/skill/references/components/upload.md +4 -1
  40. package/skill/references/setup.md +2 -1
  41. package/skill/references/tokens.md +1 -1
  42. package/CHANGELOG.md +0 -119
  43. package/dist/chunk-KQ733636.mjs +0 -1
  44. package/dist/chunk-PQVYDWUK.js +0 -1
@@ -2,8 +2,8 @@
2
2
 
3
3
  当目标区域无数据时展示的空状态占位图,引导用户进行下一步操作。
4
4
 
5
- - 导入:`import { Empty } from "lingee-ui";`
6
- - 可用类型:`EmptyProps`, `EmptySize`, `EmptyIconComponent`
5
+ - 导入:`import { Empty, EmptyCard } from "lingee-ui";`
6
+ - 可用类型:`EmptyProps`, `EmptySize`, `EmptyIconComponent`, `EmptyCardProps`, `EmptyCardStatus`, `EmptyCardVariant`, `EmptyCardSpacing`
7
7
 
8
8
  ## 最小示例
9
9
 
@@ -26,3 +26,29 @@ export default function BasicDemo() {
26
26
  | `children` | 自定义底部内容(如操作按钮) | `ReactNode` | - |
27
27
  | `className` | 自定义类名 | `string` | - |
28
28
  | `style` | 自定义内联样式 | `CSSProperties` | - |
29
+
30
+ ### Empty.Card
31
+
32
+ | 属性 | 说明 | 类型 | 默认值 |
33
+ |------|------|------|--------|
34
+ | `status` | 状态,决定默认图标与无障碍语义 | `"loading" \| "empty" \| "error"` | - |
35
+ | `description` | 描述文案 | `ReactNode` | - |
36
+ | `icon` | 覆盖默认图标;传 `null` 不渲染图标 | `ReactNode \| null` | 按 `status` 取 |
37
+ | `variant` | 布局:`block` 区块级 / `inline` 行内轻量 | `"block" \| "inline"` | `"block"` |
38
+ | `spacing` | 留白档位。`loose` 为顶部大留白(列表级空态) | `"none" \| "normal" \| "loose"` | `"normal"` |
39
+ | `onRetry` | 重试回调。仅 `status="error"` 生效,传入后整体可点击 | `() => void` | - |
40
+ | `className` | 自定义类名 | `string` | - |
41
+ | `style` | 自定义内联样式 | `CSSProperties` | - |
42
+
43
+ 默认图标:`loading` 用旋转的 `LoaderCircle`,`empty` 用 `Inbox`,`error` 用 `ExclamationCircle`。
44
+
45
+ **三态等高**:组件按 `variant` + `spacing` 设定 `min-height`,同档位下
46
+ `loading` / `empty` / `error` 高度完全一致。
47
+
48
+ | variant | spacing | 高度 |
49
+ |---------|---------|------|
50
+ | `block` | `none` | 18px |
51
+ | `block` | `normal` | 64px |
52
+ | `block` | `loose` | 85px(顶部 44 + 内容 18 + 底部 23) |
53
+ | `inline` | `none` | 18px |
54
+ | `inline` | `normal` | 26px |
@@ -2,8 +2,8 @@
2
2
 
3
3
  侧边栏复合组件,提供根容器、页签、导航项、分组、列表项、占位项与底栏,通过 Sidebar.xxx 组合使用。
4
4
 
5
- - 导入:`import { Sidebar, SidebarRoot, SidebarHeader, SidebarTabBar, SidebarNavItem, SidebarCollapsibleNavItem, SidebarGroupHeader, SidebarListItem, SidebarCollapsibleListItem, SidebarSkeletonItem, SidebarFooter } from "lingee-ui";`
6
- - 可用类型:`SidebarRootProps`, `SidebarHeaderProps`, `SidebarTabBarProps`, `SidebarTabItem`, `SidebarNavItemProps`, `SidebarCollapsibleNavItemProps`, `SidebarCollapsibleNavItemChild`, `SidebarGroupHeaderProps`, `SidebarListItemProps`, `SidebarIndicatorType`, `SidebarCollapsibleListItemProps`, `SidebarSkeletonItemProps`, `SidebarSkeletonItemStatus`, `SidebarSkeletonItemVariant`, `SidebarSkeletonItemSpacing`, `SidebarFooterProps`
5
+ - 导入:`import { Sidebar, SidebarRoot, SidebarHeader, SidebarTabBar, SidebarNavItem, SidebarCollapsibleNavItem, SidebarGroupHeader, SidebarListItem, SidebarCollapsibleListItem, SidebarFooter, SidebarFooterMenuStaticRow, SidebarFooterBadge, SidebarUsageBar, SidebarUsagePanel, SidebarUsagePanelSection } from "lingee-ui";`
6
+ - 可用类型:`SidebarRootProps`, `SidebarHeaderProps`, `SidebarTabBarProps`, `SidebarTabItem`, `SidebarNavItemProps`, `SidebarCollapsibleNavItemProps`, `SidebarCollapsibleNavItemChild`, `SidebarGroupHeaderProps`, `SidebarListItemProps`, `SidebarIndicatorType`, `SidebarCollapsibleListItemProps`, `SidebarCaretPlacement`, `SidebarFooterProps`, `SidebarFooterMenuStaticRowProps`, `SidebarFooterBadgeProps`, `SidebarUsageBarProps`, `SidebarUsageTone`, `SidebarUsagePanelProps`, `SidebarUsagePanelSectionProps`
7
7
 
8
8
  ## 最小示例
9
9
 
@@ -17,9 +17,7 @@ export default function BasicDemo() {
17
17
  const [active, setActive] = useState("new-task");
18
18
 
19
19
  return (
20
- <Sidebar.Root
21
- style={{ height: 420, borderRadius: 12 }}
22
- >
20
+ <Sidebar.Root style={{ height: 320, borderRadius: 12, paddingTop: 10 }}>
23
21
  <Sidebar.TabBar
24
22
  items={[
25
23
  { key: "work", label: "工作", icon: <List size={20} /> },
@@ -145,36 +143,13 @@ export default function BasicDemo() {
145
143
  | `title` | 标题 | `ReactNode` | - |
146
144
  | `expanded` | 展开态 | `boolean` | `false` |
147
145
  | `onToggle` | 切换回调 | `() => void` | - |
146
+ | `caretPlacement` | 箭头位置。`title` 紧跟标题、悬停才显现;`end` 恒在行尾且常显 | `"title" \| "end"` | `"title"` |
148
147
  | `actions` | 头部操作区插槽 | `ReactNode` | - |
149
148
  | `actionsVisible` | 操作区常显。菜单打开时置 `true` | `boolean` | `false` |
150
149
  | `active` | 头部高亮 | `boolean` | `false` |
151
150
  | `children` | 展开区内容 | `ReactNode` | - |
152
151
  | `expandLabel` / `collapseLabel` | 无障碍标签 | `string` | - |
153
152
 
154
- ### Sidebar.SkeletonItem
155
-
156
- | 属性 | 说明 | 类型 | 默认值 |
157
- |------|------|------|--------|
158
- | `status` | 状态,决定默认图标与无障碍语义 | `"loading" \| "empty" \| "error"` | - |
159
- | `text` | 提示文案 | `ReactNode` | - |
160
- | `icon` | 覆盖默认图标;传 `null` 不渲染图标 | `ReactNode \| null` | 按 `status` 取 |
161
- | `variant` | 布局:`block` 区块级 / `inline` 行内轻量 | `"block" \| "inline"` | `"block"` |
162
- | `spacing` | 留白档位。`loose` 为顶部大留白(列表级空态) | `"none" \| "normal" \| "loose"` | `"normal"` |
163
- | `onRetry` | 重试回调。仅 `status="error"` 生效,传入后整体可点击 | `() => void` | - |
164
-
165
- 默认图标:`loading` 用旋转的 `LoaderCircle`,`empty` 用 `Inbox`,`error` 用 `ExclamationCircle`。
166
-
167
- **三态等高**:组件按 `variant` + `spacing` 设定 `min-height`,同档位下
168
- `loading` / `empty` / `error` 高度完全一致,因此「加载中 → 空态 / 错误态」
169
- 切换时容器高度不变,列表不会跳动。
170
-
171
- | variant | spacing | 高度 |
172
- |---------|---------|------|
173
- | `block` | `none` | 24px |
174
- | `block` | `normal` | 48px |
175
- | `block` | `loose` | 80px(顶部 44 + 内容 24 + 底部 12) |
176
- | `inline` | `normal` | 26px |
177
-
178
153
  ### Sidebar.Footer
179
154
 
180
155
  | 属性 | 说明 | 类型 | 默认值 |
@@ -185,3 +160,44 @@ export default function BasicDemo() {
185
160
  | `menuOpen` | 菜单展开态,驱动触发区高亮与箭头旋转 | `boolean` | `false` |
186
161
  | `onTriggerClick` | 点击触发区,回传 `DOMRect` 供手动定位浮层 | `(rect: DOMRect) => void` | - |
187
162
  | `actions` | 右侧动作区插槽 | `ReactNode` | - |
163
+
164
+ ### Sidebar.FooterMenuStaticRow
165
+
166
+ | 属性 | 说明 | 类型 | 默认值 |
167
+ |------|------|------|--------|
168
+ | `icon` | 行首图标 | `ReactNode` | - |
169
+ | `children` | 行内容 | `ReactNode` | - |
170
+
171
+ ### Sidebar.FooterBadge
172
+
173
+ | 属性 | 说明 | 类型 | 默认值 |
174
+ |------|------|------|--------|
175
+ | `dot` | 是否显示未读红点 | `boolean` | `false` |
176
+ | `children` | 被包裹的按钮 | `ReactNode` | - |
177
+
178
+ ### Sidebar.UsageBar
179
+
180
+ | 属性 | 说明 | 类型 | 默认值 |
181
+ |------|------|------|--------|
182
+ | `used` | 已用量 | `number` | - |
183
+ | `total` | 总量。为 0 时进度按 0 处理 | `number` | - |
184
+ | `formatNumber` | 数字格式化(千分位/小数位依赖 locale) | `(n: number) => string` | `String` |
185
+ | `percentSuffix` | 总量后缀,如「(65%)」 | `ReactNode` | - |
186
+ | `remainingPrefix` | 剩余量前缀,如「剩余 」 | `ReactNode` | - |
187
+ | `ariaLabel` | 进度条无障碍标签 | `string` | - |
188
+
189
+ ### Sidebar.UsagePanel
190
+
191
+ | 属性 | 说明 | 类型 | 默认值 |
192
+ |------|------|------|--------|
193
+ | `title` | 面板标题,为空时不渲染头部 | `ReactNode` | - |
194
+ | `loading` | 加载态,展示骨架屏并隐藏内容 | `boolean` | `false` |
195
+ | `children` | 各额度分区 | `ReactNode` | - |
196
+
197
+ ### Sidebar.UsagePanelSection
198
+
199
+ | 属性 | 说明 | 类型 | 默认值 |
200
+ |------|------|------|--------|
201
+ | `title` | 分区标题 | `ReactNode` | - |
202
+ | `extra` | 标题行右侧附加信息,如到期日 | `ReactNode` | - |
203
+ | `children` | 分区内容,通常是一个 `UsageBar` | `ReactNode` | - |
@@ -0,0 +1,118 @@
1
+ # Tree 树形控件
2
+
3
+ 用于展示层级结构数据,支持勾选、拖拽排序、异步加载与虚拟滚动。
4
+
5
+ - 导入:`import { Tree } from "lingee-ui";`
6
+ - 按需导入:`import { Tree } from "lingee-ui/tree";`
7
+ - 可用类型:`TreeProps`, `TreeNodeData`, `TreeNodeState`, `TreeSize`, `TreeIndentGuide`, `TreeFieldNames`, `TreeCheckInfo`, `TreeSelectInfo`, `TreeExpandInfo`, `TreeDropInfo`, `TreeAllowDropOptions`, `TreeExpandAction`
8
+
9
+ ## 最小示例
10
+
11
+ ```tsx
12
+ import { Tree } from "lingee-ui";
13
+ import type { TreeNodeData } from "lingee-ui";
14
+
15
+ const treeData: TreeNodeData[] = [
16
+ {
17
+ key: "finance",
18
+ title: "Finance Analysis",
19
+ children: [
20
+ { key: "finance-annual", title: "Annual Report" },
21
+ { key: "finance-budget", title: "Budget Execution" },
22
+ { key: "finance-cost", title: "Cost Breakdown" },
23
+ ],
24
+ },
25
+ {
26
+ key: "sales",
27
+ title: "Sales Analysis",
28
+ children: [
29
+ { key: "sales-review", title: "Performance Review" },
30
+ {
31
+ key: "sales-region",
32
+ title: "Regional Breakdown",
33
+ children: [
34
+ { key: "sales-region-north", title: "North Region" },
35
+ { key: "sales-region-south", title: "South Region" },
36
+ ],
37
+ },
38
+ ],
39
+ },
40
+ { key: "customer", title: "Customer Satisfaction" },
41
+ ];
42
+
43
+ export default function BasicDemo() {
44
+ return (
45
+ <div style={{ width: 280 }}>
46
+ <Tree
47
+ treeData={treeData}
48
+ defaultExpandedKeys={["finance", "sales"]}
49
+ defaultSelectedKeys={["finance-budget"]}
50
+ />
51
+ </div>
52
+ );
53
+ }
54
+ ```
55
+
56
+ ## API
57
+
58
+ ### Tree
59
+
60
+ | 属性 | 说明 | 类型 | 默认值 |
61
+ |------|------|------|--------|
62
+ | `treeData` | 节点数据 | `TreeNodeData[]` | - |
63
+ | `fieldNames` | 字段名映射,用于适配非标准数据结构 | `{ key?, title?, children? }` | - |
64
+ | `size` | 行高尺寸 | `"sm" \| "md" \| "lg"` | `"md"` |
65
+ | `indentGuide` | 缩进引导线形态 | `"none" \| "line"` | `"line"` |
66
+ | `expandedKeys` | 展开的节点 key(受控) | `Key[]` | - |
67
+ | `defaultExpandedKeys` | 默认展开的节点 key | `Key[]` | - |
68
+ | `defaultExpandAll` | 默认展开全部节点 | `boolean` | `false` |
69
+ | `autoExpandParent` | 展开子节点时自动展开其父节点 | `boolean` | `false` |
70
+ | `expandAction` | 触发展开的交互方式 | `false \| "click" \| "doubleClick"` | `"click"` |
71
+ | `onExpand` | 展开状态变化回调 | `(keys, info) => void` | - |
72
+ | `selectable` | 是否可选中 | `boolean` | `true` |
73
+ | `multiple` | 是否支持多选 | `boolean` | `false` |
74
+ | `selectedKeys` | 选中的节点 key(受控) | `Key[]` | - |
75
+ | `defaultSelectedKeys` | 默认选中的节点 key | `Key[]` | - |
76
+ | `onSelect` | 选中状态变化回调 | `(keys, info) => void` | - |
77
+ | `checkable` | 是否显示勾选框 | `boolean` | `false` |
78
+ | `checkStrictly` | 父子节点勾选状态不再联动 | `boolean` | `false` |
79
+ | `checkedKeys` | 勾选的节点 key(受控) | `Key[] \| { checked, halfChecked }` | - |
80
+ | `defaultCheckedKeys` | 默认勾选的节点 key | `Key[]` | - |
81
+ | `onCheck` | 勾选状态变化回调 | `(keys, info) => void` | - |
82
+ | `showIcon` | 是否显示节点图标 | `boolean` | `false` |
83
+ | `icon` | 全局节点图标,函数形式可按展开态切换 | `ReactNode \| ((node, state: { expanded, isLeaf }) => ReactNode)` | - |
84
+ | `switcherIcon` | 自定义展开箭头,函数形式可按展开态切换 | `ReactNode \| ((state: { expanded, isLeaf }) => ReactNode)` | - |
85
+ | `titleRender` | 自定义单行内容 | `(node) => ReactNode` | - |
86
+ | `loadData` | 异步加载子节点 | `(node) => Promise<unknown>` | - |
87
+ | `loadedKeys` | 已加载完成的节点 key | `Key[]` | - |
88
+ | `draggable` | 是否可拖拽排序 | `boolean \| ((node) => boolean)` | `false` |
89
+ | `allowDrop` | 校验能否放置到目标位置 | `(options) => boolean` | - |
90
+ | `onDrop` | 拖拽放置回调 | `(info) => void` | - |
91
+ | `height` | 可视区高度,设置后启用虚拟滚动 | `number` | - |
92
+ | `itemHeight` | 虚拟滚动的单项高度 | `number` | 按 `size` 推导 |
93
+ | `virtual` | 关闭虚拟滚动 | `boolean` | - |
94
+ | `disabled` | 整体禁用 | `boolean` | `false` |
95
+ | `loading` | 加载状态,展示遮罩 | `boolean` | `false` |
96
+ | `empty` | 无数据时的展示内容 | `ReactNode` | `<Empty />` |
97
+ | `animated` | 展开 / 折叠是否启用高度过渡动效(虚拟滚动下无效) | `boolean` | `true` |
98
+ | `onRightClick` | 节点右键回调 | `(info) => void` | - |
99
+
100
+ ### TreeNodeData
101
+
102
+ | 属性 | 说明 | 类型 |
103
+ |------|------|------|
104
+ | `key` | 节点唯一标识 | `Key` |
105
+ | `title` | 节点标题 | `ReactNode` |
106
+ | `children` | 子节点 | `TreeNodeData[]` |
107
+ | `icon` | 节点前置图标,覆盖 Tree 上的全局 `icon` | `ReactNode` |
108
+ | `disabled` | 是否禁用 | `boolean` |
109
+ | `disableCheckbox` | 是否禁用勾选框 | `boolean` |
110
+ | `checkable` | 是否可勾选 | `boolean` |
111
+ | `isLeaf` | 是否强制视作叶子节点 | `boolean` |
112
+ | `selectable` | 是否可选中 | `boolean` |
113
+
114
+ ## 注意事项
115
+
116
+ - 组件不持有 `treeData`,异步加载与拖拽排序均需消费方自行更新数据
117
+ - 节点内部结构由底层 `@rc-component/tree` 生成,类名为 `lg-tree-treenode`、`lg-tree-switcher` 等单横线形式,覆盖样式时需按此书写
118
+ - 虚拟滚动开启后行高必须固定,`titleRender` 中不要渲染高度不定的内容
@@ -34,5 +34,8 @@ export default function BasicDemo() {
34
34
  | `fileList` | 文件列表(受控) | `UploadFile[]` | - |
35
35
  | `showFileList` | 是否显示文件列表 | `boolean` | `true` |
36
36
  | `onChange` | 文件列表变化回调 | `(fileList: UploadFile[]) => void` | - |
37
- | `customRequest` | 自定义上传请求 | `(options: CustomRequestOptions) => { abort }` | - |
37
+ | `onReject` | 校验未通过回调 | `(files: File[], reason: "size" \| "type" \| "count") => void` | - |
38
+ | `customRequest` | 自定义上传请求。省略则为仅收集模式 | `(options: CustomRequestOptions) => { abort }` | - |
39
+ | `pasteable` | 是否支持粘贴文件(如截图) | `boolean` | `false` |
40
+ | `validateAccept` | 是否按 `accept` 校验类型,拦住拖拽与粘贴 | `boolean` | `false` |
38
41
  | `children` | 触发区域 | `ReactNode` | - |
@@ -1,6 +1,6 @@
1
1
  # 接入指南
2
2
 
3
- 组件库 `0.0.7` | 图标库 `1.0.16`
3
+ 组件库 `0.0.8` | 图标库 `1.0.16`
4
4
 
5
5
  ## 安装
6
6
 
@@ -63,6 +63,7 @@ document.documentElement.setAttribute("data-theme", "dark");
63
63
  - `lingee-ui/toast`
64
64
  - `lingee-ui/tooltip`
65
65
  - `lingee-ui/popover`
66
+ - `lingee-ui/tree`
66
67
  - `lingee-ui/skill`
67
68
  - `lingee-ui/skill/*`
68
69
 
@@ -1,6 +1,6 @@
1
1
  # 语义 Token 全表
2
2
 
3
- 组件库 `0.0.7`。仅列语义层(`--lg-g-*`)。
3
+ 组件库 `0.0.8`。仅列语义层(`--lg-g-*`)。
4
4
 
5
5
  亮色与暗色**变量名完全相同**,给 `<html>` 加 `data-theme="dark"` 即自动切换,业务代码只写一次。
6
6
 
package/CHANGELOG.md DELETED
@@ -1,119 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to `lingee-ui` will be documented in this file.
4
-
5
- The format is based on [Keep a Changelog](https://keepachangelog.com/), and this project adheres to [Semantic Versioning](https://semver.org/).
6
-
7
- ## [0.0.7] - 2026-08-11
8
-
9
- ### Added
10
-
11
- - Tabs 新增 `rounded` variant、`glassy`(滑块高光)、`transparent`(去容器灰底)
12
- - Dropdown 菜单项支持 `description` 副标题,面板新增 `borderless`
13
- - DropdownButton 新增 `variant`、`size`、`selectedVariant`
14
- - Dialog.confirm 新增 `okProps` / `cancelProps` / `contentRender`
15
- - DatePicker / RangePicker 新增年月快速选择面板,支持 `minDate` / `maxDate` 禁用
16
- - TimePicker 时间列表末项支持滚动置顶
17
- - Tag 新增 `gradient`(渐变浅底)与 `glow`(渐变底 + 光斑)变体,支持 `icon` 前缀图标与扩展色板
18
- - Tooltip 新增 `scrollable`,长内容超出视口时限高滚动,默认开启
19
- - Input 新增 `collapsed` 折叠态,折叠为正方形仅保留单个插槽(受控)
20
- - 新增 AI 技能包(`skill/`),随包发布供消费方 AI 编码助手使用
21
- - 补充 Flex 组件文档
22
-
23
- ### i18n
24
-
25
- 组件内建文案此前存在多处硬编码,切换 `LingeeProvider` 的 `locale` 无法完全生效,本次补齐:
26
-
27
- - 语言包新增 `Dropdown`、`Tabs`、`Form` 三组文案
28
- - DropdownButton 清除按钮、Tabs 滚动箭头的 `aria-label` 接入语言包
29
- - Form.Item 必填校验提示接入语言包(原为硬编码「不能为空」拼接)
30
- - **DatePicker / RangePicker 日历面板跟随 `locale` 切换**:周几表头、日期 `aria-label`、月份名此前固定中文,因其由 `date-fns` 语言包驱动、不经过组件文案表
31
-
32
- ### Changed
33
-
34
- - Table 滚动重构为 ScrollArea + CSS sticky 表头
35
- - Dropdown / Select / TimePicker 下拉滚动统一由 ScrollArea 管理
36
- - **Select 面板默认 `maxHeight` 由 256 改为 346**,如需保持原高度请显式传 `maxHeight={256}`
37
- - Button 尺寸 Token 按档位拆分,`lg` 圆角改为 12px
38
- - 背景色全局调整;新增 `transition.duration` / `transition.timing` Token
39
-
40
- ### Fixed
41
-
42
- - Tabs `transparent` 模式滑块偏移、滑块描边被裁切
43
- - Table `scroll.x` 宽屏留白、背景色异常
44
- - Pagination 文字折行
45
- - Dropdown 菜单项间距
46
- - `-webkit-scrollbar` 导致的纵向空隙
47
- - Toast 在 `unstyled` 模式下居中失效、长文案被容器宽度提前截断换行
48
- - 修正 Dropdown / Tabs 中未定义的组件层颜色 Token
49
-
50
- ### Docs
51
-
52
- - 文档站新增「AI 技能包」与「AIBadge」页,快速开始补充样式引入 / 语义 Token / 主题切换章节
53
- - 补充 Table、Dropdown、Tabs、Empty 组件示例
54
- - 补充 Tag 变体文档与示例、Tooltip 长内容说明
55
- - **组件文档新增英文版**(`README.en.mdx`),文档站支持中英切换,缺失英文时回退中文
56
- - demo 示例数据统一改为英文,中英文档共用同一份 demo
57
-
58
- ### Experimental
59
-
60
- - 新增 `Sidebar` 侧边栏复合组件(`Sidebar.Root` / `NavItem` / `ListItem` / `SkeletonItem` / `Footer` 等),**处于测试阶段,API 与样式可能在后续版本调整,暂不建议在生产使用**
61
-
62
- ### Note
63
-
64
- - 建议同步升级 `lingee-icon` 至 `1.0.16` 及以上
65
-
66
- ## [0.0.6] - 2026-07-29
67
-
68
- ### Added
69
-
70
- - Button 新增 `std`(32px)尺寸
71
- - 新增 DropdownButton 组件,Dropdown 支持禁用
72
-
73
- ### Changed
74
-
75
- - 文档方案由 Storybook 替换为 Vite 文档站
76
-
77
- ### Fixed
78
-
79
- - Dropdown item 高度与分隔线对齐设计稿,浮层高度自适应视口
80
- - RangePicker 样式缺失
81
-
82
- ## [0.0.5] - 2026-07-22
83
-
84
- ### Added
85
-
86
- - Design Token 体系替换为 Figma JSON 自动生成,支持语义层 Light / Dark
87
- - Tabs 新增 `scrollable` 模式,Dialog 支持 Props 透传,Tooltip 新增 `disabled`
88
-
89
- ### Fixed
90
-
91
- - 组件 Token 引用错误、Tabs 缩放时 slider 偏移
92
- - Checkbox 无法点击及意外触发滚动
93
- - Image 宽度、Spin 尺寸(16 / 24 / 32)
94
-
95
- ## [0.0.4] - 2026-06-30
96
-
97
- ### Reverted
98
-
99
- - 还原 0.0.3 中 Design Token 体系升级(色板 461 色 + 语义层 112 变量 + 暗色模式),恢复线上稳定版本
100
- - 还原 0.0.3 中 Button 组件颜色改动,恢复 opacity 方案
101
- - 还原 0.0.3 中 popover / select 组件样式改动
102
-
103
- ### Note
104
-
105
- - 0.0.3 版本 Token 体系调整导致线上样式异常,本版本回退到 0.0.2 的稳定状态
106
- - 消费方升级到 0.0.4 即可恢复正常,无需锁定版本号
107
-
108
- ## [0.0.1] - 2025-06-24
109
-
110
- ### Added
111
-
112
- - Button 组件(primary / secondary / ghost / danger / text 变体,支持 size、loading、icon)
113
- - Tabs 组件(CapsuleTabs / PillTabs 页签切换)
114
- - Toast 组件(命令式全局提示,info / success / warning / error)
115
- - Tooltip 组件(基于 Radix 的文字提示)
116
- - Switch 组件(开关切换)
117
- - Input 组件(输入框,支持前后缀、清除)
118
- - Textarea 组件(多行输入)
119
- - Design Tokens(primitives 色板 + 语义色 fg-color / border-color / bg-color)
@@ -1 +0,0 @@
1
- import {a as a$1}from'./chunk-DN2VKVCV.mjs';import E,{createContext,useContext}from'react';import {Toaster,toast}from'sonner';import {ExclamationTriangle,ExclamationCircle,Check2Circle,Information1,XLg}from'lingee-icon';import {jsx,jsxs}from'react/jsx-runtime';var y={locale:"zh-CN",Button:{},Breadcrumb:{more:"\u66F4\u591A",back:"\u8FD4\u56DE"},Select:{loading:"\u52A0\u8F7D\u4E2D",loadError:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",notFound:"\u641C\u7D22\u65E0\u7ED3\u679C",clear:"\u6E05\u7A7A"},Dropdown:{clear:"\u6E05\u9664"},Tabs:{scrollLeft:"\u5411\u5DE6\u6EDA\u52A8",scrollRight:"\u5411\u53F3\u6EDA\u52A8"},Form:{required:"{label}\u4E0D\u80FD\u4E3A\u7A7A",requiredNoLabel:"\u6B64\u9879\u4E0D\u80FD\u4E3A\u7A7A"},Tag:{close:"\u5173\u95ED"},Upload:{retry:"\u91CD\u65B0\u4E0A\u4F20",remove:"\u79FB\u9664\u6587\u4EF6",removeShort:"\u79FB\u9664",dragText:"\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216",clickUpload:"\u70B9\u51FB\u4E0A\u4F20"},ColorPicker:{placeholder:"\u8BF7\u9009\u62E9\u989C\u8272"},DatePicker:{placeholder:"\u5E74/\u6708/\u65E5",today:"\u4ECA\u5929",prevYear:"\u4E0A\u4E00\u5E74",nextYear:"\u4E0B\u4E00\u5E74",prevMonth:"\u4E0A\u4E00\u6708",nextMonth:"\u4E0B\u4E00\u6708",prevDecade:"\u4E0A\u4E00\u7EC4\u5E74\u4EFD",nextDecade:"\u4E0B\u4E00\u7EC4\u5E74\u4EFD",months:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],yearFormat:"{year}\u5E74",monthFormat:"{month}\u6708"},RangePicker:{startPlaceholder:"\u5E74/\u6708/\u65E5",endPlaceholder:"\u5E74/\u6708/\u65E5"},TimePicker:{now:"\u73B0\u5728",confirm:"\u786E\u5B9A",placeholder:"\u65F6:\u5206",placeholderFull:"\u65F6:\u5206:\u79D2"},Table:{empty:"\u6682\u65E0\u6570\u636E"},Pagination:{total:"\u5171 {total} \u6761",prevPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",itemsPerPage:"{size}\u6761/\u9875",jumpTo:"\u8DF3\u81F3",page:"\u9875"},Dialog:{close:"\u5173\u95ED"},Drawer:{close:"\u5173\u95ED"},Input:{clear:"\u6E05\u7A7A",expand:"\u5C55\u5F00\u8F93\u5165\u6846"},Alert:{close:"\u5173\u95ED"},Toast:{close:"\u5173\u95ED\u6D88\u606F"},Spin:{loading:"\u52A0\u8F7D\u4E2D"}},l=y;var T={locale:"en-US",Button:{},Breadcrumb:{more:"More",back:"Back"},Select:{loading:"Loading",loadError:"Failed to load, please retry",notFound:"No results found",clear:"Clear"},Dropdown:{clear:"Clear"},Tabs:{scrollLeft:"Scroll left",scrollRight:"Scroll right"},Form:{required:"{label} is required",requiredNoLabel:"This field is required"},Tag:{close:"Close"},Upload:{retry:"Retry upload",remove:"Remove file",removeShort:"Remove",dragText:"Drag files here, or ",clickUpload:"click to upload"},ColorPicker:{placeholder:"Select a color"},DatePicker:{placeholder:"YYYY/MM/DD",today:"Today",prevYear:"Previous year",nextYear:"Next year",prevMonth:"Previous month",nextMonth:"Next month",prevDecade:"Previous decade",nextDecade:"Next decade",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yearFormat:"{year}",monthFormat:"{month}"},RangePicker:{startPlaceholder:"Start date",endPlaceholder:"End date"},TimePicker:{now:"Now",confirm:"OK",placeholder:"HH:mm",placeholderFull:"HH:mm:ss"},Table:{empty:"No data"},Pagination:{total:"{total} items",prevPage:"Previous page",nextPage:"Next page",itemsPerPage:"{size} / page",jumpTo:"Go to",page:""},Dialog:{close:"Close"},Drawer:{close:"Close"},Input:{clear:"Clear",expand:"Expand input"},Alert:{close:"Close"},Toast:{close:"Close message"},Spin:{loading:"Loading"}},C=T;var u=createContext(l);function w({locale:o=l,children:e}){return jsxs(u.Provider,{value:o,children:[e,jsx(g,{})]})}w.displayName="LingeeProvider";function N(){return useContext(u)}function m(o){return N()[o]}var I={info:jsx(Information1,{size:20}),success:jsx(Check2Circle,{size:20}),warning:jsx(ExclamationCircle,{size:20}),error:jsx(ExclamationTriangle,{size:20})};function f({type:o,content:e,icon:t,closable:i,className:c,onClose:d}){let h=m("Toast"),b=()=>{if(t===null)return null;let v=t!==void 0?t:I[o];return jsx("span",{className:"lg-toast__icon",children:v})};return jsxs("div",{className:a$1("lg-toast",`lg-toast--${o}`,c),children:[b(),jsx("span",{className:"lg-toast__content",children:e}),i&&jsx("button",{className:"lg-toast__close",onClick:d,"aria-label":h.close,type:"button",children:jsx(XLg,{size:16})})]})}var a={};function g(){let o=a.top??16;return jsx(Toaster,{position:"top-center",offset:o,gap:8,closeButton:false,toastOptions:{unstyled:true,className:"lg-toast-wrapper"},style:{"--width":"560px"}})}function A(o){let e=o[0];return typeof e=="object"&&e!==null&&!E.isValidElement(e)?e:{content:e,duration:o[1],onClose:o[2]}}function U(o,e){let t=e.duration!==void 0?e.duration<0?a.duration??3e3:e.duration:a.duration??3e3,i=t===0?1/0:t,c=toast.custom(d=>jsx(f,{type:o,content:e.content,icon:e.icon,closable:e.closable,className:e.className,onClose:()=>toast.dismiss(d)}),{...e.key!==void 0&&{id:e.key},duration:i,onAutoClose:()=>e.onClose?.(),onDismiss:()=>e.onClose?.()});return ()=>toast.dismiss(c)}function n(o){return (...e)=>{let t=A(e);return U(o,t)}}var se={info:n("info"),success:n("success"),warning:n("warning"),error:n("error"),destroy:()=>toast.dismiss(),config:o=>{a={...a,...o};}};export{g as a,se as b,l as c,C as d,w as e,N as f,m as g};
@@ -1 +0,0 @@
1
- 'use strict';var chunkDCDWEVW4_js=require('./chunk-DCDWEVW4.js'),E=require('react'),sonner=require('sonner'),lingeeIcon=require('lingee-icon'),jsxRuntime=require('react/jsx-runtime');function _interopDefault(e){return e&&e.__esModule?e:{default:e}}var E__default=/*#__PURE__*/_interopDefault(E);var y={locale:"zh-CN",Button:{},Breadcrumb:{more:"\u66F4\u591A",back:"\u8FD4\u56DE"},Select:{loading:"\u52A0\u8F7D\u4E2D",loadError:"\u52A0\u8F7D\u5931\u8D25\uFF0C\u8BF7\u91CD\u8BD5",notFound:"\u641C\u7D22\u65E0\u7ED3\u679C",clear:"\u6E05\u7A7A"},Dropdown:{clear:"\u6E05\u9664"},Tabs:{scrollLeft:"\u5411\u5DE6\u6EDA\u52A8",scrollRight:"\u5411\u53F3\u6EDA\u52A8"},Form:{required:"{label}\u4E0D\u80FD\u4E3A\u7A7A",requiredNoLabel:"\u6B64\u9879\u4E0D\u80FD\u4E3A\u7A7A"},Tag:{close:"\u5173\u95ED"},Upload:{retry:"\u91CD\u65B0\u4E0A\u4F20",remove:"\u79FB\u9664\u6587\u4EF6",removeShort:"\u79FB\u9664",dragText:"\u62D6\u62FD\u6587\u4EF6\u5230\u6B64\u5904\uFF0C\u6216",clickUpload:"\u70B9\u51FB\u4E0A\u4F20"},ColorPicker:{placeholder:"\u8BF7\u9009\u62E9\u989C\u8272"},DatePicker:{placeholder:"\u5E74/\u6708/\u65E5",today:"\u4ECA\u5929",prevYear:"\u4E0A\u4E00\u5E74",nextYear:"\u4E0B\u4E00\u5E74",prevMonth:"\u4E0A\u4E00\u6708",nextMonth:"\u4E0B\u4E00\u6708",prevDecade:"\u4E0A\u4E00\u7EC4\u5E74\u4EFD",nextDecade:"\u4E0B\u4E00\u7EC4\u5E74\u4EFD",months:["1\u6708","2\u6708","3\u6708","4\u6708","5\u6708","6\u6708","7\u6708","8\u6708","9\u6708","10\u6708","11\u6708","12\u6708"],yearFormat:"{year}\u5E74",monthFormat:"{month}\u6708"},RangePicker:{startPlaceholder:"\u5E74/\u6708/\u65E5",endPlaceholder:"\u5E74/\u6708/\u65E5"},TimePicker:{now:"\u73B0\u5728",confirm:"\u786E\u5B9A",placeholder:"\u65F6:\u5206",placeholderFull:"\u65F6:\u5206:\u79D2"},Table:{empty:"\u6682\u65E0\u6570\u636E"},Pagination:{total:"\u5171 {total} \u6761",prevPage:"\u4E0A\u4E00\u9875",nextPage:"\u4E0B\u4E00\u9875",itemsPerPage:"{size}\u6761/\u9875",jumpTo:"\u8DF3\u81F3",page:"\u9875"},Dialog:{close:"\u5173\u95ED"},Drawer:{close:"\u5173\u95ED"},Input:{clear:"\u6E05\u7A7A",expand:"\u5C55\u5F00\u8F93\u5165\u6846"},Alert:{close:"\u5173\u95ED"},Toast:{close:"\u5173\u95ED\u6D88\u606F"},Spin:{loading:"\u52A0\u8F7D\u4E2D"}},l=y;var T={locale:"en-US",Button:{},Breadcrumb:{more:"More",back:"Back"},Select:{loading:"Loading",loadError:"Failed to load, please retry",notFound:"No results found",clear:"Clear"},Dropdown:{clear:"Clear"},Tabs:{scrollLeft:"Scroll left",scrollRight:"Scroll right"},Form:{required:"{label} is required",requiredNoLabel:"This field is required"},Tag:{close:"Close"},Upload:{retry:"Retry upload",remove:"Remove file",removeShort:"Remove",dragText:"Drag files here, or ",clickUpload:"click to upload"},ColorPicker:{placeholder:"Select a color"},DatePicker:{placeholder:"YYYY/MM/DD",today:"Today",prevYear:"Previous year",nextYear:"Next year",prevMonth:"Previous month",nextMonth:"Next month",prevDecade:"Previous decade",nextDecade:"Next decade",months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],yearFormat:"{year}",monthFormat:"{month}"},RangePicker:{startPlaceholder:"Start date",endPlaceholder:"End date"},TimePicker:{now:"Now",confirm:"OK",placeholder:"HH:mm",placeholderFull:"HH:mm:ss"},Table:{empty:"No data"},Pagination:{total:"{total} items",prevPage:"Previous page",nextPage:"Next page",itemsPerPage:"{size} / page",jumpTo:"Go to",page:""},Dialog:{close:"Close"},Drawer:{close:"Close"},Input:{clear:"Clear",expand:"Expand input"},Alert:{close:"Close"},Toast:{close:"Close message"},Spin:{loading:"Loading"}},C=T;var u=E.createContext(l);function w({locale:o=l,children:e}){return jsxRuntime.jsxs(u.Provider,{value:o,children:[e,jsxRuntime.jsx(g,{})]})}w.displayName="LingeeProvider";function N(){return E.useContext(u)}function m(o){return N()[o]}var I={info:jsxRuntime.jsx(lingeeIcon.Information1,{size:20}),success:jsxRuntime.jsx(lingeeIcon.Check2Circle,{size:20}),warning:jsxRuntime.jsx(lingeeIcon.ExclamationCircle,{size:20}),error:jsxRuntime.jsx(lingeeIcon.ExclamationTriangle,{size:20})};function f({type:o,content:e,icon:t,closable:i,className:c,onClose:d}){let h=m("Toast"),b=()=>{if(t===null)return null;let v=t!==void 0?t:I[o];return jsxRuntime.jsx("span",{className:"lg-toast__icon",children:v})};return jsxRuntime.jsxs("div",{className:chunkDCDWEVW4_js.a("lg-toast",`lg-toast--${o}`,c),children:[b(),jsxRuntime.jsx("span",{className:"lg-toast__content",children:e}),i&&jsxRuntime.jsx("button",{className:"lg-toast__close",onClick:d,"aria-label":h.close,type:"button",children:jsxRuntime.jsx(lingeeIcon.XLg,{size:16})})]})}var a={};function g(){let o=a.top??16;return jsxRuntime.jsx(sonner.Toaster,{position:"top-center",offset:o,gap:8,closeButton:false,toastOptions:{unstyled:true,className:"lg-toast-wrapper"},style:{"--width":"560px"}})}function A(o){let e=o[0];return typeof e=="object"&&e!==null&&!E__default.default.isValidElement(e)?e:{content:e,duration:o[1],onClose:o[2]}}function U(o,e){let t=e.duration!==void 0?e.duration<0?a.duration??3e3:e.duration:a.duration??3e3,i=t===0?1/0:t,c=sonner.toast.custom(d=>jsxRuntime.jsx(f,{type:o,content:e.content,icon:e.icon,closable:e.closable,className:e.className,onClose:()=>sonner.toast.dismiss(d)}),{...e.key!==void 0&&{id:e.key},duration:i,onAutoClose:()=>e.onClose?.(),onDismiss:()=>e.onClose?.()});return ()=>sonner.toast.dismiss(c)}function n(o){return (...e)=>{let t=A(e);return U(o,t)}}var se={info:n("info"),success:n("success"),warning:n("warning"),error:n("error"),destroy:()=>sonner.toast.dismiss(),config:o=>{a={...a,...o};}};exports.a=g;exports.b=se;exports.c=l;exports.d=C;exports.e=w;exports.f=N;exports.g=m;