anysystem-design 0.0.46 → 0.0.48
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/README.md +4 -1
- package/dist/{bugs-mljuODtW.js → bugs-CHTtT8VX.js} +56 -59
- package/dist/{bundle-mjs-D8_OHItV.js → bundle-mjs-SHnj3fHy.js} +393 -316
- package/dist/{calculate-active-index-BLZgzU1e.js → calculate-active-index-DbdO98Z_.js} +347 -349
- package/dist/{close-provider-CEutdhG8.js → close-provider-Cs3ZWgEC.js} +1 -1
- package/dist/combobox-BGEhR2HT.js +865 -0
- package/dist/components/AutoComplete/AutoComplete.d.ts +12 -0
- package/dist/components/AutoComplete/AutoComplete.js +24 -20
- package/dist/components/AutoComplete/AutoCompleteBase.js +11 -11
- package/dist/components/AutoComplete/AutoCompleteMultiple.js +11 -11
- package/dist/components/Button/Button.js +1 -1
- package/dist/components/Checkbox/Checkbox.d.ts +1 -1
- package/dist/components/Checkbox/Checkbox.js +1 -1
- package/dist/components/Checkbox/CheckboxBase.d.ts +1 -1
- package/dist/components/Checkbox/CheckboxBase.js +1 -1
- package/dist/components/Checkbox/FormCheckbox.d.ts +1 -2
- package/dist/components/Column/Column.d.ts +1 -1
- package/dist/components/Column/Column.js +1 -1
- package/dist/components/Component.d.ts +1 -3
- package/dist/components/Container/Container.d.ts +1 -1
- package/dist/components/Container/Container.js +1 -1
- package/dist/components/DataTable/components/DataTableBody.d.ts +1 -3
- package/dist/components/DataTable/components/DataTableHead.d.ts +1 -3
- package/dist/components/DataTable/components/FieldSelectbox.js +19 -19
- package/dist/components/DatePicker/DatePicker.d.ts +3 -2
- package/dist/components/DatePicker/DatePicker.js +185 -180
- package/dist/components/FormControl/FormComponent.js +1 -1
- package/dist/components/FormControl/FormContent.d.ts +1 -2
- package/dist/components/FormControl/FormContent.js +3 -3
- package/dist/components/FormControl/FormControl.d.ts +1 -1
- package/dist/components/FormControl/FormControl.js +79 -81
- package/dist/components/FormControl/type.d.ts +1 -1
- package/dist/components/Input/InputBase.d.ts +3 -0
- package/dist/components/Input/InputBase.js +26 -23
- package/dist/components/Input/InputTel.js +1 -1
- package/dist/components/Input/Textarea.js +1 -1
- package/dist/components/Label/FormLabel.d.ts +1 -1
- package/dist/components/Label/Label.d.ts +1 -1
- package/dist/components/Label/Label.js +1 -1
- package/dist/components/Modal/Modal.js +30 -30
- package/dist/components/NavList/NavList.d.ts +4 -2
- package/dist/components/NavList/NavList.js +100 -100
- package/dist/components/Navbar/Navbar.d.ts +1 -1
- package/dist/components/PasswordInput/PasswordInput.js +1 -1
- package/dist/components/RadioGroup/RadioGroup.js +3 -3
- package/dist/components/Row/Row.d.ts +1 -1
- package/dist/components/Row/Row.js +1 -1
- package/dist/components/Selectbox/SelectboxBase.js +21 -21
- package/dist/components/Selectbox/SelectboxMultiple.js +29 -29
- package/dist/components/Switch/Switch.d.ts +1 -3
- package/dist/components/Switch/Switch.js +31 -31
- package/dist/components/TelephoneInput/TelephoneInput.js +1 -1
- package/dist/components/Text/Text.d.ts +3 -1
- package/dist/components/Text/Text.js +1 -1
- package/dist/contexts/AppContext.d.ts +1 -1
- package/dist/{floating-ui.react-dom-D1BzEDF6.js → floating-ui.react-dom-BCi5XVbY.js} +179 -186
- package/dist/{headless-datepicker-CJgYtyPm.js → headless-datepicker-DRvAXFm1.js} +1 -1
- package/dist/index-CTu7UrOL.js +383 -0
- package/dist/index.css +1 -1
- package/dist/{label-9PX7EyLe.js → label-BU1UL9Xe.js} +1 -1
- package/dist/layouts/SideMenu/SideMenu.js +2 -2
- package/dist/listbox-BHRihzeO.js +317 -0
- package/dist/open-closed-CowzTowH.js +93 -0
- package/dist/portal-BgeE7-lt.js +326 -0
- package/dist/transition-6o20faRl.js +165 -0
- package/dist/use-resolve-button-type-DkEA2l9L.js +47 -0
- package/package.json +12 -12
- package/dist/combobox-n82D2K1B.js +0 -869
- package/dist/index-DsprzSCj.js +0 -19066
- package/dist/listbox-CEBFFwl1.js +0 -312
- package/dist/open-closed-Btlb-eA5.js +0 -96
- package/dist/portal-VJzbRmUd.js +0 -344
- package/dist/transition-BWQrWLaC.js +0 -143
- package/dist/use-resolve-button-type-DbQUT_r1.js +0 -41
package/README.md
CHANGED
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
# Anysystem Design
|
|
2
|
-
Powerful open source libraries for React.
|
|
2
|
+
Powerful open source libraries for React and Tailwind CSS.
|
|
3
|
+
|
|
4
|
+
## Usage Guide
|
|
5
|
+
Please visit [https://david-marstree.github.io/anysystem](https://david-marstree.github.io/anysystem)
|
|
3
6
|
|
|
4
7
|
## Getting started
|
|
5
8
|
```bash
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
const I = typeof document < "u" ?
|
|
1
|
+
import j, { useRef as h, useCallback as v, useEffect as P, useState as M, useMemo as G } from "react";
|
|
2
|
+
const I = typeof document < "u" ? j.useLayoutEffect : () => {
|
|
3
3
|
};
|
|
4
|
-
function
|
|
4
|
+
function U(t) {
|
|
5
5
|
const n = h(null);
|
|
6
6
|
return I(() => {
|
|
7
7
|
n.current = t;
|
|
@@ -16,27 +16,24 @@ const w = (t) => {
|
|
|
16
16
|
var n;
|
|
17
17
|
return (n = t == null ? void 0 : t.ownerDocument) !== null && n !== void 0 ? n : document;
|
|
18
18
|
}, b = (t) => t && "window" in t && t.window === t ? t : w(t).defaultView || window;
|
|
19
|
-
function
|
|
19
|
+
function R(t) {
|
|
20
20
|
var n;
|
|
21
21
|
return typeof window > "u" || window.navigator == null ? !1 : ((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.brands.some((e) => t.test(e.brand))) || t.test(window.navigator.userAgent);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function z(t) {
|
|
24
24
|
var n;
|
|
25
25
|
return typeof window < "u" && window.navigator != null ? t.test(((n = window.navigator.userAgentData) === null || n === void 0 ? void 0 : n.platform) || window.navigator.platform) : !1;
|
|
26
26
|
}
|
|
27
|
-
function
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
function N() {
|
|
28
|
+
return z(/^Mac/i);
|
|
29
|
+
}
|
|
30
|
+
function Y() {
|
|
31
|
+
return R(/Android/i);
|
|
30
32
|
}
|
|
31
|
-
|
|
32
|
-
return
|
|
33
|
-
}), q = B(function() {
|
|
34
|
-
return z(/Android/i);
|
|
35
|
-
});
|
|
36
|
-
function J(t) {
|
|
37
|
-
return t.mozInputSource === 0 && t.isTrusted ? !0 : q() && t.pointerType ? t.type === "click" && t.buttons === 1 : t.detail === 0 && !t.pointerType;
|
|
33
|
+
function q(t) {
|
|
34
|
+
return t.mozInputSource === 0 && t.isTrusted ? !0 : Y() && t.pointerType ? t.type === "click" && t.buttons === 1 : t.detail === 0 && !t.pointerType;
|
|
38
35
|
}
|
|
39
|
-
class
|
|
36
|
+
class J {
|
|
40
37
|
isDefaultPrevented() {
|
|
41
38
|
return this.nativeEvent.defaultPrevented;
|
|
42
39
|
}
|
|
@@ -55,7 +52,7 @@ class Q {
|
|
|
55
52
|
this.nativeEvent = e, this.target = e.target, this.currentTarget = e.currentTarget, this.relatedTarget = e.relatedTarget, this.bubbles = e.bubbles, this.cancelable = e.cancelable, this.defaultPrevented = e.defaultPrevented, this.eventPhase = e.eventPhase, this.isTrusted = e.isTrusted, this.timeStamp = e.timeStamp, this.type = n;
|
|
56
53
|
}
|
|
57
54
|
}
|
|
58
|
-
function
|
|
55
|
+
function B(t) {
|
|
59
56
|
let n = h({
|
|
60
57
|
isFocused: !1,
|
|
61
58
|
observer: null
|
|
@@ -66,14 +63,14 @@ function A(t) {
|
|
|
66
63
|
r.observer && (r.observer.disconnect(), r.observer = null);
|
|
67
64
|
};
|
|
68
65
|
}, []);
|
|
69
|
-
let e =
|
|
66
|
+
let e = U((r) => {
|
|
70
67
|
t == null || t(r);
|
|
71
68
|
});
|
|
72
69
|
return v((r) => {
|
|
73
70
|
if (r.target instanceof HTMLButtonElement || r.target instanceof HTMLInputElement || r.target instanceof HTMLTextAreaElement || r.target instanceof HTMLSelectElement) {
|
|
74
71
|
n.current.isFocused = !0;
|
|
75
72
|
let o = r.target, a = (s) => {
|
|
76
|
-
n.current.isFocused = !1, o.disabled && e(new
|
|
73
|
+
n.current.isFocused = !1, o.disabled && e(new J("blur", s)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
|
|
77
74
|
};
|
|
78
75
|
o.addEventListener("focusout", a, {
|
|
79
76
|
once: !0
|
|
@@ -100,7 +97,7 @@ function A(t) {
|
|
|
100
97
|
e
|
|
101
98
|
]);
|
|
102
99
|
}
|
|
103
|
-
function
|
|
100
|
+
function Q(t) {
|
|
104
101
|
let { isDisabled: n, onFocus: e, onBlur: r, onFocusChange: o } = t;
|
|
105
102
|
const a = v((d) => {
|
|
106
103
|
if (d.target === d.currentTarget)
|
|
@@ -108,7 +105,7 @@ function X(t) {
|
|
|
108
105
|
}, [
|
|
109
106
|
r,
|
|
110
107
|
o
|
|
111
|
-
]), s =
|
|
108
|
+
]), s = B(a), i = v((d) => {
|
|
112
109
|
const c = w(d.target);
|
|
113
110
|
d.target === d.currentTarget && c.activeElement === d.target && (e && e(d), o && o(!0), s(d));
|
|
114
111
|
}, [
|
|
@@ -124,29 +121,29 @@ function X(t) {
|
|
|
124
121
|
};
|
|
125
122
|
}
|
|
126
123
|
let y = null, x = /* @__PURE__ */ new Set(), m = /* @__PURE__ */ new Map(), p = !1, S = !1;
|
|
127
|
-
const
|
|
124
|
+
const X = {
|
|
128
125
|
Tab: !0,
|
|
129
126
|
Escape: !0
|
|
130
127
|
};
|
|
131
128
|
function k(t, n) {
|
|
132
129
|
for (let e of x) e(t, n);
|
|
133
130
|
}
|
|
134
|
-
function
|
|
135
|
-
return !(t.metaKey || !
|
|
131
|
+
function Z(t) {
|
|
132
|
+
return !(t.metaKey || !N() && t.altKey || t.ctrlKey || t.key === "Control" || t.key === "Shift" || t.key === "Meta");
|
|
136
133
|
}
|
|
137
134
|
function L(t) {
|
|
138
|
-
p = !0,
|
|
135
|
+
p = !0, Z(t) && (y = "keyboard", k("keyboard", t));
|
|
139
136
|
}
|
|
140
137
|
function l(t) {
|
|
141
138
|
y = "pointer", (t.type === "mousedown" || t.type === "pointerdown") && (p = !0, k("pointer", t));
|
|
142
139
|
}
|
|
143
|
-
function
|
|
144
|
-
|
|
140
|
+
function A(t) {
|
|
141
|
+
q(t) && (p = !0, y = "virtual");
|
|
145
142
|
}
|
|
146
|
-
function
|
|
143
|
+
function K(t) {
|
|
147
144
|
t.target === window || t.target === document || (!p && !S && (y = "virtual", k("virtual", t)), p = !1, S = !1);
|
|
148
145
|
}
|
|
149
|
-
function
|
|
146
|
+
function V() {
|
|
150
147
|
p = !1, S = !0;
|
|
151
148
|
}
|
|
152
149
|
function D(t) {
|
|
@@ -155,30 +152,30 @@ function D(t) {
|
|
|
155
152
|
let r = n.HTMLElement.prototype.focus;
|
|
156
153
|
n.HTMLElement.prototype.focus = function() {
|
|
157
154
|
p = !0, r.apply(this, arguments);
|
|
158
|
-
}, e.addEventListener("keydown", L, !0), e.addEventListener("keyup", L, !0), e.addEventListener("click",
|
|
159
|
-
|
|
155
|
+
}, e.addEventListener("keydown", L, !0), e.addEventListener("keyup", L, !0), e.addEventListener("click", A, !0), n.addEventListener("focus", K, !0), n.addEventListener("blur", V, !1), typeof PointerEvent < "u" ? (e.addEventListener("pointerdown", l, !0), e.addEventListener("pointermove", l, !0), e.addEventListener("pointerup", l, !0)) : (e.addEventListener("mousedown", l, !0), e.addEventListener("mousemove", l, !0), e.addEventListener("mouseup", l, !0)), n.addEventListener("beforeunload", () => {
|
|
156
|
+
O(t);
|
|
160
157
|
}, {
|
|
161
158
|
once: !0
|
|
162
159
|
}), m.set(n, {
|
|
163
160
|
focus: r
|
|
164
161
|
});
|
|
165
162
|
}
|
|
166
|
-
const
|
|
163
|
+
const O = (t, n) => {
|
|
167
164
|
const e = b(t), r = w(t);
|
|
168
|
-
n && r.removeEventListener("DOMContentLoaded", n), m.has(e) && (e.HTMLElement.prototype.focus = m.get(e).focus, r.removeEventListener("keydown", L, !0), r.removeEventListener("keyup", L, !0), r.removeEventListener("click",
|
|
165
|
+
n && r.removeEventListener("DOMContentLoaded", n), m.has(e) && (e.HTMLElement.prototype.focus = m.get(e).focus, r.removeEventListener("keydown", L, !0), r.removeEventListener("keyup", L, !0), r.removeEventListener("click", A, !0), e.removeEventListener("focus", K, !0), e.removeEventListener("blur", V, !1), typeof PointerEvent < "u" ? (r.removeEventListener("pointerdown", l, !0), r.removeEventListener("pointermove", l, !0), r.removeEventListener("pointerup", l, !0)) : (r.removeEventListener("mousedown", l, !0), r.removeEventListener("mousemove", l, !0), r.removeEventListener("mouseup", l, !0)), m.delete(e));
|
|
169
166
|
};
|
|
170
|
-
function
|
|
167
|
+
function ee(t) {
|
|
171
168
|
const n = w(t);
|
|
172
169
|
let e;
|
|
173
170
|
return n.readyState !== "loading" ? D(t) : (e = () => {
|
|
174
171
|
D(t);
|
|
175
|
-
}, n.addEventListener("DOMContentLoaded", e)), () =>
|
|
172
|
+
}, n.addEventListener("DOMContentLoaded", e)), () => O(t, e);
|
|
176
173
|
}
|
|
177
|
-
typeof document < "u" &&
|
|
178
|
-
function
|
|
174
|
+
typeof document < "u" && ee();
|
|
175
|
+
function _() {
|
|
179
176
|
return y !== "pointer";
|
|
180
177
|
}
|
|
181
|
-
const
|
|
178
|
+
const te = /* @__PURE__ */ new Set([
|
|
182
179
|
"checkbox",
|
|
183
180
|
"radio",
|
|
184
181
|
"range",
|
|
@@ -189,22 +186,22 @@ const ne = /* @__PURE__ */ new Set([
|
|
|
189
186
|
"submit",
|
|
190
187
|
"reset"
|
|
191
188
|
]);
|
|
192
|
-
function
|
|
189
|
+
function ne(t, n, e) {
|
|
193
190
|
var r;
|
|
194
191
|
const o = typeof window < "u" ? b(e == null ? void 0 : e.target).HTMLInputElement : HTMLInputElement, a = typeof window < "u" ? b(e == null ? void 0 : e.target).HTMLTextAreaElement : HTMLTextAreaElement, s = typeof window < "u" ? b(e == null ? void 0 : e.target).HTMLElement : HTMLElement, i = typeof window < "u" ? b(e == null ? void 0 : e.target).KeyboardEvent : KeyboardEvent;
|
|
195
|
-
return t = t || (e == null ? void 0 : e.target) instanceof o && !
|
|
192
|
+
return t = t || (e == null ? void 0 : e.target) instanceof o && !te.has(e == null || (r = e.target) === null || r === void 0 ? void 0 : r.type) || (e == null ? void 0 : e.target) instanceof a || (e == null ? void 0 : e.target) instanceof s && (e == null ? void 0 : e.target.isContentEditable), !(t && n === "keyboard" && e instanceof i && !X[e.key]);
|
|
196
193
|
}
|
|
197
|
-
function
|
|
194
|
+
function re(t, n, e) {
|
|
198
195
|
D(), P(() => {
|
|
199
196
|
let r = (o, a) => {
|
|
200
|
-
|
|
197
|
+
ne(!!(e != null && e.isTextInput), o, a) && t(_());
|
|
201
198
|
};
|
|
202
199
|
return x.add(r), () => {
|
|
203
200
|
x.delete(r);
|
|
204
201
|
};
|
|
205
202
|
}, n);
|
|
206
203
|
}
|
|
207
|
-
function
|
|
204
|
+
function oe(t) {
|
|
208
205
|
let { isDisabled: n, onBlurWithin: e, onFocusWithin: r, onFocusWithinChange: o } = t, a = h({
|
|
209
206
|
isFocusWithin: !1
|
|
210
207
|
}), s = v((c) => {
|
|
@@ -213,7 +210,7 @@ function ie(t) {
|
|
|
213
210
|
e,
|
|
214
211
|
o,
|
|
215
212
|
a
|
|
216
|
-
]), i =
|
|
213
|
+
]), i = B(s), d = v((c) => {
|
|
217
214
|
!a.current.isFocusWithin && document.activeElement === c.target && (r && r(c), o && o(!0), a.current.isFocusWithin = !0, i(c));
|
|
218
215
|
}, [
|
|
219
216
|
r,
|
|
@@ -242,21 +239,21 @@ function W() {
|
|
|
242
239
|
function C(t) {
|
|
243
240
|
t.pointerType === "touch" && W();
|
|
244
241
|
}
|
|
245
|
-
function
|
|
242
|
+
function ie() {
|
|
246
243
|
if (!(typeof document > "u"))
|
|
247
244
|
return typeof PointerEvent < "u" ? document.addEventListener("pointerup", C) : document.addEventListener("touchend", W), H++, () => {
|
|
248
245
|
H--, !(H > 0) && (typeof PointerEvent < "u" ? document.removeEventListener("pointerup", C) : document.removeEventListener("touchend", W));
|
|
249
246
|
};
|
|
250
247
|
}
|
|
251
|
-
function
|
|
248
|
+
function se(t) {
|
|
252
249
|
let { onHoverStart: n, onHoverChange: e, onHoverEnd: r, isDisabled: o } = t, [a, s] = M(!1), i = h({
|
|
253
250
|
isHovered: !1,
|
|
254
251
|
ignoreEmulatedMouseEvents: !1,
|
|
255
252
|
pointerType: "",
|
|
256
253
|
target: null
|
|
257
254
|
}).current;
|
|
258
|
-
P(
|
|
259
|
-
let { hoverProps: d, triggerHoverEnd: c } =
|
|
255
|
+
P(ie, []);
|
|
256
|
+
let { hoverProps: d, triggerHoverEnd: c } = G(() => {
|
|
260
257
|
let g = (u, $) => {
|
|
261
258
|
if (i.pointerType = $, o || $ === "touch" || i.isHovered || !u.currentTarget.contains(u.target)) return;
|
|
262
259
|
i.isHovered = !0;
|
|
@@ -308,24 +305,24 @@ function de(t) {
|
|
|
308
305
|
isHovered: a
|
|
309
306
|
};
|
|
310
307
|
}
|
|
311
|
-
function
|
|
308
|
+
function de(t = {}) {
|
|
312
309
|
let { autoFocus: n = !1, isTextInput: e, within: r } = t, o = h({
|
|
313
310
|
isFocused: !1,
|
|
314
|
-
isFocusVisible: n ||
|
|
311
|
+
isFocusVisible: n || _()
|
|
315
312
|
}), [a, s] = M(!1), [i, d] = M(() => o.current.isFocused && o.current.isFocusVisible), c = v(() => d(o.current.isFocused && o.current.isFocusVisible), []), g = v((u) => {
|
|
316
313
|
o.current.isFocused = u, s(u), c();
|
|
317
314
|
}, [
|
|
318
315
|
c
|
|
319
316
|
]);
|
|
320
|
-
|
|
317
|
+
re((u) => {
|
|
321
318
|
o.current.isFocusVisible = u, c();
|
|
322
319
|
}, [], {
|
|
323
320
|
isTextInput: e
|
|
324
321
|
});
|
|
325
|
-
let { focusProps: E } =
|
|
322
|
+
let { focusProps: E } = Q({
|
|
326
323
|
isDisabled: r,
|
|
327
324
|
onFocusChange: g
|
|
328
|
-
}), { focusWithinProps: f } =
|
|
325
|
+
}), { focusWithinProps: f } = oe({
|
|
329
326
|
isDisabled: !r,
|
|
330
327
|
onFocusWithinChange: g
|
|
331
328
|
});
|
|
@@ -335,13 +332,13 @@ function ce(t = {}) {
|
|
|
335
332
|
focusProps: r ? f : E
|
|
336
333
|
};
|
|
337
334
|
}
|
|
338
|
-
function
|
|
335
|
+
function ce(t) {
|
|
339
336
|
let n = t.parentElement, e = null;
|
|
340
337
|
for (; n && !(n instanceof HTMLFieldSetElement); ) n instanceof HTMLLegendElement && (e = n), n = n.parentElement;
|
|
341
338
|
let r = (n == null ? void 0 : n.getAttribute("disabled")) === "";
|
|
342
|
-
return r &&
|
|
339
|
+
return r && ue(e) ? !1 : r;
|
|
343
340
|
}
|
|
344
|
-
function
|
|
341
|
+
function ue(t) {
|
|
345
342
|
if (!t) return !1;
|
|
346
343
|
let n = t.previousElementSibling;
|
|
347
344
|
for (; n !== null; ) {
|
|
@@ -351,7 +348,7 @@ function ae(t) {
|
|
|
351
348
|
return !0;
|
|
352
349
|
}
|
|
353
350
|
export {
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
351
|
+
de as $,
|
|
352
|
+
se as a,
|
|
353
|
+
ce as r
|
|
357
354
|
};
|