@xanui/core 1.1.2 → 1.1.5
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.js +3 -0
- package/ServerStyleTags.js.map +1 -0
- package/ServerStyleTags.mjs +3 -0
- package/ServerStyleTags.mjs.map +1 -0
- package/Tag/cssPropList.js +186 -0
- package/Tag/cssPropList.js.map +1 -0
- package/{src/Tag/cssPropList.ts → Tag/cssPropList.mjs} +2 -7
- package/Tag/cssPropList.mjs.map +1 -0
- package/Tag/index.js +6 -0
- package/Tag/index.js.map +1 -0
- package/Tag/index.mjs +6 -0
- package/Tag/index.mjs.map +1 -0
- package/Tag/useTagProps.js +21 -0
- package/Tag/useTagProps.js.map +1 -0
- package/Tag/useTagProps.mjs +21 -0
- package/Tag/useTagProps.mjs.map +1 -0
- package/Transition/index.js +93 -0
- package/Transition/index.js.map +1 -0
- package/Transition/index.mjs +93 -0
- package/Transition/index.mjs.map +1 -0
- package/Transition/variants.js +158 -0
- package/Transition/variants.js.map +1 -0
- package/{src/Transition/variants.ts → Transition/variants.mjs} +44 -64
- package/Transition/variants.mjs.map +1 -0
- package/breakpoint/BreakpointProvider.js +43 -0
- package/breakpoint/BreakpointProvider.js.map +1 -0
- package/breakpoint/BreakpointProvider.mjs +43 -0
- package/breakpoint/BreakpointProvider.mjs.map +1 -0
- package/breakpoint/useBreakpoint.js +23 -0
- package/breakpoint/useBreakpoint.js.map +1 -0
- package/breakpoint/useBreakpoint.mjs +23 -0
- package/breakpoint/useBreakpoint.mjs.map +1 -0
- package/breakpoint/useBreakpointProps.js +42 -0
- package/breakpoint/useBreakpointProps.js.map +1 -0
- package/breakpoint/useBreakpointProps.mjs +42 -0
- package/breakpoint/useBreakpointProps.mjs.map +1 -0
- package/css/aliases.js +29 -0
- package/css/aliases.js.map +1 -0
- package/css/aliases.mjs +29 -0
- package/css/aliases.mjs.map +1 -0
- package/{src/css/getProps.ts → css/getProps.js} +15 -21
- package/css/getProps.js.map +1 -0
- package/css/getProps.mjs +32 -0
- package/css/getProps.mjs.map +1 -0
- package/{src/css/getValue.ts → css/getValue.js} +40 -65
- package/css/getValue.js.map +1 -0
- package/css/getValue.mjs +92 -0
- package/css/getValue.mjs.map +1 -0
- package/css/index.js +55 -0
- package/css/index.js.map +1 -0
- package/css/index.mjs +55 -0
- package/css/index.mjs.map +1 -0
- package/index.d.ts +629 -0
- package/index.js +1 -0
- package/index.js.map +1 -0
- package/index.mjs +1 -0
- package/index.mjs.map +1 -0
- package/isWindow.js +1 -0
- package/isWindow.js.map +1 -0
- package/isWindow.mjs +1 -0
- package/isWindow.mjs.map +1 -0
- package/package.json +50 -51
- package/theme/ThemeCssVars.js +5 -0
- package/theme/ThemeCssVars.js.map +1 -0
- package/theme/ThemeCssVars.mjs +5 -0
- package/theme/ThemeCssVars.mjs.map +1 -0
- package/theme/ThemeDefaultOptions.js +131 -0
- package/theme/ThemeDefaultOptions.js.map +1 -0
- package/{src/theme/ThemeDefaultOptions.ts → theme/ThemeDefaultOptions.mjs} +17 -32
- package/theme/ThemeDefaultOptions.mjs.map +1 -0
- package/theme/ThemeProvider.js +88 -0
- package/theme/ThemeProvider.js.map +1 -0
- package/theme/ThemeProvider.mjs +88 -0
- package/theme/ThemeProvider.mjs.map +1 -0
- package/theme/core.js +18 -0
- package/theme/core.js.map +1 -0
- package/theme/core.mjs +18 -0
- package/theme/core.mjs.map +1 -0
- package/theme/createColor.js +46 -0
- package/theme/createColor.js.map +1 -0
- package/theme/createColor.mjs +46 -0
- package/theme/createColor.mjs.map +1 -0
- package/theme/createTheme.js +21 -0
- package/theme/createTheme.js.map +1 -0
- package/theme/createTheme.mjs +21 -0
- package/theme/createTheme.mjs.map +1 -0
- package/theme/createThemeSwitcher.js +12 -0
- package/theme/createThemeSwitcher.js.map +1 -0
- package/theme/createThemeSwitcher.mjs +12 -0
- package/theme/createThemeSwitcher.mjs.map +1 -0
- package/theme/index.js +2 -0
- package/theme/index.js.map +1 -0
- package/theme/index.mjs +2 -0
- package/theme/index.mjs.map +1 -0
- package/useAnimation.js +25 -0
- package/useAnimation.js.map +1 -0
- package/{src/useAnimation.ts → useAnimation.mjs} +10 -25
- package/useAnimation.mjs.map +1 -0
- package/useColorTemplate.js +6 -0
- package/useColorTemplate.js.map +1 -0
- package/useColorTemplate.mjs +6 -0
- package/useColorTemplate.mjs.map +1 -0
- package/useInterface.js +8 -0
- package/useInterface.js.map +1 -0
- package/useInterface.mjs +8 -0
- package/useInterface.mjs.map +1 -0
- package/main.tsx +0 -97
- package/src/ServerStyleTags.tsx +0 -12
- package/src/Tag/index.tsx +0 -11
- package/src/Tag/types.ts +0 -183
- package/src/Tag/useTagProps.ts +0 -28
- package/src/Transition/index.tsx +0 -148
- package/src/breakpoint/index.tsx +0 -52
- package/src/breakpoint/useBreakpoint.ts +0 -31
- package/src/breakpoint/useBreakpointProps.ts +0 -57
- package/src/css/aliases.ts +0 -35
- package/src/css/index.ts +0 -78
- package/src/css/types.ts +0 -60
- package/src/index.ts +0 -34
- package/src/isWindow.ts +0 -3
- package/src/theme/ThemeCssVars.ts +0 -107
- package/src/theme/ThemeProvider.tsx +0 -140
- package/src/theme/core.ts +0 -21
- package/src/theme/createColor.ts +0 -53
- package/src/theme/createTheme.ts +0 -33
- package/src/theme/createThemeSwitcher.ts +0 -18
- package/src/theme/index.tsx +0 -17
- package/src/theme/types.ts +0 -181
- package/src/useColorTemplate.ts +0 -11
- package/src/useInterface.ts +0 -13
- package/tsconfig.json +0 -28
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});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: 0 + "px!important",
|
|
139
|
+
overflow: "hidden"
|
|
140
|
+
},
|
|
141
|
+
to: {
|
|
142
|
+
height: (_arg === null || _arg === void 0 ? void 0 : _arg.height) ? (_arg === null || _arg === void 0 ? void 0 : _arg.height) + "px!important" : "auto",
|
|
143
|
+
overflow: "hidden"
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
const collapsHorizental = (_arg) => {
|
|
148
|
+
return {
|
|
149
|
+
from: {
|
|
150
|
+
width: 0 + "px!important",
|
|
151
|
+
overflow: "hidden"
|
|
152
|
+
},
|
|
153
|
+
to: {
|
|
154
|
+
width: (_arg === null || _arg === void 0 ? void 0 : _arg.width) ? (_arg === null || _arg === void 0 ? void 0 : _arg.width) + "px!important" : "auto",
|
|
155
|
+
overflow: "hidden"
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
};exports.collapsHorizental=collapsHorizental;exports.collapsVerticle=collapsVerticle;exports.fade=fade;exports.fadeDown=fadeDown;exports.fadeLeft=fadeLeft;exports.fadeRight=fadeRight;exports.fadeUp=fadeUp;exports.grow=grow;exports.slideDown=slideDown;exports.slideLeft=slideLeft;exports.slideRight=slideRight;exports.slideUp=slideUp;exports.zoom=zoom;exports.zoomOver=zoomOver;//# sourceMappingURL=variants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.js","sources":["../../src/Transition/variants.ts"],"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"],"names":[],"mappings":"sEAEa,MAAA,SAAS,GAAG,CAAC,IAA4B,KAAI;IACtD,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAe,aAAA,CAAA;AACvD,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAyB,uBAAA,CAAA;AACvC;KACJ;AACL;AAEa,MAAA,OAAO,GAAG,CAAC,IAA4B,KAAI;IACpD,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,WAAA,EAAc,IAAI,CAAC,MAAM,CAAe,aAAA,CAAA;AACtD,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAyB,uBAAA,CAAA;AACvC;KACJ;AACL;AAEa,MAAA,UAAU,GAAG,CAAC,IAA4B,KAAI;IACvD,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,KAAK,CAAe,aAAA,CAAA;AACtD,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAyB,uBAAA,CAAA;AACvC;KACJ;AACL;AAEa,MAAA,SAAS,GAAG,CAAC,IAA4B,KAAI;IACtD,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,WAAA,EAAc,IAAI,CAAC,KAAK,CAAe,aAAA,CAAA;AACrD,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAyB,uBAAA,CAAA;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IAAI,EAAE;YACF,KAAK,EAAE,CAAC,GAAG,cAAc;AACzB,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAJ,IAAA,IAAA,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,cAAc,GAAG,MAAM;AAC1D,YAAA,QAAQ,EAAE;AACb;KACJ;AACL"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export const slideDown = (_arg: TransitionElementProps) => {
|
|
1
|
+
const slideDown = (_arg) => {
|
|
4
2
|
return {
|
|
5
3
|
from: {
|
|
6
4
|
transform: `translateY(-${_arg.height}px)!important`,
|
|
@@ -8,10 +6,9 @@ export const slideDown = (_arg: TransitionElementProps) => {
|
|
|
8
6
|
to: {
|
|
9
7
|
transform: `translateY(0)!important`,
|
|
10
8
|
}
|
|
11
|
-
}
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export const slideUp = (_arg: TransitionElementProps) => {
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
const slideUp = (_arg) => {
|
|
15
12
|
return {
|
|
16
13
|
from: {
|
|
17
14
|
transform: `translateY(${_arg.height}px)!important`,
|
|
@@ -19,10 +16,9 @@ export const slideUp = (_arg: TransitionElementProps) => {
|
|
|
19
16
|
to: {
|
|
20
17
|
transform: `translateY(0)!important`,
|
|
21
18
|
}
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export const slideRight = (_arg: TransitionElementProps) => {
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
const slideRight = (_arg) => {
|
|
26
22
|
return {
|
|
27
23
|
from: {
|
|
28
24
|
transform: `translateX(-${_arg.width}px)!important`,
|
|
@@ -30,10 +26,9 @@ export const slideRight = (_arg: TransitionElementProps) => {
|
|
|
30
26
|
to: {
|
|
31
27
|
transform: `translateX(0)!important`,
|
|
32
28
|
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export const slideLeft = (_arg: TransitionElementProps) => {
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
const slideLeft = (_arg) => {
|
|
37
32
|
return {
|
|
38
33
|
from: {
|
|
39
34
|
transform: `translateX(${_arg.width}px)!important`,
|
|
@@ -41,10 +36,9 @@ export const slideLeft = (_arg: TransitionElementProps) => {
|
|
|
41
36
|
to: {
|
|
42
37
|
transform: `translateX(0)!important`,
|
|
43
38
|
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export const fade = (_arg: TransitionElementProps) => {
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
const fade = (_arg) => {
|
|
48
42
|
return {
|
|
49
43
|
from: {
|
|
50
44
|
opacity: 0
|
|
@@ -52,10 +46,9 @@ export const fade = (_arg: TransitionElementProps) => {
|
|
|
52
46
|
to: {
|
|
53
47
|
opacity: 1
|
|
54
48
|
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
export const fadeDown = (_arg: TransitionElementProps) => {
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
const fadeDown = (_arg) => {
|
|
59
52
|
return {
|
|
60
53
|
from: {
|
|
61
54
|
transform: `translateY(-30px)!important`,
|
|
@@ -65,10 +58,9 @@ export const fadeDown = (_arg: TransitionElementProps) => {
|
|
|
65
58
|
transform: `translateY(0)!important`,
|
|
66
59
|
opacity: 1
|
|
67
60
|
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
export const fadeUp = (_arg: TransitionElementProps) => {
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
const fadeUp = (_arg) => {
|
|
72
64
|
return {
|
|
73
65
|
from: {
|
|
74
66
|
transform: `translateY(30px)!important`,
|
|
@@ -78,10 +70,9 @@ export const fadeUp = (_arg: TransitionElementProps) => {
|
|
|
78
70
|
transform: `translateY(0)!important`,
|
|
79
71
|
opacity: 1
|
|
80
72
|
}
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
export const fadeRight = (_arg: TransitionElementProps) => {
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
const fadeRight = (_arg) => {
|
|
85
76
|
return {
|
|
86
77
|
from: {
|
|
87
78
|
transform: `translateX(-30px)!important`,
|
|
@@ -91,10 +82,9 @@ export const fadeRight = (_arg: TransitionElementProps) => {
|
|
|
91
82
|
transform: `translateX(0)!important`,
|
|
92
83
|
opacity: 1
|
|
93
84
|
}
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
export const fadeLeft = (_arg: TransitionElementProps) => {
|
|
85
|
+
};
|
|
86
|
+
};
|
|
87
|
+
const fadeLeft = (_arg) => {
|
|
98
88
|
return {
|
|
99
89
|
from: {
|
|
100
90
|
transform: `translateX(30px)!important`,
|
|
@@ -104,10 +94,9 @@ export const fadeLeft = (_arg: TransitionElementProps) => {
|
|
|
104
94
|
transform: `translateX(0)!important`,
|
|
105
95
|
opacity: 1
|
|
106
96
|
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
export const grow = (_arg: TransitionElementProps) => {
|
|
97
|
+
};
|
|
98
|
+
};
|
|
99
|
+
const grow = (_arg) => {
|
|
111
100
|
return {
|
|
112
101
|
from: {
|
|
113
102
|
transform: "scale(.8, .6)!important",
|
|
@@ -117,10 +106,9 @@ export const grow = (_arg: TransitionElementProps) => {
|
|
|
117
106
|
transform: "scale(1)!important",
|
|
118
107
|
opacity: 1
|
|
119
108
|
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
export const zoom = (_arg: TransitionElementProps) => {
|
|
109
|
+
};
|
|
110
|
+
};
|
|
111
|
+
const zoom = (_arg) => {
|
|
124
112
|
return {
|
|
125
113
|
from: {
|
|
126
114
|
transform: "scale(.8)!important",
|
|
@@ -130,10 +118,9 @@ export const zoom = (_arg: TransitionElementProps) => {
|
|
|
130
118
|
transform: "scale(1)!important",
|
|
131
119
|
opacity: 1
|
|
132
120
|
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
|
|
136
|
-
export const zoomOver = (_arg: TransitionElementProps) => {
|
|
121
|
+
};
|
|
122
|
+
};
|
|
123
|
+
const zoomOver = (_arg) => {
|
|
137
124
|
return {
|
|
138
125
|
from: {
|
|
139
126
|
transform: "scale(1.2)!important",
|
|
@@ -143,36 +130,29 @@ export const zoomOver = (_arg: TransitionElementProps) => {
|
|
|
143
130
|
transform: "scale(1)!important",
|
|
144
131
|
opacity: 1
|
|
145
132
|
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export const collapsVerticle = (_arg: TransitionElementProps) => {
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
const collapsVerticle = (_arg) => {
|
|
150
136
|
return {
|
|
151
137
|
from: {
|
|
152
138
|
height: 0 + "px!important",
|
|
153
139
|
overflow: "hidden"
|
|
154
140
|
},
|
|
155
141
|
to: {
|
|
156
|
-
height: _arg
|
|
142
|
+
height: (_arg === null || _arg === void 0 ? void 0 : _arg.height) ? (_arg === null || _arg === void 0 ? void 0 : _arg.height) + "px!important" : "auto",
|
|
157
143
|
overflow: "hidden"
|
|
158
144
|
}
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
export const collapsHorizental = (_arg: TransitionElementProps) => {
|
|
145
|
+
};
|
|
146
|
+
};
|
|
147
|
+
const collapsHorizental = (_arg) => {
|
|
164
148
|
return {
|
|
165
149
|
from: {
|
|
166
150
|
width: 0 + "px!important",
|
|
167
151
|
overflow: "hidden"
|
|
168
152
|
},
|
|
169
153
|
to: {
|
|
170
|
-
width: _arg
|
|
154
|
+
width: (_arg === null || _arg === void 0 ? void 0 : _arg.width) ? (_arg === null || _arg === void 0 ? void 0 : _arg.width) + "px!important" : "auto",
|
|
171
155
|
overflow: "hidden"
|
|
172
156
|
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
157
|
+
};
|
|
158
|
+
};export{collapsHorizental,collapsVerticle,fade,fadeDown,fadeLeft,fadeRight,fadeUp,grow,slideDown,slideLeft,slideRight,slideUp,zoom,zoomOver};//# sourceMappingURL=variants.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"variants.mjs","sources":["../../src/Transition/variants.ts"],"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"],"names":[],"mappings":"AAEa,MAAA,SAAS,GAAG,CAAC,IAA4B,KAAI;IACtD,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,CAAA,YAAA,EAAe,IAAI,CAAC,MAAM,CAAe,aAAA,CAAA;AACvD,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,CAAyB,uBAAA,CAAA;AACvC;KACJ;AACL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J;AACL;AAEa,MAAA,QAAQ,GAAG,CAAC,IAA4B,KAAI;IACrD,OAAO;AACH,QAAA,IAAI,EAAE;AACF,YAAA,SAAS,EAAE,sBAAsB;AACjC,YAAA,OAAO,EAAE;AACZ,SAAA;AACD,QAAA,EAAE,EAAE;AACA,YAAA,SAAS,EAAE,oBAAoB;AAC/B,YAAA,OAAO,EAAE;AACZ;KACJ;AACL;AAEa,MAAA,eAAe,GAAG,CAAC,IAA4B,KAAI;IAC5D,OAAO;AACH,QAAA,IAAI,EAAE;YACF,MAAM,EAAE,CAAC,GAAG,cAAc;AAC1B,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,MAAM,EAAE,CAAA,IAAI,KAAJ,IAAA,IAAA,IAAI,uBAAJ,IAAI,CAAE,MAAM,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,MAAM,IAAG,cAAc,GAAG,MAAM;AAC7D,YAAA,QAAQ,EAAE;AACb;KACJ;AACL;AAGa,MAAA,iBAAiB,GAAG,CAAC,IAA4B,KAAI;IAC9D,OAAO;AACH,QAAA,IAAI,EAAE;YACF,KAAK,EAAE,CAAC,GAAG,cAAc;AACzB,YAAA,QAAQ,EAAE;AACb,SAAA;AACD,QAAA,EAAE,EAAE;YACA,KAAK,EAAE,CAAA,IAAI,KAAJ,IAAA,IAAA,IAAI,uBAAJ,IAAI,CAAE,KAAK,IAAG,CAAA,IAAI,KAAA,IAAA,IAAJ,IAAI,KAAA,MAAA,GAAA,MAAA,GAAJ,IAAI,CAAE,KAAK,IAAG,cAAc,GAAG,MAAM;AAC1D,YAAA,QAAQ,EAAE;AACb;KACJ;AACL"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
'use strict';Object.defineProperty(exports,'__esModule',{value:true});var React=require('react'),isWindow=require('../isWindow.js'),index=require('../css/index.js');const BreakpointCtx = React.createContext("xl");
|
|
2
|
+
const getKey = () => {
|
|
3
|
+
const isWin = isWindow();
|
|
4
|
+
if (isWin) {
|
|
5
|
+
const width = window.innerWidth;
|
|
6
|
+
if (width < index.breakpoints.sm) {
|
|
7
|
+
return 'xs';
|
|
8
|
+
}
|
|
9
|
+
else if (width > index.breakpoints.xs && width < index.breakpoints.md) {
|
|
10
|
+
return 'sm';
|
|
11
|
+
}
|
|
12
|
+
else if (width > index.breakpoints.sm && width < index.breakpoints.lg) {
|
|
13
|
+
return 'md';
|
|
14
|
+
}
|
|
15
|
+
else if (width > index.breakpoints.md && width < index.breakpoints.xl) {
|
|
16
|
+
return 'lg';
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return 'xl';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return 'xl';
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const BreakpointProvider = ({ children }) => {
|
|
27
|
+
const [current, setCurrent] = React.useState(getKey);
|
|
28
|
+
const handler = () => {
|
|
29
|
+
let c = getKey();
|
|
30
|
+
if (current !== c) {
|
|
31
|
+
setCurrent(c);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
React.useEffect(() => {
|
|
35
|
+
window.removeEventListener("resize", handler);
|
|
36
|
+
window.addEventListener("resize", handler);
|
|
37
|
+
handler();
|
|
38
|
+
return () => {
|
|
39
|
+
window.removeEventListener("resize", handler);
|
|
40
|
+
};
|
|
41
|
+
}, [current]);
|
|
42
|
+
return (React.createElement(BreakpointCtx.Provider, { value: current }, children));
|
|
43
|
+
};exports.BreakpointCtx=BreakpointCtx;exports.BreakpointProvider=BreakpointProvider;//# sourceMappingURL=BreakpointProvider.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreakpointProvider.js","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"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"],"names":["breakpoints","useState"],"mappings":"qKAKa,MAAA,aAAa,GAAG,KAAK,CAAC,aAAa,CAAiB,IAAI;AAErE,MAAM,MAAM,GAAG,MAAqB;AAChC,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;AACxB,IAAA,IAAI,KAAK,EAAE;AACP,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU;AAC/B,QAAA,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE,EAAE;AACxB,YAAA,OAAO,IAAI;AACd;aAAM,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE,EAAE;AACzD,YAAA,OAAO,IAAI;AACd;aAAM,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE,EAAE;AACzD,YAAA,OAAO,IAAI;AACd;aAAM,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE,IAAI,KAAK,GAAGA,iBAAW,CAAC,EAAE,EAAE;AACzD,YAAA,OAAO,IAAI;AACd;AAAM,aAAA;AACH,YAAA,OAAO,IAAI;AACd;AACJ;AAAM,SAAA;AACH,QAAA,OAAO,IAAI;AACd;AACL,CAAC;MAEY,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAA4B,KAAI;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAGC,cAAQ,CAAiB,MAAM,CAAC;IAE9D,MAAM,OAAO,GAAG,MAAK;AACjB,QAAA,IAAI,CAAC,GAAG,MAAM,EAAE;QAChB,IAAI,OAAO,KAAK,CAAC,EAAE;YACf,UAAU,CAAC,CAAC,CAAC;AAChB;AACL,KAAC;AAED,IAAA,KAAK,CAAC,SAAS,CAAC,MAAK;AACjB,QAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC7C,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC1C,QAAA,OAAO,EAAE;AACT,QAAA,OAAO,MAAK;AACR,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;AACjD,SAAC;AACL,KAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAEb,IAAA,QACI,KAAA,CAAA,aAAA,CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,EACjC,QAAQ,CACY;AAEjC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React__default,{useState}from'react';import isWindow from'../isWindow.mjs';import {breakpoints}from'../css/index.mjs';const BreakpointCtx = React__default.createContext("xl");
|
|
2
|
+
const getKey = () => {
|
|
3
|
+
const isWin = isWindow();
|
|
4
|
+
if (isWin) {
|
|
5
|
+
const width = window.innerWidth;
|
|
6
|
+
if (width < breakpoints.sm) {
|
|
7
|
+
return 'xs';
|
|
8
|
+
}
|
|
9
|
+
else if (width > breakpoints.xs && width < breakpoints.md) {
|
|
10
|
+
return 'sm';
|
|
11
|
+
}
|
|
12
|
+
else if (width > breakpoints.sm && width < breakpoints.lg) {
|
|
13
|
+
return 'md';
|
|
14
|
+
}
|
|
15
|
+
else if (width > breakpoints.md && width < breakpoints.xl) {
|
|
16
|
+
return 'lg';
|
|
17
|
+
}
|
|
18
|
+
else {
|
|
19
|
+
return 'xl';
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
return 'xl';
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const BreakpointProvider = ({ children }) => {
|
|
27
|
+
const [current, setCurrent] = useState(getKey);
|
|
28
|
+
const handler = () => {
|
|
29
|
+
let c = getKey();
|
|
30
|
+
if (current !== c) {
|
|
31
|
+
setCurrent(c);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
React__default.useEffect(() => {
|
|
35
|
+
window.removeEventListener("resize", handler);
|
|
36
|
+
window.addEventListener("resize", handler);
|
|
37
|
+
handler();
|
|
38
|
+
return () => {
|
|
39
|
+
window.removeEventListener("resize", handler);
|
|
40
|
+
};
|
|
41
|
+
}, [current]);
|
|
42
|
+
return (React__default.createElement(BreakpointCtx.Provider, { value: current }, children));
|
|
43
|
+
};export{BreakpointCtx,BreakpointProvider};//# sourceMappingURL=BreakpointProvider.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BreakpointProvider.mjs","sources":["../../src/breakpoint/BreakpointProvider.tsx"],"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"],"names":["React"],"mappings":"6HAKa,MAAA,aAAa,GAAGA,cAAK,CAAC,aAAa,CAAiB,IAAI;AAErE,MAAM,MAAM,GAAG,MAAqB;AAChC,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;AACxB,IAAA,IAAI,KAAK,EAAE;AACP,QAAA,MAAM,KAAK,GAAG,MAAM,CAAC,UAAU;AAC/B,QAAA,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE,EAAE;AACxB,YAAA,OAAO,IAAI;AACd;aAAM,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE,EAAE;AACzD,YAAA,OAAO,IAAI;AACd;aAAM,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE,EAAE;AACzD,YAAA,OAAO,IAAI;AACd;aAAM,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE,IAAI,KAAK,GAAG,WAAW,CAAC,EAAE,EAAE;AACzD,YAAA,OAAO,IAAI;AACd;AAAM,aAAA;AACH,YAAA,OAAO,IAAI;AACd;AACJ;AAAM,SAAA;AACH,QAAA,OAAO,IAAI;AACd;AACL,CAAC;MAEY,kBAAkB,GAAG,CAAC,EAAE,QAAQ,EAA4B,KAAI;IACzE,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAiB,MAAM,CAAC;IAE9D,MAAM,OAAO,GAAG,MAAK;AACjB,QAAA,IAAI,CAAC,GAAG,MAAM,EAAE;QAChB,IAAI,OAAO,KAAK,CAAC,EAAE;YACf,UAAU,CAAC,CAAC,CAAC;AAChB;AACL,KAAC;AAED,IAAAA,cAAK,CAAC,SAAS,CAAC,MAAK;AACjB,QAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC7C,QAAA,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE,OAAO,CAAC;AAC1C,QAAA,OAAO,EAAE;AACT,QAAA,OAAO,MAAK;AACR,YAAA,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE,OAAO,CAAC;AACjD,SAAC;AACL,KAAC,EAAE,CAAC,OAAO,CAAC,CAAC;AAEb,IAAA,QACIA,cAAA,CAAA,aAAA,CAAC,aAAa,CAAC,QAAQ,EAAA,EAAC,KAAK,EAAE,OAAO,EAAA,EACjC,QAAQ,CACY;AAEjC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';var React=require('react'),BreakpointProvider=require('./BreakpointProvider.js'),isWindow=require('../isWindow.js'),index=require('../css/index.js');const useBreakpoint = () => {
|
|
2
|
+
const val = React.useContext(BreakpointProvider.BreakpointCtx);
|
|
3
|
+
const isWin = isWindow();
|
|
4
|
+
const o = {
|
|
5
|
+
value: val,
|
|
6
|
+
is: (key) => val === key,
|
|
7
|
+
isDown: (key) => {
|
|
8
|
+
if (isWin) {
|
|
9
|
+
return window.innerWidth > index.breakpoints[key];
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
},
|
|
13
|
+
isUp: (key) => {
|
|
14
|
+
if (isWin) {
|
|
15
|
+
return window.innerWidth < index.breakpoints[key];
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
},
|
|
19
|
+
isOrDown: (key) => o.is(key) || o.isDown(key),
|
|
20
|
+
isOrUp: (key) => o.is(key) || o.isUp(key)
|
|
21
|
+
};
|
|
22
|
+
return o;
|
|
23
|
+
};module.exports=useBreakpoint;//# sourceMappingURL=useBreakpoint.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.js","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\"\nimport { BreakpointCtx } from \"./BreakpointProvider\"\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"],"names":["useContext","BreakpointCtx","breakpoints"],"mappings":"kKAMM,MAAA,aAAa,GAAG,MAAK;AACxB,IAAA,MAAM,GAAG,GAAGA,gBAAU,CAACC,gCAAa,CAAC;AACrC,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;AACxB,IAAA,MAAM,CAAC,GAAG;AACP,QAAA,KAAK,EAAE,GAAG;QACV,EAAE,EAAE,CAAC,GAAmB,KAAK,GAAG,KAAK,GAAG;AACxC,QAAA,MAAM,EAAE,CAAC,GAAmB,KAAI;AAC7B,YAAA,IAAI,KAAK,EAAE;gBACR,OAAO,MAAM,CAAC,UAAU,GAAGC,iBAAW,CAAC,GAAG,CAAC;AAC7C;AACD,YAAA,OAAO,KAAK;SACd;AACD,QAAA,IAAI,EAAE,CAAC,GAAmB,KAAI;AAC3B,YAAA,IAAI,KAAK,EAAE;gBACR,OAAO,MAAM,CAAC,UAAU,GAAGA,iBAAW,CAAC,GAAG,CAAC;AAC7C;AACD,YAAA,OAAO,KAAK;SACd;AACD,QAAA,QAAQ,EAAE,CAAC,GAAmB,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AAC7D,QAAA,MAAM,EAAE,CAAC,GAAmB,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG;KAC1D;AACD,IAAA,OAAO,CAAC;AACX"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import {useContext}from'react';import {BreakpointCtx}from'./BreakpointProvider.mjs';import isWindow from'../isWindow.mjs';import {breakpoints}from'../css/index.mjs';const useBreakpoint = () => {
|
|
2
|
+
const val = useContext(BreakpointCtx);
|
|
3
|
+
const isWin = isWindow();
|
|
4
|
+
const o = {
|
|
5
|
+
value: val,
|
|
6
|
+
is: (key) => val === key,
|
|
7
|
+
isDown: (key) => {
|
|
8
|
+
if (isWin) {
|
|
9
|
+
return window.innerWidth > breakpoints[key];
|
|
10
|
+
}
|
|
11
|
+
return false;
|
|
12
|
+
},
|
|
13
|
+
isUp: (key) => {
|
|
14
|
+
if (isWin) {
|
|
15
|
+
return window.innerWidth < breakpoints[key];
|
|
16
|
+
}
|
|
17
|
+
return false;
|
|
18
|
+
},
|
|
19
|
+
isOrDown: (key) => o.is(key) || o.isDown(key),
|
|
20
|
+
isOrUp: (key) => o.is(key) || o.isUp(key)
|
|
21
|
+
};
|
|
22
|
+
return o;
|
|
23
|
+
};export{useBreakpoint as default};//# sourceMappingURL=useBreakpoint.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpoint.mjs","sources":["../../src/breakpoint/useBreakpoint.ts"],"sourcesContent":["import { useContext } from \"react\"\nimport { BreakpointCtx } from \"./BreakpointProvider\"\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"],"names":[],"mappings":"qKAMM,MAAA,aAAa,GAAG,MAAK;AACxB,IAAA,MAAM,GAAG,GAAG,UAAU,CAAC,aAAa,CAAC;AACrC,IAAA,MAAM,KAAK,GAAG,QAAQ,EAAE;AACxB,IAAA,MAAM,CAAC,GAAG;AACP,QAAA,KAAK,EAAE,GAAG;QACV,EAAE,EAAE,CAAC,GAAmB,KAAK,GAAG,KAAK,GAAG;AACxC,QAAA,MAAM,EAAE,CAAC,GAAmB,KAAI;AAC7B,YAAA,IAAI,KAAK,EAAE;gBACR,OAAO,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC;AAC7C;AACD,YAAA,OAAO,KAAK;SACd;AACD,QAAA,IAAI,EAAE,CAAC,GAAmB,KAAI;AAC3B,YAAA,IAAI,KAAK,EAAE;gBACR,OAAO,MAAM,CAAC,UAAU,GAAG,WAAW,CAAC,GAAG,CAAC;AAC7C;AACD,YAAA,OAAO,KAAK;SACd;AACD,QAAA,QAAQ,EAAE,CAAC,GAAmB,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;AAC7D,QAAA,MAAM,EAAE,CAAC,GAAmB,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG;KAC1D;AACD,IAAA,OAAO,CAAC;AACX"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';var React=require('react'),useBreakpoint=require('./useBreakpoint.js');const useBreakpoinProps = (props) => {
|
|
2
|
+
const bpoint = useBreakpoint();
|
|
3
|
+
const stringifiedElement = JSON.stringify(props, (key, value) => {
|
|
4
|
+
if (key === '_owner' || key === '_store') {
|
|
5
|
+
return undefined; // Skip circular references
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
}, 2);
|
|
9
|
+
let format = React.useMemo(() => {
|
|
10
|
+
const _format = {
|
|
11
|
+
xs: {},
|
|
12
|
+
sm: {},
|
|
13
|
+
md: {},
|
|
14
|
+
lg: {},
|
|
15
|
+
xl: {}
|
|
16
|
+
};
|
|
17
|
+
for (let prop in props) {
|
|
18
|
+
let val = props[prop];
|
|
19
|
+
if (!React.isValidElement(val) && typeof val === 'object') {
|
|
20
|
+
for (let breakpoin in val) {
|
|
21
|
+
_format[breakpoin][prop] = props[prop][breakpoin];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
_format.xs[prop] = props[prop];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return _format;
|
|
29
|
+
}, [stringifiedElement, bpoint.value]);
|
|
30
|
+
return React.useMemo(() => {
|
|
31
|
+
let _props = format.xs || {};
|
|
32
|
+
for (let key of ['sm', 'md', 'lg', 'xl']) {
|
|
33
|
+
if (bpoint.isOrDown(key)) {
|
|
34
|
+
_props = Object.assign(Object.assign({}, _props), format[key]);
|
|
35
|
+
}
|
|
36
|
+
if (bpoint.is(key)) {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return _props;
|
|
41
|
+
}, [format, bpoint.value]);
|
|
42
|
+
};module.exports=useBreakpoinProps;//# sourceMappingURL=useBreakpointProps.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useBreakpointProps.js","sources":["../../src/breakpoint/useBreakpointProps.ts"],"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;\n }, [format, bpoint.value]);\n}\n\n\n\nexport default useBreakpoinProps"],"names":["isValidElement"],"mappings":"oFAQA,MAAM,iBAAiB,GAAG,CAAmB,KAAgC,KAA+B;AACzG,IAAA,MAAM,MAAM,GAAG,aAAa,EAAE;AAC9B,IAAA,MAAM,kBAAkB,GAAG,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,CAAC,GAAG,EAAE,KAAK,KAAI;AAC7D,QAAA,IAAI,GAAG,KAAK,QAAQ,IAAI,GAAG,KAAK,QAAQ,EAAE;YACvC,OAAO,SAAS,CAAC;AACnB;AACD,QAAA,OAAO,KAAK;KACd,EAAE,CAAC,CAAC;AAEL,IAAA,IAAI,MAAM,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A,OAAO,MAAM;KACf,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;AAC7B"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import React__default,{isValidElement}from'react';import useBreakpoint from'./useBreakpoint.mjs';const useBreakpoinProps = (props) => {
|
|
2
|
+
const bpoint = useBreakpoint();
|
|
3
|
+
const stringifiedElement = JSON.stringify(props, (key, value) => {
|
|
4
|
+
if (key === '_owner' || key === '_store') {
|
|
5
|
+
return undefined; // Skip circular references
|
|
6
|
+
}
|
|
7
|
+
return value;
|
|
8
|
+
}, 2);
|
|
9
|
+
let format = React__default.useMemo(() => {
|
|
10
|
+
const _format = {
|
|
11
|
+
xs: {},
|
|
12
|
+
sm: {},
|
|
13
|
+
md: {},
|
|
14
|
+
lg: {},
|
|
15
|
+
xl: {}
|
|
16
|
+
};
|
|
17
|
+
for (let prop in props) {
|
|
18
|
+
let val = props[prop];
|
|
19
|
+
if (!isValidElement(val) && typeof val === 'object') {
|
|
20
|
+
for (let breakpoin in val) {
|
|
21
|
+
_format[breakpoin][prop] = props[prop][breakpoin];
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
else {
|
|
25
|
+
_format.xs[prop] = props[prop];
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return _format;
|
|
29
|
+
}, [stringifiedElement, bpoint.value]);
|
|
30
|
+
return React__default.useMemo(() => {
|
|
31
|
+
let _props = format.xs || {};
|
|
32
|
+
for (let key of ['sm', 'md', 'lg', 'xl']) {
|
|
33
|
+
if (bpoint.isOrDown(key)) {
|
|
34
|
+
_props = Object.assign(Object.assign({}, _props), format[key]);
|
|
35
|
+
}
|
|
36
|
+
if (bpoint.is(key)) {
|
|
37
|
+
break;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return _props;
|
|
41
|
+
}, [format, bpoint.value]);
|
|
42
|
+
};export{useBreakpoinProps as default};//# sourceMappingURL=useBreakpointProps.mjs.map
|