@serendie/ui 2.1.3 → 2.2.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/client.js +79 -74
- package/dist/components/Accordion/Accordion.d.ts +1 -1
- package/dist/components/Avatar/Avatar.d.ts +1 -1
- package/dist/components/Banner/Banner.d.ts +1 -1
- package/dist/components/BottomNavigation/BottomNavigationItem.d.ts +1 -1
- package/dist/components/Button/Button.d.ts +2 -2
- package/dist/components/Button/Button.js +22 -21
- package/dist/components/DatePicker/DatePicker.d.ts +13 -0
- package/dist/components/DatePicker/DatePicker.js +203 -0
- package/dist/components/DatePicker/index.d.ts +2 -0
- package/dist/components/DatePicker/index.js +6 -0
- package/dist/components/DatePicker/parseDate.d.ts +1 -0
- package/dist/components/DatePicker/styles.d.ts +1 -0
- package/dist/components/DatePicker/styles.js +224 -0
- package/dist/components/IconButton/IconButton.d.ts +3 -3
- package/dist/components/List/ListItem.d.ts +1 -1
- package/dist/components/ModalDialog/ModalDialog.d.ts +1 -1
- package/dist/components/NotificationBadge/NotificationBadge.d.ts +1 -1
- package/dist/components/Pagination/Pagination.d.ts +1 -1
- package/dist/components/ProgressIndicator/AnimatedArc.d.ts +6 -0
- package/dist/components/ProgressIndicator/AnimatedArc.js +46 -0
- package/dist/components/ProgressIndicator/ProgressIndicator.d.ts +11 -29
- package/dist/components/ProgressIndicator/ProgressIndicator.js +201 -43
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.d.ts +10 -0
- package/dist/components/ProgressIndicator/ProgressIndicatorIndeterminate.js +215 -0
- package/dist/components/ProgressIndicator/index.d.ts +4 -1
- package/dist/components/ProgressIndicator/index.js +3 -2
- package/dist/components/ProgressIndicator/util.d.ts +1 -0
- package/dist/components/ProgressIndicator/util.js +13 -0
- package/dist/components/Search/Search.d.ts +1 -1
- package/dist/components/Select/Select.d.ts +1 -1
- package/dist/components/Switch/Switch.d.ts +1 -1
- package/dist/components/Tabs/Tabs.d.ts +1 -1
- package/dist/components/TextField/TextField.js +59 -156
- package/dist/components/Toast/Toast.d.ts +1 -1
- package/dist/components/TopAppBar/TopAppBar.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +80 -75
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-content.js +15 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-context.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-control.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-input.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-label.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-month-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-next-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-positioner.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-prev-trigger.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-root.js +55 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-body.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell-trigger.js +19 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-cell.js +26 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-head.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-header.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table-row.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-table.js +16 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-trigger.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view-control.js +14 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-view.js +23 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker-year-select.js +13 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/date-picker.anatomy.js +5 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-cell-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-table-props-context.js +10 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker-view-props-context.js +12 -0
- package/dist/node_modules/@ark-ui/react/dist/components/date-picker/use-date-picker.js +18 -0
- package/dist/node_modules/@ark-ui/react/dist/components/factory.js +11 -12
- package/dist/node_modules/@ark-ui/react/dist/components/menu/menu-root.js +5 -4
- package/dist/node_modules/@ark-ui/react/dist/utils/use-event.js +0 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +36 -36
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +238 -235
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +88 -83
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.js +68 -67
- package/dist/node_modules/@internationalized/date/dist/CalendarDate.js +178 -0
- package/dist/node_modules/@internationalized/date/dist/DateFormatter.js +99 -0
- package/dist/node_modules/@internationalized/date/dist/GregorianCalendar.js +98 -0
- package/dist/node_modules/@internationalized/date/dist/conversion.js +135 -0
- package/dist/node_modules/@internationalized/date/dist/manipulation.js +205 -0
- package/dist/node_modules/@internationalized/date/dist/queries.js +202 -0
- package/dist/node_modules/@internationalized/date/dist/string.js +41 -0
- package/dist/node_modules/@internationalized/date/dist/utils.js +6 -0
- package/dist/node_modules/@internationalized/date/dist/weekStartData.js +100 -0
- package/dist/node_modules/@swc/helpers/esm/_check_private_redeclaration.js +7 -0
- package/dist/node_modules/@swc/helpers/esm/_class_private_field_init.js +7 -0
- package/dist/node_modules/@zag-js/anatomy/dist/index.js +15 -14
- package/dist/node_modules/@zag-js/aria-hidden/dist/index.js +23 -23
- package/dist/node_modules/@zag-js/collection/dist/index.js +102 -71
- package/dist/node_modules/@zag-js/combobox/dist/index.js +482 -426
- package/dist/node_modules/@zag-js/date-picker/dist/index.js +1826 -0
- package/dist/node_modules/@zag-js/date-utils/dist/index.js +366 -0
- package/dist/node_modules/@zag-js/dialog/dist/index.js +66 -64
- package/dist/node_modules/@zag-js/dismissable/dist/index.js +94 -69
- package/dist/node_modules/@zag-js/dom-query/dist/index.js +359 -300
- package/dist/node_modules/@zag-js/live-region/dist/index.js +39 -0
- package/dist/node_modules/@zag-js/menu/dist/index.js +357 -340
- package/dist/node_modules/@zag-js/popper/dist/index.js +123 -120
- package/dist/node_modules/@zag-js/presence/dist/index.js +17 -17
- package/dist/node_modules/@zag-js/radio-group/dist/index.js +118 -117
- package/dist/node_modules/@zag-js/react/dist/index.js +124 -121
- package/dist/node_modules/@zag-js/select/dist/index.js +211 -197
- package/dist/node_modules/@zag-js/toast/dist/index.js +73 -71
- package/dist/node_modules/@zag-js/tooltip/dist/index.js +31 -30
- package/dist/node_modules/@zag-js/utils/dist/index.js +150 -104
- package/dist/preset.d.ts +11 -1
- package/dist/recipes/index.d.ts +3 -2
- package/dist/recipes/index.js +5 -2
- package/dist/recipes/textFieldRecipe.d.ts +6 -0
- package/dist/recipes/textFieldRecipe.js +107 -0
- package/dist/styled-system/css/cva.js +43 -38
- package/dist/styled-system/recipes/create-recipe.js +37 -0
- package/dist/styled-system/recipes/text-field-recipe.js +61 -0
- package/dist/styles.css +1 -1
- package/dist/tokens/keyframes/index.d.ts +8 -0
- package/dist/tokens/keyframes/index.js +6 -2
- package/package.json +3 -3
- package/styled-system/recipes/create-recipe.js +82 -0
- package/styled-system/recipes/index.d.ts +2 -0
- package/styled-system/recipes/index.js +1 -0
- package/styled-system/recipes/text-field-recipe.d.ts +28 -0
- package/styled-system/recipes/text-field-recipe.js +72 -0
- package/styled-system/types/prop-type.d.ts +1 -1
- package/dist/node_modules/@zag-js/store/dist/index.js +0 -131
- package/dist/node_modules/proxy-compare/dist/index.js +0 -7
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { autoUpdate as
|
|
2
|
-
import { raf as
|
|
3
|
-
import { noop as
|
|
4
|
-
function
|
|
1
|
+
import { autoUpdate as T, offset as I, flip as V, shift as Y, arrow as j, size as k, hide as C, computePosition as L, limitShift as N } from "../../../@floating-ui/dom/dist/floating-ui.dom.js";
|
|
2
|
+
import { raf as U, isHTMLElement as X, getWindow as _, getComputedStyle as q } from "../../dom-query/dist/index.js";
|
|
3
|
+
import { noop as G, isNull as J, compact as K } from "../../utils/dist/index.js";
|
|
4
|
+
function R(e = 0, t = 0, r = 0, i = 0) {
|
|
5
5
|
if (typeof DOMRect == "function")
|
|
6
6
|
return new DOMRect(e, t, r, i);
|
|
7
7
|
const n = {
|
|
@@ -16,55 +16,57 @@ function b(e = 0, t = 0, r = 0, i = 0) {
|
|
|
16
16
|
};
|
|
17
17
|
return { ...n, toJSON: () => n };
|
|
18
18
|
}
|
|
19
|
-
function
|
|
20
|
-
if (!e) return
|
|
19
|
+
function Q(e) {
|
|
20
|
+
if (!e) return R();
|
|
21
21
|
const { x: t, y: r, width: i, height: n } = e;
|
|
22
|
-
return
|
|
22
|
+
return R(t, r, i, n);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
24
|
+
function Z(e, t) {
|
|
25
25
|
return {
|
|
26
|
-
contextElement:
|
|
26
|
+
contextElement: X(e) ? e : void 0,
|
|
27
27
|
getBoundingClientRect: () => {
|
|
28
28
|
const r = e, i = t == null ? void 0 : t(r);
|
|
29
|
-
return i || !r ?
|
|
29
|
+
return i || !r ? Q(i) : r.getBoundingClientRect();
|
|
30
30
|
}
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
var
|
|
34
|
-
arrowSize:
|
|
35
|
-
arrowSizeHalf:
|
|
36
|
-
arrowBg:
|
|
37
|
-
transformOrigin:
|
|
38
|
-
arrowOffset:
|
|
39
|
-
},
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}
|
|
33
|
+
var m = (e) => ({ variable: e, reference: `var(${e})` }), f = {
|
|
34
|
+
arrowSize: m("--arrow-size"),
|
|
35
|
+
arrowSizeHalf: m("--arrow-size-half"),
|
|
36
|
+
arrowBg: m("--arrow-background"),
|
|
37
|
+
transformOrigin: m("--transform-origin"),
|
|
38
|
+
arrowOffset: m("--arrow-offset")
|
|
39
|
+
}, F = (e) => e === "top" || e === "bottom" ? "y" : "x";
|
|
40
|
+
function E(e, t) {
|
|
41
|
+
return {
|
|
42
|
+
name: "transformOrigin",
|
|
43
|
+
fn(r) {
|
|
44
|
+
var A, H, D, W;
|
|
45
|
+
const { elements: i, middlewareData: n, placement: o, rects: c, y: s } = r, d = o.split("-")[0], l = F(d), a = ((A = n.arrow) == null ? void 0 : A.x) || 0, y = ((H = n.arrow) == null ? void 0 : H.y) || 0, w = (t == null ? void 0 : t.clientWidth) || 0, v = (t == null ? void 0 : t.clientHeight) || 0, p = a + w / 2, h = y + v / 2, x = Math.abs(((D = n.shift) == null ? void 0 : D.y) || 0), P = c.reference.height / 2, b = v / 2, g = ((W = e.offset) == null ? void 0 : W.mainAxis) ?? e.gutter, u = typeof g == "number" ? g + b : g ?? b, O = x > u, M = {
|
|
46
|
+
top: `${p}px calc(100% + ${u}px)`,
|
|
47
|
+
bottom: `${p}px ${-u}px`,
|
|
48
|
+
left: `calc(100% + ${u}px) ${h}px`,
|
|
49
|
+
right: `${-u}px ${h}px`
|
|
50
|
+
}[d], S = `${p}px ${c.reference.y + P - s}px`, z = !!e.overlap && l === "y" && O;
|
|
51
|
+
return i.floating.style.setProperty(
|
|
52
|
+
f.transformOrigin.variable,
|
|
53
|
+
z ? S : M
|
|
54
|
+
), {
|
|
55
|
+
data: {
|
|
56
|
+
transformOrigin: z ? S : M
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
var ee = {
|
|
61
63
|
name: "rects",
|
|
62
64
|
fn({ rects: e }) {
|
|
63
65
|
return {
|
|
64
66
|
data: e
|
|
65
67
|
};
|
|
66
68
|
}
|
|
67
|
-
},
|
|
69
|
+
}, te = (e) => {
|
|
68
70
|
if (e)
|
|
69
71
|
return {
|
|
70
72
|
name: "shiftArrow",
|
|
@@ -79,14 +81,14 @@ var u = (e) => ({ variable: e, reference: `var(${e})` }), f = {
|
|
|
79
81
|
}
|
|
80
82
|
};
|
|
81
83
|
};
|
|
82
|
-
function
|
|
84
|
+
function re(e) {
|
|
83
85
|
const [t, r] = e.split("-");
|
|
84
86
|
return { side: t, align: r, hasAlign: r != null };
|
|
85
87
|
}
|
|
86
|
-
function
|
|
88
|
+
function me(e) {
|
|
87
89
|
return e.split("-")[0];
|
|
88
90
|
}
|
|
89
|
-
var
|
|
91
|
+
var ne = {
|
|
90
92
|
strategy: "absolute",
|
|
91
93
|
placement: "bottom",
|
|
92
94
|
listeners: !0,
|
|
@@ -99,121 +101,122 @@ var X = {
|
|
|
99
101
|
overflowPadding: 8,
|
|
100
102
|
arrowPadding: 4
|
|
101
103
|
};
|
|
102
|
-
function
|
|
104
|
+
function B(e, t) {
|
|
103
105
|
const r = e.devicePixelRatio || 1;
|
|
104
106
|
return Math.round(t * r) / r;
|
|
105
107
|
}
|
|
106
|
-
function
|
|
107
|
-
return
|
|
108
|
+
function $(e) {
|
|
109
|
+
return typeof e == "function" ? e() : e === "clipping-ancestors" ? "clippingAncestors" : e;
|
|
108
110
|
}
|
|
109
|
-
function
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
element: e,
|
|
113
|
-
padding: t.arrowPadding
|
|
114
|
-
});
|
|
111
|
+
function ie(e, t, r) {
|
|
112
|
+
const i = e || t.createElement("div");
|
|
113
|
+
return j({ element: i, padding: r.arrowPadding });
|
|
115
114
|
}
|
|
116
|
-
function
|
|
117
|
-
if (!
|
|
118
|
-
return
|
|
119
|
-
var
|
|
120
|
-
const i = ((e == null ? void 0 : e.clientHeight) || 0) / 2, n = ((
|
|
121
|
-
return
|
|
122
|
-
crossAxis:
|
|
115
|
+
function oe(e, t) {
|
|
116
|
+
if (!J(t.offset ?? t.gutter))
|
|
117
|
+
return I(({ placement: r }) => {
|
|
118
|
+
var l, a;
|
|
119
|
+
const i = ((e == null ? void 0 : e.clientHeight) || 0) / 2, n = ((l = t.offset) == null ? void 0 : l.mainAxis) ?? t.gutter, o = typeof n == "number" ? n + i : n ?? i, { hasAlign: c } = re(r), s = c ? void 0 : t.shift, d = ((a = t.offset) == null ? void 0 : a.crossAxis) ?? s;
|
|
120
|
+
return K({
|
|
121
|
+
crossAxis: d,
|
|
123
122
|
mainAxis: o,
|
|
124
123
|
alignmentAxis: t.shift
|
|
125
124
|
});
|
|
126
125
|
});
|
|
127
126
|
}
|
|
128
|
-
function
|
|
129
|
-
if (e.flip)
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
127
|
+
function se(e) {
|
|
128
|
+
if (!e.flip) return;
|
|
129
|
+
const t = $(e.boundary);
|
|
130
|
+
return V({
|
|
131
|
+
...t ? { boundary: t } : void 0,
|
|
132
|
+
padding: e.overflowPadding,
|
|
133
|
+
fallbackPlacements: e.flip === !0 ? void 0 : e.flip
|
|
134
|
+
});
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
if (!
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
136
|
+
function ae(e) {
|
|
137
|
+
if (!e.slide && !e.overlap) return;
|
|
138
|
+
const t = $(e.boundary);
|
|
139
|
+
return Y({
|
|
140
|
+
...t ? { boundary: t } : void 0,
|
|
141
|
+
mainAxis: e.slide,
|
|
142
|
+
crossAxis: e.overlap,
|
|
143
|
+
padding: e.overflowPadding,
|
|
144
|
+
limiter: N()
|
|
145
|
+
});
|
|
145
146
|
}
|
|
146
|
-
function
|
|
147
|
-
return
|
|
147
|
+
function ce(e) {
|
|
148
|
+
return k({
|
|
148
149
|
padding: e.overflowPadding,
|
|
149
150
|
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`);
|
|
151
|
+
const o = t.floating, c = Math.round(r.reference.width), s = Math.round(r.reference.height);
|
|
152
|
+
n = Math.floor(n), i = Math.floor(i), o.style.setProperty("--reference-width", `${c}px`), o.style.setProperty("--reference-height", `${s}px`), o.style.setProperty("--available-width", `${n}px`), o.style.setProperty("--available-height", `${i}px`);
|
|
152
153
|
}
|
|
153
154
|
});
|
|
154
155
|
}
|
|
155
|
-
function
|
|
156
|
-
var t;
|
|
156
|
+
function fe(e) {
|
|
157
157
|
if (e.hideWhenDetached)
|
|
158
|
-
return
|
|
158
|
+
return C({ strategy: "referenceHidden", boundary: $(e.boundary) ?? "clippingAncestors" });
|
|
159
159
|
}
|
|
160
|
-
function
|
|
160
|
+
function de(e) {
|
|
161
161
|
return e ? e === !0 ? { ancestorResize: !0, ancestorScroll: !0, elementResize: !0, layoutShift: !0 } : e : {};
|
|
162
162
|
}
|
|
163
|
-
function
|
|
164
|
-
const i =
|
|
163
|
+
function le(e, t, r = {}) {
|
|
164
|
+
const i = Z(e, r.getAnchorRect);
|
|
165
165
|
if (!t || !i) return;
|
|
166
|
-
const n = Object.assign({},
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
166
|
+
const n = Object.assign({}, ne, r), o = t.querySelector("[data-part=arrow]"), c = [
|
|
167
|
+
oe(o, n),
|
|
168
|
+
se(n),
|
|
169
|
+
ae(n),
|
|
170
|
+
ie(o, t.ownerDocument, n),
|
|
171
|
+
te(o),
|
|
172
|
+
E(
|
|
173
|
+
{ gutter: n.gutter, offset: n.offset, overlap: n.overlap },
|
|
174
|
+
o
|
|
175
|
+
),
|
|
176
|
+
ce(n),
|
|
177
|
+
fe(n),
|
|
178
|
+
ee
|
|
179
|
+
], { placement: s, strategy: d, onComplete: l, onPositioned: a } = n, y = async () => {
|
|
180
|
+
var u;
|
|
178
181
|
if (!i || !t) return;
|
|
179
|
-
const
|
|
182
|
+
const h = await L(i, t, {
|
|
180
183
|
placement: s,
|
|
181
184
|
middleware: c,
|
|
182
|
-
strategy:
|
|
185
|
+
strategy: d
|
|
183
186
|
});
|
|
184
|
-
|
|
185
|
-
const
|
|
186
|
-
t.style.setProperty("--x", `${
|
|
187
|
-
const
|
|
188
|
-
if (
|
|
189
|
-
const
|
|
190
|
-
t.style.setProperty("--z-index",
|
|
187
|
+
l == null || l(h), a == null || a({ placed: !0 });
|
|
188
|
+
const x = _(t), P = B(x, h.x), b = B(x, h.y);
|
|
189
|
+
t.style.setProperty("--x", `${P}px`), t.style.setProperty("--y", `${b}px`), n.hideWhenDetached && (((u = h.middlewareData.hide) == null ? void 0 : u.referenceHidden) ? (t.style.setProperty("visibility", "hidden"), t.style.setProperty("pointer-events", "none")) : (t.style.removeProperty("visibility"), t.style.removeProperty("pointer-events")));
|
|
190
|
+
const g = t.firstElementChild;
|
|
191
|
+
if (g) {
|
|
192
|
+
const O = q(g);
|
|
193
|
+
t.style.setProperty("--z-index", O.zIndex);
|
|
191
194
|
}
|
|
192
|
-
},
|
|
193
|
-
r.updatePosition ? (await r.updatePosition({ updatePosition:
|
|
194
|
-
},
|
|
195
|
-
return
|
|
196
|
-
|
|
195
|
+
}, w = async () => {
|
|
196
|
+
r.updatePosition ? (await r.updatePosition({ updatePosition: y, floatingElement: t }), a == null || a({ placed: !0 })) : await y();
|
|
197
|
+
}, v = de(n.listeners), p = n.listeners ? T(i, t, w, v) : G;
|
|
198
|
+
return w(), () => {
|
|
199
|
+
p == null || p(), a == null || a({ placed: !1 });
|
|
197
200
|
};
|
|
198
201
|
}
|
|
199
|
-
function
|
|
200
|
-
const { defer: i, ...n } = r, o = i ?
|
|
202
|
+
function ye(e, t, r = {}) {
|
|
203
|
+
const { defer: i, ...n } = r, o = i ? U : (s) => s(), c = [];
|
|
201
204
|
return c.push(
|
|
202
205
|
o(() => {
|
|
203
|
-
const s = typeof e == "function" ? e() : e,
|
|
204
|
-
c.push(
|
|
206
|
+
const s = typeof e == "function" ? e() : e, d = typeof t == "function" ? t() : t;
|
|
207
|
+
c.push(le(s, d, n));
|
|
205
208
|
})
|
|
206
209
|
), () => {
|
|
207
210
|
c.forEach((s) => s == null ? void 0 : s());
|
|
208
211
|
};
|
|
209
212
|
}
|
|
210
|
-
var
|
|
213
|
+
var ue = {
|
|
211
214
|
bottom: "rotate(45deg)",
|
|
212
215
|
left: "rotate(135deg)",
|
|
213
216
|
top: "rotate(225deg)",
|
|
214
217
|
right: "rotate(315deg)"
|
|
215
218
|
};
|
|
216
|
-
function
|
|
219
|
+
function we(e = {}) {
|
|
217
220
|
const { placement: t, sameWidth: r, fitViewport: i, strategy: n = "absolute" } = e;
|
|
218
221
|
return {
|
|
219
222
|
arrow: {
|
|
@@ -225,7 +228,7 @@ function ue(e = {}) {
|
|
|
225
228
|
},
|
|
226
229
|
arrowTip: {
|
|
227
230
|
// @ts-expect-error - Fix this
|
|
228
|
-
transform: t ?
|
|
231
|
+
transform: t ? ue[t.split("-")[0]] : void 0,
|
|
229
232
|
background: f.arrowBg.reference,
|
|
230
233
|
top: "0",
|
|
231
234
|
left: "0",
|
|
@@ -251,7 +254,7 @@ function ue(e = {}) {
|
|
|
251
254
|
};
|
|
252
255
|
}
|
|
253
256
|
export {
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
+
ye as getPlacement,
|
|
258
|
+
me as getPlacementSide,
|
|
259
|
+
we as getPlacementStyles
|
|
257
260
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { setStyle as N, nextTick as d, raf as p, getComputedStyle as g, getEventTarget as
|
|
2
|
-
import { createMachine as
|
|
3
|
-
import { createProps as
|
|
1
|
+
import { setStyle as N, nextTick as d, raf as p, getComputedStyle as g, getEventTarget as E } from "../../dom-query/dist/index.js";
|
|
2
|
+
import { createMachine as v } from "../../core/dist/index.js";
|
|
3
|
+
import { createProps as y } from "../../types/dist/index.js";
|
|
4
4
|
function S(e, t) {
|
|
5
5
|
const { state: i, send: n, context: s } = e, a = i.matches("mounted", "unmountSuspended");
|
|
6
6
|
return {
|
|
@@ -14,7 +14,7 @@ function S(e, t) {
|
|
|
14
14
|
}
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
|
-
var O =
|
|
17
|
+
var O = v({
|
|
18
18
|
props({ props: e }) {
|
|
19
19
|
return { ...e, present: !!e.present };
|
|
20
20
|
},
|
|
@@ -39,14 +39,17 @@ var O = y({
|
|
|
39
39
|
};
|
|
40
40
|
},
|
|
41
41
|
exit: ["clearInitial", "cleanupNode"],
|
|
42
|
-
watch({ track: e,
|
|
43
|
-
e([() =>
|
|
44
|
-
|
|
42
|
+
watch({ track: e, prop: t, send: i }) {
|
|
43
|
+
e([() => t("present")], () => {
|
|
44
|
+
i({ type: "PRESENCE.CHANGED" });
|
|
45
45
|
});
|
|
46
46
|
},
|
|
47
47
|
on: {
|
|
48
48
|
"NODE.SET": {
|
|
49
|
-
actions: ["
|
|
49
|
+
actions: ["setupNode"]
|
|
50
|
+
},
|
|
51
|
+
"PRESENCE.CHANGED": {
|
|
52
|
+
actions: ["setInitial", "syncPresence"]
|
|
50
53
|
}
|
|
51
54
|
},
|
|
52
55
|
states: {
|
|
@@ -93,18 +96,15 @@ var O = y({
|
|
|
93
96
|
clearInitial: ({ context: e }) => {
|
|
94
97
|
e.set("initial", !1);
|
|
95
98
|
},
|
|
96
|
-
cleanupNode: ({ refs: e }) => {
|
|
97
|
-
e.set("node", null), e.set("styles", null);
|
|
98
|
-
},
|
|
99
99
|
invokeOnExitComplete: ({ prop: e }) => {
|
|
100
100
|
var t;
|
|
101
101
|
(t = e("onExitComplete")) == null || t();
|
|
102
102
|
},
|
|
103
|
-
|
|
104
|
-
e.set("node", t.node);
|
|
103
|
+
setupNode: ({ refs: e, event: t }) => {
|
|
104
|
+
e.get("node") !== t.node && (e.set("node", t.node), e.set("styles", g(t.node)));
|
|
105
105
|
},
|
|
106
|
-
|
|
107
|
-
e.set("styles",
|
|
106
|
+
cleanupNode: ({ refs: e }) => {
|
|
107
|
+
e.set("node", null), e.set("styles", null);
|
|
108
108
|
},
|
|
109
109
|
syncPresence: ({ context: e, refs: t, send: i, prop: n }) => {
|
|
110
110
|
const s = n("present");
|
|
@@ -137,7 +137,7 @@ var O = y({
|
|
|
137
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
138
|
}, a = (o) => {
|
|
139
139
|
const m = u(t.get("styles"));
|
|
140
|
-
|
|
140
|
+
E(o) === n && m === e.get("unmountAnimationName") && i({ type: "UNMOUNT", src: "animationend" });
|
|
141
141
|
};
|
|
142
142
|
n.addEventListener("animationstart", s), n.addEventListener("animationcancel", a), n.addEventListener("animationend", a);
|
|
143
143
|
const r = N(n, { animationFillMode: "forwards" });
|
|
@@ -151,7 +151,7 @@ var O = y({
|
|
|
151
151
|
function u(e) {
|
|
152
152
|
return (e == null ? void 0 : e.animationName) || "none";
|
|
153
153
|
}
|
|
154
|
-
|
|
154
|
+
y()(["onExitComplete", "present", "immediate"]);
|
|
155
155
|
export {
|
|
156
156
|
S as connect,
|
|
157
157
|
O as machine
|