@rangka/client 0.1.1 → 0.1.3

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 (317) hide show
  1. package/dist/App.d.ts.map +1 -1
  2. package/dist/App.js +7 -1
  3. package/dist/App.js.map +1 -1
  4. package/dist/index.d.ts +2 -0
  5. package/dist/index.d.ts.map +1 -1
  6. package/dist/index.js +2 -0
  7. package/dist/index.js.map +1 -1
  8. package/dist/main.d.ts.map +1 -1
  9. package/dist/main.js +20 -0
  10. package/dist/main.js.map +1 -1
  11. package/dist/shell/assets/index-63v1sBS3.css +1 -0
  12. package/dist/shell/assets/index-Dh7K40cQ.js +8634 -0
  13. package/dist/shell/assets/vendor-query-B2cydN5j.js +1 -0
  14. package/dist/shell/assets/vendor-radix-BJxYPxPb.js +69 -0
  15. package/dist/shell/assets/vendor-router-ET_myMt5.js +17 -0
  16. package/dist/shell/index.html +5 -2
  17. package/dist/theme.css +82 -0
  18. package/dist/widgets/components/lazy-manifest.d.ts +11 -0
  19. package/dist/widgets/components/lazy-manifest.d.ts.map +1 -0
  20. package/dist/widgets/components/lazy-manifest.js +32 -0
  21. package/dist/widgets/components/lazy-manifest.js.map +1 -0
  22. package/dist/widgets/components/register.js +12 -12
  23. package/dist/widgets/components/register.js.map +1 -1
  24. package/dist/widgets/loader.d.ts +3 -0
  25. package/dist/widgets/loader.d.ts.map +1 -0
  26. package/dist/widgets/loader.js +73 -0
  27. package/dist/widgets/loader.js.map +1 -0
  28. package/dist/widgets/renderer/LazyWidget.d.ts +8 -0
  29. package/dist/widgets/renderer/LazyWidget.d.ts.map +1 -0
  30. package/dist/widgets/renderer/LazyWidget.js +31 -0
  31. package/dist/widgets/renderer/LazyWidget.js.map +1 -0
  32. package/dist/widgets/renderer/WidgetErrorBoundary.d.ts +17 -0
  33. package/dist/widgets/renderer/WidgetErrorBoundary.d.ts.map +1 -0
  34. package/dist/widgets/renderer/WidgetErrorBoundary.js +18 -0
  35. package/dist/widgets/renderer/WidgetErrorBoundary.js.map +1 -0
  36. package/dist/widgets/renderer/WidgetRenderer.d.ts.map +1 -1
  37. package/dist/widgets/renderer/WidgetRenderer.js +8 -6
  38. package/dist/widgets/renderer/WidgetRenderer.js.map +1 -1
  39. package/package.json +7 -4
  40. package/.claude/skills/add-widget/SKILL.md +0 -101
  41. package/.turbo/turbo-build.log +0 -29
  42. package/CHANGELOG.md +0 -25
  43. package/CLAUDE.md +0 -236
  44. package/components.json +0 -25
  45. package/dist/components/ui/chart.d.ts +0 -45
  46. package/dist/components/ui/chart.d.ts.map +0 -1
  47. package/dist/components/ui/chart.js +0 -119
  48. package/dist/components/ui/chart.js.map +0 -1
  49. package/dist/shell/assets/index--35CAvcP.js +0 -8715
  50. package/dist/shell/assets/index-COLmoPYo.css +0 -1
  51. package/index.html +0 -12
  52. package/src/App.tsx +0 -44
  53. package/src/__tests__/setup.ts +0 -1
  54. package/src/api/auth.ts +0 -41
  55. package/src/api/boot.ts +0 -10
  56. package/src/api/client.ts +0 -26
  57. package/src/api/paths.ts +0 -3
  58. package/src/api/token.ts +0 -13
  59. package/src/auth/LoginForm.tsx +0 -67
  60. package/src/auth/SessionExpired.tsx +0 -24
  61. package/src/auth/SetupForm.tsx +0 -76
  62. package/src/boot/BootGate.tsx +0 -35
  63. package/src/boot/BootProvider.tsx +0 -28
  64. package/src/boot/types.ts +0 -9
  65. package/src/boot/useBoot.ts +0 -111
  66. package/src/components/Icon.tsx +0 -17
  67. package/src/components/ui/accordion.tsx +0 -82
  68. package/src/components/ui/alert-dialog.tsx +0 -180
  69. package/src/components/ui/alert.tsx +0 -76
  70. package/src/components/ui/aspect-ratio.tsx +0 -9
  71. package/src/components/ui/avatar.tsx +0 -94
  72. package/src/components/ui/badge.tsx +0 -45
  73. package/src/components/ui/breadcrumb.tsx +0 -104
  74. package/src/components/ui/button-group.tsx +0 -78
  75. package/src/components/ui/button.tsx +0 -65
  76. package/src/components/ui/calendar.tsx +0 -187
  77. package/src/components/ui/card.tsx +0 -85
  78. package/src/components/ui/carousel.tsx +0 -229
  79. package/src/components/ui/chart.tsx +0 -339
  80. package/src/components/ui/checkbox.tsx +0 -27
  81. package/src/components/ui/collapsible.tsx +0 -21
  82. package/src/components/ui/combobox.tsx +0 -275
  83. package/src/components/ui/command.tsx +0 -178
  84. package/src/components/ui/context-menu.tsx +0 -242
  85. package/src/components/ui/dialog.tsx +0 -146
  86. package/src/components/ui/direction.tsx +0 -20
  87. package/src/components/ui/drawer.tsx +0 -118
  88. package/src/components/ui/dropdown-menu.tsx +0 -247
  89. package/src/components/ui/empty.tsx +0 -94
  90. package/src/components/ui/field.tsx +0 -224
  91. package/src/components/ui/hover-card.tsx +0 -36
  92. package/src/components/ui/input-group.tsx +0 -142
  93. package/src/components/ui/input-otp.tsx +0 -86
  94. package/src/components/ui/input.tsx +0 -19
  95. package/src/components/ui/item.tsx +0 -182
  96. package/src/components/ui/kbd.tsx +0 -26
  97. package/src/components/ui/label.tsx +0 -19
  98. package/src/components/ui/menubar.tsx +0 -260
  99. package/src/components/ui/native-select.tsx +0 -55
  100. package/src/components/ui/navigation-menu.tsx +0 -160
  101. package/src/components/ui/pagination.tsx +0 -112
  102. package/src/components/ui/popover.tsx +0 -74
  103. package/src/components/ui/progress.tsx +0 -31
  104. package/src/components/ui/radio-group.tsx +0 -42
  105. package/src/components/ui/resizable.tsx +0 -42
  106. package/src/components/ui/scroll-area.tsx +0 -53
  107. package/src/components/ui/select.tsx +0 -185
  108. package/src/components/ui/separator.tsx +0 -26
  109. package/src/components/ui/sheet.tsx +0 -128
  110. package/src/components/ui/sidebar.tsx +0 -669
  111. package/src/components/ui/skeleton.tsx +0 -13
  112. package/src/components/ui/slider.tsx +0 -54
  113. package/src/components/ui/sonner.tsx +0 -43
  114. package/src/components/ui/spinner.tsx +0 -16
  115. package/src/components/ui/switch.tsx +0 -33
  116. package/src/components/ui/table.tsx +0 -87
  117. package/src/components/ui/tabs.tsx +0 -80
  118. package/src/components/ui/textarea.tsx +0 -18
  119. package/src/components/ui/toggle-group.tsx +0 -86
  120. package/src/components/ui/toggle.tsx +0 -44
  121. package/src/components/ui/tooltip.tsx +0 -53
  122. package/src/context/MetaContext.tsx +0 -22
  123. package/src/context/ModuleContext.tsx +0 -62
  124. package/src/context/PermissionsContext.tsx +0 -39
  125. package/src/context/ShellProviders.tsx +0 -33
  126. package/src/context/UserContext.tsx +0 -16
  127. package/src/data/QueryProvider.tsx +0 -7
  128. package/src/data/queryClient.ts +0 -18
  129. package/src/data/useModelMeta.ts +0 -17
  130. package/src/data/useMutation.ts +0 -60
  131. package/src/data/useRecord.ts +0 -29
  132. package/src/data/useSource.ts +0 -112
  133. package/src/hooks/use-mobile.ts +0 -19
  134. package/src/index.css +0 -260
  135. package/src/index.ts +0 -16
  136. package/src/lib/utils.ts +0 -6
  137. package/src/main.tsx +0 -17
  138. package/src/router/NotFound.tsx +0 -8
  139. package/src/router/RouterProvider.tsx +0 -7
  140. package/src/router/buildRouteTree.tsx +0 -63
  141. package/src/router/createShellRouter.ts +0 -9
  142. package/src/router/hooks.ts +0 -43
  143. package/src/shell/CommandPalette.tsx +0 -76
  144. package/src/shell/ConfirmDialog.tsx +0 -34
  145. package/src/shell/ConfirmProvider.tsx +0 -56
  146. package/src/shell/DrawerContext.tsx +0 -44
  147. package/src/shell/HeaderActions.tsx +0 -31
  148. package/src/shell/ModuleSelectorPage.tsx +0 -149
  149. package/src/shell/PageOutlet.tsx +0 -21
  150. package/src/shell/ShellContext.tsx +0 -45
  151. package/src/shell/ShellDevTools.tsx +0 -153
  152. package/src/shell/ShellLayout.tsx +0 -231
  153. package/src/shell/Toast.tsx +0 -58
  154. package/src/shell/ToastProvider.tsx +0 -60
  155. package/src/shell/app-sidebar/AppSidebar.tsx +0 -44
  156. package/src/shell/app-sidebar/ModuleSwitcher.tsx +0 -87
  157. package/src/shell/app-sidebar/NavMain.tsx +0 -64
  158. package/src/shell/app-sidebar/NavUser.tsx +0 -97
  159. package/src/shell/app-sidebar/SearchMenu.tsx +0 -22
  160. package/src/shell/app-sidebar/index.ts +0 -8
  161. package/src/shell/app-sidebar/types.ts +0 -38
  162. package/src/shell/types.ts +0 -6
  163. package/src/shell/useBreadcrumbs.ts +0 -42
  164. package/src/studio/bridge.ts +0 -125
  165. package/src/studio/index.ts +0 -3
  166. package/src/studio/overlay.ts +0 -47
  167. package/src/studio/types.ts +0 -32
  168. package/src/studio/walker.ts +0 -48
  169. package/src/vite-env.d.ts +0 -1
  170. package/src/widgets/__tests__/action-edge-cases.test.ts +0 -281
  171. package/src/widgets/__tests__/action.test.ts +0 -236
  172. package/src/widgets/__tests__/attachment-widget.test.tsx +0 -85
  173. package/src/widgets/__tests__/attachments-widget.test.tsx +0 -109
  174. package/src/widgets/__tests__/binding.test.ts +0 -76
  175. package/src/widgets/__tests__/button-widget.test.tsx +0 -145
  176. package/src/widgets/__tests__/checkbox-widget.test.tsx +0 -158
  177. package/src/widgets/__tests__/code-widget.test.tsx +0 -64
  178. package/src/widgets/__tests__/computed-widget.test.tsx +0 -62
  179. package/src/widgets/__tests__/condition-edge-cases.test.ts +0 -120
  180. package/src/widgets/__tests__/condition.test.ts +0 -221
  181. package/src/widgets/__tests__/context.test.ts +0 -99
  182. package/src/widgets/__tests__/data-widget.test.tsx +0 -204
  183. package/src/widgets/__tests__/datepicker-widget.test.tsx +0 -66
  184. package/src/widgets/__tests__/datetime-widget.test.tsx +0 -67
  185. package/src/widgets/__tests__/drawer-widget.test.tsx +0 -149
  186. package/src/widgets/__tests__/dynamic-link-widget.test.tsx +0 -52
  187. package/src/widgets/__tests__/edge-cases.test.ts +0 -232
  188. package/src/widgets/__tests__/evaluator.test.ts +0 -107
  189. package/src/widgets/__tests__/functions.test.ts +0 -147
  190. package/src/widgets/__tests__/grid-widget.test.tsx +0 -137
  191. package/src/widgets/__tests__/hooks.test.tsx +0 -249
  192. package/src/widgets/__tests__/icon-widget.test.tsx +0 -129
  193. package/src/widgets/__tests__/input-widget.test.tsx +0 -264
  194. package/src/widgets/__tests__/integration.test.ts +0 -116
  195. package/src/widgets/__tests__/json-widget.test.tsx +0 -70
  196. package/src/widgets/__tests__/link-widget.test.tsx +0 -92
  197. package/src/widgets/__tests__/many-to-many-widget.test.tsx +0 -93
  198. package/src/widgets/__tests__/modal-widget.test.tsx +0 -148
  199. package/src/widgets/__tests__/money-widget.test.tsx +0 -97
  200. package/src/widgets/__tests__/parser.test.ts +0 -171
  201. package/src/widgets/__tests__/reactive-variables.test.ts +0 -383
  202. package/src/widgets/__tests__/renderer.test.tsx +0 -300
  203. package/src/widgets/__tests__/repeat-widget.test.tsx +0 -229
  204. package/src/widgets/__tests__/select-widget.test.tsx +0 -231
  205. package/src/widgets/__tests__/sequence-widget.test.tsx +0 -58
  206. package/src/widgets/__tests__/shell-integration.test.tsx +0 -1343
  207. package/src/widgets/__tests__/split-widget.test.tsx +0 -133
  208. package/src/widgets/__tests__/state-edge-cases.test.ts +0 -118
  209. package/src/widgets/__tests__/state.test.ts +0 -106
  210. package/src/widgets/__tests__/table-data-binding.test.tsx +0 -482
  211. package/src/widgets/__tests__/table-filter-popover.test.tsx +0 -486
  212. package/src/widgets/__tests__/table-search.test.tsx +0 -305
  213. package/src/widgets/__tests__/table-widget.test.tsx +0 -509
  214. package/src/widgets/__tests__/textarea-widget.test.tsx +0 -105
  215. package/src/widgets/__tests__/tracker-validator-edge-cases.test.ts +0 -242
  216. package/src/widgets/__tests__/tracker.test.ts +0 -133
  217. package/src/widgets/__tests__/tree-widget.test.tsx +0 -97
  218. package/src/widgets/__tests__/use-model-source.test.ts +0 -67
  219. package/src/widgets/__tests__/validator.test.ts +0 -208
  220. package/src/widgets/action/dispatcher.ts +0 -334
  221. package/src/widgets/action/index.ts +0 -2
  222. package/src/widgets/binding/index.ts +0 -2
  223. package/src/widgets/binding/resolver.ts +0 -61
  224. package/src/widgets/components/AttachmentWidget.tsx +0 -111
  225. package/src/widgets/components/AttachmentsWidget.tsx +0 -121
  226. package/src/widgets/components/BadgeWidget.tsx +0 -35
  227. package/src/widgets/components/ButtonWidget.tsx +0 -43
  228. package/src/widgets/components/CardWidget.tsx +0 -68
  229. package/src/widgets/components/CheckboxWidget.tsx +0 -39
  230. package/src/widgets/components/CodeWidget.tsx +0 -44
  231. package/src/widgets/components/ColumnWidget.tsx +0 -22
  232. package/src/widgets/components/ComputedWidget.tsx +0 -49
  233. package/src/widgets/components/DataWidget.tsx +0 -189
  234. package/src/widgets/components/DatePickerWidget.tsx +0 -73
  235. package/src/widgets/components/DatetimeWidget.tsx +0 -160
  236. package/src/widgets/components/DividerWidget.tsx +0 -37
  237. package/src/widgets/components/DrawerWidget.tsx +0 -52
  238. package/src/widgets/components/DynamicLinkWidget.tsx +0 -130
  239. package/src/widgets/components/GridWidget.tsx +0 -134
  240. package/src/widgets/components/GroupWidget.tsx +0 -111
  241. package/src/widgets/components/IconWidget.tsx +0 -29
  242. package/src/widgets/components/ImageWidget.tsx +0 -28
  243. package/src/widgets/components/InputWidget.tsx +0 -70
  244. package/src/widgets/components/JsonWidget.tsx +0 -78
  245. package/src/widgets/components/LinkWidget.tsx +0 -99
  246. package/src/widgets/components/ManyToManyWidget.tsx +0 -125
  247. package/src/widgets/components/ModalWidget.tsx +0 -52
  248. package/src/widgets/components/MoneyWidget.tsx +0 -80
  249. package/src/widgets/components/RepeatWidget.tsx +0 -66
  250. package/src/widgets/components/ScrollAreaWidget.tsx +0 -40
  251. package/src/widgets/components/SectionWidget.tsx +0 -78
  252. package/src/widgets/components/SelectWidget.tsx +0 -63
  253. package/src/widgets/components/SequenceWidget.tsx +0 -32
  254. package/src/widgets/components/SpacerWidget.tsx +0 -29
  255. package/src/widgets/components/SplitWidget.tsx +0 -60
  256. package/src/widgets/components/StackWidget.tsx +0 -44
  257. package/src/widgets/components/TableWidget.tsx +0 -366
  258. package/src/widgets/components/TextWidget.tsx +0 -44
  259. package/src/widgets/components/TextareaWidget.tsx +0 -49
  260. package/src/widgets/components/TreeWidget.tsx +0 -109
  261. package/src/widgets/components/index.ts +0 -30
  262. package/src/widgets/components/register.ts +0 -93
  263. package/src/widgets/components/table/CellRenderers.tsx +0 -83
  264. package/src/widgets/components/table/TablePagination.tsx +0 -45
  265. package/src/widgets/components/table/TableToolbar.tsx +0 -285
  266. package/src/widgets/components/table/filter-operators.ts +0 -134
  267. package/src/widgets/components/table/index.ts +0 -11
  268. package/src/widgets/condition/evaluator.ts +0 -57
  269. package/src/widgets/condition/index.ts +0 -1
  270. package/src/widgets/context/builder.ts +0 -99
  271. package/src/widgets/context/index.ts +0 -8
  272. package/src/widgets/context/types.ts +0 -37
  273. package/src/widgets/data/index.ts +0 -5
  274. package/src/widgets/data/useModelQuery.ts +0 -116
  275. package/src/widgets/data/useModelRecord.ts +0 -37
  276. package/src/widgets/expression/evaluator.ts +0 -100
  277. package/src/widgets/expression/functions.ts +0 -131
  278. package/src/widgets/expression/index.ts +0 -13
  279. package/src/widgets/expression/parser.ts +0 -229
  280. package/src/widgets/expression/types.ts +0 -45
  281. package/src/widgets/form/FormContext.ts +0 -29
  282. package/src/widgets/form/FormProvider.tsx +0 -84
  283. package/src/widgets/form/FormWidget.tsx +0 -42
  284. package/src/widgets/form/index.ts +0 -4
  285. package/src/widgets/form/useFormState.ts +0 -127
  286. package/src/widgets/form/useFormSubmit.ts +0 -90
  287. package/src/widgets/form/useFormValidation.ts +0 -62
  288. package/src/widgets/hooks/index.ts +0 -8
  289. package/src/widgets/hooks/useAction.ts +0 -83
  290. package/src/widgets/hooks/useBind.ts +0 -34
  291. package/src/widgets/hooks/useCondition.ts +0 -21
  292. package/src/widgets/hooks/useDataQuery.ts +0 -48
  293. package/src/widgets/hooks/useExpression.ts +0 -14
  294. package/src/widgets/hooks/usePageState.ts +0 -21
  295. package/src/widgets/hooks/useSurfaceContext.ts +0 -11
  296. package/src/widgets/hooks/useWidgetContext.ts +0 -14
  297. package/src/widgets/index.ts +0 -80
  298. package/src/widgets/lib/layout-props.ts +0 -135
  299. package/src/widgets/reactivity/index.ts +0 -11
  300. package/src/widgets/reactivity/tracker.ts +0 -139
  301. package/src/widgets/reactivity/variables.ts +0 -213
  302. package/src/widgets/registry.ts +0 -41
  303. package/src/widgets/renderer/SlotRenderer.tsx +0 -47
  304. package/src/widgets/renderer/WidgetRenderer.tsx +0 -191
  305. package/src/widgets/renderer/index.ts +0 -4
  306. package/src/widgets/shell/WidgetSlotRenderer.tsx +0 -73
  307. package/src/widgets/shell/index.ts +0 -4
  308. package/src/widgets/shell/useActionHandlers.ts +0 -170
  309. package/src/widgets/state/index.ts +0 -2
  310. package/src/widgets/state/store.ts +0 -96
  311. package/src/widgets/types.ts +0 -28
  312. package/src/widgets/validation/index.ts +0 -2
  313. package/src/widgets/validation/validator.ts +0 -140
  314. package/tsconfig.json +0 -27
  315. package/tsconfig.tsbuildinfo +0 -1
  316. package/vite.config.ts +0 -21
  317. package/vitest.config.ts +0 -16
