@vritti/quantum-ui 0.2.2 → 0.2.4
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/components/Button/Button.d.ts +9 -0
- package/dist/components/Button/Button.d.ts.map +1 -0
- package/dist/components/Button/index.d.ts +3 -0
- package/dist/components/Button/index.d.ts.map +1 -0
- package/dist/components/Card/Card.d.ts +2 -0
- package/dist/components/Card/Card.d.ts.map +1 -0
- package/dist/components/Card/index.d.ts +2 -0
- package/dist/components/Card/index.d.ts.map +1 -0
- package/dist/components/Checkbox/Checkbox.d.ts +9 -0
- package/dist/components/Checkbox/Checkbox.d.ts.map +1 -0
- package/dist/components/Checkbox/index.d.ts +2 -0
- package/dist/components/Checkbox/index.d.ts.map +1 -0
- package/dist/components/DatePicker/DatePicker.d.ts +17 -0
- package/dist/components/DatePicker/DatePicker.d.ts.map +1 -0
- package/dist/components/DatePicker/index.d.ts +3 -0
- package/dist/components/DatePicker/index.d.ts.map +1 -0
- package/dist/components/Field/index.d.ts +2 -0
- package/dist/components/Field/index.d.ts.map +1 -0
- package/dist/components/Form/Form.d.ts +21 -0
- package/dist/components/Form/Form.d.ts.map +1 -0
- package/dist/components/Form/index.d.ts +3 -0
- package/dist/components/Form/index.d.ts.map +1 -0
- package/dist/components/OTPField/OTPField.d.ts +14 -0
- package/dist/components/OTPField/OTPField.d.ts.map +1 -0
- package/dist/components/OTPField/index.d.ts +2 -0
- package/dist/components/OTPField/index.d.ts.map +1 -0
- package/dist/components/PasswordField/PasswordField.d.ts +10 -0
- package/dist/components/PasswordField/PasswordField.d.ts.map +1 -0
- package/dist/components/PasswordField/index.d.ts +2 -0
- package/dist/components/PasswordField/index.d.ts.map +1 -0
- package/dist/components/PhoneField/PhoneField.d.ts +15 -0
- package/dist/components/PhoneField/PhoneField.d.ts.map +1 -0
- package/dist/components/PhoneField/index.d.ts +3 -0
- package/dist/components/PhoneField/index.d.ts.map +1 -0
- package/dist/components/Progress/Progress.d.ts +2 -0
- package/dist/components/Progress/Progress.d.ts.map +1 -0
- package/dist/components/Progress/index.d.ts +2 -0
- package/dist/components/Progress/index.d.ts.map +1 -0
- package/dist/components/Skeleton/Skeleton.d.ts +4 -0
- package/dist/components/Skeleton/Skeleton.d.ts.map +1 -0
- package/dist/components/Skeleton/index.d.ts +2 -0
- package/dist/components/Skeleton/index.d.ts.map +1 -0
- package/dist/components/Spinner/Spinner.d.ts +3 -0
- package/dist/components/Spinner/Spinner.d.ts.map +1 -0
- package/dist/components/Spinner/index.d.ts +2 -0
- package/dist/components/Spinner/index.d.ts.map +1 -0
- package/dist/components/TextArea/TextArea.d.ts +8 -0
- package/dist/components/TextArea/TextArea.d.ts.map +1 -0
- package/dist/components/TextArea/index.d.ts +2 -0
- package/dist/components/TextArea/index.d.ts.map +1 -0
- package/dist/components/TextField/TextField.d.ts +10 -0
- package/dist/components/TextField/TextField.d.ts.map +1 -0
- package/dist/components/TextField/index.d.ts +2 -0
- package/dist/components/TextField/index.d.ts.map +1 -0
- package/dist/components/ThemeToggle/ThemeToggle.d.ts +7 -0
- package/dist/components/ThemeToggle/ThemeToggle.d.ts.map +1 -0
- package/dist/components/ThemeToggle/index.d.ts +2 -0
- package/dist/components/ThemeToggle/index.d.ts.map +1 -0
- package/dist/{Typography.d.ts → components/Typography/Typography.d.ts} +10 -13
- package/dist/components/Typography/Typography.d.ts.map +1 -0
- package/dist/components/Typography/index.d.ts +2 -0
- package/dist/components/Typography/index.d.ts.map +1 -0
- package/dist/components/index.d.ts +16 -0
- package/dist/components/index.d.ts.map +1 -0
- package/dist/config/index.d.ts +34 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/index.d.ts +5 -563
- package/dist/index.d.ts.map +1 -0
- package/dist/utils/axios.d.ts +1 -7
- package/dist/utils/axios.d.ts.map +1 -0
- package/dist/utils/formHelpers.d.ts +19 -0
- package/dist/utils/formHelpers.d.ts.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/package.json +33 -33
- package/dist/Button.d.ts +0 -54
- package/dist/Card.d.ts +0 -44
- package/dist/Checkbox.d.ts +0 -33
- package/dist/DatePicker.d.ts +0 -68
- package/dist/Form.d.ts +0 -250
- package/dist/OTPField.d.ts +0 -17
- package/dist/PasswordField.d.ts +0 -20
- package/dist/PhoneField.d.ts +0 -24
- package/dist/Progress.d.ts +0 -7
- package/dist/Skeleton.d.ts +0 -6
- package/dist/Spinner.d.ts +0 -14
- package/dist/TextArea.d.ts +0 -11
- package/dist/TextField.d.ts +0 -13
- package/dist/ThemeToggle.d.ts +0 -10
- package/dist/axios.d.ts +0 -28
- package/dist/components/Button.d.ts +0 -9
- package/dist/components/Card.d.ts +0 -9
- package/dist/components/Checkbox.d.ts +0 -9
- package/dist/components/DatePicker.d.ts +0 -9
- package/dist/components/Form.d.ts +0 -9
- package/dist/components/OTPField.d.ts +0 -9
- package/dist/components/PasswordField.d.ts +0 -9
- package/dist/components/PhoneField.d.ts +0 -9
- package/dist/components/Progress.d.ts +0 -9
- package/dist/components/Skeleton.d.ts +0 -9
- package/dist/components/Spinner.d.ts +0 -9
- package/dist/components/TextArea.d.ts +0 -9
- package/dist/components/TextField.d.ts +0 -9
- package/dist/components/ThemeToggle.d.ts +0 -9
- package/dist/components/Typography.d.ts +0 -9
- package/dist/shadcn/shadcnField.d.ts +0 -8
- package/dist/shadcnField.d.ts +0 -1
package/dist/index.d.ts
CHANGED
|
@@ -1,563 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import { DayPicker } from 'react-day-picker';
|
|
7
|
-
import { default as default_2 } from 'react';
|
|
8
|
-
import { FieldValues } from 'react-hook-form';
|
|
9
|
-
import { isValidPhoneNumber } from 'react-phone-number-input';
|
|
10
|
-
import { JSX } from 'react/jsx-runtime';
|
|
11
|
-
import * as LabelPrimitive from '@radix-ui/react-label';
|
|
12
|
-
import { Value as PhoneValue } from 'react-phone-number-input';
|
|
13
|
-
import * as React_2 from 'react';
|
|
14
|
-
import { UseFormReturn } from 'react-hook-form';
|
|
15
|
-
import { UseMutationResult } from '@tanstack/react-query';
|
|
16
|
-
import { VariantProps } from 'class-variance-authority';
|
|
17
|
-
|
|
18
|
-
export declare interface AuthConfig {
|
|
19
|
-
tokenHeaderName: string;
|
|
20
|
-
tokenPrefix: string;
|
|
21
|
-
tokenEndpoint: string;
|
|
22
|
-
refreshEndpoint: string;
|
|
23
|
-
sessionRecoveryEnabled: boolean;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export declare const axios: AxiosInstance;
|
|
27
|
-
|
|
28
|
-
export declare interface AxiosConfig {
|
|
29
|
-
baseURL: string;
|
|
30
|
-
timeout: number;
|
|
31
|
-
withCredentials: boolean;
|
|
32
|
-
headers?: Record<string, string>;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
export declare const Button: React_2.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
36
|
-
|
|
37
|
-
declare function Button_2({
|
|
38
|
-
className,
|
|
39
|
-
variant,
|
|
40
|
-
size,
|
|
41
|
-
asChild = false,
|
|
42
|
-
...props
|
|
43
|
-
}: React_2.ComponentProps<'button'> &
|
|
44
|
-
VariantProps<typeof buttonVariants> & {
|
|
45
|
-
asChild?: boolean;
|
|
46
|
-
}) {
|
|
47
|
-
const Comp = asChild ? Slot : 'button';
|
|
48
|
-
|
|
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;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export declare const buttonVariants = cva(
|
|
58
|
-
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-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",
|
|
59
|
-
{
|
|
60
|
-
variants: {
|
|
61
|
-
variant: {
|
|
62
|
-
default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
|
|
63
|
-
destructive:
|
|
64
|
-
'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
|
|
65
|
-
outline:
|
|
66
|
-
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
|
|
67
|
-
secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',
|
|
68
|
-
ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
|
|
69
|
-
link: 'text-primary underline-offset-4 hover:underline',
|
|
70
|
-
},
|
|
71
|
-
size: {
|
|
72
|
-
default: 'h-9 px-4 py-2 has-[>svg]:px-3',
|
|
73
|
-
sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
|
|
74
|
-
lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
|
|
75
|
-
icon: 'size-9',
|
|
76
|
-
},
|
|
77
|
-
},
|
|
78
|
-
defaultVariants: {
|
|
79
|
-
variant: 'default',
|
|
80
|
-
size: 'default',
|
|
81
|
-
},
|
|
82
|
-
},
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
declare type CalendarProps = React_2.ComponentProps<typeof DayPicker> & {
|
|
86
|
-
buttonVariant?: React_2.ComponentProps<typeof Button_2>['variant'];
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export declare function cancelTokenRefresh(): void;
|
|
90
|
-
|
|
91
|
-
export declare function Card({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
92
|
-
return (
|
|
93
|
-
<div
|
|
94
|
-
data-slot="card"
|
|
95
|
-
className={cn('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className)}
|
|
96
|
-
{...props}
|
|
97
|
-
/>
|
|
98
|
-
);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
export declare function CardContent({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
102
|
-
return <div data-slot="card-content" className={cn('px-6', className)} {...props} />;
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
export declare function CardDescription({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
106
|
-
return <div data-slot="card-description" className={cn('text-muted-foreground text-sm', className)} {...props} />;
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
export declare function CardFooter({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
110
|
-
return (
|
|
111
|
-
<div data-slot="card-footer" className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
export declare function CardHeader({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
116
|
-
return (
|
|
117
|
-
<div
|
|
118
|
-
data-slot="card-header"
|
|
119
|
-
className={cn(
|
|
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',
|
|
121
|
-
className,
|
|
122
|
-
)}
|
|
123
|
-
{...props}
|
|
124
|
-
/>
|
|
125
|
-
);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
export declare function CardTitle({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
129
|
-
return <div data-slot="card-title" className={cn('leading-none font-semibold', className)} {...props} />;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
export declare const Checkbox: default_2.ForwardRefExoticComponent<CheckboxProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
133
|
-
|
|
134
|
-
declare function Checkbox_2({ className, ...props }: React_2.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
135
|
-
return (
|
|
136
|
-
<CheckboxPrimitive.Root
|
|
137
|
-
data-slot="checkbox"
|
|
138
|
-
className={cn(
|
|
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,
|
|
141
|
-
)}
|
|
142
|
-
{...props}
|
|
143
|
-
>
|
|
144
|
-
<CheckboxPrimitive.Indicator
|
|
145
|
-
data-slot="checkbox-indicator"
|
|
146
|
-
className="grid place-content-center text-current transition-none"
|
|
147
|
-
>
|
|
148
|
-
<CheckIcon className="size-3.5" />
|
|
149
|
-
</CheckboxPrimitive.Indicator>
|
|
150
|
-
</CheckboxPrimitive.Root>
|
|
151
|
-
);
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
declare interface CheckboxProps extends default_2.ComponentPropsWithoutRef<typeof Checkbox_2> {
|
|
155
|
-
label?: default_2.ReactNode;
|
|
156
|
-
description?: default_2.ReactNode;
|
|
157
|
-
error?: string;
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
export declare const clearCsrfToken: () => void;
|
|
161
|
-
|
|
162
|
-
export declare const clearToken: () => void;
|
|
163
|
-
|
|
164
|
-
export declare function cn(...inputs: ClassValue[]) {
|
|
165
|
-
return twMerge(clsx(inputs));
|
|
166
|
-
}
|
|
167
|
-
|
|
168
|
-
export declare function configureQuantumUI(userConfig: QuantumUIConfig): void;
|
|
169
|
-
|
|
170
|
-
export { Controller }
|
|
171
|
-
|
|
172
|
-
export declare interface CsrfConfig {
|
|
173
|
-
endpoint: string;
|
|
174
|
-
enabled: boolean;
|
|
175
|
-
headerName: string;
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
export declare const DatePicker: React_2.ForwardRefExoticComponent<DatePickerProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
179
|
-
|
|
180
|
-
export declare interface DatePickerProps {
|
|
181
|
-
label?: string;
|
|
182
|
-
description?: React_2.ReactNode;
|
|
183
|
-
error?: string;
|
|
184
|
-
placeholder?: string;
|
|
185
|
-
value?: Date;
|
|
186
|
-
onValueChange?: (date: Date | undefined) => void;
|
|
187
|
-
open?: boolean;
|
|
188
|
-
onOpenChange?: (open: boolean) => void;
|
|
189
|
-
calendarProps?: CalendarProps;
|
|
190
|
-
className?: string;
|
|
191
|
-
id?: string;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
declare const defaultConfig: Required<{
|
|
195
|
-
csrf: CsrfConfig;
|
|
196
|
-
axios: AxiosConfig;
|
|
197
|
-
auth: AuthConfig;
|
|
198
|
-
}>;
|
|
199
|
-
|
|
200
|
-
export declare function defineConfig(config: QuantumUIConfig): QuantumUIConfig;
|
|
201
|
-
|
|
202
|
-
export declare function Field({
|
|
203
|
-
className,
|
|
204
|
-
orientation = 'vertical',
|
|
205
|
-
...props
|
|
206
|
-
}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {
|
|
207
|
-
return (
|
|
208
|
-
<div
|
|
209
|
-
role="group"
|
|
210
|
-
data-slot="field"
|
|
211
|
-
data-orientation={orientation}
|
|
212
|
-
className={cn(fieldVariants({ orientation }), className)}
|
|
213
|
-
{...props}
|
|
214
|
-
/>
|
|
215
|
-
);
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
export declare function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
219
|
-
return (
|
|
220
|
-
<div
|
|
221
|
-
data-slot="field-content"
|
|
222
|
-
className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)}
|
|
223
|
-
{...props}
|
|
224
|
-
/>
|
|
225
|
-
);
|
|
226
|
-
}
|
|
227
|
-
|
|
228
|
-
export declare function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
229
|
-
return (
|
|
230
|
-
<p
|
|
231
|
-
data-slot="field-description"
|
|
232
|
-
className={cn(
|
|
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,
|
|
237
|
-
)}
|
|
238
|
-
{...props}
|
|
239
|
-
/>
|
|
240
|
-
);
|
|
241
|
-
}
|
|
242
|
-
|
|
243
|
-
export declare function FieldError({
|
|
244
|
-
className,
|
|
245
|
-
children,
|
|
246
|
-
errors,
|
|
247
|
-
...props
|
|
248
|
-
}: React.ComponentProps<'div'> & {
|
|
249
|
-
errors?: Array<{ message?: string } | undefined>;
|
|
250
|
-
}) {
|
|
251
|
-
const content = useMemo(() => {
|
|
252
|
-
if (children) {
|
|
253
|
-
return children;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (!errors?.length) {
|
|
257
|
-
return null;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
if (errors?.length === 1) {
|
|
261
|
-
return errors[0]?.message;
|
|
262
|
-
}
|
|
263
|
-
|
|
264
|
-
return (
|
|
265
|
-
<ul className="ml-4 flex list-disc flex-col gap-1">
|
|
266
|
-
{errors.map((error) => error?.message && <li key={error.message}>{error.message}</li>)}
|
|
267
|
-
</ul>
|
|
268
|
-
);
|
|
269
|
-
}, [children, errors]);
|
|
270
|
-
|
|
271
|
-
if (!content) {
|
|
272
|
-
return null;
|
|
273
|
-
}
|
|
274
|
-
|
|
275
|
-
return (
|
|
276
|
-
<div
|
|
277
|
-
role="alert"
|
|
278
|
-
data-slot="field-error"
|
|
279
|
-
className={cn('text-destructive text-sm font-normal', className)}
|
|
280
|
-
{...props}
|
|
281
|
-
>
|
|
282
|
-
{content}
|
|
283
|
-
</div>
|
|
284
|
-
);
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
export declare function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
288
|
-
return (
|
|
289
|
-
<div
|
|
290
|
-
data-slot="field-group"
|
|
291
|
-
className={cn(
|
|
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,
|
|
294
|
-
)}
|
|
295
|
-
{...props}
|
|
296
|
-
/>
|
|
297
|
-
);
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
export declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {
|
|
301
|
-
return (
|
|
302
|
-
<Label
|
|
303
|
-
data-slot="field-label"
|
|
304
|
-
className={cn(
|
|
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,
|
|
309
|
-
)}
|
|
310
|
-
{...props}
|
|
311
|
-
/>
|
|
312
|
-
);
|
|
313
|
-
}
|
|
314
|
-
|
|
315
|
-
export declare function FieldLegend({
|
|
316
|
-
className,
|
|
317
|
-
variant = 'legend',
|
|
318
|
-
...props
|
|
319
|
-
}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {
|
|
320
|
-
return (
|
|
321
|
-
<legend
|
|
322
|
-
data-slot="field-legend"
|
|
323
|
-
data-variant={variant}
|
|
324
|
-
className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}
|
|
325
|
-
{...props}
|
|
326
|
-
/>
|
|
327
|
-
);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
declare interface FieldMapping {
|
|
331
|
-
[apiField: string]: string;
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
export declare function FieldSeparator({
|
|
335
|
-
children,
|
|
336
|
-
className,
|
|
337
|
-
...props
|
|
338
|
-
}: React.ComponentProps<'div'> & {
|
|
339
|
-
children?: React.ReactNode;
|
|
340
|
-
}) {
|
|
341
|
-
return (
|
|
342
|
-
<div
|
|
343
|
-
data-slot="field-separator"
|
|
344
|
-
data-content={!!children}
|
|
345
|
-
className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}
|
|
346
|
-
{...props}
|
|
347
|
-
>
|
|
348
|
-
<Separator className="absolute inset-0 top-1/2" />
|
|
349
|
-
{children && (
|
|
350
|
-
<span
|
|
351
|
-
className="bg-background text-muted-foreground relative mx-auto block w-fit px-2"
|
|
352
|
-
data-slot="field-separator-content"
|
|
353
|
-
>
|
|
354
|
-
{children}
|
|
355
|
-
</span>
|
|
356
|
-
)}
|
|
357
|
-
</div>
|
|
358
|
-
);
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
export declare function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {
|
|
362
|
-
return (
|
|
363
|
-
<fieldset
|
|
364
|
-
data-slot="field-set"
|
|
365
|
-
className={cn(
|
|
366
|
-
'flex flex-col gap-4',
|
|
367
|
-
'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',
|
|
368
|
-
className,
|
|
369
|
-
)}
|
|
370
|
-
{...props}
|
|
371
|
-
/>
|
|
372
|
-
);
|
|
373
|
-
}
|
|
374
|
-
|
|
375
|
-
export declare function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
376
|
-
return (
|
|
377
|
-
<div
|
|
378
|
-
data-slot="field-label"
|
|
379
|
-
className={cn(
|
|
380
|
-
'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',
|
|
381
|
-
className,
|
|
382
|
-
)}
|
|
383
|
-
{...props}
|
|
384
|
-
/>
|
|
385
|
-
);
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
declare const fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-destructive', {
|
|
389
|
-
variants: {
|
|
390
|
-
orientation: {
|
|
391
|
-
vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],
|
|
392
|
-
horizontal: [
|
|
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',
|
|
396
|
-
],
|
|
397
|
-
responsive: [
|
|
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',
|
|
401
|
-
],
|
|
402
|
-
},
|
|
403
|
-
},
|
|
404
|
-
defaultVariants: {
|
|
405
|
-
orientation: 'vertical',
|
|
406
|
-
},
|
|
407
|
-
});
|
|
408
|
-
|
|
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;
|
|
410
|
-
|
|
411
|
-
export declare namespace Form {
|
|
412
|
-
var displayName: string;
|
|
413
|
-
}
|
|
414
|
-
|
|
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'> {
|
|
416
|
-
form: UseFormReturn<TFieldValues, TContext, TTransformedValues>;
|
|
417
|
-
onSubmit?: Parameters<UseFormReturn<TFieldValues, TContext, TTransformedValues>['handleSubmit']>[0];
|
|
418
|
-
children: React_2.ReactNode;
|
|
419
|
-
showRootError?: boolean;
|
|
420
|
-
rootErrorPosition?: 'top' | 'bottom';
|
|
421
|
-
rootErrorClassName?: string;
|
|
422
|
-
fieldMapping?: FieldMapping;
|
|
423
|
-
mutation?: UseMutationResult<TMutationData, TMutationError, TMutationVariables, unknown>;
|
|
424
|
-
transformSubmit?: (data: TTransformedValues extends undefined ? TFieldValues : TTransformedValues) => TMutationVariables;
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
export declare function getConfig(): typeof defaultConfig;
|
|
428
|
-
|
|
429
|
-
export declare const getCsrfToken: () => string | null;
|
|
430
|
-
|
|
431
|
-
export declare const getToken: () => string | null;
|
|
432
|
-
|
|
433
|
-
export { isValidPhoneNumber }
|
|
434
|
-
|
|
435
|
-
declare function Label({ className, ...props }: React_2.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
436
|
-
return (
|
|
437
|
-
<LabelPrimitive.Root
|
|
438
|
-
data-slot="label"
|
|
439
|
-
className={cn(
|
|
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',
|
|
441
|
-
className,
|
|
442
|
-
)}
|
|
443
|
-
{...props}
|
|
444
|
-
/>
|
|
445
|
-
);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
export declare const OTPField: default_2.ForwardRefExoticComponent<OTPFieldProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
449
|
-
|
|
450
|
-
export declare interface OTPFieldProps {
|
|
451
|
-
value: string;
|
|
452
|
-
onChange: (value: string) => void;
|
|
453
|
-
length?: number;
|
|
454
|
-
label?: string;
|
|
455
|
-
description?: default_2.ReactNode;
|
|
456
|
-
error?: string;
|
|
457
|
-
disabled?: boolean;
|
|
458
|
-
required?: boolean;
|
|
459
|
-
className?: string;
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
export declare const PasswordField: default_2.ForwardRefExoticComponent<Omit<PasswordFieldProps, "ref"> & default_2.RefAttributes<HTMLInputElement>>;
|
|
463
|
-
|
|
464
|
-
declare interface PasswordFieldProps extends Omit<TextFieldProps, 'type' | 'endAdornment'> {
|
|
465
|
-
showStrengthIndicator?: boolean;
|
|
466
|
-
showMatchIndicator?: boolean;
|
|
467
|
-
matchPassword?: string;
|
|
468
|
-
toggleAriaLabel?: string;
|
|
469
|
-
}
|
|
470
|
-
|
|
471
|
-
export declare const PhoneField: default_2.ForwardRefExoticComponent<PhoneFieldProps & default_2.RefAttributes<HTMLInputElement>>;
|
|
472
|
-
|
|
473
|
-
export declare interface PhoneFieldProps {
|
|
474
|
-
value?: PhoneValue;
|
|
475
|
-
onChange: (value: PhoneValue | undefined) => void;
|
|
476
|
-
defaultCountry?: Country;
|
|
477
|
-
label?: string;
|
|
478
|
-
description?: default_2.ReactNode;
|
|
479
|
-
error?: string;
|
|
480
|
-
disabled?: boolean;
|
|
481
|
-
className?: string;
|
|
482
|
-
placeholder?: string;
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
export { PhoneValue }
|
|
486
|
-
|
|
487
|
-
export declare interface QuantumUIConfig {
|
|
488
|
-
csrf?: Partial<CsrfConfig>;
|
|
489
|
-
axios?: Partial<AxiosConfig>;
|
|
490
|
-
auth?: Partial<AuthConfig>;
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
export declare function recoverToken(): Promise<{
|
|
494
|
-
success: boolean;
|
|
495
|
-
expiresIn: number;
|
|
496
|
-
}>;
|
|
497
|
-
|
|
498
|
-
export declare function resetConfig(): void;
|
|
499
|
-
|
|
500
|
-
export declare function scheduleTokenRefresh(expiresIn: number): void;
|
|
501
|
-
|
|
502
|
-
export declare const setCsrfToken: (token: string) => void;
|
|
503
|
-
|
|
504
|
-
export declare const setToken: (token: string) => void;
|
|
505
|
-
|
|
506
|
-
export declare function Skeleton({ className, ...props }: React_2.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
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
|
-
|
|
521
|
-
export declare const TextArea: default_2.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & default_2.RefAttributes<HTMLTextAreaElement>>;
|
|
522
|
-
|
|
523
|
-
export declare interface TextAreaProps extends default_2.ComponentProps<'textarea'> {
|
|
524
|
-
label?: string;
|
|
525
|
-
description?: default_2.ReactNode;
|
|
526
|
-
error?: string;
|
|
527
|
-
}
|
|
528
|
-
|
|
529
|
-
export declare const TextField: default_2.ForwardRefExoticComponent<Omit<TextFieldProps, "ref"> & default_2.RefAttributes<HTMLInputElement>>;
|
|
530
|
-
|
|
531
|
-
declare interface TextFieldProps extends default_2.ComponentProps<'input'> {
|
|
532
|
-
label?: string;
|
|
533
|
-
description?: default_2.ReactNode;
|
|
534
|
-
error?: string;
|
|
535
|
-
startAdornment?: default_2.ReactNode;
|
|
536
|
-
endAdornment?: default_2.ReactNode;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
export declare const ThemeToggle: default_2.FC<ThemeToggleProps>;
|
|
540
|
-
|
|
541
|
-
declare interface ThemeToggleProps {
|
|
542
|
-
className?: string;
|
|
543
|
-
size?: 'sm' | 'md' | 'lg';
|
|
544
|
-
}
|
|
545
|
-
|
|
546
|
-
export declare const Typography: default_2.FC<TypographyProps>;
|
|
547
|
-
|
|
548
|
-
declare interface TypographyProps {
|
|
549
|
-
children: default_2.ReactNode;
|
|
550
|
-
variant?: 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'body1' | 'body2' | 'caption' | 'overline' | 'subtitle1' | 'subtitle2' | 'button' | 'code' | 'blockquote';
|
|
551
|
-
intent?: 'default' | 'primary' | 'secondary' | 'muted' | 'success' | 'warning' | 'error';
|
|
552
|
-
align?: 'left' | 'center' | 'right' | 'justify';
|
|
553
|
-
className?: string;
|
|
554
|
-
}
|
|
555
|
-
|
|
556
|
-
export { }
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
declare module 'axios' {
|
|
560
|
-
interface AxiosRequestConfig {
|
|
561
|
-
public?: boolean;
|
|
562
|
-
}
|
|
563
|
-
}
|
|
1
|
+
export { cn } from '../shadcn/utils';
|
|
2
|
+
export * from './components';
|
|
3
|
+
export { type AuthConfig, type AxiosConfig, type CsrfConfig, configureQuantumUI, defineConfig, getConfig, type QuantumUIConfig, resetConfig, } from './config';
|
|
4
|
+
export { axios, cancelTokenRefresh, clearCsrfToken, clearToken, getCsrfToken, getToken, recoverToken, scheduleTokenRefresh, setCsrfToken, setToken, } from './utils/axios';
|
|
5
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../lib/index.ts"],"names":[],"mappings":"AACA,OAAO,aAAa,CAAC;AAGrB,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,cAAc,cAAc,CAAC;AAG7B,OAAO,EACL,KAAK,UAAU,EACf,KAAK,WAAW,EAChB,KAAK,UAAU,EACf,kBAAkB,EAClB,YAAY,EACZ,SAAS,EACT,KAAK,eAAe,EACpB,WAAW,GACZ,MAAM,UAAU,CAAC;AAGlB,OAAO,EACL,KAAK,EACL,kBAAkB,EAClB,cAAc,EACd,UAAU,EACV,YAAY,EACZ,QAAQ,EACR,YAAY,EACZ,oBAAoB,EACpB,YAAY,EACZ,QAAQ,GACT,MAAM,eAAe,CAAC"}
|
package/dist/utils/axios.d.ts
CHANGED
|
@@ -18,10 +18,4 @@ export declare function scheduleTokenRefresh(expiresIn: number): void;
|
|
|
18
18
|
export declare function cancelTokenRefresh(): void;
|
|
19
19
|
export declare const axios: AxiosInstance;
|
|
20
20
|
export default axios;
|
|
21
|
-
//# sourceMappingURL=axios.d.ts.map
|
|
22
|
-
|
|
23
|
-
declare module 'axios' {
|
|
24
|
-
interface AxiosRequestConfig {
|
|
25
|
-
public?: boolean;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
21
|
+
//# sourceMappingURL=axios.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"axios.d.ts","sourceRoot":"","sources":["../../lib/utils/axios.ts"],"names":[],"mappings":"AAAA,OAAc,EAAE,KAAK,aAAa,EAAmC,MAAM,OAAO,CAAC;AAInF,OAAO,QAAQ,OAAO,CAAC;IACrB,UAAiB,kBAAkB;QAEjC,MAAM,CAAC,EAAE,OAAO,CAAC;KAClB;CACF;AAgBD,eAAO,MAAM,QAAQ,GAAI,OAAO,MAAM,KAAG,IAIxC,CAAC;AAEF,eAAO,MAAM,QAAQ,QAAO,MAAM,GAAG,IAAmB,CAAC;AAEzD,eAAO,MAAM,UAAU,QAAO,IAG7B,CAAC;AAMF,eAAO,MAAM,YAAY,GAAI,OAAO,MAAM,KAAG,IAI5C,CAAC;AAEF,eAAO,MAAM,YAAY,QAAO,MAAM,GAAG,IAAiB,CAAC;AAE3D,eAAO,MAAM,cAAc,QAAO,IAEjC,CAAC;AAOF,wBAAsB,YAAY,IAAI,OAAO,CAAC;IAAE,OAAO,EAAE,OAAO,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAoBrF;AAkCD,wBAAgB,oBAAoB,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CA4B5D;AAED,wBAAgB,kBAAkB,IAAI,IAAI,CAKzC;AA8ED,eAAO,MAAM,KAAK,EAAE,aAAqC,CAAC;AAwD1D,eAAe,KAAK,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { FieldValues, UseFormReturn } from 'react-hook-form';
|
|
2
|
+
export interface FieldMapping {
|
|
3
|
+
[apiField: string]: string;
|
|
4
|
+
}
|
|
5
|
+
export interface FieldError {
|
|
6
|
+
field?: string;
|
|
7
|
+
message: string;
|
|
8
|
+
}
|
|
9
|
+
export interface ApiErrorResponse {
|
|
10
|
+
message?: string;
|
|
11
|
+
error?: string;
|
|
12
|
+
errors?: FieldError[];
|
|
13
|
+
}
|
|
14
|
+
export interface MapApiErrorsOptions {
|
|
15
|
+
fieldMapping?: FieldMapping;
|
|
16
|
+
setRootError?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function mapApiErrorsToForm<TFieldValues extends FieldValues = FieldValues>(error: unknown, form: UseFormReturn<TFieldValues>, options?: MapApiErrorsOptions): void;
|
|
19
|
+
//# sourceMappingURL=formHelpers.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formHelpers.d.ts","sourceRoot":"","sources":["../../lib/utils/formHelpers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAKlE,MAAM,WAAW,YAAY;IAC3B,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;CAC5B;AAKD,MAAM,WAAW,UAAU;IACzB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD,MAAM,WAAW,gBAAgB;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,UAAU,EAAE,CAAC;CACvB;AAKD,MAAM,WAAW,mBAAmB;IAIlC,YAAY,CAAC,EAAE,YAAY,CAAC;IAK5B,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB;AAuBD,wBAAgB,kBAAkB,CAAC,YAAY,SAAS,WAAW,GAAG,WAAW,EAC/E,KAAK,EAAE,OAAO,EACd,IAAI,EAAE,aAAa,CAAC,YAAY,CAAC,EACjC,OAAO,GAAE,mBAAwB,GAChC,IAAI,CAmDN"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../lib/utils/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,mBAAmB,EACxB,kBAAkB,GACnB,MAAM,eAAe,CAAC"}
|