@carlonicora/nextjs-jsonapi 1.17.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.
Files changed (109) hide show
  1. package/README.md +1 -1
  2. package/dist/{BlockNoteEditor-4Z6TZBJE.mjs → BlockNoteEditor-6TWTNHNZ.mjs} +2 -2
  3. package/dist/{BlockNoteEditor-34T5CY27.js → BlockNoteEditor-C3WWGGT6.js} +6 -6
  4. package/dist/{BlockNoteEditor-34T5CY27.js.map → BlockNoteEditor-C3WWGGT6.js.map} +1 -1
  5. package/dist/{chunk-D7H7SRWB.js → chunk-6U6QCSJK.js} +4054 -2590
  6. package/dist/chunk-6U6QCSJK.js.map +1 -0
  7. package/dist/{chunk-SXPXC2TY.mjs → chunk-UZDAPWJG.mjs} +5629 -4165
  8. package/dist/chunk-UZDAPWJG.mjs.map +1 -0
  9. package/dist/client/index.js +2 -2
  10. package/dist/client/index.mjs +1 -1
  11. package/dist/components/index.d.mts +298 -385
  12. package/dist/components/index.d.ts +298 -385
  13. package/dist/components/index.js +26 -2
  14. package/dist/components/index.js.map +1 -1
  15. package/dist/components/index.mjs +35 -11
  16. package/dist/contexts/index.js +2 -2
  17. package/dist/contexts/index.mjs +1 -1
  18. package/dist/scripts/generate-web-module/templates/components/editor.template.d.ts.map +1 -1
  19. package/dist/scripts/generate-web-module/templates/components/editor.template.js +20 -6
  20. package/dist/scripts/generate-web-module/templates/components/editor.template.js.map +1 -1
  21. package/dist/scripts/generate-web-module/templates/components/selector.template.d.ts.map +1 -1
  22. package/dist/scripts/generate-web-module/templates/components/selector.template.js +45 -48
  23. package/dist/scripts/generate-web-module/templates/components/selector.template.js.map +1 -1
  24. package/dist/testing/index.js.map +1 -1
  25. package/dist/testing/index.mjs.map +1 -1
  26. package/package.json +6 -25
  27. package/scripts/generate-web-module/templates/components/editor.template.ts +20 -6
  28. package/scripts/generate-web-module/templates/components/selector.template.ts +45 -48
  29. package/src/components/forms/CommonDeleter.tsx +2 -2
  30. package/src/components/forms/CommonEditorTrigger.tsx +3 -3
  31. package/src/components/forms/DatePickerPopover.tsx +3 -1
  32. package/src/components/forms/DateRangeSelector.tsx +1 -1
  33. package/src/components/forms/FormCheckbox.tsx +1 -1
  34. package/src/components/forms/FormDate.tsx +3 -1
  35. package/src/components/forms/FormDateTime.tsx +5 -3
  36. package/src/components/forms/FormSelect.tsx +1 -1
  37. package/src/components/forms/FormSlider.tsx +4 -1
  38. package/src/components/forms/__tests__/FormCheckbox.test.tsx +5 -1
  39. package/src/components/forms/__tests__/FormDate.test.tsx +5 -1
  40. package/src/components/forms/__tests__/FormSelect.test.tsx +5 -1
  41. package/src/components/navigations/RecentPagesNavigator.tsx +2 -2
  42. package/src/components/tables/ContentListTable.tsx +3 -3
  43. package/src/features/billing/stripe-customer/components/details/PaymentMethodCard.tsx +2 -2
  44. package/src/features/company/components/forms/CompanyConfigurationEditor.tsx +2 -2
  45. package/src/features/company/components/forms/CompanyDeleter.tsx +1 -1
  46. package/src/features/content/components/lists/ContentsList.tsx +1 -1
  47. package/src/features/notification/components/lists/NotificationsList.tsx +1 -1
  48. package/src/features/notification/components/modals/NotificationModal.tsx +2 -2
  49. package/src/features/role/components/forms/FormRoles.tsx +1 -1
  50. package/src/features/user/components/forms/UserEditor.tsx +2 -2
  51. package/src/features/user/components/forms/UserReactivator.tsx +1 -1
  52. package/src/features/user/components/forms/UserResentInvitationEmail.tsx +2 -2
  53. package/src/features/user/components/widgets/UserAvatar.tsx +37 -31
  54. package/src/features/user/components/widgets/UserSearchPopover.tsx +1 -1
  55. package/src/hooks/use-mobile.ts +1 -0
  56. package/src/lib/utils.ts +2 -0
  57. package/src/shadcnui/custom/multi-select.tsx +10 -21
  58. package/src/shadcnui/ui/accordion.tsx +64 -42
  59. package/src/shadcnui/ui/alert-dialog.tsx +142 -108
  60. package/src/shadcnui/ui/alert.tsx +64 -35
  61. package/src/shadcnui/ui/avatar.tsx +106 -50
  62. package/src/shadcnui/ui/badge.tsx +34 -26
  63. package/src/shadcnui/ui/breadcrumb.tsx +103 -92
  64. package/src/shadcnui/ui/button.tsx +30 -30
  65. package/src/shadcnui/ui/calendar.tsx +192 -50
  66. package/src/shadcnui/ui/card.tsx +94 -43
  67. package/src/shadcnui/ui/carousel.tsx +220 -201
  68. package/src/shadcnui/ui/chart.tsx +244 -190
  69. package/src/shadcnui/ui/checkbox.tsx +25 -25
  70. package/src/shadcnui/ui/collapsible.tsx +10 -4
  71. package/src/shadcnui/ui/combobox.tsx +292 -0
  72. package/src/shadcnui/ui/command.tsx +158 -126
  73. package/src/shadcnui/ui/context-menu.tsx +242 -164
  74. package/src/shadcnui/ui/dialog.tsx +125 -70
  75. package/src/shadcnui/ui/drawer.tsx +106 -70
  76. package/src/shadcnui/ui/dropdown-menu.tsx +231 -182
  77. package/src/shadcnui/ui/field.tsx +227 -0
  78. package/src/shadcnui/ui/hover-card.tsx +45 -23
  79. package/src/shadcnui/ui/input-group.tsx +149 -0
  80. package/src/shadcnui/ui/input-otp.tsx +19 -9
  81. package/src/shadcnui/ui/input.tsx +4 -5
  82. package/src/shadcnui/ui/label.tsx +16 -22
  83. package/src/shadcnui/ui/navigation-menu.tsx +44 -49
  84. package/src/shadcnui/ui/popover.tsx +81 -24
  85. package/src/shadcnui/ui/progress.tsx +77 -22
  86. package/src/shadcnui/ui/radio-group.tsx +30 -28
  87. package/src/shadcnui/ui/resizable.tsx +23 -17
  88. package/src/shadcnui/ui/scroll-area.tsx +50 -35
  89. package/src/shadcnui/ui/select.tsx +163 -135
  90. package/src/shadcnui/ui/separator.tsx +5 -8
  91. package/src/shadcnui/ui/sheet.tsx +40 -50
  92. package/src/shadcnui/ui/sidebar.tsx +317 -271
  93. package/src/shadcnui/ui/skeleton.tsx +2 -2
  94. package/src/shadcnui/ui/slider.tsx +60 -21
  95. package/src/shadcnui/ui/sonner.tsx +25 -1
  96. package/src/shadcnui/ui/switch.tsx +31 -24
  97. package/src/shadcnui/ui/table.tsx +84 -103
  98. package/src/shadcnui/ui/tabs.tsx +82 -55
  99. package/src/shadcnui/ui/textarea.tsx +15 -21
  100. package/src/shadcnui/ui/toggle.tsx +26 -21
  101. package/src/shadcnui/ui/tooltip.tsx +33 -24
  102. package/src/testing/factories/createMockApiData.ts +2 -2
  103. package/src/testing/factories/createMockResponse.ts +3 -8
  104. package/src/testing/factories/createMockService.ts +1 -4
  105. package/src/testing/index.ts +4 -18
  106. package/src/testing/matchers/jsonApiMatchers.ts +14 -16
  107. package/dist/chunk-D7H7SRWB.js.map +0 -1
  108. package/dist/chunk-SXPXC2TY.mjs.map +0 -1
  109. /package/dist/{BlockNoteEditor-4Z6TZBJE.mjs.map → BlockNoteEditor-6TWTNHNZ.mjs.map} +0 -0
