@zuzjs/ui 0.4.3 → 0.4.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/dist/comps/animate.d.ts +6 -0
- package/dist/comps/animate.js +8 -0
- package/dist/comps/cover.js +1 -1
- package/dist/comps/select.js +2 -2
- package/dist/comps/sheet.js +9 -0
- package/dist/funs/css.d.ts +7 -1
- package/dist/funs/css.js +89 -7
- package/dist/funs/index.d.ts +5 -0
- package/dist/funs/index.js +15 -0
- package/dist/funs/stylesheet.js +3 -3
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useMounted.d.ts +2 -0
- package/dist/hooks/useMounted.js +10 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/styles.css +1 -1
- package/package.json +4 -3
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { animationProps } from "./base";
|
|
2
|
+
declare const Animate: import("react").ForwardRefExoticComponent<{
|
|
3
|
+
as?: string;
|
|
4
|
+
animate?: animationProps;
|
|
5
|
+
} & Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & import("react").RefAttributes<HTMLDivElement>>;
|
|
6
|
+
export default Animate;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef } from "react";
|
|
3
|
+
import With from "./base";
|
|
4
|
+
const Animate = forwardRef((props, ref) => {
|
|
5
|
+
const { as, ...rest } = props;
|
|
6
|
+
return _jsx(With, { as: as, ...rest, ref: ref });
|
|
7
|
+
});
|
|
8
|
+
export default Animate;
|
package/dist/comps/cover.js
CHANGED
|
@@ -3,7 +3,7 @@ import { forwardRef } from "react";
|
|
|
3
3
|
import With from "./base";
|
|
4
4
|
import Spinner from "./spinner";
|
|
5
5
|
const Cover = forwardRef((props, ref) => {
|
|
6
|
-
const { spinner, message, color, as, ...rest } = props;
|
|
6
|
+
const { spinner, message, color, as, when, ...rest } = props;
|
|
7
7
|
if (`when` in props && props.when == false) {
|
|
8
8
|
return null;
|
|
9
9
|
}
|
package/dist/comps/select.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { forwardRef, useEffect, useMemo, useRef, useState } from "react";
|
|
4
4
|
import With from "./base";
|
|
5
5
|
import { uuid } from "../funs";
|
|
@@ -19,7 +19,7 @@ const Select = forwardRef((props, ref) => {
|
|
|
19
19
|
setChoosing(false);
|
|
20
20
|
});
|
|
21
21
|
}, []);
|
|
22
|
-
return _jsxs(
|
|
22
|
+
return _jsxs(With, { className: `zuz-select-wrap rel`, children: [_jsxs(With, { popovertarget: _id, tag: `button`, as: as, className: `zuz-select rel flex aic`, ref: _ref, onClick: (e) => setChoosing(true), ...rest, children: [_jsx(With, { tag: `h2`, className: `zuz-selected`, children: value ? `string` == typeof value ? value : value.label : label || `Choose` }), chevronExpand()] }), _jsx(With, { popover: true, id: _id, className: `zuz-select-options abs flex cols`, style: {
|
|
23
23
|
pointerEvents: choosing ? `auto` : `none`,
|
|
24
24
|
}, animate: {
|
|
25
25
|
from: { height: 0, opacity: 0 },
|
package/dist/comps/sheet.js
CHANGED
|
@@ -41,6 +41,15 @@ const Sheet = forwardRef((props, ref) => {
|
|
|
41
41
|
setVisible(true);
|
|
42
42
|
setTimeout(() => onShow ? onShow() : () => { }, 1000);
|
|
43
43
|
},
|
|
44
|
+
error(message, duration) {
|
|
45
|
+
this.show(message, duration, SHEET.Error);
|
|
46
|
+
},
|
|
47
|
+
warn(message, duration) {
|
|
48
|
+
this.show(message, duration, SHEET.Warn);
|
|
49
|
+
},
|
|
50
|
+
success(message, duration) {
|
|
51
|
+
this.show(message, duration, SHEET.Success);
|
|
52
|
+
},
|
|
44
53
|
show(message, duration, type) {
|
|
45
54
|
if (_sheetTimeout) {
|
|
46
55
|
clearTimeout(_sheetTimeout);
|
package/dist/funs/css.d.ts
CHANGED
|
@@ -19,6 +19,11 @@ declare class CSS {
|
|
|
19
19
|
mediaQueries: dynamicObject;
|
|
20
20
|
_mediaQueries: dynamicObject;
|
|
21
21
|
_mediaQueriesLabels: dynamicObject;
|
|
22
|
+
PROPS_KEYS: string[];
|
|
23
|
+
DIRECT_KEYS: string[];
|
|
24
|
+
_cli: boolean;
|
|
25
|
+
DIRECT_VALUES: string[];
|
|
26
|
+
PROPS_VALUES: string[];
|
|
22
27
|
constructor(options?: dynamicObject | undefined);
|
|
23
28
|
buildMediaQueries(queries: dynamicObject): string;
|
|
24
29
|
styleSheet(cache: dynamicObject, pseudo?: string): string;
|
|
@@ -28,7 +33,8 @@ declare class CSS {
|
|
|
28
33
|
makeUnit(k: string, v: any): any;
|
|
29
34
|
makeValue(k: string, v: any): string;
|
|
30
35
|
calcIndexes(str: string): string;
|
|
31
|
-
|
|
36
|
+
makeID2(k: string, v: string, _out: string): string;
|
|
37
|
+
makeID3(k: string, v: string, _out: string): string;
|
|
32
38
|
makeID(k: string, v: string, _out: string): string;
|
|
33
39
|
lexer(line: string): dynamicObject;
|
|
34
40
|
processLine(line: string): void;
|
package/dist/funs/css.js
CHANGED
|
@@ -2,6 +2,7 @@ import { __SALT, FIELNAME_KEY, isColor, isHexColor, isNumber, LINE_KEY, setDeep
|
|
|
2
2
|
import { cssAnimationCurves, cssDirect, cssProps, cssTransformKeys, cssWithKeys } from "./stylesheet.js";
|
|
3
3
|
import Hashids from "hashids";
|
|
4
4
|
import { TRANSITION_CURVES, TRANSITIONS } from "../types/enums.js";
|
|
5
|
+
import md5 from "md5";
|
|
5
6
|
class CSS {
|
|
6
7
|
cx;
|
|
7
8
|
cache;
|
|
@@ -20,8 +21,14 @@ class CSS {
|
|
|
20
21
|
mediaQueries;
|
|
21
22
|
_mediaQueries;
|
|
22
23
|
_mediaQueriesLabels;
|
|
24
|
+
PROPS_KEYS;
|
|
25
|
+
DIRECT_KEYS;
|
|
26
|
+
_cli;
|
|
27
|
+
DIRECT_VALUES;
|
|
28
|
+
PROPS_VALUES;
|
|
23
29
|
constructor(options) {
|
|
24
30
|
const opts = options || {};
|
|
31
|
+
this._cli = false;
|
|
25
32
|
this._mediaQueries = {};
|
|
26
33
|
this._mediaQueriesLabels = {
|
|
27
34
|
ph: `Extra Small Devices (Phones)`,
|
|
@@ -42,7 +49,7 @@ class CSS {
|
|
|
42
49
|
this.unit = opts.unit || `px`;
|
|
43
50
|
this.seperator = `__@@__`;
|
|
44
51
|
this.hashids = new Hashids(__SALT, 5);
|
|
45
|
-
this.chars = "#@_-[]{}();:^/!^&*+='\"
|
|
52
|
+
this.chars = "#@_-[]{}();:^/!^&*+='\"`,.~%abcdefghijklmnopqrstuvwxyz0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
46
53
|
this.rgbaRegex = /\b\w+\[\d+,\d+,\d+(?:,\d+)?\]/g;
|
|
47
54
|
this.pseudoList = [
|
|
48
55
|
"@before", "@after", "@active", "@checked", "@default", "@disabled", "@empty", "@enabled", "@first", "@firstChild", "@firstOfType", "@focus", "@hover", "@indeterminate", "@inRange", "@invalid", "@lastChild", "@lastOfType", "@link", "@not", "@nthChild", "@nthLastChild", "@nthLastOfType", "@nthOfType", "@onlyChild", "@onlyOfType", "@optional", "@outOfRange", "@readOnly", "@readWrite", "@required", "@root", "@scope", "@target", "@valid", "@visited"
|
|
@@ -58,7 +65,18 @@ class CSS {
|
|
|
58
65
|
this.propCounter = {};
|
|
59
66
|
this.ids = [];
|
|
60
67
|
this.PROPS = cssProps;
|
|
68
|
+
this.PROPS_KEYS = Object.keys(cssProps);
|
|
69
|
+
this.PROPS_VALUES = this.PROPS_KEYS.reduce((arr, k) => {
|
|
70
|
+
arr.push(cssProps[k]);
|
|
71
|
+
return arr;
|
|
72
|
+
}, []);
|
|
61
73
|
this.DIRECT = cssDirect;
|
|
74
|
+
this.DIRECT_KEYS = Object.keys(cssDirect);
|
|
75
|
+
this.DIRECT_VALUES = this.DIRECT_KEYS.reduce((arr, k) => {
|
|
76
|
+
if (!cssDirect[k].includes(`__VALUE__`))
|
|
77
|
+
arr.push(cssDirect[k].replace(/\s+/g, ``));
|
|
78
|
+
return arr;
|
|
79
|
+
}, []);
|
|
62
80
|
}
|
|
63
81
|
buildMediaQueries(queries) {
|
|
64
82
|
const self = this;
|
|
@@ -345,15 +363,76 @@ class CSS {
|
|
|
345
363
|
}
|
|
346
364
|
return _indices.join(``);
|
|
347
365
|
}
|
|
348
|
-
|
|
349
|
-
const
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
366
|
+
makeID2(k, v, _out) {
|
|
367
|
+
const self = this;
|
|
368
|
+
let _ = [];
|
|
369
|
+
const out = _out.replace(/\s+/g, ``).trim();
|
|
370
|
+
const _mi = (_k, _v) => {
|
|
371
|
+
let i = Math.abs(self.DIRECT_KEYS.indexOf(_k)) + Math.abs(self.PROPS_VALUES.indexOf(_k));
|
|
372
|
+
_.push(i);
|
|
373
|
+
const nums = _v.match(/[0-9]/g);
|
|
374
|
+
if (nums) {
|
|
375
|
+
let ii = Math.abs(+nums.join(``));
|
|
376
|
+
_.push(ii);
|
|
377
|
+
i += ii;
|
|
378
|
+
}
|
|
379
|
+
const abc = _v.match(/[a-zA-Z,/-\[\]]/g);
|
|
380
|
+
if (abc) {
|
|
381
|
+
const ai = abc.reduce((acc, char) => acc + self.chars.indexOf(char), 0);
|
|
382
|
+
_.push(ai);
|
|
383
|
+
i += ai;
|
|
384
|
+
}
|
|
385
|
+
return i;
|
|
386
|
+
};
|
|
387
|
+
const [_ok, _ov] = out.split(`:`);
|
|
388
|
+
const ok = _ok.trim();
|
|
389
|
+
const ov = _ov.trim();
|
|
390
|
+
let _cp = ok.charAt(0);
|
|
391
|
+
if (self.PROPS[ok]?.indexOf("-") > -1) {
|
|
392
|
+
_cp = "";
|
|
393
|
+
self.PROPS[ok].split("-").map((c) => _cp += c.charAt(0));
|
|
394
|
+
}
|
|
395
|
+
const io = self.DIRECT_VALUES.includes(out) ? self.DIRECT_VALUES.indexOf(out) : _mi(ok, ov);
|
|
396
|
+
const id = `${_cp}${self.hashids.encode(io, _mi(k, v))}`;
|
|
397
|
+
return id;
|
|
398
|
+
}
|
|
399
|
+
makeID3(k, v, _out) {
|
|
400
|
+
const self = this;
|
|
401
|
+
const md = md5(_out);
|
|
402
|
+
let _ = [];
|
|
403
|
+
const _mi = (_k, _v) => {
|
|
404
|
+
let i = Math.abs(self.DIRECT_KEYS.indexOf(_k)) + Math.abs(self.PROPS_VALUES.indexOf(_k));
|
|
405
|
+
_.push(i);
|
|
406
|
+
const nums = _v.match(/[0-9]/g);
|
|
407
|
+
if (nums) {
|
|
408
|
+
let ii = Math.abs(+nums.join(``));
|
|
409
|
+
_.push(ii);
|
|
410
|
+
i += ii;
|
|
411
|
+
}
|
|
412
|
+
const abc = _v.match(/[a-zA-Z,/-\[\]]/g);
|
|
413
|
+
if (abc) {
|
|
414
|
+
const ai = abc.reduce((acc, char) => acc + self.chars.indexOf(char), 0);
|
|
415
|
+
_.push(ai);
|
|
416
|
+
i += ai;
|
|
417
|
+
}
|
|
418
|
+
return i;
|
|
419
|
+
};
|
|
420
|
+
const out = _out.replace(/\s+/g, ``).trim();
|
|
421
|
+
const [_ok, _ov] = out.split(`:`);
|
|
422
|
+
const ok = _ok.trim();
|
|
423
|
+
const ov = _ov.trim();
|
|
424
|
+
let _cp = ok.charAt(0);
|
|
425
|
+
if (self.PROPS[ok]?.indexOf("-") > -1) {
|
|
426
|
+
_cp = "";
|
|
427
|
+
self.PROPS[ok].split("-").map((c) => _cp += c.charAt(0));
|
|
428
|
+
}
|
|
429
|
+
const io = self.DIRECT_VALUES.includes(out) ? self.DIRECT_VALUES.indexOf(out) : _mi(ok, ov);
|
|
430
|
+
const ai = md.split(``).reduce((acc, char) => acc + self.chars.indexOf(char), 0);
|
|
431
|
+
return `${_cp}${self.hashids.encode(io, ai)}`;
|
|
354
432
|
}
|
|
355
433
|
makeID(k, v, _out) {
|
|
356
434
|
const self = this;
|
|
435
|
+
return self.makeID3(k, v, _out);
|
|
357
436
|
const _css = _out.toString().replace(/;|:|\s/g, "");
|
|
358
437
|
let _indices = 0;
|
|
359
438
|
for (let i = 0; i < _css.length; i++) {
|
|
@@ -479,6 +558,7 @@ class CSS {
|
|
|
479
558
|
}
|
|
480
559
|
else if (key == `ratio`) {
|
|
481
560
|
_out = self.DIRECT[key].replace(`__VALUE__`, val.replace(`,`, `/`));
|
|
561
|
+
_out = _out.replace(`;`, `${important};`);
|
|
482
562
|
}
|
|
483
563
|
else if (key == `anim`) {
|
|
484
564
|
let delay = `0s`;
|
|
@@ -502,6 +582,7 @@ class CSS {
|
|
|
502
582
|
.replace(`__VALUE__`, duration)
|
|
503
583
|
.replace(`__CURVE__`, curve)
|
|
504
584
|
.replace(`__DELAY__`, delay);
|
|
585
|
+
_out = _out.replace(`;`, `${important};`);
|
|
505
586
|
}
|
|
506
587
|
else {
|
|
507
588
|
const __value = `${val}${key == `extend` ? `` : self.makeUnit(key, val)}`;
|
|
@@ -552,6 +633,7 @@ class CSS {
|
|
|
552
633
|
}
|
|
553
634
|
Build(css, cli = false) {
|
|
554
635
|
let self = this;
|
|
636
|
+
self._cli = cli;
|
|
555
637
|
self.cx = [];
|
|
556
638
|
self.cache = {};
|
|
557
639
|
self._mediaQueries = {};
|
package/dist/funs/index.d.ts
CHANGED
|
@@ -32,3 +32,8 @@ export declare const useDevice: () => {
|
|
|
32
32
|
isTablet: boolean;
|
|
33
33
|
isDesktop: boolean;
|
|
34
34
|
};
|
|
35
|
+
export declare const withTime: (fun: (...args: any[]) => any) => {
|
|
36
|
+
result: any;
|
|
37
|
+
executionTime: number;
|
|
38
|
+
};
|
|
39
|
+
export declare const time: (stamp?: number, format?: string) => string;
|
package/dist/funs/index.js
CHANGED
|
@@ -5,6 +5,7 @@ import { colorNames } from "./colors.js";
|
|
|
5
5
|
import Hashids from "hashids";
|
|
6
6
|
import { nanoid } from "nanoid";
|
|
7
7
|
import Cookies from "js-cookie";
|
|
8
|
+
import moment from "moment";
|
|
8
9
|
let __css;
|
|
9
10
|
export const __SALT = `zuzjs-ui`;
|
|
10
11
|
export const FIELNAME_KEY = `__FILENAME__`;
|
|
@@ -163,3 +164,17 @@ export const useDevice = () => {
|
|
|
163
164
|
isDesktop: !mobile && !tablet
|
|
164
165
|
};
|
|
165
166
|
};
|
|
167
|
+
export const withTime = (fun) => {
|
|
168
|
+
const start = new Date().getTime();
|
|
169
|
+
const result = fun();
|
|
170
|
+
const end = new Date().getTime();
|
|
171
|
+
return {
|
|
172
|
+
result,
|
|
173
|
+
executionTime: end - start
|
|
174
|
+
};
|
|
175
|
+
};
|
|
176
|
+
export const time = (stamp, format) => {
|
|
177
|
+
return stamp ?
|
|
178
|
+
moment.unix(+stamp / 1000).format(format || `YYYY-MM-DD HH:mm:ss`)
|
|
179
|
+
: moment().format(format || `YYYY-MM-DD HH:mm:ss`);
|
|
180
|
+
};
|
package/dist/funs/stylesheet.js
CHANGED
|
@@ -277,9 +277,9 @@ export const cssDirect = {
|
|
|
277
277
|
"pv": "padding-top:__VALUE__;padding-bottom:__VALUE__;",
|
|
278
278
|
"mh": "margin-left:__VALUE__;margin-right:__VALUE__;",
|
|
279
279
|
"mv": "margin-top:__VALUE__;margin-bottom:__VALUE__;",
|
|
280
|
-
"translate": "transform:translate(__VALUE__);",
|
|
281
|
-
"translateX": "transform:translateX(__VALUE__);",
|
|
282
|
-
"translateY": "transform:translateY(__VALUE__);",
|
|
280
|
+
"translate": "transform: translate(__VALUE__);",
|
|
281
|
+
"translateX": "transform: translateX(__VALUE__);",
|
|
282
|
+
"translateY": "transform: translateY(__VALUE__);",
|
|
283
283
|
"rotate": "transform: rotate(__VALUE__);",
|
|
284
284
|
"scale": "transform: scale(__VALUE__);",
|
|
285
285
|
"anim": "transition: all __VALUE__ __CURVE__ __DELAY__;",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useMounted } from './useMounted';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as useMounted } from './useMounted';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
const useMounted = (delay = 100) => {
|
|
3
|
+
const [mounted, setMounted] = useState(false);
|
|
4
|
+
useEffect(() => {
|
|
5
|
+
const timer = setTimeout(() => setMounted(true), delay);
|
|
6
|
+
return () => clearTimeout(timer);
|
|
7
|
+
}, [delay]);
|
|
8
|
+
return mounted;
|
|
9
|
+
};
|
|
10
|
+
export default useMounted;
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
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;--cover-bg: rgba(255,255,255,0.8);--cover-label: #111;--dialog-bg: #fff;--dialog-radius: 10px;--dialog-padding: 10px;--dialog-title-font-size: 16px;--dialog-closer-font-size: 36px;--dialog-closer-hover: rgba(255,255,255,0.2)}.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}.fillx{top:-10px;left:-10px;bottom:-10px;right:-10px}.nope{pointer-events:none}.nous{user-select:none}.rel{position:relative}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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,.zuz-sheet.toast-default{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.wobble{transform-origin:inherit !important}.zuz-sheet.toast-default{background:#333;color:#fff;top:10px !important}.zuz-sheet.toast-error{background
|
|
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;--cover-bg: rgba(255,255,255,0.8);--cover-label: #111;--dialog-bg: #fff;--dialog-radius: 10px;--dialog-padding: 10px;--dialog-title-font-size: 16px;--dialog-closer-font-size: 36px;--dialog-closer-hover: rgba(255,255,255,0.2);--sheet-error: #ff4747;--sheet-warn: #ffba00;--sheet-success: #23ac28}.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}.fillx{top:-10px;left:-10px;bottom:-10px;right:-10px}.nope{pointer-events:none}.nous{user-select:none}.rel{position:relative}.ellipsis{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.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,.zuz-sheet.toast-default{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.wobble{transform-origin:inherit !important}.zuz-sheet.toast-default{background:#333;color:#fff;top:10px !important}.zuz-sheet.toast-error{background:var(--sheet-error);color:#fff;top:10px}.zuz-sheet.toast-success{background:var(--sheet-success);color:#fff;top:10px}.zuz-sheet.toast-warn{background:var(--sheet-warn);color:#111;top:10px}.zuz-sheet.toast-dialog{background:var(--dialog-bg);border-radius:var(--dialog-radius);padding:var(--dialog-padding);overflow:hidden}.zuz-sheet .zuz-sheet-head{margin-bottom:20px}.zuz-sheet .zuz-sheet-head .zuz-sheet-title{flex:1;font-size:var(--dialog-title-font-size);opacity:.5;text-align:center;padding:0px 45px}.zuz-sheet .zuz-sheet-head .zuz-sheet-dot{flex:1}.zuz-sheet .zuz-sheet-head .zuz-sheet-closer{width:32px;height:32px;cursor:pointer;font-size:var(--dialog-closer-font-size);background:rgba(0,0,0,0);border:0px;line-height:0;padding:0px;font-weight:normal;border-radius:20px;opacity:.35;top:50%;right:0px;transform:translateY(-50%)}.zuz-sheet .zuz-sheet-head .zuz-sheet-closer:hover{background:var(--dialog-closer-hover);opacity:1}.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)}@position-try --zuz-select-bottom{top:anchor(bottom);bottom:unset;margin-block:calc(var(--zuz-select-height) + var(--zuz-select-gap)) 0}.zuz-selectk-wrap{width:100%}.zuz-select{width:100%;gap:5px;background:var(--select);border-radius:var(--select-radius);border:0px;padding:12px 15px;anchor-name:--zuz-select-anchor}.zuz-select:hover{background:var(--select-hover)}.zuz-select .zuz-selected{flex:1;text-align:left}.zuz-select-options{--zuz-select-height: 30px;--zuz-select-gap: 0px;position-anchor:--zuz-select-anchor;position-try:most-height --zuz-select-bottom;width:100%;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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zuzjs/ui",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.5",
|
|
4
4
|
"keywords": [
|
|
5
5
|
"react",
|
|
6
6
|
"zuz",
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
},
|
|
19
19
|
"exports": {
|
|
20
20
|
".": "./dist/index.js",
|
|
21
|
-
"./styles": "./dist/styles.css"
|
|
22
|
-
"./funs": "./dist/funs/index.js"
|
|
21
|
+
"./styles": "./dist/styles.css"
|
|
23
22
|
},
|
|
24
23
|
"files": [
|
|
25
24
|
"dist"
|
|
@@ -33,12 +32,14 @@
|
|
|
33
32
|
"node": ">=18.17.0"
|
|
34
33
|
},
|
|
35
34
|
"dependencies": {
|
|
35
|
+
"@types/md5": "^2.3.5",
|
|
36
36
|
"axios": "^1.7.6",
|
|
37
37
|
"chokidar": "^3.6.0",
|
|
38
38
|
"commander": "^12.1.0",
|
|
39
39
|
"hashids": "^2.3.0",
|
|
40
40
|
"js-cookie": "^3.0.5",
|
|
41
41
|
"md5": "^2.3.0",
|
|
42
|
+
"moment": "^2.30.1",
|
|
42
43
|
"nanoid": "^5.0.7",
|
|
43
44
|
"picocolors": "^1.0.1",
|
|
44
45
|
"react": "19.0.0-beta-26f2496093-20240514",
|