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.
Files changed (74) hide show
  1. package/README.md +4 -1
  2. package/dist/{bugs-mljuODtW.js → bugs-CHTtT8VX.js} +56 -59
  3. package/dist/{bundle-mjs-D8_OHItV.js → bundle-mjs-SHnj3fHy.js} +393 -316
  4. package/dist/{calculate-active-index-BLZgzU1e.js → calculate-active-index-DbdO98Z_.js} +347 -349
  5. package/dist/{close-provider-CEutdhG8.js → close-provider-Cs3ZWgEC.js} +1 -1
  6. package/dist/combobox-BGEhR2HT.js +865 -0
  7. package/dist/components/AutoComplete/AutoComplete.d.ts +12 -0
  8. package/dist/components/AutoComplete/AutoComplete.js +24 -20
  9. package/dist/components/AutoComplete/AutoCompleteBase.js +11 -11
  10. package/dist/components/AutoComplete/AutoCompleteMultiple.js +11 -11
  11. package/dist/components/Button/Button.js +1 -1
  12. package/dist/components/Checkbox/Checkbox.d.ts +1 -1
  13. package/dist/components/Checkbox/Checkbox.js +1 -1
  14. package/dist/components/Checkbox/CheckboxBase.d.ts +1 -1
  15. package/dist/components/Checkbox/CheckboxBase.js +1 -1
  16. package/dist/components/Checkbox/FormCheckbox.d.ts +1 -2
  17. package/dist/components/Column/Column.d.ts +1 -1
  18. package/dist/components/Column/Column.js +1 -1
  19. package/dist/components/Component.d.ts +1 -3
  20. package/dist/components/Container/Container.d.ts +1 -1
  21. package/dist/components/Container/Container.js +1 -1
  22. package/dist/components/DataTable/components/DataTableBody.d.ts +1 -3
  23. package/dist/components/DataTable/components/DataTableHead.d.ts +1 -3
  24. package/dist/components/DataTable/components/FieldSelectbox.js +19 -19
  25. package/dist/components/DatePicker/DatePicker.d.ts +3 -2
  26. package/dist/components/DatePicker/DatePicker.js +185 -180
  27. package/dist/components/FormControl/FormComponent.js +1 -1
  28. package/dist/components/FormControl/FormContent.d.ts +1 -2
  29. package/dist/components/FormControl/FormContent.js +3 -3
  30. package/dist/components/FormControl/FormControl.d.ts +1 -1
  31. package/dist/components/FormControl/FormControl.js +79 -81
  32. package/dist/components/FormControl/type.d.ts +1 -1
  33. package/dist/components/Input/InputBase.d.ts +3 -0
  34. package/dist/components/Input/InputBase.js +26 -23
  35. package/dist/components/Input/InputTel.js +1 -1
  36. package/dist/components/Input/Textarea.js +1 -1
  37. package/dist/components/Label/FormLabel.d.ts +1 -1
  38. package/dist/components/Label/Label.d.ts +1 -1
  39. package/dist/components/Label/Label.js +1 -1
  40. package/dist/components/Modal/Modal.js +30 -30
  41. package/dist/components/NavList/NavList.d.ts +4 -2
  42. package/dist/components/NavList/NavList.js +100 -100
  43. package/dist/components/Navbar/Navbar.d.ts +1 -1
  44. package/dist/components/PasswordInput/PasswordInput.js +1 -1
  45. package/dist/components/RadioGroup/RadioGroup.js +3 -3
  46. package/dist/components/Row/Row.d.ts +1 -1
  47. package/dist/components/Row/Row.js +1 -1
  48. package/dist/components/Selectbox/SelectboxBase.js +21 -21
  49. package/dist/components/Selectbox/SelectboxMultiple.js +29 -29
  50. package/dist/components/Switch/Switch.d.ts +1 -3
  51. package/dist/components/Switch/Switch.js +31 -31
  52. package/dist/components/TelephoneInput/TelephoneInput.js +1 -1
  53. package/dist/components/Text/Text.d.ts +3 -1
  54. package/dist/components/Text/Text.js +1 -1
  55. package/dist/contexts/AppContext.d.ts +1 -1
  56. package/dist/{floating-ui.react-dom-D1BzEDF6.js → floating-ui.react-dom-BCi5XVbY.js} +179 -186
  57. package/dist/{headless-datepicker-CJgYtyPm.js → headless-datepicker-DRvAXFm1.js} +1 -1
  58. package/dist/index-CTu7UrOL.js +383 -0
  59. package/dist/index.css +1 -1
  60. package/dist/{label-9PX7EyLe.js → label-BU1UL9Xe.js} +1 -1
  61. package/dist/layouts/SideMenu/SideMenu.js +2 -2
  62. package/dist/listbox-BHRihzeO.js +317 -0
  63. package/dist/open-closed-CowzTowH.js +93 -0
  64. package/dist/portal-BgeE7-lt.js +326 -0
  65. package/dist/transition-6o20faRl.js +165 -0
  66. package/dist/use-resolve-button-type-DkEA2l9L.js +47 -0
  67. package/package.json +12 -12
  68. package/dist/combobox-n82D2K1B.js +0 -869
  69. package/dist/index-DsprzSCj.js +0 -19066
  70. package/dist/listbox-CEBFFwl1.js +0 -312
  71. package/dist/open-closed-Btlb-eA5.js +0 -96
  72. package/dist/portal-VJzbRmUd.js +0 -344
  73. package/dist/transition-BWQrWLaC.js +0 -143
  74. 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 G, { useRef as h, useCallback as v, useEffect as P, useState as M, useMemo as U } from "react";
