@drjoshcsimmons/scl 0.1.1 → 0.1.2

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 (101) hide show
  1. package/dist/index100.js +218 -8
  2. package/dist/index101.js +648 -48
  3. package/dist/index102.js +167 -205
  4. package/dist/index104.js +1 -1
  5. package/dist/index106.js +12 -21
  6. package/dist/index107.js +15 -3
  7. package/dist/index108.js +3 -32
  8. package/dist/index109.js +32 -12
  9. package/dist/index11.js +2 -2
  10. package/dist/index110.js +18 -12
  11. package/dist/index112.js +1 -1
  12. package/dist/index115.js +1 -1
  13. package/dist/index116.js +1 -1
  14. package/dist/index117.js +25 -2
  15. package/dist/index118.js +29 -2
  16. package/dist/index119.js +5 -25
  17. package/dist/index12.js +1 -1
  18. package/dist/index120.js +2 -29
  19. package/dist/index121.js +2 -5
  20. package/dist/index125.js +1 -1
  21. package/dist/index126.js +1 -1
  22. package/dist/index13.js +2 -2
  23. package/dist/index130.js +1 -1
  24. package/dist/index14.js +2 -2
  25. package/dist/index15.js +2 -2
  26. package/dist/index17.js +4 -4
  27. package/dist/index18.js +2 -2
  28. package/dist/index20.js +2 -2
  29. package/dist/index21.js +1 -1
  30. package/dist/index23.js +2 -2
  31. package/dist/index24.js +1 -1
  32. package/dist/index25.js +4 -4
  33. package/dist/index26.js +1 -1
  34. package/dist/index27.js +3 -3
  35. package/dist/index29.js +1 -1
  36. package/dist/index31.js +1 -1
  37. package/dist/index33.js +1 -1
  38. package/dist/index36.js +2 -2
  39. package/dist/index37.js +1 -1
  40. package/dist/index4.js +2 -2
  41. package/dist/index45.js +237 -33
  42. package/dist/index46.js +11 -125
  43. package/dist/index47.js +33 -237
  44. package/dist/index48.js +118 -11
  45. package/dist/index49.js +70 -57
  46. package/dist/index5.js +1 -1
  47. package/dist/index50.js +298 -237
  48. package/dist/index51.js +6 -3
  49. package/dist/index52.js +249 -62
  50. package/dist/index53.js +12 -236
  51. package/dist/index54.js +60 -11
  52. package/dist/index55.js +242 -298
  53. package/dist/index56.js +249 -12
  54. package/dist/index57.js +9 -225
  55. package/dist/index58.js +125 -11
  56. package/dist/index59.js +12 -31
  57. package/dist/index6.js +1 -1
  58. package/dist/index60.js +16 -258
  59. package/dist/index61.js +225 -12
  60. package/dist/index62.js +11 -118
  61. package/dist/index63.js +4 -5
  62. package/dist/index64.js +238 -19
  63. package/dist/index65.js +234 -16
  64. package/dist/index66.js +509 -220
  65. package/dist/index67.js +143 -112
  66. package/dist/index68.js +112 -143
  67. package/dist/index69.js +323 -241
  68. package/dist/index7.js +1 -1
  69. package/dist/index70.js +2 -2
  70. package/dist/index71.js +392 -487
  71. package/dist/index72.js +20 -433
  72. package/dist/index73.js +823 -299
  73. package/dist/index74.js +9 -860
  74. package/dist/index75.js +31 -9
  75. package/dist/index76.js +5 -66
  76. package/dist/index77.js +64 -23
  77. package/dist/index78.js +51 -6
  78. package/dist/index79.js +4 -54
  79. package/dist/index8.js +1 -1
  80. package/dist/index80.js +25 -44
  81. package/dist/index81.js +33 -51
  82. package/dist/index82.js +67 -32
  83. package/dist/index83.js +1 -1
  84. package/dist/index84.js +54 -7
  85. package/dist/index85.js +10 -5
  86. package/dist/index86.js +30 -25
  87. package/dist/index87.js +11 -67
  88. package/dist/index88.js +43 -52
  89. package/dist/index89.js +7 -10
  90. package/dist/index9.js +2 -2
  91. package/dist/index90.js +15 -4
  92. package/dist/index91.js +124 -29
  93. package/dist/index92.js +131 -9
  94. package/dist/index93.js +14 -181
  95. package/dist/index94.js +13 -13
  96. package/dist/index95.js +8 -649
  97. package/dist/index96.js +47 -122
  98. package/dist/index97.js +47 -128
  99. package/dist/index98.js +6 -14
  100. package/dist/index99.js +24 -14
  101. package/package.json +3 -2
