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