@vritti/quantum-ui 0.1.22 → 0.2.0

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