@carlonicora/nextjs-jsonapi 1.36.1 → 1.38.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.
Files changed (190) hide show
  1. package/dist/{BlockNoteEditor-4MDHRUS2.js → BlockNoteEditor-3S2B36O3.js} +15 -15
  2. package/dist/{BlockNoteEditor-4MDHRUS2.js.map → BlockNoteEditor-3S2B36O3.js.map} +1 -1
  3. package/dist/{BlockNoteEditor-SZWO3MDO.mjs → BlockNoteEditor-WQUJTVJL.mjs} +5 -5
  4. package/dist/BlockNoteEditor-WQUJTVJL.mjs.map +1 -0
  5. package/dist/billing/index.d.mts +15 -5
  6. package/dist/billing/index.d.ts +15 -5
  7. package/dist/billing/index.js +750 -520
  8. package/dist/billing/index.js.map +1 -1
  9. package/dist/billing/index.mjs +665 -435
  10. package/dist/billing/index.mjs.map +1 -1
  11. package/dist/{chunk-53IPQJVH.js → chunk-3EZX4G2E.js} +147 -23
  12. package/dist/chunk-3EZX4G2E.js.map +1 -0
  13. package/dist/{chunk-I7DFEJFF.mjs → chunk-4PHADEKA.mjs} +738 -1418
  14. package/dist/chunk-4PHADEKA.mjs.map +1 -0
  15. package/dist/{chunk-E6PQQTWF.js → chunk-T2JCZYWK.js} +999 -1679
  16. package/dist/chunk-T2JCZYWK.js.map +1 -0
  17. package/dist/{chunk-P7R2DPD6.mjs → chunk-TQ5GRRTM.mjs} +125 -1
  18. package/dist/chunk-TQ5GRRTM.mjs.map +1 -0
  19. package/dist/client/index.js +3 -3
  20. package/dist/client/index.mjs +2 -2
  21. package/dist/components/index.d.mts +23 -8
  22. package/dist/components/index.d.ts +23 -8
  23. package/dist/components/index.js +3 -3
  24. package/dist/components/index.mjs +2 -2
  25. package/dist/contexts/index.d.mts +1 -1
  26. package/dist/contexts/index.d.ts +1 -1
  27. package/dist/contexts/index.js +3 -3
  28. package/dist/contexts/index.mjs +2 -2
  29. package/dist/core/index.d.mts +47 -3
  30. package/dist/core/index.d.ts +47 -3
  31. package/dist/core/index.js +8 -2
  32. package/dist/core/index.js.map +1 -1
  33. package/dist/core/index.mjs +7 -1
  34. package/dist/index.d.mts +2 -2
  35. package/dist/index.d.ts +2 -2
  36. package/dist/index.js +8 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/index.mjs +7 -1
  39. package/dist/server/index.js +3 -3
  40. package/dist/server/index.mjs +1 -1
  41. package/dist/{stripe-subscription.interface-DK7BJaNd.d.ts → stripe-promotion-code.interface-BcJty0rv.d.ts} +18 -1
  42. package/dist/{stripe-subscription.interface-C8uhCYIZ.d.mts → stripe-promotion-code.interface-Dnm2DJKQ.d.mts} +18 -1
  43. package/dist/testing/index.js.map +1 -1
  44. package/dist/testing/index.mjs.map +1 -1
  45. package/package.json +2 -2
  46. package/src/billing/index.ts +1 -0
  47. package/src/client/context/JsonApiProvider.tsx +1 -5
  48. package/src/client/hooks/__tests__/useJsonApiGet.test.tsx +9 -9
  49. package/src/client/hooks/__tests__/useJsonApiMutation.test.tsx +11 -11
  50. package/src/client/hooks/__tests__/useRehydration.test.ts +13 -34
  51. package/src/components/editors/BlockNoteEditor.tsx +2 -2
  52. package/src/components/forms/CommonEditorTrigger.tsx +1 -1
  53. package/src/components/forms/FormCheckbox.tsx +2 -12
  54. package/src/components/forms/FormDate.tsx +1 -6
  55. package/src/components/forms/FormInput.tsx +1 -1
  56. package/src/components/forms/FormPassword.tsx +1 -7
  57. package/src/components/forms/FormSelect.tsx +2 -8
  58. package/src/components/forms/FormSlider.tsx +1 -5
  59. package/src/components/forms/FormSwitch.tsx +1 -5
  60. package/src/components/forms/GdprConsentCheckbox.tsx +2 -8
  61. package/src/components/forms/PasswordInput.tsx +28 -26
  62. package/src/components/forms/__tests__/FormCheckbox.test.tsx +16 -18
  63. package/src/components/forms/__tests__/FormDate.test.tsx +14 -30
  64. package/src/components/forms/__tests__/FormInput.test.tsx +21 -37
  65. package/src/components/forms/__tests__/FormSelect.test.tsx +15 -21
  66. package/src/components/tables/ContentListTable.tsx +1 -1
  67. package/src/components/tables/__tests__/ContentListTable.test.tsx +17 -89
  68. package/src/components/tables/cells/cell.component.tsx +1 -1
  69. package/src/contexts/HeaderChildrenContext.tsx +3 -1
  70. package/src/core/endpoint/__tests__/EndpointCreator.test.ts +2 -7
  71. package/src/core/factories/__tests__/JsonApiDataFactory.test.ts +3 -3
  72. package/src/core/factories/__tests__/RehydrationFactory.test.ts +4 -6
  73. package/src/core/index.ts +1 -0
  74. package/src/core/registry/ModuleRegistry.ts +1 -0
  75. package/src/core/registry/__tests__/DataClassRegistry.test.ts +5 -15
  76. package/src/core/registry/__tests__/ModuleRegistrar.test.ts +5 -15
  77. package/src/features/auth/components/GdprConsentSection.tsx +1 -6
  78. package/src/features/auth/components/details/LandingComponent.tsx +6 -1
  79. package/src/features/auth/components/forms/AcceptInvitation.tsx +1 -1
  80. package/src/features/auth/components/forms/ResetPassword.tsx +1 -1
  81. package/src/features/billing/components/cards/PaymentMethodSummaryCard.tsx +13 -18
  82. package/src/features/billing/components/cards/SubscriptionSummaryCard.tsx +12 -17
  83. package/src/features/billing/components/modals/BillingDetailModal.tsx +2 -13
  84. package/src/features/billing/stripe-customer/components/details/PaymentMethodCard.tsx +8 -1
  85. package/src/features/billing/stripe-customer/components/forms/PaymentMethodEditor.tsx +2 -13
  86. package/src/features/billing/stripe-customer/components/forms/PaymentMethodForm.tsx +2 -12
  87. package/src/features/billing/stripe-invoice/components/details/InvoiceDetails.tsx +6 -1
  88. package/src/features/billing/stripe-invoice/data/stripe-invoice.interface.ts +1 -0
  89. package/src/features/billing/stripe-price/components/lists/PricesList.tsx +13 -5
  90. package/src/features/billing/stripe-product/components/lists/ProductsList.tsx +5 -5
  91. package/src/features/billing/stripe-promotion-code/components/PromoCodeInput.tsx +108 -0
  92. package/src/features/billing/stripe-promotion-code/components/index.ts +1 -0
  93. package/src/features/billing/stripe-promotion-code/data/index.ts +3 -0
  94. package/src/features/billing/stripe-promotion-code/data/stripe-promotion-code.interface.ts +14 -0
  95. package/src/features/billing/stripe-promotion-code/data/stripe-promotion-code.service.ts +64 -0
  96. package/src/features/billing/stripe-promotion-code/data/stripe-promotion-code.ts +66 -0
  97. package/src/features/billing/stripe-promotion-code/index.ts +2 -0
  98. package/src/features/billing/stripe-promotion-code/stripe-promotion-code.module.ts +9 -0
  99. package/src/features/billing/stripe-subscription/components/containers/SubscriptionsContainer.tsx +1 -3
  100. package/src/features/billing/stripe-subscription/components/details/SubscriptionDetails.tsx +4 -1
  101. package/src/features/billing/stripe-subscription/components/forms/CancelSubscriptionDialog.tsx +1 -1
  102. package/src/features/billing/stripe-subscription/components/lists/SubscriptionsList.tsx +24 -4
  103. package/src/features/billing/stripe-subscription/components/widgets/PricingCard.tsx +9 -2
  104. package/src/features/billing/stripe-subscription/components/widgets/SubscriptionStatusBadge.tsx +3 -1
  105. package/src/features/billing/stripe-subscription/components/wizards/SubscriptionWizard.tsx +7 -7
  106. package/src/features/billing/stripe-subscription/components/wizards/WizardProgressIndicator.tsx +2 -10
  107. package/src/features/billing/stripe-subscription/components/wizards/WizardStepPaymentMethod.tsx +3 -13
  108. package/src/features/billing/stripe-subscription/components/wizards/WizardStepReview.tsx +134 -23
  109. package/src/features/billing/stripe-subscription/data/stripe-subscription.interface.ts +2 -0
  110. package/src/features/billing/stripe-subscription/data/stripe-subscription.ts +8 -0
  111. package/src/features/billing/stripe-subscription/hooks/useSubscriptionWizard.ts +93 -7
  112. package/src/features/billing/stripe-usage/components/details/UsageSummaryCard.tsx +1 -1
  113. package/src/features/billing/stripe-usage/components/lists/UsageHistoryTable.tsx +1 -1
  114. package/src/features/company/components/details/CompanyDetails.tsx +2 -2
  115. package/src/features/company/components/forms/CompanyConfigurationSecurityForm.tsx +1 -1
  116. package/src/features/index.ts +1 -0
  117. package/src/features/notification/components/containers/NotificationsListContainer.tsx +1 -1
  118. package/src/features/notification/components/modals/NotificationModal.tsx +6 -2
  119. package/src/features/notification/contexts/NotificationContext.tsx +1 -3
  120. package/src/features/oauth/components/OAuthClientCard.tsx +15 -17
  121. package/src/features/oauth/components/OAuthClientDetail.tsx +7 -19
  122. package/src/features/oauth/components/OAuthClientForm.tsx +4 -13
  123. package/src/features/oauth/components/OAuthClientSecretDisplay.tsx +4 -20
  124. package/src/features/oauth/components/OAuthRedirectUriInput.tsx +5 -12
  125. package/src/features/oauth/components/OAuthScopeSelector.tsx +17 -23
  126. package/src/features/oauth/components/consent/OAuthConsentActions.tsx +3 -16
  127. package/src/features/oauth/components/consent/OAuthConsentHeader.tsx +3 -12
  128. package/src/features/oauth/components/consent/OAuthConsentScreen.tsx +5 -20
  129. package/src/features/oauth/components/consent/OAuthScopeList.tsx +3 -18
  130. package/src/features/onboarding/contexts/OnboardingContext.tsx +3 -3
  131. package/src/features/role/components/forms/FormRoles.tsx +1 -7
  132. package/src/features/user/components/containers/UserContainer.tsx +1 -1
  133. package/src/features/user/components/details/UserDetails.tsx +1 -1
  134. package/src/features/user/components/forms/UserDeleter.tsx +1 -1
  135. package/src/features/user/components/forms/UserEditor.tsx +1 -1
  136. package/src/features/user/components/forms/UserMultiSelect.tsx +7 -7
  137. package/src/features/user/components/lists/UserListInAdd.tsx +2 -2
  138. package/src/features/user/components/lists/UsersList.tsx +7 -1
  139. package/src/features/user/contexts/CurrentUserContext.tsx +36 -33
  140. package/src/hooks/__tests__/useDataListRetriever.test.ts +15 -21
  141. package/src/hooks/__tests__/useDebounce.test.ts +2 -7
  142. package/src/hooks/useCustomD3Graph.tsx +2 -2
  143. package/src/shadcnui/custom/multi-select.tsx +28 -2
  144. package/src/shadcnui/ui/accordion.tsx +21 -23
  145. package/src/shadcnui/ui/alert-dialog.tsx +45 -62
  146. package/src/shadcnui/ui/alert.tsx +25 -41
  147. package/src/shadcnui/ui/avatar.tsx +23 -36
  148. package/src/shadcnui/ui/badge.tsx +13 -11
  149. package/src/shadcnui/ui/breadcrumb.tsx +21 -55
  150. package/src/shadcnui/ui/button.tsx +17 -18
  151. package/src/shadcnui/ui/calendar.tsx +44 -93
  152. package/src/shadcnui/ui/carousel.tsx +72 -100
  153. package/src/shadcnui/ui/chart.tsx +102 -161
  154. package/src/shadcnui/ui/checkbox.tsx +8 -9
  155. package/src/shadcnui/ui/combobox.tsx +52 -83
  156. package/src/shadcnui/ui/command.tsx +43 -77
  157. package/src/shadcnui/ui/context-menu.tsx +47 -86
  158. package/src/shadcnui/ui/dialog.tsx +34 -60
  159. package/src/shadcnui/ui/drawer.tsx +32 -53
  160. package/src/shadcnui/ui/dropdown-menu.tsx +48 -65
  161. package/src/shadcnui/ui/field.tsx +39 -48
  162. package/src/shadcnui/ui/hover-card.tsx +9 -14
  163. package/src/shadcnui/ui/input-group.tsx +44 -55
  164. package/src/shadcnui/ui/input-otp.tsx +22 -26
  165. package/src/shadcnui/ui/input.tsx +6 -6
  166. package/src/shadcnui/ui/label.tsx +6 -6
  167. package/src/shadcnui/ui/navigation-menu.tsx +36 -60
  168. package/src/shadcnui/ui/popover.tsx +15 -38
  169. package/src/shadcnui/ui/progress.tsx +12 -29
  170. package/src/shadcnui/ui/radio-group.tsx +9 -15
  171. package/src/shadcnui/ui/resizable.tsx +14 -24
  172. package/src/shadcnui/ui/scroll-area.tsx +12 -27
  173. package/src/shadcnui/ui/select.tsx +41 -65
  174. package/src/shadcnui/ui/separator.tsx +7 -11
  175. package/src/shadcnui/ui/sheet.tsx +30 -55
  176. package/src/shadcnui/ui/sidebar.tsx +141 -189
  177. package/src/shadcnui/ui/skeleton.tsx +3 -9
  178. package/src/shadcnui/ui/slider.tsx +11 -23
  179. package/src/shadcnui/ui/switch.tsx +8 -8
  180. package/src/shadcnui/ui/tabs.tsx +14 -21
  181. package/src/shadcnui/ui/textarea.tsx +5 -5
  182. package/src/shadcnui/ui/toggle.tsx +8 -14
  183. package/src/shadcnui/ui/tooltip.tsx +11 -23
  184. package/src/testing/providers/MockJsonApiProvider.tsx +1 -5
  185. package/src/testing/utils/renderWithProviders.tsx +6 -10
  186. package/dist/BlockNoteEditor-SZWO3MDO.mjs.map +0 -1
  187. package/dist/chunk-53IPQJVH.js.map +0 -1
  188. package/dist/chunk-E6PQQTWF.js.map +0 -1
  189. package/dist/chunk-I7DFEJFF.mjs.map +0 -1
  190. package/dist/chunk-P7R2DPD6.mjs.map +0 -1
