@drjoshcsimmons/scl 0.1.4 → 0.1.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.
Files changed (88) hide show
  1. package/dist/index100.js +8 -14
  2. package/dist/index101.js +50 -9
  3. package/dist/index102.js +218 -49
  4. package/dist/index103.js +29 -218
  5. package/dist/index104.js +178 -27
  6. package/dist/index11.js +2 -2
  7. package/dist/index110.js +1 -1
  8. package/dist/index112.js +1 -1
  9. package/dist/index13.js +2 -2
  10. package/dist/index131.js +1 -1
  11. package/dist/index132.js +1 -1
  12. package/dist/index137.js +11 -21
  13. package/dist/index138.js +26 -11
  14. package/dist/index139.js +4 -27
  15. package/dist/index14.js +2 -2
  16. package/dist/index140.js +22 -4
  17. package/dist/index15.js +2 -2
  18. package/dist/index17.js +1 -1
  19. package/dist/index18.js +2 -2
  20. package/dist/index20.js +2 -2
  21. package/dist/index21.js +1 -1
  22. package/dist/index22.js +1 -1
  23. package/dist/index23.js +1 -1
  24. package/dist/index24.js +1 -1
  25. package/dist/index25.js +3 -3
  26. package/dist/index26.js +1 -1
  27. package/dist/index27.js +3 -3
  28. package/dist/index29.js +1 -1
  29. package/dist/index31.js +1 -1
  30. package/dist/index33.js +1 -1
  31. package/dist/index36.js +2 -2
  32. package/dist/index37.js +1 -1
  33. package/dist/index45.js +7 -7
  34. package/dist/index47.js +33 -435
  35. package/dist/index48.js +111 -147
  36. package/dist/index49.js +65 -302
  37. package/dist/index5.js +1 -1
  38. package/dist/index50.js +60 -12
  39. package/dist/index51.js +253 -32
  40. package/dist/index52.js +7 -7
  41. package/dist/index53.js +302 -65
  42. package/dist/index54.js +4 -4
  43. package/dist/index55.js +4 -1
  44. package/dist/index56.js +9 -249
  45. package/dist/index57.js +432 -57
  46. package/dist/index58.js +6 -6
  47. package/dist/index6.js +1 -1
  48. package/dist/index61.js +234 -99
  49. package/dist/index62.js +12 -260
  50. package/dist/index63.js +860 -12
  51. package/dist/index64.js +9 -82
  52. package/dist/index65.js +505 -211
  53. package/dist/index66.js +138 -507
  54. package/dist/index67.js +17 -21
  55. package/dist/index68.js +16 -854
  56. package/dist/index69.js +336 -9
  57. package/dist/index7.js +1 -1
  58. package/dist/index70.js +126 -250
  59. package/dist/index71.js +82 -31
  60. package/dist/index72.js +216 -311
  61. package/dist/index73.js +222 -214
  62. package/dist/index74.js +30 -17
  63. package/dist/index75.js +197 -91
  64. package/dist/index77.js +25 -44
  65. package/dist/index78.js +5 -25
  66. package/dist/index79.js +53 -6
  67. package/dist/index8.js +1 -1
  68. package/dist/index80.js +52 -49
  69. package/dist/index81.js +10 -33
  70. package/dist/index82.js +4 -11
  71. package/dist/index83.js +30 -8
  72. package/dist/index84.js +12 -3
  73. package/dist/index85.js +51 -5
  74. package/dist/index86.js +33 -24
  75. package/dist/index87.js +65 -177
  76. package/dist/index88.js +10 -68
  77. package/dist/index9.js +2 -2
  78. package/dist/index90.js +46 -30
  79. package/dist/index91.js +7 -54
  80. package/dist/index92.js +3 -10
  81. package/dist/index93.js +6 -4
  82. package/dist/index94.js +24 -12
  83. package/dist/index95.js +647 -51
  84. package/dist/index96.js +112 -637
  85. package/dist/index97.js +126 -116
  86. package/dist/index98.js +13 -134
  87. package/dist/index99.js +14 -13
  88. package/package.json +1 -1
