@vritti/quantum-ui 0.1.19 → 0.1.21

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",
@@ -285,6 +313,10 @@ export declare function FieldLegend({
285
313
  )
286
314
  }
287
315
 
316
+ declare interface FieldMapping {
317
+ [apiField: string]: string;
318
+ }
319
+
288
320
  export declare function FieldSeparator({
289
321
  children,
290
322
  className,
@@ -366,7 +398,7 @@ declare const fieldVariants = cva(
366
398
  }
367
399
  );
368
400
 
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;
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;
370
402
 
371
403
  export declare namespace Form {
372
404
  var displayName: string;
@@ -379,9 +411,11 @@ export declare interface FormProps<TFieldValues extends FieldValues = FieldValue
379
411
  showRootError?: boolean;
380
412
  rootErrorPosition?: 'top' | 'bottom';
381
413
  rootErrorClassName?: string;
382
- csrfEndpoint?: string;
414
+ fieldMapping?: FieldMapping;
383
415
  }
384
416
 
417
+ export declare function getConfig(): typeof currentConfig;
418
+
385
419
  export declare const getCsrfToken: () => string | null;
386
420
 
387
421
  export declare const getToken: (type: TokenType) => string | null;
@@ -468,6 +502,14 @@ export declare interface PhoneFieldProps {
468
502
 
469
503
  export { PhoneValue }
470
504
 
505
+ export declare interface QuantumUIConfig {
506
+ csrf?: Partial<CsrfConfig>;
507
+ axios?: Partial<AxiosConfig>;
508
+ auth?: Partial<AuthConfig>;
509
+ }
510
+
511
+ export declare function resetConfig(): void;
512
+
471
513
  export declare const setCsrfToken: (token: string) => void;
472
514
 
473
515
  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';
@@ -12,5 +12,5 @@ export { T as TextArea } from './TextArea.js';
12
12
  export { T as ThemeToggle } from './ThemeToggle.js';
13
13
  export { T as Typography } from './Typography.js';
14
14
  export { C as Controller, F as Form } from './Form.js';
15
- export { F as Field, h as FieldContent, b as FieldDescription, c as FieldError, d as FieldGroup, a as FieldLabel, e as FieldLegend, f as FieldSeparator, g as FieldSet, i as FieldTitle } from './field.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
16
  //# sourceMappingURL=index.js.map
@@ -1,2 +1,2 @@
1
- export { F as Field, h as FieldContent, b as FieldDescription, c as FieldError, d as FieldGroup, a as FieldLabel, e as FieldLegend, f as FieldSeparator, g as FieldSet, i as FieldTitle } from '../field.js';
1
+ 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';
2
2
  //# sourceMappingURL=shadcnField.js.map