2
- const I = typeof document < "u" ? G.useLayoutEffect : () => {
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 R(t) {
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 z(t) {
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 N(t) {
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 B(t) {
28
- let n = null;
29
- return () => (n == null && (n = t()), n);
27
+ function N() {
28
+ return z(/^Mac/i);
29
+ }
30
+ function Y() {
31
+ return R(/Android/i);
30
32
  }
31
- const Y = B(function() {
32
- return N(/^Mac/i);
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 Q {
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 A(t) {
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 = R((r) => {
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 Q("blur", s)), n.current.observer && (n.current.observer.disconnect(), n.current.observer = null);
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 X(t) {
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 = A(a), i = v((d) => {
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 Z = {
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 ee(t) {
135
- return !(t.metaKey || !Y() && t.altKey || t.ctrlKey || t.key === "Control" || t.key === "Shift" || t.key === "Meta");
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, ee(t) && (y = "keyboard", k("keyboard", t));
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 K(t) {
144
- J(t) && (p = !0, y = "virtual");
140
+ function A(t) {
141
+ q(t) && (p = !0, y = "virtual");
145
142
  }
146
- function V(t) {
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 O() {
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", K, !0), n.addEventListener("focus", V, !0), n.addEventListener("blur", O, !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", () => {
159
- _(t);
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 _ = (t, n) => {
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", K, !0), e.removeEventListener("focus", V, !0), e.removeEventListener("blur", O, !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));
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 te(t) {
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)), () => _(t, e);
172
+ }, n.addEventListener("DOMContentLoaded", e)), () => O(t, e);
176
173
  }
177
- typeof document < "u" && te();
178
- function j() {
174
+ typeof document < "u" && ee();
175
+ function _() {
179
176
  return y !== "pointer";
180
177
  }
181
- const ne = /* @__PURE__ */ new Set([
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 re(t, n, e) {
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 && !ne.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 && !Z[e.key]);
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 oe(t, n, e) {
194
+ function re(t, n, e) {
198
195
  D(), P(() => {
199
196
  let r = (o, a) => {
200
- re(!!(e != null && e.isTextInput), o, a) && t(j());
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 ie(t) {
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 = A(s), d = v((c) => {
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 ue() {
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 de(t) {
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(ue, []);
259
- let { hoverProps: d, triggerHoverEnd: c } = U(() => {
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 ce(t = {}) {
308
+ function de(t = {}) {
312
309
  let { autoFocus: n = !1, isTextInput: e, within: r } = t, o = h({
313
310
  isFocused: !1,
314
- isFocusVisible: n || j()
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
- oe((u) => {
317
+ re((u) => {
321
318
  o.current.isFocusVisible = u, c();
322
319
  }, [], {
323
320
  isTextInput: e
324
321
  });
325
- let { focusProps: E } = X({
322
+ let { focusProps: E } = Q({
326
323
  isDisabled: r,
327
324
  onFocusChange: g
328
- }), { focusWithinProps: f } = ie({
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 le(t) {
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 && ae(e) ? !1 : r;
339
+ return r && ue(e) ? !1 : r;
343
340
  }
344
- function ae(t) {
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
- ce as $,
355
- de as a,
356
- le as r
351
+ de as $,
352
+ se as a,
353
+ ce as r
357
354
  };