@carlonicora/nextjs-jsonapi 1.36.0 → 1.37.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/dist/{BlockNoteEditor-N3J42SBY.js → BlockNoteEditor-74FHJO7E.js} +15 -15
- package/dist/{BlockNoteEditor-N3J42SBY.js.map → BlockNoteEditor-74FHJO7E.js.map} +1 -1
- package/dist/{BlockNoteEditor-KFUTQVUK.mjs → BlockNoteEditor-GTWR6CPI.mjs} +5 -5
- package/dist/BlockNoteEditor-GTWR6CPI.mjs.map +1 -0
- package/dist/billing/index.d.mts +3 -3
- package/dist/billing/index.d.ts +3 -3
- package/dist/billing/index.js +404 -402
- package/dist/billing/index.js.map +1 -1
- package/dist/billing/index.mjs +81 -79
- package/dist/billing/index.mjs.map +1 -1
- package/dist/{chunk-NNCTRU4O.js → chunk-53IPQJVH.js} +10 -19
- package/dist/chunk-53IPQJVH.js.map +1 -0
- package/dist/{chunk-YZV24UWN.mjs → chunk-P7R2DPD6.mjs} +10 -19
- package/dist/{chunk-YZV24UWN.mjs.map → chunk-P7R2DPD6.mjs.map} +1 -1
- package/dist/{chunk-S2RZBQP4.js → chunk-YVEK3SUS.js} +998 -1699
- package/dist/chunk-YVEK3SUS.js.map +1 -0
- package/dist/{chunk-DLJTN632.mjs → chunk-ZUUH4CQC.mjs} +737 -1438
- package/dist/chunk-ZUUH4CQC.mjs.map +1 -0
- package/dist/client/index.js +3 -3
- package/dist/client/index.mjs +2 -2
- package/dist/components/index.d.mts +23 -8
- package/dist/components/index.d.ts +23 -8
- package/dist/components/index.js +3 -3
- package/dist/components/index.mjs +2 -2
- package/dist/contexts/index.d.mts +1 -1
- package/dist/contexts/index.d.ts +1 -1
- package/dist/contexts/index.js +3 -3
- package/dist/contexts/index.mjs +2 -2
- package/dist/core/index.js +2 -2
- package/dist/core/index.mjs +1 -1
- package/dist/index.js +2 -2
- package/dist/index.mjs +1 -1
- package/dist/server/index.js +3 -3
- package/dist/server/index.mjs +1 -1
- package/dist/testing/index.js.map +1 -1
- package/dist/testing/index.mjs.map +1 -1
- package/package.json +2 -2
- package/src/client/context/JsonApiProvider.tsx +1 -5
- package/src/client/hooks/__tests__/useJsonApiGet.test.tsx +9 -9
- package/src/client/hooks/__tests__/useJsonApiMutation.test.tsx +11 -11
- package/src/client/hooks/__tests__/useRehydration.test.ts +13 -34
- package/src/components/editors/BlockNoteEditor.tsx +2 -2
- package/src/components/forms/CommonEditorTrigger.tsx +1 -1
- package/src/components/forms/FormCheckbox.tsx +2 -12
- package/src/components/forms/FormDate.tsx +1 -6
- package/src/components/forms/FormInput.tsx +1 -1
- package/src/components/forms/FormPassword.tsx +1 -7
- package/src/components/forms/FormSelect.tsx +2 -8
- package/src/components/forms/FormSlider.tsx +1 -5
- package/src/components/forms/FormSwitch.tsx +1 -5
- package/src/components/forms/GdprConsentCheckbox.tsx +2 -8
- package/src/components/forms/PasswordInput.tsx +28 -26
- package/src/components/forms/__tests__/FormCheckbox.test.tsx +16 -18
- package/src/components/forms/__tests__/FormDate.test.tsx +14 -30
- package/src/components/forms/__tests__/FormInput.test.tsx +21 -37
- package/src/components/forms/__tests__/FormSelect.test.tsx +15 -21
- package/src/components/tables/ContentListTable.tsx +1 -1
- package/src/components/tables/__tests__/ContentListTable.test.tsx +17 -89
- package/src/components/tables/cells/cell.component.tsx +1 -1
- package/src/contexts/HeaderChildrenContext.tsx +3 -1
- package/src/core/endpoint/__tests__/EndpointCreator.test.ts +2 -7
- package/src/core/factories/__tests__/JsonApiDataFactory.test.ts +3 -3
- package/src/core/factories/__tests__/RehydrationFactory.test.ts +4 -6
- package/src/core/registry/__tests__/DataClassRegistry.test.ts +5 -15
- package/src/core/registry/__tests__/ModuleRegistrar.test.ts +5 -15
- package/src/features/auth/components/GdprConsentSection.tsx +1 -6
- package/src/features/auth/components/details/LandingComponent.tsx +6 -1
- package/src/features/auth/components/forms/AcceptInvitation.tsx +1 -1
- package/src/features/auth/components/forms/ResetPassword.tsx +1 -1
- package/src/features/billing/components/cards/PaymentMethodSummaryCard.tsx +13 -18
- package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +7 -1
- package/src/features/billing/components/modals/BillingDetailModal.tsx +2 -13
- package/src/features/billing/stripe-customer/components/details/PaymentMethodCard.tsx +8 -1
- package/src/features/billing/stripe-customer/components/forms/PaymentMethodEditor.tsx +2 -13
- package/src/features/billing/stripe-customer/components/forms/PaymentMethodForm.tsx +2 -12
- package/src/features/billing/stripe-invoice/components/details/InvoiceDetails.tsx +6 -1
- package/src/features/billing/stripe-price/components/lists/PricesList.tsx +13 -5
- package/src/features/billing/stripe-product/components/lists/ProductsList.tsx +5 -5
- package/src/features/billing/stripe-subscription/components/containers/SubscriptionsContainer.tsx +1 -3
- package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +4 -1
- package/src/features/billing/stripe-subscription/components/forms/CancelSubscriptionDialog.tsx +1 -1
- package/src/features/billing/stripe-subscription/components/lists/SubscriptionsList.tsx +4 -1
- package/src/features/billing/stripe-subscription/components/widgets/PricingCard.tsx +9 -2
- package/src/features/billing/stripe-subscription/components/widgets/SubscriptionStatusBadge.tsx +3 -1
- package/src/features/billing/stripe-subscription/components/wizards/SubscriptionWizard.tsx +1 -7
- package/src/features/billing/stripe-subscription/components/wizards/WizardProgressIndicator.tsx +2 -10
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepPaymentMethod.tsx +3 -13
- package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +5 -16
- package/src/features/billing/stripe-usage/components/details/UsageSummaryCard.tsx +1 -1
- package/src/features/billing/stripe-usage/components/lists/UsageHistoryTable.tsx +1 -1
- package/src/features/company/components/details/CompanyDetails.tsx +2 -2
- package/src/features/company/components/forms/CompanyConfigurationSecurityForm.tsx +1 -1
- package/src/features/company/components/forms/CompanyDeleter.tsx +0 -23
- package/src/features/company/data/company.service.ts +9 -20
- package/src/features/notification/components/containers/NotificationsListContainer.tsx +1 -1
- package/src/features/notification/components/modals/NotificationModal.tsx +6 -2
- package/src/features/notification/contexts/NotificationContext.tsx +1 -3
- package/src/features/oauth/components/OAuthClientCard.tsx +15 -17
- package/src/features/oauth/components/OAuthClientDetail.tsx +7 -19
- package/src/features/oauth/components/OAuthClientForm.tsx +4 -13
- package/src/features/oauth/components/OAuthClientSecretDisplay.tsx +4 -20
- package/src/features/oauth/components/OAuthRedirectUriInput.tsx +5 -12
- package/src/features/oauth/components/OAuthScopeSelector.tsx +17 -23
- package/src/features/oauth/components/consent/OAuthConsentActions.tsx +3 -16
- package/src/features/oauth/components/consent/OAuthConsentHeader.tsx +3 -12
- package/src/features/oauth/components/consent/OAuthConsentScreen.tsx +5 -20
- package/src/features/oauth/components/consent/OAuthScopeList.tsx +3 -18
- package/src/features/onboarding/contexts/OnboardingContext.tsx +3 -3
- package/src/features/role/components/forms/FormRoles.tsx +1 -7
- package/src/features/user/components/containers/UserContainer.tsx +1 -1
- package/src/features/user/components/details/UserDetails.tsx +1 -1
- package/src/features/user/components/forms/UserDeleter.tsx +1 -1
- package/src/features/user/components/forms/UserEditor.tsx +1 -1
- package/src/features/user/components/forms/UserMultiSelect.tsx +7 -7
- package/src/features/user/components/lists/UserListInAdd.tsx +2 -2
- package/src/features/user/components/lists/UsersList.tsx +7 -1
- package/src/features/user/contexts/CurrentUserContext.tsx +36 -33
- package/src/hooks/__tests__/useDataListRetriever.test.ts +15 -21
- package/src/hooks/__tests__/useDebounce.test.ts +2 -7
- package/src/hooks/useCustomD3Graph.tsx +2 -2
- package/src/shadcnui/custom/multi-select.tsx +28 -2
- package/src/shadcnui/ui/accordion.tsx +21 -23
- package/src/shadcnui/ui/alert-dialog.tsx +45 -62
- package/src/shadcnui/ui/alert.tsx +25 -41
- package/src/shadcnui/ui/avatar.tsx +23 -36
- package/src/shadcnui/ui/badge.tsx +13 -11
- package/src/shadcnui/ui/breadcrumb.tsx +21 -55
- package/src/shadcnui/ui/button.tsx +17 -18
- package/src/shadcnui/ui/calendar.tsx +44 -93
- package/src/shadcnui/ui/carousel.tsx +72 -100
- package/src/shadcnui/ui/chart.tsx +102 -161
- package/src/shadcnui/ui/checkbox.tsx +8 -9
- package/src/shadcnui/ui/combobox.tsx +52 -83
- package/src/shadcnui/ui/command.tsx +43 -77
- package/src/shadcnui/ui/context-menu.tsx +47 -86
- package/src/shadcnui/ui/dialog.tsx +34 -60
- package/src/shadcnui/ui/drawer.tsx +32 -53
- package/src/shadcnui/ui/dropdown-menu.tsx +48 -65
- package/src/shadcnui/ui/field.tsx +39 -48
- package/src/shadcnui/ui/hover-card.tsx +9 -14
- package/src/shadcnui/ui/input-group.tsx +44 -55
- package/src/shadcnui/ui/input-otp.tsx +22 -26
- package/src/shadcnui/ui/input.tsx +6 -6
- package/src/shadcnui/ui/label.tsx +6 -6
- package/src/shadcnui/ui/navigation-menu.tsx +36 -60
- package/src/shadcnui/ui/popover.tsx +15 -38
- package/src/shadcnui/ui/progress.tsx +12 -29
- package/src/shadcnui/ui/radio-group.tsx +9 -15
- package/src/shadcnui/ui/resizable.tsx +14 -24
- package/src/shadcnui/ui/scroll-area.tsx +12 -27
- package/src/shadcnui/ui/select.tsx +41 -65
- package/src/shadcnui/ui/separator.tsx +7 -11
- package/src/shadcnui/ui/sheet.tsx +30 -55
- package/src/shadcnui/ui/sidebar.tsx +141 -189
- package/src/shadcnui/ui/skeleton.tsx +3 -9
- package/src/shadcnui/ui/slider.tsx +11 -23
- package/src/shadcnui/ui/switch.tsx +8 -8
- package/src/shadcnui/ui/tabs.tsx +14 -21
- package/src/shadcnui/ui/textarea.tsx +5 -5
- package/src/shadcnui/ui/toggle.tsx +8 -14
- package/src/shadcnui/ui/tooltip.tsx +11 -23
- package/src/testing/providers/MockJsonApiProvider.tsx +1 -5
- package/src/testing/utils/renderWithProviders.tsx +6 -10
- package/dist/BlockNoteEditor-KFUTQVUK.mjs.map +0 -1
- package/dist/chunk-DLJTN632.mjs.map +0 -1
- package/dist/chunk-NNCTRU4O.js.map +0 -1
- package/dist/chunk-S2RZBQP4.js.map +0 -1
|
@@ -1,29 +1,20 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Combobox as ComboboxPrimitive } from "@base-ui/react"
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Combobox as ComboboxPrimitive } from "@base-ui/react";
|
|
5
5
|
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
import { Button } from "@/components/ui/button"
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
InputGroupAddon,
|
|
11
|
-
InputGroupButton,
|
|
12
|
-
InputGroupInput,
|
|
13
|
-
} from "@/components/ui/input-group"
|
|
14
|
-
import { ChevronDownIcon, XIcon, CheckIcon } from "lucide-react"
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
import { Button } from "@/components/ui/button";
|
|
8
|
+
import { InputGroup, InputGroupAddon, InputGroupButton, InputGroupInput } from "@/components/ui/input-group";
|
|
9
|
+
import { ChevronDownIcon, XIcon, CheckIcon } from "lucide-react";
|
|
15
10
|
|
|
16
|
-
const Combobox = ComboboxPrimitive.Root
|
|
11
|
+
const Combobox = ComboboxPrimitive.Root;
|
|
17
12
|
|
|
18
13
|
function ComboboxValue({ ...props }: ComboboxPrimitive.Value.Props) {
|
|
19
|
-
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props}
|
|
14
|
+
return <ComboboxPrimitive.Value data-slot="combobox-value" {...props} />;
|
|
20
15
|
}
|
|
21
16
|
|
|
22
|
-
function ComboboxTrigger({
|
|
23
|
-
className,
|
|
24
|
-
children,
|
|
25
|
-
...props
|
|
26
|
-
}: ComboboxPrimitive.Trigger.Props) {
|
|
17
|
+
function ComboboxTrigger({ className, children, ...props }: ComboboxPrimitive.Trigger.Props) {
|
|
27
18
|
return (
|
|
28
19
|
<ComboboxPrimitive.Trigger
|
|
29
20
|
data-slot="combobox-trigger"
|
|
@@ -33,7 +24,7 @@ function ComboboxTrigger({
|
|
|
33
24
|
{children}
|
|
34
25
|
<ChevronDownIcon className="text-muted-foreground size-3.5 pointer-events-none" />
|
|
35
26
|
</ComboboxPrimitive.Trigger>
|
|
36
|
-
)
|
|
27
|
+
);
|
|
37
28
|
}
|
|
38
29
|
|
|
39
30
|
function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
@@ -46,7 +37,7 @@ function ComboboxClear({ className, ...props }: ComboboxPrimitive.Clear.Props) {
|
|
|
46
37
|
>
|
|
47
38
|
<XIcon className="pointer-events-none" />
|
|
48
39
|
</ComboboxPrimitive.Clear>
|
|
49
|
-
)
|
|
40
|
+
);
|
|
50
41
|
}
|
|
51
42
|
|
|
52
43
|
function ComboboxInput({
|
|
@@ -57,15 +48,12 @@ function ComboboxInput({
|
|
|
57
48
|
showClear = false,
|
|
58
49
|
...props
|
|
59
50
|
}: ComboboxPrimitive.Input.Props & {
|
|
60
|
-
showTrigger?: boolean
|
|
61
|
-
showClear?: boolean
|
|
51
|
+
showTrigger?: boolean;
|
|
52
|
+
showClear?: boolean;
|
|
62
53
|
}) {
|
|
63
54
|
return (
|
|
64
55
|
<InputGroup className={cn("w-auto", className)}>
|
|
65
|
-
<ComboboxPrimitive.Input
|
|
66
|
-
render={<InputGroupInput disabled={disabled} />}
|
|
67
|
-
{...props}
|
|
68
|
-
/>
|
|
56
|
+
<ComboboxPrimitive.Input render={<InputGroupInput disabled={disabled} />} {...props} />
|
|
69
57
|
<InputGroupAddon align="inline-end">
|
|
70
58
|
{showTrigger && (
|
|
71
59
|
<InputGroupButton
|
|
@@ -81,7 +69,7 @@ function ComboboxInput({
|
|
|
81
69
|
</InputGroupAddon>
|
|
82
70
|
{children}
|
|
83
71
|
</InputGroup>
|
|
84
|
-
)
|
|
72
|
+
);
|
|
85
73
|
}
|
|
86
74
|
|
|
87
75
|
function ComboboxContent({
|
|
@@ -93,10 +81,7 @@ function ComboboxContent({
|
|
|
93
81
|
anchor,
|
|
94
82
|
...props
|
|
95
83
|
}: ComboboxPrimitive.Popup.Props &
|
|
96
|
-
Pick<
|
|
97
|
-
ComboboxPrimitive.Positioner.Props,
|
|
98
|
-
"side" | "align" | "sideOffset" | "alignOffset" | "anchor"
|
|
99
|
-
>) {
|
|
84
|
+
Pick<ComboboxPrimitive.Positioner.Props, "side" | "align" | "sideOffset" | "alignOffset" | "anchor">) {
|
|
100
85
|
return (
|
|
101
86
|
<ComboboxPrimitive.Portal>
|
|
102
87
|
<ComboboxPrimitive.Positioner
|
|
@@ -110,12 +95,15 @@ function ComboboxContent({
|
|
|
110
95
|
<ComboboxPrimitive.Popup
|
|
111
96
|
data-slot="combobox-content"
|
|
112
97
|
data-chips={!!anchor}
|
|
113
|
-
className={cn(
|
|
98
|
+
className={cn(
|
|
99
|
+
"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 *:data-[slot=input-group]:bg-input/20 dark:bg-popover max-h-72 min-w-32 overflow-hidden rounded-lg shadow-md ring-1 duration-100 *:data-[slot=input-group]:m-1 *:data-[slot=input-group]:mb-0 *:data-[slot=input-group]:h-7 *:data-[slot=input-group]:border-none *:data-[slot=input-group]:shadow-none group/combobox-content relative max-h-(--available-height) w-(--anchor-width) max-w-(--available-width) min-w-[calc(var(--anchor-width)+--spacing(7))] origin-(--transform-origin) data-[chips=true]:min-w-(--anchor-width)",
|
|
100
|
+
className,
|
|
101
|
+
)}
|
|
114
102
|
{...props}
|
|
115
103
|
/>
|
|
116
104
|
</ComboboxPrimitive.Positioner>
|
|
117
105
|
</ComboboxPrimitive.Portal>
|
|
118
|
-
)
|
|
106
|
+
);
|
|
119
107
|
}
|
|
120
108
|
|
|
121
109
|
function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
@@ -124,24 +112,20 @@ function ComboboxList({ className, ...props }: ComboboxPrimitive.List.Props) {
|
|
|
124
112
|
data-slot="combobox-list"
|
|
125
113
|
className={cn(
|
|
126
114
|
"no-scrollbar max-h-[min(calc(--spacing(72)---spacing(9)),calc(var(--available-height)---spacing(9)))] scroll-py-1 overflow-y-auto p-1 data-empty:p-0 overflow-y-auto overscroll-contain",
|
|
127
|
-
className
|
|
115
|
+
className,
|
|
128
116
|
)}
|
|
129
117
|
{...props}
|
|
130
118
|
/>
|
|
131
|
-
)
|
|
119
|
+
);
|
|
132
120
|
}
|
|
133
121
|
|
|
134
|
-
function ComboboxItem({
|
|
135
|
-
className,
|
|
136
|
-
children,
|
|
137
|
-
...props
|
|
138
|
-
}: ComboboxPrimitive.Item.Props) {
|
|
122
|
+
function ComboboxItem({ className, children, ...props }: ComboboxPrimitive.Item.Props) {
|
|
139
123
|
return (
|
|
140
124
|
<ComboboxPrimitive.Item
|
|
141
125
|
data-slot="combobox-item"
|
|
142
126
|
className={cn(
|
|
143
127
|
"data-highlighted:bg-accent data-highlighted:text-accent-foreground not-data-[variant=destructive]:data-highlighted:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs/relaxed [&_svg:not([class*='size-'])]:size-3.5 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",
|
|
144
|
-
className
|
|
128
|
+
className,
|
|
145
129
|
)}
|
|
146
130
|
{...props}
|
|
147
131
|
>
|
|
@@ -152,73 +136,64 @@ function ComboboxItem({
|
|
|
152
136
|
<CheckIcon className="pointer-events-none" />
|
|
153
137
|
</ComboboxPrimitive.ItemIndicator>
|
|
154
138
|
</ComboboxPrimitive.Item>
|
|
155
|
-
)
|
|
139
|
+
);
|
|
156
140
|
}
|
|
157
141
|
|
|
158
142
|
function ComboboxGroup({ className, ...props }: ComboboxPrimitive.Group.Props) {
|
|
159
|
-
return (
|
|
160
|
-
<ComboboxPrimitive.Group
|
|
161
|
-
data-slot="combobox-group"
|
|
162
|
-
className={cn(className)}
|
|
163
|
-
{...props}
|
|
164
|
-
/>
|
|
165
|
-
)
|
|
143
|
+
return <ComboboxPrimitive.Group data-slot="combobox-group" className={cn(className)} {...props} />;
|
|
166
144
|
}
|
|
167
145
|
|
|
168
|
-
function ComboboxLabel({
|
|
169
|
-
className,
|
|
170
|
-
...props
|
|
171
|
-
}: ComboboxPrimitive.GroupLabel.Props) {
|
|
146
|
+
function ComboboxLabel({ className, ...props }: ComboboxPrimitive.GroupLabel.Props) {
|
|
172
147
|
return (
|
|
173
148
|
<ComboboxPrimitive.GroupLabel
|
|
174
149
|
data-slot="combobox-label"
|
|
175
150
|
className={cn("text-muted-foreground px-2 py-1.5 text-xs", className)}
|
|
176
151
|
{...props}
|
|
177
152
|
/>
|
|
178
|
-
)
|
|
153
|
+
);
|
|
179
154
|
}
|
|
180
155
|
|
|
181
156
|
function ComboboxCollection({ ...props }: ComboboxPrimitive.Collection.Props) {
|
|
182
|
-
return
|
|
183
|
-
<ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />
|
|
184
|
-
)
|
|
157
|
+
return <ComboboxPrimitive.Collection data-slot="combobox-collection" {...props} />;
|
|
185
158
|
}
|
|
186
159
|
|
|
187
160
|
function ComboboxEmpty({ className, ...props }: ComboboxPrimitive.Empty.Props) {
|
|
188
161
|
return (
|
|
189
162
|
<ComboboxPrimitive.Empty
|
|
190
163
|
data-slot="combobox-empty"
|
|
191
|
-
className={cn(
|
|
164
|
+
className={cn(
|
|
165
|
+
"text-muted-foreground hidden w-full justify-center py-2 text-center text-xs/relaxed group-data-empty/combobox-content:flex",
|
|
166
|
+
className,
|
|
167
|
+
)}
|
|
192
168
|
{...props}
|
|
193
169
|
/>
|
|
194
|
-
)
|
|
170
|
+
);
|
|
195
171
|
}
|
|
196
172
|
|
|
197
|
-
function ComboboxSeparator({
|
|
198
|
-
className,
|
|
199
|
-
...props
|
|
200
|
-
}: ComboboxPrimitive.Separator.Props) {
|
|
173
|
+
function ComboboxSeparator({ className, ...props }: ComboboxPrimitive.Separator.Props) {
|
|
201
174
|
return (
|
|
202
175
|
<ComboboxPrimitive.Separator
|
|
203
176
|
data-slot="combobox-separator"
|
|
204
177
|
className={cn("bg-border/50 -mx-1 my-1 h-px", className)}
|
|
205
178
|
{...props}
|
|
206
179
|
/>
|
|
207
|
-
)
|
|
180
|
+
);
|
|
208
181
|
}
|
|
209
182
|
|
|
210
183
|
function ComboboxChips({
|
|
211
184
|
className,
|
|
212
185
|
...props
|
|
213
|
-
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> &
|
|
214
|
-
ComboboxPrimitive.Chips.Props) {
|
|
186
|
+
}: React.ComponentPropsWithRef<typeof ComboboxPrimitive.Chips> & ComboboxPrimitive.Chips.Props) {
|
|
215
187
|
return (
|
|
216
188
|
<ComboboxPrimitive.Chips
|
|
217
189
|
data-slot="combobox-chips"
|
|
218
|
-
className={cn(
|
|
190
|
+
className={cn(
|
|
191
|
+
"bg-input/20 dark:bg-input/30 border-input focus-within:border-ring focus-within:ring-ring/30 has-aria-invalid:ring-destructive/20 dark:has-aria-invalid:ring-destructive/40 has-aria-invalid:border-destructive dark:has-aria-invalid:border-destructive/50 flex min-h-7 flex-wrap items-center gap-1 rounded-md border bg-clip-padding px-2 py-0.5 text-xs/relaxed transition-colors focus-within:ring-[2px] has-aria-invalid:ring-[2px] has-data-[slot=combobox-chip]:px-1",
|
|
192
|
+
className,
|
|
193
|
+
)}
|
|
219
194
|
{...props}
|
|
220
195
|
/>
|
|
221
|
-
)
|
|
196
|
+
);
|
|
222
197
|
}
|
|
223
198
|
|
|
224
199
|
function ComboboxChip({
|
|
@@ -227,14 +202,14 @@ function ComboboxChip({
|
|
|
227
202
|
showRemove = true,
|
|
228
203
|
...props
|
|
229
204
|
}: ComboboxPrimitive.Chip.Props & {
|
|
230
|
-
showRemove?: boolean
|
|
205
|
+
showRemove?: boolean;
|
|
231
206
|
}) {
|
|
232
207
|
return (
|
|
233
208
|
<ComboboxPrimitive.Chip
|
|
234
209
|
data-slot="combobox-chip"
|
|
235
210
|
className={cn(
|
|
236
211
|
"bg-muted-foreground/10 text-foreground flex h-[calc(--spacing(4.75))] w-fit items-center justify-center gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1.5 text-xs/relaxed font-medium whitespace-nowrap has-data-[slot=combobox-chip-remove]:pr-0 has-disabled:pointer-events-none has-disabled:cursor-not-allowed has-disabled:opacity-50",
|
|
237
|
-
className
|
|
212
|
+
className,
|
|
238
213
|
)}
|
|
239
214
|
{...props}
|
|
240
215
|
>
|
|
@@ -249,27 +224,21 @@ function ComboboxChip({
|
|
|
249
224
|
</ComboboxPrimitive.ChipRemove>
|
|
250
225
|
)}
|
|
251
226
|
</ComboboxPrimitive.Chip>
|
|
252
|
-
)
|
|
227
|
+
);
|
|
253
228
|
}
|
|
254
229
|
|
|
255
|
-
function ComboboxChipsInput({
|
|
256
|
-
className,
|
|
257
|
-
...props
|
|
258
|
-
}: ComboboxPrimitive.Input.Props) {
|
|
230
|
+
function ComboboxChipsInput({ className, ...props }: ComboboxPrimitive.Input.Props) {
|
|
259
231
|
return (
|
|
260
232
|
<ComboboxPrimitive.Input
|
|
261
233
|
data-slot="combobox-chip-input"
|
|
262
|
-
className={cn(
|
|
263
|
-
"min-w-16 flex-1 outline-none",
|
|
264
|
-
className
|
|
265
|
-
)}
|
|
234
|
+
className={cn("min-w-16 flex-1 outline-none", className)}
|
|
266
235
|
{...props}
|
|
267
236
|
/>
|
|
268
|
-
)
|
|
237
|
+
);
|
|
269
238
|
}
|
|
270
239
|
|
|
271
240
|
function useComboboxAnchor() {
|
|
272
|
-
return React.useRef<HTMLDivElement | null>(null)
|
|
241
|
+
return React.useRef<HTMLDivElement | null>(null);
|
|
273
242
|
}
|
|
274
243
|
|
|
275
244
|
export {
|
|
@@ -289,4 +258,4 @@ export {
|
|
|
289
258
|
ComboboxTrigger,
|
|
290
259
|
ComboboxValue,
|
|
291
260
|
useComboboxAnchor,
|
|
292
|
-
}
|
|
261
|
+
};
|
|
@@ -1,36 +1,24 @@
|
|
|
1
|
-
"use client"
|
|
1
|
+
"use client";
|
|
2
2
|
|
|
3
|
-
import * as React from "react"
|
|
4
|
-
import { Command as CommandPrimitive } from "cmdk"
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { Command as CommandPrimitive } from "cmdk";
|
|
5
5
|
|
|
6
|
-
import { cn } from "@/lib/utils"
|
|
7
|
-
import {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
DialogDescription,
|
|
11
|
-
DialogHeader,
|
|
12
|
-
DialogTitle,
|
|
13
|
-
} from "@/components/ui/dialog"
|
|
14
|
-
import {
|
|
15
|
-
InputGroup,
|
|
16
|
-
InputGroupAddon,
|
|
17
|
-
} from "@/components/ui/input-group"
|
|
18
|
-
import { SearchIcon, CheckIcon } from "lucide-react"
|
|
6
|
+
import { cn } from "@/lib/utils";
|
|
7
|
+
import { Dialog, DialogContent, DialogDescription, DialogHeader, DialogTitle } from "@/components/ui/dialog";
|
|
8
|
+
import { InputGroup, InputGroupAddon } from "@/components/ui/input-group";
|
|
9
|
+
import { SearchIcon, CheckIcon } from "lucide-react";
|
|
19
10
|
|
|
20
|
-
function Command({
|
|
21
|
-
className,
|
|
22
|
-
...props
|
|
23
|
-
}: React.ComponentProps<typeof CommandPrimitive>) {
|
|
11
|
+
function Command({ className, ...props }: React.ComponentProps<typeof CommandPrimitive>) {
|
|
24
12
|
return (
|
|
25
13
|
<CommandPrimitive
|
|
26
14
|
data-slot="command"
|
|
27
15
|
className={cn(
|
|
28
16
|
"bg-popover text-popover-foreground rounded-xl p-1 flex size-full flex-col overflow-hidden",
|
|
29
|
-
className
|
|
17
|
+
className,
|
|
30
18
|
)}
|
|
31
19
|
{...props}
|
|
32
20
|
/>
|
|
33
|
-
)
|
|
21
|
+
);
|
|
34
22
|
}
|
|
35
23
|
|
|
36
24
|
function CommandDialog({
|
|
@@ -41,11 +29,11 @@ function CommandDialog({
|
|
|
41
29
|
showCloseButton = false,
|
|
42
30
|
...props
|
|
43
31
|
}: Omit<React.ComponentProps<typeof Dialog>, "children"> & {
|
|
44
|
-
title?: string
|
|
45
|
-
description?: string
|
|
46
|
-
className?: string
|
|
47
|
-
showCloseButton?: boolean
|
|
48
|
-
children: React.ReactNode
|
|
32
|
+
title?: string;
|
|
33
|
+
description?: string;
|
|
34
|
+
className?: string;
|
|
35
|
+
showCloseButton?: boolean;
|
|
36
|
+
children: React.ReactNode;
|
|
49
37
|
}) {
|
|
50
38
|
return (
|
|
51
39
|
<Dialog {...props}>
|
|
@@ -53,20 +41,14 @@ function CommandDialog({
|
|
|
53
41
|
<DialogTitle>{title}</DialogTitle>
|
|
54
42
|
<DialogDescription>{description}</DialogDescription>
|
|
55
43
|
</DialogHeader>
|
|
56
|
-
<DialogContent
|
|
57
|
-
className={cn("rounded-xl! p-0 overflow-hidden p-0", className)}
|
|
58
|
-
showCloseButton={showCloseButton}
|
|
59
|
-
>
|
|
44
|
+
<DialogContent className={cn("rounded-xl! p-0 overflow-hidden p-0", className)} showCloseButton={showCloseButton}>
|
|
60
45
|
{children}
|
|
61
46
|
</DialogContent>
|
|
62
47
|
</Dialog>
|
|
63
|
-
)
|
|
48
|
+
);
|
|
64
49
|
}
|
|
65
50
|
|
|
66
|
-
function CommandInput({
|
|
67
|
-
className,
|
|
68
|
-
...props
|
|
69
|
-
}: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
51
|
+
function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>) {
|
|
70
52
|
return (
|
|
71
53
|
<div data-slot="command-input-wrapper" className="p-1 pb-0">
|
|
72
54
|
<InputGroup className="bg-input/20 dark:bg-input/30 h-8!">
|
|
@@ -74,7 +56,7 @@ function CommandInput({
|
|
|
74
56
|
data-slot="command-input"
|
|
75
57
|
className={cn(
|
|
76
58
|
"w-full text-xs/relaxed outline-hidden disabled:cursor-not-allowed disabled:opacity-50",
|
|
77
|
-
className
|
|
59
|
+
className,
|
|
78
60
|
)}
|
|
79
61
|
{...props}
|
|
80
62
|
/>
|
|
@@ -83,95 +65,79 @@ function CommandInput({
|
|
|
83
65
|
</InputGroupAddon>
|
|
84
66
|
</InputGroup>
|
|
85
67
|
</div>
|
|
86
|
-
)
|
|
68
|
+
);
|
|
87
69
|
}
|
|
88
70
|
|
|
89
|
-
function CommandList({
|
|
90
|
-
className,
|
|
91
|
-
...props
|
|
92
|
-
}: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
71
|
+
function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>) {
|
|
93
72
|
return (
|
|
94
73
|
<CommandPrimitive.List
|
|
95
74
|
data-slot="command-list"
|
|
96
|
-
className={cn(
|
|
97
|
-
"no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto",
|
|
98
|
-
className
|
|
99
|
-
)}
|
|
75
|
+
className={cn("no-scrollbar max-h-72 scroll-py-1 outline-none overflow-x-hidden overflow-y-auto", className)}
|
|
100
76
|
{...props}
|
|
101
77
|
/>
|
|
102
|
-
)
|
|
78
|
+
);
|
|
103
79
|
}
|
|
104
80
|
|
|
105
|
-
function CommandEmpty({
|
|
106
|
-
className,
|
|
107
|
-
...props
|
|
108
|
-
}: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
81
|
+
function CommandEmpty({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>) {
|
|
109
82
|
return (
|
|
110
83
|
<CommandPrimitive.Empty
|
|
111
84
|
data-slot="command-empty"
|
|
112
85
|
className={cn("py-6 text-center text-xs/relaxed", className)}
|
|
113
86
|
{...props}
|
|
114
87
|
/>
|
|
115
|
-
)
|
|
88
|
+
);
|
|
116
89
|
}
|
|
117
90
|
|
|
118
|
-
function CommandGroup({
|
|
119
|
-
className,
|
|
120
|
-
...props
|
|
121
|
-
}: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
91
|
+
function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>) {
|
|
122
92
|
return (
|
|
123
93
|
<CommandPrimitive.Group
|
|
124
94
|
data-slot="command-group"
|
|
125
|
-
className={cn(
|
|
95
|
+
className={cn(
|
|
96
|
+
"text-foreground [&_[cmdk-group-heading]]:text-muted-foreground overflow-hidden p-1 [&_[cmdk-group-heading]]:px-2.5 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium",
|
|
97
|
+
className,
|
|
98
|
+
)}
|
|
126
99
|
{...props}
|
|
127
100
|
/>
|
|
128
|
-
)
|
|
101
|
+
);
|
|
129
102
|
}
|
|
130
103
|
|
|
131
|
-
function CommandSeparator({
|
|
132
|
-
className,
|
|
133
|
-
...props
|
|
134
|
-
}: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
104
|
+
function CommandSeparator({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Separator>) {
|
|
135
105
|
return (
|
|
136
106
|
<CommandPrimitive.Separator
|
|
137
107
|
data-slot="command-separator"
|
|
138
108
|
className={cn("bg-border/50 -mx-1 my-1 h-px", className)}
|
|
139
109
|
{...props}
|
|
140
110
|
/>
|
|
141
|
-
)
|
|
111
|
+
);
|
|
142
112
|
}
|
|
143
113
|
|
|
144
|
-
function CommandItem({
|
|
145
|
-
className,
|
|
146
|
-
children,
|
|
147
|
-
...props
|
|
148
|
-
}: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
114
|
+
function CommandItem({ className, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Item>) {
|
|
149
115
|
return (
|
|
150
116
|
<CommandPrimitive.Item
|
|
151
117
|
data-slot="command-item"
|
|
152
118
|
className={cn(
|
|
153
119
|
"data-selected:bg-muted data-selected:text-foreground data-selected:*:[svg]:text-foreground relative flex min-h-7 cursor-default items-center gap-2 rounded-md px-2.5 py-1.5 text-xs/relaxed outline-hidden select-none [&_svg:not([class*='size-'])]:size-3.5 [[data-slot=dialog-content]_&]:rounded-md group/command-item data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
|
|
154
|
-
className
|
|
120
|
+
className,
|
|
155
121
|
)}
|
|
156
122
|
{...props}
|
|
157
123
|
>
|
|
158
124
|
{children}
|
|
159
125
|
<CheckIcon className="ml-auto opacity-0 group-has-[[data-slot=command-shortcut]]/command-item:hidden group-data-[checked=true]/command-item:opacity-100" />
|
|
160
126
|
</CommandPrimitive.Item>
|
|
161
|
-
)
|
|
127
|
+
);
|
|
162
128
|
}
|
|
163
129
|
|
|
164
|
-
function CommandShortcut({
|
|
165
|
-
className,
|
|
166
|
-
...props
|
|
167
|
-
}: React.ComponentProps<"span">) {
|
|
130
|
+
function CommandShortcut({ className, ...props }: React.ComponentProps<"span">) {
|
|
168
131
|
return (
|
|
169
132
|
<span
|
|
170
133
|
data-slot="command-shortcut"
|
|
171
|
-
className={cn(
|
|
134
|
+
className={cn(
|
|
135
|
+
"text-muted-foreground group-data-selected/command-item:text-foreground ml-auto text-[0.625rem] tracking-widest",
|
|
136
|
+
className,
|
|
137
|
+
)}
|
|
172
138
|
{...props}
|
|
173
139
|
/>
|
|
174
|
-
)
|
|
140
|
+
);
|
|
175
141
|
}
|
|
176
142
|
|
|
177
143
|
export {
|
|
@@ -184,4 +150,4 @@ export {
|
|
|
184
150
|
CommandItem,
|
|
185
151
|
CommandShortcut,
|
|
186
152
|
CommandSeparator,
|
|
187
|
-
}
|
|
153
|
+
};
|