package/dist/index100.js CHANGED
@@ -1,11 +1,221 @@
1
- import { __assign as m } from "./index119.js";
2
- import * as r from "react";
3
- import { RemoveScroll as e } from "./index120.js";
4
- import t from "./index121.js";
5
- var s = r.forwardRef(function(a, o) {
6
- return r.createElement(e, m({}, a, { ref: o, sideCar: t }));
1
+ import * as p 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 "./index111.js";
3
+ import { Root as Oe } from "./index112.js";
4
+ import { useComposedRefs as j } from "./index80.js";
5
+ import { createContextScope as Re } from "./index77.js";
6
+ import { Primitive as z } from "./index81.js";
7
+ import { useCallbackRef as Ee } from "./index85.js";
8
+ import { useLayoutEffect as T } from "./index79.js";
9
+ import { useSize as Ne } from "./index99.js";
10
+ import { jsx as f } from "react/jsx-runtime";
11
+ import { autoUpdate as _e } from "./index113.js";
12
+ var N = "Popper", [L, Ue] = Re(N), [$e, Z] = L(N), U = (e) => {
13
+ const { __scopePopper: s, children: a } = e, [t, i] = p.useState(null);
14
+ return /* @__PURE__ */ f($e, { scope: s, anchor: t, onAnchorChange: i, children: a });
15
+ };
16
+ U.displayName = N;
17
+ var q = "PopperAnchor", G = p.forwardRef(
18
+ (e, s) => {
19
+ const { __scopePopper: a, virtualRef: t, ...i } = e, r = Z(q, a), o = p.useRef(null), w = j(s, o), n = p.useRef(null);
20
+ return p.useEffect(() => {
21
+ const c = n.current;
22
+ n.current = (t == null ? void 0 : t.current) || o.current, c !== n.current && r.onAnchorChange(n.current);
23
+ }), t ? null : /* @__PURE__ */ f(z.div, { ...i, ref: w });
24
+ }
25
+ );
26
+ G.displayName = q;
27
+ var _ = "PopperContent", [He, We] = L(_), J = p.forwardRef(
28
+ (e, s) => {
29
+ var Y, M, X, D, F, k;
30
+ const {
31
+ __scopePopper: a,
32
+ side: t = "bottom",
33
+ sideOffset: i = 0,
34
+ align: r = "center",
35
+ alignOffset: o = 0,
36
+ arrowPadding: w = 0,
37
+ avoidCollisions: n = !0,
38
+ collisionBoundary: c = [],
39
+ collisionPadding: x = 0,
40
+ sticky: m = "partial",
41
+ hideWhenDetached: y = !1,
42
+ updatePositionStrategy: A = "optimized",
43
+ onPlaced: l,
44
+ ...d
45
+ } = e, v = Z(_, a), [h, C] = p.useState(null), ee = j(s, (P) => C(P)), [E, te] = p.useState(null), u = Ne(E), re = (u == null ? void 0 : u.width) ?? 0, $ = (u == null ? void 0 : u.height) ?? 0, oe = t + (r !== "center" ? "-" + r : ""), ne = typeof x == "number" ? x : { top: 0, right: 0, bottom: 0, left: 0, ...x }, H = Array.isArray(c) ? c : [c], ae = H.length > 0, b = {
46
+ padding: ne,
47
+ boundary: H.filter(Ye),
48
+ // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
49
+ altBoundary: ae
50
+ }, { refs: ie, floatingStyles: W, placement: se, isPositioned: S, middlewareData: g } = xe({
51
+ // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
52
+ strategy: "fixed",
53
+ placement: oe,
54
+ whileElementsMounted: (...P) => _e(...P, {
55
+ animationFrame: A === "always"
56
+ }),
57
+ elements: {
58
+ reference: v.anchor
59
+ },
60
+ middleware: [
61
+ Pe({ mainAxis: i + $, alignmentAxis: o }),
62
+ n && ye({
63
+ mainAxis: !0,
64
+ crossAxis: !1,
65
+ limiter: m === "partial" ? Se() : void 0,
66
+ ...b
67
+ }),
68
+ n && Ae({ ...b }),
69
+ ve({
70
+ ...b,
71
+ apply: ({ elements: P, rects: B, availableWidth: he, availableHeight: ue }) => {
72
+ const { width: ge, height: we } = B.reference, R = P.floating.style;
73
+ R.setProperty("--radix-popper-available-width", `${he}px`), R.setProperty("--radix-popper-available-height", `${ue}px`), R.setProperty("--radix-popper-anchor-width", `${ge}px`), R.setProperty("--radix-popper-anchor-height", `${we}px`);
74
+ }
75
+ }),
76
+ E && Ce({ element: E, padding: w }),
77
+ Me({ arrowWidth: re, arrowHeight: $ }),
78
+ y && be({ strategy: "referenceHidden", ...b })
79
+ ]
80
+ }), [I, ce] = V(se), O = Ee(l);
81
+ T(() => {
82
+ S && (O == null || O());
83
+ }, [S, O]);
84
+ const pe = (Y = g.arrow) == null ? void 0 : Y.x, de = (M = g.arrow) == null ? void 0 : M.y, le = ((X = g.arrow) == null ? void 0 : X.centerOffset) !== 0, [fe, me] = p.useState();
85
+ return T(() => {
86
+ h && me(window.getComputedStyle(h).zIndex);
87
+ }, [h]), /* @__PURE__ */ f(
88
+ "div",
89
+ {
90
+ ref: ie.setFloating,
91
+ "data-radix-popper-content-wrapper": "",
92
+ style: {
93
+ ...W,
94
+ transform: S ? W.transform : "translate(0, -200%)",
95
+ // keep off the page when measuring
96
+ minWidth: "max-content",
97
+ zIndex: fe,
98
+ "--radix-popper-transform-origin": [
99
+ (D = g.transformOrigin) == null ? void 0 : D.x,
100
+ (F = g.transformOrigin) == null ? void 0 : F.y
101
+ ].join(" "),
102
+ // hide the content if using the hide middleware and should be hidden
103
+ // set visibility to hidden and disable pointer events so the UI behaves
104
+ // as if the PopperContent isn't there at all
105
+ ...((k = g.hide) == null ? void 0 : k.referenceHidden) && {
106
+ visibility: "hidden",
107
+ pointerEvents: "none"
108
+ }
109
+ },
110
+ dir: e.dir,
111
+ children: /* @__PURE__ */ f(
112
+ He,
113
+ {
114
+ scope: a,
115
+ placedSide: I,
116
+ onArrowChange: te,
117
+ arrowX: pe,
118
+ arrowY: de,
119
+ shouldHideArrow: le,
120
+ children: /* @__PURE__ */ f(
121
+ z.div,
122
+ {
123
+ "data-side": I,
124
+ "data-align": ce,
125
+ ...d,
126
+ ref: ee,
127
+ style: {
128
+ ...d.style,
129
+ // if the PopperContent hasn't been placed yet (not all measurements done)
130
+ // we prevent animations so that users's animation don't kick in too early referring wrong sides
131
+ animation: S ? void 0 : "none"
132
+ }
133
+ }
134
+ )
135
+ }
136
+ )
137
+ }
138
+ );
139
+ }
140
+ );
141
+ J.displayName = _;
142
+ var K = "PopperArrow", Ie = {
143
+ top: "bottom",
144
+ right: "left",
145
+ bottom: "top",
146
+ left: "right"
147
+ }, Q = p.forwardRef(function(s, a) {
148
+ const { __scopePopper: t, ...i } = s, r = We(K, t), o = Ie[r.placedSide];
149
+ return (
150
+ // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
151
+ // doesn't report size as we'd expect on SVG elements.
152
+ // it reports their bounding box which is effectively the largest path inside the SVG.
153
+ /* @__PURE__ */ f(
154
+ "span",
155
+ {
156
+ ref: r.onArrowChange,
157
+ style: {
158
+ position: "absolute",
159
+ left: r.arrowX,
160
+ top: r.arrowY,
161
+ [o]: 0,
162
+ transformOrigin: {
163
+ top: "",
164
+ right: "0 0",
165
+ bottom: "center 0",
166
+ left: "100% 0"
167
+ }[r.placedSide],
168
+ transform: {
169
+ top: "translateY(100%)",
170
+ right: "translateY(50%) rotate(90deg) translateX(-50%)",
171
+ bottom: "rotate(180deg)",
172
+ left: "translateY(50%) rotate(-90deg) translateX(50%)"
173
+ }[r.placedSide],
174
+ visibility: r.shouldHideArrow ? "hidden" : void 0
175
+ },
176
+ children: /* @__PURE__ */ f(
177
+ Oe,
178
+ {
179
+ ...i,
180
+ ref: a,
181
+ style: {
182
+ ...i.style,
183
+ // ensures the element can be measured correctly (mostly for if SVG)
184
+ display: "block"
185
+ }
186
+ }
187
+ )
188
+ }
189
+ )
190
+ );
191
+ });
192
+ Q.displayName = K;
193
+ function Ye(e) {
194
+ return e !== null;
195
+ }
196
+ var Me = (e) => ({
197
+ name: "transformOrigin",
198
+ options: e,
199
+ fn(s) {
200
+ var v, h, C;
201
+ const { placement: a, rects: t, middlewareData: i } = s, o = ((v = i.arrow) == null ? void 0 : v.centerOffset) !== 0, w = o ? 0 : e.arrowWidth, n = o ? 0 : e.arrowHeight, [c, x] = V(a), m = { start: "0%", center: "50%", end: "100%" }[x], y = (((h = i.arrow) == null ? void 0 : h.x) ?? 0) + w / 2, A = (((C = i.arrow) == null ? void 0 : C.y) ?? 0) + n / 2;
202
+ let l = "", d = "";
203
+ return c === "bottom" ? (l = o ? m : `${y}px`, d = `${-n}px`) : c === "top" ? (l = o ? m : `${y}px`, d = `${t.floating.height + n}px`) : c === "right" ? (l = `${-n}px`, d = o ? m : `${A}px`) : c === "left" && (l = `${t.floating.width + n}px`, d = o ? m : `${A}px`), { data: { x: l, y: d } };
204
+ }
7
205
  });
8
- s.classNames = e.classNames;
206
+ function V(e) {
207
+ const [s, a = "center"] = e.split("-");
208
+ return [s, a];
209
+ }
210
+ var qe = U, Ge = G, Je = J, Ke = Q;
9
211
  export {
10
- s as default
212
+ Ge as Anchor,
213
+ Ke as Arrow,
214
+ Je as Content,
215
+ U as Popper,
216
+ G as PopperAnchor,
217
+ Q as PopperArrow,
218
+ J as PopperContent,
219
+ qe as Root,
220
+ Ue as createPopperScope
11
221
  };