@yselimcan/ui 0.0.3 → 0.0.4
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/dist/index100.js +5 -4
- package/dist/index101.js +128 -61
- package/dist/index102.js +27 -8
- package/dist/index103.js +7 -12
- package/dist/index104.js +5 -4
- package/dist/index105.js +12 -3
- package/dist/index106.js +22 -5
- package/dist/index108.js +7 -7
- package/dist/index109.js +1 -1
- package/dist/index110.js +4 -4
- package/dist/index113.js +1 -1
- package/dist/index115.js +1 -1
- package/dist/index118.js +1 -1
- package/dist/index119.js +2 -2
- package/dist/index121.js +19 -19
- package/dist/index122.js +1 -1
- package/dist/index124.js +7 -7
- package/dist/index126.js +3 -3
- package/dist/index127.js +5 -5
- package/dist/index128.js +1 -1
- package/dist/index129.js +14 -30
- package/dist/index130.js +4 -10
- package/dist/index131.js +27 -64
- package/dist/index132.js +15 -51
- package/dist/index133.js +21 -12
- package/dist/index134.js +58 -12
- package/dist/index135.js +16 -11
- package/dist/index136.js +23 -36
- package/dist/index137.js +40 -11
- package/dist/index138.js +43 -9
- package/dist/index139.js +21 -5
- package/dist/index140.js +46 -85
- package/dist/index141.js +51 -11
- package/dist/index142.js +14 -260
- package/dist/index143.js +11 -79
- package/dist/index144.js +21 -10
- package/dist/index145.js +34 -55
- package/dist/index146.js +230 -11
- package/dist/index147.js +283 -11
- package/dist/index148.js +53 -30
- package/dist/index149.js +14 -17
- package/dist/index150.js +72 -59
- package/dist/index151.js +3 -104
- package/dist/index152.js +29 -7
- package/dist/index153.js +24 -9
- package/dist/index154.js +15 -22
- package/dist/index155.js +66 -100
- package/dist/index156.js +2 -6
- package/dist/index157.js +103 -31
- package/dist/index158.js +75 -226
- package/dist/index159.js +257 -68
- package/dist/index160.js +11 -283
- package/dist/index161.js +10 -53
- package/dist/index162.js +40 -3
- package/dist/index163.js +4 -14
- package/dist/index164.js +65 -14
- package/dist/index165.js +10 -29
- package/dist/index166.js +8 -7
- package/dist/index167.js +5 -22
- package/dist/index168.js +53 -24
- package/dist/index169.js +11 -160
- package/dist/index170.js +114 -110
- package/dist/index171.js +11 -75
- package/dist/index172.js +11 -64
- package/dist/index173.js +65 -68
- package/dist/index174.js +13 -14
- package/dist/index175.js +13 -6
- package/dist/index176.js +11 -16
- package/dist/index177.js +11 -21
- package/dist/index178.js +86 -57
- package/dist/index179.js +11 -17
- package/dist/index18.js +1 -1
- package/dist/index180.js +11 -27
- package/dist/index181.js +56 -42
- package/dist/index182.js +10 -20
- package/dist/index183.js +11 -48
- package/dist/index184.js +15 -48
- package/dist/index185.js +8 -17
- package/dist/index186.js +8 -11
- package/dist/index187.js +102 -34
- package/dist/index188.js +7 -15
- package/dist/index189.js +31 -78
- package/dist/index190.js +74 -23
- package/dist/index191.js +15 -4
- package/dist/index192.js +28 -11
- package/dist/index193.js +7 -10
- package/dist/index194.js +22 -40
- package/dist/index195.js +25 -5
- package/dist/index196.js +160 -9
- package/dist/index197.js +113 -11
- package/dist/index198.js +73 -115
- package/dist/index199.js +64 -11
- package/dist/index200.js +47 -5
- package/dist/index201.js +193 -41
- package/dist/index202.js +30 -182
- package/dist/index203.js +20 -48
- package/dist/index204.js +6 -20
- package/dist/index205.js +3 -3
- package/dist/index206.js +12 -4
- package/dist/index207.js +9 -21
- package/dist/index208.js +14 -125
- package/dist/index209.js +7 -45
- package/dist/index210.js +4 -18
- package/dist/index211.js +22 -5
- package/dist/index212.js +122 -175
- package/dist/index213.js +45 -76
- package/dist/index214.js +15 -396
- package/dist/index215.js +5 -7
- package/dist/index216.js +181 -5
- package/dist/index217.js +74 -15
- package/dist/index218.js +396 -12
- package/dist/index219.js +38 -32
- package/dist/index220.js +57 -39
- package/dist/index221.js +28 -57
- package/dist/index222.js +7 -27
- package/dist/index223.js +12 -7
- package/dist/index224.js +10 -11
- package/dist/index225.js +5 -5
- package/dist/index226.js +21 -11
- package/dist/index227.js +11 -21
- package/dist/index228.js +7 -11
- package/dist/index229.js +42 -7
- package/dist/index230.js +594 -40
- package/dist/index231.js +11 -596
- package/dist/index232.js +32 -11
- package/dist/index233.js +3 -3
- package/dist/index234.js +5 -10
- package/dist/index235.js +14 -11
- package/dist/index236.js +208 -14
- package/dist/index237.js +4 -209
- package/dist/index238.js +13 -3
- package/dist/index239.js +47 -13
- package/dist/index24.js +2 -2
- package/dist/index240.js +3 -47
- package/dist/index241.js +12 -3
- package/dist/index242.js +56 -11
- package/dist/index243.js +29 -57
- package/dist/index244.js +13 -29
- package/dist/index245.js +9 -14
- package/dist/index246.js +207 -9
- package/dist/index247.js +304 -189
- package/dist/index248.js +3 -21
- package/dist/index249.js +3 -6
- package/dist/index250.js +14 -321
- package/dist/index251.js +21 -3
- package/dist/index252.js +6 -3
- package/dist/index253.js +1 -1
- package/dist/index28.js +1 -1
- package/dist/index32.js +1 -1
- package/dist/index33.js +12 -12
- package/dist/index34.js +4 -4
- package/dist/index35.js +9 -9
- package/dist/index36.js +6 -6
- package/dist/index37.js +7 -7
- package/dist/index38.js +9 -9
- package/dist/index39.js +2 -2
- package/dist/index40.js +2 -2
- package/dist/index41.js +2 -2
- package/dist/index42.js +2 -2
- package/dist/index43.js +1 -1
- package/dist/index45.js +5 -5
- package/dist/index46.js +7 -7
- package/dist/index47.js +7 -7
- package/dist/index48.js +14 -14
- package/dist/index49.js +4 -4
- package/dist/index50.js +6 -6
- package/dist/index52.js +20 -20
- package/dist/index53.js +2 -2
- package/dist/index54.js +23 -23
- package/dist/index55.js +7 -7
- package/dist/index56.js +5 -5
- package/dist/index57.js +1 -1
- package/dist/index58.js +2 -2
- package/dist/index59.js +4 -4
- package/dist/index60.js +8 -8
- package/dist/index61.js +3 -3
- package/dist/index62.js +3 -3
- package/dist/index63.js +8 -8
- package/dist/index64.js +3 -3
- package/dist/index65.js +3 -3
- package/dist/index66.js +8 -8
- package/dist/index67.js +1 -1
- package/dist/index69.js +26 -26
- package/dist/index70.js +4 -4
- package/dist/index71.js +11 -11
- package/dist/index72.js +16 -16
- package/dist/index73.js +7 -7
- package/dist/index74.js +1 -1
- package/dist/index75.js +11 -11
- package/dist/index76.js +2 -2
- package/dist/index77.js +2 -2
- package/dist/index78.js +2 -2
- package/dist/index79.js +1 -1
- package/dist/index80.js +1 -1
- package/dist/index81.js +14 -14
- package/dist/index82.js +3 -3
- package/dist/index83.js +4 -4
- package/dist/index86.js +7 -7
- package/dist/index88.js +81 -87
- package/dist/index89.js +87 -81
- package/dist/index94.js +4 -133
- package/dist/index95.js +63 -24
- package/dist/index96.js +8 -8
- package/dist/index97.js +14 -5
- package/dist/index98.js +3 -12
- package/dist/index99.js +3 -22
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/index161.js
CHANGED
|
@@ -1,56 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { useIsoLayoutEffect as T } from "./index97.js";
|
|
4
|
-
import { useTimeout as D } from "./index148.js";
|
|
5
|
-
import { EMPTY_ARRAY as U } from "./index106.js";
|
|
6
|
-
import { stopEvent as O } from "./index222.js";
|
|
7
|
-
function H(l, b) {
|
|
8
|
-
const g = "rootStore" in l ? l.rootStore : l, c = g.useState("open"), u = g.context.dataRef, {
|
|
9
|
-
listRef: E,
|
|
10
|
-
activeIndex: p,
|
|
11
|
-
onMatch: A,
|
|
12
|
-
onTypingChange: R,
|
|
13
|
-
enabled: h = !0,
|
|
14
|
-
findMatch: L = null,
|
|
15
|
-
resetMs: F = 750,
|
|
16
|
-
ignoreKeys: P = U,
|
|
17
|
-
selectedIndex: y = null
|
|
18
|
-
} = b, m = D(), r = o.useRef(""), i = o.useRef(y ?? p ?? -1), f = o.useRef(null);
|
|
19
|
-
T(() => {
|
|
20
|
-
c && (m.clear(), f.current = null, r.current = "");
|
|
21
|
-
}, [c, m]), T(() => {
|
|
22
|
-
c && r.current === "" && (i.current = y ?? p ?? -1);
|
|
23
|
-
}, [c, y, p]);
|
|
24
|
-
const n = S((e) => {
|
|
25
|
-
e ? u.current.typing || (u.current.typing = e, R?.(e)) : u.current.typing && (u.current.typing = e, R?.(e));
|
|
26
|
-
}), a = S((e) => {
|
|
27
|
-
function C(s, x, I) {
|
|
28
|
-
const K = L ? L(x, I) : x.find((Y) => Y?.toLocaleLowerCase().indexOf(I.toLocaleLowerCase()) === 0);
|
|
29
|
-
return K ? s.indexOf(K) : -1;
|
|
30
|
-
}
|
|
31
|
-
const t = E.current;
|
|
32
|
-
if (r.current.length > 0 && r.current[0] !== " " && (C(t, t, r.current) === -1 ? n(!1) : e.key === " " && O(e)), t == null || P.includes(e.key) || // Character key.
|
|
33
|
-
e.key.length !== 1 || // Modifier key.
|
|
34
|
-
e.ctrlKey || e.metaKey || e.altKey)
|
|
35
|
-
return;
|
|
36
|
-
c && e.key !== " " && (O(e), n(!0)), t.every((s) => s ? s[0]?.toLocaleLowerCase() !== s[1]?.toLocaleLowerCase() : !0) && r.current === e.key && (r.current = "", i.current = f.current), r.current += e.key, m.start(F, () => {
|
|
37
|
-
r.current = "", i.current = f.current, n(!1);
|
|
38
|
-
});
|
|
39
|
-
const w = i.current, d = C(t, [...t.slice((w || 0) + 1), ...t.slice(0, (w || 0) + 1)], r.current);
|
|
40
|
-
d !== -1 ? (A?.(d), f.current = d) : e.key !== " " && (r.current = "", n(!1));
|
|
41
|
-
}), k = o.useMemo(() => ({
|
|
42
|
-
onKeyDown: a
|
|
43
|
-
}), [a]), M = o.useMemo(() => ({
|
|
44
|
-
onKeyDown: a,
|
|
45
|
-
onKeyUp(e) {
|
|
46
|
-
e.key === " " && n(!1);
|
|
47
|
-
}
|
|
48
|
-
}), [a, n]);
|
|
49
|
-
return o.useMemo(() => h ? {
|
|
50
|
-
reference: k,
|
|
51
|
-
floating: M
|
|
52
|
-
} : {}, [h, k, M]);
|
|
1
|
+
function e(o, t) {
|
|
2
|
+
o && Object.assign(o.style, t);
|
|
53
3
|
}
|
|
4
|
+
const i = {
|
|
5
|
+
position: "relative",
|
|
6
|
+
maxHeight: "100%",
|
|
7
|
+
overflowX: "hidden",
|
|
8
|
+
overflowY: "auto"
|
|
9
|
+
};
|
|
54
10
|
export {
|
|
55
|
-
|
|
11
|
+
i as LIST_FUNCTIONAL_STYLES,
|
|
12
|
+
e as clearStyles
|
|
56
13
|
};
|
package/dist/index162.js
CHANGED
|
@@ -1,6 +1,43 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
const a = typeof navigator < "u", o = e(), n = f(), r = u(), c = typeof CSS > "u" || !CSS.supports ? !1 : CSS.supports("-webkit-backdrop-filter:none"), m = (
|
|
2
|
+
// iPads can claim to be MacIntel
|
|
3
|
+
o.platform === "MacIntel" && o.maxTouchPoints > 1 ? !0 : /iP(hone|ad|od)|iOS/.test(o.platform)
|
|
4
|
+
), p = a && /firefox/i.test(r), g = a && /apple/i.test(navigator.vendor), d = a && /android/i.test(n) || /android/i.test(r), l = a && n.toLowerCase().startsWith("mac") && !navigator.maxTouchPoints, v = r.includes("jsdom/");
|
|
5
|
+
function e() {
|
|
6
|
+
if (!a)
|
|
7
|
+
return {
|
|
8
|
+
platform: "",
|
|
9
|
+
maxTouchPoints: -1
|
|
10
|
+
};
|
|
11
|
+
const t = navigator.userAgentData;
|
|
12
|
+
return t?.platform ? {
|
|
13
|
+
platform: t.platform,
|
|
14
|
+
maxTouchPoints: navigator.maxTouchPoints
|
|
15
|
+
} : {
|
|
16
|
+
platform: navigator.platform ?? "",
|
|
17
|
+
maxTouchPoints: navigator.maxTouchPoints ?? -1
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function u() {
|
|
21
|
+
if (!a)
|
|
22
|
+
return "";
|
|
23
|
+
const t = navigator.userAgentData;
|
|
24
|
+
return t && Array.isArray(t.brands) ? t.brands.map(({
|
|
25
|
+
brand: i,
|
|
26
|
+
version: s
|
|
27
|
+
}) => `${i}/${s}`).join(" ") : navigator.userAgent;
|
|
28
|
+
}
|
|
29
|
+
function f() {
|
|
30
|
+
if (!a)
|
|
31
|
+
return "";
|
|
32
|
+
const t = navigator.userAgentData;
|
|
33
|
+
return t?.platform ? t.platform : navigator.platform ?? "";
|
|
3
34
|
}
|
|
4
35
|
export {
|
|
5
|
-
|
|
36
|
+
d as isAndroid,
|
|
37
|
+
p as isFirefox,
|
|
38
|
+
m as isIOS,
|
|
39
|
+
v as isJSDOM,
|
|
40
|
+
l as isMac,
|
|
41
|
+
g as isSafari,
|
|
42
|
+
c as isWebKit
|
|
6
43
|
};
|
package/dist/index163.js
CHANGED
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
current: []
|
|
5
|
-
};
|
|
6
|
-
events = n();
|
|
7
|
-
addNode(e) {
|
|
8
|
-
this.nodesRef.current.push(e);
|
|
9
|
-
}
|
|
10
|
-
removeNode(e) {
|
|
11
|
-
const t = this.nodesRef.current.findIndex((r) => r === e);
|
|
12
|
-
t !== -1 && this.nodesRef.current.splice(t, 1);
|
|
13
|
-
}
|
|
1
|
+
function o(t) {
|
|
2
|
+
const i = t.currentTarget.getBoundingClientRect();
|
|
3
|
+
return i.top + 1 <= t.clientY && t.clientY <= i.bottom - 1 && i.left + 1 <= t.clientX && t.clientX <= i.right - 1;
|
|
14
4
|
}
|
|
15
5
|
export {
|
|
16
|
-
|
|
6
|
+
o as isMouseWithinBounds
|
|
17
7
|
};
|
package/dist/index164.js
CHANGED
|
@@ -1,18 +1,69 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import { useRefWithInit as u } from "./index107.js";
|
|
3
|
+
import { useOnMount as h } from "./index209.js";
|
|
4
|
+
const s = null;
|
|
5
|
+
let l = globalThis.requestAnimationFrame;
|
|
6
|
+
class o {
|
|
7
|
+
/* This implementation uses an array as a backing data-structure for frame callbacks.
|
|
8
|
+
* It allows `O(1)` callback cancelling by inserting a `null` in the array, though it
|
|
9
|
+
* never calls the native `cancelAnimationFrame` if there are no frames left. This can
|
|
10
|
+
* be much more efficient if there is a call pattern that alterns as
|
|
11
|
+
* "request-cancel-request-cancel-…".
|
|
12
|
+
* But in the case of "request-request-…-cancel-cancel-…", it leaves the final animation
|
|
13
|
+
* frame to run anyway. We turn that frame into a `O(1)` no-op via `callbacksCount`. */
|
|
14
|
+
callbacks = [];
|
|
15
|
+
callbacksCount = 0;
|
|
16
|
+
nextId = 1;
|
|
17
|
+
startId = 1;
|
|
18
|
+
isScheduled = !1;
|
|
19
|
+
tick = (t) => {
|
|
20
|
+
this.isScheduled = !1;
|
|
21
|
+
const e = this.callbacks, i = this.callbacksCount;
|
|
22
|
+
if (this.callbacks = [], this.callbacksCount = 0, this.startId = this.nextId, i > 0)
|
|
23
|
+
for (let r = 0; r < e.length; r += 1)
|
|
24
|
+
e[r]?.(t);
|
|
14
25
|
};
|
|
26
|
+
request(t) {
|
|
27
|
+
const e = this.nextId;
|
|
28
|
+
this.nextId += 1, this.callbacks.push(t), this.callbacksCount += 1;
|
|
29
|
+
const i = process.env.NODE_ENV === "test" && l !== requestAnimationFrame && (l = requestAnimationFrame, !0);
|
|
30
|
+
return (!this.isScheduled || i) && (requestAnimationFrame(this.tick), this.isScheduled = !0), e;
|
|
31
|
+
}
|
|
32
|
+
cancel(t) {
|
|
33
|
+
const e = t - this.startId;
|
|
34
|
+
e < 0 || e >= this.callbacks.length || (this.callbacks[e] = null, this.callbacksCount -= 1);
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
const c = new o();
|
|
38
|
+
class a {
|
|
39
|
+
static create() {
|
|
40
|
+
return new a();
|
|
41
|
+
}
|
|
42
|
+
static request(t) {
|
|
43
|
+
return c.request(t);
|
|
44
|
+
}
|
|
45
|
+
static cancel(t) {
|
|
46
|
+
return c.cancel(t);
|
|
47
|
+
}
|
|
48
|
+
currentId = s;
|
|
49
|
+
/**
|
|
50
|
+
* Executes `fn` after `delay`, clearing any previously scheduled call.
|
|
51
|
+
*/
|
|
52
|
+
request(t) {
|
|
53
|
+
this.cancel(), this.currentId = c.request(() => {
|
|
54
|
+
this.currentId = s, t();
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
cancel = () => {
|
|
58
|
+
this.currentId !== s && (c.cancel(this.currentId), this.currentId = s);
|
|
59
|
+
};
|
|
60
|
+
disposeEffect = () => this.cancel;
|
|
61
|
+
}
|
|
62
|
+
function k() {
|
|
63
|
+
const n = u(a.create).current;
|
|
64
|
+
return h(n.disposeEffect), n;
|
|
15
65
|
}
|
|
16
66
|
export {
|
|
17
|
-
|
|
67
|
+
a as AnimationFrame,
|
|
68
|
+
k as useAnimationFrame
|
|
18
69
|
};
|
package/dist/index165.js
CHANGED
|
@@ -1,31 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
props: r = t,
|
|
11
|
-
refs: s = t,
|
|
12
|
-
metadata: m,
|
|
13
|
-
stateAttributesMapping: p,
|
|
14
|
-
tag: i = "div",
|
|
15
|
-
...a
|
|
16
|
-
} = e, {
|
|
17
|
-
compositeProps: n,
|
|
18
|
-
compositeRef: f
|
|
19
|
-
} = u({
|
|
20
|
-
metadata: m
|
|
21
|
-
});
|
|
22
|
-
return c(i, e, {
|
|
23
|
-
state: o,
|
|
24
|
-
ref: [...s, f],
|
|
25
|
-
props: [n, ...r, a],
|
|
26
|
-
stateAttributesMapping: p
|
|
27
|
-
});
|
|
28
|
-
}
|
|
1
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
2
|
+
const e = "base-ui-disable-scrollbar", r = {
|
|
3
|
+
className: e,
|
|
4
|
+
element: /* @__PURE__ */ l("style", {
|
|
5
|
+
href: e,
|
|
6
|
+
precedence: "base-ui:low",
|
|
7
|
+
children: `.${e}{scrollbar-width:none}.${e}::-webkit-scrollbar{display:none}`
|
|
8
|
+
})
|
|
9
|
+
};
|
|
29
10
|
export {
|
|
30
|
-
|
|
11
|
+
r as styleDisableScrollbar
|
|
31
12
|
};
|
package/dist/index166.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
"use client";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
const t = /* @__PURE__ */ o.createContext(void 0);
|
|
4
|
+
process.env.NODE_ENV !== "production" && (t.displayName = "ToolbarRootContext");
|
|
5
|
+
function r(e) {
|
|
6
|
+
return o.useContext(t);
|
|
7
7
|
}
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
t as ToolbarRootContext,
|
|
10
|
+
r as useToolbarRootContext
|
|
10
11
|
};
|
package/dist/index167.js
CHANGED
|
@@ -1,25 +1,8 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
const {
|
|
6
|
-
enabled: t = !0,
|
|
7
|
-
mouseDownAction: r,
|
|
8
|
-
open: n
|
|
9
|
-
} = u, e = c.useRef(!1);
|
|
10
|
-
return c.useMemo(() => t ? {
|
|
11
|
-
onMouseDown: (o) => {
|
|
12
|
-
(r === "open" && !n || r === "close" && n) && (e.current = !0, i(o.currentTarget).addEventListener("click", () => {
|
|
13
|
-
e.current = !1;
|
|
14
|
-
}, {
|
|
15
|
-
once: !0
|
|
16
|
-
}));
|
|
17
|
-
},
|
|
18
|
-
onClick: (o) => {
|
|
19
|
-
e.current && (e.current = !1, o.preventBaseUIHandler());
|
|
20
|
-
}
|
|
21
|
-
} : s, [t, r, n]);
|
|
1
|
+
import { DISABLED_TRANSITIONS_STYLE as r } from "./index125.js";
|
|
2
|
+
import { EMPTY_OBJECT as o } from "./index100.js";
|
|
3
|
+
function T(t) {
|
|
4
|
+
return t === "starting" ? r : o;
|
|
22
5
|
}
|
|
23
6
|
export {
|
|
24
|
-
|
|
7
|
+
T as getDisabledMountTransitionStyles
|
|
25
8
|
};
|
package/dist/index168.js
CHANGED
|
@@ -1,27 +1,56 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import * as
|
|
3
|
-
import { useIsoLayoutEffect as
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
})
|
|
23
|
-
|
|
24
|
-
|
|
2
|
+
import * as u from "react";
|
|
3
|
+
import { useIsoLayoutEffect as g } from "./index104.js";
|
|
4
|
+
import { useCompositeListContext as F } from "./index211.js";
|
|
5
|
+
let I = /* @__PURE__ */ (function(t) {
|
|
6
|
+
return t[t.None = 0] = "None", t[t.GuessFromOrder = 1] = "GuessFromOrder", t;
|
|
7
|
+
})({});
|
|
8
|
+
function N(t = {}) {
|
|
9
|
+
const {
|
|
10
|
+
label: c,
|
|
11
|
+
metadata: l,
|
|
12
|
+
textRef: d,
|
|
13
|
+
indexGuessBehavior: L,
|
|
14
|
+
index: r
|
|
15
|
+
} = t, {
|
|
16
|
+
register: m,
|
|
17
|
+
unregister: a,
|
|
18
|
+
subscribeMapChange: x,
|
|
19
|
+
elementsRef: R,
|
|
20
|
+
labelsRef: i,
|
|
21
|
+
nextIndexRef: p
|
|
22
|
+
} = F(), f = u.useRef(-1), [n, C] = u.useState(r ?? (L === I.GuessFromOrder ? () => {
|
|
23
|
+
if (f.current === -1) {
|
|
24
|
+
const e = p.current;
|
|
25
|
+
p.current += 1, f.current = e;
|
|
26
|
+
}
|
|
27
|
+
return f.current;
|
|
28
|
+
} : -1)), s = u.useRef(null), b = u.useCallback((e) => {
|
|
29
|
+
if (s.current = e, n !== -1 && e !== null && (R.current[n] = e, i)) {
|
|
30
|
+
const o = c !== void 0;
|
|
31
|
+
i.current[n] = o ? c : d?.current?.textContent ?? e.textContent;
|
|
32
|
+
}
|
|
33
|
+
}, [n, R, i, c, d]);
|
|
34
|
+
return g(() => {
|
|
35
|
+
if (r != null)
|
|
36
|
+
return;
|
|
37
|
+
const e = s.current;
|
|
38
|
+
if (e)
|
|
39
|
+
return m(e, l), () => {
|
|
40
|
+
a(e);
|
|
41
|
+
};
|
|
42
|
+
}, [r, m, a, l]), g(() => {
|
|
43
|
+
if (r == null)
|
|
44
|
+
return x((e) => {
|
|
45
|
+
const o = s.current ? e.get(s.current)?.index : null;
|
|
46
|
+
o != null && C(o);
|
|
47
|
+
});
|
|
48
|
+
}, [r, x, C]), u.useMemo(() => ({
|
|
49
|
+
ref: b,
|
|
50
|
+
index: n
|
|
51
|
+
}), [n, b]);
|
|
52
|
+
}
|
|
25
53
|
export {
|
|
26
|
-
|
|
54
|
+
I as IndexGuessBehavior,
|
|
55
|
+
N as useCompositeListItem
|
|
27
56
|
};
|
package/dist/index169.js
CHANGED
|
@@ -1,163 +1,14 @@
|
|
|
1
|
-
import
|
|
2
|
-
import * as
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
import { triggerHover as L } from "./index114.js";
|
|
11
|
-
import { getDocument as z, contains as O } from "./index173.js";
|
|
12
|
-
import { isMouseLikePointerType as B } from "./index222.js";
|
|
13
|
-
function W(l) {
|
|
14
|
-
return typeof l == "function" ? l() : l;
|
|
15
|
-
}
|
|
16
|
-
const se = {
|
|
17
|
-
current: null
|
|
18
|
-
};
|
|
19
|
-
function Re(l, G = {}) {
|
|
20
|
-
const t = "rootStore" in l ? l.rootStore : l, {
|
|
21
|
-
dataRef: a,
|
|
22
|
-
events: A
|
|
23
|
-
} = t.context, {
|
|
24
|
-
enabled: x = !0,
|
|
25
|
-
delay: J = 0,
|
|
26
|
-
handleClose: K = null,
|
|
27
|
-
mouseOnly: D = !1,
|
|
28
|
-
restMs: Q = 0,
|
|
29
|
-
move: X = !0,
|
|
30
|
-
triggerElementRef: b = se,
|
|
31
|
-
externalTree: U,
|
|
32
|
-
isActiveTrigger: _ = !0
|
|
33
|
-
} = G, w = ne(U), {
|
|
34
|
-
pointerTypeRef: o,
|
|
35
|
-
interactedInsideRef: Z,
|
|
36
|
-
handlerRef: d,
|
|
37
|
-
blockMouseMoveRef: p,
|
|
38
|
-
performedPointerEventsMutationRef: j,
|
|
39
|
-
unbindMouseMoveRef: P,
|
|
40
|
-
restTimeoutPendingRef: f,
|
|
41
|
-
openChangeTimeout: c,
|
|
42
|
-
restTimeout: m,
|
|
43
|
-
handleCloseOptionsRef: $
|
|
44
|
-
} = oe(t), v = N(K), M = N(J), T = N(Q);
|
|
45
|
-
_ && ($.current = v.current?.__options);
|
|
46
|
-
const y = Y(() => Z.current ? !0 : a.current.openEvent ? ["click", "mousedown"].includes(a.current.openEvent.type) : !1), S = H.useCallback((e, r = !0) => {
|
|
47
|
-
const s = V(M.current, "close", o.current);
|
|
48
|
-
s && !d.current ? c.start(s, () => t.setOpen(!1, C(L, e))) : r && (c.clear(), t.setOpen(!1, C(L, e)));
|
|
49
|
-
}, [M, d, t, o, c]), F = Y(() => {
|
|
50
|
-
P.current(), d.current = void 0;
|
|
51
|
-
}), k = Y(() => {
|
|
52
|
-
if (j.current) {
|
|
53
|
-
const e = z(t.select("domReferenceElement")).body;
|
|
54
|
-
e.style.pointerEvents = "", e.removeAttribute(ce), j.current = !1;
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
H.useEffect(() => {
|
|
58
|
-
if (!x)
|
|
59
|
-
return;
|
|
60
|
-
function e(r) {
|
|
61
|
-
r.open || (c.clear(), m.clear(), p.current = !0, f.current = !1);
|
|
62
|
-
}
|
|
63
|
-
return A.on("openchange", e), () => {
|
|
64
|
-
A.off("openchange", e);
|
|
65
|
-
};
|
|
66
|
-
}, [x, A, c, m, p, f]);
|
|
67
|
-
const q = Y((e) => {
|
|
68
|
-
if (y() || !a.current.floatingContext)
|
|
69
|
-
return;
|
|
70
|
-
const r = t.context.triggerElements;
|
|
71
|
-
if (e.relatedTarget && r.hasElement(e.relatedTarget))
|
|
72
|
-
return;
|
|
73
|
-
const s = b.current;
|
|
74
|
-
v.current?.({
|
|
75
|
-
...a.current.floatingContext,
|
|
76
|
-
tree: w,
|
|
77
|
-
x: e.clientX,
|
|
78
|
-
y: e.clientY,
|
|
79
|
-
onClose() {
|
|
80
|
-
k(), F(), !y() && s === t.select("domReferenceElement") && S(e);
|
|
81
|
-
}
|
|
82
|
-
})(e);
|
|
83
|
-
});
|
|
84
|
-
return H.useEffect(() => {
|
|
85
|
-
if (!x)
|
|
86
|
-
return;
|
|
87
|
-
const e = b.current ?? (_ ? t.select("domReferenceElement") : null);
|
|
88
|
-
if (!re(e))
|
|
89
|
-
return;
|
|
90
|
-
function r(n) {
|
|
91
|
-
if (c.clear(), p.current = !1, D && !B(o.current) || W(T.current) > 0 && !V(M.current, "open"))
|
|
92
|
-
return;
|
|
93
|
-
const g = V(M.current, "open", o.current), u = t.select("domReferenceElement"), i = t.context.triggerElements, E = (i.hasElement(n.target) || i.hasMatchingElement((ee) => O(ee, n.target))) && (!u || !O(u, n.target)), R = n.currentTarget ?? null, h = !t.select("open") || E;
|
|
94
|
-
g ? c.start(g, () => {
|
|
95
|
-
h && t.setOpen(!0, C(L, n, R));
|
|
96
|
-
}) : h && t.setOpen(!0, C(L, n, R));
|
|
97
|
-
}
|
|
98
|
-
function s(n) {
|
|
99
|
-
if (y()) {
|
|
100
|
-
k();
|
|
101
|
-
return;
|
|
102
|
-
}
|
|
103
|
-
P.current();
|
|
104
|
-
const g = t.select("domReferenceElement"), u = z(g);
|
|
105
|
-
m.clear(), f.current = !1;
|
|
106
|
-
const i = t.context.triggerElements;
|
|
107
|
-
if (n.relatedTarget && i.hasElement(n.relatedTarget))
|
|
108
|
-
return;
|
|
109
|
-
if (v.current && a.current.floatingContext) {
|
|
110
|
-
t.select("open") || c.clear();
|
|
111
|
-
const R = b.current;
|
|
112
|
-
d.current = v.current({
|
|
113
|
-
...a.current.floatingContext,
|
|
114
|
-
tree: w,
|
|
115
|
-
x: n.clientX,
|
|
116
|
-
y: n.clientY,
|
|
117
|
-
onClose() {
|
|
118
|
-
k(), F(), !y() && R === t.select("domReferenceElement") && S(n, !0);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
const h = d.current;
|
|
122
|
-
h(n), u.addEventListener("mousemove", h), P.current = () => {
|
|
123
|
-
u.removeEventListener("mousemove", h);
|
|
124
|
-
};
|
|
125
|
-
return;
|
|
126
|
-
}
|
|
127
|
-
(o.current !== "touch" || !O(t.select("floatingElement"), n.relatedTarget)) && S(n);
|
|
128
|
-
}
|
|
129
|
-
function I(n) {
|
|
130
|
-
q(n);
|
|
131
|
-
}
|
|
132
|
-
return t.select("open") && e.addEventListener("mouseleave", I), X && e.addEventListener("mousemove", r, {
|
|
133
|
-
once: !0
|
|
134
|
-
}), e.addEventListener("mouseenter", r), e.addEventListener("mouseleave", s), () => {
|
|
135
|
-
e.removeEventListener("mouseleave", I), X && e.removeEventListener("mousemove", r), e.removeEventListener("mouseenter", r), e.removeEventListener("mouseleave", s);
|
|
136
|
-
};
|
|
137
|
-
}, [F, k, p, a, M, S, t, x, v, q, _, y, D, X, o, T, m, f, c, b, w, P, d]), H.useMemo(() => {
|
|
138
|
-
function e(r) {
|
|
139
|
-
o.current = r.pointerType;
|
|
140
|
-
}
|
|
141
|
-
return {
|
|
142
|
-
onPointerDown: e,
|
|
143
|
-
onPointerEnter: e,
|
|
144
|
-
onMouseMove(r) {
|
|
145
|
-
const {
|
|
146
|
-
nativeEvent: s
|
|
147
|
-
} = r, I = r.currentTarget, n = t.select("domReferenceElement"), g = t.context.triggerElements, u = t.select("open"), i = (g.hasElement(r.target) || g.hasMatchingElement((R) => O(R, r.target))) && (!n || !O(n, r.target));
|
|
148
|
-
if (D && !B(o.current) || u && !i || W(T.current) === 0 || !i && f.current && r.movementX ** 2 + r.movementY ** 2 < 2)
|
|
149
|
-
return;
|
|
150
|
-
m.clear();
|
|
151
|
-
function E() {
|
|
152
|
-
!p.current && (!u || i) && t.setOpen(!0, C(L, s, I));
|
|
153
|
-
}
|
|
154
|
-
o.current === "touch" ? te.flushSync(() => {
|
|
155
|
-
E();
|
|
156
|
-
}) : i && u ? E() : (f.current = !0, m.start(W(T.current), E));
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
}, [p, D, t, o, T, m, f]);
|
|
1
|
+
import n from "./index94.js";
|
|
2
|
+
import * as t from "react";
|
|
3
|
+
const o = /* @__PURE__ */ t.createContext(void 0);
|
|
4
|
+
process.env.NODE_ENV !== "production" && (o.displayName = "SelectItemContext");
|
|
5
|
+
function s() {
|
|
6
|
+
const e = t.useContext(o);
|
|
7
|
+
if (!e)
|
|
8
|
+
throw new Error(process.env.NODE_ENV !== "production" ? "Base UI: SelectItemContext is missing. SelectItem parts must be placed within <Select.Item>." : n(57));
|
|
9
|
+
return e;
|
|
160
10
|
}
|
|
161
11
|
export {
|
|
162
|
-
|
|
12
|
+
o as SelectItemContext,
|
|
13
|
+
s as useSelectItemContext
|
|
163
14
|
};
|