etudes 32.6.0 → 32.8.0
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.
- package/build/etudes.js +672 -575
- package/build/etudes.umd.cjs +1 -1
- package/build/primitives/Carousel.d.ts +4 -31
- package/build/primitives/TextArea.d.ts +6 -2
- package/build/primitives/TextField.d.ts +7 -3
- package/package.json +13 -13
package/build/etudes.js
CHANGED
|
@@ -4713,9 +4713,9 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4713
4713
|
function an(e) {
|
|
4714
4714
|
return e && e.replace(/\/.*$/, "");
|
|
4715
4715
|
}
|
|
4716
|
-
var on = new rn(),
|
|
4717
|
-
on.init(
|
|
4718
|
-
var
|
|
4716
|
+
var on = new rn(), sn = on.interactStatic, cn = typeof globalThis < "u" ? globalThis : window;
|
|
4717
|
+
on.init(cn);
|
|
4718
|
+
var ln = Object.freeze({
|
|
4719
4719
|
__proto__: null,
|
|
4720
4720
|
edgeTarget: function() {},
|
|
4721
4721
|
elements: function() {},
|
|
@@ -4750,13 +4750,13 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4750
4750
|
};
|
|
4751
4751
|
return n.grid = e, n.coordFields = t, n;
|
|
4752
4752
|
}
|
|
4753
|
-
}),
|
|
4753
|
+
}), un = {
|
|
4754
4754
|
id: "snappers",
|
|
4755
4755
|
install: function(e) {
|
|
4756
4756
|
var t = e.interactStatic;
|
|
4757
|
-
t.snappers = W(t.snappers || {},
|
|
4757
|
+
t.snappers = W(t.snappers || {}, ln), t.createSnapGrid = t.snappers.grid;
|
|
4758
4758
|
}
|
|
4759
|
-
},
|
|
4759
|
+
}, dn = {
|
|
4760
4760
|
start: function(e) {
|
|
4761
4761
|
var t = e.state, r = e.rect, i = e.edges, a = e.pageCoords, o = t.options, s = o.ratio, c = o.enabled, l = t.options, u = l.equalDelta, d = l.modifiers;
|
|
4762
4762
|
s === "preserve" && (s = r.width / r.height), t.startCoords = W({}, a), t.startRect = W({}, r), t.ratio = s, t.equalDelta = u;
|
|
@@ -4782,7 +4782,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4782
4782
|
}
|
|
4783
4783
|
},
|
|
4784
4784
|
set: function(e) {
|
|
4785
|
-
var t = e.state, r = e.rect, i = e.coords, a = t.linkedEdges, o = W({}, i), s = t.equalDelta ?
|
|
4785
|
+
var t = e.state, r = e.rect, i = e.coords, a = t.linkedEdges, o = W({}, i), s = t.equalDelta ? fn : pn;
|
|
4786
4786
|
if (W(e.edges, a), s(t, t.xIsPrimaryAxis, i, r), !t.subModification) return null;
|
|
4787
4787
|
var c = W({}, r);
|
|
4788
4788
|
re(a, c, {
|
|
@@ -4805,11 +4805,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4805
4805
|
enabled: !1
|
|
4806
4806
|
}
|
|
4807
4807
|
};
|
|
4808
|
-
function
|
|
4808
|
+
function fn(e, t, n) {
|
|
4809
4809
|
var r = e.startCoords, i = e.edgeSign;
|
|
4810
4810
|
t ? n.y = r.y + (n.x - r.x) * i.y : n.x = r.x + (n.y - r.y) * i.x;
|
|
4811
4811
|
}
|
|
4812
|
-
function
|
|
4812
|
+
function pn(e, t, n, r) {
|
|
4813
4813
|
var i = e.startRect, a = e.startCoords, o = e.ratio, s = e.edgeSign;
|
|
4814
4814
|
if (t) {
|
|
4815
4815
|
var c = r.width / o;
|
|
@@ -4819,17 +4819,17 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4819
4819
|
n.x = a.x + (l - i.width) * s.x;
|
|
4820
4820
|
}
|
|
4821
4821
|
}
|
|
4822
|
-
var
|
|
4823
|
-
|
|
4824
|
-
var
|
|
4825
|
-
function
|
|
4822
|
+
var mn = yt(dn, "aspectRatio"), hn = function() {};
|
|
4823
|
+
hn._defaults = {};
|
|
4824
|
+
var gn = hn;
|
|
4825
|
+
function _n(e, t, n) {
|
|
4826
4826
|
return S.func(e) ? te(e, t.interactable, t.element, [
|
|
4827
4827
|
n.x,
|
|
4828
4828
|
n.y,
|
|
4829
4829
|
t
|
|
4830
4830
|
]) : te(e, t.interactable, t.element);
|
|
4831
4831
|
}
|
|
4832
|
-
var
|
|
4832
|
+
var vn = {
|
|
4833
4833
|
start: function(e) {
|
|
4834
4834
|
var t = e.rect, n = e.startOffset, r = e.state, i = e.interaction, a = e.pageCoords, o = r.options, s = o.elementRect, c = W({
|
|
4835
4835
|
left: 0,
|
|
@@ -4838,7 +4838,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4838
4838
|
bottom: 0
|
|
4839
4839
|
}, o.offset || {});
|
|
4840
4840
|
if (t && s) {
|
|
4841
|
-
var l =
|
|
4841
|
+
var l = _n(o.restriction, i, a);
|
|
4842
4842
|
if (l) {
|
|
4843
4843
|
var u = l.right - l.left - t.width, d = l.bottom - l.top - t.height;
|
|
4844
4844
|
u < 0 && (c.left += u, c.right += u), d < 0 && (c.top += d, c.bottom += d);
|
|
@@ -4848,7 +4848,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4848
4848
|
r.offset = c;
|
|
4849
4849
|
},
|
|
4850
4850
|
set: function(e) {
|
|
4851
|
-
var t = e.coords, n = e.interaction, r = e.state, i = r.options, a = r.offset, o =
|
|
4851
|
+
var t = e.coords, n = e.interaction, r = e.state, i = r.options, a = r.offset, o = _n(i.restriction, n, t);
|
|
4852
4852
|
if (o) {
|
|
4853
4853
|
var s = function(e) {
|
|
4854
4854
|
return !e || "left" in e && "top" in e || ((e = W({}, e)).left = e.x || 0, e.top = e.y || 0, e.right = e.right || e.left + e.width, e.bottom = e.bottom || e.top + e.height), e;
|
|
@@ -4863,18 +4863,18 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4863
4863
|
endOnly: !1,
|
|
4864
4864
|
enabled: !1
|
|
4865
4865
|
}
|
|
4866
|
-
},
|
|
4866
|
+
}, yn = yt(vn, "restrict"), bn = {
|
|
4867
4867
|
top: Infinity,
|
|
4868
4868
|
left: Infinity,
|
|
4869
4869
|
bottom: -Infinity,
|
|
4870
4870
|
right: -Infinity
|
|
4871
|
-
},
|
|
4871
|
+
}, xn = {
|
|
4872
4872
|
top: -Infinity,
|
|
4873
4873
|
left: -Infinity,
|
|
4874
4874
|
bottom: Infinity,
|
|
4875
4875
|
right: Infinity
|
|
4876
4876
|
};
|
|
4877
|
-
function
|
|
4877
|
+
function Sn(e, t) {
|
|
4878
4878
|
for (var n = 0, r = [
|
|
4879
4879
|
"top",
|
|
4880
4880
|
"left",
|
|
@@ -4886,12 +4886,12 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4886
4886
|
}
|
|
4887
4887
|
return e;
|
|
4888
4888
|
}
|
|
4889
|
-
var
|
|
4890
|
-
noInner:
|
|
4891
|
-
noOuter:
|
|
4889
|
+
var Cn = {
|
|
4890
|
+
noInner: bn,
|
|
4891
|
+
noOuter: xn,
|
|
4892
4892
|
start: function(e) {
|
|
4893
4893
|
var t, n = e.interaction, r = e.startOffset, i = e.state, a = i.options;
|
|
4894
|
-
a && (t = G(
|
|
4894
|
+
a && (t = G(_n(a.offset, n, n.coords.start.page))), t ||= {
|
|
4895
4895
|
x: 0,
|
|
4896
4896
|
y: 0
|
|
4897
4897
|
}, i.offset = {
|
|
@@ -4904,8 +4904,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4904
4904
|
set: function(e) {
|
|
4905
4905
|
var t = e.coords, n = e.edges, r = e.interaction, i = e.state, a = i.offset, o = i.options;
|
|
4906
4906
|
if (n) {
|
|
4907
|
-
var s = W({}, t), c =
|
|
4908
|
-
|
|
4907
|
+
var s = W({}, t), c = _n(o.inner, r, s) || {}, l = _n(o.outer, r, s) || {};
|
|
4908
|
+
Sn(c, bn), Sn(l, xn), n.top ? t.y = Math.min(Math.max(l.top + a.top, s.y), c.top + a.top) : n.bottom && (t.y = Math.max(Math.min(l.bottom + a.bottom, s.y), c.bottom + a.bottom)), n.left ? t.x = Math.min(Math.max(l.left + a.left, s.x), c.left + a.left) : n.right && (t.x = Math.max(Math.min(l.right + a.right, s.x), c.right + a.right));
|
|
4909
4909
|
}
|
|
4910
4910
|
},
|
|
4911
4911
|
defaults: {
|
|
@@ -4915,7 +4915,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4915
4915
|
endOnly: !1,
|
|
4916
4916
|
enabled: !1
|
|
4917
4917
|
}
|
|
4918
|
-
},
|
|
4918
|
+
}, wn = yt(Cn, "restrictEdges"), Tn = W({
|
|
4919
4919
|
get elementRect() {
|
|
4920
4920
|
return {
|
|
4921
4921
|
top: 0,
|
|
@@ -4925,29 +4925,29 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4925
4925
|
};
|
|
4926
4926
|
},
|
|
4927
4927
|
set elementRect(e) {}
|
|
4928
|
-
},
|
|
4929
|
-
start:
|
|
4930
|
-
set:
|
|
4931
|
-
defaults:
|
|
4932
|
-
}, "restrictRect"),
|
|
4928
|
+
}, vn.defaults), En = yt({
|
|
4929
|
+
start: vn.start,
|
|
4930
|
+
set: vn.set,
|
|
4931
|
+
defaults: Tn
|
|
4932
|
+
}, "restrictRect"), Dn = {
|
|
4933
4933
|
width: -Infinity,
|
|
4934
4934
|
height: -Infinity
|
|
4935
|
-
},
|
|
4935
|
+
}, On = {
|
|
4936
4936
|
width: Infinity,
|
|
4937
4937
|
height: Infinity
|
|
4938
|
-
},
|
|
4938
|
+
}, kn = yt({
|
|
4939
4939
|
start: function(e) {
|
|
4940
|
-
return
|
|
4940
|
+
return Cn.start(e);
|
|
4941
4941
|
},
|
|
4942
4942
|
set: function(e) {
|
|
4943
4943
|
var t = e.interaction, n = e.state, r = e.rect, i = e.edges, a = n.options;
|
|
4944
4944
|
if (i) {
|
|
4945
|
-
var o = ne(
|
|
4945
|
+
var o = ne(_n(a.min, t, e.coords)) || Dn, s = ne(_n(a.max, t, e.coords)) || On;
|
|
4946
4946
|
n.options = {
|
|
4947
4947
|
endOnly: a.endOnly,
|
|
4948
|
-
inner: W({},
|
|
4949
|
-
outer: W({},
|
|
4950
|
-
}, i.top ? (n.options.inner.top = r.bottom - o.height, n.options.outer.top = r.bottom - s.height) : i.bottom && (n.options.inner.bottom = r.top + o.height, n.options.outer.bottom = r.top + s.height), i.left ? (n.options.inner.left = r.right - o.width, n.options.outer.left = r.right - s.width) : i.right && (n.options.inner.right = r.left + o.width, n.options.outer.right = r.left + s.width),
|
|
4948
|
+
inner: W({}, Cn.noInner),
|
|
4949
|
+
outer: W({}, Cn.noOuter)
|
|
4950
|
+
}, i.top ? (n.options.inner.top = r.bottom - o.height, n.options.outer.top = r.bottom - s.height) : i.bottom && (n.options.inner.bottom = r.top + o.height, n.options.outer.bottom = r.top + s.height), i.left ? (n.options.inner.left = r.right - o.width, n.options.outer.left = r.right - s.width) : i.right && (n.options.inner.right = r.left + o.width, n.options.outer.right = r.left + s.width), Cn.set(e), n.options = a;
|
|
4951
4951
|
}
|
|
4952
4952
|
},
|
|
4953
4953
|
defaults: {
|
|
@@ -4956,7 +4956,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4956
4956
|
endOnly: !1,
|
|
4957
4957
|
enabled: !1
|
|
4958
4958
|
}
|
|
4959
|
-
}, "restrictSize"),
|
|
4959
|
+
}, "restrictSize"), An = {
|
|
4960
4960
|
start: function(e) {
|
|
4961
4961
|
var t, n = e.interaction, r = e.interactable, i = e.element, a = e.rect, o = e.state, s = e.startOffset, c = o.options, l = c.offsetWithOrigin ? function(e) {
|
|
4962
4962
|
var t = e.interaction.element;
|
|
@@ -5030,7 +5030,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5030
5030
|
endOnly: !1,
|
|
5031
5031
|
enabled: !1
|
|
5032
5032
|
}
|
|
5033
|
-
},
|
|
5033
|
+
}, jn = yt(An, "snap"), Mn = {
|
|
5034
5034
|
start: function(e) {
|
|
5035
5035
|
var t = e.state, n = e.edges, r = t.options;
|
|
5036
5036
|
if (!n) return null;
|
|
@@ -5046,7 +5046,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5046
5046
|
y: 0
|
|
5047
5047
|
},
|
|
5048
5048
|
range: r.range
|
|
5049
|
-
} }, t.targetFields = t.targetFields || [["width", "height"], ["x", "y"]],
|
|
5049
|
+
} }, t.targetFields = t.targetFields || [["width", "height"], ["x", "y"]], An.start(e), t.offsets = e.state.offsets, e.state = t;
|
|
5050
5050
|
},
|
|
5051
5051
|
set: function(e) {
|
|
5052
5052
|
var t = e.interaction, n = e.state, r = e.coords, i = n.options, a = n.offsets, o = {
|
|
@@ -5067,7 +5067,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5067
5067
|
n.options.targets.push(u);
|
|
5068
5068
|
}
|
|
5069
5069
|
}
|
|
5070
|
-
var g =
|
|
5070
|
+
var g = An.set(e);
|
|
5071
5071
|
return n.options = i, g;
|
|
5072
5072
|
},
|
|
5073
5073
|
defaults: {
|
|
@@ -5077,19 +5077,19 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5077
5077
|
endOnly: !1,
|
|
5078
5078
|
enabled: !1
|
|
5079
5079
|
}
|
|
5080
|
-
},
|
|
5081
|
-
aspectRatio:
|
|
5082
|
-
restrictEdges:
|
|
5083
|
-
restrict:
|
|
5084
|
-
restrictRect:
|
|
5085
|
-
restrictSize:
|
|
5080
|
+
}, Nn = yt(Mn, "snapSize"), Pn = {
|
|
5081
|
+
aspectRatio: mn,
|
|
5082
|
+
restrictEdges: wn,
|
|
5083
|
+
restrict: yn,
|
|
5084
|
+
restrictRect: En,
|
|
5085
|
+
restrictSize: kn,
|
|
5086
5086
|
snapEdges: yt({
|
|
5087
5087
|
start: function(e) {
|
|
5088
5088
|
var t = e.edges;
|
|
5089
|
-
return t ? (e.state.targetFields = e.state.targetFields || [[t.left ? "left" : "right", t.top ? "top" : "bottom"]],
|
|
5089
|
+
return t ? (e.state.targetFields = e.state.targetFields || [[t.left ? "left" : "right", t.top ? "top" : "bottom"]], Mn.start(e)) : null;
|
|
5090
5090
|
},
|
|
5091
|
-
set:
|
|
5092
|
-
defaults: W(gt(
|
|
5091
|
+
set: Mn.set,
|
|
5092
|
+
defaults: W(gt(Mn.defaults), {
|
|
5093
5093
|
targets: void 0,
|
|
5094
5094
|
range: void 0,
|
|
5095
5095
|
offset: {
|
|
@@ -5098,22 +5098,22 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5098
5098
|
}
|
|
5099
5099
|
})
|
|
5100
5100
|
}, "snapEdges"),
|
|
5101
|
-
snap:
|
|
5102
|
-
snapSize:
|
|
5103
|
-
spring:
|
|
5104
|
-
avoid:
|
|
5105
|
-
transform:
|
|
5106
|
-
rubberband:
|
|
5107
|
-
},
|
|
5101
|
+
snap: jn,
|
|
5102
|
+
snapSize: Nn,
|
|
5103
|
+
spring: gn,
|
|
5104
|
+
avoid: gn,
|
|
5105
|
+
transform: gn,
|
|
5106
|
+
rubberband: gn
|
|
5107
|
+
}, Fn = {
|
|
5108
5108
|
id: "modifiers",
|
|
5109
5109
|
install: function(e) {
|
|
5110
5110
|
var t = e.interactStatic;
|
|
5111
|
-
for (var n in e.usePlugin(xt), e.usePlugin(
|
|
5112
|
-
var r =
|
|
5111
|
+
for (var n in e.usePlugin(xt), e.usePlugin(un), t.modifiers = Pn, Pn) {
|
|
5112
|
+
var r = Pn[n], i = r._defaults;
|
|
5113
5113
|
i._methods = r._methods, e.defaults.perAction[n] = i;
|
|
5114
5114
|
}
|
|
5115
5115
|
}
|
|
5116
|
-
},
|
|
5116
|
+
}, In = function(e) {
|
|
5117
5117
|
c(n, e);
|
|
5118
5118
|
var t = f(n);
|
|
5119
5119
|
function n(e, r, a, o, s, c) {
|
|
@@ -5148,7 +5148,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5148
5148
|
}
|
|
5149
5149
|
}
|
|
5150
5150
|
]), n;
|
|
5151
|
-
}(Ce),
|
|
5151
|
+
}(Ce), Ln = {
|
|
5152
5152
|
id: "pointer-events/base",
|
|
5153
5153
|
before: [
|
|
5154
5154
|
"inertia",
|
|
@@ -5157,7 +5157,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5157
5157
|
"actions"
|
|
5158
5158
|
],
|
|
5159
5159
|
install: function(e) {
|
|
5160
|
-
e.pointerEvents =
|
|
5160
|
+
e.pointerEvents = Ln, e.defaults.actions.pointerEvents = Ln.defaults, W(e.actions.phaselessTypes, Ln.types);
|
|
5161
5161
|
},
|
|
5162
5162
|
listeners: {
|
|
5163
5163
|
"interactions:new": function(e) {
|
|
@@ -5173,7 +5173,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5173
5173
|
},
|
|
5174
5174
|
"interactions:move": function(e, t) {
|
|
5175
5175
|
var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget;
|
|
5176
|
-
e.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown &&
|
|
5176
|
+
e.duplicate || n.pointerIsDown && !n.pointerWasMoved || (n.pointerIsDown && Bn(e), Rn({
|
|
5177
5177
|
interaction: n,
|
|
5178
5178
|
pointer: r,
|
|
5179
5179
|
event: i,
|
|
@@ -5199,7 +5199,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5199
5199
|
m < d && (d = m);
|
|
5200
5200
|
}
|
|
5201
5201
|
s.duration = d, s.timeout = setTimeout((function() {
|
|
5202
|
-
|
|
5202
|
+
Rn({
|
|
5203
5203
|
interaction: n,
|
|
5204
5204
|
eventTarget: a,
|
|
5205
5205
|
pointer: r,
|
|
@@ -5208,12 +5208,12 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5208
5208
|
}, t);
|
|
5209
5209
|
}), d);
|
|
5210
5210
|
}
|
|
5211
|
-
})(e, t),
|
|
5211
|
+
})(e, t), Rn(e, t);
|
|
5212
5212
|
},
|
|
5213
5213
|
"interactions:up": function(e, t) {
|
|
5214
|
-
|
|
5214
|
+
Bn(e), Rn(e, t), function(e, t) {
|
|
5215
5215
|
var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget;
|
|
5216
|
-
n.pointerWasMoved ||
|
|
5216
|
+
n.pointerWasMoved || Rn({
|
|
5217
5217
|
interaction: n,
|
|
5218
5218
|
eventTarget: a,
|
|
5219
5219
|
pointer: r,
|
|
@@ -5223,12 +5223,12 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5223
5223
|
}(e, t);
|
|
5224
5224
|
},
|
|
5225
5225
|
"interactions:cancel": function(e, t) {
|
|
5226
|
-
|
|
5226
|
+
Bn(e), Rn(e, t);
|
|
5227
5227
|
}
|
|
5228
5228
|
},
|
|
5229
|
-
PointerEvent:
|
|
5230
|
-
fire:
|
|
5231
|
-
collectEventTargets:
|
|
5229
|
+
PointerEvent: In,
|
|
5230
|
+
fire: Rn,
|
|
5231
|
+
collectEventTargets: zn,
|
|
5232
5232
|
defaults: {
|
|
5233
5233
|
holdDuration: 600,
|
|
5234
5234
|
ignoreFrom: null,
|
|
@@ -5248,8 +5248,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5248
5248
|
hold: !0
|
|
5249
5249
|
}
|
|
5250
5250
|
};
|
|
5251
|
-
function
|
|
5252
|
-
var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget, o = e.type, s = e.targets, c = s === void 0 ?
|
|
5251
|
+
function Rn(e, t) {
|
|
5252
|
+
var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget, o = e.type, s = e.targets, c = s === void 0 ? zn(e, t) : s, l = new In(o, r, i, a, n, t.now());
|
|
5253
5253
|
t.fire("pointerEvents:new", { pointerEvent: l });
|
|
5254
5254
|
for (var u = {
|
|
5255
5255
|
interaction: n,
|
|
@@ -5266,7 +5266,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5266
5266
|
if (l._subtractOrigin(m), l.eventable = f.eventable, l.currentTarget = f.node, f.eventable.fire(l), l._addOrigin(m), l.immediatePropagationStopped || l.propagationStopped && d + 1 < c.length && c[d + 1].node !== l.currentTarget) break;
|
|
5267
5267
|
}
|
|
5268
5268
|
if (t.fire("pointerEvents:fired", u), o === "tap") {
|
|
5269
|
-
var h = l.double ?
|
|
5269
|
+
var h = l.double ? Rn({
|
|
5270
5270
|
interaction: n,
|
|
5271
5271
|
pointer: r,
|
|
5272
5272
|
event: i,
|
|
@@ -5277,7 +5277,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5277
5277
|
}
|
|
5278
5278
|
return l;
|
|
5279
5279
|
}
|
|
5280
|
-
function
|
|
5280
|
+
function zn(e, t) {
|
|
5281
5281
|
var n = e.interaction, r = e.pointer, i = e.event, a = e.eventTarget, o = e.type, s = n.getPointerIndex(r), c = n.pointers[s];
|
|
5282
5282
|
if (o === "tap" && (n.pointerWasMoved || !c || c.downTarget !== a)) return [];
|
|
5283
5283
|
for (var l = H(a), u = {
|
|
@@ -5295,22 +5295,22 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5295
5295
|
return e.eventable.options.holdDuration === ((t = n.pointers[s]) == null || (r = t.hold) == null ? void 0 : r.duration);
|
|
5296
5296
|
}))), u.targets;
|
|
5297
5297
|
}
|
|
5298
|
-
function
|
|
5298
|
+
function Bn(e) {
|
|
5299
5299
|
var t = e.interaction, n = e.pointerIndex, r = t.pointers[n].hold;
|
|
5300
5300
|
r && r.timeout && (clearTimeout(r.timeout), r.timeout = null);
|
|
5301
5301
|
}
|
|
5302
|
-
var
|
|
5302
|
+
var Vn = Object.freeze({
|
|
5303
5303
|
__proto__: null,
|
|
5304
|
-
default:
|
|
5304
|
+
default: Ln
|
|
5305
5305
|
});
|
|
5306
|
-
function
|
|
5306
|
+
function Hn(e) {
|
|
5307
5307
|
var t = e.interaction;
|
|
5308
5308
|
t.holdIntervalHandle &&= (clearInterval(t.holdIntervalHandle), null);
|
|
5309
5309
|
}
|
|
5310
|
-
var
|
|
5310
|
+
var Un = {
|
|
5311
5311
|
id: "pointer-events/holdRepeat",
|
|
5312
5312
|
install: function(e) {
|
|
5313
|
-
e.usePlugin(
|
|
5313
|
+
e.usePlugin(Ln);
|
|
5314
5314
|
var t = e.pointerEvents;
|
|
5315
5315
|
t.defaults.holdRepeatInterval = 0, t.types.holdrepeat = e.actions.phaselessTypes.holdrepeat = !0;
|
|
5316
5316
|
},
|
|
@@ -5320,7 +5320,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5320
5320
|
"cancel",
|
|
5321
5321
|
"endall"
|
|
5322
5322
|
].reduce((function(e, t) {
|
|
5323
|
-
return e[`pointerEvents:${t}`] =
|
|
5323
|
+
return e[`pointerEvents:${t}`] = Hn, e;
|
|
5324
5324
|
}), {
|
|
5325
5325
|
"pointerEvents:new": function(e) {
|
|
5326
5326
|
var t = e.pointerEvent;
|
|
@@ -5342,7 +5342,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5342
5342
|
}
|
|
5343
5343
|
}
|
|
5344
5344
|
})
|
|
5345
|
-
},
|
|
5345
|
+
}, Wn = {
|
|
5346
5346
|
id: "pointer-events/interactableTargets",
|
|
5347
5347
|
install: function(e) {
|
|
5348
5348
|
var t = e.Interactable;
|
|
@@ -5379,12 +5379,12 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5379
5379
|
}
|
|
5380
5380
|
}
|
|
5381
5381
|
};
|
|
5382
|
-
if (
|
|
5382
|
+
if (sn.use(mt), sn.use(Nt), sn.use({
|
|
5383
5383
|
id: "pointer-events",
|
|
5384
5384
|
install: function(e) {
|
|
5385
|
-
e.usePlugin(
|
|
5385
|
+
e.usePlugin(Vn), e.usePlugin(Un), e.usePlugin(Wn);
|
|
5386
5386
|
}
|
|
5387
|
-
}),
|
|
5387
|
+
}), sn.use(zt), sn.use(Fn), sn.use(dt), sn.use(We), sn.use(Z), sn.use({
|
|
5388
5388
|
id: "reflow",
|
|
5389
5389
|
install: function(e) {
|
|
5390
5390
|
var t = e.Interactable;
|
|
@@ -5481,10 +5481,10 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5481
5481
|
e.splice(e.indexOf(t), 1);
|
|
5482
5482
|
}(t.interactions.list, n));
|
|
5483
5483
|
} }
|
|
5484
|
-
}),
|
|
5485
|
-
t.exports =
|
|
5484
|
+
}), sn.default = sn, (t === void 0 ? "undefined" : r(t)) === "object" && t) try {
|
|
5485
|
+
t.exports = sn;
|
|
5486
5486
|
} catch {}
|
|
5487
|
-
return
|
|
5487
|
+
return sn.default = sn, sn;
|
|
5488
5488
|
}));
|
|
5489
5489
|
})))(), 1);
|
|
5490
5490
|
function _t(e) {
|
|
@@ -6295,12 +6295,12 @@ function on(e, t, n) {
|
|
|
6295
6295
|
}
|
|
6296
6296
|
//#endregion
|
|
6297
6297
|
//#region src/hooks/useLocalCache.ts
|
|
6298
|
-
function
|
|
6298
|
+
function sn(e) {
|
|
6299
6299
|
return d(() => tn({ defaultTTL: e }), [e]);
|
|
6300
6300
|
}
|
|
6301
6301
|
//#endregion
|
|
6302
6302
|
//#region src/hooks/useMouseEnter.ts
|
|
6303
|
-
function
|
|
6303
|
+
function cn(e, t, { isEnabled: n = !0 } = {}) {
|
|
6304
6304
|
let r = Z(t);
|
|
6305
6305
|
u(() => {
|
|
6306
6306
|
if (!n) return;
|
|
@@ -6317,7 +6317,7 @@ function sn(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6317
6317
|
}
|
|
6318
6318
|
//#endregion
|
|
6319
6319
|
//#region src/hooks/useMouseLeave.ts
|
|
6320
|
-
function
|
|
6320
|
+
function ln(e, t, { isEnabled: n = !0 } = {}) {
|
|
6321
6321
|
let r = Z(t);
|
|
6322
6322
|
u(() => {
|
|
6323
6323
|
if (!n) return;
|
|
@@ -6334,7 +6334,7 @@ function cn(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6334
6334
|
}
|
|
6335
6335
|
//#endregion
|
|
6336
6336
|
//#region src/hooks/useOS.ts
|
|
6337
|
-
function
|
|
6337
|
+
function un() {
|
|
6338
6338
|
let e = navigator.userAgent || navigator.vendor || window.opera;
|
|
6339
6339
|
return d(() => {
|
|
6340
6340
|
switch (!0) {
|
|
@@ -6349,7 +6349,7 @@ function ln() {
|
|
|
6349
6349
|
}
|
|
6350
6350
|
//#endregion
|
|
6351
6351
|
//#region src/hooks/usePrevious.ts
|
|
6352
|
-
function
|
|
6352
|
+
function dn(e, t) {
|
|
6353
6353
|
let n = f(t);
|
|
6354
6354
|
return u(() => {
|
|
6355
6355
|
n.current = e;
|
|
@@ -6357,7 +6357,7 @@ function un(e, t) {
|
|
|
6357
6357
|
}
|
|
6358
6358
|
//#endregion
|
|
6359
6359
|
//#region src/hooks/useRightClick.ts
|
|
6360
|
-
function
|
|
6360
|
+
function fn(e, t, n = {}) {
|
|
6361
6361
|
let r = Z(typeof e == "function" ? e : typeof t == "function" ? t : () => {}), i = typeof e == "function" ? void 0 : e, { isEnabled: a = !0 } = typeof t == "function" ? n : t ?? {}, o = typeof e == "function";
|
|
6362
6362
|
l(() => {
|
|
6363
6363
|
if (a) if (o) {
|
|
@@ -6383,11 +6383,11 @@ function dn(e, t, n = {}) {
|
|
|
6383
6383
|
}
|
|
6384
6384
|
//#endregion
|
|
6385
6385
|
//#region src/hooks/useScrollPositionObserver.ts
|
|
6386
|
-
function
|
|
6386
|
+
function pn(...e) {
|
|
6387
6387
|
let t = typeof e[0] == "function" ? void 0 : e[0], n = typeof e[0] == "function" ? e[0] : e[1], r = typeof e[0] == "function" ? e[1] ?? [] : e[2] ?? [], i = Z(n), a = f(void 0), o = f(!1);
|
|
6388
6388
|
u(() => {
|
|
6389
|
-
let e =
|
|
6390
|
-
let t = e ?
|
|
6389
|
+
let e = mn(t), n = () => {
|
|
6390
|
+
let t = e ? gn(e) : hn();
|
|
6391
6391
|
t && (i.current(t, a.current), a.current = t);
|
|
6392
6392
|
}, r = () => {
|
|
6393
6393
|
o.current || typeof requestAnimationFrame == "function" && (o.current = !0, requestAnimationFrame(() => {
|
|
@@ -6399,10 +6399,10 @@ function fn(...e) {
|
|
|
6399
6399
|
};
|
|
6400
6400
|
}, [...r]);
|
|
6401
6401
|
}
|
|
6402
|
-
function
|
|
6402
|
+
function mn(e) {
|
|
6403
6403
|
if (e != null) return e instanceof HTMLElement ? e : e.current ?? void 0;
|
|
6404
6404
|
}
|
|
6405
|
-
function
|
|
6405
|
+
function hn() {
|
|
6406
6406
|
let e = window.scrollX, t = window.scrollY, n = document.documentElement.scrollWidth - window.innerWidth, r = document.documentElement.scrollHeight - window.innerHeight;
|
|
6407
6407
|
return {
|
|
6408
6408
|
current: K.make(e, t),
|
|
@@ -6411,7 +6411,7 @@ function mn() {
|
|
|
6411
6411
|
start: K.make(0, 0)
|
|
6412
6412
|
};
|
|
6413
6413
|
}
|
|
6414
|
-
function
|
|
6414
|
+
function gn(e) {
|
|
6415
6415
|
let t = e.scrollLeft, n = e.scrollTop, r = e.scrollWidth - e.clientWidth, i = e.scrollHeight - e.clientHeight;
|
|
6416
6416
|
return {
|
|
6417
6417
|
current: K.make(t, n),
|
|
@@ -6422,68 +6422,68 @@ function hn(e) {
|
|
|
6422
6422
|
}
|
|
6423
6423
|
//#endregion
|
|
6424
6424
|
//#region src/utils/createSessionCache.ts
|
|
6425
|
-
var
|
|
6426
|
-
function
|
|
6425
|
+
var _n = typeof window < "u" ? window.sessionStorage : void 0;
|
|
6426
|
+
function vn({ defaultTTL: e = 300 } = {}) {
|
|
6427
6427
|
return {
|
|
6428
|
-
get:
|
|
6429
|
-
invalidate:
|
|
6430
|
-
set: (t, n, r = e) =>
|
|
6428
|
+
get: xn,
|
|
6429
|
+
invalidate: yn,
|
|
6430
|
+
set: (t, n, r = e) => Sn(t, n, r)
|
|
6431
6431
|
};
|
|
6432
6432
|
}
|
|
6433
|
-
function vn(e) {
|
|
6434
|
-
gn?.removeItem(e);
|
|
6435
|
-
}
|
|
6436
6433
|
function yn(e) {
|
|
6434
|
+
_n?.removeItem(e);
|
|
6435
|
+
}
|
|
6436
|
+
function bn(e) {
|
|
6437
6437
|
let { timestamp: t, ttl: n } = e;
|
|
6438
6438
|
return (Date.now() - t) / 1e3 >= n;
|
|
6439
6439
|
}
|
|
6440
|
-
function
|
|
6441
|
-
let t =
|
|
6440
|
+
function xn(e) {
|
|
6441
|
+
let t = _n?.getItem(e);
|
|
6442
6442
|
if (!t) return;
|
|
6443
6443
|
let n = JSON.parse(t);
|
|
6444
|
-
if (n) if (
|
|
6445
|
-
|
|
6444
|
+
if (n) if (bn(n)) {
|
|
6445
|
+
yn(e);
|
|
6446
6446
|
return;
|
|
6447
6447
|
} else return n.value;
|
|
6448
6448
|
}
|
|
6449
|
-
function
|
|
6449
|
+
function Sn(e, t, n) {
|
|
6450
6450
|
let r = {
|
|
6451
6451
|
timestamp: Date.now(),
|
|
6452
6452
|
ttl: n,
|
|
6453
6453
|
value: e
|
|
6454
6454
|
};
|
|
6455
|
-
return
|
|
6455
|
+
return _n?.setItem(t, JSON.stringify(r)), e;
|
|
6456
6456
|
}
|
|
6457
6457
|
//#endregion
|
|
6458
6458
|
//#region src/hooks/useSessionCache.ts
|
|
6459
|
-
function
|
|
6460
|
-
return d(() =>
|
|
6459
|
+
function Cn(e) {
|
|
6460
|
+
return d(() => vn({ defaultTTL: e }), [e]);
|
|
6461
6461
|
}
|
|
6462
6462
|
//#endregion
|
|
6463
6463
|
//#region src/utils/getStyle.ts
|
|
6464
|
-
function
|
|
6464
|
+
function wn(e, { computed: t, target: n }) {
|
|
6465
6465
|
if (typeof window > "u") return;
|
|
6466
6466
|
let r = n ?? window.document.documentElement;
|
|
6467
6467
|
return t ? window.getComputedStyle(r).getPropertyValue(e) || void 0 : r.style.getPropertyValue(e) || void 0;
|
|
6468
6468
|
}
|
|
6469
6469
|
//#endregion
|
|
6470
6470
|
//#region src/utils/setStyle.ts
|
|
6471
|
-
function
|
|
6471
|
+
function Tn(e, t, { target: n } = {}) {
|
|
6472
6472
|
if (typeof window > "u") return;
|
|
6473
6473
|
let r = n ?? window.document.documentElement;
|
|
6474
6474
|
t === void 0 ? r.style.removeProperty(e) : r.style.setProperty(e, t);
|
|
6475
6475
|
}
|
|
6476
6476
|
//#endregion
|
|
6477
6477
|
//#region src/hooks/useStyle.ts
|
|
6478
|
-
function
|
|
6478
|
+
function En(e, t, { target: n, isEnabled: r = !0 } = {}) {
|
|
6479
6479
|
u(() => {
|
|
6480
6480
|
if (!r) return;
|
|
6481
|
-
let i = n ?? window.document.documentElement, a =
|
|
6481
|
+
let i = n ?? window.document.documentElement, a = wn(e, {
|
|
6482
6482
|
computed: !1,
|
|
6483
6483
|
target: i
|
|
6484
6484
|
});
|
|
6485
|
-
return
|
|
6486
|
-
|
|
6485
|
+
return Tn(e, t, { target: i }), () => {
|
|
6486
|
+
Tn(e, a, { target: i });
|
|
6487
6487
|
};
|
|
6488
6488
|
}, [
|
|
6489
6489
|
e,
|
|
@@ -6494,7 +6494,7 @@ function Tn(e, t, { target: n, isEnabled: r = !0 } = {}) {
|
|
|
6494
6494
|
}
|
|
6495
6495
|
//#endregion
|
|
6496
6496
|
//#region src/hooks/useSystemColorScheme.ts
|
|
6497
|
-
function
|
|
6497
|
+
function Dn(e = "light") {
|
|
6498
6498
|
let [t, n] = p(e);
|
|
6499
6499
|
return u(() => {
|
|
6500
6500
|
let e = window.matchMedia("(prefers-color-scheme: dark)");
|
|
@@ -6508,7 +6508,7 @@ function En(e = "light") {
|
|
|
6508
6508
|
}
|
|
6509
6509
|
//#endregion
|
|
6510
6510
|
//#region src/hooks/useTimeout.ts
|
|
6511
|
-
function
|
|
6511
|
+
function On(e, t, { isEnabled: n = !0, shouldAutoStart: r = !0 } = {}, i = []) {
|
|
6512
6512
|
let a = f(void 0), o = Z(t), s = c(() => {
|
|
6513
6513
|
a.current !== void 0 && (clearTimeout(a.current), a.current = void 0);
|
|
6514
6514
|
}, []), u = c(() => {
|
|
@@ -6534,7 +6534,7 @@ function Dn(e, t, { isEnabled: n = !0, shouldAutoStart: r = !0 } = {}, i = []) {
|
|
|
6534
6534
|
}
|
|
6535
6535
|
//#endregion
|
|
6536
6536
|
//#region src/primitives/Collection.tsx
|
|
6537
|
-
var
|
|
6537
|
+
var kn = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
6538
6538
|
t.exports = function e(t, n) {
|
|
6539
6539
|
if (t === n) return !0;
|
|
6540
6540
|
if (t && n && typeof t == "object" && typeof n == "object") {
|
|
@@ -6559,8 +6559,8 @@ var On = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
6559
6559
|
return t !== t && n !== n;
|
|
6560
6560
|
};
|
|
6561
6561
|
})))(), 1);
|
|
6562
|
-
function
|
|
6563
|
-
let x =
|
|
6562
|
+
function An({ className: e, ref: t, style: n, children: r, ItemComponent: i, itemLength: a, itemPadding: o = 0, items: s = [], layout: c = "list", numSegments: u = 1, orientation: d = "vertical", selection: f, selectionMode: p = "none", isSelectionTogglable: m = !1, onActivateAt: h, onCustomEvent: g, onDeselectAt: _, onSelectAt: v, onSelectionChange: y, ...b }) {
|
|
6563
|
+
let x = Mn(f ?? [], s), S = Pn({
|
|
6564
6564
|
itemLength: a,
|
|
6565
6565
|
itemPadding: o,
|
|
6566
6566
|
layout: c,
|
|
@@ -6573,20 +6573,23 @@ function kn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
|
|
|
6573
6573
|
let t;
|
|
6574
6574
|
switch (p) {
|
|
6575
6575
|
case "multiple":
|
|
6576
|
-
t = (t) =>
|
|
6576
|
+
t = (t) => Nn([...t.filter((t) => t !== e), e]);
|
|
6577
6577
|
break;
|
|
6578
6578
|
case "single":
|
|
6579
6579
|
t = (t) => [e];
|
|
6580
6580
|
break;
|
|
6581
6581
|
default: return;
|
|
6582
6582
|
}
|
|
6583
|
-
|
|
6583
|
+
let n = x, r = t(x);
|
|
6584
|
+
A(n, r);
|
|
6584
6585
|
}, D = (e) => {
|
|
6585
|
-
C(e)
|
|
6586
|
+
if (!C(e)) return;
|
|
6587
|
+
let t = (t) => t.filter((t) => t !== e), n = x, r = t(x);
|
|
6588
|
+
A(n, r);
|
|
6586
6589
|
}, k = (e) => {
|
|
6587
6590
|
h?.(e), p !== "none" && (m ? T(e) : E(e));
|
|
6588
6591
|
}, A = (e, t) => {
|
|
6589
|
-
if ((0,
|
|
6592
|
+
if ((0, kn.default)(e, t)) return;
|
|
6590
6593
|
let n = e?.filter((e) => t.indexOf(e) === -1) ?? [], r = t.filter((t) => e?.indexOf(t) === -1);
|
|
6591
6594
|
n.forEach((e) => _?.(e)), r.forEach((e) => v?.(e)), y?.(t);
|
|
6592
6595
|
};
|
|
@@ -6605,7 +6608,7 @@ function kn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
|
|
|
6605
6608
|
}
|
|
6606
6609
|
A(e, t);
|
|
6607
6610
|
}, [p]);
|
|
6608
|
-
let M = j(r, { item:
|
|
6611
|
+
let M = j(r, { item: An.Item });
|
|
6609
6612
|
return /* @__PURE__ */ (0, O.jsx)("div", {
|
|
6610
6613
|
...b,
|
|
6611
6614
|
className: w(e),
|
|
@@ -6635,7 +6638,7 @@ function kn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
|
|
|
6635
6638
|
className: w({ active: r }),
|
|
6636
6639
|
style: a,
|
|
6637
6640
|
"aria-selected": r,
|
|
6638
|
-
element: M.item ?? /* @__PURE__ */ (0, O.jsx)(
|
|
6641
|
+
element: M.item ?? /* @__PURE__ */ (0, O.jsx)(An.Item, {}),
|
|
6639
6642
|
role: n,
|
|
6640
6643
|
selectionMode: p,
|
|
6641
6644
|
onActivateAt: h,
|
|
@@ -6654,17 +6657,17 @@ function kn({ className: e, ref: t, style: n, children: r, ItemComponent: i, ite
|
|
|
6654
6657
|
...r,
|
|
6655
6658
|
children: e
|
|
6656
6659
|
});
|
|
6657
|
-
})(
|
|
6658
|
-
function
|
|
6660
|
+
})(An ||= {});
|
|
6661
|
+
function jn(e, t) {
|
|
6659
6662
|
return !!(isNaN(e) || e >= t.length || e < 0);
|
|
6660
6663
|
}
|
|
6661
|
-
function
|
|
6662
|
-
return
|
|
6664
|
+
function Mn(e, t) {
|
|
6665
|
+
return Nn(e).filter((e) => !jn(e, t));
|
|
6663
6666
|
}
|
|
6664
|
-
function
|
|
6667
|
+
function Nn(e) {
|
|
6665
6668
|
return e.sort((e, t) => e - t);
|
|
6666
6669
|
}
|
|
6667
|
-
function
|
|
6670
|
+
function Pn({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection", numSegments: r = 1, orientation: i = "vertical" }) {
|
|
6668
6671
|
return M({
|
|
6669
6672
|
item: {
|
|
6670
6673
|
counterIncrement: "item-counter",
|
|
@@ -6702,11 +6705,11 @@ function Nn({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection",
|
|
|
6702
6705
|
}
|
|
6703
6706
|
});
|
|
6704
6707
|
}
|
|
6705
|
-
process.env.NODE_ENV === "development" && (
|
|
6708
|
+
process.env.NODE_ENV === "development" && (An.displayName = "Collection", An.Item.displayName = "Collection.Item");
|
|
6706
6709
|
//#endregion
|
|
6707
6710
|
//#region src/primitives/Accordion.tsx
|
|
6708
|
-
function
|
|
6709
|
-
let C =
|
|
6711
|
+
function Fn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderComponent: i, ItemComponent: a, orientation: o = "vertical", sectionPadding: s = 0, sections: c, selection: l, selectionMode: u = "single", shouldAutoCollapse: d = !1, onActivateAt: p, onCollapseSectionAt: m, onDeselectAt: h, onExpandedSectionsChange: g, onExpandSectionAt: _, onHeaderCustomEvent: v, onItemCustomEvent: y, onSelectAt: b, onSelectionChange: x, ...S }) {
|
|
6712
|
+
let C = zn(l ?? {}, c), T = Rn(r ?? [], c), E = Vn({ orientation: o }), D = c.map(() => f(null)), k = D.map(yt), A = (e, t) => (C[t]?.indexOf(e) ?? -1) >= 0, M = (e) => T.indexOf(e) >= 0, N = (e) => {
|
|
6710
6713
|
let t;
|
|
6711
6714
|
t = M(e) ? (t) => t.filter((t) => t !== e) : d ? (t) => [e] : (t) => [...t.filter((t) => t !== e), e], R(T, t(T));
|
|
6712
6715
|
}, I = (e, t) => {
|
|
@@ -6716,7 +6719,7 @@ function Pn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCo
|
|
|
6716
6719
|
case "multiple":
|
|
6717
6720
|
n = (n) => ({
|
|
6718
6721
|
...n,
|
|
6719
|
-
[t]:
|
|
6722
|
+
[t]: Bn([...(n[t] ?? []).filter((t) => t !== e), e])
|
|
6720
6723
|
});
|
|
6721
6724
|
break;
|
|
6722
6725
|
case "single":
|
|
@@ -6724,18 +6727,21 @@ function Pn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCo
|
|
|
6724
6727
|
break;
|
|
6725
6728
|
default: return;
|
|
6726
6729
|
}
|
|
6727
|
-
|
|
6730
|
+
let r = n(C);
|
|
6731
|
+
z(C, r);
|
|
6728
6732
|
}, L = (e, t) => {
|
|
6729
|
-
A(e, t)
|
|
6733
|
+
if (!A(e, t)) return;
|
|
6734
|
+
let n = ((n) => ({
|
|
6730
6735
|
...n,
|
|
6731
6736
|
[t]: (n[t] ?? []).filter((t) => t !== e)
|
|
6732
|
-
}))(C)
|
|
6737
|
+
}))(C);
|
|
6738
|
+
z(C, n);
|
|
6733
6739
|
}, R = (e, t) => {
|
|
6734
|
-
if ((0,
|
|
6740
|
+
if ((0, kn.default)(e, t)) return;
|
|
6735
6741
|
let n = e?.filter((e) => t.indexOf(e) === -1) ?? [], r = t.filter((t) => e?.indexOf(t) === -1);
|
|
6736
6742
|
n.forEach((e) => m?.(e)), r.forEach((e) => _?.(e)), g?.(t);
|
|
6737
6743
|
}, z = (e, t) => {
|
|
6738
|
-
if ((0,
|
|
6744
|
+
if ((0, kn.default)(e, t)) return;
|
|
6739
6745
|
let n = c.length, r = [], i = [];
|
|
6740
6746
|
for (let a = 0; a < n; a++) {
|
|
6741
6747
|
let n = e?.[a] ?? [], o = t[a] ?? [], s = n.filter((e) => o.indexOf(e) === -1), c = o.filter((e) => n?.indexOf(e) === -1);
|
|
@@ -6743,11 +6749,11 @@ function Pn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCo
|
|
|
6743
6749
|
}
|
|
6744
6750
|
r.forEach((e) => h?.(e[0], e[1])), i.forEach((e) => b?.(e[0], e[1])), x?.(t);
|
|
6745
6751
|
}, B = j(n, {
|
|
6746
|
-
collapseIcon:
|
|
6747
|
-
expandIcon:
|
|
6748
|
-
header:
|
|
6749
|
-
item:
|
|
6750
|
-
section:
|
|
6752
|
+
collapseIcon: Fn.CollapseIcon,
|
|
6753
|
+
expandIcon: Fn.ExpandIcon,
|
|
6754
|
+
header: Fn.Header,
|
|
6755
|
+
item: Fn.Item,
|
|
6756
|
+
section: Fn.Section
|
|
6751
6757
|
});
|
|
6752
6758
|
return /* @__PURE__ */ (0, O.jsx)("div", {
|
|
6753
6759
|
ref: e,
|
|
@@ -6765,7 +6771,7 @@ function Pn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCo
|
|
|
6765
6771
|
marginLeft: t === 0 ? "0px" : `${s}px`,
|
|
6766
6772
|
...S.width > 0 ? { width: `${T}px` } : { visibility: "hidden" }
|
|
6767
6773
|
}),
|
|
6768
|
-
element: B.section ?? /* @__PURE__ */ (0, O.jsx)(
|
|
6774
|
+
element: B.section ?? /* @__PURE__ */ (0, O.jsx)(Fn.Section, {}),
|
|
6769
6775
|
children: [/* @__PURE__ */ (0, O.jsx)("div", {
|
|
6770
6776
|
ref: D[t],
|
|
6771
6777
|
style: F(E.headerContainer),
|
|
@@ -6789,7 +6795,7 @@ function Pn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCo
|
|
|
6789
6795
|
}),
|
|
6790
6796
|
style: F(E.header),
|
|
6791
6797
|
"aria-expanded": !x,
|
|
6792
|
-
element: B.header ?? /* @__PURE__ */ (0, O.jsx)(
|
|
6798
|
+
element: B.header ?? /* @__PURE__ */ (0, O.jsx)(Fn.Header, {}),
|
|
6793
6799
|
role: "button",
|
|
6794
6800
|
onClick: () => N(t),
|
|
6795
6801
|
children: [/* @__PURE__ */ (0, O.jsx)("span", { dangerouslySetInnerHTML: { __html: e.label } }), B.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
@@ -6814,7 +6820,7 @@ function Pn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCo
|
|
|
6814
6820
|
width: `${b}px`
|
|
6815
6821
|
}),
|
|
6816
6822
|
role: "region",
|
|
6817
|
-
children: /* @__PURE__ */ (0, O.jsx)(
|
|
6823
|
+
children: /* @__PURE__ */ (0, O.jsx)(An, {
|
|
6818
6824
|
className: w({
|
|
6819
6825
|
collapsed: x,
|
|
6820
6826
|
expanded: !x
|
|
@@ -6834,7 +6840,7 @@ function Pn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCo
|
|
|
6834
6840
|
onCustomEvent: (e, n, r) => y?.(e, t, n, r),
|
|
6835
6841
|
onDeselectAt: (e) => L(e, t),
|
|
6836
6842
|
onSelectAt: (e) => I(e, t),
|
|
6837
|
-
children: !a && (B.item ?? /* @__PURE__ */ (0, O.jsx)(
|
|
6843
|
+
children: !a && (B.item ?? /* @__PURE__ */ (0, O.jsx)(Fn.Item, {}))
|
|
6838
6844
|
})
|
|
6839
6845
|
})]
|
|
6840
6846
|
});
|
|
@@ -6855,30 +6861,30 @@ function Pn({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCo
|
|
|
6855
6861
|
}), e.Section = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("div", {
|
|
6856
6862
|
...t,
|
|
6857
6863
|
children: e
|
|
6858
|
-
}), e.Item =
|
|
6859
|
-
})(
|
|
6860
|
-
function
|
|
6864
|
+
}), e.Item = An.Item;
|
|
6865
|
+
})(Fn ||= {});
|
|
6866
|
+
function In(e, t) {
|
|
6861
6867
|
return e >= t.length || e < 0;
|
|
6862
6868
|
}
|
|
6863
|
-
function
|
|
6864
|
-
return !!(
|
|
6865
|
-
}
|
|
6866
|
-
function Ln(e, t) {
|
|
6867
|
-
return zn(e).filter((e) => !Fn(e, t));
|
|
6869
|
+
function Ln(e, t, n) {
|
|
6870
|
+
return !!(In(t, n) || e >= (n[t].items ?? []).length || e < 0);
|
|
6868
6871
|
}
|
|
6869
6872
|
function Rn(e, t) {
|
|
6873
|
+
return Bn(e).filter((e) => !In(e, t));
|
|
6874
|
+
}
|
|
6875
|
+
function zn(e, t) {
|
|
6870
6876
|
let n = {};
|
|
6871
6877
|
for (let r in t) {
|
|
6872
6878
|
if (!Object.hasOwn(t, r)) continue;
|
|
6873
|
-
let i =
|
|
6874
|
-
n[Number(r)] =
|
|
6879
|
+
let i = Bn([...e[r] ?? []]);
|
|
6880
|
+
n[Number(r)] = Bn(i).filter((e) => !Ln(e, Number(r), t));
|
|
6875
6881
|
}
|
|
6876
6882
|
return n;
|
|
6877
6883
|
}
|
|
6878
|
-
function
|
|
6884
|
+
function Bn(e) {
|
|
6879
6885
|
return e.sort((e, t) => e - t);
|
|
6880
6886
|
}
|
|
6881
|
-
function
|
|
6887
|
+
function Vn({ orientation: e = "vertical" }) {
|
|
6882
6888
|
return M({
|
|
6883
6889
|
collapseIcon: {
|
|
6884
6890
|
pointerEvents: "none",
|
|
@@ -6930,162 +6936,189 @@ function Bn({ orientation: e = "vertical" }) {
|
|
|
6930
6936
|
}
|
|
6931
6937
|
});
|
|
6932
6938
|
}
|
|
6933
|
-
process.env.NODE_ENV === "development" && (
|
|
6939
|
+
process.env.NODE_ENV === "development" && (Fn.displayName = "Accordion", Fn.Header.displayName = "Accordion.Header", Fn.ExpandIcon.displayName = "Accordion.ExpandIcon", Fn.CollapseIcon.displayName = "Accordion.CollapseIcon", Fn.Item.displayName = "Accordion.Item");
|
|
6934
6940
|
//#endregion
|
|
6935
6941
|
//#region src/primitives/Carousel.tsx
|
|
6936
|
-
var
|
|
6937
|
-
function
|
|
6938
|
-
let
|
|
6939
|
-
content:
|
|
6940
|
-
|
|
6941
|
-
viewport:
|
|
6942
|
-
}),
|
|
6943
|
-
le.current = {
|
|
6942
|
+
var Hn = .5, Un = .02, Wn = 1e3 / 60, Gn = 5, Kn = .7, qn = .5, Jn = .9, Yn = .08, Xn = 100, Zn = .4 * Wn;
|
|
6943
|
+
function Qn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1, index: a = 0, orientation: o = "horizontal", shouldTrackExposure: s = !1, onAutoAdvancePause: c, onAutoAdvanceResume: l, onIndexChange: u, ...d }) {
|
|
6944
|
+
let f = j(r, {
|
|
6945
|
+
content: Qn.Content,
|
|
6946
|
+
item: Qn.Item,
|
|
6947
|
+
viewport: Qn.Viewport
|
|
6948
|
+
}), p = t.toArray(f.content?.props.children), m = p.length, { clickHandler: h, contentRef: g, exposures: _, safeIndex: v, viewportRef: y, isDragging: b } = $n({
|
|
6944
6949
|
dragSpeed: i,
|
|
6945
|
-
|
|
6946
|
-
itemCount:
|
|
6947
|
-
|
|
6948
|
-
|
|
6949
|
-
|
|
6950
|
-
|
|
6951
|
-
|
|
6952
|
-
|
|
6953
|
-
|
|
6954
|
-
|
|
6955
|
-
|
|
6950
|
+
index: a,
|
|
6951
|
+
itemCount: m,
|
|
6952
|
+
orientation: o,
|
|
6953
|
+
shouldTrackExposure: s,
|
|
6954
|
+
onIndexChange: u
|
|
6955
|
+
});
|
|
6956
|
+
return er({
|
|
6957
|
+
index: v,
|
|
6958
|
+
interval: n,
|
|
6959
|
+
itemCount: m,
|
|
6960
|
+
isDragging: b,
|
|
6961
|
+
onIndexChange: u,
|
|
6962
|
+
onPause: c,
|
|
6963
|
+
onResume: l
|
|
6964
|
+
}), /* @__PURE__ */ (0, O.jsx)("div", {
|
|
6965
|
+
...d,
|
|
6966
|
+
ref: e,
|
|
6967
|
+
role: "region",
|
|
6968
|
+
onClick: h,
|
|
6969
|
+
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
6970
|
+
ref: y,
|
|
6971
|
+
style: F(lr.viewport, {
|
|
6972
|
+
cursor: b ? "grabbing" : "grab",
|
|
6973
|
+
touchAction: m > 1 ? o === "horizontal" ? "pan-y" : "pan-x" : "auto"
|
|
6974
|
+
}),
|
|
6975
|
+
element: f.viewport ?? /* @__PURE__ */ (0, O.jsx)(Qn.Viewport, {}),
|
|
6976
|
+
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
6977
|
+
ref: g,
|
|
6978
|
+
style: {
|
|
6979
|
+
...lr.content,
|
|
6980
|
+
flexDirection: o === "horizontal" ? "row" : "column"
|
|
6981
|
+
},
|
|
6982
|
+
element: f.content ?? /* @__PURE__ */ (0, O.jsx)(Qn.Content, {}),
|
|
6983
|
+
children: p.map((e, t) => {
|
|
6984
|
+
let n = e.key ?? t, r = _?.[t], i = t === v;
|
|
6985
|
+
return /* @__PURE__ */ (0, O.jsx)(Qn.ItemContext, {
|
|
6986
|
+
value: {
|
|
6987
|
+
exposure: r,
|
|
6988
|
+
index: t,
|
|
6989
|
+
isActive: i
|
|
6990
|
+
},
|
|
6991
|
+
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
6992
|
+
style: lr.itemContainer,
|
|
6993
|
+
"aria-hidden": !i,
|
|
6994
|
+
element: f.item ?? /* @__PURE__ */ (0, O.jsx)(Qn.Item, {}),
|
|
6995
|
+
children: e
|
|
6996
|
+
})
|
|
6997
|
+
}, n);
|
|
6998
|
+
})
|
|
6999
|
+
})
|
|
7000
|
+
})
|
|
7001
|
+
});
|
|
7002
|
+
}
|
|
7003
|
+
function $n({ dragSpeed: e, index: t, itemCount: n, orientation: r, shouldTrackExposure: i, onIndexChange: a }) {
|
|
7004
|
+
let o = f(null), s = f(null), c = f(0), d = f(0), m = f(0), h = f(0), g = f(cr(Xn)), _ = f({
|
|
7005
|
+
activeId: void 0,
|
|
7006
|
+
didDrag: !1,
|
|
7007
|
+
gesture: "idle",
|
|
7008
|
+
startAxial: 0,
|
|
7009
|
+
startPosition: K.zero,
|
|
7010
|
+
startTranslation: 0
|
|
7011
|
+
}), v = f(0), y = Z(a), [b, x] = p(), [S, C] = p(!1), { height: w, width: T } = yt(o), E = ar(T, w, r), D = sr(t, n), O = -E * Math.max(0, n - 1), k = f(void 0);
|
|
7012
|
+
k.current = {
|
|
7013
|
+
dragSpeed: e,
|
|
7014
|
+
itemCount: n,
|
|
7015
|
+
maxTranslation: 0,
|
|
7016
|
+
minTranslation: O,
|
|
7017
|
+
orientation: r,
|
|
7018
|
+
safeIndex: D,
|
|
7019
|
+
viewportLength: E,
|
|
7020
|
+
shouldTrackExposure: i
|
|
6956
7021
|
};
|
|
6957
|
-
let
|
|
6958
|
-
|
|
6959
|
-
},
|
|
6960
|
-
|
|
6961
|
-
|
|
6962
|
-
|
|
6963
|
-
|
|
6964
|
-
|
|
6965
|
-
|
|
6966
|
-
let t =
|
|
6967
|
-
|
|
6968
|
-
},
|
|
6969
|
-
|
|
6970
|
-
},
|
|
6971
|
-
|
|
6972
|
-
},
|
|
6973
|
-
|
|
6974
|
-
|
|
6975
|
-
|
|
7022
|
+
let A = (e) => {
|
|
7023
|
+
_.current.didDrag && (e.stopPropagation(), _.current.didDrag = !1);
|
|
7024
|
+
}, j = () => {
|
|
7025
|
+
let e = s.current;
|
|
7026
|
+
if (e) {
|
|
7027
|
+
let t = c.current;
|
|
7028
|
+
e.style.transform = k.current.orientation === "horizontal" ? `translate3d(${t}px,0,0)` : `translate3d(0,${t}px,0)`;
|
|
7029
|
+
}
|
|
7030
|
+
}, M = () => {
|
|
7031
|
+
let e = k.current, t = e.shouldTrackExposure ? nr(c.current, e.viewportLength, e.itemCount) : void 0;
|
|
7032
|
+
x((e) => tr(e, t) ? e : t);
|
|
7033
|
+
}, N = () => {
|
|
7034
|
+
j(), M();
|
|
7035
|
+
}, P = () => {
|
|
7036
|
+
h.current ||= requestAnimationFrame(I);
|
|
7037
|
+
}, F = () => {
|
|
7038
|
+
h.current &&= (cancelAnimationFrame(h.current), 0);
|
|
7039
|
+
}, I = () => {
|
|
7040
|
+
let e = k.current, t = m.current, n = (t - c.current) * Yn;
|
|
7041
|
+
if (d.current = d.current * qn + n, c.current += d.current, (c.current > e.maxTranslation || c.current < e.minTranslation) && (d.current *= Jn), Math.abs(d.current) < Un && Math.abs(t - c.current) < Hn) {
|
|
7042
|
+
c.current = t, d.current = 0, h.current = 0, N();
|
|
6976
7043
|
return;
|
|
6977
7044
|
}
|
|
6978
|
-
|
|
7045
|
+
N(), h.current = requestAnimationFrame(I);
|
|
6979
7046
|
};
|
|
6980
7047
|
return u(() => {
|
|
6981
|
-
let e =
|
|
7048
|
+
let e = o.current;
|
|
6982
7049
|
if (!e) return;
|
|
6983
7050
|
let t = (e) => {
|
|
6984
|
-
let
|
|
6985
|
-
if (!e.isPrimary || e.button !== 0 || t <= 1 ||
|
|
6986
|
-
|
|
6987
|
-
|
|
6988
|
-
D.current = S.current, k.current = r, A.current = e.clientX, M.current = e.clientY, E.current = [{
|
|
6989
|
-
p: r,
|
|
6990
|
-
t: performance.now()
|
|
6991
|
-
}], L.current = !1, N.current = "pending";
|
|
7051
|
+
let t = k.current;
|
|
7052
|
+
if (!e.isPrimary || e.button !== 0 || t.itemCount <= 1 || _.current.activeId !== void 0) return;
|
|
7053
|
+
let n = ar(e.clientX, e.clientY, t.orientation);
|
|
7054
|
+
_.current.activeId = e.pointerId, _.current.didDrag = !1, _.current.gesture = "pending", _.current.startAxial = n, _.current.startPosition = K.make(e.clientX, e.clientY), _.current.startTranslation = c.current, g.current.reset(n);
|
|
6992
7055
|
}, n = (t) => {
|
|
6993
|
-
if (
|
|
6994
|
-
let
|
|
6995
|
-
if (
|
|
6996
|
-
let
|
|
6997
|
-
if (
|
|
6998
|
-
if (
|
|
6999
|
-
|
|
7000
|
-
N.current = "cross";
|
|
7056
|
+
if (_.current.activeId !== t.pointerId || _.current.gesture === "idle" || _.current.gesture === "cross") return;
|
|
7057
|
+
let n = k.current, r = _.current, i = ar(t.clientX, t.clientY, n.orientation);
|
|
7058
|
+
if (r.gesture === "pending") {
|
|
7059
|
+
let a = Math.abs(t.clientX - r.startPosition.x), o = Math.abs(t.clientY - r.startPosition.y), s = ar(a, o, n.orientation), l = or(a, o, n.orientation), u = Math.max(s, l) >= Gn, f = l > s;
|
|
7060
|
+
if (!u) return;
|
|
7061
|
+
if (f) {
|
|
7062
|
+
r.gesture = "cross";
|
|
7001
7063
|
return;
|
|
7002
7064
|
}
|
|
7065
|
+
F(), d.current = 0, r.gesture = "axis", r.startTranslation = ir(c.current, n.minTranslation, n.maxTranslation, Kn), r.startAxial = i, e.setPointerCapture(t.pointerId), C(!0);
|
|
7003
7066
|
}
|
|
7004
|
-
let
|
|
7005
|
-
|
|
7006
|
-
let u = performance.now(), d = E.current;
|
|
7007
|
-
for (d.push({
|
|
7008
|
-
p: c,
|
|
7009
|
-
t: u
|
|
7010
|
-
}); d.length > 0 && u - d[0].t > Kn;) d.shift();
|
|
7067
|
+
let a = (i - r.startAxial) * n.dragSpeed, o = r.startTranslation + a;
|
|
7068
|
+
c.current = rr(o, n.minTranslation, n.maxTranslation, Kn), N(), Math.abs(a) >= Gn && (r.didDrag = !0), g.current.add(i);
|
|
7011
7069
|
}, r = (t) => {
|
|
7012
|
-
if (
|
|
7013
|
-
e.hasPointerCapture(t.pointerId) && e.releasePointerCapture(t.pointerId),
|
|
7014
|
-
let n =
|
|
7015
|
-
if (
|
|
7016
|
-
|
|
7070
|
+
if (_.current.activeId !== t.pointerId) return;
|
|
7071
|
+
e.hasPointerCapture(t.pointerId) && e.releasePointerCapture(t.pointerId), _.current.activeId = void 0;
|
|
7072
|
+
let n = _.current.gesture === "axis";
|
|
7073
|
+
if (_.current.gesture = "idle", !n) {
|
|
7074
|
+
g.current.clear();
|
|
7017
7075
|
return;
|
|
7018
7076
|
}
|
|
7019
|
-
let
|
|
7020
|
-
|
|
7021
|
-
|
|
7022
|
-
|
|
7023
|
-
}
|
|
7024
|
-
let f = Xn((l.length > 0 ? u - l[l.length - 1].t : Infinity) <= o && Math.abs(d) > s ? a + (d < 0 ? 1 : -1) : c > 0 ? Math.round(-S.current / c) : a, i);
|
|
7025
|
-
E.current = [], w.current = -c * f, C.current = d * r * qn, fe(), ee(!1), f !== a && V.current?.(f);
|
|
7077
|
+
let r = k.current, { sinceLast: i, velocity: a } = g.current.release(), o = sr(i <= Xn && Math.abs(a) > Zn ? r.safeIndex + (a < 0 ? 1 : -1) : r.viewportLength > 0 ? Math.round(-c.current / r.viewportLength) : r.safeIndex, r.itemCount);
|
|
7078
|
+
g.current.clear(), m.current = -r.viewportLength * o;
|
|
7079
|
+
let s = a * r.dragSpeed, l = m.current - c.current;
|
|
7080
|
+
d.current = Math.sign(s) === Math.sign(l) ? s : 0, P(), C(!1), o !== r.safeIndex && y.current?.(o);
|
|
7026
7081
|
}, i = (e) => {
|
|
7027
|
-
|
|
7082
|
+
e.preventDefault();
|
|
7083
|
+
}, a = (e) => {
|
|
7084
|
+
let t = _.current.gesture;
|
|
7028
7085
|
(t === "pending" || t === "axis") && e.cancelable && e.preventDefault();
|
|
7029
7086
|
};
|
|
7030
|
-
return e.addEventListener("pointerdown", t, { passive: !0 }), e.addEventListener("pointermove", n, { passive: !0 }), e.addEventListener("pointerup", r, { passive: !0 }), e.addEventListener("pointercancel", r, { passive: !0 }), e.addEventListener("touchmove",
|
|
7031
|
-
|
|
7087
|
+
return e.addEventListener("dragstart", i), e.addEventListener("pointerdown", t, { passive: !0 }), e.addEventListener("pointermove", n, { passive: !0 }), e.addEventListener("pointerup", r, { passive: !0 }), e.addEventListener("pointercancel", r, { passive: !0 }), e.addEventListener("touchmove", a, { passive: !1 }), () => {
|
|
7088
|
+
F(), e.removeEventListener("dragstart", i), e.removeEventListener("pointerdown", t), e.removeEventListener("pointermove", n), e.removeEventListener("pointerup", r), e.removeEventListener("pointercancel", r), e.removeEventListener("touchmove", a), _.current.activeId = void 0, _.current.gesture = "idle";
|
|
7032
7089
|
};
|
|
7033
7090
|
}, []), u(() => {
|
|
7034
|
-
if (
|
|
7035
|
-
let e = -
|
|
7036
|
-
|
|
7091
|
+
if (S || E <= 0) return;
|
|
7092
|
+
let e = -E * D, t = v.current !== E, n = c.current !== e, r = d.current !== 0;
|
|
7093
|
+
v.current = E, m.current = e, t ? (F(), c.current = e, d.current = 0, N()) : (n || r) && P();
|
|
7037
7094
|
}, [
|
|
7038
|
-
|
|
7039
|
-
|
|
7040
|
-
|
|
7041
|
-
|
|
7042
|
-
|
|
7095
|
+
D,
|
|
7096
|
+
E,
|
|
7097
|
+
S,
|
|
7098
|
+
r,
|
|
7099
|
+
i
|
|
7043
7100
|
]), l(() => {
|
|
7044
|
-
|
|
7101
|
+
M();
|
|
7045
7102
|
}, [
|
|
7046
|
-
|
|
7047
|
-
|
|
7048
|
-
|
|
7049
|
-
]),
|
|
7050
|
-
|
|
7051
|
-
|
|
7052
|
-
|
|
7053
|
-
|
|
7054
|
-
|
|
7055
|
-
|
|
7056
|
-
|
|
7057
|
-
|
|
7058
|
-
|
|
7059
|
-
|
|
7060
|
-
|
|
7061
|
-
|
|
7062
|
-
|
|
7063
|
-
|
|
7064
|
-
|
|
7065
|
-
style: {
|
|
7066
|
-
...er.content,
|
|
7067
|
-
flexDirection: s === "horizontal" ? "row" : "column"
|
|
7068
|
-
},
|
|
7069
|
-
element: G.content ?? /* @__PURE__ */ (0, O.jsx)(Jn.Content, {}),
|
|
7070
|
-
children: ne.map((e, t) => {
|
|
7071
|
-
let n = e.key ?? t, r = H?.[t], i = t === ie;
|
|
7072
|
-
return /* @__PURE__ */ (0, O.jsx)(Jn.ItemContext, {
|
|
7073
|
-
value: {
|
|
7074
|
-
exposure: r,
|
|
7075
|
-
index: t,
|
|
7076
|
-
isActive: i
|
|
7077
|
-
},
|
|
7078
|
-
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7079
|
-
style: F(er.itemContainer),
|
|
7080
|
-
"aria-hidden": !i,
|
|
7081
|
-
element: G.itemContainer ?? /* @__PURE__ */ (0, O.jsx)(Jn.ItemContainer, {}),
|
|
7082
|
-
children: e
|
|
7083
|
-
})
|
|
7084
|
-
}, n);
|
|
7085
|
-
})
|
|
7086
|
-
})
|
|
7087
|
-
})
|
|
7088
|
-
});
|
|
7103
|
+
E,
|
|
7104
|
+
n,
|
|
7105
|
+
i
|
|
7106
|
+
]), {
|
|
7107
|
+
clickHandler: A,
|
|
7108
|
+
contentRef: s,
|
|
7109
|
+
exposures: b,
|
|
7110
|
+
safeIndex: D,
|
|
7111
|
+
viewportRef: o,
|
|
7112
|
+
isDragging: S
|
|
7113
|
+
};
|
|
7114
|
+
}
|
|
7115
|
+
function er({ index: e, interval: t, itemCount: n, isDragging: r, onIndexChange: i, onPause: a, onResume: o }) {
|
|
7116
|
+
let s = Z(i), c = Z(a), u = Z(o), d = dn(r, r);
|
|
7117
|
+
l(() => {
|
|
7118
|
+
t <= 0 || d !== r && (r ? c.current?.() : u.current?.());
|
|
7119
|
+
}, [r, t]), Yt(t, () => {
|
|
7120
|
+
n <= 1 || s.current?.((e + 1) % n);
|
|
7121
|
+
}, { isEnabled: !r }, [e]);
|
|
7089
7122
|
}
|
|
7090
7123
|
(function(e) {
|
|
7091
7124
|
let t = e.ItemContext = a(void 0);
|
|
@@ -7095,7 +7128,7 @@ function Jn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
|
|
|
7095
7128
|
}), e.Content = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("div", {
|
|
7096
7129
|
...t,
|
|
7097
7130
|
children: e
|
|
7098
|
-
}), e.
|
|
7131
|
+
}), e.Item = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("div", {
|
|
7099
7132
|
...t,
|
|
7100
7133
|
children: e
|
|
7101
7134
|
});
|
|
@@ -7105,20 +7138,14 @@ function Jn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
|
|
|
7105
7138
|
return e;
|
|
7106
7139
|
}
|
|
7107
7140
|
e.useItem = n;
|
|
7108
|
-
})(
|
|
7109
|
-
function
|
|
7110
|
-
e && (n === "horizontal" ? e.style.transform = `translate3d(${t}px,0,0)` : e.style.transform = `translate3d(0,${t}px,0)`);
|
|
7111
|
-
}
|
|
7112
|
-
function Xn(e, t) {
|
|
7113
|
-
return t <= 0 ? 0 : Math.max(0, Math.min(t - 1, e));
|
|
7114
|
-
}
|
|
7115
|
-
function Zn(e, t) {
|
|
7141
|
+
})(Qn ||= {});
|
|
7142
|
+
function tr(e, t) {
|
|
7116
7143
|
if (e === t) return !0;
|
|
7117
7144
|
if (!e || !t || e.length !== t.length) return !1;
|
|
7118
7145
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
7119
7146
|
return !0;
|
|
7120
7147
|
}
|
|
7121
|
-
function
|
|
7148
|
+
function nr(e, t, n) {
|
|
7122
7149
|
if (n <= 0) return [];
|
|
7123
7150
|
if (t <= 0) return Array(n).fill(0);
|
|
7124
7151
|
let r = [];
|
|
@@ -7128,11 +7155,56 @@ function Qn(e, t, n) {
|
|
|
7128
7155
|
}
|
|
7129
7156
|
return r;
|
|
7130
7157
|
}
|
|
7131
|
-
function
|
|
7158
|
+
function rr(e, t, n, r) {
|
|
7132
7159
|
let i = 1 - r;
|
|
7133
7160
|
return e > n ? n + (e - n) * i : e < t ? t + (e - t) * i : e;
|
|
7134
7161
|
}
|
|
7135
|
-
|
|
7162
|
+
function ir(e, t, n, r) {
|
|
7163
|
+
let i = 1 - r;
|
|
7164
|
+
return i <= 0 ? e : e > n ? n + (e - n) / i : e < t ? t + (e - t) / i : e;
|
|
7165
|
+
}
|
|
7166
|
+
function ar(e, t, n) {
|
|
7167
|
+
return n === "horizontal" ? e : t;
|
|
7168
|
+
}
|
|
7169
|
+
function or(e, t, n) {
|
|
7170
|
+
return n === "horizontal" ? t : e;
|
|
7171
|
+
}
|
|
7172
|
+
function sr(e, t) {
|
|
7173
|
+
return t <= 0 ? 0 : Math.max(0, Math.min(t - 1, e));
|
|
7174
|
+
}
|
|
7175
|
+
function cr(e) {
|
|
7176
|
+
let t = [];
|
|
7177
|
+
return {
|
|
7178
|
+
add: (n) => {
|
|
7179
|
+
let r = performance.now();
|
|
7180
|
+
for (t.push({
|
|
7181
|
+
p: n,
|
|
7182
|
+
t: r
|
|
7183
|
+
}); t.length > 0 && r - t[0].t > e;) t.shift();
|
|
7184
|
+
},
|
|
7185
|
+
clear: () => {
|
|
7186
|
+
t = [];
|
|
7187
|
+
},
|
|
7188
|
+
release: () => {
|
|
7189
|
+
let e = performance.now(), n = 0;
|
|
7190
|
+
if (t.length >= 2) {
|
|
7191
|
+
let e = t[0], r = t[t.length - 1], i = r.t - e.t;
|
|
7192
|
+
i > 0 && (n = (r.p - e.p) / i * Wn);
|
|
7193
|
+
}
|
|
7194
|
+
return {
|
|
7195
|
+
sinceLast: t.length > 0 ? e - t[t.length - 1].t : Infinity,
|
|
7196
|
+
velocity: n
|
|
7197
|
+
};
|
|
7198
|
+
},
|
|
7199
|
+
reset: (e) => {
|
|
7200
|
+
t = [{
|
|
7201
|
+
p: e,
|
|
7202
|
+
t: performance.now()
|
|
7203
|
+
}];
|
|
7204
|
+
}
|
|
7205
|
+
};
|
|
7206
|
+
}
|
|
7207
|
+
var lr = M({
|
|
7136
7208
|
content: {
|
|
7137
7209
|
alignItems: "center",
|
|
7138
7210
|
display: "flex",
|
|
@@ -7157,15 +7229,17 @@ var er = M({
|
|
|
7157
7229
|
width: "100%"
|
|
7158
7230
|
}
|
|
7159
7231
|
});
|
|
7160
|
-
process.env.NODE_ENV === "development" && (
|
|
7232
|
+
process.env.NODE_ENV === "development" && (Qn.displayName = "Carousel", Qn.Viewport.displayName = "Carousel.Viewport", Qn.Content.displayName = "Carousel.Content", Qn.Item.displayName = "Carousel.Item");
|
|
7161
7233
|
//#endregion
|
|
7162
7234
|
//#region src/primitives/CodeInput.tsx
|
|
7163
|
-
function
|
|
7164
|
-
let h =
|
|
7235
|
+
function ur({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r = !1, children: i, inputMode: a = "numeric", placeholder: o, size: s, value: c, isDisabled: u = !1, isRequired: d = !0, onChange: p, ...m }) {
|
|
7236
|
+
let h = fr(c, s), g = f([]), _ = dr(), v = j(i, { field: ur.Field }), y = (e) => {
|
|
7165
7237
|
e < 0 ? g.current[0]?.focus() : e >= s ? g.current[s - 1]?.focus() : g.current[e]?.focus();
|
|
7166
7238
|
}, b = (e) => (t) => {
|
|
7167
|
-
let n = h[e], r =
|
|
7168
|
-
p(
|
|
7239
|
+
let n = h[e], r = mr(t.target.value, n);
|
|
7240
|
+
p(pr(h.slice(), r.split("").slice(0, s), e));
|
|
7241
|
+
let i = Math.min(e + r.length, s - 1);
|
|
7242
|
+
y(i);
|
|
7169
7243
|
}, x = (e) => (t) => {
|
|
7170
7244
|
switch (t.key) {
|
|
7171
7245
|
case "ArrowLeft":
|
|
@@ -7185,7 +7259,9 @@ function tr({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
|
|
|
7185
7259
|
}, S = (e) => (t) => {
|
|
7186
7260
|
t.preventDefault();
|
|
7187
7261
|
let n = t.clipboardData.getData("text").trim();
|
|
7188
|
-
p(
|
|
7262
|
+
p(pr(h.slice(), n.split("").slice(0, s), e));
|
|
7263
|
+
let r = Math.min(e + n.length, s - 1);
|
|
7264
|
+
y(r);
|
|
7189
7265
|
};
|
|
7190
7266
|
return l(() => {
|
|
7191
7267
|
if (!r) return;
|
|
@@ -7204,7 +7280,7 @@ function tr({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
|
|
|
7204
7280
|
"aria-required": d,
|
|
7205
7281
|
autoComplete: n,
|
|
7206
7282
|
disabled: u,
|
|
7207
|
-
element: v.field ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7283
|
+
element: v.field ?? /* @__PURE__ */ (0, O.jsx)(ur.Field, {}),
|
|
7208
7284
|
inputMode: a,
|
|
7209
7285
|
placeholder: o,
|
|
7210
7286
|
required: d,
|
|
@@ -7223,8 +7299,8 @@ function tr({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
|
|
|
7223
7299
|
autoCorrect: "off",
|
|
7224
7300
|
type: "text"
|
|
7225
7301
|
});
|
|
7226
|
-
})(
|
|
7227
|
-
function
|
|
7302
|
+
})(ur ||= {});
|
|
7303
|
+
function dr() {
|
|
7228
7304
|
return M({
|
|
7229
7305
|
field: {
|
|
7230
7306
|
caretColor: "transparent",
|
|
@@ -7238,49 +7314,58 @@ function nr() {
|
|
|
7238
7314
|
}
|
|
7239
7315
|
});
|
|
7240
7316
|
}
|
|
7241
|
-
function
|
|
7317
|
+
function fr(e, t) {
|
|
7242
7318
|
let n = e.slice(0, t);
|
|
7243
7319
|
for (; n.length < t;) n.push("");
|
|
7244
7320
|
return n;
|
|
7245
7321
|
}
|
|
7246
|
-
function
|
|
7322
|
+
function pr(e, t, n = 0) {
|
|
7247
7323
|
let r = n, i = 0;
|
|
7248
7324
|
for (; i < t.length && r < e.length;) e[r] = t[i], r++, i++;
|
|
7249
7325
|
for (; i < t.length;) e.shift(), e.push(t[i]), i++;
|
|
7250
7326
|
return e;
|
|
7251
7327
|
}
|
|
7252
|
-
function
|
|
7328
|
+
function mr(e, t) {
|
|
7253
7329
|
return t === "" ? e : e.startsWith(t) ? e.slice(t.length) : e.endsWith(t) ? e.slice(0, -t.length) : e;
|
|
7254
7330
|
}
|
|
7255
|
-
process.env.NODE_ENV === "development" && (
|
|
7331
|
+
process.env.NODE_ENV === "development" && (ur.displayName = "CodeInput", ur.Field.displayName = "CodeInput.Field");
|
|
7256
7332
|
//#endregion
|
|
7257
7333
|
//#region src/primitives/TextField.tsx
|
|
7258
|
-
function
|
|
7259
|
-
let
|
|
7260
|
-
let t = (
|
|
7261
|
-
|
|
7262
|
-
}, [
|
|
7263
|
-
return
|
|
7264
|
-
|
|
7334
|
+
function hr({ className: e, ref: t, autoFocus: n = !1, emptyValue: r = "", placeholder: i, type: a = "text", value: o, isDisabled: s = !1, isRequired: u = !1, formatValue: d, onChange: p, onFocus: m, onUnfocus: h, ...g }) {
|
|
7335
|
+
let _ = t ?? f(null), v = c((e) => {
|
|
7336
|
+
let t = (d?.(e) ?? e) || r;
|
|
7337
|
+
p?.(t);
|
|
7338
|
+
}, [p, d]);
|
|
7339
|
+
return l(() => {
|
|
7340
|
+
if (!n) return;
|
|
7341
|
+
let e = _.current;
|
|
7342
|
+
if (!e) return;
|
|
7343
|
+
let t = setTimeout(() => {
|
|
7344
|
+
let t = e.value.length;
|
|
7345
|
+
e.focus({ preventScroll: !0 }), e.setSelectionRange(t, t);
|
|
7346
|
+
}, 0);
|
|
7347
|
+
return () => clearTimeout(t);
|
|
7348
|
+
}, [n]), /* @__PURE__ */ (0, O.jsx)("input", {
|
|
7349
|
+
...g,
|
|
7265
7350
|
...s ? { "aria-disabled": !0 } : {},
|
|
7266
7351
|
className: w(e, { disabled: s }),
|
|
7267
|
-
ref:
|
|
7352
|
+
ref: _,
|
|
7268
7353
|
"aria-placeholder": i,
|
|
7269
|
-
"aria-required":
|
|
7354
|
+
"aria-required": u,
|
|
7270
7355
|
disabled: s,
|
|
7271
7356
|
placeholder: i,
|
|
7272
|
-
required:
|
|
7357
|
+
required: u,
|
|
7273
7358
|
type: a,
|
|
7274
|
-
value: o ||
|
|
7275
|
-
onBlur: ({ target: e }) =>
|
|
7276
|
-
onChange: ({ target: e }) =>
|
|
7277
|
-
onFocus: ({ target: e }) =>
|
|
7359
|
+
value: o || r,
|
|
7360
|
+
onBlur: ({ target: e }) => h?.(e.value),
|
|
7361
|
+
onChange: ({ target: e }) => v(e.value),
|
|
7362
|
+
onFocus: ({ target: e }) => m?.(e.value)
|
|
7278
7363
|
});
|
|
7279
7364
|
}
|
|
7280
|
-
process.env.NODE_ENV === "development" && (
|
|
7365
|
+
process.env.NODE_ENV === "development" && (hr.displayName = "TextField");
|
|
7281
7366
|
//#endregion
|
|
7282
7367
|
//#region src/primitives/Counter.tsx
|
|
7283
|
-
function
|
|
7368
|
+
function gr({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN, min: a = NaN, quantity: o = 0, onChange: s, ...c }) {
|
|
7284
7369
|
let u = () => {
|
|
7285
7370
|
s?.(_(o - 1));
|
|
7286
7371
|
}, d = () => {
|
|
@@ -7296,33 +7381,35 @@ function sr({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN,
|
|
|
7296
7381
|
}, _ = (e) => {
|
|
7297
7382
|
let t = e;
|
|
7298
7383
|
return isNaN(a) || (t = Math.max(a, t)), isNaN(i) || (t = Math.min(i, t)), t;
|
|
7299
|
-
}, [v, y] = p(h(o)), b =
|
|
7384
|
+
}, [v, y] = p(h(o)), b = dn(o), x = !isNaN(i) && o + 1 > i, S = !isNaN(a) && o - 1 < a;
|
|
7300
7385
|
l(() => {
|
|
7301
|
-
b === void 0 || b === o
|
|
7386
|
+
if (b === void 0 || b === o) return;
|
|
7387
|
+
let e = _(o);
|
|
7388
|
+
y(h(e));
|
|
7302
7389
|
}, [
|
|
7303
7390
|
o,
|
|
7304
7391
|
a,
|
|
7305
7392
|
i
|
|
7306
7393
|
]);
|
|
7307
7394
|
let C = j(r, {
|
|
7308
|
-
addButton:
|
|
7309
|
-
subscribeButton:
|
|
7310
|
-
textField:
|
|
7395
|
+
addButton: gr.AddButton,
|
|
7396
|
+
subscribeButton: gr.SubtractButton,
|
|
7397
|
+
textField: gr.TextField
|
|
7311
7398
|
});
|
|
7312
7399
|
return /* @__PURE__ */ (0, O.jsxs)("div", {
|
|
7313
7400
|
...c,
|
|
7314
7401
|
ref: e,
|
|
7315
|
-
style: F(t,
|
|
7402
|
+
style: F(t, _r.root),
|
|
7316
7403
|
children: [
|
|
7317
7404
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7318
7405
|
className: w({ disabled: S }),
|
|
7319
|
-
style: F(
|
|
7320
|
-
element: C.subscribeButton ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7406
|
+
style: F(_r.subtract),
|
|
7407
|
+
element: C.subscribeButton ?? /* @__PURE__ */ (0, O.jsx)(gr.SubtractButton, {}),
|
|
7321
7408
|
onClick: () => u()
|
|
7322
7409
|
}),
|
|
7323
7410
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7324
|
-
style: F(
|
|
7325
|
-
element: C.textField ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7411
|
+
style: F(_r.textField),
|
|
7412
|
+
element: C.textField ?? /* @__PURE__ */ (0, O.jsx)(gr.TextField, {}),
|
|
7326
7413
|
value: v,
|
|
7327
7414
|
isDisabled: !n,
|
|
7328
7415
|
onChange: f,
|
|
@@ -7330,23 +7417,23 @@ function sr({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN,
|
|
|
7330
7417
|
}),
|
|
7331
7418
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7332
7419
|
className: w({ disabled: x }),
|
|
7333
|
-
style: F(
|
|
7334
|
-
element: C.addButton ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7420
|
+
style: F(_r.add),
|
|
7421
|
+
element: C.addButton ?? /* @__PURE__ */ (0, O.jsx)(gr.AddButton, {}),
|
|
7335
7422
|
onClick: () => d()
|
|
7336
7423
|
})
|
|
7337
7424
|
]
|
|
7338
7425
|
});
|
|
7339
7426
|
}
|
|
7340
7427
|
(function(e) {
|
|
7341
|
-
e.TextField = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)(
|
|
7428
|
+
e.TextField = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)(hr, { ...e }), e.AddButton = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
|
|
7342
7429
|
...t,
|
|
7343
7430
|
children: e
|
|
7344
7431
|
}), e.SubtractButton = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
|
|
7345
7432
|
...t,
|
|
7346
7433
|
children: e
|
|
7347
7434
|
});
|
|
7348
|
-
})(
|
|
7349
|
-
var
|
|
7435
|
+
})(gr ||= {});
|
|
7436
|
+
var _r = M({
|
|
7350
7437
|
add: { flex: "0 0 auto" },
|
|
7351
7438
|
root: {
|
|
7352
7439
|
alignItems: "stretch",
|
|
@@ -7357,14 +7444,14 @@ var cr = M({
|
|
|
7357
7444
|
subtract: { flex: "0 0 auto" },
|
|
7358
7445
|
textField: { width: "100%" }
|
|
7359
7446
|
});
|
|
7360
|
-
process.env.NODE_ENV === "development" && (
|
|
7447
|
+
process.env.NODE_ENV === "development" && (gr.displayName = "Counter", gr.AddButton.displayName = "Counter.AddButton", gr.SubtractButton.displayName = "Counter.SubtractButton", gr.TextField.displayName = "Counter.TextField");
|
|
7361
7448
|
//#endregion
|
|
7362
7449
|
//#region src/primitives/Dial.tsx
|
|
7363
|
-
function
|
|
7450
|
+
function vr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, knobThickness: a = 10, radius: o = 50, trackGap: s = 0, trackThickness: c = 2, ...l }) {
|
|
7364
7451
|
let u = o * 2, d = Math.max(0, Math.min(360, i)), f = j(r, {
|
|
7365
|
-
knob:
|
|
7366
|
-
track:
|
|
7367
|
-
}), p =
|
|
7452
|
+
knob: vr.Knob,
|
|
7453
|
+
track: vr.Track
|
|
7454
|
+
}), p = xr({
|
|
7368
7455
|
angle: n,
|
|
7369
7456
|
diameter: u
|
|
7370
7457
|
});
|
|
@@ -7382,7 +7469,7 @@ function lr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
|
|
|
7382
7469
|
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7383
7470
|
cx: o,
|
|
7384
7471
|
cy: o,
|
|
7385
|
-
element: f.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7472
|
+
element: f.track ?? /* @__PURE__ */ (0, O.jsx)(vr.Track, {}),
|
|
7386
7473
|
fill: "none",
|
|
7387
7474
|
r: o - c / 2,
|
|
7388
7475
|
strokeDasharray: s,
|
|
@@ -7396,8 +7483,8 @@ function lr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
|
|
|
7396
7483
|
viewBox: `0 0 ${u} ${u}`,
|
|
7397
7484
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7398
7485
|
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7399
|
-
d:
|
|
7400
|
-
element: f.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7486
|
+
d: br(o, o, o - a / 2 - (c - a) / 2, -d / 2, d / 2),
|
|
7487
|
+
element: f.knob ?? /* @__PURE__ */ (0, O.jsx)(vr.Knob, {}),
|
|
7401
7488
|
fill: "none",
|
|
7402
7489
|
strokeWidth: a
|
|
7403
7490
|
})
|
|
@@ -7407,16 +7494,16 @@ function lr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
|
|
|
7407
7494
|
}
|
|
7408
7495
|
(function(e) {
|
|
7409
7496
|
e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("circle", { ...e }), e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("path", { ...e });
|
|
7410
|
-
})(
|
|
7411
|
-
function
|
|
7497
|
+
})(vr ||= {});
|
|
7498
|
+
function yr(e, t, n, r) {
|
|
7412
7499
|
let i = (r - 90) * Math.PI / 180;
|
|
7413
7500
|
return {
|
|
7414
7501
|
x: e + n * Math.cos(i),
|
|
7415
7502
|
y: t + n * Math.sin(i)
|
|
7416
7503
|
};
|
|
7417
7504
|
}
|
|
7418
|
-
function
|
|
7419
|
-
let a =
|
|
7505
|
+
function br(e, t, n, r, i) {
|
|
7506
|
+
let a = yr(e, t, n, i), o = yr(e, t, n, r), s = i - r <= 180 ? "0" : "1";
|
|
7420
7507
|
return [
|
|
7421
7508
|
"M",
|
|
7422
7509
|
a.x,
|
|
@@ -7431,7 +7518,7 @@ function dr(e, t, n, r, i) {
|
|
|
7431
7518
|
o.y
|
|
7432
7519
|
].join(" ");
|
|
7433
7520
|
}
|
|
7434
|
-
function
|
|
7521
|
+
function xr({ angle: e = 0, diameter: t = 0 }) {
|
|
7435
7522
|
return M({
|
|
7436
7523
|
knobContainer: {
|
|
7437
7524
|
backgroundPosition: "center",
|
|
@@ -7465,11 +7552,11 @@ function fr({ angle: e = 0, diameter: t = 0 }) {
|
|
|
7465
7552
|
}
|
|
7466
7553
|
});
|
|
7467
7554
|
}
|
|
7468
|
-
process.env.NODE_ENV === "development" && (
|
|
7555
|
+
process.env.NODE_ENV === "development" && (vr.displayName = "Dial", vr.Track.displayName = "Dial.Track", vr.Knob.displayName = "Dial.Knob");
|
|
7469
7556
|
//#endregion
|
|
7470
7557
|
//#region src/primitives/Dropdown.tsx
|
|
7471
|
-
function
|
|
7472
|
-
let L = f(null), R = Ze(L), z = c.length, B =
|
|
7558
|
+
function Sr({ className: e, ref: t, style: n, children: r, collectionPadding: i = 0, ItemComponent: a, itemLength: o, itemPadding: s = 0, items: c = [], label: u, layout: d = "list", maxVisibleItems: m = -1, numSegments: h = 1, orientation: g = "vertical", selection: _ = [], selectionMode: v = "single", ToggleComponent: y, isCollapsed: b, isInverted: x = !1, isSelectionTogglable: S = !1, shouldCollapseOnSelect: C = !0, onActivateAt: T, onCollapse: E, onDeselectAt: D, onExpand: k, onSelectAt: A, onSelectionChange: M, onToggleCustomEvent: N, ...I }) {
|
|
7559
|
+
let L = f(null), R = Ze(L), z = c.length, B = Er(c, m, h, d), V = o ?? (g === "vertical" ? R.height : R.width), H = V * B + s * (B - 1), U = wr(_, c), [W, ee] = p(b ?? !0), te = Dr({
|
|
7473
7560
|
collectionPadding: i,
|
|
7474
7561
|
maxVisibleItems: m,
|
|
7475
7562
|
menuLength: H,
|
|
@@ -7478,11 +7565,11 @@ function pr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7478
7565
|
isCollapsed: W,
|
|
7479
7566
|
isInverted: x
|
|
7480
7567
|
}), G = j(r, {
|
|
7481
|
-
collapseIcon:
|
|
7482
|
-
collection:
|
|
7483
|
-
expandIcon:
|
|
7484
|
-
item:
|
|
7485
|
-
toggle:
|
|
7568
|
+
collapseIcon: Sr.CollapseIcon,
|
|
7569
|
+
collection: Sr.Collection,
|
|
7570
|
+
expandIcon: Sr.ExpandIcon,
|
|
7571
|
+
item: Sr.Item,
|
|
7572
|
+
toggle: Sr.Toggle
|
|
7486
7573
|
}), ne = () => {
|
|
7487
7574
|
W && (ee(!1), k?.());
|
|
7488
7575
|
}, re = () => {
|
|
@@ -7540,7 +7627,7 @@ function pr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7540
7627
|
style: F(te.toggle),
|
|
7541
7628
|
"aria-expanded": !W,
|
|
7542
7629
|
"aria-haspopup": "listbox",
|
|
7543
|
-
element: G.toggle ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7630
|
+
element: G.toggle ?? /* @__PURE__ */ (0, O.jsx)(Sr.Toggle, {}),
|
|
7544
7631
|
onClick: ie,
|
|
7545
7632
|
children: [/* @__PURE__ */ (0, O.jsx)("span", { dangerouslySetInnerHTML: { __html: u?.(U) ?? (U.length > 0 ? U.map((e) => c[e]).join(", ") : "") } }), G.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7546
7633
|
className: w({
|
|
@@ -7552,7 +7639,7 @@ function pr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7552
7639
|
})]
|
|
7553
7640
|
}), /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7554
7641
|
style: F(te.collection),
|
|
7555
|
-
element: G.collection ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7642
|
+
element: G.collection ?? /* @__PURE__ */ (0, O.jsx)(Sr.Collection, {}),
|
|
7556
7643
|
ItemComponent: a,
|
|
7557
7644
|
itemLength: V,
|
|
7558
7645
|
itemPadding: s,
|
|
@@ -7567,13 +7654,13 @@ function pr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7567
7654
|
onDeselectAt: D,
|
|
7568
7655
|
onSelectAt: ae,
|
|
7569
7656
|
onSelectionChange: M,
|
|
7570
|
-
children: !a && (G.item ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7657
|
+
children: !a && (G.item ?? /* @__PURE__ */ (0, O.jsx)(Sr.Item, {}))
|
|
7571
7658
|
}, g)]
|
|
7572
7659
|
})
|
|
7573
7660
|
});
|
|
7574
7661
|
}
|
|
7575
7662
|
(function(e) {
|
|
7576
|
-
e.Collection =
|
|
7663
|
+
e.Collection = An, e.CollapseIcon = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("figure", {
|
|
7577
7664
|
...t,
|
|
7578
7665
|
"aria-hidden": !0,
|
|
7579
7666
|
children: e
|
|
@@ -7581,21 +7668,21 @@ function pr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7581
7668
|
...t,
|
|
7582
7669
|
"aria-hidden": !0,
|
|
7583
7670
|
children: e
|
|
7584
|
-
}), e.Item =
|
|
7671
|
+
}), e.Item = An.Item, e.Toggle = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
|
|
7585
7672
|
...t,
|
|
7586
7673
|
children: e
|
|
7587
7674
|
});
|
|
7588
|
-
})(
|
|
7589
|
-
function
|
|
7675
|
+
})(Sr ||= {});
|
|
7676
|
+
function Cr(e, t) {
|
|
7590
7677
|
return !!(isNaN(e) || e >= t.length || e < 0);
|
|
7591
7678
|
}
|
|
7592
|
-
function
|
|
7593
|
-
return
|
|
7679
|
+
function wr(e, t) {
|
|
7680
|
+
return Tr(e).filter((e) => !Cr(e, t));
|
|
7594
7681
|
}
|
|
7595
|
-
function
|
|
7682
|
+
function Tr(e) {
|
|
7596
7683
|
return e.sort((e, t) => e - t);
|
|
7597
7684
|
}
|
|
7598
|
-
function
|
|
7685
|
+
function Er(e, t, n, r) {
|
|
7599
7686
|
let i = e.length;
|
|
7600
7687
|
switch (r) {
|
|
7601
7688
|
case "grid": {
|
|
@@ -7605,7 +7692,7 @@ function _r(e, t, n, r) {
|
|
|
7605
7692
|
default: return t < 0 ? i : Math.min(i, t);
|
|
7606
7693
|
}
|
|
7607
7694
|
}
|
|
7608
|
-
function
|
|
7695
|
+
function Dr({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n = NaN, numItems: r = 0, orientation: i = "vertical", isCollapsed: a = !0, isInverted: o = !1 }) {
|
|
7609
7696
|
return M({
|
|
7610
7697
|
body: {
|
|
7611
7698
|
height: "100%",
|
|
@@ -7664,10 +7751,10 @@ function vr({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n =
|
|
|
7664
7751
|
}
|
|
7665
7752
|
});
|
|
7666
7753
|
}
|
|
7667
|
-
process.env.NODE_ENV === "development" && (
|
|
7754
|
+
process.env.NODE_ENV === "development" && (Sr.displayName = "Dropdown", Sr.Collection.displayName = "Dropdown.Collection", Sr.CollapseIcon.displayName = "Dropdown.CollapseIcon", Sr.ExpandIcon.displayName = "Dropdown.ExpandIcon", Sr.Item.displayName = "Dropdown.Item", Sr.Toggle.displayName = "Dropdown.Toggle");
|
|
7668
7755
|
//#endregion
|
|
7669
7756
|
//#region src/primitives/Form.tsx
|
|
7670
|
-
function
|
|
7757
|
+
function Or({ ref: e, onSubmit: t, ...n }) {
|
|
7671
7758
|
return /* @__PURE__ */ (0, O.jsx)("form", {
|
|
7672
7759
|
...n,
|
|
7673
7760
|
ref: e,
|
|
@@ -7676,11 +7763,11 @@ function yr({ ref: e, onSubmit: t, ...n }) {
|
|
|
7676
7763
|
}
|
|
7677
7764
|
});
|
|
7678
7765
|
}
|
|
7679
|
-
process.env.NODE_ENV !== "production" && (
|
|
7766
|
+
process.env.NODE_ENV !== "production" && (Or.displayName = "Form");
|
|
7680
7767
|
//#endregion
|
|
7681
7768
|
//#region src/primitives/MasonryGrid.tsx
|
|
7682
|
-
var
|
|
7683
|
-
function
|
|
7769
|
+
var kr = "base-";
|
|
7770
|
+
function Ar({ className: e, ref: t, alignSections: n = !1, children: r, horizontalSpacing: i = 0, orientation: a = "vertical", sections: o = 3, verticalSpacing: s = 0, isReversed: u = !1, ...d }) {
|
|
7684
7771
|
let m = f(null), [h, g] = p(NaN), [_, v] = p(NaN), [y, b] = p(NaN), [x, S] = p(NaN), C = () => X.from(m.current).width, T = () => X.from(m.current).height, E = () => {
|
|
7685
7772
|
let e = m.current;
|
|
7686
7773
|
if (!e) return;
|
|
@@ -7693,29 +7780,29 @@ function xr({ className: e, ref: t, alignSections: n = !1, children: r, horizont
|
|
|
7693
7780
|
let a = [...Array(r)].map(() => 0);
|
|
7694
7781
|
for (let e of Array.from(t)) {
|
|
7695
7782
|
if (!(e instanceof HTMLElement)) continue;
|
|
7696
|
-
let t =
|
|
7783
|
+
let t = Fr(e, o), [c, l] = Nr(a, t);
|
|
7697
7784
|
e.role = "gridcell", e.style.position = "absolute", e.style.width = `calc(${100 / r * t}% - ${i * (r - 1) / r * t}px + ${i * (t - 1)}px)`, e.style.height = "", e.style.left = `calc(${100 / r * c}% - ${i * (r - 1) / r * c}px + ${i * c}px)`, e.style.top = `${l + (l === 0 ? 0 : s)}px`;
|
|
7698
7785
|
for (let n = 0; n < t; n++) a[c + n] = l + (l === 0 ? 0 : s) + X.from(e).height;
|
|
7699
7786
|
if (n && c + t === r) {
|
|
7700
|
-
let e =
|
|
7787
|
+
let e = Pr(a);
|
|
7701
7788
|
for (let t = 0; t < r; t++) a[t] = e;
|
|
7702
7789
|
}
|
|
7703
7790
|
}
|
|
7704
|
-
let c = C(), l =
|
|
7791
|
+
let c = C(), l = Pr(a, r);
|
|
7705
7792
|
if (g(c), v(l), isNaN(l) || (e.style.height = `${l}px`), u) for (let e of Array.from(t)) e instanceof HTMLElement && (e.style.left = `calc(${c}px - ${e.style.left} - ${e.getBoundingClientRect().width}px)`);
|
|
7706
7793
|
} else {
|
|
7707
7794
|
let a = [...Array(r)].map(() => 0);
|
|
7708
7795
|
for (let e of Array.from(t)) {
|
|
7709
7796
|
if (!(e instanceof HTMLElement)) continue;
|
|
7710
|
-
let t =
|
|
7797
|
+
let t = Fr(e, o), [c, l] = Nr(a, t);
|
|
7711
7798
|
e.style.position = "absolute", e.style.width = "", e.style.height = `calc(${100 / r * t}% - ${s * (r - 1) / r * t}px + ${s * (t - 1)}px)`, e.style.top = `calc(${100 / r * c}% - ${s * (r - 1) / r * c}px + ${s * c}px)`, e.style.left = `${l + (l === 0 ? 0 : i)}px`;
|
|
7712
7799
|
for (let n = 0; n < t; n++) a[c + n] = l + (l === 0 ? 0 : i) + X.from(e).width;
|
|
7713
7800
|
if (n && c + t === r) {
|
|
7714
|
-
let e =
|
|
7801
|
+
let e = Pr(a);
|
|
7715
7802
|
for (let t = 0; t < r; t++) a[t] = e;
|
|
7716
7803
|
}
|
|
7717
7804
|
}
|
|
7718
|
-
let c = T(), l =
|
|
7805
|
+
let c = T(), l = Pr(a, r);
|
|
7719
7806
|
if (v(c), g(l), isNaN(l) || (e.style.width = `${l}px`), u) for (let e of Array.from(t)) e instanceof HTMLElement && (e.style.top = `calc(${c}px - ${e.style.top} - ${e.getBoundingClientRect().height}px)`);
|
|
7720
7807
|
}
|
|
7721
7808
|
};
|
|
@@ -7730,7 +7817,7 @@ function xr({ className: e, ref: t, alignSections: n = !1, children: r, horizont
|
|
|
7730
7817
|
s,
|
|
7731
7818
|
a
|
|
7732
7819
|
])), l(() => {
|
|
7733
|
-
let e =
|
|
7820
|
+
let e = Ir(m.current?.innerHTML);
|
|
7734
7821
|
if (e.length === 0) return E();
|
|
7735
7822
|
let t = e.length;
|
|
7736
7823
|
for (let n = 0; n < t; n++) {
|
|
@@ -7738,7 +7825,7 @@ function xr({ className: e, ref: t, alignSections: n = !1, children: r, horizont
|
|
|
7738
7825
|
r.src = t, r.onload = () => E();
|
|
7739
7826
|
}
|
|
7740
7827
|
}, [r]);
|
|
7741
|
-
let D =
|
|
7828
|
+
let D = jr({ orientation: a }), k = Mr({
|
|
7742
7829
|
minHeight: _,
|
|
7743
7830
|
minWidth: h,
|
|
7744
7831
|
orientation: a
|
|
@@ -7755,10 +7842,10 @@ function xr({ className: e, ref: t, alignSections: n = !1, children: r, horizont
|
|
|
7755
7842
|
})
|
|
7756
7843
|
});
|
|
7757
7844
|
}
|
|
7758
|
-
function
|
|
7845
|
+
function jr({ orientation: e = "horizontal" }) {
|
|
7759
7846
|
return A({ root: w(e) });
|
|
7760
7847
|
}
|
|
7761
|
-
function
|
|
7848
|
+
function Mr({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizontal" }) {
|
|
7762
7849
|
return M({ body: {
|
|
7763
7850
|
height: n === "horizontal" ? "100%" : "auto",
|
|
7764
7851
|
minHeight: n === "vertical" && !isNaN(e) ? `${e}px` : "",
|
|
@@ -7767,28 +7854,28 @@ function Cr({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizonta
|
|
|
7767
7854
|
width: n === "horizontal" ? "auto" : "100%"
|
|
7768
7855
|
} });
|
|
7769
7856
|
}
|
|
7770
|
-
function
|
|
7857
|
+
function Nr(e, t) {
|
|
7771
7858
|
let n = e.length, r = NaN, i = Infinity;
|
|
7772
7859
|
for (let a = 0; a < n; a++) {
|
|
7773
7860
|
let o = e[a], s = o < i, c = a + t <= n, l = !0;
|
|
7774
7861
|
for (let n = 1; n < t; n++) e[a + n] > o && (l = !1);
|
|
7775
7862
|
s && c && l && (r = a, i = o);
|
|
7776
7863
|
}
|
|
7777
|
-
return isNaN(r) ? [0,
|
|
7864
|
+
return isNaN(r) ? [0, Pr(e, t)] : [r, i];
|
|
7778
7865
|
}
|
|
7779
|
-
function
|
|
7866
|
+
function Pr(e, t) {
|
|
7780
7867
|
let n = e;
|
|
7781
7868
|
return t != null && !isNaN(t) && (n = n.slice(0, Math.max(1, Math.min(t, e.length)))), n.reduce((e, t, n) => t > e ? t : e, 0);
|
|
7782
7869
|
}
|
|
7783
|
-
function
|
|
7870
|
+
function Fr(e, t) {
|
|
7784
7871
|
let n = e.classList;
|
|
7785
|
-
for (let e of Array.from(n)) if (e.startsWith(
|
|
7786
|
-
let n = parseFloat(e.replace(
|
|
7872
|
+
for (let e of Array.from(n)) if (e.startsWith(kr)) {
|
|
7873
|
+
let n = parseFloat(e.replace(kr, ""));
|
|
7787
7874
|
if (!isNaN(n)) return Math.min(Math.max(n, 1), t);
|
|
7788
7875
|
}
|
|
7789
7876
|
return 1;
|
|
7790
7877
|
}
|
|
7791
|
-
function
|
|
7878
|
+
function Ir(e) {
|
|
7792
7879
|
if (!e) return [];
|
|
7793
7880
|
let t = /<img.*?src=(["'])(.*?)\1/g, n = /<img.*?src=(["'])(.*?)\1/, r = t.exec(e) ?? [], i = [];
|
|
7794
7881
|
for (let e of r) {
|
|
@@ -7797,23 +7884,23 @@ function Dr(e) {
|
|
|
7797
7884
|
}
|
|
7798
7885
|
return i;
|
|
7799
7886
|
}
|
|
7800
|
-
process.env.NODE_ENV === "development" && (
|
|
7887
|
+
process.env.NODE_ENV === "development" && (Ar.displayName = "MasonryGrid");
|
|
7801
7888
|
//#endregion
|
|
7802
7889
|
//#region src/primitives/RangeSlider.tsx
|
|
7803
|
-
function
|
|
7804
|
-
let b = e ?? f(null), x = f(null), S = f(null), C = f(null), w = f(null), T = f(!1), E = f(!1), [D, k] = l, A = f(D), M = f(k), N = yt(x), I = d(() =>
|
|
7890
|
+
function Q({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWidth: i = 40, max: a, min: o, orientation: s = "vertical", range: l = [o, a], steps: p = -1, isClipped: m = !1, formatLabel: h, onChange: g, onDragEnd: _, onDragStart: v, ...y }) {
|
|
7891
|
+
let b = e ?? f(null), x = f(null), S = f(null), C = f(null), w = f(null), T = f(!1), E = f(!1), [D, k] = l, A = f(D), M = f(k), N = yt(x), I = d(() => Gr(o, a, p), [
|
|
7805
7892
|
o,
|
|
7806
7893
|
a,
|
|
7807
7894
|
p
|
|
7808
7895
|
]), L = j(t, {
|
|
7809
|
-
knob:
|
|
7810
|
-
knobContainer:
|
|
7811
|
-
label:
|
|
7812
|
-
track:
|
|
7813
|
-
trackHighlight:
|
|
7896
|
+
knob: Q.Knob,
|
|
7897
|
+
knobContainer: Q.KnobContainer,
|
|
7898
|
+
label: Q.Label,
|
|
7899
|
+
track: Q.Track,
|
|
7900
|
+
trackHighlight: Q.TrackHighlight
|
|
7814
7901
|
}), R = c((e, t, r) => {
|
|
7815
|
-
let c = s === "horizontal" ? t : r, l =
|
|
7816
|
-
return
|
|
7902
|
+
let c = s === "horizontal" ? t : r, l = Ur(o, o, a, s, N.width, N.height, i, n, m), u = Ur(M.current, o, a, s, N.width, N.height, i, n, m);
|
|
7903
|
+
return Vr(Kr(Ur(e, o, a, s, N.width, N.height, i, n, m) + c, u, l), o, a, s, N.width, N.height, i, n, m);
|
|
7817
7904
|
}, [
|
|
7818
7905
|
i,
|
|
7819
7906
|
n,
|
|
@@ -7824,8 +7911,8 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7824
7911
|
N.width,
|
|
7825
7912
|
N.height
|
|
7826
7913
|
]), z = c((e, t, r) => {
|
|
7827
|
-
let c = s === "horizontal" ? t : r, l =
|
|
7828
|
-
return
|
|
7914
|
+
let c = s === "horizontal" ? t : r, l = Ur(A.current, o, a, s, N.width, N.height, i, n, m), u = Ur(a, o, a, s, N.width, N.height, i, n, m);
|
|
7915
|
+
return Vr(Kr(Ur(e, o, a, s, N.width, N.height, i, n, m) + c, u, l), o, a, s, N.width, N.height, i, n, m);
|
|
7829
7916
|
}, [
|
|
7830
7917
|
i,
|
|
7831
7918
|
n,
|
|
@@ -7836,7 +7923,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7836
7923
|
N.width,
|
|
7837
7924
|
N.height
|
|
7838
7925
|
]), B = c(([e, t]) => {
|
|
7839
|
-
let r = S.current, c = C.current, l = w.current, u =
|
|
7926
|
+
let r = S.current, c = C.current, l = w.current, u = Rr(e, o, a), d = `${u * 100}%`, f = Rr(t, o, a), p = `${f * 100}%`;
|
|
7840
7927
|
s === "horizontal" ? (r && (r.style.left = m ? `calc(${d} + ${i * .5 - u * i}px)` : d), c && (c.style.left = m ? `calc(${p} + ${i * .5 - f * i}px)` : p), l && (l.style.left = d, l.style.width = `${(f - u) * 100}%`)) : (r && (r.style.top = m ? `calc(${d} + ${n * .5 - u * n}px)` : d), c && (c.style.top = m ? `calc(${p} + ${n * .5 - f * n}px)` : p), l && (l.style.top = d, l.style.height = `${(f - u) * 100}%`));
|
|
7841
7928
|
}, [
|
|
7842
7929
|
m,
|
|
@@ -7852,7 +7939,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7852
7939
|
vt(S, {
|
|
7853
7940
|
onDragEnd: () => {
|
|
7854
7941
|
V(S.current, !1);
|
|
7855
|
-
let e = I ?
|
|
7942
|
+
let e = I ? Wr(A.current, I) : A.current;
|
|
7856
7943
|
A.current = e, T.current = !1, b.current?.classList.remove("dragging"), S.current?.classList.remove("dragging"), C.current?.classList.remove("dragging"), g?.([e, M.current], !1), _?.();
|
|
7857
7944
|
},
|
|
7858
7945
|
onDragMove: ({ x: e, y: t }) => {
|
|
@@ -7865,7 +7952,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7865
7952
|
}), vt(C, {
|
|
7866
7953
|
onDragEnd: () => {
|
|
7867
7954
|
V(C.current, !1);
|
|
7868
|
-
let e = I ?
|
|
7955
|
+
let e = I ? Wr(M.current, I) : M.current;
|
|
7869
7956
|
M.current = e, E.current = !1, b.current?.classList.remove("dragging"), S.current?.classList.remove("dragging"), C.current?.classList.remove("dragging"), g?.([A.current, e], !1), _?.();
|
|
7870
7957
|
},
|
|
7871
7958
|
onDragMove: ({ x: e, y: t }) => {
|
|
@@ -7882,7 +7969,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7882
7969
|
k,
|
|
7883
7970
|
B
|
|
7884
7971
|
]);
|
|
7885
|
-
let H = d(() =>
|
|
7972
|
+
let H = d(() => Lr({
|
|
7886
7973
|
knobHeight: n,
|
|
7887
7974
|
knobPadding: r,
|
|
7888
7975
|
knobWidth: i,
|
|
@@ -7907,39 +7994,39 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7907
7994
|
children: [
|
|
7908
7995
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7909
7996
|
style: F(H.track),
|
|
7910
|
-
element: L.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7997
|
+
element: L.track ?? /* @__PURE__ */ (0, O.jsx)(Q.Track, {})
|
|
7911
7998
|
}),
|
|
7912
7999
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7913
8000
|
ref: w,
|
|
7914
8001
|
style: F(H.trackHighlight),
|
|
7915
|
-
element: L.trackHighlight ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8002
|
+
element: L.trackHighlight ?? /* @__PURE__ */ (0, O.jsx)(Q.TrackHighlight, {})
|
|
7916
8003
|
}),
|
|
7917
8004
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7918
8005
|
ref: S,
|
|
7919
|
-
style: F(H.knobContainer, { pointerEvents: (0,
|
|
7920
|
-
disabled: (0,
|
|
7921
|
-
element: L.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8006
|
+
style: F(H.knobContainer, { pointerEvents: (0, kn.default)([D, k], [o, o]) ? "none" : "auto" }, s === "horizontal" ? { top: "50%" } : { left: "50%" }),
|
|
8007
|
+
disabled: (0, kn.default)([D, k], [o, o]),
|
|
8008
|
+
element: L.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(Q.KnobContainer, {}),
|
|
7922
8009
|
children: /* @__PURE__ */ (0, O.jsxs)(P, {
|
|
7923
8010
|
style: F(H.knob),
|
|
7924
|
-
element: L.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8011
|
+
element: L.knob ?? /* @__PURE__ */ (0, O.jsx)(Q.Knob, {}),
|
|
7925
8012
|
children: [/* @__PURE__ */ (0, O.jsx)("div", { style: H.knobHitBox }), L.label && h && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7926
8013
|
style: F(H.label),
|
|
7927
|
-
element: L.label ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8014
|
+
element: L.label ?? /* @__PURE__ */ (0, O.jsx)(Q.Label, {}),
|
|
7928
8015
|
children: h(D, "start")
|
|
7929
8016
|
})]
|
|
7930
8017
|
})
|
|
7931
8018
|
}),
|
|
7932
8019
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7933
8020
|
ref: C,
|
|
7934
|
-
style: F(H.knobContainer, { pointerEvents: (0,
|
|
7935
|
-
disabled: (0,
|
|
7936
|
-
element: L.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8021
|
+
style: F(H.knobContainer, { pointerEvents: (0, kn.default)([D, k], [a, a]) ? "none" : "auto" }, s === "horizontal" ? { top: "50%" } : { left: "50%" }),
|
|
8022
|
+
disabled: (0, kn.default)([D, k], [a, a]),
|
|
8023
|
+
element: L.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(Q.KnobContainer, {}),
|
|
7937
8024
|
children: /* @__PURE__ */ (0, O.jsxs)(P, {
|
|
7938
8025
|
style: F(H.knob),
|
|
7939
|
-
element: L.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8026
|
+
element: L.knob ?? /* @__PURE__ */ (0, O.jsx)(Q.Knob, {}),
|
|
7940
8027
|
children: [/* @__PURE__ */ (0, O.jsx)("div", { style: H.knobHitBox }), L.label && h && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7941
8028
|
style: F(H.label),
|
|
7942
|
-
element: L.label ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8029
|
+
element: L.label ?? /* @__PURE__ */ (0, O.jsx)(Q.Label, {}),
|
|
7943
8030
|
children: h(k, "end")
|
|
7944
8031
|
})]
|
|
7945
8032
|
})
|
|
@@ -7950,8 +8037,8 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7950
8037
|
}
|
|
7951
8038
|
(function(e) {
|
|
7952
8039
|
e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.TrackHighlight = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.KnobContainer = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("button", { ...e }), e.Label = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e });
|
|
7953
|
-
})(
|
|
7954
|
-
function
|
|
8040
|
+
})(Q ||= {});
|
|
8041
|
+
function Lr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "horizontal" }) {
|
|
7955
8042
|
return M({
|
|
7956
8043
|
body: {
|
|
7957
8044
|
height: "100%",
|
|
@@ -8000,10 +8087,10 @@ function Or({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientati
|
|
|
8000
8087
|
}
|
|
8001
8088
|
});
|
|
8002
8089
|
}
|
|
8003
|
-
function
|
|
8090
|
+
function Rr(e, t, n) {
|
|
8004
8091
|
return (e - t) / (n - t);
|
|
8005
8092
|
}
|
|
8006
|
-
function
|
|
8093
|
+
function zr(e, t, n, r, i, a, o) {
|
|
8007
8094
|
switch (t) {
|
|
8008
8095
|
case "horizontal": {
|
|
8009
8096
|
let t = o ? n - i : n;
|
|
@@ -8016,23 +8103,23 @@ function Ar(e, t, n, r, i, a, o) {
|
|
|
8016
8103
|
default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
|
|
8017
8104
|
}
|
|
8018
8105
|
}
|
|
8019
|
-
function
|
|
8106
|
+
function Br(e, t, n) {
|
|
8020
8107
|
return e * (n - t) + t;
|
|
8021
8108
|
}
|
|
8022
|
-
function
|
|
8023
|
-
return
|
|
8109
|
+
function Vr(e, t, n, r, i, a, o, s, c) {
|
|
8110
|
+
return Br(zr(e, r, i, a, o, s, c), t, n);
|
|
8024
8111
|
}
|
|
8025
|
-
function
|
|
8112
|
+
function Hr(e, t, n, r, i, a, o) {
|
|
8026
8113
|
switch (t) {
|
|
8027
8114
|
case "horizontal": return e * (o ? n - i : n) + (o ? i * .5 : 0);
|
|
8028
8115
|
case "vertical": return e * (o ? r - a : r) + (o ? a * .5 : 0);
|
|
8029
8116
|
default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
|
|
8030
8117
|
}
|
|
8031
8118
|
}
|
|
8032
|
-
function
|
|
8033
|
-
return
|
|
8119
|
+
function Ur(e, t, n, r, i, a, o, s, c) {
|
|
8120
|
+
return Hr(Rr(e, t, n), r, i, a, o, s, c);
|
|
8034
8121
|
}
|
|
8035
|
-
function
|
|
8122
|
+
function Wr(e, t) {
|
|
8036
8123
|
let n = t.length, r = 0, i = Infinity;
|
|
8037
8124
|
for (let a = 0; a < n; a++) {
|
|
8038
8125
|
let n = t[a], o = Math.abs(e - n);
|
|
@@ -8040,21 +8127,21 @@ function Fr(e, t) {
|
|
|
8040
8127
|
}
|
|
8041
8128
|
return t[r];
|
|
8042
8129
|
}
|
|
8043
|
-
function
|
|
8130
|
+
function Gr(e, t, n) {
|
|
8044
8131
|
if (!(n < 0)) return [
|
|
8045
8132
|
e,
|
|
8046
8133
|
...[...Array(n)].map((r, i) => e + (i + 1) * (t - e) / (1 + n)),
|
|
8047
8134
|
t
|
|
8048
8135
|
];
|
|
8049
8136
|
}
|
|
8050
|
-
function
|
|
8137
|
+
function Kr(e, t, n) {
|
|
8051
8138
|
return Math.max(n, Math.min(t, e));
|
|
8052
8139
|
}
|
|
8053
|
-
process.env.NODE_ENV === "development" && (
|
|
8140
|
+
process.env.NODE_ENV === "development" && (Q.displayName = "RangeSlider", Q.Knob.displayName = "RangeSlider.Knob", Q.Label.displayName = "RangeSlider.Label", Q.Track.displayName = "RangeSlider.Track", Q.TrackHighlight.displayName = "RangeSlider.TrackHighlight");
|
|
8054
8141
|
//#endregion
|
|
8055
8142
|
//#region src/primitives/ScrollableCarousel.tsx
|
|
8056
|
-
function
|
|
8057
|
-
let _ = f(void 0), v = f(null), y = f(void 0), b = f(void 0), x = f(void 0), S = 1e3, C = Z(d), w = Z(m), T = Z(h), E = f(K.zero), D = f(!1), k = f(!1), A = Qt(), [j, M] = p(
|
|
8143
|
+
function qr({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0, ItemComponent: i, items: a = [], orientation: o = "horizontal", isDragEnabled: s = !0, shouldTrackExposure: l = !1, onAutoAdvancePause: d, onAutoAdvanceResume: m, onIndexChange: h, ...g }) {
|
|
8144
|
+
let _ = f(void 0), v = f(null), y = f(void 0), b = f(void 0), x = f(void 0), S = 1e3, C = Z(d), w = Z(m), T = Z(h), E = f(K.zero), D = f(!1), k = f(!1), A = Qt(), [j, M] = p(Yr(v, o)), [N, P] = p(!1), I = Zr({
|
|
8058
8145
|
orientation: o,
|
|
8059
8146
|
scrollSnapEnabled: A || !N
|
|
8060
8147
|
}), L = t > 0, R = c(() => {
|
|
@@ -8064,9 +8151,9 @@ function Rr({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0
|
|
|
8064
8151
|
clearTimeout(x.current), x.current = void 0;
|
|
8065
8152
|
}, S);
|
|
8066
8153
|
}, [S, R]), B = c(() => {
|
|
8067
|
-
|
|
8154
|
+
Jr(v, r, o), z();
|
|
8068
8155
|
}, [r, o]), V = c(() => {
|
|
8069
|
-
M(
|
|
8156
|
+
M(Yr(v, o));
|
|
8070
8157
|
}, [o]), H = c((e) => {
|
|
8071
8158
|
A || (y.current = K.make(e.clientX, e.clientY), P(!0));
|
|
8072
8159
|
}, [A]), U = c((e) => {
|
|
@@ -8163,7 +8250,7 @@ function Rr({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0
|
|
|
8163
8250
|
})
|
|
8164
8251
|
});
|
|
8165
8252
|
}
|
|
8166
|
-
function
|
|
8253
|
+
function Jr(e, t, n) {
|
|
8167
8254
|
let r = e?.current;
|
|
8168
8255
|
if (!r) return;
|
|
8169
8256
|
let i = n === "horizontal" ? 0 : r.clientHeight * t, a = n === "horizontal" ? r.clientWidth * t : 0;
|
|
@@ -8173,14 +8260,14 @@ function zr(e, t, n) {
|
|
|
8173
8260
|
top: i
|
|
8174
8261
|
});
|
|
8175
8262
|
}
|
|
8176
|
-
function
|
|
8263
|
+
function Yr(e, t) {
|
|
8177
8264
|
let n = e?.current;
|
|
8178
8265
|
if (!n) return;
|
|
8179
8266
|
let r = [];
|
|
8180
|
-
for (let i = 0; i < n.children.length; i++) r.push(
|
|
8267
|
+
for (let i = 0; i < n.children.length; i++) r.push(Xr(i, e, t));
|
|
8181
8268
|
return r;
|
|
8182
8269
|
}
|
|
8183
|
-
function
|
|
8270
|
+
function Xr(e, t, n) {
|
|
8184
8271
|
let r = t?.current, i = r?.children[e];
|
|
8185
8272
|
if (!i) return 0;
|
|
8186
8273
|
let a = X.intersecting(i, r);
|
|
@@ -8190,7 +8277,7 @@ function Vr(e, t, n) {
|
|
|
8190
8277
|
default: return console.error(`[etudes::ScrollableCarousel] Unsupported orientation: ${n}`), NaN;
|
|
8191
8278
|
}
|
|
8192
8279
|
}
|
|
8193
|
-
function
|
|
8280
|
+
function Zr({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
|
|
8194
8281
|
return M({
|
|
8195
8282
|
item: {
|
|
8196
8283
|
height: "100%",
|
|
@@ -8226,40 +8313,40 @@ function Hr({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
|
|
|
8226
8313
|
}
|
|
8227
8314
|
});
|
|
8228
8315
|
}
|
|
8229
|
-
process.env.NODE_ENV === "development" && (
|
|
8316
|
+
process.env.NODE_ENV === "development" && (qr.displayName = "ScrollableCarousel");
|
|
8230
8317
|
//#endregion
|
|
8231
8318
|
//#region src/primitives/Select.tsx
|
|
8232
|
-
function
|
|
8319
|
+
function Qr({ id: e, ref: t, children: n, name: r, options: i, placeholder: a, value: o, isRequired: s = !1, formatValue: c = (e) => e, onChange: l, ...u }) {
|
|
8233
8320
|
let d = j(n, {
|
|
8234
|
-
expandIcon:
|
|
8235
|
-
option:
|
|
8236
|
-
toggle:
|
|
8321
|
+
expandIcon: Qr.ExpandIcon,
|
|
8322
|
+
option: Qr.Option,
|
|
8323
|
+
toggle: Qr.Toggle
|
|
8237
8324
|
});
|
|
8238
8325
|
return /* @__PURE__ */ (0, O.jsxs)("div", {
|
|
8239
8326
|
...u,
|
|
8240
8327
|
ref: t,
|
|
8241
|
-
style:
|
|
8328
|
+
style: $r.root,
|
|
8242
8329
|
children: [/* @__PURE__ */ (0, O.jsxs)(P, {
|
|
8243
|
-
style:
|
|
8330
|
+
style: $r.select,
|
|
8244
8331
|
"aria-required": s ? "true" : void 0,
|
|
8245
|
-
element: d.toggle ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8332
|
+
element: d.toggle ?? /* @__PURE__ */ (0, O.jsx)(Qr.Toggle, {}),
|
|
8246
8333
|
name: r,
|
|
8247
8334
|
required: s,
|
|
8248
8335
|
value: o,
|
|
8249
8336
|
onChange: (e) => l?.(e.target.value),
|
|
8250
8337
|
children: [a !== void 0 && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8251
8338
|
disabled: !0,
|
|
8252
|
-
element: d.option ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8339
|
+
element: d.option ?? /* @__PURE__ */ (0, O.jsx)(Qr.Option, {}),
|
|
8253
8340
|
hidden: !0,
|
|
8254
8341
|
value: "",
|
|
8255
8342
|
children: a
|
|
8256
8343
|
}), i.map((e, t) => /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8257
|
-
element: d.option ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8344
|
+
element: d.option ?? /* @__PURE__ */ (0, O.jsx)(Qr.Option, {}),
|
|
8258
8345
|
value: e,
|
|
8259
8346
|
children: c(e)
|
|
8260
8347
|
}, `${t}-${e}`))]
|
|
8261
8348
|
}), d.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8262
|
-
style:
|
|
8349
|
+
style: $r.expandIcon,
|
|
8263
8350
|
element: d.expandIcon
|
|
8264
8351
|
})]
|
|
8265
8352
|
});
|
|
@@ -8274,8 +8361,8 @@ function Ur({ id: e, ref: t, children: n, name: r, options: i, placeholder: a, v
|
|
|
8274
8361
|
...t,
|
|
8275
8362
|
children: e
|
|
8276
8363
|
});
|
|
8277
|
-
})(
|
|
8278
|
-
var
|
|
8364
|
+
})(Qr ||= {});
|
|
8365
|
+
var $r = M({
|
|
8279
8366
|
expandIcon: {
|
|
8280
8367
|
pointerEvents: "none",
|
|
8281
8368
|
zIndex: 1
|
|
@@ -8297,20 +8384,20 @@ var Wr = M({
|
|
|
8297
8384
|
width: "100%"
|
|
8298
8385
|
}
|
|
8299
8386
|
});
|
|
8300
|
-
process.env.NODE_ENV === "development" && (
|
|
8387
|
+
process.env.NODE_ENV === "development" && (Qr.displayName = "Select", Qr.ExpandIcon.displayName = "Select.ExpandIcon", Qr.Option.displayName = "Select.Option", Qr.Toggle.displayName = "Select.Toggle");
|
|
8301
8388
|
//#endregion
|
|
8302
8389
|
//#region src/primitives/Slider.tsx
|
|
8303
|
-
function
|
|
8390
|
+
function ei({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobWidth: i = 30, orientation: a = "vertical", position: o = 0, trackPadding: s = 0, isClipped: l = !1, isInverted: p = !1, isTrackInteractive: m = !0, formatLabel: h, onChange: g, onDragEnd: _, onDragStart: v, ...y }) {
|
|
8304
8391
|
let b = e ?? f(null), x = f(null), S = f(null), C = f(null), w = f(null), T = f(o), E = f(!1), D = Ze(x), k = c((e, t, r) => {
|
|
8305
|
-
let o =
|
|
8392
|
+
let o = ri(e, p);
|
|
8306
8393
|
switch (a) {
|
|
8307
8394
|
case "horizontal": {
|
|
8308
8395
|
let n = l ? D.width - i : D.width;
|
|
8309
|
-
return n <= 0 ? e :
|
|
8396
|
+
return n <= 0 ? e : ni(ii((o * n + t) / n), p);
|
|
8310
8397
|
}
|
|
8311
8398
|
case "vertical": {
|
|
8312
8399
|
let t = l ? D.height - n : D.height;
|
|
8313
|
-
return t <= 0 ? e :
|
|
8400
|
+
return t <= 0 ? e : ni(ii((o * t + r) / t), p);
|
|
8314
8401
|
}
|
|
8315
8402
|
default: return console.error(`[etudes::Slider] Invalid orientation: ${a}`), NaN;
|
|
8316
8403
|
}
|
|
@@ -8323,7 +8410,7 @@ function Gr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8323
8410
|
n,
|
|
8324
8411
|
a
|
|
8325
8412
|
]), A = c((e) => {
|
|
8326
|
-
let t =
|
|
8413
|
+
let t = ri(e, p), r = S.current, o = C.current, c = w.current, u = (e) => `${s <= 0 ? 0 : e * .5}px - ${s}px`;
|
|
8327
8414
|
switch (a) {
|
|
8328
8415
|
case "horizontal":
|
|
8329
8416
|
r && (r.style.left = l ? `calc(${t * 100}% + ${i * .5 - t * i}px)` : `${t * 100}%`), o && (o.style.width = `calc(${t * 100}% - ${u(i)})`), c && (c.style.width = `calc(${(1 - t) * 100}% - ${u(i)})`);
|
|
@@ -8353,11 +8440,11 @@ function Gr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8353
8440
|
switch (a) {
|
|
8354
8441
|
case "horizontal":
|
|
8355
8442
|
if (D.width <= 0) return;
|
|
8356
|
-
n =
|
|
8443
|
+
n = ni((e.clientX + t.left - D.left) / D.width, p);
|
|
8357
8444
|
break;
|
|
8358
8445
|
case "vertical":
|
|
8359
8446
|
if (D.height <= 0) return;
|
|
8360
|
-
n =
|
|
8447
|
+
n = ni((e.clientY + t.top - D.top) / D.height, p);
|
|
8361
8448
|
break;
|
|
8362
8449
|
default:
|
|
8363
8450
|
console.error(`[etudes::Slider] Invalid orientation: ${a}`);
|
|
@@ -8387,7 +8474,7 @@ function Gr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8387
8474
|
}), u(() => {
|
|
8388
8475
|
E.current || (T.current = o, A(o));
|
|
8389
8476
|
}, [o, A]);
|
|
8390
|
-
let I = p ? o === 0 : o === 1, L = p ? o === 1 : o === 0, R = d(() =>
|
|
8477
|
+
let I = p ? o === 0 : o === 1, L = p ? o === 1 : o === 0, R = d(() => ti({
|
|
8391
8478
|
knobHeight: n,
|
|
8392
8479
|
knobPadding: r,
|
|
8393
8480
|
knobWidth: i,
|
|
@@ -8400,10 +8487,10 @@ function Gr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8400
8487
|
a,
|
|
8401
8488
|
m
|
|
8402
8489
|
]), z = j(t, {
|
|
8403
|
-
knob:
|
|
8404
|
-
knobContainer:
|
|
8405
|
-
label:
|
|
8406
|
-
track:
|
|
8490
|
+
knob: ei.Knob,
|
|
8491
|
+
knobContainer: ei.KnobContainer,
|
|
8492
|
+
label: ei.Label,
|
|
8493
|
+
track: ei.Track
|
|
8407
8494
|
});
|
|
8408
8495
|
return /* @__PURE__ */ (0, O.jsx)("div", {
|
|
8409
8496
|
...y,
|
|
@@ -8422,7 +8509,7 @@ function Gr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8422
8509
|
ref: C,
|
|
8423
8510
|
style: F(R.track, a === "vertical" ? { top: "0" } : { left: "0" }),
|
|
8424
8511
|
"data-side": p ? "end" : "start",
|
|
8425
|
-
element: z.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8512
|
+
element: z.track ?? /* @__PURE__ */ (0, O.jsx)(ei.Track, {}),
|
|
8426
8513
|
onClick: N,
|
|
8427
8514
|
children: /* @__PURE__ */ (0, O.jsx)("div", { style: R.trackHitBox })
|
|
8428
8515
|
}),
|
|
@@ -8430,20 +8517,20 @@ function Gr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8430
8517
|
ref: w,
|
|
8431
8518
|
style: F(R.track, a === "vertical" ? { bottom: "0" } : { right: "0" }),
|
|
8432
8519
|
"data-side": p ? "start" : "end",
|
|
8433
|
-
element: z.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8520
|
+
element: z.track ?? /* @__PURE__ */ (0, O.jsx)(ei.Track, {}),
|
|
8434
8521
|
onClick: N,
|
|
8435
8522
|
children: /* @__PURE__ */ (0, O.jsx)("div", { style: R.trackHitBox })
|
|
8436
8523
|
}),
|
|
8437
8524
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
8438
8525
|
ref: S,
|
|
8439
8526
|
style: R.knobContainer,
|
|
8440
|
-
element: z.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8527
|
+
element: z.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(ei.KnobContainer, {}),
|
|
8441
8528
|
children: /* @__PURE__ */ (0, O.jsxs)(P, {
|
|
8442
8529
|
style: F(R.knob),
|
|
8443
|
-
element: z.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8530
|
+
element: z.knob ?? /* @__PURE__ */ (0, O.jsx)(ei.Knob, {}),
|
|
8444
8531
|
children: [/* @__PURE__ */ (0, O.jsx)("div", { style: R.knobHitBox }), h && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8445
8532
|
style: F(R.label),
|
|
8446
|
-
element: z.label ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8533
|
+
element: z.label ?? /* @__PURE__ */ (0, O.jsx)(ei.Label, {}),
|
|
8447
8534
|
children: h(o)
|
|
8448
8535
|
})]
|
|
8449
8536
|
})
|
|
@@ -8454,8 +8541,8 @@ function Gr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8454
8541
|
}
|
|
8455
8542
|
(function(e) {
|
|
8456
8543
|
e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.KnobContainer = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("button", { ...e }), e.Label = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e });
|
|
8457
|
-
})(
|
|
8458
|
-
function
|
|
8544
|
+
})(ei ||= {});
|
|
8545
|
+
function ti({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "vertical", isTrackInteractive: i = !0 }) {
|
|
8459
8546
|
return M({
|
|
8460
8547
|
body: {
|
|
8461
8548
|
height: "100%",
|
|
@@ -8514,29 +8601,29 @@ function Kr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientati
|
|
|
8514
8601
|
}
|
|
8515
8602
|
});
|
|
8516
8603
|
}
|
|
8517
|
-
function
|
|
8604
|
+
function ni(e, t) {
|
|
8518
8605
|
return t ? 1 - e : e;
|
|
8519
8606
|
}
|
|
8520
|
-
function
|
|
8607
|
+
function ri(e, t) {
|
|
8521
8608
|
return t ? 1 - e : e;
|
|
8522
8609
|
}
|
|
8523
|
-
function
|
|
8610
|
+
function ii(e, t = 1, n = 0) {
|
|
8524
8611
|
return Math.max(n, Math.min(t, e));
|
|
8525
8612
|
}
|
|
8526
|
-
process.env.NODE_ENV === "development" && (
|
|
8613
|
+
process.env.NODE_ENV === "development" && (ei.displayName = "Slider", ei.Track.displayName = "Slider.Track", ei.Knob.displayName = "Slider.Knob", ei.KnobContainer.displayName = "Slider.KnobContainer", ei.Label.displayName = "Slider.Label");
|
|
8527
8614
|
//#endregion
|
|
8528
8615
|
//#region src/primitives/StepSlider.tsx
|
|
8529
|
-
function
|
|
8530
|
-
let S = e || f(null), C = f(null), w = f(null), T = f(null), E = f(null), D = f(
|
|
8531
|
-
let i =
|
|
8616
|
+
function $({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding: i = 0, knobWidth: a = 30, orientation: o = "vertical", steps: s = oi(10), trackPadding: l = 0, isClipped: p = !1, isInverted: m = !1, isTrackInteractive: h = !0, formatLabel: g, onDragEnd: _, onDragStart: v, onIndexChange: y, onPositionChange: b, ...x }) {
|
|
8617
|
+
let S = e || f(null), C = f(null), w = f(null), T = f(null), E = f(null), D = f(ci(n, s)), k = f(n), A = f(!1), M = Ze(C), N = c((e, t, n) => {
|
|
8618
|
+
let i = ui(e, m);
|
|
8532
8619
|
switch (o) {
|
|
8533
8620
|
case "horizontal": {
|
|
8534
8621
|
let n = p ? M.width - a : M.width;
|
|
8535
|
-
return n <= 0 ? e :
|
|
8622
|
+
return n <= 0 ? e : li(di((i * n + t) / n), m);
|
|
8536
8623
|
}
|
|
8537
8624
|
case "vertical": {
|
|
8538
8625
|
let t = p ? M.height - r : M.height;
|
|
8539
|
-
return t <= 0 ? e :
|
|
8626
|
+
return t <= 0 ? e : li(di((i * t + n) / t), m);
|
|
8540
8627
|
}
|
|
8541
8628
|
default: return console.error(`[etudes::StepSlider] Invalid orientation: ${o}`), NaN;
|
|
8542
8629
|
}
|
|
@@ -8549,7 +8636,7 @@ function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8549
8636
|
r,
|
|
8550
8637
|
o
|
|
8551
8638
|
]), I = c((e) => {
|
|
8552
|
-
let t =
|
|
8639
|
+
let t = ui(e, m), n = w.current, i = T.current, s = E.current, c = (e) => `${l <= 0 ? 0 : e * .5}px - ${l}px`;
|
|
8553
8640
|
switch (o) {
|
|
8554
8641
|
case "horizontal":
|
|
8555
8642
|
n && (n.style.left = p ? `calc(${t * 100}% + ${a * .5 - t * a}px)` : `${t * 100}%`), i && (i.style.width = `calc(${t * 100}% - ${c(a)})`), s && (s.style.width = `calc(${(1 - t) * 100}% - ${c(a)})`);
|
|
@@ -8579,19 +8666,19 @@ function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8579
8666
|
switch (o) {
|
|
8580
8667
|
case "horizontal":
|
|
8581
8668
|
if (M.width <= 0) return;
|
|
8582
|
-
n =
|
|
8669
|
+
n = li((e.clientX + t.left - M.left) / M.width, m);
|
|
8583
8670
|
break;
|
|
8584
8671
|
case "vertical":
|
|
8585
8672
|
if (M.height <= 0) return;
|
|
8586
|
-
n =
|
|
8673
|
+
n = li((e.clientY + t.top - M.top) / M.height, m);
|
|
8587
8674
|
break;
|
|
8588
8675
|
default:
|
|
8589
8676
|
console.error(`[etudes::StepSlider] Invalid orientation: ${o}`);
|
|
8590
8677
|
return;
|
|
8591
8678
|
}
|
|
8592
|
-
let r =
|
|
8679
|
+
let r = si(n, s), i = r === k.current ? di(n > D.current ? r + 1 : r - 1, s.length - 1) : r;
|
|
8593
8680
|
if (i !== k.current) {
|
|
8594
|
-
let e =
|
|
8681
|
+
let e = ci(i, s);
|
|
8595
8682
|
k.current = i, D.current = e, I(e), b?.(e, !1), y?.(i, !1);
|
|
8596
8683
|
}
|
|
8597
8684
|
}, [
|
|
@@ -8608,14 +8695,14 @@ function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8608
8695
|
vt(w, {
|
|
8609
8696
|
onDragEnd: () => {
|
|
8610
8697
|
L(!1), A.current = !1, S.current?.classList.remove("dragging"), w.current?.classList.remove("dragging");
|
|
8611
|
-
let e =
|
|
8698
|
+
let e = si(D.current, s), t = ci(e, s);
|
|
8612
8699
|
D.current = t, k.current = e, I(t), b?.(t, !1), y?.(e, !1), _?.();
|
|
8613
8700
|
},
|
|
8614
8701
|
onDragMove: ({ x: e, y: t }) => {
|
|
8615
8702
|
let n = N(D.current, e, t);
|
|
8616
8703
|
if (n !== D.current) {
|
|
8617
8704
|
D.current = n, I(n), b?.(n, !0);
|
|
8618
|
-
let e =
|
|
8705
|
+
let e = si(n, s);
|
|
8619
8706
|
e !== k.current && (k.current = e, y?.(e, !0));
|
|
8620
8707
|
}
|
|
8621
8708
|
A.current = !0, S.current?.classList.add("dragging"), w.current?.classList.add("dragging");
|
|
@@ -8625,14 +8712,14 @@ function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8625
8712
|
}
|
|
8626
8713
|
}), u(() => {
|
|
8627
8714
|
if (A.current) return;
|
|
8628
|
-
let e =
|
|
8715
|
+
let e = ci(n, s);
|
|
8629
8716
|
k.current = n, D.current = e, I(e);
|
|
8630
8717
|
}, [
|
|
8631
8718
|
n,
|
|
8632
8719
|
I,
|
|
8633
8720
|
_t(s)
|
|
8634
8721
|
]);
|
|
8635
|
-
let z =
|
|
8722
|
+
let z = ci(n, s), B = m ? z === 0 : z === 1, V = m ? z === 1 : z === 0, H = d(() => ai({
|
|
8636
8723
|
knobHeight: r,
|
|
8637
8724
|
knobPadding: i,
|
|
8638
8725
|
knobWidth: a,
|
|
@@ -8645,10 +8732,10 @@ function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8645
8732
|
o,
|
|
8646
8733
|
h
|
|
8647
8734
|
]), U = j(t, {
|
|
8648
|
-
knob:
|
|
8649
|
-
knobContainer:
|
|
8650
|
-
label:
|
|
8651
|
-
track:
|
|
8735
|
+
knob: $.Knob,
|
|
8736
|
+
knobContainer: $.KnobContainer,
|
|
8737
|
+
label: $.Label,
|
|
8738
|
+
track: $.Track
|
|
8652
8739
|
});
|
|
8653
8740
|
return /* @__PURE__ */ (0, O.jsx)("div", {
|
|
8654
8741
|
...x,
|
|
@@ -8667,7 +8754,7 @@ function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8667
8754
|
ref: T,
|
|
8668
8755
|
style: F(H.track, o === "vertical" ? { top: "0" } : { left: "0" }),
|
|
8669
8756
|
"data-side": m ? "end" : "start",
|
|
8670
|
-
element: U.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8757
|
+
element: U.track ?? /* @__PURE__ */ (0, O.jsx)($.Track, {}),
|
|
8671
8758
|
onClick: R,
|
|
8672
8759
|
children: /* @__PURE__ */ (0, O.jsx)("div", { style: H.trackHitBox })
|
|
8673
8760
|
}),
|
|
@@ -8675,20 +8762,20 @@ function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8675
8762
|
ref: E,
|
|
8676
8763
|
style: F(H.track, o === "vertical" ? { bottom: "0" } : { right: "0" }),
|
|
8677
8764
|
"data-side": m ? "start" : "end",
|
|
8678
|
-
element: U.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8765
|
+
element: U.track ?? /* @__PURE__ */ (0, O.jsx)($.Track, {}),
|
|
8679
8766
|
onClick: R,
|
|
8680
8767
|
children: /* @__PURE__ */ (0, O.jsx)("div", { style: H.trackHitBox })
|
|
8681
8768
|
}),
|
|
8682
8769
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
8683
8770
|
ref: w,
|
|
8684
8771
|
style: F(H.knobContainer),
|
|
8685
|
-
element: U.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8772
|
+
element: U.knobContainer ?? /* @__PURE__ */ (0, O.jsx)($.KnobContainer, {}),
|
|
8686
8773
|
children: /* @__PURE__ */ (0, O.jsxs)(P, {
|
|
8687
8774
|
style: F(H.knob),
|
|
8688
|
-
element: U.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8775
|
+
element: U.knob ?? /* @__PURE__ */ (0, O.jsx)($.Knob, {}),
|
|
8689
8776
|
children: [/* @__PURE__ */ (0, O.jsx)("div", { style: H.knobHitBox }), g && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8690
8777
|
style: F(H.label),
|
|
8691
|
-
element: U.label ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8778
|
+
element: U.label ?? /* @__PURE__ */ (0, O.jsx)($.Label, {}),
|
|
8692
8779
|
children: g(z, n)
|
|
8693
8780
|
})]
|
|
8694
8781
|
})
|
|
@@ -8698,9 +8785,9 @@ function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8698
8785
|
});
|
|
8699
8786
|
}
|
|
8700
8787
|
(function(e) {
|
|
8701
|
-
e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.KnobContainer = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("button", { ...e }), e.Label = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.generateSteps =
|
|
8702
|
-
})(
|
|
8703
|
-
function
|
|
8788
|
+
e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.KnobContainer = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("button", { ...e }), e.Label = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("div", { ...e }), e.generateSteps = oi;
|
|
8789
|
+
})($ ||= {});
|
|
8790
|
+
function ai({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "vertical", isTrackInteractive: i = !1 }) {
|
|
8704
8791
|
return M({
|
|
8705
8792
|
body: {
|
|
8706
8793
|
height: "100%",
|
|
@@ -8759,38 +8846,38 @@ function Zr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientati
|
|
|
8759
8846
|
}
|
|
8760
8847
|
});
|
|
8761
8848
|
}
|
|
8762
|
-
function
|
|
8849
|
+
function oi(e) {
|
|
8763
8850
|
if (e <= 1) return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"), [];
|
|
8764
8851
|
if (Math.round(e) !== e) return console.error("[etudes::StepSlider] `length` value must be an integer"), [];
|
|
8765
8852
|
let t = 1 / (e - 1);
|
|
8766
8853
|
return Array(e).fill(null).map((e, n) => t * n);
|
|
8767
8854
|
}
|
|
8768
|
-
function
|
|
8855
|
+
function si(e, t) {
|
|
8769
8856
|
let n = -1, r = NaN;
|
|
8770
8857
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
8771
|
-
let a =
|
|
8858
|
+
let a = ci(i, t);
|
|
8772
8859
|
if (isNaN(a)) continue;
|
|
8773
8860
|
let o = Math.abs(e - a);
|
|
8774
8861
|
(isNaN(r) || o < r) && (r = o, n = i);
|
|
8775
8862
|
}
|
|
8776
8863
|
return n;
|
|
8777
8864
|
}
|
|
8778
|
-
function
|
|
8865
|
+
function ci(e, t) {
|
|
8779
8866
|
return e >= t.length ? NaN : t[e];
|
|
8780
8867
|
}
|
|
8781
|
-
function
|
|
8868
|
+
function li(e, t) {
|
|
8782
8869
|
return t ? 1 - e : e;
|
|
8783
8870
|
}
|
|
8784
|
-
function
|
|
8871
|
+
function ui(e, t) {
|
|
8785
8872
|
return t ? 1 - e : e;
|
|
8786
8873
|
}
|
|
8787
|
-
function
|
|
8874
|
+
function di(e, t = 1, n = 0) {
|
|
8788
8875
|
return Math.max(n, Math.min(t, e));
|
|
8789
8876
|
}
|
|
8790
|
-
process.env.NODE_ENV === "development" && (
|
|
8877
|
+
process.env.NODE_ENV === "development" && ($.displayName = "StepSlider", $.Track.displayName = "StepSlider.Track", $.Knob.displayName = "StepSlider.Knob", $.KnobContainer.displayName = "StepSlider.KnobContainer", $.Label.displayName = "StepSlider.Label");
|
|
8791
8878
|
//#endregion
|
|
8792
8879
|
//#region src/primitives/SwipeRegion.tsx
|
|
8793
|
-
function
|
|
8880
|
+
function fi({ ref: e, children: t, threshold: n = .5, isEnabled: r = !0, onSwipeDown: i, onSwipeLeft: a, onSwipeRight: o, onSwipeUp: s, ...c }) {
|
|
8794
8881
|
let [l, u] = p(void 0), [d, f] = p(void 0), [m, h] = p(NaN), g = (e, t) => {
|
|
8795
8882
|
if (isNaN(e) || isNaN(t)) return y();
|
|
8796
8883
|
u(K.make(e, t));
|
|
@@ -8818,24 +8905,34 @@ function ii({ ref: e, children: t, threshold: n = .5, isEnabled: r = !0, onSwipe
|
|
|
8818
8905
|
children: t
|
|
8819
8906
|
});
|
|
8820
8907
|
}
|
|
8821
|
-
process.env.NODE_ENV === "development" && (
|
|
8908
|
+
process.env.NODE_ENV === "development" && (fi.displayName = "SwipeRegion");
|
|
8822
8909
|
//#endregion
|
|
8823
8910
|
//#region src/primitives/TextArea.tsx
|
|
8824
|
-
function
|
|
8825
|
-
|
|
8826
|
-
|
|
8827
|
-
|
|
8828
|
-
|
|
8911
|
+
function pi({ ref: e, autoFocus: t = !1, onChange: n, ...r }) {
|
|
8912
|
+
let i = e ?? f(null);
|
|
8913
|
+
return l(() => {
|
|
8914
|
+
if (!t) return;
|
|
8915
|
+
let e = i.current;
|
|
8916
|
+
if (!e) return;
|
|
8917
|
+
let n = setTimeout(() => {
|
|
8918
|
+
let t = e.value.length;
|
|
8919
|
+
e.focus({ preventScroll: !0 }), e.setSelectionRange(t, t);
|
|
8920
|
+
}, 0);
|
|
8921
|
+
return () => clearTimeout(n);
|
|
8922
|
+
}, [t]), /* @__PURE__ */ (0, O.jsx)("textarea", {
|
|
8923
|
+
...r,
|
|
8924
|
+
ref: i,
|
|
8925
|
+
onChange: (e) => n(e.target.value)
|
|
8829
8926
|
});
|
|
8830
8927
|
}
|
|
8831
|
-
process.env.NODE_ENV === "development" && (
|
|
8928
|
+
process.env.NODE_ENV === "development" && (pi.displayName = "TextArea");
|
|
8832
8929
|
//#endregion
|
|
8833
8930
|
//#region src/primitives/Toggle.tsx
|
|
8834
|
-
function
|
|
8931
|
+
function mi({ className: e, ref: t, style: n, children: r, orientation: i = "horizontal", isInverted: a = !1, isOn: o = !1, onChange: s, ...c }) {
|
|
8835
8932
|
let l = f(null), u = yt(l), d = j(r, {
|
|
8836
|
-
knob:
|
|
8837
|
-
track:
|
|
8838
|
-
}), p =
|
|
8933
|
+
knob: mi.Knob,
|
|
8934
|
+
track: mi.Track
|
|
8935
|
+
}), p = hi({ isOn: o }), m = gi({
|
|
8839
8936
|
knobSize: u,
|
|
8840
8937
|
orientation: i,
|
|
8841
8938
|
isInverted: a,
|
|
@@ -8854,7 +8951,7 @@ function oi({ className: e, ref: t, style: n, children: r, orientation: i = "hor
|
|
|
8854
8951
|
}), /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8855
8952
|
className: p.track,
|
|
8856
8953
|
style: m.track,
|
|
8857
|
-
element: d.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8954
|
+
element: d.track ?? /* @__PURE__ */ (0, O.jsx)(mi.Track, {}),
|
|
8858
8955
|
children: /* @__PURE__ */ (0, O.jsx)("div", {
|
|
8859
8956
|
style: {
|
|
8860
8957
|
height: "100%",
|
|
@@ -8865,7 +8962,7 @@ function oi({ className: e, ref: t, style: n, children: r, orientation: i = "hor
|
|
|
8865
8962
|
className: p.knob,
|
|
8866
8963
|
ref: l,
|
|
8867
8964
|
style: m.knob,
|
|
8868
|
-
element: d.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8965
|
+
element: d.knob ?? /* @__PURE__ */ (0, O.jsx)(mi.Knob, {})
|
|
8869
8966
|
})
|
|
8870
8967
|
})
|
|
8871
8968
|
})]
|
|
@@ -8879,15 +8976,15 @@ function oi({ className: e, ref: t, style: n, children: r, orientation: i = "hor
|
|
|
8879
8976
|
...t,
|
|
8880
8977
|
children: e
|
|
8881
8978
|
});
|
|
8882
|
-
})(
|
|
8883
|
-
function
|
|
8979
|
+
})(mi ||= {});
|
|
8980
|
+
function hi({ isOn: e = !1 }) {
|
|
8884
8981
|
return A({
|
|
8885
8982
|
knob: w({ active: e }),
|
|
8886
8983
|
root: w({ active: e }),
|
|
8887
8984
|
track: w({ active: e })
|
|
8888
8985
|
});
|
|
8889
8986
|
}
|
|
8890
|
-
function
|
|
8987
|
+
function gi({ knobSize: e = q.zero, orientation: t = "horizontal", isInverted: n = !1, isOn: r = !1 }) {
|
|
8891
8988
|
return M({
|
|
8892
8989
|
input: {
|
|
8893
8990
|
height: 0,
|
|
@@ -8917,40 +9014,40 @@ function ci({ knobSize: e = q.zero, orientation: t = "horizontal", isInverted: n
|
|
|
8917
9014
|
track: { position: "relative" }
|
|
8918
9015
|
});
|
|
8919
9016
|
}
|
|
8920
|
-
process.env.NODE_ENV === "development" && (
|
|
9017
|
+
process.env.NODE_ENV === "development" && (mi.displayName = "Toggle", mi.Knob.displayName = "Toggle.Knob", mi.Track.displayName = "Toggle.Track");
|
|
8921
9018
|
//#endregion
|
|
8922
9019
|
//#region src/providers/ScrollPositionProvider.tsx
|
|
8923
|
-
var
|
|
9020
|
+
var _i = {
|
|
8924
9021
|
current: K.zero,
|
|
8925
9022
|
end: K.zero,
|
|
8926
9023
|
progress: K.zero,
|
|
8927
9024
|
start: K.zero
|
|
8928
|
-
},
|
|
8929
|
-
function
|
|
8930
|
-
let [i, a] = p(!0), [o, s] = p(!1), [c, l] = p(
|
|
8931
|
-
return
|
|
9025
|
+
}, vi = a(_i), yi = a(!0), bi = a(!1);
|
|
9026
|
+
function xi({ children: e, scrollBottomOffset: t = 0, scrollTopOffset: n = 0, target: r }) {
|
|
9027
|
+
let [i, a] = p(!0), [o, s] = p(!1), [c, l] = p(_i);
|
|
9028
|
+
return pn(r, (e) => {
|
|
8932
9029
|
l(e), a(e.current.y <= e.start.y + n), s(e.current.y >= e.end.y - t);
|
|
8933
|
-
}), /* @__PURE__ */ (0, O.jsx)(
|
|
9030
|
+
}), /* @__PURE__ */ (0, O.jsx)(yi.Provider, {
|
|
8934
9031
|
value: i,
|
|
8935
|
-
children: /* @__PURE__ */ (0, O.jsx)(
|
|
9032
|
+
children: /* @__PURE__ */ (0, O.jsx)(bi.Provider, {
|
|
8936
9033
|
value: o,
|
|
8937
|
-
children: /* @__PURE__ */ (0, O.jsx)(
|
|
9034
|
+
children: /* @__PURE__ */ (0, O.jsx)(vi.Provider, {
|
|
8938
9035
|
value: c,
|
|
8939
9036
|
children: e
|
|
8940
9037
|
})
|
|
8941
9038
|
})
|
|
8942
9039
|
});
|
|
8943
9040
|
}
|
|
8944
|
-
function
|
|
8945
|
-
let e = s(
|
|
9041
|
+
function Si() {
|
|
9042
|
+
let e = s(yi);
|
|
8946
9043
|
return e === void 0 && console.warn("[etudes::useIsScrollTop] `useIsScrollTop` must be used within a `ScrollPositionProvider`"), e ?? !0;
|
|
8947
9044
|
}
|
|
8948
|
-
function
|
|
8949
|
-
let e = s(
|
|
9045
|
+
function Ci() {
|
|
9046
|
+
let e = s(bi);
|
|
8950
9047
|
return e === void 0 && console.warn("[etudes::useIsScrollBottom] `useIsScrollBottom` must be used within a `ScrollPositionProvider`"), e ?? !1;
|
|
8951
9048
|
}
|
|
8952
|
-
function
|
|
8953
|
-
let e = s(
|
|
9049
|
+
function wi() {
|
|
9050
|
+
let e = s(vi);
|
|
8954
9051
|
return e || console.warn("[etudes::useScrollPosition] `useScrollPosition` must be used within a `ScrollPositionProvider`"), e ?? {
|
|
8955
9052
|
current: K.zero,
|
|
8956
9053
|
end: K.zero,
|
|
@@ -8958,26 +9055,26 @@ function gi() {
|
|
|
8958
9055
|
start: K.zero
|
|
8959
9056
|
};
|
|
8960
9057
|
}
|
|
8961
|
-
process.env.NODE_ENV === "development" && (
|
|
9058
|
+
process.env.NODE_ENV === "development" && (xi.displayName = "ScrollPositionProvider", vi.displayName = "ScrollPositionContext", yi.displayName = "ScrollTopContext", bi.displayName = "ScrollBottomContext");
|
|
8962
9059
|
//#endregion
|
|
8963
9060
|
//#region src/utils/createKeyDeep.ts
|
|
8964
|
-
function
|
|
8965
|
-
return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(
|
|
9061
|
+
function Ti(e) {
|
|
9062
|
+
return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(Ti)) : typeof e == "object" ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => [e, Ti(t)])) : _t(e);
|
|
8966
9063
|
}
|
|
8967
9064
|
//#endregion
|
|
8968
9065
|
//#region src/utils/ExtractChildren.tsx
|
|
8969
|
-
function
|
|
9066
|
+
function Ei({ children: e, ...n }) {
|
|
8970
9067
|
return /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: t.map(e, (e) => o(e) ? N(e, { ...n }) : e) });
|
|
8971
9068
|
}
|
|
8972
|
-
process.env.NODE_ENV === "development" && (
|
|
9069
|
+
process.env.NODE_ENV === "development" && (Ei.displayName = "ExtractChildren");
|
|
8973
9070
|
//#endregion
|
|
8974
9071
|
//#region src/utils/getSystemColorScheme.ts
|
|
8975
|
-
function
|
|
9072
|
+
function Di() {
|
|
8976
9073
|
return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
8977
9074
|
}
|
|
8978
9075
|
//#endregion
|
|
8979
9076
|
//#region src/utils/NoSSR.tsx
|
|
8980
|
-
function
|
|
9077
|
+
function Oi({ children: e, fallback: t = void 0 }) {
|
|
8981
9078
|
let [n, i] = p(!1);
|
|
8982
9079
|
if (l(() => {
|
|
8983
9080
|
i(typeof window < "u");
|
|
@@ -8987,4 +9084,4 @@ function bi({ children: e, fallback: t = void 0 }) {
|
|
|
8987
9084
|
});
|
|
8988
9085
|
}
|
|
8989
9086
|
//#endregion
|
|
8990
|
-
export {
|
|
9087
|
+
export { Fn as Accordion, I as Burger, R as BurgerButton, ft as Button, Qn as Carousel, ur as CodeInput, An as Collection, kt as Conditional, gr as Counter, it as CoverImage, ut as CoverVideo, vr as Dial, Sr as Dropdown, At as Each, Nt as ExtractChild, Ei as ExtractChildren, Or as Form, nt as Image, Qe as ImageSource, Ar as MasonryGrid, Oi as NoSSR, ht as OptionButton, bt as Panorama, Et as PanoramaSlider, rt as Picture, Q as RangeSlider, k as Repeat, xi as ScrollPositionProvider, qr as ScrollableCarousel, Qr as Select, Ot as SelectableButton, ei as Slider, $ as StepSlider, P as Styled, fi as SwipeRegion, jt as Switch, pi as TextArea, hr as TextField, mi as Toggle, lt as Video, It as WithTooltip, A as asClassNameDict, j as asComponentDict, M as asStyleDict, N as cloneStyledElement, _t as createKey, Ti as createKeyDeep, tn as createLocalCache, vn as createSessionCache, wn as getStyle, Di as getSystemColorScheme, Zt as isTouchDevice, Pt as measureIntrinsicSize, Tn as setStyle, Ft as setStyles, F as styles, Vt as useClassName, Ht as useClickOutside, Ut as useCopyBlobToClipboard, Kt as useDPR, Wt as useDownloadBlob, qt as useDrag, Jt as useDropzone, $e as useImageLoader, et as useImageSize, vt as useInertiaDrag, Je as useIntersectionObserver, Yt as useInterval, Xt as useIsMounted, Ci as useIsScrollBottom, Si as useIsScrollTop, Qt as useIsTouchDevice, $t as useKeyboardShortcut, Z as useLatest, sn as useLocalCache, cn as useMouseEnter, ln as useMouseLeave, un as useOS, dn as usePrevious, Ze as useRect, fn as useRightClick, wi as useScrollPosition, pn as useScrollPositionObserver, Cn as useSessionCache, yt as useSize, Ye as useSizeObserver, En as useStyle, Dn as useSystemColorScheme, On as useTimeout, ot as useVideoMetadataLoader, st as useVideoSize, Xe as useViewportSize };
|