@questpie/admin 0.0.1 → 1.0.1

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 (250) hide show
  1. package/README.md +439 -424
  2. package/dist/auth-layout-M8K8_q5R.mjs +181 -0
  3. package/dist/auth-layout-M8K8_q5R.mjs.map +1 -0
  4. package/dist/bulk-upload-dialog-D7w7W1Hl.mjs +273 -0
  5. package/dist/bulk-upload-dialog-D7w7W1Hl.mjs.map +1 -0
  6. package/dist/{components/ui/card.mjs → card-BKHjBQfw.mjs} +8 -8
  7. package/dist/card-BKHjBQfw.mjs.map +1 -0
  8. package/dist/client/styles/index.css +434 -0
  9. package/dist/client-DbpZKSgH.d.mts +13585 -0
  10. package/dist/client-DbpZKSgH.d.mts.map +1 -0
  11. package/dist/client-njX1rZmi.mjs +22612 -0
  12. package/dist/client-njX1rZmi.mjs.map +1 -0
  13. package/dist/client.d.mts +3 -0
  14. package/dist/client.mjs +13 -0
  15. package/dist/content-locales-provider-BXvuIgfg.mjs +1650 -0
  16. package/dist/content-locales-provider-BXvuIgfg.mjs.map +1 -0
  17. package/dist/dashboard-page-B4PGEdc2.mjs +2500 -0
  18. package/dist/dashboard-page-B4PGEdc2.mjs.map +1 -0
  19. package/dist/dashboard-page-mCY0pgZv.mjs +3 -0
  20. package/dist/dropzone-Do3awXKd.mjs +634 -0
  21. package/dist/dropzone-Do3awXKd.mjs.map +1 -0
  22. package/dist/{views/auth/forgot-password-form.mjs → forgot-password-page-Bcp-An4Y.mjs} +87 -14
  23. package/dist/forgot-password-page-Bcp-An4Y.mjs.map +1 -0
  24. package/dist/forgot-password-page-CEwsdLwn.mjs +3 -0
  25. package/dist/index-B9Xwk4hi.d.mts +2753 -0
  26. package/dist/index-B9Xwk4hi.d.mts.map +1 -0
  27. package/dist/index.d.mts +3 -0
  28. package/dist/index.mjs +13 -0
  29. package/dist/login-page-BUnpCbCa.mjs +3 -0
  30. package/dist/login-page-CP4gA-dl.mjs +298 -0
  31. package/dist/login-page-CP4gA-dl.mjs.map +1 -0
  32. package/dist/preview-utils-BKQ9-TMa.mjs +65 -0
  33. package/dist/preview-utils-BKQ9-TMa.mjs.map +1 -0
  34. package/dist/{views/auth/reset-password-form.mjs → reset-password-page-BqfDmLxA.mjs} +111 -14
  35. package/dist/reset-password-page-BqfDmLxA.mjs.map +1 -0
  36. package/dist/reset-password-page-CufHz3h3.mjs +3 -0
  37. package/dist/runtime-6VZM878K.mjs +69 -0
  38. package/dist/runtime-6VZM878K.mjs.map +1 -0
  39. package/dist/saved-views.types-BMsz5mCy.d.mts +42 -0
  40. package/dist/saved-views.types-BMsz5mCy.d.mts.map +1 -0
  41. package/dist/server.d.mts +250 -0
  42. package/dist/server.d.mts.map +1 -0
  43. package/dist/server.mjs +832 -0
  44. package/dist/server.mjs.map +1 -0
  45. package/dist/setup-page-BNNzt_Z6.mjs +3 -0
  46. package/dist/setup-page-YAP_fzqh.mjs +264 -0
  47. package/dist/setup-page-YAP_fzqh.mjs.map +1 -0
  48. package/dist/shared.d.mts +57 -0
  49. package/dist/shared.d.mts.map +1 -0
  50. package/dist/shared.mjs +3 -0
  51. package/dist/{hooks/use-auth.mjs → use-auth-BoLmWtmU.mjs} +42 -30
  52. package/dist/use-auth-BoLmWtmU.mjs.map +1 -0
  53. package/package.json +48 -198
  54. package/.turbo/turbo-build.log +0 -108
  55. package/CHANGELOG.md +0 -10
  56. package/STATUS.md +0 -917
  57. package/VALIDATION.md +0 -602
  58. package/components.json +0 -24
  59. package/dist/__tests__/setup.mjs +0 -38
  60. package/dist/__tests__/test-utils.mjs +0 -45
  61. package/dist/__tests__/vitest.d.mjs +0 -3
  62. package/dist/components/admin-app.mjs +0 -69
  63. package/dist/components/fields/array-field.mjs +0 -190
  64. package/dist/components/fields/checkbox-field.mjs +0 -34
  65. package/dist/components/fields/custom-field.mjs +0 -32
  66. package/dist/components/fields/date-field.mjs +0 -41
  67. package/dist/components/fields/datetime-field.mjs +0 -42
  68. package/dist/components/fields/email-field.mjs +0 -37
  69. package/dist/components/fields/embedded-collection.mjs +0 -253
  70. package/dist/components/fields/field-types.mjs +0 -1
  71. package/dist/components/fields/field-utils.mjs +0 -10
  72. package/dist/components/fields/field-wrapper.mjs +0 -34
  73. package/dist/components/fields/index.mjs +0 -23
  74. package/dist/components/fields/json-field.mjs +0 -243
  75. package/dist/components/fields/locale-badge.mjs +0 -16
  76. package/dist/components/fields/number-field.mjs +0 -39
  77. package/dist/components/fields/password-field.mjs +0 -37
  78. package/dist/components/fields/relation-field.mjs +0 -104
  79. package/dist/components/fields/relation-picker.mjs +0 -229
  80. package/dist/components/fields/relation-select.mjs +0 -188
  81. package/dist/components/fields/rich-text-editor/index.mjs +0 -897
  82. package/dist/components/fields/select-field.mjs +0 -41
  83. package/dist/components/fields/switch-field.mjs +0 -34
  84. package/dist/components/fields/text-field.mjs +0 -38
  85. package/dist/components/fields/textarea-field.mjs +0 -38
  86. package/dist/components/index.mjs +0 -59
  87. package/dist/components/primitives/checkbox-input.mjs +0 -127
  88. package/dist/components/primitives/date-input.mjs +0 -303
  89. package/dist/components/primitives/index.mjs +0 -12
  90. package/dist/components/primitives/number-input.mjs +0 -104
  91. package/dist/components/primitives/select-input.mjs +0 -177
  92. package/dist/components/primitives/tag-input.mjs +0 -135
  93. package/dist/components/primitives/text-input.mjs +0 -39
  94. package/dist/components/primitives/textarea-input.mjs +0 -37
  95. package/dist/components/primitives/toggle-input.mjs +0 -31
  96. package/dist/components/primitives/types.mjs +0 -12
  97. package/dist/components/ui/accordion.mjs +0 -55
  98. package/dist/components/ui/avatar.mjs +0 -54
  99. package/dist/components/ui/badge.mjs +0 -34
  100. package/dist/components/ui/button.mjs +0 -48
  101. package/dist/components/ui/checkbox.mjs +0 -21
  102. package/dist/components/ui/combobox.mjs +0 -163
  103. package/dist/components/ui/dialog.mjs +0 -95
  104. package/dist/components/ui/dropdown-menu.mjs +0 -138
  105. package/dist/components/ui/field.mjs +0 -113
  106. package/dist/components/ui/input-group.mjs +0 -82
  107. package/dist/components/ui/input.mjs +0 -17
  108. package/dist/components/ui/label.mjs +0 -15
  109. package/dist/components/ui/popover.mjs +0 -56
  110. package/dist/components/ui/scroll-area.mjs +0 -38
  111. package/dist/components/ui/select.mjs +0 -100
  112. package/dist/components/ui/separator.mjs +0 -16
  113. package/dist/components/ui/sheet.mjs +0 -90
  114. package/dist/components/ui/sidebar.mjs +0 -387
  115. package/dist/components/ui/skeleton.mjs +0 -14
  116. package/dist/components/ui/spinner.mjs +0 -16
  117. package/dist/components/ui/switch.mjs +0 -22
  118. package/dist/components/ui/table.mjs +0 -68
  119. package/dist/components/ui/tabs.mjs +0 -48
  120. package/dist/components/ui/textarea.mjs +0 -15
  121. package/dist/components/ui/tooltip.mjs +0 -44
  122. package/dist/config/component-registry.mjs +0 -38
  123. package/dist/config/index.mjs +0 -129
  124. package/dist/hooks/admin-provider.mjs +0 -70
  125. package/dist/hooks/index.mjs +0 -7
  126. package/dist/hooks/store.mjs +0 -178
  127. package/dist/hooks/use-collection-db.mjs +0 -146
  128. package/dist/hooks/use-collection.mjs +0 -112
  129. package/dist/hooks/use-global.mjs +0 -46
  130. package/dist/hooks/use-mobile.mjs +0 -20
  131. package/dist/lib/utils.mjs +0 -10
  132. package/dist/styles/index.css +0 -336
  133. package/dist/styles/index.mjs +0 -1
  134. package/dist/utils/index.mjs +0 -9
  135. package/dist/views/auth/auth-layout.mjs +0 -52
  136. package/dist/views/auth/index.mjs +0 -6
  137. package/dist/views/auth/login-form.mjs +0 -156
  138. package/dist/views/collection/auto-form-fields.mjs +0 -525
  139. package/dist/views/collection/collection-form.mjs +0 -91
  140. package/dist/views/collection/collection-list.mjs +0 -76
  141. package/dist/views/collection/form-field.mjs +0 -42
  142. package/dist/views/collection/index.mjs +0 -6
  143. package/dist/views/common/index.mjs +0 -4
  144. package/dist/views/common/locale-switcher.mjs +0 -39
  145. package/dist/views/common/version-history.mjs +0 -272
  146. package/dist/views/index.mjs +0 -9
  147. package/dist/views/layout/admin-layout.mjs +0 -40
  148. package/dist/views/layout/admin-router.mjs +0 -95
  149. package/dist/views/layout/admin-sidebar.mjs +0 -63
  150. package/dist/views/layout/index.mjs +0 -5
  151. package/src/__tests__/setup.ts +0 -44
  152. package/src/__tests__/test-utils.tsx +0 -49
  153. package/src/__tests__/vitest.d.ts +0 -9
  154. package/src/components/admin-app.tsx +0 -221
  155. package/src/components/fields/array-field.tsx +0 -237
  156. package/src/components/fields/checkbox-field.tsx +0 -47
  157. package/src/components/fields/custom-field.tsx +0 -50
  158. package/src/components/fields/date-field.tsx +0 -65
  159. package/src/components/fields/datetime-field.tsx +0 -67
  160. package/src/components/fields/email-field.tsx +0 -51
  161. package/src/components/fields/embedded-collection.tsx +0 -315
  162. package/src/components/fields/field-types.ts +0 -162
  163. package/src/components/fields/field-utils.ts +0 -6
  164. package/src/components/fields/field-wrapper.tsx +0 -52
  165. package/src/components/fields/index.ts +0 -66
  166. package/src/components/fields/json-field.tsx +0 -440
  167. package/src/components/fields/locale-badge.tsx +0 -15
  168. package/src/components/fields/number-field.tsx +0 -57
  169. package/src/components/fields/password-field.tsx +0 -51
  170. package/src/components/fields/relation-field.tsx +0 -243
  171. package/src/components/fields/relation-picker.tsx +0 -402
  172. package/src/components/fields/relation-select.tsx +0 -327
  173. package/src/components/fields/rich-text-editor/index.tsx +0 -1337
  174. package/src/components/fields/select-field.tsx +0 -61
  175. package/src/components/fields/switch-field.tsx +0 -47
  176. package/src/components/fields/text-field.tsx +0 -55
  177. package/src/components/fields/textarea-field.tsx +0 -55
  178. package/src/components/index.ts +0 -40
  179. package/src/components/primitives/checkbox-input.tsx +0 -193
  180. package/src/components/primitives/date-input.tsx +0 -401
  181. package/src/components/primitives/index.ts +0 -24
  182. package/src/components/primitives/number-input.tsx +0 -132
  183. package/src/components/primitives/select-input.tsx +0 -296
  184. package/src/components/primitives/tag-input.tsx +0 -200
  185. package/src/components/primitives/text-input.tsx +0 -49
  186. package/src/components/primitives/textarea-input.tsx +0 -46
  187. package/src/components/primitives/toggle-input.tsx +0 -36
  188. package/src/components/primitives/types.ts +0 -235
  189. package/src/components/ui/accordion.tsx +0 -72
  190. package/src/components/ui/avatar.tsx +0 -106
  191. package/src/components/ui/badge.tsx +0 -48
  192. package/src/components/ui/button.tsx +0 -53
  193. package/src/components/ui/card.tsx +0 -94
  194. package/src/components/ui/checkbox.tsx +0 -27
  195. package/src/components/ui/combobox.tsx +0 -290
  196. package/src/components/ui/dialog.tsx +0 -151
  197. package/src/components/ui/dropdown-menu.tsx +0 -254
  198. package/src/components/ui/field.tsx +0 -227
  199. package/src/components/ui/input-group.tsx +0 -149
  200. package/src/components/ui/input.tsx +0 -20
  201. package/src/components/ui/label.tsx +0 -18
  202. package/src/components/ui/popover.tsx +0 -88
  203. package/src/components/ui/scroll-area.tsx +0 -53
  204. package/src/components/ui/select.tsx +0 -192
  205. package/src/components/ui/separator.tsx +0 -23
  206. package/src/components/ui/sheet.tsx +0 -127
  207. package/src/components/ui/sidebar.tsx +0 -723
  208. package/src/components/ui/skeleton.tsx +0 -13
  209. package/src/components/ui/spinner.tsx +0 -10
  210. package/src/components/ui/switch.tsx +0 -32
  211. package/src/components/ui/table.tsx +0 -99
  212. package/src/components/ui/tabs.tsx +0 -82
  213. package/src/components/ui/textarea.tsx +0 -18
  214. package/src/components/ui/tooltip.tsx +0 -70
  215. package/src/config/component-registry.ts +0 -190
  216. package/src/config/index.ts +0 -1099
  217. package/src/hooks/README.md +0 -269
  218. package/src/hooks/admin-provider.tsx +0 -110
  219. package/src/hooks/index.ts +0 -41
  220. package/src/hooks/store.ts +0 -248
  221. package/src/hooks/use-auth.ts +0 -168
  222. package/src/hooks/use-collection-db.ts +0 -209
  223. package/src/hooks/use-collection.ts +0 -156
  224. package/src/hooks/use-global.ts +0 -69
  225. package/src/hooks/use-mobile.ts +0 -21
  226. package/src/lib/utils.ts +0 -6
  227. package/src/styles/index.css +0 -340
  228. package/src/utils/index.ts +0 -6
  229. package/src/views/auth/auth-layout.tsx +0 -77
  230. package/src/views/auth/forgot-password-form.tsx +0 -192
  231. package/src/views/auth/index.ts +0 -21
  232. package/src/views/auth/login-form.tsx +0 -229
  233. package/src/views/auth/reset-password-form.tsx +0 -232
  234. package/src/views/collection/auto-form-fields.tsx +0 -982
  235. package/src/views/collection/collection-form.tsx +0 -186
  236. package/src/views/collection/collection-list.tsx +0 -223
  237. package/src/views/collection/form-field.tsx +0 -52
  238. package/src/views/collection/index.ts +0 -15
  239. package/src/views/common/index.ts +0 -8
  240. package/src/views/common/locale-switcher.tsx +0 -45
  241. package/src/views/common/version-history.tsx +0 -406
  242. package/src/views/index.ts +0 -25
  243. package/src/views/layout/admin-layout.tsx +0 -117
  244. package/src/views/layout/admin-router.tsx +0 -206
  245. package/src/views/layout/admin-sidebar.tsx +0 -185
  246. package/src/views/layout/index.ts +0 -12
  247. package/tsconfig.json +0 -13
  248. package/tsconfig.tsbuildinfo +0 -1
  249. package/tsdown.config.ts +0 -13
  250. package/vitest.config.ts +0 -29
