@ptengine/design-components 0.5.3 → 0.7.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/CHANGELOG.md +95 -0
- package/COMPONENTS-DESIGN-SYSTEM.md +341 -0
- package/README.md +43 -189
- package/dist/components/ui/alert-dialog.d.ts.map +1 -1
- package/dist/components/ui/dialog.d.ts.map +1 -1
- package/dist/components/ui/drawer.d.ts.map +1 -1
- package/dist/components/ui/input-otp.d.ts.map +1 -1
- package/dist/components/ui/prompt-picker.d.ts +2 -2
- package/dist/components/ui/prompt-picker.d.ts.map +1 -1
- package/dist/components/ui/search-input.d.ts +3 -3
- package/dist/components/ui/select.d.ts +2 -2
- package/dist/components/ui/select.d.ts.map +1 -1
- package/dist/components/ui/sheet.d.ts.map +1 -1
- package/dist/components/ui/skeleton.d.ts.map +1 -1
- package/dist/index.cjs +2 -77
- package/dist/index.js +2167 -20974
- package/dist/style.css +398 -0
- package/llms.txt +20 -0
- package/package.json +10 -5
- package/src/components/ui/accordion.tsx +6 -6
- package/src/components/ui/alert-dialog.tsx +9 -7
- package/src/components/ui/alert.tsx +5 -5
- package/src/components/ui/attachment.tsx +15 -15
- package/src/components/ui/avatar.tsx +6 -6
- package/src/components/ui/badge.tsx +8 -8
- package/src/components/ui/breadcrumb.tsx +8 -8
- package/src/components/ui/bubble.tsx +15 -15
- package/src/components/ui/button-group.tsx +5 -5
- package/src/components/ui/button.tsx +16 -16
- package/src/components/ui/calendar.tsx +23 -23
- package/src/components/ui/card.tsx +6 -6
- package/src/components/ui/carousel.tsx +16 -16
- package/src/components/ui/chart.tsx +21 -21
- package/src/components/ui/checkbox.tsx +3 -3
- package/src/components/ui/command.tsx +12 -12
- package/src/components/ui/context-menu.tsx +16 -16
- package/src/components/ui/dialog.tsx +12 -10
- package/src/components/ui/drawer.tsx +9 -7
- package/src/components/ui/dropdown-menu.tsx +17 -17
- package/src/components/ui/empty.tsx +7 -7
- package/src/components/ui/field.tsx +18 -18
- package/src/components/ui/hover-card.tsx +1 -1
- package/src/components/ui/input-group.tsx +11 -11
- package/src/components/ui/input-otp.tsx +9 -9
- package/src/components/ui/input.tsx +1 -1
- package/src/components/ui/item.tsx +18 -18
- package/src/components/ui/kbd.tsx +2 -2
- package/src/components/ui/label.tsx +1 -1
- package/src/components/ui/marker.tsx +5 -5
- package/src/components/ui/menubar.tsx +18 -18
- package/src/components/ui/message-scroller.tsx +6 -6
- package/src/components/ui/message.tsx +6 -6
- package/src/components/ui/native-select.tsx +3 -3
- package/src/components/ui/navigation-menu.tsx +9 -9
- package/src/components/ui/pagination.tsx +9 -9
- package/src/components/ui/popover.tsx +1 -1
- package/src/components/ui/progress.tsx +2 -2
- package/src/components/ui/prompt-picker.tsx +27 -25
- package/src/components/ui/radio-group.tsx +4 -4
- package/src/components/ui/resizable.tsx +4 -4
- package/src/components/ui/scroll-area.tsx +6 -6
- package/src/components/ui/search-input.tsx +12 -12
- package/src/components/ui/select.tsx +17 -17
- package/src/components/ui/separator.tsx +2 -2
- package/src/components/ui/sheet.tsx +15 -13
- package/src/components/ui/sidebar.tsx +70 -70
- package/src/components/ui/skeleton.tsx +12 -1
- package/src/components/ui/slider.tsx +4 -4
- package/src/components/ui/sonner.tsx +4 -4
- package/src/components/ui/spinner.tsx +1 -1
- package/src/components/ui/switch.tsx +2 -2
- package/src/components/ui/table.tsx +9 -9
- package/src/components/ui/tabs.tsx +16 -16
- package/src/components/ui/textarea.tsx +1 -1
- package/src/components/ui/toggle-group.tsx +1 -1
- package/src/components/ui/toggle.tsx +6 -6
- package/src/components/ui/tooltip.tsx +1 -1
|
@@ -22,7 +22,7 @@ const Menubar = React.forwardRef<
|
|
|
22
22
|
>(({ className, ...props }, ref) => (
|
|
23
23
|
<MenubarPrimitive.Root
|
|
24
24
|
ref={ref}
|
|
25
|
-
className={cn('flex h-[32px] items-center gap-[4px] rounded-[var(--pt-radius-md)] border bg-background p-[4px]', className)}
|
|
25
|
+
className={cn('ptx-flex ptx-h-[32px] ptx-items-center ptx-gap-[4px] ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-bg-background ptx-p-[4px]', className)}
|
|
26
26
|
{...props}
|
|
27
27
|
/>
|
|
28
28
|
));
|
|
@@ -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
|
+
'ptx-flex ptx-cursor-default ptx-select-none ptx-items-center ptx-rounded-[var(--pt-radius-sm)] ptx-px-[12px] ptx-py-[4px] ptx-text-sm ptx-font-medium ptx-text-foreground ptx-outline-none focus:ptx-bg-accent focus:ptx-text-accent-foreground data-[state=open]:ptx-bg-accent data-[state=open]:ptx-text-accent-foreground',
|
|
39
39
|
className
|
|
40
40
|
)}
|
|
41
41
|
{...props}
|
|
@@ -52,14 +52,14 @@ 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-
|
|
56
|
-
inset && 'pl-[32px]',
|
|
55
|
+
'ptx-flex ptx-cursor-default ptx-select-none ptx-items-center ptx-rounded-[var(--pt-radius-sm)] ptx-px-[8px] ptx-py-[6px] ptx-text-sm ptx-outline-none focus:ptx-bg-accent focus:ptx-text-accent-foreground data-[state=open]:ptx-bg-accent data-[state=open]:ptx-text-accent-foreground',
|
|
56
|
+
inset && 'ptx-pl-[32px]',
|
|
57
57
|
className
|
|
58
58
|
)}
|
|
59
59
|
{...props}
|
|
60
60
|
>
|
|
61
61
|
{children}
|
|
62
|
-
<ChevronRight className="ml-auto h-[16px] w-[16px]" />
|
|
62
|
+
<ChevronRight className="ptx-ml-auto ptx-h-[16px] ptx-w-[16px]" />
|
|
63
63
|
</MenubarPrimitive.SubTrigger>
|
|
64
64
|
));
|
|
65
65
|
MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName;
|
|
@@ -71,7 +71,7 @@ const MenubarSubContent = React.forwardRef<
|
|
|
71
71
|
<MenubarPrimitive.SubContent
|
|
72
72
|
ref={ref}
|
|
73
73
|
className={cn(
|
|
74
|
-
'z-[var(--pt-z-popup,50)] min-w-[8rem] overflow-hidden rounded-[var(--pt-radius-md)] border bg-popover p-[4px] text-popover-foreground shadow-lg data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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',
|
|
74
|
+
'ptx-z-[var(--pt-z-popup,50)] ptx-min-w-[8rem] ptx-overflow-hidden ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-bg-popover ptx-p-[4px] ptx-text-popover-foreground ptx-shadow-lg data-[state=open]:ptx-animate-in data-[state=closed]:ptx-animate-out data-[state=closed]:ptx-fade-out-0 data-[state=open]:ptx-fade-in-0 data-[state=closed]:ptx-zoom-out-95 data-[state=open]:ptx-zoom-in-95 data-[side=bottom]:ptx-slide-in-from-top-2 data-[side=left]:ptx-slide-in-from-right-2 data-[side=right]:ptx-slide-in-from-left-2 data-[side=top]:ptx-slide-in-from-bottom-2',
|
|
75
75
|
className
|
|
76
76
|
)}
|
|
77
77
|
{...props}
|
|
@@ -90,7 +90,7 @@ const MenubarContent = React.forwardRef<
|
|
|
90
90
|
alignOffset={alignOffset}
|
|
91
91
|
sideOffset={sideOffset}
|
|
92
92
|
className={cn(
|
|
93
|
-
'z-[var(--pt-z-popup,50)] min-w-[12rem] overflow-hidden rounded-[var(--pt-radius-md)] border bg-popover p-[4px] text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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',
|
|
93
|
+
'ptx-z-[var(--pt-z-popup,50)] ptx-min-w-[12rem] ptx-overflow-hidden ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-bg-popover ptx-p-[4px] ptx-text-popover-foreground ptx-shadow-md data-[state=open]:ptx-animate-in data-[state=closed]:ptx-fade-out-0 data-[state=open]:ptx-fade-in-0 data-[state=closed]:ptx-zoom-out-95 data-[state=open]:ptx-zoom-in-95 data-[side=bottom]:ptx-slide-in-from-top-2 data-[side=left]:ptx-slide-in-from-right-2 data-[side=right]:ptx-slide-in-from-left-2 data-[side=top]:ptx-slide-in-from-bottom-2',
|
|
94
94
|
className
|
|
95
95
|
)}
|
|
96
96
|
{...props}
|
|
@@ -108,8 +108,8 @@ 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-
|
|
112
|
-
inset && 'pl-[32px]',
|
|
111
|
+
'ptx-relative ptx-flex ptx-cursor-default ptx-select-none ptx-items-center ptx-rounded-[var(--pt-radius-sm)] ptx-px-[8px] ptx-py-[6px] ptx-text-sm ptx-outline-none focus:ptx-bg-accent focus:ptx-text-accent-foreground data-[disabled]:ptx-pointer-events-none data-[disabled]:ptx-opacity-50',
|
|
112
|
+
inset && 'ptx-pl-[32px]',
|
|
113
113
|
className
|
|
114
114
|
)}
|
|
115
115
|
{...props}
|
|
@@ -124,15 +124,15 @@ 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
|
+
'ptx-relative ptx-flex ptx-cursor-default ptx-select-none ptx-items-center ptx-rounded-[var(--pt-radius-sm)] ptx-py-[6px] ptx-pl-[32px] ptx-pr-[8px] ptx-text-sm ptx-outline-none focus:ptx-bg-accent focus:ptx-text-accent-foreground data-[disabled]:ptx-pointer-events-none data-[disabled]:ptx-opacity-50',
|
|
128
128
|
className
|
|
129
129
|
)}
|
|
130
130
|
checked={checked}
|
|
131
131
|
{...props}
|
|
132
132
|
>
|
|
133
|
-
<span className="absolute left-[8px] flex h-[14px] w-[14px] items-center justify-center">
|
|
133
|
+
<span className="ptx-absolute ptx-left-[8px] ptx-flex ptx-h-[14px] ptx-w-[14px] ptx-items-center ptx-justify-center">
|
|
134
134
|
<MenubarPrimitive.ItemIndicator>
|
|
135
|
-
<Check className="h-[16px] w-[16px]" />
|
|
135
|
+
<Check className="ptx-h-[16px] ptx-w-[16px]" />
|
|
136
136
|
</MenubarPrimitive.ItemIndicator>
|
|
137
137
|
</span>
|
|
138
138
|
{children}
|
|
@@ -147,14 +147,14 @@ 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
|
+
'ptx-relative ptx-flex ptx-cursor-default ptx-select-none ptx-items-center ptx-rounded-[var(--pt-radius-sm)] ptx-py-[6px] ptx-pl-[32px] ptx-pr-[8px] ptx-text-sm ptx-outline-none focus:ptx-bg-accent focus:ptx-text-accent-foreground data-[disabled]:ptx-pointer-events-none data-[disabled]:ptx-opacity-50',
|
|
151
151
|
className
|
|
152
152
|
)}
|
|
153
153
|
{...props}
|
|
154
154
|
>
|
|
155
|
-
<span className="absolute left-[8px] flex h-[14px] w-[14px] items-center justify-center">
|
|
155
|
+
<span className="ptx-absolute ptx-left-[8px] ptx-flex ptx-h-[14px] ptx-w-[14px] ptx-items-center ptx-justify-center">
|
|
156
156
|
<MenubarPrimitive.ItemIndicator>
|
|
157
|
-
<Circle className="h-[8px] w-[8px] fill-current" />
|
|
157
|
+
<Circle className="ptx-h-[8px] ptx-w-[8px] ptx-fill-current" />
|
|
158
158
|
</MenubarPrimitive.ItemIndicator>
|
|
159
159
|
</span>
|
|
160
160
|
{children}
|
|
@@ -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('ptx-px-[8px] ptx-py-[6px] ptx-text-sm ptx-font-semibold ptx-text-foreground', inset && 'ptx-pl-[32px]', className)}
|
|
174
174
|
{...props}
|
|
175
175
|
/>
|
|
176
176
|
));
|
|
@@ -182,7 +182,7 @@ const MenubarSeparator = React.forwardRef<
|
|
|
182
182
|
>(({ className, ...props }, ref) => (
|
|
183
183
|
<MenubarPrimitive.Separator
|
|
184
184
|
ref={ref}
|
|
185
|
-
className={cn('-mx-[4px] my-[4px] h-px bg-muted', className)}
|
|
185
|
+
className={cn('-ptx-mx-[4px] ptx-my-[4px] ptx-h-px ptx-bg-muted', className)}
|
|
186
186
|
{...props}
|
|
187
187
|
/>
|
|
188
188
|
));
|
|
@@ -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('ptx-ml-auto ptx-text-xs ptx-tracking-widest ptx-text-muted-foreground', className)}
|
|
195
195
|
{...props}
|
|
196
196
|
/>
|
|
197
197
|
);
|
|
@@ -73,7 +73,7 @@ function MessageScroller({ className, ...props }: React.HTMLAttributes<HTMLDivEl
|
|
|
73
73
|
<div
|
|
74
74
|
data-slot="message-scroller"
|
|
75
75
|
className={cn(
|
|
76
|
-
'group/message-scroller relative flex size-full min-h-0 flex-col overflow-hidden',
|
|
76
|
+
'group/message-scroller ptx-relative ptx-flex ptx-size-full ptx-min-h-0 ptx-flex-col ptx-overflow-hidden',
|
|
77
77
|
className
|
|
78
78
|
)}
|
|
79
79
|
{...props}
|
|
@@ -112,7 +112,7 @@ function MessageScrollerViewport({
|
|
|
112
112
|
ref={viewportRef}
|
|
113
113
|
data-slot="message-scroller-viewport"
|
|
114
114
|
className={cn(
|
|
115
|
-
'size-full min-h-0 min-w-0 overflow-y-auto overscroll-contain [contain:content]',
|
|
115
|
+
'ptx-size-full ptx-min-h-0 ptx-min-w-0 ptx-overflow-y-auto ptx-overscroll-contain [contain:content]',
|
|
116
116
|
className
|
|
117
117
|
)}
|
|
118
118
|
onScroll={e => {
|
|
@@ -130,7 +130,7 @@ function MessageScrollerContent({ className, ...props }: React.HTMLAttributes<HT
|
|
|
130
130
|
return (
|
|
131
131
|
<div
|
|
132
132
|
data-slot="message-scroller-content"
|
|
133
|
-
className={cn('flex h-max min-h-full flex-col gap-[32px]', className)}
|
|
133
|
+
className={cn('ptx-flex ptx-h-max ptx-min-h-full ptx-flex-col ptx-gap-[32px]', className)}
|
|
134
134
|
{...props}
|
|
135
135
|
/>
|
|
136
136
|
);
|
|
@@ -141,7 +141,7 @@ function MessageScrollerItem({ className, ...props }: React.HTMLAttributes<HTMLD
|
|
|
141
141
|
<div
|
|
142
142
|
data-slot="message-scroller-item"
|
|
143
143
|
className={cn(
|
|
144
|
-
'min-w-0 shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]',
|
|
144
|
+
'ptx-min-w-0 ptx-shrink-0 [contain-intrinsic-size:auto_10rem] [content-visibility:auto]',
|
|
145
145
|
className
|
|
146
146
|
)}
|
|
147
147
|
{...props}
|
|
@@ -174,7 +174,7 @@ function MessageScrollerButton({
|
|
|
174
174
|
variant={variant}
|
|
175
175
|
size={size}
|
|
176
176
|
className={cn(
|
|
177
|
-
'absolute left-1/2 z-10 h-[32px] w-[32px] -translate-x-1/2 rounded-full transition-[opacity,transform] duration-200 data-[direction=end]:bottom-[16px] data-[direction=start]:top-[16px] data-[active=false]:pointer-events-none data-[active=false]:opacity-0 data-[active=true]:opacity-100 data-[direction=start]:[&_svg]:rotate-180',
|
|
177
|
+
'ptx-absolute ptx-left-1/2 ptx-z-10 ptx-h-[32px] ptx-w-[32px] -ptx-translate-x-1/2 ptx-rounded-full ptx-transition-[opacity,transform] ptx-duration-200 data-[direction=end]:ptx-bottom-[16px] data-[direction=start]:ptx-top-[16px] data-[active=false]:ptx-pointer-events-none data-[active=false]:ptx-opacity-0 data-[active=true]:ptx-opacity-100 data-[direction=start]:[&_svg]:ptx-rotate-180',
|
|
178
178
|
className
|
|
179
179
|
)}
|
|
180
180
|
onClick={e => {
|
|
@@ -186,7 +186,7 @@ function MessageScrollerButton({
|
|
|
186
186
|
{children ?? (
|
|
187
187
|
<>
|
|
188
188
|
<ArrowDown />
|
|
189
|
-
<span className="sr-only">
|
|
189
|
+
<span className="ptx-sr-only">
|
|
190
190
|
{label ?? (direction === 'end' ? 'Scroll to end' : 'Scroll to start')}
|
|
191
191
|
</span>
|
|
192
192
|
</>
|
|
@@ -6,7 +6,7 @@ function MessageGroup({ className, ...props }: React.HTMLAttributes<HTMLDivEleme
|
|
|
6
6
|
return (
|
|
7
7
|
<div
|
|
8
8
|
data-slot="message-group"
|
|
9
|
-
className={cn('flex min-w-0 flex-col gap-[8px]', className)}
|
|
9
|
+
className={cn('ptx-flex ptx-min-w-0 ptx-flex-col ptx-gap-[8px]', className)}
|
|
10
10
|
{...props}
|
|
11
11
|
/>
|
|
12
12
|
);
|
|
@@ -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 ptx-relative ptx-flex ptx-w-full ptx-min-w-0 ptx-gap-[8px] ptx-text-sm data-[align=end]:ptx-flex-row-reverse',
|
|
26
26
|
className
|
|
27
27
|
)}
|
|
28
28
|
{...props}
|
|
@@ -35,7 +35,7 @@ function MessageAvatar({ className, ...props }: React.HTMLAttributes<HTMLDivElem
|
|
|
35
35
|
<div
|
|
36
36
|
data-slot="message-avatar"
|
|
37
37
|
className={cn(
|
|
38
|
-
'flex w-fit min-w-[32px] shrink-0 items-center justify-center self-end overflow-hidden rounded-full bg-muted group-has-[[data-slot=message-footer]]/message:-translate-y-[32px]',
|
|
38
|
+
'ptx-flex ptx-w-fit ptx-min-w-[32px] ptx-shrink-0 ptx-items-center ptx-justify-center ptx-self-end ptx-overflow-hidden ptx-rounded-full ptx-bg-muted group-has-[[data-slot=message-footer]]/message:-ptx-translate-y-[32px]',
|
|
39
39
|
className
|
|
40
40
|
)}
|
|
41
41
|
{...props}
|
|
@@ -48,7 +48,7 @@ function MessageContent({ className, ...props }: React.HTMLAttributes<HTMLDivEle
|
|
|
48
48
|
<div
|
|
49
49
|
data-slot="message-content"
|
|
50
50
|
className={cn(
|
|
51
|
-
'flex w-full min-w-0 flex-col gap-[10px] break-words group-data-[align=end]/message:[&>[data-slot]]:self-end',
|
|
51
|
+
'ptx-flex ptx-w-full ptx-min-w-0 ptx-flex-col ptx-gap-[10px] ptx-break-words group-data-[align=end]/message:[&>[data-slot]]:ptx-self-end',
|
|
52
52
|
className
|
|
53
53
|
)}
|
|
54
54
|
{...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
|
+
'ptx-flex ptx-max-w-full ptx-min-w-0 ptx-items-center ptx-px-[12px] ptx-text-xs ptx-font-medium ptx-text-muted-foreground group-has-[[data-variant=ghost]]/message:ptx-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
|
+
'ptx-flex ptx-max-w-full ptx-min-w-0 ptx-items-center ptx-px-[12px] ptx-text-xs ptx-font-medium ptx-text-muted-foreground group-has-[[data-variant=ghost]]/message:ptx-px-0 group-data-[align=end]/message:ptx-justify-end',
|
|
78
78
|
className
|
|
79
79
|
)}
|
|
80
80
|
{...props}
|
|
@@ -7,11 +7,11 @@ const NativeSelect = React.forwardRef<
|
|
|
7
7
|
HTMLSelectElement,
|
|
8
8
|
React.SelectHTMLAttributes<HTMLSelectElement>
|
|
9
9
|
>(({ className, children, ...props }, ref) => (
|
|
10
|
-
<div className="relative w-full">
|
|
10
|
+
<div className="ptx-relative ptx-w-full">
|
|
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
|
+
'ptx-h-[32px] ptx-w-full ptx-appearance-none ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-border-input ptx-bg-transparent ptx-pl-[12px] ptx-pr-[32px] ptx-text-xs ptx-text-foreground ptx-transition-colors enabled:hover:ptx-border-neutral focus-visible:ptx-outline-none focus-visible:ptx-ring-1 focus-visible:ptx-ring-ring disabled:ptx-cursor-not-allowed disabled:ptx-opacity-50 aria-[invalid=true]:ptx-border-destructive aria-[invalid=true]:enabled:hover:ptx-border-destructive aria-[invalid=true]:focus-visible:ptx-ring-destructive/30',
|
|
15
15
|
className
|
|
16
16
|
)}
|
|
17
17
|
{...props}
|
|
@@ -19,7 +19,7 @@ const NativeSelect = React.forwardRef<
|
|
|
19
19
|
{children}
|
|
20
20
|
</select>
|
|
21
21
|
<ChevronDown
|
|
22
|
-
className="pointer-events-none absolute right-[10px] top-1/2 size-[16px] -translate-y-1/2 text-muted-foreground"
|
|
22
|
+
className="ptx-pointer-events-none ptx-absolute ptx-right-[10px] ptx-top-1/2 ptx-size-[16px] -ptx-translate-y-1/2 ptx-text-muted-foreground"
|
|
23
23
|
aria-hidden="true"
|
|
24
24
|
/>
|
|
25
25
|
</div>
|
|
@@ -11,7 +11,7 @@ const NavigationMenu = React.forwardRef<
|
|
|
11
11
|
>(({ className, children, ...props }, ref) => (
|
|
12
12
|
<NavigationMenuPrimitive.Root
|
|
13
13
|
ref={ref}
|
|
14
|
-
className={cn('relative z-10 flex max-w-max flex-1 items-center justify-center', className)}
|
|
14
|
+
className={cn('ptx-relative ptx-z-10 ptx-flex ptx-max-w-max ptx-flex-1 ptx-items-center ptx-justify-center', className)}
|
|
15
15
|
{...props}
|
|
16
16
|
>
|
|
17
17
|
{children}
|
|
@@ -26,7 +26,7 @@ const NavigationMenuList = React.forwardRef<
|
|
|
26
26
|
>(({ className, ...props }, ref) => (
|
|
27
27
|
<NavigationMenuPrimitive.List
|
|
28
28
|
ref={ref}
|
|
29
|
-
className={cn('group flex flex-1 list-none items-center justify-center gap-[4px]', className)}
|
|
29
|
+
className={cn('group ptx-flex ptx-flex-1 ptx-list-none ptx-items-center ptx-justify-center ptx-gap-[4px]', className)}
|
|
30
30
|
{...props}
|
|
31
31
|
/>
|
|
32
32
|
));
|
|
@@ -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
|
+
'ptx-state-layer group ptx-inline-flex ptx-h-[32px] ptx-w-max ptx-items-center ptx-justify-center ptx-rounded-[var(--pt-radius-md)] ptx-bg-background ptx-px-[16px] ptx-py-[8px] ptx-text-sm ptx-font-medium ptx-text-foreground ptx-transition-colors focus:ptx-bg-accent focus:ptx-text-accent-foreground focus:ptx-outline-none disabled:ptx-cursor-not-allowed disabled:ptx-opacity-50 data-[state=open]:ptx-bg-accent'
|
|
39
39
|
);
|
|
40
40
|
|
|
41
41
|
const NavigationMenuTrigger = React.forwardRef<
|
|
@@ -49,7 +49,7 @@ const NavigationMenuTrigger = React.forwardRef<
|
|
|
49
49
|
>
|
|
50
50
|
{children}{' '}
|
|
51
51
|
<ChevronDown
|
|
52
|
-
className="relative top-[1px] ml-[4px] h-[12px] w-[12px] transition duration-300 group-data-[state=open]:rotate-180"
|
|
52
|
+
className="ptx-relative ptx-top-[1px] ptx-ml-[4px] ptx-h-[12px] ptx-w-[12px] ptx-transition ptx-duration-300 group-data-[state=open]:ptx-rotate-180"
|
|
53
53
|
aria-hidden="true"
|
|
54
54
|
/>
|
|
55
55
|
</NavigationMenuPrimitive.Trigger>
|
|
@@ -63,7 +63,7 @@ const NavigationMenuContent = React.forwardRef<
|
|
|
63
63
|
<NavigationMenuPrimitive.Content
|
|
64
64
|
ref={ref}
|
|
65
65
|
className={cn(
|
|
66
|
-
'left-0 top-0 w-full data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 md:absolute md:w-auto',
|
|
66
|
+
'ptx-left-0 ptx-top-0 ptx-w-full data-[motion^=from-]:ptx-animate-in data-[motion^=to-]:ptx-animate-out data-[motion^=from-]:ptx-fade-in data-[motion^=to-]:ptx-fade-out data-[motion=from-end]:ptx-slide-in-from-right-52 data-[motion=from-start]:ptx-slide-in-from-left-52 data-[motion=to-end]:ptx-slide-out-to-right-52 data-[motion=to-start]:ptx-slide-out-to-left-52 md:ptx-absolute md:ptx-w-auto',
|
|
67
67
|
className
|
|
68
68
|
)}
|
|
69
69
|
{...props}
|
|
@@ -77,10 +77,10 @@ const NavigationMenuViewport = React.forwardRef<
|
|
|
77
77
|
React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
|
|
78
78
|
React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
|
|
79
79
|
>(({ className, ...props }, ref) => (
|
|
80
|
-
<div className={cn('absolute left-0 top-full flex justify-center')}>
|
|
80
|
+
<div className={cn('ptx-absolute ptx-left-0 ptx-top-full ptx-flex ptx-justify-center')}>
|
|
81
81
|
<NavigationMenuPrimitive.Viewport
|
|
82
82
|
className={cn(
|
|
83
|
-
'origin-top-center relative mt-[6px] h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-[var(--pt-radius-md)] border bg-popover text-popover-foreground shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]',
|
|
83
|
+
'origin-top-center ptx-relative ptx-mt-[6px] ptx-h-[var(--radix-navigation-menu-viewport-height)] ptx-w-full ptx-overflow-hidden ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-bg-popover ptx-text-popover-foreground ptx-shadow-md data-[state=open]:ptx-animate-in data-[state=closed]:ptx-animate-out data-[state=closed]:ptx-zoom-out-95 data-[state=open]:ptx-zoom-in-90 md:ptx-w-[var(--radix-navigation-menu-viewport-width)]',
|
|
84
84
|
className
|
|
85
85
|
)}
|
|
86
86
|
ref={ref}
|
|
@@ -97,12 +97,12 @@ const NavigationMenuIndicator = React.forwardRef<
|
|
|
97
97
|
<NavigationMenuPrimitive.Indicator
|
|
98
98
|
ref={ref}
|
|
99
99
|
className={cn(
|
|
100
|
-
'top-full z-[1] flex h-[6px] items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in',
|
|
100
|
+
'ptx-top-full ptx-z-[1] ptx-flex ptx-h-[6px] ptx-items-end ptx-justify-center ptx-overflow-hidden data-[state=visible]:ptx-animate-in data-[state=hidden]:ptx-animate-out data-[state=hidden]:ptx-fade-out data-[state=visible]:ptx-fade-in',
|
|
101
101
|
className
|
|
102
102
|
)}
|
|
103
103
|
{...props}
|
|
104
104
|
>
|
|
105
|
-
<div className="relative top-[60%] h-[8px] w-[8px] rotate-45 rounded-tl-[var(--pt-radius-sm)] bg-border" />
|
|
105
|
+
<div className="ptx-relative ptx-top-[60%] ptx-h-[8px] ptx-w-[8px] ptx-rotate-45 ptx-rounded-tl-[var(--pt-radius-sm)] ptx-bg-border" />
|
|
106
106
|
</NavigationMenuPrimitive.Indicator>
|
|
107
107
|
));
|
|
108
108
|
NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName;
|
|
@@ -8,7 +8,7 @@ const Pagination = ({ className, ...props }: React.ComponentProps<'nav'>) => (
|
|
|
8
8
|
<nav
|
|
9
9
|
role="navigation"
|
|
10
10
|
aria-label="pagination"
|
|
11
|
-
className={cn('mx-auto flex w-full justify-center', className)}
|
|
11
|
+
className={cn('ptx-mx-auto ptx-flex ptx-w-full ptx-justify-center', className)}
|
|
12
12
|
{...props}
|
|
13
13
|
/>
|
|
14
14
|
);
|
|
@@ -16,7 +16,7 @@ Pagination.displayName = 'Pagination';
|
|
|
16
16
|
|
|
17
17
|
const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'>>(
|
|
18
18
|
({ className, ...props }, ref) => (
|
|
19
|
-
<ul ref={ref} className={cn('flex flex-row items-center gap-[4px]', className)} {...props} />
|
|
19
|
+
<ul ref={ref} className={cn('ptx-flex ptx-flex-row ptx-items-center ptx-gap-[4px]', className)} {...props} />
|
|
20
20
|
)
|
|
21
21
|
);
|
|
22
22
|
PaginationContent.displayName = 'PaginationContent';
|
|
@@ -55,10 +55,10 @@ const PaginationPrevious = ({
|
|
|
55
55
|
<PaginationLink
|
|
56
56
|
aria-label={label}
|
|
57
57
|
size="default"
|
|
58
|
-
className={cn('gap-[4px] pl-[10px]', className)}
|
|
58
|
+
className={cn('ptx-gap-[4px] ptx-pl-[10px]', className)}
|
|
59
59
|
{...props}
|
|
60
60
|
>
|
|
61
|
-
<ChevronLeft className="h-[16px] w-[16px]" />
|
|
61
|
+
<ChevronLeft className="ptx-h-[16px] ptx-w-[16px]" />
|
|
62
62
|
<span>{label}</span>
|
|
63
63
|
</PaginationLink>
|
|
64
64
|
);
|
|
@@ -72,11 +72,11 @@ const PaginationNext = ({
|
|
|
72
72
|
<PaginationLink
|
|
73
73
|
aria-label={label}
|
|
74
74
|
size="default"
|
|
75
|
-
className={cn('gap-[4px] pr-[10px]', className)}
|
|
75
|
+
className={cn('ptx-gap-[4px] ptx-pr-[10px]', className)}
|
|
76
76
|
{...props}
|
|
77
77
|
>
|
|
78
78
|
<span>{label}</span>
|
|
79
|
-
<ChevronRight className="h-[16px] w-[16px]" />
|
|
79
|
+
<ChevronRight className="ptx-h-[16px] ptx-w-[16px]" />
|
|
80
80
|
</PaginationLink>
|
|
81
81
|
);
|
|
82
82
|
PaginationNext.displayName = 'PaginationNext';
|
|
@@ -88,11 +88,11 @@ const PaginationEllipsis = ({
|
|
|
88
88
|
}: React.ComponentProps<'span'> & { label?: string }) => (
|
|
89
89
|
<span
|
|
90
90
|
aria-hidden
|
|
91
|
-
className={cn('flex h-[32px] w-[36px] items-center justify-center text-foreground', className)}
|
|
91
|
+
className={cn('ptx-flex ptx-h-[32px] ptx-w-[36px] ptx-items-center ptx-justify-center ptx-text-foreground', className)}
|
|
92
92
|
{...props}
|
|
93
93
|
>
|
|
94
|
-
<MoreHorizontal className="h-[16px] w-[16px]" />
|
|
95
|
-
<span className="sr-only">{label}</span>
|
|
94
|
+
<MoreHorizontal className="ptx-h-[16px] ptx-w-[16px]" />
|
|
95
|
+
<span className="ptx-sr-only">{label}</span>
|
|
96
96
|
</span>
|
|
97
97
|
);
|
|
98
98
|
PaginationEllipsis.displayName = 'PaginationEllipsis';
|
|
@@ -19,7 +19,7 @@ const PopoverContent = React.forwardRef<
|
|
|
19
19
|
align={align}
|
|
20
20
|
sideOffset={sideOffset}
|
|
21
21
|
className={cn(
|
|
22
|
-
'z-[var(--pt-z-popup,50)] w-[288px] rounded-[var(--pt-radius-md)] border bg-popover p-[16px] text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-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
|
+
'ptx-z-[var(--pt-z-popup,50)] ptx-w-[288px] ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-bg-popover ptx-p-[16px] ptx-text-popover-foreground ptx-shadow-md ptx-outline-none data-[state=open]:ptx-animate-in data-[state=closed]:ptx-animate-out data-[state=closed]:ptx-fade-out-0 data-[state=open]:ptx-fade-in-0 data-[state=closed]:ptx-zoom-out-95 data-[state=open]:ptx-zoom-in-95 data-[side=bottom]:ptx-slide-in-from-top-2 data-[side=left]:ptx-slide-in-from-right-2 data-[side=right]:ptx-slide-in-from-left-2 data-[side=top]:ptx-slide-in-from-bottom-2',
|
|
23
23
|
className
|
|
24
24
|
)}
|
|
25
25
|
{...props}
|
|
@@ -9,11 +9,11 @@ const Progress = React.forwardRef<
|
|
|
9
9
|
>(({ className, value, ...props }, ref) => (
|
|
10
10
|
<ProgressPrimitive.Root
|
|
11
11
|
ref={ref}
|
|
12
|
-
className={cn('relative h-[8px] w-full overflow-hidden rounded-full bg-secondary', className)}
|
|
12
|
+
className={cn('ptx-relative ptx-h-[8px] ptx-w-full ptx-overflow-hidden ptx-rounded-full ptx-bg-secondary', className)}
|
|
13
13
|
{...props}
|
|
14
14
|
>
|
|
15
15
|
<ProgressPrimitive.Indicator
|
|
16
|
-
className="h-full w-full flex-1 bg-primary transition-all"
|
|
16
|
+
className="ptx-h-full ptx-w-full ptx-flex-1 ptx-bg-primary ptx-transition-all"
|
|
17
17
|
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
|
|
18
18
|
/>
|
|
19
19
|
</ProgressPrimitive.Root>
|
|
@@ -67,8 +67,8 @@ export interface PromptPickerItem {
|
|
|
67
67
|
* 可选:条目右端的小徽标,如「即将上线」。**只放短枚举**(1-4 字),它是给整条加限定,
|
|
68
68
|
* 不是第二行说明 —— 长说明走 `hint`(悬停)。
|
|
69
69
|
*
|
|
70
|
-
* 用扁平 chip(`rounded-sm bg-muted`)而不是库的 `Badge` 组件:后者是
|
|
71
|
-
* `rounded-full font-semibold` 胶囊,在 32px 高的条目里显得过重,且 lin 已裁定
|
|
70
|
+
* 用扁平 chip(`ptx-rounded-sm ptx-bg-muted`)而不是库的 `Badge` 组件:后者是
|
|
71
|
+
* `ptx-rounded-full ptx-font-semibold` 胶囊,在 32px 高的条目里显得过重,且 lin 已裁定
|
|
72
72
|
* Badge 只留给短枚举场景的独立标签。此处写法与 apps/x 的 ⋮ 菜单出口组一致。
|
|
73
73
|
*/
|
|
74
74
|
badge?: string;
|
|
@@ -126,33 +126,35 @@ export interface PromptPickerProps extends Omit<React.HTMLAttributes<HTMLDivElem
|
|
|
126
126
|
库规范(llms.txt 交互状态)是 **hover 在原底色上叠加中性 8%、边框加深黑 20%**,
|
|
127
127
|
并且明文「禁止用品牌绿等彩色表达选中」。规格里那份 hover 色值来自旧的
|
|
128
128
|
SuggestionCards 实测值,属于组件库成型前的写法 —— 以库规范为准。
|
|
129
|
-
机制:`state-layer` 类(preset 插件,::after 叠加 --pt-interaction-hover,
|
|
129
|
+
机制:`ptx-state-layer` 类(preset 插件,::after 叠加 --pt-interaction-hover,
|
|
130
130
|
按下自动切 press)+ `[--pt-state-layer-border:1px]` 把叠层外扩到 border box,
|
|
131
131
|
否则叠层缩在边框内侧、圆角与边框内圆弧不同心(错位约 1px)。 */
|
|
132
132
|
const CHIP_BASE =
|
|
133
|
-
'inline-flex h-[32px] max-w-full items-center gap-[8px] rounded-[var(--pt-radius-md)] border ' +
|
|
134
|
-
'px-[12px] text-left text-
|
|
135
|
-
'[&>svg]:size-[16px] [&>svg]:shrink-0 ' +
|
|
136
|
-
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2';
|
|
133
|
+
'ptx-inline-flex ptx-h-[32px] ptx-max-w-full ptx-items-center ptx-gap-[8px] ptx-rounded-[var(--pt-radius-md)] ptx-border ' +
|
|
134
|
+
'ptx-px-[12px] ptx-text-left ptx-text-xs ptx-transition-colors ' +
|
|
135
|
+
'[&>svg]:ptx-size-[16px] [&>svg]:ptx-shrink-0 ' +
|
|
136
|
+
'focus-visible:ptx-outline-none focus-visible:ptx-ring-2 focus-visible:ptx-ring-ring focus-visible:ptx-ring-offset-2';
|
|
137
137
|
|
|
138
138
|
const CHIP_IDLE =
|
|
139
|
-
'state-layer [--pt-state-layer-border:1px] border-input bg-background text-foreground ' +
|
|
140
|
-
'hover:border-neutral';
|
|
139
|
+
'ptx-state-layer [--pt-state-layer-border:1px] ptx-border-input ptx-bg-background ptx-text-foreground ' +
|
|
140
|
+
'hover:ptx-border-neutral';
|
|
141
141
|
|
|
142
142
|
/* 未上线/不可选的条目:整条降辅助色,**不挂 state-layer、不给 hover** ——
|
|
143
143
|
灰着不给反馈,好过给了反馈却什么都不发生。 */
|
|
144
|
-
const CHIP_DISABLED = 'border-input bg-background text-[rgb(var(--pt-text-tage))]';
|
|
144
|
+
const CHIP_DISABLED = 'ptx-border-input ptx-bg-background ptx-text-[rgb(var(--pt-text-tage))]';
|
|
145
145
|
|
|
146
146
|
/* 条目右端的小徽标。扁平 chip,不是库 Badge(理由见 PromptPickerItem.badge 的注释)。
|
|
147
|
-
|
|
147
|
+
用 `2xs`(12/16)——比条目正文 `xs`(13/20) 低一档,不与之争夺注意力。
|
|
148
|
+
⚠️ 原先写的是 `ptx-text-[11px] ptx-leading-[16px]`,**11px 不在字阶表里**(表里最小是 2xs 12)。
|
|
149
|
+
字阶来自 Figma Text Styles,自造档位会让「组件跟着规范走」这件事从这里开始漏。 */
|
|
148
150
|
const CHIP_BADGE =
|
|
149
|
-
'ml-[8px] shrink-0 whitespace-nowrap rounded-[var(--pt-radius-sm)] bg-muted ' +
|
|
150
|
-
'px-[6px] text-
|
|
151
|
+
'ptx-ml-[8px] ptx-shrink-0 ptx-whitespace-nowrap ptx-rounded-[var(--pt-radius-sm)] ptx-bg-muted ' +
|
|
152
|
+
'ptx-px-[6px] ptx-text-2xs ptx-text-[rgb(var(--pt-text-tage))]';
|
|
151
153
|
|
|
152
154
|
/* 第二层顶部的分类项 —— 面包屑,不是选中态(见头注释规则 2)。
|
|
153
155
|
持久态底色 = 中性 8%(库规范:选中/激活用 --pt-bg-selected,不用彩色);
|
|
154
156
|
它自己不可点,所以不挂 state-layer。 */
|
|
155
|
-
const CHIP_CRUMB = 'border-neutral bg-selected text-foreground';
|
|
157
|
+
const CHIP_CRUMB = 'ptx-border-neutral ptx-bg-selected ptx-text-foreground';
|
|
156
158
|
|
|
157
159
|
const PromptPicker = React.forwardRef<HTMLDivElement, PromptPickerProps>(
|
|
158
160
|
(
|
|
@@ -200,7 +202,7 @@ const PromptPicker = React.forwardRef<HTMLDivElement, PromptPickerProps>(
|
|
|
200
202
|
return (
|
|
201
203
|
<div
|
|
202
204
|
ref={ref}
|
|
203
|
-
className={cn('flex w-full flex-col items-start gap-[10px]', className)}
|
|
205
|
+
className={cn('ptx-flex ptx-w-full ptx-flex-col ptx-items-start ptx-gap-[10px]', className)}
|
|
204
206
|
{...props}
|
|
205
207
|
>
|
|
206
208
|
{/* 面包屑与列表同进同退:内容进了输入框,整个选项区(含这条分类)一起退场,
|
|
@@ -213,19 +215,19 @@ const PromptPicker = React.forwardRef<HTMLDivElement, PromptPickerProps>(
|
|
|
213
215
|
{branch && !hasContent && (
|
|
214
216
|
<div className={cn(CHIP_BASE, CHIP_CRUMB)}>
|
|
215
217
|
{branch.icon}
|
|
216
|
-
<span className="min-w-0 flex-1 truncate">{branch.label}</span>
|
|
218
|
+
<span className="ptx-min-w-0 ptx-flex-1 ptx-truncate">{branch.label}</span>
|
|
217
219
|
<button
|
|
218
220
|
type="button"
|
|
219
221
|
aria-label={backLabel}
|
|
220
222
|
onClick={handleBack}
|
|
221
223
|
className={
|
|
222
|
-
'flex size-[24px] shrink-0 items-center justify-center rounded-[var(--pt-radius-sm)] ' +
|
|
223
|
-
'text-[rgb(var(--pt-text-tage))] transition-colors hover:text-foreground ' +
|
|
224
|
-
'focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring'
|
|
224
|
+
'ptx-flex ptx-size-[24px] ptx-shrink-0 ptx-items-center ptx-justify-center ptx-rounded-[var(--pt-radius-sm)] ' +
|
|
225
|
+
'ptx-text-[rgb(var(--pt-text-tage))] ptx-transition-colors hover:ptx-text-foreground ' +
|
|
226
|
+
'focus-visible:ptx-outline-none focus-visible:ptx-ring-2 focus-visible:ptx-ring-ring'
|
|
225
227
|
}
|
|
226
228
|
>
|
|
227
229
|
{/* 辅助图标(关闭叉)default 档 = 12px;点击区仍保 24×24 */}
|
|
228
|
-
<X className="size-[12px]" />
|
|
230
|
+
<X className="ptx-size-[12px]" />
|
|
229
231
|
</button>
|
|
230
232
|
</div>
|
|
231
233
|
)}
|
|
@@ -237,12 +239,12 @@ const PromptPicker = React.forwardRef<HTMLDivElement, PromptPickerProps>(
|
|
|
237
239
|
display:none 同时把它移出无障碍树与 Tab 序,不用额外处理焦点。 */}
|
|
238
240
|
<div
|
|
239
241
|
className={cn(
|
|
240
|
-
'w-full flex-col items-start gap-[8px]',
|
|
241
|
-
hasContent ? 'hidden' : 'flex'
|
|
242
|
+
'ptx-w-full ptx-flex-col ptx-items-start ptx-gap-[8px]',
|
|
243
|
+
hasContent ? 'ptx-hidden' : 'ptx-flex'
|
|
242
244
|
)}
|
|
243
245
|
>
|
|
244
246
|
{lead && (
|
|
245
|
-
<p className="text-
|
|
247
|
+
<p className="ptx-text-xs ptx-text-[rgb(var(--pt-text-tage))]">
|
|
246
248
|
{lead}
|
|
247
249
|
</p>
|
|
248
250
|
)}
|
|
@@ -259,7 +261,7 @@ const PromptPicker = React.forwardRef<HTMLDivElement, PromptPickerProps>(
|
|
|
259
261
|
className={cn(CHIP_BASE, CHIP_DISABLED)}
|
|
260
262
|
>
|
|
261
263
|
{item.icon}
|
|
262
|
-
<span className={cn('min-w-0 truncate', item.badge && 'flex-1')}>
|
|
264
|
+
<span className={cn('ptx-min-w-0 ptx-truncate', item.badge && 'ptx-flex-1')}>
|
|
263
265
|
{item.label}
|
|
264
266
|
</span>
|
|
265
267
|
{item.badge && <span className={CHIP_BADGE}>{item.badge}</span>}
|
|
@@ -273,7 +275,7 @@ const PromptPicker = React.forwardRef<HTMLDivElement, PromptPickerProps>(
|
|
|
273
275
|
className={cn(CHIP_BASE, CHIP_IDLE)}
|
|
274
276
|
>
|
|
275
277
|
{item.icon}
|
|
276
|
-
<span className={cn('min-w-0 truncate', item.badge && 'flex-1')}>
|
|
278
|
+
<span className={cn('ptx-min-w-0 ptx-truncate', item.badge && 'ptx-flex-1')}>
|
|
277
279
|
{item.label}
|
|
278
280
|
</span>
|
|
279
281
|
{item.badge && <span className={CHIP_BADGE}>{item.badge}</span>}
|
|
@@ -8,7 +8,7 @@ const RadioGroup = React.forwardRef<
|
|
|
8
8
|
React.ElementRef<typeof RadioGroupPrimitive.Root>,
|
|
9
9
|
React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
|
|
10
10
|
>(({ className, ...props }, ref) => {
|
|
11
|
-
return <RadioGroupPrimitive.Root className={cn('grid gap-[8px]', className)} {...props} ref={ref} />;
|
|
11
|
+
return <RadioGroupPrimitive.Root className={cn('ptx-grid ptx-gap-[8px]', className)} {...props} ref={ref} />;
|
|
12
12
|
});
|
|
13
13
|
RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
|
|
14
14
|
|
|
@@ -20,13 +20,13 @@ const RadioGroupItem = React.forwardRef<
|
|
|
20
20
|
<RadioGroupPrimitive.Item
|
|
21
21
|
ref={ref}
|
|
22
22
|
className={cn(
|
|
23
|
-
'aspect-square h-[16px] w-[16px] rounded-full border border-neutral text-primary transition-colors enabled:hover:border-strong data-[state=unchecked]:enabled:active:bg-press focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:border-weak disabled:bg-disable disabled:text-disabled enabled:data-[state=checked]:border-primary',
|
|
23
|
+
'ptx-aspect-square ptx-h-[16px] ptx-w-[16px] ptx-rounded-full ptx-border ptx-border-neutral ptx-text-primary ptx-transition-colors enabled:hover:ptx-border-strong data-[state=unchecked]:enabled:active:ptx-bg-press focus:ptx-outline-none focus-visible:ptx-ring-1 focus-visible:ptx-ring-ring disabled:ptx-cursor-not-allowed disabled:ptx-border-weak disabled:ptx-bg-disable disabled:ptx-text-disabled enabled:data-[state=checked]:ptx-border-primary',
|
|
24
24
|
className
|
|
25
25
|
)}
|
|
26
26
|
{...props}
|
|
27
27
|
>
|
|
28
|
-
<RadioGroupPrimitive.Indicator className="flex items-center justify-center">
|
|
29
|
-
<Circle className="h-[14px] w-[14px] fill-current" />
|
|
28
|
+
<RadioGroupPrimitive.Indicator className="ptx-flex ptx-items-center ptx-justify-center">
|
|
29
|
+
<Circle className="ptx-h-[14px] ptx-w-[14px] ptx-fill-current" />
|
|
30
30
|
</RadioGroupPrimitive.Indicator>
|
|
31
31
|
</RadioGroupPrimitive.Item>
|
|
32
32
|
);
|
|
@@ -8,7 +8,7 @@ const ResizablePanelGroup = ({
|
|
|
8
8
|
...props
|
|
9
9
|
}: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) => (
|
|
10
10
|
<ResizablePrimitive.PanelGroup
|
|
11
|
-
className={cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className)}
|
|
11
|
+
className={cn('ptx-flex ptx-h-full ptx-w-full data-[panel-group-direction=vertical]:ptx-flex-col', className)}
|
|
12
12
|
{...props}
|
|
13
13
|
/>
|
|
14
14
|
);
|
|
@@ -24,14 +24,14 @@ const ResizableHandle = ({
|
|
|
24
24
|
}) => (
|
|
25
25
|
<ResizablePrimitive.PanelResizeHandle
|
|
26
26
|
className={cn(
|
|
27
|
-
'relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-[4px] after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-[4px] data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:-translate-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90',
|
|
27
|
+
'ptx-relative ptx-flex ptx-w-px ptx-items-center ptx-justify-center ptx-bg-border after:ptx-absolute after:ptx-inset-y-0 after:ptx-left-1/2 after:ptx-w-[4px] after:-ptx-translate-x-1/2 focus-visible:ptx-outline-none focus-visible:ptx-ring-1 focus-visible:ptx-ring-ring focus-visible:ptx-ring-offset-1 data-[panel-group-direction=vertical]:ptx-h-px data-[panel-group-direction=vertical]:ptx-w-full data-[panel-group-direction=vertical]:after:ptx-left-0 data-[panel-group-direction=vertical]:after:ptx-h-[4px] data-[panel-group-direction=vertical]:after:ptx-w-full data-[panel-group-direction=vertical]:after:-ptx-translate-y-1/2 data-[panel-group-direction=vertical]:after:ptx-translate-x-0 [&[data-panel-group-direction=vertical]>div]:ptx-rotate-90',
|
|
28
28
|
className
|
|
29
29
|
)}
|
|
30
30
|
{...props}
|
|
31
31
|
>
|
|
32
32
|
{withHandle && (
|
|
33
|
-
<div className="z-10 flex h-[16px] w-[12px] items-center justify-center rounded-[var(--pt-radius-sm)] border bg-border">
|
|
34
|
-
<GripVertical className="h-[10px] w-[10px]" />
|
|
33
|
+
<div className="ptx-z-10 ptx-flex ptx-h-[16px] ptx-w-[12px] ptx-items-center ptx-justify-center ptx-rounded-[var(--pt-radius-sm)] ptx-border ptx-bg-border">
|
|
34
|
+
<GripVertical className="ptx-h-[10px] ptx-w-[10px]" />
|
|
35
35
|
</div>
|
|
36
36
|
)}
|
|
37
37
|
</ResizablePrimitive.PanelResizeHandle>
|