@carlonicora/nextjs-jsonapi 1.17.0 → 1.19.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/README.md +1 -1
- package/dist/{BlockNoteEditor-4Z6TZBJE.mjs → BlockNoteEditor-BQ5WWVUF.mjs} +2 -2
- package/dist/{BlockNoteEditor-34T5CY27.js → BlockNoteEditor-IZR6TESC.js} +6 -6
- package/dist/{BlockNoteEditor-34T5CY27.js.map → BlockNoteEditor-IZR6TESC.js.map} +1 -1
- package/dist/{chunk-D7H7SRWB.js → chunk-FB535VUS.js} +3977 -2496
- package/dist/chunk-FB535VUS.js.map +1 -0
- package/dist/{chunk-SXPXC2TY.mjs → chunk-MVNVXOC6.mjs} +5809 -4328
- package/dist/chunk-MVNVXOC6.mjs.map +1 -0
- package/dist/client/index.js +2 -2
- package/dist/client/index.mjs +1 -1
- package/dist/components/index.d.mts +298 -385
- package/dist/components/index.d.ts +298 -385
- package/dist/components/index.js +26 -2
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +35 -11
- package/dist/contexts/index.js +2 -2
- package/dist/contexts/index.mjs +1 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/editor.template.js +20 -6
- package/dist/scripts/generate-web-module/templates/components/editor.template.js.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/selector.template.d.ts.map +1 -1
- package/dist/scripts/generate-web-module/templates/components/selector.template.js +46 -48
- package/dist/scripts/generate-web-module/templates/components/selector.template.js.map +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/index.mjs.map +1 -1
- package/package.json +6 -25
- package/scripts/generate-web-module/templates/components/editor.template.ts +20 -6
- package/scripts/generate-web-module/templates/components/selector.template.ts +46 -48
- package/src/components/forms/CommonDeleter.tsx +2 -2
- package/src/components/forms/CommonEditorTrigger.tsx +3 -3
- package/src/components/forms/DatePickerPopover.tsx +3 -1
- package/src/components/forms/DateRangeSelector.tsx +1 -1
- package/src/components/forms/FormCheckbox.tsx +1 -1
- package/src/components/forms/FormDate.tsx +3 -1
- package/src/components/forms/FormDateTime.tsx +5 -3
- package/src/components/forms/FormSelect.tsx +1 -1
- package/src/components/forms/FormSlider.tsx +4 -1
- package/src/components/forms/__tests__/FormCheckbox.test.tsx +5 -1
- package/src/components/forms/__tests__/FormDate.test.tsx +5 -1
- package/src/components/forms/__tests__/FormSelect.test.tsx +5 -1
- package/src/components/navigations/RecentPagesNavigator.tsx +2 -2
- package/src/components/tables/ContentListTable.tsx +3 -3
- package/src/features/billing/stripe-customer/components/details/PaymentMethodCard.tsx +2 -2
- package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +2 -2
- package/src/features/company/components/forms/CompanyDeleter.tsx +1 -1
- package/src/features/content/components/lists/ContentsList.tsx +1 -1
- package/src/features/notification/components/lists/NotificationsList.tsx +1 -1
- package/src/features/notification/components/modals/NotificationModal.tsx +2 -2
- package/src/features/role/components/forms/FormRoles.tsx +1 -1
- package/src/features/role/components/forms/UserRoleAdd.tsx +1 -1
- package/src/features/user/components/forms/UserEditor.tsx +2 -2
- package/src/features/user/components/forms/UserReactivator.tsx +1 -1
- package/src/features/user/components/forms/UserResentInvitationEmail.tsx +2 -2
- package/src/features/user/components/forms/UserSelector.tsx +5 -1
- package/src/features/user/components/lists/UserListInAdd.tsx +1 -1
- package/src/features/user/components/widgets/UserAvatar.tsx +37 -31
- package/src/features/user/components/widgets/UserSearchPopover.tsx +6 -2
- package/src/hooks/use-mobile.ts +1 -0
- package/src/hooks/useDataListRetriever.ts +1 -0
- package/src/lib/utils.ts +2 -0
- package/src/shadcnui/custom/multi-select.tsx +68 -76
- package/src/shadcnui/ui/accordion.tsx +64 -42
- package/src/shadcnui/ui/alert-dialog.tsx +142 -108
- package/src/shadcnui/ui/alert.tsx +64 -35
- package/src/shadcnui/ui/avatar.tsx +106 -50
- package/src/shadcnui/ui/badge.tsx +34 -26
- package/src/shadcnui/ui/breadcrumb.tsx +103 -92
- package/src/shadcnui/ui/button.tsx +30 -30
- package/src/shadcnui/ui/calendar.tsx +192 -50
- package/src/shadcnui/ui/card.tsx +94 -43
- package/src/shadcnui/ui/carousel.tsx +220 -201
- package/src/shadcnui/ui/chart.tsx +244 -190
- package/src/shadcnui/ui/checkbox.tsx +25 -25
- package/src/shadcnui/ui/collapsible.tsx +10 -4
- package/src/shadcnui/ui/combobox.tsx +292 -0
- package/src/shadcnui/ui/command.tsx +158 -126
- package/src/shadcnui/ui/context-menu.tsx +242 -164
- package/src/shadcnui/ui/dialog.tsx +125 -70
- package/src/shadcnui/ui/drawer.tsx +106 -70
- package/src/shadcnui/ui/dropdown-menu.tsx +231 -182
- package/src/shadcnui/ui/field.tsx +227 -0
- package/src/shadcnui/ui/hover-card.tsx +45 -23
- package/src/shadcnui/ui/input-group.tsx +149 -0
- package/src/shadcnui/ui/input-otp.tsx +19 -9
- package/src/shadcnui/ui/input.tsx +4 -5
- package/src/shadcnui/ui/label.tsx +16 -22
- package/src/shadcnui/ui/navigation-menu.tsx +44 -49
- package/src/shadcnui/ui/popover.tsx +81 -24
- package/src/shadcnui/ui/progress.tsx +77 -22
- package/src/shadcnui/ui/radio-group.tsx +30 -28
- package/src/shadcnui/ui/resizable.tsx +23 -17
- package/src/shadcnui/ui/scroll-area.tsx +50 -35
- package/src/shadcnui/ui/select.tsx +163 -135
- package/src/shadcnui/ui/separator.tsx +5 -8
- package/src/shadcnui/ui/sheet.tsx +40 -50
- package/src/shadcnui/ui/sidebar.tsx +317 -271
- package/src/shadcnui/ui/skeleton.tsx +2 -2
- package/src/shadcnui/ui/slider.tsx +60 -21
- package/src/shadcnui/ui/sonner.tsx +25 -1
- package/src/shadcnui/ui/switch.tsx +31 -24
- package/src/shadcnui/ui/table.tsx +84 -103
- package/src/shadcnui/ui/tabs.tsx +82 -55
- package/src/shadcnui/ui/textarea.tsx +15 -21
- package/src/shadcnui/ui/toggle.tsx +26 -21
- package/src/shadcnui/ui/tooltip.tsx +33 -24
- package/src/testing/factories/createMockApiData.ts +2 -2
- package/src/testing/factories/createMockResponse.ts +3 -8
- package/src/testing/factories/createMockService.ts +1 -4
- package/src/testing/index.ts +4 -18
- package/src/testing/matchers/jsonApiMatchers.ts +14 -16
- package/dist/chunk-D7H7SRWB.js.map +0 -1
- package/dist/chunk-SXPXC2TY.mjs.map +0 -1
- /package/dist/{BlockNoteEditor-4Z6TZBJE.mjs.map → BlockNoteEditor-BQ5WWVUF.mjs.map} +0 -0
|
@@ -1,130 +1,163 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { AlertDialog as AlertDialogPrimitive } from "@base-ui/react/alert-dialog"
|
|
5
5
|
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { Button } from "@/components/ui/button"
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props) {
|
|
10
|
+
return <AlertDialogPrimitive.Root data-slot="alert-dialog" {...props} />
|
|
11
|
+
}
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props) {
|
|
14
|
+
return (
|
|
15
|
+
<AlertDialogPrimitive.Trigger data-slot="alert-dialog-trigger" {...props} />
|
|
16
|
+
)
|
|
17
|
+
}
|
|
12
18
|
|
|
13
|
-
|
|
19
|
+
function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props) {
|
|
20
|
+
return (
|
|
21
|
+
<AlertDialogPrimitive.Portal data-slot="alert-dialog-portal" {...props} />
|
|
22
|
+
)
|
|
23
|
+
}
|
|
14
24
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
className,
|
|
23
|
-
)}
|
|
24
|
-
{...props}
|
|
25
|
-
ref={ref}
|
|
26
|
-
/>
|
|
27
|
-
));
|
|
28
|
-
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
|
|
29
|
-
|
|
30
|
-
const AlertDialogContent = React.forwardRef<
|
|
31
|
-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
|
|
32
|
-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
|
|
33
|
-
>(({ className, ...props }, ref) => (
|
|
34
|
-
<AlertDialogPortal>
|
|
35
|
-
<AlertDialogOverlay />
|
|
36
|
-
<AlertDialogPrimitive.Content
|
|
37
|
-
ref={ref}
|
|
25
|
+
function AlertDialogOverlay({
|
|
26
|
+
className,
|
|
27
|
+
...props
|
|
28
|
+
}: AlertDialogPrimitive.Backdrop.Props) {
|
|
29
|
+
return (
|
|
30
|
+
<AlertDialogPrimitive.Backdrop
|
|
31
|
+
data-slot="alert-dialog-overlay"
|
|
38
32
|
className={cn(
|
|
39
|
-
"
|
|
40
|
-
className
|
|
33
|
+
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 isolate z-50",
|
|
34
|
+
className
|
|
41
35
|
)}
|
|
42
36
|
{...props}
|
|
43
37
|
/>
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
|
|
38
|
+
)
|
|
39
|
+
}
|
|
47
40
|
|
|
48
|
-
|
|
41
|
+
function AlertDialogContent({
|
|
49
42
|
className,
|
|
43
|
+
size = "default",
|
|
50
44
|
...props
|
|
51
|
-
}:
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
45
|
+
}: AlertDialogPrimitive.Popup.Props & {
|
|
46
|
+
size?: "default" | "sm"
|
|
47
|
+
}) {
|
|
48
|
+
return (
|
|
49
|
+
<AlertDialogPortal>
|
|
50
|
+
<AlertDialogOverlay />
|
|
51
|
+
<AlertDialogPrimitive.Popup
|
|
52
|
+
data-slot="alert-dialog-content"
|
|
53
|
+
data-size={size}
|
|
54
|
+
className={cn(
|
|
55
|
+
"data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 bg-background ring-foreground/10 gap-3 rounded-xl p-4 ring-1 duration-100 data-[size=default]:max-w-xs data-[size=sm]:max-w-64 data-[size=default]:sm:max-w-sm group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 outline-none",
|
|
56
|
+
className
|
|
57
|
+
)}
|
|
58
|
+
{...props}
|
|
59
|
+
/>
|
|
60
|
+
</AlertDialogPortal>
|
|
61
|
+
)
|
|
62
|
+
}
|
|
61
63
|
|
|
62
|
-
|
|
64
|
+
function AlertDialogHeader({
|
|
63
65
|
className,
|
|
64
66
|
...props
|
|
65
|
-
}: React.
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
"
|
|
69
|
-
className,
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
AlertDialogFooter.displayName = "AlertDialogFooter";
|
|
67
|
+
}: React.ComponentProps<"div">) {
|
|
68
|
+
return (
|
|
69
|
+
<div
|
|
70
|
+
data-slot="alert-dialog-header"
|
|
71
|
+
className={cn("grid grid-rows-[auto_1fr] place-items-center gap-1 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]", className)}
|
|
72
|
+
{...props}
|
|
73
|
+
/>
|
|
74
|
+
)
|
|
75
|
+
}
|
|
75
76
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
77
|
+
function AlertDialogFooter({
|
|
78
|
+
className,
|
|
79
|
+
...props
|
|
80
|
+
}: React.ComponentProps<"div">) {
|
|
81
|
+
return (
|
|
82
|
+
<div
|
|
83
|
+
data-slot="alert-dialog-footer"
|
|
84
|
+
className={cn(
|
|
85
|
+
"flex flex-col-reverse gap-2 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end",
|
|
86
|
+
className
|
|
87
|
+
)}
|
|
88
|
+
{...props}
|
|
89
|
+
/>
|
|
90
|
+
)
|
|
91
|
+
}
|
|
87
92
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
function AlertDialogMedia({
|
|
94
|
+
className,
|
|
95
|
+
...props
|
|
96
|
+
}: React.ComponentProps<"div">) {
|
|
97
|
+
return (
|
|
98
|
+
<div
|
|
99
|
+
data-slot="alert-dialog-media"
|
|
100
|
+
className={cn("bg-muted mb-2 inline-flex size-8 items-center justify-center rounded-md sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-4", className)}
|
|
101
|
+
{...props}
|
|
102
|
+
/>
|
|
103
|
+
)
|
|
104
|
+
}
|
|
100
105
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
106
|
+
function AlertDialogTitle({
|
|
107
|
+
className,
|
|
108
|
+
...props
|
|
109
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Title>) {
|
|
110
|
+
return (
|
|
111
|
+
<AlertDialogPrimitive.Title
|
|
112
|
+
data-slot="alert-dialog-title"
|
|
113
|
+
className={cn("text-sm font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2", className)}
|
|
114
|
+
{...props}
|
|
115
|
+
/>
|
|
116
|
+
)
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
function AlertDialogDescription({
|
|
120
|
+
className,
|
|
121
|
+
...props
|
|
122
|
+
}: React.ComponentProps<typeof AlertDialogPrimitive.Description>) {
|
|
123
|
+
return (
|
|
124
|
+
<AlertDialogPrimitive.Description
|
|
125
|
+
data-slot="alert-dialog-description"
|
|
126
|
+
className={cn("text-muted-foreground *:[a]:hover:text-foreground text-xs/relaxed text-balance md:text-pretty *:[a]:underline *:[a]:underline-offset-3", className)}
|
|
127
|
+
{...props}
|
|
128
|
+
/>
|
|
129
|
+
)
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
function AlertDialogAction({
|
|
133
|
+
className,
|
|
134
|
+
...props
|
|
135
|
+
}: React.ComponentProps<typeof Button>) {
|
|
136
|
+
return (
|
|
137
|
+
<Button
|
|
138
|
+
data-slot="alert-dialog-action"
|
|
139
|
+
className={cn(className)}
|
|
140
|
+
{...props}
|
|
141
|
+
/>
|
|
142
|
+
)
|
|
143
|
+
}
|
|
112
144
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
145
|
+
function AlertDialogCancel({
|
|
146
|
+
className,
|
|
147
|
+
variant = "outline",
|
|
148
|
+
size = "default",
|
|
149
|
+
...props
|
|
150
|
+
}: AlertDialogPrimitive.Close.Props &
|
|
151
|
+
Pick<React.ComponentProps<typeof Button>, "variant" | "size">) {
|
|
152
|
+
return (
|
|
153
|
+
<AlertDialogPrimitive.Close
|
|
154
|
+
data-slot="alert-dialog-cancel"
|
|
155
|
+
className={cn(className)}
|
|
156
|
+
render={<Button variant={variant} size={size} />}
|
|
157
|
+
{...props}
|
|
158
|
+
/>
|
|
159
|
+
)
|
|
160
|
+
}
|
|
128
161
|
|
|
129
162
|
export {
|
|
130
163
|
AlertDialog,
|
|
@@ -134,8 +167,9 @@ export {
|
|
|
134
167
|
AlertDialogDescription,
|
|
135
168
|
AlertDialogFooter,
|
|
136
169
|
AlertDialogHeader,
|
|
170
|
+
AlertDialogMedia,
|
|
137
171
|
AlertDialogOverlay,
|
|
138
172
|
AlertDialogPortal,
|
|
139
173
|
AlertDialogTitle,
|
|
140
174
|
AlertDialogTrigger,
|
|
141
|
-
}
|
|
175
|
+
}
|
|
@@ -1,43 +1,72 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
3
|
|
|
4
|
-
import { cn } from "
|
|
4
|
+
import { cn } from "@/lib/utils"
|
|
5
5
|
|
|
6
|
-
const alertVariants = cva(
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
default: "bg-background text-foreground",
|
|
12
|
-
destructive: "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
defaultVariants: {
|
|
16
|
-
variant: "default",
|
|
6
|
+
const alertVariants = cva("grid gap-0.5 rounded-lg border px-2 py-1.5 text-left text-xs/relaxed has-data-[slot=alert-action]:relative has-data-[slot=alert-action]:pr-18 has-[>svg]:grid-cols-[auto_1fr] has-[>svg]:gap-x-1.5 *:[svg]:row-span-2 *:[svg]:translate-y-0.5 *:[svg]:text-current *:[svg:not([class*='size-'])]:size-3.5 w-full relative group/alert", {
|
|
7
|
+
variants: {
|
|
8
|
+
variant: {
|
|
9
|
+
default: "bg-card text-card-foreground",
|
|
10
|
+
destructive: "text-destructive bg-card *:data-[slot=alert-description]:text-destructive/90 *:[svg]:text-current",
|
|
17
11
|
},
|
|
18
12
|
},
|
|
19
|
-
|
|
13
|
+
defaultVariants: {
|
|
14
|
+
variant: "default",
|
|
15
|
+
},
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
function Alert({
|
|
19
|
+
className,
|
|
20
|
+
variant,
|
|
21
|
+
...props
|
|
22
|
+
}: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>) {
|
|
23
|
+
return (
|
|
24
|
+
<div
|
|
25
|
+
data-slot="alert"
|
|
26
|
+
role="alert"
|
|
27
|
+
className={cn(alertVariants({ variant }), className)}
|
|
28
|
+
{...props}
|
|
29
|
+
/>
|
|
30
|
+
)
|
|
31
|
+
}
|
|
20
32
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
33
|
+
function AlertTitle({ className, ...props }: React.ComponentProps<"div">) {
|
|
34
|
+
return (
|
|
35
|
+
<div
|
|
36
|
+
data-slot="alert-title"
|
|
37
|
+
className={cn(
|
|
38
|
+
"font-medium group-has-[>svg]/alert:col-start-2 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3",
|
|
39
|
+
className
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
/>
|
|
43
|
+
)
|
|
44
|
+
}
|
|
28
45
|
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
46
|
+
function AlertDescription({
|
|
47
|
+
className,
|
|
48
|
+
...props
|
|
49
|
+
}: React.ComponentProps<"div">) {
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
data-slot="alert-description"
|
|
53
|
+
className={cn(
|
|
54
|
+
"text-muted-foreground text-xs/relaxed text-balance md:text-pretty [&_p:not(:last-child)]:mb-4 [&_a]:hover:text-foreground [&_a]:underline [&_a]:underline-offset-3",
|
|
55
|
+
className
|
|
56
|
+
)}
|
|
57
|
+
{...props}
|
|
58
|
+
/>
|
|
59
|
+
)
|
|
60
|
+
}
|
|
35
61
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
<div
|
|
39
|
-
|
|
40
|
-
)
|
|
41
|
-
|
|
62
|
+
function AlertAction({ className, ...props }: React.ComponentProps<"div">) {
|
|
63
|
+
return (
|
|
64
|
+
<div
|
|
65
|
+
data-slot="alert-action"
|
|
66
|
+
className={cn("absolute top-1.5 right-2", className)}
|
|
67
|
+
{...props}
|
|
68
|
+
/>
|
|
69
|
+
)
|
|
70
|
+
}
|
|
42
71
|
|
|
43
|
-
export { Alert, AlertDescription,
|
|
72
|
+
export { Alert, AlertTitle, AlertDescription, AlertAction }
|
|
@@ -1,50 +1,106 @@
|
|
|
1
|
-
"use client"
|
|
2
|
-
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
import { cn } from "
|
|
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
|
-
|
|
1
|
+
"use client"
|
|
2
|
+
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar"
|
|
5
|
+
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
|
|
8
|
+
function Avatar({
|
|
9
|
+
className,
|
|
10
|
+
size = "default",
|
|
11
|
+
...props
|
|
12
|
+
}: AvatarPrimitive.Root.Props & {
|
|
13
|
+
size?: "default" | "sm" | "lg"
|
|
14
|
+
}) {
|
|
15
|
+
return (
|
|
16
|
+
<AvatarPrimitive.Root
|
|
17
|
+
data-slot="avatar"
|
|
18
|
+
data-size={size}
|
|
19
|
+
className={cn(
|
|
20
|
+
"size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 after:border-border group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten",
|
|
21
|
+
className
|
|
22
|
+
)}
|
|
23
|
+
{...props}
|
|
24
|
+
/>
|
|
25
|
+
)
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
|
|
29
|
+
return (
|
|
30
|
+
<AvatarPrimitive.Image
|
|
31
|
+
data-slot="avatar-image"
|
|
32
|
+
className={cn(
|
|
33
|
+
"rounded-full aspect-square size-full object-cover",
|
|
34
|
+
className
|
|
35
|
+
)}
|
|
36
|
+
{...props}
|
|
37
|
+
/>
|
|
38
|
+
)
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
function AvatarFallback({
|
|
42
|
+
className,
|
|
43
|
+
...props
|
|
44
|
+
}: AvatarPrimitive.Fallback.Props) {
|
|
45
|
+
return (
|
|
46
|
+
<AvatarPrimitive.Fallback
|
|
47
|
+
data-slot="avatar-fallback"
|
|
48
|
+
className={cn(
|
|
49
|
+
"bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs",
|
|
50
|
+
className
|
|
51
|
+
)}
|
|
52
|
+
{...props}
|
|
53
|
+
/>
|
|
54
|
+
)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
|
|
58
|
+
return (
|
|
59
|
+
<span
|
|
60
|
+
data-slot="avatar-badge"
|
|
61
|
+
className={cn(
|
|
62
|
+
"bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none",
|
|
63
|
+
"group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
|
|
64
|
+
"group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
|
|
65
|
+
"group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
|
|
66
|
+
className
|
|
67
|
+
)}
|
|
68
|
+
{...props}
|
|
69
|
+
/>
|
|
70
|
+
)
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
|
|
74
|
+
return (
|
|
75
|
+
<div
|
|
76
|
+
data-slot="avatar-group"
|
|
77
|
+
className={cn(
|
|
78
|
+
"*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",
|
|
79
|
+
className
|
|
80
|
+
)}
|
|
81
|
+
{...props}
|
|
82
|
+
/>
|
|
83
|
+
)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
function AvatarGroupCount({
|
|
87
|
+
className,
|
|
88
|
+
...props
|
|
89
|
+
}: React.ComponentProps<"div">) {
|
|
90
|
+
return (
|
|
91
|
+
<div
|
|
92
|
+
data-slot="avatar-group-count"
|
|
93
|
+
className={cn("bg-muted text-muted-foreground size-8 rounded-full text-xs/relaxed group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3 ring-background relative flex shrink-0 items-center justify-center ring-2", className)}
|
|
94
|
+
{...props}
|
|
95
|
+
/>
|
|
96
|
+
)
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export {
|
|
100
|
+
Avatar,
|
|
101
|
+
AvatarImage,
|
|
102
|
+
AvatarFallback,
|
|
103
|
+
AvatarGroup,
|
|
104
|
+
AvatarGroupCount,
|
|
105
|
+
AvatarBadge,
|
|
106
|
+
}
|
|
@@ -1,40 +1,48 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { mergeProps } from "@base-ui/react/merge-props"
|
|
2
|
+
import { useRender } from "@base-ui/react/use-render"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
3
4
|
|
|
4
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
5
6
|
|
|
6
7
|
const badgeVariants = cva(
|
|
7
|
-
"
|
|
8
|
+
"h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",
|
|
8
9
|
{
|
|
9
10
|
variants: {
|
|
10
11
|
variant: {
|
|
11
|
-
default: "
|
|
12
|
-
secondary: "
|
|
13
|
-
destructive: "
|
|
14
|
-
outline: "text-foreground",
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
green: "border-transparent bg-emerald-500 text-primary-foreground rounded-full",
|
|
18
|
-
red: "border-transparent bg-red-500 text-primary-foreground rounded-full",
|
|
19
|
-
yellow: "border-transparent bg-yellow-500 text-primary-foreground rounded-full",
|
|
20
|
-
purple: "border-transparent bg-purple-500 text-primary-foreground rounded-full",
|
|
21
|
-
pink: "border-transparent bg-pink-500 text-primary-foreground rounded-full",
|
|
22
|
-
gray: "border-transparent bg-gray-500 text-primary-foreground rounded-full",
|
|
23
|
-
orange: "border-transparent bg-orange-500 text-primary-foreground rounded-full",
|
|
24
|
-
teal: "border-transparent bg-teal-500 text-primary-foreground rounded-full",
|
|
25
|
-
lime: "border-transparent bg-lime-500 text-primary-foreground rounded-full",
|
|
12
|
+
default: "bg-primary text-primary-foreground [a]:hover:bg-primary/80",
|
|
13
|
+
secondary: "bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80",
|
|
14
|
+
destructive: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
|
|
15
|
+
outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",
|
|
16
|
+
ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
|
|
17
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
26
18
|
},
|
|
27
19
|
},
|
|
28
20
|
defaultVariants: {
|
|
29
21
|
variant: "default",
|
|
30
22
|
},
|
|
31
|
-
}
|
|
32
|
-
)
|
|
33
|
-
|
|
34
|
-
export interface BadgeProps extends React.HTMLAttributes<HTMLDivElement>, VariantProps<typeof badgeVariants> {}
|
|
23
|
+
}
|
|
24
|
+
)
|
|
35
25
|
|
|
36
|
-
function Badge({
|
|
37
|
-
|
|
26
|
+
function Badge({
|
|
27
|
+
className,
|
|
28
|
+
variant = "default",
|
|
29
|
+
render,
|
|
30
|
+
...props
|
|
31
|
+
}: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
|
|
32
|
+
return useRender({
|
|
33
|
+
defaultTagName: "span",
|
|
34
|
+
props: mergeProps<"span">(
|
|
35
|
+
{
|
|
36
|
+
className: cn(badgeVariants({ className, variant })),
|
|
37
|
+
},
|
|
38
|
+
props
|
|
39
|
+
),
|
|
40
|
+
render,
|
|
41
|
+
state: {
|
|
42
|
+
slot: "badge",
|
|
43
|
+
variant,
|
|
44
|
+
},
|
|
45
|
+
})
|
|
38
46
|
}
|
|
39
47
|
|
|
40
|
-
export { Badge, badgeVariants }
|
|
48
|
+
export { Badge, badgeVariants }
|