@lark-apaas/coding-templates 0.1.4 → 0.1.6

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 (85) hide show
  1. package/package.json +1 -1
  2. package/template-vite-react/README.md +175 -0
  3. package/template-vite-react/client/index.html +2 -1
  4. package/template-vite-react/client/src/app.tsx +3 -1
  5. package/template-vite-react/client/src/components/layout.tsx +0 -2
  6. package/template-vite-react/client/src/components/ui/README.md +134 -0
  7. package/template-vite-react/client/src/components/ui/accordion.tsx +22 -28
  8. package/template-vite-react/client/src/components/ui/alert-dialog.tsx +34 -64
  9. package/template-vite-react/client/src/components/ui/alert.tsx +10 -15
  10. package/template-vite-react/client/src/components/ui/aspect-ratio.tsx +5 -16
  11. package/template-vite-react/client/src/components/ui/avatar.tsx +11 -67
  12. package/template-vite-react/client/src/components/ui/badge.tsx +21 -31
  13. package/template-vite-react/client/src/components/ui/breadcrumb.tsx +23 -39
  14. package/template-vite-react/client/src/components/ui/button.tsx +36 -25
  15. package/template-vite-react/client/src/components/ui/calendar.tsx +37 -43
  16. package/template-vite-react/client/src/components/ui/card.tsx +73 -94
  17. package/template-vite-react/client/src/components/ui/carousel.tsx +7 -8
  18. package/template-vite-react/client/src/components/ui/chart.tsx +35 -49
  19. package/template-vite-react/client/src/components/ui/checkbox.tsx +10 -7
  20. package/template-vite-react/client/src/components/ui/collapsible.tsx +20 -6
  21. package/template-vite-react/client/src/components/ui/command.tsx +52 -40
  22. package/template-vite-react/client/src/components/ui/context-menu.tsx +170 -117
  23. package/template-vite-react/client/src/components/ui/dialog.tsx +37 -52
  24. package/template-vite-react/client/src/components/ui/drawer.tsx +12 -9
  25. package/template-vite-react/client/src/components/ui/dropdown-menu.tsx +194 -133
  26. package/template-vite-react/client/src/components/ui/hover-card.tsx +24 -29
  27. package/template-vite-react/client/src/components/ui/input-group.tsx +39 -29
  28. package/template-vite-react/client/src/components/ui/input-otp.tsx +7 -17
  29. package/template-vite-react/client/src/components/ui/input.tsx +4 -3
  30. package/template-vite-react/client/src/components/ui/label.tsx +9 -3
  31. package/template-vite-react/client/src/components/ui/menubar.tsx +160 -92
  32. package/template-vite-react/client/src/components/ui/navigation-menu.tsx +45 -45
  33. package/template-vite-react/client/src/components/ui/pagination.tsx +32 -35
  34. package/template-vite-react/client/src/components/ui/popover.tsx +20 -62
  35. package/template-vite-react/client/src/components/ui/progress.tsx +14 -64
  36. package/template-vite-react/client/src/components/ui/radio-group.tsx +20 -13
  37. package/template-vite-react/client/src/components/ui/resizable.tsx +18 -10
  38. package/template-vite-react/client/src/components/ui/scroll-area.tsx +13 -10
  39. package/template-vite-react/client/src/components/ui/select.tsx +122 -78
  40. package/template-vite-react/client/src/components/ui/separator.tsx +7 -4
  41. package/template-vite-react/client/src/components/ui/sheet.tsx +42 -41
  42. package/template-vite-react/client/src/components/ui/sidebar.tsx +162 -156
  43. package/template-vite-react/client/src/components/ui/skeleton.tsx +1 -1
  44. package/template-vite-react/client/src/components/ui/slider.tsx +52 -22
  45. package/template-vite-react/client/src/components/ui/sonner.tsx +44 -26
  46. package/template-vite-react/client/src/components/ui/switch.tsx +9 -8
  47. package/template-vite-react/client/src/components/ui/table.tsx +5 -5
  48. package/template-vite-react/client/src/components/ui/tabs.tsx +24 -38
  49. package/template-vite-react/client/src/components/ui/textarea.tsx +1 -1
  50. package/template-vite-react/client/src/components/ui/toggle-group.tsx +14 -20
  51. package/template-vite-react/client/src/components/ui/toggle.tsx +13 -10
  52. package/template-vite-react/client/src/components/ui/tooltip.tsx +30 -33
  53. package/template-vite-react/client/src/index.css +130 -0
  54. package/template-vite-react/client/src/main.tsx +1 -4
  55. package/template-vite-react/client/src/pages/home/index.tsx +5 -5
  56. package/template-vite-react/components.json +2 -6
  57. package/template-vite-react/eslint.config.js +11 -0
  58. package/template-vite-react/package.json +27 -2
  59. package/template-vite-react/vite.config.ts +5 -0
  60. package/template-vite-react/client/src/components/header.tsx +0 -22
  61. package/template-vite-react/client/src/components/theme-provider.tsx +0 -45
  62. package/template-vite-react/client/src/components/ui/icons/file-ae-colorful-icon.tsx +0 -21
  63. package/template-vite-react/client/src/components/ui/icons/file-ai-colorful-icon.tsx +0 -36
  64. package/template-vite-react/client/src/components/ui/icons/file-android-colorful-icon.tsx +0 -33
  65. package/template-vite-react/client/src/components/ui/icons/file-audio-colorful-icon.tsx +0 -21
  66. package/template-vite-react/client/src/components/ui/icons/file-code-colorful-icon.tsx +0 -28
  67. package/template-vite-react/client/src/components/ui/icons/file-csv-colorful-icon.tsx +0 -21
  68. package/template-vite-react/client/src/components/ui/icons/file-eml-colorful-icon.tsx +0 -29
  69. package/template-vite-react/client/src/components/ui/icons/file-ios-colorful-icon.tsx +0 -25
  70. package/template-vite-react/client/src/components/ui/icons/file-keynote-colorful-icon.tsx +0 -29
  71. package/template-vite-react/client/src/components/ui/icons/file-pages-colorful-icon.tsx +0 -29
  72. package/template-vite-react/client/src/components/ui/icons/file-ps-colorful-icon.tsx +0 -21
  73. package/template-vite-react/client/src/components/ui/icons/file-sketch-colorful-icon.tsx +0 -21
  74. package/template-vite-react/client/src/components/ui/icons/file-slide-colorful-icon.tsx +0 -21
  75. package/template-vite-react/client/src/components/ui/icons/file-vcf-colorful-icon.tsx +0 -29
  76. package/template-vite-react/client/src/components/ui/icons/file-wiki-excel-colorful-icon.tsx +0 -23
  77. package/template-vite-react/client/src/components/ui/icons/file-wiki-image-colorful-icon.tsx +0 -27
  78. package/template-vite-react/client/src/components/ui/icons/file-wiki-pdf-colorful-icon.tsx +0 -20
  79. package/template-vite-react/client/src/components/ui/icons/file-wiki-ppt-colorful-icon.tsx +0 -21
  80. package/template-vite-react/client/src/components/ui/icons/file-wiki-text-colorful-icon.tsx +0 -12
  81. package/template-vite-react/client/src/components/ui/icons/file-wiki-unknown-colorful-icon.tsx +0 -14
  82. package/template-vite-react/client/src/components/ui/icons/file-wiki-video-colorful-icon.tsx +0 -23
  83. package/template-vite-react/client/src/components/ui/icons/file-wiki-word-colorful-icon.tsx +0 -38
  84. package/template-vite-react/client/src/components/ui/icons/file-wiki-zip-colorful-icon.tsx +0 -21
  85. package/template-vite-react/client/src/types/index.ts +0 -1