@@ -1,94 +0,0 @@
1
- import * as React from 'react';
2
- import { Avatar as AvatarPrimitive } from 'radix-ui';
3
-
4
- import { cn } from '@/lib/utils';
5
-
6
- function Avatar({
7
- className,
8
- size = 'default',
9
- ...props
10
- }: React.ComponentProps<typeof AvatarPrimitive.Root> & {
11
- size?: 'default' | 'sm' | 'lg';
12
- }) {
13
- return (
14
- <AvatarPrimitive.Root
15
- data-slot="avatar"
16
- data-size={size}
17
- className={cn(
18
- 'group/avatar relative flex size-8 shrink-0 rounded-full select-none after:absolute after:inset-0 after:rounded-full after:border after:border-border after:mix-blend-darken data-[size=lg]:size-10 data-[size=sm]:size-6 dark:after:mix-blend-lighten',
19
- className,
20
- )}
21
- {...props}
22
- />
23
- );
24
- }
25
-
26
- function AvatarImage({ className, ...props }: React.ComponentProps<typeof AvatarPrimitive.Image>) {
27
- return (
28
- <AvatarPrimitive.Image
29
- data-slot="avatar-image"
30
- className={cn('aspect-square size-full rounded-full object-cover', className)}
31
- {...props}
32
- />
33
- );
34
- }
35
-
36
- function AvatarFallback({
37
- className,
38
- ...props
39
- }: React.ComponentProps<typeof AvatarPrimitive.Fallback>) {
40
- return (
41
- <AvatarPrimitive.Fallback
42
- data-slot="avatar-fallback"
43
- className={cn(
44
- 'flex size-full items-center justify-center rounded-full bg-muted text-sm text-muted-foreground group-data-[size=sm]/avatar:text-xs',
45
- className,
46
- )}
47
- {...props}
48
- />
49
- );
50
- }
51
-
52
- function AvatarBadge({ className, ...props }: React.ComponentProps<'span'>) {
53
- return (
54
- <span
55
- data-slot="avatar-badge"
56
- className={cn(
57
- 'absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-primary text-primary-foreground bg-blend-color ring-2 ring-background select-none',
58
- 'group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden',
59
- 'group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2',
60
- 'group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2',
61
- className,
62
- )}
63
- {...props}
64
- />
65
- );
66
- }
67
-
68
- function AvatarGroup({ className, ...props }: React.ComponentProps<'div'>) {
69
- return (
70
- <div
71
- data-slot="avatar-group"
72
- className={cn(
73
- 'group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background',
74
- className,
75
- )}
76
- {...props}
77
- />
78
- );
79
- }
80
-
81
- function AvatarGroupCount({ className, ...props }: React.ComponentProps<'div'>) {
82
- return (
83
- <div
84
- data-slot="avatar-group-count"
85
- className={cn(
86
- 'relative flex size-8 shrink-0 items-center justify-center rounded-full bg-muted text-xs text-muted-foreground ring-2 ring-background group-has-data-[size=lg]/avatar-group:size-10 group-has-data-[size=sm]/avatar-group:size-6 [&>svg]:size-4 group-has-data-[size=lg]/avatar-group:[&>svg]:size-5 group-has-data-[size=sm]/avatar-group:[&>svg]:size-3',
87
- className,
88
- )}
89
- {...props}
90
- />
91
- );
92
- }
93
-
94
- export { Avatar, AvatarImage, AvatarFallback, AvatarGroup, AvatarGroupCount, AvatarBadge };
@@ -1,45 +0,0 @@
1
- import * as React from 'react';
2
- import { cva, type VariantProps } from 'class-variance-authority';
3
- import { Slot } from 'radix-ui';
4
-
5
- import { cn } from '@/lib/utils';
6
-
7
- const badgeVariants = cva(
8
- 'group/badge inline-flex h-5 w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-none border border-transparent px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-all focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3!',
9
- {
10
- variants: {
11
- variant: {
12
- default: 'bg-primary text-primary-foreground [a]:hover:bg-primary/80',
13
- secondary: 'bg-secondary text-secondary-foreground [a]:hover:bg-secondary/80',
14
- destructive:
15
- 'bg-destructive/10 text-destructive focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:focus-visible:ring-destructive/40 [a]:hover:bg-destructive/20',
16
- outline: 'border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground',
17
- ghost: 'hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50',
18
- link: 'text-primary underline-offset-4 hover:underline',
19
- },
20
- },
21
- defaultVariants: {
22
- variant: 'default',
23
- },
24
- },
25
- );
26
-
27
- function Badge({
28
- className,
29
- variant = 'default',
30
- asChild = false,
31
- ...props
32
- }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
33
- const Comp = asChild ? Slot.Root : 'span';
34
-
35
- return (
36
- <Comp
37
- data-slot="badge"
38
- data-variant={variant}
39
- className={cn(badgeVariants({ variant }), className)}
40
- {...props}
41
- />
42
- );
43
- }
44
-
45
- export { Badge, badgeVariants };
@@ -1,104 +0,0 @@
1
- import * as React from 'react';
2
- import { Slot } from 'radix-ui';
3
-
4
- import { cn } from '@/lib/utils';
5
- import { ChevronRightIcon, MoreHorizontalIcon } from 'lucide-react';
6
-
7
- function Breadcrumb({ className, ...props }: React.ComponentProps<'nav'>) {
8
- return (
9
- <nav aria-label="breadcrumb" data-slot="breadcrumb" className={cn(className)} {...props} />
10
- );
11
- }
12
-
13
- function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {
14
- return (
15
- <ol
16
- data-slot="breadcrumb-list"
17
- className={cn(
18
- 'flex flex-wrap items-center gap-1.5 text-xs wrap-break-word text-muted-foreground',
19
- className,
20
- )}
21
- {...props}
22
- />
23
- );
24
- }
25
-
26
- function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {
27
- return (
28
- <li
29
- data-slot="breadcrumb-item"
30
- className={cn('inline-flex items-center gap-1', className)}
31
- {...props}
32
- />
33
- );
34
- }
35
-
36
- function BreadcrumbLink({
37
- asChild,
38
- className,
39
- ...props
40
- }: React.ComponentProps<'a'> & {
41
- asChild?: boolean;
42
- }) {
43
- const Comp = asChild ? Slot.Root : 'a';
44
-
45
- return (
46
- <Comp
47
- data-slot="breadcrumb-link"
48
- className={cn('transition-colors hover:text-foreground', className)}
49
- {...props}
50
- />
51
- );
52
- }
53
-
54
- function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {
55
- return (
56
- <span
57
- data-slot="breadcrumb-page"
58
- role="link"
59
- aria-disabled="true"
60
- aria-current="page"
61
- className={cn('font-normal text-foreground', className)}
62
- {...props}
63
- />
64
- );
65
- }
66
-
67
- function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>) {
68
- return (
69
- <li
70
- data-slot="breadcrumb-separator"
71
- role="presentation"
72
- aria-hidden="true"
73
- className={cn('[&>svg]:size-3.5', className)}
74
- {...props}
75
- >
76
- {children ?? <ChevronRightIcon />}
77
- </li>
78
- );
79
- }
80
-
81
- function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
82
- return (
83
- <span
84
- data-slot="breadcrumb-ellipsis"
85
- role="presentation"
86
- aria-hidden="true"
87
- className={cn('flex size-5 items-center justify-center [&>svg]:size-4', className)}
88
- {...props}
89
- >
90
- <MoreHorizontalIcon />
91
- <span className="sr-only">More</span>
92
- </span>
93
- );
94
- }
95
-
96
- export {
97
- Breadcrumb,
98
- BreadcrumbList,
99
- BreadcrumbItem,
100
- BreadcrumbLink,
101
- BreadcrumbPage,
102
- BreadcrumbSeparator,
103
- BreadcrumbEllipsis,
104
- };
@@ -1,78 +0,0 @@
1
- import { cva, type VariantProps } from 'class-variance-authority';
2
- import { Slot } from 'radix-ui';
3
-
4
- import { cn } from '@/lib/utils';
5
- import { Separator } from '@/components/ui/separator';
6
-
7
- const buttonGroupVariants = cva(
8
- "group/button-group flex w-fit items-stretch rounded-none *:focus-visible:relative *:focus-visible:z-10 has-[>[data-slot=button-group]]:gap-2 has-[select[aria-hidden=true]:last-child]:[&>[data-slot=select-trigger]:last-of-type]:rounded-none [&>[data-slot=select-trigger]:not([class*='w-'])]:w-fit [&>input]:flex-1",
9
- {
10
- variants: {
11
- orientation: {
12
- horizontal:
13
- '[&>*:not(:first-child)]:rounded-l-none [&>*:not(:first-child)]:border-l-0 [&>*:not(:last-child)]:rounded-r-none',
14
- vertical:
15
- 'flex-col [&>*:not(:first-child)]:rounded-t-none [&>*:not(:first-child)]:border-t-0 [&>*:not(:last-child)]:rounded-b-none',
16
- },
17
- },
18
- defaultVariants: {
19
- orientation: 'horizontal',
20
- },
21
- },
22
- );
23
-
24
- function ButtonGroup({
25
- className,
26
- orientation,
27
- ...props
28
- }: React.ComponentProps<'div'> & VariantProps<typeof buttonGroupVariants>) {
29
- return (
30
- <div
31
- role="group"
32
- data-slot="button-group"
33
- data-orientation={orientation}
34
- className={cn(buttonGroupVariants({ orientation }), className)}
35
- {...props}
36
- />
37
- );
38
- }
39
-
40
- function ButtonGroupText({
41
- className,
42
- asChild = false,
43
- ...props
44
- }: React.ComponentProps<'div'> & {
45
- asChild?: boolean;
46
- }) {
47
- const Comp = asChild ? Slot.Root : 'div';
48
-
49
- return (
50
- <Comp
51
- className={cn(
52
- "flex items-center gap-2 rounded-none border bg-muted px-2.5 text-xs font-medium [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4",
53
- className,
54
- )}
55
- {...props}
56
- />
57
- );
58
- }
59
-
60
- function ButtonGroupSeparator({
61
- className,
62
- orientation = 'vertical',
63
- ...props
64
- }: React.ComponentProps<typeof Separator>) {
65
- return (
66
- <Separator
67
- data-slot="button-group-separator"
68
- orientation={orientation}
69
- className={cn(
70
- 'relative self-stretch bg-input data-horizontal:mx-px data-horizontal:w-auto data-vertical:my-px data-vertical:h-auto',
71
- className,
72
- )}
73
- {...props}
74
- />
75
- );
76
- }
77
-
78
- export { ButtonGroup, ButtonGroupSeparator, ButtonGroupText, buttonGroupVariants };
@@ -1,65 +0,0 @@
1
- import * as React from 'react';
2
- import { cva, type VariantProps } from 'class-variance-authority';
3
- import { Slot } from 'radix-ui';
4
-
5
- import { cn } from '@/lib/utils';
6
-
7
- const buttonVariants = cva(
8
- "group/button inline-flex shrink-0 items-center justify-center rounded-none border border-transparent bg-clip-padding text-xs font-medium whitespace-nowrap transition-all outline-none select-none focus-visible:border-ring focus-visible:ring-1 focus-visible:ring-ring/50 active:not-aria-[haspopup]:translate-y-px disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-1 aria-invalid:ring-destructive/20 dark:aria-invalid:border-destructive/50 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
9
- {
10
- variants: {
11
- variant: {
12
- default: 'bg-primary text-primary-foreground hover:bg-primary/80',
13
- outline:
14
- 'border-border bg-background hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
15
- secondary:
16
- 'bg-secondary text-secondary-foreground hover:bg-[color-mix(in_oklch,var(--secondary),var(--foreground)_5%)] aria-expanded:bg-secondary aria-expanded:text-secondary-foreground',
17
- ghost:
18
- 'hover:bg-muted hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground dark:hover:bg-muted/50',
19
- destructive:
20
- 'bg-destructive/10 text-destructive hover:bg-destructive/20 focus-visible:border-destructive/40 focus-visible:ring-destructive/20 dark:bg-destructive/20 dark:hover:bg-destructive/30 dark:focus-visible:ring-destructive/40',
21
- link: 'text-primary underline-offset-4 hover:underline',
22
- },
23
- size: {
24
- default:
25
- 'h-8 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
26
- xs: "h-6 gap-1 rounded-none px-2 text-xs has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
27
- sm: "h-7 gap-1 rounded-none px-2.5 has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
28
- lg: 'h-9 gap-1.5 px-2.5 has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2',
29
- icon: 'size-8',
30
- 'icon-xs': "size-6 rounded-none [&_svg:not([class*='size-'])]:size-3",
31
- 'icon-sm': 'size-7 rounded-none',
32
- 'icon-lg': 'size-9',
33
- },
34
- },
35
- defaultVariants: {
36
- variant: 'default',
37
- size: 'default',
38
- },
39
- },
40
- );
41
-
42
- function Button({
43
- className,
44
- variant = 'default',
45
- size = 'default',
46
- asChild = false,
47
- ...props
48
- }: React.ComponentProps<'button'> &
49
- VariantProps<typeof buttonVariants> & {
50
- asChild?: boolean;
51
- }) {
52
- const Comp = asChild ? Slot.Root : 'button';
53
-
54
- return (
55
- <Comp
56
- data-slot="button"
57
- data-variant={variant}
58
- data-size={size}
59
- className={cn(buttonVariants({ variant, size, className }))}
60
- {...props}
61
- />
62
- );
63
- }
64
-
65
- export { Button, buttonVariants };
@@ -1,187 +0,0 @@
1
- 'use client';
2
-
3
- import * as React from 'react';
4
- import { DayPicker, getDefaultClassNames, type DayButton, type Locale } from 'react-day-picker';
5
-
6
- import { cn } from '@/lib/utils';
7
- import { Button, buttonVariants } from '@/components/ui/button';
8
- import { ChevronLeftIcon, ChevronRightIcon, ChevronDownIcon } from 'lucide-react';
9
-
10
- function Calendar({
11
- className,
12
- classNames,
13
- showOutsideDays = true,
14
- captionLayout = 'label',
15
- buttonVariant = 'ghost',
16
- locale,
17
- formatters,
18
- components,
19
- ...props
20
- }: React.ComponentProps<typeof DayPicker> & {
21
- buttonVariant?: React.ComponentProps<typeof Button>['variant'];
22
- }) {
23
- const defaultClassNames = getDefaultClassNames();
24
-
25
- return (
26
- <DayPicker
27
- showOutsideDays={showOutsideDays}
28
- className={cn(
29
- 'group/calendar bg-background p-2 [--cell-size:--spacing(7)] in-data-[slot=card-content]:bg-transparent in-data-[slot=popover-content]:bg-transparent',
30
- String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,
31
- String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,
32
- className,
33
- )}
34
- captionLayout={captionLayout}
35
- locale={locale}
36
- formatters={{
37
- formatMonthDropdown: (date) => date.toLocaleString(locale?.code, { month: 'short' }),
38
- ...formatters,
39
- }}
40
- classNames={{
41
- root: cn('w-fit', defaultClassNames.root),
42
- months: cn('relative flex flex-col gap-4 md:flex-row', defaultClassNames.months),
43
- month: cn('flex w-full flex-col gap-4', defaultClassNames.month),
44
- nav: cn(
45
- 'absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1',
46
- defaultClassNames.nav,
47
- ),
48
- button_previous: cn(
49
- buttonVariants({ variant: buttonVariant }),
50
- 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',
51
- defaultClassNames.button_previous,
52
- ),
53
- button_next: cn(
54
- buttonVariants({ variant: buttonVariant }),
55
- 'size-(--cell-size) p-0 select-none aria-disabled:opacity-50',
56
- defaultClassNames.button_next,
57
- ),
58
- month_caption: cn(
59
- 'flex h-(--cell-size) w-full items-center justify-center px-(--cell-size)',
60
- defaultClassNames.month_caption,
61
- ),
62
- dropdowns: cn(
63
- 'flex h-(--cell-size) w-full items-center justify-center gap-1.5 text-sm font-medium',
64
- defaultClassNames.dropdowns,
65
- ),
66
- dropdown_root: cn('relative rounded-(--cell-radius)', defaultClassNames.dropdown_root),
67
- dropdown: cn('absolute inset-0 bg-popover opacity-0', defaultClassNames.dropdown),
68
- caption_label: cn(
69
- 'font-medium select-none',
70
- captionLayout === 'label'
71
- ? 'text-sm'
72
- : 'flex items-center gap-1 rounded-(--cell-radius) text-sm [&>svg]:size-3.5 [&>svg]:text-muted-foreground',
73
- defaultClassNames.caption_label,
74
- ),
75
- // @ts-expect-error -- shadcn template uses `table` but react-day-picker types don't include it
76
- table: 'w-full border-collapse',
77
- weekdays: cn('flex', defaultClassNames.weekdays),
78
- weekday: cn(
79
- 'flex-1 rounded-(--cell-radius) text-[0.8rem] font-normal text-muted-foreground select-none',
80
- defaultClassNames.weekday,
81
- ),
82
- week: cn('mt-2 flex w-full', defaultClassNames.week),
83
- week_number_header: cn('w-(--cell-size) select-none', defaultClassNames.week_number_header),
84
- week_number: cn(
85
- 'text-[0.8rem] text-muted-foreground select-none',
86
- defaultClassNames.week_number,
87
- ),
88
- day: cn(
89
- 'group/day relative aspect-square h-full w-full rounded-(--cell-radius) p-0 text-center select-none [&:last-child[data-selected=true]_button]:rounded-r-(--cell-radius)',
90
- props.showWeekNumber
91
- ? '[&:nth-child(2)[data-selected=true]_button]:rounded-l-(--cell-radius)'
92
- : '[&:first-child[data-selected=true]_button]:rounded-l-(--cell-radius)',
93
- defaultClassNames.day,
94
- ),
95
- range_start: cn(
96
- 'relative isolate z-0 rounded-l-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:right-0 after:w-4 after:bg-muted',
97
- defaultClassNames.range_start,
98
- ),
99
- range_middle: cn('rounded-none', defaultClassNames.range_middle),
100
- range_end: cn(
101
- 'relative isolate z-0 rounded-r-(--cell-radius) bg-muted after:absolute after:inset-y-0 after:left-0 after:w-4 after:bg-muted',
102
- defaultClassNames.range_end,
103
- ),
104
- today: cn(
105
- 'rounded-(--cell-radius) bg-muted text-foreground data-[selected=true]:rounded-none',
106
- defaultClassNames.today,
107
- ),
108
- outside: cn(
109
- 'text-muted-foreground aria-selected:text-muted-foreground',
110
- defaultClassNames.outside,
111
- ),
112
- disabled: cn('text-muted-foreground opacity-50', defaultClassNames.disabled),
113
- hidden: cn('invisible', defaultClassNames.hidden),
114
- ...classNames,
115
- }}
116
- components={{
117
- Root: ({ className, rootRef, ...props }) => {
118
- return <div data-slot="calendar" ref={rootRef} className={cn(className)} {...props} />;
119
- },
120
- Chevron: ({ className, orientation, ...props }) => {
121
- if (orientation === 'left') {
122
- return <ChevronLeftIcon className={cn('size-4', className)} {...props} />;
123
- }
124
-
125
- if (orientation === 'right') {
126
- return <ChevronRightIcon className={cn('size-4', className)} {...props} />;
127
- }
128
-
129
- return <ChevronDownIcon className={cn('size-4', className)} {...props} />;
130
- },
131
- DayButton: ({ ...props }) => <CalendarDayButton locale={locale} {...props} />,
132
- WeekNumber: ({ children, ...props }) => {
133
- return (
134
- <td {...props}>
135
- <div className="flex size-(--cell-size) items-center justify-center text-center">
136
- {children}
137
- </div>
138
- </td>
139
- );
140
- },
141
- ...components,
142
- }}
143
- {...props}
144
- />
145
- );
146
- }
147
-
148
- function CalendarDayButton({
149
- className,
150
- day,
151
- modifiers,
152
- locale,
153
- ...props
154
- }: React.ComponentProps<typeof DayButton> & { locale?: Partial<Locale> }) {
155
- const defaultClassNames = getDefaultClassNames();
156
-
157
- const ref = React.useRef<HTMLButtonElement>(null);
158
- React.useEffect(() => {
159
- if (modifiers.focused) ref.current?.focus();
160
- }, [modifiers.focused]);
161
-
162
- return (
163
- <Button
164
- ref={ref}
165
- variant="ghost"
166
- size="icon"
167
- data-day={day.date.toLocaleDateString(locale?.code)}
168
- data-selected-single={
169
- modifiers.selected &&
170
- !modifiers.range_start &&
171
- !modifiers.range_end &&
172
- !modifiers.range_middle
173
- }
174
- data-range-start={modifiers.range_start}
175
- data-range-end={modifiers.range_end}
176
- data-range-middle={modifiers.range_middle}
177
- className={cn(
178
- 'relative isolate z-10 flex aspect-square size-auto w-full min-w-(--cell-size) flex-col gap-1 border-0 leading-none font-normal group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-[3px] group-data-[focused=true]/day:ring-ring/50 data-[range-end=true]:rounded-(--cell-radius) data-[range-end=true]:rounded-r-(--cell-radius) data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground data-[range-middle=true]:rounded-none data-[range-middle=true]:bg-muted data-[range-middle=true]:text-foreground data-[range-start=true]:rounded-(--cell-radius) data-[range-start=true]:rounded-l-(--cell-radius) data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground dark:hover:text-foreground [&>span]:text-xs [&>span]:opacity-70',
179
- defaultClassNames.day,
180
- className,
181
- )}
182
- {...props}
183
- />
184
- );
185
- }
186
-
187
- export { Calendar, CalendarDayButton };
@@ -1,85 +0,0 @@
1
- import * as React from 'react';
2
-
3
- import { cn } from '@/lib/utils';
4
-
5
- function Card({
6
- className,
7
- size = 'default',
8
- ...props
9
- }: React.ComponentProps<'div'> & { size?: 'default' | 'sm' }) {
10
- return (
11
- <div
12
- data-slot="card"
13
- data-size={size}
14
- className={cn(
15
- 'group/card flex flex-col gap-(--card-spacing) overflow-hidden rounded-none bg-card py-(--card-spacing) text-xs/relaxed text-card-foreground ring-1 ring-foreground/10 [--card-spacing:--spacing(4)] has-data-[slot=card-footer]:pb-0 has-[>img:first-child]:pt-0 data-[size=sm]:[--card-spacing:--spacing(3)] data-[size=sm]:has-data-[slot=card-footer]:pb-0 *:[img:first-child]:rounded-none *:[img:last-child]:rounded-none',
16
- className,
17
- )}
18
- {...props}
19
- />
20
- );
21
- }
22
-
23
- function CardHeader({ className, ...props }: React.ComponentProps<'div'>) {
24
- return (
25
- <div
26
- data-slot="card-header"
27
- className={cn(
28
- 'group/card-header @container/card-header grid auto-rows-min items-start gap-1 rounded-none px-(--card-spacing) has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto] [.border-b]:pb-(--card-spacing)',
29
- className,
30
- )}
31
- {...props}
32
- />
33
- );
34
- }
35
-
36
- function CardTitle({ className, ...props }: React.ComponentProps<'div'>) {
37
- return (
38
- <div
39
- data-slot="card-title"
40
- className={cn(
41
- 'font-heading text-sm font-medium group-data-[size=sm]/card:text-sm',
42
- className,
43
- )}
44
- {...props}
45
- />
46
- );
47
- }
48
-
49
- function CardDescription({ className, ...props }: React.ComponentProps<'div'>) {
50
- return (
51
- <div
52
- data-slot="card-description"
53
- className={cn('text-xs/relaxed text-muted-foreground', className)}
54
- {...props}
55
- />
56
- );
57
- }
58
-
59
- function CardAction({ className, ...props }: React.ComponentProps<'div'>) {
60
- return (
61
- <div
62
- data-slot="card-action"
63
- className={cn('col-start-2 row-span-2 row-start-1 self-start justify-self-end', className)}
64
- {...props}
65
- />
66
- );
67
- }
68
-
69
- function CardContent({ className, ...props }: React.ComponentProps<'div'>) {
70
- return (
71
- <div data-slot="card-content" className={cn('px-(--card-spacing)', className)} {...props} />
72
- );
73
- }
74
-
75
- function CardFooter({ className, ...props }: React.ComponentProps<'div'>) {
76
- return (
77
- <div
78
- data-slot="card-footer"
79
- className={cn('flex items-center rounded-none border-t p-(--card-spacing)', className)}
80
- {...props}
81
- />
82
- );
83
- }
84
-
85
- export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent };