@vritti/quantum-ui 0.1.23 → 0.2.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 (77) hide show
  1. package/dist/Button.d.ts +10 -3
  2. package/dist/Button.js +21 -36
  3. package/dist/Button.js.map +1 -1
  4. package/dist/Button2.js +42 -0
  5. package/dist/Button2.js.map +1 -0
  6. package/dist/Card.d.ts +8 -8
  7. package/dist/Card.js.map +1 -1
  8. package/dist/Checkbox.d.ts +5 -8
  9. package/dist/Checkbox.js +41 -30
  10. package/dist/Checkbox.js.map +1 -1
  11. package/dist/DatePicker.d.ts +4 -4
  12. package/dist/DatePicker.js +4055 -246
  13. package/dist/DatePicker.js.map +1 -1
  14. package/dist/Form.d.ts +70 -88
  15. package/dist/Form.js +34 -30
  16. package/dist/Form.js.map +1 -1
  17. package/dist/Label.js.map +1 -1
  18. package/dist/OTPField.js +2 -12
  19. package/dist/OTPField.js.map +1 -1
  20. package/dist/PasswordField.js.map +1 -1
  21. package/dist/PhoneField.js +6 -12
  22. package/dist/PhoneField.js.map +1 -1
  23. package/dist/Skeleton.d.ts +1 -1
  24. package/dist/Skeleton.js +2 -11
  25. package/dist/Skeleton.js.map +1 -1
  26. package/dist/Spinner.d.ts +14 -0
  27. package/dist/Spinner.js +31 -0
  28. package/dist/Spinner.js.map +1 -0
  29. package/dist/TextArea.js +4 -10
  30. package/dist/TextArea.js.map +1 -1
  31. package/dist/TextField.js +18 -2
  32. package/dist/TextField.js.map +1 -1
  33. package/dist/ThemeToggle.js.map +1 -1
  34. package/dist/Typography.js.map +1 -1
  35. package/dist/assets/quantum-ui.css +47 -31
  36. package/dist/axios.d.ts +1 -1
  37. package/dist/axios.js +18 -18
  38. package/dist/axios.js.map +1 -1
  39. package/dist/components/Button.js +2 -1
  40. package/dist/components/Button.js.map +1 -1
  41. package/dist/components/Form.js +1 -1
  42. package/dist/components/Progress.js +2 -5
  43. package/dist/components/Progress.js.map +1 -1
  44. package/dist/components/{DataTable.d.ts → Spinner.d.ts} +1 -1
  45. package/dist/components/Spinner.js +2 -0
  46. package/dist/components/Spinner.js.map +1 -0
  47. package/dist/createLucideIcon.js.map +1 -1
  48. package/dist/field.js +25 -143
  49. package/dist/field.js.map +1 -1
  50. package/dist/index.d.ts +110 -134
  51. package/dist/index.js +4 -3
  52. package/dist/index.js.map +1 -1
  53. package/dist/index2.js +54 -116
  54. package/dist/index2.js.map +1 -1
  55. package/dist/index3.js +103 -1
  56. package/dist/index3.js.map +1 -1
  57. package/dist/index4.js +31 -55
  58. package/dist/index4.js.map +1 -1
  59. package/dist/index5.js +86 -2
  60. package/dist/index5.js.map +1 -1
  61. package/dist/index6.js +1 -1
  62. package/dist/index6.js.map +1 -1
  63. package/dist/utils/axios.d.ts +1 -1
  64. package/dist/utils/axios.js +1 -1
  65. package/dist/utils.js.map +1 -1
  66. package/package.json +21 -19
  67. package/dist/Combination.js +0 -3869
  68. package/dist/Combination.js.map +0 -1
  69. package/dist/DataTable.d.ts +0 -31
  70. package/dist/DataTable.js +0 -4989
  71. package/dist/DataTable.js.map +0 -1
  72. package/dist/Input.js +0 -22
  73. package/dist/Input.js.map +0 -1
  74. package/dist/check.js +0 -15
  75. package/dist/check.js.map +0 -1
  76. package/dist/components/DataTable.js +0 -2
  77. package/dist/components/DataTable.js.map +0 -1