package/dist/index91.js CHANGED
@@ -1,57 +1,10 @@
1
- import * as i from "react";
2
- import { jsx as _ } from "react/jsx-runtime";
3
- function $(e, x = []) {
4
- let o = [];
5
- function f(r, n) {
6
- const t = i.createContext(n);
7
- t.displayName = r + "Context";
8
- const c = o.length;
9
- o = [...o, n];
10
- const m = (a) => {
11
- var l;
12
- const { scope: s, children: C, ...p } = a, d = ((l = s == null ? void 0 : s[e]) == null ? void 0 : l[c]) || t, v = i.useMemo(() => p, Object.values(p));
13
- return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
14
- };
15
- m.displayName = r + "Provider";
16
- function S(a, s) {
17
- var d;
18
- const C = ((d = s == null ? void 0 : s[e]) == null ? void 0 : d[c]) || t, p = i.useContext(C);
19
- if (p) return p;
20
- if (n !== void 0) return n;
21
- throw new Error(`\`${a}\` must be used within \`${r}\``);
22
- }
23
- return [m, S];
24
- }
25
- const u = () => {
26
- const r = o.map((n) => i.createContext(n));
27
- return function(t) {
28
- const c = (t == null ? void 0 : t[e]) || r;
29
- return i.useMemo(
30
- () => ({ [`__scope${e}`]: { ...t, [e]: c } }),
31
- [t, c]
32
- );
33
- };
34
- };
35
- return u.scopeName = e, [f, h(u, ...x)];
36
- }
37
- function h(...e) {
38
- const x = e[0];
39
- if (e.length === 1) return x;
40
- const o = () => {
41
- const f = e.map((u) => ({
42
- useScope: u(),
43
- scopeName: u.scopeName
44
- }));
45
- return function(r) {
46
- const n = f.reduce((t, { useScope: c, scopeName: m }) => {
47
- const a = c(r)[`__scope${m}`];
48
- return { ...t, ...a };
49
- }, {});
50
- return i.useMemo(() => ({ [`__scope${x.scopeName}`]: n }), [n]);
51
- };
52
- };
53
- return o.scopeName = x.scopeName, o;
1
+ import * as t from "react";
2
+ import "react/jsx-runtime";
3
+ var r = t.createContext(void 0);
4
+ function n(o) {
5
+ const e = t.useContext(r);
6
+ return o || e || "ltr";
54
7
  }
55
8
  export {
56
- $ as createContextScope
9
+ n as useDirection
57
10
  };
package/dist/index92.js CHANGED
@@ -1,13 +1,6 @@
1
- import * as r from "react";
2
- function o(t) {
3
- const e = r.useRef(t);
4
- return r.useEffect(() => {
5
- e.current = t;
6
- }), r.useMemo(() => (...n) => {
7
- var u;
8
- return (u = e.current) == null ? void 0 : u.call(e, ...n);
9
- }, []);
1
+ function m(t, [a, n]) {
2
+ return Math.min(n, Math.max(a, t));
10
3
  }
11
4
  export {
12
- o as useCallbackRef
5
+ m as clamp
13
6
  };
package/dist/index93.js CHANGED
@@ -1,6 +1,8 @@
1
- import * as t from "react";
2
- var e = globalThis != null && globalThis.document ? t.useLayoutEffect : () => {
3
- };
1
+ import * as u from "react";
2
+ function t(r) {
3
+ const e = u.useRef({ value: r, previous: r });
4
+ return u.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);
5
+ }
4
6
  export {
5
- e as useLayoutEffect
7
+ t as usePrevious
6
8
  };
package/dist/index94.js CHANGED
@@ -1,15 +1,27 @@
1
- import { s as r } from "./index105.js";
2
- function s() {
3
- return r.useSyncExternalStore(
4
- e,
5
- () => !0,
6
- () => !1
7
- );
8
- }
9
- function e() {
10
- return () => {
11
- };
1
+ import * as h from "react";
2
+ import { useLayoutEffect as z } from "./index82.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;
12
24
  }
13
25
  export {
14
- s as useIsHydrated
26
+ c as useSize
15
27
  };