@plyaz/ui 0.4.6 → 0.4.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 (57) hide show
  1. package/dist/ui.cjs20.js +1 -1
  2. package/dist/ui.cjs21.js +1 -1
  3. package/dist/ui.cjs22.js +1 -1
  4. package/dist/ui.cjs23.js +1 -1
  5. package/dist/ui.cjs24.js +1 -1
  6. package/dist/ui.cjs25.js +1 -1
  7. package/dist/ui.cjs31.js +1 -1
  8. package/dist/ui.cjs32.js +1 -1
  9. package/dist/ui.cjs35.js +1 -1
  10. package/dist/ui.cjs38.js +1 -1
  11. package/dist/ui.cjs40.js +1 -1
  12. package/dist/ui.cjs42.js +1 -1
  13. package/dist/ui.cjs54.js +1 -6
  14. package/dist/ui.cjs55.js +1 -6
  15. package/dist/ui.cjs56.js +1 -6
  16. package/dist/ui.cjs57.js +1 -6
  17. package/dist/ui.cjs58.js +1 -1
  18. package/dist/ui.cjs59.js +6 -1
  19. package/dist/ui.cjs60.js +6 -1
  20. package/dist/ui.cjs61.js +6 -1
  21. package/dist/ui.cjs62.js +6 -1
  22. package/dist/ui.cjs67.js +1 -1
  23. package/dist/ui.cjs69.js +1 -1
  24. package/dist/ui.cjs74.js +1 -38
  25. package/dist/ui.cjs75.js +38 -1
  26. package/dist/ui.cjs76.js +1 -1
  27. package/dist/ui.cjs77.js +1 -1
  28. package/dist/ui.cjs78.js +1 -1
  29. package/dist/ui.es20.js +1 -1
  30. package/dist/ui.es21.js +1 -1
  31. package/dist/ui.es22.js +1 -1
  32. package/dist/ui.es23.js +1 -1
  33. package/dist/ui.es24.js +1 -1
  34. package/dist/ui.es25.js +1 -1
  35. package/dist/ui.es31.js +2724 -22
  36. package/dist/ui.es32.js +22 -2724
  37. package/dist/ui.es35.js +1 -1
  38. package/dist/ui.es38.js +2 -2
  39. package/dist/ui.es40.js +1 -1
  40. package/dist/ui.es42.js +5 -5
  41. package/dist/ui.es54.js +12 -25
  42. package/dist/ui.es55.js +205 -21
  43. package/dist/ui.es56.js +21 -38
  44. package/dist/ui.es57.js +25 -18
  45. package/dist/ui.es58.js +396 -10
  46. package/dist/ui.es59.js +25 -206
  47. package/dist/ui.es60.js +22 -22
  48. package/dist/ui.es61.js +39 -25
  49. package/dist/ui.es62.js +17 -397
  50. package/dist/ui.es67.js +1 -1
  51. package/dist/ui.es69.js +4 -4
  52. package/dist/ui.es74.js +65 -69
  53. package/dist/ui.es75.js +68 -8
  54. package/dist/ui.es76.js +9 -14
  55. package/dist/ui.es77.js +14 -66
  56. package/dist/ui.es78.js +65 -64
  57. package/package.json +4 -3
package/dist/ui.es35.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import r from "react";
2
2
  import { createContextScope as y } from "./ui.es36.js";
3
- import { useComposedRefs as S } from "./ui.es31.js";
3
+ import { useComposedRefs as S } from "./ui.es32.js";
4
4
  import { createSlot as M } from "./ui.es20.js";
5
5
  import { j as d } from "./ui.es17.js";
