@lark-apaas/coding-template-nestjs-react-fullstack 0.1.36-alpha.20260903095202 → 0.1.36-alpha.20260903185731
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 +1 -1
- package/template/client/src/components/ui/markdown.tsx +43 -0
- package/template/client/src/index.css +0 -1
- package/template/package-lock.json +5783 -13022
- package/template/package.json +5 -68
- package/template/client/src/components/business-ui/README.md +0 -519
- package/template/client/src/components/business-ui/api/chats/queries.ts +0 -39
- package/template/client/src/components/business-ui/api/chats/service.ts +0 -29
- package/template/client/src/components/business-ui/api/departments/queries.ts +0 -42
- package/template/client/src/components/business-ui/api/departments/service.ts +0 -18
- package/template/client/src/components/business-ui/api/files/service.ts +0 -28
- package/template/client/src/components/business-ui/api/user-profiles/queries.ts +0 -42
- package/template/client/src/components/business-ui/api/user-profiles/service.ts +0 -23
- package/template/client/src/components/business-ui/api/users/queries.ts +0 -34
- package/template/client/src/components/business-ui/api/users/service.ts +0 -40
- package/template/client/src/components/business-ui/chat-select/README.md +0 -128
- package/template/client/src/components/business-ui/chat-select/chat-item.tsx +0 -85
- package/template/client/src/components/business-ui/chat-select/chat-select-tag.tsx +0 -83
- package/template/client/src/components/business-ui/chat-select/chat-select.tsx +0 -197
- package/template/client/src/components/business-ui/chat-select/index.tsx +0 -12
- package/template/client/src/components/business-ui/chat-select/types.ts +0 -102
- package/template/client/src/components/business-ui/chat-select/use-chat-value.ts +0 -180
- package/template/client/src/components/business-ui/chat-select/utils.ts +0 -81
- package/template/client/src/components/business-ui/department-select/department-item.tsx +0 -55
- package/template/client/src/components/business-ui/department-select/department-select-field.tsx +0 -86
- package/template/client/src/components/business-ui/department-select/department-select-tag.tsx +0 -56
- package/template/client/src/components/business-ui/department-select/department-select.tsx +0 -168
- package/template/client/src/components/business-ui/department-select/icon-department.tsx +0 -22
- package/template/client/src/components/business-ui/department-select/index.tsx +0 -7
- package/template/client/src/components/business-ui/department-select/types.ts +0 -15
- package/template/client/src/components/business-ui/department-select/utils.ts +0 -17
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-content.tsx +0 -35
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-empty.tsx +0 -28
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-error.tsx +0 -35
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-item.tsx +0 -55
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-list.tsx +0 -174
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-loading.tsx +0 -19
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-search.tsx +0 -31
- package/template/client/src/components/business-ui/entity-combobox/base-combobox-trigger.tsx +0 -281
- package/template/client/src/components/business-ui/entity-combobox/base-combobox.tsx +0 -132
- package/template/client/src/components/business-ui/entity-combobox/context.tsx +0 -19
- package/template/client/src/components/business-ui/entity-combobox/entity-combobox.tsx +0 -145
- package/template/client/src/components/business-ui/entity-combobox/highlight-text.tsx +0 -52
- package/template/client/src/components/business-ui/entity-combobox/hooks.tsx +0 -21
- package/template/client/src/components/business-ui/entity-combobox/index.tsx +0 -31
- package/template/client/src/components/business-ui/entity-combobox/item-pill.tsx +0 -179
- package/template/client/src/components/business-ui/entity-combobox/popover-wrapper.tsx +0 -149
- package/template/client/src/components/business-ui/entity-combobox/search-trigger.tsx +0 -262
- package/template/client/src/components/business-ui/entity-combobox/shared-types.ts +0 -296
- package/template/client/src/components/business-ui/entity-combobox/size-variants.tsx +0 -322
- package/template/client/src/components/business-ui/entity-combobox/types.ts +0 -246
- package/template/client/src/components/business-ui/entity-combobox/use-fetch-data.tsx +0 -81
- package/template/client/src/components/business-ui/entity-combobox/use-infinite-scroll.tsx +0 -99
- package/template/client/src/components/business-ui/entity-combobox/use-popover-outside-click.tsx +0 -32
- package/template/client/src/components/business-ui/form/checkbox-field.tsx +0 -83
- package/template/client/src/components/business-ui/form/context.tsx +0 -38
- package/template/client/src/components/business-ui/form/field-layout.tsx +0 -91
- package/template/client/src/components/business-ui/form/form.tsx +0 -54
- package/template/client/src/components/business-ui/form/hooks/form-context.tsx +0 -4
- package/template/client/src/components/business-ui/form/hooks/form-utils.ts +0 -23
- package/template/client/src/components/business-ui/form/hooks/form.tsx +0 -40
- package/template/client/src/components/business-ui/form/index.tsx +0 -4
- package/template/client/src/components/business-ui/form/input-field.tsx +0 -74
- package/template/client/src/components/business-ui/form/radio-group-field.tsx +0 -138
- package/template/client/src/components/business-ui/form/select-field.tsx +0 -155
- package/template/client/src/components/business-ui/form/switch-field.tsx +0 -66
- package/template/client/src/components/business-ui/form/textarea-field.tsx +0 -72
- package/template/client/src/components/business-ui/form/types.ts +0 -32
- package/template/client/src/components/business-ui/tiptap-editor/README.md +0 -324
- package/template/client/src/components/business-ui/tiptap-editor/components/attachment-toolbar-button.tsx +0 -74
- package/template/client/src/components/business-ui/tiptap-editor/components/blockquote-toolbar-button.tsx +0 -41
- package/template/client/src/components/business-ui/tiptap-editor/components/code-block-toolbar-button.tsx +0 -41
- package/template/client/src/components/business-ui/tiptap-editor/components/color-highlight-toolbar-button.tsx +0 -141
- package/template/client/src/components/business-ui/tiptap-editor/components/heading-toolbar-button.tsx +0 -99
- package/template/client/src/components/business-ui/tiptap-editor/components/horizontal-rule-toolbar-button.tsx +0 -39
- package/template/client/src/components/business-ui/tiptap-editor/components/image-upload-toolbar-button.tsx +0 -65
- package/template/client/src/components/business-ui/tiptap-editor/components/link-edit-form.tsx +0 -127
- package/template/client/src/components/business-ui/tiptap-editor/components/link-hover-toolbar.tsx +0 -380
- package/template/client/src/components/business-ui/tiptap-editor/components/link-toolbar-button.tsx +0 -96
- package/template/client/src/components/business-ui/tiptap-editor/components/list-toolbar-button.tsx +0 -75
- package/template/client/src/components/business-ui/tiptap-editor/components/mark-toolbar-button.tsx +0 -118
- package/template/client/src/components/business-ui/tiptap-editor/components/text-align-toolbar-button.tsx +0 -84
- package/template/client/src/components/business-ui/tiptap-editor/components/undo-redo-toolbar-button.tsx +0 -54
- package/template/client/src/components/business-ui/tiptap-editor/extensions/attachment.tsx +0 -539
- package/template/client/src/components/business-ui/tiptap-editor/extensions/code-block-shiki.tsx +0 -236
- package/template/client/src/components/business-ui/tiptap-editor/extensions/complete-kit.ts +0 -260
- package/template/client/src/components/business-ui/tiptap-editor/extensions/image.tsx +0 -456
- package/template/client/src/components/business-ui/tiptap-editor/hooks/use-tiptap-editor.ts +0 -47
- package/template/client/src/components/business-ui/tiptap-editor/index.ts +0 -38
- package/template/client/src/components/business-ui/tiptap-editor/tiptap-editor-complete.tsx +0 -112
- package/template/client/src/components/business-ui/tiptap-editor/tiptap-editor.tsx +0 -169
- package/template/client/src/components/business-ui/types/user.ts +0 -74
- package/template/client/src/components/business-ui/user-display/index.tsx +0 -2
- package/template/client/src/components/business-ui/user-display/overflow-tooltip-text.tsx +0 -90
- package/template/client/src/components/business-ui/user-display/type.ts +0 -27
- package/template/client/src/components/business-ui/user-display/user-display.tsx +0 -99
- package/template/client/src/components/business-ui/user-display/user-with-avatar.tsx +0 -158
- package/template/client/src/components/business-ui/user-display/utils.ts +0 -37
- package/template/client/src/components/business-ui/user-profile/error-image.tsx +0 -302
- package/template/client/src/components/business-ui/user-profile/user-external-script.ts +0 -73
- package/template/client/src/components/business-ui/user-profile/user-profile.tsx +0 -370
- package/template/client/src/components/business-ui/user-select/index.tsx +0 -28
- package/template/client/src/components/business-ui/user-select/types.ts +0 -109
- package/template/client/src/components/business-ui/user-select/use-user-value.ts +0 -160
- package/template/client/src/components/business-ui/user-select/user-item.tsx +0 -98
- package/template/client/src/components/business-ui/user-select/user-pill.tsx +0 -140
- package/template/client/src/components/business-ui/user-select/user-select-tag.tsx +0 -82
- package/template/client/src/components/business-ui/user-select/user-select.tsx +0 -359
- package/template/client/src/components/business-ui/user-select/utils.tsx +0 -188
- package/template/client/src/components/business-ui/utils/user.ts +0 -72
- package/template/client/src/components/ui/streamdown.tsx +0 -186
- package/template/client/src/lib/shiki.ts +0 -92
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
import type { FocusEvent, ReactNode } from 'react';
|
|
2
|
-
|
|
3
|
-
import { PopoverContent } from '@client/src/components/ui/popover';
|
|
4
|
-
|
|
5
|
-
// 重新导出 size 相关类型
|
|
6
|
-
export type { ComboboxSize } from '@client/src/components/business-ui/entity-combobox/size-variants';
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* 通用选项值类型
|
|
10
|
-
* @template TRaw - 原始数据类型,用于保留完整的原始对象
|
|
11
|
-
*/
|
|
12
|
-
export type ItemValue<TRaw = unknown> = {
|
|
13
|
-
id: string;
|
|
14
|
-
name: string;
|
|
15
|
-
avatar?: string;
|
|
16
|
-
raw?: TRaw;
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* 触发器类型
|
|
21
|
-
*/
|
|
22
|
-
export type TriggerType = 'button' | 'search' | 'custom';
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* 触发器渲染属性
|
|
26
|
-
*/
|
|
27
|
-
export type TriggerRenderProps<TRaw = unknown> = {
|
|
28
|
-
selectedValue: ItemValue<TRaw> | ItemValue<TRaw>[] | null;
|
|
29
|
-
multiple: boolean;
|
|
30
|
-
open: boolean;
|
|
31
|
-
disabled: boolean;
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* 样式类名配置
|
|
36
|
-
* 用于统一配置各个内部元素的自定义 className
|
|
37
|
-
*/
|
|
38
|
-
export type ClassNamesConfig = {
|
|
39
|
-
/** 根容器的 className */
|
|
40
|
-
root?: string;
|
|
41
|
-
/** 触发器的 className */
|
|
42
|
-
trigger?: string;
|
|
43
|
-
/** 弹层内容的 className */
|
|
44
|
-
popover?: string;
|
|
45
|
-
/** 搜索框的 className */
|
|
46
|
-
search?: string;
|
|
47
|
-
/** 列表容器的 className */
|
|
48
|
-
list?: string;
|
|
49
|
-
/** 列表项的 className */
|
|
50
|
-
listItem?: string;
|
|
51
|
-
/** 标签的 className(多选模式) */
|
|
52
|
-
tag?: string;
|
|
53
|
-
/** 空状态的 className */
|
|
54
|
-
empty?: string;
|
|
55
|
-
/** 异常态的 className */
|
|
56
|
-
error?: string;
|
|
57
|
-
/** 加载状态的 className */
|
|
58
|
-
loading?: string;
|
|
59
|
-
/** 清除按钮元素的 className */
|
|
60
|
-
clear?: string;
|
|
61
|
-
/** 后缀元素的 className */
|
|
62
|
-
suffix?: string;
|
|
63
|
-
};
|
|
64
|
-
|
|
65
|
-
/**
|
|
66
|
-
* 弹层容器配置
|
|
67
|
-
*/
|
|
68
|
-
export type PopoverSlotProps = {
|
|
69
|
-
popover?: React.ComponentProps<typeof PopoverContent>;
|
|
70
|
-
};
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* 基础 Select 组件共享的 Props
|
|
74
|
-
* 适用于 UserSelect、DepartmentSelect 等所有实体选择器
|
|
75
|
-
*/
|
|
76
|
-
export type BaseEntitySelectProps<TValue = ItemValue<unknown>> = {
|
|
77
|
-
/**
|
|
78
|
-
* 组件尺寸
|
|
79
|
-
* @default "medium"
|
|
80
|
-
*/
|
|
81
|
-
size?: 'medium' | 'small' | 'xs';
|
|
82
|
-
|
|
83
|
-
/**
|
|
84
|
-
* 触发器类型
|
|
85
|
-
* - "button": 按钮样式触发器
|
|
86
|
-
* - "search": 搜索框样式触发器
|
|
87
|
-
* - "custom": 自定义触发器,需配合 renderTrigger 使用
|
|
88
|
-
*/
|
|
89
|
-
triggerType?: TriggerType;
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* 自定义渲染触发器
|
|
93
|
-
* @param props - 触发器渲染属性,包含选中值、多选状态、展开状态、禁用状态
|
|
94
|
-
* @returns 自定义触发器的 ReactNode
|
|
95
|
-
*/
|
|
96
|
-
renderTrigger?: (props: TriggerRenderProps<unknown>) => ReactNode;
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* 是否多选模式
|
|
100
|
-
* @default false
|
|
101
|
-
*/
|
|
102
|
-
multiple?: boolean;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* 当前选中的值(受控模式)
|
|
106
|
-
* - 单选时为 TValue | null
|
|
107
|
-
* - 多选时为 TValue[] | null
|
|
108
|
-
*/
|
|
109
|
-
value?: TValue | TValue[] | null;
|
|
110
|
-
|
|
111
|
-
/**
|
|
112
|
-
* 默认选中的值(非受控模式)
|
|
113
|
-
* - 单选时为 TValue | null
|
|
114
|
-
* - 多选时为 TValue[] | null
|
|
115
|
-
*/
|
|
116
|
-
defaultValue?: TValue | TValue[] | null;
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* 选中值变化时的回调
|
|
120
|
-
* @param value - 新的选中值
|
|
121
|
-
*/
|
|
122
|
-
onChange?: (value: TValue | TValue[] | null) => void;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* 弹层默认是否展开(非受控模式)
|
|
126
|
-
* @default false
|
|
127
|
-
*/
|
|
128
|
-
defaultOpen?: boolean;
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* 是否禁用组件
|
|
132
|
-
* @default false
|
|
133
|
-
*/
|
|
134
|
-
disabled?: boolean;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* 是否自动聚焦
|
|
138
|
-
* @default false
|
|
139
|
-
*/
|
|
140
|
-
autoFocus?: boolean;
|
|
141
|
-
|
|
142
|
-
/**
|
|
143
|
-
* 是否必填(用于表单校验)
|
|
144
|
-
* @default false
|
|
145
|
-
*/
|
|
146
|
-
required?: boolean;
|
|
147
|
-
|
|
148
|
-
/**
|
|
149
|
-
* 表单字段名称
|
|
150
|
-
*/
|
|
151
|
-
name?: string;
|
|
152
|
-
|
|
153
|
-
/**
|
|
154
|
-
* 根元素的自定义类名
|
|
155
|
-
*/
|
|
156
|
-
className?: string;
|
|
157
|
-
|
|
158
|
-
/**
|
|
159
|
-
* 各元素的自定义类名配置
|
|
160
|
-
* @example
|
|
161
|
-
* classNames={{
|
|
162
|
-
* root: 'my-root',
|
|
163
|
-
* trigger: 'my-trigger',
|
|
164
|
-
* popover: 'my-popover',
|
|
165
|
-
* tag: 'my-tag',
|
|
166
|
-
* }}
|
|
167
|
-
*/
|
|
168
|
-
classNames?: ClassNamesConfig;
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* 未选中时显示的占位文本
|
|
172
|
-
*/
|
|
173
|
-
placeholder?: string;
|
|
174
|
-
|
|
175
|
-
/**
|
|
176
|
-
* 选项列表为空时显示的文本
|
|
177
|
-
*/
|
|
178
|
-
emptyText?: string;
|
|
179
|
-
|
|
180
|
-
/**
|
|
181
|
-
* 多选模式下,标签是否可关闭(显示删除按钮)
|
|
182
|
-
* @default true
|
|
183
|
-
*/
|
|
184
|
-
tagClosable?: boolean;
|
|
185
|
-
|
|
186
|
-
/**
|
|
187
|
-
* 多选模式下,最多显示的标签数量
|
|
188
|
-
* - 数字: 最多显示指定数量的标签,超出部分显示 "+N"
|
|
189
|
-
* - "responsive": 根据容器宽度自动计算显示数量
|
|
190
|
-
*/
|
|
191
|
-
maxTagCount?: number | 'responsive';
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* 判断选项是否禁用
|
|
195
|
-
* @param value 选项值
|
|
196
|
-
* @returns 如果返回 true,该选项将被禁用,不能改变选中状态,已选中项的 tag 不显示删除按钮
|
|
197
|
-
*/
|
|
198
|
-
getOptionDisabled?: (value: TValue) => boolean;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* 选中选项时的回调
|
|
202
|
-
* @param value - 被选中的选项值
|
|
203
|
-
*/
|
|
204
|
-
onSelect?: (value: TValue) => void;
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* 取消选中选项时的回调(多选模式下生效)
|
|
208
|
-
* @param value - 被取消选中的选项值
|
|
209
|
-
*/
|
|
210
|
-
onDeselect?: (value: TValue) => void;
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* 清空所有选中值时的回调
|
|
214
|
-
*/
|
|
215
|
-
onClear?: () => void;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* 组件获得焦点时的回调
|
|
219
|
-
* @param event - 焦点事件对象
|
|
220
|
-
*/
|
|
221
|
-
onFocus?: (event: FocusEvent<HTMLElement>) => void;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* 组件失去焦点时的回调
|
|
225
|
-
* @param event - 焦点事件对象
|
|
226
|
-
*/
|
|
227
|
-
onBlur?: (event: FocusEvent<HTMLElement>) => void;
|
|
228
|
-
|
|
229
|
-
/**
|
|
230
|
-
* 插槽属性配置,用于自定义内部组件的 props
|
|
231
|
-
*/
|
|
232
|
-
slotProps?: PopoverSlotProps;
|
|
233
|
-
};
|
|
234
|
-
|
|
235
|
-
/**
|
|
236
|
-
* Combobox 配置相关的 Props
|
|
237
|
-
*/
|
|
238
|
-
export type ComboboxConfigProps = {
|
|
239
|
-
pageSize?: number;
|
|
240
|
-
debounce?: number;
|
|
241
|
-
disabled?: boolean;
|
|
242
|
-
loading?: boolean;
|
|
243
|
-
autoFocus?: boolean;
|
|
244
|
-
showSearch?: boolean;
|
|
245
|
-
required?: boolean;
|
|
246
|
-
name?: string;
|
|
247
|
-
};
|
|
248
|
-
|
|
249
|
-
/**
|
|
250
|
-
* Combobox 样式相关的 Props
|
|
251
|
-
*/
|
|
252
|
-
export type ComboboxStyleProps = {
|
|
253
|
-
className?: string;
|
|
254
|
-
popoverClassName?: string;
|
|
255
|
-
classNames?: ClassNamesConfig;
|
|
256
|
-
};
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Combobox Placeholder 相关的 Props
|
|
260
|
-
*/
|
|
261
|
-
export type ComboboxPlaceholderProps = {
|
|
262
|
-
placeholder?: string;
|
|
263
|
-
searchPlaceholder?: string;
|
|
264
|
-
emptyText?: string;
|
|
265
|
-
loadingText?: string;
|
|
266
|
-
};
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Combobox 标签相关的 Props
|
|
270
|
-
*/
|
|
271
|
-
export type ComboboxTagProps = {
|
|
272
|
-
tagClosable?: boolean;
|
|
273
|
-
maxTagCount?: number | 'responsive';
|
|
274
|
-
maxTagTextLength?: number;
|
|
275
|
-
};
|
|
276
|
-
|
|
277
|
-
/**
|
|
278
|
-
* Combobox 弹层配置相关的 Props
|
|
279
|
-
*/
|
|
280
|
-
export type ComboboxPopoverProps = {
|
|
281
|
-
placement?: 'top' | 'bottom' | 'left' | 'right';
|
|
282
|
-
align?: 'start' | 'center' | 'end';
|
|
283
|
-
sideOffset?: number;
|
|
284
|
-
};
|
|
285
|
-
|
|
286
|
-
/**
|
|
287
|
-
* Combobox 回调相关的 Props
|
|
288
|
-
*/
|
|
289
|
-
export type ComboboxCallbackProps<TRaw = unknown> = {
|
|
290
|
-
onSelect?: (value: ItemValue<TRaw>) => void;
|
|
291
|
-
onDeselect?: (value: ItemValue<TRaw>) => void;
|
|
292
|
-
onSearch?: (value: string) => void;
|
|
293
|
-
onClear?: () => void;
|
|
294
|
-
onFocus?: (event: FocusEvent<HTMLElement>) => void;
|
|
295
|
-
onBlur?: (event: FocusEvent<HTMLElement>) => void;
|
|
296
|
-
};
|
|
@@ -1,322 +0,0 @@
|
|
|
1
|
-
import { cva } from 'class-variance-authority';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Combobox 尺寸类型
|
|
5
|
-
* - medium: 默认大小,适用于大多数场景
|
|
6
|
-
* - small: 较小尺寸
|
|
7
|
-
* - xs: 最小尺寸
|
|
8
|
-
*/
|
|
9
|
-
export type ComboboxSize = 'medium' | 'small' | 'xs';
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Search 模式下的搜索框容器样式
|
|
13
|
-
* medium: 高度36px, padding上下6px左右6px
|
|
14
|
-
* small: 高度32px, padding上下4px左右4px
|
|
15
|
-
* xs: 高度28px, padding上下4px左右4px
|
|
16
|
-
*/
|
|
17
|
-
export const searchTriggerVariants = cva(
|
|
18
|
-
[
|
|
19
|
-
'border-input bg-background',
|
|
20
|
-
'flex w-full cursor-pointer items-center gap-1 rounded-md border',
|
|
21
|
-
'hover:border-ring',
|
|
22
|
-
'focus-visible:ring-3 focus-visible:ring-ring/20',
|
|
23
|
-
'data-[state=open]:ring-3 data-[state=open]:ring-ring/20',
|
|
24
|
-
'disabled:cursor-not-allowed disabled:opacity-50',
|
|
25
|
-
'focus-visible:border-ring focus-visible:outline-none data-[state=open]:border-ring',
|
|
26
|
-
],
|
|
27
|
-
{
|
|
28
|
-
variants: {
|
|
29
|
-
size: {
|
|
30
|
-
medium: 'min-h-9 px-3 py-1.5 text-sm', // 36px, padding 12px
|
|
31
|
-
small: 'min-h-8 px-3 py-1 text-sm', // 32px, padding 12px
|
|
32
|
-
xs: 'min-h-7 px-2 py-1 text-xs', // 28px, padding 8px
|
|
33
|
-
},
|
|
34
|
-
},
|
|
35
|
-
defaultVariants: {
|
|
36
|
-
size: 'medium',
|
|
37
|
-
},
|
|
38
|
-
},
|
|
39
|
-
);
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* Search 模式下输入框文字样式
|
|
43
|
-
* medium/small: text-sm
|
|
44
|
-
* xs: text-xs
|
|
45
|
-
*/
|
|
46
|
-
export const searchInputVariants = cva('', {
|
|
47
|
-
variants: {
|
|
48
|
-
size: {
|
|
49
|
-
medium: 'text-sm',
|
|
50
|
-
small: 'text-sm',
|
|
51
|
-
xs: 'text-xs',
|
|
52
|
-
},
|
|
53
|
-
},
|
|
54
|
-
defaultVariants: {
|
|
55
|
-
size: 'medium',
|
|
56
|
-
},
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* Search 模式下的标签样式
|
|
61
|
-
* medium/small: 高度24px, 头像20px, 文字text-sm line-height 22px
|
|
62
|
-
* xs: 高度20px, 头像16px, 文字text-xs line-height 16px
|
|
63
|
-
*/
|
|
64
|
-
export const searchTagVariants = cva('gap-1 pr-1 font-normal', {
|
|
65
|
-
variants: {
|
|
66
|
-
size: {
|
|
67
|
-
medium: 'h-6 text-sm leading-[22px]', // 24px
|
|
68
|
-
small: 'h-6 text-sm leading-[22px]', // 24px
|
|
69
|
-
xs: 'h-5 text-xs leading-4', // 20px
|
|
70
|
-
},
|
|
71
|
-
},
|
|
72
|
-
defaultVariants: {
|
|
73
|
-
size: 'medium',
|
|
74
|
-
},
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
* 标签内头像尺寸
|
|
79
|
-
* medium/small: 20px
|
|
80
|
-
* xs: 16px
|
|
81
|
-
*/
|
|
82
|
-
export const tagAvatarVariants = cva('', {
|
|
83
|
-
variants: {
|
|
84
|
-
size: {
|
|
85
|
-
medium: 'size-5', // 20px
|
|
86
|
-
small: 'size-5', // 20px
|
|
87
|
-
xs: 'size-4', // 16px
|
|
88
|
-
},
|
|
89
|
-
},
|
|
90
|
-
defaultVariants: {
|
|
91
|
-
size: 'medium',
|
|
92
|
-
},
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* 标签内图标尺寸 (如部门图标)
|
|
97
|
-
* medium/small: 16px
|
|
98
|
-
* xs: 12px
|
|
99
|
-
*/
|
|
100
|
-
export const tagIconVariants = cva('', {
|
|
101
|
-
variants: {
|
|
102
|
-
size: {
|
|
103
|
-
medium: 'size-5', // 16px
|
|
104
|
-
small: 'size-5', // 16px
|
|
105
|
-
xs: 'size-4', // 12px
|
|
106
|
-
},
|
|
107
|
-
},
|
|
108
|
-
defaultVariants: {
|
|
109
|
-
size: 'medium',
|
|
110
|
-
},
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* 标签内关闭按钮图标尺寸
|
|
115
|
-
*/
|
|
116
|
-
export const tagCloseIconVariants = cva('text-foreground', {
|
|
117
|
-
variants: {
|
|
118
|
-
size: {
|
|
119
|
-
medium: 'size-2.5', // 10px
|
|
120
|
-
small: 'size-2.5', // 10px
|
|
121
|
-
xs: 'size-2', // 8px
|
|
122
|
-
},
|
|
123
|
-
},
|
|
124
|
-
defaultVariants: {
|
|
125
|
-
size: 'medium',
|
|
126
|
-
},
|
|
127
|
-
});
|
|
128
|
-
|
|
129
|
-
/**
|
|
130
|
-
* Button 模式下的添加按钮样式
|
|
131
|
-
* medium/small: 24px
|
|
132
|
-
* xs: 16px
|
|
133
|
-
*/
|
|
134
|
-
export const addButtonVariants = cva(
|
|
135
|
-
[
|
|
136
|
-
'shrink-0 rounded-full p-0',
|
|
137
|
-
'bg-neutral-700/10 hover:bg-neutral-700/20! dark:bg-neutral-500/10 dark:hover:bg-neutral-500/20!',
|
|
138
|
-
'data-[state=open]:bg-neutral-700/20 dark:data-[state=open]:bg-neutral-500/20',
|
|
139
|
-
],
|
|
140
|
-
{
|
|
141
|
-
variants: {
|
|
142
|
-
size: {
|
|
143
|
-
medium: 'size-6', // 24px
|
|
144
|
-
small: 'size-6', // 24px
|
|
145
|
-
xs: 'size-4', // 16px
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
defaultVariants: {
|
|
149
|
-
size: 'medium',
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
);
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* Button 模式下的加号图标尺寸
|
|
156
|
-
*/
|
|
157
|
-
export const addButtonIconVariants = cva('', {
|
|
158
|
-
variants: {
|
|
159
|
-
size: {
|
|
160
|
-
medium: 'size-4', // 16px
|
|
161
|
-
small: 'size-4', // 16px
|
|
162
|
-
xs: 'size-2', // 8px
|
|
163
|
-
},
|
|
164
|
-
},
|
|
165
|
-
defaultVariants: {
|
|
166
|
-
size: 'medium',
|
|
167
|
-
},
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
/**
|
|
171
|
-
* 列表项容器样式
|
|
172
|
-
* medium/small: 高度50px
|
|
173
|
-
* xs: 高度46px
|
|
174
|
-
*/
|
|
175
|
-
export const listItemVariants = cva('flex items-center gap-2', {
|
|
176
|
-
variants: {
|
|
177
|
-
size: {
|
|
178
|
-
medium: 'h-[50px] py-2', // 50px
|
|
179
|
-
small: 'h-[50px] py-2', // 50px
|
|
180
|
-
xs: 'h-[46px] py-1.5', // 46px
|
|
181
|
-
},
|
|
182
|
-
},
|
|
183
|
-
defaultVariants: {
|
|
184
|
-
size: 'medium',
|
|
185
|
-
},
|
|
186
|
-
});
|
|
187
|
-
|
|
188
|
-
/**
|
|
189
|
-
* 列表项头像尺寸
|
|
190
|
-
* medium/small: 32px
|
|
191
|
-
* xs: 28px
|
|
192
|
-
*/
|
|
193
|
-
export const listItemAvatarVariants = cva('', {
|
|
194
|
-
variants: {
|
|
195
|
-
size: {
|
|
196
|
-
medium: 'size-8', // 32px
|
|
197
|
-
small: 'size-8', // 32px
|
|
198
|
-
xs: 'size-7', // 28px
|
|
199
|
-
},
|
|
200
|
-
},
|
|
201
|
-
defaultVariants: {
|
|
202
|
-
size: 'medium',
|
|
203
|
-
},
|
|
204
|
-
});
|
|
205
|
-
|
|
206
|
-
/**
|
|
207
|
-
* 列表项名称文字样式
|
|
208
|
-
* medium/small: text-sm, line-height 22px
|
|
209
|
-
* xs: text-xs, line-height 16px
|
|
210
|
-
*/
|
|
211
|
-
export const listItemNameVariants = cva('truncate', {
|
|
212
|
-
variants: {
|
|
213
|
-
size: {
|
|
214
|
-
medium: 'text-sm leading-[22px]',
|
|
215
|
-
small: 'text-sm leading-[22px]',
|
|
216
|
-
xs: 'text-xs leading-4',
|
|
217
|
-
},
|
|
218
|
-
},
|
|
219
|
-
defaultVariants: {
|
|
220
|
-
size: 'medium',
|
|
221
|
-
},
|
|
222
|
-
});
|
|
223
|
-
|
|
224
|
-
/**
|
|
225
|
-
* 列表项副文本样式 (如 userId)
|
|
226
|
-
* 所有尺寸: text-xs, line-height 16px
|
|
227
|
-
*/
|
|
228
|
-
export const listItemSubTextVariants = cva(
|
|
229
|
-
'truncate leading-4 text-muted-foreground',
|
|
230
|
-
{
|
|
231
|
-
variants: {
|
|
232
|
-
size: {
|
|
233
|
-
medium: 'text-xs',
|
|
234
|
-
small: 'text-xs',
|
|
235
|
-
xs: 'text-[10px]',
|
|
236
|
-
},
|
|
237
|
-
},
|
|
238
|
-
defaultVariants: {
|
|
239
|
-
size: 'medium',
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
);
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* ItemPill 标签组件样式 (用于 tag 渲染)
|
|
246
|
-
*/
|
|
247
|
-
export const itemPillVariants = cva(
|
|
248
|
-
[
|
|
249
|
-
'w-fit gap-1 rounded-full border-0 bg-[#E8E8E9] font-normal dark:bg-[#3D3E3E]',
|
|
250
|
-
'pt-px pb-px pl-0.5',
|
|
251
|
-
],
|
|
252
|
-
{
|
|
253
|
-
variants: {
|
|
254
|
-
size: {
|
|
255
|
-
medium: 'h-[22px] pr-2 text-sm leading-5 [&>svg]:size-5', // 24px
|
|
256
|
-
small: 'h-[22px] pr-2 text-sm leading-5 [&>svg]:size-5', // 24px
|
|
257
|
-
xs: 'h-5 pr-1.5 text-xs leading-4 [&>svg]:size-4', // 20px
|
|
258
|
-
},
|
|
259
|
-
},
|
|
260
|
-
defaultVariants: {
|
|
261
|
-
size: 'medium',
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
);
|
|
265
|
-
|
|
266
|
-
/**
|
|
267
|
-
* ItemPill 内文本样式
|
|
268
|
-
*/
|
|
269
|
-
export const itemPillTextVariants = cva(
|
|
270
|
-
'max-w-[120px] truncate text-foreground',
|
|
271
|
-
{
|
|
272
|
-
variants: {
|
|
273
|
-
size: {
|
|
274
|
-
medium: 'text-sm leading-5',
|
|
275
|
-
small: 'text-sm leading-5',
|
|
276
|
-
xs: 'text-xs leading-4',
|
|
277
|
-
},
|
|
278
|
-
},
|
|
279
|
-
defaultVariants: {
|
|
280
|
-
size: 'medium',
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
);
|
|
284
|
-
|
|
285
|
-
/**
|
|
286
|
-
* 列表骨架屏项容器样式 (与 listItemVariants 保持一致)
|
|
287
|
-
* medium/small: 高度50px
|
|
288
|
-
* xs: 高度46px
|
|
289
|
-
*/
|
|
290
|
-
export const skeletonItemVariants = cva(
|
|
291
|
-
'flex items-center gap-2 rounded-sm px-2',
|
|
292
|
-
{
|
|
293
|
-
variants: {
|
|
294
|
-
size: {
|
|
295
|
-
medium: 'h-[50px] py-3.5', // 50px
|
|
296
|
-
small: 'h-[50px] py-3.5', // 50px
|
|
297
|
-
xs: 'h-[46px] py-1.5', // 46px
|
|
298
|
-
},
|
|
299
|
-
},
|
|
300
|
-
defaultVariants: {
|
|
301
|
-
size: 'medium',
|
|
302
|
-
},
|
|
303
|
-
},
|
|
304
|
-
);
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* 列表骨架屏头像尺寸 (与 listItemAvatarVariants 保持一致)
|
|
308
|
-
* medium/small: 32px
|
|
309
|
-
* xs: 28px
|
|
310
|
-
*/
|
|
311
|
-
export const skeletonAvatarVariants = cva('rounded-full', {
|
|
312
|
-
variants: {
|
|
313
|
-
size: {
|
|
314
|
-
medium: 'size-8', // 32px
|
|
315
|
-
small: 'size-8', // 32px
|
|
316
|
-
xs: 'size-7', // 28px
|
|
317
|
-
},
|
|
318
|
-
},
|
|
319
|
-
defaultVariants: {
|
|
320
|
-
size: 'medium',
|
|
321
|
-
},
|
|
322
|
-
});
|