package/dist/index.d.ts CHANGED
@@ -1,8 +1,6 @@
1
1
  import { AxiosInstance } from 'axios';
2
2
  import * as CheckboxPrimitive from '@radix-ui/react-checkbox';
3
3
  import { ClassValue } from 'clsx';
4
- import { ColumnDef } from '@tanstack/react-table';
5
- import { ColumnFiltersState } from '@tanstack/react-table';
6
4
  import { Controller } from 'react-hook-form';
7
5
  import { Country } from 'react-phone-number-input';
8
6
  import { DayPicker } from 'react-day-picker';
@@ -13,14 +11,16 @@ import { JSX } from 'react/jsx-runtime';
13
11
  import * as LabelPrimitive from '@radix-ui/react-label';
14
12
  import { Value as PhoneValue } from 'react-phone-number-input';
15
13
  import * as React_2 from 'react';
16
- import { SortingState } from '@tanstack/react-table';
17
14
  import { UseFormReturn } from 'react-hook-form';
15
+ import { UseMutationResult } from '@tanstack/react-query';
18
16
  import { VariantProps } from 'class-variance-authority';
19
- import { VisibilityState } from '@tanstack/react-table';
20
17
 
21
18
  export declare interface AuthConfig {
22
19
  tokenHeaderName: string;
23
20
  tokenPrefix: string;
21
+ tokenEndpoint: string;
22
+ refreshEndpoint: string;
23
+ sessionRecoveryEnabled: boolean;
24
24
  }
25
25
 
26
26
  export declare const axios: AxiosInstance;
@@ -32,7 +32,9 @@ export declare interface AxiosConfig {
32
32
  headers?: Record<string, string>;
33
33
  }
34
34
 
35
- export declare function Button({
35
+ export declare const Button: React_2.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
36
+
37
+ declare function Button_2({
36
38
  className,
37
39
  variant,
38
40
  size,
@@ -44,7 +46,12 @@ VariantProps<typeof buttonVariants> & {
44
46
  }) {
45
47
  const Comp = asChild ? Slot : 'button';
46
48
 
47
- return <Comp data-slot='button' className={cn(buttonVariants({ variant, size, className }))} {...props} />;
49
+ return <Comp data-slot="button" className={cn(buttonVariants({ variant, size, className }))} {...props} />;
50
+ }
51
+
52
+ export declare interface ButtonProps extends React_2.ComponentProps<typeof Button_2> {
53
+ isLoading?: boolean;
54
+ loadingText?: string;
48
55
  }
49
56
 
50
57
  export declare const buttonVariants = cva(
@@ -72,19 +79,19 @@ export declare const buttonVariants = cva(
72
79
  variant: 'default',
73
80
  size: 'default',
74
81
  },
75
- }
82
+ },
76
83
  );
77
84
 
78
85
  declare type CalendarProps = React_2.ComponentProps<typeof DayPicker> & {
79
- buttonVariant?: React_2.ComponentProps<typeof Button>["variant"]
80
- }
86
+ buttonVariant?: React_2.ComponentProps<typeof Button_2>['variant'];
87
+ };
81
88
 
82
89
  export declare function cancelTokenRefresh(): void;
83
90
 