@@ -1,21 +1,21 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import * as React from "react"
4
- import { Menu as MenuPrimitive } from "@base-ui/react/menu"
3
+ import * as React from "react";
4
+ import { Menu as MenuPrimitive } from "@base-ui/react/menu";
5
5
 
6
- import { cn } from "@/lib/utils"
7
- import { ChevronRightIcon, CheckIcon } from "lucide-react"
6
+ import { cn } from "@/lib/utils";
7
+ import { ChevronRightIcon, CheckIcon } from "lucide-react";
8
8
 
9
9
  function DropdownMenu({ ...props }: MenuPrimitive.Root.Props) {
10
- return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />
10
+ return <MenuPrimitive.Root data-slot="dropdown-menu" {...props} />;
11
11
  }
12
12
 
13
13
  function DropdownMenuPortal({ ...props }: MenuPrimitive.Portal.Props) {
14
- return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />
14
+ return <MenuPrimitive.Portal data-slot="dropdown-menu-portal" {...props} />;
15
15
  }
16
16
 
17
17
  function DropdownMenuTrigger({ ...props }: MenuPrimitive.Trigger.Props) {
18
- return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />
18
+ return <MenuPrimitive.Trigger data-slot="dropdown-menu-trigger" {...props} />;
19
19
  }
