@zuzjs/ui 0.4.0 → 0.4.2
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/bin.js +34 -23
- package/dist/comps/base.d.ts +11 -1
- package/dist/comps/base.js +23 -3
- package/dist/comps/box.d.ts +2 -0
- package/dist/comps/box.js +0 -7
- package/dist/comps/button.d.ts +2 -0
- package/dist/comps/button.js +0 -11
- package/dist/comps/checkbox.d.ts +2 -0
- package/dist/comps/checkbox.js +0 -18
- package/dist/comps/contextmenu.d.ts +6 -1
- package/dist/comps/contextmenu.js +3 -2
- package/dist/comps/cover.d.ts +2 -0
- package/dist/comps/cover.js +1 -25
- package/dist/comps/dialog.d.ts +0 -0
- package/dist/comps/dialog.js +1 -0
- package/dist/comps/form.d.ts +6 -1
- package/dist/comps/form.js +10 -149
- package/dist/comps/heading.d.ts +2 -0
- package/dist/comps/heading.js +0 -13
- package/dist/comps/icon.d.ts +2 -0
- package/dist/comps/icon.js +0 -10
- package/dist/comps/image.d.ts +13 -0
- package/dist/comps/image.js +8 -0
- package/dist/comps/input.d.ts +2 -0
- package/dist/comps/input.js +0 -15
- package/dist/comps/select.d.ts +18 -0
- package/dist/comps/select.js +32 -0
- package/dist/comps/sheet.d.ts +4 -1
- package/dist/comps/sheet.js +39 -59
- package/dist/comps/spinner.d.ts +2 -0
- package/dist/comps/spinner.js +0 -1
- package/dist/funs/colors.d.ts +0 -6
- package/dist/funs/colors.js +0 -6
- package/dist/funs/css.d.ts +25 -251
- package/dist/funs/css.js +355 -325
- package/dist/funs/index.d.ts +10 -1
- package/dist/funs/index.js +35 -10
- package/dist/funs/stylesheet.d.ts +7 -242
- package/dist/funs/stylesheet.js +97 -7
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/styles.css +1 -1
- package/dist/types/enums.d.ts +1 -0
- package/dist/types/enums.js +1 -0
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
package/dist/funs/index.d.ts
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import CSS from './css.js';
|
|
2
2
|
import { dynamicObject } from "../types/index.js";
|
|
3
|
+
export declare const __SALT: string;
|
|
4
|
+
export declare const FIELNAME_KEY = "__FILENAME__";
|
|
5
|
+
export declare const LINE_KEY = "__LINE__";
|
|
6
|
+
export declare const toHash: (n: number, len?: number) => string;
|
|
7
|
+
export declare const fromHash: (n: string) => number;
|
|
3
8
|
export declare const css: () => CSS;
|
|
9
|
+
export declare const uuid: (len?: number) => string;
|
|
10
|
+
export declare const numberInRange: (min: number, max: number) => number;
|
|
4
11
|
export declare const hexColorRegex: RegExp;
|
|
5
12
|
export declare const rgbaColorRegex: RegExp;
|
|
6
13
|
export declare const hslColorRegex: RegExp;
|
|
@@ -15,6 +22,8 @@ export declare const isNumber: (v: any) => boolean;
|
|
|
15
22
|
export declare const hexToRgba: (hex: string, alpha?: number) => string;
|
|
16
23
|
export declare const ucfirst: (str: string) => string;
|
|
17
24
|
export declare const cleanProps: <T extends dynamicObject>(props: T, withProps?: string[]) => T;
|
|
18
|
-
export declare const withZuz: (cx: string) => string;
|
|
25
|
+
export declare const withZuz: (cx: string | string[]) => string;
|
|
26
|
+
export declare const setDeep: (object: dynamicObject, path: string, value: any, seperator?: string) => dynamicObject;
|
|
27
|
+
export declare const removeDuplicatesFromArray: <T>(array: T[]) => T[];
|
|
19
28
|
export declare const extendGlobals: () => void;
|
|
20
29
|
export declare const withPost: (uri: string, data: dynamicObject, timeout?: number, fd?: dynamicObject) => Promise<unknown>;
|
package/dist/funs/index.js
CHANGED
|
@@ -2,19 +2,25 @@ import { cssProps } from "./stylesheet.js";
|
|
|
2
2
|
import CSS from './css.js';
|
|
3
3
|
import axios from "axios";
|
|
4
4
|
import { colorNames } from "./colors.js";
|
|
5
|
+
import Hashids from "hashids";
|
|
6
|
+
import { nanoid } from "nanoid";
|
|
5
7
|
let __css;
|
|
8
|
+
export const __SALT = `zuzjs-ui`;
|
|
9
|
+
export const FIELNAME_KEY = `__FILENAME__`;
|
|
10
|
+
export const LINE_KEY = `__LINE__`;
|
|
11
|
+
export const toHash = (n, len = 6) => new Hashids(__SALT, len).encode(n);
|
|
12
|
+
export const fromHash = (n) => Number(new Hashids(__SALT).decode(n));
|
|
6
13
|
export const css = () => __css ? __css : __css = new CSS();
|
|
7
|
-
|
|
14
|
+
export const uuid = (len) => nanoid(len);
|
|
15
|
+
export const numberInRange = (min, max) => {
|
|
16
|
+
return Math.floor(Math.random() * (max - min + 1)) + min;
|
|
17
|
+
};
|
|
8
18
|
export const hexColorRegex = /^#([A-Fa-f0-9]{3}){1,2}$/;
|
|
9
|
-
// export const hexColorRegex3 = /^#([A-Fa-f0-9]{3}){1,2}$/;
|
|
10
|
-
// RGBA color regex (rgba(255, 255, 255, 1))
|
|
11
19
|
export const rgbaColorRegex = /^rgba?\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*(,\s*((0|1|0?\.\d+)\s*))?\)$/;
|
|
12
|
-
// HSL color regex (hsl(360, 100%, 100%))
|
|
13
20
|
export const hslColorRegex = /^hsl\(\s*(\d{1,3})\s*,\s*(\d{1,3})%\s*,\s*(\d{1,3})%\s*\)$/;
|
|
14
21
|
export const isHexColor = (color) => hexColorRegex.test(color);
|
|
15
22
|
export const isRgbaColor = (color) => rgbaColorRegex.test(color);
|
|
16
23
|
export const isHslColor = (color) => hslColorRegex.test(color);
|
|
17
|
-
// Function to validate a color string
|
|
18
24
|
export const isColor = (color) => colorNames.includes(color) || isHexColor(color) || isRgbaColor(color) || isHslColor(color);
|
|
19
25
|
export const isUrl = (u) => {
|
|
20
26
|
let url;
|
|
@@ -31,15 +37,11 @@ export const isIPv4 = (ipaddress) => {
|
|
|
31
37
|
return /^(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/.test(ipaddress);
|
|
32
38
|
};
|
|
33
39
|
export const isNumber = (v) => /\d+(\.\d+)?$/g.test(v);
|
|
34
|
-
// Convert hex to rgba
|
|
35
40
|
export const hexToRgba = (hex, alpha = 1) => {
|
|
36
|
-
// Remove the hash symbol if present
|
|
37
41
|
hex = hex.replace(/^#/, '');
|
|
38
|
-
// If shorthand hex (#RGB), expand it to full form (#RRGGBB)
|
|
39
42
|
if (hex.length === 3) {
|
|
40
43
|
hex = hex.split('').map(char => char + char).join('');
|
|
41
44
|
}
|
|
42
|
-
// Convert to integer values for RGB
|
|
43
45
|
const bigint = parseInt(hex, 16);
|
|
44
46
|
const r = (bigint >> 16) & 255;
|
|
45
47
|
const g = (bigint >> 8) & 255;
|
|
@@ -58,7 +60,30 @@ export const cleanProps = (props, withProps = []) => {
|
|
|
58
60
|
_extras.map(x => x in _props && delete _props[x]);
|
|
59
61
|
return _props;
|
|
60
62
|
};
|
|
61
|
-
export const withZuz = (cx) =>
|
|
63
|
+
export const withZuz = (cx) => css().Build([[`string` == typeof cx ? cx : cx.join(` `)]]).cx.join(` `);
|
|
64
|
+
export const setDeep = (object, path, value, seperator = `.`) => {
|
|
65
|
+
const _path = path.split(seperator);
|
|
66
|
+
const base = _path[0];
|
|
67
|
+
if (base === undefined) {
|
|
68
|
+
return object;
|
|
69
|
+
}
|
|
70
|
+
if (!object.hasOwnProperty(base)) {
|
|
71
|
+
object[base] = {};
|
|
72
|
+
}
|
|
73
|
+
value = _path.length <= 1 ? value : setDeep(object[base], _path.slice(1).join(seperator), value, seperator);
|
|
74
|
+
return {
|
|
75
|
+
...object,
|
|
76
|
+
[base]: value,
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
export const removeDuplicatesFromArray = (array) => {
|
|
80
|
+
return array.reduce((accumulator, currentValue) => {
|
|
81
|
+
if (!accumulator.includes(currentValue)) {
|
|
82
|
+
accumulator.push(currentValue);
|
|
83
|
+
}
|
|
84
|
+
return accumulator;
|
|
85
|
+
}, []);
|
|
86
|
+
};
|
|
62
87
|
export const extendGlobals = () => {
|
|
63
88
|
Object.prototype.is = function (v) { return typeof this === v; };
|
|
64
89
|
Object.prototype.typeof = function (v) { return typeof this === typeof v; };
|
|
@@ -1,242 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
animationDuration: string;
|
|
9
|
-
animationFillMode: string;
|
|
10
|
-
animationIterationCount: string;
|
|
11
|
-
animationName: string;
|
|
12
|
-
animationPlayState: string;
|
|
13
|
-
animationTimingFunction: string;
|
|
14
|
-
background: string;
|
|
15
|
-
bg: string;
|
|
16
|
-
backgroundColor: string;
|
|
17
|
-
backgroundImage: string;
|
|
18
|
-
backgroundOrigin: string;
|
|
19
|
-
backgroundPosition: string;
|
|
20
|
-
backgroundRepeat: string;
|
|
21
|
-
backgroundSize: string;
|
|
22
|
-
backfaceVisibility: string;
|
|
23
|
-
backgroundAttachment: string;
|
|
24
|
-
backgroundBlendMode: string;
|
|
25
|
-
backgroundClip: string;
|
|
26
|
-
border: string;
|
|
27
|
-
borderBottom: string;
|
|
28
|
-
borderBottomColor: string;
|
|
29
|
-
borderBottomStyle: string;
|
|
30
|
-
borderBottomWidth: string;
|
|
31
|
-
borderCollapse: string;
|
|
32
|
-
borderColor: string;
|
|
33
|
-
borderImage: string;
|
|
34
|
-
borderImageOutset: string;
|
|
35
|
-
borderImageRepeat: string;
|
|
36
|
-
borderImageSlice: string;
|
|
37
|
-
borderImageSource: string;
|
|
38
|
-
borderImageWidth: string;
|
|
39
|
-
borderLeft: string;
|
|
40
|
-
borderLeftColor: string;
|
|
41
|
-
borderLeftStyle: string;
|
|
42
|
-
borderLeftWidth: string;
|
|
43
|
-
borderRight: string;
|
|
44
|
-
borderRightColor: string;
|
|
45
|
-
borderRightStyle: string;
|
|
46
|
-
borderRightWidth: string;
|
|
47
|
-
borderSpacing: string;
|
|
48
|
-
borderStyle: string;
|
|
49
|
-
borderTop: string;
|
|
50
|
-
borderTopColor: string;
|
|
51
|
-
borderTopStyle: string;
|
|
52
|
-
borderTopWidth: string;
|
|
53
|
-
borderWidth: string;
|
|
54
|
-
borderRadius: string;
|
|
55
|
-
r: string;
|
|
56
|
-
borderTopLeftRadius: string;
|
|
57
|
-
rtl: string;
|
|
58
|
-
borderTopRightRadius: string;
|
|
59
|
-
rtr: string;
|
|
60
|
-
borderBottomLeftRadius: string;
|
|
61
|
-
rbl: string;
|
|
62
|
-
borderBottomRightRadius: string;
|
|
63
|
-
rbr: string;
|
|
64
|
-
bottom: string;
|
|
65
|
-
boxDecorationBreak: string;
|
|
66
|
-
boxShadow: string;
|
|
67
|
-
boxSizing: string;
|
|
68
|
-
captionSide: string;
|
|
69
|
-
caretColor: string;
|
|
70
|
-
"@charset": string;
|
|
71
|
-
clear: string;
|
|
72
|
-
clip: string;
|
|
73
|
-
clipPath: string;
|
|
74
|
-
color: string;
|
|
75
|
-
c: string;
|
|
76
|
-
columnCount: string;
|
|
77
|
-
columnFill: string;
|
|
78
|
-
columnGap: string;
|
|
79
|
-
colGap: string;
|
|
80
|
-
columnRule: string;
|
|
81
|
-
columnRuleColor: string;
|
|
82
|
-
columnRuleStyle: string;
|
|
83
|
-
columnRuleWidth: string;
|
|
84
|
-
columnSpan: string;
|
|
85
|
-
columnWidth: string;
|
|
86
|
-
columns: string;
|
|
87
|
-
content: string;
|
|
88
|
-
counterIncrement: string;
|
|
89
|
-
counterReset: string;
|
|
90
|
-
cursor: string;
|
|
91
|
-
pointer: string;
|
|
92
|
-
direction: string;
|
|
93
|
-
display: string;
|
|
94
|
-
emptyCells: string;
|
|
95
|
-
filter: string;
|
|
96
|
-
flex: string;
|
|
97
|
-
flexBasis: string;
|
|
98
|
-
flexDirection: string;
|
|
99
|
-
flexDir: string;
|
|
100
|
-
flexFlow: string;
|
|
101
|
-
flexGrow: string;
|
|
102
|
-
flexShrink: string;
|
|
103
|
-
flexWrap: string;
|
|
104
|
-
float: string;
|
|
105
|
-
font: string;
|
|
106
|
-
fontFamily: string;
|
|
107
|
-
fontKerning: string;
|
|
108
|
-
s: string;
|
|
109
|
-
fontSize: string;
|
|
110
|
-
fontSizeAdjust: string;
|
|
111
|
-
fontStretch: string;
|
|
112
|
-
fontStyle: string;
|
|
113
|
-
fontVariant: string;
|
|
114
|
-
bold: string;
|
|
115
|
-
fontWeight: string;
|
|
116
|
-
b: string;
|
|
117
|
-
gap: string;
|
|
118
|
-
grid: string;
|
|
119
|
-
gridArea: string;
|
|
120
|
-
gridAutoColumns: string;
|
|
121
|
-
gridAutoFlow: string;
|
|
122
|
-
gridAutoRows: string;
|
|
123
|
-
gridColumn: string;
|
|
124
|
-
gridColumnEnd: string;
|
|
125
|
-
gridColumnGap: string;
|
|
126
|
-
gridColumnStart: string;
|
|
127
|
-
gridGap: string;
|
|
128
|
-
gridRow: string;
|
|
129
|
-
gridRowEnd: string;
|
|
130
|
-
gridRowGap: string;
|
|
131
|
-
gridRowStart: string;
|
|
132
|
-
gridTemplate: string;
|
|
133
|
-
gridTemplateAreas: string;
|
|
134
|
-
gridTemplateColumns: string;
|
|
135
|
-
gridTemplateRows: string;
|
|
136
|
-
hangingPunctuation: string;
|
|
137
|
-
hyphens: string;
|
|
138
|
-
isolation: string;
|
|
139
|
-
justifyContent: string;
|
|
140
|
-
left: string;
|
|
141
|
-
letterSpacing: string;
|
|
142
|
-
lineHeight: string;
|
|
143
|
-
lh: string;
|
|
144
|
-
listStyle: string;
|
|
145
|
-
listStyleImage: string;
|
|
146
|
-
listStylePosition: string;
|
|
147
|
-
listStyleType: string;
|
|
148
|
-
aspectRatio: string;
|
|
149
|
-
margin: string;
|
|
150
|
-
m: string;
|
|
151
|
-
marginBottom: string;
|
|
152
|
-
mb: string;
|
|
153
|
-
marginLeft: string;
|
|
154
|
-
ml: string;
|
|
155
|
-
marginRight: string;
|
|
156
|
-
mr: string;
|
|
157
|
-
marginTop: string;
|
|
158
|
-
mt: string;
|
|
159
|
-
height: string;
|
|
160
|
-
h: string;
|
|
161
|
-
minHeight: string;
|
|
162
|
-
minH: string;
|
|
163
|
-
maxHeight: string;
|
|
164
|
-
maxH: string;
|
|
165
|
-
width: string;
|
|
166
|
-
w: string;
|
|
167
|
-
minWidth: string;
|
|
168
|
-
minW: string;
|
|
169
|
-
maxWidth: string;
|
|
170
|
-
maxW: string;
|
|
171
|
-
mixBlendMode: string;
|
|
172
|
-
objectFit: string;
|
|
173
|
-
objectPosition: string;
|
|
174
|
-
opacity: string;
|
|
175
|
-
order: string;
|
|
176
|
-
outline: string;
|
|
177
|
-
outlineColor: string;
|
|
178
|
-
outlineOffset: string;
|
|
179
|
-
outlineStyle: string;
|
|
180
|
-
outlineWidth: string;
|
|
181
|
-
overflow: string;
|
|
182
|
-
overflowX: string;
|
|
183
|
-
overflowY: string;
|
|
184
|
-
padding: string;
|
|
185
|
-
p: string;
|
|
186
|
-
paddingBottom: string;
|
|
187
|
-
pb: string;
|
|
188
|
-
paddingLeft: string;
|
|
189
|
-
pl: string;
|
|
190
|
-
paddingRight: string;
|
|
191
|
-
pr: string;
|
|
192
|
-
paddingTop: string;
|
|
193
|
-
pt: string;
|
|
194
|
-
pageBreakAfter: string;
|
|
195
|
-
pageBreakBefore: string;
|
|
196
|
-
pageBreakInside: string;
|
|
197
|
-
perspective: string;
|
|
198
|
-
perspectiveOrigin: string;
|
|
199
|
-
pointerEvents: string;
|
|
200
|
-
position: string;
|
|
201
|
-
quotes: string;
|
|
202
|
-
resize: string;
|
|
203
|
-
right: string;
|
|
204
|
-
scrollBehavior: string;
|
|
205
|
-
tabSize: string;
|
|
206
|
-
tableLayout: string;
|
|
207
|
-
align: string;
|
|
208
|
-
textAlign: string;
|
|
209
|
-
textAlignLast: string;
|
|
210
|
-
textDecoration: string;
|
|
211
|
-
td: string;
|
|
212
|
-
textDecorationColor: string;
|
|
213
|
-
textDecorationLine: string;
|
|
214
|
-
textDecorationStyle: string;
|
|
215
|
-
textIndent: string;
|
|
216
|
-
textJustify: string;
|
|
217
|
-
textOverflow: string;
|
|
218
|
-
textShadow: string;
|
|
219
|
-
textTransform: string;
|
|
220
|
-
top: string;
|
|
221
|
-
transform: string;
|
|
222
|
-
"transform(2D)": string;
|
|
223
|
-
"transformOrigin(twoValue syntax)": string;
|
|
224
|
-
transformStyle: string;
|
|
225
|
-
transition: string;
|
|
226
|
-
transitionDelay: string;
|
|
227
|
-
transitionDuration: string;
|
|
228
|
-
transitionProperty: string;
|
|
229
|
-
transitionTimingFunction: string;
|
|
230
|
-
unicodeBidi: string;
|
|
231
|
-
userSelect: string;
|
|
232
|
-
verticalAlign: string;
|
|
233
|
-
visibility: string;
|
|
234
|
-
whiteSpace: string;
|
|
235
|
-
wordBreak: string;
|
|
236
|
-
wordSpacing: string;
|
|
237
|
-
textWrap: string;
|
|
238
|
-
wordWrap: string;
|
|
239
|
-
writingMode: string;
|
|
240
|
-
zIndex: string;
|
|
241
|
-
backdropFilter: string;
|
|
242
|
-
};
|
|
1
|
+
import { dynamicObject } from "../types";
|
|
2
|
+
export declare const cssProps: dynamicObject;
|
|
3
|
+
export declare const cssDirect: dynamicObject;
|
|
4
|
+
export declare const cssAnimationCurves: dynamicObject;
|
|
5
|
+
export declare const cssAnimationFunctions: dynamicObject;
|
|
6
|
+
export declare const cssTransformKeys: string[];
|
|
7
|
+
export declare const cssWithKeys: dynamicObject;
|
package/dist/funs/stylesheet.js
CHANGED
|
@@ -2,7 +2,6 @@ export const cssProps = {
|
|
|
2
2
|
"alignContent": "align-content",
|
|
3
3
|
"alignItems": "align-items",
|
|
4
4
|
"alignSelf": "align-self",
|
|
5
|
-
//Animations
|
|
6
5
|
"animation": "animation",
|
|
7
6
|
"animationDelay": "animation-delay",
|
|
8
7
|
"animationDirection": "animation-direction",
|
|
@@ -12,7 +11,6 @@ export const cssProps = {
|
|
|
12
11
|
"animationName": "animation-name",
|
|
13
12
|
"animationPlayState": "animation-play-state",
|
|
14
13
|
"animationTimingFunction": "animation-timing-function",
|
|
15
|
-
//Backgrounds
|
|
16
14
|
"background": "background",
|
|
17
15
|
"bg": "background",
|
|
18
16
|
"backgroundColor": "background-color",
|
|
@@ -25,7 +23,6 @@ export const cssProps = {
|
|
|
25
23
|
"backgroundAttachment": "background-attachment",
|
|
26
24
|
"backgroundBlendMode": "background-blend-mode",
|
|
27
25
|
"backgroundClip": "background-clip",
|
|
28
|
-
//Borders
|
|
29
26
|
"border": "border",
|
|
30
27
|
"borderBottom": "border-bottom",
|
|
31
28
|
"borderBottomColor": "border-bottom-color",
|
|
@@ -54,7 +51,6 @@ export const cssProps = {
|
|
|
54
51
|
"borderTopStyle": "border-top-style",
|
|
55
52
|
"borderTopWidth": "border-top-width",
|
|
56
53
|
"borderWidth": "border-width",
|
|
57
|
-
//Radius
|
|
58
54
|
"borderRadius": "border-radius",
|
|
59
55
|
"r": "border-radius",
|
|
60
56
|
"borderTopLeftRadius": "border-top-left-radius",
|
|
@@ -68,6 +64,7 @@ export const cssProps = {
|
|
|
68
64
|
"bottom": "bottom",
|
|
69
65
|
"boxDecorationBreak": "box-decoration-break",
|
|
70
66
|
"boxShadow": "box-shadow",
|
|
67
|
+
"shadow": "box-shadow",
|
|
71
68
|
"boxSizing": "box-sizing",
|
|
72
69
|
"captionSide": "caption-side",
|
|
73
70
|
"caretColor": "caret-color",
|
|
@@ -150,7 +147,6 @@ export const cssProps = {
|
|
|
150
147
|
"listStylePosition": "list-style-position",
|
|
151
148
|
"listStyleType": "list-style-type",
|
|
152
149
|
"aspectRatio": "aspect-ratio",
|
|
153
|
-
//Margin
|
|
154
150
|
"margin": "margin",
|
|
155
151
|
"m": "margin",
|
|
156
152
|
"marginBottom": "margin-bottom",
|
|
@@ -161,14 +157,12 @@ export const cssProps = {
|
|
|
161
157
|
"mr": "margin-right",
|
|
162
158
|
"marginTop": "margin-top",
|
|
163
159
|
"mt": "margin-top",
|
|
164
|
-
//Height
|
|
165
160
|
"height": "height",
|
|
166
161
|
"h": "height",
|
|
167
162
|
"minHeight": "min-height",
|
|
168
163
|
"minH": "min-height",
|
|
169
164
|
"maxHeight": "max-height",
|
|
170
165
|
"maxH": "max-height",
|
|
171
|
-
//Width
|
|
172
166
|
"width": "width",
|
|
173
167
|
"w": "width",
|
|
174
168
|
"minWidth": "min-width",
|
|
@@ -247,3 +241,99 @@ export const cssProps = {
|
|
|
247
241
|
"zIndex": "z-index",
|
|
248
242
|
"backdropFilter": "backdrop-filter"
|
|
249
243
|
};
|
|
244
|
+
export const cssDirect = {
|
|
245
|
+
"extend": "@extend __VALUE__;",
|
|
246
|
+
"content": "content:'';",
|
|
247
|
+
"bold": "font-weight: bold;",
|
|
248
|
+
"grid": "display:grid;",
|
|
249
|
+
"flex": "display:flex;",
|
|
250
|
+
"wrap": "flex-wrap:wrap;",
|
|
251
|
+
"cols": "flex-direction:column;",
|
|
252
|
+
"ass": "align-self:flex-start;",
|
|
253
|
+
"ais": "align-items:flex-start;",
|
|
254
|
+
"aib": "align-items:baseline;",
|
|
255
|
+
"aic": "align-items:center;",
|
|
256
|
+
"aie": "align-items:flex-end;",
|
|
257
|
+
"jcs": "justify-content:flex-start;",
|
|
258
|
+
"jcc": "justify-content:center;",
|
|
259
|
+
"jce": "justify-content:flex-end;",
|
|
260
|
+
"jcb": "justify-content:space-between;",
|
|
261
|
+
"jca": "justify-content:space-around;",
|
|
262
|
+
"tal": "text-align: left;",
|
|
263
|
+
"tac": "text-align: center;",
|
|
264
|
+
"tar": "text-align: right;",
|
|
265
|
+
"tas": "text-align: justify;",
|
|
266
|
+
"fill": "top: 0px;left: 0px;right: 0px;bottom: 0px;",
|
|
267
|
+
"rel": "position:relative;",
|
|
268
|
+
"abs": "position:absolute;",
|
|
269
|
+
"fixed": "position:fixed;",
|
|
270
|
+
"sticky": "position:sticky;",
|
|
271
|
+
"abc": "top: 50%;left: 50%;transform: translate(-50%, -50%);",
|
|
272
|
+
"tdn": "text-decoration:none;",
|
|
273
|
+
"tdu": "text-decoration:underline;",
|
|
274
|
+
"nous": "user-select:none;",
|
|
275
|
+
"nope": "pointer-events:none;",
|
|
276
|
+
"ph": "padding-left:__VALUE__;padding-right:__VALUE__;",
|
|
277
|
+
"pv": "padding-top:__VALUE__;padding-bottom:__VALUE__;",
|
|
278
|
+
"mh": "margin-left:__VALUE__;margin-right:__VALUE__;",
|
|
279
|
+
"mv": "margin-top:__VALUE__;margin-bottom:__VALUE__;",
|
|
280
|
+
"translate": "transform:translate(__VALUE__);",
|
|
281
|
+
"translateX": "transform:translateX(__VALUE__);",
|
|
282
|
+
"translateY": "transform:translateY(__VALUE__);",
|
|
283
|
+
"rotate": "transform: rotate(__VALUE__);",
|
|
284
|
+
"scale": "transform: scale(__VALUE__);",
|
|
285
|
+
"anim": "transition: all __VALUE__ __CURVE__ __DELAY__;",
|
|
286
|
+
"hide": "display: none;",
|
|
287
|
+
};
|
|
288
|
+
export const cssAnimationCurves = {
|
|
289
|
+
ease: 'ease',
|
|
290
|
+
in: 'ease-in',
|
|
291
|
+
out: 'ease-out',
|
|
292
|
+
inout: 'ease-in-out',
|
|
293
|
+
linear: 'linear',
|
|
294
|
+
start: 'step-start',
|
|
295
|
+
end: 'step-end',
|
|
296
|
+
steps: 'steps',
|
|
297
|
+
cubic: 'cubic-bezier',
|
|
298
|
+
initial: 'initial',
|
|
299
|
+
inherit: 'inherit'
|
|
300
|
+
};
|
|
301
|
+
export const cssAnimationFunctions = {
|
|
302
|
+
animation: 'animation',
|
|
303
|
+
name: 'animation-name',
|
|
304
|
+
duration: 'animation-duration',
|
|
305
|
+
timing: 'animation-timing-function',
|
|
306
|
+
delay: 'animation-delay',
|
|
307
|
+
count: 'animation-iteration-count',
|
|
308
|
+
direction: 'animation-direction',
|
|
309
|
+
fill: 'animation-fill-mode',
|
|
310
|
+
state: 'animation-play-state',
|
|
311
|
+
frames: 'keyframes'
|
|
312
|
+
};
|
|
313
|
+
export const cssTransformKeys = [
|
|
314
|
+
'translate',
|
|
315
|
+
'translateX',
|
|
316
|
+
'translateY',
|
|
317
|
+
'translateZ',
|
|
318
|
+
'scale',
|
|
319
|
+
'scaleX',
|
|
320
|
+
'scaleY',
|
|
321
|
+
'scaleZ',
|
|
322
|
+
'rotate',
|
|
323
|
+
'rotateX',
|
|
324
|
+
'rotateY',
|
|
325
|
+
'rotateZ',
|
|
326
|
+
'skew',
|
|
327
|
+
'skewX',
|
|
328
|
+
'skewY',
|
|
329
|
+
'perspective',
|
|
330
|
+
'matrix',
|
|
331
|
+
'matrix3d'
|
|
332
|
+
];
|
|
333
|
+
export const cssWithKeys = {
|
|
334
|
+
w: `width`,
|
|
335
|
+
h: `height`,
|
|
336
|
+
x: `translateX`,
|
|
337
|
+
y: `translateY`,
|
|
338
|
+
z: `translateZ`,
|
|
339
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -7,6 +7,8 @@ export { default as Cover } from "./comps/cover";
|
|
|
7
7
|
export { default as Form } from "./comps/form";
|
|
8
8
|
export { default as Heading } from "./comps/heading";
|
|
9
9
|
export { default as Icon } from "./comps/icon";
|
|
10
|
+
export { default as Image } from "./comps/image";
|
|
10
11
|
export { default as Input } from "./comps/input";
|
|
12
|
+
export { default as Select } from "./comps/select";
|
|
11
13
|
export { default as Sheet } from "./comps/sheet";
|
|
12
14
|
export { default as Spinner } from "./comps/spinner";
|
package/dist/index.js
CHANGED
|
@@ -7,6 +7,8 @@ export { default as Cover } from "./comps/cover";
|
|
|
7
7
|
export { default as Form } from "./comps/form";
|
|
8
8
|
export { default as Heading } from "./comps/heading";
|
|
9
9
|
export { default as Icon } from "./comps/icon";
|
|
10
|
+
export { default as Image } from "./comps/image";
|
|
10
11
|
export { default as Input } from "./comps/input";
|
|
12
|
+
export { default as Select } from "./comps/select";
|
|
11
13
|
export { default as Sheet } from "./comps/sheet";
|
|
12
14
|
export { default as Spinner } from "./comps/spinner";
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
button{user-select:none;cursor:pointer}input{user-select:none}input:-webkit-autofill{background-color:rgba(0,0,0,0) !important;-webkit-box-shadow:0 0 0px 1000px rgba(0,0,0,0) inset;box-shadow:0 0 0px 1000px rgba(0,0,0,0) inset}:root{--checkbox-checked: rgb(46, 161, 42);--checkbox-unchecked: rgb(203, 203, 203);--checkbox-thumb: #fff;--checkbox-thumb-shadow: #000;--checkbox-thumb-shadow-size: 2px}.flex{display:flex}.flex.cols{flex-direction:column}.flex.aic{align-items:center}.flex.jcc{justify-content:center}.abs{position:absolute}.fixed{position:fixed}.fill{top:0px;left:0px;bottom:0px;right:0px}.rel{position:relative}.input-with-error{box-shadow:inset 0px 0px 0px 1px #ff8b8b}.zuz-checkbox{height:25px;width:45px;cursor:pointer}.zuz-checkbox input[type=checkbox]{z-index:0;left:10px;top:10px;opacity:0}.zuz-checkbox:before{content:"";position:absolute;width:45px;height:25px;background:var(--checkbox-unchecked);border-radius:50px;z-index:1;transition:all .3s linear 0s}.zuz-checkbox:after{content:"";position:absolute;width:21px;height:21px;background:var(--checkbox-thumb);border-radius:50px;z-index:2;top:2px;left:2px;box-shadow:0px 0px --checkbox-thumb-shadow-size --checkbox-thumb-shadow;transition:all .2s linear 0s}.zuz-checkbox.is-checked:before{box-shadow:inset 0px 0px 0px 15px var(--checkbox-checked)}.zuz-checkbox.is-checked:after{transform:translateX(20px)}.zuz-spinner{animation:spin infinite}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.zuz-cover{backdrop-filter:blur(4px);z-index:99999;gap:15px}.zuz-cover .label{font-size:14px;animation:breath 1s linear infinite}@keyframes breath{0%{opacity:.5}50%{opacity:1}100%{opacity:.5}}.zuz-sheet{top:
|
|
1
|
+
*,*::before,*::after{box-sizing:border-box}button{user-select:none;cursor:pointer}input{user-select:none}input:-webkit-autofill{background-color:rgba(0,0,0,0) !important;-webkit-box-shadow:0 0 0px 1000px rgba(0,0,0,0) inset;box-shadow:0 0 0px 1000px rgba(0,0,0,0) inset}[popover]{margin:0;padding:0;border:0}:root{--checkbox-checked: rgb(46, 161, 42);--checkbox-unchecked: rgb(203, 203, 203);--checkbox-thumb: #fff;--checkbox-thumb-shadow: #000;--checkbox-thumb-shadow-size: 2px;--select: #fff;--select-options: #fff;--select-option-font-size: 16px;--select-hover: #eee;--select-selected: #ddd;--select-padding: 6px 8px;--select-radius: 5px}.flex{display:flex}.flex.cols{flex-direction:column}.flex.aic{align-items:center}.flex.jcc{justify-content:center}.abs{position:absolute}.fixed{position:fixed}.fill{top:0px;left:0px;bottom:0px;right:0px}.rel{position:relative}.input-with-error{box-shadow:inset 0px 0px 0px 1px #ff8b8b}.zuz-checkbox{height:25px;width:45px;cursor:pointer}.zuz-checkbox input[type=checkbox]{z-index:0;left:10px;top:10px;opacity:0}.zuz-checkbox:before{content:"";position:absolute;width:45px;height:25px;background:var(--checkbox-unchecked);border-radius:50px;z-index:1;transition:all .3s linear 0s}.zuz-checkbox:after{content:"";position:absolute;width:21px;height:21px;background:var(--checkbox-thumb);border-radius:50px;z-index:2;top:2px;left:2px;box-shadow:0px 0px --checkbox-thumb-shadow-size --checkbox-thumb-shadow;transition:all .2s linear 0s}.zuz-checkbox.is-checked:before{box-shadow:inset 0px 0px 0px 15px var(--checkbox-checked)}.zuz-checkbox.is-checked:after{transform:translateX(20px)}.zuz-spinner{animation:spin infinite}@keyframes spin{from{transform:rotate(0deg)}to{transform:rotate(360deg)}}.zuz-cover{backdrop-filter:blur(4px);z-index:99999;gap:15px}.zuz-cover .label{font-size:14px;animation:breath 1s linear infinite}@keyframes breath{0%{opacity:.5}50%{opacity:1}100%{opacity:.5}}.zuz-toast,.zuz-sheet.toast-warn,.zuz-sheet.toast-success,.zuz-sheet.toast-error{border-radius:6px;padding:6px 12px;font-size:14px;white-space:pre}.zuz-sheet{top:50%;left:50%;transform:translate(-50%, -50%);z-index:214748364;transform-origin:top left;transition:all .5s cubic-bezier(0.2, -0.36, 0, 1.46) 0s}.zuz-sheet.toast-default{background:#333;color:#fff}.zuz-sheet.toast-error{background:#ff4747;color:#fff;top:-20px}.zuz-sheet.toast-success{background:#23ac28;color:#fff}.zuz-sheet.toast-warn{background:#ffba00}.zuz-sheet-overlay{background:rgba(0,0,0,.7);z-index:111;backdrop-filter:blur(10px)}.zuz-context-menu{z-index:99;background:var(--context-background);border-radius:var(--context-radius);padding:10px;box-shadow:var(--context-shadow)}.zuz-context-menu .context-line{height:1px;background:var(--context-seperator);margin:3px 6px}.zuz-context-menu .context-menu-item{width:220px;padding:6px 10px;gap:10px;cursor:pointer;font-size:var(--context-label-size);border-radius:var(--context-radius)}.zuz-context-menu .context-menu-item .ico{font-size:var(--context-icon-size)}.zuz-context-menu .context-menu-item:hover{background:var(--context-hover)}.zuz-select{gap:5px;background:var(--select);border-radius:var(--select-radius)}.zuz-select .zuz-selected{flex:1}.zuz-select-options{max-height:400px;overflow-x:hidden;gap:2px;background:var(--select-options);border-radius:var(--select-radius);padding:4px 0px}.zuz-select-options button{background:rgba(0,0,0,0);border:0px;text-align:left;padding:var(--select-padding);border-radius:var(--select-radius);font-size:var(--select-option-font-size)}.zuz-select-options button:hover{background:var(--select-hover)}.zuz-select-options button.selected{background:var(--select-selected)}
|
package/dist/types/enums.d.ts
CHANGED
package/dist/types/enums.js
CHANGED
package/dist/types/index.d.ts
CHANGED