@mortenbrudvik/waveui 0.14.1 → 0.15.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +142 -32
- package/dist/components/data-display/InfoButton.cjs +1 -1
- package/dist/components/data-display/InfoButton.cjs.map +1 -1
- package/dist/components/data-display/InfoButton.mjs +90 -82
- package/dist/components/data-display/InfoButton.mjs.map +1 -1
- package/dist/components/data-display/InfoLabel.cjs +1 -1
- package/dist/components/data-display/InfoLabel.cjs.map +1 -1
- package/dist/components/data-display/InfoLabel.mjs +19 -18
- package/dist/components/data-display/InfoLabel.mjs.map +1 -1
- package/dist/components/feedback/MessageBarGroup.cjs +2 -0
- package/dist/components/feedback/MessageBarGroup.cjs.map +1 -0
- package/dist/components/feedback/MessageBarGroup.mjs +63 -0
- package/dist/components/feedback/MessageBarGroup.mjs.map +1 -0
- package/dist/components/feedback/ProgressBar.cjs +1 -1
- package/dist/components/feedback/ProgressBar.cjs.map +1 -1
- package/dist/components/feedback/ProgressBar.mjs +41 -39
- package/dist/components/feedback/ProgressBar.mjs.map +1 -1
- package/dist/components/feedback/Toaster.cjs +1 -1
- package/dist/components/feedback/Toaster.cjs.map +1 -1
- package/dist/components/feedback/Toaster.mjs +222 -216
- package/dist/components/feedback/Toaster.mjs.map +1 -1
- package/dist/components/layout/Accordion.cjs +1 -1
- package/dist/components/layout/Accordion.cjs.map +1 -1
- package/dist/components/layout/Accordion.mjs +124 -109
- package/dist/components/layout/Accordion.mjs.map +1 -1
- package/dist/components/layout/Carousel.cjs +1 -1
- package/dist/components/layout/Carousel.cjs.map +1 -1
- package/dist/components/layout/Carousel.mjs +207 -193
- package/dist/components/layout/Carousel.mjs.map +1 -1
- package/dist/components/layout/TabList.cjs +1 -1
- package/dist/components/layout/TabList.cjs.map +1 -1
- package/dist/components/layout/TabList.mjs +149 -108
- package/dist/components/layout/TabList.mjs.map +1 -1
- package/dist/components/layout/Tree.cjs.map +1 -1
- package/dist/components/layout/Tree.context.cjs +1 -1
- package/dist/components/layout/Tree.context.cjs.map +1 -1
- package/dist/components/layout/Tree.context.mjs +2 -1
- package/dist/components/layout/Tree.context.mjs.map +1 -1
- package/dist/components/layout/Tree.core.cjs +1 -1
- package/dist/components/layout/Tree.core.cjs.map +1 -1
- package/dist/components/layout/Tree.core.mjs +178 -165
- package/dist/components/layout/Tree.core.mjs.map +1 -1
- package/dist/components/layout/Tree.mjs.map +1 -1
- package/dist/components/navigation/Menu.popover.cjs +1 -1
- package/dist/components/navigation/Menu.popover.cjs.map +1 -1
- package/dist/components/navigation/Menu.popover.mjs +154 -168
- package/dist/components/navigation/Menu.popover.mjs.map +1 -1
- package/dist/components/navigation/Nav.cjs +1 -1
- package/dist/components/navigation/Nav.cjs.map +1 -1
- package/dist/components/navigation/Nav.mjs +156 -136
- package/dist/components/navigation/Nav.mjs.map +1 -1
- package/dist/components/navigation/NavDrawer.cjs +1 -1
- package/dist/components/navigation/NavDrawer.cjs.map +1 -1
- package/dist/components/navigation/NavDrawer.mjs +48 -45
- package/dist/components/navigation/NavDrawer.mjs.map +1 -1
- package/dist/components/overlays/Dialog.cjs +1 -1
- package/dist/components/overlays/Dialog.cjs.map +1 -1
- package/dist/components/overlays/Dialog.mjs +128 -122
- package/dist/components/overlays/Dialog.mjs.map +1 -1
- package/dist/components/overlays/Dialog.slots.cjs +1 -1
- package/dist/components/overlays/Dialog.slots.cjs.map +1 -1
- package/dist/components/overlays/Dialog.slots.mjs +12 -12
- package/dist/components/overlays/Dialog.slots.mjs.map +1 -1
- package/dist/components/overlays/Drawer.cjs.map +1 -1
- package/dist/components/overlays/Drawer.mjs.map +1 -1
- package/dist/components/overlays/Drawer.panel.cjs +1 -1
- package/dist/components/overlays/Drawer.panel.cjs.map +1 -1
- package/dist/components/overlays/Drawer.panel.mjs +97 -81
- package/dist/components/overlays/Drawer.panel.mjs.map +1 -1
- package/dist/components/overlays/Drawer.root.cjs +1 -1
- package/dist/components/overlays/Drawer.root.cjs.map +1 -1
- package/dist/components/overlays/Drawer.root.mjs +34 -31
- package/dist/components/overlays/Drawer.root.mjs.map +1 -1
- package/dist/components/overlays/Popover.cjs +1 -1
- package/dist/components/overlays/Popover.cjs.map +1 -1
- package/dist/components/overlays/Popover.mjs +231 -216
- package/dist/components/overlays/Popover.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.parts.cjs +1 -1
- package/dist/components/overlays/TeachingPopover.parts.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.parts.mjs +199 -177
- package/dist/components/overlays/TeachingPopover.parts.mjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.root.cjs +1 -1
- package/dist/components/overlays/TeachingPopover.root.cjs.map +1 -1
- package/dist/components/overlays/TeachingPopover.root.mjs +93 -92
- package/dist/components/overlays/TeachingPopover.root.mjs.map +1 -1
- package/dist/components/overlays/Tooltip.cjs +1 -1
- package/dist/components/overlays/Tooltip.cjs.map +1 -1
- package/dist/components/overlays/Tooltip.mjs +66 -61
- package/dist/components/overlays/Tooltip.mjs.map +1 -1
- package/dist/components/provider/WaveProvider.cjs +1 -1
- package/dist/components/provider/WaveProvider.cjs.map +1 -1
- package/dist/components/provider/WaveProvider.mjs +26 -23
- package/dist/components/provider/WaveProvider.mjs.map +1 -1
- package/dist/hooks/useCollapsePresence.cjs +2 -0
- package/dist/hooks/useCollapsePresence.cjs.map +1 -0
- package/dist/hooks/useCollapsePresence.mjs +21 -0
- package/dist/hooks/useCollapsePresence.mjs.map +1 -0
- package/dist/hooks/useFocusBeforeClose.cjs +2 -0
- package/dist/hooks/useFocusBeforeClose.cjs.map +1 -0
- package/dist/hooks/useFocusBeforeClose.mjs +33 -0
- package/dist/hooks/useFocusBeforeClose.mjs.map +1 -0
- package/dist/hooks/useMotion.cjs +2 -0
- package/dist/hooks/useMotion.cjs.map +1 -0
- package/dist/hooks/useMotion.mjs +14 -0
- package/dist/hooks/useMotion.mjs.map +1 -0
- package/dist/hooks/usePresenceGroup.cjs +2 -0
- package/dist/hooks/usePresenceGroup.cjs.map +1 -0
- package/dist/hooks/usePresenceGroup.mjs +68 -0
- package/dist/hooks/usePresenceGroup.mjs.map +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +707 -126
- package/dist/index.d.ts +707 -126
- package/dist/index.mjs +136 -135
- package/dist/lib/classNames.cjs +1 -1
- package/dist/lib/classNames.cjs.map +1 -1
- package/dist/lib/classNames.mjs +101 -90
- package/dist/lib/classNames.mjs.map +1 -1
- package/dist/lib/motion.cjs +2 -0
- package/dist/lib/motion.cjs.map +1 -0
- package/dist/lib/motion.mjs +43 -0
- package/dist/lib/motion.mjs.map +1 -0
- package/dist/styles.css +1 -1
- package/package.json +2 -1
|
@@ -8,165 +8,187 @@ import { useMergedRefs as _ } from "../../hooks/useMergedRefs.mjs";
|
|
|
8
8
|
import { useIsClient as v } from "../../hooks/useIsClient.mjs";
|
|
9
9
|
import { focusableDisabledProps as y, preventIfDisabled as b } from "../../lib/aria.mjs";
|
|
10
10
|
import { useAnnounce as x } from "../../hooks/useAnnounce.mjs";
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import
|
|
24
|
-
import {
|
|
11
|
+
import { usePresence as ee } from "../../hooks/usePresence.mjs";
|
|
12
|
+
import { resolvePositioning as te, usePopupPosition as ne } from "../../hooks/usePopupPosition.mjs";
|
|
13
|
+
import { useDismiss as re } from "../../hooks/useDismiss.mjs";
|
|
14
|
+
import { useRestoreFocus as ie } from "../../hooks/useRestoreFocus.mjs";
|
|
15
|
+
import { focusRing as ae, forcedColors as S } from "../../lib/styles.mjs";
|
|
16
|
+
import { Portal as oe } from "../portal/Portal.mjs";
|
|
17
|
+
import { Button as C } from "../button/Button.mjs";
|
|
18
|
+
import { popupMotion as se } from "../../lib/motion.mjs";
|
|
19
|
+
import { useFocusBeforeClose as ce } from "../../hooks/useFocusBeforeClose.mjs";
|
|
20
|
+
import { useMotionClasses as le } from "../../hooks/useMotion.mjs";
|
|
21
|
+
import { PopoverBeak as ue, getTabbableThrough as de, usePopoverTabOrder as fe } from "./Popover.shared.mjs";
|
|
22
|
+
import { useTriggerElement as pe, useTriggerFocusRef as me } from "../../hooks/useTriggerElement.mjs";
|
|
23
|
+
import { useTitleRegistry as he } from "./Dialog.shared.mjs";
|
|
24
|
+
import { ModalCloseButton as ge } from "./Dialog.slots.mjs";
|
|
25
|
+
import { useCarouselFooterStacked as _e } from "./TeachingPopover.stack.mjs";
|
|
26
|
+
import { TeachingPopoverContext as ve, TeachingPopoverSurfaceContext as ye, useTeachingPopoverContext as w } from "./TeachingPopover.context.mjs";
|
|
27
|
+
import * as T from "react";
|
|
28
|
+
import { Fragment as E, jsx as D, jsxs as O } from "react/jsx-runtime";
|
|
25
29
|
//#region src/components/overlays/TeachingPopover.parts.tsx
|
|
26
|
-
function
|
|
30
|
+
function k(e) {
|
|
27
31
|
return "current" in e;
|
|
28
32
|
}
|
|
29
|
-
function
|
|
30
|
-
return e != null && !
|
|
33
|
+
function be(e) {
|
|
34
|
+
return e != null && !k(e) && typeof e.nodeType == "number";
|
|
31
35
|
}
|
|
32
|
-
function
|
|
33
|
-
return e != null && !
|
|
36
|
+
function A(e) {
|
|
37
|
+
return e != null && !k(e) && !be(e);
|
|
34
38
|
}
|
|
35
|
-
function
|
|
36
|
-
return !e ||
|
|
39
|
+
function xe(e) {
|
|
40
|
+
return !e || A(e) ? null : k(e) ? e.current : e;
|
|
37
41
|
}
|
|
38
|
-
var
|
|
39
|
-
function
|
|
42
|
+
var Se = (e) => t(e, C, "button", "a");
|
|
43
|
+
function j(n, r, a, s) {
|
|
40
44
|
let c = (e) => {
|
|
41
45
|
e.defaultPrevented || s();
|
|
42
46
|
};
|
|
43
|
-
if (
|
|
44
|
-
let { className: i, onClick: s, appearance: l } = n.props, u = t(n,
|
|
45
|
-
return
|
|
47
|
+
if (Se(n)) {
|
|
48
|
+
let { className: i, onClick: s, appearance: l } = n.props, u = t(n, C);
|
|
49
|
+
return T.cloneElement(n, {
|
|
46
50
|
className: e(a, i),
|
|
47
51
|
onClick: o(s, c),
|
|
48
52
|
...u ? { appearance: l ?? r } : void 0
|
|
49
53
|
});
|
|
50
54
|
}
|
|
51
|
-
let l = i(n,
|
|
55
|
+
let l = i(n, C, a);
|
|
52
56
|
if (!l) return null;
|
|
53
57
|
let { onClick: u, ...d } = l.props;
|
|
54
|
-
return
|
|
58
|
+
return T.createElement(C, {
|
|
55
59
|
appearance: r,
|
|
56
60
|
...d,
|
|
57
|
-
...l.Component ===
|
|
61
|
+
...l.Component === C ? void 0 : { as: l.Component },
|
|
58
62
|
onClick: o(u, c)
|
|
59
63
|
}, l.children);
|
|
60
64
|
}
|
|
61
|
-
var
|
|
62
|
-
let { target:
|
|
63
|
-
|
|
64
|
-
let
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
65
|
+
var M = ({ context: t, rootClassName: n, id: r, className: i, style: s, onKeyDown: c, motion: l, children: u, ref: d, ...p }) => {
|
|
66
|
+
let { target: m, side: h, align: g, positioning: v, shown: y, index: b, step: S, stepPosition: C, titleId: pe, dismiss: ge, hasTrigger: _e, triggerRef: w, surfaceId: Se } = t, j = x(), M = he(), N = S?.title, P = m !== void 0, [z, B] = T.useState(t);
|
|
67
|
+
y && t !== z && B(t);
|
|
68
|
+
let V = y ? t : z, { isMounted: H, ref: U, presenceProps: Ce } = ee(y, { appear: !0 }), W = le(l, se), [G, we] = T.useState(null), Te = (e) => be(e) || A(e), [K, Ee] = T.useState(() => Te(m)), q = m === null ? !1 : Te(m) ? !0 : void 0;
|
|
69
|
+
q !== void 0 && q !== K && Ee(q);
|
|
70
|
+
let J = T.useRef(null), Y = T.useRef(null), De = T.useRef(m), X = T.useRef(K), Oe = T.useRef(null), { setReference: ke, setFloating: Ae, floatingProps: je, arrowStyles: Me, side: Ne, isPositioned: Pe } = ne({
|
|
71
|
+
open: y && P,
|
|
72
|
+
side: h,
|
|
73
|
+
align: g,
|
|
74
|
+
arrowRef: Oe,
|
|
75
|
+
...te(v, { offset: 12 })
|
|
76
|
+
}), Fe = m != null && (!k(m) || K), Z = !P || Fe && Pe, Q = y && Z, [Ie, Le] = T.useState(Z);
|
|
77
|
+
y && Z !== Ie && Le(Z);
|
|
78
|
+
let Re = y ? Z : Ie, ze = _(d, J, we, Ae, U);
|
|
79
|
+
T.useLayoutEffect(() => {
|
|
80
|
+
De.current = m, X.current = K;
|
|
81
|
+
let e = xe(m);
|
|
82
|
+
Y.current = e, ke(A(m) ? m : e), m != null && k(m) && queueMicrotask(() => {
|
|
83
|
+
let e = xe(De.current);
|
|
84
|
+
e !== Y.current && (Y.current = e, ke(e));
|
|
77
85
|
let t = e !== null;
|
|
78
|
-
t !== X.current && (X.current = t,
|
|
86
|
+
t !== X.current && (X.current = t, Ee(t));
|
|
79
87
|
});
|
|
80
88
|
});
|
|
81
|
-
let { layerId:
|
|
89
|
+
let { layerId: Be } = re({
|
|
82
90
|
open: Q,
|
|
83
|
-
onDismiss:
|
|
91
|
+
onDismiss: ge,
|
|
84
92
|
refs: [J],
|
|
85
93
|
anchorRef: Y,
|
|
86
94
|
kind: "popover",
|
|
87
95
|
outsidePress: !1
|
|
88
|
-
}),
|
|
89
|
-
|
|
96
|
+
}), Ve = me(w);
|
|
97
|
+
ie({
|
|
90
98
|
enabled: Q,
|
|
91
|
-
container:
|
|
92
|
-
triggerRef:
|
|
99
|
+
container: G,
|
|
100
|
+
triggerRef: Ve,
|
|
93
101
|
fallback: () => Y.current,
|
|
94
102
|
onlyIfFocusInside: !0
|
|
103
|
+
}), ce({
|
|
104
|
+
open: Q,
|
|
105
|
+
surfaceRef: J,
|
|
106
|
+
captureOpener: () => Ve.current,
|
|
107
|
+
candidates: (e) => [
|
|
108
|
+
e,
|
|
109
|
+
Ve.current,
|
|
110
|
+
Y.current
|
|
111
|
+
]
|
|
95
112
|
});
|
|
96
|
-
let
|
|
97
|
-
enabled: Q &&
|
|
98
|
-
surface:
|
|
113
|
+
let He = fe({
|
|
114
|
+
enabled: Q && P,
|
|
115
|
+
surface: G,
|
|
99
116
|
anchorRef: Y,
|
|
100
|
-
getPreviousStop:
|
|
117
|
+
getPreviousStop: de
|
|
101
118
|
});
|
|
102
|
-
|
|
103
|
-
Q &&
|
|
119
|
+
T.useEffect(() => {
|
|
120
|
+
Q && G && G.focus({ preventScroll: P });
|
|
104
121
|
}, [
|
|
105
122
|
Q,
|
|
106
|
-
|
|
107
|
-
|
|
123
|
+
G,
|
|
124
|
+
P
|
|
108
125
|
]);
|
|
109
|
-
let
|
|
110
|
-
index:
|
|
126
|
+
let Ue = T.useRef({
|
|
127
|
+
index: b,
|
|
111
128
|
visible: Q
|
|
112
129
|
});
|
|
113
|
-
if (
|
|
114
|
-
let e =
|
|
115
|
-
|
|
116
|
-
index:
|
|
130
|
+
if (T.useEffect(() => {
|
|
131
|
+
let e = Ue.current;
|
|
132
|
+
Ue.current = {
|
|
133
|
+
index: b,
|
|
117
134
|
visible: Q
|
|
118
|
-
}, e.index !==
|
|
135
|
+
}, e.index !== b && e.visible && Q && N !== void 0 && j(`${N}, ${C}`);
|
|
119
136
|
}, [
|
|
120
|
-
|
|
137
|
+
b,
|
|
121
138
|
Q,
|
|
122
|
-
|
|
139
|
+
N,
|
|
123
140
|
C,
|
|
124
|
-
|
|
125
|
-
]), !
|
|
126
|
-
let $ = a(
|
|
127
|
-
return /* @__PURE__ */
|
|
128
|
-
disabled: !
|
|
129
|
-
layerId:
|
|
130
|
-
children: /* @__PURE__ */
|
|
141
|
+
j
|
|
142
|
+
]), !H || !V.step) return null;
|
|
143
|
+
let $ = a(u), We = r || void 0;
|
|
144
|
+
return /* @__PURE__ */ D(oe, {
|
|
145
|
+
disabled: !P,
|
|
146
|
+
layerId: Be,
|
|
147
|
+
children: /* @__PURE__ */ O("div", {
|
|
131
148
|
role: "dialog",
|
|
132
|
-
"aria-labelledby": $ ?
|
|
149
|
+
"aria-labelledby": $ ? M.titleId : pe,
|
|
133
150
|
tabIndex: -1,
|
|
134
|
-
"data-layout":
|
|
135
|
-
id:
|
|
136
|
-
...
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
151
|
+
"data-layout": V.footerLayout,
|
|
152
|
+
id: We ?? (_e ? Se : void 0),
|
|
153
|
+
...p,
|
|
154
|
+
...Ce,
|
|
155
|
+
"data-state": y ? "open" : "closed",
|
|
156
|
+
ref: ze,
|
|
157
|
+
onKeyDown: o(c, He),
|
|
158
|
+
...P ? {
|
|
159
|
+
"data-side": je["data-side"],
|
|
160
|
+
"data-align": je["data-align"],
|
|
142
161
|
style: {
|
|
143
162
|
...s,
|
|
144
|
-
...
|
|
145
|
-
...
|
|
163
|
+
...je.style,
|
|
164
|
+
...Re ? void 0 : { visibility: "hidden" }
|
|
146
165
|
}
|
|
147
166
|
} : { style: s },
|
|
148
|
-
className: e(n, "relative w-80 rounded-md border border-border bg-background p-5 text-foreground shadow-8",
|
|
149
|
-
children: [
|
|
150
|
-
ref:
|
|
151
|
-
side:
|
|
152
|
-
style:
|
|
167
|
+
className: e(n, "relative w-80 rounded-md border border-border bg-background p-5 text-foreground shadow-8", ae, W, i),
|
|
168
|
+
children: [P && /* @__PURE__ */ D(ue, {
|
|
169
|
+
ref: Oe,
|
|
170
|
+
side: Ne,
|
|
171
|
+
style: Me,
|
|
153
172
|
"data-wave-teaching-popover-arrow": "",
|
|
154
173
|
className: f.beak
|
|
155
|
-
}), /* @__PURE__ */
|
|
156
|
-
value:
|
|
157
|
-
children:
|
|
158
|
-
|
|
159
|
-
/* @__PURE__ */
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
174
|
+
}), /* @__PURE__ */ D(ve.Provider, {
|
|
175
|
+
value: V,
|
|
176
|
+
children: /* @__PURE__ */ D(ye.Provider, {
|
|
177
|
+
value: $ ? M.context : null,
|
|
178
|
+
children: $ ? u : /* @__PURE__ */ O(E, { children: [
|
|
179
|
+
/* @__PURE__ */ D(F, {}),
|
|
180
|
+
/* @__PURE__ */ D(I, {}),
|
|
181
|
+
/* @__PURE__ */ D(L, {}),
|
|
182
|
+
/* @__PURE__ */ D(R, {})
|
|
183
|
+
] })
|
|
184
|
+
})
|
|
163
185
|
})]
|
|
164
186
|
})
|
|
165
187
|
});
|
|
166
188
|
};
|
|
167
|
-
|
|
168
|
-
var
|
|
169
|
-
let { shown: a, requestOpen: s, dismiss: c, surfaceId: l, triggerElementRef: u } =
|
|
189
|
+
M.displayName = "TeachingSurface";
|
|
190
|
+
var N = ({ children: e, asChild: t, onClick: n, ref: r, ...i }) => {
|
|
191
|
+
let { shown: a, requestOpen: s, dismiss: c, surfaceId: l, triggerElementRef: u } = w("TeachingPopover.Trigger"), d = v(), f = a && d, p = _(r, u), m = {
|
|
170
192
|
...i,
|
|
171
193
|
"aria-haspopup": "dialog",
|
|
172
194
|
"aria-expanded": f,
|
|
@@ -174,17 +196,17 @@ var I = ({ children: e, asChild: t, onClick: n, ref: r, ...i }) => {
|
|
|
174
196
|
onClick: o(n, () => a ? c() : s()),
|
|
175
197
|
ref: p
|
|
176
198
|
};
|
|
177
|
-
return
|
|
199
|
+
return pe(e, m, {
|
|
178
200
|
componentName: "TeachingPopover.Trigger",
|
|
179
201
|
asChild: t
|
|
180
202
|
});
|
|
181
203
|
};
|
|
182
|
-
|
|
183
|
-
var
|
|
184
|
-
let i =
|
|
185
|
-
|
|
204
|
+
N.displayName = "TeachingPopoverTrigger";
|
|
205
|
+
var P = ({ id: t, ref: n, ...r }) => {
|
|
206
|
+
let i = w("TeachingPopover.Surface"), { registerSurface: a, setCustomSurfaceId: o } = i;
|
|
207
|
+
T.useLayoutEffect(() => a(), [a]);
|
|
186
208
|
let s = t || void 0;
|
|
187
|
-
return
|
|
209
|
+
return T.useEffect(() => (o(s), () => o(void 0)), [s, o]), /* @__PURE__ */ D(M, {
|
|
188
210
|
context: i,
|
|
189
211
|
rootClassName: e(f.root, h.root),
|
|
190
212
|
id: t,
|
|
@@ -192,19 +214,19 @@ var L = ({ id: t, ref: n, ...r }) => {
|
|
|
192
214
|
ref: n
|
|
193
215
|
});
|
|
194
216
|
};
|
|
195
|
-
|
|
196
|
-
var
|
|
197
|
-
let { step: u, closeLabel: d, dismiss: p } =
|
|
217
|
+
P.displayName = "TeachingPopoverSurface";
|
|
218
|
+
var F = ({ icon: t, dismissButton: i, className: o, children: s, ref: c, ...l }) => {
|
|
219
|
+
let { step: u, closeLabel: d, dismiss: p } = w("TeachingPopover.Header");
|
|
198
220
|
if (!u) return null;
|
|
199
221
|
let h = a(t), g = a(s);
|
|
200
|
-
return /* @__PURE__ */
|
|
222
|
+
return /* @__PURE__ */ O("div", {
|
|
201
223
|
ref: c,
|
|
202
224
|
className: e(m.root, (h || g) && "-mt-2 mb-2 flex min-h-6 items-center gap-1.5 pe-8 text-caption-1 font-semibold text-primary", o),
|
|
203
225
|
...l,
|
|
204
226
|
children: [
|
|
205
227
|
h && r(t, "span", e(m.icon, "inline-flex shrink-0 items-center"), { "aria-hidden": !0 }),
|
|
206
228
|
g && n(s),
|
|
207
|
-
/* @__PURE__ */
|
|
229
|
+
/* @__PURE__ */ D(ge, {
|
|
208
230
|
componentName: "TeachingPopover.Header",
|
|
209
231
|
closeButton: i,
|
|
210
232
|
slotName: "dismissButton",
|
|
@@ -215,81 +237,81 @@ var R = ({ icon: t, dismissButton: i, className: o, children: s, ref: c, ...l })
|
|
|
215
237
|
]
|
|
216
238
|
});
|
|
217
239
|
};
|
|
218
|
-
|
|
219
|
-
var
|
|
220
|
-
let { as: r, id: i, className: o, children: s, ref: c, ...l } = t, { step: u, stepPosition: d, titleId: p } =
|
|
221
|
-
return u ? /* @__PURE__ */
|
|
240
|
+
F.displayName = "TeachingPopoverHeader";
|
|
241
|
+
var I = (t) => {
|
|
242
|
+
let { as: r, id: i, className: o, children: s, ref: c, ...l } = t, { step: u, stepPosition: d, titleId: p } = w("TeachingPopover.Title"), m = T.useContext(ye), h = i || p, v = m?.registerTitle, y = T.useCallback((e) => e && v ? v(h) : void 0, [v, h]), b = _(c, y);
|
|
243
|
+
return u ? /* @__PURE__ */ O(r ?? "h3", {
|
|
222
244
|
id: h,
|
|
223
245
|
className: e(g.root, f.title, "mb-2 pe-8 text-subtitle-1 font-semibold text-foreground", o),
|
|
224
246
|
...l,
|
|
225
247
|
ref: b,
|
|
226
|
-
children: [a(s) ? n(s) : u.title, /* @__PURE__ */
|
|
248
|
+
children: [a(s) ? n(s) : u.title, /* @__PURE__ */ D("span", {
|
|
227
249
|
className: "sr-only",
|
|
228
250
|
children: `, ${d}`
|
|
229
251
|
})]
|
|
230
252
|
}) : null;
|
|
231
253
|
};
|
|
232
|
-
|
|
233
|
-
var
|
|
234
|
-
let { step: u } =
|
|
235
|
-
return u ? /* @__PURE__ */
|
|
254
|
+
I.displayName = "TeachingPopoverTitle";
|
|
255
|
+
var L = ({ media: t, className: i, children: o, ref: c, ...l }) => {
|
|
256
|
+
let { step: u } = w("TeachingPopover.Body");
|
|
257
|
+
return u ? /* @__PURE__ */ O("div", {
|
|
236
258
|
ref: c,
|
|
237
259
|
className: e(s.root, f.body, "mb-4 text-body-1 text-muted-foreground", i),
|
|
238
260
|
...l,
|
|
239
261
|
children: [a(t) && r(t, "span", e(s.media, "mb-3 block overflow-hidden rounded-md")), a(o) ? n(o) : u.body]
|
|
240
262
|
}) : null;
|
|
241
263
|
};
|
|
242
|
-
|
|
243
|
-
var
|
|
244
|
-
let s =
|
|
264
|
+
L.displayName = "TeachingPopoverBody";
|
|
265
|
+
var R = ({ className: t, children: r, ref: i, ...o }) => {
|
|
266
|
+
let s = w("TeachingPopover.Footer"), { step: c, footerLayout: l } = s;
|
|
245
267
|
if (!c) return null;
|
|
246
268
|
let u = l === "vertical";
|
|
247
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ D("div", {
|
|
248
270
|
ref: i,
|
|
249
271
|
"data-layout": l,
|
|
250
272
|
className: e(p.root, f.footer, "flex gap-2", u ? "flex-col items-stretch gap-4" : "items-center justify-between", t),
|
|
251
273
|
...o,
|
|
252
|
-
children: a(r) ? n(r) : /* @__PURE__ */
|
|
274
|
+
children: a(r) ? n(r) : /* @__PURE__ */ D(z, { context: s })
|
|
253
275
|
});
|
|
254
276
|
};
|
|
255
|
-
|
|
256
|
-
function
|
|
257
|
-
let n = t.footerLayout === "vertical", { secondary: r, primary: i } =
|
|
258
|
-
return /* @__PURE__ */
|
|
277
|
+
R.displayName = "TeachingPopoverFooter";
|
|
278
|
+
function z({ context: t }) {
|
|
279
|
+
let n = t.footerLayout === "vertical", { secondary: r, primary: i } = V(t);
|
|
280
|
+
return /* @__PURE__ */ O(E, { children: [/* @__PURE__ */ D(B, {
|
|
259
281
|
count: t.count,
|
|
260
282
|
index: t.index,
|
|
261
283
|
className: n && "justify-center"
|
|
262
|
-
}), /* @__PURE__ */
|
|
284
|
+
}), /* @__PURE__ */ O("div", {
|
|
263
285
|
className: e("flex gap-2", n ? "flex-col items-stretch" : "items-center"),
|
|
264
286
|
children: [r, i]
|
|
265
287
|
})] });
|
|
266
288
|
}
|
|
267
|
-
|
|
268
|
-
function
|
|
269
|
-
return /* @__PURE__ */
|
|
289
|
+
z.displayName = "TeachingFooterContent";
|
|
290
|
+
function B({ count: t, index: n, className: r }) {
|
|
291
|
+
return /* @__PURE__ */ D("div", {
|
|
270
292
|
"aria-hidden": "true",
|
|
271
293
|
className: e("flex items-center gap-1.5", r),
|
|
272
|
-
children: Array.from({ length: t }, (t, r) => /* @__PURE__ */
|
|
294
|
+
children: Array.from({ length: t }, (t, r) => /* @__PURE__ */ D("span", {
|
|
273
295
|
"data-wave-teaching-popover-dot": "",
|
|
274
296
|
"aria-current": r === n ? "step" : void 0,
|
|
275
|
-
className: e(f.dot, "h-1.5 rounded-full transition-[width,background-color] motion-reduce:transition-none", r === n ? e("w-4 bg-primary",
|
|
297
|
+
className: e(f.dot, "h-1.5 rounded-full transition-[width,background-color] motion-reduce:transition-none", r === n ? e("w-4 bg-primary", S.fill) : "w-1.5 bg-stroke-accessible forced-colors:bg-[CanvasText] forced-colors:forced-color-adjust-none")
|
|
276
298
|
}, r))
|
|
277
299
|
});
|
|
278
300
|
}
|
|
279
|
-
|
|
280
|
-
function
|
|
301
|
+
B.displayName = "TeachingStepDots";
|
|
302
|
+
function V(e, { initialStepText: t, finalStepText: n } = {}) {
|
|
281
303
|
let { count: r, isFirst: i, isLast: a, goBack: o, goNext: s, dismiss: c, primaryAction: l, secondaryAction: u, backLabel: d, nextLabel: p, doneLabel: m } = e, h;
|
|
282
|
-
u ? h =
|
|
304
|
+
u ? h = j(u, "outline", f.secondaryButton, o) : i && t ? h = /* @__PURE__ */ D(C, {
|
|
283
305
|
className: f.backButton,
|
|
284
306
|
onClick: c,
|
|
285
307
|
children: t
|
|
286
|
-
}) : r > 1 && (h = /* @__PURE__ */
|
|
308
|
+
}) : r > 1 && (h = /* @__PURE__ */ D(C, {
|
|
287
309
|
...y(i),
|
|
288
310
|
className: f.backButton,
|
|
289
311
|
onClick: b(i, o),
|
|
290
312
|
children: d
|
|
291
313
|
}));
|
|
292
|
-
let g = l ?
|
|
314
|
+
let g = l ? j(l, "primary", f.primaryButton, s) : /* @__PURE__ */ D(C, {
|
|
293
315
|
appearance: "primary",
|
|
294
316
|
className: f.nextButton,
|
|
295
317
|
onClick: s,
|
|
@@ -300,23 +322,23 @@ function W(e, { initialStepText: t, finalStepText: n } = {}) {
|
|
|
300
322
|
primary: g
|
|
301
323
|
};
|
|
302
324
|
}
|
|
303
|
-
var
|
|
304
|
-
let { step: s } =
|
|
305
|
-
return s ? /* @__PURE__ */
|
|
325
|
+
var H = ({ className: t, children: r, ref: i, ...o }) => {
|
|
326
|
+
let { step: s } = w("TeachingPopover.Carousel");
|
|
327
|
+
return s ? /* @__PURE__ */ D("div", {
|
|
306
328
|
ref: i,
|
|
307
329
|
className: e(c.root, t),
|
|
308
330
|
...o,
|
|
309
|
-
children: a(r) ? n(r) : /* @__PURE__ */
|
|
310
|
-
/* @__PURE__ */
|
|
311
|
-
/* @__PURE__ */
|
|
312
|
-
/* @__PURE__ */
|
|
331
|
+
children: a(r) ? n(r) : /* @__PURE__ */ O(E, { children: [
|
|
332
|
+
/* @__PURE__ */ D(I, {}),
|
|
333
|
+
/* @__PURE__ */ D(L, {}),
|
|
334
|
+
/* @__PURE__ */ D(G, {})
|
|
313
335
|
] })
|
|
314
336
|
}) : null;
|
|
315
337
|
};
|
|
316
|
-
|
|
317
|
-
var
|
|
318
|
-
let { step: i, count: a, index: o, goToStep: s, navLabel: c, navButtonLabel: l } =
|
|
319
|
-
return i ? /* @__PURE__ */
|
|
338
|
+
H.displayName = "TeachingPopoverCarousel";
|
|
339
|
+
var U = ({ className: t, ref: n, ...r }) => {
|
|
340
|
+
let { step: i, count: a, index: o, goToStep: s, navLabel: c, navButtonLabel: l } = w("TeachingPopover.CarouselNav");
|
|
341
|
+
return i ? /* @__PURE__ */ D("div", {
|
|
320
342
|
ref: n,
|
|
321
343
|
role: "group",
|
|
322
344
|
"aria-label": c,
|
|
@@ -324,82 +346,82 @@ var K = ({ className: t, ref: n, ...r }) => {
|
|
|
324
346
|
...r,
|
|
325
347
|
children: Array.from({ length: a }, (t, n) => {
|
|
326
348
|
let r = n === o;
|
|
327
|
-
return /* @__PURE__ */
|
|
349
|
+
return /* @__PURE__ */ D("button", {
|
|
328
350
|
type: "button",
|
|
329
351
|
"aria-label": l(n, a),
|
|
330
352
|
"aria-current": r ? "step" : void 0,
|
|
331
353
|
onClick: () => s(n),
|
|
332
|
-
className: e(u.button, "group inline-flex h-6 min-w-6 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0",
|
|
333
|
-
children: /* @__PURE__ */
|
|
354
|
+
className: e(u.button, "group inline-flex h-6 min-w-6 cursor-pointer items-center justify-center rounded-md border-0 bg-transparent p-0", ae),
|
|
355
|
+
children: /* @__PURE__ */ D("span", {
|
|
334
356
|
"aria-hidden": "true",
|
|
335
|
-
className: e(u.indicator, "block h-1.5 rounded-full transition-[width,background-color] motion-reduce:transition-none", r ? e("w-4 bg-primary",
|
|
357
|
+
className: e(u.indicator, "block h-1.5 rounded-full transition-[width,background-color] motion-reduce:transition-none", r ? e("w-4 bg-primary", S.fill) : "w-1.5 bg-stroke-accessible group-hover:bg-foreground forced-colors:bg-[ButtonText] forced-colors:forced-color-adjust-none")
|
|
336
358
|
})
|
|
337
359
|
}, n);
|
|
338
360
|
})
|
|
339
361
|
}) : null;
|
|
340
362
|
};
|
|
341
|
-
|
|
342
|
-
var
|
|
343
|
-
let { step: s, count: c, index: l } =
|
|
363
|
+
U.displayName = "TeachingPopoverCarouselNav";
|
|
364
|
+
var Ce = (e, t) => `${e} of ${t}`, W = ({ className: t, children: r, ref: i, ...o }) => {
|
|
365
|
+
let { step: s, count: c, index: l } = w("TeachingPopover.CarouselPageCount");
|
|
344
366
|
if (!s) return null;
|
|
345
367
|
let u = r?.(l + 1, c);
|
|
346
|
-
return /* @__PURE__ */
|
|
368
|
+
return /* @__PURE__ */ D("div", {
|
|
347
369
|
ref: i,
|
|
348
370
|
className: e(d.root, "shrink-0 text-caption-1 text-muted-foreground", t),
|
|
349
371
|
...o,
|
|
350
|
-
children: a(u) ? n(u) :
|
|
372
|
+
children: a(u) ? n(u) : Ce(l + 1, c)
|
|
351
373
|
});
|
|
352
374
|
};
|
|
353
|
-
|
|
354
|
-
var
|
|
355
|
-
let d =
|
|
375
|
+
W.displayName = "TeachingPopoverCarouselPageCount";
|
|
376
|
+
var G = ({ layout: t = "offset", initialStepText: r, finalStepText: i, className: o, children: s, ref: c, ...u }) => {
|
|
377
|
+
let d = w("TeachingPopover.CarouselFooter"), p = t === "centered", [m, h] = T.useState(null), g = _(c, h), v = _e(m, p && d.step !== void 0);
|
|
356
378
|
if (!d.step) return null;
|
|
357
|
-
let { secondary: y, primary: b } =
|
|
379
|
+
let { secondary: y, primary: b } = V(d, {
|
|
358
380
|
initialStepText: r,
|
|
359
381
|
finalStepText: i
|
|
360
|
-
}), x = a(s) ? /* @__PURE__ */
|
|
382
|
+
}), x = a(s) ? /* @__PURE__ */ D("div", {
|
|
361
383
|
className: e("flex flex-wrap items-center gap-2", p && "w-max max-w-full justify-center"),
|
|
362
384
|
children: n(s)
|
|
363
|
-
}) : /* @__PURE__ */
|
|
385
|
+
}) : /* @__PURE__ */ D(B, {
|
|
364
386
|
count: d.count,
|
|
365
387
|
index: d.index
|
|
366
388
|
});
|
|
367
|
-
return p ? /* @__PURE__ */
|
|
389
|
+
return p ? /* @__PURE__ */ O("div", {
|
|
368
390
|
ref: g,
|
|
369
391
|
"data-carousel-layout": t,
|
|
370
392
|
"data-stacked": v ? "" : void 0,
|
|
371
393
|
className: e(l.root, f.footer, "items-center gap-2", v ? "flex flex-wrap" : "grid grid-cols-[1fr_auto_1fr]", o),
|
|
372
394
|
...u,
|
|
373
395
|
children: [
|
|
374
|
-
a(y) && /* @__PURE__ */
|
|
396
|
+
a(y) && /* @__PURE__ */ D("div", {
|
|
375
397
|
"data-wave-carousel-footer-slot": "secondary",
|
|
376
398
|
className: e("flex w-max max-w-full", !v && "col-start-1 justify-self-start"),
|
|
377
399
|
children: y
|
|
378
400
|
}),
|
|
379
|
-
/* @__PURE__ */
|
|
401
|
+
/* @__PURE__ */ D("div", {
|
|
380
402
|
"data-wave-carousel-footer-slot": "indicator",
|
|
381
403
|
className: e("flex justify-center", v ? "order-first basis-full" : "col-start-2"),
|
|
382
404
|
children: x
|
|
383
405
|
}),
|
|
384
|
-
/* @__PURE__ */
|
|
406
|
+
/* @__PURE__ */ D("div", {
|
|
385
407
|
"data-wave-carousel-footer-slot": "primary",
|
|
386
408
|
className: e("flex w-max max-w-full", v ? "ms-auto" : "col-start-3 justify-self-end"),
|
|
387
409
|
children: b
|
|
388
410
|
})
|
|
389
411
|
]
|
|
390
|
-
}) : /* @__PURE__ */
|
|
412
|
+
}) : /* @__PURE__ */ O("div", {
|
|
391
413
|
ref: g,
|
|
392
414
|
"data-carousel-layout": t,
|
|
393
415
|
className: e(l.root, f.footer, "flex flex-wrap items-center justify-between gap-2", o),
|
|
394
416
|
...u,
|
|
395
|
-
children: [x, /* @__PURE__ */
|
|
417
|
+
children: [x, /* @__PURE__ */ O("div", {
|
|
396
418
|
className: "ms-auto flex flex-wrap items-center justify-end gap-2",
|
|
397
419
|
children: [y, b]
|
|
398
420
|
})]
|
|
399
421
|
});
|
|
400
422
|
};
|
|
401
|
-
|
|
423
|
+
G.displayName = "TeachingPopoverCarouselFooter";
|
|
402
424
|
//#endregion
|
|
403
|
-
export {
|
|
425
|
+
export { L as TeachingPopoverBody, H as TeachingPopoverCarousel, G as TeachingPopoverCarouselFooter, U as TeachingPopoverCarouselNav, W as TeachingPopoverCarouselPageCount, R as TeachingPopoverFooter, F as TeachingPopoverHeader, P as TeachingPopoverSurface, I as TeachingPopoverTitle, N as TeachingPopoverTrigger, M as TeachingSurface };
|
|
404
426
|
|
|
405
427
|
//# sourceMappingURL=TeachingPopover.parts.mjs.map
|