@betterstart/cli 0.1.3 → 0.1.4

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 (234) hide show
  1. package/README.md +133 -0
  2. package/dist/cli.d.ts +1 -9
  3. package/dist/cli.js +13484 -367
  4. package/dist/cli.js.map +1 -1
  5. package/dist/index.d.ts +24 -266
  6. package/dist/index.js +4 -11378
  7. package/dist/index.js.map +1 -1
  8. package/package.json +29 -42
  9. package/templates/schema.json +959 -0
  10. package/templates/tiptap/hooks/use-composed-ref.ts +43 -0
  11. package/templates/tiptap/hooks/use-cursor-visibility.ts +68 -0
  12. package/templates/tiptap/hooks/use-element-rect.ts +166 -0
  13. package/templates/tiptap/hooks/use-is-breakpoint.ts +32 -0
  14. package/templates/tiptap/hooks/use-menu-navigation.ts +182 -0
  15. package/templates/tiptap/hooks/use-scrolling.ts +64 -0
  16. package/templates/tiptap/hooks/use-throttled-callback.ts +146 -0
  17. package/templates/tiptap/hooks/use-tiptap-editor.ts +46 -0
  18. package/templates/tiptap/hooks/use-unmount.ts +21 -0
  19. package/templates/tiptap/hooks/use-window-size.ts +87 -0
  20. package/templates/tiptap/lib/tiptap-utils.ts +587 -0
  21. package/templates/tiptap/styles/_keyframe-animations.scss +91 -0
  22. package/templates/tiptap/styles/_variables.scss +296 -0
  23. package/templates/tiptap/tiptap-extension/node-background-extension.ts +138 -0
  24. package/templates/tiptap/tiptap-icons/align-center-icon.tsx +38 -0
  25. package/templates/tiptap/tiptap-icons/align-justify-icon.tsx +38 -0
  26. package/templates/tiptap/tiptap-icons/align-left-icon.tsx +38 -0
  27. package/templates/tiptap/tiptap-icons/align-right-icon.tsx +38 -0
  28. package/templates/tiptap/tiptap-icons/arrow-left-icon.tsx +24 -0
  29. package/templates/tiptap/tiptap-icons/ban-icon.tsx +26 -0
  30. package/templates/tiptap/tiptap-icons/blockquote-icon.tsx +44 -0
  31. package/templates/tiptap/tiptap-icons/bold-icon.tsx +26 -0
  32. package/templates/tiptap/tiptap-icons/chevron-down-icon.tsx +26 -0
  33. package/templates/tiptap/tiptap-icons/close-icon.tsx +24 -0
  34. package/templates/tiptap/tiptap-icons/code-block-icon.tsx +38 -0
  35. package/templates/tiptap/tiptap-icons/code2-icon.tsx +32 -0
  36. package/templates/tiptap/tiptap-icons/corner-down-left-icon.tsx +26 -0
  37. package/templates/tiptap/tiptap-icons/external-link-icon.tsx +28 -0
  38. package/templates/tiptap/tiptap-icons/heading-five-icon.tsx +28 -0
  39. package/templates/tiptap/tiptap-icons/heading-four-icon.tsx +28 -0
  40. package/templates/tiptap/tiptap-icons/heading-icon.tsx +24 -0
  41. package/templates/tiptap/tiptap-icons/heading-one-icon.tsx +28 -0
  42. package/templates/tiptap/tiptap-icons/heading-six-icon.tsx +30 -0
  43. package/templates/tiptap/tiptap-icons/heading-three-icon.tsx +36 -0
  44. package/templates/tiptap/tiptap-icons/heading-two-icon.tsx +28 -0
  45. package/templates/tiptap/tiptap-icons/highlighter-icon.tsx +26 -0
  46. package/templates/tiptap/tiptap-icons/image-plus-icon.tsx +26 -0
  47. package/templates/tiptap/tiptap-icons/italic-icon.tsx +24 -0
  48. package/templates/tiptap/tiptap-icons/link-icon.tsx +28 -0
  49. package/templates/tiptap/tiptap-icons/list-icon.tsx +56 -0
  50. package/templates/tiptap/tiptap-icons/list-ordered-icon.tsx +56 -0
  51. package/templates/tiptap/tiptap-icons/list-todo-icon.tsx +50 -0
  52. package/templates/tiptap/tiptap-icons/moon-star-icon.tsx +30 -0
  53. package/templates/tiptap/tiptap-icons/redo2-icon.tsx +26 -0
  54. package/templates/tiptap/tiptap-icons/strike-icon.tsx +28 -0
  55. package/templates/tiptap/tiptap-icons/subscript-icon.tsx +38 -0
  56. package/templates/tiptap/tiptap-icons/sun-icon.tsx +58 -0
  57. package/templates/tiptap/tiptap-icons/superscript-icon.tsx +38 -0
  58. package/templates/tiptap/tiptap-icons/trash-icon.tsx +26 -0
  59. package/templates/tiptap/tiptap-icons/underline-icon.tsx +26 -0
  60. package/templates/tiptap/tiptap-icons/undo2-icon.tsx +26 -0
  61. package/templates/tiptap/tiptap-node/blockquote-node/blockquote-node.scss +37 -0
  62. package/templates/tiptap/tiptap-node/code-block-node/code-block-node.scss +54 -0
  63. package/templates/tiptap/tiptap-node/heading-node/heading-node.scss +45 -0
  64. package/templates/tiptap/tiptap-node/horizontal-rule-node/horizontal-rule-node-extension.ts +10 -0
  65. package/templates/tiptap/tiptap-node/horizontal-rule-node/horizontal-rule-node.scss +25 -0
  66. package/templates/tiptap/tiptap-node/image-node/image-node.scss +35 -0
  67. package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node-extension.ts +154 -0
  68. package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node.scss +249 -0
  69. package/templates/tiptap/tiptap-node/image-upload-node/image-upload-node.tsx +522 -0
  70. package/templates/tiptap/tiptap-node/image-upload-node/index.tsx +1 -0
  71. package/templates/tiptap/tiptap-node/list-node/list-node.scss +208 -0
  72. package/templates/tiptap/tiptap-node/paragraph-node/paragraph-node.scss +273 -0
  73. package/templates/tiptap/tiptap-ui/blockquote-button/blockquote-button.tsx +104 -0
  74. package/templates/tiptap/tiptap-ui/blockquote-button/index.tsx +2 -0
  75. package/templates/tiptap/tiptap-ui/blockquote-button/use-blockquote.ts +252 -0
  76. package/templates/tiptap/tiptap-ui/code-block-button/code-block-button.tsx +106 -0
  77. package/templates/tiptap/tiptap-ui/code-block-button/index.tsx +2 -0
  78. package/templates/tiptap/tiptap-ui/code-block-button/use-code-block.ts +261 -0
  79. package/templates/tiptap/tiptap-ui/color-highlight-button/color-highlight-button.scss +49 -0
  80. package/templates/tiptap/tiptap-ui/color-highlight-button/color-highlight-button.tsx +153 -0
  81. package/templates/tiptap/tiptap-ui/color-highlight-button/index.tsx +2 -0
  82. package/templates/tiptap/tiptap-ui/color-highlight-button/use-color-highlight.ts +345 -0
  83. package/templates/tiptap/tiptap-ui/color-highlight-popover/color-highlight-popover.tsx +207 -0
  84. package/templates/tiptap/tiptap-ui/color-highlight-popover/index.tsx +1 -0
  85. package/templates/tiptap/tiptap-ui/heading-button/heading-button.tsx +107 -0
  86. package/templates/tiptap/tiptap-ui/heading-button/index.tsx +2 -0
  87. package/templates/tiptap/tiptap-ui/heading-button/use-heading.ts +314 -0
  88. package/templates/tiptap/tiptap-ui/heading-dropdown-menu/heading-dropdown-menu.tsx +131 -0
  89. package/templates/tiptap/tiptap-ui/heading-dropdown-menu/index.tsx +2 -0
  90. package/templates/tiptap/tiptap-ui/heading-dropdown-menu/use-heading-dropdown-menu.ts +130 -0
  91. package/templates/tiptap/tiptap-ui/image-upload-button/image-upload-button.tsx +114 -0
  92. package/templates/tiptap/tiptap-ui/image-upload-button/index.tsx +2 -0
  93. package/templates/tiptap/tiptap-ui/image-upload-button/use-image-upload.ts +192 -0
  94. package/templates/tiptap/tiptap-ui/link-popover/index.tsx +2 -0
  95. package/templates/tiptap/tiptap-ui/link-popover/link-popover.tsx +285 -0
  96. package/templates/tiptap/tiptap-ui/link-popover/use-link-popover.ts +286 -0
  97. package/templates/tiptap/tiptap-ui/list-button/index.tsx +2 -0
  98. package/templates/tiptap/tiptap-ui/list-button/list-button.tsx +108 -0
  99. package/templates/tiptap/tiptap-ui/list-button/use-list.ts +329 -0
  100. package/templates/tiptap/tiptap-ui/list-dropdown-menu/index.tsx +1 -0
  101. package/templates/tiptap/tiptap-ui/list-dropdown-menu/list-dropdown-menu.tsx +123 -0
  102. package/templates/tiptap/tiptap-ui/list-dropdown-menu/use-list-dropdown-menu.ts +203 -0
  103. package/templates/tiptap/tiptap-ui/mark-button/index.tsx +2 -0
  104. package/templates/tiptap/tiptap-ui/mark-button/mark-button.tsx +107 -0
  105. package/templates/tiptap/tiptap-ui/mark-button/use-mark.ts +206 -0
  106. package/templates/tiptap/tiptap-ui/text-align-button/index.tsx +2 -0
  107. package/templates/tiptap/tiptap-ui/text-align-button/text-align-button.tsx +118 -0
  108. package/templates/tiptap/tiptap-ui/text-align-button/use-text-align.ts +212 -0
  109. package/templates/tiptap/tiptap-ui/undo-redo-button/index.tsx +2 -0
  110. package/templates/tiptap/tiptap-ui/undo-redo-button/undo-redo-button.tsx +105 -0
  111. package/templates/tiptap/tiptap-ui/undo-redo-button/use-undo-redo.ts +173 -0
  112. package/templates/tiptap/tiptap-ui-primitive/badge/badge-colors.scss +395 -0
  113. package/templates/tiptap/tiptap-ui-primitive/badge/badge-group.scss +16 -0
  114. package/templates/tiptap/tiptap-ui-primitive/badge/badge.scss +99 -0
  115. package/templates/tiptap/tiptap-ui-primitive/badge/badge.tsx +46 -0
  116. package/templates/tiptap/tiptap-ui-primitive/badge/index.tsx +1 -0
  117. package/templates/tiptap/tiptap-ui-primitive/button/button-colors.scss +429 -0
  118. package/templates/tiptap/tiptap-ui-primitive/button/button-group.scss +22 -0
  119. package/templates/tiptap/tiptap-ui-primitive/button/button.scss +314 -0
  120. package/templates/tiptap/tiptap-ui-primitive/button/button.tsx +102 -0
  121. package/templates/tiptap/tiptap-ui-primitive/button/index.tsx +1 -0
  122. package/templates/tiptap/tiptap-ui-primitive/card/card.scss +77 -0
  123. package/templates/tiptap/tiptap-ui-primitive/card/card.tsx +59 -0
  124. package/templates/tiptap/tiptap-ui-primitive/card/index.tsx +1 -0
  125. package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/dropdown-menu.scss +63 -0
  126. package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/dropdown-menu.tsx +95 -0
  127. package/templates/tiptap/tiptap-ui-primitive/dropdown-menu/index.tsx +1 -0
  128. package/templates/tiptap/tiptap-ui-primitive/input/index.tsx +1 -0
  129. package/templates/tiptap/tiptap-ui-primitive/input/input.scss +45 -0
  130. package/templates/tiptap/tiptap-ui-primitive/input/input.tsx +18 -0
  131. package/templates/tiptap/tiptap-ui-primitive/popover/index.tsx +1 -0
  132. package/templates/tiptap/tiptap-ui-primitive/popover/popover.scss +63 -0
  133. package/templates/tiptap/tiptap-ui-primitive/popover/popover.tsx +33 -0
  134. package/templates/tiptap/tiptap-ui-primitive/separator/index.tsx +1 -0
  135. package/templates/tiptap/tiptap-ui-primitive/separator/separator.scss +23 -0
  136. package/templates/tiptap/tiptap-ui-primitive/separator/separator.tsx +33 -0
  137. package/templates/tiptap/tiptap-ui-primitive/spacer/index.tsx +1 -0
  138. package/templates/tiptap/tiptap-ui-primitive/spacer/spacer.tsx +21 -0
  139. package/templates/tiptap/tiptap-ui-primitive/toolbar/index.tsx +1 -0
  140. package/templates/tiptap/tiptap-ui-primitive/toolbar/toolbar.scss +98 -0
  141. package/templates/tiptap/tiptap-ui-primitive/toolbar/toolbar.tsx +113 -0
  142. package/templates/tiptap/tiptap-ui-primitive/tooltip/index.tsx +1 -0
  143. package/templates/tiptap/tiptap-ui-primitive/tooltip/tooltip.scss +43 -0
  144. package/templates/tiptap/tiptap-ui-primitive/tooltip/tooltip.tsx +223 -0
  145. package/templates/ui/accordion.tsx +52 -0
  146. package/templates/ui/alert-dialog.tsx +116 -0
  147. package/templates/ui/alert.tsx +48 -0
  148. package/templates/ui/aspect-ratio.tsx +7 -0
  149. package/templates/ui/avatar.tsx +46 -0
  150. package/templates/ui/badge.tsx +32 -0
  151. package/templates/ui/breadcrumb.tsx +98 -0
  152. package/templates/ui/button-group.tsx +77 -0
  153. package/templates/ui/button.tsx +48 -0
  154. package/templates/ui/calendar.tsx +176 -0
  155. package/templates/ui/card.tsx +54 -0
  156. package/templates/ui/carousel.tsx +234 -0
  157. package/templates/ui/chart.tsx +349 -0
  158. package/templates/ui/checkbox.tsx +27 -0
  159. package/templates/ui/collapsible.tsx +11 -0
  160. package/templates/ui/command.tsx +142 -0
  161. package/templates/ui/context-menu.tsx +188 -0
  162. package/templates/ui/curriculum-editor.tsx +601 -0
  163. package/templates/ui/date-picker.tsx +70 -0
  164. package/templates/ui/dialog.tsx +103 -0
  165. package/templates/ui/drawer.tsx +99 -0
  166. package/templates/ui/dropdown-menu.tsx +185 -0
  167. package/templates/ui/dynamic-list-field.tsx +95 -0
  168. package/templates/ui/empty.tsx +90 -0
  169. package/templates/ui/field.tsx +231 -0
  170. package/templates/ui/file-upload-example.tsx +113 -0
  171. package/templates/ui/form.tsx +172 -0
  172. package/templates/ui/hover-card.tsx +28 -0
  173. package/templates/ui/icon-picker.tsx +435 -0
  174. package/templates/ui/icons-data.ts +6 -0
  175. package/templates/ui/image-upload-field.tsx +360 -0
  176. package/templates/ui/input-group.tsx +160 -0
  177. package/templates/ui/input-otp.tsx +70 -0
  178. package/templates/ui/input.tsx +21 -0
  179. package/templates/ui/item.tsx +171 -0
  180. package/templates/ui/kbd.tsx +28 -0
  181. package/templates/ui/label.tsx +20 -0
  182. package/templates/ui/logo.tsx +113 -0
  183. package/templates/ui/markdown-editor.tsx +303 -0
  184. package/templates/ui/markdown-utils.ts +128 -0
  185. package/templates/ui/media-upload-field.tsx +255 -0
  186. package/templates/ui/menubar.tsx +230 -0
  187. package/templates/ui/navigation-menu.tsx +119 -0
  188. package/templates/ui/pagination.tsx +96 -0
  189. package/templates/ui/placeholder.tsx +25 -0
  190. package/templates/ui/popover.tsx +32 -0
  191. package/templates/ui/progress.tsx +24 -0
  192. package/templates/ui/radio-group.tsx +37 -0
  193. package/templates/ui/resizable.tsx +41 -0
  194. package/templates/ui/rich-text-editor.tsx +374 -0
  195. package/templates/ui/scroll-area.tsx +45 -0
  196. package/templates/ui/select.tsx +151 -0
  197. package/templates/ui/separator.tsx +25 -0
  198. package/templates/ui/sheet.tsx +120 -0
  199. package/templates/ui/sidebar.tsx +684 -0
  200. package/templates/ui/skeleton.tsx +7 -0
  201. package/templates/ui/slider.tsx +24 -0
  202. package/templates/ui/sonner.tsx +29 -0
  203. package/templates/ui/spinner.tsx +15 -0
  204. package/templates/ui/switch.tsx +28 -0
  205. package/templates/ui/table.tsx +93 -0
  206. package/templates/ui/tabs.tsx +54 -0
  207. package/templates/ui/textarea.tsx +20 -0
  208. package/templates/ui/toast.tsx +127 -0
  209. package/templates/ui/toggle-group.tsx +56 -0
  210. package/templates/ui/toggle.tsx +43 -0
  211. package/templates/ui/tooltip.tsx +31 -0
  212. package/templates/ui/use-mobile.tsx +19 -0
  213. package/templates/ui/video-upload-field.tsx +368 -0
  214. package/dist/chunk-EIH4RRIJ.js +0 -183
  215. package/dist/chunk-EIH4RRIJ.js.map +0 -1
  216. package/dist/chunk-NKRQYAS6.js +0 -260
  217. package/dist/chunk-NKRQYAS6.js.map +0 -1
  218. package/dist/chunk-QLVSHP7X.js +0 -235
  219. package/dist/chunk-QLVSHP7X.js.map +0 -1
  220. package/dist/chunk-WY6BC55D.js +0 -357
  221. package/dist/chunk-WY6BC55D.js.map +0 -1
  222. package/dist/config/index.d.ts +0 -93
  223. package/dist/config/index.js +0 -58
  224. package/dist/config/index.js.map +0 -1
  225. package/dist/core/index.d.ts +0 -415
  226. package/dist/core/index.js +0 -906
  227. package/dist/core/index.js.map +0 -1
  228. package/dist/import-resolver-BaZ-rzkH.d.ts +0 -123
  229. package/dist/logger-awLb347n.d.ts +0 -81
  230. package/dist/plugins/index.d.ts +0 -213
  231. package/dist/plugins/index.js +0 -365
  232. package/dist/plugins/index.js.map +0 -1
  233. package/dist/types-ByX_gl6y.d.ts +0 -232
  234. package/dist/types-eI549DEG.d.ts +0 -331
