etudes 32.3.0 → 32.5.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 +399 -385
- package/build/etudes.umd.cjs +1 -1
- package/build/hooks/useImageLoader.d.ts +9 -19
- package/build/hooks/useImageSize.d.ts +10 -7
- package/build/hooks/useRightClick.d.ts +24 -0
- package/build/index.d.ts +1 -0
- package/package.json +12 -12
package/build/etudes.js
CHANGED
|
@@ -994,46 +994,42 @@ var Qe;
|
|
|
994
994
|
})(Qe ||= {});
|
|
995
995
|
//#endregion
|
|
996
996
|
//#region src/hooks/useImageLoader.ts
|
|
997
|
-
function $e(
|
|
998
|
-
let o =
|
|
997
|
+
function $e(e, { onError: t, onLoad: n, onLoadStart: r } = {}) {
|
|
998
|
+
let i = typeof e == "string" ? e : e[0], a = typeof e == "string" ? void 0 : e[1], o = a ? Qe.asProps(a) : void 0, s = f(void 0), c = Z(r), l = Z(n), d = Z(t);
|
|
999
999
|
u(() => {
|
|
1000
|
-
let
|
|
1001
|
-
if (
|
|
1002
|
-
let
|
|
1003
|
-
|
|
1004
|
-
},
|
|
1005
|
-
if (
|
|
1006
|
-
let
|
|
1007
|
-
|
|
1008
|
-
},
|
|
1009
|
-
return
|
|
1010
|
-
|
|
1000
|
+
let e = !1, t = (t) => {
|
|
1001
|
+
if (e) return;
|
|
1002
|
+
let n = t.currentTarget;
|
|
1003
|
+
l.current?.(n);
|
|
1004
|
+
}, n = (t) => {
|
|
1005
|
+
if (e) return;
|
|
1006
|
+
let n = t.currentTarget;
|
|
1007
|
+
d.current?.(n);
|
|
1008
|
+
}, r = new Image();
|
|
1009
|
+
return r.addEventListener("load", t), r.addEventListener("error", n), c.current?.(r), o?.srcSet && (r.srcset = o.srcSet), o?.sizes && (r.sizes = o.sizes), r.src = i, s.current = r, () => {
|
|
1010
|
+
e = !0, r.removeEventListener("load", t), r.removeEventListener("error", n), s.current = void 0;
|
|
1011
1011
|
};
|
|
1012
1012
|
}, [
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1013
|
+
i,
|
|
1014
|
+
o?.srcSet,
|
|
1015
|
+
o?.sizes
|
|
1016
1016
|
]);
|
|
1017
1017
|
}
|
|
1018
1018
|
//#endregion
|
|
1019
1019
|
//#region src/hooks/useImageSize.ts
|
|
1020
|
-
function et(
|
|
1021
|
-
let [
|
|
1022
|
-
|
|
1023
|
-
}, [
|
|
1024
|
-
|
|
1025
|
-
}, [])
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
},
|
|
1033
|
-
onError: g,
|
|
1034
|
-
onLoad: h,
|
|
1035
|
-
onLoadStart: m
|
|
1036
|
-
}), s;
|
|
1020
|
+
function et(e, { preservesSizeBetweenLoads: t = !0, onError: n, onLoad: r, onLoadStart: i } = {}) {
|
|
1021
|
+
let [a, o] = p(), s = Z(i), l = Z(r), u = Z(n), d = c((e) => {
|
|
1022
|
+
t || o(void 0), s.current?.(e);
|
|
1023
|
+
}, [t]), f = c((e) => {
|
|
1024
|
+
o(tt(e)), l.current?.(e);
|
|
1025
|
+
}, []);
|
|
1026
|
+
return $e(e, {
|
|
1027
|
+
onError: c((e) => {
|
|
1028
|
+
t || o(void 0), u.current?.(e);
|
|
1029
|
+
}, [t]),
|
|
1030
|
+
onLoad: f,
|
|
1031
|
+
onLoadStart: d
|
|
1032
|
+
}), a;
|
|
1037
1033
|
}
|
|
1038
1034
|
function tt(e) {
|
|
1039
1035
|
if (e && typeof e.width == "number" && typeof e.height == "number") return q.make(e.width, e.height);
|
|
@@ -1041,11 +1037,7 @@ function tt(e) {
|
|
|
1041
1037
|
//#endregion
|
|
1042
1038
|
//#region src/primitives/Image.tsx
|
|
1043
1039
|
function nt({ ref: e, alt: t, loadingMode: n, source: r, onError: i, onLoad: a, onLoadStart: o, onSizeChange: s, ...c }) {
|
|
1044
|
-
let u = typeof r == "string" ? r : r[0], d = typeof r == "string" ? void 0 : r[1], f = d ? Qe.asProps(d) : void 0, p = et({
|
|
1045
|
-
sizes: f?.sizes,
|
|
1046
|
-
src: u,
|
|
1047
|
-
srcSet: f?.srcSet
|
|
1048
|
-
}, {
|
|
1040
|
+
let u = typeof r == "string" ? r : r[0], d = typeof r == "string" ? void 0 : r[1], f = d ? Qe.asProps(d) : void 0, p = et(r, {
|
|
1049
1041
|
onError: i,
|
|
1050
1042
|
onLoad: a,
|
|
1051
1043
|
onLoadStart: o
|
|
@@ -4721,9 +4713,9 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4721
4713
|
function an(e) {
|
|
4722
4714
|
return e && e.replace(/\/.*$/, "");
|
|
4723
4715
|
}
|
|
4724
|
-
var on = new rn(),
|
|
4725
|
-
on.init(
|
|
4726
|
-
var
|
|
4716
|
+
var on = new rn(), Q = on.interactStatic, sn = typeof globalThis < "u" ? globalThis : window;
|
|
4717
|
+
on.init(sn);
|
|
4718
|
+
var cn = Object.freeze({
|
|
4727
4719
|
__proto__: null,
|
|
4728
4720
|
edgeTarget: function() {},
|
|
4729
4721
|
elements: function() {},
|
|
@@ -4758,13 +4750,13 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4758
4750
|
};
|
|
4759
4751
|
return n.grid = e, n.coordFields = t, n;
|
|
4760
4752
|
}
|
|
4761
|
-
}),
|
|
4753
|
+
}), ln = {
|
|
4762
4754
|
id: "snappers",
|
|
4763
4755
|
install: function(e) {
|
|
4764
4756
|
var t = e.interactStatic;
|
|
4765
|
-
t.snappers = W(t.snappers || {},
|
|
4757
|
+
t.snappers = W(t.snappers || {}, cn), t.createSnapGrid = t.snappers.grid;
|
|
4766
4758
|
}
|
|
4767
|
-
},
|
|
4759
|
+
}, un = {
|
|
4768
4760
|
start: function(e) {
|
|
4769
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;
|
|
4770
4762
|
s === "preserve" && (s = r.width / r.height), t.startCoords = W({}, a), t.startRect = W({}, r), t.ratio = s, t.equalDelta = u;
|
|
@@ -4790,7 +4782,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4790
4782
|
}
|
|
4791
4783
|
},
|
|
4792
4784
|
set: function(e) {
|
|
4793
|
-
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 ? dn : fn;
|
|
4794
4786
|
if (W(e.edges, a), s(t, t.xIsPrimaryAxis, i, r), !t.subModification) return null;
|
|
4795
4787
|
var c = W({}, r);
|
|
4796
4788
|
re(a, c, {
|
|
@@ -4813,11 +4805,11 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4813
4805
|
enabled: !1
|
|
4814
4806
|
}
|
|
4815
4807
|
};
|
|
4816
|
-
function
|
|
4808
|
+
function dn(e, t, n) {
|
|
4817
4809
|
var r = e.startCoords, i = e.edgeSign;
|
|
4818
4810
|
t ? n.y = r.y + (n.x - r.x) * i.y : n.x = r.x + (n.y - r.y) * i.x;
|
|
4819
4811
|
}
|
|
4820
|
-
function
|
|
4812
|
+
function fn(e, t, n, r) {
|
|
4821
4813
|
var i = e.startRect, a = e.startCoords, o = e.ratio, s = e.edgeSign;
|
|
4822
4814
|
if (t) {
|
|
4823
4815
|
var c = r.width / o;
|
|
@@ -4827,17 +4819,17 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4827
4819
|
n.x = a.x + (l - i.width) * s.x;
|
|
4828
4820
|
}
|
|
4829
4821
|
}
|
|
4830
|
-
var
|
|
4831
|
-
|
|
4832
|
-
var
|
|
4833
|
-
function
|
|
4822
|
+
var pn = yt(un, "aspectRatio"), mn = function() {};
|
|
4823
|
+
mn._defaults = {};
|
|
4824
|
+
var hn = mn;
|
|
4825
|
+
function gn(e, t, n) {
|
|
4834
4826
|
return S.func(e) ? te(e, t.interactable, t.element, [
|
|
4835
4827
|
n.x,
|
|
4836
4828
|
n.y,
|
|
4837
4829
|
t
|
|
4838
4830
|
]) : te(e, t.interactable, t.element);
|
|
4839
4831
|
}
|
|
4840
|
-
var
|
|
4832
|
+
var _n = {
|
|
4841
4833
|
start: function(e) {
|
|
4842
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({
|
|
4843
4835
|
left: 0,
|
|
@@ -4846,7 +4838,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4846
4838
|
bottom: 0
|
|
4847
4839
|
}, o.offset || {});
|
|
4848
4840
|
if (t && s) {
|
|
4849
|
-
var l =
|
|
4841
|
+
var l = gn(o.restriction, i, a);
|
|
4850
4842
|
if (l) {
|
|
4851
4843
|
var u = l.right - l.left - t.width, d = l.bottom - l.top - t.height;
|
|
4852
4844
|
u < 0 && (c.left += u, c.right += u), d < 0 && (c.top += d, c.bottom += d);
|
|
@@ -4856,7 +4848,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4856
4848
|
r.offset = c;
|
|
4857
4849
|
},
|
|
4858
4850
|
set: function(e) {
|
|
4859
|
-
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 = gn(i.restriction, n, t);
|
|
4860
4852
|
if (o) {
|
|
4861
4853
|
var s = function(e) {
|
|
4862
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;
|
|
@@ -4871,18 +4863,18 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4871
4863
|
endOnly: !1,
|
|
4872
4864
|
enabled: !1
|
|
4873
4865
|
}
|
|
4874
|
-
},
|
|
4866
|
+
}, vn = yt(_n, "restrict"), yn = {
|
|
4875
4867
|
top: Infinity,
|
|
4876
4868
|
left: Infinity,
|
|
4877
4869
|
bottom: -Infinity,
|
|
4878
4870
|
right: -Infinity
|
|
4879
|
-
},
|
|
4871
|
+
}, bn = {
|
|
4880
4872
|
top: -Infinity,
|
|
4881
4873
|
left: -Infinity,
|
|
4882
4874
|
bottom: Infinity,
|
|
4883
4875
|
right: Infinity
|
|
4884
4876
|
};
|
|
4885
|
-
function
|
|
4877
|
+
function xn(e, t) {
|
|
4886
4878
|
for (var n = 0, r = [
|
|
4887
4879
|
"top",
|
|
4888
4880
|
"left",
|
|
@@ -4894,12 +4886,12 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4894
4886
|
}
|
|
4895
4887
|
return e;
|
|
4896
4888
|
}
|
|
4897
|
-
var
|
|
4898
|
-
noInner:
|
|
4899
|
-
noOuter:
|
|
4889
|
+
var Sn = {
|
|
4890
|
+
noInner: yn,
|
|
4891
|
+
noOuter: bn,
|
|
4900
4892
|
start: function(e) {
|
|
4901
4893
|
var t, n = e.interaction, r = e.startOffset, i = e.state, a = i.options;
|
|
4902
|
-
a && (t = G(
|
|
4894
|
+
a && (t = G(gn(a.offset, n, n.coords.start.page))), t ||= {
|
|
4903
4895
|
x: 0,
|
|
4904
4896
|
y: 0
|
|
4905
4897
|
}, i.offset = {
|
|
@@ -4912,8 +4904,8 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4912
4904
|
set: function(e) {
|
|
4913
4905
|
var t = e.coords, n = e.edges, r = e.interaction, i = e.state, a = i.offset, o = i.options;
|
|
4914
4906
|
if (n) {
|
|
4915
|
-
var s = W({}, t), c =
|
|
4916
|
-
|
|
4907
|
+
var s = W({}, t), c = gn(o.inner, r, s) || {}, l = gn(o.outer, r, s) || {};
|
|
4908
|
+
xn(c, yn), xn(l, bn), 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));
|
|
4917
4909
|
}
|
|
4918
4910
|
},
|
|
4919
4911
|
defaults: {
|
|
@@ -4923,7 +4915,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4923
4915
|
endOnly: !1,
|
|
4924
4916
|
enabled: !1
|
|
4925
4917
|
}
|
|
4926
|
-
},
|
|
4918
|
+
}, Cn = yt(Sn, "restrictEdges"), wn = W({
|
|
4927
4919
|
get elementRect() {
|
|
4928
4920
|
return {
|
|
4929
4921
|
top: 0,
|
|
@@ -4933,29 +4925,29 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4933
4925
|
};
|
|
4934
4926
|
},
|
|
4935
4927
|
set elementRect(e) {}
|
|
4936
|
-
},
|
|
4937
|
-
start:
|
|
4938
|
-
set:
|
|
4939
|
-
defaults:
|
|
4940
|
-
}, "restrictRect"),
|
|
4928
|
+
}, _n.defaults), Tn = yt({
|
|
4929
|
+
start: _n.start,
|
|
4930
|
+
set: _n.set,
|
|
4931
|
+
defaults: wn
|
|
4932
|
+
}, "restrictRect"), En = {
|
|
4941
4933
|
width: -Infinity,
|
|
4942
4934
|
height: -Infinity
|
|
4943
|
-
},
|
|
4935
|
+
}, Dn = {
|
|
4944
4936
|
width: Infinity,
|
|
4945
4937
|
height: Infinity
|
|
4946
|
-
},
|
|
4938
|
+
}, On = yt({
|
|
4947
4939
|
start: function(e) {
|
|
4948
|
-
return
|
|
4940
|
+
return Sn.start(e);
|
|
4949
4941
|
},
|
|
4950
4942
|
set: function(e) {
|
|
4951
4943
|
var t = e.interaction, n = e.state, r = e.rect, i = e.edges, a = n.options;
|
|
4952
4944
|
if (i) {
|
|
4953
|
-
var o = ne(
|
|
4945
|
+
var o = ne(gn(a.min, t, e.coords)) || En, s = ne(gn(a.max, t, e.coords)) || Dn;
|
|
4954
4946
|
n.options = {
|
|
4955
4947
|
endOnly: a.endOnly,
|
|
4956
|
-
inner: W({},
|
|
4957
|
-
outer: W({},
|
|
4958
|
-
}, 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({}, Sn.noInner),
|
|
4949
|
+
outer: W({}, Sn.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), Sn.set(e), n.options = a;
|
|
4959
4951
|
}
|
|
4960
4952
|
},
|
|
4961
4953
|
defaults: {
|
|
@@ -4964,7 +4956,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
4964
4956
|
endOnly: !1,
|
|
4965
4957
|
enabled: !1
|
|
4966
4958
|
}
|
|
4967
|
-
}, "restrictSize"),
|
|
4959
|
+
}, "restrictSize"), kn = {
|
|
4968
4960
|
start: function(e) {
|
|
4969
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) {
|
|
4970
4962
|
var t = e.interaction.element;
|
|
@@ -5038,7 +5030,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5038
5030
|
endOnly: !1,
|
|
5039
5031
|
enabled: !1
|
|
5040
5032
|
}
|
|
5041
|
-
},
|
|
5033
|
+
}, An = yt(kn, "snap"), jn = {
|
|
5042
5034
|
start: function(e) {
|
|
5043
5035
|
var t = e.state, n = e.edges, r = t.options;
|
|
5044
5036
|
if (!n) return null;
|
|
@@ -5054,7 +5046,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5054
5046
|
y: 0
|
|
5055
5047
|
},
|
|
5056
5048
|
range: r.range
|
|
5057
|
-
} }, t.targetFields = t.targetFields || [["width", "height"], ["x", "y"]],
|
|
5049
|
+
} }, t.targetFields = t.targetFields || [["width", "height"], ["x", "y"]], kn.start(e), t.offsets = e.state.offsets, e.state = t;
|
|
5058
5050
|
},
|
|
5059
5051
|
set: function(e) {
|
|
5060
5052
|
var t = e.interaction, n = e.state, r = e.coords, i = n.options, a = n.offsets, o = {
|
|
@@ -5075,7 +5067,7 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5075
5067
|
n.options.targets.push(u);
|
|
5076
5068
|
}
|
|
5077
5069
|
}
|
|
5078
|
-
var g =
|
|
5070
|
+
var g = kn.set(e);
|
|
5079
5071
|
return n.options = i, g;
|
|
5080
5072
|
},
|
|
5081
5073
|
defaults: {
|
|
@@ -5085,19 +5077,19 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5085
5077
|
endOnly: !1,
|
|
5086
5078
|
enabled: !1
|
|
5087
5079
|
}
|
|
5088
|
-
},
|
|
5089
|
-
aspectRatio:
|
|
5090
|
-
restrictEdges:
|
|
5091
|
-
restrict:
|
|
5092
|
-
restrictRect:
|
|
5093
|
-
restrictSize:
|
|
5080
|
+
}, Mn = yt(jn, "snapSize"), Nn = {
|
|
5081
|
+
aspectRatio: pn,
|
|
5082
|
+
restrictEdges: Cn,
|
|
5083
|
+
restrict: vn,
|
|
5084
|
+
restrictRect: Tn,
|
|
5085
|
+
restrictSize: On,
|
|
5094
5086
|
snapEdges: yt({
|
|
5095
5087
|
start: function(e) {
|
|
5096
5088
|
var t = e.edges;
|
|
5097
|
-
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"]], jn.start(e)) : null;
|
|
5098
5090
|
},
|
|
5099
|
-
set:
|
|
5100
|
-
defaults: W(gt(
|
|
5091
|
+
set: jn.set,
|
|
5092
|
+
defaults: W(gt(jn.defaults), {
|
|
5101
5093
|
targets: void 0,
|
|
5102
5094
|
range: void 0,
|
|
5103
5095
|
offset: {
|
|
@@ -5106,18 +5098,18 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5106
5098
|
}
|
|
5107
5099
|
})
|
|
5108
5100
|
}, "snapEdges"),
|
|
5109
|
-
snap:
|
|
5110
|
-
snapSize:
|
|
5111
|
-
spring:
|
|
5112
|
-
avoid:
|
|
5113
|
-
transform:
|
|
5114
|
-
rubberband:
|
|
5101
|
+
snap: An,
|
|
5102
|
+
snapSize: Mn,
|
|
5103
|
+
spring: hn,
|
|
5104
|
+
avoid: hn,
|
|
5105
|
+
transform: hn,
|
|
5106
|
+
rubberband: hn
|
|
5115
5107
|
}, Pn = {
|
|
5116
5108
|
id: "modifiers",
|
|
5117
5109
|
install: function(e) {
|
|
5118
5110
|
var t = e.interactStatic;
|
|
5119
|
-
for (var n in e.usePlugin(xt), e.usePlugin(
|
|
5120
|
-
var r =
|
|
5111
|
+
for (var n in e.usePlugin(xt), e.usePlugin(ln), t.modifiers = Nn, Nn) {
|
|
5112
|
+
var r = Nn[n], i = r._defaults;
|
|
5121
5113
|
i._methods = r._methods, e.defaults.perAction[n] = i;
|
|
5122
5114
|
}
|
|
5123
5115
|
}
|
|
@@ -5387,12 +5379,12 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5387
5379
|
}
|
|
5388
5380
|
}
|
|
5389
5381
|
};
|
|
5390
|
-
if (
|
|
5382
|
+
if (Q.use(mt), Q.use(Nt), Q.use({
|
|
5391
5383
|
id: "pointer-events",
|
|
5392
5384
|
install: function(e) {
|
|
5393
5385
|
e.usePlugin(Bn), e.usePlugin(Hn), e.usePlugin(Un);
|
|
5394
5386
|
}
|
|
5395
|
-
}),
|
|
5387
|
+
}), Q.use(zt), Q.use(Pn), Q.use(dt), Q.use(We), Q.use(Z), Q.use({
|
|
5396
5388
|
id: "reflow",
|
|
5397
5389
|
install: function(e) {
|
|
5398
5390
|
var t = e.Interactable;
|
|
@@ -5489,10 +5481,10 @@ var gt = /* @__PURE__ */ S((/* @__PURE__ */ b(((e, t) => {
|
|
|
5489
5481
|
e.splice(e.indexOf(t), 1);
|
|
5490
5482
|
}(t.interactions.list, n));
|
|
5491
5483
|
} }
|
|
5492
|
-
}),
|
|
5493
|
-
t.exports =
|
|
5484
|
+
}), Q.default = Q, (t === void 0 ? "undefined" : r(t)) === "object" && t) try {
|
|
5485
|
+
t.exports = Q;
|
|
5494
5486
|
} catch {}
|
|
5495
|
-
return
|
|
5487
|
+
return Q.default = Q, Q;
|
|
5496
5488
|
}));
|
|
5497
5489
|
})))(), 1);
|
|
5498
5490
|
function _t(e) {
|
|
@@ -5545,7 +5537,7 @@ function yt(e) {
|
|
|
5545
5537
|
//#endregion
|
|
5546
5538
|
//#region src/primitives/Panorama.tsx
|
|
5547
5539
|
function bt({ ref: e, angle: t = 0, speed: n = 1, src: r, zeroAnchor: i = 0, onAngleChange: a, onDragEnd: o, onDragStart: s, onImageSizeChange: d, onLoadImageComplete: p, onLoadImageError: m, onLoadImageStart: h, onPositionChange: g, ..._ }) {
|
|
5548
|
-
let v = f(null), y = yt(v), b = et(
|
|
5540
|
+
let v = f(null), y = yt(v), b = et(r, {
|
|
5549
5541
|
onError: m,
|
|
5550
5542
|
onLoad: p,
|
|
5551
5543
|
onLoadStart: h
|
|
@@ -6084,9 +6076,11 @@ function Ht(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6084
6076
|
e = !t(n.target);
|
|
6085
6077
|
}, o = (n) => {
|
|
6086
6078
|
!e || t(n.target) || (e = !1, r.current());
|
|
6079
|
+
}, s = (n) => {
|
|
6080
|
+
!e || t(n.target) || (n.preventDefault(), e = !1, r.current());
|
|
6087
6081
|
};
|
|
6088
|
-
return window.addEventListener("pointerdown", a, !0), window.addEventListener("click", o, !0), () => {
|
|
6089
|
-
window.removeEventListener("pointerdown", a, !0), window.removeEventListener("click", o, !0);
|
|
6082
|
+
return window.addEventListener("pointerdown", a, !0), window.addEventListener("click", o, !0), window.addEventListener("contextmenu", s, !0), () => {
|
|
6083
|
+
window.removeEventListener("pointerdown", a, !0), window.removeEventListener("click", o, !0), window.removeEventListener("contextmenu", s, !0);
|
|
6090
6084
|
};
|
|
6091
6085
|
}, [...[].concat(e).map((e) => e && "current" in e ? e.current : void 0), n]);
|
|
6092
6086
|
}
|
|
@@ -6301,12 +6295,12 @@ function on(e, t, n) {
|
|
|
6301
6295
|
}
|
|
6302
6296
|
//#endregion
|
|
6303
6297
|
//#region src/hooks/useLocalCache.ts
|
|
6304
|
-
function
|
|
6298
|
+
function Q(e) {
|
|
6305
6299
|
return d(() => tn({ defaultTTL: e }), [e]);
|
|
6306
6300
|
}
|
|
6307
6301
|
//#endregion
|
|
6308
6302
|
//#region src/hooks/useMouseEnter.ts
|
|
6309
|
-
function
|
|
6303
|
+
function sn(e, t, { isEnabled: n = !0 } = {}) {
|
|
6310
6304
|
let r = Z(t);
|
|
6311
6305
|
u(() => {
|
|
6312
6306
|
if (!n) return;
|
|
@@ -6323,7 +6317,7 @@ function cn(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6323
6317
|
}
|
|
6324
6318
|
//#endregion
|
|
6325
6319
|
//#region src/hooks/useMouseLeave.ts
|
|
6326
|
-
function
|
|
6320
|
+
function cn(e, t, { isEnabled: n = !0 } = {}) {
|
|
6327
6321
|
let r = Z(t);
|
|
6328
6322
|
u(() => {
|
|
6329
6323
|
if (!n) return;
|
|
@@ -6340,7 +6334,7 @@ function ln(e, t, { isEnabled: n = !0 } = {}) {
|
|
|
6340
6334
|
}
|
|
6341
6335
|
//#endregion
|
|
6342
6336
|
//#region src/hooks/useOS.ts
|
|
6343
|
-
function
|
|
6337
|
+
function ln() {
|
|
6344
6338
|
let e = navigator.userAgent || navigator.vendor || window.opera;
|
|
6345
6339
|
return d(() => {
|
|
6346
6340
|
switch (!0) {
|
|
@@ -6355,13 +6349,33 @@ function un() {
|
|
|
6355
6349
|
}
|
|
6356
6350
|
//#endregion
|
|
6357
6351
|
//#region src/hooks/usePrevious.ts
|
|
6358
|
-
function
|
|
6352
|
+
function un(e, t) {
|
|
6359
6353
|
let n = f(t);
|
|
6360
6354
|
return u(() => {
|
|
6361
6355
|
n.current = e;
|
|
6362
6356
|
}, [e]), n.current;
|
|
6363
6357
|
}
|
|
6364
6358
|
//#endregion
|
|
6359
|
+
//#region src/hooks/useRightClick.ts
|
|
6360
|
+
function dn(e, t, n = {}) {
|
|
6361
|
+
let r = Z(typeof e == "function" ? e : typeof t == "function" ? t : () => {}), i = typeof e == "function" ? void 0 : e && "current" in e ? e.current : e, { isEnabled: a = !0 } = typeof t == "function" ? n : t ?? {}, o = typeof e == "function";
|
|
6362
|
+
l(() => {
|
|
6363
|
+
if (!a) return;
|
|
6364
|
+
let e = (e) => {
|
|
6365
|
+
e.preventDefault(), r.current?.();
|
|
6366
|
+
};
|
|
6367
|
+
return o ? (window.addEventListener("contextmenu", e), () => {
|
|
6368
|
+
window.removeEventListener("contextmenu", e);
|
|
6369
|
+
}) : (i?.addEventListener("contextmenu", e), () => {
|
|
6370
|
+
i?.removeEventListener("contextmenu", e);
|
|
6371
|
+
});
|
|
6372
|
+
}, [
|
|
6373
|
+
o,
|
|
6374
|
+
i,
|
|
6375
|
+
a
|
|
6376
|
+
]);
|
|
6377
|
+
}
|
|
6378
|
+
//#endregion
|
|
6365
6379
|
//#region src/hooks/useScrollPositionObserver.ts
|
|
6366
6380
|
function fn(...e) {
|
|
6367
6381
|
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);
|
|
@@ -6685,8 +6699,8 @@ function Nn({ itemLength: e = NaN, itemPadding: t = 0, layout: n = "collection",
|
|
|
6685
6699
|
process.env.NODE_ENV === "development" && (kn.displayName = "Collection", kn.Item.displayName = "Collection.Item");
|
|
6686
6700
|
//#endregion
|
|
6687
6701
|
//#region src/primitives/Accordion.tsx
|
|
6688
|
-
function
|
|
6689
|
-
let C =
|
|
6702
|
+
function Pn({ 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 }) {
|
|
6703
|
+
let C = Rn(l ?? {}, c), T = Ln(r ?? [], c), E = Bn({ 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) => {
|
|
6690
6704
|
let t;
|
|
6691
6705
|
t = M(e) ? (t) => t.filter((t) => t !== e) : d ? (t) => [e] : (t) => [...t.filter((t) => t !== e), e], R(T, t(T));
|
|
6692
6706
|
}, I = (e, t) => {
|
|
@@ -6696,7 +6710,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
|
|
|
6696
6710
|
case "multiple":
|
|
6697
6711
|
n = (n) => ({
|
|
6698
6712
|
...n,
|
|
6699
|
-
[t]:
|
|
6713
|
+
[t]: zn([...(n[t] ?? []).filter((t) => t !== e), e])
|
|
6700
6714
|
});
|
|
6701
6715
|
break;
|
|
6702
6716
|
case "single":
|
|
@@ -6723,11 +6737,11 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
|
|
|
6723
6737
|
}
|
|
6724
6738
|
r.forEach((e) => h?.(e[0], e[1])), i.forEach((e) => b?.(e[0], e[1])), x?.(t);
|
|
6725
6739
|
}, B = j(n, {
|
|
6726
|
-
collapseIcon:
|
|
6727
|
-
expandIcon:
|
|
6728
|
-
header:
|
|
6729
|
-
item:
|
|
6730
|
-
section:
|
|
6740
|
+
collapseIcon: Pn.CollapseIcon,
|
|
6741
|
+
expandIcon: Pn.ExpandIcon,
|
|
6742
|
+
header: Pn.Header,
|
|
6743
|
+
item: Pn.Item,
|
|
6744
|
+
section: Pn.Section
|
|
6731
6745
|
});
|
|
6732
6746
|
return /* @__PURE__ */ (0, O.jsx)("div", {
|
|
6733
6747
|
ref: e,
|
|
@@ -6745,7 +6759,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
|
|
|
6745
6759
|
marginLeft: t === 0 ? "0px" : `${s}px`,
|
|
6746
6760
|
...S.width > 0 ? { width: `${T}px` } : { visibility: "hidden" }
|
|
6747
6761
|
}),
|
|
6748
|
-
element: B.section ?? /* @__PURE__ */ (0, O.jsx)(
|
|
6762
|
+
element: B.section ?? /* @__PURE__ */ (0, O.jsx)(Pn.Section, {}),
|
|
6749
6763
|
children: [/* @__PURE__ */ (0, O.jsx)("div", {
|
|
6750
6764
|
ref: D[t],
|
|
6751
6765
|
style: F(E.headerContainer),
|
|
@@ -6769,7 +6783,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
|
|
|
6769
6783
|
}),
|
|
6770
6784
|
style: F(E.header),
|
|
6771
6785
|
"aria-expanded": !x,
|
|
6772
|
-
element: B.header ?? /* @__PURE__ */ (0, O.jsx)(
|
|
6786
|
+
element: B.header ?? /* @__PURE__ */ (0, O.jsx)(Pn.Header, {}),
|
|
6773
6787
|
role: "button",
|
|
6774
6788
|
onClick: () => N(t),
|
|
6775
6789
|
children: [/* @__PURE__ */ (0, O.jsx)("span", { dangerouslySetInnerHTML: { __html: e.label } }), B.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
@@ -6814,7 +6828,7 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
|
|
|
6814
6828
|
onCustomEvent: (e, n, r) => y?.(e, t, n, r),
|
|
6815
6829
|
onDeselectAt: (e) => L(e, t),
|
|
6816
6830
|
onSelectAt: (e) => I(e, t),
|
|
6817
|
-
children: !a && (B.item ?? /* @__PURE__ */ (0, O.jsx)(
|
|
6831
|
+
children: !a && (B.item ?? /* @__PURE__ */ (0, O.jsx)(Pn.Item, {}))
|
|
6818
6832
|
})
|
|
6819
6833
|
})]
|
|
6820
6834
|
});
|
|
@@ -6836,29 +6850,29 @@ function Q({ ref: e, style: t, children: n, expandedSectionIndices: r, HeaderCom
|
|
|
6836
6850
|
...t,
|
|
6837
6851
|
children: e
|
|
6838
6852
|
}), e.Item = kn.Item;
|
|
6839
|
-
})(
|
|
6840
|
-
function
|
|
6853
|
+
})(Pn ||= {});
|
|
6854
|
+
function Fn(e, t) {
|
|
6841
6855
|
return e >= t.length || e < 0;
|
|
6842
6856
|
}
|
|
6843
|
-
function
|
|
6844
|
-
return !!(
|
|
6845
|
-
}
|
|
6846
|
-
function In(e, t) {
|
|
6847
|
-
return Rn(e).filter((e) => !Pn(e, t));
|
|
6857
|
+
function In(e, t, n) {
|
|
6858
|
+
return !!(Fn(t, n) || e >= (n[t].items ?? []).length || e < 0);
|
|
6848
6859
|
}
|
|
6849
6860
|
function Ln(e, t) {
|
|
6861
|
+
return zn(e).filter((e) => !Fn(e, t));
|
|
6862
|
+
}
|
|
6863
|
+
function Rn(e, t) {
|
|
6850
6864
|
let n = {};
|
|
6851
6865
|
for (let r in t) {
|
|
6852
6866
|
if (!Object.hasOwn(t, r)) continue;
|
|
6853
|
-
let i =
|
|
6854
|
-
n[Number(r)] =
|
|
6867
|
+
let i = zn([...e[r] ?? []]);
|
|
6868
|
+
n[Number(r)] = zn(i).filter((e) => !In(e, Number(r), t));
|
|
6855
6869
|
}
|
|
6856
6870
|
return n;
|
|
6857
6871
|
}
|
|
6858
|
-
function
|
|
6872
|
+
function zn(e) {
|
|
6859
6873
|
return e.sort((e, t) => e - t);
|
|
6860
6874
|
}
|
|
6861
|
-
function
|
|
6875
|
+
function Bn({ orientation: e = "vertical" }) {
|
|
6862
6876
|
return M({
|
|
6863
6877
|
collapseIcon: {
|
|
6864
6878
|
pointerEvents: "none",
|
|
@@ -6910,16 +6924,16 @@ function zn({ orientation: e = "vertical" }) {
|
|
|
6910
6924
|
}
|
|
6911
6925
|
});
|
|
6912
6926
|
}
|
|
6913
|
-
process.env.NODE_ENV === "development" && (
|
|
6927
|
+
process.env.NODE_ENV === "development" && (Pn.displayName = "Accordion", Pn.Header.displayName = "Accordion.Header", Pn.ExpandIcon.displayName = "Accordion.ExpandIcon", Pn.CollapseIcon.displayName = "Accordion.CollapseIcon", Pn.Item.displayName = "Accordion.Item");
|
|
6914
6928
|
//#endregion
|
|
6915
6929
|
//#region src/primitives/Carousel.tsx
|
|
6916
|
-
var
|
|
6917
|
-
function
|
|
6918
|
-
let b = f(null), x = f(null), S = f(0), C = f(0), w = f(0), T = f(0), E = f([]), D = f(0), k = f(0), A = f(0), M = f(0), N = f("idle"), I = f(null), L = f(!1), R = f(0), z = Z(g), B = Z(_), V = Z(v), [H, U] = p(), [W, ee] = p(!1), te =
|
|
6919
|
-
content:
|
|
6920
|
-
itemContainer:
|
|
6921
|
-
viewport:
|
|
6922
|
-
}), ne = t.toArray(G.content?.props.children), re = ne.length, ie =
|
|
6930
|
+
var Vn = .55, Hn = .05, Un = .55, Wn = .5, Gn = .02, Kn = 100, qn = 1e3 / 60;
|
|
6931
|
+
function Jn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1, dragStartThreshold: a = 5, index: o = 0, orientation: s = "horizontal", overscrollResistance: c = .7, swipeLiftWindow: d = 100, swipeVelocityThreshold: m = .4, shouldTrackExposure: h = !1, onAutoAdvancePause: g, onAutoAdvanceResume: _, onIndexChange: v, ...y }) {
|
|
6932
|
+
let b = f(null), x = f(null), S = f(0), C = f(0), w = f(0), T = f(0), E = f([]), D = f(0), k = f(0), A = f(0), M = f(0), N = f("idle"), I = f(null), L = f(!1), R = f(0), z = Z(g), B = Z(_), V = Z(v), [H, U] = p(), [W, ee] = p(!1), te = un(W, W), G = j(r, {
|
|
6933
|
+
content: Jn.Content,
|
|
6934
|
+
itemContainer: Jn.ItemContainer,
|
|
6935
|
+
viewport: Jn.Viewport
|
|
6936
|
+
}), ne = t.toArray(G.content?.props.children), re = ne.length, ie = Xn(o, re), { height: ae, width: oe } = yt(b), se = s === "horizontal" ? oe : ae, ce = -se * Math.max(0, re - 1), le = f(void 0);
|
|
6923
6937
|
le.current = {
|
|
6924
6938
|
dragSpeed: i,
|
|
6925
6939
|
dragStartThreshold: a,
|
|
@@ -6943,19 +6957,19 @@ function qn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
|
|
|
6943
6957
|
}, de = () => {
|
|
6944
6958
|
let e = le.current;
|
|
6945
6959
|
if (!e.shouldTrackExposure) return;
|
|
6946
|
-
let t =
|
|
6947
|
-
U((e) =>
|
|
6960
|
+
let t = Qn(S.current, e.viewportLength, e.itemCount);
|
|
6961
|
+
U((e) => Zn(e, t) ? e : t);
|
|
6948
6962
|
}, fe = () => {
|
|
6949
6963
|
T.current ||= requestAnimationFrame(me);
|
|
6950
6964
|
}, pe = () => {
|
|
6951
6965
|
T.current &&= (cancelAnimationFrame(T.current), 0);
|
|
6952
6966
|
}, me = () => {
|
|
6953
|
-
let { maxDisplacement: e, minDisplacement: t, orientation: n } = le.current, r = w.current, i = (r - S.current) *
|
|
6954
|
-
if (C.current = C.current *
|
|
6955
|
-
S.current = r, C.current = 0, T.current = 0,
|
|
6967
|
+
let { maxDisplacement: e, minDisplacement: t, orientation: n } = le.current, r = w.current, i = (r - S.current) * Hn;
|
|
6968
|
+
if (C.current = C.current * Vn + i, S.current += C.current, (S.current > e || S.current < t) && (C.current *= Un), Math.abs(C.current) < Gn && Math.abs(r - S.current) < Wn) {
|
|
6969
|
+
S.current = r, C.current = 0, T.current = 0, Yn(x.current, r, n), de();
|
|
6956
6970
|
return;
|
|
6957
6971
|
}
|
|
6958
|
-
|
|
6972
|
+
Yn(x.current, S.current, n), de(), T.current = requestAnimationFrame(me);
|
|
6959
6973
|
};
|
|
6960
6974
|
return u(() => {
|
|
6961
6975
|
let e = b.current;
|
|
@@ -6982,12 +6996,12 @@ function qn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
|
|
|
6982
6996
|
}
|
|
6983
6997
|
}
|
|
6984
6998
|
let c = o === "horizontal" ? t.clientX : t.clientY, l = (c - k.current) * n;
|
|
6985
|
-
S.current =
|
|
6999
|
+
S.current = $n(D.current + l, a, i, s), Yn(x.current, S.current, o), de(), Math.abs(l) > r && (L.current = !0);
|
|
6986
7000
|
let u = performance.now(), d = E.current;
|
|
6987
7001
|
for (d.push({
|
|
6988
7002
|
p: c,
|
|
6989
7003
|
t: u
|
|
6990
|
-
}); d.length > 0 && u - d[0].t >
|
|
7004
|
+
}); d.length > 0 && u - d[0].t > Kn;) d.shift();
|
|
6991
7005
|
}, r = (t) => {
|
|
6992
7006
|
if (I.current !== t.pointerId) return;
|
|
6993
7007
|
e.hasPointerCapture(t.pointerId) && e.releasePointerCapture(t.pointerId), I.current = null;
|
|
@@ -7001,8 +7015,8 @@ function qn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
|
|
|
7001
7015
|
let e = l[0], t = l[l.length - 1], n = t.t - e.t;
|
|
7002
7016
|
n > 0 && (d = (t.p - e.p) / n);
|
|
7003
7017
|
}
|
|
7004
|
-
let f =
|
|
7005
|
-
E.current = [], w.current = -c * f, C.current = d * r *
|
|
7018
|
+
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);
|
|
7019
|
+
E.current = [], w.current = -c * f, C.current = d * r * qn, fe(), ee(!1), f !== a && V.current?.(f);
|
|
7006
7020
|
}, i = (e) => {
|
|
7007
7021
|
let t = N.current;
|
|
7008
7022
|
(t === "pending" || t === "axis") && e.cancelable && e.preventDefault();
|
|
@@ -7013,7 +7027,7 @@ function qn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
|
|
|
7013
7027
|
}, []), u(() => {
|
|
7014
7028
|
if (W || se <= 0) return;
|
|
7015
7029
|
let e = -se * ie, t = R.current !== se;
|
|
7016
|
-
R.current = se, w.current = e, t ? (pe(), S.current = e, C.current = 0,
|
|
7030
|
+
R.current = se, w.current = e, t ? (pe(), S.current = e, C.current = 0, Yn(x.current, e, s), de()) : (S.current !== e || C.current !== 0) && fe();
|
|
7017
7031
|
}, [
|
|
7018
7032
|
ie,
|
|
7019
7033
|
se,
|
|
@@ -7035,30 +7049,30 @@ function qn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
|
|
|
7035
7049
|
onClick: ue,
|
|
7036
7050
|
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7037
7051
|
ref: b,
|
|
7038
|
-
style: F(
|
|
7052
|
+
style: F(er.viewport, {
|
|
7039
7053
|
cursor: W ? "grabbing" : "grab",
|
|
7040
7054
|
touchAction: re > 1 ? s === "horizontal" ? "pan-y" : "pan-x" : "auto"
|
|
7041
7055
|
}),
|
|
7042
|
-
element: G.viewport ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7056
|
+
element: G.viewport ?? /* @__PURE__ */ (0, O.jsx)(Jn.Viewport, {}),
|
|
7043
7057
|
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7044
7058
|
ref: x,
|
|
7045
7059
|
style: {
|
|
7046
|
-
|
|
7060
|
+
...er.content,
|
|
7047
7061
|
flexDirection: s === "horizontal" ? "row" : "column"
|
|
7048
7062
|
},
|
|
7049
|
-
element: G.content ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7063
|
+
element: G.content ?? /* @__PURE__ */ (0, O.jsx)(Jn.Content, {}),
|
|
7050
7064
|
children: ne.map((e, t) => {
|
|
7051
7065
|
let n = e.key ?? t, r = H?.[t], i = t === ie;
|
|
7052
|
-
return /* @__PURE__ */ (0, O.jsx)(
|
|
7066
|
+
return /* @__PURE__ */ (0, O.jsx)(Jn.ItemContext, {
|
|
7053
7067
|
value: {
|
|
7054
7068
|
exposure: r,
|
|
7055
7069
|
index: t,
|
|
7056
7070
|
isActive: i
|
|
7057
7071
|
},
|
|
7058
7072
|
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7059
|
-
style: F(
|
|
7073
|
+
style: F(er.itemContainer),
|
|
7060
7074
|
"aria-hidden": !i,
|
|
7061
|
-
element: G.itemContainer ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7075
|
+
element: G.itemContainer ?? /* @__PURE__ */ (0, O.jsx)(Jn.ItemContainer, {}),
|
|
7062
7076
|
children: e
|
|
7063
7077
|
})
|
|
7064
7078
|
}, n);
|
|
@@ -7085,20 +7099,20 @@ function qn({ ref: e, autoAdvanceInterval: n = 0, children: r, dragSpeed: i = 1,
|
|
|
7085
7099
|
return e;
|
|
7086
7100
|
}
|
|
7087
7101
|
e.useItem = n;
|
|
7088
|
-
})(
|
|
7089
|
-
function
|
|
7102
|
+
})(Jn ||= {});
|
|
7103
|
+
function Yn(e, t, n) {
|
|
7090
7104
|
e && (n === "horizontal" ? e.style.transform = `translate3d(${t}px,0,0)` : e.style.transform = `translate3d(0,${t}px,0)`);
|
|
7091
7105
|
}
|
|
7092
|
-
function
|
|
7106
|
+
function Xn(e, t) {
|
|
7093
7107
|
return t <= 0 ? 0 : Math.max(0, Math.min(t - 1, e));
|
|
7094
7108
|
}
|
|
7095
|
-
function
|
|
7109
|
+
function Zn(e, t) {
|
|
7096
7110
|
if (e === t) return !0;
|
|
7097
7111
|
if (!e || !t || e.length !== t.length) return !1;
|
|
7098
7112
|
for (let n = 0; n < e.length; n++) if (e[n] !== t[n]) return !1;
|
|
7099
7113
|
return !0;
|
|
7100
7114
|
}
|
|
7101
|
-
function
|
|
7115
|
+
function Qn(e, t, n) {
|
|
7102
7116
|
if (n <= 0) return [];
|
|
7103
7117
|
if (t <= 0) return Array(n).fill(0);
|
|
7104
7118
|
let r = [];
|
|
@@ -7108,11 +7122,11 @@ function Zn(e, t, n) {
|
|
|
7108
7122
|
}
|
|
7109
7123
|
return r;
|
|
7110
7124
|
}
|
|
7111
|
-
function
|
|
7125
|
+
function $n(e, t, n, r) {
|
|
7112
7126
|
let i = 1 - r;
|
|
7113
7127
|
return e > n ? n + (e - n) * i : e < t ? t + (e - t) * i : e;
|
|
7114
7128
|
}
|
|
7115
|
-
var
|
|
7129
|
+
var er = M({
|
|
7116
7130
|
content: {
|
|
7117
7131
|
alignItems: "center",
|
|
7118
7132
|
display: "flex",
|
|
@@ -7137,15 +7151,15 @@ var $n = M({
|
|
|
7137
7151
|
width: "100%"
|
|
7138
7152
|
}
|
|
7139
7153
|
});
|
|
7140
|
-
process.env.NODE_ENV === "development" && (
|
|
7154
|
+
process.env.NODE_ENV === "development" && (Jn.displayName = "Carousel", Jn.Viewport.displayName = "Carousel.Viewport", Jn.Content.displayName = "Carousel.Content", Jn.ItemContainer.displayName = "Carousel.ItemContainer");
|
|
7141
7155
|
//#endregion
|
|
7142
7156
|
//#region src/primitives/CodeInput.tsx
|
|
7143
|
-
function
|
|
7144
|
-
let h =
|
|
7157
|
+
function tr({ 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 }) {
|
|
7158
|
+
let h = rr(c, s), g = f([]), _ = nr(), v = j(i, { field: tr.Field }), y = (e) => {
|
|
7145
7159
|
e < 0 ? g.current[0]?.focus() : e >= s ? g.current[s - 1]?.focus() : g.current[e]?.focus();
|
|
7146
7160
|
}, b = (e) => (t) => {
|
|
7147
|
-
let n = h[e], r =
|
|
7148
|
-
p(
|
|
7161
|
+
let n = h[e], r = ar(t.target.value, n);
|
|
7162
|
+
p(ir(h.slice(), r.split("").slice(0, s), e)), y(Math.min(e + r.length, s - 1));
|
|
7149
7163
|
}, x = (e) => (t) => {
|
|
7150
7164
|
switch (t.key) {
|
|
7151
7165
|
case "ArrowLeft":
|
|
@@ -7165,7 +7179,7 @@ function er({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
|
|
|
7165
7179
|
}, S = (e) => (t) => {
|
|
7166
7180
|
t.preventDefault();
|
|
7167
7181
|
let n = t.clipboardData.getData("text").trim();
|
|
7168
|
-
p(
|
|
7182
|
+
p(ir(h.slice(), n.split("").slice(0, s), e)), y(Math.min(e + n.length, s - 1));
|
|
7169
7183
|
};
|
|
7170
7184
|
return l(() => {
|
|
7171
7185
|
if (!r) return;
|
|
@@ -7184,7 +7198,7 @@ function er({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
|
|
|
7184
7198
|
"aria-required": d,
|
|
7185
7199
|
autoComplete: n,
|
|
7186
7200
|
disabled: u,
|
|
7187
|
-
element: v.field ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7201
|
+
element: v.field ?? /* @__PURE__ */ (0, O.jsx)(tr.Field, {}),
|
|
7188
7202
|
inputMode: a,
|
|
7189
7203
|
placeholder: o,
|
|
7190
7204
|
required: d,
|
|
@@ -7203,8 +7217,8 @@ function er({ ref: e, style: t, autoComplete: n = "one-time-code", autoFocus: r
|
|
|
7203
7217
|
autoCorrect: "off",
|
|
7204
7218
|
type: "text"
|
|
7205
7219
|
});
|
|
7206
|
-
})(
|
|
7207
|
-
function
|
|
7220
|
+
})(tr ||= {});
|
|
7221
|
+
function nr() {
|
|
7208
7222
|
return M({
|
|
7209
7223
|
field: {
|
|
7210
7224
|
caretColor: "transparent",
|
|
@@ -7218,24 +7232,24 @@ function tr() {
|
|
|
7218
7232
|
}
|
|
7219
7233
|
});
|
|
7220
7234
|
}
|
|
7221
|
-
function
|
|
7235
|
+
function rr(e, t) {
|
|
7222
7236
|
let n = e.slice(0, t);
|
|
7223
7237
|
for (; n.length < t;) n.push("");
|
|
7224
7238
|
return n;
|
|
7225
7239
|
}
|
|
7226
|
-
function
|
|
7240
|
+
function ir(e, t, n = 0) {
|
|
7227
7241
|
let r = n, i = 0;
|
|
7228
7242
|
for (; i < t.length && r < e.length;) e[r] = t[i], r++, i++;
|
|
7229
7243
|
for (; i < t.length;) e.shift(), e.push(t[i]), i++;
|
|
7230
7244
|
return e;
|
|
7231
7245
|
}
|
|
7232
|
-
function
|
|
7246
|
+
function ar(e, t) {
|
|
7233
7247
|
return t === "" ? e : e.startsWith(t) ? e.slice(t.length) : e.endsWith(t) ? e.slice(0, -t.length) : e;
|
|
7234
7248
|
}
|
|
7235
|
-
process.env.NODE_ENV === "development" && (
|
|
7249
|
+
process.env.NODE_ENV === "development" && (tr.displayName = "CodeInput", tr.Field.displayName = "CodeInput.Field");
|
|
7236
7250
|
//#endregion
|
|
7237
7251
|
//#region src/primitives/TextField.tsx
|
|
7238
|
-
function
|
|
7252
|
+
function or({ className: e, ref: t, emptyValue: n = "", formatter: r, placeholder: i, type: a = "text", value: o, isDisabled: s = !1, isRequired: l = !1, onChange: u, onFocus: d, onUnfocus: f, ...p }) {
|
|
7239
7253
|
let m = c((e) => {
|
|
7240
7254
|
let t = (r?.(e) ?? e) || n;
|
|
7241
7255
|
u?.(t);
|
|
@@ -7257,10 +7271,10 @@ function ar({ className: e, ref: t, emptyValue: n = "", formatter: r, placeholde
|
|
|
7257
7271
|
onFocus: ({ target: e }) => d?.(e.value)
|
|
7258
7272
|
});
|
|
7259
7273
|
}
|
|
7260
|
-
process.env.NODE_ENV === "development" && (
|
|
7274
|
+
process.env.NODE_ENV === "development" && (or.displayName = "TextField");
|
|
7261
7275
|
//#endregion
|
|
7262
7276
|
//#region src/primitives/Counter.tsx
|
|
7263
|
-
function
|
|
7277
|
+
function sr({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN, min: a = NaN, quantity: o = 0, onChange: s, ...c }) {
|
|
7264
7278
|
let u = () => {
|
|
7265
7279
|
s?.(_(o - 1));
|
|
7266
7280
|
}, d = () => {
|
|
@@ -7276,7 +7290,7 @@ function or({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN,
|
|
|
7276
7290
|
}, _ = (e) => {
|
|
7277
7291
|
let t = e;
|
|
7278
7292
|
return isNaN(a) || (t = Math.max(a, t)), isNaN(i) || (t = Math.min(i, t)), t;
|
|
7279
|
-
}, [v, y] = p(h(o)), b =
|
|
7293
|
+
}, [v, y] = p(h(o)), b = un(o), x = !isNaN(i) && o + 1 > i, S = !isNaN(a) && o - 1 < a;
|
|
7280
7294
|
l(() => {
|
|
7281
7295
|
b === void 0 || b === o || y(h(_(o)));
|
|
7282
7296
|
}, [
|
|
@@ -7285,24 +7299,24 @@ function or({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN,
|
|
|
7285
7299
|
i
|
|
7286
7300
|
]);
|
|
7287
7301
|
let C = j(r, {
|
|
7288
|
-
addButton:
|
|
7289
|
-
subscribeButton:
|
|
7290
|
-
textField:
|
|
7302
|
+
addButton: sr.AddButton,
|
|
7303
|
+
subscribeButton: sr.SubtractButton,
|
|
7304
|
+
textField: sr.TextField
|
|
7291
7305
|
});
|
|
7292
7306
|
return /* @__PURE__ */ (0, O.jsxs)("div", {
|
|
7293
7307
|
...c,
|
|
7294
7308
|
ref: e,
|
|
7295
|
-
style: F(t,
|
|
7309
|
+
style: F(t, cr.root),
|
|
7296
7310
|
children: [
|
|
7297
7311
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7298
7312
|
className: w({ disabled: S }),
|
|
7299
|
-
style: F(
|
|
7300
|
-
element: C.subscribeButton ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7313
|
+
style: F(cr.subtract),
|
|
7314
|
+
element: C.subscribeButton ?? /* @__PURE__ */ (0, O.jsx)(sr.SubtractButton, {}),
|
|
7301
7315
|
onClick: () => u()
|
|
7302
7316
|
}),
|
|
7303
7317
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7304
|
-
style: F(
|
|
7305
|
-
element: C.textField ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7318
|
+
style: F(cr.textField),
|
|
7319
|
+
element: C.textField ?? /* @__PURE__ */ (0, O.jsx)(sr.TextField, {}),
|
|
7306
7320
|
value: v,
|
|
7307
7321
|
isDisabled: !n,
|
|
7308
7322
|
onChange: f,
|
|
@@ -7310,23 +7324,23 @@ function or({ ref: e, style: t, allowsInput: n = !0, children: r, max: i = NaN,
|
|
|
7310
7324
|
}),
|
|
7311
7325
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
7312
7326
|
className: w({ disabled: x }),
|
|
7313
|
-
style: F(
|
|
7314
|
-
element: C.addButton ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7327
|
+
style: F(cr.add),
|
|
7328
|
+
element: C.addButton ?? /* @__PURE__ */ (0, O.jsx)(sr.AddButton, {}),
|
|
7315
7329
|
onClick: () => d()
|
|
7316
7330
|
})
|
|
7317
7331
|
]
|
|
7318
7332
|
});
|
|
7319
7333
|
}
|
|
7320
7334
|
(function(e) {
|
|
7321
|
-
e.TextField = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)(
|
|
7335
|
+
e.TextField = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)(or, { ...e }), e.AddButton = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
|
|
7322
7336
|
...t,
|
|
7323
7337
|
children: e
|
|
7324
7338
|
}), e.SubtractButton = ({ children: e, ...t }) => /* @__PURE__ */ (0, O.jsx)("button", {
|
|
7325
7339
|
...t,
|
|
7326
7340
|
children: e
|
|
7327
7341
|
});
|
|
7328
|
-
})(
|
|
7329
|
-
var
|
|
7342
|
+
})(sr ||= {});
|
|
7343
|
+
var cr = M({
|
|
7330
7344
|
add: { flex: "0 0 auto" },
|
|
7331
7345
|
root: {
|
|
7332
7346
|
alignItems: "stretch",
|
|
@@ -7337,14 +7351,14 @@ var sr = M({
|
|
|
7337
7351
|
subtract: { flex: "0 0 auto" },
|
|
7338
7352
|
textField: { width: "100%" }
|
|
7339
7353
|
});
|
|
7340
|
-
process.env.NODE_ENV === "development" && (
|
|
7354
|
+
process.env.NODE_ENV === "development" && (sr.displayName = "Counter", sr.AddButton.displayName = "Counter.AddButton", sr.SubtractButton.displayName = "Counter.SubtractButton", sr.TextField.displayName = "Counter.TextField");
|
|
7341
7355
|
//#endregion
|
|
7342
7356
|
//#region src/primitives/Dial.tsx
|
|
7343
|
-
function
|
|
7357
|
+
function lr({ 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 }) {
|
|
7344
7358
|
let u = o * 2, d = Math.max(0, Math.min(360, i)), f = j(r, {
|
|
7345
|
-
knob:
|
|
7346
|
-
track:
|
|
7347
|
-
}), p =
|
|
7359
|
+
knob: lr.Knob,
|
|
7360
|
+
track: lr.Track
|
|
7361
|
+
}), p = fr({
|
|
7348
7362
|
angle: n,
|
|
7349
7363
|
diameter: u
|
|
7350
7364
|
});
|
|
@@ -7362,7 +7376,7 @@ function cr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
|
|
|
7362
7376
|
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7363
7377
|
cx: o,
|
|
7364
7378
|
cy: o,
|
|
7365
|
-
element: f.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7379
|
+
element: f.track ?? /* @__PURE__ */ (0, O.jsx)(lr.Track, {}),
|
|
7366
7380
|
fill: "none",
|
|
7367
7381
|
r: o - c / 2,
|
|
7368
7382
|
strokeDasharray: s,
|
|
@@ -7376,8 +7390,8 @@ function cr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
|
|
|
7376
7390
|
viewBox: `0 0 ${u} ${u}`,
|
|
7377
7391
|
xmlns: "http://www.w3.org/2000/svg",
|
|
7378
7392
|
children: /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7379
|
-
d:
|
|
7380
|
-
element: f.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7393
|
+
d: dr(o, o, o - a / 2 - (c - a) / 2, -d / 2, d / 2),
|
|
7394
|
+
element: f.knob ?? /* @__PURE__ */ (0, O.jsx)(lr.Knob, {}),
|
|
7381
7395
|
fill: "none",
|
|
7382
7396
|
strokeWidth: a
|
|
7383
7397
|
})
|
|
@@ -7387,16 +7401,16 @@ function cr({ ref: e, style: t, angle: n = 0, children: r, knobLength: i = 30, k
|
|
|
7387
7401
|
}
|
|
7388
7402
|
(function(e) {
|
|
7389
7403
|
e.Track = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("circle", { ...e }), e.Knob = ({ ...e }) => /* @__PURE__ */ (0, O.jsx)("path", { ...e });
|
|
7390
|
-
})(
|
|
7391
|
-
function
|
|
7404
|
+
})(lr ||= {});
|
|
7405
|
+
function ur(e, t, n, r) {
|
|
7392
7406
|
let i = (r - 90) * Math.PI / 180;
|
|
7393
7407
|
return {
|
|
7394
7408
|
x: e + n * Math.cos(i),
|
|
7395
7409
|
y: t + n * Math.sin(i)
|
|
7396
7410
|
};
|
|
7397
7411
|
}
|
|
7398
|
-
function
|
|
7399
|
-
let a =
|
|
7412
|
+
function dr(e, t, n, r, i) {
|
|
7413
|
+
let a = ur(e, t, n, i), o = ur(e, t, n, r), s = i - r <= 180 ? "0" : "1";
|
|
7400
7414
|
return [
|
|
7401
7415
|
"M",
|
|
7402
7416
|
a.x,
|
|
@@ -7411,7 +7425,7 @@ function ur(e, t, n, r, i) {
|
|
|
7411
7425
|
o.y
|
|
7412
7426
|
].join(" ");
|
|
7413
7427
|
}
|
|
7414
|
-
function
|
|
7428
|
+
function fr({ angle: e = 0, diameter: t = 0 }) {
|
|
7415
7429
|
return M({
|
|
7416
7430
|
knobContainer: {
|
|
7417
7431
|
backgroundPosition: "center",
|
|
@@ -7445,11 +7459,11 @@ function dr({ angle: e = 0, diameter: t = 0 }) {
|
|
|
7445
7459
|
}
|
|
7446
7460
|
});
|
|
7447
7461
|
}
|
|
7448
|
-
process.env.NODE_ENV === "development" && (
|
|
7462
|
+
process.env.NODE_ENV === "development" && (lr.displayName = "Dial", lr.Track.displayName = "Dial.Track", lr.Knob.displayName = "Dial.Knob");
|
|
7449
7463
|
//#endregion
|
|
7450
7464
|
//#region src/primitives/Dropdown.tsx
|
|
7451
|
-
function
|
|
7452
|
-
let L = f(null), R = Ze(L), z = c.length, B =
|
|
7465
|
+
function pr({ 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 }) {
|
|
7466
|
+
let L = f(null), R = Ze(L), z = c.length, B = _r(c, m, h, d), V = o ?? (g === "vertical" ? R.height : R.width), H = V * B + s * (B - 1), U = hr(_, c), [W, ee] = p(b ?? !0), te = vr({
|
|
7453
7467
|
collectionPadding: i,
|
|
7454
7468
|
maxVisibleItems: m,
|
|
7455
7469
|
menuLength: H,
|
|
@@ -7458,11 +7472,11 @@ function fr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7458
7472
|
isCollapsed: W,
|
|
7459
7473
|
isInverted: x
|
|
7460
7474
|
}), G = j(r, {
|
|
7461
|
-
collapseIcon:
|
|
7462
|
-
collection:
|
|
7463
|
-
expandIcon:
|
|
7464
|
-
item:
|
|
7465
|
-
toggle:
|
|
7475
|
+
collapseIcon: pr.CollapseIcon,
|
|
7476
|
+
collection: pr.Collection,
|
|
7477
|
+
expandIcon: pr.ExpandIcon,
|
|
7478
|
+
item: pr.Item,
|
|
7479
|
+
toggle: pr.Toggle
|
|
7466
7480
|
}), ne = () => {
|
|
7467
7481
|
W && (ee(!1), k?.());
|
|
7468
7482
|
}, re = () => {
|
|
@@ -7520,7 +7534,7 @@ function fr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7520
7534
|
style: F(te.toggle),
|
|
7521
7535
|
"aria-expanded": !W,
|
|
7522
7536
|
"aria-haspopup": "listbox",
|
|
7523
|
-
element: G.toggle ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7537
|
+
element: G.toggle ?? /* @__PURE__ */ (0, O.jsx)(pr.Toggle, {}),
|
|
7524
7538
|
onClick: ie,
|
|
7525
7539
|
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, {
|
|
7526
7540
|
className: w({
|
|
@@ -7532,7 +7546,7 @@ function fr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7532
7546
|
})]
|
|
7533
7547
|
}), /* @__PURE__ */ (0, O.jsx)(P, {
|
|
7534
7548
|
style: F(te.collection),
|
|
7535
|
-
element: G.collection ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7549
|
+
element: G.collection ?? /* @__PURE__ */ (0, O.jsx)(pr.Collection, {}),
|
|
7536
7550
|
ItemComponent: a,
|
|
7537
7551
|
itemLength: V,
|
|
7538
7552
|
itemPadding: s,
|
|
@@ -7547,7 +7561,7 @@ function fr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7547
7561
|
onDeselectAt: D,
|
|
7548
7562
|
onSelectAt: ae,
|
|
7549
7563
|
onSelectionChange: M,
|
|
7550
|
-
children: !a && (G.item ?? /* @__PURE__ */ (0, O.jsx)(
|
|
7564
|
+
children: !a && (G.item ?? /* @__PURE__ */ (0, O.jsx)(pr.Item, {}))
|
|
7551
7565
|
}, g)]
|
|
7552
7566
|
})
|
|
7553
7567
|
});
|
|
@@ -7565,17 +7579,17 @@ function fr({ className: e, ref: t, style: n, children: r, collectionPadding: i
|
|
|
7565
7579
|
...t,
|
|
7566
7580
|
children: e
|
|
7567
7581
|
});
|
|
7568
|
-
})(
|
|
7569
|
-
function
|
|
7582
|
+
})(pr ||= {});
|
|
7583
|
+
function mr(e, t) {
|
|
7570
7584
|
return !!(isNaN(e) || e >= t.length || e < 0);
|
|
7571
7585
|
}
|
|
7572
|
-
function
|
|
7573
|
-
return
|
|
7586
|
+
function hr(e, t) {
|
|
7587
|
+
return gr(e).filter((e) => !mr(e, t));
|
|
7574
7588
|
}
|
|
7575
|
-
function
|
|
7589
|
+
function gr(e) {
|
|
7576
7590
|
return e.sort((e, t) => e - t);
|
|
7577
7591
|
}
|
|
7578
|
-
function
|
|
7592
|
+
function _r(e, t, n, r) {
|
|
7579
7593
|
let i = e.length;
|
|
7580
7594
|
switch (r) {
|
|
7581
7595
|
case "grid": {
|
|
@@ -7585,7 +7599,7 @@ function gr(e, t, n, r) {
|
|
|
7585
7599
|
default: return t < 0 ? i : Math.min(i, t);
|
|
7586
7600
|
}
|
|
7587
7601
|
}
|
|
7588
|
-
function
|
|
7602
|
+
function vr({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n = NaN, numItems: r = 0, orientation: i = "vertical", isCollapsed: a = !0, isInverted: o = !1 }) {
|
|
7589
7603
|
return M({
|
|
7590
7604
|
body: {
|
|
7591
7605
|
height: "100%",
|
|
@@ -7644,10 +7658,10 @@ function _r({ collectionPadding: e = 0, maxVisibleItems: t = 0, menuLength: n =
|
|
|
7644
7658
|
}
|
|
7645
7659
|
});
|
|
7646
7660
|
}
|
|
7647
|
-
process.env.NODE_ENV === "development" && (
|
|
7661
|
+
process.env.NODE_ENV === "development" && (pr.displayName = "Dropdown", pr.Collection.displayName = "Dropdown.Collection", pr.CollapseIcon.displayName = "Dropdown.CollapseIcon", pr.ExpandIcon.displayName = "Dropdown.ExpandIcon", pr.Item.displayName = "Dropdown.Item", pr.Toggle.displayName = "Dropdown.Toggle");
|
|
7648
7662
|
//#endregion
|
|
7649
7663
|
//#region src/primitives/Form.tsx
|
|
7650
|
-
function
|
|
7664
|
+
function yr({ ref: e, onSubmit: t, ...n }) {
|
|
7651
7665
|
return /* @__PURE__ */ (0, O.jsx)("form", {
|
|
7652
7666
|
...n,
|
|
7653
7667
|
ref: e,
|
|
@@ -7656,11 +7670,11 @@ function vr({ ref: e, onSubmit: t, ...n }) {
|
|
|
7656
7670
|
}
|
|
7657
7671
|
});
|
|
7658
7672
|
}
|
|
7659
|
-
process.env.NODE_ENV !== "production" && (
|
|
7673
|
+
process.env.NODE_ENV !== "production" && (yr.displayName = "Form");
|
|
7660
7674
|
//#endregion
|
|
7661
7675
|
//#region src/primitives/MasonryGrid.tsx
|
|
7662
|
-
var
|
|
7663
|
-
function
|
|
7676
|
+
var br = "base-";
|
|
7677
|
+
function xr({ 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 }) {
|
|
7664
7678
|
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 = () => {
|
|
7665
7679
|
let e = m.current;
|
|
7666
7680
|
if (!e) return;
|
|
@@ -7673,29 +7687,29 @@ function br({ className: e, ref: t, alignSections: n = !1, children: r, horizont
|
|
|
7673
7687
|
let a = [...Array(r)].map(() => 0);
|
|
7674
7688
|
for (let e of Array.from(t)) {
|
|
7675
7689
|
if (!(e instanceof HTMLElement)) continue;
|
|
7676
|
-
let t =
|
|
7690
|
+
let t = Er(e, o), [c, l] = wr(a, t);
|
|
7677
7691
|
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`;
|
|
7678
7692
|
for (let n = 0; n < t; n++) a[c + n] = l + (l === 0 ? 0 : s) + X.from(e).height;
|
|
7679
7693
|
if (n && c + t === r) {
|
|
7680
|
-
let e =
|
|
7694
|
+
let e = Tr(a);
|
|
7681
7695
|
for (let t = 0; t < r; t++) a[t] = e;
|
|
7682
7696
|
}
|
|
7683
7697
|
}
|
|
7684
|
-
let c = C(), l =
|
|
7698
|
+
let c = C(), l = Tr(a, r);
|
|
7685
7699
|
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)`);
|
|
7686
7700
|
} else {
|
|
7687
7701
|
let a = [...Array(r)].map(() => 0);
|
|
7688
7702
|
for (let e of Array.from(t)) {
|
|
7689
7703
|
if (!(e instanceof HTMLElement)) continue;
|
|
7690
|
-
let t =
|
|
7704
|
+
let t = Er(e, o), [c, l] = wr(a, t);
|
|
7691
7705
|
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`;
|
|
7692
7706
|
for (let n = 0; n < t; n++) a[c + n] = l + (l === 0 ? 0 : i) + X.from(e).width;
|
|
7693
7707
|
if (n && c + t === r) {
|
|
7694
|
-
let e =
|
|
7708
|
+
let e = Tr(a);
|
|
7695
7709
|
for (let t = 0; t < r; t++) a[t] = e;
|
|
7696
7710
|
}
|
|
7697
7711
|
}
|
|
7698
|
-
let c = T(), l =
|
|
7712
|
+
let c = T(), l = Tr(a, r);
|
|
7699
7713
|
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)`);
|
|
7700
7714
|
}
|
|
7701
7715
|
};
|
|
@@ -7710,7 +7724,7 @@ function br({ className: e, ref: t, alignSections: n = !1, children: r, horizont
|
|
|
7710
7724
|
s,
|
|
7711
7725
|
a
|
|
7712
7726
|
])), l(() => {
|
|
7713
|
-
let e =
|
|
7727
|
+
let e = Dr(m.current?.innerHTML);
|
|
7714
7728
|
if (e.length === 0) return E();
|
|
7715
7729
|
let t = e.length;
|
|
7716
7730
|
for (let n = 0; n < t; n++) {
|
|
@@ -7718,7 +7732,7 @@ function br({ className: e, ref: t, alignSections: n = !1, children: r, horizont
|
|
|
7718
7732
|
r.src = t, r.onload = () => E();
|
|
7719
7733
|
}
|
|
7720
7734
|
}, [r]);
|
|
7721
|
-
let D =
|
|
7735
|
+
let D = Sr({ orientation: a }), k = Cr({
|
|
7722
7736
|
minHeight: _,
|
|
7723
7737
|
minWidth: h,
|
|
7724
7738
|
orientation: a
|
|
@@ -7735,10 +7749,10 @@ function br({ className: e, ref: t, alignSections: n = !1, children: r, horizont
|
|
|
7735
7749
|
})
|
|
7736
7750
|
});
|
|
7737
7751
|
}
|
|
7738
|
-
function
|
|
7752
|
+
function Sr({ orientation: e = "horizontal" }) {
|
|
7739
7753
|
return A({ root: w(e) });
|
|
7740
7754
|
}
|
|
7741
|
-
function
|
|
7755
|
+
function Cr({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizontal" }) {
|
|
7742
7756
|
return M({ body: {
|
|
7743
7757
|
height: n === "horizontal" ? "100%" : "auto",
|
|
7744
7758
|
minHeight: n === "vertical" && !isNaN(e) ? `${e}px` : "",
|
|
@@ -7747,28 +7761,28 @@ function Sr({ minHeight: e = NaN, minWidth: t = NaN, orientation: n = "horizonta
|
|
|
7747
7761
|
width: n === "horizontal" ? "auto" : "100%"
|
|
7748
7762
|
} });
|
|
7749
7763
|
}
|
|
7750
|
-
function
|
|
7764
|
+
function wr(e, t) {
|
|
7751
7765
|
let n = e.length, r = NaN, i = Infinity;
|
|
7752
7766
|
for (let a = 0; a < n; a++) {
|
|
7753
7767
|
let o = e[a], s = o < i, c = a + t <= n, l = !0;
|
|
7754
7768
|
for (let n = 1; n < t; n++) e[a + n] > o && (l = !1);
|
|
7755
7769
|
s && c && l && (r = a, i = o);
|
|
7756
7770
|
}
|
|
7757
|
-
return isNaN(r) ? [0,
|
|
7771
|
+
return isNaN(r) ? [0, Tr(e, t)] : [r, i];
|
|
7758
7772
|
}
|
|
7759
|
-
function
|
|
7773
|
+
function Tr(e, t) {
|
|
7760
7774
|
let n = e;
|
|
7761
7775
|
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);
|
|
7762
7776
|
}
|
|
7763
|
-
function
|
|
7777
|
+
function Er(e, t) {
|
|
7764
7778
|
let n = e.classList;
|
|
7765
|
-
for (let e of Array.from(n)) if (e.startsWith(
|
|
7766
|
-
let n = parseFloat(e.replace(
|
|
7779
|
+
for (let e of Array.from(n)) if (e.startsWith(br)) {
|
|
7780
|
+
let n = parseFloat(e.replace(br, ""));
|
|
7767
7781
|
if (!isNaN(n)) return Math.min(Math.max(n, 1), t);
|
|
7768
7782
|
}
|
|
7769
7783
|
return 1;
|
|
7770
7784
|
}
|
|
7771
|
-
function
|
|
7785
|
+
function Dr(e) {
|
|
7772
7786
|
if (!e) return [];
|
|
7773
7787
|
let t = /<img.*?src=(["'])(.*?)\1/g, n = /<img.*?src=(["'])(.*?)\1/, r = t.exec(e) ?? [], i = [];
|
|
7774
7788
|
for (let e of r) {
|
|
@@ -7777,11 +7791,11 @@ function Er(e) {
|
|
|
7777
7791
|
}
|
|
7778
7792
|
return i;
|
|
7779
7793
|
}
|
|
7780
|
-
process.env.NODE_ENV === "development" && (
|
|
7794
|
+
process.env.NODE_ENV === "development" && (xr.displayName = "MasonryGrid");
|
|
7781
7795
|
//#endregion
|
|
7782
7796
|
//#region src/primitives/RangeSlider.tsx
|
|
7783
7797
|
function $({ 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 }) {
|
|
7784
|
-
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(() =>
|
|
7798
|
+
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(() => Ir(o, a, p), [
|
|
7785
7799
|
o,
|
|
7786
7800
|
a,
|
|
7787
7801
|
p
|
|
@@ -7792,8 +7806,8 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7792
7806
|
track: $.Track,
|
|
7793
7807
|
trackHighlight: $.TrackHighlight
|
|
7794
7808
|
}), R = c((e, t, r) => {
|
|
7795
|
-
let c = s === "horizontal" ? t : r, l =
|
|
7796
|
-
return
|
|
7809
|
+
let c = s === "horizontal" ? t : r, l = Pr(o, o, a, s, N.width, N.height, i, n, m), u = Pr(M.current, o, a, s, N.width, N.height, i, n, m);
|
|
7810
|
+
return Mr(Lr(Pr(e, o, a, s, N.width, N.height, i, n, m) + c, u, l), o, a, s, N.width, N.height, i, n, m);
|
|
7797
7811
|
}, [
|
|
7798
7812
|
i,
|
|
7799
7813
|
n,
|
|
@@ -7804,8 +7818,8 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7804
7818
|
N.width,
|
|
7805
7819
|
N.height
|
|
7806
7820
|
]), z = c((e, t, r) => {
|
|
7807
|
-
let c = s === "horizontal" ? t : r, l =
|
|
7808
|
-
return
|
|
7821
|
+
let c = s === "horizontal" ? t : r, l = Pr(A.current, o, a, s, N.width, N.height, i, n, m), u = Pr(a, o, a, s, N.width, N.height, i, n, m);
|
|
7822
|
+
return Mr(Lr(Pr(e, o, a, s, N.width, N.height, i, n, m) + c, u, l), o, a, s, N.width, N.height, i, n, m);
|
|
7809
7823
|
}, [
|
|
7810
7824
|
i,
|
|
7811
7825
|
n,
|
|
@@ -7816,7 +7830,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7816
7830
|
N.width,
|
|
7817
7831
|
N.height
|
|
7818
7832
|
]), B = c(([e, t]) => {
|
|
7819
|
-
let r = S.current, c = C.current, l = w.current, u =
|
|
7833
|
+
let r = S.current, c = C.current, l = w.current, u = kr(e, o, a), d = `${u * 100}%`, f = kr(t, o, a), p = `${f * 100}%`;
|
|
7820
7834
|
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}%`));
|
|
7821
7835
|
}, [
|
|
7822
7836
|
m,
|
|
@@ -7832,7 +7846,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7832
7846
|
vt(S, {
|
|
7833
7847
|
onDragEnd: () => {
|
|
7834
7848
|
V(S.current, !1);
|
|
7835
|
-
let e = I ?
|
|
7849
|
+
let e = I ? Fr(A.current, I) : A.current;
|
|
7836
7850
|
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), _?.();
|
|
7837
7851
|
},
|
|
7838
7852
|
onDragMove: ({ x: e, y: t }) => {
|
|
@@ -7845,7 +7859,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7845
7859
|
}), vt(C, {
|
|
7846
7860
|
onDragEnd: () => {
|
|
7847
7861
|
V(C.current, !1);
|
|
7848
|
-
let e = I ?
|
|
7862
|
+
let e = I ? Fr(M.current, I) : M.current;
|
|
7849
7863
|
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), _?.();
|
|
7850
7864
|
},
|
|
7851
7865
|
onDragMove: ({ x: e, y: t }) => {
|
|
@@ -7862,7 +7876,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7862
7876
|
k,
|
|
7863
7877
|
B
|
|
7864
7878
|
]);
|
|
7865
|
-
let H = d(() =>
|
|
7879
|
+
let H = d(() => Or({
|
|
7866
7880
|
knobHeight: n,
|
|
7867
7881
|
knobPadding: r,
|
|
7868
7882
|
knobWidth: i,
|
|
@@ -7931,7 +7945,7 @@ function $({ ref: e, children: t, knobHeight: n = 28, knobPadding: r = 0, knobWi
|
|
|
7931
7945
|
(function(e) {
|
|
7932
7946
|
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 });
|
|
7933
7947
|
})($ ||= {});
|
|
7934
|
-
function
|
|
7948
|
+
function Or({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "horizontal" }) {
|
|
7935
7949
|
return M({
|
|
7936
7950
|
body: {
|
|
7937
7951
|
height: "100%",
|
|
@@ -7980,10 +7994,10 @@ function Dr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientati
|
|
|
7980
7994
|
}
|
|
7981
7995
|
});
|
|
7982
7996
|
}
|
|
7983
|
-
function
|
|
7997
|
+
function kr(e, t, n) {
|
|
7984
7998
|
return (e - t) / (n - t);
|
|
7985
7999
|
}
|
|
7986
|
-
function
|
|
8000
|
+
function Ar(e, t, n, r, i, a, o) {
|
|
7987
8001
|
switch (t) {
|
|
7988
8002
|
case "horizontal": {
|
|
7989
8003
|
let t = o ? n - i : n;
|
|
@@ -7996,23 +8010,23 @@ function kr(e, t, n, r, i, a, o) {
|
|
|
7996
8010
|
default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
|
|
7997
8011
|
}
|
|
7998
8012
|
}
|
|
7999
|
-
function
|
|
8013
|
+
function jr(e, t, n) {
|
|
8000
8014
|
return e * (n - t) + t;
|
|
8001
8015
|
}
|
|
8002
|
-
function
|
|
8003
|
-
return Ar(
|
|
8016
|
+
function Mr(e, t, n, r, i, a, o, s, c) {
|
|
8017
|
+
return jr(Ar(e, r, i, a, o, s, c), t, n);
|
|
8004
8018
|
}
|
|
8005
|
-
function
|
|
8019
|
+
function Nr(e, t, n, r, i, a, o) {
|
|
8006
8020
|
switch (t) {
|
|
8007
8021
|
case "horizontal": return e * (o ? n - i : n) + (o ? i * .5 : 0);
|
|
8008
8022
|
case "vertical": return e * (o ? r - a : r) + (o ? a * .5 : 0);
|
|
8009
8023
|
default: return console.error(`[etudes::RangeSlider] Invalid orientation: ${t}`), NaN;
|
|
8010
8024
|
}
|
|
8011
8025
|
}
|
|
8012
|
-
function
|
|
8013
|
-
return
|
|
8026
|
+
function Pr(e, t, n, r, i, a, o, s, c) {
|
|
8027
|
+
return Nr(kr(e, t, n), r, i, a, o, s, c);
|
|
8014
8028
|
}
|
|
8015
|
-
function
|
|
8029
|
+
function Fr(e, t) {
|
|
8016
8030
|
let n = t.length, r = 0, i = Infinity;
|
|
8017
8031
|
for (let a = 0; a < n; a++) {
|
|
8018
8032
|
let n = t[a], o = Math.abs(e - n);
|
|
@@ -8020,21 +8034,21 @@ function Pr(e, t) {
|
|
|
8020
8034
|
}
|
|
8021
8035
|
return t[r];
|
|
8022
8036
|
}
|
|
8023
|
-
function
|
|
8037
|
+
function Ir(e, t, n) {
|
|
8024
8038
|
if (!(n < 0)) return [
|
|
8025
8039
|
e,
|
|
8026
8040
|
...[...Array(n)].map((r, i) => e + (i + 1) * (t - e) / (1 + n)),
|
|
8027
8041
|
t
|
|
8028
8042
|
];
|
|
8029
8043
|
}
|
|
8030
|
-
function
|
|
8044
|
+
function Lr(e, t, n) {
|
|
8031
8045
|
return Math.max(n, Math.min(t, e));
|
|
8032
8046
|
}
|
|
8033
8047
|
process.env.NODE_ENV === "development" && ($.displayName = "RangeSlider", $.Knob.displayName = "RangeSlider.Knob", $.Label.displayName = "RangeSlider.Label", $.Track.displayName = "RangeSlider.Track", $.TrackHighlight.displayName = "RangeSlider.TrackHighlight");
|
|
8034
8048
|
//#endregion
|
|
8035
8049
|
//#region src/primitives/ScrollableCarousel.tsx
|
|
8036
|
-
function
|
|
8037
|
-
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(
|
|
8050
|
+
function Rr({ 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 }) {
|
|
8051
|
+
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(Br(v, o)), [N, P] = p(!1), I = Hr({
|
|
8038
8052
|
orientation: o,
|
|
8039
8053
|
scrollSnapEnabled: A || !N
|
|
8040
8054
|
}), L = t > 0, R = c(() => {
|
|
@@ -8044,9 +8058,9 @@ function Lr({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0
|
|
|
8044
8058
|
clearTimeout(x.current), x.current = void 0;
|
|
8045
8059
|
}, S);
|
|
8046
8060
|
}, [S, R]), B = c(() => {
|
|
8047
|
-
|
|
8061
|
+
zr(v, r, o), z();
|
|
8048
8062
|
}, [r, o]), V = c(() => {
|
|
8049
|
-
M(
|
|
8063
|
+
M(Br(v, o));
|
|
8050
8064
|
}, [o]), H = c((e) => {
|
|
8051
8065
|
A || (y.current = K.make(e.clientX, e.clientY), P(!0));
|
|
8052
8066
|
}, [A]), U = c((e) => {
|
|
@@ -8143,7 +8157,7 @@ function Lr({ ref: e, autoAdvanceInterval: t = 0, dragSpeed: n = 1, index: r = 0
|
|
|
8143
8157
|
})
|
|
8144
8158
|
});
|
|
8145
8159
|
}
|
|
8146
|
-
function
|
|
8160
|
+
function zr(e, t, n) {
|
|
8147
8161
|
let r = e?.current;
|
|
8148
8162
|
if (!r) return;
|
|
8149
8163
|
let i = n === "horizontal" ? 0 : r.clientHeight * t, a = n === "horizontal" ? r.clientWidth * t : 0;
|
|
@@ -8153,14 +8167,14 @@ function Rr(e, t, n) {
|
|
|
8153
8167
|
top: i
|
|
8154
8168
|
});
|
|
8155
8169
|
}
|
|
8156
|
-
function
|
|
8170
|
+
function Br(e, t) {
|
|
8157
8171
|
let n = e?.current;
|
|
8158
8172
|
if (!n) return;
|
|
8159
8173
|
let r = [];
|
|
8160
|
-
for (let i = 0; i < n.children.length; i++) r.push(
|
|
8174
|
+
for (let i = 0; i < n.children.length; i++) r.push(Vr(i, e, t));
|
|
8161
8175
|
return r;
|
|
8162
8176
|
}
|
|
8163
|
-
function
|
|
8177
|
+
function Vr(e, t, n) {
|
|
8164
8178
|
let r = t?.current, i = r?.children[e];
|
|
8165
8179
|
if (!i) return 0;
|
|
8166
8180
|
let a = X.intersecting(i, r);
|
|
@@ -8170,7 +8184,7 @@ function Br(e, t, n) {
|
|
|
8170
8184
|
default: return console.error(`[etudes::ScrollableCarousel] Unsupported orientation: ${n}`), NaN;
|
|
8171
8185
|
}
|
|
8172
8186
|
}
|
|
8173
|
-
function
|
|
8187
|
+
function Hr({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
|
|
8174
8188
|
return M({
|
|
8175
8189
|
item: {
|
|
8176
8190
|
height: "100%",
|
|
@@ -8206,40 +8220,40 @@ function Vr({ orientation: e = "horizontal", scrollSnapEnabled: t = !1 }) {
|
|
|
8206
8220
|
}
|
|
8207
8221
|
});
|
|
8208
8222
|
}
|
|
8209
|
-
process.env.NODE_ENV === "development" && (
|
|
8223
|
+
process.env.NODE_ENV === "development" && (Rr.displayName = "ScrollableCarousel");
|
|
8210
8224
|
//#endregion
|
|
8211
8225
|
//#region src/primitives/Select.tsx
|
|
8212
|
-
function
|
|
8226
|
+
function Ur({ id: e, ref: t, children: n, name: r, options: i, placeholder: a, value: o, isRequired: s = !1, formatValue: c = (e) => e, onChange: l, ...u }) {
|
|
8213
8227
|
let d = j(n, {
|
|
8214
|
-
expandIcon:
|
|
8215
|
-
option:
|
|
8216
|
-
toggle:
|
|
8228
|
+
expandIcon: Ur.ExpandIcon,
|
|
8229
|
+
option: Ur.Option,
|
|
8230
|
+
toggle: Ur.Toggle
|
|
8217
8231
|
});
|
|
8218
8232
|
return /* @__PURE__ */ (0, O.jsxs)("div", {
|
|
8219
8233
|
...u,
|
|
8220
8234
|
ref: t,
|
|
8221
|
-
style:
|
|
8235
|
+
style: Wr.root,
|
|
8222
8236
|
children: [/* @__PURE__ */ (0, O.jsxs)(P, {
|
|
8223
|
-
style:
|
|
8237
|
+
style: Wr.select,
|
|
8224
8238
|
"aria-required": s ? "true" : void 0,
|
|
8225
|
-
element: d.toggle ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8239
|
+
element: d.toggle ?? /* @__PURE__ */ (0, O.jsx)(Ur.Toggle, {}),
|
|
8226
8240
|
name: r,
|
|
8227
8241
|
required: s,
|
|
8228
8242
|
value: o,
|
|
8229
8243
|
onChange: (e) => l?.(e.target.value),
|
|
8230
8244
|
children: [a !== void 0 && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8231
8245
|
disabled: !0,
|
|
8232
|
-
element: d.option ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8246
|
+
element: d.option ?? /* @__PURE__ */ (0, O.jsx)(Ur.Option, {}),
|
|
8233
8247
|
hidden: !0,
|
|
8234
8248
|
value: "",
|
|
8235
8249
|
children: a
|
|
8236
8250
|
}), i.map((e, t) => /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8237
|
-
element: d.option ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8251
|
+
element: d.option ?? /* @__PURE__ */ (0, O.jsx)(Ur.Option, {}),
|
|
8238
8252
|
value: e,
|
|
8239
8253
|
children: c(e)
|
|
8240
8254
|
}, `${t}-${e}`))]
|
|
8241
8255
|
}), d.expandIcon && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8242
|
-
style:
|
|
8256
|
+
style: Wr.expandIcon,
|
|
8243
8257
|
element: d.expandIcon
|
|
8244
8258
|
})]
|
|
8245
8259
|
});
|
|
@@ -8254,8 +8268,8 @@ function Hr({ id: e, ref: t, children: n, name: r, options: i, placeholder: a, v
|
|
|
8254
8268
|
...t,
|
|
8255
8269
|
children: e
|
|
8256
8270
|
});
|
|
8257
|
-
})(
|
|
8258
|
-
var
|
|
8271
|
+
})(Ur ||= {});
|
|
8272
|
+
var Wr = M({
|
|
8259
8273
|
expandIcon: {
|
|
8260
8274
|
pointerEvents: "none",
|
|
8261
8275
|
zIndex: 1
|
|
@@ -8277,20 +8291,20 @@ var Ur = M({
|
|
|
8277
8291
|
width: "100%"
|
|
8278
8292
|
}
|
|
8279
8293
|
});
|
|
8280
|
-
process.env.NODE_ENV === "development" && (
|
|
8294
|
+
process.env.NODE_ENV === "development" && (Ur.displayName = "Select", Ur.ExpandIcon.displayName = "Select.ExpandIcon", Ur.Option.displayName = "Select.Option", Ur.Toggle.displayName = "Select.Toggle");
|
|
8281
8295
|
//#endregion
|
|
8282
8296
|
//#region src/primitives/Slider.tsx
|
|
8283
|
-
function
|
|
8297
|
+
function Gr({ 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 }) {
|
|
8284
8298
|
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) => {
|
|
8285
|
-
let o =
|
|
8299
|
+
let o = Jr(e, p);
|
|
8286
8300
|
switch (a) {
|
|
8287
8301
|
case "horizontal": {
|
|
8288
8302
|
let n = l ? D.width - i : D.width;
|
|
8289
|
-
return n <= 0 ? e :
|
|
8303
|
+
return n <= 0 ? e : qr(Yr((o * n + t) / n), p);
|
|
8290
8304
|
}
|
|
8291
8305
|
case "vertical": {
|
|
8292
8306
|
let t = l ? D.height - n : D.height;
|
|
8293
|
-
return t <= 0 ? e :
|
|
8307
|
+
return t <= 0 ? e : qr(Yr((o * t + r) / t), p);
|
|
8294
8308
|
}
|
|
8295
8309
|
default: return console.error(`[etudes::Slider] Invalid orientation: ${a}`), NaN;
|
|
8296
8310
|
}
|
|
@@ -8303,7 +8317,7 @@ function Wr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8303
8317
|
n,
|
|
8304
8318
|
a
|
|
8305
8319
|
]), A = c((e) => {
|
|
8306
|
-
let t =
|
|
8320
|
+
let t = Jr(e, p), r = S.current, o = C.current, c = w.current, u = (e) => `${s <= 0 ? 0 : e * .5}px - ${s}px`;
|
|
8307
8321
|
switch (a) {
|
|
8308
8322
|
case "horizontal":
|
|
8309
8323
|
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)})`);
|
|
@@ -8333,11 +8347,11 @@ function Wr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8333
8347
|
switch (a) {
|
|
8334
8348
|
case "horizontal":
|
|
8335
8349
|
if (D.width <= 0) return;
|
|
8336
|
-
n =
|
|
8350
|
+
n = qr((e.clientX + t.left - D.left) / D.width, p);
|
|
8337
8351
|
break;
|
|
8338
8352
|
case "vertical":
|
|
8339
8353
|
if (D.height <= 0) return;
|
|
8340
|
-
n =
|
|
8354
|
+
n = qr((e.clientY + t.top - D.top) / D.height, p);
|
|
8341
8355
|
break;
|
|
8342
8356
|
default:
|
|
8343
8357
|
console.error(`[etudes::Slider] Invalid orientation: ${a}`);
|
|
@@ -8367,7 +8381,7 @@ function Wr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8367
8381
|
}), u(() => {
|
|
8368
8382
|
E.current || (T.current = o, A(o));
|
|
8369
8383
|
}, [o, A]);
|
|
8370
|
-
let I = p ? o === 0 : o === 1, L = p ? o === 1 : o === 0, R = d(() =>
|
|
8384
|
+
let I = p ? o === 0 : o === 1, L = p ? o === 1 : o === 0, R = d(() => Kr({
|
|
8371
8385
|
knobHeight: n,
|
|
8372
8386
|
knobPadding: r,
|
|
8373
8387
|
knobWidth: i,
|
|
@@ -8380,10 +8394,10 @@ function Wr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8380
8394
|
a,
|
|
8381
8395
|
m
|
|
8382
8396
|
]), z = j(t, {
|
|
8383
|
-
knob:
|
|
8384
|
-
knobContainer:
|
|
8385
|
-
label:
|
|
8386
|
-
track:
|
|
8397
|
+
knob: Gr.Knob,
|
|
8398
|
+
knobContainer: Gr.KnobContainer,
|
|
8399
|
+
label: Gr.Label,
|
|
8400
|
+
track: Gr.Track
|
|
8387
8401
|
});
|
|
8388
8402
|
return /* @__PURE__ */ (0, O.jsx)("div", {
|
|
8389
8403
|
...y,
|
|
@@ -8402,7 +8416,7 @@ function Wr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8402
8416
|
ref: C,
|
|
8403
8417
|
style: F(R.track, a === "vertical" ? { top: "0" } : { left: "0" }),
|
|
8404
8418
|
"data-side": p ? "end" : "start",
|
|
8405
|
-
element: z.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8419
|
+
element: z.track ?? /* @__PURE__ */ (0, O.jsx)(Gr.Track, {}),
|
|
8406
8420
|
onClick: N,
|
|
8407
8421
|
children: /* @__PURE__ */ (0, O.jsx)("div", { style: R.trackHitBox })
|
|
8408
8422
|
}),
|
|
@@ -8410,20 +8424,20 @@ function Wr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8410
8424
|
ref: w,
|
|
8411
8425
|
style: F(R.track, a === "vertical" ? { bottom: "0" } : { right: "0" }),
|
|
8412
8426
|
"data-side": p ? "start" : "end",
|
|
8413
|
-
element: z.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8427
|
+
element: z.track ?? /* @__PURE__ */ (0, O.jsx)(Gr.Track, {}),
|
|
8414
8428
|
onClick: N,
|
|
8415
8429
|
children: /* @__PURE__ */ (0, O.jsx)("div", { style: R.trackHitBox })
|
|
8416
8430
|
}),
|
|
8417
8431
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
8418
8432
|
ref: S,
|
|
8419
8433
|
style: R.knobContainer,
|
|
8420
|
-
element: z.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8434
|
+
element: z.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(Gr.KnobContainer, {}),
|
|
8421
8435
|
children: /* @__PURE__ */ (0, O.jsxs)(P, {
|
|
8422
8436
|
style: F(R.knob),
|
|
8423
|
-
element: z.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8437
|
+
element: z.knob ?? /* @__PURE__ */ (0, O.jsx)(Gr.Knob, {}),
|
|
8424
8438
|
children: [/* @__PURE__ */ (0, O.jsx)("div", { style: R.knobHitBox }), h && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8425
8439
|
style: F(R.label),
|
|
8426
|
-
element: z.label ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8440
|
+
element: z.label ?? /* @__PURE__ */ (0, O.jsx)(Gr.Label, {}),
|
|
8427
8441
|
children: h(o)
|
|
8428
8442
|
})]
|
|
8429
8443
|
})
|
|
@@ -8434,8 +8448,8 @@ function Wr({ ref: e, children: t, knobHeight: n = 30, knobPadding: r = 0, knobW
|
|
|
8434
8448
|
}
|
|
8435
8449
|
(function(e) {
|
|
8436
8450
|
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 });
|
|
8437
|
-
})(
|
|
8438
|
-
function
|
|
8451
|
+
})(Gr ||= {});
|
|
8452
|
+
function Kr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "vertical", isTrackInteractive: i = !0 }) {
|
|
8439
8453
|
return M({
|
|
8440
8454
|
body: {
|
|
8441
8455
|
height: "100%",
|
|
@@ -8494,29 +8508,29 @@ function Gr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientati
|
|
|
8494
8508
|
}
|
|
8495
8509
|
});
|
|
8496
8510
|
}
|
|
8497
|
-
function
|
|
8511
|
+
function qr(e, t) {
|
|
8498
8512
|
return t ? 1 - e : e;
|
|
8499
8513
|
}
|
|
8500
|
-
function
|
|
8514
|
+
function Jr(e, t) {
|
|
8501
8515
|
return t ? 1 - e : e;
|
|
8502
8516
|
}
|
|
8503
|
-
function
|
|
8517
|
+
function Yr(e, t = 1, n = 0) {
|
|
8504
8518
|
return Math.max(n, Math.min(t, e));
|
|
8505
8519
|
}
|
|
8506
|
-
process.env.NODE_ENV === "development" && (
|
|
8520
|
+
process.env.NODE_ENV === "development" && (Gr.displayName = "Slider", Gr.Track.displayName = "Slider.Track", Gr.Knob.displayName = "Slider.Knob", Gr.KnobContainer.displayName = "Slider.KnobContainer", Gr.Label.displayName = "Slider.Label");
|
|
8507
8521
|
//#endregion
|
|
8508
8522
|
//#region src/primitives/StepSlider.tsx
|
|
8509
|
-
function
|
|
8510
|
-
let S = e || f(null), C = f(null), w = f(null), T = f(null), E = f(null), D = f(
|
|
8511
|
-
let i =
|
|
8523
|
+
function Xr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding: i = 0, knobWidth: a = 30, orientation: o = "vertical", steps: s = Qr(10), trackPadding: l = 0, isClipped: p = !1, isInverted: m = !1, isTrackInteractive: h = !0, formatLabel: g, onDragEnd: _, onDragStart: v, onIndexChange: y, onPositionChange: b, ...x }) {
|
|
8524
|
+
let S = e || f(null), C = f(null), w = f(null), T = f(null), E = f(null), D = f(ei(n, s)), k = f(n), A = f(!1), M = Ze(C), N = c((e, t, n) => {
|
|
8525
|
+
let i = ni(e, m);
|
|
8512
8526
|
switch (o) {
|
|
8513
8527
|
case "horizontal": {
|
|
8514
8528
|
let n = p ? M.width - a : M.width;
|
|
8515
|
-
return n <= 0 ? e :
|
|
8529
|
+
return n <= 0 ? e : ti(ri((i * n + t) / n), m);
|
|
8516
8530
|
}
|
|
8517
8531
|
case "vertical": {
|
|
8518
8532
|
let t = p ? M.height - r : M.height;
|
|
8519
|
-
return t <= 0 ? e :
|
|
8533
|
+
return t <= 0 ? e : ti(ri((i * t + n) / t), m);
|
|
8520
8534
|
}
|
|
8521
8535
|
default: return console.error(`[etudes::StepSlider] Invalid orientation: ${o}`), NaN;
|
|
8522
8536
|
}
|
|
@@ -8529,7 +8543,7 @@ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8529
8543
|
r,
|
|
8530
8544
|
o
|
|
8531
8545
|
]), I = c((e) => {
|
|
8532
|
-
let t =
|
|
8546
|
+
let t = ni(e, m), n = w.current, i = T.current, s = E.current, c = (e) => `${l <= 0 ? 0 : e * .5}px - ${l}px`;
|
|
8533
8547
|
switch (o) {
|
|
8534
8548
|
case "horizontal":
|
|
8535
8549
|
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)})`);
|
|
@@ -8559,19 +8573,19 @@ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8559
8573
|
switch (o) {
|
|
8560
8574
|
case "horizontal":
|
|
8561
8575
|
if (M.width <= 0) return;
|
|
8562
|
-
n =
|
|
8576
|
+
n = ti((e.clientX + t.left - M.left) / M.width, m);
|
|
8563
8577
|
break;
|
|
8564
8578
|
case "vertical":
|
|
8565
8579
|
if (M.height <= 0) return;
|
|
8566
|
-
n =
|
|
8580
|
+
n = ti((e.clientY + t.top - M.top) / M.height, m);
|
|
8567
8581
|
break;
|
|
8568
8582
|
default:
|
|
8569
8583
|
console.error(`[etudes::StepSlider] Invalid orientation: ${o}`);
|
|
8570
8584
|
return;
|
|
8571
8585
|
}
|
|
8572
|
-
let r =
|
|
8586
|
+
let r = $r(n, s), i = r === k.current ? ri(n > D.current ? r + 1 : r - 1, s.length - 1) : r;
|
|
8573
8587
|
if (i !== k.current) {
|
|
8574
|
-
let e =
|
|
8588
|
+
let e = ei(i, s);
|
|
8575
8589
|
k.current = i, D.current = e, I(e), b?.(e, !1), y?.(i, !1);
|
|
8576
8590
|
}
|
|
8577
8591
|
}, [
|
|
@@ -8588,14 +8602,14 @@ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8588
8602
|
vt(w, {
|
|
8589
8603
|
onDragEnd: () => {
|
|
8590
8604
|
L(!1), A.current = !1, S.current?.classList.remove("dragging"), w.current?.classList.remove("dragging");
|
|
8591
|
-
let e =
|
|
8605
|
+
let e = $r(D.current, s), t = ei(e, s);
|
|
8592
8606
|
D.current = t, k.current = e, I(t), b?.(t, !1), y?.(e, !1), _?.();
|
|
8593
8607
|
},
|
|
8594
8608
|
onDragMove: ({ x: e, y: t }) => {
|
|
8595
8609
|
let n = N(D.current, e, t);
|
|
8596
8610
|
if (n !== D.current) {
|
|
8597
8611
|
D.current = n, I(n), b?.(n, !0);
|
|
8598
|
-
let e =
|
|
8612
|
+
let e = $r(n, s);
|
|
8599
8613
|
e !== k.current && (k.current = e, y?.(e, !0));
|
|
8600
8614
|
}
|
|
8601
8615
|
A.current = !0, S.current?.classList.add("dragging"), w.current?.classList.add("dragging");
|
|
@@ -8605,14 +8619,14 @@ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8605
8619
|
}
|
|
8606
8620
|
}), u(() => {
|
|
8607
8621
|
if (A.current) return;
|
|
8608
|
-
let e =
|
|
8622
|
+
let e = ei(n, s);
|
|
8609
8623
|
k.current = n, D.current = e, I(e);
|
|
8610
8624
|
}, [
|
|
8611
8625
|
n,
|
|
8612
8626
|
I,
|
|
8613
8627
|
_t(s)
|
|
8614
8628
|
]);
|
|
8615
|
-
let z =
|
|
8629
|
+
let z = ei(n, s), B = m ? z === 0 : z === 1, V = m ? z === 1 : z === 0, H = d(() => Zr({
|
|
8616
8630
|
knobHeight: r,
|
|
8617
8631
|
knobPadding: i,
|
|
8618
8632
|
knobWidth: a,
|
|
@@ -8625,10 +8639,10 @@ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8625
8639
|
o,
|
|
8626
8640
|
h
|
|
8627
8641
|
]), U = j(t, {
|
|
8628
|
-
knob:
|
|
8629
|
-
knobContainer:
|
|
8630
|
-
label:
|
|
8631
|
-
track:
|
|
8642
|
+
knob: Xr.Knob,
|
|
8643
|
+
knobContainer: Xr.KnobContainer,
|
|
8644
|
+
label: Xr.Label,
|
|
8645
|
+
track: Xr.Track
|
|
8632
8646
|
});
|
|
8633
8647
|
return /* @__PURE__ */ (0, O.jsx)("div", {
|
|
8634
8648
|
...x,
|
|
@@ -8647,7 +8661,7 @@ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8647
8661
|
ref: T,
|
|
8648
8662
|
style: F(H.track, o === "vertical" ? { top: "0" } : { left: "0" }),
|
|
8649
8663
|
"data-side": m ? "end" : "start",
|
|
8650
|
-
element: U.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8664
|
+
element: U.track ?? /* @__PURE__ */ (0, O.jsx)(Xr.Track, {}),
|
|
8651
8665
|
onClick: R,
|
|
8652
8666
|
children: /* @__PURE__ */ (0, O.jsx)("div", { style: H.trackHitBox })
|
|
8653
8667
|
}),
|
|
@@ -8655,20 +8669,20 @@ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8655
8669
|
ref: E,
|
|
8656
8670
|
style: F(H.track, o === "vertical" ? { bottom: "0" } : { right: "0" }),
|
|
8657
8671
|
"data-side": m ? "start" : "end",
|
|
8658
|
-
element: U.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8672
|
+
element: U.track ?? /* @__PURE__ */ (0, O.jsx)(Xr.Track, {}),
|
|
8659
8673
|
onClick: R,
|
|
8660
8674
|
children: /* @__PURE__ */ (0, O.jsx)("div", { style: H.trackHitBox })
|
|
8661
8675
|
}),
|
|
8662
8676
|
/* @__PURE__ */ (0, O.jsx)(P, {
|
|
8663
8677
|
ref: w,
|
|
8664
8678
|
style: F(H.knobContainer),
|
|
8665
|
-
element: U.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8679
|
+
element: U.knobContainer ?? /* @__PURE__ */ (0, O.jsx)(Xr.KnobContainer, {}),
|
|
8666
8680
|
children: /* @__PURE__ */ (0, O.jsxs)(P, {
|
|
8667
8681
|
style: F(H.knob),
|
|
8668
|
-
element: U.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8682
|
+
element: U.knob ?? /* @__PURE__ */ (0, O.jsx)(Xr.Knob, {}),
|
|
8669
8683
|
children: [/* @__PURE__ */ (0, O.jsx)("div", { style: H.knobHitBox }), g && /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8670
8684
|
style: F(H.label),
|
|
8671
|
-
element: U.label ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8685
|
+
element: U.label ?? /* @__PURE__ */ (0, O.jsx)(Xr.Label, {}),
|
|
8672
8686
|
children: g(z, n)
|
|
8673
8687
|
})]
|
|
8674
8688
|
})
|
|
@@ -8678,9 +8692,9 @@ function Yr({ ref: e, children: t, index: n = 0, knobHeight: r = 30, knobPadding
|
|
|
8678
8692
|
});
|
|
8679
8693
|
}
|
|
8680
8694
|
(function(e) {
|
|
8681
|
-
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 =
|
|
8682
|
-
})(
|
|
8683
|
-
function
|
|
8695
|
+
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 = Qr;
|
|
8696
|
+
})(Xr ||= {});
|
|
8697
|
+
function Zr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientation: r = "vertical", isTrackInteractive: i = !1 }) {
|
|
8684
8698
|
return M({
|
|
8685
8699
|
body: {
|
|
8686
8700
|
height: "100%",
|
|
@@ -8739,38 +8753,38 @@ function Xr({ knobHeight: e = 0, knobPadding: t = 0, knobWidth: n = 0, orientati
|
|
|
8739
8753
|
}
|
|
8740
8754
|
});
|
|
8741
8755
|
}
|
|
8742
|
-
function
|
|
8756
|
+
function Qr(e) {
|
|
8743
8757
|
if (e <= 1) return console.error("[etudes::StepSlider] `length` value must be greater than or equal to 2"), [];
|
|
8744
8758
|
if (Math.round(e) !== e) return console.error("[etudes::StepSlider] `length` value must be an integer"), [];
|
|
8745
8759
|
let t = 1 / (e - 1);
|
|
8746
8760
|
return Array(e).fill(null).map((e, n) => t * n);
|
|
8747
8761
|
}
|
|
8748
|
-
function
|
|
8762
|
+
function $r(e, t) {
|
|
8749
8763
|
let n = -1, r = NaN;
|
|
8750
8764
|
for (let i = 0, a = t.length; i < a; i++) {
|
|
8751
|
-
let a =
|
|
8765
|
+
let a = ei(i, t);
|
|
8752
8766
|
if (isNaN(a)) continue;
|
|
8753
8767
|
let o = Math.abs(e - a);
|
|
8754
8768
|
(isNaN(r) || o < r) && (r = o, n = i);
|
|
8755
8769
|
}
|
|
8756
8770
|
return n;
|
|
8757
8771
|
}
|
|
8758
|
-
function
|
|
8772
|
+
function ei(e, t) {
|
|
8759
8773
|
return e >= t.length ? NaN : t[e];
|
|
8760
8774
|
}
|
|
8761
|
-
function
|
|
8775
|
+
function ti(e, t) {
|
|
8762
8776
|
return t ? 1 - e : e;
|
|
8763
8777
|
}
|
|
8764
|
-
function
|
|
8778
|
+
function ni(e, t) {
|
|
8765
8779
|
return t ? 1 - e : e;
|
|
8766
8780
|
}
|
|
8767
|
-
function
|
|
8781
|
+
function ri(e, t = 1, n = 0) {
|
|
8768
8782
|
return Math.max(n, Math.min(t, e));
|
|
8769
8783
|
}
|
|
8770
|
-
process.env.NODE_ENV === "development" && (
|
|
8784
|
+
process.env.NODE_ENV === "development" && (Xr.displayName = "StepSlider", Xr.Track.displayName = "StepSlider.Track", Xr.Knob.displayName = "StepSlider.Knob", Xr.KnobContainer.displayName = "StepSlider.KnobContainer", Xr.Label.displayName = "StepSlider.Label");
|
|
8771
8785
|
//#endregion
|
|
8772
8786
|
//#region src/primitives/SwipeRegion.tsx
|
|
8773
|
-
function
|
|
8787
|
+
function ii({ ref: e, children: t, threshold: n = .5, isEnabled: r = !0, onSwipeDown: i, onSwipeLeft: a, onSwipeRight: o, onSwipeUp: s, ...c }) {
|
|
8774
8788
|
let [l, u] = p(void 0), [d, f] = p(void 0), [m, h] = p(NaN), g = (e, t) => {
|
|
8775
8789
|
if (isNaN(e) || isNaN(t)) return y();
|
|
8776
8790
|
u(K.make(e, t));
|
|
@@ -8798,24 +8812,24 @@ function ri({ ref: e, children: t, threshold: n = .5, isEnabled: r = !0, onSwipe
|
|
|
8798
8812
|
children: t
|
|
8799
8813
|
});
|
|
8800
8814
|
}
|
|
8801
|
-
process.env.NODE_ENV === "development" && (
|
|
8815
|
+
process.env.NODE_ENV === "development" && (ii.displayName = "SwipeRegion");
|
|
8802
8816
|
//#endregion
|
|
8803
8817
|
//#region src/primitives/TextArea.tsx
|
|
8804
|
-
function
|
|
8818
|
+
function ai({ ref: e, onChange: t, ...n }) {
|
|
8805
8819
|
return /* @__PURE__ */ (0, O.jsx)("textarea", {
|
|
8806
8820
|
...n,
|
|
8807
8821
|
ref: e,
|
|
8808
8822
|
onChange: (e) => t(e.target.value)
|
|
8809
8823
|
});
|
|
8810
8824
|
}
|
|
8811
|
-
process.env.NODE_ENV === "development" && (
|
|
8825
|
+
process.env.NODE_ENV === "development" && (ai.displayName = "TextArea");
|
|
8812
8826
|
//#endregion
|
|
8813
8827
|
//#region src/primitives/Toggle.tsx
|
|
8814
|
-
function
|
|
8828
|
+
function oi({ className: e, ref: t, style: n, children: r, orientation: i = "horizontal", isInverted: a = !1, isOn: o = !1, onChange: s, ...c }) {
|
|
8815
8829
|
let l = f(null), u = yt(l), d = j(r, {
|
|
8816
|
-
knob:
|
|
8817
|
-
track:
|
|
8818
|
-
}), p =
|
|
8830
|
+
knob: oi.Knob,
|
|
8831
|
+
track: oi.Track
|
|
8832
|
+
}), p = si({ isOn: o }), m = ci({
|
|
8819
8833
|
knobSize: u,
|
|
8820
8834
|
orientation: i,
|
|
8821
8835
|
isInverted: a,
|
|
@@ -8834,7 +8848,7 @@ function ai({ className: e, ref: t, style: n, children: r, orientation: i = "hor
|
|
|
8834
8848
|
}), /* @__PURE__ */ (0, O.jsx)(P, {
|
|
8835
8849
|
className: p.track,
|
|
8836
8850
|
style: m.track,
|
|
8837
|
-
element: d.track ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8851
|
+
element: d.track ?? /* @__PURE__ */ (0, O.jsx)(oi.Track, {}),
|
|
8838
8852
|
children: /* @__PURE__ */ (0, O.jsx)("div", {
|
|
8839
8853
|
style: {
|
|
8840
8854
|
height: "100%",
|
|
@@ -8845,7 +8859,7 @@ function ai({ className: e, ref: t, style: n, children: r, orientation: i = "hor
|
|
|
8845
8859
|
className: p.knob,
|
|
8846
8860
|
ref: l,
|
|
8847
8861
|
style: m.knob,
|
|
8848
|
-
element: d.knob ?? /* @__PURE__ */ (0, O.jsx)(
|
|
8862
|
+
element: d.knob ?? /* @__PURE__ */ (0, O.jsx)(oi.Knob, {})
|
|
8849
8863
|
})
|
|
8850
8864
|
})
|
|
8851
8865
|
})]
|
|
@@ -8859,15 +8873,15 @@ function ai({ className: e, ref: t, style: n, children: r, orientation: i = "hor
|
|
|
8859
8873
|
...t,
|
|
8860
8874
|
children: e
|
|
8861
8875
|
});
|
|
8862
|
-
})(
|
|
8863
|
-
function
|
|
8876
|
+
})(oi ||= {});
|
|
8877
|
+
function si({ isOn: e = !1 }) {
|
|
8864
8878
|
return A({
|
|
8865
8879
|
knob: w({ active: e }),
|
|
8866
8880
|
root: w({ active: e }),
|
|
8867
8881
|
track: w({ active: e })
|
|
8868
8882
|
});
|
|
8869
8883
|
}
|
|
8870
|
-
function
|
|
8884
|
+
function ci({ knobSize: e = q.zero, orientation: t = "horizontal", isInverted: n = !1, isOn: r = !1 }) {
|
|
8871
8885
|
return M({
|
|
8872
8886
|
input: {
|
|
8873
8887
|
height: 0,
|
|
@@ -8897,40 +8911,40 @@ function si({ knobSize: e = q.zero, orientation: t = "horizontal", isInverted: n
|
|
|
8897
8911
|
track: { position: "relative" }
|
|
8898
8912
|
});
|
|
8899
8913
|
}
|
|
8900
|
-
process.env.NODE_ENV === "development" && (
|
|
8914
|
+
process.env.NODE_ENV === "development" && (oi.displayName = "Toggle", oi.Knob.displayName = "Toggle.Knob", oi.Track.displayName = "Toggle.Track");
|
|
8901
8915
|
//#endregion
|
|
8902
8916
|
//#region src/providers/ScrollPositionProvider.tsx
|
|
8903
|
-
var
|
|
8917
|
+
var li = {
|
|
8904
8918
|
current: K.zero,
|
|
8905
8919
|
end: K.zero,
|
|
8906
8920
|
progress: K.zero,
|
|
8907
8921
|
start: K.zero
|
|
8908
|
-
},
|
|
8909
|
-
function
|
|
8910
|
-
let [i, a] = p(!0), [o, s] = p(!1), [c, l] = p(
|
|
8922
|
+
}, ui = a(li), di = a(!0), fi = a(!1);
|
|
8923
|
+
function pi({ children: e, scrollBottomOffset: t = 0, scrollTopOffset: n = 0, target: r }) {
|
|
8924
|
+
let [i, a] = p(!0), [o, s] = p(!1), [c, l] = p(li);
|
|
8911
8925
|
return fn(r, (e) => {
|
|
8912
8926
|
l(e), a(e.current.y <= e.start.y + n), s(e.current.y >= e.end.y - t);
|
|
8913
|
-
}), /* @__PURE__ */ (0, O.jsx)(
|
|
8927
|
+
}), /* @__PURE__ */ (0, O.jsx)(di.Provider, {
|
|
8914
8928
|
value: i,
|
|
8915
|
-
children: /* @__PURE__ */ (0, O.jsx)(
|
|
8929
|
+
children: /* @__PURE__ */ (0, O.jsx)(fi.Provider, {
|
|
8916
8930
|
value: o,
|
|
8917
|
-
children: /* @__PURE__ */ (0, O.jsx)(
|
|
8931
|
+
children: /* @__PURE__ */ (0, O.jsx)(ui.Provider, {
|
|
8918
8932
|
value: c,
|
|
8919
8933
|
children: e
|
|
8920
8934
|
})
|
|
8921
8935
|
})
|
|
8922
8936
|
});
|
|
8923
8937
|
}
|
|
8924
|
-
function pi() {
|
|
8925
|
-
let e = s(ui);
|
|
8926
|
-
return e === void 0 && console.warn("[etudes::useIsScrollTop] `useIsScrollTop` must be used within a `ScrollPositionProvider`"), e ?? !0;
|
|
8927
|
-
}
|
|
8928
8938
|
function mi() {
|
|
8929
8939
|
let e = s(di);
|
|
8930
|
-
return e === void 0 && console.warn("[etudes::
|
|
8940
|
+
return e === void 0 && console.warn("[etudes::useIsScrollTop] `useIsScrollTop` must be used within a `ScrollPositionProvider`"), e ?? !0;
|
|
8931
8941
|
}
|
|
8932
8942
|
function hi() {
|
|
8933
|
-
let e = s(
|
|
8943
|
+
let e = s(fi);
|
|
8944
|
+
return e === void 0 && console.warn("[etudes::useIsScrollBottom] `useIsScrollBottom` must be used within a `ScrollPositionProvider`"), e ?? !1;
|
|
8945
|
+
}
|
|
8946
|
+
function gi() {
|
|
8947
|
+
let e = s(ui);
|
|
8934
8948
|
return e || console.warn("[etudes::useScrollPosition] `useScrollPosition` must be used within a `ScrollPositionProvider`"), e ?? {
|
|
8935
8949
|
current: K.zero,
|
|
8936
8950
|
end: K.zero,
|
|
@@ -8938,26 +8952,26 @@ function hi() {
|
|
|
8938
8952
|
start: K.zero
|
|
8939
8953
|
};
|
|
8940
8954
|
}
|
|
8941
|
-
process.env.NODE_ENV === "development" && (
|
|
8955
|
+
process.env.NODE_ENV === "development" && (pi.displayName = "ScrollPositionProvider", ui.displayName = "ScrollPositionContext", di.displayName = "ScrollTopContext", fi.displayName = "ScrollBottomContext");
|
|
8942
8956
|
//#endregion
|
|
8943
8957
|
//#region src/utils/createKeyDeep.ts
|
|
8944
|
-
function
|
|
8945
|
-
return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(
|
|
8958
|
+
function _i(e) {
|
|
8959
|
+
return e == null ? "" : Array.isArray(e) ? JSON.stringify(e.map(_i)) : typeof e == "object" ? JSON.stringify(Object.entries(e).sort(([e], [t]) => e.localeCompare(t)).map(([e, t]) => [e, _i(t)])) : _t(e);
|
|
8946
8960
|
}
|
|
8947
8961
|
//#endregion
|
|
8948
8962
|
//#region src/utils/ExtractChildren.tsx
|
|
8949
|
-
function
|
|
8963
|
+
function vi({ children: e, ...n }) {
|
|
8950
8964
|
return /* @__PURE__ */ (0, O.jsx)(O.Fragment, { children: t.map(e, (e) => o(e) ? N(e, { ...n }) : e) });
|
|
8951
8965
|
}
|
|
8952
|
-
process.env.NODE_ENV === "development" && (
|
|
8966
|
+
process.env.NODE_ENV === "development" && (vi.displayName = "ExtractChildren");
|
|
8953
8967
|
//#endregion
|
|
8954
8968
|
//#region src/utils/getSystemColorScheme.ts
|
|
8955
|
-
function
|
|
8969
|
+
function yi() {
|
|
8956
8970
|
return typeof window < "u" && window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
8957
8971
|
}
|
|
8958
8972
|
//#endregion
|
|
8959
8973
|
//#region src/utils/NoSSR.tsx
|
|
8960
|
-
function
|
|
8974
|
+
function bi({ children: e, fallback: t = void 0 }) {
|
|
8961
8975
|
let [n, i] = p(!1);
|
|
8962
8976
|
if (l(() => {
|
|
8963
8977
|
i(typeof window < "u");
|
|
@@ -8967,4 +8981,4 @@ function yi({ children: e, fallback: t = void 0 }) {
|
|
|
8967
8981
|
});
|
|
8968
8982
|
}
|
|
8969
8983
|
//#endregion
|
|
8970
|
-
export {
|
|
8984
|
+
export { Pn as Accordion, I as Burger, R as BurgerButton, ft as Button, Jn as Carousel, tr as CodeInput, kn as Collection, kt as Conditional, sr as Counter, it as CoverImage, ut as CoverVideo, lr as Dial, pr as Dropdown, At as Each, Nt as ExtractChild, vi as ExtractChildren, yr as Form, nt as Image, Qe as ImageSource, xr as MasonryGrid, bi as NoSSR, ht as OptionButton, bt as Panorama, Et as PanoramaSlider, rt as Picture, $ as RangeSlider, k as Repeat, pi as ScrollPositionProvider, Rr as ScrollableCarousel, Ur as Select, Ot as SelectableButton, Gr as Slider, Xr as StepSlider, P as Styled, ii as SwipeRegion, jt as Switch, ai as TextArea, or as TextField, oi as Toggle, lt as Video, It as WithTooltip, A as asClassNameDict, j as asComponentDict, M as asStyleDict, N as cloneStyledElement, _t as createKey, _i as createKeyDeep, tn as createLocalCache, _n as createSessionCache, Cn as getStyle, yi as getSystemColorScheme, Zt as isTouchDevice, Pt as measureIntrinsicSize, wn 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, hi as useIsScrollBottom, mi as useIsScrollTop, Qt as useIsTouchDevice, $t as useKeyboardShortcut, Z as useLatest, Q as useLocalCache, sn as useMouseEnter, cn as useMouseLeave, ln as useOS, un as usePrevious, Ze as useRect, dn as useRightClick, gi as useScrollPosition, fn as useScrollPositionObserver, Sn as useSessionCache, yt as useSize, Ye as useSizeObserver, Tn as useStyle, En as useSystemColorScheme, Dn as useTimeout, ot as useVideoMetadataLoader, st as useVideoSize, Xe as useViewportSize };
|