@carlonicora/nextjs-jsonapi 1.16.0 → 1.18.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/ApiData-DPKNfY-9.d.mts +10 -0
- package/dist/ApiData-DPKNfY-9.d.ts +10 -0
- package/dist/ApiRequestDataTypeInterface-DIEOFn9s.d.mts +40 -0
- package/dist/ApiRequestDataTypeInterface-DIEOFn9s.d.ts +40 -0
- package/dist/{ApiResponseInterface-BvWIeLkq.d.ts → ApiResponseInterface-BKyod24U.d.ts} +2 -11
- package/dist/{ApiResponseInterface-CAbw0sv7.d.mts → ApiResponseInterface-Dqvu09tz.d.mts} +2 -11
- package/dist/{BlockNoteEditor-HFX7Z5BQ.mjs → BlockNoteEditor-6TWTNHNZ.mjs} +7 -6
- package/dist/{BlockNoteEditor-HFX7Z5BQ.mjs.map → BlockNoteEditor-6TWTNHNZ.mjs.map} +1 -1
- package/dist/{BlockNoteEditor-MBFDWP7X.js → BlockNoteEditor-C3WWGGT6.js} +17 -16
- package/dist/BlockNoteEditor-C3WWGGT6.js.map +1 -0
- package/dist/JsonApiContext-Bsm_Q2oe.d.mts +41 -0
- package/dist/JsonApiContext-Bsm_Q2oe.d.ts +41 -0
- package/dist/JsonApiRequest-54ZBO7WQ.js +24 -0
- package/dist/{JsonApiRequest-45CLE65I.js.map → JsonApiRequest-54ZBO7WQ.js.map} +1 -1
- package/dist/{JsonApiRequest-6IPS3DZJ.mjs → JsonApiRequest-XWQWTFEQ.mjs} +2 -2
- package/dist/chunk-3EPNHTMH.js +26 -0
- package/dist/chunk-3EPNHTMH.js.map +1 -0
- package/dist/{chunk-BCKYJQ3K.mjs → chunk-3VM3WAOV.mjs} +1 -1
- package/dist/{chunk-ONB2DAIV.js → chunk-6U6QCSJK.js} +4224 -2775
- package/dist/chunk-6U6QCSJK.js.map +1 -0
- package/dist/{chunk-R5QSSISB.js → chunk-7DTKRMYW.js} +21 -14
- package/dist/chunk-7DTKRMYW.js.map +1 -0
- package/dist/{chunk-BCQSE3EU.mjs → chunk-KUFWHMMY.mjs} +8 -8
- package/dist/{chunk-POKIJ56Q.mjs → chunk-KX7YG6LY.mjs} +22 -15
- package/dist/chunk-KX7YG6LY.mjs.map +1 -0
- package/dist/{chunk-GPGJNTHP.js → chunk-LI6CPNJI.js} +1 -1
- package/dist/{chunk-GPGJNTHP.js.map → chunk-LI6CPNJI.js.map} +1 -1
- package/dist/{chunk-2AZLCF6D.js → chunk-UYY34W7R.js} +28 -28
- package/dist/{chunk-2AZLCF6D.js.map → chunk-UYY34W7R.js.map} +1 -1
- package/dist/{chunk-5RAUCUAA.mjs → chunk-UZDAPWJG.mjs} +5645 -4196
- package/dist/chunk-UZDAPWJG.mjs.map +1 -0
- package/dist/chunk-VOXD3ZLY.mjs +26 -0
- package/dist/chunk-VOXD3ZLY.mjs.map +1 -0
- package/dist/client/index.d.mts +11 -45
- package/dist/client/index.d.ts +11 -45
- package/dist/client/index.js +9 -7
- package/dist/client/index.js.map +1 -1
- package/dist/client/index.mjs +11 -9
- package/dist/components/index.d.mts +302 -388
- package/dist/components/index.d.ts +302 -388
- package/dist/components/index.js +31 -6
- package/dist/components/index.js.map +1 -1
- package/dist/components/index.mjs +40 -15
- package/dist/{config-DEaUbBqR.d.ts → config--nwiW74Z.d.ts} +1 -1
- package/dist/{config-CWsTwnsK.d.mts → config-BKSQmUWU.d.mts} +1 -1
- package/dist/{content.interface-D_4b4RQt.d.ts → content.interface-4VICFRA0.d.ts} +2 -1
- package/dist/{content.interface-Dk4UZcJM.d.mts → content.interface-CFc97-Cj.d.mts} +2 -1
- package/dist/contexts/index.d.mts +3 -2
- package/dist/contexts/index.d.ts +3 -2
- package/dist/contexts/index.js +7 -6
- package/dist/contexts/index.js.map +1 -1
- package/dist/contexts/index.mjs +6 -5
- package/dist/core/index.d.mts +11 -8
- package/dist/core/index.d.ts +11 -8
- package/dist/core/index.js +4 -4
- package/dist/core/index.js.map +1 -1
- package/dist/core/index.mjs +3 -3
- package/dist/index.d.mts +15 -11
- package/dist/index.d.ts +15 -11
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -6
- package/dist/{notification.interface-BllkURRm.d.ts → notification.interface-BGaPiCUM.d.mts} +2 -40
- package/dist/{notification.interface-BllkURRm.d.mts → notification.interface-CqwaOIgM.d.ts} +2 -40
- package/dist/{s3.service-BEfGqho0.d.ts → s3.service-BYs88XEE.d.ts} +3 -2
- package/dist/{s3.service-DIQRYe93.d.mts → s3.service-C0BjOdvn.d.mts} +3 -2
- 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 +45 -48
- package/dist/scripts/generate-web-module/templates/components/selector.template.js.map +1 -1
- package/dist/server/index.d.mts +6 -4
- package/dist/server/index.d.ts +6 -4
- package/dist/server/index.js +13 -13
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +3 -3
- package/dist/{stripe-subscription.interface-C63L6hVg.d.mts → stripe-subscription.interface-B-TM40Io.d.ts} +1 -1
- package/dist/{stripe-subscription.interface-CUvNDvw5.d.ts → stripe-subscription.interface-DDxnpj0F.d.mts} +1 -1
- package/dist/testing/index.d.mts +338 -0
- package/dist/testing/index.d.ts +338 -0
- package/dist/testing/index.js +323 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/index.mjs +323 -0
- package/dist/testing/index.mjs.map +1 -0
- package/dist/{useSocket-BpenBR2z.d.mts → useSocket-BNj9PrRw.d.mts} +1 -1
- package/dist/{useSocket-D-QYA0Sr.d.ts → useSocket-Dwt8cz1x.d.ts} +1 -1
- package/package.json +26 -27
- package/scripts/generate-web-module/templates/components/editor.template.ts +20 -6
- package/scripts/generate-web-module/templates/components/selector.template.ts +45 -48
- package/src/client/hooks/__tests__/useJsonApiGet.test.tsx +229 -0
- package/src/client/hooks/__tests__/useJsonApiMutation.test.tsx +348 -0
- package/src/client/hooks/__tests__/useRehydration.test.ts +188 -0
- 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 +242 -0
- package/src/components/forms/__tests__/FormDate.test.tsx +216 -0
- package/src/components/forms/__tests__/FormInput.test.tsx +292 -0
- package/src/components/forms/__tests__/FormSelect.test.tsx +177 -0
- package/src/components/navigations/RecentPagesNavigator.tsx +2 -2
- package/src/components/tables/ContentListTable.tsx +3 -3
- package/src/components/tables/__tests__/ContentListTable.test.tsx +411 -0
- package/src/core/endpoint/__tests__/EndpointCreator.test.ts +168 -0
- package/src/core/factories/__tests__/JsonApiDataFactory.test.ts +109 -0
- package/src/core/factories/__tests__/RehydrationFactory.test.ts +151 -0
- package/src/core/registry/__tests__/DataClassRegistry.test.ts +136 -0
- package/src/core/registry/__tests__/ModuleRegistrar.test.ts +159 -0
- package/src/features/auth/components/details/LandingComponent.tsx +14 -12
- 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/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/widgets/UserAvatar.tsx +37 -31
- package/src/features/user/components/widgets/UserSearchPopover.tsx +1 -1
- package/src/hooks/__tests__/useDataListRetriever.test.ts +321 -0
- package/src/hooks/__tests__/useDebounce.test.ts +170 -0
- package/src/hooks/use-mobile.ts +1 -0
- package/src/index.ts +4 -1
- package/src/lib/utils.ts +2 -0
- package/src/login/config.ts +27 -0
- package/src/login/index.ts +2 -0
- package/src/shadcnui/custom/multi-select.tsx +10 -21
- 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 +143 -0
- package/src/testing/factories/createMockModule.ts +32 -0
- package/src/testing/factories/createMockResponse.ts +88 -0
- package/src/testing/factories/createMockService.ts +76 -0
- package/src/testing/index.ts +56 -0
- package/src/testing/matchers/jsonApiMatchers.ts +172 -0
- package/src/testing/providers/MockJsonApiProvider.tsx +58 -0
- package/src/testing/utils/renderWithProviders.tsx +76 -0
- package/src/utils/__tests__/date-formatter.test.ts +161 -0
- package/src/utils/__tests__/exists.test.ts +100 -0
- package/src/utils/cn.test.ts +44 -0
- package/dist/BlockNoteEditor-MBFDWP7X.js.map +0 -1
- package/dist/JsonApiRequest-45CLE65I.js +0 -24
- package/dist/chunk-5RAUCUAA.mjs.map +0 -1
- package/dist/chunk-ONB2DAIV.js.map +0 -1
- package/dist/chunk-POKIJ56Q.mjs.map +0 -1
- package/dist/chunk-R5QSSISB.js.map +0 -1
- package/src/discord/config.ts +0 -15
- package/src/discord/index.ts +0 -1
- /package/dist/{JsonApiRequest-6IPS3DZJ.mjs.map → JsonApiRequest-XWQWTFEQ.mjs.map} +0 -0
- /package/dist/{chunk-BCKYJQ3K.mjs.map → chunk-3VM3WAOV.mjs.map} +0 -0
- /package/dist/{chunk-BCQSE3EU.mjs.map → chunk-KUFWHMMY.mjs.map} +0 -0
|
@@ -1,154 +1,182 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
CheckIcon,
|
|
6
|
-
ChevronDownIcon,
|
|
7
|
-
ChevronUpIcon,
|
|
8
|
-
} from "@radix-ui/react-icons";
|
|
9
|
-
import * as SelectPrimitive from "@radix-ui/react-select";
|
|
10
|
-
import * as React from "react";
|
|
3
|
+
import * as React from "react"
|
|
4
|
+
import { Select as SelectPrimitive } from "@base-ui/react/select"
|
|
11
5
|
|
|
12
|
-
import { cn } from "
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { ChevronDownIcon, CheckIcon, ChevronUpIcon } from "lucide-react"
|
|
13
8
|
|
|
14
|
-
const Select = SelectPrimitive.Root
|
|
9
|
+
const Select = SelectPrimitive.Root
|
|
15
10
|
|
|
16
|
-
|
|
11
|
+
function SelectGroup({ className, ...props }: SelectPrimitive.Group.Props) {
|
|
12
|
+
return (
|
|
13
|
+
<SelectPrimitive.Group
|
|
14
|
+
data-slot="select-group"
|
|
15
|
+
className={cn("scroll-my-1 p-1", className)}
|
|
16
|
+
{...props}
|
|
17
|
+
/>
|
|
18
|
+
)
|
|
19
|
+
}
|
|
17
20
|
|
|
18
|
-
|
|
21
|
+
function SelectValue({ className, ...props }: SelectPrimitive.Value.Props) {
|
|
22
|
+
return (
|
|
23
|
+
<SelectPrimitive.Value
|
|
24
|
+
data-slot="select-value"
|
|
25
|
+
className={cn("flex flex-1 text-left", className)}
|
|
26
|
+
{...props}
|
|
27
|
+
/>
|
|
28
|
+
)
|
|
29
|
+
}
|
|
19
30
|
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
31
|
+
function SelectTrigger({
|
|
32
|
+
className,
|
|
33
|
+
size = "default",
|
|
34
|
+
children,
|
|
35
|
+
...props
|
|
36
|
+
}: SelectPrimitive.Trigger.Props & {
|
|
37
|
+
size?: "sm" | "default"
|
|
38
|
+
}) {
|
|
39
|
+
return (
|
|
40
|
+
<SelectPrimitive.Trigger
|
|
41
|
+
data-slot="select-trigger"
|
|
42
|
+
data-size={size}
|
|
43
|
+
className={cn(
|
|
44
|
+
"border-input data-[placeholder]:text-muted-foreground bg-input/20 dark:bg-input/30 dark:hover:bg-input/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 gap-1.5 rounded-md border px-2 py-1.5 text-xs/relaxed transition-colors focus-visible:ring-[2px] aria-invalid:ring-[2px] data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:flex *:data-[slot=select-value]:gap-1.5 [&_svg:not([class*='size-'])]:size-3.5 flex w-fit items-center justify-between whitespace-nowrap outline-none disabled:cursor-not-allowed disabled:opacity-50 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
45
|
+
className
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
>
|
|
49
|
+
{children}
|
|
50
|
+
<SelectPrimitive.Icon
|
|
51
|
+
render={
|
|
52
|
+
<ChevronDownIcon className="text-muted-foreground size-3.5 pointer-events-none" />
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
</SelectPrimitive.Trigger>
|
|
56
|
+
)
|
|
57
|
+
}
|
|
39
58
|
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
59
|
+
function SelectContent({
|
|
60
|
+
className,
|
|
61
|
+
children,
|
|
62
|
+
side = "bottom",
|
|
63
|
+
sideOffset = 4,
|
|
64
|
+
align = "center",
|
|
65
|
+
alignOffset = 0,
|
|
66
|
+
alignItemWithTrigger = true,
|
|
67
|
+
...props
|
|
68
|
+
}: SelectPrimitive.Popup.Props &
|
|
69
|
+
Pick<
|
|
70
|
+
SelectPrimitive.Positioner.Props,
|
|
71
|
+
"align" | "alignOffset" | "side" | "sideOffset" | "alignItemWithTrigger"
|
|
72
|
+
>) {
|
|
73
|
+
return (
|
|
74
|
+
<SelectPrimitive.Portal>
|
|
75
|
+
<SelectPrimitive.Positioner
|
|
76
|
+
side={side}
|
|
77
|
+
sideOffset={sideOffset}
|
|
78
|
+
align={align}
|
|
79
|
+
alignOffset={alignOffset}
|
|
80
|
+
alignItemWithTrigger={alignItemWithTrigger}
|
|
81
|
+
className="isolate z-50"
|
|
82
|
+
>
|
|
83
|
+
<SelectPrimitive.Popup
|
|
84
|
+
data-slot="select-content"
|
|
85
|
+
className={cn("bg-popover text-popover-foreground 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 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 ring-foreground/10 min-w-32 rounded-lg shadow-md ring-1 duration-100 relative isolate z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto", className )}
|
|
86
|
+
{...props}
|
|
87
|
+
>
|
|
88
|
+
<SelectScrollUpButton />
|
|
89
|
+
<SelectPrimitive.List>{children}</SelectPrimitive.List>
|
|
90
|
+
<SelectScrollDownButton />
|
|
91
|
+
</SelectPrimitive.Popup>
|
|
92
|
+
</SelectPrimitive.Positioner>
|
|
93
|
+
</SelectPrimitive.Portal>
|
|
94
|
+
)
|
|
95
|
+
}
|
|
56
96
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
"
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
<ChevronDownIcon />
|
|
70
|
-
</SelectPrimitive.ScrollDownButton>
|
|
71
|
-
));
|
|
72
|
-
SelectScrollDownButton.displayName =
|
|
73
|
-
SelectPrimitive.ScrollDownButton.displayName;
|
|
97
|
+
function SelectLabel({
|
|
98
|
+
className,
|
|
99
|
+
...props
|
|
100
|
+
}: SelectPrimitive.GroupLabel.Props) {
|
|
101
|
+
return (
|
|
102
|
+
<SelectPrimitive.GroupLabel
|
|
103
|
+
data-slot="select-label"
|
|
104
|
+
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
105
|
+
{...props}
|
|
106
|
+
/>
|
|
107
|
+
)
|
|
108
|
+
}
|
|
74
109
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
110
|
+
function SelectItem({
|
|
111
|
+
className,
|
|
112
|
+
children,
|
|
113
|
+
...props
|
|
114
|
+
}: SelectPrimitive.Item.Props) {
|
|
115
|
+
return (
|
|
116
|
+
<SelectPrimitive.Item
|
|
117
|
+
data-slot="select-item"
|
|
82
118
|
className={cn(
|
|
83
|
-
"
|
|
84
|
-
|
|
85
|
-
"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",
|
|
86
|
-
className,
|
|
119
|
+
"focus:bg-accent focus:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2 relative flex w-full cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
120
|
+
className
|
|
87
121
|
)}
|
|
88
|
-
position={position}
|
|
89
122
|
{...props}
|
|
90
123
|
>
|
|
91
|
-
<
|
|
92
|
-
<SelectPrimitive.Viewport
|
|
93
|
-
className={cn(
|
|
94
|
-
"p-1",
|
|
95
|
-
position === "popper" &&
|
|
96
|
-
"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]",
|
|
97
|
-
)}
|
|
98
|
-
>
|
|
124
|
+
<SelectPrimitive.ItemText className="flex flex-1 gap-2 shrink-0 whitespace-nowrap">
|
|
99
125
|
{children}
|
|
100
|
-
</SelectPrimitive.
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
126
|
+
</SelectPrimitive.ItemText>
|
|
127
|
+
<SelectPrimitive.ItemIndicator
|
|
128
|
+
render={<span className="pointer-events-none absolute right-2 flex items-center justify-center" />}
|
|
129
|
+
>
|
|
130
|
+
<CheckIcon className="pointer-events-none" />
|
|
131
|
+
</SelectPrimitive.ItemIndicator>
|
|
132
|
+
</SelectPrimitive.Item>
|
|
133
|
+
)
|
|
134
|
+
}
|
|
106
135
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
136
|
+
function SelectSeparator({
|
|
137
|
+
className,
|
|
138
|
+
...props
|
|
139
|
+
}: SelectPrimitive.Separator.Props) {
|
|
140
|
+
return (
|
|
141
|
+
<SelectPrimitive.Separator
|
|
142
|
+
data-slot="select-separator"
|
|
143
|
+
className={cn("bg-border/50 -mx-1 my-1 h-px pointer-events-none", className)}
|
|
144
|
+
{...props}
|
|
145
|
+
/>
|
|
146
|
+
)
|
|
147
|
+
}
|
|
118
148
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
</SelectPrimitive.ItemIndicator>
|
|
135
|
-
</span>
|
|
136
|
-
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
137
|
-
</SelectPrimitive.Item>
|
|
138
|
-
));
|
|
139
|
-
SelectItem.displayName = SelectPrimitive.Item.displayName;
|
|
149
|
+
function SelectScrollUpButton({
|
|
150
|
+
className,
|
|
151
|
+
...props
|
|
152
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollUpArrow>) {
|
|
153
|
+
return (
|
|
154
|
+
<SelectPrimitive.ScrollUpArrow
|
|
155
|
+
data-slot="select-scroll-up-button"
|
|
156
|
+
className={cn("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 top-0 w-full", className)}
|
|
157
|
+
{...props}
|
|
158
|
+
>
|
|
159
|
+
<ChevronUpIcon
|
|
160
|
+
/>
|
|
161
|
+
</SelectPrimitive.ScrollUpArrow>
|
|
162
|
+
)
|
|
163
|
+
}
|
|
140
164
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
165
|
+
function SelectScrollDownButton({
|
|
166
|
+
className,
|
|
167
|
+
...props
|
|
168
|
+
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownArrow>) {
|
|
169
|
+
return (
|
|
170
|
+
<SelectPrimitive.ScrollDownArrow
|
|
171
|
+
data-slot="select-scroll-down-button"
|
|
172
|
+
className={cn("bg-popover z-10 flex cursor-default items-center justify-center py-1 [&_svg:not([class*='size-'])]:size-3.5 bottom-0 w-full", className)}
|
|
173
|
+
{...props}
|
|
174
|
+
>
|
|
175
|
+
<ChevronDownIcon
|
|
176
|
+
/>
|
|
177
|
+
</SelectPrimitive.ScrollDownArrow>
|
|
178
|
+
)
|
|
179
|
+
}
|
|
152
180
|
|
|
153
181
|
export {
|
|
154
182
|
Select,
|
|
@@ -161,4 +189,4 @@ export {
|
|
|
161
189
|
SelectSeparator,
|
|
162
190
|
SelectTrigger,
|
|
163
191
|
SelectValue,
|
|
164
|
-
}
|
|
192
|
+
}
|
|
@@ -1,23 +1,20 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
|
-
import
|
|
4
|
-
import * as SeparatorPrimitive from "@radix-ui/react-separator"
|
|
3
|
+
import { Separator as SeparatorPrimitive } from "@base-ui/react/separator"
|
|
5
4
|
|
|
6
|
-
import { cn } from "
|
|
5
|
+
import { cn } from "@/lib/utils"
|
|
7
6
|
|
|
8
7
|
function Separator({
|
|
9
8
|
className,
|
|
10
9
|
orientation = "horizontal",
|
|
11
|
-
decorative = true,
|
|
12
10
|
...props
|
|
13
|
-
}:
|
|
11
|
+
}: SeparatorPrimitive.Props) {
|
|
14
12
|
return (
|
|
15
|
-
<SeparatorPrimitive
|
|
13
|
+
<SeparatorPrimitive
|
|
16
14
|
data-slot="separator"
|
|
17
|
-
decorative={decorative}
|
|
18
15
|
orientation={orientation}
|
|
19
16
|
className={cn(
|
|
20
|
-
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:
|
|
17
|
+
"bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:w-px data-[orientation=vertical]:self-stretch",
|
|
21
18
|
className
|
|
22
19
|
)}
|
|
23
20
|
{...props}
|
|
@@ -1,44 +1,33 @@
|
|
|
1
1
|
"use client"
|
|
2
2
|
|
|
3
3
|
import * as React from "react"
|
|
4
|
-
import
|
|
5
|
-
import { XIcon } from "lucide-react"
|
|
4
|
+
import { Dialog as SheetPrimitive } from "@base-ui/react/dialog"
|
|
6
5
|
|
|
7
|
-
import { cn } from "
|
|
6
|
+
import { cn } from "@/lib/utils"
|
|
7
|
+
import { Button } from "@/components/ui/button"
|
|
8
|
+
import { XIcon } from "lucide-react"
|
|
8
9
|
|
|
9
|
-
function Sheet({ ...props }:
|
|
10
|
+
function Sheet({ ...props }: SheetPrimitive.Root.Props) {
|
|
10
11
|
return <SheetPrimitive.Root data-slot="sheet" {...props} />
|
|
11
12
|
}
|
|
12
13
|
|
|
13
|
-
function SheetTrigger({
|
|
14
|
-
...props
|
|
15
|
-
}: React.ComponentProps<typeof SheetPrimitive.Trigger>) {
|
|
14
|
+
function SheetTrigger({ ...props }: SheetPrimitive.Trigger.Props) {
|
|
16
15
|
return <SheetPrimitive.Trigger data-slot="sheet-trigger" {...props} />
|
|
17
16
|
}
|
|
18
17
|
|
|
19
|
-
function SheetClose({
|
|
20
|
-
...props
|
|
21
|
-
}: React.ComponentProps<typeof SheetPrimitive.Close>) {
|
|
18
|
+
function SheetClose({ ...props }: SheetPrimitive.Close.Props) {
|
|
22
19
|
return <SheetPrimitive.Close data-slot="sheet-close" {...props} />
|
|
23
20
|
}
|
|
24
21
|
|
|
25
|
-
function SheetPortal({
|
|
26
|
-
...props
|
|
27
|
-
}: React.ComponentProps<typeof SheetPrimitive.Portal>) {
|
|
22
|
+
function SheetPortal({ ...props }: SheetPrimitive.Portal.Props) {
|
|
28
23
|
return <SheetPrimitive.Portal data-slot="sheet-portal" {...props} />
|
|
29
24
|
}
|
|
30
25
|
|
|
31
|
-
function SheetOverlay({
|
|
32
|
-
className,
|
|
33
|
-
...props
|
|
34
|
-
}: React.ComponentProps<typeof SheetPrimitive.Overlay>) {
|
|
26
|
+
function SheetOverlay({ className, ...props }: SheetPrimitive.Backdrop.Props) {
|
|
35
27
|
return (
|
|
36
|
-
<SheetPrimitive.
|
|
28
|
+
<SheetPrimitive.Backdrop
|
|
37
29
|
data-slot="sheet-overlay"
|
|
38
|
-
className={cn(
|
|
39
|
-
"data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50",
|
|
40
|
-
className
|
|
41
|
-
)}
|
|
30
|
+
className={cn("data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 bg-black/80 duration-100 data-ending-style:opacity-0 data-starting-style:opacity-0 supports-backdrop-filter:backdrop-blur-xs fixed inset-0 z-50", className)}
|
|
42
31
|
{...props}
|
|
43
32
|
/>
|
|
44
33
|
)
|
|
@@ -48,35 +37,39 @@ function SheetContent({
|
|
|
48
37
|
className,
|
|
49
38
|
children,
|
|
50
39
|
side = "right",
|
|
40
|
+
showCloseButton = true,
|
|
51
41
|
...props
|
|
52
|
-
}:
|
|
42
|
+
}: SheetPrimitive.Popup.Props & {
|
|
53
43
|
side?: "top" | "right" | "bottom" | "left"
|
|
44
|
+
showCloseButton?: boolean
|
|
54
45
|
}) {
|
|
55
46
|
return (
|
|
56
47
|
<SheetPortal>
|
|
57
48
|
<SheetOverlay />
|
|
58
|
-
<SheetPrimitive.
|
|
49
|
+
<SheetPrimitive.Popup
|
|
59
50
|
data-slot="sheet-content"
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
side === "right" &&
|
|
63
|
-
"data-[state=closed]:slide-out-to-right data-[state=open]:slide-in-from-right inset-y-0 right-0 h-full w-3/4 border-l sm:max-w-sm",
|
|
64
|
-
side === "left" &&
|
|
65
|
-
"data-[state=closed]:slide-out-to-left data-[state=open]:slide-in-from-left inset-y-0 left-0 h-full w-3/4 border-r sm:max-w-sm",
|
|
66
|
-
side === "top" &&
|
|
67
|
-
"data-[state=closed]:slide-out-to-top data-[state=open]:slide-in-from-top inset-x-0 top-0 h-auto border-b",
|
|
68
|
-
side === "bottom" &&
|
|
69
|
-
"data-[state=closed]:slide-out-to-bottom data-[state=open]:slide-in-from-bottom inset-x-0 bottom-0 h-auto border-t",
|
|
70
|
-
className
|
|
71
|
-
)}
|
|
51
|
+
data-side={side}
|
|
52
|
+
className={cn("bg-background data-open:animate-in data-closed:animate-out data-[side=right]:data-closed:slide-out-to-right-10 data-[side=right]:data-open:slide-in-from-right-10 data-[side=left]:data-closed:slide-out-to-left-10 data-[side=left]:data-open:slide-in-from-left-10 data-[side=top]:data-closed:slide-out-to-top-10 data-[side=top]:data-open:slide-in-from-top-10 data-closed:fade-out-0 data-open:fade-in-0 data-[side=bottom]:data-closed:slide-out-to-bottom-10 data-[side=bottom]:data-open:slide-in-from-bottom-10 fixed z-50 flex flex-col bg-clip-padding text-xs/relaxed shadow-lg transition duration-200 ease-in-out data-[side=bottom]:inset-x-0 data-[side=bottom]:bottom-0 data-[side=bottom]:h-auto data-[side=bottom]:border-t data-[side=left]:inset-y-0 data-[side=left]:left-0 data-[side=left]:h-full data-[side=left]:w-3/4 data-[side=left]:border-r data-[side=right]:inset-y-0 data-[side=right]:right-0 data-[side=right]:h-full data-[side=right]:w-3/4 data-[side=right]:border-l data-[side=top]:inset-x-0 data-[side=top]:top-0 data-[side=top]:h-auto data-[side=top]:border-b data-[side=left]:sm:max-w-sm data-[side=right]:sm:max-w-sm", className)}
|
|
72
53
|
{...props}
|
|
73
54
|
>
|
|
74
55
|
{children}
|
|
75
|
-
|
|
76
|
-
<
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
56
|
+
{showCloseButton && (
|
|
57
|
+
<SheetPrimitive.Close
|
|
58
|
+
data-slot="sheet-close"
|
|
59
|
+
render={
|
|
60
|
+
<Button
|
|
61
|
+
variant="ghost"
|
|
62
|
+
className="absolute top-4 right-4"
|
|
63
|
+
size="icon-sm"
|
|
64
|
+
/>
|
|
65
|
+
}
|
|
66
|
+
>
|
|
67
|
+
<XIcon
|
|
68
|
+
/>
|
|
69
|
+
<span className="sr-only">Close</span>
|
|
70
|
+
</SheetPrimitive.Close>
|
|
71
|
+
)}
|
|
72
|
+
</SheetPrimitive.Popup>
|
|
80
73
|
</SheetPortal>
|
|
81
74
|
)
|
|
82
75
|
}
|
|
@@ -85,7 +78,7 @@ function SheetHeader({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
85
78
|
return (
|
|
86
79
|
<div
|
|
87
80
|
data-slot="sheet-header"
|
|
88
|
-
className={cn("
|
|
81
|
+
className={cn("gap-1.5 p-6 flex flex-col", className)}
|
|
89
82
|
{...props}
|
|
90
83
|
/>
|
|
91
84
|
)
|
|
@@ -95,20 +88,17 @@ function SheetFooter({ className, ...props }: React.ComponentProps<"div">) {
|
|
|
95
88
|
return (
|
|
96
89
|
<div
|
|
97
90
|
data-slot="sheet-footer"
|
|
98
|
-
className={cn("mt-auto flex flex-col
|
|
91
|
+
className={cn("gap-2 p-6 mt-auto flex flex-col", className)}
|
|
99
92
|
{...props}
|
|
100
93
|
/>
|
|
101
94
|
)
|
|
102
95
|
}
|
|
103
96
|
|
|
104
|
-
function SheetTitle({
|
|
105
|
-
className,
|
|
106
|
-
...props
|
|
107
|
-
}: React.ComponentProps<typeof SheetPrimitive.Title>) {
|
|
97
|
+
function SheetTitle({ className, ...props }: SheetPrimitive.Title.Props) {
|
|
108
98
|
return (
|
|
109
99
|
<SheetPrimitive.Title
|
|
110
100
|
data-slot="sheet-title"
|
|
111
|
-
className={cn("text-foreground font-
|
|
101
|
+
className={cn("text-foreground text-sm font-medium", className)}
|
|
112
102
|
{...props}
|
|
113
103
|
/>
|
|
114
104
|
)
|
|
@@ -117,11 +107,11 @@ function SheetTitle({
|
|
|
117
107
|
function SheetDescription({
|
|
118
108
|
className,
|
|
119
109
|
...props
|
|
120
|
-
}:
|
|
110
|
+
}: SheetPrimitive.Description.Props) {
|
|
121
111
|
return (
|
|
122
112
|
<SheetPrimitive.Description
|
|
123
113
|
data-slot="sheet-description"
|
|
124
|
-
className={cn("text-muted-foreground text-
|
|
114
|
+
className={cn("text-muted-foreground text-xs/relaxed", className)}
|
|
125
115
|
{...props}
|
|
126
116
|
/>
|
|
127
117
|
)
|