@xanui/core 1.0.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/ServerStyleTags.d.ts +3 -0
- package/ServerStyleTags.js +17 -0
- package/ServerStyleTags.js.map +7 -0
- package/Tag/cssPropList.d.ts +2 -0
- package/Tag/cssPropList.js +190 -0
- package/Tag/cssPropList.js.map +7 -0
- package/Tag/index.d.ts +6 -0
- package/Tag/index.js +12 -0
- package/Tag/index.js.map +7 -0
- package/Tag/types.d.ts +179 -0
- package/Tag/types.js +1 -0
- package/Tag/types.js.map +7 -0
- package/Tag/useTagProps.d.ts +3 -0
- package/Tag/useTagProps.js +27 -0
- package/Tag/useTagProps.js.map +7 -0
- package/Transition/index.d.ts +31 -0
- package/Transition/index.js +101 -0
- package/Transition/index.js.map +7 -0
- package/Transition/variants.d.ts +131 -0
- package/Transition/variants.js +175 -0
- package/Transition/variants.js.map +7 -0
- package/breakpoint/index.d.ts +6 -0
- package/breakpoint/index.js +46 -0
- package/breakpoint/index.js.map +7 -0
- package/breakpoint/useBreakpoint.d.ts +10 -0
- package/breakpoint/useBreakpoint.js +32 -0
- package/breakpoint/useBreakpoint.js.map +7 -0
- package/breakpoint/useBreakpointProps.d.ts +6 -0
- package/breakpoint/useBreakpointProps.js +48 -0
- package/breakpoint/useBreakpointProps.js.map +7 -0
- package/css/aliases.d.ts +4 -0
- package/css/aliases.js +34 -0
- package/css/aliases.js.map +7 -0
- package/css/getProps.d.ts +3 -0
- package/css/getProps.js +37 -0
- package/css/getProps.js.map +7 -0
- package/css/getValue.d.ts +3 -0
- package/css/getValue.js +108 -0
- package/css/getValue.js.map +7 -0
- package/css/index.d.ts +15 -0
- package/css/index.js +70 -0
- package/css/index.js.map +7 -0
- package/css/types.d.ts +54 -0
- package/css/types.js +1 -0
- package/css/types.js.map +7 -0
- package/index.d.ts +21 -0
- package/index.js +30 -0
- package/index.js.map +7 -0
- package/isWindow.d.ts +2 -0
- package/isWindow.js +6 -0
- package/isWindow.js.map +7 -0
- package/package.json +28 -0
- package/readme.md +0 -0
- package/theme/ThemeCssVars.d.ts +3 -0
- package/theme/ThemeCssVars.js +92 -0
- package/theme/ThemeCssVars.js.map +7 -0
- package/theme/ThemeDefaultOptions.d.ts +68 -0
- package/theme/ThemeDefaultOptions.js +148 -0
- package/theme/ThemeDefaultOptions.js.map +7 -0
- package/theme/ThemeProvider.d.ts +10 -0
- package/theme/ThemeProvider.js +120 -0
- package/theme/ThemeProvider.js.map +7 -0
- package/theme/core.d.ts +7 -0
- package/theme/core.js +26 -0
- package/theme/core.js.map +7 -0
- package/theme/createColor.d.ts +41 -0
- package/theme/createColor.js +52 -0
- package/theme/createColor.js.map +7 -0
- package/theme/createTheme.d.ts +2 -0
- package/theme/createTheme.js +33 -0
- package/theme/createTheme.js.map +7 -0
- package/theme/createThemeSwitcher.d.ts +6 -0
- package/theme/createThemeSwitcher.js +19 -0
- package/theme/createThemeSwitcher.js.map +7 -0
- package/theme/index.d.ts +4 -0
- package/theme/index.js +14 -0
- package/theme/index.js.map +7 -0
- package/theme/types.d.ts +124 -0
- package/theme/types.js +1 -0
- package/theme/types.js.map +7 -0
- package/useAnimation.d.ts +18 -0
- package/useAnimation.js +33 -0
- package/useAnimation.js.map +7 -0
- package/useColorTemplate.d.ts +4 -0
- package/useColorTemplate.js +11 -0
- package/useColorTemplate.js.map +7 -0
- package/useInterface.d.ts +2 -0
- package/useInterface.js +14 -0
- package/useInterface.js.map +7 -0
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
import { TransitionElementProps } from ".";
|
|
2
|
+
export declare const slideDown: (_arg: TransitionElementProps) => {
|
|
3
|
+
from: {
|
|
4
|
+
transform: string;
|
|
5
|
+
};
|
|
6
|
+
to: {
|
|
7
|
+
transform: string;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
export declare const slideUp: (_arg: TransitionElementProps) => {
|
|
11
|
+
from: {
|
|
12
|
+
transform: string;
|
|
13
|
+
};
|
|
14
|
+
to: {
|
|
15
|
+
transform: string;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export declare const slideRight: (_arg: TransitionElementProps) => {
|
|
19
|
+
from: {
|
|
20
|
+
transform: string;
|
|
21
|
+
};
|
|
22
|
+
to: {
|
|
23
|
+
transform: string;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
export declare const slideLeft: (_arg: TransitionElementProps) => {
|
|
27
|
+
from: {
|
|
28
|
+
transform: string;
|
|
29
|
+
};
|
|
30
|
+
to: {
|
|
31
|
+
transform: string;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
export declare const fade: (_arg: TransitionElementProps) => {
|
|
35
|
+
from: {
|
|
36
|
+
opacity: number;
|
|
37
|
+
};
|
|
38
|
+
to: {
|
|
39
|
+
opacity: number;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
42
|
+
export declare const fadeDown: (_arg: TransitionElementProps) => {
|
|
43
|
+
from: {
|
|
44
|
+
transform: string;
|
|
45
|
+
opacity: number;
|
|
46
|
+
};
|
|
47
|
+
to: {
|
|
48
|
+
transform: string;
|
|
49
|
+
opacity: number;
|
|
50
|
+
};
|
|
51
|
+
};
|
|
52
|
+
export declare const fadeUp: (_arg: TransitionElementProps) => {
|
|
53
|
+
from: {
|
|
54
|
+
transform: string;
|
|
55
|
+
opacity: number;
|
|
56
|
+
};
|
|
57
|
+
to: {
|
|
58
|
+
transform: string;
|
|
59
|
+
opacity: number;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
export declare const fadeRight: (_arg: TransitionElementProps) => {
|
|
63
|
+
from: {
|
|
64
|
+
transform: string;
|
|
65
|
+
opacity: number;
|
|
66
|
+
};
|
|
67
|
+
to: {
|
|
68
|
+
transform: string;
|
|
69
|
+
opacity: number;
|
|
70
|
+
};
|
|
71
|
+
};
|
|
72
|
+
export declare const fadeLeft: (_arg: TransitionElementProps) => {
|
|
73
|
+
from: {
|
|
74
|
+
transform: string;
|
|
75
|
+
opacity: number;
|
|
76
|
+
};
|
|
77
|
+
to: {
|
|
78
|
+
transform: string;
|
|
79
|
+
opacity: number;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
export declare const grow: (_arg: TransitionElementProps) => {
|
|
83
|
+
from: {
|
|
84
|
+
transform: string;
|
|
85
|
+
opacity: number;
|
|
86
|
+
};
|
|
87
|
+
to: {
|
|
88
|
+
transform: string;
|
|
89
|
+
opacity: number;
|
|
90
|
+
};
|
|
91
|
+
};
|
|
92
|
+
export declare const zoom: (_arg: TransitionElementProps) => {
|
|
93
|
+
from: {
|
|
94
|
+
transform: string;
|
|
95
|
+
opacity: number;
|
|
96
|
+
};
|
|
97
|
+
to: {
|
|
98
|
+
transform: string;
|
|
99
|
+
opacity: number;
|
|
100
|
+
};
|
|
101
|
+
};
|
|
102
|
+
export declare const zoomOver: (_arg: TransitionElementProps) => {
|
|
103
|
+
from: {
|
|
104
|
+
transform: string;
|
|
105
|
+
opacity: number;
|
|
106
|
+
};
|
|
107
|
+
to: {
|
|
108
|
+
transform: string;
|
|
109
|
+
opacity: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
export declare const collapsVerticle: (_arg: TransitionElementProps) => {
|
|
113
|
+
from: {
|
|
114
|
+
height: string;
|
|
115
|
+
overflow: string;
|
|
116
|
+
};
|
|
117
|
+
to: {
|
|
118
|
+
height: string;
|
|
119
|
+
overflow: string;
|
|
120
|
+
};
|
|
121
|
+
};
|
|
122
|
+
export declare const collapsHorizental: (_arg: TransitionElementProps) => {
|
|
123
|
+
from: {
|
|
124
|
+
width: string;
|
|
125
|
+
overflow: string;
|
|
126
|
+
};
|
|
127
|
+
to: {
|
|
128
|
+
width: string;
|
|
129
|
+
overflow: string;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
const slideDown = (_arg) => {
|
|
2
|
+
return {
|
|
3
|
+
from: {
|
|
4
|
+
transform: `translateY(-${_arg.height}px)!important`
|
|
5
|
+
},
|
|
6
|
+
to: {
|
|
7
|
+
transform: `translateY(0)!important`
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const slideUp = (_arg) => {
|
|
12
|
+
return {
|
|
13
|
+
from: {
|
|
14
|
+
transform: `translateY(${_arg.height}px)!important`
|
|
15
|
+
},
|
|
16
|
+
to: {
|
|
17
|
+
transform: `translateY(0)!important`
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const slideRight = (_arg) => {
|
|
22
|
+
return {
|
|
23
|
+
from: {
|
|
24
|
+
transform: `translateX(-${_arg.width}px)!important`
|
|
25
|
+
},
|
|
26
|
+
to: {
|
|
27
|
+
transform: `translateX(0)!important`
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const slideLeft = (_arg) => {
|
|
32
|
+
return {
|
|
33
|
+
from: {
|
|
34
|
+
transform: `translateX(${_arg.width}px)!important`
|
|
35
|
+
},
|
|
36
|
+
to: {
|
|
37
|
+
transform: `translateX(0)!important`
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const fade = (_arg) => {
|
|
42
|
+
return {
|
|
43
|
+
from: {
|
|
44
|
+
opacity: 0
|
|
45
|
+
},
|
|
46
|
+
to: {
|
|
47
|
+
opacity: 1
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const fadeDown = (_arg) => {
|
|
52
|
+
return {
|
|
53
|
+
from: {
|
|
54
|
+
transform: `translateY(-30px)!important`,
|
|
55
|
+
opacity: 0
|
|
56
|
+
},
|
|
57
|
+
to: {
|
|
58
|
+
transform: `translateY(0)!important`,
|
|
59
|
+
opacity: 1
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const fadeUp = (_arg) => {
|
|
64
|
+
return {
|
|
65
|
+
from: {
|
|
66
|
+
transform: `translateY(30px)!important`,
|
|
67
|
+
opacity: 0
|
|
68
|
+
},
|
|
69
|
+
to: {
|
|
70
|
+
transform: `translateY(0)!important`,
|
|
71
|
+
opacity: 1
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const fadeRight = (_arg) => {
|
|
76
|
+
return {
|
|
77
|
+
from: {
|
|
78
|
+
transform: `translateX(-30px)!important`,
|
|
79
|
+
opacity: 0
|
|
80
|
+
},
|
|
81
|
+
to: {
|
|
82
|
+
transform: `translateX(0)!important`,
|
|
83
|
+
opacity: 1
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const fadeLeft = (_arg) => {
|
|
88
|
+
return {
|
|
89
|
+
from: {
|
|
90
|
+
transform: `translateX(30px)!important`,
|
|
91
|
+
opacity: 0
|
|
92
|
+
},
|
|
93
|
+
to: {
|
|
94
|
+
transform: `translateX(0)!important`,
|
|
95
|
+
opacity: 1
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const grow = (_arg) => {
|
|
100
|
+
return {
|
|
101
|
+
from: {
|
|
102
|
+
transform: "scale(.8, .6)!important",
|
|
103
|
+
opacity: 0
|
|
104
|
+
},
|
|
105
|
+
to: {
|
|
106
|
+
transform: "scale(1)!important",
|
|
107
|
+
opacity: 1
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const zoom = (_arg) => {
|
|
112
|
+
return {
|
|
113
|
+
from: {
|
|
114
|
+
transform: "scale(.8)!important",
|
|
115
|
+
opacity: 0
|
|
116
|
+
},
|
|
117
|
+
to: {
|
|
118
|
+
transform: "scale(1)!important",
|
|
119
|
+
opacity: 1
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const zoomOver = (_arg) => {
|
|
124
|
+
return {
|
|
125
|
+
from: {
|
|
126
|
+
transform: "scale(1.2)!important",
|
|
127
|
+
opacity: 0
|
|
128
|
+
},
|
|
129
|
+
to: {
|
|
130
|
+
transform: "scale(1)!important",
|
|
131
|
+
opacity: 1
|
|
132
|
+
}
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
const collapsVerticle = (_arg) => {
|
|
136
|
+
return {
|
|
137
|
+
from: {
|
|
138
|
+
height: "0px!important",
|
|
139
|
+
overflow: "hidden"
|
|
140
|
+
},
|
|
141
|
+
to: {
|
|
142
|
+
height: _arg?.height ? _arg?.height + "px!important" : "auto",
|
|
143
|
+
overflow: "hidden"
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
const collapsHorizental = (_arg) => {
|
|
148
|
+
return {
|
|
149
|
+
from: {
|
|
150
|
+
width: "0px!important",
|
|
151
|
+
overflow: "hidden"
|
|
152
|
+
},
|
|
153
|
+
to: {
|
|
154
|
+
width: _arg?.width ? _arg?.width + "px!important" : "auto",
|
|
155
|
+
overflow: "hidden"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
};
|
|
159
|
+
export {
|
|
160
|
+
collapsHorizental,
|
|
161
|
+
collapsVerticle,
|
|
162
|
+
fade,
|
|
163
|
+
fadeDown,
|
|
164
|
+
fadeLeft,
|
|
165
|
+
fadeRight,
|
|
166
|
+
fadeUp,
|
|
167
|
+
grow,
|
|
168
|
+
slideDown,
|
|
169
|
+
slideLeft,
|
|
170
|
+
slideRight,
|
|
171
|
+
slideUp,
|
|
172
|
+
zoom,
|
|
173
|
+
zoomOver
|
|
174
|
+
};
|
|
175
|
+
//# sourceMappingURL=variants.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/Transition/variants.ts"],
|
|
4
|
+
"sourcesContent": ["import { TransitionElementProps } from \".\"\n\nexport const slideDown = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: `translateY(-${_arg.height}px)!important`,\n },\n to: {\n transform: `translateY(0)!important`,\n }\n }\n}\n\nexport const slideUp = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: `translateY(${_arg.height}px)!important`,\n },\n to: {\n transform: `translateY(0)!important`,\n }\n }\n}\n\nexport const slideRight = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: `translateX(-${_arg.width}px)!important`,\n },\n to: {\n transform: `translateX(0)!important`,\n }\n }\n}\n\nexport const slideLeft = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: `translateX(${_arg.width}px)!important`,\n },\n to: {\n transform: `translateX(0)!important`,\n }\n }\n}\n\nexport const fade = (_arg: TransitionElementProps) => {\n return {\n from: {\n opacity: 0\n },\n to: {\n opacity: 1\n }\n }\n}\n\nexport const fadeDown = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: `translateY(-30px)!important`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)!important`,\n opacity: 1\n }\n }\n}\n\nexport const fadeUp = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: `translateY(30px)!important`,\n opacity: 0\n },\n to: {\n transform: `translateY(0)!important`,\n opacity: 1\n }\n }\n}\n\nexport const fadeRight = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: `translateX(-30px)!important`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)!important`,\n opacity: 1\n }\n }\n}\n\nexport const fadeLeft = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: `translateX(30px)!important`,\n opacity: 0\n },\n to: {\n transform: `translateX(0)!important`,\n opacity: 1\n }\n }\n}\n\nexport const grow = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: \"scale(.8, .6)!important\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)!important\",\n opacity: 1\n }\n }\n}\n\nexport const zoom = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: \"scale(.8)!important\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)!important\",\n opacity: 1\n }\n }\n}\n\nexport const zoomOver = (_arg: TransitionElementProps) => {\n return {\n from: {\n transform: \"scale(1.2)!important\",\n opacity: 0\n },\n to: {\n transform: \"scale(1)!important\",\n opacity: 1\n }\n }\n}\n\nexport const collapsVerticle = (_arg: TransitionElementProps) => {\n return {\n from: {\n height: 0 + \"px!important\",\n overflow: \"hidden\"\n },\n to: {\n height: _arg?.height ? _arg?.height + \"px!important\" : \"auto\",\n overflow: \"hidden\"\n }\n }\n}\n\n\nexport const collapsHorizental = (_arg: TransitionElementProps) => {\n return {\n from: {\n width: 0 + \"px!important\",\n overflow: \"hidden\"\n },\n to: {\n width: _arg?.width ? _arg?.width + \"px!important\" : \"auto\",\n overflow: \"hidden\"\n }\n }\n}\n\n\n\n\n"],
|
|
5
|
+
"mappings": "AAEO,MAAM,YAAY,CAAC,SAAiC;AACvD,SAAO;AAAA,IACH,MAAM;AAAA,MACF,WAAW,eAAe,KAAK,MAAM;AAAA,IACzC;AAAA,IACA,IAAI;AAAA,MACA,WAAW;AAAA,IACf;AAAA,EACJ;AACJ;AAEO,MAAM,UAAU,CAAC,SAAiC;AACrD,SAAO;AAAA,IACH,MAAM;AAAA,MACF,WAAW,cAAc,KAAK,MAAM;AAAA,IACxC;AAAA,IACA,IAAI;AAAA,MACA,WAAW;AAAA,IACf;AAAA,EACJ;AACJ;AAEO,MAAM,aAAa,CAAC,SAAiC;AACxD,SAAO;AAAA,IACH,MAAM;AAAA,MACF,WAAW,eAAe,KAAK,KAAK;AAAA,IACxC;AAAA,IACA,IAAI;AAAA,MACA,WAAW;AAAA,IACf;AAAA,EACJ;AACJ;AAEO,MAAM,YAAY,CAAC,SAAiC;AACvD,SAAO;AAAA,IACH,MAAM;AAAA,MACF,WAAW,cAAc,KAAK,KAAK;AAAA,IACvC;AAAA,IACA,IAAI;AAAA,MACA,WAAW;AAAA,IACf;AAAA,EACJ;AACJ;AAEO,MAAM,OAAO,CAAC,SAAiC;AAClD,SAAO;AAAA,IACH,MAAM;AAAA,MACF,SAAS;AAAA,IACb;AAAA,IACA,IAAI;AAAA,MACA,SAAS;AAAA,IACb;AAAA,EACJ;AACJ;AAEO,MA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W;AAAA,MACX,SAAS;AAAA,IACb;AAAA,EACJ;AACJ;AAEO,MAAM,kBAAkB,CAAC,SAAiC;AAC7D,SAAO;AAAA,IACH,MAAM;AAAA,MACF,QAAQ;AAAA,MACR,UAAU;AAAA,IACd;AAAA,IACA,IAAI;AAAA,MACA,QAAQ,MAAM,SAAS,MAAM,SAAS,iBAAiB;AAAA,MACvD,UAAU;AAAA,IACd;AAAA,EACJ;AACJ;AAGO,MAAM,oBAAoB,CAAC,SAAiC;AAC/D,SAAO;AAAA,IACH,MAAM;AAAA,MACF,OAAO;AAAA,MACP,UAAU;AAAA,IACd;AAAA,IACA,IAAI;AAAA,MACA,OAAO,MAAM,QAAQ,MAAM,QAAQ,iBAAiB;AAAA,MACpD,UAAU;AAAA,IACd;AAAA,EACJ;AACJ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
import { BreakpointKeys } from "../css/types";
|
|
3
|
+
export declare const BreakpointCtx: React.Context<BreakpointKeys>;
|
|
4
|
+
export declare const BreakpointProvider: ({ children }: {
|
|
5
|
+
children?: ReactNode;
|
|
6
|
+
}) => React.JSX.Element;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import isWindow from "../isWindow";
|
|
3
|
+
import { breakpoints } from "../css";
|
|
4
|
+
const BreakpointCtx = React.createContext("xl");
|
|
5
|
+
const getKey = () => {
|
|
6
|
+
const isWin = isWindow();
|
|
7
|
+
if (isWin) {
|
|
8
|
+
const width = window.innerWidth;
|
|
9
|
+
if (width < breakpoints.sm) {
|
|
10
|
+
return "xs";
|
|
11
|
+
} else if (width > breakpoints.xs && width < breakpoints.md) {
|
|
12
|
+
return "sm";
|
|
13
|
+
} else if (width > breakpoints.sm && width < breakpoints.lg) {
|
|
14
|
+
return "md";
|
|
15
|
+
} else if (width > breakpoints.md && width < breakpoints.xl) {
|
|
16
|
+
return "lg";
|
|
17
|
+
} else {
|
|
18
|
+
return "xl";
|
|
19
|
+
}
|
|
20
|
+
} else {
|
|
21
|
+
return "xl";
|
|
22
|
+
}
|
|
23
|
+
};
|
|
24
|
+
const BreakpointProvider = ({ children }) => {
|
|
25
|
+
const [current, setCurrent] = useState(getKey);
|
|
26
|
+
const handler = () => {
|
|
27
|
+
let c = getKey();
|
|
28
|
+
if (current !== c) {
|
|
29
|
+
setCurrent(c);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
32
|
+
React.useEffect(() => {
|
|
33
|
+
window.removeEventListener("resize", handler);
|
|
34
|
+
window.addEventListener("resize", handler);
|
|
35
|
+
handler();
|
|
36
|
+
return () => {
|
|
37
|
+
window.removeEventListener("resize", handler);
|
|
38
|
+
};
|
|
39
|
+
}, [current]);
|
|
40
|
+
return /* @__PURE__ */ React.createElement(BreakpointCtx.Provider, { value: current }, children);
|
|
41
|
+
};
|
|
42
|
+
export {
|
|
43
|
+
BreakpointCtx,
|
|
44
|
+
BreakpointProvider
|
|
45
|
+
};
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/breakpoint/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import React, { ReactNode, useState } from \"react\";\nimport isWindow from \"../isWindow\";\nimport { breakpoints } from \"../css\";\nimport { BreakpointKeys } from \"../css/types\";\n\nexport const BreakpointCtx = React.createContext<BreakpointKeys>(\"xl\")\n\nconst getKey = (): BreakpointKeys => {\n const isWin = isWindow()\n if (isWin) {\n const width = window.innerWidth\n if (width < breakpoints.sm) {\n return 'xs'\n } else if (width > breakpoints.xs && width < breakpoints.md) {\n return 'sm'\n } else if (width > breakpoints.sm && width < breakpoints.lg) {\n return 'md'\n } else if (width > breakpoints.md && width < breakpoints.xl) {\n return 'lg'\n } else {\n return 'xl'\n }\n } else {\n return 'xl'\n }\n}\n\nexport const BreakpointProvider = ({ children }: { children?: ReactNode }) => {\n const [current, setCurrent] = useState<BreakpointKeys>(getKey)\n\n const handler = () => {\n let c = getKey()\n if (current !== c) {\n setCurrent(c)\n }\n }\n\n React.useEffect(() => {\n window.removeEventListener(\"resize\", handler)\n window.addEventListener(\"resize\", handler)\n handler()\n return () => {\n window.removeEventListener(\"resize\", handler)\n }\n }, [current])\n\n return (\n <BreakpointCtx.Provider value={current}>\n {children}\n </BreakpointCtx.Provider>\n )\n}\n"],
|
|
5
|
+
"mappings": "AAAA,OAAO,SAAoB,gBAAgB;AAC3C,OAAO,cAAc;AACrB,SAAS,mBAAmB;AAGrB,MAAM,gBAAgB,MAAM,cAA8B,IAAI;AAErE,MAAM,SAAS,MAAsB;AACjC,QAAM,QAAQ,SAAS;AACvB,MAAI,OAAO;AACP,UAAM,QAAQ,OAAO;AACrB,QAAI,QAAQ,YAAY,IAAI;AACxB,aAAO;AAAA,IACX,WAAW,QAAQ,YAAY,MAAM,QAAQ,YAAY,IAAI;AACzD,aAAO;AAAA,IACX,WAAW,QAAQ,YAAY,MAAM,QAAQ,YAAY,IAAI;AACzD,aAAO;AAAA,IACX,WAAW,QAAQ,YAAY,MAAM,QAAQ,YAAY,IAAI;AACzD,aAAO;AAAA,IACX,OAAO;AACH,aAAO;AAAA,IACX;AAAA,EACJ,OAAO;AACH,WAAO;AAAA,EACX;AACJ;AAEO,MAAM,qBAAqB,CAAC,EAAE,SAAS,MAAgC;AAC1E,QAAM,CAAC,SAAS,UAAU,IAAI,SAAyB,MAAM;AAE7D,QAAM,UAAU,MAAM;AAClB,QAAI,IAAI,OAAO;AACf,QAAI,YAAY,GAAG;AACf,iBAAW,CAAC;AAAA,IAChB;AAAA,EACJ;AAEA,QAAM,UAAU,MAAM;AAClB,WAAO,oBAAoB,UAAU,OAAO;AAC5C,WAAO,iBAAiB,UAAU,OAAO;AACzC,YAAQ;AACR,WAAO,MAAM;AACT,aAAO,oBAAoB,UAAU,OAAO;AAAA,IAChD;AAAA,EACJ,GAAG,CAAC,OAAO,CAAC;AAEZ,SACI,oCAAC,cAAc,UAAd,EAAuB,OAAO,WAC1B,QACL;AAER;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BreakpointKeys } from "../css/types";
|
|
2
|
+
declare const useBreakpoint: () => {
|
|
3
|
+
value: BreakpointKeys;
|
|
4
|
+
is: (key: BreakpointKeys) => boolean;
|
|
5
|
+
isDown: (key: BreakpointKeys) => boolean;
|
|
6
|
+
isUp: (key: BreakpointKeys) => boolean;
|
|
7
|
+
isOrDown: (key: BreakpointKeys) => boolean;
|
|
8
|
+
isOrUp: (key: BreakpointKeys) => boolean;
|
|
9
|
+
};
|
|
10
|
+
export default useBreakpoint;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { useContext } from "react";
|
|
2
|
+
import { BreakpointCtx } from ".";
|
|
3
|
+
import isWindow from "../isWindow";
|
|
4
|
+
import { breakpoints } from "../css";
|
|
5
|
+
const useBreakpoint = () => {
|
|
6
|
+
const val = useContext(BreakpointCtx);
|
|
7
|
+
const isWin = isWindow();
|
|
8
|
+
const o = {
|
|
9
|
+
value: val,
|
|
10
|
+
is: (key) => val === key,
|
|
11
|
+
isDown: (key) => {
|
|
12
|
+
if (isWin) {
|
|
13
|
+
return window.innerWidth > breakpoints[key];
|
|
14
|
+
}
|
|
15
|
+
return false;
|
|
16
|
+
},
|
|
17
|
+
isUp: (key) => {
|
|
18
|
+
if (isWin) {
|
|
19
|
+
return window.innerWidth < breakpoints[key];
|
|
20
|
+
}
|
|
21
|
+
return false;
|
|
22
|
+
},
|
|
23
|
+
isOrDown: (key) => o.is(key) || o.isDown(key),
|
|
24
|
+
isOrUp: (key) => o.is(key) || o.isUp(key)
|
|
25
|
+
};
|
|
26
|
+
return o;
|
|
27
|
+
};
|
|
28
|
+
var useBreakpoint_default = useBreakpoint;
|
|
29
|
+
export {
|
|
30
|
+
useBreakpoint_default as default
|
|
31
|
+
};
|
|
32
|
+
//# sourceMappingURL=useBreakpoint.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/breakpoint/useBreakpoint.ts"],
|
|
4
|
+
"sourcesContent": ["import { useContext } from \"react\"\nimport { BreakpointCtx } from \".\"\nimport isWindow from \"../isWindow\"\nimport { breakpoints } from \"../css\"\nimport { BreakpointKeys } from \"../css/types\"\n\nconst useBreakpoint = () => {\n const val = useContext(BreakpointCtx)\n const isWin = isWindow()\n const o = {\n value: val,\n is: (key: BreakpointKeys) => val === key,\n isDown: (key: BreakpointKeys) => {\n if (isWin) {\n return window.innerWidth > breakpoints[key]\n }\n return false\n },\n isUp: (key: BreakpointKeys) => {\n if (isWin) {\n return window.innerWidth < breakpoints[key]\n }\n return false\n },\n isOrDown: (key: BreakpointKeys) => o.is(key) || o.isDown(key),\n isOrUp: (key: BreakpointKeys) => o.is(key) || o.isUp(key)\n }\n return o\n}\n\nexport default useBreakpoint\n"],
|
|
5
|
+
"mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,qBAAqB;AAC9B,OAAO,cAAc;AACrB,SAAS,mBAAmB;AAG5B,MAAM,gBAAgB,MAAM;AACzB,QAAM,MAAM,WAAW,aAAa;AACpC,QAAM,QAAQ,SAAS;AACvB,QAAM,IAAI;AAAA,IACP,OAAO;AAAA,IACP,IAAI,CAAC,QAAwB,QAAQ;AAAA,IACrC,QAAQ,CAAC,QAAwB;AAC9B,UAAI,OAAO;AACR,eAAO,OAAO,aAAa,YAAY,GAAG;AAAA,MAC7C;AACA,aAAO;AAAA,IACV;AAAA,IACA,MAAM,CAAC,QAAwB;AAC5B,UAAI,OAAO;AACR,eAAO,OAAO,aAAa,YAAY,GAAG;AAAA,MAC7C;AACA,aAAO;AAAA,IACV;AAAA,IACA,UAAU,CAAC,QAAwB,EAAE,GAAG,GAAG,KAAK,EAAE,OAAO,GAAG;AAAA,IAC5D,QAAQ,CAAC,QAAwB,EAAE,GAAG,GAAG,KAAK,EAAE,KAAK,GAAG;AAAA,EAC3D;AACA,SAAO;AACV;AAEA,IAAO,wBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { BreakpointKeys } from "../css/types";
|
|
2
|
+
export type useBreakpointPropsType<P> = P | {
|
|
3
|
+
[key in BreakpointKeys]?: P;
|
|
4
|
+
};
|
|
5
|
+
declare const useBreakpoinProps: <P extends object>(props: useBreakpointPropsType<P>) => useBreakpointPropsType<P>;
|
|
6
|
+
export default useBreakpoinProps;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import React, { isValidElement } from "react";
|
|
2
|
+
import useBreakpoint from "./useBreakpoint";
|
|
3
|
+
const useBreakpoinProps = (props) => {
|
|
4
|
+
const bpoint = useBreakpoint();
|
|
5
|
+
const stringifiedElement = JSON.stringify(props, (key, value) => {
|
|
6
|
+
if (key === "_owner" || key === "_store") {
|
|
7
|
+
return void 0;
|
|
8
|
+
}
|
|
9
|
+
return value;
|
|
10
|
+
}, 2);
|
|
11
|
+
let format = React.useMemo(() => {
|
|
12
|
+
const _format = {
|
|
13
|
+
xs: {},
|
|
14
|
+
sm: {},
|
|
15
|
+
md: {},
|
|
16
|
+
lg: {},
|
|
17
|
+
xl: {}
|
|
18
|
+
};
|
|
19
|
+
for (let prop in props) {
|
|
20
|
+
let val = props[prop];
|
|
21
|
+
if (!isValidElement(val) && typeof val === "object") {
|
|
22
|
+
for (let breakpoin in val) {
|
|
23
|
+
_format[breakpoin][prop] = props[prop][breakpoin];
|
|
24
|
+
}
|
|
25
|
+
} else {
|
|
26
|
+
_format.xs[prop] = props[prop];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return _format;
|
|
30
|
+
}, [stringifiedElement, bpoint.value]);
|
|
31
|
+
return React.useMemo(() => {
|
|
32
|
+
let _props = format.xs || {};
|
|
33
|
+
for (let key of ["sm", "md", "lg", "xl"]) {
|
|
34
|
+
if (bpoint.isOrDown(key)) {
|
|
35
|
+
_props = { ..._props, ...format[key] };
|
|
36
|
+
}
|
|
37
|
+
if (bpoint.is(key)) {
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
return _props;
|
|
42
|
+
}, [format, bpoint.value]);
|
|
43
|
+
};
|
|
44
|
+
var useBreakpointProps_default = useBreakpoinProps;
|
|
45
|
+
export {
|
|
46
|
+
useBreakpointProps_default as default
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=useBreakpointProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/breakpoint/useBreakpointProps.ts"],
|
|
4
|
+
"sourcesContent": ["import React, { isValidElement } from \"react\"\nimport useBreakpoint from \"./useBreakpoint\"\nimport { BreakpointKeys } from \"../css/types\"\n\nexport type useBreakpointPropsType<P> = P | {\n [key in BreakpointKeys]?: P\n}\n\nconst useBreakpoinProps = <P extends object>(props: useBreakpointPropsType<P>): useBreakpointPropsType<P> => {\n const bpoint = useBreakpoint()\n const stringifiedElement = JSON.stringify(props, (key, value) => {\n if (key === '_owner' || key === '_store') {\n return undefined; // Skip circular references\n }\n return value;\n }, 2);\n\n let format: any = React.useMemo(() => {\n\n const _format: any = {\n xs: {},\n sm: {},\n md: {},\n lg: {},\n xl: {}\n }\n for (let prop in props) {\n let val = (props as any)[prop]\n if (!isValidElement(val) && typeof val === 'object') {\n for (let breakpoin in val) {\n _format[breakpoin][prop] = (props as any)[prop][breakpoin]\n }\n } else {\n _format.xs[prop] = (props as any)[prop]\n }\n }\n\n return _format\n }, [stringifiedElement, bpoint.value])\n\n return React.useMemo(() => {\n let _props = format.xs || {};\n for (let key of ['sm', 'md', 'lg', 'xl']) {\n if (bpoint.isOrDown(key as any)) {\n _props = { ..._props, ...format[key] };\n }\n if (bpoint.is(key as any)) {\n break;\n }\n }\n return _props;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IA,IAAO,6BAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/css/aliases.d.ts
ADDED
package/css/aliases.js
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const isStr = (v, or) => typeof v === "string" ? v : or;
|
|
2
|
+
const aliases = {
|
|
3
|
+
bgcolor: (v) => ({ backgroundColor: v }),
|
|
4
|
+
bgimage: (v) => ({ backgroundImage: `url(${v})`, "background-size": "cover", "background-repeat": "no-repeat" }),
|
|
5
|
+
bg: (v) => ({ "background": v }),
|
|
6
|
+
p: (v) => ({ "padding": isStr(v, 8 * v) }),
|
|
7
|
+
pt: (v) => ({ paddingTop: isStr(v, 8 * v) }),
|
|
8
|
+
pr: (v) => ({ paddingRight: isStr(v, 8 * v) }),
|
|
9
|
+
pb: (v) => ({ paddingBottom: isStr(v, 8 * v) }),
|
|
10
|
+
pl: (v) => ({ paddingLeft: isStr(v, 8 * v) }),
|
|
11
|
+
px: (v) => ({ paddingLeft: isStr(v, 8 * v), paddingRight: isStr(v, 8 * v) }),
|
|
12
|
+
py: (v) => ({ paddingTop: isStr(v, 8 * v), paddingBottom: isStr(v, 8 * v) }),
|
|
13
|
+
m: (v) => ({ margin: isStr(v, 8 * v) }),
|
|
14
|
+
mt: (v) => ({ marginTop: isStr(v, 8 * v) }),
|
|
15
|
+
mr: (v) => ({ marginRight: isStr(v, 8 * v) }),
|
|
16
|
+
mb: (v) => ({ marginBottom: isStr(v, 8 * v) }),
|
|
17
|
+
ml: (v) => ({ marginLeft: isStr(v, 8 * v) }),
|
|
18
|
+
mx: (v) => ({ marginLeft: isStr(v, 8 * v), marginRight: isStr(v, 8 * v) }),
|
|
19
|
+
my: (v) => ({ marginTop: isStr(v, 8 * v), marginBottom: isStr(v, 8 * v) }),
|
|
20
|
+
radius: (v) => ({ borderRadius: isStr(v, 8 * v) }),
|
|
21
|
+
borderRadius: (v) => ({ borderRadius: isStr(v, 8 * v) }),
|
|
22
|
+
shadow: (v) => ({ boxShadow: v }),
|
|
23
|
+
flexBox: (v) => v ? { display: "flex" } : {},
|
|
24
|
+
flexRow: (v) => v ? { flexDirection: "row" } : {},
|
|
25
|
+
flexColumn: (v) => v ? { flexDirection: "column" } : {},
|
|
26
|
+
flexWraped: (v) => v ? { flexWrap: "wrap" } : {},
|
|
27
|
+
direction: (v) => v === "row" || v === "column" ? { "flex-direction": v } : { direction: v },
|
|
28
|
+
gap: (v) => ({ "gap": isStr(v, 8 * v) })
|
|
29
|
+
};
|
|
30
|
+
var aliases_default = aliases;
|
|
31
|
+
export {
|
|
32
|
+
aliases_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=aliases.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/css/aliases.ts"],
|
|
4
|
+
"sourcesContent": ["import { OptionAliases } from 'oncss'\nimport { Aliases } from './types'\n\nconst isStr = (v: any, or: any) => typeof v === 'string' ? v : or\n\nconst aliases: OptionAliases<Aliases> = {\n bgcolor: (v) => ({ backgroundColor: v }),\n bgimage: (v) => ({ backgroundImage: `url(${v})`, \"background-size\": \"cover\", \"background-repeat\": \"no-repeat\" }),\n bg: (v) => ({ 'background': v }),\n p: (v) => ({ \"padding\": isStr(v, 8 * v) }),\n pt: (v) => ({ paddingTop: isStr(v, 8 * v) }),\n pr: (v) => ({ paddingRight: isStr(v, 8 * v) }),\n pb: (v) => ({ paddingBottom: isStr(v, 8 * v) }),\n pl: (v) => ({ paddingLeft: isStr(v, 8 * v) }),\n px: (v) => ({ paddingLeft: isStr(v, 8 * v), paddingRight: isStr(v, 8 * v) }),\n py: (v) => ({ paddingTop: isStr(v, 8 * v), paddingBottom: isStr(v, 8 * v) }),\n m: (v) => ({ margin: isStr(v, 8 * v) }),\n mt: (v) => ({ marginTop: isStr(v, 8 * v) }),\n mr: (v) => ({ marginRight: isStr(v, 8 * v) }),\n mb: (v) => ({ marginBottom: isStr(v, 8 * v) }),\n ml: (v) => ({ marginLeft: isStr(v, 8 * v) }),\n mx: (v) => ({ marginLeft: isStr(v, 8 * v), marginRight: isStr(v, 8 * v) }),\n my: (v) => ({ marginTop: isStr(v, 8 * v), marginBottom: isStr(v, 8 * v) }),\n radius: (v) => ({ borderRadius: isStr(v, 8 * v) }),\n borderRadius: (v) => ({ borderRadius: isStr(v, 8 * v) }),\n shadow: (v) => ({ boxShadow: v }),\n flexBox: (v) => (v ? { display: \"flex\" } : {}),\n flexRow: (v) => (v ? { flexDirection: \"row\" } : {}),\n flexColumn: (v) => (v ? { flexDirection: \"column\" } : {}),\n flexWraped: (v) => (v ? { flexWrap: \"wrap\" } : {}),\n direction: (v) => (v === 'row' || v === 'column' ? { \"flex-direction\": v } : { direction: v }),\n gap: (v) => ({ \"gap\": isStr(v, 8 * v) }),\n};\n\nexport default aliases"],
|
|
5
|
+
"mappings": "AAGA,MAAM,QAAQ,CAAC,GAAQ,OAAY,OAAO,MAAM,WAAW,IAAI;AAE/D,MAAM,UAAkC;AAAA,EACrC,SAAS,CAAC,OAAO,EAAE,iBAAiB,EAAE;AAAA,EACtC,SAAS,CAAC,OAAO,EAAE,iBAAiB,OAAO,CAAC,KAAK,mBAAmB,SAAS,qBAAqB,YAAY;AAAA,EAC9G,IAAI,CAAC,OAAO,EAAE,cAAc,EAAE;AAAA,EAC9B,GAAG,CAAC,OAAO,EAAE,WAAW,MAAM,GAAG,IAAI,CAAC,EAAE;AAAA,EACxC,IAAI,CAAC,OAAO,EAAE,YAAY,MAAM,GAAG,IAAI,CAAC,EAAE;AAAA,EAC1C,IAAI,CAAC,OAAO,EAAE,cAAc,MAAM,GAAG,IAAI,CAAC,EAAE;AAAA,EAC5C,IAAI,CAAC,OAAO,EAAE,eAAe,MAAM,GAAG,IAAI,CAAC,EAAE;AAAA,EAC7C,IAAI,CAAC,OAAO,EAAE,aAAa,MAAM,GAAG,IAAI,CAAC,EAAE;AAAA,EAC3C,IAAI,CAAC,OAAO,EAAE,aAAa,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,WAAW,CAAC,MAAO,MAAM,SAAS,MAAM,WAAW,EAAE,kBAAkB,EAAE,IAAI,EAAE,WAAW,EAAE;AAAA,EAC5F,KAAK,CAAC,OAAO,EAAE,OAAO,MAAM,GAAG,IAAI,CAAC,EAAE;AACzC;AAEA,IAAO,kBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/css/getProps.js
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
const getProps = (prop, value, _css) => {
|
|
2
|
+
let important;
|
|
3
|
+
if (typeof value === "string") {
|
|
4
|
+
const split = value.split("!");
|
|
5
|
+
important = split[1] ? "!important" : "";
|
|
6
|
+
value = split[0];
|
|
7
|
+
}
|
|
8
|
+
if (prop === "disabled") {
|
|
9
|
+
if (value === true) {
|
|
10
|
+
return {
|
|
11
|
+
pointerEvents: "none!important",
|
|
12
|
+
cursor: "default!important",
|
|
13
|
+
userSelect: "none!important",
|
|
14
|
+
opacity: ".8!important"
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
return {};
|
|
18
|
+
}
|
|
19
|
+
if (value && typeof value === "number" && ["border", "borderRight", "borderLeft", "borderTop", "borderBottom"].includes(prop)) {
|
|
20
|
+
const keys = Object.keys(_css);
|
|
21
|
+
let p = {
|
|
22
|
+
[`${prop}Width`]: value + "px" + (important || "")
|
|
23
|
+
};
|
|
24
|
+
if (!keys.includes(`${prop}Color`)) {
|
|
25
|
+
p[`${prop}Color`] = "divider";
|
|
26
|
+
}
|
|
27
|
+
if (!keys.includes(`${prop}Style`)) {
|
|
28
|
+
p[`${prop}Style`] = "solid";
|
|
29
|
+
}
|
|
30
|
+
return p;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
var getProps_default = getProps;
|
|
34
|
+
export {
|
|
35
|
+
getProps_default as default
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=getProps.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/css/getProps.ts"],
|
|
4
|
+
"sourcesContent": ["import { CSSProps } from \"./types\";\n\nconst getProps = (prop: string, value: string, _css: CSSProps) => {\n let important;\n if (typeof value === 'string') {\n const split = value.split(\"!\")\n important = split[1] ? \"!important\" : \"\"\n value = split[0]\n }\n\n if (prop === 'disabled') {\n if ((value as any) === true) {\n return {\n pointerEvents: \"none!important\",\n cursor: \"default!important\",\n userSelect: \"none!important\",\n opacity: \".8!important\"\n } as any\n }\n return {}\n }\n\n if (value && typeof value === \"number\" && [\"border\", \"borderRight\", \"borderLeft\", \"borderTop\", \"borderBottom\"].includes(prop as any)) {\n const keys = Object.keys(_css)\n let p: any = {\n [`${prop}Width`]: value + 'px' + (important || \"\"),\n }\n if (!keys.includes(`${prop}Color`)) {\n p[`${prop}Color`] = \"divider\"\n }\n if (!keys.includes(`${prop}Style`)) {\n p[`${prop}Style`] = \"solid\"\n }\n return p\n }\n}\n\nexport default getProps"],
|
|
5
|
+
"mappings": "AAEA,MAAM,WAAW,CAAC,MAAc,OAAe,SAAmB;AAC9D,MAAI;AACJ,MAAI,OAAO,UAAU,UAAU;AAC3B,UAAM,QAAQ,MAAM,MAAM,GAAG;AAC7B,gBAAY,MAAM,CAAC,IAAI,eAAe;AACtC,YAAQ,MAAM,CAAC;AAAA,EACnB;AAEA,MAAI,SAAS,YAAY;AACrB,QAAK,UAAkB,MAAM;AACzB,aAAO;AAAA,QACH,eAAe;AAAA,QACf,QAAQ;AAAA,QACR,YAAY;AAAA,QACZ,SAAS;AAAA,MACb;AAAA,IACJ;AACA,WAAO,CAAC;AAAA,EACZ;AAEA,MAAI,SAAS,OAAO,UAAU,YAAY,CAAC,UAAU,eAAe,cAAc,aAAa,cAAc,EAAE,SAAS,IAAW,GAAG;AAClI,UAAM,OAAO,OAAO,KAAK,IAAI;AAC7B,QAAI,IAAS;AAAA,MACT,CAAC,GAAG,IAAI,OAAO,GAAG,QAAQ,QAAQ,aAAa;AAAA,IACnD;AACA,QAAI,CAAC,KAAK,SAAS,GAAG,IAAI,OAAO,GAAG;AAChC,QAAE,GAAG,IAAI,OAAO,IAAI;AAAA,IACxB;AACA,QAAI,CAAC,KAAK,SAAS,GAAG,IAAI,OAAO,GAAG;AAChC,QAAE,GAAG,IAAI,OAAO,IAAI;AAAA,IACxB;AACA,WAAO;AAAA,EACX;AACJ;AAEA,IAAO,mBAAQ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|