6
6
  function D(s) {
package/dist/ui.es38.js CHANGED
@@ -1,9 +1,9 @@
1
1
  import * as n from "react";
2
2
  import { composeEventHandlers as m } from "./ui.es34.js";
3
3
  import { Primitive as R, dispatchDiscreteCustomEvent as k } from "./ui.es44.js";
4
- import { useComposedRefs as g } from "./ui.es31.js";
4
+ import { useComposedRefs as g } from "./ui.es32.js";
5
5
  import { useCallbackRef as w } from "./ui.es45.js";
6
- import { useEscapeKeydown as U } from "./ui.es58.js";
6
+ import { useEscapeKeydown as U } from "./ui.es54.js";
7
7
  import { j as x } from "./ui.es17.js";
8
8
  var j = "DismissableLayer", p = "dismissableLayer.update", z = "dismissableLayer.pointerDownOutside", H = "dismissableLayer.focusOutside", L, T = n.createContext({
9
9
  layers: /* @__PURE__ */ new Set(),
package/dist/ui.es40.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as d from "react";
2
- import { useComposedRefs as P } from "./ui.es31.js";
2
+ import { useComposedRefs as P } from "./ui.es32.js";
3
3
  import { Primitive as M } from "./ui.es44.js";
4
4
  import { useCallbackRef as y } from "./ui.es45.js";
5
5
  import { j as _ } from "./ui.es17.js";
package/dist/ui.es42.js CHANGED
@@ -1,14 +1,14 @@
1
1
  import * as s from "react";
2
- import { useFloating as xe, offset as Pe, shift as ye, flip as Ae, size as ve, arrow as Ce, hide as be, limitShift as Se } from "./ui.es59.js";
3
- import { Root as Oe } from "./ui.es60.js";
4
- import { useComposedRefs as T } from "./ui.es31.js";
2
+ import { useFloating as xe, offset as Pe, shift as ye, flip as Ae, size as ve, arrow as Ce, hide as be, limitShift as Se } from "./ui.es55.js";
3
+ import { Root as Oe } from "./ui.es56.js";
4
+ import { useComposedRefs as T } from "./ui.es32.js";
5
5
  import { createContextScope as Re } from "./ui.es36.js";
6
6
  import { Primitive as z } from "./ui.es44.js";
7
7
  import { useCallbackRef as Ee } from "./ui.es45.js";
8
8
  import { useLayoutEffect as B } from "./ui.es47.js";
9
- import { useSize as Ne } from "./ui.es61.js";
9
+ import { useSize as Ne } from "./ui.es57.js";
10
10
  import { j as f } from "./ui.es17.js";
11
- import { autoUpdate as _e } from "./ui.es62.js";
11
+ import { autoUpdate as _e } from "./ui.es58.js";
12
12
  var N = "Popper", [L, Ue] = Re(N), [$e, Z] = L(N), U = (e) => {
13
13
  const { __scopePopper: i, children: n } = e, [t, a] = s.useState(null);
14
14
  return /* @__PURE__ */ f.jsx($e, { scope: i, anchor: t, onAnchorChange: a, children: n });
package/dist/ui.es54.js CHANGED
@@ -1,27 +1,14 @@
1
- import { forwardRef as m, createElement as l } from "react";
2
- import { mergeClasses as d, toKebabCase as f, toPascalCase as r } from "./ui.es55.js";
3
- import n from "./ui.es56.js";
4
- /**
5
- * @license lucide-react v0.525.0 - ISC
6
- *
7
- * This source code is licensed under the ISC license.
8
- * See the LICENSE file in the root directory of this source tree.
9
- */
10
- const C = (e, t) => {
11
- const o = m(
12
- ({ className: a, ...s }, c) => l(n, {
13
- ref: c,
14
- iconNode: t,
15
- className: d(
16
- `lucide-${f(r(e))}`,
17
- `lucide-${e}`,
18
- a
19
- ),
20
- ...s
21
- })
22
- );
23
- return o.displayName = r(e), o;
24
- };
1
+ import * as r from "react";
2
+ import { useCallbackRef as s } from "./ui.es45.js";
3
+ function p(n, e = globalThis == null ? void 0 : globalThis.document) {
4
+ const t = s(n);
5
+ r.useEffect(() => {
6
+ const o = (a) => {
7
+ a.key === "Escape" && t(a);
8
+ };
9
+ return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
10
+ }, [t, e]);
11
+ }
25
12
  export {
26
- C as default
13
+ p as useEscapeKeydown
27
14
  };
package/dist/ui.es55.js CHANGED
@@ -1,24 +1,208 @@
1
- /**
2
- * @license lucide-react v0.525.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */
7
- const s = (t) => t.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase(), a = (t) => t.replace(
8
- /^([A-Z])|[\s-_]+(\w)/g,
9
- (e, o, r) => r ? r.toUpperCase() : o.toLowerCase()
10
- ), n = (t) => {
11
- const e = a(t);
12
- return e.charAt(0).toUpperCase() + e.slice(1);
13
- }, c = (...t) => t.filter((e, o, r) => !!e && e.trim() !== "" && r.indexOf(e) === o).join(" ").trim(), i = (t) => {
14
- for (const e in t)
15
- if (e.startsWith("aria-") || e === "role" || e === "title")
1
+ import { computePosition as I, offset as J, shift as K, flip as N, size as Q, hide as T, limitShift as X, arrow as z } from "./ui.es58.js";
2
+ import { autoUpdate as pe, platform as ge } from "./ui.es58.js";
3
+ import * as o from "react";
4
+ import { useLayoutEffect as Y } from "react";
5
+ import * as Z from "react-dom";
6
+ var b = typeof document < "u", ee = function() {
7
+ }, w = b ? Y : ee;
8
+ function R(e, t) {
9
+ if (e === t)
10
+ return !0;
11
+ if (typeof e != typeof t)
12
+ return !1;
13
+ if (typeof e == "function" && e.toString() === t.toString())
14
+ return !0;
15
+ let n, r, i;
16
+ if (e && t && typeof e == "object") {
17
+ if (Array.isArray(e)) {
18
+ if (n = e.length, n !== t.length) return !1;
19
+ for (r = n; r-- !== 0; )
20
+ if (!R(e[r], t[r]))
21
+ return !1;
16
22
  return !0;
17
- };
23
+ }
24
+ if (i = Object.keys(e), n = i.length, n !== Object.keys(t).length)
25
+ return !1;
26
+ for (r = n; r-- !== 0; )
27
+ if (!{}.hasOwnProperty.call(t, i[r]))
28
+ return !1;
29
+ for (r = n; r-- !== 0; ) {
30
+ const p = i[r];
31
+ if (!(p === "_owner" && e.$$typeof) && !R(e[p], t[p]))
32
+ return !1;
33
+ }
34
+ return !0;
35
+ }
36
+ return e !== e && t !== t;
37
+ }
38
+ function A(e) {
39
+ return typeof window > "u" ? 1 : (e.ownerDocument.defaultView || window).devicePixelRatio || 1;
40
+ }
41
+ function L(e, t) {
42
+ const n = A(e);
43
+ return Math.round(t * n) / n;
44
+ }
45
+ function k(e) {
46
+ const t = o.useRef(e);
47
+ return w(() => {
48
+ t.current = e;
49
+ }), t;
50
+ }
51
+ function oe(e) {
52
+ e === void 0 && (e = {});
53
+ const {
54
+ placement: t = "bottom",
55
+ strategy: n = "absolute",
56
+ middleware: r = [],
57
+ platform: i,
58
+ elements: {
59
+ reference: p,
60
+ floating: q
61
+ } = {},
62
+ transform: D = !0,
63
+ whileElementsMounted: E,
64
+ open: x
65
+ } = e, [s, C] = o.useState({
66
+ x: 0,
67
+ y: 0,
68
+ strategy: n,
69
+ placement: t,
70
+ middlewareData: {},
71
+ isPositioned: !1
72
+ }), [M, B] = o.useState(r);
73
+ R(M, r) || B(r);
74
+ const [U, V] = o.useState(null), [W, G] = o.useState(null), O = o.useCallback((f) => {
75
+ f !== a.current && (a.current = f, V(f));
76
+ }, []), _ = o.useCallback((f) => {
77
+ f !== d.current && (d.current = f, G(f));
78
+ }, []), u = p || U, l = q || W, a = o.useRef(null), d = o.useRef(null), y = o.useRef(s), H = E != null, S = k(E), P = k(i), v = k(x), g = o.useCallback(() => {
79
+ if (!a.current || !d.current)
80
+ return;
81
+ const f = {
82
+ placement: t,
83
+ strategy: n,
84
+ middleware: M
85
+ };
86
+ P.current && (f.platform = P.current), I(a.current, d.current, f).then((h) => {
87
+ const m = {
88
+ ...h,
89
+ // The floating element's position may be recomputed while it's closed
90
+ // but still mounted (such as when transitioning out). To ensure
91
+ // `isPositioned` will be `false` initially on the next open, avoid
92
+ // setting it to `true` when `open === false` (must be specified).
93
+ isPositioned: v.current !== !1
94
+ };
95
+ $.current && !R(y.current, m) && (y.current = m, Z.flushSync(() => {
96
+ C(m);
97
+ }));
98
+ });
99
+ }, [M, t, n, P, v]);
100
+ w(() => {
101
+ x === !1 && y.current.isPositioned && (y.current.isPositioned = !1, C((f) => ({
102
+ ...f,
103
+ isPositioned: !1
104
+ })));
105
+ }, [x]);
106
+ const $ = o.useRef(!1);
107
+ w(() => ($.current = !0, () => {
108
+ $.current = !1;
109
+ }), []), w(() => {
110
+ if (u && (a.current = u), l && (d.current = l), u && l) {
111
+ if (S.current)
112
+ return S.current(u, l, g);
113
+ g();
114
+ }
115
+ }, [u, l, g, S, H]);
116
+ const F = o.useMemo(() => ({
117
+ reference: a,
118
+ floating: d,
119
+ setReference: O,
120
+ setFloating: _
121
+ }), [O, _]), c = o.useMemo(() => ({
122
+ reference: u,
123
+ floating: l
124
+ }), [u, l]), j = o.useMemo(() => {
125
+ const f = {
126
+ position: n,
127
+ left: 0,
128
+ top: 0
129
+ };
130
+ if (!c.floating)
131
+ return f;
132
+ const h = L(c.floating, s.x), m = L(c.floating, s.y);
133
+ return D ? {
134
+ ...f,
135
+ transform: "translate(" + h + "px, " + m + "px)",
136
+ ...A(c.floating) >= 1.5 && {
137
+ willChange: "transform"
138
+ }
139
+ } : {
140
+ position: n,
141
+ left: h,
142
+ top: m
143
+ };
144
+ }, [n, D, c.floating, s.x, s.y]);
145
+ return o.useMemo(() => ({
146
+ ...s,
147
+ update: g,
148
+ refs: F,
149
+ elements: c,
150
+ floatingStyles: j
151
+ }), [s, g, F, c, j]);
152
+ }
153
+ const te = (e) => {
154
+ function t(n) {
155
+ return {}.hasOwnProperty.call(n, "current");
156
+ }
157
+ return {
158
+ name: "arrow",
159
+ options: e,
160
+ fn(n) {
161
+ const {
162
+ element: r,
163
+ padding: i
164
+ } = typeof e == "function" ? e(n) : e;
165
+ return r && t(r) ? r.current != null ? z({
166
+ element: r.current,
167
+ padding: i
168
+ }).fn(n) : {} : r ? z({
169
+ element: r,
170
+ padding: i
171
+ }).fn(n) : {};
172
+ }
173
+ };
174
+ }, fe = (e, t) => ({
175
+ ...J(e),
176
+ options: [e, t]
177
+ }), ie = (e, t) => ({
178
+ ...K(e),
179
+ options: [e, t]
180
+ }), se = (e, t) => ({
181
+ ...X(e),
182
+ options: [e, t]
183
+ }), ue = (e, t) => ({
184
+ ...N(e),
185
+ options: [e, t]
186
+ }), le = (e, t) => ({
187
+ ...Q(e),
188
+ options: [e, t]
189
+ }), ce = (e, t) => ({
190
+ ...T(e),
191
+ options: [e, t]
192
+ }), ae = (e, t) => ({
193
+ ...te(e),
194
+ options: [e, t]
195
+ });
18
196
  export {
19
- i as hasA11yProp,
20
- c as mergeClasses,
21
- a as toCamelCase,
22
- s as toKebabCase,
23
- n as toPascalCase
197
+ ae as arrow,
198
+ pe as autoUpdate,
199
+ I as computePosition,
200
+ ue as flip,
201
+ ce as hide,
202
+ se as limitShift,
203
+ fe as offset,
204
+ ge as platform,
205
+ ie as shift,
206
+ le as size,
207
+ oe as useFloating
24
208
  };
package/dist/ui.es56.js CHANGED
@@ -1,41 +1,24 @@
1
- import { forwardRef as l, createElement as o } from "react";
2
- import A from "./ui.es57.js";
3
- import { mergeClasses as b, hasA11yProp as c } from "./ui.es55.js";
4
- /**
5
- * @license lucide-react v0.525.0 - ISC
6
- *
7
- * This source code is licensed under the ISC license.
8
- * See the LICENSE file in the root directory of this source tree.
9
- */
10
- const h = l(
11
- ({
12
- color: m = "currentColor",
13
- size: t = 24,
14
- strokeWidth: e = 2,
15
- absoluteStrokeWidth: s,
16
- className: u = "",
17
- children: r,
18
- iconNode: f,
19
- ...a
20
- }, p) => o(
21
- "svg",
1
+ import * as n from "react";
2
+ import { Primitive as p } from "./ui.es44.js";
3
+ import { j as o } from "./ui.es17.js";
4
+ var v = "Arrow", e = n.forwardRef((r, i) => {
5
+ const { children: t, width: s = 10, height: a = 5, ...m } = r;
6
+ return /* @__PURE__ */ o.jsx(
7
+ p.svg,
22
8
  {
23
- ref: p,
24
- ...A,
25
- width: t,
26
- height: t,
27
- stroke: m,
28
- strokeWidth: s ? Number(e) * 24 / Number(t) : e,
29
- className: b("lucide", u),
30
- ...!r && !c(a) && { "aria-hidden": "true" },
31
- ...a
32
- },
33
- [
34
- ...f.map(([i, d]) => o(i, d)),
35
- ...Array.isArray(r) ? r : [r]
36
- ]
37
- )
38
- );
9
+ ...m,
10
+ ref: i,
11
+ width: s,
12
+ height: a,
13
+ viewBox: "0 0 30 10",
14
+ preserveAspectRatio: "none",
15
+ children: r.asChild ? t : /* @__PURE__ */ o.jsx("polygon", { points: "0,0 30,0 15,10" })
16
+ }
17
+ );
18
+ });
19
+ e.displayName = v;
20
+ var h = e;
39
21
  export {
40
- h as default
22
+ e as Arrow,
23
+ h as Root
41
24
  };
package/dist/ui.es57.js CHANGED
@@ -1,20 +1,27 @@
1
- /**
2
- * @license lucide-react v0.525.0 - ISC
3
- *
4
- * This source code is licensed under the ISC license.
5
- * See the LICENSE file in the root directory of this source tree.
6
- */
7
- var t = {
8
- xmlns: "http://www.w3.org/2000/svg",
9
- width: 24,
10
- height: 24,
11
- viewBox: "0 0 24 24",
12
- fill: "none",
13
- stroke: "currentColor",
14
- strokeWidth: 2,
15
- strokeLinecap: "round",
16
- strokeLinejoin: "round"
17
- };
1
+ import * as h from "react";
2
+ import { useLayoutEffect as z } from "./ui.es47.js";
3
+ function c(r) {
4
+ const [d, e] = h.useState(void 0);
5
+ return z(() => {
6
+ if (r) {
7
+ e({ width: r.offsetWidth, height: r.offsetHeight });
8
+ const f = new ResizeObserver((i) => {
9
+ if (!Array.isArray(i) || !i.length)
10
+ return;
11
+ const b = i[0];
12
+ let o, t;
13
+ if ("borderBoxSize" in b) {
14
+ const s = b.borderBoxSize, u = Array.isArray(s) ? s[0] : s;
15
+ o = u.inlineSize, t = u.blockSize;
16
+ } else
17
+ o = r.offsetWidth, t = r.offsetHeight;
18
+ e({ width: o, height: t });
19
+ });
20
+ return f.observe(r, { box: "border-box" }), () => f.unobserve(r);
21
+ } else
22
+ e(void 0);
23
+ }, [r]), d;
24
+ }
18
25
  export {
19
- t as default
26
+ c as useSize
20
27
  };