@@ -1,227 +0,0 @@
1
- "use client"
2
-
3
- import { useMemo } from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
-
6
- import { cn } from "../../lib/utils"
7
- import { Label } from "./label"
8
- import { Separator } from "./separator"
9
-
10
- function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
11
- return (
12
- <fieldset
13
- data-slot="field-set"
14
- className={cn("gap-4 has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3 flex flex-col", className)}
15
- {...props}
16
- />
17
- )
18
- }
19
-
20
- function FieldLegend({
21
- className,
22
- variant = "legend",
23
- ...props
24
- }: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {
25
- return (
26
- <legend
27
- data-slot="field-legend"
28
- data-variant={variant}
29
- className={cn("mb-2 font-medium data-[variant=label]:text-xs/relaxed data-[variant=legend]:text-sm", className)}
30
- {...props}
31
- />
32
- )
33
- }
34
-
35
- function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
36
- return (
37
- <div
38
- data-slot="field-group"
39
- className={cn(
40
- "gap-4 data-[slot=checkbox-group]:gap-3 [&>[data-slot=field-group]]:gap-4 group/field-group @container/field-group flex w-full flex-col",
41
- className
42
- )}
43
- {...props}
44
- />
45
- )
46
- }
47
-
48
- const fieldVariants = cva("data-[invalid=true]:text-destructive gap-2 group/field flex w-full", {
49
- variants: {
50
- orientation: {
51
- vertical:
52
- "flex-col [&>*]:w-full [&>.sr-only]:w-auto",
53
- horizontal:
54
- "flex-row items-center [&>[data-slot=field-label]]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
55
- responsive:
56
- "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto @md/field-group:[&>[data-slot=field-label]]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
57
- },
58
- },
59
- defaultVariants: {
60
- orientation: "vertical",
61
- },
62
- })
63
-
64
- function Field({
65
- className,
66
- orientation = "vertical",
67
- ...props
68
- }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {
69
- return (
70
- <div
71
- role="group"
72
- data-slot="field"
73
- data-orientation={orientation}
74
- className={cn(fieldVariants({ orientation }), className)}
75
- {...props}
76
- />
77
- )
78
- }
79
-
80
- function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
81
- return (
82
- <div
83
- data-slot="field-content"
84
- className={cn(
85
- "gap-0.5 group/field-content flex flex-1 flex-col leading-snug",
86
- className
87
- )}
88
- {...props}
89
- />
90
- )
91
- }
92
-
93
- function FieldLabel({
94
- className,
95
- ...props
96
- }: React.ComponentProps<typeof Label>) {
97
- return (
98
- <Label
99
- data-slot="field-label"
100
- className={cn(
101
- "has-data-checked:bg-primary/5 dark:has-data-checked:bg-primary/10 gap-2 group-data-[disabled=true]/field:opacity-50 has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-2 group/field-label peer/field-label flex w-fit leading-snug",
102
- "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col",
103
- className
104
- )}
105
- {...props}
106
- />
107
- )
108
- }
109
-
110
- function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
111
- return (
112
- <div
113
- data-slot="field-label"
114
- className={cn(
115
- "gap-2 text-xs/relaxed font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug",
116
- className
117
- )}
118
- {...props}
119
- />
120
- )
121
- }
122
-
123
- function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
124
- return (
125
- <p
126
- data-slot="field-description"
127
- className={cn(
128
- "text-muted-foreground text-left text-xs/relaxed [[data-variant=legend]+&]:-mt-1.5 leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
129
- "last:mt-0 nth-last-2:-mt-1",
130
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
131
- className
132
- )}
133
- {...props}
134
- />
135
- )
136
- }
137
-
138
- function FieldSeparator({
139
- children,
140
- className,
141
- ...props
142
- }: React.ComponentProps<"div"> & {
143
- children?: React.ReactNode
144
- }) {
145
- return (
146
- <div
147
- data-slot="field-separator"
148
- data-content={!!children}
149
- className={cn("-my-2 h-5 text-xs/relaxed group-data-[variant=outline]/field-group:-mb-2 relative", className)}
150
- {...props}
151
- >
152
- <Separator className="absolute inset-0 top-1/2" />
153
- {children && (
154
- <span
155
- className="text-muted-foreground px-2 bg-background relative mx-auto block w-fit"
156
- data-slot="field-separator-content"
157
- >
158
- {children}
159
- </span>
160
- )}
161
- </div>
162
- )
163
- }
164
-
165
- function FieldError({
166
- className,
167
- children,
168
- errors,
169
- ...props
170
- }: React.ComponentProps<"div"> & {
171
- errors?: Array<{ message?: string } | undefined>
172
- }) {
173
- const content = useMemo(() => {
174
- if (children) {
175
- return children
176
- }
177
-
178
- if (!errors?.length) {
179
- return null
180
- }
181
-
182
- const uniqueErrors = [
183
- ...new Map(errors.map((error) => [error?.message, error])).values(),
184
- ]
185
-
186
- if (uniqueErrors?.length == 1) {
187
- return uniqueErrors[0]?.message
188
- }
189
-
190
- return (
191
- <ul className="ml-4 flex list-disc flex-col gap-1">
192
- {uniqueErrors.map(
193
- (error, index) =>
194
- error?.message && <li key={index}>{error.message}</li>
195
- )}
196
- </ul>
197
- )
198
- }, [children, errors])
199
-
200
- if (!content) {
201
- return null
202
- }
203
-
204
- return (
205
- <div
206
- role="alert"
207
- data-slot="field-error"
208
- className={cn("text-destructive text-xs/relaxed font-normal", className)}
209
- {...props}
210
- >
211
- {content}
212
- </div>
213
- )
214
- }
215
-
216
- export {
217
- Field,
218
- FieldLabel,
219
- FieldDescription,
220
- FieldError,
221
- FieldGroup,
222
- FieldLegend,
223
- FieldSeparator,
224
- FieldSet,
225
- FieldContent,
226
- FieldTitle,
227
- }
@@ -1,149 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
-
6
- import { cn } from "../../lib/utils"
7
- import { Button } from "./button"
8
- import { Input } from "./input"
9
- import { Textarea } from "./textarea"
10
-
11
- function InputGroup({ className, ...props }: React.ComponentProps<"div">) {
12
- return (
13
- <div
14
- data-slot="input-group"
15
- role="group"
16
- className={cn(
17
- "border-input bg-input/20 dark:bg-input/30 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-ring/30 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[[data-slot][aria-invalid=true]]:border-destructive dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 h-7 rounded-md border transition-colors has-data-[align=block-end]:rounded-md has-data-[align=block-start]:rounded-md has-[[data-slot=input-group-control]:focus-visible]:ring-[2px] has-[[data-slot][aria-invalid=true]]:ring-[2px] has-[textarea]:rounded-md has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5 [[data-slot=combobox-content]_&]:focus-within:border-inherit [[data-slot=combobox-content]_&]:focus-within:ring-0 group/input-group relative flex w-full min-w-0 items-center outline-none has-[>textarea]:h-auto",
18
- className
19
- )}
20
- {...props}
21
- />
22
- )
23
- }
24
-
25
- const inputGroupAddonVariants = cva(
26
- "text-muted-foreground **:data-[slot=kbd]:bg-muted-foreground/10 h-auto gap-1 py-2 text-xs/relaxed font-medium group-data-[disabled=true]/input-group:opacity-50 **:data-[slot=kbd]:rounded-[calc(var(--radius-sm)-2px)] **:data-[slot=kbd]:px-1 **:data-[slot=kbd]:text-[0.625rem] [&>svg:not([class*='size-'])]:size-3.5 flex cursor-text items-center justify-center select-none",
27
- {
28
- variants: {
29
- align: {
30
- "inline-start": "pl-2 has-[>button]:ml-[-0.275rem] has-[>kbd]:ml-[-0.275rem] order-first",
31
- "inline-end": "pr-2 has-[>button]:mr-[-0.275rem] has-[>kbd]:mr-[-0.275rem] order-last",
32
- "block-start":
33
- "px-2 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2 order-first w-full justify-start",
34
- "block-end":
35
- "px-2 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2 order-last w-full justify-start",
36
- },
37
- },
38
- defaultVariants: {
39
- align: "inline-start",
40
- },
41
- }
42
- )
43
-
44
- function InputGroupAddon({
45
- className,
46
- align = "inline-start",
47
- ...props
48
- }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>) {
49
- return (
50
- <div
51
- role="group"
52
- data-slot="input-group-addon"
53
- data-align={align}
54
- className={cn(inputGroupAddonVariants({ align }), className)}
55
- onClick={(e) => {
56
- if ((e.target as HTMLElement).closest("button")) {
57
- return
58
- }
59
- e.currentTarget.parentElement?.querySelector("input")?.focus()
60
- }}
61
- {...props}
62
- />
63
- )
64
- }
65
-
66
- const inputGroupButtonVariants = cva(
67
- "gap-2 rounded-md text-xs/relaxed shadow-none flex items-center",
68
- {
69
- variants: {
70
- size: {
71
- xs: "h-5 gap-1 rounded-[calc(var(--radius-sm)-2px)] px-1 [&>svg:not([class*='size-'])]:size-3",
72
- sm: "",
73
- "icon-xs": "size-6 p-0 has-[>svg]:p-0",
74
- "icon-sm": "size-8 p-0 has-[>svg]:p-0",
75
- },
76
- },
77
- defaultVariants: {
78
- size: "xs",
79
- },
80
- }
81
- )
82
-
83
- function InputGroupButton({
84
- className,
85
- type = "button",
86
- variant = "ghost",
87
- size = "xs",
88
- ...props
89
- }: Omit<React.ComponentProps<typeof Button>, "size" | "type"> &
90
- VariantProps<typeof inputGroupButtonVariants> & {
91
- type?: "button" | "submit" | "reset"
92
- }) {
93
- return (
94
- <Button
95
- type={type}
96
- data-size={size}
97
- variant={variant}
98
- className={cn(inputGroupButtonVariants({ size }), className)}
99
- {...props}
100
- />
101
- )
102
- }
103
-
104
- function InputGroupText({ className, ...props }: React.ComponentProps<"span">) {
105
- return (
106
- <span
107
- className={cn(
108
- "text-muted-foreground gap-2 text-xs/relaxed [&_svg:not([class*='size-'])]:size-4 flex items-center [&_svg]:pointer-events-none",
109
- className
110
- )}
111
- {...props}
112
- />
113
- )
114
- }
115
-
116
- function InputGroupInput({
117
- className,
118
- ...props
119
- }: React.ComponentProps<"input">) {
120
- return (
121
- <Input
122
- data-slot="input-group-control"
123
- className={cn("rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1", className)}
124
- {...props}
125
- />
126
- )
127
- }
128
-
129
- function InputGroupTextarea({
130
- className,
131
- ...props
132
- }: React.ComponentProps<"textarea">) {
133
- return (
134
- <Textarea
135
- data-slot="input-group-control"
136
- className={cn("rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 aria-invalid:ring-0 dark:bg-transparent flex-1 resize-none", className)}
137
- {...props}
138
- />
139
- )
140
- }
141
-
142
- export {
143
- InputGroup,
144
- InputGroupAddon,
145
- InputGroupButton,
146
- InputGroupText,
147
- InputGroupInput,
148
- InputGroupTextarea,
149
- }
@@ -1,20 +0,0 @@
1
- import * as React from "react"
2
- import { Input as InputPrimitive } from "@base-ui/react/input"
3
-
4
- import { cn } from "../../lib/utils"
5
-
6
- function Input({ className, type, ...props }: React.ComponentProps<"input">) {
7
- return (
8
- <InputPrimitive
9
- type={type}
10
- data-slot="input"
11
- className={cn(
12
- "bg-input/20 dark:bg-input/30 border-input focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 h-7 rounded-md border px-2 py-0.5 text-sm transition-colors file:h-6 file:text-xs/relaxed file:font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] md:text-xs/relaxed file:text-foreground placeholder:text-muted-foreground w-full min-w-0 outline-none file:inline-flex file:border-0 file:bg-transparent disabled:pointer-events-none disabled:cursor-not-allowed disabled:opacity-50",
13
- className
14
- )}
15
- {...props}
16
- />
17
- )
18
- }
19
-
20
- export { Input }
@@ -1,18 +0,0 @@
1
- import * as React from "react"
2
-
3
- import { cn } from "../../lib/utils"
4
-
5
- function Label({ className, ...props }: React.ComponentProps<"label">) {
6
- return (
7
- <label
8
- data-slot="label"
9
- className={cn(
10
- "gap-2 text-xs/relaxed leading-none font-medium group-data-[disabled=true]:opacity-50 peer-disabled:opacity-50 flex items-center select-none group-data-[disabled=true]:pointer-events-none peer-disabled:cursor-not-allowed",
11
- className
12
- )}
13
- {...props}
14
- />
15
- )
16
- }
17
-
18
- export { Label }
@@ -1,88 +0,0 @@
1
- import * as React from "react"
2
- import { Popover as PopoverPrimitive } from "@base-ui/react/popover"
3
-
4
- import { cn } from "../../lib/utils"
5
-
6
- function Popover({ ...props }: PopoverPrimitive.Root.Props) {
7
- return <PopoverPrimitive.Root data-slot="popover" {...props} />
8
- }
9
-
10
- function PopoverTrigger({ ...props }: PopoverPrimitive.Trigger.Props) {
11
- return <PopoverPrimitive.Trigger data-slot="popover-trigger" {...props} />
12
- }
13
-
14
- function PopoverContent({
15
- className,
16
- align = "center",
17
- alignOffset = 0,
18
- side = "bottom",
19
- sideOffset = 4,
20
- ...props
21
- }: PopoverPrimitive.Popup.Props &
22
- Pick<
23
- PopoverPrimitive.Positioner.Props,
24
- "align" | "alignOffset" | "side" | "sideOffset"
25
- >) {
26
- return (
27
- <PopoverPrimitive.Portal>
28
- <PopoverPrimitive.Positioner
29
- align={align}
30
- alignOffset={alignOffset}
31
- side={side}
32
- sideOffset={sideOffset}
33
- className="isolate z-50"
34
- >
35
- <PopoverPrimitive.Popup
36
- data-slot="popover-content"
37
- className={cn(
38
- "bg-popover text-popover-foreground data-open:animate-in data-closed:animate-out data-closed:fade-out-0 data-open:fade-in-0 data-closed:zoom-out-95 data-open:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 ring-foreground/10 flex flex-col gap-4 rounded-lg p-2.5 text-xs shadow-md ring-1 duration-100 z-50 w-72 origin-(--transform-origin) outline-hidden",
39
- className
40
- )}
41
- {...props}
42
- />
43
- </PopoverPrimitive.Positioner>
44
- </PopoverPrimitive.Portal>
45
- )
46
- }
47
-
48
- function PopoverHeader({ className, ...props }: React.ComponentProps<"div">) {
49
- return (
50
- <div
51
- data-slot="popover-header"
52
- className={cn("flex flex-col gap-1 text-xs", className)}
53
- {...props}
54
- />
55
- )
56
- }
57
-
58
- function PopoverTitle({ className, ...props }: PopoverPrimitive.Title.Props) {
59
- return (
60
- <PopoverPrimitive.Title
61
- data-slot="popover-title"
62
- className={cn("text-sm font-medium", className)}
63
- {...props}
64
- />
65
- )
66
- }
67
-
68
- function PopoverDescription({
69
- className,
70
- ...props
71
- }: PopoverPrimitive.Description.Props) {
72
- return (
73
- <PopoverPrimitive.Description
74
- data-slot="popover-description"
75
- className={cn("text-muted-foreground", className)}
76
- {...props}
77
- />
78
- )
79
- }
80
-
81
- export {
82
- Popover,
83
- PopoverContent,
84
- PopoverDescription,
85
- PopoverHeader,
86
- PopoverTitle,
87
- PopoverTrigger,
88
- }
@@ -1,53 +0,0 @@
1
- import * as React from "react"
2
- import { ScrollArea as ScrollAreaPrimitive } from "@base-ui/react/scroll-area"
3
-
4
- import { cn } from "../../lib/utils"
5
-
6
- function ScrollArea({
7
- className,
8
- children,
9
- ...props
10
- }: ScrollAreaPrimitive.Root.Props) {
11
- return (
12
- <ScrollAreaPrimitive.Root
13
- data-slot="scroll-area"
14
- className={cn("relative", className)}
15
- {...props}
16
- >
17
- <ScrollAreaPrimitive.Viewport
18
- data-slot="scroll-area-viewport"
19
- className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
20
- >
21
- {children}
22
- </ScrollAreaPrimitive.Viewport>
23
- <ScrollBar />
24
- <ScrollAreaPrimitive.Corner />
25
- </ScrollAreaPrimitive.Root>
26
- )
27
- }
28
-
29
- function ScrollBar({
30
- className,
31
- orientation = "vertical",
32
- ...props
33
- }: ScrollAreaPrimitive.Scrollbar.Props) {
34
- return (
35
- <ScrollAreaPrimitive.Scrollbar
36
- data-slot="scroll-area-scrollbar"
37
- data-orientation={orientation}
38
- orientation={orientation}
39
- className={cn(
40
- "data-horizontal:h-2.5 data-horizontal:flex-col data-horizontal:border-t data-horizontal:border-t-transparent data-vertical:h-full data-vertical:w-2.5 data-vertical:border-l data-vertical:border-l-transparent flex touch-none p-px transition-colors select-none",
41
- className
42
- )}
43
- {...props}
44
- >
45
- <ScrollAreaPrimitive.Thumb
46
- data-slot="scroll-area-thumb"
47
- className="rounded-full bg-border relative flex-1"
48
- />
49
- </ScrollAreaPrimitive.Scrollbar>
50
- )
51
- }
52
-
53
- export { ScrollArea, ScrollBar }