@ptengine/design-components 0.6.0 → 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 +14 -2
- package/README.md +32 -13
- 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/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 -2
- package/dist/index.js +472 -467
- package/dist/style.css +398 -0
- package/package.json +8 -4
- 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 +25 -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
|
@@ -16,8 +16,10 @@ const AlertDialogOverlay = React.forwardRef<
|
|
|
16
16
|
>(({ className, ...props }, ref) => (
|
|
17
17
|
<AlertDialogPrimitive.Overlay
|
|
18
18
|
ref={ref}
|
|
19
|
+
/* 稳定钩子,供消费方测试查询遮罩层;勿改名。 */
|
|
20
|
+
data-slot="alert-dialog-overlay"
|
|
19
21
|
className={cn(
|
|
20
|
-
'fixed inset-0 z-[var(--pt-z-overlay,50)] bg-[rgb(var(--pt-black)/0.8)] data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0',
|
|
22
|
+
'ptx-fixed ptx-inset-0 ptx-z-[var(--pt-z-overlay,50)] ptx-bg-[rgb(var(--pt-black)/0.8)] 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',
|
|
21
23
|
className
|
|
22
24
|
)}
|
|
23
25
|
{...props}
|
|
@@ -34,7 +36,7 @@ const AlertDialogContent = React.forwardRef<
|
|
|
34
36
|
<AlertDialogPrimitive.Content
|
|
35
37
|
ref={ref}
|
|
36
38
|
className={cn(
|
|
37
|
-
'fixed left-[50%] top-[50%] z-[var(--pt-z-overlay,50)] grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-[16px] border bg-background p-[24px] shadow-lg 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)]',
|
|
39
|
+
'ptx-fixed ptx-left-[50%] ptx-top-[50%] ptx-z-[var(--pt-z-overlay,50)] ptx-grid ptx-w-full ptx-max-w-lg ptx-translate-x-[-50%] ptx-translate-y-[-50%] ptx-gap-[16px] ptx-border ptx-bg-background ptx-p-[24px] ptx-shadow-lg 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)]',
|
|
38
40
|
className
|
|
39
41
|
)}
|
|
40
42
|
{...props}
|
|
@@ -44,13 +46,13 @@ const AlertDialogContent = React.forwardRef<
|
|
|
44
46
|
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
45
47
|
|
|
46
48
|
const AlertDialogHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
47
|
-
<div className={cn('flex flex-col space-y-[8px] text-center sm:text-left', className)} {...props} />
|
|
49
|
+
<div className={cn('ptx-flex ptx-flex-col ptx-space-y-[8px] ptx-text-center sm:ptx-text-left', className)} {...props} />
|
|
48
50
|
);
|
|
49
51
|
AlertDialogHeader.displayName = 'AlertDialogHeader';
|
|
50
52
|
|
|
51
53
|
const AlertDialogFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
52
54
|
<div
|
|
53
|
-
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-[8px]', className)}
|
|
55
|
+
className={cn('ptx-flex ptx-flex-col-reverse sm:ptx-flex-row sm:ptx-justify-end sm:ptx-space-x-[8px]', className)}
|
|
54
56
|
{...props}
|
|
55
57
|
/>
|
|
56
58
|
);
|
|
@@ -62,7 +64,7 @@ const AlertDialogTitle = React.forwardRef<
|
|
|
62
64
|
>(({ className, ...props }, ref) => (
|
|
63
65
|
<AlertDialogPrimitive.Title
|
|
64
66
|
ref={ref}
|
|
65
|
-
className={cn('text-lg font-semibold text-foreground', className)}
|
|
67
|
+
className={cn('ptx-text-lg ptx-font-semibold ptx-text-foreground', className)}
|
|
66
68
|
{...props}
|
|
67
69
|
/>
|
|
68
70
|
));
|
|
@@ -74,7 +76,7 @@ const AlertDialogDescription = React.forwardRef<
|
|
|
74
76
|
>(({ className, ...props }, ref) => (
|
|
75
77
|
<AlertDialogPrimitive.Description
|
|
76
78
|
ref={ref}
|
|
77
|
-
className={cn('text-sm text-muted-foreground', className)}
|
|
79
|
+
className={cn('ptx-text-sm ptx-text-muted-foreground', className)}
|
|
78
80
|
{...props}
|
|
79
81
|
/>
|
|
80
82
|
));
|
|
@@ -94,7 +96,7 @@ const AlertDialogCancel = React.forwardRef<
|
|
|
94
96
|
>(({ className, ...props }, ref) => (
|
|
95
97
|
<AlertDialogPrimitive.Cancel
|
|
96
98
|
ref={ref}
|
|
97
|
-
className={cn(buttonVariants({ variant: 'secondary' }), 'mt-[8px] sm:mt-0', className)}
|
|
99
|
+
className={cn(buttonVariants({ variant: 'secondary' }), 'ptx-mt-[8px] sm:ptx-mt-0', className)}
|
|
98
100
|
{...props}
|
|
99
101
|
/>
|
|
100
102
|
));
|
|
@@ -4,12 +4,12 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
5
|
|
|
6
6
|
const alertVariants = cva(
|
|
7
|
-
'relative w-full rounded-[var(--pt-radius)] border px-[16px] py-[12px] text-sm [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-[16px] [&>svg]:top-[16px] [&>svg]:size-[16px] [&>svg~*]:pl-[28px]',
|
|
7
|
+
'ptx-relative ptx-w-full ptx-rounded-[var(--pt-radius)] ptx-border ptx-px-[16px] ptx-py-[12px] ptx-text-sm [&>svg+div]:ptx-translate-y-[-3px] [&>svg]:ptx-absolute [&>svg]:ptx-left-[16px] [&>svg]:ptx-top-[16px] [&>svg]:ptx-size-[16px] [&>svg~*]:ptx-pl-[28px]',
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
|
-
default: 'bg-background text-foreground [&>svg]:text-foreground',
|
|
12
|
-
destructive: 'border-destructive/50 text-destructive [&>svg]:text-destructive'
|
|
11
|
+
default: 'ptx-bg-background ptx-text-foreground [&>svg]:ptx-text-foreground',
|
|
12
|
+
destructive: 'ptx-border-destructive/50 ptx-text-destructive [&>svg]:ptx-text-destructive'
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
defaultVariants: {
|
|
@@ -30,7 +30,7 @@ const AlertTitle = React.forwardRef<HTMLHeadingElement, React.HTMLAttributes<HTM
|
|
|
30
30
|
({ className, ...props }, ref) => (
|
|
31
31
|
<h5
|
|
32
32
|
ref={ref}
|
|
33
|
-
className={cn('mb-[4px] font-medium leading-none tracking-tight', className)}
|
|
33
|
+
className={cn('ptx-mb-[4px] ptx-font-medium ptx-leading-none ptx-tracking-tight', className)}
|
|
34
34
|
{...props}
|
|
35
35
|
/>
|
|
36
36
|
)
|
|
@@ -41,7 +41,7 @@ const AlertDescription = React.forwardRef<
|
|
|
41
41
|
HTMLParagraphElement,
|
|
42
42
|
React.HTMLAttributes<HTMLParagraphElement>
|
|
43
43
|
>(({ className, ...props }, ref) => (
|
|
44
|
-
<div ref={ref} className={cn('text-sm [&_p]:leading-relaxed', className)} {...props} />
|
|
44
|
+
<div ref={ref} className={cn('ptx-text-sm [&_p]:ptx-leading-relaxed', className)} {...props} />
|
|
45
45
|
));
|
|
46
46
|
AlertDescription.displayName = 'AlertDescription';
|
|
47
47
|
|
|
@@ -6,18 +6,18 @@ import { cn } from '../../lib/utils';
|
|
|
6
6
|
import { Button } from './button';
|
|
7
7
|
|
|
8
8
|
const attachmentVariants = cva(
|
|
9
|
-
'group/attachment relative isolate flex w-fit max-w-full min-w-0 shrink-0 flex-wrap rounded-[var(--pt-radius)] border bg-card text-card-foreground transition-colors focus-within:ring-1 focus-within:ring-ring data-[state=error]:border-destructive/30 data-[state=idle]:border-dashed after:pointer-events-none after:absolute after:inset-0 after:rounded-[inherit] after:bg-[rgb(var(--pt-interaction-hover))] after:opacity-0 after:transition-opacity has-[>a,>button]:hover:after:opacity-100 has-[>a,>button]:active:after:bg-[rgb(var(--pt-interaction-press))] has-[>a,>button]:active:after:opacity-100',
|
|
9
|
+
'group/attachment ptx-relative ptx-isolate ptx-flex ptx-w-fit ptx-max-w-full ptx-min-w-0 ptx-shrink-0 ptx-flex-wrap ptx-rounded-[var(--pt-radius)] ptx-border ptx-bg-card ptx-text-card-foreground ptx-transition-colors focus-within:ptx-ring-1 focus-within:ptx-ring-ring data-[state=error]:ptx-border-destructive/30 data-[state=idle]:ptx-border-dashed after:ptx-pointer-events-none after:ptx-absolute after:ptx-inset-0 after:ptx-rounded-[inherit] after:ptx-bg-[rgb(var(--pt-interaction-hover))] after:ptx-opacity-0 after:ptx-transition-opacity has-[>a,>button]:hover:after:ptx-opacity-100 has-[>a,>button]:active:after:ptx-bg-[rgb(var(--pt-interaction-press))] has-[>a,>button]:active:after:ptx-opacity-100',
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
size: {
|
|
13
13
|
default:
|
|
14
|
-
'gap-[8px] text-sm has-[[data-slot=attachment-content]]:px-[10px] has-[[data-slot=attachment-content]]:py-[8px] has-[[data-slot=attachment-media]]:p-[8px]',
|
|
15
|
-
sm: 'gap-[10px] text-xs has-[[data-slot=attachment-content]]:px-[8px] has-[[data-slot=attachment-content]]:py-[6px] has-[[data-slot=attachment-media]]:p-[6px]',
|
|
16
|
-
xs: 'gap-[6px] rounded-[var(--pt-radius-md)] text-xs has-[[data-slot=attachment-content]]:px-[6px] has-[[data-slot=attachment-content]]:py-[4px] has-[[data-slot=attachment-media]]:p-[4px]'
|
|
14
|
+
'ptx-gap-[8px] ptx-text-sm has-[[data-slot=attachment-content]]:ptx-px-[10px] has-[[data-slot=attachment-content]]:ptx-py-[8px] has-[[data-slot=attachment-media]]:ptx-p-[8px]',
|
|
15
|
+
sm: 'ptx-gap-[10px] ptx-text-xs has-[[data-slot=attachment-content]]:ptx-px-[8px] has-[[data-slot=attachment-content]]:ptx-py-[6px] has-[[data-slot=attachment-media]]:ptx-p-[6px]',
|
|
16
|
+
xs: 'ptx-gap-[6px] ptx-rounded-[var(--pt-radius-md)] ptx-text-xs has-[[data-slot=attachment-content]]:ptx-px-[6px] has-[[data-slot=attachment-content]]:ptx-py-[4px] has-[[data-slot=attachment-media]]:ptx-p-[4px]'
|
|
17
17
|
},
|
|
18
18
|
orientation: {
|
|
19
|
-
horizontal: 'min-w-[160px] items-center',
|
|
20
|
-
vertical: 'w-[96px] flex-col has-[[data-slot=attachment-content]]:w-[7.5rem]'
|
|
19
|
+
horizontal: 'ptx-min-w-[160px] ptx-items-center',
|
|
20
|
+
vertical: 'ptx-w-[96px] ptx-flex-col has-[[data-slot=attachment-content]]:ptx-w-[7.5rem]'
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
@@ -46,12 +46,12 @@ function Attachment({
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
const attachmentMediaVariants = cva(
|
|
49
|
-
"relative flex aspect-square w-[40px] shrink-0 items-center justify-center overflow-hidden rounded-[var(--pt-radius-md)] bg-muted text-foreground group-data-[orientation=vertical]/attachment:w-full group-data-[size=sm]/attachment:w-[32px] group-data-[size=xs]/attachment:w-[28px] group-data-[size=xs]/attachment:rounded-[var(--pt-radius-sm)] group-data-[state=error]/attachment:bg-destructive/10 group-data-[state=error]/attachment:text-destructive group-data-[orientation=vertical]/attachment:[&>[data-slot=spinner]]:!size-[24px] [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-[16px] group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:size-[24px] group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:size-[14px]",
|
|
49
|
+
"ptx-relative ptx-flex ptx-aspect-square ptx-w-[40px] ptx-shrink-0 ptx-items-center ptx-justify-center ptx-overflow-hidden ptx-rounded-[var(--pt-radius-md)] ptx-bg-muted ptx-text-foreground group-data-[orientation=vertical]/attachment:ptx-w-full group-data-[size=sm]/attachment:ptx-w-[32px] group-data-[size=xs]/attachment:ptx-w-[28px] group-data-[size=xs]/attachment:ptx-rounded-[var(--pt-radius-sm)] group-data-[state=error]/attachment:ptx-bg-destructive/10 group-data-[state=error]/attachment:ptx-text-destructive group-data-[orientation=vertical]/attachment:[&>[data-slot=spinner]]:!ptx-size-[24px] [&_svg]:ptx-pointer-events-none [&_svg:not([class*='size-'])]:ptx-size-[16px] group-data-[orientation=vertical]/attachment:[&_svg:not([class*='size-'])]:ptx-size-[24px] group-data-[size=xs]/attachment:[&_svg:not([class*='size-'])]:ptx-size-[14px]",
|
|
50
50
|
{
|
|
51
51
|
variants: {
|
|
52
52
|
variant: {
|
|
53
53
|
icon: '',
|
|
54
|
-
image: 'opacity-60 group-data-[state=done]/attachment:opacity-100 group-data-[state=idle]/attachment:opacity-100 [&>img]:aspect-square [&>img]:w-full [&>img]:object-cover'
|
|
54
|
+
image: 'ptx-opacity-60 group-data-[state=done]/attachment:ptx-opacity-100 group-data-[state=idle]/attachment:ptx-opacity-100 [&>img]:ptx-aspect-square [&>img]:ptx-w-full [&>img]:ptx-object-cover'
|
|
55
55
|
}
|
|
56
56
|
},
|
|
57
57
|
defaultVariants: {
|
|
@@ -80,7 +80,7 @@ function AttachmentContent({ className, ...props }: React.HTMLAttributes<HTMLDiv
|
|
|
80
80
|
<div
|
|
81
81
|
data-slot="attachment-content"
|
|
82
82
|
className={cn(
|
|
83
|
-
'max-w-full min-w-0 flex-1 leading-tight group-data-[orientation=vertical]/attachment:px-[4px]',
|
|
83
|
+
'ptx-max-w-full ptx-min-w-0 ptx-flex-1 ptx-leading-tight group-data-[orientation=vertical]/attachment:ptx-px-[4px]',
|
|
84
84
|
className
|
|
85
85
|
)}
|
|
86
86
|
{...props}
|
|
@@ -93,7 +93,7 @@ function AttachmentTitle({ className, ...props }: React.HTMLAttributes<HTMLSpanE
|
|
|
93
93
|
<span
|
|
94
94
|
data-slot="attachment-title"
|
|
95
95
|
className={cn(
|
|
96
|
-
'block max-w-full min-w-0 truncate font-medium group-data-[state=processing]/attachment:animate-pulse group-data-[state=uploading]/attachment:animate-pulse',
|
|
96
|
+
'ptx-block ptx-max-w-full ptx-min-w-0 ptx-truncate ptx-font-medium group-data-[state=processing]/attachment:ptx-animate-pulse group-data-[state=uploading]/attachment:ptx-animate-pulse',
|
|
97
97
|
className
|
|
98
98
|
)}
|
|
99
99
|
{...props}
|
|
@@ -106,7 +106,7 @@ function AttachmentDescription({ className, ...props }: React.HTMLAttributes<HTM
|
|
|
106
106
|
<span
|
|
107
107
|
data-slot="attachment-description"
|
|
108
108
|
className={cn(
|
|
109
|
-
'mt-[2px] block max-w-full min-w-0 truncate text-xs text-muted-foreground group-data-[state=error]/attachment:text-destructive/80',
|
|
109
|
+
'ptx-mt-[2px] ptx-block ptx-max-w-full ptx-min-w-0 ptx-truncate ptx-text-xs ptx-text-muted-foreground group-data-[state=error]/attachment:ptx-text-destructive/80',
|
|
110
110
|
className
|
|
111
111
|
)}
|
|
112
112
|
{...props}
|
|
@@ -119,7 +119,7 @@ function AttachmentActions({ className, ...props }: React.HTMLAttributes<HTMLDiv
|
|
|
119
119
|
<div
|
|
120
120
|
data-slot="attachment-actions"
|
|
121
121
|
className={cn(
|
|
122
|
-
'relative z-20 flex shrink-0 items-center group-data-[orientation=vertical]/attachment:absolute group-data-[orientation=vertical]/attachment:right-[12px] group-data-[orientation=vertical]/attachment:top-[12px] group-data-[orientation=vertical]/attachment:gap-[4px]',
|
|
122
|
+
'ptx-relative ptx-z-20 ptx-flex ptx-shrink-0 ptx-items-center group-data-[orientation=vertical]/attachment:ptx-absolute group-data-[orientation=vertical]/attachment:ptx-right-[12px] group-data-[orientation=vertical]/attachment:ptx-top-[12px] group-data-[orientation=vertical]/attachment:ptx-gap-[4px]',
|
|
123
123
|
className
|
|
124
124
|
)}
|
|
125
125
|
{...props}
|
|
@@ -133,7 +133,7 @@ function AttachmentAction({ className, variant, size, ...props }: React.Componen
|
|
|
133
133
|
data-slot="attachment-action"
|
|
134
134
|
variant={variant ?? 'ghost'}
|
|
135
135
|
size={size ?? 'icon'}
|
|
136
|
-
className={cn('h-[24px] w-[24px] rounded-[var(--pt-radius-sm)] [&_svg]:size-[14px]', className)}
|
|
136
|
+
className={cn('ptx-h-[24px] ptx-w-[24px] ptx-rounded-[var(--pt-radius-sm)] [&_svg]:ptx-size-[14px]', className)}
|
|
137
137
|
{...props}
|
|
138
138
|
/>
|
|
139
139
|
);
|
|
@@ -154,7 +154,7 @@ function AttachmentTrigger({
|
|
|
154
154
|
<Comp
|
|
155
155
|
data-slot="attachment-trigger"
|
|
156
156
|
type={asChild ? undefined : (type ?? 'button')}
|
|
157
|
-
className={cn('absolute inset-0 z-10 cursor-pointer outline-none', className)}
|
|
157
|
+
className={cn('ptx-absolute ptx-inset-0 ptx-z-10 ptx-cursor-pointer ptx-outline-none', className)}
|
|
158
158
|
{...props}
|
|
159
159
|
/>
|
|
160
160
|
);
|
|
@@ -165,7 +165,7 @@ function AttachmentGroup({ className, ...props }: React.HTMLAttributes<HTMLDivEl
|
|
|
165
165
|
<div
|
|
166
166
|
data-slot="attachment-group"
|
|
167
167
|
className={cn(
|
|
168
|
-
'flex min-w-0 snap-x snap-mandatory scroll-px-[4px] gap-[12px] overflow-x-auto overscroll-x-contain py-[4px] [scrollbar-width:none] [&::-webkit-scrollbar]:hidden [&>[data-slot=attachment]]:flex-none [&>[data-slot=attachment]]:snap-start',
|
|
168
|
+
'ptx-flex ptx-min-w-0 ptx-snap-x ptx-snap-mandatory ptx-scroll-px-[4px] ptx-gap-[12px] ptx-overflow-x-auto ptx-overscroll-x-contain ptx-py-[4px] [scrollbar-width:none] [&::-webkit-scrollbar]:ptx-hidden [&>[data-slot=attachment]]:ptx-flex-none [&>[data-slot=attachment]]:ptx-snap-start',
|
|
169
169
|
className
|
|
170
170
|
)}
|
|
171
171
|
{...props}
|
|
@@ -5,12 +5,12 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
6
|
|
|
7
7
|
/* 头像三档:sm 24(字12)· md 32(字13)· lg 40(字14,默认)。字号作用于 Fallback 首字母 */
|
|
8
|
-
const avatarVariants = cva('relative flex shrink-0 overflow-hidden rounded-full', {
|
|
8
|
+
const avatarVariants = cva('ptx-relative ptx-flex ptx-shrink-0 ptx-overflow-hidden ptx-rounded-full', {
|
|
9
9
|
variants: {
|
|
10
10
|
size: {
|
|
11
|
-
sm: 'h-[24px] w-[24px] text-2xs',
|
|
12
|
-
md: 'h-[32px] w-[32px] text-xs',
|
|
13
|
-
lg: 'h-[40px] w-[40px] text-sm'
|
|
11
|
+
sm: 'ptx-h-[24px] ptx-w-[24px] ptx-text-2xs',
|
|
12
|
+
md: 'ptx-h-[32px] ptx-w-[32px] ptx-text-xs',
|
|
13
|
+
lg: 'ptx-h-[40px] ptx-w-[40px] ptx-text-sm'
|
|
14
14
|
}
|
|
15
15
|
},
|
|
16
16
|
defaultVariants: {
|
|
@@ -33,7 +33,7 @@ const AvatarImage = React.forwardRef<
|
|
|
33
33
|
>(({ className, ...props }, ref) => (
|
|
34
34
|
<AvatarPrimitive.Image
|
|
35
35
|
ref={ref}
|
|
36
|
-
className={cn('aspect-square h-full w-full', className)}
|
|
36
|
+
className={cn('ptx-aspect-square ptx-h-full ptx-w-full', className)}
|
|
37
37
|
{...props}
|
|
38
38
|
/>
|
|
39
39
|
));
|
|
@@ -46,7 +46,7 @@ const AvatarFallback = React.forwardRef<
|
|
|
46
46
|
<AvatarPrimitive.Fallback
|
|
47
47
|
ref={ref}
|
|
48
48
|
className={cn(
|
|
49
|
-
'flex h-full w-full items-center justify-center rounded-full bg-secondary text-foreground',
|
|
49
|
+
'ptx-flex ptx-h-full ptx-w-full ptx-items-center ptx-justify-center ptx-rounded-full ptx-bg-secondary ptx-text-foreground',
|
|
50
50
|
className
|
|
51
51
|
)}
|
|
52
52
|
{...props}
|
|
@@ -4,23 +4,23 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
4
4
|
import { cn } from '../../lib/utils';
|
|
5
5
|
|
|
6
6
|
const badgeVariants = cva(
|
|
7
|
-
'inline-flex items-center rounded-full border px-[10px] py-[2px] text-xs font-semibold transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 [--pt-state-layer-border:1px] [&:is(a,button)]:cursor-pointer',
|
|
7
|
+
'ptx-inline-flex ptx-items-center ptx-rounded-full ptx-border ptx-px-[10px] ptx-py-[2px] ptx-text-xs ptx-font-semibold ptx-transition-colors focus-visible:ptx-outline-none focus-visible:ptx-ring-2 focus-visible:ptx-ring-ring focus-visible:ptx-ring-offset-2 [--pt-state-layer-border:1px] [&:is(a,button)]:ptx-cursor-pointer',
|
|
8
8
|
{
|
|
9
9
|
variants: {
|
|
10
10
|
variant: {
|
|
11
11
|
default:
|
|
12
|
-
'border-transparent bg-primary text-primary-foreground [&:is(a,button)]:state-layer-inverse',
|
|
12
|
+
'ptx-border-transparent ptx-bg-primary ptx-text-primary-foreground [&:is(a,button)]:ptx-state-layer-inverse',
|
|
13
13
|
secondary:
|
|
14
|
-
'border-transparent bg-neutral-subtler text-neutral [&:is(a,button)]:state-layer',
|
|
14
|
+
'ptx-border-transparent ptx-bg-neutral-subtler ptx-text-neutral [&:is(a,button)]:ptx-state-layer',
|
|
15
15
|
destructive:
|
|
16
|
-
'border-transparent bg-danger-subtler text-danger [&:is(a,button)]:state-layer',
|
|
16
|
+
'ptx-border-transparent ptx-bg-danger-subtler ptx-text-danger [&:is(a,button)]:ptx-state-layer',
|
|
17
17
|
success:
|
|
18
|
-
'border-transparent bg-positive-subtler text-success [&:is(a,button)]:state-layer',
|
|
18
|
+
'ptx-border-transparent ptx-bg-positive-subtler ptx-text-success [&:is(a,button)]:ptx-state-layer',
|
|
19
19
|
warning:
|
|
20
|
-
'border-transparent bg-warning-subtler text-warning [&:is(a,button)]:state-layer',
|
|
20
|
+
'ptx-border-transparent ptx-bg-warning-subtler ptx-text-warning [&:is(a,button)]:ptx-state-layer',
|
|
21
21
|
information:
|
|
22
|
-
'border-transparent bg-information-subtler text-information [&:is(a,button)]:state-layer',
|
|
23
|
-
ai: 'border-transparent bg-ai-subtler text-ai [&:is(a,button)]:state-layer'
|
|
22
|
+
'ptx-border-transparent ptx-bg-information-subtler ptx-text-information [&:is(a,button)]:ptx-state-layer',
|
|
23
|
+
ai: 'ptx-border-transparent ptx-bg-ai-subtler ptx-text-ai [&:is(a,button)]:ptx-state-layer'
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
defaultVariants: {
|
|
@@ -17,7 +17,7 @@ const BreadcrumbList = React.forwardRef<HTMLOListElement, React.ComponentPropsWi
|
|
|
17
17
|
className={cn(
|
|
18
18
|
// 面包屑是导航辅助信息,不是正文 —— 字号走 13(lin 2026-08-28)。
|
|
19
19
|
// 原为 14,与页面正文同级,在标题下方读起来比实际权重更重。
|
|
20
|
-
'flex flex-wrap items-center gap-[6px] break-words text-xs text-muted-foreground sm:gap-[10px]',
|
|
20
|
+
'ptx-flex ptx-flex-wrap ptx-items-center ptx-gap-[6px] ptx-break-words ptx-text-xs ptx-text-muted-foreground sm:ptx-gap-[10px]',
|
|
21
21
|
className
|
|
22
22
|
)}
|
|
23
23
|
{...props}
|
|
@@ -28,7 +28,7 @@ BreadcrumbList.displayName = 'BreadcrumbList';
|
|
|
28
28
|
|
|
29
29
|
const BreadcrumbItem = React.forwardRef<HTMLLIElement, React.ComponentPropsWithoutRef<'li'>>(
|
|
30
30
|
({ className, ...props }, ref) => (
|
|
31
|
-
<li ref={ref} className={cn('inline-flex items-center gap-[6px]', className)} {...props} />
|
|
31
|
+
<li ref={ref} className={cn('ptx-inline-flex ptx-items-center ptx-gap-[6px]', className)} {...props} />
|
|
32
32
|
)
|
|
33
33
|
);
|
|
34
34
|
BreadcrumbItem.displayName = 'BreadcrumbItem';
|
|
@@ -41,7 +41,7 @@ const BreadcrumbLink = React.forwardRef<
|
|
|
41
41
|
return (
|
|
42
42
|
<Comp
|
|
43
43
|
ref={ref}
|
|
44
|
-
className={cn('transition-colors hover:text-foreground', className)}
|
|
44
|
+
className={cn('ptx-transition-colors hover:ptx-text-foreground', className)}
|
|
45
45
|
{...props}
|
|
46
46
|
/>
|
|
47
47
|
);
|
|
@@ -55,7 +55,7 @@ const BreadcrumbPage = React.forwardRef<HTMLSpanElement, React.ComponentPropsWit
|
|
|
55
55
|
role="link"
|
|
56
56
|
aria-disabled="true"
|
|
57
57
|
aria-current="page"
|
|
58
|
-
className={cn('font-normal text-foreground', className)}
|
|
58
|
+
className={cn('ptx-font-normal ptx-text-foreground', className)}
|
|
59
59
|
{...props}
|
|
60
60
|
/>
|
|
61
61
|
)
|
|
@@ -66,7 +66,7 @@ const BreadcrumbSeparator = ({ children, className, ...props }: React.ComponentP
|
|
|
66
66
|
<li
|
|
67
67
|
role="presentation"
|
|
68
68
|
aria-hidden="true"
|
|
69
|
-
className={cn('[&>svg]:size-[14px]', className)}
|
|
69
|
+
className={cn('[&>svg]:ptx-size-[14px]', className)}
|
|
70
70
|
{...props}
|
|
71
71
|
>
|
|
72
72
|
{children ?? <ChevronRight />}
|
|
@@ -83,11 +83,11 @@ const BreadcrumbEllipsis = ({
|
|
|
83
83
|
<span
|
|
84
84
|
role="presentation"
|
|
85
85
|
aria-hidden="true"
|
|
86
|
-
className={cn('flex h-[32px] w-[36px] items-center justify-center', className)}
|
|
86
|
+
className={cn('ptx-flex ptx-h-[32px] ptx-w-[36px] ptx-items-center ptx-justify-center', className)}
|
|
87
87
|
{...props}
|
|
88
88
|
>
|
|
89
|
-
<MoreHorizontal className="h-[16px] w-[16px]" />
|
|
90
|
-
<span className="sr-only">{label}</span>
|
|
89
|
+
<MoreHorizontal className="ptx-h-[16px] ptx-w-[16px]" />
|
|
90
|
+
<span className="ptx-sr-only">{label}</span>
|
|
91
91
|
</span>
|
|
92
92
|
);
|
|
93
93
|
BreadcrumbEllipsis.displayName = 'BreadcrumbEllipsis';
|
|
@@ -8,27 +8,27 @@ function BubbleGroup({ className, ...props }: React.HTMLAttributes<HTMLDivElemen
|
|
|
8
8
|
return (
|
|
9
9
|
<div
|
|
10
10
|
data-slot="bubble-group"
|
|
11
|
-
className={cn('flex min-w-0 flex-col gap-[8px]', className)}
|
|
11
|
+
className={cn('ptx-flex ptx-min-w-0 ptx-flex-col ptx-gap-[8px]', className)}
|
|
12
12
|
{...props}
|
|
13
13
|
/>
|
|
14
14
|
);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
const bubbleVariants = cva(
|
|
18
|
-
'group/bubble relative flex w-fit max-w-[80%] min-w-0 flex-col gap-[4px] group-data-[align=end]/message:self-end data-[align=end]:self-end data-[variant=ghost]:max-w-full',
|
|
18
|
+
'group/bubble ptx-relative ptx-flex ptx-w-fit ptx-max-w-[80%] ptx-min-w-0 ptx-flex-col ptx-gap-[4px] group-data-[align=end]/message:ptx-self-end data-[align=end]:ptx-self-end data-[variant=ghost]:ptx-max-w-full',
|
|
19
19
|
{
|
|
20
20
|
variants: {
|
|
21
21
|
variant: {
|
|
22
22
|
default:
|
|
23
|
-
'[&>[data-slot=bubble-content]]:bg-primary [&>[data-slot=bubble-content]]:text-primary-foreground [&>[data-slot=bubble-content]]:[--pt-interaction-hover:var(--pt-interaction-reversal-hover)] [&>[data-slot=bubble-content]]:[--pt-interaction-press:var(--pt-interaction-reversal-press)]',
|
|
23
|
+
'[&>[data-slot=bubble-content]]:ptx-bg-primary [&>[data-slot=bubble-content]]:ptx-text-primary-foreground [&>[data-slot=bubble-content]]:[--pt-interaction-hover:var(--pt-interaction-reversal-hover)] [&>[data-slot=bubble-content]]:[--pt-interaction-press:var(--pt-interaction-reversal-press)]',
|
|
24
24
|
secondary:
|
|
25
|
-
'[&>[data-slot=bubble-content]]:bg-secondary [&>[data-slot=bubble-content]]:text-secondary-foreground',
|
|
26
|
-
muted: '[&>[data-slot=bubble-content]]:bg-muted',
|
|
25
|
+
'[&>[data-slot=bubble-content]]:ptx-bg-secondary [&>[data-slot=bubble-content]]:ptx-text-secondary-foreground',
|
|
26
|
+
muted: '[&>[data-slot=bubble-content]]:ptx-bg-muted',
|
|
27
27
|
outline:
|
|
28
|
-
'[&>[data-slot=bubble-content]]:border-input [&>[data-slot=bubble-content]]:bg-background [&>[data-slot=bubble-content]]:[--pt-state-layer-border:1px]',
|
|
29
|
-
ghost: 'border-none [&>[data-slot=bubble-content]]:rounded-none [&>[data-slot=bubble-content]]:bg-transparent [&>[data-slot=bubble-content]]:p-0',
|
|
28
|
+
'[&>[data-slot=bubble-content]]:ptx-border-input [&>[data-slot=bubble-content]]:ptx-bg-background [&>[data-slot=bubble-content]]:[--pt-state-layer-border:1px]',
|
|
29
|
+
ghost: 'ptx-border-none [&>[data-slot=bubble-content]]:ptx-rounded-none [&>[data-slot=bubble-content]]:ptx-bg-transparent [&>[data-slot=bubble-content]]:ptx-p-0',
|
|
30
30
|
destructive:
|
|
31
|
-
'[&>[data-slot=bubble-content]]:bg-destructive/10 [&>[data-slot=bubble-content]]:text-destructive dark:[&>[data-slot=bubble-content]]:bg-destructive/20'
|
|
31
|
+
'[&>[data-slot=bubble-content]]:ptx-bg-destructive/10 [&>[data-slot=bubble-content]]:ptx-text-destructive dark:[&>[data-slot=bubble-content]]:ptx-bg-destructive/20'
|
|
32
32
|
}
|
|
33
33
|
},
|
|
34
34
|
defaultVariants: {
|
|
@@ -71,8 +71,8 @@ function BubbleContent({
|
|
|
71
71
|
<Comp
|
|
72
72
|
data-slot="bubble-content"
|
|
73
73
|
className={cn(
|
|
74
|
-
'w-fit max-w-full min-w-0 overflow-hidden break-words rounded-[var(--pt-radius)] border border-transparent px-[12px] py-[8px] text-sm leading-relaxed group-data-[align=end]/bubble:self-end',
|
|
75
|
-
'[&:is(button,a)]:state-layer [&:is(button)]:text-left [&:is(button,a)]:cursor-pointer [&:is(button,a)]:focus-visible:outline-none [&:is(button,a)]:focus-visible:ring-1 [&:is(button,a)]:focus-visible:ring-ring',
|
|
74
|
+
'ptx-w-fit ptx-max-w-full ptx-min-w-0 ptx-overflow-hidden ptx-break-words ptx-rounded-[var(--pt-radius)] ptx-border ptx-border-transparent ptx-px-[12px] ptx-py-[8px] ptx-text-sm ptx-leading-relaxed group-data-[align=end]/bubble:ptx-self-end',
|
|
75
|
+
'[&:is(button,a)]:ptx-state-layer [&:is(button)]:ptx-text-left [&:is(button,a)]:ptx-cursor-pointer [&:is(button,a)]:focus-visible:ptx-outline-none [&:is(button,a)]:focus-visible:ptx-ring-1 [&:is(button,a)]:focus-visible:ptx-ring-ring',
|
|
76
76
|
className
|
|
77
77
|
)}
|
|
78
78
|
{...props}
|
|
@@ -81,16 +81,16 @@ function BubbleContent({
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
const bubbleReactionsVariants = cva(
|
|
84
|
-
'absolute z-10 flex w-fit shrink-0 items-center justify-center gap-[4px] rounded-full bg-muted px-[6px] py-[2px] text-sm ring ring-card has-[button]:p-0',
|
|
84
|
+
'ptx-absolute ptx-z-10 ptx-flex ptx-w-fit ptx-shrink-0 ptx-items-center ptx-justify-center ptx-gap-[4px] ptx-rounded-full ptx-bg-muted ptx-px-[6px] ptx-py-[2px] ptx-text-sm ptx-ring ptx-ring-card has-[button]:ptx-p-0',
|
|
85
85
|
{
|
|
86
86
|
variants: {
|
|
87
87
|
side: {
|
|
88
|
-
top: 'top-0 -translate-y-3/4',
|
|
89
|
-
bottom: 'bottom-0 translate-y-3/4'
|
|
88
|
+
top: 'ptx-top-0 -ptx-translate-y-3/4',
|
|
89
|
+
bottom: 'ptx-bottom-0 ptx-translate-y-3/4'
|
|
90
90
|
},
|
|
91
91
|
align: {
|
|
92
|
-
start: 'left-[12px]',
|
|
93
|
-
end: 'right-[12px]'
|
|
92
|
+
start: 'ptx-left-[12px]',
|
|
93
|
+
end: 'ptx-right-[12px]'
|
|
94
94
|
}
|
|
95
95
|
},
|
|
96
96
|
defaultVariants: {
|
|
@@ -6,14 +6,14 @@ import { cn } from '../../lib/utils';
|
|
|
6
6
|
import { Separator } from './separator';
|
|
7
7
|
|
|
8
8
|
const buttonGroupVariants = cva(
|
|
9
|
-
"flex w-fit items-stretch has-[>[data-slot=button-group]]:gap-[8px] [&>*]:focus-visible:relative [&>*]:focus-visible:z-10 [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
|
|
9
|
+
"ptx-flex ptx-w-fit ptx-items-stretch has-[>[data-slot=button-group]]:ptx-gap-[8px] [&>*]:focus-visible:ptx-relative [&>*]:focus-visible:ptx-z-10 [&>[data-slot=select-trigger]:not([class*='w-'])]:ptx-w-fit [&>input]:ptx-flex-1",
|
|
10
10
|
{
|
|
11
11
|
variants: {
|
|
12
12
|
orientation: {
|
|
13
13
|
horizontal:
|
|
14
|
-
'[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none [&>*:not(:first-child)]:after:left-0',
|
|
14
|
+
'[&>*:not(:first-child)]:ptx-rounded-l-none [&>*:not(:first-child)]:ptx-border-l-0 [&>*:not(:last-child)]:ptx-rounded-r-none [&>*:not(:first-child)]:after:ptx-left-0',
|
|
15
15
|
vertical:
|
|
16
|
-
'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none [&>*:not(:first-child)]:after:top-0'
|
|
16
|
+
'ptx-flex-col [&>*:not(:first-child)]:ptx-rounded-t-none [&>*:not(:first-child)]:ptx-border-t-0 [&>*:not(:last-child)]:ptx-rounded-b-none [&>*:not(:first-child)]:after:ptx-top-0'
|
|
17
17
|
}
|
|
18
18
|
},
|
|
19
19
|
defaultVariants: {
|
|
@@ -48,7 +48,7 @@ function ButtonGroupText({
|
|
|
48
48
|
<Comp
|
|
49
49
|
data-slot="button-group-text"
|
|
50
50
|
className={cn(
|
|
51
|
-
"flex items-center gap-[8px] rounded-[var(--pt-radius-md)] border bg-muted px-[16px] text-sm font-medium text-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-[16px]",
|
|
51
|
+
"ptx-flex ptx-items-center ptx-gap-[8px] ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-bg-muted ptx-px-[16px] ptx-text-sm ptx-font-medium ptx-text-foreground [&_svg]:ptx-pointer-events-none [&_svg:not([class*='size-'])]:ptx-size-[16px]",
|
|
52
52
|
className
|
|
53
53
|
)}
|
|
54
54
|
{...props}
|
|
@@ -65,7 +65,7 @@ function ButtonGroupSeparator({
|
|
|
65
65
|
<Separator
|
|
66
66
|
data-slot="button-group-separator"
|
|
67
67
|
orientation={orientation}
|
|
68
|
-
className={cn('relative !m-0 self-stretch bg-input data-[orientation=vertical]:h-auto', className)}
|
|
68
|
+
className={cn('ptx-relative !ptx-m-0 ptx-self-stretch ptx-bg-input data-[orientation=vertical]:ptx-h-auto', className)}
|
|
69
69
|
{...props}
|
|
70
70
|
/>
|
|
71
71
|
);
|
|
@@ -5,32 +5,32 @@ import { cva, type VariantProps } from 'class-variance-authority';
|
|
|
5
5
|
import { cn } from '../../lib/utils';
|
|
6
6
|
|
|
7
7
|
const buttonVariants = cva(
|
|
8
|
-
'inline-flex items-center justify-center gap-[8px] whitespace-nowrap rounded-[var(--pt-radius-md)] text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-[16px] [&_svg]:shrink-0',
|
|
8
|
+
'ptx-inline-flex ptx-items-center ptx-justify-center ptx-gap-[8px] ptx-whitespace-nowrap ptx-rounded-[var(--pt-radius-md)] ptx-text-sm ptx-font-medium ptx-transition-colors focus-visible:ptx-outline-none focus-visible:ptx-ring-2 focus-visible:ptx-ring-ring focus-visible:ptx-ring-offset-2 disabled:ptx-cursor-not-allowed disabled:ptx-opacity-50 [&_svg]:ptx-pointer-events-none [&_svg]:ptx-size-[16px] [&_svg]:ptx-shrink-0',
|
|
9
9
|
{
|
|
10
10
|
variants: {
|
|
11
11
|
variant: {
|
|
12
|
-
default: 'state-layer-inverse bg-primary text-primary-foreground',
|
|
13
|
-
brand: 'state-layer bg-brand text-brand-foreground',
|
|
12
|
+
default: 'ptx-state-layer-inverse ptx-bg-primary ptx-text-primary-foreground',
|
|
13
|
+
brand: 'ptx-state-layer ptx-bg-brand ptx-text-brand-foreground',
|
|
14
14
|
secondary:
|
|
15
|
-
'state-layer border border-input bg-background text-foreground [--pt-state-layer-border:1px]',
|
|
16
|
-
tertiary: 'state-layer bg-secondary text-secondary-foreground',
|
|
17
|
-
destructive: 'state-layer bg-destructive text-destructive-foreground',
|
|
18
|
-
ghost: 'state-layer text-foreground',
|
|
15
|
+
'ptx-state-layer ptx-border ptx-border-input ptx-bg-background ptx-text-foreground [--pt-state-layer-border:1px]',
|
|
16
|
+
tertiary: 'ptx-state-layer ptx-bg-secondary ptx-text-secondary-foreground',
|
|
17
|
+
destructive: 'ptx-state-layer ptx-bg-destructive ptx-text-destructive-foreground',
|
|
18
|
+
ghost: 'ptx-state-layer ptx-text-foreground',
|
|
19
19
|
/* 静默警示钮:常态同 ghost/secondary,hover/按下 内容变 --pt-red(删除等场景) */
|
|
20
20
|
'ghost-destructive':
|
|
21
|
-
'state-layer text-foreground hover:text-[rgb(var(--pt-red))] active:text-[rgb(var(--pt-red))]',
|
|
21
|
+
'ptx-state-layer ptx-text-foreground hover:ptx-text-[rgb(var(--pt-red))] active:ptx-text-[rgb(var(--pt-red))]',
|
|
22
22
|
'secondary-destructive':
|
|
23
|
-
'state-layer border border-input bg-background text-foreground [--pt-state-layer-border:1px] hover:text-[rgb(var(--pt-red))] active:text-[rgb(var(--pt-red))]',
|
|
24
|
-
link: 'text-primary underline-offset-4 hover:underline'
|
|
23
|
+
'ptx-state-layer ptx-border ptx-border-input ptx-bg-background ptx-text-foreground [--pt-state-layer-border:1px] hover:ptx-text-[rgb(var(--pt-red))] active:ptx-text-[rgb(var(--pt-red))]',
|
|
24
|
+
link: 'ptx-text-primary ptx-underline-offset-4 hover:ptx-underline'
|
|
25
25
|
},
|
|
26
26
|
/* 控件三档刻度:sm 24(字12/图16)· default 32(字13/图16)· lg 40(字14/图20);语义图标 16/16/20 */
|
|
27
27
|
size: {
|
|
28
|
-
sm: 'h-[24px] gap-[4px] rounded-[var(--pt-radius-sm)] px-[8px] text-2xs',
|
|
29
|
-
default: 'h-[32px] rounded-[var(--pt-radius-md)] px-[12px] text-xs',
|
|
30
|
-
lg: 'h-[40px] rounded-[var(--pt-radius-md)] px-[16px] text-sm [&_svg]:size-[20px]',
|
|
31
|
-
'icon-sm': 'h-[24px] w-[24px] rounded-[var(--pt-radius-sm)]',
|
|
32
|
-
icon: 'h-[32px] w-[32px]',
|
|
33
|
-
'icon-lg': 'h-[40px] w-[40px] [&_svg]:size-[20px]'
|
|
28
|
+
sm: 'ptx-h-[24px] ptx-gap-[4px] ptx-rounded-[var(--pt-radius-sm)] ptx-px-[8px] ptx-text-2xs',
|
|
29
|
+
default: 'ptx-h-[32px] ptx-rounded-[var(--pt-radius-md)] ptx-px-[12px] ptx-text-xs',
|
|
30
|
+
lg: 'ptx-h-[40px] ptx-rounded-[var(--pt-radius-md)] ptx-px-[16px] ptx-text-sm [&_svg]:ptx-size-[20px]',
|
|
31
|
+
'icon-sm': 'ptx-h-[24px] ptx-w-[24px] ptx-rounded-[var(--pt-radius-sm)]',
|
|
32
|
+
icon: 'ptx-h-[32px] ptx-w-[32px]',
|
|
33
|
+
'icon-lg': 'ptx-h-[40px] ptx-w-[40px] [&_svg]:ptx-size-[20px]'
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
defaultVariants: {
|
|
@@ -11,47 +11,47 @@ function Calendar({ className, classNames, showOutsideDays = true, ...props }: C
|
|
|
11
11
|
return (
|
|
12
12
|
<DayPicker
|
|
13
13
|
showOutsideDays={showOutsideDays}
|
|
14
|
-
className={cn('p-[12px]', className)}
|
|
14
|
+
className={cn('ptx-p-[12px]', className)}
|
|
15
15
|
classNames={{
|
|
16
|
-
months: 'relative flex flex-col gap-[16px] sm:flex-row',
|
|
17
|
-
month: 'flex flex-col gap-[16px]',
|
|
18
|
-
month_caption: 'flex h-[28px] items-center justify-center',
|
|
19
|
-
caption_label: 'text-sm font-medium text-foreground',
|
|
20
|
-
nav: 'absolute inset-x-0 top-0 z-10 flex items-center justify-between',
|
|
21
|
-
button_previous: cn(buttonVariants({ variant: 'ghost' }), 'h-[28px] w-[28px] p-0'),
|
|
22
|
-
button_next: cn(buttonVariants({ variant: 'ghost' }), 'h-[28px] w-[28px] p-0'),
|
|
23
|
-
month_grid: 'w-full border-collapse',
|
|
24
|
-
weekdays: 'flex',
|
|
16
|
+
months: 'ptx-relative ptx-flex ptx-flex-col ptx-gap-[16px] sm:ptx-flex-row',
|
|
17
|
+
month: 'ptx-flex ptx-flex-col ptx-gap-[16px]',
|
|
18
|
+
month_caption: 'ptx-flex ptx-h-[28px] ptx-items-center ptx-justify-center',
|
|
19
|
+
caption_label: 'ptx-text-sm ptx-font-medium ptx-text-foreground',
|
|
20
|
+
nav: 'ptx-absolute ptx-inset-x-0 ptx-top-0 ptx-z-10 ptx-flex ptx-items-center ptx-justify-between',
|
|
21
|
+
button_previous: cn(buttonVariants({ variant: 'ghost' }), 'ptx-h-[28px] ptx-w-[28px] ptx-p-0'),
|
|
22
|
+
button_next: cn(buttonVariants({ variant: 'ghost' }), 'ptx-h-[28px] ptx-w-[28px] ptx-p-0'),
|
|
23
|
+
month_grid: 'ptx-w-full ptx-border-collapse',
|
|
24
|
+
weekdays: 'ptx-flex',
|
|
25
25
|
weekday:
|
|
26
|
-
'w-[32px] rounded-[var(--pt-radius-md)] text-2xs font-normal text-muted-foreground',
|
|
27
|
-
week: 'mt-[8px] flex w-full',
|
|
28
|
-
day: 'relative p-0 text-center text-sm focus-within:relative focus-within:z-20',
|
|
26
|
+
'ptx-w-[32px] ptx-rounded-[var(--pt-radius-md)] ptx-text-2xs ptx-font-normal ptx-text-muted-foreground',
|
|
27
|
+
week: 'ptx-mt-[8px] ptx-flex ptx-w-full',
|
|
28
|
+
day: 'ptx-relative ptx-p-0 ptx-text-center ptx-text-sm focus-within:ptx-relative focus-within:ptx-z-20',
|
|
29
29
|
day_button: cn(
|
|
30
30
|
buttonVariants({ variant: 'ghost' }),
|
|
31
|
-
'h-[32px] w-[32px] p-0 font-normal aria-selected:opacity-100'
|
|
31
|
+
'ptx-h-[32px] ptx-w-[32px] ptx-p-0 ptx-font-normal aria-selected:ptx-opacity-100'
|
|
32
32
|
),
|
|
33
33
|
/* range 端点:黑底白字按钮;格子层同时铺 8% 底带并只圆外侧角,
|
|
34
34
|
让中段底带连续延伸到端点下方不断开 */
|
|
35
35
|
range_start:
|
|
36
|
-
'day-range-start bg-selected rounded-l-[var(--pt-radius-md)] [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:font-medium',
|
|
36
|
+
'day-range-start ptx-bg-selected ptx-rounded-l-[var(--pt-radius-md)] [&>button]:ptx-bg-primary [&>button]:ptx-text-primary-foreground [&>button]:ptx-font-medium',
|
|
37
37
|
range_end:
|
|
38
|
-
'day-range-end bg-selected rounded-r-[var(--pt-radius-md)] [&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:font-medium',
|
|
38
|
+
'day-range-end ptx-bg-selected ptx-rounded-r-[var(--pt-radius-md)] [&>button]:ptx-bg-primary [&>button]:ptx-text-primary-foreground [&>button]:ptx-font-medium',
|
|
39
39
|
/* 单选模式选中=黑底白字;range 模式交给 range_start/end/middle 三键,不在此重复设底 */
|
|
40
40
|
selected:
|
|
41
41
|
props.mode === 'range'
|
|
42
42
|
? undefined
|
|
43
|
-
: '[&>button]:bg-primary [&>button]:text-primary-foreground [&>button]:font-medium',
|
|
44
|
-
today: '[&>button]:bg-selected',
|
|
45
|
-
outside: 'day-outside text-muted-foreground aria-selected:text-muted-foreground',
|
|
46
|
-
disabled: 'text-muted-foreground opacity-50',
|
|
47
|
-
range_middle: 'bg-selected [&>button]:bg-transparent [&>button]:font-normal',
|
|
48
|
-
hidden: 'invisible',
|
|
43
|
+
: '[&>button]:ptx-bg-primary [&>button]:ptx-text-primary-foreground [&>button]:ptx-font-medium',
|
|
44
|
+
today: '[&>button]:ptx-bg-selected',
|
|
45
|
+
outside: 'day-outside ptx-text-muted-foreground aria-selected:ptx-text-muted-foreground',
|
|
46
|
+
disabled: 'ptx-text-muted-foreground ptx-opacity-50',
|
|
47
|
+
range_middle: 'ptx-bg-selected [&>button]:ptx-bg-transparent [&>button]:ptx-font-normal',
|
|
48
|
+
hidden: 'ptx-invisible',
|
|
49
49
|
...classNames
|
|
50
50
|
}}
|
|
51
51
|
components={{
|
|
52
52
|
Chevron: ({ orientation }) => {
|
|
53
53
|
const Icon = orientation === 'left' ? ChevronLeft : ChevronRight;
|
|
54
|
-
return <Icon className="h-[16px] w-[16px]" />;
|
|
54
|
+
return <Icon className="ptx-h-[16px] ptx-w-[16px]" />;
|
|
55
55
|
}
|
|
56
56
|
}}
|
|
57
57
|
{...props}
|