@@ -1,19 +1,22 @@
1
- import { NavigationMenu as NavigationMenuPrimitive } from "@base-ui/react/navigation-menu"
1
+ import * as React from "react"
2
+ import * as NavigationMenuPrimitive from "@radix-ui/react-navigation-menu"
2
3
  import { cva } from "class-variance-authority"
4
+ import { ChevronDownIcon } from "lucide-react"
3
5
 
4
6
  import { cn } from "@/lib/utils"
5
- import { ChevronDownIcon } from "lucide-react"
6
7
 
7
8
  function NavigationMenu({
8
- align = "start",
9
9
  className,
10
10
  children,
11
+ viewport = true,
11
12
  ...props
12
- }: NavigationMenuPrimitive.Root.Props &
13
- Pick<NavigationMenuPrimitive.Positioner.Props, "align">) {
13
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Root> & {
14
+ viewport?: boolean
15
+ }) {
14
16
  return (
15
17
  <NavigationMenuPrimitive.Root
16
18
  data-slot="navigation-menu"
19
+ data-viewport={viewport}
17
20
  className={cn(
18
21
  "group/navigation-menu relative flex max-w-max flex-1 items-center justify-center",
19
22
  className
@@ -21,7 +24,7 @@ function NavigationMenu({
21
24
  {...props}
22
25
  >
23
26
  {children}
24
- <NavigationMenuPositioner align={align} />
27
+ {viewport && <NavigationMenuViewport />}
25
28
  </NavigationMenuPrimitive.Root>
26
29
  )
27
30
  }
@@ -29,12 +32,12 @@ function NavigationMenu({
29
32
  function NavigationMenuList({
30
33
  className,
31
34
  ...props
32
- }: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.List>) {
35
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.List>) {
33
36
  return (
34
37
  <NavigationMenuPrimitive.List
35
38
  data-slot="navigation-menu-list"
36
39
  className={cn(
37
- "group flex flex-1 list-none items-center justify-center gap-0",
40
+ "group flex flex-1 list-none items-center justify-center gap-1",
38
41
  className
39
42
  )}
40
43
  {...props}
@@ -45,7 +48,7 @@ function NavigationMenuList({
45
48
  function NavigationMenuItem({
46
49
  className,
47
50
  ...props
48
- }: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.Item>) {
51
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Item>) {
49
52
  return (
50
53
  <NavigationMenuPrimitive.Item
51
54
  data-slot="navigation-menu-item"
@@ -56,14 +59,14 @@ function NavigationMenuItem({
56
59
  }
57
60
 
58
61
  const navigationMenuTriggerStyle = cva(
59
- "group/navigation-menu-trigger inline-flex h-9 w-max items-center justify-center rounded-lg px-2.5 py-1.5 text-sm font-medium transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 data-popup-open:bg-muted/50 data-popup-open:hover:bg-muted data-open:bg-muted/50 data-open:hover:bg-muted data-open:focus:bg-muted"
62
+ "group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium enabled:hover:bg-accent enabled:hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground disabled:cursor-not-allowed disabled:opacity-50 enabled: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/20 outline-none transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1"
60
63
  )
61
64
 
62
65
  function NavigationMenuTrigger({
63
66
  className,
64
67
  children,
65
68
  ...props
66
- }: NavigationMenuPrimitive.Trigger.Props) {
69
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Trigger>) {
67
70
  return (
68
71
  <NavigationMenuPrimitive.Trigger
69
72
  data-slot="navigation-menu-trigger"
@@ -71,7 +74,10 @@ function NavigationMenuTrigger({
71
74
  {...props}
72
75
  >
73
76
  {children}{" "}
74
- <ChevronDownIcon className="relative top-px ml-1 size-3 transition duration-300 group-data-popup-open/navigation-menu-trigger:rotate-180 group-data-open/navigation-menu-trigger:rotate-180" aria-hidden="true" />
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
+ />
75
81
  </NavigationMenuPrimitive.Trigger>
76
82
  )
77
83
  }
@@ -79,12 +85,13 @@ function NavigationMenuTrigger({
79
85
  function NavigationMenuContent({
80
86
  className,
81
87
  ...props
82
- }: NavigationMenuPrimitive.Content.Props) {
88
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Content>) {
83
89
  return (
84
90
  <NavigationMenuPrimitive.Content
85
91
  data-slot="navigation-menu-content"
86
92
  className={cn(
87
- "data-ending-style:data-activation-direction=left:translate-x-[50%] data-ending-style:data-activation-direction=right:translate-x-[-50%] data-starting-style:data-activation-direction=left:translate-x-[-50%] data-starting-style:data-activation-direction=right:translate-x-[50%] h-full w-auto p-1 transition-[opacity,transform,translate] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] group-data-[viewport=false]/navigation-menu:rounded-lg group-data-[viewport=false]/navigation-menu:bg-popover group-data-[viewport=false]/navigation-menu:text-popover-foreground group-data-[viewport=false]/navigation-menu:shadow group-data-[viewport=false]/navigation-menu:ring-1 group-data-[viewport=false]/navigation-menu:ring-foreground/10 group-data-[viewport=false]/navigation-menu:duration-300 data-ending-style:opacity-0 data-starting-style:opacity-0 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 data-[motion^=from-]:animate-in data-[motion^=from-]:fade-in data-[motion^=to-]:animate-out data-[motion^=to-]:fade-out **:data-[slot=navigation-menu-link]:focus:ring-0 **:data-[slot=navigation-menu-link]:focus:outline-none group-data-[viewport=false]/navigation-menu:data-open:animate-in group-data-[viewport=false]/navigation-menu:data-open:fade-in-0 group-data-[viewport=false]/navigation-menu:data-open:zoom-in-95 group-data-[viewport=false]/navigation-menu:data-closed:animate-out group-data-[viewport=false]/navigation-menu:data-closed:fade-out-0 group-data-[viewport=false]/navigation-menu:data-closed:zoom-out-95",
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",
88
95
  className
89
96
  )}
90
97
  {...props}
@@ -92,44 +99,37 @@ function NavigationMenuContent({
92
99
  )
93
100
  }
94
101
 
95
- function NavigationMenuPositioner({
102
+ function NavigationMenuViewport({
96
103
  className,
97
- side = "bottom",
98
- sideOffset = 8,
99
- align = "start",
100
- alignOffset = 0,
101
104
  ...props
102
- }: NavigationMenuPrimitive.Positioner.Props) {
105
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Viewport>) {
103
106
  return (
104
- <NavigationMenuPrimitive.Portal>
105
- <NavigationMenuPrimitive.Positioner
106
- side={side}
107
- sideOffset={sideOffset}
108
- align={align}
109
- alignOffset={alignOffset}
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"
110
114
  className={cn(
111
- "isolate z-50 h-(--positioner-height) w-(--positioner-width) max-w-(--available-width) transition-[top,left,right,bottom] duration-[0.35s] ease-[cubic-bezier(0.22,1,0.36,1)] data-instant:transition-none data-[side=bottom]:before:top-[-10px] data-[side=bottom]:before:right-0 data-[side=bottom]:before:left-0",
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)]",
112
116
  className
113
117
  )}
114
118
  {...props}
115
- >
116
- <NavigationMenuPrimitive.Popup className="data-[ending-style]:easing-[ease] xs:w-(--popup-width) relative h-(--popup-height) w-(--popup-width) origin-(--transform-origin) rounded-lg bg-popover text-popover-foreground shadow ring-1 ring-foreground/10 transition-[opacity,transform,width,height,scale,translate] duration-[0.35s] 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">
117
- <NavigationMenuPrimitive.Viewport className="relative size-full overflow-hidden" />
118
- </NavigationMenuPrimitive.Popup>
119
- </NavigationMenuPrimitive.Positioner>
120
- </NavigationMenuPrimitive.Portal>
119
+ />
120
+ </div>
121
121
  )
122
122
  }
123
123
 
124
124
  function NavigationMenuLink({
125
125
  className,
126
126
  ...props
127
- }: NavigationMenuPrimitive.Link.Props) {
127
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Link>) {
128
128
  return (
129
129
  <NavigationMenuPrimitive.Link
130
130
  data-slot="navigation-menu-link"
131
131
  className={cn(
132
- "flex items-center gap-2 rounded-lg p-2 text-sm transition-all outline-none hover:bg-muted focus:bg-muted focus-visible:ring-3 focus-visible:ring-ring/50 focus-visible:outline-1 in-data-[slot=navigation-menu-content]:rounded-md data-active:bg-muted/50 data-active:hover:bg-muted data-active:focus:bg-muted [&_svg:not([class*='size-'])]:size-4",
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/20 [&_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
133
  className
134
134
  )}
135
135
  {...props}
@@ -140,29 +140,29 @@ function NavigationMenuLink({
140
140
  function NavigationMenuIndicator({
141
141
  className,
142
142
  ...props
143
- }: React.ComponentPropsWithRef<typeof NavigationMenuPrimitive.Icon>) {
143
+ }: React.ComponentProps<typeof NavigationMenuPrimitive.Indicator>) {
144
144
  return (
145
- <NavigationMenuPrimitive.Icon
145
+ <NavigationMenuPrimitive.Indicator
146
146
  data-slot="navigation-menu-indicator"
147
147
  className={cn(
148
- "top-full z-1 flex h-1.5 items-end justify-center overflow-hidden data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:animate-in data-[state=visible]:fade-in",
148
+ "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",
149
149
  className
150
150
  )}
151
151
  {...props}
152
152
  >
153
- <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
154
- </NavigationMenuPrimitive.Icon>
153
+ <div className="bg-border relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm shadow-md" />
154
+ </NavigationMenuPrimitive.Indicator>
155
155
  )
156
156
  }
157
157
 
158
158
  export {
159
159
  NavigationMenu,
160
- NavigationMenuContent,
161
- NavigationMenuIndicator,
162
- NavigationMenuItem,
163
- NavigationMenuLink,
164
160
  NavigationMenuList,
161
+ NavigationMenuItem,
162
+ NavigationMenuContent,
165
163
  NavigationMenuTrigger,
164
+ NavigationMenuLink,
165
+ NavigationMenuIndicator,
166
+ NavigationMenuViewport,
166
167
  navigationMenuTriggerStyle,
167
- NavigationMenuPositioner,
168
168
  }
@@ -1,8 +1,12 @@
1
1
  import * as React from "react"
2
+ import {
3
+ ChevronLeftIcon,
4
+ ChevronRightIcon,
5
+ MoreHorizontalIcon,
6
+ } from "lucide-react"
2
7
 
3
8
  import { cn } from "@/lib/utils"
4
- import { Button } from "@/components/ui/button"
5
- import { ChevronLeftIcon, ChevronRightIcon, MoreHorizontalIcon } from "lucide-react"
9
+ import { Button, buttonVariants } from "@/components/ui/button"
6
10
 
7
11
  function Pagination({ className, ...props }: React.ComponentProps<"nav">) {
8
12
  return (
@@ -23,7 +27,7 @@ function PaginationContent({
23
27
  return (
24
28
  <ul
25
29
  data-slot="pagination-content"
26
- className={cn("flex items-center gap-0.5", className)}
30
+ className={cn("flex flex-row items-center gap-1", className)}
27
31
  {...props}
28
32
  />
29
33
  )
@@ -45,55 +49,52 @@ function PaginationLink({
45
49
  ...props
46
50
  }: PaginationLinkProps) {
47
51
  return (
48
- <Button
49
- variant={isActive ? "outline" : "ghost"}
50
- size={size}
51
- className={cn(className)}
52
- nativeButton={false}
53
- render={
54
- <a
55
- aria-current={isActive ? "page" : undefined}
56
- data-slot="pagination-link"
57
- data-active={isActive}
58
- {...props}
59
- />
60
- }
52
+ <a
53
+ aria-current={isActive ? "page" : undefined}
54
+ data-slot="pagination-link"
55
+ data-active={isActive}
56
+ className={cn(
57
+ buttonVariants({
58
+ variant: isActive ? "outline" : "ghost",
59
+ size,
60
+ }),
61
+ className
62
+ )}
63
+ {...props}
61
64
  />
62
65
  )
63
66
  }
64
67
 
65
68
  function PaginationPrevious({
66
69
  className,
67
- text = "Previous",
68
70
  ...props
69
- }: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
71
+ }: React.ComponentProps<typeof PaginationLink>) {
70
72
  return (
71
73
  <PaginationLink
72
74
  aria-label="Go to previous page"
73
75
  size="default"
74
- className={cn("pl-1.5!", className)}
76
+ className={cn("gap-1 px-2.5 sm:pl-2.5", className)}
75
77
  {...props}
76
78
  >
77
- <ChevronLeftIcon data-icon="inline-start" />
78
- <span className="hidden sm:block">{text}</span>
79
+ <ChevronLeftIcon />
80
+ <span className="hidden">Previous</span>
79
81
  </PaginationLink>
80
82
  )
81
83
  }
82
84
 
83
85
  function PaginationNext({
84
86
  className,
85
- text = "Next",
86
87
  ...props
87
- }: React.ComponentProps<typeof PaginationLink> & { text?: string }) {
88
+ }: React.ComponentProps<typeof PaginationLink>) {
88
89
  return (
89
90
  <PaginationLink
90
91
  aria-label="Go to next page"
91
92
  size="default"
92
- className={cn("pr-1.5!", className)}
93
+ className={cn("gap-1 px-2.5 sm:pr-2.5", className)}
93
94
  {...props}
94
95
  >
95
- <span className="hidden sm:block">{text}</span>
96
- <ChevronRightIcon data-icon="inline-end" />
96
+ <span className="hidden">Next</span>
97
+ <ChevronRightIcon />
97
98
  </PaginationLink>
98
99
  )
99
100
  }
@@ -106,14 +107,10 @@ function PaginationEllipsis({
106
107
  <span
107
108
  aria-hidden
108
109
  data-slot="pagination-ellipsis"
109
- className={cn(
110
- "flex size-8 items-center justify-center [&_svg:not([class*='size-'])]:size-4",
111
- className
112
- )}
110
+ className={cn("flex size-9 items-center justify-center", className)}
113
111
  {...props}
114
112
  >
115
- <MoreHorizontalIcon
116
- />
113
+ <MoreHorizontalIcon className="size-4" />
117
114
  <span className="sr-only">More pages</span>
118
115
  </span>
119
116
  )
@@ -122,9 +119,9 @@ function PaginationEllipsis({
122
119
  export {
123
120
  Pagination,
124
121
  PaginationContent,
125
- PaginationEllipsis,
126
- PaginationItem,
127
122
  PaginationLink,
128
- PaginationNext,
123
+ PaginationItem,
129
124
  PaginationPrevious,
125
+ PaginationNext,
126
+ PaginationEllipsis,
130
127
  }
@@ -1,90 +1,48 @@
1
1
  "use client"
2
2
 
3
3
  import * as React from "react"
4
- import { Popover as PopoverPrimitive } from "@base-ui/react/popover"
4
+ import * as PopoverPrimitive from "@radix-ui/react-popover"
5
5
 
6
6
  import { cn } from "@/lib/utils"
7
7
 
8
- function Popover({ ...props }: PopoverPrimitive.Root.Props) {
8
+ function Popover({
9
+ ...props
10
+ }: React.ComponentProps<typeof PopoverPrimitive.Root>) {
9
11
  return <PopoverPrimitive.Root data-slot="popover" {...props} />
10
12
  }
11
13
 
12
- function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
14
+ function PopoverTrigger({
15
+ ...props
16
+ }: React.ComponentProps<typeof PopoverPrimitive.Trigger>) {
13
17
  return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
14
18
  }
15
19
 
16
20
  function PopoverContent({
17
21
  className,
18
22
  align = "center",
19
- alignOffset = 0,
20
- side = "bottom",
21
23
  sideOffset = 4,
22
24
  ...props
23
- }: PopoverPrimitive.Popup.Props &
24
- Pick<
25
- PopoverPrimitive.Positioner.Props,
26
- "align" | "alignOffset" | "side" | "sideOffset"
27
- >) {
25
+ }: React.ComponentProps<typeof PopoverPrimitive.Content>) {
28
26
  return (
29
27
  <PopoverPrimitive.Portal>
30
- <PopoverPrimitive.Positioner
28
+ <PopoverPrimitive.Content
29
+ data-slot="popover-content"
31
30
  align={align}
32
- alignOffset={alignOffset}
33
- side={side}
34
31
  sideOffset={sideOffset}
35
- className="isolate z-50"
36
- >
37
- <PopoverPrimitive.Popup
38
- data-slot="popover-content"
39
- className={cn(
40
- "z-50 flex w-72 origin-(--transform-origin) flex-col gap-2.5 rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=inline-end]:slide-in-from-left-2 data-[side=inline-start]:slide-in-from-right-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 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95",
41
- className
42
- )}
43
- {...props}
44
- />
45
- </PopoverPrimitive.Positioner>
32
+ className={cn(
33
+ "bg-popover text-popover-foreground 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 z-50 w-72 origin-(--radix-popover-content-transform-origin) rounded-md border p-4 shadow-md outline-hidden",
34
+ className
35
+ )}
36
+ {...props}
37
+ />
46
38
  </PopoverPrimitive.Portal>
47
39
  )
48
40
  }
49
41
 
50
- function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
51
- return (
52
- <div
53
- data-slot="popover-header"
54
- className={cn("flex flex-col gap-0.5 text-sm", className)}
55
- {...props}
56
- />
57
- )
58
- }
59
-
60
- function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {
61
- return (
62
- <PopoverPrimitive.Title
63
- data-slot="popover-title"
64
- className={cn("font-medium", className)}
65
- {...props}
66
- />
67
- )
68
- }
69
-
70
- function PopoverDescription({
71
- className,
42
+ function PopoverAnchor({
72
43
  ...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
- )
44
+ }: React.ComponentProps<typeof PopoverPrimitive.Anchor>) {
45
+ return <PopoverPrimitive.Anchor data-slot="popover-anchor" {...props} />
81
46
  }
82
47
 
83
- export {
84
- Popover,
85
- PopoverContent,
86
- PopoverDescription,
87
- PopoverHeader,
88
- PopoverTitle,
89
- PopoverTrigger,
90
- }
48
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
@@ -1,81 +1,31 @@
1
- import { Progress as ProgressPrimitive } from "@base-ui/react/progress"
1
+ "use client"
2
+
3
+ import * as React from "react"
4
+ import * as ProgressPrimitive from "@radix-ui/react-progress"
2
5
 
3
6
  import { cn } from "@/lib/utils"
4
7
 
5
8
  function Progress({
6
9
  className,
7
- children,
8
10
  value,
9
11
  ...props
10
- }: ProgressPrimitive.Root.Props) {
12
+ }: React.ComponentProps<typeof ProgressPrimitive.Root>) {
11
13
  return (
12
14
  <ProgressPrimitive.Root
13
- value={value}
14
15
  data-slot="progress"
15
- className={cn("flex flex-wrap gap-3", className)}
16
- {...props}
17
- >
18
- {children}
19
- <ProgressTrack>
20
- <ProgressIndicator />
21
- </ProgressTrack>
22
- </ProgressPrimitive.Root>
23
- )
24
- }
25
-
26
- function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {
27
- return (
28
- <ProgressPrimitive.Track
29
16
  className={cn(
30
- "relative flex h-1 w-full items-center overflow-x-hidden rounded-full bg-muted",
17
+ "bg-primary/20 relative h-2 w-full overflow-hidden rounded-full",
31
18
  className
32
19
  )}
33
- data-slot="progress-track"
34
20
  {...props}
35
- />
36
- )
37
- }
38
-
39
- function ProgressIndicator({
40
- className,
41
- ...props
42
- }: ProgressPrimitive.Indicator.Props) {
43
- return (
44
- <ProgressPrimitive.Indicator
45
- data-slot="progress-indicator"
46
- className={cn("h-full bg-primary transition-all", className)}
47
- {...props}
48
- />
49
- )
50
- }
51
-
52
- function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {
53
- return (
54
- <ProgressPrimitive.Label
55
- className={cn("text-sm font-medium", className)}
56
- data-slot="progress-label"
57
- {...props}
58
- />
59
- )
60
- }
61
-
62
- function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {
63
- return (
64
- <ProgressPrimitive.Value
65
- className={cn(
66
- "ml-auto text-sm text-muted-foreground tabular-nums",
67
- className
68
- )}
69
- data-slot="progress-value"
70
- {...props}
71
- />
21
+ >
22
+ <ProgressPrimitive.Indicator
23
+ data-slot="progress-indicator"
24
+ className="bg-primary h-full w-full flex-1 transition-all"
25
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
26
+ />
27
+ </ProgressPrimitive.Root>
72
28
  )
73
29
  }
74
30
 
75
- export {
76
- Progress,
77
- ProgressTrack,
78
- ProgressIndicator,
79
- ProgressLabel,
80
- ProgressValue,
81
- }
31
+ export { Progress }
@@ -1,37 +1,44 @@
1
1
  "use client"
2
2
 
3
- import { Radio as RadioPrimitive } from "@base-ui/react/radio"
4
- import { RadioGroup as RadioGroupPrimitive } from "@base-ui/react/radio-group"
3
+ import * as React from "react"
4
+ import * as RadioGroupPrimitive from "@radix-ui/react-radio-group"
5
+ import { CircleIcon } from "lucide-react"
5
6
 
6
7
  import { cn } from "@/lib/utils"
7
8
 
8
- function RadioGroup({ className, ...props }: RadioGroupPrimitive.Props) {
9
+ function RadioGroup({
10
+ className,
11
+ ...props
12
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Root>) {
9
13
  return (
10
- <RadioGroupPrimitive
14
+ <RadioGroupPrimitive.Root
11
15
  data-slot="radio-group"
12
- className={cn("grid w-full gap-2", className)}
16
+ className={cn("grid gap-3", className)}
13
17
  {...props}
14
18
  />
15
19
  )
16
20
  }
17
21
 
18
- function RadioGroupItem({ className, ...props }: RadioPrimitive.Root.Props) {
22
+ function RadioGroupItem({
23
+ className,
24
+ ...props
25
+ }: React.ComponentProps<typeof RadioGroupPrimitive.Item>) {
19
26
  return (
20
- <RadioPrimitive.Root
27
+ <RadioGroupPrimitive.Item
21
28
  data-slot="radio-group-item"
22
29
  className={cn(
23
- "group/radio-group-item peer relative flex aspect-square size-4 shrink-0 rounded-full border border-input outline-none after:absolute after:-inset-x-3 after:-inset-y-2 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-3 aria-invalid:ring-destructive/20 aria-invalid:aria-checked:border-primary dark:bg-input/30 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 data-checked:border-primary data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary",
30
+ "border-input text-primary focus-visible:border-ring focus-visible:ring-ring/20 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 aspect-square size-4 shrink-0 rounded-full border transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
24
31
  className
25
32
  )}
26
33
  {...props}
27
34
  >
28
- <RadioPrimitive.Indicator
35
+ <RadioGroupPrimitive.Indicator
29
36
  data-slot="radio-group-indicator"
30
- className="flex size-4 items-center justify-center"
37
+ className="relative flex items-center justify-center"
31
38
  >
32
- <span className="absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2 rounded-full bg-primary-foreground" />
33
- </RadioPrimitive.Indicator>
34
- </RadioPrimitive.Root>
39
+ <CircleIcon className="fill-primary absolute top-1/2 left-1/2 size-2 -translate-x-1/2 -translate-y-1/2" />
40
+ </RadioGroupPrimitive.Indicator>
41
+ </RadioGroupPrimitive.Item>
35
42
  )
36
43
  }
37
44