create-nextjs-cms 0.9.15 → 0.9.17
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/package.json +3 -3
- package/templates/default/components/ItemEditPage.tsx +25 -25
- package/templates/default/components/LocaleSwitcher.tsx +32 -23
- package/templates/default/components/SectionPage.tsx +1 -0
- package/templates/default/components/form/helpers/_section-hot-reload.js +1 -1
- package/templates/default/components/ui/alert-dialog.tsx +84 -128
- package/templates/default/components/ui/alert.tsx +1 -1
- package/templates/default/components/ui/button.tsx +64 -62
- package/templates/default/components/ui/calendar.tsx +220 -166
- package/templates/default/components/ui/checkbox.tsx +29 -29
- package/templates/default/components/ui/command.tsx +1 -1
- package/templates/default/components/ui/custom-alert-dialog.tsx +2 -2
- package/templates/default/components/ui/custom-dialog.tsx +3 -3
- package/templates/default/components/ui/dialog.tsx +3 -3
- package/templates/default/components/ui/dropdown-menu.tsx +9 -9
- package/templates/default/components/ui/input-group.tsx +1 -1
- package/templates/default/components/ui/scroll-area.tsx +1 -1
- package/templates/default/components/ui/select.tsx +3 -3
- package/templates/default/components/ui/sheet.tsx +3 -3
- package/templates/default/components/ui/switch.tsx +1 -1
- package/templates/default/components/ui/table.tsx +2 -2
- package/templates/default/components/ui/toast.tsx +3 -3
- package/templates/default/components/ui/use-toast.ts +0 -1
- package/templates/default/components.json +25 -21
- package/templates/default/dynamic-schemas/schema.ts +1 -1
- package/templates/default/package.json +3 -2
|
@@ -1,166 +1,220 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import * as React from
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import {
|
|
5
|
+
ChevronDownIcon,
|
|
6
|
+
ChevronLeftIcon,
|
|
7
|
+
ChevronRightIcon,
|
|
8
|
+
} from "lucide-react"
|
|
9
|
+
import {
|
|
10
|
+
DayPicker,
|
|
11
|
+
getDefaultClassNames,
|
|
12
|
+
type DayButton,
|
|
13
|
+
} from "react-day-picker"
|
|
14
|
+
|
|
15
|
+
import { cn } from "@/lib/utils"
|
|
16
|
+
import { Button, buttonVariants } from "@/components/ui/button"
|
|
17
|
+
|
|
18
|
+
function Calendar({
|
|
19
|
+
className,
|
|
20
|
+
classNames,
|
|
21
|
+
showOutsideDays = true,
|
|
22
|
+
captionLayout = "label",
|
|
23
|
+
buttonVariant = "ghost",
|
|
24
|
+
formatters,
|
|
25
|
+
components,
|
|
26
|
+
...props
|
|
27
|
+
}: React.ComponentProps<typeof DayPicker> & {
|
|
28
|
+
buttonVariant?: React.ComponentProps<typeof Button>["variant"]
|
|
29
|
+
}) {
|
|
30
|
+
const defaultClassNames = getDefaultClassNames()
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<DayPicker
|
|
34
|
+
showOutsideDays={showOutsideDays}
|
|
35
|
+
className={cn(
|
|
36
|
+
"group/calendar bg-background p-3 [--cell-size:--spacing(8)] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",
|
|
37
|
+
String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
|
|
38
|
+
String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
captionLayout={captionLayout}
|
|
42
|
+
formatters={{
|
|
43
|
+
formatMonthDropdown: (date) =>
|
|
44
|
+
date.toLocaleString("default", { month: "short" }),
|
|
45
|
+
...formatters,
|
|
46
|
+
}}
|
|
47
|
+
classNames={{
|
|
48
|
+
root: cn("w-fit", defaultClassNames.root),
|
|
49
|
+
months: cn(
|
|
50
|
+
"relative flex flex-col gap-4 md:flex-row",
|
|
51
|
+
defaultClassNames.months
|
|
52
|
+
),
|
|
53
|
+
month: cn("flex w-full flex-col gap-4", defaultClassNames.month),
|
|
54
|
+
nav: cn(
|
|
55
|
+
"absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",
|
|
56
|
+
defaultClassNames.nav
|
|
57
|
+
),
|
|
58
|
+
button_previous: cn(
|
|
59
|
+
buttonVariants({ variant: buttonVariant }),
|
|
60
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
61
|
+
defaultClassNames.button_previous
|
|
62
|
+
),
|
|
63
|
+
button_next: cn(
|
|
64
|
+
buttonVariants({ variant: buttonVariant }),
|
|
65
|
+
"size-(--cell-size) p-0 select-none aria-disabled:opacity-50",
|
|
66
|
+
defaultClassNames.button_next
|
|
67
|
+
),
|
|
68
|
+
month_caption: cn(
|
|
69
|
+
"flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)",
|
|
70
|
+
defaultClassNames.month_caption
|
|
71
|
+
),
|
|
72
|
+
dropdowns: cn(
|
|
73
|
+
"flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium",
|
|
74
|
+
defaultClassNames.dropdowns
|
|
75
|
+
),
|
|
76
|
+
dropdown_root: cn(
|
|
77
|
+
"relative rounded-md border border-input shadow-xs has-focus:border-ring has-focus:ring-[3px] has-focus:ring-ring/50",
|
|
78
|
+
defaultClassNames.dropdown_root
|
|
79
|
+
),
|
|
80
|
+
dropdown: cn(
|
|
81
|
+
"absolute inset-0 bg-popover opacity-0",
|
|
82
|
+
defaultClassNames.dropdown
|
|
83
|
+
),
|
|
84
|
+
caption_label: cn(
|
|
85
|
+
"font-medium select-none",
|
|
86
|
+
captionLayout === "label"
|
|
87
|
+
? "text-sm"
|
|
88
|
+
: "flex h-8 items-center gap-1 rounded-md pe-1 ps-2 text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground",
|
|
89
|
+
defaultClassNames.caption_label
|
|
90
|
+
),
|
|
91
|
+
table: "w-full border-collapse",
|
|
92
|
+
weekdays: cn("flex", defaultClassNames.weekdays),
|
|
93
|
+
weekday: cn(
|
|
94
|
+
"flex-1 rounded-md text-[0.8rem] font-normal text-muted-foreground select-none",
|
|
95
|
+
defaultClassNames.weekday
|
|
96
|
+
),
|
|
97
|
+
week: cn("mt-2 flex w-full", defaultClassNames.week),
|
|
98
|
+
week_number_header: cn(
|
|
99
|
+
"w-(--cell-size) select-none",
|
|
100
|
+
defaultClassNames.week_number_header
|
|
101
|
+
),
|
|
102
|
+
week_number: cn(
|
|
103
|
+
"text-[0.8rem] text-muted-foreground select-none",
|
|
104
|
+
defaultClassNames.week_number
|
|
105
|
+
),
|
|
106
|
+
day: cn(
|
|
107
|
+
"group/day relative aspect-square h-full w-full p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-e-md",
|
|
108
|
+
props.showWeekNumber
|
|
109
|
+
? "[&:nth-child(2)[data-selected=true]_button]:rounded-s-md"
|
|
110
|
+
: "[&:first-child[data-selected=true]_button]:rounded-s-md",
|
|
111
|
+
defaultClassNames.day
|
|
112
|
+
),
|
|
113
|
+
range_start: cn(
|
|
114
|
+
"rounded-s-md bg-accent",
|
|
115
|
+
defaultClassNames.range_start
|
|
116
|
+
),
|
|
117
|
+
range_middle: cn("rounded-none", defaultClassNames.range_middle),
|
|
118
|
+
range_end: cn("rounded-e-md bg-accent", defaultClassNames.range_end),
|
|
119
|
+
today: cn(
|
|
120
|
+
"rounded-md bg-accent text-accent-foreground data-[selected=true]:rounded-none",
|
|
121
|
+
defaultClassNames.today
|
|
122
|
+
),
|
|
123
|
+
outside: cn(
|
|
124
|
+
"text-muted-foreground aria-selected:text-muted-foreground",
|
|
125
|
+
defaultClassNames.outside
|
|
126
|
+
),
|
|
127
|
+
disabled: cn(
|
|
128
|
+
"text-muted-foreground opacity-50",
|
|
129
|
+
defaultClassNames.disabled
|
|
130
|
+
),
|
|
131
|
+
hidden: cn("invisible", defaultClassNames.hidden),
|
|
132
|
+
...classNames,
|
|
133
|
+
}}
|
|
134
|
+
components={{
|
|
135
|
+
Root: ({ className, rootRef, ...props }) => {
|
|
136
|
+
return (
|
|
137
|
+
<div
|
|
138
|
+
data-slot="calendar"
|
|
139
|
+
ref={rootRef}
|
|
140
|
+
className={cn(className)}
|
|
141
|
+
{...props}
|
|
142
|
+
/>
|
|
143
|
+
)
|
|
144
|
+
},
|
|
145
|
+
Chevron: ({ className, orientation, ...props }) => {
|
|
146
|
+
if (orientation === "left") {
|
|
147
|
+
return (
|
|
148
|
+
<ChevronLeftIcon className={cn("size-4", className)} {...props} />
|
|
149
|
+
)
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (orientation === "right") {
|
|
153
|
+
return (
|
|
154
|
+
<ChevronRightIcon
|
|
155
|
+
className={cn("size-4", className)}
|
|
156
|
+
{...props}
|
|
157
|
+
/>
|
|
158
|
+
)
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
return (
|
|
162
|
+
<ChevronDownIcon className={cn("size-4", className)} {...props} />
|
|
163
|
+
)
|
|
164
|
+
},
|
|
165
|
+
DayButton: CalendarDayButton,
|
|
166
|
+
WeekNumber: ({ children, ...props }) => {
|
|
167
|
+
return (
|
|
168
|
+
<td {...props}>
|
|
169
|
+
<div className="flex size-(--cell-size) items-center justify-center text-center">
|
|
170
|
+
{children}
|
|
171
|
+
</div>
|
|
172
|
+
</td>
|
|
173
|
+
)
|
|
174
|
+
},
|
|
175
|
+
...components,
|
|
176
|
+
}}
|
|
177
|
+
{...props}
|
|
178
|
+
/>
|
|
179
|
+
)
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
function CalendarDayButton({
|
|
183
|
+
className,
|
|
184
|
+
day,
|
|
185
|
+
modifiers,
|
|
186
|
+
...props
|
|
187
|
+
}: React.ComponentProps<typeof DayButton>) {
|
|
188
|
+
const defaultClassNames = getDefaultClassNames()
|
|
189
|
+
|
|
190
|
+
const ref = React.useRef<HTMLButtonElement>(null)
|
|
191
|
+
React.useEffect(() => {
|
|
192
|
+
if (modifiers.focused) ref.current?.focus()
|
|
193
|
+
}, [modifiers.focused])
|
|
194
|
+
|
|
195
|
+
return (
|
|
196
|
+
<Button
|
|
197
|
+
ref={ref}
|
|
198
|
+
variant="ghost"
|
|
199
|
+
size="icon"
|
|
200
|
+
data-day={day.date.toLocaleDateString()}
|
|
201
|
+
data-selected-single={
|
|
202
|
+
modifiers.selected &&
|
|
203
|
+
!modifiers.range_start &&
|
|
204
|
+
!modifiers.range_end &&
|
|
205
|
+
!modifiers.range_middle
|
|
206
|
+
}
|
|
207
|
+
data-range-start={modifiers.range_start}
|
|
208
|
+
data-range-end={modifiers.range_end}
|
|
209
|
+
data-range-middle={modifiers.range_middle}
|
|
210
|
+
className={cn(
|
|
211
|
+
"flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-md data-[range-end=true]:rounded-e-md data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:rounded-md data-[range-start=true]:rounded-s-md data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-accent-foreground [&>span]:text-xs [&>span]:opacity-70",
|
|
212
|
+
defaultClassNames.day,
|
|
213
|
+
className
|
|
214
|
+
)}
|
|
215
|
+
{...props}
|
|
216
|
+
/>
|
|
217
|
+
)
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
export { Calendar, CalendarDayButton }
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import * as React from 'react'
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import { cn } from '@/lib/utils'
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
)
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
export { Checkbox }
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import * as React from 'react'
|
|
4
|
+
import { CheckIcon } from 'lucide-react'
|
|
5
|
+
import { Checkbox as CheckboxPrimitive } from 'radix-ui'
|
|
6
|
+
|
|
7
|
+
import { cn } from '@/lib/utils'
|
|
8
|
+
|
|
9
|
+
function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
10
|
+
return (
|
|
11
|
+
<CheckboxPrimitive.Root
|
|
12
|
+
data-slot='checkbox'
|
|
13
|
+
className={cn(
|
|
14
|
+
'peer border-input focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
>
|
|
19
|
+
<CheckboxPrimitive.Indicator
|
|
20
|
+
data-slot='checkbox-indicator'
|
|
21
|
+
className='grid place-content-center text-current transition-none'
|
|
22
|
+
>
|
|
23
|
+
<CheckIcon className='size-3.5' />
|
|
24
|
+
</CheckboxPrimitive.Indicator>
|
|
25
|
+
</CheckboxPrimitive.Root>
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export { Checkbox }
|
|
@@ -118,7 +118,7 @@ function CommandShortcut({ className, ...props }: React.ComponentProps<'span'>)
|
|
|
118
118
|
return (
|
|
119
119
|
<span
|
|
120
120
|
data-slot='command-shortcut'
|
|
121
|
-
className={cn('text-muted-foreground
|
|
121
|
+
className={cn('text-muted-foreground ms-auto text-xs tracking-widest', className)}
|
|
122
122
|
{...props}
|
|
123
123
|
/>
|
|
124
124
|
)
|
|
@@ -38,7 +38,7 @@ function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof
|
|
|
38
38
|
<AlertDialogPrimitive.Content
|
|
39
39
|
data-slot='alert-dialog-content'
|
|
40
40
|
className={cn(
|
|
41
|
-
'bg-background 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 fixed
|
|
41
|
+
'bg-background 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 fixed start-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 rtl:-translate-x-[-50%]',
|
|
42
42
|
className,
|
|
43
43
|
)}
|
|
44
44
|
{...props}
|
|
@@ -51,7 +51,7 @@ function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>)
|
|
|
51
51
|
return (
|
|
52
52
|
<div
|
|
53
53
|
data-slot='alert-dialog-header'
|
|
54
|
-
className={cn('flex flex-col gap-2 text-center sm:text-
|
|
54
|
+
className={cn('flex flex-col gap-2 text-center sm:text-start', className)}
|
|
55
55
|
{...props}
|
|
56
56
|
/>
|
|
57
57
|
)
|
|
@@ -49,7 +49,7 @@ function DialogContent({
|
|
|
49
49
|
<DialogPrimitive.Content
|
|
50
50
|
data-slot='dialog-content'
|
|
51
51
|
className={cn(
|
|
52
|
-
'bg-background 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 fixed
|
|
52
|
+
'bg-background 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 fixed start-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] border p-6 shadow-lg duration-200 outline-none rtl:-translate-x-[-50%]',
|
|
53
53
|
className,
|
|
54
54
|
)}
|
|
55
55
|
{...props}
|
|
@@ -58,7 +58,7 @@ function DialogContent({
|
|
|
58
58
|
{showCloseButton && (
|
|
59
59
|
<DialogPrimitive.Close
|
|
60
60
|
data-slot='dialog-close'
|
|
61
|
-
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute
|
|
61
|
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
62
62
|
>
|
|
63
63
|
<XIcon />
|
|
64
64
|
<span className='sr-only'>Close</span>
|
|
@@ -73,7 +73,7 @@ function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
73
73
|
return (
|
|
74
74
|
<div
|
|
75
75
|
data-slot='dialog-header'
|
|
76
|
-
className={cn('flex flex-col gap-2 text-center sm:text-
|
|
76
|
+
className={cn('flex flex-col gap-2 text-center sm:text-start', className)}
|
|
77
77
|
{...props}
|
|
78
78
|
/>
|
|
79
79
|
)
|
|
@@ -49,7 +49,7 @@ function DialogContent({
|
|
|
49
49
|
<DialogPrimitive.Content
|
|
50
50
|
data-slot='dialog-content'
|
|
51
51
|
className={cn(
|
|
52
|
-
'bg-background 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 fixed
|
|
52
|
+
'bg-background 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 fixed start-[50%] top-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 outline-none sm:max-w-lg rtl:-translate-x-[-50%]',
|
|
53
53
|
className,
|
|
54
54
|
)}
|
|
55
55
|
{...props}
|
|
@@ -58,7 +58,7 @@ function DialogContent({
|
|
|
58
58
|
{showCloseButton && (
|
|
59
59
|
<DialogPrimitive.Close
|
|
60
60
|
data-slot='dialog-close'
|
|
61
|
-
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute
|
|
61
|
+
className="ring-offset-background focus:ring-ring data-[state=open]:bg-accent data-[state=open]:text-muted-foreground absolute end-4 top-4 rounded-xs opacity-70 transition-opacity hover:opacity-100 focus:ring-2 focus:ring-offset-2 focus:outline-hidden disabled:pointer-events-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4"
|
|
62
62
|
>
|
|
63
63
|
<XIcon />
|
|
64
64
|
<span className='sr-only'>Close</span>
|
|
@@ -73,7 +73,7 @@ function DialogHeader({ className, ...props }: React.ComponentProps<'div'>) {
|
|
|
73
73
|
return (
|
|
74
74
|
<div
|
|
75
75
|
data-slot='dialog-header'
|
|
76
|
-
className={cn('flex flex-col gap-2 text-center sm:text-
|
|
76
|
+
className={cn('flex flex-col gap-2 text-center sm:text-start', className)}
|
|
77
77
|
{...props}
|
|
78
78
|
/>
|
|
79
79
|
)
|
|
@@ -28,13 +28,13 @@ const DropdownMenuSubTrigger = React.forwardRef<
|
|
|
28
28
|
ref={ref}
|
|
29
29
|
className={cn(
|
|
30
30
|
'focus:bg-accent data-[state=open]:bg-accent flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none',
|
|
31
|
-
inset && '
|
|
31
|
+
inset && 'ps-8',
|
|
32
32
|
className,
|
|
33
33
|
)}
|
|
34
34
|
{...props}
|
|
35
35
|
>
|
|
36
36
|
{children}
|
|
37
|
-
<ChevronRightIcon className='
|
|
37
|
+
<ChevronRightIcon className='ms-auto h-4 w-4' />
|
|
38
38
|
</DropdownMenuPrimitive.SubTrigger>
|
|
39
39
|
))
|
|
40
40
|
DropdownMenuSubTrigger.displayName = DropdownMenuPrimitive.SubTrigger.displayName
|
|
@@ -83,7 +83,7 @@ const DropdownMenuItem = React.forwardRef<
|
|
|
83
83
|
ref={ref}
|
|
84
84
|
className={cn(
|
|
85
85
|
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
86
|
-
inset && '
|
|
86
|
+
inset && 'ps-8',
|
|
87
87
|
className,
|
|
88
88
|
)}
|
|
89
89
|
{...props}
|
|
@@ -98,13 +98,13 @@ const DropdownMenuCheckboxItem = React.forwardRef<
|
|
|
98
98
|
<DropdownMenuPrimitive.CheckboxItem
|
|
99
99
|
ref={ref}
|
|
100
100
|
className={cn(
|
|
101
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5
|
|
101
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
102
102
|
className,
|
|
103
103
|
)}
|
|
104
104
|
checked={checked}
|
|
105
105
|
{...props}
|
|
106
106
|
>
|
|
107
|
-
<span className='absolute
|
|
107
|
+
<span className='absolute start-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
108
108
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
109
109
|
<CheckIcon className='h-4 w-4' />
|
|
110
110
|
</DropdownMenuPrimitive.ItemIndicator>
|
|
@@ -121,12 +121,12 @@ const DropdownMenuRadioItem = React.forwardRef<
|
|
|
121
121
|
<DropdownMenuPrimitive.RadioItem
|
|
122
122
|
ref={ref}
|
|
123
123
|
className={cn(
|
|
124
|
-
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5
|
|
124
|
+
'focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center rounded-sm py-1.5 ps-8 pe-2 text-sm outline-hidden transition-colors select-none data-disabled:pointer-events-none data-disabled:opacity-50',
|
|
125
125
|
className,
|
|
126
126
|
)}
|
|
127
127
|
{...props}
|
|
128
128
|
>
|
|
129
|
-
<span className='absolute
|
|
129
|
+
<span className='absolute start-2 flex h-3.5 w-3.5 items-center justify-center'>
|
|
130
130
|
<DropdownMenuPrimitive.ItemIndicator>
|
|
131
131
|
<DotFilledIcon className='h-4 w-4 fill-current' />
|
|
132
132
|
</DropdownMenuPrimitive.ItemIndicator>
|
|
@@ -144,7 +144,7 @@ const DropdownMenuLabel = React.forwardRef<
|
|
|
144
144
|
>(({ className, inset, ...props }, ref) => (
|
|
145
145
|
<DropdownMenuPrimitive.Label
|
|
146
146
|
ref={ref}
|
|
147
|
-
className={cn('px-2 py-1.5 text-sm font-semibold', inset && '
|
|
147
|
+
className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'ps-8', className)}
|
|
148
148
|
{...props}
|
|
149
149
|
/>
|
|
150
150
|
))
|
|
@@ -159,7 +159,7 @@ const DropdownMenuSeparator = React.forwardRef<
|
|
|
159
159
|
DropdownMenuSeparator.displayName = DropdownMenuPrimitive.Separator.displayName
|
|
160
160
|
|
|
161
161
|
const DropdownMenuShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
|
|
162
|
-
return <span className={cn('
|
|
162
|
+
return <span className={cn('ms-auto text-xs tracking-widest opacity-60', className)} {...props} />
|
|
163
163
|
}
|
|
164
164
|
DropdownMenuShortcut.displayName = 'DropdownMenuShortcut'
|
|
165
165
|
|
|
@@ -8,7 +8,7 @@ const InputGroup = React.forwardRef<HTMLDivElement, React.HTMLAttributes<HTMLDiv
|
|
|
8
8
|
<div
|
|
9
9
|
ref={ref}
|
|
10
10
|
className={cn(
|
|
11
|
-
'flex items-stretch overflow-hidden rounded shadow-xs ring-2 ring-gray-300 outline-0
|
|
11
|
+
'flex items-stretch overflow-hidden rounded shadow-xs ring-2 ring-gray-300 outline-0 focus-within:ring-blue-500 hover:ring-gray-400 hover:focus-within:ring-blue-500',
|
|
12
12
|
className,
|
|
13
13
|
)}
|
|
14
14
|
{...props}
|
|
@@ -28,7 +28,7 @@ const ScrollBar = React.forwardRef<
|
|
|
28
28
|
orientation={orientation}
|
|
29
29
|
className={cn(
|
|
30
30
|
'flex touch-none transition-colors select-none',
|
|
31
|
-
orientation === 'vertical' && 'h-full w-2.5 border-
|
|
31
|
+
orientation === 'vertical' && 'h-full w-2.5 border-s border-s-transparent p-px',
|
|
32
32
|
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent p-px',
|
|
33
33
|
className,
|
|
34
34
|
)}
|