asterui 0.12.44 → 0.12.47
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/Button.d.ts +0 -1
- package/dist/components/Button.js +8 -9
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Checkbox.d.ts +4 -1
- package/dist/components/Checkbox.js +106 -77
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/ConfigProvider.d.ts +59 -0
- package/dist/components/ConfigProvider.js +46 -0
- package/dist/components/ConfigProvider.js.map +1 -0
- package/dist/components/CopyButton.d.ts +3 -0
- package/dist/components/CopyButton.js +90 -64
- package/dist/components/CopyButton.js.map +1 -1
- package/dist/components/Message.d.ts +20 -0
- package/dist/components/Message.js +56 -0
- package/dist/components/Message.js.map +1 -0
- package/dist/components/Notification.d.ts +8 -1
- package/dist/components/Notification.js +84 -60
- package/dist/components/Notification.js.map +1 -1
- package/dist/components/Tour.d.ts +71 -9
- package/dist/components/Tour.js +361 -198
- package/dist/components/Tour.js.map +1 -1
- package/dist/contexts/IconSizeContext.d.ts +2 -0
- package/dist/contexts/IconSizeContext.js +6 -0
- package/dist/contexts/IconSizeContext.js.map +1 -0
- package/dist/index.d.ts +14 -6
- package/dist/index.js +237 -207
- package/dist/index.js.map +1 -1
- package/dist/locale/de-DE.d.ts +3 -0
- package/dist/locale/de-DE.js +100 -0
- package/dist/locale/de-DE.js.map +1 -0
- package/dist/locale/en-CA.d.ts +3 -0
- package/dist/locale/en-CA.js +11 -0
- package/dist/locale/en-CA.js.map +1 -0
- package/dist/locale/en-GB.d.ts +3 -0
- package/dist/locale/en-GB.js +11 -0
- package/dist/locale/en-GB.js.map +1 -0
- package/dist/locale/en-US.d.ts +3 -0
- package/dist/locale/en-US.js +100 -0
- package/dist/locale/en-US.js.map +1 -0
- package/dist/locale/es-ES.d.ts +3 -0
- package/dist/locale/es-ES.js +100 -0
- package/dist/locale/es-ES.js.map +1 -0
- package/dist/locale/fr-FR.d.ts +3 -0
- package/dist/locale/fr-FR.js +100 -0
- package/dist/locale/fr-FR.js.map +1 -0
- package/dist/locale/index.d.ts +107 -0
- package/dist/locale/ja-JP.d.ts +3 -0
- package/dist/locale/ja-JP.js +100 -0
- package/dist/locale/ja-JP.js.map +1 -0
- package/dist/locale/ko-KR.d.ts +3 -0
- package/dist/locale/ko-KR.js +100 -0
- package/dist/locale/ko-KR.js.map +1 -0
- package/dist/locale/pt-BR.d.ts +3 -0
- package/dist/locale/pt-BR.js +100 -0
- package/dist/locale/pt-BR.js.map +1 -0
- package/dist/locale/zh-CN.d.ts +3 -0
- package/dist/locale/zh-CN.js +100 -0
- package/dist/locale/zh-CN.js.map +1 -0
- package/package.json +1 -1
package/dist/components/Tour.js
CHANGED
|
@@ -1,237 +1,400 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useState as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
const
|
|
5
|
-
if (!t ||
|
|
1
|
+
import { jsx as l, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as St, useState as H, useRef as K, useCallback as y, useImperativeHandle as jt, useEffect as L } from "react";
|
|
3
|
+
import { createPortal as Dt } from "react-dom";
|
|
4
|
+
const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t, c, i, o, k) => {
|
|
5
|
+
if (!t || c === "center")
|
|
6
6
|
return {
|
|
7
|
-
top: window.innerHeight / 2 -
|
|
8
|
-
left: window.innerWidth / 2 -
|
|
7
|
+
top: window.innerHeight / 2 - i.height / 2,
|
|
8
|
+
left: window.innerWidth / 2 - i.width / 2
|
|
9
9
|
};
|
|
10
|
-
const
|
|
10
|
+
const a = window.scrollY, d = window.scrollX, D = typeof k == "object" && k.pointAtCenter;
|
|
11
11
|
return {
|
|
12
12
|
top: {
|
|
13
|
-
top: t.top +
|
|
14
|
-
left: t.left +
|
|
13
|
+
top: t.top + a - i.height - o,
|
|
14
|
+
left: t.left + d + t.width / 2 - i.width / 2
|
|
15
15
|
},
|
|
16
16
|
topLeft: {
|
|
17
|
-
top: t.top +
|
|
18
|
-
left: t.left +
|
|
17
|
+
top: t.top + a - i.height - o,
|
|
18
|
+
left: t.left + d
|
|
19
19
|
},
|
|
20
20
|
topRight: {
|
|
21
|
-
top: t.top +
|
|
22
|
-
left: t.right +
|
|
21
|
+
top: t.top + a - i.height - o,
|
|
22
|
+
left: t.right + d - i.width
|
|
23
23
|
},
|
|
24
24
|
bottom: {
|
|
25
|
-
top: t.bottom +
|
|
26
|
-
left: t.left +
|
|
25
|
+
top: t.bottom + a + o,
|
|
26
|
+
left: t.left + d + t.width / 2 - i.width / 2
|
|
27
27
|
},
|
|
28
28
|
bottomLeft: {
|
|
29
|
-
top: t.bottom +
|
|
30
|
-
left: t.left +
|
|
29
|
+
top: t.bottom + a + o,
|
|
30
|
+
left: t.left + d
|
|
31
31
|
},
|
|
32
32
|
bottomRight: {
|
|
33
|
-
top: t.bottom +
|
|
34
|
-
left: t.right +
|
|
33
|
+
top: t.bottom + a + o,
|
|
34
|
+
left: t.right + d - i.width
|
|
35
35
|
},
|
|
36
36
|
left: {
|
|
37
|
-
top: t.top +
|
|
38
|
-
left: t.left +
|
|
37
|
+
top: t.top + a + t.height / 2 - i.height / 2,
|
|
38
|
+
left: t.left + d - i.width - o
|
|
39
39
|
},
|
|
40
40
|
leftTop: {
|
|
41
|
-
top: t.top +
|
|
42
|
-
left: t.left +
|
|
41
|
+
top: t.top + a,
|
|
42
|
+
left: t.left + d - i.width - o
|
|
43
43
|
},
|
|
44
44
|
leftBottom: {
|
|
45
|
-
top: t.bottom +
|
|
46
|
-
left: t.left +
|
|
45
|
+
top: t.bottom + a - i.height,
|
|
46
|
+
left: t.left + d - i.width - o
|
|
47
47
|
},
|
|
48
48
|
right: {
|
|
49
|
-
top: t.top +
|
|
50
|
-
left: t.right +
|
|
49
|
+
top: t.top + a + t.height / 2 - i.height / 2,
|
|
50
|
+
left: t.right + d + o
|
|
51
51
|
},
|
|
52
52
|
rightTop: {
|
|
53
|
-
top: t.top +
|
|
54
|
-
left: t.right +
|
|
53
|
+
top: t.top + a,
|
|
54
|
+
left: t.right + d + o
|
|
55
55
|
},
|
|
56
56
|
rightBottom: {
|
|
57
|
-
top: t.bottom +
|
|
58
|
-
left: t.right +
|
|
57
|
+
top: t.bottom + a - i.height,
|
|
58
|
+
left: t.right + d + o
|
|
59
59
|
},
|
|
60
60
|
center: {
|
|
61
|
-
top: window.innerHeight / 2 -
|
|
62
|
-
left: window.innerWidth / 2 -
|
|
61
|
+
top: window.innerHeight / 2 - i.height / 2,
|
|
62
|
+
left: window.innerWidth / 2 - i.width / 2
|
|
63
63
|
}
|
|
64
|
-
}[
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
const
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
64
|
+
}[c];
|
|
65
|
+
}, Wt = (t) => ({
|
|
66
|
+
top: { position: "bottom-0 left-1/2", transform: "translate(-50%, 50%) rotate(45deg)" },
|
|
67
|
+
topLeft: { position: "bottom-0 left-4", transform: "translate(0, 50%) rotate(45deg)" },
|
|
68
|
+
topRight: { position: "bottom-0 right-4", transform: "translate(0, 50%) rotate(45deg)" },
|
|
69
|
+
bottom: { position: "top-0 left-1/2", transform: "translate(-50%, -50%) rotate(45deg)" },
|
|
70
|
+
bottomLeft: { position: "top-0 left-4", transform: "translate(0, -50%) rotate(45deg)" },
|
|
71
|
+
bottomRight: { position: "top-0 right-4", transform: "translate(0, -50%) rotate(45deg)" },
|
|
72
|
+
left: { position: "right-0 top-1/2", transform: "translate(50%, -50%) rotate(45deg)" },
|
|
73
|
+
leftTop: { position: "right-0 top-4", transform: "translate(50%, 0) rotate(45deg)" },
|
|
74
|
+
leftBottom: { position: "right-0 bottom-4", transform: "translate(50%, 0) rotate(45deg)" },
|
|
75
|
+
right: { position: "left-0 top-1/2", transform: "translate(-50%, -50%) rotate(45deg)" },
|
|
76
|
+
rightTop: { position: "left-0 top-4", transform: "translate(-50%, 0) rotate(45deg)" },
|
|
77
|
+
rightBottom: { position: "left-0 bottom-4", transform: "translate(-50%, 0) rotate(45deg)" },
|
|
78
|
+
center: { position: "hidden", transform: "" }
|
|
79
|
+
})[t], Ft = /* @__PURE__ */ l("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ l("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }), Ht = St(
|
|
80
|
+
({
|
|
81
|
+
open: t = !1,
|
|
82
|
+
onClose: c,
|
|
83
|
+
onFinish: i,
|
|
84
|
+
steps: o,
|
|
85
|
+
current: k,
|
|
86
|
+
onChange: a,
|
|
87
|
+
arrow: d = !0,
|
|
88
|
+
closeIcon: D,
|
|
89
|
+
mask: M = !0,
|
|
90
|
+
disabledInteraction: O = !1,
|
|
91
|
+
type: nt = "default",
|
|
92
|
+
gap: V = { offset: 6, radius: 2 },
|
|
93
|
+
prevButtonText: rt = "Previous",
|
|
94
|
+
nextButtonText: it = "Next",
|
|
95
|
+
finishButtonText: lt = "Finish",
|
|
96
|
+
skipButtonText: st = "Skip",
|
|
97
|
+
showSkip: at = !0,
|
|
98
|
+
showIndicators: dt = !0,
|
|
99
|
+
closeOnMaskClick: I = !0,
|
|
100
|
+
closeOnEscape: U = !0,
|
|
101
|
+
scrollIntoViewOptions: ct = !0,
|
|
102
|
+
zIndex: A = 1001,
|
|
103
|
+
indicatorsRender: X,
|
|
104
|
+
actionsRender: Y,
|
|
105
|
+
getPopupContainer: z,
|
|
106
|
+
classNames: m = {},
|
|
107
|
+
styles: b = {},
|
|
108
|
+
className: ft,
|
|
109
|
+
style: ht,
|
|
110
|
+
"data-testid": ut,
|
|
111
|
+
...mt
|
|
112
|
+
}, bt) => {
|
|
113
|
+
const [pt, G] = H(0), [u, wt] = H(null), [_, gt] = H({ top: 0, left: 0 }), w = K(null), vt = K(null), $ = K(null), B = ut ?? "tour", f = (n) => `${B}-${n}`, x = k !== void 0, s = x ? k : pt, e = o[s], q = V.offset ?? 6, h = V.radius ?? 2, J = Array.isArray(q) ? q[0] : q, W = e?.arrow ?? d, g = e?.mask ?? M, yt = e?.type ?? nt, E = e?.scrollIntoViewOptions ?? ct, Q = e?.closeIcon ?? D, kt = W !== !1 && e?.placement !== "center", $t = typeof g == "object" && g.color ? g.color : "rgba(0, 0, 0, 0.5)", xt = typeof g == "object" && g.style ? g.style : {}, N = y(() => {
|
|
114
|
+
if (!e) return;
|
|
115
|
+
const r = et(e.target)?.getBoundingClientRect() ?? null;
|
|
116
|
+
if (wt(r), w.current) {
|
|
117
|
+
const C = w.current.getBoundingClientRect(), S = e.placement ?? "bottom", j = qt(
|
|
118
|
+
r,
|
|
119
|
+
S,
|
|
120
|
+
C,
|
|
121
|
+
J + h,
|
|
122
|
+
W
|
|
123
|
+
);
|
|
124
|
+
gt(j);
|
|
125
|
+
}
|
|
126
|
+
}, [e, J, h, W]), v = y(
|
|
127
|
+
(n) => {
|
|
128
|
+
n < 0 || n >= o.length || (o[s]?.onClose?.(), x || G(n), a?.(n), $.current && ($.current.textContent = `Step ${n + 1} of ${o.length}: ${typeof o[n]?.title == "string" ? o[n]?.title : ""}`));
|
|
129
|
+
},
|
|
130
|
+
[o, s, x, a]
|
|
131
|
+
), F = y(() => {
|
|
132
|
+
c?.();
|
|
133
|
+
}, [c]), P = y(() => {
|
|
134
|
+
e?.prevButtonProps?.onClick?.(), v(s - 1);
|
|
135
|
+
}, [s, v, e]), T = y(() => {
|
|
136
|
+
e?.nextButtonProps?.onClick?.(), s === o.length - 1 ? (i?.(), c?.()) : v(s + 1);
|
|
137
|
+
}, [s, o.length, v, i, c, e]), Nt = y(() => {
|
|
138
|
+
c?.();
|
|
139
|
+
}, [c]), Pt = y(() => {
|
|
140
|
+
I && c?.();
|
|
141
|
+
}, [I, c]);
|
|
142
|
+
if (jt(
|
|
143
|
+
bt,
|
|
144
|
+
() => ({
|
|
145
|
+
goTo: v,
|
|
146
|
+
next: T,
|
|
147
|
+
prev: P,
|
|
148
|
+
close: F
|
|
149
|
+
}),
|
|
150
|
+
[v, T, P, F]
|
|
151
|
+
), L(() => {
|
|
152
|
+
t && !x && G(0);
|
|
153
|
+
}, [t, x]), L(() => {
|
|
154
|
+
if (t) {
|
|
155
|
+
if (N(), E && e?.target) {
|
|
156
|
+
const n = et(e.target);
|
|
157
|
+
if (n) {
|
|
158
|
+
const r = typeof E == "object" ? E : { behavior: "smooth", block: "center" };
|
|
159
|
+
n.scrollIntoView(r);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
s === 0 && $.current && ($.current.textContent = `Tour started. Step 1 of ${o.length}: ${typeof e?.title == "string" ? e?.title : ""}`);
|
|
163
|
+
}
|
|
164
|
+
}, [t, s, e, E, N, o.length]), L(() => {
|
|
165
|
+
if (!t) return;
|
|
166
|
+
const n = () => N();
|
|
167
|
+
return window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), requestAnimationFrame(N), () => {
|
|
168
|
+
window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
|
|
169
|
+
};
|
|
170
|
+
}, [t, N]), L(() => {
|
|
171
|
+
if (!t) return;
|
|
172
|
+
const n = (r) => {
|
|
173
|
+
if (r.key === "Escape" && U)
|
|
174
|
+
c?.();
|
|
175
|
+
else if (r.key === "ArrowRight" || r.key === "ArrowDown")
|
|
176
|
+
r.preventDefault(), T();
|
|
177
|
+
else if (r.key === "ArrowLeft" || r.key === "ArrowUp")
|
|
178
|
+
r.preventDefault(), P();
|
|
179
|
+
else if (r.key === "Tab" && w.current) {
|
|
180
|
+
const C = w.current.querySelectorAll(
|
|
181
|
+
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
182
|
+
), S = C[0], j = C[C.length - 1];
|
|
183
|
+
r.shiftKey && document.activeElement === S ? (r.preventDefault(), j?.focus()) : !r.shiftKey && document.activeElement === j && (r.preventDefault(), S?.focus());
|
|
184
|
+
}
|
|
185
|
+
};
|
|
186
|
+
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
187
|
+
}, [t, U, c, T, P]), L(() => {
|
|
188
|
+
t && w.current && requestAnimationFrame(() => {
|
|
189
|
+
w.current?.querySelector("button")?.focus();
|
|
190
|
+
});
|
|
191
|
+
}, [t, s]), !t || !e) return null;
|
|
192
|
+
const Tt = s === 0, Z = s === o.length - 1, R = e.placement ?? "bottom", tt = Wt(R), Ct = dt && o.length > 1 ? /* @__PURE__ */ l(
|
|
193
|
+
"div",
|
|
194
|
+
{
|
|
195
|
+
className: `flex gap-1 mb-4 ${m.indicator ?? ""}`,
|
|
196
|
+
style: b.indicator,
|
|
197
|
+
"data-testid": f("indicators"),
|
|
198
|
+
children: o.map((n, r) => /* @__PURE__ */ l(
|
|
199
|
+
"button",
|
|
135
200
|
{
|
|
136
|
-
className:
|
|
137
|
-
onClick:
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
201
|
+
className: `w-2 h-2 rounded-full transition-colors ${r === s ? "bg-primary" : "bg-base-300 hover:bg-base-content/30"}`,
|
|
202
|
+
onClick: () => v(r),
|
|
203
|
+
"aria-label": `Go to step ${r + 1}`,
|
|
204
|
+
"aria-current": r === s ? "step" : void 0,
|
|
205
|
+
"data-testid": f(`indicator-${r}`)
|
|
206
|
+
},
|
|
207
|
+
r
|
|
208
|
+
))
|
|
209
|
+
}
|
|
210
|
+
) : null, Lt = X ? X(s, o.length) : Ct, ot = /* @__PURE__ */ p(
|
|
211
|
+
"div",
|
|
212
|
+
{
|
|
213
|
+
className: `flex items-center justify-between gap-2 ${m.footer ?? ""}`,
|
|
214
|
+
style: b.footer,
|
|
215
|
+
"data-testid": f("footer"),
|
|
216
|
+
children: [
|
|
217
|
+
/* @__PURE__ */ l("div", { children: at && !Z && /* @__PURE__ */ l(
|
|
218
|
+
"button",
|
|
219
|
+
{
|
|
220
|
+
className: "btn btn-ghost btn-sm",
|
|
221
|
+
onClick: Nt,
|
|
222
|
+
"data-testid": f("skip"),
|
|
223
|
+
children: st
|
|
224
|
+
}
|
|
225
|
+
) }),
|
|
226
|
+
/* @__PURE__ */ p("div", { className: "flex gap-2", children: [
|
|
227
|
+
!Tt && /* @__PURE__ */ l(
|
|
228
|
+
"button",
|
|
229
|
+
{
|
|
230
|
+
className: "btn btn-ghost btn-sm",
|
|
231
|
+
onClick: P,
|
|
232
|
+
"data-testid": f("prev"),
|
|
233
|
+
children: e.prevButtonProps?.children ?? rt
|
|
234
|
+
}
|
|
235
|
+
),
|
|
236
|
+
/* @__PURE__ */ l(
|
|
237
|
+
"button",
|
|
238
|
+
{
|
|
239
|
+
className: `btn btn-sm ${yt === "primary" ? "btn-primary" : ""}`,
|
|
240
|
+
onClick: T,
|
|
241
|
+
"data-testid": f("next"),
|
|
242
|
+
children: e.nextButtonProps?.children ?? (Z ? lt : it)
|
|
243
|
+
}
|
|
244
|
+
)
|
|
245
|
+
] })
|
|
246
|
+
]
|
|
247
|
+
}
|
|
248
|
+
), At = Y ? Y(ot, { current: s, total: o.length }) : ot, Bt = /* @__PURE__ */ p(
|
|
249
|
+
"div",
|
|
250
|
+
{
|
|
251
|
+
ref: vt,
|
|
252
|
+
className: `fixed inset-0 ${m.root ?? ""} ${ft ?? ""}`,
|
|
253
|
+
style: { zIndex: A, ...b.root, ...ht },
|
|
254
|
+
"data-testid": B,
|
|
255
|
+
"data-state": t ? "open" : "closed",
|
|
256
|
+
role: "dialog",
|
|
257
|
+
"aria-modal": "true",
|
|
258
|
+
"aria-label": `Tour step ${s + 1} of ${o.length}`,
|
|
259
|
+
...mt,
|
|
260
|
+
children: [
|
|
261
|
+
/* @__PURE__ */ l(
|
|
262
|
+
"div",
|
|
263
|
+
{
|
|
264
|
+
ref: $,
|
|
265
|
+
className: "sr-only",
|
|
266
|
+
role: "status",
|
|
267
|
+
"aria-live": "polite",
|
|
268
|
+
"aria-atomic": "true"
|
|
269
|
+
}
|
|
270
|
+
),
|
|
271
|
+
g && /* @__PURE__ */ p(
|
|
272
|
+
"svg",
|
|
273
|
+
{
|
|
274
|
+
className: `absolute inset-0 w-full h-full pointer-events-auto ${m.mask ?? ""}`,
|
|
275
|
+
style: { zIndex: A, ...xt, ...b.mask },
|
|
276
|
+
onClick: Pt,
|
|
277
|
+
"data-testid": f("mask"),
|
|
278
|
+
"aria-hidden": "true",
|
|
279
|
+
children: [
|
|
280
|
+
/* @__PURE__ */ l("defs", { children: /* @__PURE__ */ p("mask", { id: `tour-mask-${B}`, children: [
|
|
281
|
+
/* @__PURE__ */ l("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "white" }),
|
|
282
|
+
u && /* @__PURE__ */ l(
|
|
283
|
+
"rect",
|
|
284
|
+
{
|
|
285
|
+
x: u.left - h,
|
|
286
|
+
y: u.top - h,
|
|
287
|
+
width: u.width + h * 2,
|
|
288
|
+
height: u.height + h * 2,
|
|
289
|
+
rx: h,
|
|
290
|
+
fill: "black"
|
|
291
|
+
}
|
|
292
|
+
)
|
|
293
|
+
] }) }),
|
|
294
|
+
/* @__PURE__ */ l(
|
|
143
295
|
"rect",
|
|
144
296
|
{
|
|
145
|
-
x:
|
|
146
|
-
y:
|
|
147
|
-
width:
|
|
148
|
-
height:
|
|
149
|
-
|
|
150
|
-
|
|
297
|
+
x: "0",
|
|
298
|
+
y: "0",
|
|
299
|
+
width: "100%",
|
|
300
|
+
height: "100%",
|
|
301
|
+
fill: $t,
|
|
302
|
+
mask: `url(#tour-mask-${B})`
|
|
151
303
|
}
|
|
152
304
|
)
|
|
153
|
-
]
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
305
|
+
]
|
|
306
|
+
}
|
|
307
|
+
),
|
|
308
|
+
O && u && /* @__PURE__ */ l(
|
|
309
|
+
"div",
|
|
310
|
+
{
|
|
311
|
+
className: "absolute pointer-events-auto",
|
|
312
|
+
style: {
|
|
313
|
+
left: u.left - h,
|
|
314
|
+
top: u.top - h,
|
|
315
|
+
width: u.width + h * 2,
|
|
316
|
+
height: u.height + h * 2,
|
|
317
|
+
zIndex: A + 1
|
|
318
|
+
},
|
|
319
|
+
"data-testid": f("blocker")
|
|
320
|
+
}
|
|
321
|
+
),
|
|
322
|
+
/* @__PURE__ */ p(
|
|
323
|
+
"div",
|
|
324
|
+
{
|
|
325
|
+
ref: w,
|
|
326
|
+
className: `absolute bg-base-100 rounded-lg shadow-xl border border-base-300 max-w-sm ${m.popover ?? ""} ${e.className ?? ""}`,
|
|
327
|
+
style: {
|
|
328
|
+
top: _.top,
|
|
329
|
+
left: _.left,
|
|
330
|
+
zIndex: A + 2,
|
|
331
|
+
...b.popover,
|
|
332
|
+
...e.style
|
|
333
|
+
},
|
|
334
|
+
onClick: (n) => n.stopPropagation(),
|
|
335
|
+
"data-testid": f("popover"),
|
|
336
|
+
"data-placement": R,
|
|
337
|
+
children: [
|
|
338
|
+
kt && /* @__PURE__ */ l(
|
|
339
|
+
"div",
|
|
340
|
+
{
|
|
341
|
+
className: `absolute w-3 h-3 bg-base-100 border-base-300 ${tt.position}`,
|
|
342
|
+
style: {
|
|
343
|
+
transform: tt.transform,
|
|
344
|
+
borderWidth: "1px",
|
|
345
|
+
borderTopColor: "transparent",
|
|
346
|
+
borderLeftColor: "transparent"
|
|
347
|
+
},
|
|
348
|
+
"data-testid": f("arrow")
|
|
349
|
+
}
|
|
350
|
+
),
|
|
351
|
+
Q !== !1 && /* @__PURE__ */ l(
|
|
186
352
|
"button",
|
|
187
353
|
{
|
|
188
|
-
className: `
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
);
|
|
232
|
-
return I(J, document.body);
|
|
233
|
-
};
|
|
354
|
+
className: `absolute top-2 right-2 btn btn-ghost btn-xs btn-circle ${m.close ?? ""}`,
|
|
355
|
+
style: b.close,
|
|
356
|
+
onClick: F,
|
|
357
|
+
"aria-label": "Close tour",
|
|
358
|
+
"data-testid": f("close"),
|
|
359
|
+
children: Q ?? Ft
|
|
360
|
+
}
|
|
361
|
+
),
|
|
362
|
+
e.cover && /* @__PURE__ */ l("div", { className: "rounded-t-lg overflow-hidden", "data-testid": f("cover"), children: e.cover }),
|
|
363
|
+
/* @__PURE__ */ p(
|
|
364
|
+
"div",
|
|
365
|
+
{
|
|
366
|
+
className: `p-4 ${m.content ?? ""}`,
|
|
367
|
+
style: b.content,
|
|
368
|
+
"data-testid": f("content"),
|
|
369
|
+
children: [
|
|
370
|
+
/* @__PURE__ */ p(
|
|
371
|
+
"div",
|
|
372
|
+
{
|
|
373
|
+
className: `${m.header ?? ""}`,
|
|
374
|
+
style: b.header,
|
|
375
|
+
"data-testid": f("header"),
|
|
376
|
+
children: [
|
|
377
|
+
/* @__PURE__ */ l("h3", { className: "font-semibold text-lg mb-1 pr-6", children: e.title }),
|
|
378
|
+
e.description && /* @__PURE__ */ l("p", { className: "text-base-content/70 text-sm mb-4", children: e.description })
|
|
379
|
+
]
|
|
380
|
+
}
|
|
381
|
+
),
|
|
382
|
+
Lt,
|
|
383
|
+
At
|
|
384
|
+
]
|
|
385
|
+
}
|
|
386
|
+
)
|
|
387
|
+
]
|
|
388
|
+
}
|
|
389
|
+
)
|
|
390
|
+
]
|
|
391
|
+
}
|
|
392
|
+
), Et = z ? z(document.body) : document.body;
|
|
393
|
+
return Dt(Bt, Et);
|
|
394
|
+
}
|
|
395
|
+
);
|
|
396
|
+
Ht.displayName = "Tour";
|
|
234
397
|
export {
|
|
235
|
-
|
|
398
|
+
Ht as Tour
|
|
236
399
|
};
|
|
237
400
|
//# sourceMappingURL=Tour.js.map
|