@tu-design/vue 0.5.12 → 0.5.14
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/dist/index.d.mts +19 -19
- package/dist/index.mjs +72 -6
- package/dist/registry/vue/alert-dialog.json +2 -2
- package/dist/registry/vue/alert.json +1 -1
- package/dist/registry/vue/avatar-group.json +1 -1
- package/dist/registry/vue/avatar.json +1 -1
- package/dist/registry/vue/badge.json +1 -1
- package/dist/registry/vue/button.json +1 -1
- package/dist/registry/vue/calendar.json +1 -1
- package/dist/registry/vue/card.json +1 -1
- package/dist/registry/vue/cascader.json +1 -1
- package/dist/registry/vue/checkbox.json +1 -1
- package/dist/registry/vue/context-menu.json +1 -1
- package/dist/registry/vue/currency-input.json +1 -1
- package/dist/registry/vue/date-picker.json +1 -1
- package/dist/registry/vue/date-range-picker.json +1 -1
- package/dist/registry/vue/date-shared.json +1 -1
- package/dist/registry/vue/dialog.json +2 -2
- package/dist/registry/vue/drawer.json +1 -1
- package/dist/registry/vue/dropdown-menu.json +1 -1
- package/dist/registry/vue/empty.json +1 -1
- package/dist/registry/vue/form-render.json +1 -1
- package/dist/registry/vue/form.json +1 -1
- package/dist/registry/vue/icon-shared.json +1 -1
- package/dist/registry/vue/input.json +1 -1
- package/dist/registry/vue/label.json +1 -1
- package/dist/registry/vue/month-picker.json +1 -1
- package/dist/registry/vue/number-input.json +1 -1
- package/dist/registry/vue/overlay-shared.json +7 -1
- package/dist/registry/vue/password-input.json +1 -1
- package/dist/registry/vue/pin-input.json +1 -1
- package/dist/registry/vue/popconfirm.json +1 -1
- package/dist/registry/vue/popover.json +1 -1
- package/dist/registry/vue/progress.json +1 -1
- package/dist/registry/vue/provider.json +2 -2
- package/dist/registry/vue/radio-group.json +1 -1
- package/dist/registry/vue/registry.json +53 -53
- package/dist/registry/vue/select.json +1 -1
- package/dist/registry/vue/separator.json +1 -1
- package/dist/registry/vue/skeleton.json +1 -1
- package/dist/registry/vue/slider.json +1 -1
- package/dist/registry/vue/slot.json +1 -1
- package/dist/registry/vue/spin.json +1 -1
- package/dist/registry/vue/switch.json +1 -1
- package/dist/registry/vue/table-render.json +1 -1
- package/dist/registry/vue/tabs.json +1 -1
- package/dist/registry/vue/textarea.json +1 -1
- package/dist/registry/vue/timeline.json +1 -1
- package/dist/registry/vue/toast.json +3 -3
- package/dist/registry/vue/tokens.json +1 -1
- package/dist/registry/vue/tooltip.json +1 -1
- package/dist/registry/vue/tree-select.json +1 -1
- package/dist/registry/vue/tree-shared.json +1 -1
- package/dist/registry/vue/utils.json +1 -1
- package/dist/registry/vue/week-picker.json +1 -1
- package/dist/registry/vue/year-picker.json +1 -1
- package/dist/style.css +21 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "table-render",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "配置驱动表格渲染器:defineTable 聚合 TanStack Table 实例与列配置,静态/服务端双模式(onLoad 回写分页排序),搜索表单联动(search 接 FormRender),左右固定列 sticky 横向滚动,表体虚拟滚动(virtual + height,TanStack Virtual 动态测量行高),树形数据(tree:子行展开/收起、depth 缩进、caret 位于首列),行拖拽排序(draggable:把手列页内 DnD + drag-sort 事件,静态模式引擎先行重排、服务端模式只发事件;与 tree/virtual 互斥,排序激活/rowKey 缺失时把手置灰),列显隐(columnSettings 面板 + visibleKeys 受控,面板树形三态),表头分组(任意层级多级表头,分组列/固定列/多行 sticky 全兼容),错误态占位与重试(#error 插槽 + load-error),ellipsis 支持 tooltip 形态,v-model 受控(pageIndex/pageSize/sort/selectedKeys),Ark Pagination 分页条 + 原生 select 每页条数,排序表头 aria-sort、加载骨架与空态插槽,语义化 table + Tailwind tokens。",
|
|
7
7
|
"registryDependencies": [
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "timeline",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "时间轴:数据驱动 items 渲染竖向事件流,支持单列/左右交替、五种语义节点色与空心节点、#item 作用域插槽自定义内容。",
|
|
7
7
|
"registryDependencies": ["utils"],
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "toast",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "全局轻提示:ToastProvider 在应用根部挂载一次,useToast() 提供命令式 API(success/error/info/warning/loading/promise/dismiss);基于 Ark UI Toast 原语,语义 type 映射主题 token 配色。",
|
|
7
|
-
"registryDependencies": ["icon-shared", "utils"],
|
|
7
|
+
"registryDependencies": ["icon-shared", "utils", "overlay-shared"],
|
|
8
8
|
"dependencies": ["@ark-ui/vue@^5.40.0"],
|
|
9
9
|
"files": [
|
|
10
10
|
{
|
|
11
11
|
"path": "toast/ToastProvider.vue",
|
|
12
12
|
"type": "registry:component",
|
|
13
13
|
"target": "components/ui/toast/ToastProvider.vue",
|
|
14
|
-
"content": "<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, shallowRef } from \"vue\";\nimport { Toaster, Toast } from \"@ark-ui/vue/toast\";\nimport type { ToastPlacement } from \"./useToast\";\nimport { cn } from \"@/lib/utils\";\nimport CloseIcon from \"../icon-shared/CloseIcon.vue\";\nimport { __configureToaster, __setToastMounted } from \"./useToast\";\n\n/**\n * Toast 渲染容器:在应用根部挂载一次。\n * 内部按 props 重建 useToast 单例 store,随后所有 toast 方法经单例转发到这里渲染。\n *\n * 兼容出口:新接入推荐 `<TuDesignProvider :toast=\"{...}\">`(内部组合本组件)。\n * 两者同时挂载即双宿主,dev 告警且后挂载者配置生效,请二选一。\n */\nconst props = defineProps({\n /** 弹出位置 */\n placement: { type: String as () => ToastPlacement, default: \"bottom-end\" },\n /** 默认自动关闭时长(ms) */\n duration: { type: Number, default: 3000 },\n /** 同屏最大数量,超出排队 */\n max: { type: Number, default: 3 },\n});\n\n// setup 阶段同步重建:首次渲染的 <Toaster> 即持有新配置(zag 仅在挂载时消费 store)\nconst toaster = shallowRef(\n __configureToaster({ placement: props.placement, duration: props.duration, max: props.max }),\n);\n\nonMounted(() => __setToastMounted(true));\nonBeforeUnmount(() => __setToastMounted(false));\n\n/** 语义 type → token 样式(tokens.css 的 success/warning/info/destructive) */\nconst typeClass: Record<string, string> = {\n success: \"bg-success text-success-foreground\",\n error: \"bg-destructive text-destructive-foreground\",\n warning: \"bg-warning text-warning-foreground\",\n info: \"bg-info text-info-foreground\",\n loading: \"bg-primary text-primary-foreground\",\n default: \"bg-background text-foreground border-border\",\n};\n\nconst rootBase =\n \"flex w-[22rem] max-w-[calc(100vw-2rem)] items-start gap-3 rounded-md border p-4 shadow-lg
|
|
14
|
+
"content": "<script setup lang=\"ts\">\nimport { computed, onBeforeUnmount, onMounted, shallowRef } from \"vue\";\nimport { Toaster, Toast } from \"@ark-ui/vue/toast\";\nimport type { ToastPlacement } from \"./useToast\";\nimport { cn } from \"@/lib/utils\";\nimport CloseIcon from \"../icon-shared/CloseIcon.vue\";\nimport { useTuProvider } from \"../overlay-shared/config\";\nimport { ensureRafClockGuard } from \"../overlay-shared/rafClock\";\nimport { __configureToaster, __setToastMounted } from \"./useToast\";\n\n/**\n * Toast 渲染容器:在应用根部挂载一次。\n * 内部按 props 重建 useToast 单例 store,随后所有 toast 方法经单例转发到这里渲染。\n *\n * 兼容出口:新接入推荐 `<TuDesignProvider :toast=\"{...}\">`(内部组合本组件)。\n * 两者同时挂载即双宿主,dev 告警且后挂载者配置生效,请二选一。\n *\n * rAF 时钟守卫:独立挂载路径兜底(组合挂载时 TuDesignProvider 已装,幂等无害);\n * mode=\"none\"(经 inject 继承)显式跳过,其余哨兵门控(详注 overlay-shared/rafClock.ts)。\n */\nconst props = defineProps({\n /** 弹出位置 */\n placement: { type: String as () => ToastPlacement, default: \"bottom-end\" },\n /** 默认自动关闭时长(ms) */\n duration: { type: Number, default: 3000 },\n /** 同屏最大数量,超出排队 */\n max: { type: Number, default: 3 },\n});\n\n// setup 阶段同步重建:首次渲染的 <Toaster> 即持有新配置(zag 仅在挂载时消费 store)\nconst toaster = shallowRef(\n __configureToaster({ placement: props.placement, duration: props.duration, max: props.max }),\n);\n\n// rAF 时钟守卫(setup 顶层同步安装,零空窗;mode=\"none\" 显式关闭)\nif (useTuProvider().mode !== \"none\") void ensureRafClockGuard();\n\nonMounted(() => __setToastMounted(true));\nonBeforeUnmount(() => __setToastMounted(false));\n\n/** 语义 type → token 样式(tokens.css 的 success/warning/info/destructive) */\nconst typeClass: Record<string, string> = {\n success: \"bg-success text-success-foreground\",\n error: \"bg-destructive text-destructive-foreground\",\n warning: \"bg-warning text-warning-foreground\",\n info: \"bg-info text-info-foreground\",\n loading: \"bg-primary text-primary-foreground\",\n default: \"bg-background text-foreground border-border\",\n};\n\n// 入退场/堆叠/层级动画全部由下方 <style> 的 Zag 连接样式驱动(translate/scale/opacity\n// transition 消费 machine 注入的 CSS 变量),不再叠加 tw-animate keyframes,避免双引擎位移冲突。\nconst rootBase =\n \"flex w-[22rem] max-w-[calc(100vw-2rem)] items-start gap-3 rounded-md border p-4 shadow-lg\";\n\nconst rootClass = computed(\n () => (type: string) => cn(rootBase, typeClass[type] ?? typeClass.default),\n);\n</script>\n\n<template>\n <Toaster :toaster=\"toaster\" v-slot=\"t\">\n <Toast.Root :class=\"rootClass(String(t.type ?? 'default'))\">\n <!-- 语义图标:随 type 着色(loading 旋转) -->\n <span v-if=\"t.type\" class=\"mt-0.5 shrink-0\" :class=\"{ 'animate-spin': t.type === 'loading' }\">\n <slot name=\"icon\" :type=\"t.type\">\n <svg\n v-if=\"t.type === 'success'\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-4\"\n >\n <path d=\"M21.801 10A10 10 0 1 1 17 3.335\" />\n <path d=\"m9 11 3 3L22 4\" />\n </svg>\n <svg\n v-else-if=\"t.type === 'error'\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-4\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"m15 9-6 6\" />\n <path d=\"m9 9 6 6\" />\n </svg>\n <svg\n v-else-if=\"t.type === 'warning'\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-4\"\n >\n <path d=\"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3\" />\n <path d=\"M12 9v4\" />\n <path d=\"M12 17h.01\" />\n </svg>\n <svg\n v-else-if=\"t.type === 'info'\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-4\"\n >\n <circle cx=\"12\" cy=\"12\" r=\"10\" />\n <path d=\"M12 16v-4\" />\n <path d=\"M12 8h.01\" />\n </svg>\n <svg\n v-else\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n class=\"size-4\"\n >\n <path d=\"M21 12a9 9 0 1 1-6.219-8.56\" />\n </svg>\n </slot>\n </span>\n\n <div class=\"flex-1\">\n <Toast.Title class=\"text-sm font-semibold\">{{ t.title }}</Toast.Title>\n <Toast.Description v-if=\"t.description\" class=\"mt-1 text-sm opacity-90\">\n {{ t.description }}\n </Toast.Description>\n </div>\n\n <div class=\"flex shrink-0 items-center gap-1\">\n <Toast.ActionTrigger\n v-if=\"t.action\"\n class=\"inline-flex h-8 items-center rounded-sm px-2 text-sm font-medium underline-offset-4 hover:underline focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/50\"\n />\n <Toast.CloseTrigger\n aria-label=\"关闭\"\n class=\"inline-flex size-6 items-center justify-center rounded-sm opacity-70 transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-current/50\"\n >\n <CloseIcon class=\"size-4\" />\n <span class=\"sr-only\">关闭</span>\n </Toast.CloseTrigger>\n </div>\n </Toast.Root>\n </Toaster>\n</template>\n\n<!--\n Zag 1.47 toast 连接样式(官方 Styling guide 要求):machine 给每条 root 内联注入\n --x/--y/--z-index/--scale/--height/--opacity 等变量,堆叠位移、层级、退场折叠全靠\n CSS 消费;不消费则多条 toast 全部重叠在同一位置且新条被旧条盖住(issue #7)。\n 非 scoped + data-scope/data-part 双重限定,只作用于 Toast.Root,无跨组件污染。\n 变量缺省时(单条 / frontmost 态)各属性回退 initial,无副作用。\n-->\n<style>\n[data-scope=\"toast\"][data-part=\"root\"] {\n translate: var(--x) var(--y);\n scale: var(--scale);\n z-index: var(--z-index);\n height: var(--height);\n opacity: var(--opacity);\n will-change: translate, opacity, scale;\n transition:\n translate 400ms,\n scale 400ms,\n opacity 400ms;\n transition-timing-function: cubic-bezier(0.21, 1.02, 0.73, 1);\n}\n\n[data-scope=\"toast\"][data-part=\"root\"][data-state=\"closed\"] {\n transition:\n translate 400ms,\n scale 400ms,\n opacity 200ms;\n transition-timing-function: cubic-bezier(0.06, 0.71, 0.55, 1);\n}\n</style>\n"
|
|
15
15
|
},
|
|
16
16
|
{
|
|
17
17
|
"path": "toast/index.ts",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "tokens",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:style",
|
|
6
6
|
"description": "Tailwind CSS v4 语义 tokens(shadcn 官方 v4 集合)。",
|
|
7
7
|
"dependencies": ["tw-animate-css@^1.4.0"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "tooltip",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "文字提示气泡:悬停触发,基于 Ark UI Tooltip 原语,支持 asChild 与延迟配置。",
|
|
7
7
|
"registryDependencies": ["utils", "overlay-shared"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "tree-select",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "树形下拉选择:一站式 props 驱动,支持单/多选、勾选级联、过滤与多标签折叠。",
|
|
7
7
|
"registryDependencies": ["icon-shared", "tree-shared", "utils", "date-shared", "overlay-shared"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "tree-shared",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "树形数据层与共享类型(移植自 treemate v0.3.11,MIT)。",
|
|
7
7
|
"registryDependencies": ["icon-shared", "utils"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "utils",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:lib",
|
|
6
6
|
"description": "cn 类名合并工具(clsx + tailwind-merge)。",
|
|
7
7
|
"dependencies": ["clsx@^2.1.1", "tailwind-merge@^3.7.0", "class-variance-authority@^0.7.1"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "week-picker",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "周选择器:输入框 + 日历弹层,点任意可选日归一到所在周并整周高亮,值以 \"yyyy-MM-dd\"(所在周起始日)字符串受控;周起点跟随 locale(zh-CN 周一起始),输入框回显 \"start ~ end\"。",
|
|
7
7
|
"registryDependencies": ["utils", "date-shared", "calendar"],
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
3
|
"name": "year-picker",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.14",
|
|
5
5
|
"type": "registry:ui",
|
|
6
6
|
"description": "年份选择器:输入框 + 锁定年视图的日历弹层(decade 网格),值以 \"yyyy\" 字符串受控,min/max 为年粒度闭区间。",
|
|
7
7
|
"registryDependencies": ["utils", "date-shared", "calendar"],
|
package/dist/style.css
CHANGED
|
@@ -8,3 +8,24 @@ to {
|
|
|
8
8
|
opacity: 1;
|
|
9
9
|
}
|
|
10
10
|
}
|
|
11
|
+
|
|
12
|
+
[data-scope="toast"][data-part="root"] {
|
|
13
|
+
translate: var(--x) var(--y);
|
|
14
|
+
scale: var(--scale);
|
|
15
|
+
z-index: var(--z-index);
|
|
16
|
+
height: var(--height);
|
|
17
|
+
opacity: var(--opacity);
|
|
18
|
+
will-change: translate, opacity, scale;
|
|
19
|
+
transition:
|
|
20
|
+
translate 400ms,
|
|
21
|
+
scale 400ms,
|
|
22
|
+
opacity 400ms;
|
|
23
|
+
transition-timing-function: cubic-bezier(0.21, 1.02, 0.73, 1);
|
|
24
|
+
}
|
|
25
|
+
[data-scope="toast"][data-part="root"][data-state="closed"] {
|
|
26
|
+
transition:
|
|
27
|
+
translate 400ms,
|
|
28
|
+
scale 400ms,
|
|
29
|
+
opacity 200ms;
|
|
30
|
+
transition-timing-function: cubic-bezier(0.06, 0.71, 0.55, 1);
|
|
31
|
+
}
|