@@ -1,30 +1,25 @@
1
- import * as React from "react"
2
- import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
1
+ import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu"
3
2
  import { cva } from "class-variance-authority"
4
- import { ChevronDownIcon } from "lucide-react"
5
3
 
6
- import { cn } from "../../utils/cn"
4
+ import { cn } from "@/lib/utils"
5
+ import { ChevronDownIcon } from "lucide-react"
7
6
 
8
7
  function NavigationMenu({
9
8
  className,
10
9
  children,
11
- viewport = true,
12
10
  ...props
13
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
14
- viewport?: boolean
15
- }) {
11
+ }: NavigationMenuPrimitive.Root.Props) {
16
12
  return (
17
13
  <NavigationMenuPrimitive.Root
18
14
  data-slot="navigation-menu"
19
- data-viewport={viewport}
20
15
  className={cn(
21
- "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
16
+ "max-w-max group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
22
17
  className
23
18
  )}
24
19
  {...props}
25
20
  >
26
21
  {children}
27
- {viewport && <NavigationMenuViewport />}
22
+ <NavigationMenuPositioner />
28
23
  </NavigationMenuPrimitive.Root>
29
24
  )
30
25
  }
@@ -32,12 +27,12 @@ function NavigationMenu({
32
27
  function NavigationMenuList({
33
28
  className,
34
29
  ...props
35
- }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
30
+ }: NavigationMenuPrimitive.List.Props) {
36
31
  return (
37
32
  <NavigationMenuPrimitive.List
38
33
  data-slot="navigation-menu-list"
39
34
  className={cn(
40
- "group flex flex-1 list-none items-center justify-center gap-1",
35
+ "gap-0 group flex flex-1 list-none items-center justify-center",
41
36
  className
42
37
  )}
43
38
  {...props}
@@ -48,7 +43,7 @@ function NavigationMenuList({
48
43
  function NavigationMenuItem({
49
44
  className,
50
45
  ...props
51
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
46
+ }: NavigationMenuPrimitive.Item.Props) {
52
47
  return (
53
48
  <NavigationMenuPrimitive.Item
54
49
  data-slot="navigation-menu-item"
@@ -59,14 +54,14 @@ function NavigationMenuItem({
59
54
  }
60
55
 
61
56
  const navigationMenuTriggerStyle = cva(
62
- "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:pointer-events-none disabled:opacity-50 data-[state=open]:hover:bg-accent data-[state=open]:text-accent-foreground data-[state=open]:focus:bg-accent data-[state=open]:bg-accent/50 focus-visible:ring-ring/50 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
57
+ "bg-background hover:bg-muted focus:bg-muted data-open:hover:bg-muted data-open:focus:bg-muted data-open:bg-muted/50 focus-visible:ring-ring/30 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted rounded-md px-2.5 py-1.5 text-xs/relaxed font-medium transition-all focus-visible:ring-[2px] focus-visible:outline-1 disabled:opacity-50 group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center disabled:pointer-events-none outline-none"
63
58
  )
64
59
 
65
60
  function NavigationMenuTrigger({
66
61
  className,
67
62
  children,
68
63
  ...props
69
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
64
+ }: NavigationMenuPrimitive.Trigger.Props) {
70
65
  return (
71
66
  <NavigationMenuPrimitive.Trigger
72
67
  data-slot="navigation-menu-trigger"
@@ -74,10 +69,7 @@ function NavigationMenuTrigger({
74
69
  {...props}
75
70
  >
76
71
  {children}{" "}
77
- <ChevronDownIcon
78
- className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-[state=open]:rotate-180"
79
- aria-hidden="true"
80
- />
72
+ <ChevronDownIcon className="relative top-[1px] ml-1 size-3 transition duration-300 group-data-open/navigation-menu-trigger:rotate-180 group-data-popup-open/navigation-menu-trigger:rotate-180" aria-hidden="true" />
81
73
  </NavigationMenuPrimitive.Trigger>
82
74
  )
83
75
  }
@@ -85,13 +77,12 @@ function NavigationMenuTrigger({
85
77
  function NavigationMenuContent({
86
78
  className,
87
79
  ...props
88
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
80
+ }: NavigationMenuPrimitive.Content.Props) {
89
81
  return (
90
82
  <NavigationMenuPrimitive.Content
91
83
  data-slot="navigation-menu-content"
92
84
  className={cn(
93
- "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 top-0 left-0 w-full p-2 pr-2.5 md:absolute md:w-auto",
94
- "group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-[state=open]:animate-in group-data-[viewport=false]/navigation-menu:data-[state=closed]:animate-out group-data-[viewport=false]/navigation-menu:data-[state=closed]:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-[state=open]:fade-in-0 group-data-[viewport=false]/navigation-menu:data-[state=closed]:fade-out-0 group-data-[viewport=false]/navigation-menu:top-full group-data-[viewport=false]/navigation-menu:mt-1.5 group-data-[viewport=false]/navigation-menu:overflow-hidden group-data-[viewport=false]/navigation-menu:rounded-md group-data-[viewport=false]/navigation-menu:border group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:duration-200 **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
85
+ "data-[motion^=from-]:animate-in data-[motion^=to-]:animate-out data-[motion^=from-]:fade-in data-[motion^=to-]:fade-out data-[motion=from-end]:slide-in-from-right-52 data-[motion=from-start]:slide-in-from-left-52 data-[motion=to-end]:slide-out-to-right-52 data-[motion=to-start]:slide-out-to-left-52 group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:ring-foreground/10 p-1.5 ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-xl group-data-[viewport=false]/navigation-menu:shadow-md group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:duration-300 h-full w-auto **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none",
95
86
  className
96
87
  )}
97
88
  {...props}
@@ -99,39 +90,43 @@ function NavigationMenuContent({
99
90
  )
100
91
  }
101
92
 
102
- function NavigationMenuViewport({
93
+ function NavigationMenuPositioner({
103
94
  className,
95
+ side = "bottom",
96
+ sideOffset = 8,
97
+ align = "start",
98
+ alignOffset = 0,
104
99
  ...props
105
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
100
+ }: NavigationMenuPrimitive.Positioner.Props) {
106
101
  return (
107
- <div
108
- className={cn(
109
- "absolute top-full left-0 isolate z-50 flex justify-center"
110
- )}
111
- >
112
- <NavigationMenuPrimitive.Viewport
113
- data-slot="navigation-menu-viewport"
102
+ <NavigationMenuPrimitive.Portal>
103
+ <NavigationMenuPrimitive.Positioner
104
+ side={side}
105
+ sideOffset={sideOffset}
106
+ align={align}
107
+ alignOffset={alignOffset}
114
108
  className={cn(
115
- "origin-top-center bg-popover text-popover-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border shadow md:w-[var(--radix-navigation-menu-viewport-width)]",
109
+ "transition-[top,left,right,bottom] duration-300 ease-[cubic-bezier(0.22,1,0.36,1)] data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0 isolate z-50 h-[var(--positioner-height)] w-[var(--positioner-width)] max-w-[var(--available-width)] data-[instant]:transition-none",
116
110
  className
117
111
  )}
118
112
  {...props}
119
- />
120
- </div>
113
+ >
114
+ <NavigationMenuPrimitive.Popup className="bg-popover text-popover-foreground ring-foreground/10 rounded-xl shadow ring-1 transition-all ease-[cubic-bezier(0.22,1,0.36,1)] outline-none data-[ending-style]:scale-90 data-[ending-style]:opacity-0 data-[ending-style]:duration-150 data-[starting-style]:scale-90 data-[starting-style]:opacity-0 xs:w-(--popup-width) relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin)">
115
+ <NavigationMenuPrimitive.Viewport className="relative size-full overflow-hidden" />
116
+ </NavigationMenuPrimitive.Popup>
117
+ </NavigationMenuPrimitive.Positioner>
118
+ </NavigationMenuPrimitive.Portal>
121
119
  )
122
120
  }
123
121
 
124
122
  function NavigationMenuLink({
125
123
  className,
126
124
  ...props
127
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
125
+ }: NavigationMenuPrimitive.Link.Props) {
128
126
  return (
129
127
  <NavigationMenuPrimitive.Link
130
128
  data-slot="navigation-menu-link"
131
- className={cn(
132
- "data-[active=true]:focus:bg-accent data-[active=true]:hover:bg-accent data-[active=true]:bg-accent/50 data-[active=true]:text-accent-foreground hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus-visible:ring-ring/50 [&_svg:not([class*='text-'])]:text-muted-foreground flex flex-col gap-1 rounded-sm p-2 text-sm transition-all outline-none focus-visible:ring-[3px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4",
133
- className
134
- )}
129
+ className={cn("data-[active=true]:focus:bg-muted data-[active=true]:hover:bg-muted data-[active=true]:bg-muted/50 focus-visible:ring-ring/30 hover:bg-muted focus:bg-muted flex items-center gap-1.5 rounded-lg p-2 text-xs/relaxed transition-all outline-none focus-visible:ring-[2px] focus-visible:outline-1 [&_svg:not([class*='size-'])]:size-4", className)}
135
130
  {...props}
136
131
  />
137
132
  )
@@ -140,9 +135,9 @@ function NavigationMenuLink({
140
135
  function NavigationMenuIndicator({
141
136
  className,
142
137
  ...props
143
- }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
138
+ }: NavigationMenuPrimitive.Icon.Props) {
144
139
  return (
145
- <NavigationMenuPrimitive.Indicator
140
+ <NavigationMenuPrimitive.Icon
146
141
  data-slot="navigation-menu-indicator"
147
142
  className={cn(
148
143
  "data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden",
@@ -150,19 +145,19 @@ function NavigationMenuIndicator({
150
145
  )}
151
146
  {...props}
152
147
  >
153
- <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
154
- </NavigationMenuPrimitive.Indicator>
148
+ <div className="bg-border rounded-tl-sm shadow-md relative top-[60%] h-2 w-2 rotate-45" />
149
+ </NavigationMenuPrimitive.Icon>
155
150
  )
156
151
  }
157
152
 
158
153
  export {
159
154
  NavigationMenu,
160
- NavigationMenuList,
161
- NavigationMenuItem,
162
155
  NavigationMenuContent,
163
- NavigationMenuTrigger,
164
- NavigationMenuLink,
165
156
  NavigationMenuIndicator,
166
- NavigationMenuViewport,
157
+ NavigationMenuItem,
158
+ NavigationMenuLink,
159
+ NavigationMenuList,
160
+ NavigationMenuTrigger,
167
161
  navigationMenuTriggerStyle,
162
+ NavigationMenuPositioner,
168
163
  }
@@ -1,33 +1,90 @@
1
- "use client";
1
+ "use client"
2
2
 
3
- import * as PopoverPrimitive from "@radix-ui/react-popover";
4
- import * as React from "react";
3
+ import * as React from "react"
4
+ import { Popover as PopoverPrimitive } from "@base-ui/react/popover"
5
5
 
6
- import { cn } from "../../utils/cn";
6
+ import { cn } from "@/lib/utils"
7
7
 
8
- const Popover = PopoverPrimitive.Root;
8
+ function Popover({ ...props }: PopoverPrimitive.Root.Props) {
9
+ return <PopoverPrimitive.Root data-slot="popover" {...props} />
10
+ }
9
11
 
10
- const PopoverTrigger = PopoverPrimitive.Trigger;
12
+ function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
13
+ return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
14
+ }
11
15
 
12
- const PopoverAnchor = PopoverPrimitive.Anchor;
16
+ function PopoverContent({
17
+ className,
18
+ align = "center",
19
+ alignOffset = 0,
20
+ side = "bottom",
21
+ sideOffset = 4,
22
+ ...props
23
+ }: PopoverPrimitive.Popup.Props &
24
+ Pick<
25
+ PopoverPrimitive.Positioner.Props,
26
+ "align" | "alignOffset" | "side" | "sideOffset"
27
+ >) {
28
+ return (
29
+ <PopoverPrimitive.Portal>
30
+ <PopoverPrimitive.Positioner
31
+ align={align}
32
+ alignOffset={alignOffset}
33
+ side={side}
34
+ sideOffset={sideOffset}
35
+ className="isolate z-50"
36
+ >
37
+ <PopoverPrimitive.Popup
38
+ data-slot="popover-content"
39
+ className={cn(
40
+ "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 flex flex-col gap-4 rounded-lg p-2.5 text-xs shadow-md ring-1 duration-100 z-50 w-72 origin-(--transform-origin) outline-hidden",
41
+ className
42
+ )}
43
+ {...props}
44
+ />
45
+ </PopoverPrimitive.Positioner>
46
+ </PopoverPrimitive.Portal>
47
+ )
48
+ }
13
49
 
14
- const PopoverContent = React.forwardRef<
15
- React.ElementRef<typeof PopoverPrimitive.Content>,
16
- React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
17
- >(({ className, align = "center", sideOffset = 4, ...props }, ref) => (
18
- <PopoverPrimitive.Portal>
19
- <PopoverPrimitive.Content
20
- ref={ref}
21
- align={align}
22
- sideOffset={sideOffset}
23
- className={cn(
24
- "z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 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",
25
- className,
26
- )}
50
+ function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
51
+ return (
52
+ <div
53
+ data-slot="popover-header"
54
+ className={cn("flex flex-col gap-1 text-xs", className)}
27
55
  {...props}
28
56
  />
29
- </PopoverPrimitive.Portal>
30
- ));
31
- PopoverContent.displayName = PopoverPrimitive.Content.displayName;
57
+ )
58
+ }
32
59
 
33
- export { Popover, PopoverAnchor, PopoverContent, PopoverTrigger };
60
+ function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {
61
+ return (
62
+ <PopoverPrimitive.Title
63
+ data-slot="popover-title"
64
+ className={cn("text-sm font-medium", className)}
65
+ {...props}
66
+ />
67
+ )
68
+ }
69
+
70
+ function PopoverDescription({
71
+ className,
72
+ ...props
73
+ }: PopoverPrimitive.Description.Props) {
74
+ return (
75
+ <PopoverPrimitive.Description
76
+ data-slot="popover-description"
77
+ className={cn("text-muted-foreground", className)}
78
+ {...props}
79
+ />
80
+ )
81
+ }
82
+
83
+ export {
84
+ Popover,
85
+ PopoverContent,
86
+ PopoverDescription,
87
+ PopoverHeader,
88
+ PopoverTitle,
89
+ PopoverTrigger,
90
+ }
@@ -1,25 +1,80 @@
1
- "use client";
2
-
3
- import * as ProgressPrimitive from "@radix-ui/react-progress";
4
- import * as React from "react";
5
-
6
- import { cn } from "../../utils/cn";
7
-
8
- const Progress = React.forwardRef<
9
- React.ElementRef<typeof ProgressPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
11
- >(({ className, value, ...props }, ref) => (
12
- <ProgressPrimitive.Root
13
- ref={ref}
14
- className={cn("relative h-2 w-full overflow-hidden rounded-full bg-primary/20", className)}
15
- {...props}
16
- >
1
+ "use client"
2
+
3
+ import { Progress as ProgressPrimitive } from "@base-ui/react/progress"
4
+
5
+ import { cn } from "@/lib/utils"
6
+
7
+ function Progress({
8
+ className,
9
+ children,
10
+ value,
11
+ ...props
12
+ }: ProgressPrimitive.Root.Props) {
13
+ return (
14
+ <ProgressPrimitive.Root
15
+ value={value}
16
+ data-slot="progress"
17
+ className={cn("flex flex-wrap gap-3", className)}
18
+ {...props}
19
+ >
20
+ {children}
21
+ <ProgressTrack>
22
+ <ProgressIndicator />
23
+ </ProgressTrack>
24
+ </ProgressPrimitive.Root>
25
+ )
26
+ }
27
+
28
+ function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {
29
+ return (
30
+ <ProgressPrimitive.Track
31
+ className={cn(
32
+ "bg-muted h-1 rounded-md relative flex w-full items-center overflow-x-hidden",
33
+ className
34
+ )}
35
+ data-slot="progress-track"
36
+ {...props}
37
+ />
38
+ )
39
+ }
40
+
41
+ function ProgressIndicator({
42
+ className,
43
+ ...props
44
+ }: ProgressPrimitive.Indicator.Props) {
45
+ return (
17
46
  <ProgressPrimitive.Indicator
18
- className="h-full w-full flex-1 bg-primary transition-all"
19
- style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
47
+ data-slot="progress-indicator"
48
+ className={cn("bg-primary h-full transition-all", className)}
49
+ {...props}
50
+ />
51
+ )
52
+ }
53
+
54
+ function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {
55
+ return (
56
+ <ProgressPrimitive.Label
57
+ className={cn("text-xs/relaxed font-medium", className)}
58
+ data-slot="progress-label"
59
+ {...props}
60
+ />
61
+ )
62
+ }
63
+
64
+ function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {
65
+ return (
66
+ <ProgressPrimitive.Value
67
+ className={cn("text-muted-foreground ml-auto text-xs/relaxed tabular-nums", className)}
68
+ data-slot="progress-value"
69
+ {...props}
20
70
  />
21
- </ProgressPrimitive.Root>
22
- ));
23
- Progress.displayName = ProgressPrimitive.Root.displayName;
71
+ )
72
+ }
24
73
 
25
- export { Progress };
74
+ export {
75
+ Progress,
76
+ ProgressTrack,
77
+ ProgressIndicator,
78
+ ProgressLabel,
79
+ ProgressValue,
80
+ }
@@ -1,37 +1,39 @@
1
- "use client";
1
+ "use client"
2
2
 
3
- import { cn } from "../../utils/cn";
4
- import { DotFilledIcon } from "@radix-ui/react-icons";
5
- import * as RadioGroupPrimitive from "@radix-ui/react-radio-group";
6
- import * as React from "react";
3
+ import { Radio as RadioPrimitive } from "@base-ui/react/radio"
4
+ import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group"
7
5
 
8
- const RadioGroup = React.forwardRef<
9
- React.ElementRef<typeof RadioGroupPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Root>
11
- >(({ className, ...props }, ref) => {
12
- return <RadioGroupPrimitive.Root className={cn("grid gap-2", className)} {...props} ref={ref} />;
13
- });
14
- RadioGroup.displayName = RadioGroupPrimitive.Root.displayName;
6
+ import { cn } from "@/lib/utils"
7
+ import { CircleIcon } from "lucide-react"
15
8
 
16
- const RadioGroupItem = React.forwardRef<
17
- React.ElementRef<typeof RadioGroupPrimitive.Item>,
18
- React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
19
- >(({ className, ...props }, ref) => {
9
+ function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
20
10
  return (
21
- <RadioGroupPrimitive.Item
22
- ref={ref}
11
+ <RadioGroupPrimitive
12
+ data-slot="radio-group"
13
+ className={cn("grid gap-3 w-full", className)}
14
+ {...props}
15
+ />
16
+ )
17
+ }
18
+
19
+ function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
20
+ return (
21
+ <RadioPrimitive.Root
22
+ data-slot="radio-group-item"
23
23
  className={cn(
24
- "aspect-square h-4 w-4 rounded-full border border-primary text-primary shadow focus:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50",
25
- className,
24
+ "border-input text-primary dark:bg-input/30 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 data-checked:bg-primary data-checked:border-primary flex size-4 rounded-full transition-none focus-visible:ring-[2px] aria-invalid:ring-[2px] group/radio-group-item peer relative aspect-square shrink-0 border outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",
25
+ className
26
26
  )}
27
27
  {...props}
28
28
  >
29
- <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
30
- <DotFilledIcon className="h-3.5 w-3.5 fill-primary" />
31
- </RadioGroupPrimitive.Indicator>
32
- </RadioGroupPrimitive.Item>
33
- );
34
- });
35
- RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName;
29
+ <RadioPrimitive.Indicator
30
+ data-slot="radio-group-indicator"
31
+ className="group-aria-invalid/radio-group-item:text-destructive flex size-4 items-center justify-center text-white"
32
+ >
33
+ <CircleIcon className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 fill-current" />
34
+ </RadioPrimitive.Indicator>
35
+ </RadioPrimitive.Root>
36
+ )
37
+ }
36
38
 
37
- export { RadioGroup, RadioGroupItem };
39
+ export { RadioGroup, RadioGroupItem }
@@ -1,22 +1,30 @@
1
- "use client";
1
+ "use client"
2
2
 
3
- import { GripVerticalIcon } from "lucide-react";
4
- import * as React from "react";
5
- import * as ResizablePrimitive from "react-resizable-panels";
6
- import { cn } from "../../utils";
3
+ import * as React from "react"
4
+ import * as ResizablePrimitive from "react-resizable-panels"
7
5
 
8
- function ResizablePanelGroup({ className, ...props }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
6
+ import { cn } from "@/lib/utils"
7
+
8
+ function ResizablePanelGroup({
9
+ className,
10
+ ...props
11
+ }: React.ComponentProps<typeof ResizablePrimitive.PanelGroup>) {
9
12
  return (
10
13
  <ResizablePrimitive.PanelGroup
11
14
  data-slot="resizable-panel-group"
12
- className={cn("flex h-full w-full data-[panel-group-direction=vertical]:flex-col", className)}
15
+ className={cn(
16
+ "flex h-full w-full data-[panel-group-direction=vertical]:flex-col",
17
+ className
18
+ )}
13
19
  {...props}
14
20
  />
15
- );
21
+ )
16
22
  }
17
23
 
18
- function ResizablePanel({ ...props }: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
19
- return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />;
24
+ function ResizablePanel({
25
+ ...props
26
+ }: React.ComponentProps<typeof ResizablePrimitive.Panel>) {
27
+ return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />
20
28
  }
21
29
 
22
30
  function ResizableHandle({
@@ -24,24 +32,22 @@ function ResizableHandle({
24
32
  className,
25
33
  ...props
26
34
  }: React.ComponentProps<typeof ResizablePrimitive.PanelResizeHandle> & {
27
- withHandle?: boolean;
35
+ withHandle?: boolean
28
36
  }) {
29
37
  return (
30
38
  <ResizablePrimitive.PanelResizeHandle
31
39
  data-slot="resizable-handle"
32
40
  className={cn(
33
41
  "bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden data-[panel-group-direction=vertical]:h-px data-[panel-group-direction=vertical]:w-full data-[panel-group-direction=vertical]:after:left-0 data-[panel-group-direction=vertical]:after:h-1 data-[panel-group-direction=vertical]:after:w-full data-[panel-group-direction=vertical]:after:translate-x-0 data-[panel-group-direction=vertical]:after:-translate-y-1/2 [&[data-panel-group-direction=vertical]>div]:rotate-90",
34
- className,
42
+ className
35
43
  )}
36
44
  {...props}
37
45
  >
38
46
  {withHandle && (
39
- <div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
40
- <GripVerticalIcon className="size-2.5" />
41
- </div>
47
+ <div className="bg-border h-6 w-1 rounded-lg z-10 flex shrink-0" />
42
48
  )}
43
49
  </ResizablePrimitive.PanelResizeHandle>
44
- );
50
+ )
45
51
  }
46
52
 
47
- export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
53
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle }
@@ -1,40 +1,55 @@
1
- "use client";
1
+ "use client"
2
2
 
3
- import * as ScrollAreaPrimitive from "@radix-ui/react-scroll-area";
4
- import * as React from "react";
3
+ import * as React from "react"
4
+ import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
5
5
 
6
- import { cn } from "../../utils/cn";
6
+ import { cn } from "@/lib/utils"
7
7
 
8
- const ScrollArea = React.forwardRef<
9
- React.ElementRef<typeof ScrollAreaPrimitive.Root>,
10
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.Root>
11
- >(({ className, children, ...props }, ref) => (
12
- <ScrollAreaPrimitive.Root ref={ref} className={cn("relative overflow-hidden", className)} {...props}>
13
- <ScrollAreaPrimitive.Viewport className="h-full w-full rounded-[inherit]">{children}</ScrollAreaPrimitive.Viewport>
14
- <ScrollBar />
15
- <ScrollAreaPrimitive.Corner />
16
- </ScrollAreaPrimitive.Root>
17
- ));
18
- ScrollArea.displayName = ScrollAreaPrimitive.Root.displayName;
8
+ function ScrollArea({
9
+ className,
10
+ children,
11
+ ...props
12
+ }: ScrollAreaPrimitive.Root.Props) {
13
+ return (
14
+ <ScrollAreaPrimitive.Root
15
+ data-slot="scroll-area"
16
+ className={cn("relative", className)}
17
+ {...props}
18
+ >
19
+ <ScrollAreaPrimitive.Viewport
20
+ data-slot="scroll-area-viewport"
21
+ className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
22
+ >
23
+ {children}
24
+ </ScrollAreaPrimitive.Viewport>
25
+ <ScrollBar />
26
+ <ScrollAreaPrimitive.Corner />
27
+ </ScrollAreaPrimitive.Root>
28
+ )
29
+ }
19
30
 
20
- const ScrollBar = React.forwardRef<
21
- React.ElementRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>,
22
- React.ComponentPropsWithoutRef<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>
23
- >(({ className, orientation = "vertical", ...props }, ref) => (
24
- <ScrollAreaPrimitive.ScrollAreaScrollbar
25
- ref={ref}
26
- orientation={orientation}
27
- className={cn(
28
- "flex touch-none select-none transition-colors",
29
- orientation === "vertical" && "h-full w-2.5 border-l border-l-transparent p-[1px]",
30
- orientation === "horizontal" && "h-2.5 flex-col border-t border-t-transparent p-[1px]",
31
- className,
32
- )}
33
- {...props}
34
- >
35
- <ScrollAreaPrimitive.ScrollAreaThumb className="relative flex-1 rounded-full bg-border" />
36
- </ScrollAreaPrimitive.ScrollAreaScrollbar>
37
- ));
38
- ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName;
31
+ function ScrollBar({
32
+ className,
33
+ orientation = "vertical",
34
+ ...props
35
+ }: ScrollAreaPrimitive.Scrollbar.Props) {
36
+ return (
37
+ <ScrollAreaPrimitive.Scrollbar
38
+ data-slot="scroll-area-scrollbar"
39
+ data-orientation={orientation}
40
+ orientation={orientation}
41
+ className={cn(
42
+ "data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",
43
+ className
44
+ )}
45
+ {...props}
46
+ >
47
+ <ScrollAreaPrimitive.Thumb
48
+ data-slot="scroll-area-thumb"
49
+ className="rounded-full bg-border relative flex-1"
50
+ />
51
+ </ScrollAreaPrimitive.Scrollbar>
52
+ )
53
+ }
39
54
 
40
- export { ScrollArea, ScrollBar };
55
+ export { ScrollArea, ScrollBar }