@bouko/react 2.3.6 → 2.3.8
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/animate/configs.d.ts +136 -136
- package/dist/components/animate/configs.js +62 -62
- package/dist/components/animate/index.d.ts +12 -12
- package/dist/components/animate/index.js +7 -7
- package/dist/components/attachment.d.ts +2 -2
- package/dist/components/attachment.js +18 -19
- package/dist/components/button/load.d.ts +10 -10
- package/dist/components/button/load.js +35 -35
- package/dist/components/button.d.ts +10 -10
- package/dist/components/button.js +22 -22
- package/dist/components/carousel/index.d.ts +7 -7
- package/dist/components/carousel/index.js +15 -15
- package/dist/components/checkbox.d.ts +8 -8
- package/dist/components/checkbox.js +13 -13
- package/dist/components/dropdown/normal.d.ts +10 -10
- package/dist/components/dropdown/normal.js +19 -19
- package/dist/components/fade-carousel.d.ts +4 -4
- package/dist/components/fade-carousel.js +14 -14
- package/dist/components/field.d.ts +10 -10
- package/dist/components/field.js +10 -10
- package/dist/components/form/footer.js +2 -2
- package/dist/components/form/types.d.ts +38 -38
- package/dist/components/form/types.js +1 -1
- package/dist/components/heading/normal.d.ts +29 -29
- package/dist/components/heading/normal.js +22 -22
- package/dist/components/heading/page.d.ts +1 -1
- package/dist/components/heading/page.js +5 -5
- package/dist/components/index.d.ts +11 -12
- package/dist/components/index.js +11 -12
- package/dist/components/input.d.ts +11 -11
- package/dist/components/input.js +6 -6
- package/dist/components/layout/fade.d.ts +6 -6
- package/dist/components/layout/fade.js +14 -14
- package/dist/components/layout/flex.d.ts +16 -16
- package/dist/components/layout/flex.js +42 -40
- package/dist/components/layout/heading.d.ts +1 -3
- package/dist/components/layout/heading.js +2 -2
- package/dist/components/layout/separator.d.ts +3 -3
- package/dist/components/layout/separator.js +5 -5
- package/dist/components/list/index.d.ts +2 -2
- package/dist/components/list/index.js +2 -2
- package/dist/components/list/item.d.ts +9 -9
- package/dist/components/list/item.js +7 -7
- package/dist/components/list/variants/bullet.d.ts +9 -9
- package/dist/components/list/variants/bullet.js +16 -16
- package/dist/components/list/variants/number.d.ts +10 -10
- package/dist/components/list/variants/number.js +18 -18
- package/dist/components/multiple-choice.d.ts +2 -2
- package/dist/components/multiple-choice.js +12 -13
- package/dist/components/search-bar.d.ts +12 -12
- package/dist/components/search-bar.js +14 -14
- package/dist/components/select.d.ts +6 -6
- package/dist/components/select.js +24 -25
- package/dist/components/text/badge.d.ts +11 -11
- package/dist/components/text/badge.js +18 -17
- package/dist/components/textarea.d.ts +7 -7
- package/dist/components/textarea.js +11 -11
- package/dist/components/upload/file.d.ts +8 -8
- package/dist/components/upload/file.js +15 -15
- package/dist/core/format.d.ts +3 -3
- package/dist/core/format.js +34 -34
- package/dist/core/functions.d.ts +13 -13
- package/dist/core/functions.js +79 -79
- package/dist/core/types.d.ts +11 -11
- package/dist/core/types.js +2 -2
- package/dist/hooks/audio/sound.d.ts +1 -0
- package/dist/hooks/audio/sound.js +6 -0
- package/dist/hooks/clock/interval.d.ts +1 -1
- package/dist/hooks/clock/interval.js +20 -20
- package/dist/hooks/element/container.d.ts +5 -4
- package/dist/hooks/element/container.js +7 -7
- package/dist/hooks/element/resize.d.ts +1 -1
- package/dist/hooks/element/resize.js +12 -12
- package/dist/hooks/index.d.ts +4 -3
- package/dist/hooks/index.js +4 -3
- package/dist/index.d.ts +14 -14
- package/dist/index.js +14 -14
- package/package.json +5 -31
- package/dist/assets/icons/check copy.svg +0 -6
- package/dist/assets/icons/check-circle copy.svg +0 -6
- package/dist/assets/icons/chevron copy.svg +0 -6
- package/dist/assets/icons/paperclip copy.svg +0 -6
- package/dist/assets/icons/spinner copy.svg +0 -6
- package/dist/assets/icons/x-circle copy.svg +0 -6
- package/dist/components/badge.d.ts +0 -5
- package/dist/components/badge.js +0 -4
- package/dist/components/flex.d.ts +0 -16
- package/dist/components/flex.js +0 -8
- package/dist/components/form/fields.d.ts +0 -16
- package/dist/components/form/fields.js +0 -21
- package/dist/components/form/loaders.d.ts +0 -3
- package/dist/components/form/loaders.js +0 -11
- package/dist/components/form/test-next.d.ts +0 -1
- package/dist/components/form/test-next.js +0 -6
- package/dist/components/search/index.d.ts +0 -6
- package/dist/components/search/index.js +0 -12
- package/dist/hooks/color.d.ts +0 -7
- package/dist/hooks/color.js +0 -8
|
@@ -1,136 +1,136 @@
|
|
|
1
|
-
export declare const animations: {
|
|
2
|
-
readonly fadeUp: {
|
|
3
|
-
readonly initial: {
|
|
4
|
-
readonly opacity: 0;
|
|
5
|
-
readonly y: 30;
|
|
6
|
-
};
|
|
7
|
-
readonly animate: {
|
|
8
|
-
readonly opacity: 1;
|
|
9
|
-
readonly y: 0;
|
|
10
|
-
readonly transition: {
|
|
11
|
-
readonly duration: 0.3;
|
|
12
|
-
};
|
|
13
|
-
};
|
|
14
|
-
};
|
|
15
|
-
readonly fadeInAndOut: {
|
|
16
|
-
readonly initial: {
|
|
17
|
-
readonly opacity: 0;
|
|
18
|
-
};
|
|
19
|
-
readonly animate: {
|
|
20
|
-
readonly opacity: 1;
|
|
21
|
-
};
|
|
22
|
-
readonly exit: {
|
|
23
|
-
readonly opacity: 0;
|
|
24
|
-
};
|
|
25
|
-
};
|
|
26
|
-
readonly fadeUpAndOut: {
|
|
27
|
-
readonly initial: {
|
|
28
|
-
readonly opacity: 0;
|
|
29
|
-
readonly y: 10;
|
|
30
|
-
};
|
|
31
|
-
readonly animate: {
|
|
32
|
-
readonly opacity: 1;
|
|
33
|
-
readonly y: 0;
|
|
34
|
-
};
|
|
35
|
-
readonly exit: {
|
|
36
|
-
readonly opacity: 1;
|
|
37
|
-
readonly y: -10;
|
|
38
|
-
};
|
|
39
|
-
};
|
|
40
|
-
readonly fadeUpAndOutSlow: {
|
|
41
|
-
readonly initial: {
|
|
42
|
-
readonly opacity: 0;
|
|
43
|
-
readonly y: "-100%";
|
|
44
|
-
};
|
|
45
|
-
readonly animate: {
|
|
46
|
-
readonly opacity: 1;
|
|
47
|
-
readonly y: 0;
|
|
48
|
-
readonly transition: {
|
|
49
|
-
readonly duration: 0.2;
|
|
50
|
-
readonly ease: "easeInOut";
|
|
51
|
-
};
|
|
52
|
-
};
|
|
53
|
-
readonly exit: {
|
|
54
|
-
readonly opacity: 0;
|
|
55
|
-
readonly y: "100%";
|
|
56
|
-
};
|
|
57
|
-
};
|
|
58
|
-
readonly fadeLeft: {
|
|
59
|
-
readonly initial: {
|
|
60
|
-
readonly x: -50;
|
|
61
|
-
readonly opacity: 0;
|
|
62
|
-
};
|
|
63
|
-
readonly animate: {
|
|
64
|
-
readonly x: 0;
|
|
65
|
-
readonly opacity: 1;
|
|
66
|
-
};
|
|
67
|
-
readonly exit: {
|
|
68
|
-
readonly x: 50;
|
|
69
|
-
readonly opacity: 0;
|
|
70
|
-
};
|
|
71
|
-
readonly transition: {
|
|
72
|
-
readonly duration: 0.4;
|
|
73
|
-
readonly ease: "easeOut";
|
|
74
|
-
};
|
|
75
|
-
};
|
|
76
|
-
readonly growUpAndOut: {
|
|
77
|
-
readonly initial: {
|
|
78
|
-
readonly opacity: 0;
|
|
79
|
-
readonly height: 0;
|
|
80
|
-
};
|
|
81
|
-
readonly animate: {
|
|
82
|
-
readonly opacity: 1;
|
|
83
|
-
readonly height: "auto";
|
|
84
|
-
};
|
|
85
|
-
readonly exit: {
|
|
86
|
-
readonly opacity: 0;
|
|
87
|
-
readonly height: 0;
|
|
88
|
-
};
|
|
89
|
-
};
|
|
90
|
-
readonly fadeStagger: {
|
|
91
|
-
readonly initial: {
|
|
92
|
-
readonly opacity: 0;
|
|
93
|
-
};
|
|
94
|
-
readonly animate: {
|
|
95
|
-
readonly opacity: 1;
|
|
96
|
-
readonly transition: {
|
|
97
|
-
readonly staggerChildren: 0.2;
|
|
98
|
-
};
|
|
99
|
-
};
|
|
100
|
-
};
|
|
101
|
-
readonly fadeList: {
|
|
102
|
-
readonly hidden: {
|
|
103
|
-
readonly opacity: 0;
|
|
104
|
-
readonly x: -10;
|
|
105
|
-
readonly y: 5;
|
|
106
|
-
};
|
|
107
|
-
readonly visible: {
|
|
108
|
-
readonly opacity: 1;
|
|
109
|
-
readonly x: 0;
|
|
110
|
-
readonly y: 0;
|
|
111
|
-
readonly transition: {
|
|
112
|
-
readonly type: "spring";
|
|
113
|
-
readonly stiffness: 350;
|
|
114
|
-
readonly damping: 25;
|
|
115
|
-
};
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
readonly popUp: {
|
|
119
|
-
readonly initial: {
|
|
120
|
-
readonly opacity: 0;
|
|
121
|
-
readonly scale: 0.9;
|
|
122
|
-
};
|
|
123
|
-
readonly animate: {
|
|
124
|
-
readonly opacity: 1;
|
|
125
|
-
readonly scale: 1;
|
|
126
|
-
};
|
|
127
|
-
readonly exit: {
|
|
128
|
-
readonly opacity: 0;
|
|
129
|
-
readonly scale: 0.9;
|
|
130
|
-
};
|
|
131
|
-
readonly transition: {
|
|
132
|
-
readonly duration: 0.2;
|
|
133
|
-
readonly ease: readonly [0.23, 1, 0.32, 1];
|
|
134
|
-
};
|
|
135
|
-
};
|
|
136
|
-
};
|
|
1
|
+
export declare const animations: {
|
|
2
|
+
readonly fadeUp: {
|
|
3
|
+
readonly initial: {
|
|
4
|
+
readonly opacity: 0;
|
|
5
|
+
readonly y: 30;
|
|
6
|
+
};
|
|
7
|
+
readonly animate: {
|
|
8
|
+
readonly opacity: 1;
|
|
9
|
+
readonly y: 0;
|
|
10
|
+
readonly transition: {
|
|
11
|
+
readonly duration: 0.3;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
readonly fadeInAndOut: {
|
|
16
|
+
readonly initial: {
|
|
17
|
+
readonly opacity: 0;
|
|
18
|
+
};
|
|
19
|
+
readonly animate: {
|
|
20
|
+
readonly opacity: 1;
|
|
21
|
+
};
|
|
22
|
+
readonly exit: {
|
|
23
|
+
readonly opacity: 0;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
readonly fadeUpAndOut: {
|
|
27
|
+
readonly initial: {
|
|
28
|
+
readonly opacity: 0;
|
|
29
|
+
readonly y: 10;
|
|
30
|
+
};
|
|
31
|
+
readonly animate: {
|
|
32
|
+
readonly opacity: 1;
|
|
33
|
+
readonly y: 0;
|
|
34
|
+
};
|
|
35
|
+
readonly exit: {
|
|
36
|
+
readonly opacity: 1;
|
|
37
|
+
readonly y: -10;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
readonly fadeUpAndOutSlow: {
|
|
41
|
+
readonly initial: {
|
|
42
|
+
readonly opacity: 0;
|
|
43
|
+
readonly y: "-100%";
|
|
44
|
+
};
|
|
45
|
+
readonly animate: {
|
|
46
|
+
readonly opacity: 1;
|
|
47
|
+
readonly y: 0;
|
|
48
|
+
readonly transition: {
|
|
49
|
+
readonly duration: 0.2;
|
|
50
|
+
readonly ease: "easeInOut";
|
|
51
|
+
};
|
|
52
|
+
};
|
|
53
|
+
readonly exit: {
|
|
54
|
+
readonly opacity: 0;
|
|
55
|
+
readonly y: "100%";
|
|
56
|
+
};
|
|
57
|
+
};
|
|
58
|
+
readonly fadeLeft: {
|
|
59
|
+
readonly initial: {
|
|
60
|
+
readonly x: -50;
|
|
61
|
+
readonly opacity: 0;
|
|
62
|
+
};
|
|
63
|
+
readonly animate: {
|
|
64
|
+
readonly x: 0;
|
|
65
|
+
readonly opacity: 1;
|
|
66
|
+
};
|
|
67
|
+
readonly exit: {
|
|
68
|
+
readonly x: 50;
|
|
69
|
+
readonly opacity: 0;
|
|
70
|
+
};
|
|
71
|
+
readonly transition: {
|
|
72
|
+
readonly duration: 0.4;
|
|
73
|
+
readonly ease: "easeOut";
|
|
74
|
+
};
|
|
75
|
+
};
|
|
76
|
+
readonly growUpAndOut: {
|
|
77
|
+
readonly initial: {
|
|
78
|
+
readonly opacity: 0;
|
|
79
|
+
readonly height: 0;
|
|
80
|
+
};
|
|
81
|
+
readonly animate: {
|
|
82
|
+
readonly opacity: 1;
|
|
83
|
+
readonly height: "auto";
|
|
84
|
+
};
|
|
85
|
+
readonly exit: {
|
|
86
|
+
readonly opacity: 0;
|
|
87
|
+
readonly height: 0;
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
readonly fadeStagger: {
|
|
91
|
+
readonly initial: {
|
|
92
|
+
readonly opacity: 0;
|
|
93
|
+
};
|
|
94
|
+
readonly animate: {
|
|
95
|
+
readonly opacity: 1;
|
|
96
|
+
readonly transition: {
|
|
97
|
+
readonly staggerChildren: 0.2;
|
|
98
|
+
};
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
readonly fadeList: {
|
|
102
|
+
readonly hidden: {
|
|
103
|
+
readonly opacity: 0;
|
|
104
|
+
readonly x: -10;
|
|
105
|
+
readonly y: 5;
|
|
106
|
+
};
|
|
107
|
+
readonly visible: {
|
|
108
|
+
readonly opacity: 1;
|
|
109
|
+
readonly x: 0;
|
|
110
|
+
readonly y: 0;
|
|
111
|
+
readonly transition: {
|
|
112
|
+
readonly type: "spring";
|
|
113
|
+
readonly stiffness: 350;
|
|
114
|
+
readonly damping: 25;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
readonly popUp: {
|
|
119
|
+
readonly initial: {
|
|
120
|
+
readonly opacity: 0;
|
|
121
|
+
readonly scale: 0.9;
|
|
122
|
+
};
|
|
123
|
+
readonly animate: {
|
|
124
|
+
readonly opacity: 1;
|
|
125
|
+
readonly scale: 1;
|
|
126
|
+
};
|
|
127
|
+
readonly exit: {
|
|
128
|
+
readonly opacity: 0;
|
|
129
|
+
readonly scale: 0.9;
|
|
130
|
+
};
|
|
131
|
+
readonly transition: {
|
|
132
|
+
readonly duration: 0.2;
|
|
133
|
+
readonly ease: readonly [0.23, 1, 0.32, 1];
|
|
134
|
+
};
|
|
135
|
+
};
|
|
136
|
+
};
|
|
@@ -1,62 +1,62 @@
|
|
|
1
|
-
export const animations = {
|
|
2
|
-
"fadeUp": {
|
|
3
|
-
"initial": { "opacity": 0, "y": 30 },
|
|
4
|
-
"animate": {
|
|
5
|
-
"opacity": 1,
|
|
6
|
-
"y": 0,
|
|
7
|
-
"transition": { "duration": 0.3 }
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"fadeInAndOut": {
|
|
11
|
-
"initial": { "opacity": 0 },
|
|
12
|
-
"animate": { "opacity": 1 },
|
|
13
|
-
"exit": { "opacity": 0 }
|
|
14
|
-
},
|
|
15
|
-
"fadeUpAndOut": {
|
|
16
|
-
"initial": { "opacity": 0, "y": 10 },
|
|
17
|
-
"animate": { "opacity": 1, "y": 0 },
|
|
18
|
-
"exit": { "opacity": 1, "y": -10 }
|
|
19
|
-
},
|
|
20
|
-
"fadeUpAndOutSlow": {
|
|
21
|
-
"initial": { "opacity": 0, "y": "-100%" },
|
|
22
|
-
"animate": { "opacity": 1, "y": 0,
|
|
23
|
-
"transition": { "duration": 0.2, "ease": "easeInOut" }
|
|
24
|
-
},
|
|
25
|
-
"exit": { "opacity": 0, "y": "100%" }
|
|
26
|
-
},
|
|
27
|
-
"fadeLeft": {
|
|
28
|
-
"initial": { "x": -50, "opacity": 0 },
|
|
29
|
-
"animate": { "x": 0, "opacity": 1 },
|
|
30
|
-
"exit": { "x": 50, "opacity": 0 },
|
|
31
|
-
"transition": { "duration": 0.4, "ease": "easeOut" }
|
|
32
|
-
},
|
|
33
|
-
"growUpAndOut": {
|
|
34
|
-
"initial": { "opacity": 0, "height": 0 },
|
|
35
|
-
"animate": { "opacity": 1, "height": "auto" },
|
|
36
|
-
"exit": { "opacity": 0, "height": 0 }
|
|
37
|
-
},
|
|
38
|
-
"fadeStagger": {
|
|
39
|
-
"initial": { "opacity": 0 },
|
|
40
|
-
"animate": {
|
|
41
|
-
"opacity": 1,
|
|
42
|
-
"transition": { "staggerChildren": 0.2 }
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
"fadeList": {
|
|
46
|
-
"hidden": { "opacity": 0, "x": -10, "y": 5 },
|
|
47
|
-
"visible": {
|
|
48
|
-
"opacity": 1, "x": 0, "y": 0,
|
|
49
|
-
"transition": {
|
|
50
|
-
"type": "spring",
|
|
51
|
-
"stiffness": 350,
|
|
52
|
-
"damping": 25
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
"popUp": {
|
|
57
|
-
"initial": { "opacity": 0, "scale": 0.9 },
|
|
58
|
-
"animate": { "opacity": 1, "scale": 1 },
|
|
59
|
-
"exit": { "opacity": 0, "scale": 0.9 },
|
|
60
|
-
"transition": { "duration": 0.2, "ease": [0.23, 1, 0.32, 1] }
|
|
61
|
-
}
|
|
62
|
-
};
|
|
1
|
+
export const animations = {
|
|
2
|
+
"fadeUp": {
|
|
3
|
+
"initial": { "opacity": 0, "y": 30 },
|
|
4
|
+
"animate": {
|
|
5
|
+
"opacity": 1,
|
|
6
|
+
"y": 0,
|
|
7
|
+
"transition": { "duration": 0.3 }
|
|
8
|
+
}
|
|
9
|
+
},
|
|
10
|
+
"fadeInAndOut": {
|
|
11
|
+
"initial": { "opacity": 0 },
|
|
12
|
+
"animate": { "opacity": 1 },
|
|
13
|
+
"exit": { "opacity": 0 }
|
|
14
|
+
},
|
|
15
|
+
"fadeUpAndOut": {
|
|
16
|
+
"initial": { "opacity": 0, "y": 10 },
|
|
17
|
+
"animate": { "opacity": 1, "y": 0 },
|
|
18
|
+
"exit": { "opacity": 1, "y": -10 }
|
|
19
|
+
},
|
|
20
|
+
"fadeUpAndOutSlow": {
|
|
21
|
+
"initial": { "opacity": 0, "y": "-100%" },
|
|
22
|
+
"animate": { "opacity": 1, "y": 0,
|
|
23
|
+
"transition": { "duration": 0.2, "ease": "easeInOut" }
|
|
24
|
+
},
|
|
25
|
+
"exit": { "opacity": 0, "y": "100%" }
|
|
26
|
+
},
|
|
27
|
+
"fadeLeft": {
|
|
28
|
+
"initial": { "x": -50, "opacity": 0 },
|
|
29
|
+
"animate": { "x": 0, "opacity": 1 },
|
|
30
|
+
"exit": { "x": 50, "opacity": 0 },
|
|
31
|
+
"transition": { "duration": 0.4, "ease": "easeOut" }
|
|
32
|
+
},
|
|
33
|
+
"growUpAndOut": {
|
|
34
|
+
"initial": { "opacity": 0, "height": 0 },
|
|
35
|
+
"animate": { "opacity": 1, "height": "auto" },
|
|
36
|
+
"exit": { "opacity": 0, "height": 0 }
|
|
37
|
+
},
|
|
38
|
+
"fadeStagger": {
|
|
39
|
+
"initial": { "opacity": 0 },
|
|
40
|
+
"animate": {
|
|
41
|
+
"opacity": 1,
|
|
42
|
+
"transition": { "staggerChildren": 0.2 }
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
"fadeList": {
|
|
46
|
+
"hidden": { "opacity": 0, "x": -10, "y": 5 },
|
|
47
|
+
"visible": {
|
|
48
|
+
"opacity": 1, "x": 0, "y": 0,
|
|
49
|
+
"transition": {
|
|
50
|
+
"type": "spring",
|
|
51
|
+
"stiffness": 350,
|
|
52
|
+
"damping": 25
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
"popUp": {
|
|
57
|
+
"initial": { "opacity": 0, "scale": 0.9 },
|
|
58
|
+
"animate": { "opacity": 1, "scale": 1 },
|
|
59
|
+
"exit": { "opacity": 0, "scale": 0.9 },
|
|
60
|
+
"transition": { "duration": 0.2, "ease": [0.23, 1, 0.32, 1] }
|
|
61
|
+
}
|
|
62
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import React from "react";
|
|
2
|
-
import { animations } from "./configs";
|
|
3
|
-
type Props = {
|
|
4
|
-
style?: string;
|
|
5
|
-
variant?: keyof typeof animations;
|
|
6
|
-
inherit?: boolean;
|
|
7
|
-
layout?: boolean;
|
|
8
|
-
ref?: React.RefObject<HTMLDivElement | null>;
|
|
9
|
-
children?: React.ReactNode;
|
|
10
|
-
};
|
|
11
|
-
export declare function Animation({ style, variant, inherit, layout, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { animations } from "./configs";
|
|
3
|
+
declare type Props = {
|
|
4
|
+
style?: string;
|
|
5
|
+
variant?: keyof typeof animations;
|
|
6
|
+
inherit?: boolean;
|
|
7
|
+
layout?: boolean;
|
|
8
|
+
ref?: React.RefObject<HTMLDivElement | null>;
|
|
9
|
+
children?: React.ReactNode;
|
|
10
|
+
};
|
|
11
|
+
export declare function Animation({ style, variant, inherit, layout, children }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
-
import { motion } from "framer-motion";
|
|
4
|
-
import { animations } from "./configs";
|
|
5
|
-
export function Animation({ style, variant = "fadeInAndOut", inherit, layout, children }) {
|
|
6
|
-
return (_jsx(motion.div, { className: style, variants: animations[variant], initial: inherit ? undefined : "initial", animate: inherit ? undefined : "animate", exit: inherit ? undefined : "exit", layout: layout, children: children }));
|
|
7
|
-
}
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
3
|
+
import { motion } from "framer-motion";
|
|
4
|
+
import { animations } from "./configs";
|
|
5
|
+
export function Animation({ style, variant = "fadeInAndOut", inherit, layout, children }) {
|
|
6
|
+
return (_jsx(motion.div, { className: style, variants: animations[variant], initial: inherit ? undefined : "initial", animate: inherit ? undefined : "animate", exit: inherit ? undefined : "exit", layout: layout, children: children }, void 0));
|
|
7
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { type Field } from "./form/types";
|
|
2
|
-
export default function Attachment
|
|
1
|
+
import { type Field } from "./form/types";
|
|
2
|
+
export default function Attachment({ id, style, label, value, update, required, note }: Field<File[], File[]>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,19 +1,18 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useRef } from "react";
|
|
3
|
-
import PaperClip from "../assets/icons/paperclip.svg";
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
};
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useRef } from "react";
|
|
3
|
+
import PaperClip from "../assets/icons/paperclip.svg";
|
|
4
|
+
import { cn } from "@bouko/style";
|
|
5
|
+
export default function Attachment({ id, style, label, value, update, required = true, note }) {
|
|
6
|
+
const ref = useRef(null);
|
|
7
|
+
const handleFileChange = (e) => {
|
|
8
|
+
if (e.target.files && id)
|
|
9
|
+
update([e.target.files[0]]);
|
|
10
|
+
};
|
|
11
|
+
return (_jsxs("div", { className: cn(styles.container, style), children: [label && _jsxs("span", { className: styles.label, children: [label, " ", !required ? _jsx("span", { className: "italic text-slate-400", children: "(optional)" }, void 0) : ""] }, void 0), _jsxs("div", { onClick: () => ref.current?.click(), className: "flex flex-col justify-center items-center py-3 gap-1 w-full cursor-pointer duration-200 hover:bg-slate-200/40 rounded border-2 border-slate-300 border-dashed", children: [!value || value.length === 0 && (_jsxs(_Fragment, { children: [_jsxs("span", { className: "flex gap-2 items-center font-semibold text-sm", children: [_jsx(PaperClip, {}, void 0), "Drag and drop files, paste screenshots, or"] }, void 0), _jsx("span", { className: "text-xs text-slate-500", children: "browse" }, void 0), _jsx("input", { type: "file", className: "hidden", onChange: handleFileChange, ref: ref }, void 0)] }, void 0)), value && value.length > 0 && value.map((x, i) => (_jsx("span", { className: "text-xs text-slate-500", children: x.name }, i)))] }, void 0), note && _jsx("span", { className: styles.note, children: note }, void 0)] }, void 0));
|
|
12
|
+
}
|
|
13
|
+
const styles = {
|
|
14
|
+
container: "flex flex-col gap-2 w-full shrink-0 overflow-hidden",
|
|
15
|
+
label: "text-xs text-slate-600",
|
|
16
|
+
input: "px-3 py-2 bg-slate-200/50 border border-slate-300 outline-blue-500 rounded text-sm",
|
|
17
|
+
note: "mt-1 text-xs text-slate-500"
|
|
18
|
+
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export type ButtonProps = {
|
|
3
|
-
variant?: "primary" | "outline" | "ghost";
|
|
4
|
-
size?: "xs" | "sm" | "md" | "lg";
|
|
5
|
-
style?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
export default function LoadButton({ size, variant, style, onClick, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare type ButtonProps = {
|
|
3
|
+
variant?: "primary" | "outline" | "ghost";
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
5
|
+
style?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export default function LoadButton({ size, variant, style, onClick, children, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
"use state";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { useState } from "react";
|
|
4
|
-
import { cn, tv } from "@bouko/style";
|
|
5
|
-
import CheckCircle from "../../assets/icons/check-circle.svg";
|
|
6
|
-
import Spinner from "../../assets/icons/spinner.svg";
|
|
7
|
-
export default function LoadButton({ size, variant, style, onClick, children, ...props }) {
|
|
8
|
-
const [isLoading, setLoading] = useState(false);
|
|
9
|
-
const submit = async () => {
|
|
10
|
-
setLoading(true);
|
|
11
|
-
try {
|
|
12
|
-
await onClick?.();
|
|
13
|
-
}
|
|
14
|
-
catch { }
|
|
15
|
-
setLoading(false);
|
|
16
|
-
};
|
|
17
|
-
return (_jsxs("button", { className: cn(styles({ variant, size }), style), onClick: submit, ...props, children: [isLoading ? _jsx(Spinner, { className: "animate-spin" }) : _jsx(CheckCircle, {}), children] }));
|
|
18
|
-
}
|
|
19
|
-
const styles = tv({
|
|
20
|
-
base: "flex justify-center items-center gap-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-background-light duration-200 cursor-pointer disabled:cursor-not-allowed",
|
|
21
|
-
defaultVariants: { size: "md" },
|
|
22
|
-
variants: {
|
|
23
|
-
variant: {
|
|
24
|
-
primary: "bg-primary hover:bg-primary-dark border-primary-dark",
|
|
25
|
-
outline: "!bg-transparent border-accent hover:border-accent-dark text-primary",
|
|
26
|
-
ghost: "!bg-transparent border-transparent text-accent hover:text-accent-dark"
|
|
27
|
-
},
|
|
28
|
-
size: {
|
|
29
|
-
xs: "px-3 py-1 text-xs",
|
|
30
|
-
sm: "px-4 py-2 text-xs sm:text-sm",
|
|
31
|
-
md: "px-4 py-2",
|
|
32
|
-
lg: "px-5 py-3 text-lg"
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
});
|
|
1
|
+
"use state";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
import { cn, tv } from "@bouko/style";
|
|
5
|
+
import CheckCircle from "../../assets/icons/check-circle.svg";
|
|
6
|
+
import Spinner from "../../assets/icons/spinner.svg";
|
|
7
|
+
export default function LoadButton({ size, variant, style, onClick, children, ...props }) {
|
|
8
|
+
const [isLoading, setLoading] = useState(false);
|
|
9
|
+
const submit = async () => {
|
|
10
|
+
setLoading(true);
|
|
11
|
+
try {
|
|
12
|
+
await onClick?.();
|
|
13
|
+
}
|
|
14
|
+
catch { }
|
|
15
|
+
setLoading(false);
|
|
16
|
+
};
|
|
17
|
+
return (_jsxs("button", { className: cn(styles({ variant, size }), style), onClick: submit, ...props, children: [isLoading ? _jsx(Spinner, { className: "animate-spin" }, void 0) : _jsx(CheckCircle, {}, void 0), children] }, void 0));
|
|
18
|
+
}
|
|
19
|
+
const styles = tv({
|
|
20
|
+
base: "flex justify-center items-center gap-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-background-light duration-200 cursor-pointer disabled:cursor-not-allowed",
|
|
21
|
+
defaultVariants: { size: "md" },
|
|
22
|
+
variants: {
|
|
23
|
+
variant: {
|
|
24
|
+
primary: "bg-primary hover:bg-primary-dark border-primary-dark",
|
|
25
|
+
outline: "!bg-transparent border-accent hover:border-accent-dark text-primary",
|
|
26
|
+
ghost: "!bg-transparent border-transparent text-accent hover:text-accent-dark"
|
|
27
|
+
},
|
|
28
|
+
size: {
|
|
29
|
+
xs: "px-3 py-1 text-xs",
|
|
30
|
+
sm: "px-4 py-2 text-xs sm:text-sm",
|
|
31
|
+
md: "px-4 py-2",
|
|
32
|
+
lg: "px-5 py-3 text-lg"
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import type { ReactNode } from "react";
|
|
2
|
-
export type ButtonProps = {
|
|
3
|
-
variant?: "primary" | "outline" | "ghost";
|
|
4
|
-
size?: "xs" | "sm" | "md" | "lg";
|
|
5
|
-
style?: string;
|
|
6
|
-
onClick?: () => void;
|
|
7
|
-
disabled?: boolean;
|
|
8
|
-
children: ReactNode;
|
|
9
|
-
};
|
|
10
|
-
export declare function Button({ size, variant, style, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
|
+
export declare type ButtonProps = {
|
|
3
|
+
variant?: "primary" | "outline" | "ghost";
|
|
4
|
+
size?: "xs" | "sm" | "md" | "lg";
|
|
5
|
+
style?: string;
|
|
6
|
+
onClick?: () => void;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
children: ReactNode;
|
|
9
|
+
};
|
|
10
|
+
export declare function Button({ size, variant, style, ...props }: ButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { cn, tv } from "@bouko/style";
|
|
3
|
-
export function Button({ size, variant, style, ...props }) {
|
|
4
|
-
return (_jsx("button", { className: cn(styles({ variant, size }), style), ...props }));
|
|
5
|
-
}
|
|
6
|
-
const styles = tv({
|
|
7
|
-
base: "flex justify-center items-center gap-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-background-light duration-200 cursor-pointer disabled:cursor-not-allowed",
|
|
8
|
-
defaultVariants: { size: "md" },
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
primary: "bg-primary hover:bg-primary-dark border-primary-dark",
|
|
12
|
-
outline: "!bg-transparent border-accent hover:border-accent-dark text-primary",
|
|
13
|
-
ghost: "!bg-transparent border-transparent text-accent hover:text-accent-dark"
|
|
14
|
-
},
|
|
15
|
-
size: {
|
|
16
|
-
xs: "px-3 py-1 text-xs",
|
|
17
|
-
sm: "px-4 py-2 text-xs sm:text-sm",
|
|
18
|
-
md: "px-4 py-2",
|
|
19
|
-
lg: "px-5 py-3 text-lg"
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
});
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn, tv } from "@bouko/style";
|
|
3
|
+
export function Button({ size, variant, style, ...props }) {
|
|
4
|
+
return (_jsx("button", { className: cn(styles({ variant, size }), style), ...props }, void 0));
|
|
5
|
+
}
|
|
6
|
+
const styles = tv({
|
|
7
|
+
base: "flex justify-center items-center gap-2 bg-accent hover:bg-accent-dark border border-accent-dark rounded font-semibold text-background-light duration-200 cursor-pointer disabled:cursor-not-allowed",
|
|
8
|
+
defaultVariants: { size: "md" },
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
primary: "bg-primary hover:bg-primary-dark border-primary-dark",
|
|
12
|
+
outline: "!bg-transparent border-accent hover:border-accent-dark text-primary",
|
|
13
|
+
ghost: "!bg-transparent border-transparent text-accent hover:text-accent-dark"
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
xs: "px-3 py-1 text-xs",
|
|
17
|
+
sm: "px-4 py-2 text-xs sm:text-sm",
|
|
18
|
+
md: "px-4 py-2",
|
|
19
|
+
lg: "px-5 py-3 text-lg"
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
});
|