@ptengine/design-components 0.5.2 → 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/COMPONENTS-DESIGN-SYSTEM.md +329 -0
- package/README.md +11 -176
- package/dist/components/ui/prompt-picker.d.ts +15 -0
- package/dist/components/ui/prompt-picker.d.ts.map +1 -1
- package/dist/components/ui/search-input.d.ts +2 -2
- package/dist/components/ui/select.d.ts +1 -1
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/index.cjs +2 -77
- package/dist/index.js +2093 -20883
- package/llms.txt +20 -0
- package/package.json +3 -2
- package/src/components/ui/accordion.tsx +2 -2
- package/src/components/ui/alert-dialog.tsx +2 -2
- package/src/components/ui/alert.tsx +2 -2
- package/src/components/ui/attachment.tsx +4 -4
- package/src/components/ui/avatar.tsx +3 -3
- package/src/components/ui/badge.tsx +1 -1
- package/src/components/ui/breadcrumb.tsx +1 -1
- package/src/components/ui/bubble.tsx +2 -2
- package/src/components/ui/button-group.tsx +1 -1
- package/src/components/ui/button.tsx +4 -4
- package/src/components/ui/calendar.tsx +3 -3
- package/src/components/ui/card.tsx +1 -1
- package/src/components/ui/chart.tsx +2 -2
- package/src/components/ui/command.tsx +5 -5
- package/src/components/ui/context-menu.tsx +6 -6
- package/src/components/ui/dialog.tsx +2 -2
- package/src/components/ui/drawer.tsx +2 -2
- package/src/components/ui/dropdown-menu.tsx +6 -6
- package/src/components/ui/empty.tsx +3 -3
- package/src/components/ui/field.tsx +6 -6
- package/src/components/ui/input-group.tsx +3 -3
- package/src/components/ui/input-otp.tsx +1 -1
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +3 -3
- package/src/components/ui/kbd.tsx +1 -1
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/marker.tsx +1 -1
- package/src/components/ui/menubar.tsx +7 -7
- package/src/components/ui/message.tsx +3 -3
- package/src/components/ui/native-select.tsx +1 -1
- package/src/components/ui/navigation-menu.tsx +1 -1
- package/src/components/ui/prompt-picker.tsx +63 -14
- package/src/components/ui/search-input.tsx +2 -2
- package/src/components/ui/select.tsx +3 -3
- package/src/components/ui/sheet.tsx +2 -2
- package/src/components/ui/sidebar.tsx +9 -9
- package/src/components/ui/table.tsx +2 -2
- package/src/components/ui/tabs.tsx +3 -3
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle.tsx +4 -4
- package/src/components/ui/tooltip.tsx +1 -1
|
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
6
|
|
|
7
7
|
const labelVariants = cva(
|
|
8
|
-
'text-
|
|
8
|
+
'text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-50'
|
|
9
9
|
);
|
|
10
10
|
|
|
11
11
|
const Label = React.forwardRef<
|
|
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
6
|
|
|
7
7
|
const markerVariants = cva(
|
|
8
|
-
"group/marker relative flex min-h-[16px] w-full items-center gap-[8px] text-left text-
|
|
8
|
+
"group/marker relative flex min-h-[16px] w-full items-center gap-[8px] text-left text-sm text-muted-foreground [&_svg:not([class*='size-'])]:size-[16px] [&:is(a)]:underline [&:is(a)]:underline-offset-4 [&:is(a):hover]:text-foreground",
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
@@ -35,7 +35,7 @@ const MenubarTrigger = React.forwardRef<
|
|
|
35
35
|
<MenubarPrimitive.Trigger
|
|
36
36
|
ref={ref}
|
|
37
37
|
className={cn(
|
|
38
|
-
'flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] px-[12px] py-[4px] text-
|
|
38
|
+
'flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] px-[12px] py-[4px] text-sm font-medium text-foreground outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
|
|
39
39
|
className
|
|
40
40
|
)}
|
|
41
41
|
{...props}
|
|
@@ -52,7 +52,7 @@ const MenubarSubTrigger = React.forwardRef<
|
|
|
52
52
|
<MenubarPrimitive.SubTrigger
|
|
53
53
|
ref={ref}
|
|
54
54
|
className={cn(
|
|
55
|
-
'flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] px-[8px] py-[6px] text-
|
|
55
|
+
'flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] px-[8px] py-[6px] text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
|
|
56
56
|
inset && 'pl-[32px]',
|
|
57
57
|
className
|
|
58
58
|
)}
|
|
@@ -108,7 +108,7 @@ const MenubarItem = React.forwardRef<
|
|
|
108
108
|
<MenubarPrimitive.Item
|
|
109
109
|
ref={ref}
|
|
110
110
|
className={cn(
|
|
111
|
-
'relative flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] px-[8px] py-[6px] text-
|
|
111
|
+
'relative flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] px-[8px] py-[6px] text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
112
112
|
inset && 'pl-[32px]',
|
|
113
113
|
className
|
|
114
114
|
)}
|
|
@@ -124,7 +124,7 @@ const MenubarCheckboxItem = React.forwardRef<
|
|
|
124
124
|
<MenubarPrimitive.CheckboxItem
|
|
125
125
|
ref={ref}
|
|
126
126
|
className={cn(
|
|
127
|
-
'relative flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[32px] pr-[8px] text-
|
|
127
|
+
'relative flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[32px] pr-[8px] text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
128
128
|
className
|
|
129
129
|
)}
|
|
130
130
|
checked={checked}
|
|
@@ -147,7 +147,7 @@ const MenubarRadioItem = React.forwardRef<
|
|
|
147
147
|
<MenubarPrimitive.RadioItem
|
|
148
148
|
ref={ref}
|
|
149
149
|
className={cn(
|
|
150
|
-
'relative flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[32px] pr-[8px] text-
|
|
150
|
+
'relative flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[32px] pr-[8px] text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
151
151
|
className
|
|
152
152
|
)}
|
|
153
153
|
{...props}
|
|
@@ -170,7 +170,7 @@ const MenubarLabel = React.forwardRef<
|
|
|
170
170
|
>(({ className, inset, ...props }, ref) => (
|
|
171
171
|
<MenubarPrimitive.Label
|
|
172
172
|
ref={ref}
|
|
173
|
-
className={cn('px-[8px] py-[6px] text-
|
|
173
|
+
className={cn('px-[8px] py-[6px] text-sm font-semibold text-foreground', inset && 'pl-[32px]', className)}
|
|
174
174
|
{...props}
|
|
175
175
|
/>
|
|
176
176
|
));
|
|
@@ -191,7 +191,7 @@ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName;
|
|
|
191
191
|
const MenubarShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
192
192
|
return (
|
|
193
193
|
<span
|
|
194
|
-
className={cn('ml-auto text-
|
|
194
|
+
className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}
|
|
195
195
|
{...props}
|
|
196
196
|
/>
|
|
197
197
|
);
|
|
@@ -22,7 +22,7 @@ function Message({
|
|
|
22
22
|
data-slot="message"
|
|
23
23
|
data-align={align}
|
|
24
24
|
className={cn(
|
|
25
|
-
'group/message relative flex w-full min-w-0 gap-[8px] text-
|
|
25
|
+
'group/message relative flex w-full min-w-0 gap-[8px] text-sm data-[align=end]:flex-row-reverse',
|
|
26
26
|
className
|
|
27
27
|
)}
|
|
28
28
|
{...props}
|
|
@@ -61,7 +61,7 @@ function MessageHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElem
|
|
|
61
61
|
<div
|
|
62
62
|
data-slot="message-header"
|
|
63
63
|
className={cn(
|
|
64
|
-
'flex max-w-full min-w-0 items-center px-[12px] text-
|
|
64
|
+
'flex max-w-full min-w-0 items-center px-[12px] text-xs font-medium text-muted-foreground group-has-[[data-variant=ghost]]/message:px-0',
|
|
65
65
|
className
|
|
66
66
|
)}
|
|
67
67
|
{...props}
|
|
@@ -74,7 +74,7 @@ function MessageFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElem
|
|
|
74
74
|
<div
|
|
75
75
|
data-slot="message-footer"
|
|
76
76
|
className={cn(
|
|
77
|
-
'flex max-w-full min-w-0 items-center px-[12px] text-
|
|
77
|
+
'flex max-w-full min-w-0 items-center px-[12px] text-xs font-medium text-muted-foreground group-has-[[data-variant=ghost]]/message:px-0 group-data-[align=end]/message:justify-end',
|
|
78
78
|
className
|
|
79
79
|
)}
|
|
80
80
|
{...props}
|
|
@@ -11,7 +11,7 @@ const NativeSelect = React.forwardRef<
|
|
|
11
11
|
<select
|
|
12
12
|
ref={ref}
|
|
13
13
|
className={cn(
|
|
14
|
-
'h-[32px] w-full appearance-none rounded-[var(--pt-radius-md)] border border-input bg-transparent pl-[12px] pr-[32px] text-
|
|
14
|
+
'h-[32px] w-full appearance-none rounded-[var(--pt-radius-md)] border border-input bg-transparent pl-[12px] pr-[32px] text-xs text-foreground transition-colors enabled:hover:border-neutral focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive aria-[invalid=true]:enabled:hover:border-destructive aria-[invalid=true]:focus-visible:ring-destructive/30',
|
|
15
15
|
className
|
|
16
16
|
)}
|
|
17
17
|
{...props}
|
|
@@ -35,7 +35,7 @@ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName;
|
|
|
35
35
|
const NavigationMenuItem = NavigationMenuPrimitive.Item;
|
|
36
36
|
|
|
37
37
|
const navigationMenuTriggerStyle = cva(
|
|
38
|
-
'state-layer group inline-flex h-[32px] w-max items-center justify-center rounded-[var(--pt-radius-md)] bg-background px-[16px] py-[8px] text-
|
|
38
|
+
'state-layer group inline-flex h-[32px] w-max items-center justify-center rounded-[var(--pt-radius-md)] bg-background px-[16px] py-[8px] text-sm font-medium text-foreground transition-colors focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[state=open]:bg-accent'
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
const NavigationMenuTrigger = React.forwardRef<
|
|
@@ -63,6 +63,21 @@ export interface PromptPickerItem {
|
|
|
63
63
|
* **只支持两层,不要做递归多层。**
|
|
64
64
|
*/
|
|
65
65
|
children?: PromptPickerItem[];
|
|
66
|
+
/**
|
|
67
|
+
* 可选:条目右端的小徽标,如「即将上线」。**只放短枚举**(1-4 字),它是给整条加限定,
|
|
68
|
+
* 不是第二行说明 —— 长说明走 `hint`(悬停)。
|
|
69
|
+
*
|
|
70
|
+
* 用扁平 chip(`rounded-sm bg-muted`)而不是库的 `Badge` 组件:后者是
|
|
71
|
+
* `rounded-full font-semibold` 胶囊,在 32px 高的条目里显得过重,且 lin 已裁定
|
|
72
|
+
* Badge 只留给短枚举场景的独立标签。此处写法与 apps/x 的 ⋮ 菜单出口组一致。
|
|
73
|
+
*/
|
|
74
|
+
badge?: string;
|
|
75
|
+
/**
|
|
76
|
+
* 可选:该条不可选(常与 `badge: '即将上线'` 搭配)。
|
|
77
|
+
* 整条降到辅助色、不响应点击、不进 Tab 序,也不给 hover 反馈 ——
|
|
78
|
+
* **点了没反应比灰着更伤**,所以连状态层都不挂。
|
|
79
|
+
*/
|
|
80
|
+
disabled?: boolean;
|
|
66
81
|
/**
|
|
67
82
|
* 可选图标。⚠️ **一组条目全用同一个图标时不要传** —— 它不携带任何用于选择的信息,
|
|
68
83
|
* 只会在每行左边留一段空白。只有各条图标不同、且图标在编码类别时才传。
|
|
@@ -116,7 +131,7 @@ export interface PromptPickerProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
116
131
|
否则叠层缩在边框内侧、圆角与边框内圆弧不同心(错位约 1px)。 */
|
|
117
132
|
const CHIP_BASE =
|
|
118
133
|
'inline-flex h-[32px] max-w-full items-center gap-[8px] rounded-[var(--pt-radius-md)] border ' +
|
|
119
|
-
'px-[12px] text-left text-
|
|
134
|
+
'px-[12px] text-left text-xs transition-colors ' +
|
|
120
135
|
'[&>svg]:size-[16px] [&>svg]:shrink-0 ' +
|
|
121
136
|
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';
|
|
122
137
|
|
|
@@ -124,6 +139,18 @@ const CHIP_IDLE =
|
|
|
124
139
|
'state-layer [--pt-state-layer-border:1px] border-input bg-background text-foreground ' +
|
|
125
140
|
'hover:border-neutral';
|
|
126
141
|
|
|
142
|
+
/* 未上线/不可选的条目:整条降辅助色,**不挂 state-layer、不给 hover** ——
|
|
143
|
+
灰着不给反馈,好过给了反馈却什么都不发生。 */
|
|
144
|
+
const CHIP_DISABLED = 'border-input bg-background text-[rgb(var(--pt-text-tage))]';
|
|
145
|
+
|
|
146
|
+
/* 条目右端的小徽标。扁平 chip,不是库 Badge(理由见 PromptPickerItem.badge 的注释)。
|
|
147
|
+
用 `2xs`(12/16)——比条目正文 `xs`(13/20) 低一档,不与之争夺注意力。
|
|
148
|
+
⚠️ 原先写的是 `text-[11px] leading-[16px]`,**11px 不在字阶表里**(表里最小是 2xs 12)。
|
|
149
|
+
字阶来自 Figma Text Styles,自造档位会让「组件跟着规范走」这件事从这里开始漏。 */
|
|
150
|
+
const CHIP_BADGE =
|
|
151
|
+
'ml-[8px] shrink-0 whitespace-nowrap rounded-[var(--pt-radius-sm)] bg-muted ' +
|
|
152
|
+
'px-[6px] text-2xs text-[rgb(var(--pt-text-tage))]';
|
|
153
|
+
|
|
127
154
|
/* 第二层顶部的分类项 —— 面包屑,不是选中态(见头注释规则 2)。
|
|
128
155
|
持久态底色 = 中性 8%(库规范:选中/激活用 --pt-bg-selected,不用彩色);
|
|
129
156
|
它自己不可点,所以不挂 state-layer。 */
|
|
@@ -217,22 +244,44 @@ const PromptPicker = React.forwardRef<HTMLDivElement, PromptPickerProps>(
|
|
|
217
244
|
)}
|
|
218
245
|
>
|
|
219
246
|
{lead && (
|
|
220
|
-
<p className="text-
|
|
247
|
+
<p className="text-xs text-[rgb(var(--pt-text-tage))]">
|
|
221
248
|
{lead}
|
|
222
249
|
</p>
|
|
223
250
|
)}
|
|
224
|
-
{visibleItems.map(item =>
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
251
|
+
{visibleItems.map(item =>
|
|
252
|
+
item.disabled ? (
|
|
253
|
+
/* 不可选:用 div + aria-disabled,不是 <button disabled> ——
|
|
254
|
+
后者仍会被读屏念成「命令,已禁用」且占 Tab 序。
|
|
255
|
+
有 badge 时 label 撑开、badge 贴右;无 badge 时不加 flex-1,
|
|
256
|
+
胶囊仍按内容收窄(不撑满)。 */
|
|
257
|
+
<div
|
|
258
|
+
key={item.id}
|
|
259
|
+
aria-disabled="true"
|
|
260
|
+
title={item.hint ?? item.label}
|
|
261
|
+
className={cn(CHIP_BASE, CHIP_DISABLED)}
|
|
262
|
+
>
|
|
263
|
+
{item.icon}
|
|
264
|
+
<span className={cn('min-w-0 truncate', item.badge && 'flex-1')}>
|
|
265
|
+
{item.label}
|
|
266
|
+
</span>
|
|
267
|
+
{item.badge && <span className={CHIP_BADGE}>{item.badge}</span>}
|
|
268
|
+
</div>
|
|
269
|
+
) : (
|
|
270
|
+
<button
|
|
271
|
+
key={item.id}
|
|
272
|
+
type="button"
|
|
273
|
+
title={item.hint ?? item.label}
|
|
274
|
+
onClick={() => handleChipClick(item)}
|
|
275
|
+
className={cn(CHIP_BASE, CHIP_IDLE)}
|
|
276
|
+
>
|
|
277
|
+
{item.icon}
|
|
278
|
+
<span className={cn('min-w-0 truncate', item.badge && 'flex-1')}>
|
|
279
|
+
{item.label}
|
|
280
|
+
</span>
|
|
281
|
+
{item.badge && <span className={CHIP_BADGE}>{item.badge}</span>}
|
|
282
|
+
</button>
|
|
283
|
+
)
|
|
284
|
+
)}
|
|
236
285
|
</div>
|
|
237
286
|
</div>
|
|
238
287
|
);
|
|
@@ -6,9 +6,9 @@ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '
|
|
|
6
6
|
|
|
7
7
|
/* 三档:高 24/32/40 · 字 12/13/14 · 辅助图标 12/16/16 · 左右间距 8/10/12(带 icon 组件档) */
|
|
8
8
|
const SIZE_CLASSES = {
|
|
9
|
-
sm: 'h-[24px] px-[8px] rounded-[var(--pt-radius-sm)] [&_input]:text-
|
|
9
|
+
sm: 'h-[24px] px-[8px] rounded-[var(--pt-radius-sm)] [&_input]:text-2xs',
|
|
10
10
|
default: 'h-[32px] px-[10px]',
|
|
11
|
-
lg: 'h-[40px] px-[12px] [&_input]:text-
|
|
11
|
+
lg: 'h-[40px] px-[12px] [&_input]:text-sm'
|
|
12
12
|
} as const;
|
|
13
13
|
|
|
14
14
|
/* 放大镜(寓意图标):16 / 16 / 20 */
|
|
@@ -25,7 +25,7 @@ const SelectValue = SelectPrimitive.Value;
|
|
|
25
25
|
* `w-full` 不在里面:Select 自己要撑满容器,而筛选器通常按内容宽。各自加。
|
|
26
26
|
*/
|
|
27
27
|
export const selectTriggerClassName =
|
|
28
|
-
'flex h-[32px] items-center justify-between whitespace-nowrap rounded-[var(--pt-radius-md)] border border-input bg-transparent px-[12px] py-[8px] text-
|
|
28
|
+
'flex h-[32px] items-center justify-between whitespace-nowrap rounded-[var(--pt-radius-md)] border border-input bg-transparent px-[12px] py-[8px] text-xs ring-offset-background transition-colors placeholder:text-muted-foreground enabled:hover:border-neutral focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive aria-[invalid=true]:text-destructive aria-[invalid=true]:enabled:hover:border-destructive aria-[invalid=true]:focus-visible:ring-destructive/30 [&>span]:line-clamp-1';
|
|
29
29
|
|
|
30
30
|
const SelectTrigger = React.forwardRef<
|
|
31
31
|
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
@@ -111,7 +111,7 @@ const SelectLabel = React.forwardRef<
|
|
|
111
111
|
>(({ className, ...props }, ref) => (
|
|
112
112
|
<SelectPrimitive.Label
|
|
113
113
|
ref={ref}
|
|
114
|
-
className={cn('px-[8px] py-[6px] text-
|
|
114
|
+
className={cn('px-[8px] py-[6px] text-sm font-semibold', className)}
|
|
115
115
|
{...props}
|
|
116
116
|
/>
|
|
117
117
|
));
|
|
@@ -124,7 +124,7 @@ const SelectItem = React.forwardRef<
|
|
|
124
124
|
<SelectPrimitive.Item
|
|
125
125
|
ref={ref}
|
|
126
126
|
className={cn(
|
|
127
|
-
'relative flex w-full cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[8px] pr-[32px] text-
|
|
127
|
+
'relative flex w-full cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[8px] pr-[32px] text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
|
|
128
128
|
className
|
|
129
129
|
)}
|
|
130
130
|
{...props}
|
|
@@ -92,7 +92,7 @@ const SheetTitle = React.forwardRef<
|
|
|
92
92
|
>(({ className, ...props }, ref) => (
|
|
93
93
|
<SheetPrimitive.Title
|
|
94
94
|
ref={ref}
|
|
95
|
-
className={cn('text-
|
|
95
|
+
className={cn('text-lg font-semibold text-foreground', className)}
|
|
96
96
|
{...props}
|
|
97
97
|
/>
|
|
98
98
|
));
|
|
@@ -104,7 +104,7 @@ const SheetDescription = React.forwardRef<
|
|
|
104
104
|
>(({ className, ...props }, ref) => (
|
|
105
105
|
<SheetPrimitive.Description
|
|
106
106
|
ref={ref}
|
|
107
|
-
className={cn('text-
|
|
107
|
+
className={cn('text-sm text-muted-foreground', className)}
|
|
108
108
|
{...props}
|
|
109
109
|
/>
|
|
110
110
|
));
|
|
@@ -407,7 +407,7 @@ const SidebarGroupLabel = React.forwardRef<
|
|
|
407
407
|
ref={ref}
|
|
408
408
|
data-sidebar="group-label"
|
|
409
409
|
className={cn(
|
|
410
|
-
'flex h-[32px] shrink-0 items-center rounded-[var(--pt-radius-md)] px-[8px] text-
|
|
410
|
+
'flex h-[32px] shrink-0 items-center rounded-[var(--pt-radius-md)] px-[8px] text-xs font-medium text-sidebar-foreground/70 outline-none ring-sidebar-ring transition-[margin,opacity] duration-200 ease-linear focus-visible:ring-2 [&>svg]:size-[16px] [&>svg]:shrink-0',
|
|
411
411
|
'group-data-[collapsible=icon]:-mt-[32px] group-data-[collapsible=icon]:opacity-0',
|
|
412
412
|
className
|
|
413
413
|
)}
|
|
@@ -444,7 +444,7 @@ const SidebarGroupContent = React.forwardRef<HTMLDivElement, React.ComponentProp
|
|
|
444
444
|
<div
|
|
445
445
|
ref={ref}
|
|
446
446
|
data-sidebar="group-content"
|
|
447
|
-
className={cn('w-full text-
|
|
447
|
+
className={cn('w-full text-sm', className)}
|
|
448
448
|
{...props}
|
|
449
449
|
/>
|
|
450
450
|
)
|
|
@@ -476,7 +476,7 @@ const SidebarMenuItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li
|
|
|
476
476
|
SidebarMenuItem.displayName = 'SidebarMenuItem';
|
|
477
477
|
|
|
478
478
|
const sidebarMenuButtonVariants = cva(
|
|
479
|
-
'peer/menu-button flex w-full items-center gap-[8px] overflow-hidden rounded-[var(--pt-radius-md)] p-[8px] text-left text-
|
|
479
|
+
'peer/menu-button flex w-full items-center gap-[8px] overflow-hidden rounded-[var(--pt-radius-md)] p-[8px] text-left text-sm text-sidebar-foreground outline-none ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-[[data-sidebar=menu-action]]/menu-item:pr-[32px] aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-selected data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:!size-[32px] group-data-[collapsible=icon]:!p-[8px] [&>span:last-child]:truncate [&>svg]:size-[16px] [&>svg]:shrink-0',
|
|
480
480
|
{
|
|
481
481
|
variants: {
|
|
482
482
|
variant: {
|
|
@@ -485,9 +485,9 @@ const sidebarMenuButtonVariants = cva(
|
|
|
485
485
|
'bg-background hover:bg-sidebar-accent hover:text-sidebar-accent-foreground'
|
|
486
486
|
},
|
|
487
487
|
size: {
|
|
488
|
-
default: 'h-[32px] text-
|
|
489
|
-
sm: 'h-[28px] text-
|
|
490
|
-
lg: 'h-[48px] text-
|
|
488
|
+
default: 'h-[32px] text-sm',
|
|
489
|
+
sm: 'h-[28px] text-xs',
|
|
490
|
+
lg: 'h-[48px] text-sm group-data-[collapsible=icon]:!p-0'
|
|
491
491
|
}
|
|
492
492
|
},
|
|
493
493
|
defaultVariants: {
|
|
@@ -579,7 +579,7 @@ const SidebarMenuBadge = React.forwardRef<HTMLDivElement, React.ComponentProps<'
|
|
|
579
579
|
ref={ref}
|
|
580
580
|
data-sidebar="menu-badge"
|
|
581
581
|
className={cn(
|
|
582
|
-
'pointer-events-none absolute right-[4px] flex h-[20px] min-w-[20px] select-none items-center justify-center rounded-[var(--pt-radius-md)] px-[4px] text-
|
|
582
|
+
'pointer-events-none absolute right-[4px] flex h-[20px] min-w-[20px] select-none items-center justify-center rounded-[var(--pt-radius-md)] px-[4px] text-xs font-medium tabular-nums text-sidebar-foreground',
|
|
583
583
|
'peer-hover/menu-button:text-sidebar-accent-foreground peer-data-[active=true]/menu-button:text-sidebar-accent-foreground',
|
|
584
584
|
'peer-data-[size=sm]/menu-button:top-[4px]',
|
|
585
585
|
'peer-data-[size=default]/menu-button:top-[6px]',
|
|
@@ -665,8 +665,8 @@ const SidebarMenuSubButton = React.forwardRef<
|
|
|
665
665
|
className={cn(
|
|
666
666
|
'flex h-[28px] min-w-0 -translate-x-px items-center gap-[8px] overflow-hidden rounded-[var(--pt-radius-md)] px-[8px] text-sidebar-foreground outline-none ring-sidebar-ring hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:opacity-50 [&>span:last-child]:truncate [&>svg]:size-[16px] [&>svg]:shrink-0 [&>svg]:text-sidebar-accent-foreground',
|
|
667
667
|
'data-[active=true]:bg-selected data-[active=true]:text-sidebar-accent-foreground',
|
|
668
|
-
size === 'sm' && 'text-
|
|
669
|
-
size === 'md' && 'text-
|
|
668
|
+
size === 'sm' && 'text-xs',
|
|
669
|
+
size === 'md' && 'text-sm',
|
|
670
670
|
'group-data-[collapsible=icon]:hidden',
|
|
671
671
|
className
|
|
672
672
|
)}
|
|
@@ -7,7 +7,7 @@ const Table = React.forwardRef<HTMLTableElement, React.HTMLAttributes<HTMLTableE
|
|
|
7
7
|
<div className="relative w-full overflow-auto">
|
|
8
8
|
<table
|
|
9
9
|
ref={ref}
|
|
10
|
-
className={cn('w-full caption-bottom text-
|
|
10
|
+
className={cn('w-full caption-bottom text-sm text-foreground', className)}
|
|
11
11
|
{...props}
|
|
12
12
|
/>
|
|
13
13
|
</div>
|
|
@@ -88,7 +88,7 @@ const TableCaption = React.forwardRef<
|
|
|
88
88
|
HTMLTableCaptionElement,
|
|
89
89
|
React.HTMLAttributes<HTMLTableCaptionElement>
|
|
90
90
|
>(({ className, ...props }, ref) => (
|
|
91
|
-
<caption ref={ref} className={cn('mt-[16px] text-
|
|
91
|
+
<caption ref={ref} className={cn('mt-[16px] text-sm text-muted-foreground', className)} {...props} />
|
|
92
92
|
));
|
|
93
93
|
TableCaption.displayName = 'TableCaption';
|
|
94
94
|
|
|
@@ -32,9 +32,9 @@ const LIST_SIZE: Record<TabsVariant, Record<TabsSize, string>> = {
|
|
|
32
32
|
};
|
|
33
33
|
|
|
34
34
|
const TRIGGER_TEXT: Record<TabsSize, string> = {
|
|
35
|
-
sm: 'text-
|
|
36
|
-
default: 'text-
|
|
37
|
-
lg: 'text-
|
|
35
|
+
sm: 'text-2xs',
|
|
36
|
+
default: 'text-xs',
|
|
37
|
+
lg: 'text-sm'
|
|
38
38
|
};
|
|
39
39
|
|
|
40
40
|
const Tabs = React.forwardRef<
|
|
@@ -9,7 +9,7 @@ const Textarea = React.forwardRef<HTMLTextAreaElement, TextareaProps>(
|
|
|
9
9
|
return (
|
|
10
10
|
<textarea
|
|
11
11
|
className={cn(
|
|
12
|
-
'flex min-h-[60px] w-full rounded-[var(--pt-radius-md)] border border-input bg-transparent px-[12px] py-[8px] text-
|
|
12
|
+
'flex min-h-[60px] w-full rounded-[var(--pt-radius-md)] border border-input bg-transparent px-[12px] py-[8px] text-sm placeholder:text-muted-foreground transition-colors enabled:hover:border-neutral focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-[invalid=true]:border-destructive aria-[invalid=true]:enabled:hover:border-destructive aria-[invalid=true]:focus-visible:ring-destructive/30',
|
|
13
13
|
className
|
|
14
14
|
)}
|
|
15
15
|
ref={ref}
|
|
@@ -5,7 +5,7 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
6
|
|
|
7
7
|
const toggleVariants = cva(
|
|
8
|
-
'state-layer inline-flex items-center justify-center gap-[8px] rounded-[var(--pt-radius-md)] text-
|
|
8
|
+
'state-layer inline-flex items-center justify-center gap-[8px] rounded-[var(--pt-radius-md)] text-sm font-medium text-foreground transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 data-[state=on]:bg-selected data-[state=on]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-[16px] [&_svg]:shrink-0',
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
@@ -13,9 +13,9 @@ const toggleVariants = cva(
|
|
|
13
13
|
outline: 'border border-input bg-transparent [--pt-state-layer-border:1px]'
|
|
14
14
|
},
|
|
15
15
|
size: {
|
|
16
|
-
default: 'h-[32px] min-w-[36px] px-[8px] text-
|
|
17
|
-
sm: 'h-[24px] min-w-[32px] rounded-[var(--pt-radius-sm)] px-[6px] text-
|
|
18
|
-
lg: 'h-[40px] min-w-[40px] px-[10px] text-
|
|
16
|
+
default: 'h-[32px] min-w-[36px] px-[8px] text-xs',
|
|
17
|
+
sm: 'h-[24px] min-w-[32px] rounded-[var(--pt-radius-sm)] px-[6px] text-2xs',
|
|
18
|
+
lg: 'h-[40px] min-w-[40px] px-[10px] text-sm [&_svg]:size-[20px]'
|
|
19
19
|
}
|
|
20
20
|
},
|
|
21
21
|
defaultVariants: {
|
|
@@ -18,7 +18,7 @@ const TooltipContent = React.forwardRef<
|
|
|
18
18
|
ref={ref}
|
|
19
19
|
sideOffset={sideOffset}
|
|
20
20
|
className={cn(
|
|
21
|
-
'z-[var(--pt-z-tooltip,50)] overflow-hidden rounded-[var(--pt-radius-md)] bg-primary px-[12px] py-[6px] text-
|
|
21
|
+
'z-[var(--pt-z-tooltip,50)] overflow-hidden rounded-[var(--pt-radius-md)] bg-primary px-[12px] py-[6px] text-xs text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2',
|
|
22
22
|
className
|
|
23
23
|
)}
|
|
24
24
|
{...props}
|