20
20
 
21
21
  function DropdownMenuContent({
@@ -25,11 +25,7 @@ function DropdownMenuContent({
25
25
  sideOffset = 4,
26
26
  className,
27
27
  ...props
28
- }: MenuPrimitive.Popup.Props &
29
- Pick<
30
- MenuPrimitive.Positioner.Props,
31
- "align" | "alignOffset" | "side" | "sideOffset"
32
- >) {
28
+ }: MenuPrimitive.Popup.Props & Pick<MenuPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) {
33
29
  return (
34
30
  <MenuPrimitive.Portal>
35
31
  <MenuPrimitive.Positioner
@@ -41,16 +37,19 @@ function DropdownMenuContent({
41
37
  >
42
38
  <MenuPrimitive.Popup
43
39
  data-slot="dropdown-menu-content"
44
- className={cn("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 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden", className )}
40
+ className={cn(
41
+ "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 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 z-50 max-h-(--available-height) w-(--anchor-width) origin-(--transform-origin) overflow-x-hidden overflow-y-auto outline-none data-closed:overflow-hidden",
42
+ className,
43
+ )}
45
44
  {...props}
46
45
  />
47
46
  </MenuPrimitive.Positioner>
48
47
  </MenuPrimitive.Portal>
49
- )
48
+ );
50
49
  }
51
50
 
52
51
  function DropdownMenuGroup({ ...props }: MenuPrimitive.Group.Props) {
53
- return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />
52
+ return <MenuPrimitive.Group data-slot="dropdown-menu-group" {...props} />;
54
53
  }
55
54
 
56
55
  function DropdownMenuLabel({
@@ -58,7 +57,7 @@ function DropdownMenuLabel({
58
57
  inset,
59
58
  ...props
60
59
  }: MenuPrimitive.GroupLabel.Props & {
61
- inset?: boolean
60
+ inset?: boolean;
62
61
  }) {
63
62
  return (
64
63
  <MenuPrimitive.GroupLabel
@@ -67,7 +66,7 @@ function DropdownMenuLabel({
67
66
  className={cn("text-muted-foreground px-2 py-1.5 text-xs data-[inset]:pl-8", className)}
68
67
  {...props}
69
68
  />
70
- )
69
+ );
71
70
  }
72
71
 
73
72
  function DropdownMenuItem({
@@ -76,8 +75,8 @@ function DropdownMenuItem({
76
75
  variant = "default",
77
76
  ...props
78
77
  }: MenuPrimitive.Item.Props & {
79
- inset?: boolean
80
- variant?: "default" | "destructive"
78
+ inset?: boolean;
79
+ variant?: "default" | "destructive";
81
80
  }) {
82
81
  return (
83
82
  <MenuPrimitive.Item
@@ -86,15 +85,15 @@ function DropdownMenuItem({
86
85
  data-variant={variant}
87
86
  className={cn(
88
87
  "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:text-destructive 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 group/dropdown-menu-item relative flex cursor-default items-center outline-hidden select-none data-disabled:pointer-events-none data-disabled:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
89
- className
88
+ className,
90
89
  )}
91
90
  {...props}
92
91
  />
93
- )
92
+ );
94
93
  }
95
94
 
96
95
  function DropdownMenuSub({ ...props }: MenuPrimitive.SubmenuRoot.Props) {
97
- return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />
96
+ return <MenuPrimitive.SubmenuRoot data-slot="dropdown-menu-sub" {...props} />;
98
97
  }
99
98
 
100
99
  function DropdownMenuSubTrigger({
@@ -103,7 +102,7 @@ function DropdownMenuSubTrigger({
103
102
  children,
104
103
  ...props
105
104
  }: MenuPrimitive.SubmenuTrigger.Props & {
106
- inset?: boolean
105
+ inset?: boolean;
107
106
  }) {
108
107
  return (
109
108
  <MenuPrimitive.SubmenuTrigger
@@ -111,14 +110,14 @@ function DropdownMenuSubTrigger({
111
110
  data-inset={inset}
112
111
  className={cn(
113
112
  "focus:bg-accent focus:text-accent-foreground data-open:bg-accent data-open:text-accent-foreground not-data-[variant=destructive]:focus:**:text-accent-foreground min-h-7 gap-2 rounded-md px-2 py-1 text-xs [&_svg:not([class*='size-'])]:size-3.5 flex cursor-default items-center outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0",
114
- className
113
+ className,
115
114
  )}
116
115
  {...props}
117
116
  >
118
117
  {children}
119
118
  <ChevronRightIcon className="ml-auto" />
120
119
  </MenuPrimitive.SubmenuTrigger>
121
- )
120
+ );
122
121
  }
123
122
 
124
123
  function DropdownMenuSubContent({
@@ -132,28 +131,26 @@ function DropdownMenuSubContent({
132
131
  return (
133
132
  <DropdownMenuContent
134
133
  data-slot="dropdown-menu-sub-content"
135
- className={cn("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 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 w-auto", className)}
134
+ className={cn(
135
+ "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 bg-popover text-popover-foreground min-w-32 rounded-lg p-1 shadow-md ring-1 duration-100 w-auto",
136
+ className,
137
+ )}
136
138
  align={align}
137
139
  alignOffset={alignOffset}
138
140
  side={side}
139
141
  sideOffset={sideOffset}
140
142
  {...props}
141
143
  />
142
- )
144
+ );
143
145
  }
144
146
 
145
- function DropdownMenuCheckboxItem({
146
- className,
147
- children,
148
- checked,
149
- ...props
150
- }: MenuPrimitive.CheckboxItem.Props) {
147
+ function DropdownMenuCheckboxItem({ className, children, checked, ...props }: MenuPrimitive.CheckboxItem.Props) {
151
148
  return (
152
149
  <MenuPrimitive.CheckboxItem
153
150
  data-slot="dropdown-menu-checkbox-item"
154
151
  className={cn(
155
152
  "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
156
- className
153
+ className,
157
154
  )}
158
155
  checked={checked}
159
156
  {...props}
@@ -163,35 +160,25 @@ function DropdownMenuCheckboxItem({
163
160
  data-slot="dropdown-menu-checkbox-item-indicator"
164
161
  >
165
162
  <MenuPrimitive.CheckboxItemIndicator>
166
- <CheckIcon
167
- />
163
+ <CheckIcon />
168
164
  </MenuPrimitive.CheckboxItemIndicator>
169
165
  </span>
170
166
  {children}
171
167
  </MenuPrimitive.CheckboxItem>
172
- )
168
+ );
173
169
  }
174
170
 
175
171
  function DropdownMenuRadioGroup({ ...props }: MenuPrimitive.RadioGroup.Props) {
176
- return (
177
- <MenuPrimitive.RadioGroup
178
- data-slot="dropdown-menu-radio-group"
179
- {...props}
180
- />
181
- )
172
+ return <MenuPrimitive.RadioGroup data-slot="dropdown-menu-radio-group" {...props} />;
182
173
  }
183
174
 
184
- function DropdownMenuRadioItem({
185
- className,
186
- children,
187
- ...props
188
- }: MenuPrimitive.RadioItem.Props) {
175
+ function DropdownMenuRadioItem({ className, children, ...props }: MenuPrimitive.RadioItem.Props) {
189
176
  return (
190
177
  <MenuPrimitive.RadioItem
191
178
  data-slot="dropdown-menu-radio-item"
192
179
  className={cn(
193
180
  "focus:bg-accent focus:text-accent-foreground focus:**:text-accent-foreground min-h-7 gap-2 rounded-md py-1.5 pr-8 pl-2 text-xs [&_svg:not([class*='size-'])]:size-3.5 relative flex cursor-default items-center outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0",
194
- className
181
+ className,
195
182
  )}
196
183
  {...props}
197
184
  >
@@ -200,39 +187,35 @@ function DropdownMenuRadioItem({
200
187
  data-slot="dropdown-menu-radio-item-indicator"
201
188
  >
202
189
  <MenuPrimitive.RadioItemIndicator>
203
- <CheckIcon
204
- />
190
+ <CheckIcon />
205
191
  </MenuPrimitive.RadioItemIndicator>
206
192
  </span>
207
193
  {children}
208
194
  </MenuPrimitive.RadioItem>
209
- )
195
+ );
210
196
  }
211
197
 
212
- function DropdownMenuSeparator({
213
- className,
214
- ...props
215
- }: MenuPrimitive.Separator.Props) {
198
+ function DropdownMenuSeparator({ className, ...props }: MenuPrimitive.Separator.Props) {
216
199
  return (
217
200
  <MenuPrimitive.Separator
218
201
  data-slot="dropdown-menu-separator"
219
202
  className={cn("bg-border/50 -mx-1 my-1 h-px", className)}
220
203
  {...props}
221
204
  />
222
- )
205
+ );
223
206
  }
224
207
 
225
- function DropdownMenuShortcut({
226
- className,
227
- ...props
228
- }: React.ComponentProps<"span">) {
208
+ function DropdownMenuShortcut({ className, ...props }: React.ComponentProps<"span">) {
229
209
  return (
230
210
  <span
231
211
  data-slot="dropdown-menu-shortcut"
232
- className={cn("text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-[0.625rem] tracking-widest", className)}
212
+ className={cn(
213
+ "text-muted-foreground group-focus/dropdown-menu-item:text-accent-foreground ml-auto text-[0.625rem] tracking-widest",
214
+ className,
215
+ )}
233
216
  {...props}
234
217
  />
235
- )
218
+ );
236
219
  }
237
220
 
238
221
  export {
@@ -251,4 +234,4 @@ export {
251
234
  DropdownMenuSub,
252
235
  DropdownMenuSubTrigger,
253
236
  DropdownMenuSubContent,
254
- }
237
+ };
@@ -1,20 +1,23 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import { useMemo } from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
3
+ import { useMemo } from "react";
4
+ import { cva, type VariantProps } from "class-variance-authority";
5
5
 
6
- import { cn } from "../../utils/cn"
7
- import { Label } from "./label"
8
- import { Separator } from "./separator"
6
+ import { cn } from "../../utils/cn";
7
+ import { Label } from "./label";
8
+ import { Separator } from "./separator";
9
9
 
10
10
  function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
11
11
  return (
12
12
  <fieldset
13
13
  data-slot="field-set"
14
- className={cn("gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col", className)}
14
+ className={cn(
15
+ "gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col",
16
+ className,
17
+ )}
15
18
  {...props}
16
19
  />
17
- )
20
+ );
18
21
  }
19
22
 
20
23
  function FieldLegend({
@@ -29,7 +32,7 @@ function FieldLegend({
29
32
  className={cn("mb-2 font-medium data-[variant=label]:text-xs/relaxed data-[variant=legend]:text-sm", className)}
30
33
  {...props}
31
34
  />
32
- )
35
+ );
33
36
  }
34
37
 
35
38
  function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
@@ -38,18 +41,17 @@ function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
38
41
  data-slot="field-group"
39
42
  className={cn(
40
43
  "gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",
41
- className
44
+ className,
42
45
  )}
43
46
  {...props}
44
47
  />
45
- )
48
+ );
46
49
  }
47
50
 
48
51
  const fieldVariants = cva("data-[invalid=true]:text-destructive gap-2 group/field flex w-full", {
49
52
  variants: {
50
53
  orientation: {
51
- vertical:
52
- "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
54
+ vertical: "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
53
55
  horizontal:
54
56
  "flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
55
57
  responsive:
@@ -59,7 +61,7 @@ const fieldVariants = cva("data-[invalid=true]:text-destructive gap-2 group/fiel
59
61
  defaultVariants: {
60
62
  orientation: "vertical",
61
63
  },
62
- })
64
+ });
63
65
 
64
66
  function Field({
65
67
  className,
@@ -74,37 +76,31 @@ function Field({
74
76
  className={cn(fieldVariants({ orientation }), className)}
75
77
  {...props}
76
78
  />
77
- )
79
+ );
78
80
  }
79
81
 
80
82
  function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
81
83
  return (
82
84
  <div
83
85
  data-slot="field-content"
84
- className={cn(
85
- "gap-0.5 group/field-content flex flex-1 flex-col leading-snug",
86
- className
87
- )}
86
+ className={cn("gap-0.5 group/field-content flex flex-1 flex-col leading-snug", className)}
88
87
  {...props}
89
88
  />
90
- )
89
+ );
91
90
  }
92
91
 
93
- function FieldLabel({
94
- className,
95
- ...props
96
- }: React.ComponentProps<typeof Label>) {
92
+ function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {
97
93
  return (
98
94
  <Label
99
95
  data-slot="field-label"
100
96
  className={cn(
101
97
  "has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug",
102
98
  "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",
103
- className
99
+ className,
104
100
  )}
105
101
  {...props}
106
102
  />
107
- )
103
+ );
108
104
  }
109
105
 
110
106
  function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
@@ -113,11 +109,11 @@ function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
113
109
  data-slot="field-label"
114
110
  className={cn(
115
111
  "gap-2 text-xs/relaxed font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug",
116
- className
112
+ className,
117
113
  )}
118
114
  {...props}
119
115
  />
120
- )
116
+ );
121
117
  }
122
118
 
123
119
  function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
@@ -128,11 +124,11 @@ function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
128
124
  "text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
129
125
  "last:mt-0 nth-last-2:-mt-1",
130
126
  "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
131
- className
127
+ className,
132
128
  )}
133
129
  {...props}
134
130
  />
135
- )
131
+ );
136
132
  }
137
133
 
138
134
  function FieldSeparator({
@@ -140,7 +136,7 @@ function FieldSeparator({
140
136
  className,
141
137
  ...props
142
138
  }: React.ComponentProps<"div"> & {
143
- children?: React.ReactNode
139
+ children?: React.ReactNode;
144
140
  }) {
145
141
  return (
146
142
  <div
@@ -159,7 +155,7 @@ function FieldSeparator({
159
155
  </span>
160
156
  )}
161
157
  </div>
162
- )
158
+ );
163
159
  }
164
160
 
165
161
  function FieldError({
@@ -168,37 +164,32 @@ function FieldError({
168
164
  errors,
169
165
  ...props
170
166
  }: React.ComponentProps<"div"> & {
171
- errors?: Array<{ message?: string } | undefined>
167
+ errors?: Array<{ message?: string } | undefined>;
172
168
  }) {
173
169
  const content = useMemo(() => {
174
170
  if (children) {
175
- return children
171
+ return children;
176
172
  }
177
173
 
178
174
  if (!errors?.length) {
179
- return null
175
+ return null;
180
176
  }
181
177
 
182
- const uniqueErrors = [
183
- ...new Map(errors.map((error) => [error?.message, error])).values(),
184
- ]
178
+ const uniqueErrors = [...new Map(errors.map((error) => [error?.message, error])).values()];
185
179
 
186
180
  if (uniqueErrors?.length == 1) {
187
- return uniqueErrors[0]?.message
181
+ return uniqueErrors[0]?.message;
188
182
  }
189
183
 
190
184
  return (
191
185
  <ul className="ml-4 flex list-disc flex-col gap-1">
192
- {uniqueErrors.map(
193
- (error, index) =>
194
- error?.message && <li key={index}>{error.message}</li>
195
- )}
186
+ {uniqueErrors.map((error, index) => error?.message && <li key={index}>{error.message}</li>)}
196
187
  </ul>
197
- )
198
- }, [children, errors])
188
+ );
189
+ }, [children, errors]);
199
190
 
200
191
  if (!content) {
201
- return null
192
+ return null;
202
193
  }
203
194
 
204
195
  return (
@@ -210,7 +201,7 @@ function FieldError({
210
201
  >
211
202
  {content}
212
203
  </div>
213
- )
204
+ );
214
205
  }
215
206
 
216
207
  export {
@@ -224,4 +215,4 @@ export {
224
215
  FieldSet,
225
216
  FieldContent,
226
217
  FieldTitle,
227
- }
218
+ };
@@ -1,17 +1,15 @@
1
- "use client"
1
+ "use client";
2
2
 
3
- import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card"
3
+ import { PreviewCard as PreviewCardPrimitive } from "@base-ui/react/preview-card";
4
4
 
5
- import { cn } from "@/lib/utils"
5
+ import { cn } from "@/lib/utils";
6
6
 
7
7
  function HoverCard({ ...props }: PreviewCardPrimitive.Root.Props) {
8
- return <PreviewCardPrimitive.Root data-slot="hover-card" {...props} />
8
+ return <PreviewCardPrimitive.Root data-slot="hover-card" {...props} />;
9
9
  }
10
10
 
11
11
  function HoverCardTrigger({ ...props }: PreviewCardPrimitive.Trigger.Props) {
12
- return (
13
- <PreviewCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />
14
- )
12
+ return <PreviewCardPrimitive.Trigger data-slot="hover-card-trigger" {...props} />;
15
13
  }
16
14
 
17
15
  function HoverCardContent({
@@ -22,10 +20,7 @@ function HoverCardContent({
22
20
  alignOffset = 4,
23
21
  ...props
24
22
  }: PreviewCardPrimitive.Popup.Props &
25
- Pick<
26
- PreviewCardPrimitive.Positioner.Props,
27
- "align" | "alignOffset" | "side" | "sideOffset"
28
- >) {
23
+ Pick<PreviewCardPrimitive.Positioner.Props, "align" | "alignOffset" | "side" | "sideOffset">) {
29
24
  return (
30
25
  <PreviewCardPrimitive.Portal data-slot="hover-card-portal">
31
26
  <PreviewCardPrimitive.Positioner
@@ -39,13 +34,13 @@ function HoverCardContent({
39
34
  data-slot="hover-card-content"
40
35
  className={cn(
41
36
  "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 bg-popover text-popover-foreground w-72 rounded-lg p-2.5 text-xs/relaxed shadow-md ring-1 duration-100 z-50 origin-(--transform-origin) outline-hidden",
42
- className
37
+ className,
43
38
  )}
44
39
  {...props}
45
40
  />
46
41
  </PreviewCardPrimitive.Positioner>
47
42
  </PreviewCardPrimitive.Portal>
48
- )
43
+ );
49
44
  }
50
45
 
51
- export { HoverCard, HoverCardTrigger, HoverCardContent }
46
+ export { HoverCard, HoverCardTrigger, HoverCardContent };