@mage-ui/components 0.0.22 → 0.0.23
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/buttons/button/Button.d.ts +2 -2
- package/dist/components/buttons/button-icon/ButtonIcon.d.ts +2 -2
- package/dist/components/controls/dropdown/Combobox.d.ts +2 -2
- package/dist/components/controls/dropdown/DropdownButton.d.ts +4 -4
- package/dist/components/controls/dropdown/Select.d.ts +2 -2
- package/dist/components/controls/input-file/InputFile.d.ts +2 -2
- package/dist/components/controls/input-password/InputPassword.d.ts +2 -2
- package/dist/components/controls/input-text/InputText.d.ts +2 -2
- package/dist/components/controls/textarea/Textarea.d.ts +2 -2
- package/dist/components/controls/textarea/Textarea.d.ts.map +1 -1
- package/dist/components/data-display/avatar/Avatar.d.ts +2 -2
- package/dist/components/data-display/badge/Badge.d.ts +2 -2
- package/dist/components/data-display/carousel/Carousel.d.ts +2 -2
- package/dist/components/forms/form/Form.d.ts +18 -16
- package/dist/components/forms/form/Form.d.ts.map +1 -1
- package/dist/components/forms/form/Form.js +1 -1
- package/dist/components/forms/form/Form.js.map +1 -1
- package/dist/components/misc/visually-hidden/VisuallyHidden.d.ts +2 -2
- package/dist/components/misc/visually-hidden/VisuallyHidden.d.ts.map +1 -1
- package/dist/components/navigation/breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/components/navigation/tabs/Tabs.d.ts +5 -5
- package/package.json +3 -3
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime13 from "react/jsx-runtime";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/buttons/button/Button.d.ts
|
|
@@ -18,7 +18,7 @@ declare const Button: ({
|
|
|
18
18
|
endSlot,
|
|
19
19
|
children,
|
|
20
20
|
...props
|
|
21
|
-
}: ButtonProps) =>
|
|
21
|
+
}: ButtonProps) => react_jsx_runtime13.JSX.Element;
|
|
22
22
|
//# sourceMappingURL=Button.d.ts.map
|
|
23
23
|
|
|
24
24
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ButtonProps } from "../button/Button.js";
|
|
2
|
-
import * as
|
|
2
|
+
import * as react_jsx_runtime2 from "react/jsx-runtime";
|
|
3
3
|
|
|
4
4
|
//#region src/components/buttons/button-icon/ButtonIcon.d.ts
|
|
5
5
|
type ButtonIconProps = ButtonProps & {
|
|
@@ -15,7 +15,7 @@ declare const ButtonIcon: ({
|
|
|
15
15
|
icon,
|
|
16
16
|
classNames,
|
|
17
17
|
...props
|
|
18
|
-
}: ButtonIconProps) =>
|
|
18
|
+
}: ButtonIconProps) => react_jsx_runtime2.JSX.Element;
|
|
19
19
|
//# sourceMappingURL=ButtonIcon.d.ts.map
|
|
20
20
|
|
|
21
21
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DropdownBaseProps } from "./DropdownBase.js";
|
|
2
2
|
import { InputTextProps } from "../input-text/InputText.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime42 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/controls/dropdown/Combobox.d.ts
|
|
6
6
|
type ComboboxProps = Omit<DropdownBaseProps, 'children' | 'onClick' | 'setQuery' | 'target'> & InputTextProps & {
|
|
@@ -31,7 +31,7 @@ declare const Combobox: ({
|
|
|
31
31
|
create,
|
|
32
32
|
empty,
|
|
33
33
|
...props
|
|
34
|
-
}: ComboboxProps) =>
|
|
34
|
+
}: ComboboxProps) => react_jsx_runtime42.JSX.Element;
|
|
35
35
|
//# sourceMappingURL=Combobox.d.ts.map
|
|
36
36
|
|
|
37
37
|
//#endregion
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as
|
|
2
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime43 from "react/jsx-runtime";
|
|
2
|
+
import * as react44 from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/controls/dropdown/DropdownButton.d.ts
|
|
5
5
|
type DropdownButtonProps = {
|
|
@@ -15,11 +15,11 @@ declare const DropdownButton: {
|
|
|
15
15
|
label,
|
|
16
16
|
classNames,
|
|
17
17
|
children
|
|
18
|
-
}: DropdownButtonProps):
|
|
18
|
+
}: DropdownButtonProps): react_jsx_runtime43.JSX.Element;
|
|
19
19
|
Option: {
|
|
20
20
|
({
|
|
21
21
|
children
|
|
22
|
-
}: DropdownButtonOptionProps):
|
|
22
|
+
}: DropdownButtonOptionProps): react44.ReactNode;
|
|
23
23
|
displayName: string;
|
|
24
24
|
};
|
|
25
25
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DropdownBaseProps } from "./DropdownBase.js";
|
|
2
2
|
import { InputTextProps } from "../input-text/InputText.js";
|
|
3
|
-
import * as
|
|
3
|
+
import * as react_jsx_runtime45 from "react/jsx-runtime";
|
|
4
4
|
|
|
5
5
|
//#region src/components/controls/dropdown/Select.d.ts
|
|
6
6
|
type SelectProps = Omit<DropdownBaseProps, 'children' | 'onClick' | 'setQuery' | 'target'> & InputTextProps & {
|
|
@@ -23,7 +23,7 @@ declare const Select: ({
|
|
|
23
23
|
options,
|
|
24
24
|
classNames,
|
|
25
25
|
...props
|
|
26
|
-
}: SelectProps) =>
|
|
26
|
+
}: SelectProps) => react_jsx_runtime45.JSX.Element;
|
|
27
27
|
//# sourceMappingURL=Select.d.ts.map
|
|
28
28
|
|
|
29
29
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime46 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/controls/input-file/InputFile.d.ts
|
|
4
4
|
type InputFileProps = {
|
|
@@ -26,7 +26,7 @@ declare const InputFile: ({
|
|
|
26
26
|
multiple,
|
|
27
27
|
badgeClassName,
|
|
28
28
|
...props
|
|
29
|
-
}: InputFileProps) =>
|
|
29
|
+
}: InputFileProps) => react_jsx_runtime46.JSX.Element;
|
|
30
30
|
//# sourceMappingURL=InputFile.d.ts.map
|
|
31
31
|
//#endregion
|
|
32
32
|
export { InputFile, InputFileProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime47 from "react/jsx-runtime";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/controls/input-password/InputPassword.d.ts
|
|
@@ -26,7 +26,7 @@ declare const InputPassword: ({
|
|
|
26
26
|
startSlot,
|
|
27
27
|
endSlot,
|
|
28
28
|
...props
|
|
29
|
-
}: InputPasswordProps) =>
|
|
29
|
+
}: InputPasswordProps) => react_jsx_runtime47.JSX.Element;
|
|
30
30
|
//# sourceMappingURL=InputPassword.d.ts.map
|
|
31
31
|
//#endregion
|
|
32
32
|
export { InputPassword, InputPasswordProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime48 from "react/jsx-runtime";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/controls/input-text/InputText.d.ts
|
|
@@ -25,7 +25,7 @@ declare const InputText: ({
|
|
|
25
25
|
startSlot,
|
|
26
26
|
endSlot,
|
|
27
27
|
...props
|
|
28
|
-
}: InputTextProps) =>
|
|
28
|
+
}: InputTextProps) => react_jsx_runtime48.JSX.Element;
|
|
29
29
|
//# sourceMappingURL=InputText.d.ts.map
|
|
30
30
|
//#endregion
|
|
31
31
|
export { InputText, InputTextProps };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime41 from "react/jsx-runtime";
|
|
2
2
|
import { ComponentProps, ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/controls/textarea/Textarea.d.ts
|
|
@@ -27,7 +27,7 @@ declare const Textarea: ({
|
|
|
27
27
|
autosize,
|
|
28
28
|
onChange,
|
|
29
29
|
...props
|
|
30
|
-
}: TextareaProps) =>
|
|
30
|
+
}: TextareaProps) => react_jsx_runtime41.JSX.Element;
|
|
31
31
|
//# sourceMappingURL=Textarea.d.ts.map
|
|
32
32
|
|
|
33
33
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Textarea.d.ts","names":[],"sources":["../../../../src/components/controls/textarea/Textarea.tsx"],"sourcesContent":[],"mappings":";;;;KAcY,aAAA,GAAgB,KAAK;;;EAArB,WAAA,CAAA,EAAA,MAAa;EAAA,KAAA,CAAA,EAAA,MAAA;EAAA,UAAQ,CAAA,EAAA;IAAL,IAAA,CAAA,EAAA,MAAA;IAcd,KAAA,CAAA,EAAA,MAAA;IACF,WAAA,CAAA,EAAA,MAAA;IAAS,KAAA,CAAA,EAAA,MAAA;IAIR,OA0BZ,CAAA,EAAA,MAAA;IAAA,KAAA,CAAA,EAAA,MAAA;IA1BwB,OAAA,CAAA,EAAA,MAAA;EAAA,CAAA;EAAA,SAAA,CAAA,EALX,SAKW;EAAA,OAAA,CAAA,EAJb,SAIa;EAAA,QAAA,CAAA,EAAA,OAAA;CAAA;AAOT,cAPH,QAOG,EAAA,CAAA;EAAA,UAAA;EAAA,SAAA;EAAA,OAAA;EAAA,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAb,aAAa,EAAA,GAAA,
|
|
1
|
+
{"version":3,"file":"Textarea.d.ts","names":[],"sources":["../../../../src/components/controls/textarea/Textarea.tsx"],"sourcesContent":[],"mappings":";;;;KAcY,aAAA,GAAgB,KAAK;;;EAArB,WAAA,CAAA,EAAA,MAAa;EAAA,KAAA,CAAA,EAAA,MAAA;EAAA,UAAQ,CAAA,EAAA;IAAL,IAAA,CAAA,EAAA,MAAA;IAcd,KAAA,CAAA,EAAA,MAAA;IACF,WAAA,CAAA,EAAA,MAAA;IAAS,KAAA,CAAA,EAAA,MAAA;IAIR,OA0BZ,CAAA,EAAA,MAAA;IAAA,KAAA,CAAA,EAAA,MAAA;IA1BwB,OAAA,CAAA,EAAA,MAAA;EAAA,CAAA;EAAA,SAAA,CAAA,EALX,SAKW;EAAA,OAAA,CAAA,EAJb,SAIa;EAAA,QAAA,CAAA,EAAA,OAAA;CAAA;AAOT,cAPH,QAOG,EAAA,CAAA;EAAA,UAAA;EAAA,SAAA;EAAA,OAAA;EAAA,QAAA;EAAA,QAAA;EAAA,GAAA;AAAA,CAAA,EAAb,aAAa,EAAA,GAAA,mBAAA,CAAA,GAAA,CAAA,OAAA;AAmBf"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime10 from "react/jsx-runtime";
|
|
2
2
|
|
|
3
3
|
//#region src/components/data-display/avatar/Avatar.d.ts
|
|
4
4
|
type AvatarProps = {
|
|
@@ -13,7 +13,7 @@ type AvatarProps = {
|
|
|
13
13
|
declare const Avatar: ({
|
|
14
14
|
classNames,
|
|
15
15
|
...props
|
|
16
|
-
}: AvatarProps) =>
|
|
16
|
+
}: AvatarProps) => react_jsx_runtime10.JSX.Element;
|
|
17
17
|
//# sourceMappingURL=Avatar.d.ts.map
|
|
18
18
|
|
|
19
19
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime11 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/data-display/badge/Badge.d.ts
|
|
@@ -17,7 +17,7 @@ declare const Badge: ({
|
|
|
17
17
|
startSlot,
|
|
18
18
|
classNames,
|
|
19
19
|
...props
|
|
20
|
-
}: BadgeProps) =>
|
|
20
|
+
}: BadgeProps) => react_jsx_runtime11.JSX.Element;
|
|
21
21
|
//# sourceMappingURL=Badge.d.ts.map
|
|
22
22
|
|
|
23
23
|
//#endregion
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime12 from "react/jsx-runtime";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/data-display/carousel/Carousel.d.ts
|
|
@@ -36,7 +36,7 @@ declare const Carousel: {
|
|
|
36
36
|
({
|
|
37
37
|
classNames,
|
|
38
38
|
...props
|
|
39
|
-
}: CarouselProps):
|
|
39
|
+
}: CarouselProps): react_jsx_runtime12.JSX.Element;
|
|
40
40
|
Slide: {
|
|
41
41
|
({
|
|
42
42
|
children
|
|
@@ -10,27 +10,29 @@ import { FormSelectProps } from "./controls/FormSelect.js";
|
|
|
10
10
|
import { FormDatePickerProps } from "./controls/FormDatePicker.js";
|
|
11
11
|
import { FormInputFileProps } from "./controls/FormInputFile.js";
|
|
12
12
|
import { FormInputPasswordProps } from "./controls/FormInputPassword.js";
|
|
13
|
-
import * as
|
|
13
|
+
import * as react_jsx_runtime15 from "react/jsx-runtime";
|
|
14
14
|
import { ReactNode } from "react";
|
|
15
15
|
import { ZodRawShape, z } from "zod";
|
|
16
16
|
|
|
17
17
|
//#region src/components/forms/form/Form.d.ts
|
|
18
18
|
type FormProps = {
|
|
19
|
-
children: React.ReactNode;
|
|
20
|
-
rules?: ZodRawShape;
|
|
21
19
|
defaultValues?: object;
|
|
20
|
+
rules?: ZodRawShape;
|
|
21
|
+
onSubmit?: (formData: object) => void;
|
|
22
|
+
children: React.ReactNode;
|
|
22
23
|
};
|
|
23
24
|
declare const Form: {
|
|
24
25
|
({
|
|
25
26
|
defaultValues,
|
|
26
27
|
rules,
|
|
28
|
+
onSubmit,
|
|
27
29
|
children,
|
|
28
30
|
...props
|
|
29
|
-
}: FormProps):
|
|
31
|
+
}: FormProps): react_jsx_runtime15.JSX.Element;
|
|
30
32
|
InputText: {
|
|
31
33
|
({
|
|
32
34
|
...props
|
|
33
|
-
}: FormInputTextProps):
|
|
35
|
+
}: FormInputTextProps): react_jsx_runtime15.JSX.Element;
|
|
34
36
|
displayName: string;
|
|
35
37
|
rules: {
|
|
36
38
|
required: (message?: string, min?: number) => z.ZodString;
|
|
@@ -41,7 +43,7 @@ declare const Form: {
|
|
|
41
43
|
name,
|
|
42
44
|
control,
|
|
43
45
|
...props
|
|
44
|
-
}: FormCheckboxProps):
|
|
46
|
+
}: FormCheckboxProps): react_jsx_runtime15.JSX.Element;
|
|
45
47
|
displayName: string;
|
|
46
48
|
rules: {
|
|
47
49
|
required: (message?: string) => z.ZodEffects<z.ZodBoolean, boolean, boolean>;
|
|
@@ -55,7 +57,7 @@ declare const Form: {
|
|
|
55
57
|
label,
|
|
56
58
|
description,
|
|
57
59
|
error
|
|
58
|
-
}: FormCheckboxGroupProps):
|
|
60
|
+
}: FormCheckboxGroupProps): react_jsx_runtime15.JSX.Element;
|
|
59
61
|
rules: {
|
|
60
62
|
required: (message?: string) => z.ZodArray<z.ZodString, "many">;
|
|
61
63
|
};
|
|
@@ -69,7 +71,7 @@ declare const Form: {
|
|
|
69
71
|
name,
|
|
70
72
|
control,
|
|
71
73
|
...props
|
|
72
|
-
}: FormComboboxProps):
|
|
74
|
+
}: FormComboboxProps): react_jsx_runtime15.JSX.Element;
|
|
73
75
|
displayName: string;
|
|
74
76
|
rules: {
|
|
75
77
|
required: (message?: string, defaultValue?: {
|
|
@@ -101,23 +103,23 @@ declare const Form: {
|
|
|
101
103
|
label,
|
|
102
104
|
description,
|
|
103
105
|
error
|
|
104
|
-
}: FormRadioGroupProps):
|
|
106
|
+
}: FormRadioGroupProps): react_jsx_runtime15.JSX.Element;
|
|
105
107
|
rules: {
|
|
106
108
|
required: (message?: string) => z.ZodEffects<z.ZodString, string, string>;
|
|
107
109
|
};
|
|
108
110
|
Radio: {
|
|
109
|
-
(props: RadioProps):
|
|
111
|
+
(props: RadioProps): react_jsx_runtime15.JSX.Element;
|
|
110
112
|
displayName: string;
|
|
111
113
|
};
|
|
112
114
|
};
|
|
113
115
|
Radio: {
|
|
114
|
-
(props: RadioProps):
|
|
116
|
+
(props: RadioProps): react_jsx_runtime15.JSX.Element;
|
|
115
117
|
displayName: string;
|
|
116
118
|
};
|
|
117
119
|
Textarea: {
|
|
118
120
|
({
|
|
119
121
|
...props
|
|
120
|
-
}: FormTextareaProps):
|
|
122
|
+
}: FormTextareaProps): react_jsx_runtime15.JSX.Element;
|
|
121
123
|
displayName: string;
|
|
122
124
|
rules: {
|
|
123
125
|
required: (message?: string, min?: number) => z.ZodString;
|
|
@@ -128,7 +130,7 @@ declare const Form: {
|
|
|
128
130
|
name,
|
|
129
131
|
control,
|
|
130
132
|
...props
|
|
131
|
-
}: FormSelectProps):
|
|
133
|
+
}: FormSelectProps): react_jsx_runtime15.JSX.Element;
|
|
132
134
|
displayName: string;
|
|
133
135
|
rules: {
|
|
134
136
|
required: (message?: string, defaultValue?: {
|
|
@@ -157,7 +159,7 @@ declare const Form: {
|
|
|
157
159
|
name,
|
|
158
160
|
control,
|
|
159
161
|
...props
|
|
160
|
-
}: FormDatePickerProps):
|
|
162
|
+
}: FormDatePickerProps): react_jsx_runtime15.JSX.Element;
|
|
161
163
|
displayName: string;
|
|
162
164
|
rules: {
|
|
163
165
|
required: (message?: string) => z.ZodEffects<z.ZodUnion<[z.ZodType<Date, z.ZodTypeDef, Date>, z.ZodEffects<z.ZodString, string, string>]>, string | Date, string | Date>;
|
|
@@ -168,7 +170,7 @@ declare const Form: {
|
|
|
168
170
|
control,
|
|
169
171
|
name,
|
|
170
172
|
...props
|
|
171
|
-
}: FormInputFileProps):
|
|
173
|
+
}: FormInputFileProps): react_jsx_runtime15.JSX.Element;
|
|
172
174
|
displayName: string;
|
|
173
175
|
rules: {
|
|
174
176
|
required: (message?: string, min?: number) => z.ZodEffects<z.ZodAny, any, any>;
|
|
@@ -177,7 +179,7 @@ declare const Form: {
|
|
|
177
179
|
InputPassword: {
|
|
178
180
|
({
|
|
179
181
|
...props
|
|
180
|
-
}: FormInputPasswordProps):
|
|
182
|
+
}: FormInputPasswordProps): react_jsx_runtime15.JSX.Element;
|
|
181
183
|
displayName: string;
|
|
182
184
|
rules: {
|
|
183
185
|
required: (message?: string) => z.ZodString;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.d.ts","names":[],"sources":["../../../../src/components/forms/form/Form.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;KAuBY,SAAA
|
|
1
|
+
{"version":3,"file":"Form.d.ts","names":[],"sources":["../../../../src/components/forms/form/Form.tsx"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;;;;;KAuBY,SAAA;;UAEF;;YAEE,KAAA,CAAM;;cAGL;;;;;;;KAMV,YAAS,mBAAA,CAAA,GAAA,CAAA;;;;OAAA;;;;;;EAbA,QAAA,EAAA;IAAS,CAAA;MAAA,IAAA;MAAA,OAAA;MAAA,GAAA;IAAA,CAAA,mBAAA,CAAA,iCAAA;IAEX,WAAA,EAAA,MAAA;IAEE,KAAM,EAAA;MAAS,QAAA,EAAA,CAAA,OAAA,CAAA,EAAA,MAAA,EAAA,eAAA,aAAA,EAAA,OAAA,EAAA,OAAA,CAAA;IAGd,CAAA;EA6BZ,CAAA;EAAA,aAAA,EAAA;;;;;;;;;;;IAvBE,CAAA;IAAS,QAAA,EAAA,CAAA;MAAA,UAAA;MAAA,GAAA;IAAA,CAAA,eAAA,EAAA,YAAA;EAAA,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{FormCheckbox as e}from"./controls/FormCheckbox.js";import{FormCheckboxGroup as t}from"./controls/FormCheckboxGroup.js";import{FormCombobox as n}from"./controls/FormCombobox.js";import{FormDatePicker as r}from"./controls/FormDatePicker.js";import{FormInputFile as i}from"./controls/FormInputFile.js";import{FormInputPassword as a}from"./controls/FormInputPassword.js";import{FormInputText as o}from"./controls/FormInputText.js";import{FormRadio as s}from"./controls/FormRadio.js";import{FormRadioGroup as c}from"./controls/FormRadioGroup.js";import{FormSelect as l}from"./controls/FormSelect.js";import{FormTextarea as u}from"./controls/FormTextarea.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{Children as p,cloneElement as m,isValidElement as h}from"react";import{FormProvider as g,useForm as _}from"react-hook-form";import{z as v}from"zod";import{zodResolver as y}from"@hookform/resolvers/zod";const b=({defaultValues:e,rules:t={},children:
|
|
1
|
+
import{FormCheckbox as e}from"./controls/FormCheckbox.js";import{FormCheckboxGroup as t}from"./controls/FormCheckboxGroup.js";import{FormCombobox as n}from"./controls/FormCombobox.js";import{FormDatePicker as r}from"./controls/FormDatePicker.js";import{FormInputFile as i}from"./controls/FormInputFile.js";import{FormInputPassword as a}from"./controls/FormInputPassword.js";import{FormInputText as o}from"./controls/FormInputText.js";import{FormRadio as s}from"./controls/FormRadio.js";import{FormRadioGroup as c}from"./controls/FormRadioGroup.js";import{FormSelect as l}from"./controls/FormSelect.js";import{FormTextarea as u}from"./controls/FormTextarea.js";import{jsx as d,jsxs as f}from"react/jsx-runtime";import{Children as p,cloneElement as m,isValidElement as h}from"react";import{FormProvider as g,useForm as _}from"react-hook-form";import{z as v}from"zod";import{zodResolver as y}from"@hookform/resolvers/zod";const b=({defaultValues:e,rules:t={},onSubmit:n,children:r,...i})=>{let a=_({shouldFocusError:!0,resolver:y(v.object(t)),defaultValues:e}),{register:o,handleSubmit:s,formState:{errors:c}}=a;return d(g,{...a,children:f(`form`,{onSubmit:s(n),...i,children:[S(r,o,c),d(`button`,{type:`submit`,children:`Submit`})]})})},x=[o,t,e,n,c,s,u,l,r,i,a],S=(e,t,n)=>p.map(e,e=>{if(!h(e))return e;let r=e.props;if(x.some(t=>e.type===t)&&r.name){let i={...r,error:n[r.name]?.message,...t(r.name,{setValueAs:e=>e===``||e===null?void 0:e})};return m(e,i)}return r.children?m(e,r,S(r.children,t,n)):e});b.InputText=o,b.Checkbox=e,b.CheckboxGroup=t,b.Combobox=n,b.RadioGroup=c,b.Radio=s,b.Textarea=u,b.Select=l,b.DatePicker=r,b.InputFile=i,b.InputPassword=a;export{b as Form};
|
|
2
2
|
//# sourceMappingURL=Form.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Form.js","names":["children: React.ReactNode","register: UseFormRegister<Record<string, string>>","errors: FieldErrors","value: unknown"],"sources":["../../../../src/components/forms/form/Form.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, type ReactNode } from 'react';\nimport {\n type FieldErrors,\n FormProvider,\n type UseFormRegister,\n useForm,\n} from 'react-hook-form';\nimport { type ZodRawShape, z } from 'zod';\n\nimport { zodResolver } from '@hookform/resolvers/zod';\n\nimport { FormCheckbox } from './controls/FormCheckbox';\nimport { FormCheckboxGroup } from './controls/FormCheckboxGroup';\nimport { FormCombobox } from './controls/FormCombobox';\nimport { FormDatePicker } from './controls/FormDatePicker';\nimport { FormInputFile } from './controls/FormInputFile';\nimport { FormInputPassword } from './controls/FormInputPassword';\nimport { FormInputText } from './controls/FormInputText';\nimport { FormRadio } from './controls/FormRadio';\nimport { FormRadioGroup } from './controls/FormRadioGroup';\nimport { FormSelect } from './controls/FormSelect';\nimport { FormTextarea } from './controls/FormTextarea';\n\nexport type FormProps = {\n
|
|
1
|
+
{"version":3,"file":"Form.js","names":["children: React.ReactNode","register: UseFormRegister<Record<string, string>>","errors: FieldErrors","value: unknown"],"sources":["../../../../src/components/forms/form/Form.tsx"],"sourcesContent":["import { Children, cloneElement, isValidElement, type ReactNode } from 'react';\nimport {\n type FieldErrors,\n FormProvider,\n type UseFormRegister,\n useForm,\n} from 'react-hook-form';\nimport { type ZodRawShape, z } from 'zod';\n\nimport { zodResolver } from '@hookform/resolvers/zod';\n\nimport { FormCheckbox } from './controls/FormCheckbox';\nimport { FormCheckboxGroup } from './controls/FormCheckboxGroup';\nimport { FormCombobox } from './controls/FormCombobox';\nimport { FormDatePicker } from './controls/FormDatePicker';\nimport { FormInputFile } from './controls/FormInputFile';\nimport { FormInputPassword } from './controls/FormInputPassword';\nimport { FormInputText } from './controls/FormInputText';\nimport { FormRadio } from './controls/FormRadio';\nimport { FormRadioGroup } from './controls/FormRadioGroup';\nimport { FormSelect } from './controls/FormSelect';\nimport { FormTextarea } from './controls/FormTextarea';\n\nexport type FormProps = {\n defaultValues?: object;\n rules?: ZodRawShape;\n onSubmit?: (formData: object) => void;\n children: React.ReactNode;\n};\n\nexport const Form = ({\n defaultValues,\n rules = {},\n onSubmit,\n children,\n ...props\n}: FormProps) => {\n const form = useForm({\n shouldFocusError: true,\n resolver: zodResolver(z.object(rules)),\n defaultValues,\n });\n const {\n register,\n handleSubmit,\n formState: { errors },\n } = form;\n\n return (\n <FormProvider {...form}>\n <form\n onSubmit={handleSubmit(onSubmit)}\n {...props}\n >\n {renderChildrenRecursively(children, register, errors)}\n <button type='submit'>Submit</button>\n </form>\n </FormProvider>\n );\n};\n\nconst controlList = [\n FormInputText,\n FormCheckboxGroup,\n FormCheckbox,\n FormCombobox,\n FormRadioGroup,\n FormRadio,\n FormTextarea,\n FormSelect,\n FormDatePicker,\n FormInputFile,\n FormInputPassword,\n];\n\nconst renderChildrenRecursively = (\n children: React.ReactNode,\n register: UseFormRegister<Record<string, string>>,\n errors: FieldErrors,\n): ReactNode => {\n return Children.map(children, (child) => {\n if (!isValidElement(child)) {\n return child;\n }\n\n const props = child.props as {\n name?: string;\n type?: string;\n children?: ReactNode;\n };\n\n if (controlList.some((control) => child.type === control)) {\n if (props.name) {\n const newProps = {\n ...props,\n error: errors[props.name]?.message,\n ...register(props.name, {\n setValueAs: (value: unknown) =>\n value === '' || value === null ? undefined : value,\n }),\n };\n return cloneElement(child, newProps);\n }\n }\n\n if (props.children) {\n return cloneElement(\n child,\n props,\n renderChildrenRecursively(props.children, register, errors),\n );\n }\n\n return child;\n });\n};\n\nForm.InputText = FormInputText;\nForm.Checkbox = FormCheckbox;\nForm.CheckboxGroup = FormCheckboxGroup;\nForm.Combobox = FormCombobox;\nForm.RadioGroup = FormRadioGroup;\nForm.Radio = FormRadio;\nForm.Textarea = FormTextarea;\nForm.Select = FormSelect;\nForm.DatePicker = FormDatePicker;\nForm.InputFile = FormInputFile;\nForm.InputPassword = FormInputPassword;\n"],"mappings":"u5BA2EA,MA7Ca,EAAO,CAAC,CACnB,gBACA,QAAQ,CAAE,EACV,WACA,WACA,GAAG,EACO,GAAK,CAMf,IALM,EAAO,EAAQ,CACnB,kBAAkB,EAClB,SAAU,EAAY,EAAE,OAAO,EAAM,CAAC,CACtC,eACD,EAAC,CACI,CACJ,WACA,eACA,UAAW,CAAE,SAAQ,CACtB,CAAG,EAEJ,MACE,GAAC,EAAA,CAAa,GAAI,WAChB,EAAC,OAAA,CACC,SAAU,EAAa,EAAS,CAChC,GAAI,YAEH,EAA0B,EAAU,EAAU,EAAO,CACtD,EAAC,SAAA,CAAO,KAAK,kBAAS,UAAe,GAChC,EACM,AAElB,EAEK,EAAc,CAClB,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,EACA,CACD,EAEK,EAA4B,CAChCA,EACAC,EACAC,IAEO,EAAS,IAAI,EAAU,AAAC,GAAU,CACvC,IAAK,EAAe,EAAM,CACxB,OAAO,EAGT,IAAM,EAAQ,EAAM,MAMpB,GAAI,EAAY,KAAK,AAAC,GAAY,EAAM,OAAS,EAAQ,EACnD,EAAM,KAAM,CACd,IAAM,EAAW,CACf,GAAG,EACH,MAAO,EAAO,EAAM,OAAO,QAC3B,GAAG,EAAS,EAAM,KAAM,CACtB,WAAY,AAACC,GACX,IAAU,IAAM,IAAU,SAAA,GAAmB,CAChD,EAAC,AACH,EACD,MAAO,GAAa,EAAO,EAAS,AACrC,CAWH,OARI,EAAM,SACD,EACL,EACA,EACA,EAA0B,EAAM,SAAU,EAAU,EAAO,CAC5D,CAGI,CACR,EAAC,CAaJ,AAVA,EAAK,UAAY,EACjB,EAAK,SAAW,EAChB,EAAK,cAAgB,EACrB,EAAK,SAAW,EAChB,EAAK,WAAa,EAClB,EAAK,MAAQ,EACb,EAAK,SAAW,EAChB,EAAK,OAAS,EACd,EAAK,WAAa,EAClB,EAAK,UAAY,EACjB,EAAK,cAAgB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime1 from "react/jsx-runtime";
|
|
2
2
|
import React from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/misc/visually-hidden/VisuallyHidden.d.ts
|
|
@@ -7,7 +7,7 @@ type VisuallyHiddenProps = {
|
|
|
7
7
|
};
|
|
8
8
|
declare const VisuallyHidden: ({
|
|
9
9
|
children
|
|
10
|
-
}: VisuallyHiddenProps) =>
|
|
10
|
+
}: VisuallyHiddenProps) => react_jsx_runtime1.JSX.Element;
|
|
11
11
|
//# sourceMappingURL=VisuallyHidden.d.ts.map
|
|
12
12
|
|
|
13
13
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"VisuallyHidden.d.ts","names":[],"sources":["../../../../src/components/misc/visually-hidden/VisuallyHidden.tsx"],"sourcesContent":[],"mappings":";;;;KAKY,mBAAA;YACA,KAAA,CAAM;;AADN,cAIC,cAJkB,EACnB,CAAA;EAAA;AAAe,CAAT,EAG2B,mBAHlB,EAAA,GAGqC,
|
|
1
|
+
{"version":3,"file":"VisuallyHidden.d.ts","names":[],"sources":["../../../../src/components/misc/visually-hidden/VisuallyHidden.tsx"],"sourcesContent":[],"mappings":";;;;KAKY,mBAAA;YACA,KAAA,CAAM;;AADN,cAIC,cAJkB,EACnB,CAAA;EAAA;AAAe,CAAT,EAG2B,mBAHlB,EAAA,GAGqC,kBAAA,CAAA,GAAA,CAAA,OAHrC;AAG3B"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react_jsx_runtime14 from "react/jsx-runtime";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
//#region src/components/navigation/breadcrumbs/Breadcrumbs.d.ts
|
|
@@ -17,7 +17,7 @@ declare const Breadcrumbs: {
|
|
|
17
17
|
separator,
|
|
18
18
|
children,
|
|
19
19
|
classNames
|
|
20
|
-
}: BreadcrumbsProps):
|
|
20
|
+
}: BreadcrumbsProps): react_jsx_runtime14.JSX.Element;
|
|
21
21
|
Item: {
|
|
22
22
|
({
|
|
23
23
|
children
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TabsListProps } from "./TabsList.js";
|
|
2
2
|
import { TabsTabProps } from "./TabsTab.js";
|
|
3
3
|
import { TabsPanelProps } from "./TabsPanel.js";
|
|
4
|
-
import * as
|
|
4
|
+
import * as react_jsx_runtime3 from "react/jsx-runtime";
|
|
5
5
|
import React from "react";
|
|
6
6
|
|
|
7
7
|
//#region src/components/navigation/tabs/Tabs.d.ts
|
|
@@ -18,14 +18,14 @@ declare const Tabs: {
|
|
|
18
18
|
classNames,
|
|
19
19
|
children,
|
|
20
20
|
...props
|
|
21
|
-
}: TabsProps):
|
|
21
|
+
}: TabsProps): react_jsx_runtime3.JSX.Element;
|
|
22
22
|
displayName: string;
|
|
23
23
|
List: {
|
|
24
24
|
({
|
|
25
25
|
classNames,
|
|
26
26
|
children,
|
|
27
27
|
...props
|
|
28
|
-
}: TabsListProps):
|
|
28
|
+
}: TabsListProps): react_jsx_runtime3.JSX.Element;
|
|
29
29
|
displayName: string;
|
|
30
30
|
};
|
|
31
31
|
Tab: {
|
|
@@ -35,7 +35,7 @@ declare const Tabs: {
|
|
|
35
35
|
endSlot,
|
|
36
36
|
children,
|
|
37
37
|
...props
|
|
38
|
-
}: TabsTabProps):
|
|
38
|
+
}: TabsTabProps): react_jsx_runtime3.JSX.Element;
|
|
39
39
|
displayName: string;
|
|
40
40
|
};
|
|
41
41
|
Panel: {
|
|
@@ -43,7 +43,7 @@ declare const Tabs: {
|
|
|
43
43
|
classNames,
|
|
44
44
|
children,
|
|
45
45
|
...props
|
|
46
|
-
}: TabsPanelProps):
|
|
46
|
+
}: TabsPanelProps): react_jsx_runtime3.JSX.Element;
|
|
47
47
|
displayName: string;
|
|
48
48
|
};
|
|
49
49
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mage-ui/components",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [],
|
|
@@ -42,8 +42,8 @@
|
|
|
42
42
|
"react-dom": "^19.1.0",
|
|
43
43
|
"react-hook-form": "^7.56.4",
|
|
44
44
|
"zod": "^3.25.42",
|
|
45
|
-
"@mage-ui/preset": "0.0.
|
|
46
|
-
"@mage-ui/styled-system": "0.0.
|
|
45
|
+
"@mage-ui/preset": "0.0.23",
|
|
46
|
+
"@mage-ui/styled-system": "0.0.23"
|
|
47
47
|
},
|
|
48
48
|
"engines": {
|
|
49
49
|
"node": ">=22.14.0"
|