@vritti/quantum-ui 0.1.19 → 0.1.20

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.
package/dist/index.d.ts CHANGED
@@ -14,8 +14,20 @@ import * as React_2 from 'react';
14
14
  import { UseFormReturn } from 'react-hook-form';
15
15
  import { VariantProps } from 'class-variance-authority';
16
16
 
17
+ export declare interface AuthConfig {
18
+ tokenHeaderName: string;
19
+ tokenPrefix: string;
20
+ }
21
+
17
22
  export declare const axios: AxiosInstance;
18
23
 
24
+ export declare interface AxiosConfig {
25
+ baseURL: string;
26
+ timeout: number;
27
+ withCredentials: boolean;
28
+ headers?: Record<string, string>;
29
+ }
30
+
19
31
  export declare function Button({
20
32
  className,
21
33
  variant,
@@ -141,8 +153,24 @@ export declare function cn(...inputs: ClassValue[]) {
141
153
  return twMerge(clsx(inputs));
142
154
  }
143
155
 
156
+ export declare function configureQuantumUI(userConfig: QuantumUIConfig): void;
157
+
144
158
  export { Controller }
145
159
 
160
+ export declare interface CsrfConfig {
161
+ endpoint: string;
162
+ enabled: boolean;
163
+ headerName: string;
164
+ }
165
+
166
+ declare let currentConfig: {
167
+ csrf: CsrfConfig;
168
+ axios: AxiosConfig;
169
+ auth: AuthConfig;
170
+ };
171
+
172
+ export declare function defineConfig(config: QuantumUIConfig): QuantumUIConfig;
173
+
146
174
  export declare function Field({
147
175
  className,
148
176
  orientation = "vertical",
@@ -366,7 +394,7 @@ declare const fieldVariants = cva(
366
394
  }
367
395
  );
368
396
 
369
- export declare function Form<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues>({ form, onSubmit, children, showRootError, rootErrorPosition, rootErrorClassName, csrfEndpoint, ...props }: FormProps<TFieldValues, TContext, TTransformedValues>): JSX.Element;
397
+ export declare function Form<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues>({ form, onSubmit, children, showRootError, rootErrorPosition, rootErrorClassName, ...props }: FormProps<TFieldValues, TContext, TTransformedValues>): JSX.Element;
370
398
 
371
399
  export declare namespace Form {
372
400
  var displayName: string;
@@ -379,9 +407,10 @@ export declare interface FormProps<TFieldValues extends FieldValues = FieldValue
379
407
  showRootError?: boolean;
380
408
  rootErrorPosition?: 'top' | 'bottom';
381
409
  rootErrorClassName?: string;
382
- csrfEndpoint?: string;
383
410
  }
384
411
 
412
+ export declare function getConfig(): typeof currentConfig;
413
+
385
414
  export declare const getCsrfToken: () => string | null;
386
415
 
387
416
  export declare const getToken: (type: TokenType) => string | null;
@@ -468,6 +497,14 @@ export declare interface PhoneFieldProps {
468
497
 
469
498
  export { PhoneValue }
470
499
 
500
+ export declare interface QuantumUIConfig {
501
+ csrf?: Partial<CsrfConfig>;
502
+ axios?: Partial<AxiosConfig>;
503
+ auth?: Partial<AuthConfig>;
504
+ }
505
+
506
+ export declare function resetConfig(): void;
507
+
471
508
  export declare const setCsrfToken: (token: string) => void;
472
509
 
473
510
  export declare const setToken: (type: TokenType, token: string) => void;
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  export { O as OnboardingContext, a as OnboardingProvider, u as useOnboarding } from './OnboardingProvider.js';
2
2
  export { c as cn } from './utils.js';
3
- export { axios, clearAllTokens, clearCsrfToken, clearToken, getCsrfToken, getToken, setCsrfToken, setToken } from './utils/axios.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
4
  export { B as Button, b as buttonVariants } from './Button.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';