asterui 0.12.59 → 0.12.60
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/Cascader.js +147 -146
- package/dist/components/Cascader.js.map +1 -1
- package/dist/components/ContextMenu.js +90 -89
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/Drawer.js +66 -65
- package/dist/components/Drawer.js.map +1 -1
- package/dist/components/Dropdown.js +174 -173
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Mention.js +66 -65
- package/dist/components/Mention.js.map +1 -1
- package/dist/components/Tour.js +83 -82
- package/dist/components/Tour.js.map +1 -1
- package/dist/components/Transfer.js +107 -103
- package/dist/components/Transfer.js.map +1 -1
- package/dist/components/TreeSelect.js +245 -244
- package/dist/components/TreeSelect.js.map +1 -1
- package/dist/providers/ConfigProvider.d.ts +8 -0
- package/dist/providers/ConfigProvider.js +31 -27
- package/dist/providers/ConfigProvider.js.map +1 -1
- package/package.json +1 -1
package/dist/components/Tour.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { jsx as s, jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
|
|
1
|
+
import { jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as Wt, useState as H, useRef as K, useCallback as y, useImperativeHandle as Ft, useEffect as T } from "react";
|
|
3
|
+
import { createPortal as Ht } from "react-dom";
|
|
4
|
+
import { useConfig as Kt } from "../providers/ConfigProvider.js";
|
|
5
|
+
const D = "btn", M = "btn-ghost", O = "btn-sm", Mt = "btn-primary", Ot = "btn-xs", Vt = "btn-circle", it = (t) => t ? typeof t == "function" ? t() : t.current : null, Xt = (t, c, i, o, k) => {
|
|
5
6
|
if (!t || c === "center")
|
|
6
7
|
return {
|
|
7
8
|
top: window.innerHeight / 2 - i.height / 2,
|
|
@@ -62,7 +63,7 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
62
63
|
left: window.innerWidth / 2 - i.width / 2
|
|
63
64
|
}
|
|
64
65
|
}[c];
|
|
65
|
-
},
|
|
66
|
+
}, It = (t) => ({
|
|
66
67
|
top: { position: "bottom-0 left-1/2", transform: "translate(-50%, 50%) rotate(45deg)" },
|
|
67
68
|
topLeft: { position: "bottom-0 left-4", transform: "translate(0, 50%) rotate(45deg)" },
|
|
68
69
|
topRight: { position: "bottom-0 right-4", transform: "translate(0, 50%) rotate(45deg)" },
|
|
@@ -76,7 +77,7 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
76
77
|
rightTop: { position: "left-0 top-4", transform: "translate(-50%, 0) rotate(45deg)" },
|
|
77
78
|
rightBottom: { position: "left-0 bottom-4", transform: "translate(-50%, 0) rotate(45deg)" },
|
|
78
79
|
center: { position: "hidden", transform: "" }
|
|
79
|
-
})[t],
|
|
80
|
+
})[t], Ut = /* @__PURE__ */ s("svg", { className: "w-4 h-4", fill: "none", viewBox: "0 0 24 24", stroke: "currentColor", children: /* @__PURE__ */ s("path", { strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M6 18L18 6M6 6l12 12" }) }), Yt = Wt(
|
|
80
81
|
({
|
|
81
82
|
open: t = !1,
|
|
82
83
|
onClose: c,
|
|
@@ -86,8 +87,8 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
86
87
|
onChange: a,
|
|
87
88
|
arrow: d = !0,
|
|
88
89
|
closeIcon: q,
|
|
89
|
-
mask:
|
|
90
|
-
disabledInteraction:
|
|
90
|
+
mask: V = !0,
|
|
91
|
+
disabledInteraction: X = !1,
|
|
91
92
|
type: st = "default",
|
|
92
93
|
gap: I = { offset: 6, radius: 2 },
|
|
93
94
|
prevButtonText: lt = "Previous",
|
|
@@ -102,57 +103,57 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
102
103
|
zIndex: L = 1001,
|
|
103
104
|
indicatorsRender: z,
|
|
104
105
|
actionsRender: _,
|
|
105
|
-
getPopupContainer:
|
|
106
|
+
getPopupContainer: mt,
|
|
106
107
|
classNames: m = {},
|
|
107
|
-
styles:
|
|
108
|
-
className:
|
|
108
|
+
styles: p = {},
|
|
109
|
+
className: pt,
|
|
109
110
|
style: bt,
|
|
110
|
-
"data-testid":
|
|
111
|
-
...
|
|
112
|
-
},
|
|
113
|
-
const [
|
|
111
|
+
"data-testid": wt,
|
|
112
|
+
...gt
|
|
113
|
+
}, vt) => {
|
|
114
|
+
const { getPopupContainer: yt } = Kt(), J = mt ?? yt, [kt, Q] = H(0), [u, $t] = H(null), [Z, Ct] = H({ top: 0, left: 0 }), w = K(null), Pt = K(null), $ = K(null), A = wt ?? "tour", f = (n) => `${A}-${n}`, C = k !== void 0, l = C ? k : kt, e = o[l], G = I.offset ?? 6, h = I.radius ?? 2, R = Array.isArray(G) ? G[0] : G, W = e?.arrow ?? d, g = e?.mask ?? V, Bt = e?.type ?? st, S = e?.scrollIntoViewOptions ?? ut, tt = e?.closeIcon ?? q, xt = W !== !1 && e?.placement !== "center", Nt = typeof g == "object" && g.color ? g.color : "rgba(0, 0, 0, 0.5)", Tt = typeof g == "object" && g.style ? g.style : {}, P = y(() => {
|
|
114
115
|
if (!e) return;
|
|
115
116
|
const r = it(e.target)?.getBoundingClientRect() ?? null;
|
|
116
|
-
if (
|
|
117
|
-
const N = w.current.getBoundingClientRect(), E = e.placement ?? "bottom", j =
|
|
117
|
+
if ($t(r), w.current) {
|
|
118
|
+
const N = w.current.getBoundingClientRect(), E = e.placement ?? "bottom", j = Xt(
|
|
118
119
|
r,
|
|
119
120
|
E,
|
|
120
121
|
N,
|
|
121
122
|
R + h,
|
|
122
|
-
|
|
123
|
+
W
|
|
123
124
|
);
|
|
124
|
-
|
|
125
|
+
Ct(j);
|
|
125
126
|
}
|
|
126
|
-
}, [e, R, h,
|
|
127
|
+
}, [e, R, h, W]), v = y(
|
|
127
128
|
(n) => {
|
|
128
|
-
n < 0 || n >= o.length || (o[l]?.onClose?.(),
|
|
129
|
+
n < 0 || n >= o.length || (o[l]?.onClose?.(), C || Q(n), a?.(n), $.current && ($.current.textContent = `Step ${n + 1} of ${o.length}: ${typeof o[n]?.title == "string" ? o[n]?.title : ""}`));
|
|
129
130
|
},
|
|
130
|
-
[o, l,
|
|
131
|
-
),
|
|
131
|
+
[o, l, C, a]
|
|
132
|
+
), F = y(() => {
|
|
132
133
|
c?.();
|
|
133
|
-
}, [c]),
|
|
134
|
+
}, [c]), B = y(() => {
|
|
134
135
|
e?.prevButtonProps?.onClick?.(), v(l - 1);
|
|
135
|
-
}, [l, v, e]),
|
|
136
|
+
}, [l, v, e]), x = y(() => {
|
|
136
137
|
e?.nextButtonProps?.onClick?.(), l === o.length - 1 ? (i?.(), c?.()) : v(l + 1);
|
|
137
|
-
}, [l, o.length, v, i, c, e]),
|
|
138
|
+
}, [l, o.length, v, i, c, e]), Lt = y(() => {
|
|
138
139
|
c?.();
|
|
139
|
-
}, [c]),
|
|
140
|
+
}, [c]), At = y(() => {
|
|
140
141
|
U && c?.();
|
|
141
142
|
}, [U, c]);
|
|
142
|
-
if (
|
|
143
|
-
|
|
143
|
+
if (Ft(
|
|
144
|
+
vt,
|
|
144
145
|
() => ({
|
|
145
146
|
goTo: v,
|
|
146
|
-
next:
|
|
147
|
-
prev:
|
|
148
|
-
close:
|
|
147
|
+
next: x,
|
|
148
|
+
prev: B,
|
|
149
|
+
close: F
|
|
149
150
|
}),
|
|
150
|
-
[v,
|
|
151
|
+
[v, x, B, F]
|
|
151
152
|
), T(() => {
|
|
152
|
-
t && !
|
|
153
|
-
}, [t,
|
|
153
|
+
t && !C && Q(0);
|
|
154
|
+
}, [t, C]), T(() => {
|
|
154
155
|
if (t) {
|
|
155
|
-
if (
|
|
156
|
+
if (P(), S && e?.target) {
|
|
156
157
|
const n = it(e.target);
|
|
157
158
|
if (n) {
|
|
158
159
|
const r = typeof S == "object" ? S : { behavior: "smooth", block: "center" };
|
|
@@ -161,21 +162,21 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
161
162
|
}
|
|
162
163
|
l === 0 && $.current && ($.current.textContent = `Tour started. Step 1 of ${o.length}: ${typeof e?.title == "string" ? e?.title : ""}`);
|
|
163
164
|
}
|
|
164
|
-
}, [t, l, e, S,
|
|
165
|
+
}, [t, l, e, S, P, o.length]), T(() => {
|
|
165
166
|
if (!t) return;
|
|
166
|
-
const n = () =>
|
|
167
|
-
return window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), requestAnimationFrame(
|
|
167
|
+
const n = () => P();
|
|
168
|
+
return window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), requestAnimationFrame(P), () => {
|
|
168
169
|
window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
|
|
169
170
|
};
|
|
170
|
-
}, [t,
|
|
171
|
+
}, [t, P]), T(() => {
|
|
171
172
|
if (!t) return;
|
|
172
173
|
const n = (r) => {
|
|
173
174
|
if (r.key === "Escape" && Y)
|
|
174
175
|
c?.();
|
|
175
176
|
else if (r.key === "ArrowRight" || r.key === "ArrowDown")
|
|
176
|
-
r.preventDefault(),
|
|
177
|
+
r.preventDefault(), x();
|
|
177
178
|
else if (r.key === "ArrowLeft" || r.key === "ArrowUp")
|
|
178
|
-
r.preventDefault(),
|
|
179
|
+
r.preventDefault(), B();
|
|
179
180
|
else if (r.key === "Tab" && w.current) {
|
|
180
181
|
const N = w.current.querySelectorAll(
|
|
181
182
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
@@ -184,16 +185,16 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
184
185
|
}
|
|
185
186
|
};
|
|
186
187
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
187
|
-
}, [t, Y, c,
|
|
188
|
+
}, [t, Y, c, x, B]), T(() => {
|
|
188
189
|
t && w.current && requestAnimationFrame(() => {
|
|
189
190
|
w.current?.querySelector("button")?.focus();
|
|
190
191
|
});
|
|
191
192
|
}, [t, l]), !t || !e) return null;
|
|
192
|
-
const
|
|
193
|
+
const St = l === 0, ot = l === o.length - 1, et = e.placement ?? "bottom", nt = It(et), Et = ht && o.length > 1 ? /* @__PURE__ */ s(
|
|
193
194
|
"div",
|
|
194
195
|
{
|
|
195
196
|
className: `flex gap-1 mb-4 ${m.indicator ?? ""}`,
|
|
196
|
-
style:
|
|
197
|
+
style: p.indicator,
|
|
197
198
|
"data-testid": f("indicators"),
|
|
198
199
|
children: o.map((n, r) => /* @__PURE__ */ s(
|
|
199
200
|
"button",
|
|
@@ -207,28 +208,28 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
207
208
|
r
|
|
208
209
|
))
|
|
209
210
|
}
|
|
210
|
-
) : null,
|
|
211
|
+
) : null, jt = z ? z(l, o.length) : Et, rt = /* @__PURE__ */ b(
|
|
211
212
|
"div",
|
|
212
213
|
{
|
|
213
214
|
className: `flex items-center justify-between gap-2 ${m.footer ?? ""}`,
|
|
214
|
-
style:
|
|
215
|
+
style: p.footer,
|
|
215
216
|
"data-testid": f("footer"),
|
|
216
217
|
children: [
|
|
217
218
|
/* @__PURE__ */ s("div", { children: ft && !ot && /* @__PURE__ */ s(
|
|
218
219
|
"button",
|
|
219
220
|
{
|
|
220
|
-
className: `${D} ${
|
|
221
|
-
onClick:
|
|
221
|
+
className: `${D} ${M} ${O}`,
|
|
222
|
+
onClick: Lt,
|
|
222
223
|
"data-testid": f("skip"),
|
|
223
224
|
children: ct
|
|
224
225
|
}
|
|
225
226
|
) }),
|
|
226
|
-
/* @__PURE__ */
|
|
227
|
-
!
|
|
227
|
+
/* @__PURE__ */ b("div", { className: "flex gap-2", children: [
|
|
228
|
+
!St && /* @__PURE__ */ s(
|
|
228
229
|
"button",
|
|
229
230
|
{
|
|
230
|
-
className: `${D} ${
|
|
231
|
-
onClick:
|
|
231
|
+
className: `${D} ${M} ${O}`,
|
|
232
|
+
onClick: B,
|
|
232
233
|
"data-testid": f("prev"),
|
|
233
234
|
children: e.prevButtonProps?.children ?? lt
|
|
234
235
|
}
|
|
@@ -236,8 +237,8 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
236
237
|
/* @__PURE__ */ s(
|
|
237
238
|
"button",
|
|
238
239
|
{
|
|
239
|
-
className: `${D} ${
|
|
240
|
-
onClick:
|
|
240
|
+
className: `${D} ${O} ${Bt === "primary" ? Mt : ""}`,
|
|
241
|
+
onClick: x,
|
|
241
242
|
"data-testid": f("next"),
|
|
242
243
|
children: e.nextButtonProps?.children ?? (ot ? dt : at)
|
|
243
244
|
}
|
|
@@ -245,18 +246,18 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
245
246
|
] })
|
|
246
247
|
]
|
|
247
248
|
}
|
|
248
|
-
),
|
|
249
|
+
), Dt = _ ? _(rt, { current: l, total: o.length }) : rt, qt = /* @__PURE__ */ b(
|
|
249
250
|
"div",
|
|
250
251
|
{
|
|
251
|
-
ref:
|
|
252
|
-
className: `fixed inset-0 ${m.root ?? ""} ${
|
|
253
|
-
style: { zIndex: L, ...
|
|
252
|
+
ref: Pt,
|
|
253
|
+
className: `fixed inset-0 ${m.root ?? ""} ${pt ?? ""}`,
|
|
254
|
+
style: { zIndex: L, ...p.root, ...bt },
|
|
254
255
|
"data-testid": A,
|
|
255
256
|
"data-state": t ? "open" : "closed",
|
|
256
257
|
role: "dialog",
|
|
257
258
|
"aria-modal": "true",
|
|
258
259
|
"aria-label": `Tour step ${l + 1} of ${o.length}`,
|
|
259
|
-
...
|
|
260
|
+
...gt,
|
|
260
261
|
children: [
|
|
261
262
|
/* @__PURE__ */ s(
|
|
262
263
|
"div",
|
|
@@ -268,16 +269,16 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
268
269
|
"aria-atomic": "true"
|
|
269
270
|
}
|
|
270
271
|
),
|
|
271
|
-
g && /* @__PURE__ */
|
|
272
|
+
g && /* @__PURE__ */ b(
|
|
272
273
|
"svg",
|
|
273
274
|
{
|
|
274
275
|
className: `absolute inset-0 w-full h-full pointer-events-auto ${m.mask ?? ""}`,
|
|
275
|
-
style: { zIndex: L, ...
|
|
276
|
-
onClick:
|
|
276
|
+
style: { zIndex: L, ...Tt, ...p.mask },
|
|
277
|
+
onClick: At,
|
|
277
278
|
"data-testid": f("mask"),
|
|
278
279
|
"aria-hidden": "true",
|
|
279
280
|
children: [
|
|
280
|
-
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */
|
|
281
|
+
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ b("mask", { id: `tour-mask-${A}`, children: [
|
|
281
282
|
/* @__PURE__ */ s("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "white" }),
|
|
282
283
|
u && /* @__PURE__ */ s(
|
|
283
284
|
"rect",
|
|
@@ -298,14 +299,14 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
298
299
|
y: "0",
|
|
299
300
|
width: "100%",
|
|
300
301
|
height: "100%",
|
|
301
|
-
fill:
|
|
302
|
+
fill: Nt,
|
|
302
303
|
mask: `url(#tour-mask-${A})`
|
|
303
304
|
}
|
|
304
305
|
)
|
|
305
306
|
]
|
|
306
307
|
}
|
|
307
308
|
),
|
|
308
|
-
|
|
309
|
+
X && u && /* @__PURE__ */ s(
|
|
309
310
|
"div",
|
|
310
311
|
{
|
|
311
312
|
className: "absolute pointer-events-auto",
|
|
@@ -319,7 +320,7 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
319
320
|
"data-testid": f("blocker")
|
|
320
321
|
}
|
|
321
322
|
),
|
|
322
|
-
/* @__PURE__ */
|
|
323
|
+
/* @__PURE__ */ b(
|
|
323
324
|
"div",
|
|
324
325
|
{
|
|
325
326
|
ref: w,
|
|
@@ -328,7 +329,7 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
328
329
|
top: Z.top,
|
|
329
330
|
left: Z.left,
|
|
330
331
|
zIndex: L + 2,
|
|
331
|
-
...
|
|
332
|
+
...p.popover,
|
|
332
333
|
...e.style
|
|
333
334
|
},
|
|
334
335
|
onClick: (n) => n.stopPropagation(),
|
|
@@ -351,27 +352,27 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
351
352
|
tt !== !1 && /* @__PURE__ */ s(
|
|
352
353
|
"button",
|
|
353
354
|
{
|
|
354
|
-
className: `absolute top-2 right-2 ${D} ${
|
|
355
|
-
style:
|
|
356
|
-
onClick:
|
|
355
|
+
className: `absolute top-2 right-2 ${D} ${M} ${Ot} ${Vt} ${m.close ?? ""}`,
|
|
356
|
+
style: p.close,
|
|
357
|
+
onClick: F,
|
|
357
358
|
"aria-label": "Close tour",
|
|
358
359
|
"data-testid": f("close"),
|
|
359
|
-
children: tt ??
|
|
360
|
+
children: tt ?? Ut
|
|
360
361
|
}
|
|
361
362
|
),
|
|
362
363
|
e.cover && /* @__PURE__ */ s("div", { className: "rounded-t-lg overflow-hidden", "data-testid": f("cover"), children: e.cover }),
|
|
363
|
-
/* @__PURE__ */
|
|
364
|
+
/* @__PURE__ */ b(
|
|
364
365
|
"div",
|
|
365
366
|
{
|
|
366
367
|
className: `p-4 ${m.content ?? ""}`,
|
|
367
|
-
style:
|
|
368
|
+
style: p.content,
|
|
368
369
|
"data-testid": f("content"),
|
|
369
370
|
children: [
|
|
370
|
-
/* @__PURE__ */
|
|
371
|
+
/* @__PURE__ */ b(
|
|
371
372
|
"div",
|
|
372
373
|
{
|
|
373
374
|
className: `${m.header ?? ""}`,
|
|
374
|
-
style:
|
|
375
|
+
style: p.header,
|
|
375
376
|
"data-testid": f("header"),
|
|
376
377
|
children: [
|
|
377
378
|
/* @__PURE__ */ s("h3", { className: "font-semibold text-lg mb-1 pr-6", children: e.title }),
|
|
@@ -379,8 +380,8 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
379
380
|
]
|
|
380
381
|
}
|
|
381
382
|
),
|
|
382
|
-
|
|
383
|
-
|
|
383
|
+
jt,
|
|
384
|
+
Dt
|
|
384
385
|
]
|
|
385
386
|
}
|
|
386
387
|
)
|
|
@@ -389,12 +390,12 @@ const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs
|
|
|
389
390
|
)
|
|
390
391
|
]
|
|
391
392
|
}
|
|
392
|
-
),
|
|
393
|
-
return
|
|
393
|
+
), Gt = J ? J(document.body) : document.body;
|
|
394
|
+
return Ht(qt, Gt);
|
|
394
395
|
}
|
|
395
396
|
);
|
|
396
|
-
|
|
397
|
+
Yt.displayName = "Tour";
|
|
397
398
|
export {
|
|
398
|
-
|
|
399
|
+
Yt as Tour
|
|
399
400
|
};
|
|
400
401
|
//# sourceMappingURL=Tour.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tour.js","sources":["../../src/components/Tour.tsx"],"sourcesContent":["import React, {\n useState,\n useEffect,\n useCallback,\n useRef,\n forwardRef,\n useImperativeHandle,\n} from 'react'\nimport { createPortal } from 'react-dom'\n\n// DaisyUI classes\nconst dBtn = 'btn'\nconst dBtnGhost = 'btn-ghost'\nconst dBtnSm = 'btn-sm'\nconst dBtnPrimary = 'btn-primary'\nconst dBtnXs = 'btn-xs'\nconst dBtnCircle = 'btn-circle'\n\nexport type TourPlacement =\n | 'top'\n | 'topLeft'\n | 'topRight'\n | 'bottom'\n | 'bottomLeft'\n | 'bottomRight'\n | 'left'\n | 'leftTop'\n | 'leftBottom'\n | 'right'\n | 'rightTop'\n | 'rightBottom'\n | 'center'\n\nexport type TourType = 'default' | 'primary'\n\nexport interface TourArrowConfig {\n pointAtCenter?: boolean\n}\n\nexport interface TourMaskConfig {\n style?: React.CSSProperties\n color?: string\n}\n\nexport interface TourButtonProps {\n children?: React.ReactNode\n onClick?: () => void\n}\n\nexport interface TourStepProps {\n /** Target element ref or function returning element */\n target?: React.RefObject<HTMLElement | null> | (() => HTMLElement | null) | null\n /** Step title */\n title: React.ReactNode\n /** Step description */\n description?: React.ReactNode\n /** Cover image or content above title */\n cover?: React.ReactNode\n /** Placement of popover relative to target */\n placement?: TourPlacement\n /** Whether to show arrow (overrides Tour setting) */\n arrow?: boolean | TourArrowConfig\n /** Custom close icon for this step */\n closeIcon?: React.ReactNode\n /** Show mask overlay (overrides Tour setting) */\n mask?: boolean | TourMaskConfig\n /** Type affects styling (overrides Tour setting) */\n type?: TourType\n /** Scroll into view options (overrides Tour setting) */\n scrollIntoViewOptions?: boolean | ScrollIntoViewOptions\n /** Next button props */\n nextButtonProps?: TourButtonProps\n /** Previous button props */\n prevButtonProps?: TourButtonProps\n /** Custom class for this step's popover */\n className?: string\n /** Custom style for this step's popover */\n style?: React.CSSProperties\n /** Called when this step becomes active */\n onClose?: () => void\n}\n\nexport type TourSemanticName = 'root' | 'mask' | 'popover' | 'header' | 'content' | 'footer' | 'indicator' | 'close'\n\nexport interface TourActionInfo {\n current: number\n total: number\n}\n\nexport interface TourRef {\n /** Go to a specific step */\n goTo: (step: number) => void\n /** Go to the next step */\n next: () => void\n /** Go to the previous step */\n prev: () => void\n /** Close the tour */\n close: () => void\n}\n\nexport interface TourProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Whether tour is visible */\n open?: boolean\n /** Callback when tour closes */\n onClose?: () => void\n /** Callback when tour finishes (last step completed) */\n onFinish?: () => void\n /** Tour steps */\n steps: TourStepProps[]\n /** Current step (controlled) */\n current?: number\n /** Callback when step changes */\n onChange?: (current: number) => void\n /** Whether to show arrow on popover */\n arrow?: boolean | TourArrowConfig\n /** Custom close icon */\n closeIcon?: React.ReactNode\n /** Show mask overlay */\n mask?: boolean | TourMaskConfig\n /** Disable interaction on highlighted area */\n disabledInteraction?: boolean\n /** Type affects styling */\n type?: TourType\n /** Gap between highlight and target */\n gap?: { offset?: number | [number, number]; radius?: number }\n /** Text for prev button */\n prevButtonText?: React.ReactNode\n /** Text for next button */\n nextButtonText?: React.ReactNode\n /** Text for finish button */\n finishButtonText?: React.ReactNode\n /** Text for skip button */\n skipButtonText?: React.ReactNode\n /** Show skip button */\n showSkip?: boolean\n /** Show step indicators */\n showIndicators?: boolean\n /** Close on mask click */\n closeOnMaskClick?: boolean\n /** Close on escape key */\n closeOnEscape?: boolean\n /** Scroll target into view */\n scrollIntoViewOptions?: boolean | ScrollIntoViewOptions\n /** Z-index for tour overlay */\n zIndex?: number\n /** Custom indicator renderer */\n indicatorsRender?: (current: number, total: number) => React.ReactNode\n /** Custom action buttons renderer */\n actionsRender?: (originNode: React.ReactNode, info: TourActionInfo) => React.ReactNode\n /** Rendering container for tour */\n getPopupContainer?: (node: HTMLElement) => HTMLElement\n /** Semantic class names */\n classNames?: Partial<Record<TourSemanticName, string>>\n /** Semantic styles */\n styles?: Partial<Record<TourSemanticName, React.CSSProperties>>\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\nconst getTargetElement = (\n target: TourStepProps['target']\n): HTMLElement | null => {\n if (!target) return null\n if (typeof target === 'function') return target()\n return target.current\n}\n\nconst getPopoverPosition = (\n targetRect: DOMRect | null,\n placement: TourPlacement,\n popoverRect: DOMRect,\n gap: number,\n arrow: boolean | TourArrowConfig\n): { top: number; left: number } => {\n if (!targetRect || placement === 'center') {\n return {\n top: window.innerHeight / 2 - popoverRect.height / 2,\n left: window.innerWidth / 2 - popoverRect.width / 2,\n }\n }\n\n const scrollY = window.scrollY\n const scrollX = window.scrollX\n const pointAtCenter = typeof arrow === 'object' && arrow.pointAtCenter\n\n const positions: Record<TourPlacement, { top: number; left: number }> = {\n top: {\n top: targetRect.top + scrollY - popoverRect.height - gap,\n left: pointAtCenter\n ? targetRect.left + scrollX + targetRect.width / 2 - popoverRect.width / 2\n : targetRect.left + scrollX + targetRect.width / 2 - popoverRect.width / 2,\n },\n topLeft: {\n top: targetRect.top + scrollY - popoverRect.height - gap,\n left: targetRect.left + scrollX,\n },\n topRight: {\n top: targetRect.top + scrollY - popoverRect.height - gap,\n left: targetRect.right + scrollX - popoverRect.width,\n },\n bottom: {\n top: targetRect.bottom + scrollY + gap,\n left: targetRect.left + scrollX + targetRect.width / 2 - popoverRect.width / 2,\n },\n bottomLeft: {\n top: targetRect.bottom + scrollY + gap,\n left: targetRect.left + scrollX,\n },\n bottomRight: {\n top: targetRect.bottom + scrollY + gap,\n left: targetRect.right + scrollX - popoverRect.width,\n },\n left: {\n top: targetRect.top + scrollY + targetRect.height / 2 - popoverRect.height / 2,\n left: targetRect.left + scrollX - popoverRect.width - gap,\n },\n leftTop: {\n top: targetRect.top + scrollY,\n left: targetRect.left + scrollX - popoverRect.width - gap,\n },\n leftBottom: {\n top: targetRect.bottom + scrollY - popoverRect.height,\n left: targetRect.left + scrollX - popoverRect.width - gap,\n },\n right: {\n top: targetRect.top + scrollY + targetRect.height / 2 - popoverRect.height / 2,\n left: targetRect.right + scrollX + gap,\n },\n rightTop: {\n top: targetRect.top + scrollY,\n left: targetRect.right + scrollX + gap,\n },\n rightBottom: {\n top: targetRect.bottom + scrollY - popoverRect.height,\n left: targetRect.right + scrollX + gap,\n },\n center: {\n top: window.innerHeight / 2 - popoverRect.height / 2,\n left: window.innerWidth / 2 - popoverRect.width / 2,\n },\n }\n\n return positions[placement]\n}\n\nconst getArrowPosition = (\n placement: TourPlacement\n): { position: string; transform: string } => {\n const arrowPositions: Record<TourPlacement, { position: string; transform: string }> = {\n top: { position: 'bottom-0 left-1/2', transform: 'translate(-50%, 50%) rotate(45deg)' },\n topLeft: { position: 'bottom-0 left-4', transform: 'translate(0, 50%) rotate(45deg)' },\n topRight: { position: 'bottom-0 right-4', transform: 'translate(0, 50%) rotate(45deg)' },\n bottom: { position: 'top-0 left-1/2', transform: 'translate(-50%, -50%) rotate(45deg)' },\n bottomLeft: { position: 'top-0 left-4', transform: 'translate(0, -50%) rotate(45deg)' },\n bottomRight: { position: 'top-0 right-4', transform: 'translate(0, -50%) rotate(45deg)' },\n left: { position: 'right-0 top-1/2', transform: 'translate(50%, -50%) rotate(45deg)' },\n leftTop: { position: 'right-0 top-4', transform: 'translate(50%, 0) rotate(45deg)' },\n leftBottom: { position: 'right-0 bottom-4', transform: 'translate(50%, 0) rotate(45deg)' },\n right: { position: 'left-0 top-1/2', transform: 'translate(-50%, -50%) rotate(45deg)' },\n rightTop: { position: 'left-0 top-4', transform: 'translate(-50%, 0) rotate(45deg)' },\n rightBottom: { position: 'left-0 bottom-4', transform: 'translate(-50%, 0) rotate(45deg)' },\n center: { position: 'hidden', transform: '' },\n }\n return arrowPositions[placement]\n}\n\nconst defaultCloseIcon = (\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n)\n\nexport const Tour = forwardRef<TourRef, TourProps>(\n (\n {\n open = false,\n onClose,\n onFinish,\n steps,\n current: controlledCurrent,\n onChange,\n arrow = true,\n closeIcon,\n mask = true,\n disabledInteraction = false,\n type = 'default',\n gap = { offset: 6, radius: 2 },\n prevButtonText = 'Previous',\n nextButtonText = 'Next',\n finishButtonText = 'Finish',\n skipButtonText = 'Skip',\n showSkip = true,\n showIndicators = true,\n closeOnMaskClick = true,\n closeOnEscape = true,\n scrollIntoViewOptions = true,\n zIndex = 1001,\n indicatorsRender,\n actionsRender,\n getPopupContainer,\n classNames = {},\n styles = {},\n className,\n style,\n 'data-testid': testId,\n ...rest\n },\n ref\n ) => {\n const [internalCurrent, setInternalCurrent] = useState(0)\n const [targetRect, setTargetRect] = useState<DOMRect | null>(null)\n const [popoverPosition, setPopoverPosition] = useState({ top: 0, left: 0 })\n const popoverRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const liveRegionRef = useRef<HTMLDivElement>(null)\n\n const baseTestId = testId ?? 'tour'\n const getTestId = (suffix: string) => `${baseTestId}-${suffix}`\n\n const isControlled = controlledCurrent !== undefined\n const currentStep = isControlled ? controlledCurrent : internalCurrent\n const step = steps[currentStep]\n\n // Resolve gap values\n const gapOffset = gap.offset ?? 6\n const gapRadius = gap.radius ?? 2\n const gapOffsetValue = Array.isArray(gapOffset) ? gapOffset[0] : gapOffset\n\n // Resolve per-step overrides\n const resolvedArrow = step?.arrow ?? arrow\n const resolvedMask = step?.mask ?? mask\n const resolvedType = step?.type ?? type\n const resolvedScrollOptions = step?.scrollIntoViewOptions ?? scrollIntoViewOptions\n const resolvedCloseIcon = step?.closeIcon ?? closeIcon\n\n const showArrow = resolvedArrow !== false && step?.placement !== 'center'\n\n // Mask color\n const maskColor =\n typeof resolvedMask === 'object' && resolvedMask.color\n ? resolvedMask.color\n : 'rgba(0, 0, 0, 0.5)'\n const maskStyle =\n typeof resolvedMask === 'object' && resolvedMask.style ? resolvedMask.style : {}\n\n const updatePosition = useCallback(() => {\n if (!step) return\n\n const target = getTargetElement(step.target)\n const rect = target?.getBoundingClientRect() ?? null\n setTargetRect(rect)\n\n if (popoverRef.current) {\n const popoverRect = popoverRef.current.getBoundingClientRect()\n const placement = step.placement ?? 'bottom'\n const pos = getPopoverPosition(\n rect,\n placement,\n popoverRect,\n gapOffsetValue + gapRadius,\n resolvedArrow\n )\n setPopoverPosition(pos)\n }\n }, [step, gapOffsetValue, gapRadius, resolvedArrow])\n\n const goToStep = useCallback(\n (stepIndex: number) => {\n if (stepIndex < 0 || stepIndex >= steps.length) return\n\n // Call onClose for current step\n steps[currentStep]?.onClose?.()\n\n if (!isControlled) {\n setInternalCurrent(stepIndex)\n }\n onChange?.(stepIndex)\n\n // Announce step change\n if (liveRegionRef.current) {\n liveRegionRef.current.textContent = `Step ${stepIndex + 1} of ${steps.length}: ${\n typeof steps[stepIndex]?.title === 'string' ? steps[stepIndex]?.title : ''\n }`\n }\n },\n [steps, currentStep, isControlled, onChange]\n )\n\n const handleClose = useCallback(() => {\n onClose?.()\n }, [onClose])\n\n const handlePrev = useCallback(() => {\n step?.prevButtonProps?.onClick?.()\n goToStep(currentStep - 1)\n }, [currentStep, goToStep, step])\n\n const handleNext = useCallback(() => {\n step?.nextButtonProps?.onClick?.()\n if (currentStep === steps.length - 1) {\n onFinish?.()\n onClose?.()\n } else {\n goToStep(currentStep + 1)\n }\n }, [currentStep, steps.length, goToStep, onFinish, onClose, step])\n\n const handleSkip = useCallback(() => {\n onClose?.()\n }, [onClose])\n\n const handleMaskClick = useCallback(() => {\n if (closeOnMaskClick) {\n onClose?.()\n }\n }, [closeOnMaskClick, onClose])\n\n // Expose imperative methods\n useImperativeHandle(\n ref,\n () => ({\n goTo: goToStep,\n next: handleNext,\n prev: handlePrev,\n close: handleClose,\n }),\n [goToStep, handleNext, handlePrev, handleClose]\n )\n\n // Reset to first step when opening\n useEffect(() => {\n if (open && !isControlled) {\n setInternalCurrent(0)\n }\n }, [open, isControlled])\n\n // Update position on step change or open\n useEffect(() => {\n if (!open) return\n\n updatePosition()\n\n // Scroll target into view\n if (resolvedScrollOptions && step?.target) {\n const target = getTargetElement(step.target)\n if (target) {\n const scrollOptions: ScrollIntoViewOptions =\n typeof resolvedScrollOptions === 'object'\n ? resolvedScrollOptions\n : { behavior: 'smooth', block: 'center' }\n target.scrollIntoView(scrollOptions)\n }\n }\n\n // Announce first step\n if (currentStep === 0 && liveRegionRef.current) {\n liveRegionRef.current.textContent = `Tour started. Step 1 of ${steps.length}: ${\n typeof step?.title === 'string' ? step?.title : ''\n }`\n }\n }, [open, currentStep, step, resolvedScrollOptions, updatePosition, steps.length])\n\n // Update position on resize/scroll\n useEffect(() => {\n if (!open) return\n\n const handleUpdate = () => updatePosition()\n window.addEventListener('resize', handleUpdate)\n window.addEventListener('scroll', handleUpdate, true)\n\n // Initial position after popover renders\n requestAnimationFrame(updatePosition)\n\n return () => {\n window.removeEventListener('resize', handleUpdate)\n window.removeEventListener('scroll', handleUpdate, true)\n }\n }, [open, updatePosition])\n\n // Keyboard handling\n useEffect(() => {\n if (!open) return\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && closeOnEscape) {\n onClose?.()\n } else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n e.preventDefault()\n handleNext()\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n e.preventDefault()\n handlePrev()\n } else if (e.key === 'Tab') {\n // Focus trap within popover\n if (popoverRef.current) {\n const focusableElements = popoverRef.current.querySelectorAll<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n )\n const firstElement = focusableElements[0]\n const lastElement = focusableElements[focusableElements.length - 1]\n\n if (e.shiftKey && document.activeElement === firstElement) {\n e.preventDefault()\n lastElement?.focus()\n } else if (!e.shiftKey && document.activeElement === lastElement) {\n e.preventDefault()\n firstElement?.focus()\n }\n }\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n return () => document.removeEventListener('keydown', handleKeyDown)\n }, [open, closeOnEscape, onClose, handleNext, handlePrev])\n\n // Focus management - focus first button when tour opens\n useEffect(() => {\n if (open && popoverRef.current) {\n requestAnimationFrame(() => {\n const firstButton = popoverRef.current?.querySelector<HTMLElement>('button')\n firstButton?.focus()\n })\n }\n }, [open, currentStep])\n\n if (!open || !step) return null\n\n const isFirstStep = currentStep === 0\n const isLastStep = currentStep === steps.length - 1\n const placement = step.placement ?? 'bottom'\n const arrowPos = getArrowPosition(placement)\n\n // Default indicators\n const defaultIndicators =\n showIndicators && steps.length > 1 ? (\n <div\n className={`flex gap-1 mb-4 ${classNames.indicator ?? ''}`}\n style={styles.indicator}\n data-testid={getTestId('indicators')}\n >\n {steps.map((_, index) => (\n <button\n key={index}\n className={`w-2 h-2 rounded-full transition-colors ${\n index === currentStep\n ? 'bg-primary'\n : 'bg-base-300 hover:bg-base-content/30'\n }`}\n onClick={() => goToStep(index)}\n aria-label={`Go to step ${index + 1}`}\n aria-current={index === currentStep ? 'step' : undefined}\n data-testid={getTestId(`indicator-${index}`)}\n />\n ))}\n </div>\n ) : null\n\n const indicators = indicatorsRender\n ? indicatorsRender(currentStep, steps.length)\n : defaultIndicators\n\n // Default action buttons\n const defaultActions = (\n <div\n className={`flex items-center justify-between gap-2 ${classNames.footer ?? ''}`}\n style={styles.footer}\n data-testid={getTestId('footer')}\n >\n <div>\n {showSkip && !isLastStep && (\n <button\n className={`${dBtn} ${dBtnGhost} ${dBtnSm}`}\n onClick={handleSkip}\n data-testid={getTestId('skip')}\n >\n {skipButtonText}\n </button>\n )}\n </div>\n <div className=\"flex gap-2\">\n {!isFirstStep && (\n <button\n className={`${dBtn} ${dBtnGhost} ${dBtnSm}`}\n onClick={handlePrev}\n data-testid={getTestId('prev')}\n >\n {step.prevButtonProps?.children ?? prevButtonText}\n </button>\n )}\n <button\n className={`${dBtn} ${dBtnSm} ${resolvedType === 'primary' ? dBtnPrimary : ''}`}\n onClick={handleNext}\n data-testid={getTestId('next')}\n >\n {step.nextButtonProps?.children ?? (isLastStep ? finishButtonText : nextButtonText)}\n </button>\n </div>\n </div>\n )\n\n const actions = actionsRender\n ? actionsRender(defaultActions, { current: currentStep, total: steps.length })\n : defaultActions\n\n const content = (\n <div\n ref={containerRef}\n className={`fixed inset-0 ${classNames.root ?? ''} ${className ?? ''}`}\n style={{ zIndex, ...styles.root, ...style }}\n data-testid={baseTestId}\n data-state={open ? 'open' : 'closed'}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`Tour step ${currentStep + 1} of ${steps.length}`}\n {...rest}\n >\n {/* Live region for screen reader announcements */}\n <div\n ref={liveRegionRef}\n className=\"sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n />\n\n {/* Mask overlay with spotlight cutout */}\n {resolvedMask && (\n <svg\n className={`absolute inset-0 w-full h-full ${\n disabledInteraction ? 'pointer-events-auto' : 'pointer-events-auto'\n } ${classNames.mask ?? ''}`}\n style={{ zIndex, ...maskStyle, ...styles.mask }}\n onClick={handleMaskClick}\n data-testid={getTestId('mask')}\n aria-hidden=\"true\"\n >\n <defs>\n <mask id={`tour-mask-${baseTestId}`}>\n <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"white\" />\n {targetRect && (\n <rect\n x={targetRect.left - gapRadius}\n y={targetRect.top - gapRadius}\n width={targetRect.width + gapRadius * 2}\n height={targetRect.height + gapRadius * 2}\n rx={gapRadius}\n fill=\"black\"\n />\n )}\n </mask>\n </defs>\n <rect\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n fill={maskColor}\n mask={`url(#tour-mask-${baseTestId})`}\n />\n </svg>\n )}\n\n {/* Interaction blocker for highlighted area */}\n {disabledInteraction && targetRect && (\n <div\n className=\"absolute pointer-events-auto\"\n style={{\n left: targetRect.left - gapRadius,\n top: targetRect.top - gapRadius,\n width: targetRect.width + gapRadius * 2,\n height: targetRect.height + gapRadius * 2,\n zIndex: zIndex + 1,\n }}\n data-testid={getTestId('blocker')}\n />\n )}\n\n {/* Popover */}\n <div\n ref={popoverRef}\n className={`absolute bg-base-100 rounded-lg shadow-xl border border-base-300 max-w-sm ${\n classNames.popover ?? ''\n } ${step.className ?? ''}`}\n style={{\n top: popoverPosition.top,\n left: popoverPosition.left,\n zIndex: zIndex + 2,\n ...styles.popover,\n ...step.style,\n }}\n onClick={(e) => e.stopPropagation()}\n data-testid={getTestId('popover')}\n data-placement={placement}\n >\n {/* Arrow */}\n {showArrow && (\n <div\n className={`absolute w-3 h-3 bg-base-100 border-base-300 ${arrowPos.position}`}\n style={{\n transform: arrowPos.transform,\n borderWidth: '1px',\n borderTopColor: 'transparent',\n borderLeftColor: 'transparent',\n }}\n data-testid={getTestId('arrow')}\n />\n )}\n\n {/* Close button */}\n {resolvedCloseIcon !== false && (\n <button\n className={`absolute top-2 right-2 ${dBtn} ${dBtnGhost} ${dBtnXs} ${dBtnCircle} ${\n classNames.close ?? ''\n }`}\n style={styles.close}\n onClick={handleClose}\n aria-label=\"Close tour\"\n data-testid={getTestId('close')}\n >\n {resolvedCloseIcon ?? defaultCloseIcon}\n </button>\n )}\n\n {/* Cover */}\n {step.cover && (\n <div className=\"rounded-t-lg overflow-hidden\" data-testid={getTestId('cover')}>\n {step.cover}\n </div>\n )}\n\n {/* Content */}\n <div\n className={`p-4 ${classNames.content ?? ''}`}\n style={styles.content}\n data-testid={getTestId('content')}\n >\n <div\n className={`${classNames.header ?? ''}`}\n style={styles.header}\n data-testid={getTestId('header')}\n >\n <h3 className=\"font-semibold text-lg mb-1 pr-6\">{step.title}</h3>\n {step.description && (\n <p className=\"text-base-content/70 text-sm mb-4\">{step.description}</p>\n )}\n </div>\n\n {/* Indicators */}\n {indicators}\n\n {/* Navigation */}\n {actions}\n </div>\n </div>\n </div>\n )\n\n // Get container for portal\n const container = getPopupContainer\n ? getPopupContainer(document.body)\n : document.body\n\n return createPortal(content, container)\n }\n)\n\nTour.displayName = 'Tour'\n"],"names":["dBtn","dBtnGhost","dBtnSm","dBtnPrimary","dBtnXs","dBtnCircle","getTargetElement","target","getPopoverPosition","targetRect","placement","popoverRect","gap","arrow","scrollY","scrollX","pointAtCenter","getArrowPosition","defaultCloseIcon","jsx","Tour","forwardRef","open","onClose","onFinish","steps","controlledCurrent","onChange","closeIcon","mask","disabledInteraction","type","prevButtonText","nextButtonText","finishButtonText","skipButtonText","showSkip","showIndicators","closeOnMaskClick","closeOnEscape","scrollIntoViewOptions","zIndex","indicatorsRender","actionsRender","getPopupContainer","classNames","styles","className","style","testId","rest","ref","internalCurrent","setInternalCurrent","useState","setTargetRect","popoverPosition","setPopoverPosition","popoverRef","useRef","containerRef","liveRegionRef","baseTestId","getTestId","suffix","isControlled","currentStep","step","gapOffset","gapRadius","gapOffsetValue","resolvedArrow","resolvedMask","resolvedType","resolvedScrollOptions","resolvedCloseIcon","showArrow","maskColor","maskStyle","updatePosition","useCallback","rect","pos","goToStep","stepIndex","handleClose","handlePrev","handleNext","handleSkip","handleMaskClick","useImperativeHandle","useEffect","scrollOptions","handleUpdate","handleKeyDown","e","focusableElements","firstElement","lastElement","isFirstStep","isLastStep","arrowPos","defaultIndicators","_","index","indicators","defaultActions","jsxs","actions","content","container","createPortal"],"mappings":";;;AAWA,MAAMA,IAAO,OACPC,IAAY,aACZC,IAAS,UACTC,KAAc,eACdC,KAAS,UACTC,KAAa,cA+IbC,KAAmB,CACvBC,MAEKA,IACD,OAAOA,KAAW,aAAmBA,EAAA,IAClCA,EAAO,UAFM,MAKhBC,KAAqB,CACzBC,GACAC,GACAC,GACAC,GACAC,MACkC;AAClC,MAAI,CAACJ,KAAcC,MAAc;AAC/B,WAAO;AAAA,MACL,KAAK,OAAO,cAAc,IAAIC,EAAY,SAAS;AAAA,MACnD,MAAM,OAAO,aAAa,IAAIA,EAAY,QAAQ;AAAA,IAAA;AAItD,QAAMG,IAAU,OAAO,SACjBC,IAAU,OAAO,SACjBC,IAAgB,OAAOH,KAAU,YAAYA,EAAM;AA2DzD,SAzDwE;AAAA,IACtE,KAAK;AAAA,MACH,KAAKJ,EAAW,MAAMK,IAAUH,EAAY,SAASC;AAAA,MACrD,MACIH,EAAW,OAAOM,IAAUN,EAAW,QAAQ,IAAIE,EAAY,QAAQ;AAAA,IACA;AAAA,IAE7E,SAAS;AAAA,MACP,KAAKF,EAAW,MAAMK,IAAUH,EAAY,SAASC;AAAA,MACrD,MAAMH,EAAW,OAAOM;AAAA,IAAA;AAAA,IAE1B,UAAU;AAAA,MACR,KAAKN,EAAW,MAAMK,IAAUH,EAAY,SAASC;AAAA,MACrD,MAAMH,EAAW,QAAQM,IAAUJ,EAAY;AAAA,IAAA;AAAA,IAEjD,QAAQ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;AAAA,gBAAA;AAAA,gBAKzBiD,EAAK,SACJ,gBAAAhD,EAAC,OAAA,EAAI,WAAU,gCAA+B,eAAa4C,EAAU,OAAO,GACzE,UAAAI,EAAK,MAAA,CACR;AAAA,gBAIF,gBAAAwC;AAAA,kBAAC;AAAA,kBAAA;AAAA,oBACC,WAAW,OAAO9D,EAAW,WAAW,EAAE;AAAA,oBAC1C,OAAOC,EAAO;AAAA,oBACd,eAAaiB,EAAU,SAAS;AAAA,oBAEhC,UAAA;AAAA,sBAAA,gBAAA4C;AAAA,wBAAC;AAAA,wBAAA;AAAA,0BACC,WAAW,GAAG9D,EAAW,UAAU,EAAE;AAAA,0BACrC,OAAOC,EAAO;AAAA,0BACd,eAAaiB,EAAU,QAAQ;AAAA,0BAE/B,UAAA;AAAA,4BAAA,gBAAA5C,EAAC,MAAA,EAAG,WAAU,mCAAmC,UAAAgD,EAAK,OAAM;AAAA,4BAC3DA,EAAK,eACJ,gBAAAhD,EAAC,OAAE,WAAU,qCAAqC,YAAK,YAAA,CAAY;AAAA,0BAAA;AAAA,wBAAA;AAAA,sBAAA;AAAA,sBAKtEsF;AAAA,sBAGAG;AAAA,oBAAA;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACH;AAAA,YAAA;AAAA,UAAA;AAAA,QACF;AAAA,MAAA;AAAA,IAAA,GAKEE,KAAYlE,IACdA,EAAkB,SAAS,IAAI,IAC/B,SAAS;AAEb,WAAOmE,GAAaF,IAASC,EAAS;AAAA,EACxC;AACF;AAEA1F,GAAK,cAAc;"}
|
|
1
|
+
{"version":3,"file":"Tour.js","sources":["../../src/components/Tour.tsx"],"sourcesContent":["import React, {\n useState,\n useEffect,\n useCallback,\n useRef,\n forwardRef,\n useImperativeHandle,\n} from 'react'\nimport { createPortal } from 'react-dom'\nimport { useConfig } from '../providers/ConfigProvider'\n\n// DaisyUI classes\nconst dBtn = 'btn'\nconst dBtnGhost = 'btn-ghost'\nconst dBtnSm = 'btn-sm'\nconst dBtnPrimary = 'btn-primary'\nconst dBtnXs = 'btn-xs'\nconst dBtnCircle = 'btn-circle'\n\nexport type TourPlacement =\n | 'top'\n | 'topLeft'\n | 'topRight'\n | 'bottom'\n | 'bottomLeft'\n | 'bottomRight'\n | 'left'\n | 'leftTop'\n | 'leftBottom'\n | 'right'\n | 'rightTop'\n | 'rightBottom'\n | 'center'\n\nexport type TourType = 'default' | 'primary'\n\nexport interface TourArrowConfig {\n pointAtCenter?: boolean\n}\n\nexport interface TourMaskConfig {\n style?: React.CSSProperties\n color?: string\n}\n\nexport interface TourButtonProps {\n children?: React.ReactNode\n onClick?: () => void\n}\n\nexport interface TourStepProps {\n /** Target element ref or function returning element */\n target?: React.RefObject<HTMLElement | null> | (() => HTMLElement | null) | null\n /** Step title */\n title: React.ReactNode\n /** Step description */\n description?: React.ReactNode\n /** Cover image or content above title */\n cover?: React.ReactNode\n /** Placement of popover relative to target */\n placement?: TourPlacement\n /** Whether to show arrow (overrides Tour setting) */\n arrow?: boolean | TourArrowConfig\n /** Custom close icon for this step */\n closeIcon?: React.ReactNode\n /** Show mask overlay (overrides Tour setting) */\n mask?: boolean | TourMaskConfig\n /** Type affects styling (overrides Tour setting) */\n type?: TourType\n /** Scroll into view options (overrides Tour setting) */\n scrollIntoViewOptions?: boolean | ScrollIntoViewOptions\n /** Next button props */\n nextButtonProps?: TourButtonProps\n /** Previous button props */\n prevButtonProps?: TourButtonProps\n /** Custom class for this step's popover */\n className?: string\n /** Custom style for this step's popover */\n style?: React.CSSProperties\n /** Called when this step becomes active */\n onClose?: () => void\n}\n\nexport type TourSemanticName = 'root' | 'mask' | 'popover' | 'header' | 'content' | 'footer' | 'indicator' | 'close'\n\nexport interface TourActionInfo {\n current: number\n total: number\n}\n\nexport interface TourRef {\n /** Go to a specific step */\n goTo: (step: number) => void\n /** Go to the next step */\n next: () => void\n /** Go to the previous step */\n prev: () => void\n /** Close the tour */\n close: () => void\n}\n\nexport interface TourProps extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onChange'> {\n /** Whether tour is visible */\n open?: boolean\n /** Callback when tour closes */\n onClose?: () => void\n /** Callback when tour finishes (last step completed) */\n onFinish?: () => void\n /** Tour steps */\n steps: TourStepProps[]\n /** Current step (controlled) */\n current?: number\n /** Callback when step changes */\n onChange?: (current: number) => void\n /** Whether to show arrow on popover */\n arrow?: boolean | TourArrowConfig\n /** Custom close icon */\n closeIcon?: React.ReactNode\n /** Show mask overlay */\n mask?: boolean | TourMaskConfig\n /** Disable interaction on highlighted area */\n disabledInteraction?: boolean\n /** Type affects styling */\n type?: TourType\n /** Gap between highlight and target */\n gap?: { offset?: number | [number, number]; radius?: number }\n /** Text for prev button */\n prevButtonText?: React.ReactNode\n /** Text for next button */\n nextButtonText?: React.ReactNode\n /** Text for finish button */\n finishButtonText?: React.ReactNode\n /** Text for skip button */\n skipButtonText?: React.ReactNode\n /** Show skip button */\n showSkip?: boolean\n /** Show step indicators */\n showIndicators?: boolean\n /** Close on mask click */\n closeOnMaskClick?: boolean\n /** Close on escape key */\n closeOnEscape?: boolean\n /** Scroll target into view */\n scrollIntoViewOptions?: boolean | ScrollIntoViewOptions\n /** Z-index for tour overlay */\n zIndex?: number\n /** Custom indicator renderer */\n indicatorsRender?: (current: number, total: number) => React.ReactNode\n /** Custom action buttons renderer */\n actionsRender?: (originNode: React.ReactNode, info: TourActionInfo) => React.ReactNode\n /** Rendering container for tour */\n getPopupContainer?: (node: HTMLElement) => HTMLElement\n /** Semantic class names */\n classNames?: Partial<Record<TourSemanticName, string>>\n /** Semantic styles */\n styles?: Partial<Record<TourSemanticName, React.CSSProperties>>\n /** Test ID for testing */\n 'data-testid'?: string\n}\n\nconst getTargetElement = (\n target: TourStepProps['target']\n): HTMLElement | null => {\n if (!target) return null\n if (typeof target === 'function') return target()\n return target.current\n}\n\nconst getPopoverPosition = (\n targetRect: DOMRect | null,\n placement: TourPlacement,\n popoverRect: DOMRect,\n gap: number,\n arrow: boolean | TourArrowConfig\n): { top: number; left: number } => {\n if (!targetRect || placement === 'center') {\n return {\n top: window.innerHeight / 2 - popoverRect.height / 2,\n left: window.innerWidth / 2 - popoverRect.width / 2,\n }\n }\n\n const scrollY = window.scrollY\n const scrollX = window.scrollX\n const pointAtCenter = typeof arrow === 'object' && arrow.pointAtCenter\n\n const positions: Record<TourPlacement, { top: number; left: number }> = {\n top: {\n top: targetRect.top + scrollY - popoverRect.height - gap,\n left: pointAtCenter\n ? targetRect.left + scrollX + targetRect.width / 2 - popoverRect.width / 2\n : targetRect.left + scrollX + targetRect.width / 2 - popoverRect.width / 2,\n },\n topLeft: {\n top: targetRect.top + scrollY - popoverRect.height - gap,\n left: targetRect.left + scrollX,\n },\n topRight: {\n top: targetRect.top + scrollY - popoverRect.height - gap,\n left: targetRect.right + scrollX - popoverRect.width,\n },\n bottom: {\n top: targetRect.bottom + scrollY + gap,\n left: targetRect.left + scrollX + targetRect.width / 2 - popoverRect.width / 2,\n },\n bottomLeft: {\n top: targetRect.bottom + scrollY + gap,\n left: targetRect.left + scrollX,\n },\n bottomRight: {\n top: targetRect.bottom + scrollY + gap,\n left: targetRect.right + scrollX - popoverRect.width,\n },\n left: {\n top: targetRect.top + scrollY + targetRect.height / 2 - popoverRect.height / 2,\n left: targetRect.left + scrollX - popoverRect.width - gap,\n },\n leftTop: {\n top: targetRect.top + scrollY,\n left: targetRect.left + scrollX - popoverRect.width - gap,\n },\n leftBottom: {\n top: targetRect.bottom + scrollY - popoverRect.height,\n left: targetRect.left + scrollX - popoverRect.width - gap,\n },\n right: {\n top: targetRect.top + scrollY + targetRect.height / 2 - popoverRect.height / 2,\n left: targetRect.right + scrollX + gap,\n },\n rightTop: {\n top: targetRect.top + scrollY,\n left: targetRect.right + scrollX + gap,\n },\n rightBottom: {\n top: targetRect.bottom + scrollY - popoverRect.height,\n left: targetRect.right + scrollX + gap,\n },\n center: {\n top: window.innerHeight / 2 - popoverRect.height / 2,\n left: window.innerWidth / 2 - popoverRect.width / 2,\n },\n }\n\n return positions[placement]\n}\n\nconst getArrowPosition = (\n placement: TourPlacement\n): { position: string; transform: string } => {\n const arrowPositions: Record<TourPlacement, { position: string; transform: string }> = {\n top: { position: 'bottom-0 left-1/2', transform: 'translate(-50%, 50%) rotate(45deg)' },\n topLeft: { position: 'bottom-0 left-4', transform: 'translate(0, 50%) rotate(45deg)' },\n topRight: { position: 'bottom-0 right-4', transform: 'translate(0, 50%) rotate(45deg)' },\n bottom: { position: 'top-0 left-1/2', transform: 'translate(-50%, -50%) rotate(45deg)' },\n bottomLeft: { position: 'top-0 left-4', transform: 'translate(0, -50%) rotate(45deg)' },\n bottomRight: { position: 'top-0 right-4', transform: 'translate(0, -50%) rotate(45deg)' },\n left: { position: 'right-0 top-1/2', transform: 'translate(50%, -50%) rotate(45deg)' },\n leftTop: { position: 'right-0 top-4', transform: 'translate(50%, 0) rotate(45deg)' },\n leftBottom: { position: 'right-0 bottom-4', transform: 'translate(50%, 0) rotate(45deg)' },\n right: { position: 'left-0 top-1/2', transform: 'translate(-50%, -50%) rotate(45deg)' },\n rightTop: { position: 'left-0 top-4', transform: 'translate(-50%, 0) rotate(45deg)' },\n rightBottom: { position: 'left-0 bottom-4', transform: 'translate(-50%, 0) rotate(45deg)' },\n center: { position: 'hidden', transform: '' },\n }\n return arrowPositions[placement]\n}\n\nconst defaultCloseIcon = (\n <svg className=\"w-4 h-4\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\">\n <path strokeLinecap=\"round\" strokeLinejoin=\"round\" strokeWidth={2} d=\"M6 18L18 6M6 6l12 12\" />\n </svg>\n)\n\nexport const Tour = forwardRef<TourRef, TourProps>(\n (\n {\n open = false,\n onClose,\n onFinish,\n steps,\n current: controlledCurrent,\n onChange,\n arrow = true,\n closeIcon,\n mask = true,\n disabledInteraction = false,\n type = 'default',\n gap = { offset: 6, radius: 2 },\n prevButtonText = 'Previous',\n nextButtonText = 'Next',\n finishButtonText = 'Finish',\n skipButtonText = 'Skip',\n showSkip = true,\n showIndicators = true,\n closeOnMaskClick = true,\n closeOnEscape = true,\n scrollIntoViewOptions = true,\n zIndex = 1001,\n indicatorsRender,\n actionsRender,\n getPopupContainer,\n classNames = {},\n styles = {},\n className,\n style,\n 'data-testid': testId,\n ...rest\n },\n ref\n ) => {\n const { getPopupContainer: globalGetPopupContainer } = useConfig()\n const effectiveGetPopupContainer = getPopupContainer ?? globalGetPopupContainer\n\n const [internalCurrent, setInternalCurrent] = useState(0)\n const [targetRect, setTargetRect] = useState<DOMRect | null>(null)\n const [popoverPosition, setPopoverPosition] = useState({ top: 0, left: 0 })\n const popoverRef = useRef<HTMLDivElement>(null)\n const containerRef = useRef<HTMLDivElement>(null)\n const liveRegionRef = useRef<HTMLDivElement>(null)\n\n const baseTestId = testId ?? 'tour'\n const getTestId = (suffix: string) => `${baseTestId}-${suffix}`\n\n const isControlled = controlledCurrent !== undefined\n const currentStep = isControlled ? controlledCurrent : internalCurrent\n const step = steps[currentStep]\n\n // Resolve gap values\n const gapOffset = gap.offset ?? 6\n const gapRadius = gap.radius ?? 2\n const gapOffsetValue = Array.isArray(gapOffset) ? gapOffset[0] : gapOffset\n\n // Resolve per-step overrides\n const resolvedArrow = step?.arrow ?? arrow\n const resolvedMask = step?.mask ?? mask\n const resolvedType = step?.type ?? type\n const resolvedScrollOptions = step?.scrollIntoViewOptions ?? scrollIntoViewOptions\n const resolvedCloseIcon = step?.closeIcon ?? closeIcon\n\n const showArrow = resolvedArrow !== false && step?.placement !== 'center'\n\n // Mask color\n const maskColor =\n typeof resolvedMask === 'object' && resolvedMask.color\n ? resolvedMask.color\n : 'rgba(0, 0, 0, 0.5)'\n const maskStyle =\n typeof resolvedMask === 'object' && resolvedMask.style ? resolvedMask.style : {}\n\n const updatePosition = useCallback(() => {\n if (!step) return\n\n const target = getTargetElement(step.target)\n const rect = target?.getBoundingClientRect() ?? null\n setTargetRect(rect)\n\n if (popoverRef.current) {\n const popoverRect = popoverRef.current.getBoundingClientRect()\n const placement = step.placement ?? 'bottom'\n const pos = getPopoverPosition(\n rect,\n placement,\n popoverRect,\n gapOffsetValue + gapRadius,\n resolvedArrow\n )\n setPopoverPosition(pos)\n }\n }, [step, gapOffsetValue, gapRadius, resolvedArrow])\n\n const goToStep = useCallback(\n (stepIndex: number) => {\n if (stepIndex < 0 || stepIndex >= steps.length) return\n\n // Call onClose for current step\n steps[currentStep]?.onClose?.()\n\n if (!isControlled) {\n setInternalCurrent(stepIndex)\n }\n onChange?.(stepIndex)\n\n // Announce step change\n if (liveRegionRef.current) {\n liveRegionRef.current.textContent = `Step ${stepIndex + 1} of ${steps.length}: ${\n typeof steps[stepIndex]?.title === 'string' ? steps[stepIndex]?.title : ''\n }`\n }\n },\n [steps, currentStep, isControlled, onChange]\n )\n\n const handleClose = useCallback(() => {\n onClose?.()\n }, [onClose])\n\n const handlePrev = useCallback(() => {\n step?.prevButtonProps?.onClick?.()\n goToStep(currentStep - 1)\n }, [currentStep, goToStep, step])\n\n const handleNext = useCallback(() => {\n step?.nextButtonProps?.onClick?.()\n if (currentStep === steps.length - 1) {\n onFinish?.()\n onClose?.()\n } else {\n goToStep(currentStep + 1)\n }\n }, [currentStep, steps.length, goToStep, onFinish, onClose, step])\n\n const handleSkip = useCallback(() => {\n onClose?.()\n }, [onClose])\n\n const handleMaskClick = useCallback(() => {\n if (closeOnMaskClick) {\n onClose?.()\n }\n }, [closeOnMaskClick, onClose])\n\n // Expose imperative methods\n useImperativeHandle(\n ref,\n () => ({\n goTo: goToStep,\n next: handleNext,\n prev: handlePrev,\n close: handleClose,\n }),\n [goToStep, handleNext, handlePrev, handleClose]\n )\n\n // Reset to first step when opening\n useEffect(() => {\n if (open && !isControlled) {\n setInternalCurrent(0)\n }\n }, [open, isControlled])\n\n // Update position on step change or open\n useEffect(() => {\n if (!open) return\n\n updatePosition()\n\n // Scroll target into view\n if (resolvedScrollOptions && step?.target) {\n const target = getTargetElement(step.target)\n if (target) {\n const scrollOptions: ScrollIntoViewOptions =\n typeof resolvedScrollOptions === 'object'\n ? resolvedScrollOptions\n : { behavior: 'smooth', block: 'center' }\n target.scrollIntoView(scrollOptions)\n }\n }\n\n // Announce first step\n if (currentStep === 0 && liveRegionRef.current) {\n liveRegionRef.current.textContent = `Tour started. Step 1 of ${steps.length}: ${\n typeof step?.title === 'string' ? step?.title : ''\n }`\n }\n }, [open, currentStep, step, resolvedScrollOptions, updatePosition, steps.length])\n\n // Update position on resize/scroll\n useEffect(() => {\n if (!open) return\n\n const handleUpdate = () => updatePosition()\n window.addEventListener('resize', handleUpdate)\n window.addEventListener('scroll', handleUpdate, true)\n\n // Initial position after popover renders\n requestAnimationFrame(updatePosition)\n\n return () => {\n window.removeEventListener('resize', handleUpdate)\n window.removeEventListener('scroll', handleUpdate, true)\n }\n }, [open, updatePosition])\n\n // Keyboard handling\n useEffect(() => {\n if (!open) return\n\n const handleKeyDown = (e: KeyboardEvent) => {\n if (e.key === 'Escape' && closeOnEscape) {\n onClose?.()\n } else if (e.key === 'ArrowRight' || e.key === 'ArrowDown') {\n e.preventDefault()\n handleNext()\n } else if (e.key === 'ArrowLeft' || e.key === 'ArrowUp') {\n e.preventDefault()\n handlePrev()\n } else if (e.key === 'Tab') {\n // Focus trap within popover\n if (popoverRef.current) {\n const focusableElements = popoverRef.current.querySelectorAll<HTMLElement>(\n 'button, [href], input, select, textarea, [tabindex]:not([tabindex=\"-1\"])'\n )\n const firstElement = focusableElements[0]\n const lastElement = focusableElements[focusableElements.length - 1]\n\n if (e.shiftKey && document.activeElement === firstElement) {\n e.preventDefault()\n lastElement?.focus()\n } else if (!e.shiftKey && document.activeElement === lastElement) {\n e.preventDefault()\n firstElement?.focus()\n }\n }\n }\n }\n\n document.addEventListener('keydown', handleKeyDown)\n return () => document.removeEventListener('keydown', handleKeyDown)\n }, [open, closeOnEscape, onClose, handleNext, handlePrev])\n\n // Focus management - focus first button when tour opens\n useEffect(() => {\n if (open && popoverRef.current) {\n requestAnimationFrame(() => {\n const firstButton = popoverRef.current?.querySelector<HTMLElement>('button')\n firstButton?.focus()\n })\n }\n }, [open, currentStep])\n\n if (!open || !step) return null\n\n const isFirstStep = currentStep === 0\n const isLastStep = currentStep === steps.length - 1\n const placement = step.placement ?? 'bottom'\n const arrowPos = getArrowPosition(placement)\n\n // Default indicators\n const defaultIndicators =\n showIndicators && steps.length > 1 ? (\n <div\n className={`flex gap-1 mb-4 ${classNames.indicator ?? ''}`}\n style={styles.indicator}\n data-testid={getTestId('indicators')}\n >\n {steps.map((_, index) => (\n <button\n key={index}\n className={`w-2 h-2 rounded-full transition-colors ${\n index === currentStep\n ? 'bg-primary'\n : 'bg-base-300 hover:bg-base-content/30'\n }`}\n onClick={() => goToStep(index)}\n aria-label={`Go to step ${index + 1}`}\n aria-current={index === currentStep ? 'step' : undefined}\n data-testid={getTestId(`indicator-${index}`)}\n />\n ))}\n </div>\n ) : null\n\n const indicators = indicatorsRender\n ? indicatorsRender(currentStep, steps.length)\n : defaultIndicators\n\n // Default action buttons\n const defaultActions = (\n <div\n className={`flex items-center justify-between gap-2 ${classNames.footer ?? ''}`}\n style={styles.footer}\n data-testid={getTestId('footer')}\n >\n <div>\n {showSkip && !isLastStep && (\n <button\n className={`${dBtn} ${dBtnGhost} ${dBtnSm}`}\n onClick={handleSkip}\n data-testid={getTestId('skip')}\n >\n {skipButtonText}\n </button>\n )}\n </div>\n <div className=\"flex gap-2\">\n {!isFirstStep && (\n <button\n className={`${dBtn} ${dBtnGhost} ${dBtnSm}`}\n onClick={handlePrev}\n data-testid={getTestId('prev')}\n >\n {step.prevButtonProps?.children ?? prevButtonText}\n </button>\n )}\n <button\n className={`${dBtn} ${dBtnSm} ${resolvedType === 'primary' ? dBtnPrimary : ''}`}\n onClick={handleNext}\n data-testid={getTestId('next')}\n >\n {step.nextButtonProps?.children ?? (isLastStep ? finishButtonText : nextButtonText)}\n </button>\n </div>\n </div>\n )\n\n const actions = actionsRender\n ? actionsRender(defaultActions, { current: currentStep, total: steps.length })\n : defaultActions\n\n const content = (\n <div\n ref={containerRef}\n className={`fixed inset-0 ${classNames.root ?? ''} ${className ?? ''}`}\n style={{ zIndex, ...styles.root, ...style }}\n data-testid={baseTestId}\n data-state={open ? 'open' : 'closed'}\n role=\"dialog\"\n aria-modal=\"true\"\n aria-label={`Tour step ${currentStep + 1} of ${steps.length}`}\n {...rest}\n >\n {/* Live region for screen reader announcements */}\n <div\n ref={liveRegionRef}\n className=\"sr-only\"\n role=\"status\"\n aria-live=\"polite\"\n aria-atomic=\"true\"\n />\n\n {/* Mask overlay with spotlight cutout */}\n {resolvedMask && (\n <svg\n className={`absolute inset-0 w-full h-full ${\n disabledInteraction ? 'pointer-events-auto' : 'pointer-events-auto'\n } ${classNames.mask ?? ''}`}\n style={{ zIndex, ...maskStyle, ...styles.mask }}\n onClick={handleMaskClick}\n data-testid={getTestId('mask')}\n aria-hidden=\"true\"\n >\n <defs>\n <mask id={`tour-mask-${baseTestId}`}>\n <rect x=\"0\" y=\"0\" width=\"100%\" height=\"100%\" fill=\"white\" />\n {targetRect && (\n <rect\n x={targetRect.left - gapRadius}\n y={targetRect.top - gapRadius}\n width={targetRect.width + gapRadius * 2}\n height={targetRect.height + gapRadius * 2}\n rx={gapRadius}\n fill=\"black\"\n />\n )}\n </mask>\n </defs>\n <rect\n x=\"0\"\n y=\"0\"\n width=\"100%\"\n height=\"100%\"\n fill={maskColor}\n mask={`url(#tour-mask-${baseTestId})`}\n />\n </svg>\n )}\n\n {/* Interaction blocker for highlighted area */}\n {disabledInteraction && targetRect && (\n <div\n className=\"absolute pointer-events-auto\"\n style={{\n left: targetRect.left - gapRadius,\n top: targetRect.top - gapRadius,\n width: targetRect.width + gapRadius * 2,\n height: targetRect.height + gapRadius * 2,\n zIndex: zIndex + 1,\n }}\n data-testid={getTestId('blocker')}\n />\n )}\n\n {/* Popover */}\n <div\n ref={popoverRef}\n className={`absolute bg-base-100 rounded-lg shadow-xl border border-base-300 max-w-sm ${\n classNames.popover ?? ''\n } ${step.className ?? ''}`}\n style={{\n top: popoverPosition.top,\n left: popoverPosition.left,\n zIndex: zIndex + 2,\n ...styles.popover,\n ...step.style,\n }}\n onClick={(e) => e.stopPropagation()}\n data-testid={getTestId('popover')}\n data-placement={placement}\n >\n {/* Arrow */}\n {showArrow && (\n <div\n className={`absolute w-3 h-3 bg-base-100 border-base-300 ${arrowPos.position}`}\n style={{\n transform: arrowPos.transform,\n borderWidth: '1px',\n borderTopColor: 'transparent',\n borderLeftColor: 'transparent',\n }}\n data-testid={getTestId('arrow')}\n />\n )}\n\n {/* Close button */}\n {resolvedCloseIcon !== false && (\n <button\n className={`absolute top-2 right-2 ${dBtn} ${dBtnGhost} ${dBtnXs} ${dBtnCircle} ${\n classNames.close ?? ''\n }`}\n style={styles.close}\n onClick={handleClose}\n aria-label=\"Close tour\"\n data-testid={getTestId('close')}\n >\n {resolvedCloseIcon ?? defaultCloseIcon}\n </button>\n )}\n\n {/* Cover */}\n {step.cover && (\n <div className=\"rounded-t-lg overflow-hidden\" data-testid={getTestId('cover')}>\n {step.cover}\n </div>\n )}\n\n {/* Content */}\n <div\n className={`p-4 ${classNames.content ?? ''}`}\n style={styles.content}\n data-testid={getTestId('content')}\n >\n <div\n className={`${classNames.header ?? ''}`}\n style={styles.header}\n data-testid={getTestId('header')}\n >\n <h3 className=\"font-semibold text-lg mb-1 pr-6\">{step.title}</h3>\n {step.description && (\n <p className=\"text-base-content/70 text-sm mb-4\">{step.description}</p>\n )}\n </div>\n\n {/* Indicators */}\n {indicators}\n\n {/* Navigation */}\n {actions}\n </div>\n </div>\n </div>\n )\n\n // Get container for portal\n const container = effectiveGetPopupContainer\n ? effectiveGetPopupContainer(document.body)\n : document.body\n\n return createPortal(content, container)\n }\n)\n\nTour.displayName = 'Tour'\n"],"names":["dBtn","dBtnGhost","dBtnSm","dBtnPrimary","dBtnXs","dBtnCircle","getTargetElement","target","getPopoverPosition","targetRect","placement","popoverRect","gap","arrow","scrollY","scrollX","pointAtCenter","getArrowPosition","defaultCloseIcon","jsx","Tour","forwardRef","open","onClose","onFinish","steps","controlledCurrent","onChange","closeIcon","mask","disabledInteraction","type","prevButtonText","nextButtonText","finishButtonText","skipButtonText","showSkip","showIndicators","closeOnMaskClick","closeOnEscape","scrollIntoViewOptions","zIndex","indicatorsRender","actionsRender","getPopupContainer","classNames","styles","className","style","testId","rest","ref","globalGetPopupContainer","useConfig","effectiveGetPopupContainer","internalCurrent","setInternalCurrent","useState","setTargetRect","popoverPosition","setPopoverPosition","popoverRef","useRef","containerRef","liveRegionRef","baseTestId","getTestId","suffix","isControlled","currentStep","step","gapOffset","gapRadius","gapOffsetValue","resolvedArrow","resolvedMask","resolvedType","resolvedScrollOptions","resolvedCloseIcon","showArrow","maskColor","maskStyle","updatePosition","useCallback","rect","pos","goToStep","stepIndex","handleClose","handlePrev","handleNext","handleSkip","handleMaskClick","useImperativeHandle","useEffect","scrollOptions","handleUpdate","handleKeyDown","e","focusableElements","firstElement","lastElement","isFirstStep","isLastStep","arrowPos","defaultIndicators","_","index","indicators","defaultActions","jsxs","actions","content","container","createPortal"],"mappings":";;;;AAYA,MAAMA,IAAO,OACPC,IAAY,aACZC,IAAS,UACTC,KAAc,eACdC,KAAS,UACTC,KAAa,cA+IbC,KAAmB,CACvBC,MAEKA,IACD,OAAOA,KAAW,aAAmBA,EAAA,IAClCA,EAAO,UAFM,MAKhBC,KAAqB,CACzBC,GACAC,GACAC,GACAC,GACAC,MACkC;AAClC,MAAI,CAACJ,KAAcC,MAAc;AAC/B,WAAO;AAAA,MACL,KAAK,OAAO,cAAc,IAAIC,EAAY,SAAS;AAAA,MACnD,MAAM,OAAO,aAAa,IAAIA,EAAY,QAAQ;AAAA,IAAA;AAItD,QAAMG,IAAU,OAAO,SACjBC,IAAU,OAAO,SACjBC,IAAgB,OAAOH,KAAU,YAAYA,EAAM;AA2DzD,SAzDwE;AAAA,IACtE,KAAK;AAAA,MACH,KAAKJ,EAAW,MAAMK,IAAUH,EAAY,SAASC;AAAA,MACrD,MACIH,EAAW,OAAOM,IAAUN,EAAW,QAAQ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