@@ -0,0 +1,230 @@
1
+ 'use client'
2
+
3
+ import { cn } from '@cms/utils/cn'
4
+ import * as MenubarPrimitive from '@radix-ui/react-menubar'
5
+ import { Check, ChevronRight, Circle } from 'lucide-react'
6
+ import * as React from 'react'
7
+
8
+ function MenubarMenu({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Menu>) {
9
+ return <MenubarPrimitive.Menu {...props} />
10
+ }
11
+
12
+ function MenubarGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Group>) {
13
+ return <MenubarPrimitive.Group {...props} />
14
+ }
15
+
16
+ function MenubarPortal({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Portal>) {
17
+ return <MenubarPrimitive.Portal {...props} />
18
+ }
19
+
20
+ function MenubarRadioGroup({ ...props }: React.ComponentProps<typeof MenubarPrimitive.RadioGroup>) {
21
+ return <MenubarPrimitive.RadioGroup {...props} />
22
+ }
23
+
24
+ function MenubarSub({ ...props }: React.ComponentProps<typeof MenubarPrimitive.Sub>) {
25
+ return <MenubarPrimitive.Sub data-slot="menubar-sub" {...props} />
26
+ }
27
+
28
+ const Menubar = React.forwardRef<
29
+ React.ElementRef<typeof MenubarPrimitive.Root>,
30
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Root>
31
+ >(({ className, ...props }, ref) => (
32
+ <MenubarPrimitive.Root
33
+ ref={ref}
34
+ className={cn(
35
+ 'flex h-9 items-center space-x-1 rounded-md border bg-background p-1 shadow-sm',
36
+ className
37
+ )}
38
+ {...props}
39
+ />
40
+ ))
41
+ Menubar.displayName = MenubarPrimitive.Root.displayName
42
+
43
+ const MenubarTrigger = React.forwardRef<
44
+ React.ElementRef<typeof MenubarPrimitive.Trigger>,
45
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Trigger>
46
+ >(({ className, ...props }, ref) => (
47
+ <MenubarPrimitive.Trigger
48
+ ref={ref}
49
+ className={cn(
50
+ 'flex cursor-default select-none items-center rounded-sm px-3 py-1 text-sm font-medium outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
51
+ className
52
+ )}
53
+ {...props}
54
+ />
55
+ ))
56
+ MenubarTrigger.displayName = MenubarPrimitive.Trigger.displayName
57
+
58
+ const MenubarSubTrigger = React.forwardRef<
59
+ React.ElementRef<typeof MenubarPrimitive.SubTrigger>,
60
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubTrigger> & {
61
+ inset?: boolean
62
+ }
63
+ >(({ className, inset, children, ...props }, ref) => (
64
+ <MenubarPrimitive.SubTrigger
65
+ ref={ref}
66
+ className={cn(
67
+ 'flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground',
68
+ inset && 'pl-8',
69
+ className
70
+ )}
71
+ {...props}
72
+ >
73
+ {children}
74
+ <ChevronRight className="ml-auto h-4 w-4" />
75
+ </MenubarPrimitive.SubTrigger>
76
+ ))
77
+ MenubarSubTrigger.displayName = MenubarPrimitive.SubTrigger.displayName
78
+
79
+ const MenubarSubContent = React.forwardRef<
80
+ React.ElementRef<typeof MenubarPrimitive.SubContent>,
81
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.SubContent>
82
+ >(({ className, ...props }, ref) => (
83
+ <MenubarPrimitive.SubContent
84
+ ref={ref}
85
+ className={cn(
86
+ 'z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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 origin-[--radix-menubar-content-transform-origin]',
87
+ className
88
+ )}
89
+ {...props}
90
+ />
91
+ ))
92
+ MenubarSubContent.displayName = MenubarPrimitive.SubContent.displayName
93
+
94
+ const MenubarContent = React.forwardRef<
95
+ React.ElementRef<typeof MenubarPrimitive.Content>,
96
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Content>
97
+ >(({ className, align = 'start', alignOffset = -4, sideOffset = 8, ...props }, ref) => (
98
+ <MenubarPrimitive.Portal>
99
+ <MenubarPrimitive.Content
100
+ ref={ref}
101
+ align={align}
102
+ alignOffset={alignOffset}
103
+ sideOffset={sideOffset}
104
+ className={cn(
105
+ 'z-50 min-w-[12rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-md data-[state=open]:animate-in 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 origin-[--radix-menubar-content-transform-origin]',
106
+ className
107
+ )}
108
+ {...props}
109
+ />
110
+ </MenubarPrimitive.Portal>
111
+ ))
112
+ MenubarContent.displayName = MenubarPrimitive.Content.displayName
113
+
114
+ const MenubarItem = React.forwardRef<
115
+ React.ElementRef<typeof MenubarPrimitive.Item>,
116
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Item> & {
117
+ inset?: boolean
118
+ }
119
+ >(({ className, inset, ...props }, ref) => (
120
+ <MenubarPrimitive.Item
121
+ ref={ref}
122
+ className={cn(
123
+ 'relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
124
+ inset && 'pl-8',
125
+ className
126
+ )}
127
+ {...props}
128
+ />
129
+ ))
130
+ MenubarItem.displayName = MenubarPrimitive.Item.displayName
131
+
132
+ const MenubarCheckboxItem = React.forwardRef<
133
+ React.ElementRef<typeof MenubarPrimitive.CheckboxItem>,
134
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.CheckboxItem>
135
+ >(({ className, children, checked, ...props }, ref) => (
136
+ <MenubarPrimitive.CheckboxItem
137
+ ref={ref}
138
+ className={cn(
139
+ 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
140
+ className
141
+ )}
142
+ checked={checked}
143
+ {...props}
144
+ >
145
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
146
+ <MenubarPrimitive.ItemIndicator>
147
+ <Check className="h-4 w-4" />
148
+ </MenubarPrimitive.ItemIndicator>
149
+ </span>
150
+ {children}
151
+ </MenubarPrimitive.CheckboxItem>
152
+ ))
153
+ MenubarCheckboxItem.displayName = MenubarPrimitive.CheckboxItem.displayName
154
+
155
+ const MenubarRadioItem = React.forwardRef<
156
+ React.ElementRef<typeof MenubarPrimitive.RadioItem>,
157
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.RadioItem>
158
+ >(({ className, children, ...props }, ref) => (
159
+ <MenubarPrimitive.RadioItem
160
+ ref={ref}
161
+ className={cn(
162
+ 'relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50',
163
+ className
164
+ )}
165
+ {...props}
166
+ >
167
+ <span className="absolute left-2 flex h-3.5 w-3.5 items-center justify-center">
168
+ <MenubarPrimitive.ItemIndicator>
169
+ <Circle className="h-4 w-4 fill-current" />
170
+ </MenubarPrimitive.ItemIndicator>
171
+ </span>
172
+ {children}
173
+ </MenubarPrimitive.RadioItem>
174
+ ))
175
+ MenubarRadioItem.displayName = MenubarPrimitive.RadioItem.displayName
176
+
177
+ const MenubarLabel = React.forwardRef<
178
+ React.ElementRef<typeof MenubarPrimitive.Label>,
179
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Label> & {
180
+ inset?: boolean
181
+ }
182
+ >(({ className, inset, ...props }, ref) => (
183
+ <MenubarPrimitive.Label
184
+ ref={ref}
185
+ className={cn('px-2 py-1.5 text-sm font-semibold', inset && 'pl-8', className)}
186
+ {...props}
187
+ />
188
+ ))
189
+ MenubarLabel.displayName = MenubarPrimitive.Label.displayName
190
+
191
+ const MenubarSeparator = React.forwardRef<
192
+ React.ElementRef<typeof MenubarPrimitive.Separator>,
193
+ React.ComponentPropsWithoutRef<typeof MenubarPrimitive.Separator>
194
+ >(({ className, ...props }, ref) => (
195
+ <MenubarPrimitive.Separator
196
+ ref={ref}
197
+ className={cn('-mx-1 my-1 h-px bg-muted', className)}
198
+ {...props}
199
+ />
200
+ ))
201
+ MenubarSeparator.displayName = MenubarPrimitive.Separator.displayName
202
+
203
+ const MenubarShortcut = ({ className, ...props }: React.HTMLAttributes<HTMLSpanElement>) => {
204
+ return (
205
+ <span
206
+ className={cn('ml-auto text-xs tracking-widest text-muted-foreground', className)}
207
+ {...props}
208
+ />
209
+ )
210
+ }
211
+ MenubarShortcut.displayname = 'MenubarShortcut'
212
+
213
+ export {
214
+ Menubar,
215
+ MenubarMenu,
216
+ MenubarTrigger,
217
+ MenubarContent,
218
+ MenubarItem,
219
+ MenubarSeparator,
220
+ MenubarLabel,
221
+ MenubarCheckboxItem,
222
+ MenubarRadioGroup,
223
+ MenubarRadioItem,
224
+ MenubarPortal,
225
+ MenubarSubContent,
226
+ MenubarSubTrigger,
227
+ MenubarGroup,
228
+ MenubarSub,
229
+ MenubarShortcut
230
+ }
@@ -0,0 +1,119 @@
1
+ import { cn } from '@cms/utils/cn'
2
+ import * as NavigationMenuPrimitive from '@radix-ui/react-navigation-menu'
3
+ import { cva } from 'class-variance-authority'
4
+ import { ChevronDown } from 'lucide-react'
5
+ import * as React from 'react'
6
+
7
+ const NavigationMenu = React.forwardRef<
8
+ React.ElementRef<typeof NavigationMenuPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Root>
10
+ >(({ className, children, ...props }, ref) => (
11
+ <NavigationMenuPrimitive.Root
12
+ ref={ref}
13
+ className={cn('relative z-10 flex max-w-max flex-1 items-center justify-center', className)}
14
+ {...props}
15
+ >
16
+ {children}
17
+ <NavigationMenuViewport />
18
+ </NavigationMenuPrimitive.Root>
19
+ ))
20
+ NavigationMenu.displayName = NavigationMenuPrimitive.Root.displayName
21
+
22
+ const NavigationMenuList = React.forwardRef<
23
+ React.ElementRef<typeof NavigationMenuPrimitive.List>,
24
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.List>
25
+ >(({ className, ...props }, ref) => (
26
+ <NavigationMenuPrimitive.List
27
+ ref={ref}
28
+ className={cn('group flex flex-1 list-none items-center justify-center space-x-1', className)}
29
+ {...props}
30
+ />
31
+ ))
32
+ NavigationMenuList.displayName = NavigationMenuPrimitive.List.displayName
33
+
34
+ const NavigationMenuItem = NavigationMenuPrimitive.Item
35
+
36
+ const navigationMenuTriggerStyle = cva(
37
+ 'group inline-flex h-9 w-max items-center justify-center rounded-md bg-background px-4 py-2 text-sm font-medium transition-colors hover:bg-accent hover:text-accent-foreground focus:bg-accent focus:text-accent-foreground focus:outline-none disabled:pointer-events-none disabled:opacity-50 data-[state=open]:text-accent-foreground data-[state=open]:bg-accent/50 data-[state=open]:hover:bg-accent data-[state=open]:focus:bg-accent'
38
+ )
39
+
40
+ const NavigationMenuTrigger = React.forwardRef<
41
+ React.ElementRef<typeof NavigationMenuPrimitive.Trigger>,
42
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Trigger>
43
+ >(({ className, children, ...props }, ref) => (
44
+ <NavigationMenuPrimitive.Trigger
45
+ ref={ref}
46
+ className={cn(navigationMenuTriggerStyle(), 'group', className)}
47
+ {...props}
48
+ >
49
+ {children}{' '}
50
+ <ChevronDown
51
+ className="relative top-[1px] ml-1 h-3 w-3 transition duration-300 group-data-[state=open]:rotate-180"
52
+ aria-hidden="true"
53
+ />
54
+ </NavigationMenuPrimitive.Trigger>
55
+ ))
56
+ NavigationMenuTrigger.displayName = NavigationMenuPrimitive.Trigger.displayName
57
+
58
+ const NavigationMenuContent = React.forwardRef<
59
+ React.ElementRef<typeof NavigationMenuPrimitive.Content>,
60
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Content>
61
+ >(({ className, ...props }, ref) => (
62
+ <NavigationMenuPrimitive.Content
63
+ ref={ref}
64
+ className={cn(
65
+ 'left-0 top-0 w-full 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 md:absolute md:w-auto ',
66
+ className
67
+ )}
68
+ {...props}
69
+ />
70
+ ))
71
+ NavigationMenuContent.displayName = NavigationMenuPrimitive.Content.displayName
72
+
73
+ const NavigationMenuLink = NavigationMenuPrimitive.Link
74
+
75
+ const NavigationMenuViewport = React.forwardRef<
76
+ React.ElementRef<typeof NavigationMenuPrimitive.Viewport>,
77
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Viewport>
78
+ >(({ className, ...props }, ref) => (
79
+ <div className={cn('absolute left-0 top-full flex justify-center')}>
80
+ <NavigationMenuPrimitive.Viewport
81
+ className={cn(
82
+ 'origin-top-center relative mt-1.5 h-[var(--radix-navigation-menu-viewport-height)] w-full overflow-hidden rounded-md border bg-popover text-popover-foreground shadow data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-90 md:w-[var(--radix-navigation-menu-viewport-width)]',
83
+ className
84
+ )}
85
+ ref={ref}
86
+ {...props}
87
+ />
88
+ </div>
89
+ ))
90
+ NavigationMenuViewport.displayName = NavigationMenuPrimitive.Viewport.displayName
91
+
92
+ const NavigationMenuIndicator = React.forwardRef<
93
+ React.ElementRef<typeof NavigationMenuPrimitive.Indicator>,
94
+ React.ComponentPropsWithoutRef<typeof NavigationMenuPrimitive.Indicator>
95
+ >(({ className, ...props }, ref) => (
96
+ <NavigationMenuPrimitive.Indicator
97
+ ref={ref}
98
+ className={cn(
99
+ 'top-full z-[1] flex h-1.5 items-end justify-center overflow-hidden data-[state=visible]:animate-in data-[state=hidden]:animate-out data-[state=hidden]:fade-out data-[state=visible]:fade-in',
100
+ className
101
+ )}
102
+ {...props}
103
+ >
104
+ <div className="relative top-[60%] h-2 w-2 rotate-45 rounded-tl-sm bg-border shadow-md" />
105
+ </NavigationMenuPrimitive.Indicator>
106
+ ))
107
+ NavigationMenuIndicator.displayName = NavigationMenuPrimitive.Indicator.displayName
108
+
109
+ export {
110
+ navigationMenuTriggerStyle,
111
+ NavigationMenu,
112
+ NavigationMenuList,
113
+ NavigationMenuItem,
114
+ NavigationMenuContent,
115
+ NavigationMenuTrigger,
116
+ NavigationMenuLink,
117
+ NavigationMenuIndicator,
118
+ NavigationMenuViewport
119
+ }
@@ -0,0 +1,96 @@
1
+ import { cn } from '@cms/utils/cn'
2
+ import { ChevronLeft, ChevronRight, MoreHorizontal } from 'lucide-react'
3
+ import * as React from 'react'
4
+ import { type ButtonProps, buttonVariants } from './button'
5
+
6
+ const Pagination = ({ className, ...props }: React.ComponentProps<'nav'>) => (
7
+ <nav
8
+ aria-label="pagination"
9
+ className={cn('mx-auto flex w-full justify-center', className)}
10
+ {...props}
11
+ />
12
+ )
13
+ Pagination.displayName = 'Pagination'
14
+
15
+ const PaginationContent = React.forwardRef<HTMLUListElement, React.ComponentProps<'ul'>>(
16
+ ({ className, ...props }, ref) => (
17
+ <ul ref={ref} className={cn('flex flex-row items-center gap-1', className)} {...props} />
18
+ )
19
+ )
20
+ PaginationContent.displayName = 'PaginationContent'
21
+
22
+ const PaginationItem = React.forwardRef<HTMLLIElement, React.ComponentProps<'li'>>(
23
+ ({ className, ...props }, ref) => <li ref={ref} className={cn('', className)} {...props} />
24
+ )
25
+ PaginationItem.displayName = 'PaginationItem'
26
+
27
+ type PaginationLinkProps = {
28
+ isActive?: boolean
29
+ } & Pick<ButtonProps, 'size'> &
30
+ React.ComponentProps<'a'>
31
+
32
+ const PaginationLink = ({ className, isActive, size = 'icon', ...props }: PaginationLinkProps) => (
33
+ <a
34
+ aria-current={isActive ? 'page' : undefined}
35
+ className={cn(
36
+ buttonVariants({
37
+ variant: isActive ? 'outline' : 'ghost',
38
+ size
39
+ }),
40
+ className
41
+ )}
42
+ {...props}
43
+ />
44
+ )
45
+ PaginationLink.displayName = 'PaginationLink'
46
+
47
+ const PaginationPrevious = ({
48
+ className,
49
+ ...props
50
+ }: React.ComponentProps<typeof PaginationLink>) => (
51
+ <PaginationLink
52
+ aria-label="Go to previous page"
53
+ size="default"
54
+ className={cn('gap-1 pl-2.5', className)}
55
+ {...props}
56
+ >
57
+ <ChevronLeft className="h-4 w-4" />
58
+ <span>Previous</span>
59
+ </PaginationLink>
60
+ )
61
+ PaginationPrevious.displayName = 'PaginationPrevious'
62
+
63
+ const PaginationNext = ({ className, ...props }: React.ComponentProps<typeof PaginationLink>) => (
64
+ <PaginationLink
65
+ aria-label="Go to next page"
66
+ size="default"
67
+ className={cn('gap-1 pr-2.5', className)}
68
+ {...props}
69
+ >
70
+ <span>Next</span>
71
+ <ChevronRight className="h-4 w-4" />
72
+ </PaginationLink>
73
+ )
74
+ PaginationNext.displayName = 'PaginationNext'
75
+
76
+ const PaginationEllipsis = ({ className, ...props }: React.ComponentProps<'span'>) => (
77
+ <span
78
+ aria-hidden
79
+ className={cn('flex h-9 w-9 items-center justify-center', className)}
80
+ {...props}
81
+ >
82
+ <MoreHorizontal className="h-4 w-4" />
83
+ <span className="sr-only">More pages</span>
84
+ </span>
85
+ )
86
+ PaginationEllipsis.displayName = 'PaginationEllipsis'
87
+
88
+ export {
89
+ Pagination,
90
+ PaginationContent,
91
+ PaginationLink,
92
+ PaginationItem,
93
+ PaginationPrevious,
94
+ PaginationNext,
95
+ PaginationEllipsis
96
+ }
@@ -0,0 +1,25 @@
1
+ import { cn } from '@cms/utils/cn'
2
+ import type * as React from 'react'
3
+
4
+ type PlaceholderProps = {
5
+ label: string
6
+ description: string
7
+ action: React.ReactNode
8
+ className?: string
9
+ } & React.ComponentProps<'div'>
10
+
11
+ export function Placeholder({ label, description, action, className, ...props }: PlaceholderProps) {
12
+ return (
13
+ <div
14
+ className={cn(
15
+ 'border flex items-center flex-col gap-2 border-dashed border-border rounded-lg corner-squircle p-8 bg-secondary/50',
16
+ className
17
+ )}
18
+ {...props}
19
+ >
20
+ <h4 className="text-sm font-medium">{label}</h4>
21
+ <p className="text-sm text-muted-foreground">{description}</p>
22
+ <div className="flex pt-4">{action}</div>
23
+ </div>
24
+ )
25
+ }
@@ -0,0 +1,32 @@
1
+ 'use client'
2
+
3
+ import { cn } from '@cms/utils/cn'
4
+ import * as PopoverPrimitive from '@radix-ui/react-popover'
5
+ import * as React from 'react'
6
+
7
+ const Popover = PopoverPrimitive.Root
8
+
9
+ const PopoverTrigger = PopoverPrimitive.Trigger
10
+
11
+ const PopoverAnchor = PopoverPrimitive.Anchor
12
+
13
+ const PopoverContent = React.forwardRef<
14
+ React.ElementRef<typeof PopoverPrimitive.Content>,
15
+ React.ComponentPropsWithoutRef<typeof PopoverPrimitive.Content>
16
+ >(({ className, align = 'center', sideOffset = 4, ...props }, ref) => (
17
+ <PopoverPrimitive.Portal>
18
+ <PopoverPrimitive.Content
19
+ ref={ref}
20
+ align={align}
21
+ sideOffset={sideOffset}
22
+ className={cn(
23
+ '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 origin-[--radix-popover-content-transform-origin]',
24
+ className
25
+ )}
26
+ {...props}
27
+ />
28
+ </PopoverPrimitive.Portal>
29
+ ))
30
+ PopoverContent.displayName = PopoverPrimitive.Content.displayName
31
+
32
+ export { Popover, PopoverTrigger, PopoverContent, PopoverAnchor }
@@ -0,0 +1,24 @@
1
+ 'use client'
2
+
3
+ import { cn } from '@cms/utils/cn'
4
+ import * as ProgressPrimitive from '@radix-ui/react-progress'
5
+ import * as React from 'react'
6
+
7
+ const Progress = React.forwardRef<
8
+ React.ElementRef<typeof ProgressPrimitive.Root>,
9
+ React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
10
+ >(({ className, value, ...props }, ref) => (
11
+ <ProgressPrimitive.Root
12
+ ref={ref}
13
+ className={cn('relative h-2 w-full overflow-hidden rounded-full bg-primary/20', className)}
14
+ {...props}
15
+ >
16
+ <ProgressPrimitive.Indicator
17
+ className="h-full w-full flex-1 bg-primary transition-all"
18
+ style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
19
+ />
20
+ </ProgressPrimitive.Root>
21
+ ))
22
+ Progress.displayName = ProgressPrimitive.Root.displayName
23
+
24
+ export { Progress }
@@ -0,0 +1,37 @@
1
+ 'use client'
2
+
3
+ import { cn } from '@cms/utils/cn'
4
+ import * as RadioGroupPrimitive from '@radix-ui/react-radio-group'
5
+ import { Circle } from 'lucide-react'
6
+ import * as React from 'react'
7
+
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
15
+
16
+ const RadioGroupItem = React.forwardRef<
17
+ React.ElementRef<typeof RadioGroupPrimitive.Item>,
18
+ React.ComponentPropsWithoutRef<typeof RadioGroupPrimitive.Item>
19
+ >(({ className, ...props }, ref) => {
20
+ return (
21
+ <RadioGroupPrimitive.Item
22
+ ref={ref}
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
26
+ )}
27
+ {...props}
28
+ >
29
+ <RadioGroupPrimitive.Indicator className="flex items-center justify-center">
30
+ <Circle className="h-3.5 w-3.5 fill-primary" />
31
+ </RadioGroupPrimitive.Indicator>
32
+ </RadioGroupPrimitive.Item>
33
+ )
34
+ })
35
+ RadioGroupItem.displayName = RadioGroupPrimitive.Item.displayName
36
+
37
+ export { RadioGroup, RadioGroupItem }
@@ -0,0 +1,41 @@
1
+ 'use client'
2
+
3
+ import { cn } from '@cms/utils/cn'
4
+ import { GripVertical } from 'lucide-react'
5
+ import * as ResizablePrimitive from 'react-resizable-panels'
6
+
7
+ const ResizablePanelGroup = ({
8
+ className,
9
+ ...props
10
+ }: React.ComponentProps<typeof ResizablePrimitive.Group>) => (
11
+ <ResizablePrimitive.Group
12
+ className={cn('flex h-full w-full data-[panel-group-direction=vertical]:flex-col', className)}
13
+ {...props}
14
+ />
15
+ )
16
+
17
+ const ResizablePanel = ResizablePrimitive.Panel
18
+
19
+ const ResizableHandle = ({
20
+ withHandle,
21
+ className,
22
+ ...props
23
+ }: React.ComponentProps<typeof ResizablePrimitive.Separator> & {
24
+ withHandle?: boolean
25
+ }) => (
26
+ <ResizablePrimitive.Separator
27
+ className={cn(
28
+ 'relative flex w-px items-center justify-center bg-border after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring focus-visible:ring-offset-1 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-y-1/2 data-[panel-group-direction=vertical]:after:translate-x-0 [&[data-panel-group-direction=vertical]>div]:rotate-90',
29
+ className
30
+ )}
31
+ {...props}
32
+ >
33
+ {withHandle && (
34
+ <div className="z-10 flex h-4 w-3 items-center justify-center rounded-sm border bg-border">
35
+ <GripVertical className="h-2.5 w-2.5" />
36
+ </div>
37
+ )}
38
+ </ResizablePrimitive.Separator>
39
+ )
40
+
41
+ export { ResizablePanelGroup, ResizablePanel, ResizableHandle }