@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
|
@@ -9,10 +9,10 @@ const ScrollArea = React.forwardRef<
|
|
|
9
9
|
>(({ className, children, ...props }, ref) => (
|
|
10
10
|
<ScrollAreaPrimitive.Root
|
|
11
11
|
ref={ref}
|
|
12
|
-
className={cn('relative overflow-hidden', className)}
|
|
12
|
+
className={cn('ptx-relative ptx-overflow-hidden', className)}
|
|
13
13
|
{...props}
|
|
14
14
|
>
|
|
15
|
-
<ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">
|
|
15
|
+
<ScrollAreaPrimitive.Viewport className="ptx-h-full ptx-w-full ptx-rounded-[inherit]">
|
|
16
16
|
{children}
|
|
17
17
|
</ScrollAreaPrimitive.Viewport>
|
|
18
18
|
<ScrollBar />
|
|
@@ -29,14 +29,14 @@ const ScrollBar = React.forwardRef<
|
|
|
29
29
|
ref={ref}
|
|
30
30
|
orientation={orientation}
|
|
31
31
|
className={cn(
|
|
32
|
-
'flex touch-none select-none transition-colors',
|
|
33
|
-
orientation === 'vertical' && 'h-full w-[10px] border-l border-l-transparent p-[1px]',
|
|
34
|
-
orientation === 'horizontal' && 'h-[10px] flex-col border-t border-t-transparent p-[1px]',
|
|
32
|
+
'ptx-flex ptx-touch-none ptx-select-none ptx-transition-colors',
|
|
33
|
+
orientation === 'vertical' && 'ptx-h-full ptx-w-[10px] ptx-border-l ptx-border-l-transparent ptx-p-[1px]',
|
|
34
|
+
orientation === 'horizontal' && 'ptx-h-[10px] ptx-flex-col ptx-border-t ptx-border-t-transparent ptx-p-[1px]',
|
|
35
35
|
className
|
|
36
36
|
)}
|
|
37
37
|
{...props}
|
|
38
38
|
>
|
|
39
|
-
<ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
|
|
39
|
+
<ScrollAreaPrimitive.ScrollAreaThumb className="ptx-relative ptx-flex-1 ptx-rounded-full ptx-bg-border" />
|
|
40
40
|
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
41
41
|
));
|
|
42
42
|
ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
|
|
@@ -6,29 +6,29 @@ import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from '
|
|
|
6
6
|
|
|
7
7
|
/* 三档:高 24/32/40 · 字 12/13/14 · 辅助图标 12/16/16 · 左右间距 8/10/12(带 icon 组件档) */
|
|
8
8
|
const SIZE_CLASSES = {
|
|
9
|
-
sm: 'h-[24px] px-[8px] rounded-[var(--pt-radius-sm)] [&_input]:text-
|
|
10
|
-
default: 'h-[32px] px-[10px]',
|
|
11
|
-
lg: 'h-[40px] px-[12px] [&_input]:text-
|
|
9
|
+
sm: 'ptx-h-[24px] ptx-px-[8px] ptx-rounded-[var(--pt-radius-sm)] [&_input]:ptx-text-2xs',
|
|
10
|
+
default: 'ptx-h-[32px] ptx-px-[10px]',
|
|
11
|
+
lg: 'ptx-h-[40px] ptx-px-[12px] [&_input]:ptx-text-sm'
|
|
12
12
|
} as const;
|
|
13
13
|
|
|
14
14
|
/* 放大镜(寓意图标):16 / 16 / 20 */
|
|
15
15
|
const ICON_CLASSES = {
|
|
16
|
-
sm: '[&_svg]:size-[16px]',
|
|
17
|
-
default: '[&_svg]:size-[16px]',
|
|
18
|
-
lg: '[&_svg]:size-[20px]'
|
|
16
|
+
sm: '[&_svg]:ptx-size-[16px]',
|
|
17
|
+
default: '[&_svg]:ptx-size-[16px]',
|
|
18
|
+
lg: '[&_svg]:ptx-size-[20px]'
|
|
19
19
|
} as const;
|
|
20
20
|
|
|
21
21
|
/* 清空钮(按钮里的辅助图标):sm 12 · default 12 · lg 16;容器与按钮同值,避免跨元素层叠打架 */
|
|
22
22
|
const CLEAR_ADDON_CLASSES = {
|
|
23
|
-
sm: '[&_svg]:size-[12px]',
|
|
24
|
-
default: '[&_svg]:size-[12px]',
|
|
25
|
-
lg: '[&_svg]:size-[16px]'
|
|
23
|
+
sm: '[&_svg]:ptx-size-[12px]',
|
|
24
|
+
default: '[&_svg]:ptx-size-[12px]',
|
|
25
|
+
lg: '[&_svg]:ptx-size-[16px]'
|
|
26
26
|
} as const;
|
|
27
27
|
|
|
28
28
|
const CLEAR_BUTTON_CLASSES = {
|
|
29
|
-
sm: 'size-[20px] p-0 [&_svg]:size-[12px]',
|
|
30
|
-
default: 'size-[24px] p-0 [&_svg]:size-[12px]',
|
|
31
|
-
lg: 'size-[24px] p-0 [&_svg]:size-[16px]'
|
|
29
|
+
sm: 'ptx-size-[20px] ptx-p-0 [&_svg]:ptx-size-[12px]',
|
|
30
|
+
default: 'ptx-size-[24px] ptx-p-0 [&_svg]:ptx-size-[12px]',
|
|
31
|
+
lg: 'ptx-size-[24px] ptx-p-0 [&_svg]:ptx-size-[16px]'
|
|
32
32
|
} as const;
|
|
33
33
|
|
|
34
34
|
export interface SearchInputProps
|
|
@@ -22,10 +22,10 @@ const SelectValue = SelectPrimitive.Value;
|
|
|
22
22
|
* 而高度 / 圆角 / 字号是上一轮手工对齐的 —— 手工对齐的东西下次改库时又会散开。
|
|
23
23
|
* 所以样式收在这里一处,多选触发器 `cn(selectTriggerClassName, …)` 复用。
|
|
24
24
|
*
|
|
25
|
-
* `w-full` 不在里面:Select 自己要撑满容器,而筛选器通常按内容宽。各自加。
|
|
25
|
+
* `ptx-w-full` 不在里面:Select 自己要撑满容器,而筛选器通常按内容宽。各自加。
|
|
26
26
|
*/
|
|
27
27
|
export const selectTriggerClassName =
|
|
28
|
-
'flex h-[32px] items-center justify-between whitespace-nowrap rounded-[var(--pt-radius-md)] border border-input bg-transparent px-[12px] py-[8px] text-
|
|
28
|
+
'ptx-flex ptx-h-[32px] ptx-items-center ptx-justify-between ptx-whitespace-nowrap ptx-rounded-[var(--pt-radius-md)] ptx-border ptx-border-input ptx-bg-transparent ptx-px-[12px] ptx-py-[8px] ptx-text-xs ptx-ring-offset-background ptx-transition-colors placeholder:ptx-text-muted-foreground 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]:ptx-text-destructive aria-[invalid=true]:enabled:hover:ptx-border-destructive aria-[invalid=true]:focus-visible:ptx-ring-destructive/30 [&>span]:ptx-line-clamp-1';
|
|
29
29
|
|
|
30
30
|
const SelectTrigger = React.forwardRef<
|
|
31
31
|
React.ElementRef<typeof SelectPrimitive.Trigger>,
|
|
@@ -34,12 +34,12 @@ const SelectTrigger = React.forwardRef<
|
|
|
34
34
|
<SelectPrimitive.Trigger
|
|
35
35
|
ref={ref}
|
|
36
36
|
data-slot="select-trigger"
|
|
37
|
-
className={cn(selectTriggerClassName, 'w-full', className)}
|
|
37
|
+
className={cn(selectTriggerClassName, 'ptx-w-full', className)}
|
|
38
38
|
{...props}
|
|
39
39
|
>
|
|
40
40
|
{children}
|
|
41
41
|
<SelectPrimitive.Icon asChild>
|
|
42
|
-
<ChevronDown className="h-[16px] w-[16px] opacity-50" />
|
|
42
|
+
<ChevronDown className="ptx-h-[16px] ptx-w-[16px] ptx-opacity-50" />
|
|
43
43
|
</SelectPrimitive.Icon>
|
|
44
44
|
</SelectPrimitive.Trigger>
|
|
45
45
|
));
|
|
@@ -51,10 +51,10 @@ const SelectScrollUpButton = React.forwardRef<
|
|
|
51
51
|
>(({ className, ...props }, ref) => (
|
|
52
52
|
<SelectPrimitive.ScrollUpButton
|
|
53
53
|
ref={ref}
|
|
54
|
-
className={cn('flex cursor-default items-center justify-center py-[4px]', className)}
|
|
54
|
+
className={cn('ptx-flex ptx-cursor-default ptx-items-center ptx-justify-center ptx-py-[4px]', className)}
|
|
55
55
|
{...props}
|
|
56
56
|
>
|
|
57
|
-
<ChevronUp className="h-[16px] w-[16px]" />
|
|
57
|
+
<ChevronUp className="ptx-h-[16px] ptx-w-[16px]" />
|
|
58
58
|
</SelectPrimitive.ScrollUpButton>
|
|
59
59
|
));
|
|
60
60
|
SelectScrollUpButton.displayName = SelectPrimitive.ScrollUpButton.displayName;
|
|
@@ -65,10 +65,10 @@ const SelectScrollDownButton = React.forwardRef<
|
|
|
65
65
|
>(({ className, ...props }, ref) => (
|
|
66
66
|
<SelectPrimitive.ScrollDownButton
|
|
67
67
|
ref={ref}
|
|
68
|
-
className={cn('flex cursor-default items-center justify-center py-[4px]', className)}
|
|
68
|
+
className={cn('ptx-flex ptx-cursor-default ptx-items-center ptx-justify-center ptx-py-[4px]', className)}
|
|
69
69
|
{...props}
|
|
70
70
|
>
|
|
71
|
-
<ChevronDown className="h-[16px] w-[16px]" />
|
|
71
|
+
<ChevronDown className="ptx-h-[16px] ptx-w-[16px]" />
|
|
72
72
|
</SelectPrimitive.ScrollDownButton>
|
|
73
73
|
));
|
|
74
74
|
SelectScrollDownButton.displayName = SelectPrimitive.ScrollDownButton.displayName;
|
|
@@ -81,9 +81,9 @@ const SelectContent = React.forwardRef<
|
|
|
81
81
|
<SelectPrimitive.Content
|
|
82
82
|
ref={ref}
|
|
83
83
|
className={cn(
|
|
84
|
-
'relative z-[var(--pt-z-popup,50)] max-h-[384px] min-w-[8rem] 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]: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',
|
|
84
|
+
'ptx-relative ptx-z-[var(--pt-z-popup,50)] ptx-max-h-[384px] ptx-min-w-[8rem] 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-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',
|
|
85
85
|
position === 'popper' &&
|
|
86
|
-
'data-[side=bottom]:translate-y-[4px] data-[side=left]:-translate-x-[4px] data-[side=right]:translate-x-[4px] data-[side=top]:-translate-y-[4px]',
|
|
86
|
+
'data-[side=bottom]:ptx-translate-y-[4px] data-[side=left]:-ptx-translate-x-[4px] data-[side=right]:ptx-translate-x-[4px] data-[side=top]:-ptx-translate-y-[4px]',
|
|
87
87
|
className
|
|
88
88
|
)}
|
|
89
89
|
position={position}
|
|
@@ -92,9 +92,9 @@ const SelectContent = React.forwardRef<
|
|
|
92
92
|
<SelectScrollUpButton />
|
|
93
93
|
<SelectPrimitive.Viewport
|
|
94
94
|
className={cn(
|
|
95
|
-
'p-[4px]',
|
|
95
|
+
'ptx-p-[4px]',
|
|
96
96
|
position === 'popper' &&
|
|
97
|
-
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]'
|
|
97
|
+
'ptx-h-[var(--radix-select-trigger-height)] ptx-w-full ptx-min-w-[var(--radix-select-trigger-width)]'
|
|
98
98
|
)}
|
|
99
99
|
>
|
|
100
100
|
{children}
|
|
@@ -111,7 +111,7 @@ const SelectLabel = React.forwardRef<
|
|
|
111
111
|
>(({ className, ...props }, ref) => (
|
|
112
112
|
<SelectPrimitive.Label
|
|
113
113
|
ref={ref}
|
|
114
|
-
className={cn('px-[8px] py-[6px] text-
|
|
114
|
+
className={cn('ptx-px-[8px] ptx-py-[6px] ptx-text-sm ptx-font-semibold', className)}
|
|
115
115
|
{...props}
|
|
116
116
|
/>
|
|
117
117
|
));
|
|
@@ -124,14 +124,14 @@ const SelectItem = React.forwardRef<
|
|
|
124
124
|
<SelectPrimitive.Item
|
|
125
125
|
ref={ref}
|
|
126
126
|
className={cn(
|
|
127
|
-
'relative flex w-full cursor-default select-none items-center rounded-[var(--pt-radius-sm)] py-[6px] pl-[8px] pr-[32px] text-
|
|
127
|
+
'ptx-relative ptx-flex ptx-w-full ptx-cursor-default ptx-select-none ptx-items-center ptx-rounded-[var(--pt-radius-sm)] ptx-py-[6px] ptx-pl-[8px] ptx-pr-[32px] 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
|
{...props}
|
|
131
131
|
>
|
|
132
|
-
<span className="absolute right-[8px] flex h-[14px] w-[14px] items-center justify-center">
|
|
132
|
+
<span className="ptx-absolute ptx-right-[8px] ptx-flex ptx-h-[14px] ptx-w-[14px] ptx-items-center ptx-justify-center">
|
|
133
133
|
<SelectPrimitive.ItemIndicator>
|
|
134
|
-
<Check className="h-[16px] w-[16px]" />
|
|
134
|
+
<Check className="ptx-h-[16px] ptx-w-[16px]" />
|
|
135
135
|
</SelectPrimitive.ItemIndicator>
|
|
136
136
|
</span>
|
|
137
137
|
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
@@ -145,7 +145,7 @@ const SelectSeparator = React.forwardRef<
|
|
|
145
145
|
>(({ className, ...props }, ref) => (
|
|
146
146
|
<SelectPrimitive.Separator
|
|
147
147
|
ref={ref}
|
|
148
|
-
className={cn('-mx-[4px] my-[4px] h-px bg-muted', className)}
|
|
148
|
+
className={cn('-ptx-mx-[4px] ptx-my-[4px] ptx-h-px ptx-bg-muted', className)}
|
|
149
149
|
{...props}
|
|
150
150
|
/>
|
|
151
151
|
));
|
|
@@ -12,8 +12,8 @@ const Separator = React.forwardRef<
|
|
|
12
12
|
decorative={decorative}
|
|
13
13
|
orientation={orientation}
|
|
14
14
|
className={cn(
|
|
15
|
-
'shrink-0 bg-border',
|
|
16
|
-
orientation === 'horizontal' ? 'h-px w-full' : 'h-full w-px',
|
|
15
|
+
'ptx-shrink-0 ptx-bg-border',
|
|
16
|
+
orientation === 'horizontal' ? 'ptx-h-px ptx-w-full' : 'ptx-h-full ptx-w-px',
|
|
17
17
|
className
|
|
18
18
|
)}
|
|
19
19
|
{...props}
|
|
@@ -19,8 +19,10 @@ const SheetOverlay = React.forwardRef<
|
|
|
19
19
|
>(({ className, ...props }, ref) => (
|
|
20
20
|
<SheetPrimitive.Overlay
|
|
21
21
|
ref={ref}
|
|
22
|
+
/* 稳定钩子,供消费方测试查询遮罩层;勿改名。 */
|
|
23
|
+
data-slot="sheet-overlay"
|
|
22
24
|
className={cn(
|
|
23
|
-
'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',
|
|
25
|
+
'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',
|
|
24
26
|
className
|
|
25
27
|
)}
|
|
26
28
|
{...props}
|
|
@@ -29,14 +31,14 @@ const SheetOverlay = React.forwardRef<
|
|
|
29
31
|
SheetOverlay.displayName = SheetPrimitive.Overlay.displayName;
|
|
30
32
|
|
|
31
33
|
const sheetVariants = cva(
|
|
32
|
-
'fixed z-[var(--pt-z-overlay,50)] gap-[16px] bg-background p-[24px] shadow-lg transition ease-in-out data-[state=closed]:duration-300 data-[state=open]:duration-500 data-[state=open]:animate-in data-[state=closed]:animate-out',
|
|
34
|
+
'ptx-fixed ptx-z-[var(--pt-z-overlay,50)] ptx-gap-[16px] ptx-bg-background ptx-p-[24px] ptx-shadow-lg ptx-transition ptx-ease-in-out data-[state=closed]:ptx-duration-300 data-[state=open]:ptx-duration-500 data-[state=open]:ptx-animate-in data-[state=closed]:ptx-animate-out',
|
|
33
35
|
{
|
|
34
36
|
variants: {
|
|
35
37
|
side: {
|
|
36
|
-
top: 'inset-x-0 top-0 border-b data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top',
|
|
37
|
-
bottom: 'inset-x-0 bottom-0 border-t data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom',
|
|
38
|
-
left: 'inset-y-0 left-0 h-full w-3/4 border-r data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left sm:max-w-sm',
|
|
39
|
-
right: 'inset-y-0 right-0 h-full w-3/4 border-l data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right sm:max-w-sm'
|
|
38
|
+
top: 'ptx-inset-x-0 ptx-top-0 ptx-border-b data-[state=closed]:ptx-slide-out-to-top data-[state=open]:ptx-slide-in-from-top',
|
|
39
|
+
bottom: 'ptx-inset-x-0 ptx-bottom-0 ptx-border-t data-[state=closed]:ptx-slide-out-to-bottom data-[state=open]:ptx-slide-in-from-bottom',
|
|
40
|
+
left: 'ptx-inset-y-0 ptx-left-0 ptx-h-full ptx-w-3/4 ptx-border-r data-[state=closed]:ptx-slide-out-to-left data-[state=open]:ptx-slide-in-from-left sm:ptx-max-w-sm',
|
|
41
|
+
right: 'ptx-inset-y-0 ptx-right-0 ptx-h-full ptx-w-3/4 ptx-border-l data-[state=closed]:ptx-slide-out-to-right data-[state=open]:ptx-slide-in-from-right sm:ptx-max-w-sm'
|
|
40
42
|
}
|
|
41
43
|
},
|
|
42
44
|
defaultVariants: {
|
|
@@ -64,9 +66,9 @@ const SheetContent = React.forwardRef<
|
|
|
64
66
|
{...props}
|
|
65
67
|
>
|
|
66
68
|
{children}
|
|
67
|
-
<SheetPrimitive.Close className="absolute right-[16px] top-[16px] rounded-[var(--pt-radius-sm)] opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent">
|
|
68
|
-
<X className="h-[16px] w-[16px]" />
|
|
69
|
-
<span className="sr-only">{closeLabel}</span>
|
|
69
|
+
<SheetPrimitive.Close className="ptx-absolute ptx-right-[16px] ptx-top-[16px] ptx-rounded-[var(--pt-radius-sm)] ptx-opacity-70 ptx-ring-offset-background ptx-transition-opacity hover:ptx-opacity-100 focus-visible:ptx-outline-none focus-visible:ptx-ring-2 focus-visible:ptx-ring-ring focus-visible:ptx-ring-offset-2 disabled:ptx-pointer-events-none data-[state=open]:ptx-bg-accent">
|
|
70
|
+
<X className="ptx-h-[16px] ptx-w-[16px]" />
|
|
71
|
+
<span className="ptx-sr-only">{closeLabel}</span>
|
|
70
72
|
</SheetPrimitive.Close>
|
|
71
73
|
</SheetPrimitive.Content>
|
|
72
74
|
</SheetPortal>
|
|
@@ -74,13 +76,13 @@ const SheetContent = React.forwardRef<
|
|
|
74
76
|
SheetContent.displayName = SheetPrimitive.Content.displayName;
|
|
75
77
|
|
|
76
78
|
const SheetHeader = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
77
|
-
<div className={cn('flex flex-col space-y-[8px] text-center sm:text-left', className)} {...props} />
|
|
79
|
+
<div className={cn('ptx-flex ptx-flex-col ptx-space-y-[8px] ptx-text-center sm:ptx-text-left', className)} {...props} />
|
|
78
80
|
);
|
|
79
81
|
SheetHeader.displayName = 'SheetHeader';
|
|
80
82
|
|
|
81
83
|
const SheetFooter = ({ className, ...props }: React.HTMLAttributes<HTMLDivElement>) => (
|
|
82
84
|
<div
|
|
83
|
-
className={cn('flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-[8px]', className)}
|
|
85
|
+
className={cn('ptx-flex ptx-flex-col-reverse sm:ptx-flex-row sm:ptx-justify-end sm:ptx-space-x-[8px]', className)}
|
|
84
86
|
{...props}
|
|
85
87
|
/>
|
|
86
88
|
);
|
|
@@ -92,7 +94,7 @@ const SheetTitle = React.forwardRef<
|
|
|
92
94
|
>(({ className, ...props }, ref) => (
|
|
93
95
|
<SheetPrimitive.Title
|
|
94
96
|
ref={ref}
|
|
95
|
-
className={cn('text-
|
|
97
|
+
className={cn('ptx-text-lg ptx-font-semibold ptx-text-foreground', className)}
|
|
96
98
|
{...props}
|
|
97
99
|
/>
|
|
98
100
|
));
|
|
@@ -104,7 +106,7 @@ const SheetDescription = React.forwardRef<
|
|
|
104
106
|
>(({ className, ...props }, ref) => (
|
|
105
107
|
<SheetPrimitive.Description
|
|
106
108
|
ref={ref}
|
|
107
|
-
className={cn('text-
|
|
109
|
+
className={cn('ptx-text-sm ptx-text-muted-foreground', className)}
|
|
108
110
|
{...props}
|
|
109
111
|
/>
|
|
110
112
|
));
|