@serendie/ui 2.0.0 → 2.1.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/dist/components/CheckBox/CheckBox.js +36 -35
- package/dist/components/ChoiceBox/ChoiceBox.js +41 -41
- package/dist/components/DataTable/DataTableComponent.d.ts +3 -20
- package/dist/components/DataTable/DataTableComponent.js +38 -36
- package/dist/components/DataTable/table/HeaderCheckbox.js +29 -19
- package/dist/components/Search/Search.d.ts +3 -1
- package/dist/components/Search/Search.js +34 -33
- package/dist/components/Select/Select.d.ts +2 -1
- package/dist/components/Select/Select.js +47 -41
- package/dist/components/Tooltip/Tooltip.d.ts +14 -0
- package/dist/components/Tooltip/Tooltip.js +70 -0
- package/dist/components/Tooltip/index.d.ts +1 -0
- package/dist/components/Tooltip/index.js +4 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +12 -10
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-content.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-indicator.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item-trigger.js +10 -12
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/accordion-item.js +16 -16
- package/dist/node_modules/@ark-ui/react/dist/components/accordion/use-accordion.js +13 -20
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/avatar-root.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/avatar/use-avatar.js +14 -18
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/checkbox-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/checkbox/use-checkbox.js +22 -28
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/collapsible-content.js +7 -9
- package/dist/node_modules/@ark-ui/react/dist/components/collapsible/use-collapsible.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/collection/list-collection.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-item-group.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-positioner.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-root.js +17 -18
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/combobox-trigger.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox-item-context.js +5 -7
- package/dist/node_modules/@ark-ui/react/dist/components/combobox/use-combobox.js +21 -45
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-backdrop.js +10 -9
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-close-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-content.js +6 -5
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/dialog-description.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/dialog/use-dialog.js +13 -22
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +26 -24
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item-group.js +1 -3
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-item.js +15 -13
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +13 -14
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu-option-item-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/menu/use-menu.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-ellipsis.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-next-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-prev-trigger.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/pagination-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/components/pagination/use-pagination.js +13 -19
- package/dist/node_modules/@ark-ui/react/dist/components/portal/portal.js +25 -16
- package/dist/node_modules/@ark-ui/react/dist/components/presence/split-presence-props.js +3 -2
- package/dist/node_modules/@ark-ui/react/dist/components/presence/use-presence.js +18 -18
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-control.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item-text.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/radio-group-item.js +1 -5
- package/dist/node_modules/@ark-ui/react/dist/components/radio-group/use-radio-group.js +14 -22
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-content.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/select/select-root.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/select/use-select.js +20 -47
- package/dist/node_modules/@ark-ui/react/dist/components/switch/switch-hidden-input.js +4 -6
- package/dist/node_modules/@ark-ui/react/dist/components/switch/use-switch.js +20 -26
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/tabs-root.js +9 -8
- package/dist/node_modules/@ark-ui/react/dist/components/tabs/use-tabs.js +14 -21
- package/dist/node_modules/@ark-ui/react/dist/components/toast/create-toaster.js +3 -7
- package/dist/node_modules/@ark-ui/react/dist/components/toast/toaster.js +28 -15
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow-tip.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-arrow.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-root.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/tooltip-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/tooltip/use-tooltip.js +17 -0
- package/dist/node_modules/@ark-ui/react/dist/utils/compose-refs.js +13 -7
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +92 -90
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +230 -216
- package/dist/node_modules/@zag-js/accordion/dist/index.js +210 -227
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +49 -12
- package/dist/node_modules/@zag-js/avatar/dist/index.js +119 -134
- package/dist/node_modules/@zag-js/checkbox/dist/index.js +196 -197
- package/dist/node_modules/@zag-js/collapsible/dist/index.js +250 -198
- package/dist/node_modules/@zag-js/collection/dist/index.js +172 -179
- package/dist/node_modules/@zag-js/combobox/dist/index.js +1176 -1082
- package/dist/node_modules/@zag-js/core/dist/index.js +77 -496
- package/dist/node_modules/@zag-js/dialog/dist/index.js +243 -270
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +62 -60
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +465 -253
- package/dist/node_modules/@zag-js/focus-trap/dist/index.js +307 -0
- package/dist/node_modules/@zag-js/focus-visible/dist/index.js +48 -47
- package/dist/node_modules/@zag-js/interact-outside/dist/index.js +112 -80
- package/dist/node_modules/@zag-js/menu/dist/index.js +998 -884
- package/dist/node_modules/@zag-js/pagination/dist/index.js +207 -213
- package/dist/node_modules/@zag-js/popper/dist/index.js +130 -129
- package/dist/node_modules/@zag-js/presence/dist/index.js +139 -122
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +297 -302
- package/dist/node_modules/@zag-js/react/dist/index.js +255 -103
- package/dist/node_modules/@zag-js/remove-scroll/dist/index.js +18 -31
- package/dist/node_modules/@zag-js/select/dist/index.js +889 -885
- package/dist/node_modules/@zag-js/store/dist/index.js +98 -137
- package/dist/node_modules/@zag-js/switch/dist/index.js +199 -191
- package/dist/node_modules/@zag-js/tabs/dist/index.js +383 -386
- package/dist/node_modules/@zag-js/toast/dist/index.js +646 -633
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +459 -0
- package/dist/node_modules/@zag-js/types/dist/index.js +6 -6
- package/dist/node_modules/@zag-js/utils/dist/index.js +112 -99
- package/dist/node_modules/proxy-compare/dist/index.js +4 -106
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/dist/node_modules/@ark-ui/react/dist/utils/use-is-server.js +0 -10
- package/dist/node_modules/@zag-js/dom-event/dist/index.js +0 -130
- package/dist/node_modules/@zag-js/element-rect/dist/index.js +0 -32
- package/dist/node_modules/@zag-js/form-utils/dist/index.js +0 -51
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +0 -52
- package/dist/node_modules/focus-trap/dist/focus-trap.esm.js +0 -431
- package/dist/node_modules/klona/full/index.js +0 -21
- package/dist/node_modules/tabbable/dist/index.esm.js +0 -202
|
@@ -1,92 +1,92 @@
|
|
|
1
|
-
import { autoUpdate as S, offset as A, flip as D, shift as
|
|
2
|
-
import { raf as V, isHTMLElement as k, getWindow as C } from "../../dom-query/dist/index.js";
|
|
3
|
-
import { noop as
|
|
4
|
-
function
|
|
1
|
+
import { autoUpdate as S, offset as A, flip as D, shift as H, arrow as R, size as W, hide as B, computePosition as I, limitShift as T } from "../../../@floating-ui/dom/dist/floating-ui.dom.js";
|
|
2
|
+
import { raf as V, isHTMLElement as k, getWindow as C, getComputedStyle as L } from "../../dom-query/dist/index.js";
|
|
3
|
+
import { noop as N, isNull as j, runIfFn as U, compact as _ } from "../../utils/dist/index.js";
|
|
4
|
+
function b(e = 0, t = 0, r = 0, i = 0) {
|
|
5
5
|
if (typeof DOMRect == "function")
|
|
6
|
-
return new DOMRect(
|
|
6
|
+
return new DOMRect(e, t, r, i);
|
|
7
7
|
const n = {
|
|
8
|
-
x:
|
|
9
|
-
y:
|
|
8
|
+
x: e,
|
|
9
|
+
y: t,
|
|
10
10
|
width: r,
|
|
11
11
|
height: i,
|
|
12
|
-
top:
|
|
13
|
-
right:
|
|
14
|
-
bottom:
|
|
15
|
-
left:
|
|
12
|
+
top: t,
|
|
13
|
+
right: e + r,
|
|
14
|
+
bottom: t + i,
|
|
15
|
+
left: e
|
|
16
16
|
};
|
|
17
17
|
return { ...n, toJSON: () => n };
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
if (!
|
|
21
|
-
const { x:
|
|
22
|
-
return
|
|
19
|
+
function q(e) {
|
|
20
|
+
if (!e) return b();
|
|
21
|
+
const { x: t, y: r, width: i, height: n } = e;
|
|
22
|
+
return b(t, r, i, n);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function E(e, t) {
|
|
25
25
|
return {
|
|
26
|
-
contextElement: k(
|
|
26
|
+
contextElement: k(e) ? e : void 0,
|
|
27
27
|
getBoundingClientRect: () => {
|
|
28
|
-
const r =
|
|
29
|
-
return i || !r ?
|
|
28
|
+
const r = e, i = t == null ? void 0 : t(r);
|
|
29
|
+
return i || !r ? q(i) : r.getBoundingClientRect();
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
var u = (
|
|
33
|
+
var u = (e) => ({ variable: e, reference: `var(${e})` }), f = {
|
|
34
34
|
arrowSize: u("--arrow-size"),
|
|
35
35
|
arrowSizeHalf: u("--arrow-size-half"),
|
|
36
36
|
arrowBg: u("--arrow-background"),
|
|
37
37
|
transformOrigin: u("--transform-origin"),
|
|
38
38
|
arrowOffset: u("--arrow-offset")
|
|
39
|
-
}, G = (
|
|
39
|
+
}, G = (e) => ({
|
|
40
40
|
top: "bottom center",
|
|
41
|
-
"top-start":
|
|
42
|
-
"top-end":
|
|
41
|
+
"top-start": e ? `${e.x}px bottom` : "left bottom",
|
|
42
|
+
"top-end": e ? `${e.x}px bottom` : "right bottom",
|
|
43
43
|
bottom: "top center",
|
|
44
|
-
"bottom-start":
|
|
45
|
-
"bottom-end":
|
|
44
|
+
"bottom-start": e ? `${e.x}px top` : "top left",
|
|
45
|
+
"bottom-end": e ? `${e.x}px top` : "top right",
|
|
46
46
|
left: "right center",
|
|
47
|
-
"left-start":
|
|
48
|
-
"left-end":
|
|
47
|
+
"left-start": e ? `right ${e.y}px` : "right top",
|
|
48
|
+
"left-end": e ? `right ${e.y}px` : "right bottom",
|
|
49
49
|
right: "left center",
|
|
50
|
-
"right-start":
|
|
51
|
-
"right-end":
|
|
50
|
+
"right-start": e ? `left ${e.y}px` : "left top",
|
|
51
|
+
"right-end": e ? `left ${e.y}px` : "left bottom"
|
|
52
52
|
}), J = {
|
|
53
53
|
name: "transformOrigin",
|
|
54
|
-
fn({ placement:
|
|
55
|
-
const { arrow: i } = r, n = G(i)[
|
|
56
|
-
return o.style.setProperty(
|
|
54
|
+
fn({ placement: e, elements: t, middlewareData: r }) {
|
|
55
|
+
const { arrow: i } = r, n = G(i)[e], { floating: o } = t;
|
|
56
|
+
return o.style.setProperty(f.transformOrigin.variable, n), {
|
|
57
57
|
data: { transformOrigin: n }
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
60
|
}, Y = {
|
|
61
61
|
name: "rects",
|
|
62
|
-
fn({ rects:
|
|
62
|
+
fn({ rects: e }) {
|
|
63
63
|
return {
|
|
64
|
-
data:
|
|
64
|
+
data: e
|
|
65
65
|
};
|
|
66
66
|
}
|
|
67
|
-
},
|
|
68
|
-
if (
|
|
67
|
+
}, K = (e) => {
|
|
68
|
+
if (e)
|
|
69
69
|
return {
|
|
70
70
|
name: "shiftArrow",
|
|
71
|
-
fn({ placement:
|
|
71
|
+
fn({ placement: t, middlewareData: r }) {
|
|
72
72
|
if (!r.arrow) return {};
|
|
73
|
-
const { x: i, y: n } = r.arrow, o =
|
|
74
|
-
return Object.assign(
|
|
73
|
+
const { x: i, y: n } = r.arrow, o = t.split("-")[0];
|
|
74
|
+
return Object.assign(e.style, {
|
|
75
75
|
left: i != null ? `${i}px` : "",
|
|
76
76
|
top: n != null ? `${n}px` : "",
|
|
77
|
-
[o]: `calc(100% + ${
|
|
77
|
+
[o]: `calc(100% + ${f.arrowOffset.reference})`
|
|
78
78
|
}), {};
|
|
79
79
|
}
|
|
80
80
|
};
|
|
81
81
|
};
|
|
82
|
-
function
|
|
83
|
-
const [
|
|
84
|
-
return { side:
|
|
82
|
+
function Q(e) {
|
|
83
|
+
const [t, r] = e.split("-");
|
|
84
|
+
return { side: t, align: r, hasAlign: r != null };
|
|
85
85
|
}
|
|
86
|
-
function
|
|
87
|
-
return
|
|
86
|
+
function de(e) {
|
|
87
|
+
return e.split("-")[0];
|
|
88
88
|
}
|
|
89
|
-
var
|
|
89
|
+
var X = {
|
|
90
90
|
strategy: "absolute",
|
|
91
91
|
placement: "bottom",
|
|
92
92
|
listeners: !0,
|
|
@@ -99,134 +99,134 @@ var Q = {
|
|
|
99
99
|
overflowPadding: 8,
|
|
100
100
|
arrowPadding: 4
|
|
101
101
|
};
|
|
102
|
-
function
|
|
103
|
-
const r =
|
|
104
|
-
return Math.round(
|
|
102
|
+
function P(e, t) {
|
|
103
|
+
const r = e.devicePixelRatio || 1;
|
|
104
|
+
return Math.round(t * r) / r;
|
|
105
105
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
106
|
+
function M(e) {
|
|
107
|
+
return U(e.boundary);
|
|
108
108
|
}
|
|
109
|
-
function
|
|
110
|
-
if (
|
|
111
|
-
return
|
|
112
|
-
element:
|
|
113
|
-
padding:
|
|
109
|
+
function Z(e, t) {
|
|
110
|
+
if (e)
|
|
111
|
+
return R({
|
|
112
|
+
element: e,
|
|
113
|
+
padding: t.arrowPadding
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
function
|
|
117
|
-
if (!
|
|
116
|
+
function F(e, t) {
|
|
117
|
+
if (!j(t.offset ?? t.gutter))
|
|
118
118
|
return A(({ placement: r }) => {
|
|
119
119
|
var d, a;
|
|
120
|
-
const i = ((
|
|
121
|
-
return
|
|
120
|
+
const i = ((e == null ? void 0 : e.clientHeight) || 0) / 2, n = ((d = t.offset) == null ? void 0 : d.mainAxis) ?? t.gutter, o = typeof n == "number" ? n + i : n ?? i, { hasAlign: c } = Q(r), s = c ? void 0 : t.shift, l = ((a = t.offset) == null ? void 0 : a.crossAxis) ?? s;
|
|
121
|
+
return _({
|
|
122
122
|
crossAxis: l,
|
|
123
123
|
mainAxis: o,
|
|
124
|
-
alignmentAxis:
|
|
124
|
+
alignmentAxis: t.shift
|
|
125
125
|
});
|
|
126
126
|
});
|
|
127
127
|
}
|
|
128
|
-
function
|
|
129
|
-
if (
|
|
128
|
+
function ee(e) {
|
|
129
|
+
if (e.flip)
|
|
130
130
|
return D({
|
|
131
|
-
boundary:
|
|
132
|
-
padding:
|
|
133
|
-
fallbackPlacements:
|
|
131
|
+
boundary: M(e),
|
|
132
|
+
padding: e.overflowPadding,
|
|
133
|
+
fallbackPlacements: e.flip === !0 ? void 0 : e.flip
|
|
134
134
|
});
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
if (!(!
|
|
138
|
-
return
|
|
139
|
-
boundary:
|
|
140
|
-
mainAxis:
|
|
141
|
-
crossAxis:
|
|
142
|
-
padding:
|
|
136
|
+
function te(e) {
|
|
137
|
+
if (!(!e.slide && !e.overlap))
|
|
138
|
+
return H({
|
|
139
|
+
boundary: M(e),
|
|
140
|
+
mainAxis: e.slide,
|
|
141
|
+
crossAxis: e.overlap,
|
|
142
|
+
padding: e.overflowPadding,
|
|
143
143
|
limiter: T()
|
|
144
144
|
});
|
|
145
145
|
}
|
|
146
|
-
function
|
|
147
|
-
return
|
|
148
|
-
padding:
|
|
149
|
-
apply({ elements:
|
|
150
|
-
const o =
|
|
151
|
-
n = Math.floor(n), i = Math.floor(i), o.style.setProperty("--reference-width", `${
|
|
146
|
+
function re(e) {
|
|
147
|
+
return W({
|
|
148
|
+
padding: e.overflowPadding,
|
|
149
|
+
apply({ elements: t, rects: r, availableHeight: i, availableWidth: n }) {
|
|
150
|
+
const o = t.floating, c = Math.round(r.reference.width);
|
|
151
|
+
n = Math.floor(n), i = Math.floor(i), o.style.setProperty("--reference-width", `${c}px`), o.style.setProperty("--available-width", `${n}px`), o.style.setProperty("--available-height", `${i}px`);
|
|
152
152
|
}
|
|
153
153
|
});
|
|
154
154
|
}
|
|
155
|
-
function
|
|
156
|
-
var
|
|
157
|
-
if (
|
|
158
|
-
return B({ strategy: "referenceHidden", boundary: ((
|
|
155
|
+
function ne(e) {
|
|
156
|
+
var t;
|
|
157
|
+
if (e.hideWhenDetached)
|
|
158
|
+
return B({ strategy: "referenceHidden", boundary: ((t = e.boundary) == null ? void 0 : t.call(e)) ?? "clippingAncestors" });
|
|
159
159
|
}
|
|
160
|
-
function
|
|
161
|
-
return
|
|
160
|
+
function ie(e) {
|
|
161
|
+
return e ? e === !0 ? { ancestorResize: !0, ancestorScroll: !0, elementResize: !0, layoutShift: !0 } : e : {};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
const i =
|
|
165
|
-
if (!
|
|
166
|
-
const n = Object.assign({},
|
|
163
|
+
function oe(e, t, r = {}) {
|
|
164
|
+
const i = E(e, r.getAnchorRect);
|
|
165
|
+
if (!t || !i) return;
|
|
166
|
+
const n = Object.assign({}, X, r), o = t.querySelector("[data-part=arrow]"), c = [
|
|
167
|
+
F(o, n),
|
|
168
|
+
ee(n),
|
|
169
|
+
te(n),
|
|
167
170
|
Z(o, n),
|
|
168
|
-
|
|
169
|
-
tt(n),
|
|
170
|
-
X(o, n),
|
|
171
|
-
E(o),
|
|
171
|
+
K(o),
|
|
172
172
|
J,
|
|
173
|
-
|
|
174
|
-
|
|
173
|
+
re(n),
|
|
174
|
+
ne(n),
|
|
175
175
|
Y
|
|
176
|
-
], { placement: s, strategy: l, onComplete: d, onPositioned: a } = n,
|
|
177
|
-
var
|
|
178
|
-
if (!i || !
|
|
179
|
-
const p = await
|
|
176
|
+
], { placement: s, strategy: l, onComplete: d, onPositioned: a } = n, h = async () => {
|
|
177
|
+
var x;
|
|
178
|
+
if (!i || !t) return;
|
|
179
|
+
const p = await I(i, t, {
|
|
180
180
|
placement: s,
|
|
181
|
-
middleware:
|
|
181
|
+
middleware: c,
|
|
182
182
|
strategy: l
|
|
183
183
|
});
|
|
184
184
|
d == null || d(p), a == null || a({ placed: !0 });
|
|
185
|
-
const
|
|
186
|
-
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
const
|
|
190
|
-
|
|
185
|
+
const y = C(t), $ = P(y, p.x), z = P(y, p.y);
|
|
186
|
+
t.style.setProperty("--x", `${$}px`), t.style.setProperty("--y", `${z}px`), n.hideWhenDetached && (((x = p.middlewareData.hide) == null ? void 0 : x.referenceHidden) ? (t.style.setProperty("visibility", "hidden"), t.style.setProperty("pointer-events", "none")) : (t.style.removeProperty("visibility"), t.style.removeProperty("pointer-events")));
|
|
187
|
+
const v = t.firstElementChild;
|
|
188
|
+
if (v) {
|
|
189
|
+
const w = L(v);
|
|
190
|
+
t.style.setProperty("--z-index", w.zIndex);
|
|
191
191
|
}
|
|
192
|
-
},
|
|
193
|
-
r.updatePosition ? (await r.updatePosition({ updatePosition:
|
|
194
|
-
},
|
|
195
|
-
return
|
|
192
|
+
}, m = async () => {
|
|
193
|
+
r.updatePosition ? (await r.updatePosition({ updatePosition: h }), a == null || a({ placed: !0 })) : await h();
|
|
194
|
+
}, O = ie(n.listeners), g = n.listeners ? S(i, t, m, O) : N;
|
|
195
|
+
return m(), () => {
|
|
196
196
|
g == null || g(), a == null || a({ placed: !1 });
|
|
197
197
|
};
|
|
198
198
|
}
|
|
199
|
-
function
|
|
200
|
-
const { defer: i, ...n } = r, o = i ? V : (s) => s(),
|
|
201
|
-
return
|
|
199
|
+
function le(e, t, r = {}) {
|
|
200
|
+
const { defer: i, ...n } = r, o = i ? V : (s) => s(), c = [];
|
|
201
|
+
return c.push(
|
|
202
202
|
o(() => {
|
|
203
|
-
const s = typeof
|
|
204
|
-
|
|
203
|
+
const s = typeof e == "function" ? e() : e, l = typeof t == "function" ? t() : t;
|
|
204
|
+
c.push(oe(s, l, n));
|
|
205
205
|
})
|
|
206
206
|
), () => {
|
|
207
|
-
|
|
207
|
+
c.forEach((s) => s == null ? void 0 : s());
|
|
208
208
|
};
|
|
209
209
|
}
|
|
210
|
-
var
|
|
210
|
+
var ae = {
|
|
211
211
|
bottom: "rotate(45deg)",
|
|
212
212
|
left: "rotate(135deg)",
|
|
213
213
|
top: "rotate(225deg)",
|
|
214
214
|
right: "rotate(315deg)"
|
|
215
215
|
};
|
|
216
|
-
function
|
|
217
|
-
const { placement:
|
|
216
|
+
function ue(e = {}) {
|
|
217
|
+
const { placement: t, sameWidth: r, fitViewport: i, strategy: n = "absolute" } = e;
|
|
218
218
|
return {
|
|
219
219
|
arrow: {
|
|
220
220
|
position: "absolute",
|
|
221
|
-
width:
|
|
222
|
-
height:
|
|
223
|
-
[
|
|
224
|
-
[
|
|
221
|
+
width: f.arrowSize.reference,
|
|
222
|
+
height: f.arrowSize.reference,
|
|
223
|
+
[f.arrowSizeHalf.variable]: `calc(${f.arrowSize.reference} / 2)`,
|
|
224
|
+
[f.arrowOffset.variable]: `calc(${f.arrowSizeHalf.reference} * -1)`
|
|
225
225
|
},
|
|
226
226
|
arrowTip: {
|
|
227
227
|
// @ts-expect-error - Fix this
|
|
228
|
-
transform:
|
|
229
|
-
background:
|
|
228
|
+
transform: t ? ae[t.split("-")[0]] : void 0,
|
|
229
|
+
background: f.arrowBg.reference,
|
|
230
230
|
top: "0",
|
|
231
231
|
left: "0",
|
|
232
232
|
width: "100%",
|
|
@@ -241,16 +241,17 @@ function lt(t = {}) {
|
|
|
241
241
|
width: r ? "var(--reference-width)" : void 0,
|
|
242
242
|
maxWidth: i ? "var(--available-width)" : void 0,
|
|
243
243
|
maxHeight: i ? "var(--available-height)" : void 0,
|
|
244
|
+
pointerEvents: t ? void 0 : "none",
|
|
244
245
|
top: "0px",
|
|
245
246
|
left: "0px",
|
|
246
247
|
// move off-screen if placement is not defined
|
|
247
|
-
transform:
|
|
248
|
+
transform: t ? "translate3d(var(--x), var(--y), 0)" : "translate3d(0, -100vh, 0)",
|
|
248
249
|
zIndex: "var(--z-index)"
|
|
249
250
|
}
|
|
250
251
|
};
|
|
251
252
|
}
|
|
252
253
|
export {
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
254
|
+
le as getPlacement,
|
|
255
|
+
de as getPlacementSide,
|
|
256
|
+
ue as getPlacementStyles
|
|
256
257
|
};
|
|
@@ -1,141 +1,158 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
function
|
|
5
|
-
const i = a.matches("mounted", "unmountSuspended");
|
|
1
|
+
import { setStyle as N, nextTick as d, raf as p, getComputedStyle as g, getEventTarget as v } from "../../dom-query/dist/index.js";
|
|
2
|
+
import { createMachine as y } from "../../core/dist/index.js";
|
|
3
|
+
import { createProps as f } from "../../types/dist/index.js";
|
|
4
|
+
function S(e, t) {
|
|
5
|
+
const { state: i, send: n, context: s } = e, a = i.matches("mounted", "unmountSuspended");
|
|
6
6
|
return {
|
|
7
|
-
skip: !
|
|
8
|
-
present:
|
|
9
|
-
setNode(
|
|
10
|
-
|
|
7
|
+
skip: !s.get("initial"),
|
|
8
|
+
present: a,
|
|
9
|
+
setNode(r) {
|
|
10
|
+
r && n({ type: "NODE.SET", node: r });
|
|
11
11
|
},
|
|
12
12
|
unmount() {
|
|
13
|
-
|
|
13
|
+
n({ type: "UNMOUNT" });
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
17
|
+
var O = y({
|
|
18
|
+
props({ props: e }) {
|
|
19
|
+
return { ...e, present: !!e.present };
|
|
20
|
+
},
|
|
21
|
+
initialState({ prop: e }) {
|
|
22
|
+
return e("present") ? "mounted" : "unmounted";
|
|
23
|
+
},
|
|
24
|
+
refs() {
|
|
25
|
+
return {
|
|
26
|
+
node: null,
|
|
27
|
+
styles: null
|
|
28
|
+
};
|
|
29
|
+
},
|
|
30
|
+
context({ bindable: e }) {
|
|
31
|
+
return {
|
|
32
|
+
unmountAnimationName: e(() => ({ defaultValue: null })),
|
|
33
|
+
prevAnimationName: e(() => ({ defaultValue: null })),
|
|
34
|
+
present: e(() => ({ defaultValue: !1 })),
|
|
35
|
+
initial: e(() => ({
|
|
36
|
+
sync: !0,
|
|
37
|
+
defaultValue: !1
|
|
38
|
+
}))
|
|
39
|
+
};
|
|
40
|
+
},
|
|
41
|
+
exit: ["clearInitial", "cleanupNode"],
|
|
42
|
+
watch({ track: e, action: t, prop: i }) {
|
|
43
|
+
e([() => i("present")], () => {
|
|
44
|
+
t(["setInitial", "syncPresence"]);
|
|
45
|
+
});
|
|
46
|
+
},
|
|
47
|
+
on: {
|
|
48
|
+
"NODE.SET": {
|
|
49
|
+
actions: ["setNode", "setStyles"]
|
|
50
|
+
}
|
|
51
|
+
},
|
|
52
|
+
states: {
|
|
53
|
+
mounted: {
|
|
37
54
|
on: {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
},
|
|
42
|
-
states: {
|
|
43
|
-
mounted: {
|
|
44
|
-
on: {
|
|
45
|
-
UNMOUNT: {
|
|
46
|
-
target: "unmounted",
|
|
47
|
-
actions: ["invokeOnExitComplete"]
|
|
48
|
-
},
|
|
49
|
-
"UNMOUNT.SUSPEND": "unmountSuspended"
|
|
50
|
-
}
|
|
55
|
+
UNMOUNT: {
|
|
56
|
+
target: "unmounted",
|
|
57
|
+
actions: ["clearPrevAnimationName", "invokeOnExitComplete"]
|
|
51
58
|
},
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
on: {
|
|
55
|
-
MOUNT: {
|
|
56
|
-
target: "mounted",
|
|
57
|
-
actions: ["setPrevAnimationName"]
|
|
58
|
-
},
|
|
59
|
-
"ANIMATION.END": {
|
|
60
|
-
target: "unmounted",
|
|
61
|
-
actions: ["invokeOnExitComplete"]
|
|
62
|
-
},
|
|
63
|
-
UNMOUNT: {
|
|
64
|
-
target: "unmounted",
|
|
65
|
-
actions: ["invokeOnExitComplete"]
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
unmounted: {
|
|
70
|
-
entry: ["clearPrevAnimationName"],
|
|
71
|
-
on: {
|
|
72
|
-
MOUNT: {
|
|
73
|
-
target: "mounted",
|
|
74
|
-
actions: ["setPrevAnimationName"]
|
|
75
|
-
}
|
|
76
|
-
}
|
|
59
|
+
"UNMOUNT.SUSPEND": {
|
|
60
|
+
target: "unmountSuspended"
|
|
77
61
|
}
|
|
78
62
|
}
|
|
79
63
|
},
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
e.initial = !1;
|
|
87
|
-
},
|
|
88
|
-
invokeOnExitComplete(e) {
|
|
89
|
-
var t;
|
|
90
|
-
(t = e.onExitComplete) == null || t.call(e);
|
|
91
|
-
},
|
|
92
|
-
setNode(e, t) {
|
|
93
|
-
e.node = u(t.node);
|
|
94
|
-
},
|
|
95
|
-
setStyles(e, t) {
|
|
96
|
-
const i = t.node.ownerDocument.defaultView || window;
|
|
97
|
-
e.styles = u(i.getComputedStyle(t.node));
|
|
98
|
-
},
|
|
99
|
-
syncPresence(e, t, { send: i }) {
|
|
100
|
-
if (e.present) {
|
|
101
|
-
i({ type: "MOUNT", src: "presence.changed" });
|
|
102
|
-
return;
|
|
103
|
-
}
|
|
104
|
-
const n = r(e.styles);
|
|
105
|
-
(e.immediate ? queueMicrotask : requestAnimationFrame)(() => {
|
|
106
|
-
var o, m;
|
|
107
|
-
e.unmountAnimationName = n, n === "none" || n === e.prevAnimationName || ((o = e.styles) == null ? void 0 : o.display) === "none" || ((m = e.styles) == null ? void 0 : m.animationDuration) === "0s" ? i({ type: "UNMOUNT", src: "presence.changed" }) : i({ type: "UNMOUNT.SUSPEND" });
|
|
108
|
-
});
|
|
109
|
-
},
|
|
110
|
-
setPrevAnimationName(e) {
|
|
111
|
-
(e.immediate ? queueMicrotask : requestAnimationFrame)(() => {
|
|
112
|
-
e.prevAnimationName = r(e.styles);
|
|
113
|
-
});
|
|
64
|
+
unmountSuspended: {
|
|
65
|
+
effects: ["trackAnimationEvents"],
|
|
66
|
+
on: {
|
|
67
|
+
MOUNT: {
|
|
68
|
+
target: "mounted",
|
|
69
|
+
actions: ["setPrevAnimationName"]
|
|
114
70
|
},
|
|
115
|
-
|
|
116
|
-
|
|
71
|
+
UNMOUNT: {
|
|
72
|
+
target: "unmounted",
|
|
73
|
+
actions: ["clearPrevAnimationName", "invokeOnExitComplete"]
|
|
117
74
|
}
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}, o = (m) => {
|
|
126
|
-
const l = r(e.styles);
|
|
127
|
-
m.target === n && l === e.unmountAnimationName && i({ type: "UNMOUNT", src: "animationend" });
|
|
128
|
-
};
|
|
129
|
-
return n.addEventListener("animationstart", s), n.addEventListener("animationcancel", o), n.addEventListener("animationend", o), () => {
|
|
130
|
-
n.removeEventListener("animationstart", s), n.removeEventListener("animationcancel", o), n.removeEventListener("animationend", o);
|
|
131
|
-
};
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
unmounted: {
|
|
78
|
+
on: {
|
|
79
|
+
MOUNT: {
|
|
80
|
+
target: "mounted",
|
|
81
|
+
actions: ["setPrevAnimationName"]
|
|
132
82
|
}
|
|
133
83
|
}
|
|
134
84
|
}
|
|
135
|
-
|
|
85
|
+
},
|
|
86
|
+
implementations: {
|
|
87
|
+
actions: {
|
|
88
|
+
setInitial: ({ context: e }) => {
|
|
89
|
+
e.get("initial") || queueMicrotask(() => {
|
|
90
|
+
e.set("initial", !0);
|
|
91
|
+
});
|
|
92
|
+
},
|
|
93
|
+
clearInitial: ({ context: e }) => {
|
|
94
|
+
e.set("initial", !1);
|
|
95
|
+
},
|
|
96
|
+
cleanupNode: ({ refs: e }) => {
|
|
97
|
+
e.set("node", null), e.set("styles", null);
|
|
98
|
+
},
|
|
99
|
+
invokeOnExitComplete: ({ prop: e }) => {
|
|
100
|
+
var t;
|
|
101
|
+
(t = e("onExitComplete")) == null || t();
|
|
102
|
+
},
|
|
103
|
+
setNode: ({ refs: e, event: t }) => {
|
|
104
|
+
e.set("node", t.node);
|
|
105
|
+
},
|
|
106
|
+
setStyles: ({ refs: e, event: t }) => {
|
|
107
|
+
e.set("styles", g(t.node));
|
|
108
|
+
},
|
|
109
|
+
syncPresence: ({ context: e, refs: t, send: i, prop: n }) => {
|
|
110
|
+
const s = n("present");
|
|
111
|
+
if (s)
|
|
112
|
+
return i({ type: "MOUNT", src: "presence.changed" });
|
|
113
|
+
const a = t.get("node");
|
|
114
|
+
if (!s && (a == null ? void 0 : a.ownerDocument.visibilityState) === "hidden")
|
|
115
|
+
return i({ type: "UNMOUNT", src: "visibilitychange" });
|
|
116
|
+
p(() => {
|
|
117
|
+
var o, m;
|
|
118
|
+
const r = u(t.get("styles"));
|
|
119
|
+
e.set("unmountAnimationName", r), r === "none" || r === e.get("prevAnimationName") || ((o = t.get("styles")) == null ? void 0 : o.display) === "none" || ((m = t.get("styles")) == null ? void 0 : m.animationDuration) === "0s" ? i({ type: "UNMOUNT", src: "presence.changed" }) : i({ type: "UNMOUNT.SUSPEND" });
|
|
120
|
+
});
|
|
121
|
+
},
|
|
122
|
+
setPrevAnimationName: ({ context: e, refs: t }) => {
|
|
123
|
+
p(() => {
|
|
124
|
+
e.set("prevAnimationName", u(t.get("styles")));
|
|
125
|
+
});
|
|
126
|
+
},
|
|
127
|
+
clearPrevAnimationName: ({ context: e }) => {
|
|
128
|
+
e.set("prevAnimationName", null);
|
|
129
|
+
}
|
|
130
|
+
},
|
|
131
|
+
effects: {
|
|
132
|
+
trackAnimationEvents: ({ context: e, refs: t, send: i }) => {
|
|
133
|
+
const n = t.get("node");
|
|
134
|
+
if (!n) return;
|
|
135
|
+
const s = (o) => {
|
|
136
|
+
var l, c;
|
|
137
|
+
(((c = (l = o.composedPath) == null ? void 0 : l.call(o)) == null ? void 0 : c[0]) ?? o.target) === n && e.set("prevAnimationName", u(t.get("styles")));
|
|
138
|
+
}, a = (o) => {
|
|
139
|
+
const m = u(t.get("styles"));
|
|
140
|
+
v(o) === n && m === e.get("unmountAnimationName") && i({ type: "UNMOUNT", src: "animationend" });
|
|
141
|
+
};
|
|
142
|
+
n.addEventListener("animationstart", s), n.addEventListener("animationcancel", a), n.addEventListener("animationend", a);
|
|
143
|
+
const r = N(n, { animationFillMode: "forwards" });
|
|
144
|
+
return () => {
|
|
145
|
+
n.removeEventListener("animationstart", s), n.removeEventListener("animationcancel", a), n.removeEventListener("animationend", a), d(() => r());
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
});
|
|
151
|
+
function u(e) {
|
|
152
|
+
return (e == null ? void 0 : e.animationName) || "none";
|
|
136
153
|
}
|
|
137
|
-
|
|
154
|
+
f()(["onExitComplete", "present", "immediate"]);
|
|
138
155
|
export {
|
|
139
|
-
|
|
140
|
-
|
|
156
|
+
S as connect,
|
|
157
|
+
O as machine
|
|
141
158
|
};
|