asterui 0.12.49 → 0.12.50
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/Alert.js +18 -18
- package/dist/components/Alert.js.map +1 -1
- package/dist/components/Anchor.js +53 -53
- package/dist/components/Anchor.js.map +1 -1
- package/dist/components/Autocomplete.js +115 -114
- package/dist/components/Autocomplete.js.map +1 -1
- package/dist/components/Avatar.js +33 -32
- package/dist/components/Avatar.js.map +1 -1
- package/dist/components/Badge.js +99 -99
- package/dist/components/Badge.js.map +1 -1
- package/dist/components/Breadcrumb.js +12 -11
- package/dist/components/Breadcrumb.js.map +1 -1
- package/dist/components/Browser.js +10 -10
- package/dist/components/Browser.js.map +1 -1
- package/dist/components/Button.js +80 -79
- package/dist/components/Button.js.map +1 -1
- package/dist/components/Card.d.ts +2 -0
- package/dist/components/Card.js +111 -110
- package/dist/components/Card.js.map +1 -1
- package/dist/components/Carousel.js +59 -59
- package/dist/components/Carousel.js.map +1 -1
- package/dist/components/Cascader.js +175 -174
- package/dist/components/Cascader.js.map +1 -1
- package/dist/components/Chat.js +27 -27
- package/dist/components/Chat.js.map +1 -1
- package/dist/components/Checkbox.js +98 -97
- package/dist/components/Checkbox.js.map +1 -1
- package/dist/components/Code.js +11 -11
- package/dist/components/Code.js.map +1 -1
- package/dist/components/Collapse.js +46 -46
- package/dist/components/Collapse.js.map +1 -1
- package/dist/components/ColorPicker.d.ts +1 -1
- package/dist/components/ColorPicker.js +93 -91
- package/dist/components/ColorPicker.js.map +1 -1
- package/dist/components/Command.js +120 -120
- package/dist/components/Command.js.map +1 -1
- package/dist/components/ConfigProvider.d.ts +1 -1
- package/dist/components/ConfigProvider.js +9 -9
- package/dist/components/ConfigProvider.js.map +1 -1
- package/dist/components/ContextMenu.js +33 -33
- package/dist/components/ContextMenu.js.map +1 -1
- package/dist/components/CopyButton.js +74 -73
- package/dist/components/CopyButton.js.map +1 -1
- package/dist/components/Countdown.js +60 -59
- package/dist/components/Countdown.js.map +1 -1
- package/dist/components/DatePicker.d.ts +1 -1
- package/dist/components/DatePicker.js +54 -53
- package/dist/components/DatePicker.js.map +1 -1
- package/dist/components/Diff.js +10 -10
- package/dist/components/Diff.js.map +1 -1
- package/dist/components/Divider.js +21 -20
- package/dist/components/Divider.js.map +1 -1
- package/dist/components/Dock.js +28 -27
- package/dist/components/Dock.js.map +1 -1
- package/dist/components/Drawer.js +43 -43
- package/dist/components/Drawer.js.map +1 -1
- package/dist/components/Dropdown.js +127 -127
- package/dist/components/Dropdown.js.map +1 -1
- package/dist/components/Empty.js +16 -15
- package/dist/components/Empty.js.map +1 -1
- package/dist/components/Fieldset.js +11 -10
- package/dist/components/Fieldset.js.map +1 -1
- package/dist/components/FileInput.js +30 -29
- package/dist/components/FileInput.js.map +1 -1
- package/dist/components/Filter.d.ts +1 -1
- package/dist/components/Filter.js +32 -30
- package/dist/components/Filter.js.map +1 -1
- package/dist/components/FloatButton.js +83 -83
- package/dist/components/FloatButton.js.map +1 -1
- package/dist/components/Footer.js +14 -13
- package/dist/components/Footer.js.map +1 -1
- package/dist/components/Form.js +133 -132
- package/dist/components/Form.js.map +1 -1
- package/dist/components/Hero.js +12 -11
- package/dist/components/Hero.js.map +1 -1
- package/dist/components/HoverGallery.js +7 -7
- package/dist/components/HoverGallery.js.map +1 -1
- package/dist/components/Image.js +40 -40
- package/dist/components/Image.js.map +1 -1
- package/dist/components/Input.js +171 -169
- package/dist/components/Input.js.map +1 -1
- package/dist/components/InputNumber.js +84 -83
- package/dist/components/InputNumber.js.map +1 -1
- package/dist/components/Join.js +11 -10
- package/dist/components/Join.js.map +1 -1
- package/dist/components/Kbd.js +15 -15
- package/dist/components/Kbd.js.map +1 -1
- package/dist/components/Layout.js +66 -66
- package/dist/components/Layout.js.map +1 -1
- package/dist/components/List.d.ts +1 -1
- package/dist/components/List.js +75 -72
- package/dist/components/List.js.map +1 -1
- package/dist/components/Loading.d.ts +1 -1
- package/dist/components/Loading.js +31 -29
- package/dist/components/Loading.js.map +1 -1
- package/dist/components/Mask.js +31 -31
- package/dist/components/Mask.js.map +1 -1
- package/dist/components/Mention.js +61 -61
- package/dist/components/Mention.js.map +1 -1
- package/dist/components/Menu.js +84 -84
- package/dist/components/Menu.js.map +1 -1
- package/dist/components/Message.js +30 -29
- package/dist/components/Message.js.map +1 -1
- package/dist/components/Modal.js +117 -116
- package/dist/components/Modal.js.map +1 -1
- package/dist/components/MonthCalendar.d.ts +31 -0
- package/dist/components/MonthCalendar.js +205 -0
- package/dist/components/MonthCalendar.js.map +1 -0
- package/dist/components/Navbar.js +25 -25
- package/dist/components/Navbar.js.map +1 -1
- package/dist/components/Notification.js +56 -55
- package/dist/components/Notification.js.map +1 -1
- package/dist/components/OTPInput.js +69 -68
- package/dist/components/OTPInput.js.map +1 -1
- package/dist/components/Pagination.d.ts +1 -1
- package/dist/components/Pagination.js +60 -58
- package/dist/components/Pagination.js.map +1 -1
- package/dist/components/Phone.js +10 -10
- package/dist/components/Phone.js.map +1 -1
- package/dist/components/Popconfirm.js +60 -60
- package/dist/components/Popconfirm.js.map +1 -1
- package/dist/components/Progress.js +17 -17
- package/dist/components/Progress.js.map +1 -1
- package/dist/components/QRCode.js +23 -23
- package/dist/components/QRCode.js.map +1 -1
- package/dist/components/RadialProgress.js +17 -17
- package/dist/components/RadialProgress.js.map +1 -1
- package/dist/components/Radio.js +41 -40
- package/dist/components/Radio.js.map +1 -1
- package/dist/components/Range.d.ts +1 -1
- package/dist/components/Range.js +39 -37
- package/dist/components/Range.js.map +1 -1
- package/dist/components/Rating.js +79 -78
- package/dist/components/Rating.js.map +1 -1
- package/dist/components/ResponsiveDrawer.js +27 -27
- package/dist/components/ResponsiveDrawer.js.map +1 -1
- package/dist/components/RichTextEditor.d.ts +32 -0
- package/dist/components/RichTextEditor.js +335 -0
- package/dist/components/RichTextEditor.js.map +1 -0
- package/dist/components/Segmented.d.ts +1 -1
- package/dist/components/Segmented.js +48 -46
- package/dist/components/Segmented.js.map +1 -1
- package/dist/components/Select.js +55 -54
- package/dist/components/Select.js.map +1 -1
- package/dist/components/Skeleton.js +9 -9
- package/dist/components/Skeleton.js.map +1 -1
- package/dist/components/Splitter.js +93 -93
- package/dist/components/Splitter.js.map +1 -1
- package/dist/components/Stat.js +17 -16
- package/dist/components/Stat.js.map +1 -1
- package/dist/components/Status.js +29 -29
- package/dist/components/Status.js.map +1 -1
- package/dist/components/Steps.js +61 -61
- package/dist/components/Steps.js.map +1 -1
- package/dist/components/Table.js +256 -256
- package/dist/components/Table.js.map +1 -1
- package/dist/components/Tabs.js +65 -65
- package/dist/components/Tabs.js.map +1 -1
- package/dist/components/Tag.js +147 -147
- package/dist/components/Tag.js.map +1 -1
- package/dist/components/TextRotate.js +6 -6
- package/dist/components/TextRotate.js.map +1 -1
- package/dist/components/Textarea.js +35 -34
- package/dist/components/Textarea.js.map +1 -1
- package/dist/components/ThemeController.d.ts +1 -1
- package/dist/components/ThemeController.js +71 -68
- package/dist/components/ThemeController.js.map +1 -1
- package/dist/components/TimePicker.d.ts +1 -1
- package/dist/components/TimePicker.js +133 -129
- package/dist/components/TimePicker.js.map +1 -1
- package/dist/components/Timeline.js +79 -79
- package/dist/components/Timeline.js.map +1 -1
- package/dist/components/Toggle.js +33 -32
- package/dist/components/Toggle.js.map +1 -1
- package/dist/components/Tooltip.js +25 -25
- package/dist/components/Tooltip.js.map +1 -1
- package/dist/components/Tour.js +126 -126
- package/dist/components/Tour.js.map +1 -1
- package/dist/components/Transfer.js +93 -92
- package/dist/components/Transfer.js.map +1 -1
- package/dist/components/Tree.js +200 -200
- package/dist/components/Tree.js.map +1 -1
- package/dist/components/TreeSelect.js +255 -254
- package/dist/components/TreeSelect.js.map +1 -1
- package/dist/components/Typography.js +71 -70
- package/dist/components/Typography.js.map +1 -1
- package/dist/components/Upload.js +81 -81
- package/dist/components/Upload.js.map +1 -1
- package/dist/components/WeekCalendar.d.ts +35 -0
- package/dist/components/WeekCalendar.js +204 -0
- package/dist/components/WeekCalendar.js.map +1 -0
- package/dist/components/Window.js +7 -7
- package/dist/components/Window.js.map +1 -1
- package/dist/editor.d.ts +1 -0
- package/dist/editor.js +5 -0
- package/dist/editor.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +211 -207
- package/dist/index.js.map +1 -1
- package/package.json +30 -1
package/dist/components/Tour.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { createPortal as
|
|
4
|
-
const
|
|
1
|
+
import { jsx as s, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as qt, useState as K, useRef as M, useCallback as y, useImperativeHandle as Wt, useEffect as T } from "react";
|
|
3
|
+
import { createPortal as Ft } from "react-dom";
|
|
4
|
+
const D = "btn", O = "btn-ghost", V = "btn-sm", Ht = "btn-primary", Kt = "btn-xs", Mt = "btn-circle", it = (t) => t ? typeof t == "function" ? t() : t.current : null, Ot = (t, c, i, o, k) => {
|
|
5
5
|
if (!t || c === "center")
|
|
6
6
|
return {
|
|
7
7
|
top: window.innerHeight / 2 - i.height / 2,
|
|
8
8
|
left: window.innerWidth / 2 - i.width / 2
|
|
9
9
|
};
|
|
10
|
-
const a = window.scrollY, d = window.scrollX,
|
|
10
|
+
const a = window.scrollY, d = window.scrollX, q = typeof k == "object" && k.pointAtCenter;
|
|
11
11
|
return {
|
|
12
12
|
top: {
|
|
13
13
|
top: t.top + a - i.height - o,
|
|
@@ -62,7 +62,7 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
62
62
|
left: window.innerWidth / 2 - i.width / 2
|
|
63
63
|
}
|
|
64
64
|
}[c];
|
|
65
|
-
},
|
|
65
|
+
}, Vt = (t) => ({
|
|
66
66
|
top: { position: "bottom-0 left-1/2", transform: "translate(-50%, 50%) rotate(45deg)" },
|
|
67
67
|
topLeft: { position: "bottom-0 left-4", transform: "translate(0, 50%) rotate(45deg)" },
|
|
68
68
|
topRight: { position: "bottom-0 right-4", transform: "translate(0, 50%) rotate(45deg)" },
|
|
@@ -76,7 +76,7 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
76
76
|
rightTop: { position: "left-0 top-4", transform: "translate(-50%, 0) rotate(45deg)" },
|
|
77
77
|
rightBottom: { position: "left-0 bottom-4", transform: "translate(-50%, 0) rotate(45deg)" },
|
|
78
78
|
center: { position: "hidden", transform: "" }
|
|
79
|
-
})[t],
|
|
79
|
+
})[t], Xt = /* @__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" }) }), Gt = qt(
|
|
80
80
|
({
|
|
81
81
|
open: t = !1,
|
|
82
82
|
onClose: c,
|
|
@@ -85,180 +85,180 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
85
85
|
current: k,
|
|
86
86
|
onChange: a,
|
|
87
87
|
arrow: d = !0,
|
|
88
|
-
closeIcon:
|
|
89
|
-
mask:
|
|
90
|
-
disabledInteraction:
|
|
91
|
-
type:
|
|
92
|
-
gap:
|
|
93
|
-
prevButtonText:
|
|
94
|
-
nextButtonText:
|
|
95
|
-
finishButtonText:
|
|
96
|
-
skipButtonText:
|
|
97
|
-
showSkip:
|
|
98
|
-
showIndicators:
|
|
99
|
-
closeOnMaskClick:
|
|
100
|
-
closeOnEscape:
|
|
101
|
-
scrollIntoViewOptions:
|
|
102
|
-
zIndex:
|
|
103
|
-
indicatorsRender:
|
|
104
|
-
actionsRender:
|
|
105
|
-
getPopupContainer:
|
|
88
|
+
closeIcon: q,
|
|
89
|
+
mask: X = !0,
|
|
90
|
+
disabledInteraction: G = !1,
|
|
91
|
+
type: st = "default",
|
|
92
|
+
gap: I = { offset: 6, radius: 2 },
|
|
93
|
+
prevButtonText: lt = "Previous",
|
|
94
|
+
nextButtonText: at = "Next",
|
|
95
|
+
finishButtonText: dt = "Finish",
|
|
96
|
+
skipButtonText: ct = "Skip",
|
|
97
|
+
showSkip: ft = !0,
|
|
98
|
+
showIndicators: ht = !0,
|
|
99
|
+
closeOnMaskClick: U = !0,
|
|
100
|
+
closeOnEscape: Y = !0,
|
|
101
|
+
scrollIntoViewOptions: ut = !0,
|
|
102
|
+
zIndex: L = 1001,
|
|
103
|
+
indicatorsRender: z,
|
|
104
|
+
actionsRender: _,
|
|
105
|
+
getPopupContainer: J,
|
|
106
106
|
classNames: m = {},
|
|
107
107
|
styles: b = {},
|
|
108
|
-
className:
|
|
109
|
-
style:
|
|
110
|
-
"data-testid":
|
|
111
|
-
...
|
|
112
|
-
},
|
|
113
|
-
const [
|
|
108
|
+
className: mt,
|
|
109
|
+
style: bt,
|
|
110
|
+
"data-testid": pt,
|
|
111
|
+
...wt
|
|
112
|
+
}, gt) => {
|
|
113
|
+
const [vt, Q] = K(0), [u, yt] = K(null), [Z, kt] = K({ top: 0, left: 0 }), w = M(null), $t = M(null), $ = M(null), A = pt ?? "tour", f = (n) => `${A}-${n}`, B = k !== void 0, l = B ? k : vt, e = o[l], W = I.offset ?? 6, h = I.radius ?? 2, R = Array.isArray(W) ? W[0] : W, F = e?.arrow ?? d, g = e?.mask ?? X, Bt = e?.type ?? st, S = e?.scrollIntoViewOptions ?? ut, tt = e?.closeIcon ?? q, xt = F !== !1 && e?.placement !== "center", Pt = typeof g == "object" && g.color ? g.color : "rgba(0, 0, 0, 0.5)", Ct = typeof g == "object" && g.style ? g.style : {}, x = y(() => {
|
|
114
114
|
if (!e) return;
|
|
115
|
-
const r =
|
|
116
|
-
if (
|
|
117
|
-
const
|
|
115
|
+
const r = it(e.target)?.getBoundingClientRect() ?? null;
|
|
116
|
+
if (yt(r), w.current) {
|
|
117
|
+
const N = w.current.getBoundingClientRect(), E = e.placement ?? "bottom", j = Ot(
|
|
118
118
|
r,
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
119
|
+
E,
|
|
120
|
+
N,
|
|
121
|
+
R + h,
|
|
122
|
+
F
|
|
123
123
|
);
|
|
124
|
-
|
|
124
|
+
kt(j);
|
|
125
125
|
}
|
|
126
|
-
}, [e,
|
|
126
|
+
}, [e, R, h, F]), v = y(
|
|
127
127
|
(n) => {
|
|
128
|
-
n < 0 || n >= o.length || (o[
|
|
128
|
+
n < 0 || n >= o.length || (o[l]?.onClose?.(), B || Q(n), a?.(n), $.current && ($.current.textContent = `Step ${n + 1} of ${o.length}: ${typeof o[n]?.title == "string" ? o[n]?.title : ""}`));
|
|
129
129
|
},
|
|
130
|
-
[o,
|
|
131
|
-
),
|
|
130
|
+
[o, l, B, a]
|
|
131
|
+
), H = y(() => {
|
|
132
132
|
c?.();
|
|
133
133
|
}, [c]), P = y(() => {
|
|
134
|
-
e?.prevButtonProps?.onClick?.(), v(
|
|
135
|
-
}, [
|
|
136
|
-
e?.nextButtonProps?.onClick?.(),
|
|
137
|
-
}, [
|
|
134
|
+
e?.prevButtonProps?.onClick?.(), v(l - 1);
|
|
135
|
+
}, [l, v, e]), C = y(() => {
|
|
136
|
+
e?.nextButtonProps?.onClick?.(), l === o.length - 1 ? (i?.(), c?.()) : v(l + 1);
|
|
137
|
+
}, [l, o.length, v, i, c, e]), Nt = y(() => {
|
|
138
138
|
c?.();
|
|
139
|
-
}, [c]),
|
|
140
|
-
|
|
141
|
-
}, [
|
|
142
|
-
if (
|
|
143
|
-
|
|
139
|
+
}, [c]), Tt = y(() => {
|
|
140
|
+
U && c?.();
|
|
141
|
+
}, [U, c]);
|
|
142
|
+
if (Wt(
|
|
143
|
+
gt,
|
|
144
144
|
() => ({
|
|
145
145
|
goTo: v,
|
|
146
|
-
next:
|
|
146
|
+
next: C,
|
|
147
147
|
prev: P,
|
|
148
|
-
close:
|
|
148
|
+
close: H
|
|
149
149
|
}),
|
|
150
|
-
[v,
|
|
151
|
-
),
|
|
152
|
-
t && !
|
|
153
|
-
}, [t,
|
|
150
|
+
[v, C, P, H]
|
|
151
|
+
), T(() => {
|
|
152
|
+
t && !B && Q(0);
|
|
153
|
+
}, [t, B]), T(() => {
|
|
154
154
|
if (t) {
|
|
155
|
-
if (
|
|
156
|
-
const n =
|
|
155
|
+
if (x(), S && e?.target) {
|
|
156
|
+
const n = it(e.target);
|
|
157
157
|
if (n) {
|
|
158
|
-
const r = typeof
|
|
158
|
+
const r = typeof S == "object" ? S : { behavior: "smooth", block: "center" };
|
|
159
159
|
n.scrollIntoView(r);
|
|
160
160
|
}
|
|
161
161
|
}
|
|
162
|
-
|
|
162
|
+
l === 0 && $.current && ($.current.textContent = `Tour started. Step 1 of ${o.length}: ${typeof e?.title == "string" ? e?.title : ""}`);
|
|
163
163
|
}
|
|
164
|
-
}, [t,
|
|
164
|
+
}, [t, l, e, S, x, o.length]), T(() => {
|
|
165
165
|
if (!t) return;
|
|
166
|
-
const n = () =>
|
|
167
|
-
return window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), requestAnimationFrame(
|
|
166
|
+
const n = () => x();
|
|
167
|
+
return window.addEventListener("resize", n), window.addEventListener("scroll", n, !0), requestAnimationFrame(x), () => {
|
|
168
168
|
window.removeEventListener("resize", n), window.removeEventListener("scroll", n, !0);
|
|
169
169
|
};
|
|
170
|
-
}, [t,
|
|
170
|
+
}, [t, x]), T(() => {
|
|
171
171
|
if (!t) return;
|
|
172
172
|
const n = (r) => {
|
|
173
|
-
if (r.key === "Escape" &&
|
|
173
|
+
if (r.key === "Escape" && Y)
|
|
174
174
|
c?.();
|
|
175
175
|
else if (r.key === "ArrowRight" || r.key === "ArrowDown")
|
|
176
|
-
r.preventDefault(),
|
|
176
|
+
r.preventDefault(), C();
|
|
177
177
|
else if (r.key === "ArrowLeft" || r.key === "ArrowUp")
|
|
178
178
|
r.preventDefault(), P();
|
|
179
179
|
else if (r.key === "Tab" && w.current) {
|
|
180
|
-
const
|
|
180
|
+
const N = w.current.querySelectorAll(
|
|
181
181
|
'button, [href], input, select, textarea, [tabindex]:not([tabindex="-1"])'
|
|
182
|
-
),
|
|
183
|
-
r.shiftKey && document.activeElement ===
|
|
182
|
+
), E = N[0], j = N[N.length - 1];
|
|
183
|
+
r.shiftKey && document.activeElement === E ? (r.preventDefault(), j?.focus()) : !r.shiftKey && document.activeElement === j && (r.preventDefault(), E?.focus());
|
|
184
184
|
}
|
|
185
185
|
};
|
|
186
186
|
return document.addEventListener("keydown", n), () => document.removeEventListener("keydown", n);
|
|
187
|
-
}, [t,
|
|
187
|
+
}, [t, Y, c, C, P]), T(() => {
|
|
188
188
|
t && w.current && requestAnimationFrame(() => {
|
|
189
189
|
w.current?.querySelector("button")?.focus();
|
|
190
190
|
});
|
|
191
|
-
}, [t,
|
|
192
|
-
const
|
|
191
|
+
}, [t, l]), !t || !e) return null;
|
|
192
|
+
const Lt = l === 0, ot = l === o.length - 1, et = e.placement ?? "bottom", nt = Vt(et), At = ht && o.length > 1 ? /* @__PURE__ */ s(
|
|
193
193
|
"div",
|
|
194
194
|
{
|
|
195
195
|
className: `flex gap-1 mb-4 ${m.indicator ?? ""}`,
|
|
196
196
|
style: b.indicator,
|
|
197
197
|
"data-testid": f("indicators"),
|
|
198
|
-
children: o.map((n, r) => /* @__PURE__ */
|
|
198
|
+
children: o.map((n, r) => /* @__PURE__ */ s(
|
|
199
199
|
"button",
|
|
200
200
|
{
|
|
201
|
-
className: `w-2 h-2 rounded-full transition-colors ${r ===
|
|
201
|
+
className: `w-2 h-2 rounded-full transition-colors ${r === l ? "bg-primary" : "bg-base-300 hover:bg-base-content/30"}`,
|
|
202
202
|
onClick: () => v(r),
|
|
203
203
|
"aria-label": `Go to step ${r + 1}`,
|
|
204
|
-
"aria-current": r ===
|
|
204
|
+
"aria-current": r === l ? "step" : void 0,
|
|
205
205
|
"data-testid": f(`indicator-${r}`)
|
|
206
206
|
},
|
|
207
207
|
r
|
|
208
208
|
))
|
|
209
209
|
}
|
|
210
|
-
) : null,
|
|
210
|
+
) : null, St = z ? z(l, o.length) : At, rt = /* @__PURE__ */ p(
|
|
211
211
|
"div",
|
|
212
212
|
{
|
|
213
213
|
className: `flex items-center justify-between gap-2 ${m.footer ?? ""}`,
|
|
214
214
|
style: b.footer,
|
|
215
215
|
"data-testid": f("footer"),
|
|
216
216
|
children: [
|
|
217
|
-
/* @__PURE__ */
|
|
217
|
+
/* @__PURE__ */ s("div", { children: ft && !ot && /* @__PURE__ */ s(
|
|
218
218
|
"button",
|
|
219
219
|
{
|
|
220
|
-
className:
|
|
220
|
+
className: `${D} ${O} ${V}`,
|
|
221
221
|
onClick: Nt,
|
|
222
222
|
"data-testid": f("skip"),
|
|
223
|
-
children:
|
|
223
|
+
children: ct
|
|
224
224
|
}
|
|
225
225
|
) }),
|
|
226
226
|
/* @__PURE__ */ p("div", { className: "flex gap-2", children: [
|
|
227
|
-
!
|
|
227
|
+
!Lt && /* @__PURE__ */ s(
|
|
228
228
|
"button",
|
|
229
229
|
{
|
|
230
|
-
className:
|
|
230
|
+
className: `${D} ${O} ${V}`,
|
|
231
231
|
onClick: P,
|
|
232
232
|
"data-testid": f("prev"),
|
|
233
|
-
children: e.prevButtonProps?.children ??
|
|
233
|
+
children: e.prevButtonProps?.children ?? lt
|
|
234
234
|
}
|
|
235
235
|
),
|
|
236
|
-
/* @__PURE__ */
|
|
236
|
+
/* @__PURE__ */ s(
|
|
237
237
|
"button",
|
|
238
238
|
{
|
|
239
|
-
className:
|
|
240
|
-
onClick:
|
|
239
|
+
className: `${D} ${V} ${Bt === "primary" ? Ht : ""}`,
|
|
240
|
+
onClick: C,
|
|
241
241
|
"data-testid": f("next"),
|
|
242
|
-
children: e.nextButtonProps?.children ?? (
|
|
242
|
+
children: e.nextButtonProps?.children ?? (ot ? dt : at)
|
|
243
243
|
}
|
|
244
244
|
)
|
|
245
245
|
] })
|
|
246
246
|
]
|
|
247
247
|
}
|
|
248
|
-
),
|
|
248
|
+
), Et = _ ? _(rt, { current: l, total: o.length }) : rt, jt = /* @__PURE__ */ p(
|
|
249
249
|
"div",
|
|
250
250
|
{
|
|
251
|
-
ref:
|
|
252
|
-
className: `fixed inset-0 ${m.root ?? ""} ${
|
|
253
|
-
style: { zIndex:
|
|
254
|
-
"data-testid":
|
|
251
|
+
ref: $t,
|
|
252
|
+
className: `fixed inset-0 ${m.root ?? ""} ${mt ?? ""}`,
|
|
253
|
+
style: { zIndex: L, ...b.root, ...bt },
|
|
254
|
+
"data-testid": A,
|
|
255
255
|
"data-state": t ? "open" : "closed",
|
|
256
256
|
role: "dialog",
|
|
257
257
|
"aria-modal": "true",
|
|
258
|
-
"aria-label": `Tour step ${
|
|
259
|
-
...
|
|
258
|
+
"aria-label": `Tour step ${l + 1} of ${o.length}`,
|
|
259
|
+
...wt,
|
|
260
260
|
children: [
|
|
261
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ s(
|
|
262
262
|
"div",
|
|
263
263
|
{
|
|
264
264
|
ref: $,
|
|
@@ -272,14 +272,14 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
272
272
|
"svg",
|
|
273
273
|
{
|
|
274
274
|
className: `absolute inset-0 w-full h-full pointer-events-auto ${m.mask ?? ""}`,
|
|
275
|
-
style: { zIndex:
|
|
276
|
-
onClick:
|
|
275
|
+
style: { zIndex: L, ...Ct, ...b.mask },
|
|
276
|
+
onClick: Tt,
|
|
277
277
|
"data-testid": f("mask"),
|
|
278
278
|
"aria-hidden": "true",
|
|
279
279
|
children: [
|
|
280
|
-
/* @__PURE__ */
|
|
281
|
-
/* @__PURE__ */
|
|
282
|
-
u && /* @__PURE__ */
|
|
280
|
+
/* @__PURE__ */ s("defs", { children: /* @__PURE__ */ p("mask", { id: `tour-mask-${A}`, children: [
|
|
281
|
+
/* @__PURE__ */ s("rect", { x: "0", y: "0", width: "100%", height: "100%", fill: "white" }),
|
|
282
|
+
u && /* @__PURE__ */ s(
|
|
283
283
|
"rect",
|
|
284
284
|
{
|
|
285
285
|
x: u.left - h,
|
|
@@ -291,21 +291,21 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
291
291
|
}
|
|
292
292
|
)
|
|
293
293
|
] }) }),
|
|
294
|
-
/* @__PURE__ */
|
|
294
|
+
/* @__PURE__ */ s(
|
|
295
295
|
"rect",
|
|
296
296
|
{
|
|
297
297
|
x: "0",
|
|
298
298
|
y: "0",
|
|
299
299
|
width: "100%",
|
|
300
300
|
height: "100%",
|
|
301
|
-
fill:
|
|
302
|
-
mask: `url(#tour-mask-${
|
|
301
|
+
fill: Pt,
|
|
302
|
+
mask: `url(#tour-mask-${A})`
|
|
303
303
|
}
|
|
304
304
|
)
|
|
305
305
|
]
|
|
306
306
|
}
|
|
307
307
|
),
|
|
308
|
-
|
|
308
|
+
G && u && /* @__PURE__ */ s(
|
|
309
309
|
"div",
|
|
310
310
|
{
|
|
311
311
|
className: "absolute pointer-events-auto",
|
|
@@ -314,7 +314,7 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
314
314
|
top: u.top - h,
|
|
315
315
|
width: u.width + h * 2,
|
|
316
316
|
height: u.height + h * 2,
|
|
317
|
-
zIndex:
|
|
317
|
+
zIndex: L + 1
|
|
318
318
|
},
|
|
319
319
|
"data-testid": f("blocker")
|
|
320
320
|
}
|
|
@@ -325,22 +325,22 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
325
325
|
ref: w,
|
|
326
326
|
className: `absolute bg-base-100 rounded-lg shadow-xl border border-base-300 max-w-sm ${m.popover ?? ""} ${e.className ?? ""}`,
|
|
327
327
|
style: {
|
|
328
|
-
top:
|
|
329
|
-
left:
|
|
330
|
-
zIndex:
|
|
328
|
+
top: Z.top,
|
|
329
|
+
left: Z.left,
|
|
330
|
+
zIndex: L + 2,
|
|
331
331
|
...b.popover,
|
|
332
332
|
...e.style
|
|
333
333
|
},
|
|
334
334
|
onClick: (n) => n.stopPropagation(),
|
|
335
335
|
"data-testid": f("popover"),
|
|
336
|
-
"data-placement":
|
|
336
|
+
"data-placement": et,
|
|
337
337
|
children: [
|
|
338
|
-
|
|
338
|
+
xt && /* @__PURE__ */ s(
|
|
339
339
|
"div",
|
|
340
340
|
{
|
|
341
|
-
className: `absolute w-3 h-3 bg-base-100 border-base-300 ${
|
|
341
|
+
className: `absolute w-3 h-3 bg-base-100 border-base-300 ${nt.position}`,
|
|
342
342
|
style: {
|
|
343
|
-
transform:
|
|
343
|
+
transform: nt.transform,
|
|
344
344
|
borderWidth: "1px",
|
|
345
345
|
borderTopColor: "transparent",
|
|
346
346
|
borderLeftColor: "transparent"
|
|
@@ -348,18 +348,18 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
348
348
|
"data-testid": f("arrow")
|
|
349
349
|
}
|
|
350
350
|
),
|
|
351
|
-
|
|
351
|
+
tt !== !1 && /* @__PURE__ */ s(
|
|
352
352
|
"button",
|
|
353
353
|
{
|
|
354
|
-
className: `absolute top-2 right-2
|
|
354
|
+
className: `absolute top-2 right-2 ${D} ${O} ${Kt} ${Mt} ${m.close ?? ""}`,
|
|
355
355
|
style: b.close,
|
|
356
|
-
onClick:
|
|
356
|
+
onClick: H,
|
|
357
357
|
"aria-label": "Close tour",
|
|
358
358
|
"data-testid": f("close"),
|
|
359
|
-
children:
|
|
359
|
+
children: tt ?? Xt
|
|
360
360
|
}
|
|
361
361
|
),
|
|
362
|
-
e.cover && /* @__PURE__ */
|
|
362
|
+
e.cover && /* @__PURE__ */ s("div", { className: "rounded-t-lg overflow-hidden", "data-testid": f("cover"), children: e.cover }),
|
|
363
363
|
/* @__PURE__ */ p(
|
|
364
364
|
"div",
|
|
365
365
|
{
|
|
@@ -374,13 +374,13 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
374
374
|
style: b.header,
|
|
375
375
|
"data-testid": f("header"),
|
|
376
376
|
children: [
|
|
377
|
-
/* @__PURE__ */
|
|
378
|
-
e.description && /* @__PURE__ */
|
|
377
|
+
/* @__PURE__ */ s("h3", { className: "font-semibold text-lg mb-1 pr-6", children: e.title }),
|
|
378
|
+
e.description && /* @__PURE__ */ s("p", { className: "text-base-content/70 text-sm mb-4", children: e.description })
|
|
379
379
|
]
|
|
380
380
|
}
|
|
381
381
|
),
|
|
382
|
-
|
|
383
|
-
|
|
382
|
+
St,
|
|
383
|
+
Et
|
|
384
384
|
]
|
|
385
385
|
}
|
|
386
386
|
)
|
|
@@ -389,12 +389,12 @@ const et = (t) => t ? typeof t == "function" ? t() : t.current : null, qt = (t,
|
|
|
389
389
|
)
|
|
390
390
|
]
|
|
391
391
|
}
|
|
392
|
-
),
|
|
393
|
-
return
|
|
392
|
+
), Dt = J ? J(document.body) : document.body;
|
|
393
|
+
return Ft(jt, Dt);
|
|
394
394
|
}
|
|
395
395
|
);
|
|
396
|
-
|
|
396
|
+
Gt.displayName = "Tour";
|
|
397
397
|
export {
|
|
398
|
-
|
|
398
|
+
Gt as Tour
|
|
399
399
|
};
|
|
400
400
|
//# sourceMappingURL=Tour.js.map
|