ono-react-element 0.0.7 → 0.0.8

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 (80) hide show
  1. package/dist/es/AutoSliderList-Dy-otnYu.js +30 -0
  2. package/dist/es/AvatarCrop-DrA-SARP.js +65 -0
  3. package/dist/es/Button-C89izu2m.js +26 -0
  4. package/dist/es/Card3D-DMvCSUhe.js +18 -0
  5. package/dist/es/Checkbox-daBabj14.js +19 -0
  6. package/dist/es/InjunctiveBox-D0V-K9Pn.js +11 -0
  7. package/dist/es/Input-Z3uL5-nj.js +80 -0
  8. package/dist/es/List-UAKCMuGC.js +19 -0
  9. package/dist/es/MenuButton-DHkU5Bq7.js +17 -0
  10. package/dist/es/Message-GvTC61N0.js +68 -0
  11. package/dist/es/Modal-C-c_S_VM.js +32 -0
  12. package/dist/es/Pagination-m71H2tfS.js +17 -0
  13. package/dist/es/PortalRenderer-CDAzQJgm.js +19 -0
  14. package/dist/es/Radio-D_GKVoOC.js +25 -0
  15. package/dist/es/Select-y-aAIqxg.js +23 -0
  16. package/dist/es/SvgImg-CZwq2D7J.js +14 -0
  17. package/dist/es/Switch-CN3M5pXb.js +34 -0
  18. package/dist/es/TemplateDialog-fX7Ie-xU.js +45 -0
  19. package/dist/es/Toast-BadlA1yD.js +42 -0
  20. package/dist/es/Tooltip-C5OFmxWo.js +29 -0
  21. package/dist/es/VirtualList-BeDq637Z.js +65 -0
  22. package/dist/es/Waterfall-a_c3urjB.js +55 -0
  23. package/dist/es/dependencies-CbQbPZZ-.js +15524 -0
  24. package/dist/es/hooks-Dew3_cmY.js +103 -0
  25. package/dist/es/index.js +106 -231
  26. package/dist/es/utils-BxXROOPY.js +394 -0
  27. package/dist/index.css +1 -1
  28. package/dist/style/AutoSliderList.css +1 -0
  29. package/dist/style/AvatarCrop.css +1 -0
  30. package/dist/style/Button.css +1 -0
  31. package/dist/style/Card3D.css +1 -0
  32. package/dist/style/Checkbox.css +1 -0
  33. package/dist/style/Input.css +1 -0
  34. package/dist/style/MenuButton.css +1 -0
  35. package/dist/style/Message.css +1 -0
  36. package/dist/style/Modal.css +1 -0
  37. package/dist/style/Pagination.css +1 -0
  38. package/dist/style/Radio.css +1 -0
  39. package/dist/style/Select.css +1 -0
  40. package/dist/style/SvgImg.css +1 -0
  41. package/dist/style/Switch.css +1 -0
  42. package/dist/style/TemplateDialog.css +1 -0
  43. package/dist/style/Toast.css +1 -0
  44. package/dist/style/Tooltip.css +1 -0
  45. package/dist/style/Waterfall.css +1 -0
  46. package/dist/style/index.css +1 -0
  47. package/dist/types/index.d.ts +2 -2
  48. package/dist/types/printLogo.d.ts +1 -0
  49. package/dist/types/utils/common.d.ts +36 -20
  50. package/dist/umd/index.css +1 -1
  51. package/dist/umd/index.css.br +0 -0
  52. package/dist/umd/index.css.gz +0 -0
  53. package/dist/umd/index.umd.cjs +16583 -295
  54. package/dist/umd/index.umd.cjs.br +0 -0
  55. package/dist/umd/index.umd.cjs.gz +0 -0
  56. package/package.json +56 -49
  57. package/dist/es/AutoSliderList-DN4Sec6L.js +0 -106
  58. package/dist/es/AvatarCrop-DzGw2FVQ.js +0 -225
  59. package/dist/es/Button-CdxyXFF4.js +0 -72
  60. package/dist/es/Card3D-sf3zmiHk.js +0 -41
  61. package/dist/es/Checkbox-BN7rT73n.js +0 -62
  62. package/dist/es/InjunctiveBox-CGpy0PxH.js +0 -39
  63. package/dist/es/Input-DoY3kR7J.js +0 -301
  64. package/dist/es/List-B9mP7VjN.js +0 -35
  65. package/dist/es/MenuButton-CuOdVlg0.js +0 -62
  66. package/dist/es/Message-TfweOOpK.js +0 -219
  67. package/dist/es/Modal-CHgTYu-I.js +0 -154
  68. package/dist/es/Pagination-BtmtUkVw.js +0 -110
  69. package/dist/es/PortalRenderer-8Iur-eZp.js +0 -38
  70. package/dist/es/Radio-BmSpqdK8.js +0 -113
  71. package/dist/es/SvgImg-Bcmzdjzl.js +0 -38
  72. package/dist/es/Switch-DwDBR0sG.js +0 -110
  73. package/dist/es/TemplateDialog-SXrElzoR.js +0 -75
  74. package/dist/es/Toast-C7ybVNyd.js +0 -174
  75. package/dist/es/Tooltip-BtzG0TSW.js +0 -94
  76. package/dist/es/VirtualList-OG7kqLe0.js +0 -160
  77. package/dist/es/Waterfall-GHdJxww4.js +0 -131
  78. package/dist/es/dependencies-DWmdjl5u.js +0 -25491
  79. package/dist/es/hooks-CQN6qu4t.js +0 -159
  80. package/dist/es/utils-BLV_TQU3.js +0 -585
