@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,235 +0,0 @@
1
- import type { ReactNode } from "react";
2
-
3
- // =============================================================================
4
- // Base Props (shared by all primitives)
5
- // =============================================================================
6
-
7
- export interface BasePrimitiveProps {
8
- /** Unique identifier */
9
- id?: string;
10
- /** Placeholder text */
11
- placeholder?: string;
12
- /** Disabled state */
13
- disabled?: boolean;
14
- /** Read-only state */
15
- readOnly?: boolean;
16
- /** Additional class names */
17
- className?: string;
18
- /** aria-invalid for error state */
19
- "aria-invalid"?: boolean;
20
- }
21
-
22
- // =============================================================================
23
- // Text Inputs
24
- // =============================================================================
25
-
26
- export interface TextInputProps extends BasePrimitiveProps {
27
- value: string;
28
- onChange: (value: string) => void;
29
- type?: "text" | "email" | "password" | "url" | "tel" | "search";
30
- maxLength?: number;
31
- autoComplete?: string;
32
- }
33
-
34
- export interface NumberInputProps extends BasePrimitiveProps {
35
- value: number | null;
36
- onChange: (value: number | null) => void;
37
- min?: number;
38
- max?: number;
39
- step?: number;
40
- /** Show increment/decrement buttons */
41
- showButtons?: boolean;
42
- }
43
-
44
- export interface TextareaInputProps extends BasePrimitiveProps {
45
- value: string;
46
- onChange: (value: string) => void;
47
- rows?: number;
48
- maxLength?: number;
49
- autoResize?: boolean;
50
- }
51
-
52
- // =============================================================================
53
- // Select / Multi-Select
54
- // =============================================================================
55
-
56
- export interface SelectOption<TValue = string> {
57
- value: TValue;
58
- label: string;
59
- disabled?: boolean;
60
- icon?: ReactNode;
61
- }
62
-
63
- export interface SelectOptionGroup<TValue = string> {
64
- label: string;
65
- options: SelectOption<TValue>[];
66
- }
67
-
68
- export type SelectOptions<TValue = string> =
69
- | SelectOption<TValue>[]
70
- | SelectOptionGroup<TValue>[];
71
-
72
- /**
73
- * Unified Select Input props
74
- * - multiple: false (default) = single select (dropdown)
75
- * - multiple: true = multi-select with chips
76
- *
77
- * Both modes support:
78
- * - Static options array
79
- * - Dynamic loading via loadOptions
80
- * - Search/filtering
81
- */
82
- export interface SelectInputProps<TValue = string> extends BasePrimitiveProps {
83
- /** Selected value(s) */
84
- value: TValue | TValue[] | null;
85
- /** Change handler */
86
- onChange: (value: TValue | TValue[] | null) => void;
87
- /** Static options */
88
- options?: SelectOptions<TValue>;
89
- /** Dynamic options loader */
90
- loadOptions?: (search: string) => Promise<SelectOption<TValue>[]>;
91
- /** Allow multiple selections */
92
- multiple?: boolean;
93
- /** Allow clearing selection */
94
- clearable?: boolean;
95
- /** Max selections (for multiple mode) */
96
- maxSelections?: number;
97
- /** Debounce delay for loadOptions (ms) */
98
- debounceMs?: number;
99
- /** Loading state */
100
- loading?: boolean;
101
- /** Empty state message */
102
- emptyMessage?: string;
103
- }
104
-
105
- // =============================================================================
106
- // Boolean Inputs
107
- // =============================================================================
108
-
109
- export interface ToggleInputProps extends BasePrimitiveProps {
110
- value: boolean;
111
- onChange: (value: boolean) => void;
112
- /** Size variant */
113
- size?: "sm" | "default" | "lg";
114
- }
115
-
116
- export interface CheckboxInputProps extends BasePrimitiveProps {
117
- value: boolean;
118
- onChange: (value: boolean) => void;
119
- /** Indeterminate state */
120
- indeterminate?: boolean;
121
- }
122
-
123
- export interface CheckboxGroupProps<TValue = string>
124
- extends BasePrimitiveProps {
125
- value: TValue[];
126
- onChange: (value: TValue[]) => void;
127
- options: SelectOption<TValue>[];
128
- /** Layout direction */
129
- orientation?: "horizontal" | "vertical";
130
- }
131
-
132
- export interface RadioGroupProps<TValue = string> extends BasePrimitiveProps {
133
- value: TValue | null;
134
- onChange: (value: TValue) => void;
135
- options: SelectOption<TValue>[];
136
- orientation?: "horizontal" | "vertical";
137
- }
138
-
139
- // =============================================================================
140
- // Date/Time Inputs
141
- // =============================================================================
142
-
143
- export interface DateInputProps extends BasePrimitiveProps {
144
- value: Date | null;
145
- onChange: (value: Date | null) => void;
146
- /** Minimum date */
147
- minDate?: Date;
148
- /** Maximum date */
149
- maxDate?: Date;
150
- /** Date format display */
151
- format?: string;
152
- }
153
-
154
- export interface DateTimeInputProps extends DateInputProps {
155
- /** Time precision */
156
- precision?: "minute" | "second";
157
- }
158
-
159
- export interface TimeInputProps extends BasePrimitiveProps {
160
- value: string | null; // "HH:mm" or "HH:mm:ss"
161
- onChange: (value: string | null) => void;
162
- precision?: "minute" | "second";
163
- }
164
-
165
- export interface DateRangeInputProps extends BasePrimitiveProps {
166
- value: { start: Date | null; end: Date | null };
167
- onChange: (value: { start: Date | null; end: Date | null }) => void;
168
- minDate?: Date;
169
- maxDate?: Date;
170
- }
171
-
172
- // =============================================================================
173
- // Special Inputs
174
- // =============================================================================
175
-
176
- export interface TagInputProps extends BasePrimitiveProps {
177
- value: string[];
178
- onChange: (value: string[]) => void;
179
- /** Suggestions for autocomplete */
180
- suggestions?: string[];
181
- /** Max tags */
182
- maxTags?: number;
183
- /** Allow duplicates */
184
- allowDuplicates?: boolean;
185
- /** Validation pattern */
186
- pattern?: RegExp;
187
- }
188
-
189
- export interface ColorInputProps extends BasePrimitiveProps {
190
- value: string; // hex color
191
- onChange: (value: string) => void;
192
- /** Preset colors */
193
- presets?: string[];
194
- /** Allow alpha */
195
- alpha?: boolean;
196
- }
197
-
198
- export interface SliderInputProps extends BasePrimitiveProps {
199
- value: number | [number, number];
200
- onChange: (value: number | [number, number]) => void;
201
- min: number;
202
- max: number;
203
- step?: number;
204
- /** Show value label */
205
- showValue?: boolean;
206
- }
207
-
208
- export interface JsonEditorProps extends BasePrimitiveProps {
209
- value: unknown;
210
- onChange: (value: unknown) => void;
211
- /** Max height */
212
- maxHeight?: string;
213
- /** Line numbers */
214
- showLineNumbers?: boolean;
215
- /** Schema for validation */
216
- schema?: unknown;
217
- }
218
-
219
- // =============================================================================
220
- // Utility Types
221
- // =============================================================================
222
-
223
- /** Check if options are grouped */
224
- export function isOptionGroup<T>(
225
- option: SelectOption<T> | SelectOptionGroup<T>,
226
- ): option is SelectOptionGroup<T> {
227
- return "options" in option;
228
- }
229
-
230
- /** Flatten grouped options */
231
- export function flattenOptions<T>(
232
- options: SelectOptions<T>,
233
- ): SelectOption<T>[] {
234
- return options.flatMap((opt) => (isOptionGroup(opt) ? opt.options : [opt]));
235
- }
@@ -1,72 +0,0 @@
1
- import { Accordion as AccordionPrimitive } from "@base-ui/react/accordion"
2
-
3
- import { cn } from "../../lib/utils"
4
- import { CaretDownIcon, CaretUpIcon } from "@phosphor-icons/react"
5
-
6
- function Accordion({ className, ...props }: AccordionPrimitive.Root.Props) {
7
- return (
8
- <AccordionPrimitive.Root
9
- data-slot="accordion"
10
- className={cn("overflow-hidden rounded-md border flex w-full flex-col", className)}
11
- {...props}
12
- />
13
- )
14
- }
15
-
16
- function AccordionItem({ className, ...props }: AccordionPrimitive.Item.Props) {
17
- return (
18
- <AccordionPrimitive.Item
19
- data-slot="accordion-item"
20
- className={cn("data-open:bg-muted/50 not-last:border-b", className)}
21
- {...props}
22
- />
23
- )
24
- }
25
-
26
- function AccordionTrigger({
27
- className,
28
- children,
29
- ...props
30
- }: AccordionPrimitive.Trigger.Props) {
31
- return (
32
- <AccordionPrimitive.Header className="flex">
33
- <AccordionPrimitive.Trigger
34
- data-slot="accordion-trigger"
35
- className={cn(
36
- "**:data-[slot=accordion-trigger-icon]:text-muted-foreground gap-6 p-2 text-left text-xs/relaxed font-medium hover:underline **:data-[slot=accordion-trigger-icon]:ml-auto **:data-[slot=accordion-trigger-icon]:size-4 group/accordion-trigger relative flex flex-1 items-start justify-between border border-transparent transition-all outline-none disabled:pointer-events-none disabled:opacity-50",
37
- className
38
- )}
39
- {...props}
40
- >
41
- {children}
42
- <CaretDownIcon data-slot="accordion-trigger-icon" className="pointer-events-none shrink-0 group-aria-expanded/accordion-trigger:hidden" />
43
- <CaretUpIcon data-slot="accordion-trigger-icon" className="pointer-events-none hidden shrink-0 group-aria-expanded/accordion-trigger:inline" />
44
- </AccordionPrimitive.Trigger>
45
- </AccordionPrimitive.Header>
46
- )
47
- }
48
-
49
- function AccordionContent({
50
- className,
51
- children,
52
- ...props
53
- }: AccordionPrimitive.Panel.Props) {
54
- return (
55
- <AccordionPrimitive.Panel
56
- data-slot="accordion-content"
57
- className="data-open:animate-accordion-down data-closed:animate-accordion-up px-2 text-xs/relaxed overflow-hidden"
58
- {...props}
59
- >
60
- <div
61
- className={cn(
62
- "pt-0 pb-4 [&_a]:hover:text-foreground h-(--accordion-panel-height) data-ending-style:h-0 data-starting-style:h-0 [&_a]:underline [&_a]:underline-offset-3 [&_p:not(:last-child)]:mb-4",
63
- className
64
- )}
65
- >
66
- {children}
67
- </div>
68
- </AccordionPrimitive.Panel>
69
- )
70
- }
71
-
72
- export { Accordion, AccordionItem, AccordionTrigger, AccordionContent }
@@ -1,106 +0,0 @@
1
- "use client"
2
-
3
- import * as React from "react"
4
- import { Avatar as AvatarPrimitive } from "@base-ui/react/avatar"
5
-
6
- import { cn } from "../../lib/utils"
7
-
8
- function Avatar({
9
- className,
10
- size = "default",
11
- ...props
12
- }: AvatarPrimitive.Root.Props & {
13
- size?: "default" | "sm" | "lg"
14
- }) {
15
- return (
16
- <AvatarPrimitive.Root
17
- data-slot="avatar"
18
- data-size={size}
19
- className={cn(
20
- "size-8 rounded-full after:rounded-full data-[size=lg]:size-10 data-[size=sm]:size-6 after:border-border group/avatar relative flex shrink-0 select-none after:absolute after:inset-0 after:border after:mix-blend-darken dark:after:mix-blend-lighten",
21
- className
22
- )}
23
- {...props}
24
- />
25
- )
26
- }
27
-
28
- function AvatarImage({ className, ...props }: AvatarPrimitive.Image.Props) {
29
- return (
30
- <AvatarPrimitive.Image
31
- data-slot="avatar-image"
32
- className={cn(
33
- "rounded-full aspect-square size-full object-cover",
34
- className
35
- )}
36
- {...props}
37
- />
38
- )
39
- }
40
-
41
- function AvatarFallback({
42
- className,
43
- ...props
44
- }: AvatarPrimitive.Fallback.Props) {
45
- return (
46
- <AvatarPrimitive.Fallback
47
- data-slot="avatar-fallback"
48
- className={cn(
49
- "bg-muted text-muted-foreground rounded-full flex size-full items-center justify-center text-sm group-data-[size=sm]/avatar:text-xs",
50
- className
51
- )}
52
- {...props}
53
- />
54
- )
55
- }
56
-
57
- function AvatarBadge({ className, ...props }: React.ComponentProps<"span">) {
58
- return (
59
- <span
60
- data-slot="avatar-badge"
61
- className={cn(
62
- "bg-primary text-primary-foreground ring-background absolute right-0 bottom-0 z-10 inline-flex items-center justify-center rounded-full bg-blend-color ring-2 select-none",
63
- "group-data-[size=sm]/avatar:size-2 group-data-[size=sm]/avatar:[&>svg]:hidden",
64
- "group-data-[size=default]/avatar:size-2.5 group-data-[size=default]/avatar:[&>svg]:size-2",
65
- "group-data-[size=lg]/avatar:size-3 group-data-[size=lg]/avatar:[&>svg]:size-2",
66
- className
67
- )}
68
- {...props}
69
- />
70
- )
71
- }
72
-
73
- function AvatarGroup({ className, ...props }: React.ComponentProps<"div">) {
74
- return (
75
- <div
76
- data-slot="avatar-group"
77
- className={cn(
78
- "*:data-[slot=avatar]:ring-background group/avatar-group flex -space-x-2 *:data-[slot=avatar]:ring-2",
79
- className
80
- )}
81
- {...props}
82
- />
83
- )
84
- }
85
-
86
- function AvatarGroupCount({
87
- className,
88
- ...props
89
- }: React.ComponentProps<"div">) {
90
- return (
91
- <div
92
- data-slot="avatar-group-count"
93
- className={cn("bg-muted text-muted-foreground size-8 rounded-full text-xs/relaxed 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 ring-background relative flex shrink-0 items-center justify-center ring-2", className)}
94
- {...props}
95
- />
96
- )
97
- }
98
-
99
- export {
100
- Avatar,
101
- AvatarImage,
102
- AvatarFallback,
103
- AvatarGroup,
104
- AvatarGroupCount,
105
- AvatarBadge,
106
- }
@@ -1,48 +0,0 @@
1
- import { mergeProps } from "@base-ui/react/merge-props"
2
- import { useRender } from "@base-ui/react/use-render"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
-
5
- import { cn } from "../../lib/utils"
6
-
7
- const badgeVariants = cva(
8
- "h-5 gap-1 rounded-full border border-transparent px-2 py-0.5 text-[0.625rem] font-medium transition-all has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&>svg]:size-2.5! inline-flex items-center justify-center w-fit whitespace-nowrap shrink-0 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-colors overflow-hidden group/badge",
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: "bg-destructive/10 [a]:hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 text-destructive dark:bg-destructive/20",
15
- outline: "border-border text-foreground [a]:hover:bg-muted [a]:hover:text-muted-foreground bg-input/20 dark:bg-input/30",
16
- ghost: "hover:bg-muted hover:text-muted-foreground dark:hover:bg-muted/50",
17
- link: "text-primary underline-offset-4 hover:underline",
18
- },
19
- },
20
- defaultVariants: {
21
- variant: "default",
22
- },
23
- }
24
- )
25
-
26
- function Badge({
27
- className,
28
- variant = "default",
29
- render,
30
- ...props
31
- }: useRender.ComponentProps<"span"> & VariantProps<typeof badgeVariants>) {
32
- return useRender({
33
- defaultTagName: "span",
34
- props: mergeProps<"span">(
35
- {
36
- className: cn(badgeVariants({ className, variant })),
37
- },
38
- props
39
- ),
40
- render,
41
- state: {
42
- slot: "badge",
43
- variant,
44
- },
45
- })
46
- }
47
-
48
- export { Badge, badgeVariants }
@@ -1,53 +0,0 @@
1
- "use client"
2
-
3
- import { Button as ButtonPrimitive } from "@base-ui/react/button"
4
- import { cva, type VariantProps } from "class-variance-authority"
5
-
6
- import { cn } from "../../lib/utils"
7
-
8
- const buttonVariants = cva(
9
- "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 rounded-md border border-transparent bg-clip-padding text-xs/relaxed font-medium focus-visible:ring-[2px] aria-invalid:ring-[2px] [&_svg:not([class*='size-'])]:size-4 inline-flex items-center justify-center whitespace-nowrap transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none shrink-0 [&_svg]:shrink-0 outline-none group/button select-none",
10
- {
11
- variants: {
12
- variant: {
13
- default: "bg-primary text-primary-foreground hover:bg-primary/80",
14
- outline: "border-border dark:bg-input/30 hover:bg-input/50 hover:text-foreground aria-expanded:bg-muted aria-expanded:text-foreground",
15
- secondary: "bg-secondary text-secondary-foreground hover:bg-secondary/80 aria-expanded:bg-secondary aria-expanded:text-secondary-foreground",
16
- ghost: "hover:bg-muted hover:text-foreground dark:hover:bg-muted/50 aria-expanded:bg-muted aria-expanded:text-foreground",
17
- destructive: "bg-destructive/10 hover:bg-destructive/20 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/20 text-destructive focus-visible:border-destructive/40 dark:hover:bg-destructive/30",
18
- link: "text-primary underline-offset-4 hover:underline",
19
- },
20
- size: {
21
- default: "h-7 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3.5",
22
- xs: "h-5 gap-1 rounded-sm px-2 text-[0.625rem] has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-2.5",
23
- sm: "h-6 gap-1 px-2 text-xs/relaxed has-data-[icon=inline-end]:pr-1.5 has-data-[icon=inline-start]:pl-1.5 [&_svg:not([class*='size-'])]:size-3",
24
- lg: "h-8 gap-1 px-2.5 text-xs/relaxed has-data-[icon=inline-end]:pr-2 has-data-[icon=inline-start]:pl-2 [&_svg:not([class*='size-'])]:size-4",
25
- icon: "size-7 [&_svg:not([class*='size-'])]:size-3.5",
26
- "icon-xs": "size-5 rounded-sm [&_svg:not([class*='size-'])]:size-2.5",
27
- "icon-sm": "size-6 [&_svg:not([class*='size-'])]:size-3",
28
- "icon-lg": "size-8 [&_svg:not([class*='size-'])]:size-4",
29
- },
30
- },
31
- defaultVariants: {
32
- variant: "default",
33
- size: "default",
34
- },
35
- }
36
- )
37
-
38
- function Button({
39
- className,
40
- variant = "default",
41
- size = "default",
42
- ...props
43
- }: ButtonPrimitive.Props & VariantProps<typeof buttonVariants>) {
44
- return (
45
- <ButtonPrimitive
46
- data-slot="button"
47
- className={cn(buttonVariants({ variant, size, className }))}
48
- {...props}
49
- />
50
- )
51
- }
52
-
53
- export { Button, buttonVariants }
@@ -1,94 +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("ring-foreground/10 bg-card text-card-foreground gap-4 overflow-hidden rounded-lg py-4 text-xs/relaxed ring-1 has-[>img:first-child]:pt-0 data-[size=sm]:gap-3 data-[size=sm]:py-3 *:[img:first-child]:rounded-t-lg *:[img:last-child]:rounded-b-lg group/card flex flex-col", className)}
15
- {...props}
16
- />
17
- )
18
- }
19
-
20
- function CardHeader({ className, ...props }: React.ComponentProps<"div">) {
21
- return (
22
- <div
23
- data-slot="card-header"
24
- className={cn(
25
- "gap-1 rounded-t-lg px-4 group-data-[size=sm]/card:px-3 [.border-b]:pb-4 group-data-[size=sm]/card:[.border-b]:pb-3 group/card-header @container/card-header grid auto-rows-min items-start has-data-[slot=card-action]:grid-cols-[1fr_auto] has-data-[slot=card-description]:grid-rows-[auto_auto]",
26
- className
27
- )}
28
- {...props}
29
- />
30
- )
31
- }
32
-
33
- function CardTitle({ className, ...props }: React.ComponentProps<"div">) {
34
- return (
35
- <div
36
- data-slot="card-title"
37
- className={cn("text-sm font-medium", className)}
38
- {...props}
39
- />
40
- )
41
- }
42
-
43
- function CardDescription({ className, ...props }: React.ComponentProps<"div">) {
44
- return (
45
- <div
46
- data-slot="card-description"
47
- className={cn("text-muted-foreground text-xs/relaxed", className)}
48
- {...props}
49
- />
50
- )
51
- }
52
-
53
- function CardAction({ className, ...props }: React.ComponentProps<"div">) {
54
- return (
55
- <div
56
- data-slot="card-action"
57
- className={cn(
58
- "col-start-2 row-span-2 row-start-1 self-start justify-self-end",
59
- className
60
- )}
61
- {...props}
62
- />
63
- )
64
- }
65
-
66
- function CardContent({ className, ...props }: React.ComponentProps<"div">) {
67
- return (
68
- <div
69
- data-slot="card-content"
70
- className={cn("px-4 group-data-[size=sm]/card:px-3", className)}
71
- {...props}
72
- />
73
- )
74
- }
75
-
76
- function CardFooter({ className, ...props }: React.ComponentProps<"div">) {
77
- return (
78
- <div
79
- data-slot="card-footer"
80
- className={cn("rounded-b-lg px-4 group-data-[size=sm]/card:px-3 [.border-t]:pt-4 group-data-[size=sm]/card:[.border-t]:pt-3 flex items-center", className)}
81
- {...props}
82
- />
83
- )
84
- }
85
-
86
- export {
87
- Card,
88
- CardHeader,
89
- CardFooter,
90
- CardTitle,
91
- CardAction,
92
- CardDescription,
93
- CardContent,
94
- }
@@ -1,27 +0,0 @@
1
- import { Checkbox as CheckboxPrimitive } from "@base-ui/react/checkbox"
2
-
3
- import { cn } from "../../lib/utils"
4
- import { CheckIcon } from "@phosphor-icons/react"
5
-
6
- function Checkbox({ className, ...props }: CheckboxPrimitive.Root.Props) {
7
- return (
8
- <CheckboxPrimitive.Root
9
- data-slot="checkbox"
10
- className={cn(
11
- "border-input dark:bg-input/30 data-checked:bg-primary data-checked:text-primary-foreground dark:data-checked:bg-primary data-checked:border-primary aria-invalid:aria-checked:border-primary aria-invalid:border-destructive dark:aria-invalid:border-destructive/50 focus-visible:border-ring focus-visible:ring-ring/30 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 flex size-4 items-center justify-center rounded-[4px] border transition-shadow group-has-disabled/field:opacity-50 focus-visible:ring-[2px] aria-invalid:ring-[2px] peer relative shrink-0 outline-none after:absolute after:-inset-x-3 after:-inset-y-2 disabled:cursor-not-allowed disabled:opacity-50",
12
- className
13
- )}
14
- {...props}
15
- >
16
- <CheckboxPrimitive.Indicator
17
- data-slot="checkbox-indicator"
18
- className="[&>svg]:size-3.5 grid place-content-center text-current transition-none"
19
- >
20
- <CheckIcon
21
- />
22
- </CheckboxPrimitive.Indicator>
23
- </CheckboxPrimitive.Root>
24
- )
25
- }
26
-
27
- export { Checkbox }