@teamix-evo/ui 0.5.0 → 0.6.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/package.json +19 -17
- package/src/components/alert/index.tsx +1 -1
- package/src/components/alert-dialog/index.tsx +17 -24
- package/src/components/alert-dialog/meta.md +102 -8
- package/src/components/alert-dialog/stories.tsx +117 -7
- package/src/components/avatar/index.tsx +1 -1
- package/src/components/badge/index.tsx +1 -1
- package/src/components/button/index.tsx +3 -31
- package/src/components/button/meta.md +24 -13
- package/src/components/button/stories.tsx +24 -12
- package/src/components/button-group/meta.md +6 -9
- package/src/components/button-group/stories.tsx +2 -6
- package/src/components/calendar/index.tsx +12 -7
- package/src/components/cascader-select/index.tsx +1 -1
- package/src/components/checkbox/index.tsx +1 -1
- package/src/components/combobox/index.tsx +54 -10
- package/src/components/combobox/meta.md +3 -5
- package/src/components/combobox/stories.tsx +104 -25
- package/src/components/data-table/index.tsx +10 -5
- package/src/components/data-table/stories.tsx +4 -1
- package/src/components/date-picker/index.tsx +25 -2
- package/src/components/field/index.tsx +1 -1
- package/src/components/filter-bar/index.tsx +1 -1
- package/src/components/float-button/meta.md +3 -15
- package/src/components/icon/index.tsx +3 -4
- package/src/components/icon/meta.md +1 -2
- package/src/components/input/index.tsx +11 -3
- package/src/components/input-group/index.tsx +33 -23
- package/src/components/input-group/meta.md +15 -0
- package/src/components/input-group/stories.tsx +14 -0
- package/src/components/input-ip/index.tsx +1 -1
- package/src/components/input-number/index.tsx +5 -5
- package/src/components/item/meta.md +10 -42
- package/src/components/item/stories.tsx +12 -44
- package/src/components/radio-group/index.tsx +1 -1
- package/src/components/rate/index.tsx +3 -3
- package/src/components/select/index.tsx +2 -2
- package/src/components/skeleton/index.tsx +1 -1
- package/src/components/skeleton/meta.md +6 -6
- package/src/components/skeleton/stories.tsx +8 -8
- package/src/components/slider/index.tsx +27 -1
- package/src/components/sonner/index.tsx +43 -40
- package/src/components/sonner/meta.md +84 -68
- package/src/components/sonner/stories.tsx +122 -83
- package/src/components/spinner/index.tsx +170 -0
- package/src/components/spinner/meta.md +27 -1
- package/src/components/spinner/stories.tsx +23 -0
- package/src/components/steps/index.tsx +5 -1
- package/src/components/switch/index.tsx +1 -1
- package/src/components/table/index.tsx +6 -2
- package/src/components/tag/index.tsx +14 -0
- package/src/components/tag/meta.md +1 -0
- package/src/components/tag/stories.tsx +13 -0
- package/src/components/textarea/index.tsx +1 -1
- package/src/components/textarea/stories.tsx +1 -1
- package/src/components/time-picker/index.tsx +3 -1
- package/src/components/toggle/index.tsx +1 -1
- package/src/components/tooltip/index.tsx +5 -1
- package/src/components/tooltip/meta.md +13 -28
- package/src/components/tooltip/stories.tsx +11 -28
- package/src/components/transfer/index.tsx +12 -10
- package/src/components/tree-select/index.tsx +1 -1
- package/LICENSE +0 -21
|
@@ -263,6 +263,12 @@ export interface TagClosableConfig {
|
|
|
263
263
|
closeArea?: 'tag' | 'tail';
|
|
264
264
|
/** 关闭按钮 aria-label(默认 `'Close'`)。 */
|
|
265
265
|
'aria-label'?: string;
|
|
266
|
+
/**
|
|
267
|
+
* hover 时才显示关闭按钮,默认隐藏。
|
|
268
|
+
* 效果:hover 后关闭按钮淡入,文字向左微移让出空间。
|
|
269
|
+
* @default false
|
|
270
|
+
*/
|
|
271
|
+
hoverReveal?: boolean;
|
|
266
272
|
}
|
|
267
273
|
|
|
268
274
|
export interface TagProps
|
|
@@ -352,6 +358,7 @@ function Tag({
|
|
|
352
358
|
const closableConfig = asChild ? null : normalizeClosable(closable);
|
|
353
359
|
const closeArea = closableConfig?.closeArea ?? 'tail';
|
|
354
360
|
const closeAriaLabel = closableConfig?.['aria-label'] ?? 'Close';
|
|
361
|
+
const hoverReveal = closableConfig?.hoverReveal ?? false;
|
|
355
362
|
|
|
356
363
|
const triggerClose = (
|
|
357
364
|
e: React.MouseEvent<HTMLElement> | React.KeyboardEvent<HTMLElement>,
|
|
@@ -380,6 +387,7 @@ function Tag({
|
|
|
380
387
|
const closeButton = closableConfig ? (
|
|
381
388
|
<button
|
|
382
389
|
type="button"
|
|
390
|
+
data-slot="tag-close"
|
|
383
391
|
aria-label={closeAriaLabel}
|
|
384
392
|
disabled={disabled}
|
|
385
393
|
onClick={(e) => {
|
|
@@ -397,6 +405,8 @@ function Tag({
|
|
|
397
405
|
'-mr-0.5 inline-flex shrink-0 cursor-pointer rounded-sm opacity-60 transition-opacity hover:opacity-100',
|
|
398
406
|
'focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring',
|
|
399
407
|
disabled && 'cursor-not-allowed opacity-30 hover:opacity-30',
|
|
408
|
+
hoverReveal &&
|
|
409
|
+
'mr-0 overflow-hidden w-0 opacity-0 transition-[width,opacity] duration-150 group-hover/tag:w-3 group-hover/tag:opacity-60',
|
|
400
410
|
)}
|
|
401
411
|
>
|
|
402
412
|
{renderCloseIcon(closableConfig.closeIcon)}
|
|
@@ -427,6 +437,8 @@ function Tag({
|
|
|
427
437
|
closeArea === 'tag' &&
|
|
428
438
|
!disabled &&
|
|
429
439
|
'cursor-pointer',
|
|
440
|
+
hoverReveal &&
|
|
441
|
+
'group/tag transition-[padding-inline] duration-150 hover:!px-1.5',
|
|
430
442
|
className,
|
|
431
443
|
)}
|
|
432
444
|
style={{ color: tone, ...style }}
|
|
@@ -530,6 +542,8 @@ function Tag({
|
|
|
530
542
|
'bg-[var(--tag-bg)] hover:bg-[var(--tag-bg-hover)]',
|
|
531
543
|
disabled && 'cursor-not-allowed opacity-50',
|
|
532
544
|
closableConfig && closeArea === 'tag' && !disabled && 'cursor-pointer',
|
|
545
|
+
hoverReveal &&
|
|
546
|
+
'group/tag transition-[padding-inline] duration-150 hover:!px-1.5',
|
|
533
547
|
className,
|
|
534
548
|
)}
|
|
535
549
|
style={{ ...composedStyle, ...style }}
|
|
@@ -38,6 +38,7 @@ closeArea / aria-label),`onClose(e)` 调用 `e.preventDefault()` 即可
|
|
|
38
38
|
| `visible` | `boolean` | – | – | 受控可见性。 |
|
|
39
39
|
| `defaultVisible` | `boolean` | – | – | 非受控初始可见性,默认 `true`。 |
|
|
40
40
|
| `disabled` | `boolean` | – | – | 禁用态:灰显 + cursor-not-allowed,点击 / 关闭均无效。 |
|
|
41
|
+
| `borderless` | `boolean` | – | – | 去除边框显示。在 OP 主题下,带 icon 的分类 Tag 使用此样式: 仅保留浅色背景 + 彩色文字 + 前缀图标,无边框线。 |
|
|
41
42
|
| `asChild` | `boolean` | – | – | Slot 模式渲染为子元素(如 `<a>`);此模式下不内置渲染 icon 与关闭按钮。 |
|
|
42
43
|
| `gap` | `'sm' \| 'md' \| 'lg'` | – | – | 间距档位:`sm` 6px / `md` 8px(默认) / `lg` 12px。 |
|
|
43
44
|
| `checked` | `boolean` | – | ✓ | 是否选中(受控)。 |
|
|
@@ -192,6 +192,19 @@ export const Closable: Story = {
|
|
|
192
192
|
</CheckableTag>
|
|
193
193
|
</TagGroup>
|
|
194
194
|
</div>
|
|
195
|
+
<div>
|
|
196
|
+
<h4 className="mb-2 text-xs text-muted-foreground">
|
|
197
|
+
hoverReveal(hover 时才显示 ×)
|
|
198
|
+
</h4>
|
|
199
|
+
<TagGroup>
|
|
200
|
+
<Tag closable={{ hoverReveal: true }} color="primary">
|
|
201
|
+
hover me
|
|
202
|
+
</Tag>
|
|
203
|
+
<Tag closable={{ hoverReveal: true }} color="success">
|
|
204
|
+
hover me too
|
|
205
|
+
</Tag>
|
|
206
|
+
</TagGroup>
|
|
207
|
+
</div>
|
|
195
208
|
</div>
|
|
196
209
|
);
|
|
197
210
|
},
|
|
@@ -17,7 +17,7 @@ import { cn } from '@/lib/utils';
|
|
|
17
17
|
// ─── Textarea cva ────────────────────────────────────────────────────────────
|
|
18
18
|
|
|
19
19
|
const textareaVariants = cva(
|
|
20
|
-
'flex w-full cursor-text rounded-md border border-input bg-transparent font-normal field-sizing-content transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-
|
|
20
|
+
'flex w-full cursor-text rounded-md border border-input bg-transparent font-normal field-sizing-content transition-colors outline-none placeholder:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/20 disabled:cursor-not-allowed disabled:bg-input/50 disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20',
|
|
21
21
|
{
|
|
22
22
|
variants: {
|
|
23
23
|
size: {
|
|
@@ -71,7 +71,7 @@ export function inspectFormat(format: string) {
|
|
|
71
71
|
const triggerVariants = cva(
|
|
72
72
|
[
|
|
73
73
|
'flex cursor-pointer items-center gap-2 rounded-md border border-input bg-transparent transition-colors',
|
|
74
|
-
'hover:border-ring focus-within:border-ring focus-within:ring-
|
|
74
|
+
'hover:border-ring focus-within:border-ring focus-within:ring-ring/20',
|
|
75
75
|
'[&:has(input:disabled)]:pointer-events-none [&:has(input:disabled)]:cursor-not-allowed [&:has(input:disabled)]:bg-input/50 [&:has(input:disabled)]:opacity-50',
|
|
76
76
|
'aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20',
|
|
77
77
|
].join(' '),
|
|
@@ -509,6 +509,7 @@ function TimePicker({
|
|
|
509
509
|
<Clock
|
|
510
510
|
data-slot="time-picker-icon"
|
|
511
511
|
aria-hidden
|
|
512
|
+
strokeWidth={1.5}
|
|
512
513
|
className="size-4 shrink-0 text-muted-foreground"
|
|
513
514
|
/>
|
|
514
515
|
)}
|
|
@@ -825,6 +826,7 @@ function TimeRangePicker({
|
|
|
825
826
|
<Clock
|
|
826
827
|
data-slot="time-range-picker-icon"
|
|
827
828
|
aria-hidden
|
|
829
|
+
strokeWidth={1.5}
|
|
828
830
|
className="size-4 shrink-0 text-muted-foreground"
|
|
829
831
|
/>
|
|
830
832
|
)}
|
|
@@ -15,7 +15,7 @@ import { Toggle as TogglePrimitive } from 'radix-ui';
|
|
|
15
15
|
import { cn } from '@/lib/utils';
|
|
16
16
|
|
|
17
17
|
const toggleVariants = cva(
|
|
18
|
-
'group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-
|
|
18
|
+
'group/toggle inline-flex items-center justify-center gap-1 rounded-md text-xs font-medium whitespace-nowrap transition-all outline-none hover:bg-muted hover:text-foreground focus-visible:border-ring focus-visible:ring-ring/20 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 aria-pressed:bg-muted data-[state=on]:bg-muted cursor-pointer [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*=size-])]:size-4',
|
|
19
19
|
{
|
|
20
20
|
variants: {
|
|
21
21
|
variant: {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
* - 截断文本悬停展示完整内容
|
|
9
9
|
* - 为操作提供额外上下文信息
|
|
10
10
|
*
|
|
11
|
-
* 组合结构:TooltipProvider > Tooltip > TooltipTrigger + TooltipContent (
|
|
11
|
+
* 组合结构:TooltipProvider > Tooltip > TooltipTrigger + TooltipContent (默认带 Arrow,showArrow={false} 可隐藏)
|
|
12
12
|
*/
|
|
13
13
|
|
|
14
14
|
'use client';
|
|
@@ -86,6 +86,8 @@ export interface TooltipContentProps
|
|
|
86
86
|
variant?: 'default' | 'inverse';
|
|
87
87
|
/** 浮层渲染容器,透传给 Portal。 @default document.body */
|
|
88
88
|
container?: HTMLElement | null;
|
|
89
|
+
/** 是否显示箭头。 @default true */
|
|
90
|
+
showArrow?: boolean;
|
|
89
91
|
}
|
|
90
92
|
|
|
91
93
|
function TooltipContent({
|
|
@@ -93,6 +95,7 @@ function TooltipContent({
|
|
|
93
95
|
sideOffset = 4,
|
|
94
96
|
variant = 'default',
|
|
95
97
|
container,
|
|
98
|
+
showArrow = true,
|
|
96
99
|
children,
|
|
97
100
|
...props
|
|
98
101
|
}: TooltipContentProps) {
|
|
@@ -106,6 +109,7 @@ function TooltipContent({
|
|
|
106
109
|
{...props}
|
|
107
110
|
>
|
|
108
111
|
{children}
|
|
112
|
+
{showArrow && <TooltipArrow />}
|
|
109
113
|
</TooltipPrimitive.Content>
|
|
110
114
|
</TooltipPrimitive.Portal>
|
|
111
115
|
);
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
- 图标按钮需要文字解释
|
|
13
13
|
- 截断文本悬停展示完整内容
|
|
14
14
|
- 为操作提供额外上下文信息
|
|
15
|
-
- 组合结构:TooltipProvider > Tooltip > TooltipTrigger + TooltipContent (
|
|
15
|
+
- 组合结构:TooltipProvider > Tooltip > TooltipTrigger + TooltipContent (默认带 Arrow,showArrow={false} 可隐藏)
|
|
16
16
|
|
|
17
17
|
## Props
|
|
18
18
|
|
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
| `disableHoverableContent` | `boolean` | `false` | – | 是否禁用鼠标进入 Tooltip 内保持显示。 |
|
|
26
26
|
| `variant` | `'default' \| 'inverse'` | `'default'` | – | 视觉变体:default = 亮底;inverse = 反色(深底白字)。 |
|
|
27
27
|
| `container` | `HTMLElement \| null` | `document.body` | – | 浮层渲染容器,透传给 Portal。 |
|
|
28
|
+
| `showArrow` | `boolean` | `true` | – | 是否显示箭头。 |
|
|
28
29
|
|
|
29
30
|
## 示例
|
|
30
31
|
|
|
@@ -86,29 +87,25 @@
|
|
|
86
87
|
</TooltipProvider>
|
|
87
88
|
```
|
|
88
89
|
|
|
89
|
-
###
|
|
90
|
+
### WithoutArrow
|
|
90
91
|
|
|
91
|
-
|
|
92
|
+
隐藏箭头:showArrow={false}。
|
|
92
93
|
|
|
93
94
|
```tsx
|
|
94
95
|
<TooltipProvider>
|
|
95
96
|
<div className="flex items-center gap-4">
|
|
96
97
|
<Tooltip>
|
|
97
98
|
<TooltipTrigger asChild>
|
|
98
|
-
<Button
|
|
99
|
+
<Button>无箭头</Button>
|
|
99
100
|
</TooltipTrigger>
|
|
100
|
-
<TooltipContent>
|
|
101
|
-
提示内容
|
|
102
|
-
<TooltipArrow />
|
|
103
|
-
</TooltipContent>
|
|
101
|
+
<TooltipContent showArrow={false}>提示内容</TooltipContent>
|
|
104
102
|
</Tooltip>
|
|
105
103
|
<Tooltip>
|
|
106
104
|
<TooltipTrigger asChild>
|
|
107
|
-
<Button
|
|
105
|
+
<Button>反色无箭头</Button>
|
|
108
106
|
</TooltipTrigger>
|
|
109
|
-
<TooltipContent variant="inverse">
|
|
107
|
+
<TooltipContent variant="inverse" showArrow={false}>
|
|
110
108
|
深色提示
|
|
111
|
-
<TooltipArrow />
|
|
112
109
|
</TooltipContent>
|
|
113
110
|
</Tooltip>
|
|
114
111
|
</div>
|
|
@@ -117,7 +114,7 @@
|
|
|
117
114
|
|
|
118
115
|
### ArrowSides
|
|
119
116
|
|
|
120
|
-
四个方向的箭头 — 箭头随 side 自动朝向 trigger
|
|
117
|
+
四个方向的箭头 — 箭头随 side 自动朝向 trigger(默认即带箭头)。
|
|
121
118
|
|
|
122
119
|
```tsx
|
|
123
120
|
<TooltipProvider delayDuration={0}>
|
|
@@ -126,37 +123,25 @@
|
|
|
126
123
|
<TooltipTrigger asChild>
|
|
127
124
|
<Button>side=top</Button>
|
|
128
125
|
</TooltipTrigger>
|
|
129
|
-
<TooltipContent side="top">
|
|
130
|
-
top
|
|
131
|
-
<TooltipArrow />
|
|
132
|
-
</TooltipContent>
|
|
126
|
+
<TooltipContent side="top">top</TooltipContent>
|
|
133
127
|
</Tooltip>
|
|
134
128
|
<Tooltip open>
|
|
135
129
|
<TooltipTrigger asChild>
|
|
136
130
|
<Button>side=bottom</Button>
|
|
137
131
|
</TooltipTrigger>
|
|
138
|
-
<TooltipContent side="bottom">
|
|
139
|
-
bottom
|
|
140
|
-
<TooltipArrow />
|
|
141
|
-
</TooltipContent>
|
|
132
|
+
<TooltipContent side="bottom">bottom</TooltipContent>
|
|
142
133
|
</Tooltip>
|
|
143
134
|
<Tooltip open>
|
|
144
135
|
<TooltipTrigger asChild>
|
|
145
136
|
<Button>side=left</Button>
|
|
146
137
|
</TooltipTrigger>
|
|
147
|
-
<TooltipContent side="left">
|
|
148
|
-
left
|
|
149
|
-
<TooltipArrow />
|
|
150
|
-
</TooltipContent>
|
|
138
|
+
<TooltipContent side="left">left</TooltipContent>
|
|
151
139
|
</Tooltip>
|
|
152
140
|
<Tooltip open>
|
|
153
141
|
<TooltipTrigger asChild>
|
|
154
142
|
<Button>side=right</Button>
|
|
155
143
|
</TooltipTrigger>
|
|
156
|
-
<TooltipContent side="right">
|
|
157
|
-
right
|
|
158
|
-
<TooltipArrow />
|
|
159
|
-
</TooltipContent>
|
|
144
|
+
<TooltipContent side="right">right</TooltipContent>
|
|
160
145
|
</Tooltip>
|
|
161
146
|
</div>
|
|
162
147
|
</TooltipProvider>
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import {
|
|
3
3
|
Tooltip,
|
|
4
|
-
TooltipArrow,
|
|
5
4
|
TooltipContent,
|
|
6
5
|
TooltipProvider,
|
|
7
6
|
TooltipTrigger,
|
|
@@ -115,27 +114,23 @@ export const AllPositions: Story = {
|
|
|
115
114
|
},
|
|
116
115
|
};
|
|
117
116
|
|
|
118
|
-
/**
|
|
119
|
-
export const
|
|
117
|
+
/** 隐藏箭头:showArrow={false}。 */
|
|
118
|
+
export const WithoutArrow: Story = {
|
|
120
119
|
render: () => (
|
|
121
120
|
<TooltipProvider>
|
|
122
121
|
<div className="flex items-center gap-4">
|
|
123
122
|
<Tooltip>
|
|
124
123
|
<TooltipTrigger asChild>
|
|
125
|
-
<Button
|
|
124
|
+
<Button>无箭头</Button>
|
|
126
125
|
</TooltipTrigger>
|
|
127
|
-
<TooltipContent>
|
|
128
|
-
提示内容
|
|
129
|
-
<TooltipArrow />
|
|
130
|
-
</TooltipContent>
|
|
126
|
+
<TooltipContent showArrow={false}>提示内容</TooltipContent>
|
|
131
127
|
</Tooltip>
|
|
132
128
|
<Tooltip>
|
|
133
129
|
<TooltipTrigger asChild>
|
|
134
|
-
<Button
|
|
130
|
+
<Button>反色无箭头</Button>
|
|
135
131
|
</TooltipTrigger>
|
|
136
|
-
<TooltipContent variant="inverse">
|
|
132
|
+
<TooltipContent variant="inverse" showArrow={false}>
|
|
137
133
|
深色提示
|
|
138
|
-
<TooltipArrow />
|
|
139
134
|
</TooltipContent>
|
|
140
135
|
</Tooltip>
|
|
141
136
|
</div>
|
|
@@ -143,7 +138,7 @@ export const WithArrow: Story = {
|
|
|
143
138
|
),
|
|
144
139
|
};
|
|
145
140
|
|
|
146
|
-
/** 四个方向的箭头 — 箭头随 side 自动朝向 trigger
|
|
141
|
+
/** 四个方向的箭头 — 箭头随 side 自动朝向 trigger(默认即带箭头)。 */
|
|
147
142
|
export const ArrowSides: Story = {
|
|
148
143
|
render: () => (
|
|
149
144
|
<TooltipProvider delayDuration={0}>
|
|
@@ -152,37 +147,25 @@ export const ArrowSides: Story = {
|
|
|
152
147
|
<TooltipTrigger asChild>
|
|
153
148
|
<Button>side=top</Button>
|
|
154
149
|
</TooltipTrigger>
|
|
155
|
-
<TooltipContent side="top">
|
|
156
|
-
top
|
|
157
|
-
<TooltipArrow />
|
|
158
|
-
</TooltipContent>
|
|
150
|
+
<TooltipContent side="top">top</TooltipContent>
|
|
159
151
|
</Tooltip>
|
|
160
152
|
<Tooltip open>
|
|
161
153
|
<TooltipTrigger asChild>
|
|
162
154
|
<Button>side=bottom</Button>
|
|
163
155
|
</TooltipTrigger>
|
|
164
|
-
<TooltipContent side="bottom">
|
|
165
|
-
bottom
|
|
166
|
-
<TooltipArrow />
|
|
167
|
-
</TooltipContent>
|
|
156
|
+
<TooltipContent side="bottom">bottom</TooltipContent>
|
|
168
157
|
</Tooltip>
|
|
169
158
|
<Tooltip open>
|
|
170
159
|
<TooltipTrigger asChild>
|
|
171
160
|
<Button>side=left</Button>
|
|
172
161
|
</TooltipTrigger>
|
|
173
|
-
<TooltipContent side="left">
|
|
174
|
-
left
|
|
175
|
-
<TooltipArrow />
|
|
176
|
-
</TooltipContent>
|
|
162
|
+
<TooltipContent side="left">left</TooltipContent>
|
|
177
163
|
</Tooltip>
|
|
178
164
|
<Tooltip open>
|
|
179
165
|
<TooltipTrigger asChild>
|
|
180
166
|
<Button>side=right</Button>
|
|
181
167
|
</TooltipTrigger>
|
|
182
|
-
<TooltipContent side="right">
|
|
183
|
-
right
|
|
184
|
-
<TooltipArrow />
|
|
185
|
-
</TooltipContent>
|
|
168
|
+
<TooltipContent side="right">right</TooltipContent>
|
|
186
169
|
</Tooltip>
|
|
187
170
|
</div>
|
|
188
171
|
</TooltipProvider>
|
|
@@ -328,10 +328,7 @@ function TransferPanel({
|
|
|
328
328
|
|
|
329
329
|
{/* Search */}
|
|
330
330
|
{showSearch ? (
|
|
331
|
-
<div
|
|
332
|
-
data-slot="transfer-search"
|
|
333
|
-
className="px-2 pt-1.5 pb-2"
|
|
334
|
-
>
|
|
331
|
+
<div data-slot="transfer-search" className="px-2 pt-1.5 pb-2">
|
|
335
332
|
<Input
|
|
336
333
|
value={search}
|
|
337
334
|
disabled={disabled}
|
|
@@ -404,17 +401,22 @@ function TransferPanel({
|
|
|
404
401
|
) : null}
|
|
405
402
|
<div className="min-w-0 flex-1">{renderItemContent(item)}</div>
|
|
406
403
|
{showRemove ? (
|
|
407
|
-
<
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
404
|
+
<span
|
|
405
|
+
role="button"
|
|
406
|
+
aria-label="移除"
|
|
407
|
+
tabIndex={-1}
|
|
408
|
+
onPointerDown={(e) => {
|
|
409
|
+
e.preventDefault();
|
|
410
|
+
e.stopPropagation();
|
|
411
|
+
}}
|
|
411
412
|
onClick={(e) => {
|
|
412
413
|
e.stopPropagation();
|
|
413
414
|
onItemRemove?.(item.key);
|
|
414
415
|
}}
|
|
416
|
+
className="inline-flex size-4 shrink-0 cursor-pointer items-center justify-center rounded-sm text-muted-foreground opacity-0 transition-colors hover:text-foreground group-hover/transfer-item:opacity-100"
|
|
415
417
|
>
|
|
416
|
-
<X />
|
|
417
|
-
</
|
|
418
|
+
<X className="size-3.5" />
|
|
419
|
+
</span>
|
|
418
420
|
) : null}
|
|
419
421
|
</div>
|
|
420
422
|
);
|
|
@@ -26,7 +26,7 @@ import { findNode } from '@/components/tree/utils';
|
|
|
26
26
|
// ─── Variants ────────────────────────────────────────────────────────────────
|
|
27
27
|
|
|
28
28
|
const treeSelectTriggerVariants = cva(
|
|
29
|
-
'flex w-fit min-w-36 cursor-pointer items-center justify-between gap-1.5 rounded-md border border-input bg-transparent px-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-
|
|
29
|
+
'flex w-fit min-w-36 cursor-pointer items-center justify-between gap-1.5 rounded-md border border-input bg-transparent px-2.5 text-xs whitespace-nowrap transition-colors outline-none select-none focus-visible:border-ring focus-visible:ring-ring/20 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20',
|
|
30
30
|
{
|
|
31
31
|
variants: {
|
|
32
32
|
size: {
|
package/LICENSE
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2026 Teamix Evo Contributors
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|