84
91
  export declare function Card({ className, ...props }: React_2.ComponentProps<'div'>) {
85
92
  return (
86
93
  <div
87
- data-slot='card'
94
+ data-slot="card"
88
95
  className={cn('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className)}
89
96
  {...props}
90
97
  />
@@ -92,26 +99,26 @@ export declare function Card({ className, ...props }: React_2.ComponentProps<'di
92
99
  }
93
100
 
94
101
  export declare function CardContent({ className, ...props }: React_2.ComponentProps<'div'>) {
95
- return <div data-slot='card-content' className={cn('px-6', className)} {...props} />;
102
+ return <div data-slot="card-content" className={cn('px-6', className)} {...props} />;
96
103
  }
97
104
 
98
105
  export declare function CardDescription({ className, ...props }: React_2.ComponentProps<'div'>) {
99
- return <div data-slot='card-description' className={cn('text-muted-foreground text-sm', className)} {...props} />;
106
+ return <div data-slot="card-description" className={cn('text-muted-foreground text-sm', className)} {...props} />;
100
107
  }
101
108
 
102
109
  export declare function CardFooter({ className, ...props }: React_2.ComponentProps<'div'>) {
103
110
  return (
104
- <div data-slot='card-footer' className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />
111
+ <div data-slot="card-footer" className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />
105
112
  );
106
113
  }
107
114
 
108
115
  export declare function CardHeader({ className, ...props }: React_2.ComponentProps<'div'>) {
109
116
  return (
110
117
  <div
111
- data-slot='card-header'
118
+ data-slot="card-header"
112
119
  className={cn(
113
120
  '@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6',
114
- className
121
+ className,
115
122
  )}
116
123
  {...props}
117
124
  />
@@ -119,21 +126,18 @@ export declare function CardHeader({ className, ...props }: React_2.ComponentPro
119
126
  }
120
127
 
121
128
  export declare function CardTitle({ className, ...props }: React_2.ComponentProps<'div'>) {
122
- return <div data-slot='card-title' className={cn('leading-none font-semibold', className)} {...props} />;
129
+ return <div data-slot="card-title" className={cn('leading-none font-semibold', className)} {...props} />;
123
130
  }
124
131
 
125
132
  export declare const Checkbox: default_2.ForwardRefExoticComponent<CheckboxProps & default_2.RefAttributes<HTMLButtonElement>>;
126
133
 
127
- declare function Checkbox_2({
128
- className,
129
- ...props
130
- }: React_2.ComponentProps<typeof CheckboxPrimitive.Root>) {
134
+ declare function Checkbox_2({ className, ...props }: React_2.ComponentProps<typeof CheckboxPrimitive.Root>) {
131
135
  return (
132
136
  <CheckboxPrimitive.Root
133
137
  data-slot="checkbox"
134
138
  className={cn(
135
- "peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50",
136
- className
139
+ 'peer border-input dark:bg-input/30 data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:data-[state=checked]:bg-primary data-[state=checked]:border-primary focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive size-4 shrink-0 rounded-[4px] border shadow-xs transition-shadow outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50',
140
+ className,
137
141
  )}
138
142
  {...props}
139
143
  >
@@ -144,7 +148,7 @@ declare function Checkbox_2({
144
148
  <CheckIcon className="size-3.5" />
145
149
  </CheckboxPrimitive.Indicator>
146
150
  </CheckboxPrimitive.Root>
147
- )
151
+ );
148
152
  }
149
153
 
150
154
  declare interface CheckboxProps extends default_2.ComponentPropsWithoutRef<typeof Checkbox_2> {
@@ -177,29 +181,6 @@ declare let currentConfig: {
177
181
  auth: AuthConfig;
178
182
  };
179
183
 
180
- export declare function DataTable<TData, TValue>({ columns, data, enablePagination, enableSorting, enableFiltering, filterColumn, filterPlaceholder, enableColumnVisibility, initialSorting, initialColumnFilters, initialColumnVisibility, pageSize, emptyMessage, className, }: DataTableProps<TData, TValue>): JSX.Element;
181
-
182
- export declare namespace DataTable {
183
- var displayName: string;
184
- }
185
-
186
- export declare interface DataTableProps<TData, TValue> {
187
- columns: ColumnDef<TData, TValue>[];
188
- data: TData[];
189
- enablePagination?: boolean;
190
- enableSorting?: boolean;
191
- enableFiltering?: boolean;
192
- filterColumn?: string;
193
- filterPlaceholder?: string;
194
- enableColumnVisibility?: boolean;
195
- initialSorting?: SortingState;
196
- initialColumnFilters?: ColumnFiltersState;
197
- initialColumnVisibility?: VisibilityState;
198
- pageSize?: number;
199
- emptyMessage?: React_2.ReactNode;
200
- className?: string;
201
- }
202
-
203
184
  export declare const DatePicker: React_2.ForwardRefExoticComponent<DatePickerProps & React_2.RefAttributes<HTMLButtonElement>>;
204
185
 
205
186
  export declare interface DatePickerProps {
@@ -220,9 +201,9 @@ export declare function defineConfig(config: QuantumUIConfig): QuantumUIConfig;
220
201
 
221
202
  export declare function Field({
222
203
  className,
223
- orientation = "vertical",
204
+ orientation = 'vertical',
224
205
  ...props
225
- }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>) {
206
+ }: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {
226
207
  return (
227
208
  <div
228
209
  role="group"
@@ -231,35 +212,32 @@ export declare function Field({
231
212
  className={cn(fieldVariants({ orientation }), className)}
232
213
  {...props}
233
214
  />
234
- )
215
+ );
235
216
  }
236
217
 
237
- export declare function FieldContent({ className, ...props }: React.ComponentProps<"div">) {
218
+ export declare function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {
238
219
  return (
239
220
  <div
240
221
  data-slot="field-content"
241
- className={cn(
242
- "group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
243
- className
244
- )}
222
+ className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)}
245
223
  {...props}
246
224
  />
247
- )
225
+ );
248
226
  }
249
227
 
250
- export declare function FieldDescription({ className, ...props }: React.ComponentProps<"p">) {
228
+ export declare function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {
251
229
  return (
252
230
  <p
253
231
  data-slot="field-description"
254
232
  className={cn(
255
- "text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance",
256
- "last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5",
257
- "[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4",
258
- className
233
+ 'text-muted-foreground text-sm leading-normal font-normal group-has-[[data-orientation=horizontal]]/field:text-balance',
234
+ 'last:mt-0 nth-last-2:-mt-1 [[data-variant=legend]+&]:-mt-1.5',
235
+ '[&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4',
236
+ className,
259
237
  )}
260
238
  {...props}
261
239
  />
262
- )
240
+ );
263
241
  }
264
242
 
265
243
  export declare function FieldError({
@@ -267,97 +245,86 @@ export declare function FieldError({
267
245
  children,
268
246
  errors,
269
247
  ...props
270
- }: React.ComponentProps<"div"> & {
271
- errors?: Array<{ message?: string } | undefined>
248
+ }: React.ComponentProps<'div'> & {
249
+ errors?: Array<{ message?: string } | undefined>;
272
250
  }) {
273
251
  const content = useMemo(() => {
274
252
  if (children) {
275
- return children
253
+ return children;
276
254
  }
277
255
 
278
256
  if (!errors?.length) {
279
- return null
257
+ return null;
280
258
  }
281
259
 
282
- if (errors?.length == 1) {
283
- return errors[0]?.message
260
+ if (errors?.length === 1) {
261
+ return errors[0]?.message;
284
262
  }
285
263
 
286
264
  return (
287
265
  <ul className="ml-4 flex list-disc flex-col gap-1">
288
- {errors.map(
289
- (error, index) =>
290
- error?.message && <li key={index}>{error.message}</li>
291
- )}
266
+ {errors.map((error) => error?.message && <li key={error.message}>{error.message}</li>)}
292
267
  </ul>
293
- )
294
- }, [children, errors])
268
+ );
269
+ }, [children, errors]);
295
270
 
296
271
  if (!content) {
297
- return null
272
+ return null;
298
273
  }
299
274
 
300
275
  return (
301
276
  <div
302
277
  role="alert"
303
278
  data-slot="field-error"
304
- className={cn("text-destructive text-sm font-normal", className)}
279
+ className={cn('text-destructive text-sm font-normal', className)}
305
280
  {...props}
306
281
  >
307
282
  {content}
308
283
  </div>
309
- )
284
+ );
310
285
  }
311
286
 
312
- export declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">) {
287
+ export declare function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {
313
288
  return (
314
289
  <div
315
290
  data-slot="field-group"
316
291
  className={cn(
317
- "group/field-group @container/field-group flex w-full flex-col gap-2 data-[slot=checkbox-group]:gap-1 [&>[data-slot=field-group]]:gap-2",
318
- className
292
+ 'group/field-group @container/field-group flex w-full flex-col gap-2 data-[slot=checkbox-group]:gap-1 [&>[data-slot=field-group]]:gap-2',
293
+ className,
319
294
  )}
320
295
  {...props}
321
296
  />
322
- )
297
+ );
323
298
  }
324
299
 
325
- export declare function FieldLabel({
326
- className,
327
- ...props
328
- }: React.ComponentProps<typeof Label>) {
300
+ export declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {
329
301
  return (
330
302
  <Label
331
303
  data-slot="field-label"
332
304
  className={cn(
333
- "group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50",
334
- "has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4",
335
- "has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10",
336
- className
305
+ 'group/field-label peer/field-label flex w-fit gap-2 leading-snug group-data-[disabled=true]/field:opacity-50',
306
+ 'has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-md has-[>[data-slot=field]]:border [&>*]:data-[slot=field]:p-4',
307
+ 'has-data-[state=checked]:bg-primary/5 has-data-[state=checked]:border-primary dark:has-data-[state=checked]:bg-primary/10',
308
+ className,
337
309
  )}
338
310
  {...props}
339
311
  />
340
- )
312
+ );
341
313
  }
342
314
 
343
315
  export declare function FieldLegend({
344
316
  className,
345
- variant = "legend",
317
+ variant = 'legend',
346
318
  ...props
347
- }: React.ComponentProps<"legend"> & { variant?: "legend" | "label" }) {
319
+ }: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {
348
320
  return (
349
321
  <legend
350
322
  data-slot="field-legend"
351
323
  data-variant={variant}
352
- className={cn(
353
- "mb-3 font-medium",
354
- "data-[variant=legend]:text-base",
355
- "data-[variant=label]:text-sm",
356
- className
357
- )}
324
+ className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}
358
325
  {...props}
359
326
  />
360
- )
327
+ );
361
328
  }
362
329
 
363
330
  declare interface FieldMapping {
@@ -368,17 +335,14 @@ export declare function FieldSeparator({
368
335
  children,
369
336
  className,
370
337
  ...props
371
- }: React.ComponentProps<"div"> & {
372
- children?: React.ReactNode
338
+ }: React.ComponentProps<'div'> & {
339
+ children?: React.ReactNode;
373
340
  }) {
374
341
  return (
375
342
  <div
376
343
  data-slot="field-separator"
377
344
  data-content={!!children}
378
- className={cn(
379
- "relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2",
380
- className
381
- )}
345
+ className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}
382
346
  {...props}
383
347
  >
384
348
  <Separator className="absolute inset-0 top-1/2" />
@@ -391,74 +355,73 @@ export declare function FieldSeparator({
391
355
  </span>
392
356
  )}
393
357
  </div>
394
- )
358
+ );
395
359
  }
396
360
 
397
- export declare function FieldSet({ className, ...props }: React.ComponentProps<"fieldset">) {
361
+ export declare function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {
398
362
  return (
399
363
  <fieldset
400
364
  data-slot="field-set"
401
365
  className={cn(
402
- "flex flex-col gap-4",
403
- "has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3",
404
- className
366
+ 'flex flex-col gap-4',
367
+ 'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',
368
+ className,
405
369
  )}
406
370
  {...props}
407
371
  />
408
- )
372
+ );
409
373
  }
410
374
 
411
- export declare function FieldTitle({ className, ...props }: React.ComponentProps<"div">) {
375
+ export declare function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {
412
376
  return (
413
377
  <div
414
378
  data-slot="field-label"
415
379
  className={cn(
416
- "flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50",
417
- className
380
+ 'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',
381
+ className,
418
382
  )}
419
383
  {...props}
420
384
  />
421
- )
385
+ );
422
386
  }
423
387
 
424
- declare const fieldVariants = cva(
425
- "group/field flex w-full gap-2 data-[invalid=true]:text-destructive",
426
- {
388
+ declare const fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-destructive', {
427
389
  variants: {
428
390
  orientation: {
429
- vertical: ["flex-col [&>*]:w-full [&>.sr-only]:w-auto"],
391
+ vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],
430
392
  horizontal: [
431
- "flex-row items-center",
432
- "[&>[data-slot=field-label]]:flex-auto",
433
- "has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
393
+ 'flex-row items-center',
394
+ '[&>[data-slot=field-label]]:flex-auto',
395
+ 'has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
434
396
  ],
435
397
  responsive: [
436
- "flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto",
437
- "@md/field-group:[&>[data-slot=field-label]]:flex-auto",
438
- "@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px",
398
+ 'flex-col [&>*]:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:[&>*]:w-auto',
399
+ '@md/field-group:[&>[data-slot=field-label]]:flex-auto',
400
+ '@md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px',
439
401
  ],
440
402
  },
441
403
  },
442
404
  defaultVariants: {
443
- orientation: "vertical",
405
+ orientation: 'vertical',
444
406
  },
445
- }
446
- );
407
+ });
447
408
 
448
- export declare function Form<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues>({ form, onSubmit, children, showRootError, rootErrorPosition, rootErrorClassName, fieldMapping, ...props }: FormProps<TFieldValues, TContext, TTransformedValues>): JSX.Element;
409
+ export declare function Form<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues, TMutationData = unknown, TMutationError = Error, TMutationVariables = any>({ form, onSubmit, children, showRootError, rootErrorPosition, rootErrorClassName, fieldMapping, mutation, transformSubmit, ...props }: FormProps<TFieldValues, TContext, TTransformedValues, TMutationData, TMutationError, TMutationVariables>): JSX.Element;
449
410
 
450
411
  export declare namespace Form {
451
412
  var displayName: string;
452
413
  }
453
414
 
454
- export declare interface FormProps<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues> extends Omit<default_2.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {
415
+ export declare interface FormProps<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues, TMutationData = unknown, TMutationError = Error, TMutationVariables = any> extends Omit<React_2.FormHTMLAttributes<HTMLFormElement>, 'onSubmit'> {
455
416
  form: UseFormReturn<TFieldValues, TContext, TTransformedValues>;
456
- onSubmit: Parameters<UseFormReturn<TFieldValues, TContext, TTransformedValues>['handleSubmit']>[0];
457
- children: default_2.ReactNode;
417
+ onSubmit?: Parameters<UseFormReturn<TFieldValues, TContext, TTransformedValues>['handleSubmit']>[0];
418
+ children: React_2.ReactNode;
458
419
  showRootError?: boolean;
459
420
  rootErrorPosition?: 'top' | 'bottom';
460
421
  rootErrorClassName?: string;
461
422
  fieldMapping?: FieldMapping;
423
+ mutation?: UseMutationResult<TMutationData, TMutationError, TMutationVariables, unknown>;
424
+ transformSubmit?: (data: TTransformedValues extends undefined ? TFieldValues : TTransformedValues) => TMutationVariables;
462
425
  }
463
426
 
464
427
  export declare function getConfig(): typeof currentConfig;
@@ -472,10 +435,10 @@ export { isValidPhoneNumber }
472
435
  declare function Label({ className, ...props }: React_2.ComponentProps<typeof LabelPrimitive.Root>) {
473
436
  return (
474
437
  <LabelPrimitive.Root
475
- data-slot='label'
438
+ data-slot="label"
476
439
  className={cn(
477
440
  'flex items-center gap-2 text-sm leading-none font-medium select-none group-data-[disabled=true]:pointer-events-none group-data-[disabled=true]:opacity-50 peer-disabled:cursor-not-allowed peer-disabled:opacity-50',
478
- className
441
+ className,
479
442
  )}
480
443
  {...props}
481
444
  />
@@ -527,7 +490,7 @@ export declare interface QuantumUIConfig {
527
490
  auth?: Partial<AuthConfig>;
528
491
  }
529
492
 
530
- export declare function recoverSession(): Promise<{
493
+ export declare function recoverToken(): Promise<{
531
494
  success: boolean;
532
495
  expiresIn: number;
533
496
  }>;
@@ -542,6 +505,19 @@ export declare const setToken: (token: string) => void;
542
505
 
543
506
  export declare function Skeleton({ className, ...props }: React_2.HTMLAttributes<HTMLDivElement>): JSX.Element;
544
507
 
508
+ export declare const Spinner: typeof Spinner_2;
509
+
510
+ declare function Spinner_2({ className, ...props }: React.ComponentProps<'svg'>) {
511
+ return (
512
+ <Loader2Icon
513
+ role="status"
514
+ aria-label="Loading"
515
+ className={cn('size-4 animate-spin', className)}
516
+ {...props}
517
+ />
518
+ );
519
+ }
520
+
545
521
  export declare const TextArea: default_2.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & default_2.RefAttributes<HTMLTextAreaElement>>;
546
522
 
547
523
  export declare interface TextAreaProps extends default_2.ComponentProps<'textarea'> {
package/dist/index.js CHANGED
@@ -1,9 +1,9 @@
1
1
  export { c as cn } from './utils.js';
2
- export { a as axios, i as cancelTokenRefresh, l as clearCsrfToken, e as clearToken, c as configureQuantumUI, d as defineConfig, g as getConfig, k as getCsrfToken, b as getToken, f as recoverSession, r as resetConfig, h as scheduleTokenRefresh, j as setCsrfToken, s as setToken } from './axios.js';
3
- export { B as Button, b as buttonVariants } from './Button.js';
2
+ export { a as axios, b as cancelTokenRefresh, e as clearCsrfToken, f as clearToken, c as configureQuantumUI, d as defineConfig, g as getConfig, h as getCsrfToken, i as getToken, j as recoverToken, r as resetConfig, s as scheduleTokenRefresh, k as setCsrfToken, l as setToken } from './axios.js';
3
+ export { B as Button } from './Button.js';
4
+ export { b as buttonVariants } from './Button2.js';
4
5
  export { C as Card, a as CardContent, b as CardDescription, c as CardFooter, d as CardHeader, e as CardTitle } from './Card.js';
5
6
  export { C as Checkbox } from './Checkbox.js';
6
- export { D as DataTable } from './DataTable.js';
7
7
  export { D as DatePicker } from './DatePicker.js';
8
8
  export { F as Field, a as FieldContent, b as FieldDescription, c as FieldError, d as FieldGroup, e as FieldLabel, f as FieldLegend, g as FieldSeparator, h as FieldSet, i as FieldTitle } from './field.js';
9
9
  export { C as Controller, F as Form } from './Form.js';
@@ -11,6 +11,7 @@ export { O as OTPField } from './OTPField.js';
11
11
  export { P as PasswordField } from './PasswordField.js';
12
12
  export { P as PhoneField, i as isValidPhoneNumber } from './PhoneField.js';
13
13
  export { S as Skeleton } from './Skeleton.js';
14
+ export { S as Spinner } from './Spinner.js';
14
15
  export { T as TextArea } from './TextArea.js';
15
16
  export { T as TextField } from './TextField.js';
16
17
  export { T as ThemeToggle } from './ThemeToggle.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;"}