@vritti/quantum-ui 0.1.23 → 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.
- package/dist/Button.d.ts +10 -3
- package/dist/Button.js +21 -36
- package/dist/Button.js.map +1 -1
- package/dist/Button2.js +42 -0
- package/dist/Button2.js.map +1 -0
- package/dist/Card.d.ts +8 -8
- package/dist/Card.js.map +1 -1
- package/dist/Checkbox.d.ts +5 -8
- package/dist/Checkbox.js +41 -30
- package/dist/Checkbox.js.map +1 -1
- package/dist/DatePicker.d.ts +4 -4
- package/dist/DatePicker.js +4055 -246
- package/dist/DatePicker.js.map +1 -1
- package/dist/Form.d.ts +70 -88
- package/dist/Form.js +34 -30
- package/dist/Form.js.map +1 -1
- package/dist/Label.js.map +1 -1
- package/dist/OTPField.js +2 -12
- package/dist/OTPField.js.map +1 -1
- package/dist/PasswordField.js.map +1 -1
- package/dist/PhoneField.js +6 -12
- package/dist/PhoneField.js.map +1 -1
- package/dist/Skeleton.d.ts +1 -1
- package/dist/Skeleton.js +2 -11
- package/dist/Skeleton.js.map +1 -1
- package/dist/Spinner.d.ts +14 -0
- package/dist/Spinner.js +31 -0
- package/dist/Spinner.js.map +1 -0
- package/dist/TextArea.js +4 -10
- package/dist/TextArea.js.map +1 -1
- package/dist/TextField.js +18 -2
- package/dist/TextField.js.map +1 -1
- package/dist/ThemeToggle.js.map +1 -1
- package/dist/Typography.js.map +1 -1
- package/dist/assets/quantum-ui.css +47 -31
- package/dist/axios.d.ts +1 -1
- package/dist/axios.js +11 -16
- package/dist/axios.js.map +1 -1
- package/dist/components/Button.js +2 -1
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Form.js +1 -1
- package/dist/components/Progress.js +2 -5
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/{DataTable.d.ts → Spinner.d.ts} +1 -1
- package/dist/components/Spinner.js +2 -0
- package/dist/components/Spinner.js.map +1 -0
- package/dist/createLucideIcon.js.map +1 -1
- package/dist/field.js +25 -143
- package/dist/field.js.map +1 -1
- package/dist/index.d.ts +107 -134
- package/dist/index.js +4 -3
- package/dist/index.js.map +1 -1
- package/dist/index2.js +54 -116
- package/dist/index2.js.map +1 -1
- package/dist/index3.js +103 -1
- package/dist/index3.js.map +1 -1
- package/dist/index4.js +31 -55
- package/dist/index4.js.map +1 -1
- package/dist/index5.js +86 -2
- package/dist/index5.js.map +1 -1
- package/dist/index6.js +1 -1
- package/dist/index6.js.map +1 -1
- package/dist/utils/axios.d.ts +1 -1
- package/dist/utils/axios.js +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +21 -19
- package/dist/Combination.js +0 -3869
- package/dist/Combination.js.map +0 -1
- package/dist/DataTable.d.ts +0 -31
- package/dist/DataTable.js +0 -4989
- package/dist/DataTable.js.map +0 -1
- package/dist/Input.js +0 -22
- package/dist/Input.js.map +0 -1
- package/dist/check.js +0 -15
- package/dist/check.js.map +0 -1
- package/dist/components/DataTable.js +0 -2
- 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,10 +11,9 @@ 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;
|
|
@@ -32,7 +29,9 @@ export declare interface AxiosConfig {
|
|
|
32
29
|
headers?: Record<string, string>;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
export declare
|
|
32
|
+
export declare const Button: React_2.ForwardRefExoticComponent<Omit<ButtonProps, "ref"> & React_2.RefAttributes<HTMLButtonElement>>;
|
|
33
|
+
|
|
34
|
+
declare function Button_2({
|
|
36
35
|
className,
|
|
37
36
|
variant,
|
|
38
37
|
size,
|
|
@@ -44,7 +43,12 @@ VariantProps<typeof buttonVariants> & {
|
|
|
44
43
|
}) {
|
|
45
44
|
const Comp = asChild ? Slot : 'button';
|
|
46
45
|
|
|
47
|
-
return <Comp data-slot=
|
|
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;
|
|
48
52
|
}
|
|
49
53
|
|
|
50
54
|
export declare const buttonVariants = cva(
|
|
@@ -72,19 +76,19 @@ export declare const buttonVariants = cva(
|
|
|
72
76
|
variant: 'default',
|
|
73
77
|
size: 'default',
|
|
74
78
|
},
|
|
75
|
-
}
|
|
79
|
+
},
|
|
76
80
|
);
|
|
77
81
|
|
|
78
82
|
declare type CalendarProps = React_2.ComponentProps<typeof DayPicker> & {
|
|
79
|
-
buttonVariant?: React_2.ComponentProps<typeof
|
|
80
|
-
}
|
|
83
|
+
buttonVariant?: React_2.ComponentProps<typeof Button_2>['variant'];
|
|
84
|
+
};
|
|
81
85
|
|
|
82
86
|
export declare function cancelTokenRefresh(): void;
|
|
83
87
|
|
|
84
88
|
export declare function Card({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
85
89
|
return (
|
|
86
90
|
<div
|
|
87
|
-
data-slot=
|
|
91
|
+
data-slot="card"
|
|
88
92
|
className={cn('bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm', className)}
|
|
89
93
|
{...props}
|
|
90
94
|
/>
|
|
@@ -92,26 +96,26 @@ export declare function Card({ className, ...props }: React_2.ComponentProps<'di
|
|
|
92
96
|
}
|
|
93
97
|
|
|
94
98
|
export declare function CardContent({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
95
|
-
return <div data-slot=
|
|
99
|
+
return <div data-slot="card-content" className={cn('px-6', className)} {...props} />;
|
|
96
100
|
}
|
|
97
101
|
|
|
98
102
|
export declare function CardDescription({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
99
|
-
return <div data-slot=
|
|
103
|
+
return <div data-slot="card-description" className={cn('text-muted-foreground text-sm', className)} {...props} />;
|
|
100
104
|
}
|
|
101
105
|
|
|
102
106
|
export declare function CardFooter({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
103
107
|
return (
|
|
104
|
-
<div data-slot=
|
|
108
|
+
<div data-slot="card-footer" className={cn('flex items-center px-6 [.border-t]:pt-6', className)} {...props} />
|
|
105
109
|
);
|
|
106
110
|
}
|
|
107
111
|
|
|
108
112
|
export declare function CardHeader({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
109
113
|
return (
|
|
110
114
|
<div
|
|
111
|
-
data-slot=
|
|
115
|
+
data-slot="card-header"
|
|
112
116
|
className={cn(
|
|
113
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',
|
|
114
|
-
className
|
|
118
|
+
className,
|
|
115
119
|
)}
|
|
116
120
|
{...props}
|
|
117
121
|
/>
|
|
@@ -119,21 +123,18 @@ export declare function CardHeader({ className, ...props }: React_2.ComponentPro
|
|
|
119
123
|
}
|
|
120
124
|
|
|
121
125
|
export declare function CardTitle({ className, ...props }: React_2.ComponentProps<'div'>) {
|
|
122
|
-
return <div data-slot=
|
|
126
|
+
return <div data-slot="card-title" className={cn('leading-none font-semibold', className)} {...props} />;
|
|
123
127
|
}
|
|
124
128
|
|
|
125
129
|
export declare const Checkbox: default_2.ForwardRefExoticComponent<CheckboxProps & default_2.RefAttributes<HTMLButtonElement>>;
|
|
126
130
|
|
|
127
|
-
declare function Checkbox_2({
|
|
128
|
-
className,
|
|
129
|
-
...props
|
|
130
|
-
}: React_2.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
131
|
+
declare function Checkbox_2({ className, ...props }: React_2.ComponentProps<typeof CheckboxPrimitive.Root>) {
|
|
131
132
|
return (
|
|
132
133
|
<CheckboxPrimitive.Root
|
|
133
134
|
data-slot="checkbox"
|
|
134
135
|
className={cn(
|
|
135
|
-
|
|
136
|
-
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,
|
|
137
138
|
)}
|
|
138
139
|
{...props}
|
|
139
140
|
>
|
|
@@ -144,7 +145,7 @@ declare function Checkbox_2({
|
|
|
144
145
|
<CheckIcon className="size-3.5" />
|
|
145
146
|
</CheckboxPrimitive.Indicator>
|
|
146
147
|
</CheckboxPrimitive.Root>
|
|
147
|
-
)
|
|
148
|
+
);
|
|
148
149
|
}
|
|
149
150
|
|
|
150
151
|
declare interface CheckboxProps extends default_2.ComponentPropsWithoutRef<typeof Checkbox_2> {
|
|
@@ -177,29 +178,6 @@ declare let currentConfig: {
|
|
|
177
178
|
auth: AuthConfig;
|
|
178
179
|
};
|
|
179
180
|
|
|
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
181
|
export declare const DatePicker: React_2.ForwardRefExoticComponent<DatePickerProps & React_2.RefAttributes<HTMLButtonElement>>;
|
|
204
182
|
|
|
205
183
|
export declare interface DatePickerProps {
|
|
@@ -220,9 +198,9 @@ export declare function defineConfig(config: QuantumUIConfig): QuantumUIConfig;
|
|
|
220
198
|
|
|
221
199
|
export declare function Field({
|
|
222
200
|
className,
|
|
223
|
-
orientation =
|
|
201
|
+
orientation = 'vertical',
|
|
224
202
|
...props
|
|
225
|
-
}: React.ComponentProps<
|
|
203
|
+
}: React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>) {
|
|
226
204
|
return (
|
|
227
205
|
<div
|
|
228
206
|
role="group"
|
|
@@ -231,35 +209,32 @@ export declare function Field({
|
|
|
231
209
|
className={cn(fieldVariants({ orientation }), className)}
|
|
232
210
|
{...props}
|
|
233
211
|
/>
|
|
234
|
-
)
|
|
212
|
+
);
|
|
235
213
|
}
|
|
236
214
|
|
|
237
|
-
export declare function FieldContent({ className, ...props }: React.ComponentProps<
|
|
215
|
+
export declare function FieldContent({ className, ...props }: React.ComponentProps<'div'>) {
|
|
238
216
|
return (
|
|
239
217
|
<div
|
|
240
218
|
data-slot="field-content"
|
|
241
|
-
className={cn(
|
|
242
|
-
"group/field-content flex flex-1 flex-col gap-1.5 leading-snug",
|
|
243
|
-
className
|
|
244
|
-
)}
|
|
219
|
+
className={cn('group/field-content flex flex-1 flex-col gap-1.5 leading-snug', className)}
|
|
245
220
|
{...props}
|
|
246
221
|
/>
|
|
247
|
-
)
|
|
222
|
+
);
|
|
248
223
|
}
|
|
249
224
|
|
|
250
|
-
export declare function FieldDescription({ className, ...props }: React.ComponentProps<
|
|
225
|
+
export declare function FieldDescription({ className, ...props }: React.ComponentProps<'p'>) {
|
|
251
226
|
return (
|
|
252
227
|
<p
|
|
253
228
|
data-slot="field-description"
|
|
254
229
|
className={cn(
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
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,
|
|
259
234
|
)}
|
|
260
235
|
{...props}
|
|
261
236
|
/>
|
|
262
|
-
)
|
|
237
|
+
);
|
|
263
238
|
}
|
|
264
239
|
|
|
265
240
|
export declare function FieldError({
|
|
@@ -267,97 +242,86 @@ export declare function FieldError({
|
|
|
267
242
|
children,
|
|
268
243
|
errors,
|
|
269
244
|
...props
|
|
270
|
-
}: React.ComponentProps<
|
|
271
|
-
errors?: Array<{ message?: string } | undefined
|
|
245
|
+
}: React.ComponentProps<'div'> & {
|
|
246
|
+
errors?: Array<{ message?: string } | undefined>;
|
|
272
247
|
}) {
|
|
273
248
|
const content = useMemo(() => {
|
|
274
249
|
if (children) {
|
|
275
|
-
return children
|
|
250
|
+
return children;
|
|
276
251
|
}
|
|
277
252
|
|
|
278
253
|
if (!errors?.length) {
|
|
279
|
-
return null
|
|
254
|
+
return null;
|
|
280
255
|
}
|
|
281
256
|
|
|
282
|
-
if (errors?.length
|
|
283
|
-
return errors[0]?.message
|
|
257
|
+
if (errors?.length === 1) {
|
|
258
|
+
return errors[0]?.message;
|
|
284
259
|
}
|
|
285
260
|
|
|
286
261
|
return (
|
|
287
262
|
<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
|
-
)}
|
|
263
|
+
{errors.map((error) => error?.message && <li key={error.message}>{error.message}</li>)}
|
|
292
264
|
</ul>
|
|
293
|
-
)
|
|
294
|
-
}, [children, errors])
|
|
265
|
+
);
|
|
266
|
+
}, [children, errors]);
|
|
295
267
|
|
|
296
268
|
if (!content) {
|
|
297
|
-
return null
|
|
269
|
+
return null;
|
|
298
270
|
}
|
|
299
271
|
|
|
300
272
|
return (
|
|
301
273
|
<div
|
|
302
274
|
role="alert"
|
|
303
275
|
data-slot="field-error"
|
|
304
|
-
className={cn(
|
|
276
|
+
className={cn('text-destructive text-sm font-normal', className)}
|
|
305
277
|
{...props}
|
|
306
278
|
>
|
|
307
279
|
{content}
|
|
308
280
|
</div>
|
|
309
|
-
)
|
|
281
|
+
);
|
|
310
282
|
}
|
|
311
283
|
|
|
312
|
-
export declare function FieldGroup({ className, ...props }: React.ComponentProps<
|
|
284
|
+
export declare function FieldGroup({ className, ...props }: React.ComponentProps<'div'>) {
|
|
313
285
|
return (
|
|
314
286
|
<div
|
|
315
287
|
data-slot="field-group"
|
|
316
288
|
className={cn(
|
|
317
|
-
|
|
318
|
-
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,
|
|
319
291
|
)}
|
|
320
292
|
{...props}
|
|
321
293
|
/>
|
|
322
|
-
)
|
|
294
|
+
);
|
|
323
295
|
}
|
|
324
296
|
|
|
325
|
-
export declare function FieldLabel({
|
|
326
|
-
className,
|
|
327
|
-
...props
|
|
328
|
-
}: React.ComponentProps<typeof Label>) {
|
|
297
|
+
export declare function FieldLabel({ className, ...props }: React.ComponentProps<typeof Label>) {
|
|
329
298
|
return (
|
|
330
299
|
<Label
|
|
331
300
|
data-slot="field-label"
|
|
332
301
|
className={cn(
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
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,
|
|
337
306
|
)}
|
|
338
307
|
{...props}
|
|
339
308
|
/>
|
|
340
|
-
)
|
|
309
|
+
);
|
|
341
310
|
}
|
|
342
311
|
|
|
343
312
|
export declare function FieldLegend({
|
|
344
313
|
className,
|
|
345
|
-
variant =
|
|
314
|
+
variant = 'legend',
|
|
346
315
|
...props
|
|
347
|
-
}: React.ComponentProps<
|
|
316
|
+
}: React.ComponentProps<'legend'> & { variant?: 'legend' | 'label' }) {
|
|
348
317
|
return (
|
|
349
318
|
<legend
|
|
350
319
|
data-slot="field-legend"
|
|
351
320
|
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
|
-
)}
|
|
321
|
+
className={cn('mb-3 font-medium', 'data-[variant=legend]:text-base', 'data-[variant=label]:text-sm', className)}
|
|
358
322
|
{...props}
|
|
359
323
|
/>
|
|
360
|
-
)
|
|
324
|
+
);
|
|
361
325
|
}
|
|
362
326
|
|
|
363
327
|
declare interface FieldMapping {
|
|
@@ -368,17 +332,14 @@ export declare function FieldSeparator({
|
|
|
368
332
|
children,
|
|
369
333
|
className,
|
|
370
334
|
...props
|
|
371
|
-
}: React.ComponentProps<
|
|
372
|
-
children?: React.ReactNode
|
|
335
|
+
}: React.ComponentProps<'div'> & {
|
|
336
|
+
children?: React.ReactNode;
|
|
373
337
|
}) {
|
|
374
338
|
return (
|
|
375
339
|
<div
|
|
376
340
|
data-slot="field-separator"
|
|
377
341
|
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
|
-
)}
|
|
342
|
+
className={cn('relative -my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2', className)}
|
|
382
343
|
{...props}
|
|
383
344
|
>
|
|
384
345
|
<Separator className="absolute inset-0 top-1/2" />
|
|
@@ -391,74 +352,73 @@ export declare function FieldSeparator({
|
|
|
391
352
|
</span>
|
|
392
353
|
)}
|
|
393
354
|
</div>
|
|
394
|
-
)
|
|
355
|
+
);
|
|
395
356
|
}
|
|
396
357
|
|
|
397
|
-
export declare function FieldSet({ className, ...props }: React.ComponentProps<
|
|
358
|
+
export declare function FieldSet({ className, ...props }: React.ComponentProps<'fieldset'>) {
|
|
398
359
|
return (
|
|
399
360
|
<fieldset
|
|
400
361
|
data-slot="field-set"
|
|
401
362
|
className={cn(
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
className
|
|
363
|
+
'flex flex-col gap-4',
|
|
364
|
+
'has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3',
|
|
365
|
+
className,
|
|
405
366
|
)}
|
|
406
367
|
{...props}
|
|
407
368
|
/>
|
|
408
|
-
)
|
|
369
|
+
);
|
|
409
370
|
}
|
|
410
371
|
|
|
411
|
-
export declare function FieldTitle({ className, ...props }: React.ComponentProps<
|
|
372
|
+
export declare function FieldTitle({ className, ...props }: React.ComponentProps<'div'>) {
|
|
412
373
|
return (
|
|
413
374
|
<div
|
|
414
375
|
data-slot="field-label"
|
|
415
376
|
className={cn(
|
|
416
|
-
|
|
417
|
-
className
|
|
377
|
+
'flex w-fit items-center gap-2 text-sm leading-snug font-medium group-data-[disabled=true]/field:opacity-50',
|
|
378
|
+
className,
|
|
418
379
|
)}
|
|
419
380
|
{...props}
|
|
420
381
|
/>
|
|
421
|
-
)
|
|
382
|
+
);
|
|
422
383
|
}
|
|
423
384
|
|
|
424
|
-
declare const fieldVariants = cva(
|
|
425
|
-
"group/field flex w-full gap-2 data-[invalid=true]:text-destructive",
|
|
426
|
-
{
|
|
385
|
+
declare const fieldVariants = cva('group/field flex w-full gap-2 data-[invalid=true]:text-destructive', {
|
|
427
386
|
variants: {
|
|
428
387
|
orientation: {
|
|
429
|
-
vertical: [
|
|
388
|
+
vertical: ['flex-col [&>*]:w-full [&>.sr-only]:w-auto'],
|
|
430
389
|
horizontal: [
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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',
|
|
434
393
|
],
|
|
435
394
|
responsive: [
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
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',
|
|
439
398
|
],
|
|
440
399
|
},
|
|
441
400
|
},
|
|
442
401
|
defaultVariants: {
|
|
443
|
-
orientation:
|
|
402
|
+
orientation: 'vertical',
|
|
444
403
|
},
|
|
445
|
-
}
|
|
446
|
-
);
|
|
404
|
+
});
|
|
447
405
|
|
|
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;
|
|
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;
|
|
449
407
|
|
|
450
408
|
export declare namespace Form {
|
|
451
409
|
var displayName: string;
|
|
452
410
|
}
|
|
453
411
|
|
|
454
|
-
export declare interface FormProps<TFieldValues extends FieldValues = FieldValues, TContext = any, TTransformedValues extends FieldValues | undefined = TFieldValues> extends Omit<
|
|
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'> {
|
|
455
413
|
form: UseFormReturn<TFieldValues, TContext, TTransformedValues>;
|
|
456
|
-
onSubmit
|
|
457
|
-
children:
|
|
414
|
+
onSubmit?: Parameters<UseFormReturn<TFieldValues, TContext, TTransformedValues>['handleSubmit']>[0];
|
|
415
|
+
children: React_2.ReactNode;
|
|
458
416
|
showRootError?: boolean;
|
|
459
417
|
rootErrorPosition?: 'top' | 'bottom';
|
|
460
418
|
rootErrorClassName?: string;
|
|
461
419
|
fieldMapping?: FieldMapping;
|
|
420
|
+
mutation?: UseMutationResult<TMutationData, TMutationError, TMutationVariables, unknown>;
|
|
421
|
+
transformSubmit?: (data: TTransformedValues extends undefined ? TFieldValues : TTransformedValues) => TMutationVariables;
|
|
462
422
|
}
|
|
463
423
|
|
|
464
424
|
export declare function getConfig(): typeof currentConfig;
|
|
@@ -472,10 +432,10 @@ export { isValidPhoneNumber }
|
|
|
472
432
|
declare function Label({ className, ...props }: React_2.ComponentProps<typeof LabelPrimitive.Root>) {
|
|
473
433
|
return (
|
|
474
434
|
<LabelPrimitive.Root
|
|
475
|
-
data-slot=
|
|
435
|
+
data-slot="label"
|
|
476
436
|
className={cn(
|
|
477
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',
|
|
478
|
-
className
|
|
438
|
+
className,
|
|
479
439
|
)}
|
|
480
440
|
{...props}
|
|
481
441
|
/>
|
|
@@ -527,7 +487,7 @@ export declare interface QuantumUIConfig {
|
|
|
527
487
|
auth?: Partial<AuthConfig>;
|
|
528
488
|
}
|
|
529
489
|
|
|
530
|
-
export declare function
|
|
490
|
+
export declare function recoverToken(): Promise<{
|
|
531
491
|
success: boolean;
|
|
532
492
|
expiresIn: number;
|
|
533
493
|
}>;
|
|
@@ -542,6 +502,19 @@ export declare const setToken: (token: string) => void;
|
|
|
542
502
|
|
|
543
503
|
export declare function Skeleton({ className, ...props }: React_2.HTMLAttributes<HTMLDivElement>): JSX.Element;
|
|
544
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
|
+
}
|
|
517
|
+
|
|
545
518
|
export declare const TextArea: default_2.ForwardRefExoticComponent<Omit<TextAreaProps, "ref"> & default_2.RefAttributes<HTMLTextAreaElement>>;
|
|
546
519
|
|
|
547
520
|
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,
|
|
3
|
-
export { B as Button
|
|
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":";;;;;;;;;;;;;;;;;"}
|