@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
|
@@ -6,7 +6,7 @@ const Card = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElemen
|
|
|
6
6
|
({ className, ...props }, ref) => (
|
|
7
7
|
<div
|
|
8
8
|
ref={ref}
|
|
9
|
-
className={cn('rounded-12 border bg-card text-card-foreground', className)}
|
|
9
|
+
className={cn('ptx-rounded-12 ptx-border ptx-bg-card ptx-text-card-foreground', className)}
|
|
10
10
|
{...props}
|
|
11
11
|
/>
|
|
12
12
|
)
|
|
@@ -15,7 +15,7 @@ Card.displayName = 'Card';
|
|
|
15
15
|
|
|
16
16
|
const CardHeader = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
17
17
|
({ className, ...props }, ref) => (
|
|
18
|
-
<div ref={ref} className={cn('flex flex-col space-y-[6px] p-[24px]', className)} {...props} />
|
|
18
|
+
<div ref={ref} className={cn('ptx-flex ptx-flex-col ptx-space-y-[6px] ptx-p-[24px]', className)} {...props} />
|
|
19
19
|
)
|
|
20
20
|
);
|
|
21
21
|
CardHeader.displayName = 'CardHeader';
|
|
@@ -24,7 +24,7 @@ const CardTitle = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivE
|
|
|
24
24
|
({ className, ...props }, ref) => (
|
|
25
25
|
<div
|
|
26
26
|
ref={ref}
|
|
27
|
-
className={cn('font-semibold leading-none tracking-tight', className)}
|
|
27
|
+
className={cn('ptx-font-semibold ptx-leading-none ptx-tracking-tight', className)}
|
|
28
28
|
{...props}
|
|
29
29
|
/>
|
|
30
30
|
)
|
|
@@ -33,21 +33,21 @@ CardTitle.displayName = 'CardTitle';
|
|
|
33
33
|
|
|
34
34
|
const CardDescription = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
35
35
|
({ className, ...props }, ref) => (
|
|
36
|
-
<div ref={ref} className={cn('text-
|
|
36
|
+
<div ref={ref} className={cn('ptx-text-sm ptx-text-muted-foreground', className)} {...props} />
|
|
37
37
|
)
|
|
38
38
|
);
|
|
39
39
|
CardDescription.displayName = 'CardDescription';
|
|
40
40
|
|
|
41
41
|
const CardContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
42
42
|
({ className, ...props }, ref) => (
|
|
43
|
-
<div ref={ref} className={cn('p-[24px] pt-0', className)} {...props} />
|
|
43
|
+
<div ref={ref} className={cn('ptx-p-[24px] ptx-pt-0', className)} {...props} />
|
|
44
44
|
)
|
|
45
45
|
);
|
|
46
46
|
CardContent.displayName = 'CardContent';
|
|
47
47
|
|
|
48
48
|
const CardFooter = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDivElement>>(
|
|
49
49
|
({ className, ...props }, ref) => (
|
|
50
|
-
<div ref={ref} className={cn('flex items-center p-[24px] pt-0', className)} {...props} />
|
|
50
|
+
<div ref={ref} className={cn('ptx-flex ptx-items-center ptx-p-[24px] ptx-pt-0', className)} {...props} />
|
|
51
51
|
)
|
|
52
52
|
);
|
|
53
53
|
CardFooter.displayName = 'CardFooter';
|
|
@@ -120,7 +120,7 @@ const Carousel = React.forwardRef<
|
|
|
120
120
|
<div
|
|
121
121
|
ref={ref}
|
|
122
122
|
onKeyDownCapture={handleKeyDown}
|
|
123
|
-
className={cn('relative', className)}
|
|
123
|
+
className={cn('ptx-relative', className)}
|
|
124
124
|
role="region"
|
|
125
125
|
aria-roledescription="carousel"
|
|
126
126
|
{...props}
|
|
@@ -137,12 +137,12 @@ const CarouselContent = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HT
|
|
|
137
137
|
const { carouselRef, orientation } = useCarousel();
|
|
138
138
|
|
|
139
139
|
return (
|
|
140
|
-
<div ref={carouselRef} className="overflow-hidden">
|
|
140
|
+
<div ref={carouselRef} className="ptx-overflow-hidden">
|
|
141
141
|
<div
|
|
142
142
|
ref={ref}
|
|
143
143
|
className={cn(
|
|
144
|
-
'flex',
|
|
145
|
-
orientation === 'horizontal' ? '-ml-[16px]' : '-mt-[16px] flex-col',
|
|
144
|
+
'ptx-flex',
|
|
145
|
+
orientation === 'horizontal' ? '-ptx-ml-[16px]' : '-ptx-mt-[16px] ptx-flex-col',
|
|
146
146
|
className
|
|
147
147
|
)}
|
|
148
148
|
{...props}
|
|
@@ -163,8 +163,8 @@ const CarouselItem = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLD
|
|
|
163
163
|
role="group"
|
|
164
164
|
aria-roledescription="slide"
|
|
165
165
|
className={cn(
|
|
166
|
-
'min-w-0 shrink-0 grow-0 basis-full',
|
|
167
|
-
orientation === 'horizontal' ? 'pl-[16px]' : 'pt-[16px]',
|
|
166
|
+
'ptx-min-w-0 ptx-shrink-0 ptx-grow-0 ptx-basis-full',
|
|
167
|
+
orientation === 'horizontal' ? 'ptx-pl-[16px]' : 'ptx-pt-[16px]',
|
|
168
168
|
className
|
|
169
169
|
)}
|
|
170
170
|
{...props}
|
|
@@ -190,18 +190,18 @@ const CarouselPrevious = React.forwardRef<
|
|
|
190
190
|
variant={variant}
|
|
191
191
|
size={size}
|
|
192
192
|
className={cn(
|
|
193
|
-
'absolute h-[32px] w-[32px] rounded-full',
|
|
193
|
+
'ptx-absolute ptx-h-[32px] ptx-w-[32px] ptx-rounded-full',
|
|
194
194
|
orientation === 'horizontal'
|
|
195
|
-
? '-left-[48px] top-1/2 -translate-y-1/2'
|
|
196
|
-
: '-top-[48px] left-1/2 -translate-x-1/2 rotate-90',
|
|
195
|
+
? '-ptx-left-[48px] ptx-top-1/2 -ptx-translate-y-1/2'
|
|
196
|
+
: '-ptx-top-[48px] ptx-left-1/2 -ptx-translate-x-1/2 ptx-rotate-90',
|
|
197
197
|
className
|
|
198
198
|
)}
|
|
199
199
|
disabled={!canScrollPrev}
|
|
200
200
|
onClick={scrollPrev}
|
|
201
201
|
{...props}
|
|
202
202
|
>
|
|
203
|
-
<ArrowLeft className="h-[16px] w-[16px]" />
|
|
204
|
-
<span className="sr-only">{label}</span>
|
|
203
|
+
<ArrowLeft className="ptx-h-[16px] ptx-w-[16px]" />
|
|
204
|
+
<span className="ptx-sr-only">{label}</span>
|
|
205
205
|
</Button>
|
|
206
206
|
);
|
|
207
207
|
}
|
|
@@ -224,18 +224,18 @@ const CarouselNext = React.forwardRef<
|
|
|
224
224
|
variant={variant}
|
|
225
225
|
size={size}
|
|
226
226
|
className={cn(
|
|
227
|
-
'absolute h-[32px] w-[32px] rounded-full',
|
|
227
|
+
'ptx-absolute ptx-h-[32px] ptx-w-[32px] ptx-rounded-full',
|
|
228
228
|
orientation === 'horizontal'
|
|
229
|
-
? '-right-[48px] top-1/2 -translate-y-1/2'
|
|
230
|
-
: '-bottom-[48px] left-1/2 -translate-x-1/2 rotate-90',
|
|
229
|
+
? '-ptx-right-[48px] ptx-top-1/2 -ptx-translate-y-1/2'
|
|
230
|
+
: '-ptx-bottom-[48px] ptx-left-1/2 -ptx-translate-x-1/2 ptx-rotate-90',
|
|
231
231
|
className
|
|
232
232
|
)}
|
|
233
233
|
disabled={!canScrollNext}
|
|
234
234
|
onClick={scrollNext}
|
|
235
235
|
{...props}
|
|
236
236
|
>
|
|
237
|
-
<ArrowRight className="h-[16px] w-[16px]" />
|
|
238
|
-
<span className="sr-only">{label}</span>
|
|
237
|
+
<ArrowRight className="ptx-h-[16px] ptx-w-[16px]" />
|
|
238
|
+
<span className="ptx-sr-only">{label}</span>
|
|
239
239
|
</Button>
|
|
240
240
|
);
|
|
241
241
|
}
|
|
@@ -47,7 +47,7 @@ const ChartContainer = React.forwardRef<
|
|
|
47
47
|
data-chart={chartId}
|
|
48
48
|
ref={ref}
|
|
49
49
|
className={cn(
|
|
50
|
-
"flex aspect-video justify-center text-
|
|
50
|
+
"ptx-flex ptx-aspect-video ptx-justify-center ptx-text-xs [&_.recharts-cartesian-axis-tick_text]:ptx-fill-muted-foreground [&_.recharts-cartesian-grid_line[stroke='#ccc']]:ptx-stroke-border [&_.recharts-curve.recharts-tooltip-cursor]:ptx-stroke-border [&_.recharts-dot[stroke='#fff']]:ptx-stroke-transparent [&_.recharts-layer]:ptx-outline-none [&_.recharts-polar-grid_[stroke='#ccc']]:ptx-stroke-border [&_.recharts-radial-bar-background-sector]:ptx-fill-muted [&_.recharts-rectangle.recharts-tooltip-cursor]:ptx-fill-muted [&_.recharts-reference-line_[stroke='#ccc']]:ptx-stroke-border [&_.recharts-sector[stroke='#fff']]:ptx-stroke-transparent [&_.recharts-sector]:ptx-outline-none [&_.recharts-surface]:ptx-outline-none",
|
|
51
51
|
className
|
|
52
52
|
)}
|
|
53
53
|
{...props}
|
|
@@ -137,7 +137,7 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
137
137
|
|
|
138
138
|
if (labelFormatter) {
|
|
139
139
|
return (
|
|
140
|
-
<div className={cn('font-medium', labelClassName)}>
|
|
140
|
+
<div className={cn('ptx-font-medium', labelClassName)}>
|
|
141
141
|
{labelFormatter(value, payload)}
|
|
142
142
|
</div>
|
|
143
143
|
);
|
|
@@ -147,7 +147,7 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
147
147
|
return null;
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
-
return <div className={cn('font-medium', labelClassName)}>{value}</div>;
|
|
150
|
+
return <div className={cn('ptx-font-medium', labelClassName)}>{value}</div>;
|
|
151
151
|
}, [label, labelFormatter, payload, hideLabel, labelClassName, config, labelKey]);
|
|
152
152
|
|
|
153
153
|
if (!active || !payload?.length) {
|
|
@@ -160,12 +160,12 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
160
160
|
<div
|
|
161
161
|
ref={ref}
|
|
162
162
|
className={cn(
|
|
163
|
-
'grid min-w-[8rem] items-start gap-[6px] rounded-[var(--pt-radius)] border bg-background px-[10px] py-[6px] text-
|
|
163
|
+
'ptx-grid ptx-min-w-[8rem] ptx-items-start ptx-gap-[6px] ptx-rounded-[var(--pt-radius)] ptx-border ptx-bg-background ptx-px-[10px] ptx-py-[6px] ptx-text-xs ptx-shadow-xl',
|
|
164
164
|
className
|
|
165
165
|
)}
|
|
166
166
|
>
|
|
167
167
|
{!nestLabel ? tooltipLabel : null}
|
|
168
|
-
<div className="grid gap-[6px]">
|
|
168
|
+
<div className="ptx-grid ptx-gap-[6px]">
|
|
169
169
|
{payload.map((item, index) => {
|
|
170
170
|
const key = `${nameKey || item.name || item.dataKey || 'value'}`;
|
|
171
171
|
const itemConfig = getPayloadConfigFromPayload(config, item, key);
|
|
@@ -175,8 +175,8 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
175
175
|
<div
|
|
176
176
|
key={item.dataKey}
|
|
177
177
|
className={cn(
|
|
178
|
-
'flex w-full flex-wrap items-stretch gap-[8px] [&>svg]:h-[10px] [&>svg]:w-[10px] [&>svg]:text-muted-foreground',
|
|
179
|
-
indicator === 'dot' && 'items-center'
|
|
178
|
+
'ptx-flex ptx-w-full ptx-flex-wrap ptx-items-stretch ptx-gap-[8px] [&>svg]:ptx-h-[10px] [&>svg]:ptx-w-[10px] [&>svg]:ptx-text-muted-foreground',
|
|
179
|
+
indicator === 'dot' && 'ptx-items-center'
|
|
180
180
|
)}
|
|
181
181
|
>
|
|
182
182
|
{formatter && item?.value !== undefined && item.name ? (
|
|
@@ -189,13 +189,13 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
189
189
|
!hideIndicator && (
|
|
190
190
|
<div
|
|
191
191
|
className={cn(
|
|
192
|
-
'shrink-0 rounded-[2px] border-[--color-border] bg-[--color-bg]',
|
|
192
|
+
'ptx-shrink-0 ptx-rounded-[2px] ptx-border-[--color-border] ptx-bg-[--color-bg]',
|
|
193
193
|
{
|
|
194
|
-
'h-[10px] w-[10px]': indicator === 'dot',
|
|
195
|
-
'w-[4px]': indicator === 'line',
|
|
196
|
-
'w-0 border-[1.5px] border-dashed bg-transparent':
|
|
194
|
+
'ptx-h-[10px] ptx-w-[10px]': indicator === 'dot',
|
|
195
|
+
'ptx-w-[4px]': indicator === 'line',
|
|
196
|
+
'ptx-w-0 ptx-border-[1.5px] ptx-border-dashed ptx-bg-transparent':
|
|
197
197
|
indicator === 'dashed',
|
|
198
|
-
'my-[2px]': nestLabel && indicator === 'dashed'
|
|
198
|
+
'ptx-my-[2px]': nestLabel && indicator === 'dashed'
|
|
199
199
|
}
|
|
200
200
|
)}
|
|
201
201
|
style={
|
|
@@ -209,18 +209,18 @@ const ChartTooltipContent = React.forwardRef<
|
|
|
209
209
|
)}
|
|
210
210
|
<div
|
|
211
211
|
className={cn(
|
|
212
|
-
'flex flex-1 justify-between leading-none',
|
|
213
|
-
nestLabel ? 'items-end' : 'items-center'
|
|
212
|
+
'ptx-flex ptx-flex-1 ptx-justify-between ptx-leading-none',
|
|
213
|
+
nestLabel ? 'ptx-items-end' : 'ptx-items-center'
|
|
214
214
|
)}
|
|
215
215
|
>
|
|
216
|
-
<div className="grid gap-[6px]">
|
|
216
|
+
<div className="ptx-grid ptx-gap-[6px]">
|
|
217
217
|
{nestLabel ? tooltipLabel : null}
|
|
218
|
-
<span className="text-muted-foreground">
|
|
218
|
+
<span className="ptx-text-muted-foreground">
|
|
219
219
|
{itemConfig?.label || item.name}
|
|
220
220
|
</span>
|
|
221
221
|
</div>
|
|
222
222
|
{item.value && (
|
|
223
|
-
<span className="font-mono font-medium tabular-nums text-foreground">
|
|
223
|
+
<span className="ptx-font-mono ptx-font-medium ptx-tabular-nums ptx-text-foreground">
|
|
224
224
|
{item.value.toLocaleString()}
|
|
225
225
|
</span>
|
|
226
226
|
)}
|
|
@@ -257,8 +257,8 @@ const ChartLegendContent = React.forwardRef<
|
|
|
257
257
|
<div
|
|
258
258
|
ref={ref}
|
|
259
259
|
className={cn(
|
|
260
|
-
'flex items-center justify-center gap-[16px]',
|
|
261
|
-
verticalAlign === 'top' ? 'pb-[12px]' : 'pt-[12px]',
|
|
260
|
+
'ptx-flex ptx-items-center ptx-justify-center ptx-gap-[16px]',
|
|
261
|
+
verticalAlign === 'top' ? 'ptx-pb-[12px]' : 'ptx-pt-[12px]',
|
|
262
262
|
className
|
|
263
263
|
)}
|
|
264
264
|
>
|
|
@@ -269,13 +269,13 @@ const ChartLegendContent = React.forwardRef<
|
|
|
269
269
|
return (
|
|
270
270
|
<div
|
|
271
271
|
key={item.value}
|
|
272
|
-
className="flex items-center gap-[6px] text-foreground [&>svg]:h-[12px] [&>svg]:w-[12px] [&>svg]:text-muted-foreground"
|
|
272
|
+
className="ptx-flex ptx-items-center ptx-gap-[6px] ptx-text-foreground [&>svg]:ptx-h-[12px] [&>svg]:ptx-w-[12px] [&>svg]:ptx-text-muted-foreground"
|
|
273
273
|
>
|
|
274
274
|
{itemConfig?.icon && !hideIcon ? (
|
|
275
275
|
<itemConfig.icon />
|
|
276
276
|
) : (
|
|
277
277
|
<div
|
|
278
|
-
className="h-[8px] w-[8px] shrink-0 rounded-[2px]"
|
|
278
|
+
className="ptx-h-[8px] ptx-w-[8px] ptx-shrink-0 ptx-rounded-[2px]"
|
|
279
279
|
style={{ backgroundColor: item.color }}
|
|
280
280
|
/>
|
|
281
281
|
)}
|
|
@@ -11,13 +11,13 @@ const Checkbox = React.forwardRef<
|
|
|
11
11
|
<CheckboxPrimitive.Root
|
|
12
12
|
ref={ref}
|
|
13
13
|
className={cn(
|
|
14
|
-
'peer h-[16px] w-[16px] shrink-0 rounded-[var(--pt-radius-sm)] border border-neutral transition-colors enabled:hover:border-strong data-[state=unchecked]:enabled:active:bg-press focus-visible: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 enabled:data-[state=checked]:bg-primary enabled:data-[state=checked]:text-primary-foreground',
|
|
14
|
+
'peer ptx-h-[16px] ptx-w-[16px] ptx-shrink-0 ptx-rounded-[var(--pt-radius-sm)] ptx-border ptx-border-neutral ptx-transition-colors enabled:hover:ptx-border-strong data-[state=unchecked]:enabled:active:ptx-bg-press focus-visible: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 enabled:data-[state=checked]:ptx-bg-primary enabled:data-[state=checked]:ptx-text-primary-foreground',
|
|
15
15
|
className
|
|
16
16
|
)}
|
|
17
17
|
{...props}
|
|
18
18
|
>
|
|
19
|
-
<CheckboxPrimitive.Indicator className={cn('flex items-center justify-center text-current')}>
|
|
20
|
-
<Check className="h-[16px] w-[16px]" />
|
|
19
|
+
<CheckboxPrimitive.Indicator className={cn('ptx-flex ptx-items-center ptx-justify-center ptx-text-current')}>
|
|
20
|
+
<Check className="ptx-h-[16px] ptx-w-[16px]" />
|
|
21
21
|
</CheckboxPrimitive.Indicator>
|
|
22
22
|
</CheckboxPrimitive.Root>
|
|
23
23
|
));
|
|
@@ -13,7 +13,7 @@ const Command = React.forwardRef<
|
|
|
13
13
|
<CommandPrimitive
|
|
14
14
|
ref={ref}
|
|
15
15
|
className={cn(
|
|
16
|
-
'flex h-full w-full flex-col overflow-hidden rounded-[var(--pt-radius-md)] bg-popover text-popover-foreground',
|
|
16
|
+
'ptx-flex ptx-h-full ptx-w-full ptx-flex-col ptx-overflow-hidden ptx-rounded-[var(--pt-radius-md)] ptx-bg-popover ptx-text-popover-foreground',
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|
|
@@ -24,8 +24,8 @@ Command.displayName = CommandPrimitive.displayName;
|
|
|
24
24
|
const CommandDialog = ({ children, ...props }: DialogProps) => {
|
|
25
25
|
return (
|
|
26
26
|
<Dialog {...props}>
|
|
27
|
-
<DialogContent className="overflow-hidden p-0">
|
|
28
|
-
<Command className="[&_[cmdk-group-heading]]:px-[8px] [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-[8px] [&_[cmdk-input-wrapper]_svg]:h-[20px] [&_[cmdk-input-wrapper]_svg]:w-[20px] [&_[cmdk-input]]:h-[48px] [&_[cmdk-item]]:px-[8px] [&_[cmdk-item]]:py-[12px] [&_[cmdk-item]_svg]:h-[20px] [&_[cmdk-item]_svg]:w-[20px]">
|
|
27
|
+
<DialogContent className="ptx-overflow-hidden ptx-p-0">
|
|
28
|
+
<Command className="[&_[cmdk-group-heading]]:ptx-px-[8px] [&_[cmdk-group-heading]]:ptx-font-medium [&_[cmdk-group-heading]]:ptx-text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:ptx-pt-0 [&_[cmdk-group]]:ptx-px-[8px] [&_[cmdk-input-wrapper]_svg]:ptx-h-[20px] [&_[cmdk-input-wrapper]_svg]:ptx-w-[20px] [&_[cmdk-input]]:ptx-h-[48px] [&_[cmdk-item]]:ptx-px-[8px] [&_[cmdk-item]]:ptx-py-[12px] [&_[cmdk-item]_svg]:ptx-h-[20px] [&_[cmdk-item]_svg]:ptx-w-[20px]">
|
|
29
29
|
{children}
|
|
30
30
|
</Command>
|
|
31
31
|
</DialogContent>
|
|
@@ -37,12 +37,12 @@ const CommandInput = React.forwardRef<
|
|
|
37
37
|
React.ElementRef<typeof CommandPrimitive.Input>,
|
|
38
38
|
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Input>
|
|
39
39
|
>(({ className, ...props }, ref) => (
|
|
40
|
-
<div className="flex items-center border-b px-[12px]" cmdk-input-wrapper="">
|
|
41
|
-
<Search className="mr-[8px] h-[16px] w-[16px] shrink-0 text-muted-foreground" />
|
|
40
|
+
<div className="ptx-flex ptx-items-center ptx-border-b ptx-px-[12px]" cmdk-input-wrapper="">
|
|
41
|
+
<Search className="ptx-mr-[8px] ptx-h-[16px] ptx-w-[16px] ptx-shrink-0 ptx-text-muted-foreground" />
|
|
42
42
|
<CommandPrimitive.Input
|
|
43
43
|
ref={ref}
|
|
44
44
|
className={cn(
|
|
45
|
-
'flex h-[40px] w-full rounded-[var(--pt-radius-md)] bg-transparent py-[12px] text-
|
|
45
|
+
'ptx-flex ptx-h-[40px] ptx-w-full ptx-rounded-[var(--pt-radius-md)] ptx-bg-transparent ptx-py-[12px] ptx-text-sm ptx-text-foreground ptx-outline-none placeholder:ptx-text-muted-foreground disabled:ptx-cursor-not-allowed disabled:ptx-opacity-50',
|
|
46
46
|
className
|
|
47
47
|
)}
|
|
48
48
|
{...props}
|
|
@@ -57,7 +57,7 @@ const CommandList = React.forwardRef<
|
|
|
57
57
|
>(({ className, ...props }, ref) => (
|
|
58
58
|
<CommandPrimitive.List
|
|
59
59
|
ref={ref}
|
|
60
|
-
className={cn('max-h-[300px] overflow-y-auto overflow-x-hidden', className)}
|
|
60
|
+
className={cn('ptx-max-h-[300px] ptx-overflow-y-auto ptx-overflow-x-hidden', className)}
|
|
61
61
|
{...props}
|
|
62
62
|
/>
|
|
63
63
|
));
|
|
@@ -67,7 +67,7 @@ const CommandEmpty = React.forwardRef<
|
|
|
67
67
|
React.ElementRef<typeof CommandPrimitive.Empty>,
|
|
68
68
|
React.ComponentPropsWithoutRef<typeof CommandPrimitive.Empty>
|
|
69
69
|
>((props, ref) => (
|
|
70
|
-
<CommandPrimitive.Empty ref={ref} className="py-[24px] text-center text-
|
|
70
|
+
<CommandPrimitive.Empty ref={ref} className="ptx-py-[24px] ptx-text-center ptx-text-xs" {...props} />
|
|
71
71
|
));
|
|
72
72
|
CommandEmpty.displayName = CommandPrimitive.Empty.displayName;
|
|
73
73
|
|
|
@@ -78,7 +78,7 @@ const CommandGroup = React.forwardRef<
|
|
|
78
78
|
<CommandPrimitive.Group
|
|
79
79
|
ref={ref}
|
|
80
80
|
className={cn(
|
|
81
|
-
'overflow-hidden p-[4px] text-foreground [&_[cmdk-group-heading]]:px-[8px] [&_[cmdk-group-heading]]:py-[6px] [&_[cmdk-group-heading]]:text-
|
|
81
|
+
'ptx-overflow-hidden ptx-p-[4px] ptx-text-foreground [&_[cmdk-group-heading]]:ptx-px-[8px] [&_[cmdk-group-heading]]:ptx-py-[6px] [&_[cmdk-group-heading]]:ptx-text-xs [&_[cmdk-group-heading]]:ptx-font-medium [&_[cmdk-group-heading]]:ptx-text-muted-foreground',
|
|
82
82
|
className
|
|
83
83
|
)}
|
|
84
84
|
{...props}
|
|
@@ -92,7 +92,7 @@ const CommandSeparator = React.forwardRef<
|
|
|
92
92
|
>(({ className, ...props }, ref) => (
|
|
93
93
|
<CommandPrimitive.Separator
|
|
94
94
|
ref={ref}
|
|
95
|
-
className={cn('-mx-[4px] h-px bg-border', className)}
|
|
95
|
+
className={cn('-ptx-mx-[4px] ptx-h-px ptx-bg-border', className)}
|
|
96
96
|
{...props}
|
|
97
97
|
/>
|
|
98
98
|
));
|
|
@@ -105,7 +105,7 @@ const CommandItem = React.forwardRef<
|
|
|
105
105
|
<CommandPrimitive.Item
|
|
106
106
|
ref={ref}
|
|
107
107
|
className={cn(
|
|
108
|
-
'relative flex cursor-default select-none items-center gap-[8px] rounded-[var(--pt-radius-sm)] px-[8px] py-[6px] text-
|
|
108
|
+
'ptx-relative ptx-flex ptx-cursor-default ptx-select-none ptx-items-center ptx-gap-[8px] ptx-rounded-[var(--pt-radius-sm)] ptx-px-[8px] ptx-py-[6px] ptx-text-sm ptx-outline-none data-[disabled=true]:ptx-pointer-events-none data-[selected=true]:ptx-bg-accent data-[selected=true]:ptx-text-accent-foreground data-[disabled=true]:ptx-opacity-50 [&_svg]:ptx-pointer-events-none [&_svg]:ptx-size-[16px] [&_svg]:ptx-shrink-0',
|
|
109
109
|
className
|
|
110
110
|
)}
|
|
111
111
|
{...props}
|
|
@@ -116,7 +116,7 @@ CommandItem.displayName = CommandPrimitive.Item.displayName;
|
|
|
116
116
|
const CommandShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
117
117
|
return (
|
|
118
118
|
<span
|
|
119
|
-
className={cn('ml-auto text-
|
|
119
|
+
className={cn('ptx-ml-auto ptx-text-xs ptx-tracking-widest ptx-text-muted-foreground', className)}
|
|
120
120
|
{...props}
|
|
121
121
|
/>
|
|
122
122
|
);
|
|
@@ -25,14 +25,14 @@ const ContextMenuSubTrigger = React.forwardRef<
|
|
|
25
25
|
<ContextMenuPrimitive.SubTrigger
|
|
26
26
|
ref={ref}
|
|
27
27
|
className={cn(
|
|
28
|
-
'flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] px-[8px] py-[6px] text-
|
|
29
|
-
inset && 'pl-[32px]',
|
|
28
|
+
'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',
|
|
29
|
+
inset && 'ptx-pl-[32px]',
|
|
30
30
|
className
|
|
31
31
|
)}
|
|
32
32
|
{...props}
|
|
33
33
|
>
|
|
34
34
|
{children}
|
|
35
|
-
<ChevronRight className="ml-auto h-[16px] w-[16px]" />
|
|
35
|
+
<ChevronRight className="ptx-ml-auto ptx-h-[16px] ptx-w-[16px]" />
|
|
36
36
|
</ContextMenuPrimitive.SubTrigger>
|
|
37
37
|
));
|
|
38
38
|
ContextMenuSubTrigger.displayName = ContextMenuPrimitive.SubTrigger.displayName;
|
|
@@ -44,7 +44,7 @@ const ContextMenuSubContent = React.forwardRef<
|
|
|
44
44
|
<ContextMenuPrimitive.SubContent
|
|
45
45
|
ref={ref}
|
|
46
46
|
className={cn(
|
|
47
|
-
'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',
|
|
47
|
+
'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',
|
|
48
48
|
className
|
|
49
49
|
)}
|
|
50
50
|
{...props}
|
|
@@ -60,7 +60,7 @@ const ContextMenuContent = React.forwardRef<
|
|
|
60
60
|
<ContextMenuPrimitive.Content
|
|
61
61
|
ref={ref}
|
|
62
62
|
className={cn(
|
|
63
|
-
'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-md 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',
|
|
63
|
+
'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-md 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',
|
|
64
64
|
className
|
|
65
65
|
)}
|
|
66
66
|
{...props}
|
|
@@ -78,8 +78,8 @@ const ContextMenuItem = React.forwardRef<
|
|
|
78
78
|
<ContextMenuPrimitive.Item
|
|
79
79
|
ref={ref}
|
|
80
80
|
className={cn(
|
|
81
|
-
'relative flex cursor-default select-none items-center gap-[8px] rounded-[var(--pt-radius-sm)] px-[8px] py-[6px] text-
|
|
82
|
-
inset && 'pl-[32px]',
|
|
81
|
+
'ptx-relative ptx-flex ptx-cursor-default ptx-select-none ptx-items-center ptx-gap-[8px] ptx-rounded-[var(--pt-radius-sm)] ptx-px-[8px] ptx-py-[6px] ptx-text-sm ptx-outline-none ptx-transition-colors focus:ptx-bg-accent focus:ptx-text-accent-foreground data-[disabled]:ptx-pointer-events-none data-[disabled]:ptx-opacity-50 [&>svg]:ptx-size-[16px] [&>svg]:ptx-shrink-0',
|
|
82
|
+
inset && 'ptx-pl-[32px]',
|
|
83
83
|
className
|
|
84
84
|
)}
|
|
85
85
|
{...props}
|
|
@@ -94,15 +94,15 @@ const ContextMenuCheckboxItem = React.forwardRef<
|
|
|
94
94
|
<ContextMenuPrimitive.CheckboxItem
|
|
95
95
|
ref={ref}
|
|
96
96
|
className={cn(
|
|
97
|
-
'relative flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[32px] pr-[8px] text-
|
|
97
|
+
'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 ptx-transition-colors focus:ptx-bg-accent focus:ptx-text-accent-foreground data-[disabled]:ptx-pointer-events-none data-[disabled]:ptx-opacity-50',
|
|
98
98
|
className
|
|
99
99
|
)}
|
|
100
100
|
checked={checked}
|
|
101
101
|
{...props}
|
|
102
102
|
>
|
|
103
|
-
<span className="absolute left-[8px] flex h-[14px] w-[14px] items-center justify-center">
|
|
103
|
+
<span className="ptx-absolute ptx-left-[8px] ptx-flex ptx-h-[14px] ptx-w-[14px] ptx-items-center ptx-justify-center">
|
|
104
104
|
<ContextMenuPrimitive.ItemIndicator>
|
|
105
|
-
<Check className="h-[16px] w-[16px]" />
|
|
105
|
+
<Check className="ptx-h-[16px] ptx-w-[16px]" />
|
|
106
106
|
</ContextMenuPrimitive.ItemIndicator>
|
|
107
107
|
</span>
|
|
108
108
|
{children}
|
|
@@ -117,14 +117,14 @@ const ContextMenuRadioItem = React.forwardRef<
|
|
|
117
117
|
<ContextMenuPrimitive.RadioItem
|
|
118
118
|
ref={ref}
|
|
119
119
|
className={cn(
|
|
120
|
-
'relative flex cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[32px] pr-[8px] text-
|
|
120
|
+
'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 ptx-transition-colors focus:ptx-bg-accent focus:ptx-text-accent-foreground data-[disabled]:ptx-pointer-events-none data-[disabled]:ptx-opacity-50',
|
|
121
121
|
className
|
|
122
122
|
)}
|
|
123
123
|
{...props}
|
|
124
124
|
>
|
|
125
|
-
<span className="absolute left-[8px] flex h-[14px] w-[14px] items-center justify-center">
|
|
125
|
+
<span className="ptx-absolute ptx-left-[8px] ptx-flex ptx-h-[14px] ptx-w-[14px] ptx-items-center ptx-justify-center">
|
|
126
126
|
<ContextMenuPrimitive.ItemIndicator>
|
|
127
|
-
<Circle className="h-[8px] w-[8px] fill-current" />
|
|
127
|
+
<Circle className="ptx-h-[8px] ptx-w-[8px] ptx-fill-current" />
|
|
128
128
|
</ContextMenuPrimitive.ItemIndicator>
|
|
129
129
|
</span>
|
|
130
130
|
{children}
|
|
@@ -140,7 +140,7 @@ const ContextMenuLabel = React.forwardRef<
|
|
|
140
140
|
>(({ className, inset, ...props }, ref) => (
|
|
141
141
|
<ContextMenuPrimitive.Label
|
|
142
142
|
ref={ref}
|
|
143
|
-
className={cn('px-[8px] py-[6px] text-
|
|
143
|
+
className={cn('ptx-px-[8px] ptx-py-[6px] ptx-text-sm ptx-font-semibold ptx-text-foreground', inset && 'ptx-pl-[32px]', className)}
|
|
144
144
|
{...props}
|
|
145
145
|
/>
|
|
146
146
|
));
|
|
@@ -152,7 +152,7 @@ const ContextMenuSeparator = React.forwardRef<
|
|
|
152
152
|
>(({ className, ...props }, ref) => (
|
|
153
153
|
<ContextMenuPrimitive.Separator
|
|
154
154
|
ref={ref}
|
|
155
|
-
className={cn('-mx-[4px] my-[4px] h-px bg-border', className)}
|
|
155
|
+
className={cn('-ptx-mx-[4px] ptx-my-[4px] ptx-h-px ptx-bg-border', className)}
|
|
156
156
|
{...props}
|
|
157
157
|
/>
|
|
158
158
|
));
|
|
@@ -161,7 +161,7 @@ ContextMenuSeparator.displayName = ContextMenuPrimitive.Separator.displayName;
|
|
|
161
161
|
const ContextMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
162
162
|
return (
|
|
163
163
|
<span
|
|
164
|
-
className={cn('ml-auto text-
|
|
164
|
+
className={cn('ptx-ml-auto ptx-text-xs ptx-tracking-widest ptx-text-muted-foreground', className)}
|
|
165
165
|
{...props}
|
|
166
166
|
/>
|
|
167
167
|
);
|
|
@@ -19,8 +19,10 @@ const DialogOverlay = React.forwardRef<
|
|
|
19
19
|
>(({ className, ...props }, ref) => (
|
|
20
20
|
<DialogPrimitive.Overlay
|
|
21
21
|
ref={ref}
|
|
22
|
+
/* 稳定钩子,供消费方测试查询遮罩层;勿改名。 */
|
|
23
|
+
data-slot="dialog-overlay"
|
|
22
24
|
className={cn(
|
|
23
|
-
'fixed inset-0 z-[var(--pt-z-overlay,50)] bg-[rgb(var(--pt-black)/0.45)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
25
|
+
'ptx-fixed ptx-inset-0 ptx-z-[var(--pt-z-overlay,50)] ptx-bg-[rgb(var(--pt-black)/0.45)] 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',
|
|
24
26
|
className
|
|
25
27
|
)}
|
|
26
28
|
{...props}
|
|
@@ -32,9 +34,9 @@ DialogOverlay.displayName = DialogPrimitive.Overlay.displayName;
|
|
|
32
34
|
type DialogSize = 'sm' | 'md' | 'lg';
|
|
33
35
|
|
|
34
36
|
const dialogSizeClasses: Record<DialogSize, string> = {
|
|
35
|
-
sm: 'max-w-[480px]',
|
|
36
|
-
md: 'max-w-[640px]',
|
|
37
|
-
lg: 'max-w-[960px]'
|
|
37
|
+
sm: 'ptx-max-w-[480px]',
|
|
38
|
+
md: 'ptx-max-w-[640px]',
|
|
39
|
+
lg: 'ptx-max-w-[960px]'
|
|
38
40
|
};
|
|
39
41
|
|
|
40
42
|
/* closeLabel:关闭钮读屏文案,库不做 i18n,消费方传译文(默认英文) */
|
|
@@ -52,7 +54,7 @@ const DialogContent = React.forwardRef<
|
|
|
52
54
|
className={cn(
|
|
53
55
|
// outline-none:打开时焦点落在本容器(onOpenAutoFocus),浏览器在"键盘型"
|
|
54
56
|
// 触发下会给焦点元素画默认蓝框 —— 容器是模态本体,遮罩+弹窗已是焦点指示,抑制之
|
|
55
|
-
'fixed left-[50%] top-[50%] z-[var(--pt-z-overlay,50)] grid w-full translate-x-[-50%] translate-y-[-50%] gap-[16px] border bg-background p-[24px] shadow-lg outline-none duration-200 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-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-[var(--pt-radius)]',
|
|
57
|
+
'ptx-fixed ptx-left-[50%] ptx-top-[50%] ptx-z-[var(--pt-z-overlay,50)] ptx-grid ptx-w-full ptx-translate-x-[-50%] ptx-translate-y-[-50%] ptx-gap-[16px] ptx-border ptx-bg-background ptx-p-[24px] ptx-shadow-lg ptx-outline-none ptx-duration-200 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-[state=closed]:ptx-slide-out-to-left-1/2 data-[state=closed]:ptx-slide-out-to-top-[48%] data-[state=open]:ptx-slide-in-from-left-1/2 data-[state=open]:ptx-slide-in-from-top-[48%] sm:ptx-rounded-[var(--pt-radius)]',
|
|
56
58
|
dialogSizeClasses[size],
|
|
57
59
|
className
|
|
58
60
|
)}
|
|
@@ -73,7 +75,7 @@ const DialogContent = React.forwardRef<
|
|
|
73
75
|
<Button
|
|
74
76
|
variant="ghost"
|
|
75
77
|
size="icon-sm"
|
|
76
|
-
className="!absolute right-[16px] top-[16px]"
|
|
78
|
+
className="!ptx-absolute ptx-right-[16px] ptx-top-[16px]"
|
|
77
79
|
aria-label={closeLabel}
|
|
78
80
|
>
|
|
79
81
|
<X />
|
|
@@ -85,13 +87,13 @@ const DialogContent = React.forwardRef<
|
|
|
85
87
|
DialogContent.displayName = DialogPrimitive.Content.displayName;
|
|
86
88
|
|
|
87
89
|
const DialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
88
|
-
<div className={cn('flex flex-col space-y-[6px] text-center sm:text-left', className)} {...props} />
|
|
90
|
+
<div className={cn('ptx-flex ptx-flex-col ptx-space-y-[6px] ptx-text-center sm:ptx-text-left', className)} {...props} />
|
|
89
91
|
);
|
|
90
92
|
DialogHeader.displayName = 'DialogHeader';
|
|
91
93
|
|
|
92
94
|
const DialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
93
95
|
<div
|
|
94
|
-
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-[8px]', className)}
|
|
96
|
+
className={cn('ptx-flex ptx-flex-col-reverse sm:ptx-flex-row sm:ptx-justify-end sm:ptx-space-x-[8px]', className)}
|
|
95
97
|
{...props}
|
|
96
98
|
/>
|
|
97
99
|
);
|
|
@@ -104,7 +106,7 @@ const DialogTitle = React.forwardRef<
|
|
|
104
106
|
<DialogPrimitive.Title
|
|
105
107
|
ref={ref}
|
|
106
108
|
className={cn(
|
|
107
|
-
'text-
|
|
109
|
+
'ptx-text-lg ptx-font-semibold ptx-leading-none ptx-tracking-tight ptx-text-[rgb(var(--pt-text-strong))]',
|
|
108
110
|
className
|
|
109
111
|
)}
|
|
110
112
|
{...props}
|
|
@@ -118,7 +120,7 @@ const DialogDescription = React.forwardRef<
|
|
|
118
120
|
>(({ className, ...props }, ref) => (
|
|
119
121
|
<DialogPrimitive.Description
|
|
120
122
|
ref={ref}
|
|
121
|
-
className={cn('text-
|
|
123
|
+
className={cn('ptx-text-sm ptx-text-[rgb(var(--pt-text-standard))]', className)}
|
|
122
124
|
{...props}
|
|
123
125
|
/>
|
|
124
126
|
));
|
|
@@ -23,7 +23,9 @@ const DrawerOverlay = React.forwardRef<
|
|
|
23
23
|
>(({ className, ...props }, ref) => (
|
|
24
24
|
<DrawerPrimitive.Overlay
|
|
25
25
|
ref={ref}
|
|
26
|
-
|
|
26
|
+
/* 稳定钩子,供消费方测试查询遮罩层;勿改名。 */
|
|
27
|
+
data-slot="drawer-overlay"
|
|
28
|
+
className={cn('ptx-fixed ptx-inset-0 ptx-z-[var(--pt-z-overlay,50)] ptx-bg-[rgb(var(--pt-black)/0.8)]', className)}
|
|
27
29
|
{...props}
|
|
28
30
|
/>
|
|
29
31
|
));
|
|
@@ -38,12 +40,12 @@ const DrawerContent = React.forwardRef<
|
|
|
38
40
|
<DrawerPrimitive.Content
|
|
39
41
|
ref={ref}
|
|
40
42
|
className={cn(
|
|
41
|
-
'fixed inset-x-0 bottom-0 z-[var(--pt-z-overlay,50)] mt-[96px] flex h-auto flex-col rounded-t-[10px] border bg-background',
|
|
43
|
+
'ptx-fixed ptx-inset-x-0 ptx-bottom-0 ptx-z-[var(--pt-z-overlay,50)] ptx-mt-[96px] ptx-flex ptx-h-auto ptx-flex-col ptx-rounded-t-[10px] ptx-border ptx-bg-background',
|
|
42
44
|
className
|
|
43
45
|
)}
|
|
44
46
|
{...props}
|
|
45
47
|
>
|
|
46
|
-
<div className="mx-auto mt-[16px] h-[8px] w-[100px] rounded-full bg-muted" />
|
|
48
|
+
<div className="ptx-mx-auto ptx-mt-[16px] ptx-h-[8px] ptx-w-[100px] ptx-rounded-full ptx-bg-muted" />
|
|
47
49
|
{children}
|
|
48
50
|
</DrawerPrimitive.Content>
|
|
49
51
|
</DrawerPortal>
|
|
@@ -51,12 +53,12 @@ const DrawerContent = React.forwardRef<
|
|
|
51
53
|
DrawerContent.displayName = 'DrawerContent';
|
|
52
54
|
|
|
53
55
|
const DrawerHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
54
|
-
<div className={cn('grid gap-[6px] p-[16px] text-center sm:text-left', className)} {...props} />
|
|
56
|
+
<div className={cn('ptx-grid ptx-gap-[6px] ptx-p-[16px] ptx-text-center sm:ptx-text-left', className)} {...props} />
|
|
55
57
|
);
|
|
56
58
|
DrawerHeader.displayName = 'DrawerHeader';
|
|
57
59
|
|
|
58
60
|
const DrawerFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
59
|
-
<div className={cn('mt-auto flex flex-col gap-[8px] p-[16px]', className)} {...props} />
|
|
61
|
+
<div className={cn('ptx-mt-auto ptx-flex ptx-flex-col ptx-gap-[8px] ptx-p-[16px]', className)} {...props} />
|
|
60
62
|
);
|
|
61
63
|
DrawerFooter.displayName = 'DrawerFooter';
|
|
62
64
|
|
|
@@ -66,7 +68,7 @@ const DrawerTitle = React.forwardRef<
|
|
|
66
68
|
>(({ className, ...props }, ref) => (
|
|
67
69
|
<DrawerPrimitive.Title
|
|
68
70
|
ref={ref}
|
|
69
|
-
className={cn('text-
|
|
71
|
+
className={cn('ptx-text-lg ptx-font-semibold ptx-leading-none ptx-tracking-tight ptx-text-foreground', className)}
|
|
70
72
|
{...props}
|
|
71
73
|
/>
|
|
72
74
|
));
|
|
@@ -78,7 +80,7 @@ const DrawerDescription = React.forwardRef<
|
|
|
78
80
|
>(({ className, ...props }, ref) => (
|
|
79
81
|
<DrawerPrimitive.Description
|
|
80
82
|
ref={ref}
|
|
81
|
-
className={cn('text-
|
|
83
|
+
className={cn('ptx-text-sm ptx-text-muted-foreground', className)}
|
|
82
84
|
{...props}
|
|
83
85
|
/>
|
|
84
86
|
));
|