@@ -1,159 +0,0 @@
1
- import { useEffect as E, useState as L, useRef as b, useCallback as T } from "react";
2
- import { X as v } from "./utils-BLV_TQU3.js";
3
- const C = (e, c, t) => {
4
- const { target: s, deps: i, isDeferred: r } = t || {}, n = (l) => c(l);
5
- return E(() => (typeof e == "string" ? !r && (s || window).addEventListener(e, n) : e.forEach(
6
- (l) => !r && (s || window).addEventListener(l, n)
7
- ), () => {
8
- typeof e == "string" ? (s || window).removeEventListener(e, n) : e.forEach(
9
- (l) => (s || window).removeEventListener(l, n)
10
- );
11
- }), [s, ...i || []]), r ? () => {
12
- typeof e == "string" ? (s || window).addEventListener(e, n) : e.forEach(
13
- (l) => (s || window).addEventListener(l, n)
14
- );
15
- } : void 0;
16
- }, S = (e) => {
17
- const c = typeof e == "string" ? [e] : e;
18
- if (new Set(c).size !== c.length)
19
- throw new Error("there are duplicates in the event type");
20
- return c;
21
- }, M = (e, c, t) => C(
22
- S((t == null ? void 0 : t.event) || "click"),
23
- (s) => {
24
- if (e)
25
- if (e instanceof Array)
26
- e.map(
27
- (n) => n instanceof HTMLElement ? n : n.current
28
- ).some(
29
- (n) => n ? n.contains(s.target) : !1
30
- ) || c(s);
31
- else {
32
- const i = e instanceof HTMLElement ? e : e.current;
33
- i && !i.contains(s.target) && c(s);
34
- }
35
- },
36
- {
37
- deps: [e, ...(t == null ? void 0 : t.deps) || []]
38
- }
39
- ), A = (e = 60, c) => {
40
- const [t, s] = L(e), [i, r] = L(!1), n = b(null), l = T(() => r(!0), []), u = T(() => {
41
- r(!1), s(e), n.current && (clearTimeout(n.current), n.current = null), c == null || c();
42
- }, [e, c]);
43
- return E(() => {
44
- if (i)
45
- return t > 0 ? n.current = setTimeout(() => {
46
- s((a) => a - 1);
47
- }, 1e3) : u(), () => {
48
- n.current && (clearTimeout(n.current), n.current = null);
49
- };
50
- }, [i, t, u]), [t, l, u];
51
- }, R = (e) => {
52
- const [c, t] = L({ w: 0, h: 0 }), s = new ResizeObserver((r) => {
53
- for (const n of r)
54
- t({
55
- w: n.borderBoxSize[0].inlineSize,
56
- h: n.borderBoxSize[0].blockSize
57
- });
58
- }), i = () => {
59
- if (e && typeof e != "function")
60
- s.observe(e instanceof HTMLElement ? e : e.current);
61
- else if (e && typeof e == "function") {
62
- const r = e();
63
- s.observe(r instanceof HTMLElement ? r : r.current);
64
- } else t({ w: window.innerWidth, h: window.innerHeight });
65
- };
66
- return E(() => (i(), window.addEventListener("resize", i), () => {
67
- if (window.removeEventListener("resize", i), e && typeof e != "function")
68
- s.unobserve(e instanceof HTMLElement ? e : e.current);
69
- else if (e && typeof e == "function") {
70
- const r = e();
71
- s.unobserve(r instanceof HTMLElement ? r : r.current);
72
- }
73
- }), [e]), c;
74
- }, w = (e) => e.toString().toLocaleLowerCase(), k = (e, c, t) => {
75
- const s = (r, n, l) => {
76
- r.forEach((u) => {
77
- if (u.includes("+") && u.length > 1) {
78
- const a = u.split("+"), f = n.ctrlKey && a.includes("ctrl"), o = n.shiftKey && a.includes("shift"), m = n.altKey && a.includes("alt"), d = n.metaKey && a.includes("meta"), h = (n.ctrlKey || n.metaKey) && a.includes("commandorcontrol");
79
- a.length === 2 ? (f || o || m || d || h) && n.key.toLocaleLowerCase() === a[a.length - 1] && c(n, u) : a.length === 3 && (f && o || f && m || f && d || f && h || o && m || o && d || o && h || m && d || m && h || d && h) && n.key.toLocaleLowerCase() === a[a.length - 1] && c(n, u);
80
- } else if (u.includes(w(n.key))) {
81
- if (l) u === w(n.key) && c(n, u);
82
- else if (!n.ctrlKey && !n.metaKey && !n.shiftKey && !n.altKey)
83
- return c(n, u);
84
- }
85
- });
86
- }, i = (r) => C(
87
- r,
88
- (n) => s(
89
- e instanceof Array ? e.map((l) => w(l)) : [w(e)],
90
- n,
91
- (t == null ? void 0 : t.exactMatch) || !1
92
- ),
93
- {
94
- deps: [t == null ? void 0 : t.target, ...(t == null ? void 0 : t.deps) || []]
95
- }
96
- );
97
- (t == null ? void 0 : t.events) instanceof Array ? t.events.forEach((r) => i(r)) : i((t == null ? void 0 : t.events) || "keydown");
98
- };
99
- let y = !1;
100
- const z = ({ theme: e, onDark: c, onLight: t }) => {
101
- const s = window.matchMedia("(prefers-color-scheme: dark)"), i = () => {
102
- s.matches ? c() : t();
103
- }, r = () => {
104
- switch (y && (y = !1, s.removeEventListener("change", i)), e) {
105
- case "light":
106
- t();
107
- break;
108
- case "dark":
109
- c();
110
- break;
111
- default: {
112
- i(), y = !0, s.addEventListener("change", i);
113
- break;
114
- }
115
- }
116
- };
117
- E(() => {
118
- r();
119
- }, [e]);
120
- }, x = (e) => {
121
- const {
122
- initTheme: c = "light",
123
- themeRules: t = (l) => {
124
- l ? document.documentElement.classList.add("dark") : document.documentElement.classList.remove("dark");
125
- }
126
- } = e || Object.assign({}), [s, i] = L(c), r = b(null), n = ({
127
- targetTheme: l,
128
- element: u,
129
- onChange: a
130
- }) => {
131
- r.current = u || null, requestAnimationFrame(() => {
132
- a == null || a(), i(l);
133
- });
134
- };
135
- return z({
136
- theme: s,
137
- onDark: () => {
138
- r.current ? v.changeThemeClipPathCircle({
139
- element: r.current,
140
- onChangeTheme: () => t(!0)
141
- }) : t(!0);
142
- },
143
- onLight: () => {
144
- r.current ? v.changeThemeClipPathCircle({
145
- element: r.current,
146
- onChangeTheme: () => t(!1)
147
- }) : t(!1);
148
- }
149
- }), [s, n];
150
- };
151
- export {
152
- C as a,
153
- k as b,
154
- M as c,
155
- A as d,
156
- z as e,
157
- x as f,
158
- R as u
159
- };