@plexui/ui 0.30.0 → 0.31.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 (92) hide show
  1. package/dist/es/components/ButtonGroup/ButtonGroup.js +1 -1
  2. package/dist/es/components/ButtonGroup/ButtonGroup.js.map +1 -1
  3. package/dist/es/components/ButtonGroup/index.js.map +1 -1
  4. package/dist/es/components/ContextMenu/shared.js +3 -2
  5. package/dist/es/components/ContextMenu/shared.js.map +1 -1
  6. package/dist/es/components/Dialog/Dialog.js +42 -29
  7. package/dist/es/components/Dialog/Dialog.js.map +1 -1
  8. package/dist/es/components/Dialog/dialogSteps.js +85 -0
  9. package/dist/es/components/Dialog/dialogSteps.js.map +1 -0
  10. package/dist/es/components/Dialog/dialogViewport.js +74 -0
  11. package/dist/es/components/Dialog/dialogViewport.js.map +1 -0
  12. package/dist/es/components/Dialog/index.js +1 -1
  13. package/dist/es/components/Dialog/index.js.map +1 -1
  14. package/dist/es/components/Dialog/sheetDrag.js +2 -1
  15. package/dist/es/components/Dialog/sheetDrag.js.map +1 -1
  16. package/dist/es/components/IndexBar/IndexBar.js +164 -0
  17. package/dist/es/components/IndexBar/IndexBar.js.map +1 -0
  18. package/dist/es/components/IndexBar/index.js +2 -0
  19. package/dist/es/components/IndexBar/index.js.map +1 -0
  20. package/dist/es/components/MarkdownEditor/MarkdownEditor.js +142 -1
  21. package/dist/es/components/MarkdownEditor/MarkdownEditor.js.map +1 -1
  22. package/dist/es/components/Menu/Menu.js +3 -2
  23. package/dist/es/components/Menu/Menu.js.map +1 -1
  24. package/dist/es/components/Page/Page.js +1 -1
  25. package/dist/es/components/Page/Page.js.map +1 -1
  26. package/dist/es/components/PhoneLayout/PhoneLayout.js +41 -0
  27. package/dist/es/components/PhoneLayout/PhoneLayout.js.map +1 -0
  28. package/dist/es/components/PhoneLayout/index.js +2 -0
  29. package/dist/es/components/PhoneLayout/index.js.map +1 -0
  30. package/dist/es/components/Slider/Slider.js +33 -3
  31. package/dist/es/components/Slider/Slider.js.map +1 -1
  32. package/dist/es/components/SwipeActions/SwipeActions.js +321 -0
  33. package/dist/es/components/SwipeActions/SwipeActions.js.map +1 -0
  34. package/dist/es/components/SwipeActions/index.js +2 -0
  35. package/dist/es/components/SwipeActions/index.js.map +1 -0
  36. package/dist/es/components/TabBar/TabBar.js +4 -4
  37. package/dist/es/components/TabBar/TabBar.js.map +1 -1
  38. package/dist/es/components/TabBar/index.js.map +1 -1
  39. package/dist/es/components/Tabs/Tabs.js +1 -1
  40. package/dist/es/components/Tabs/Tabs.js.map +1 -1
  41. package/dist/es/components/TagInput/TagInput.js +5 -65
  42. package/dist/es/components/TagInput/TagInput.js.map +1 -1
  43. package/dist/es/components/Textarea/Textarea.js +1 -1
  44. package/dist/es/components/Textarea/Textarea.js.map +1 -1
  45. package/dist/es/components/Tip/Tip.js +106 -0
  46. package/dist/es/components/Tip/Tip.js.map +1 -0
  47. package/dist/es/components/Tip/index.js +2 -0
  48. package/dist/es/components/Tip/index.js.map +1 -0
  49. package/dist/es/components/Toast/ToastRenderer.js +22 -9
  50. package/dist/es/components/Toast/ToastRenderer.js.map +1 -1
  51. package/dist/es/components/Toast/Toaster.js +17 -6
  52. package/dist/es/components/Toast/Toaster.js.map +1 -1
  53. package/dist/es/components/Toast/toastLifecycle.js +113 -1
  54. package/dist/es/components/Toast/toastLifecycle.js.map +1 -1
  55. package/dist/es/components/Toolbar/Toolbar.js +1 -1
  56. package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
  57. package/dist/es/hooks/useEscCloseStack.js +10 -3
  58. package/dist/es/hooks/useEscCloseStack.js.map +1 -1
  59. package/dist/es/lib/floatingBoundary.js +3 -1
  60. package/dist/es/lib/floatingBoundary.js.map +1 -1
  61. package/dist/es/lib/helpers.js +21 -0
  62. package/dist/es/lib/helpers.js.map +1 -1
  63. package/dist/es/lib/phoneLayout.js +16 -0
  64. package/dist/es/lib/phoneLayout.js.map +1 -0
  65. package/dist/es/lib/toastRegion.js +6 -0
  66. package/dist/es/lib/toastRegion.js.map +1 -0
  67. package/dist/types/components/ButtonGroup/ButtonGroup.d.ts +8 -1
  68. package/dist/types/components/ButtonGroup/index.d.ts +1 -1
  69. package/dist/types/components/ContextMenu/shared.d.ts +3 -2
  70. package/dist/types/components/Dialog/Dialog.d.ts +48 -3
  71. package/dist/types/components/Dialog/dialogSteps.d.ts +10 -0
  72. package/dist/types/components/Dialog/dialogViewport.d.ts +1 -0
  73. package/dist/types/components/Dialog/index.d.ts +1 -1
  74. package/dist/types/components/IndexBar/IndexBar.d.ts +35 -0
  75. package/dist/types/components/IndexBar/index.d.ts +1 -0
  76. package/dist/types/components/Menu/Menu.d.ts +6 -2
  77. package/dist/types/components/Page/Page.d.ts +1 -1
  78. package/dist/types/components/PhoneLayout/PhoneLayout.d.ts +18 -0
  79. package/dist/types/components/PhoneLayout/index.d.ts +1 -0
  80. package/dist/types/components/SwipeActions/SwipeActions.d.ts +46 -0
  81. package/dist/types/components/SwipeActions/index.d.ts +1 -0
  82. package/dist/types/components/TabBar/TabBar.d.ts +18 -4
  83. package/dist/types/components/TabBar/index.d.ts +1 -1
  84. package/dist/types/components/Tip/Tip.d.ts +57 -0
  85. package/dist/types/components/Tip/index.d.ts +1 -0
  86. package/dist/types/components/Toast/toastLifecycle.d.ts +34 -0
  87. package/dist/types/components/Toolbar/Toolbar.d.ts +5 -3
  88. package/dist/types/hooks/useEscCloseStack.d.ts +5 -1
  89. package/dist/types/lib/helpers.d.ts +6 -0
  90. package/dist/types/lib/phoneLayout.d.ts +11 -0
  91. package/dist/types/lib/toastRegion.d.ts +5 -0
  92. package/package.json +2 -2
@@ -0,0 +1,321 @@
1
+ "use client";
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import clsx from "clsx";
4
+ import { useEffect, useRef, useState, } from "react";
5
+ import s from "@plexui/styles/components/SwipeActions/SwipeActions.module.css";
6
+ import { useLatestValue } from "../../hooks/useLatestValue.js";
7
+ /** A finger has to travel this far, and farther across than down, before the row follows it. */
8
+ const SLOP = 10;
9
+ /** The width an open row moves by is the border box of its actions, edge and content gaps included. */
10
+ const BORDER_BOX = { box: "border-box" };
11
+ /** Controls that take a horizontal drag themselves. */
12
+ const OWN_DRAG = 'input, textarea, select, [contenteditable]:not([contenteditable="false"]), [role="slider"]';
13
+ /** The open row: opening another one closes it, as a list keeps one row open. */
14
+ let closeOpenRow = null;
15
+ /** The row keeps the finger past its edges; a pointer that is no longer active (it lifted between events) cannot be held. */
16
+ const capture = (element, pointerId) => {
17
+ try {
18
+ element.setPointerCapture?.(pointerId);
19
+ }
20
+ catch {
21
+ // The swipe goes on with the events the row still gets.
22
+ }
23
+ };
24
+ const sideOf = (offset) => offset > 0 ? "leading" : offset < 0 ? "trailing" : undefined;
25
+ /**
26
+ * Where the content goes for a swipe of `raw` px toward the trailing edge (negative: toward the leading edge), and
27
+ * whether that is a full swipe. A side without actions stays shut. Past its actions the content follows the finger
28
+ * where a full swipe is allowed, and a third as fast where it is not; past the middle between the open actions and
29
+ * the far edge of the row the swipe is full.
30
+ */
31
+ export const swipeActionsOffset = (raw, widths, rowWidth, fullSwipe) => {
32
+ const side = sideOf(raw);
33
+ const width = side ? widths[side] : 0;
34
+ if (!side || !(width > 0))
35
+ return { offset: 0, full: false };
36
+ const sign = Math.sign(raw);
37
+ const distance = Math.abs(raw);
38
+ if (distance <= width)
39
+ return { offset: raw, full: false };
40
+ if (!fullSwipe)
41
+ return { offset: sign * (width + (distance - width) / 3), full: false };
42
+ const travel = Math.min(distance, Math.max(width, rowWidth));
43
+ return { offset: sign * travel, full: travel >= (width + rowWidth) / 2 };
44
+ };
45
+ /**
46
+ * Actions behind a row of a list, as the swipe actions of an iOS list: a swipe toward the leading edge reveals the
47
+ * trailing actions, a swipe toward the trailing edge the leading ones, and a full swipe runs the first action of
48
+ * that side. The row is a `data-row` of a FieldGroup. Each action is also a button in the order of the screen, and
49
+ * the focus on one shows its side.
50
+ */
51
+ export function SwipeActions({ leading = [], trailing = [], labelPlacement = "hidden", fullSwipe = true, className, children, }) {
52
+ const [offset, setOffset] = useState(0);
53
+ const [full, setFull] = useState(false);
54
+ const [swiping, setSwiping] = useState(false);
55
+ const [rtl, setRtl] = useState(false);
56
+ const root = useRef(null);
57
+ const sides = useRef({ leading: null, trailing: null });
58
+ const gesture = useRef(null);
59
+ const current = useRef({ offset: 0, full: false });
60
+ const suppressClick = useRef(false);
61
+ const observer = useRef(null);
62
+ const actionsRef = useLatestValue({ leading, trailing });
63
+ const revealed = sideOf(offset);
64
+ const widthOf = (side) => sides.current[side]?.getBoundingClientRect().width ?? 0;
65
+ const isRtl = () => !!root.current && getComputedStyle(root.current).direction === "rtl";
66
+ const move = (next, nextFull = false) => {
67
+ current.current = { offset: next, full: nextFull };
68
+ setOffset(next);
69
+ setFull(nextFull);
70
+ };
71
+ /** Lets go of the gesture: the listeners for its end go, and the row no longer follows the finger. */
72
+ const release = () => {
73
+ const state = gesture.current;
74
+ gesture.current = null;
75
+ state?.detach();
76
+ return state;
77
+ };
78
+ /** The handlers of the latest render, for listeners and observers set up once. */
79
+ const latest = useRef({ close: () => { }, release, finish: () => { }, cancel: () => { }, sync: () => { } });
80
+ /** One function for the life of the row, so the list knows which row is open; another row that opens ends this one's gesture too. */
81
+ const closer = useRef(() => {
82
+ const state = latest.current.release();
83
+ if (state) {
84
+ setSwiping(false);
85
+ // The finger of the ended swipe still lifts over this row: its click is not a click on the content.
86
+ if (state.swiping)
87
+ suppressClick.current = true;
88
+ }
89
+ latest.current.close();
90
+ }).current;
91
+ const close = () => {
92
+ if (closeOpenRow === closer)
93
+ closeOpenRow = null;
94
+ move(0);
95
+ };
96
+ /** This row takes the place of the open one. */
97
+ const claim = () => {
98
+ if (closeOpenRow && closeOpenRow !== closer)
99
+ closeOpenRow();
100
+ closeOpenRow = closer;
101
+ };
102
+ /** Shows a side as wide as its actions (`width` when known), or closes the row when that side has none (any more). */
103
+ const open = (side, width = widthOf(side)) => {
104
+ if (!(width > 0))
105
+ return close();
106
+ claim();
107
+ setRtl(isRtl());
108
+ move(side === "leading" ? width : -width);
109
+ };
110
+ /** An open row follows its actions: more of them, other labels or another width move it to their new width. */
111
+ const sync = () => {
112
+ const side = sideOf(current.current.offset);
113
+ if (!side || gesture.current?.swiping || current.current.full)
114
+ return;
115
+ const width = widthOf(side);
116
+ if (!(width > 0))
117
+ return close();
118
+ const target = side === "leading" ? width : -width;
119
+ if (target !== current.current.offset)
120
+ move(target);
121
+ };
122
+ const settle = (state) => {
123
+ const { offset: last, full: wasFull } = current.current;
124
+ const side = sideOf(last);
125
+ if (!side)
126
+ return close();
127
+ if (wasFull) {
128
+ actionsRef.current[side][0]?.onSelect?.();
129
+ return close();
130
+ }
131
+ // The widths from the start of the swipe: a full swipe may have stretched the actions since.
132
+ if (Math.abs(last) >= state.widths[side] / 2)
133
+ open(side, state.widths[side]);
134
+ else
135
+ close();
136
+ };
137
+ /** The finger lifted (anywhere): a swipe settles, a press on an open row closes it. */
138
+ const finish = () => {
139
+ const state = release();
140
+ if (!state)
141
+ return;
142
+ if (state.swiping) {
143
+ suppressClick.current = true;
144
+ setSwiping(false);
145
+ settle(state);
146
+ }
147
+ else if (state.start !== 0) {
148
+ if (state.swiping === undefined)
149
+ suppressClick.current = true;
150
+ close();
151
+ }
152
+ };
153
+ /** The browser took the gesture (a scroll) or the row lost the finger: the row goes back to where it was. */
154
+ const cancel = () => {
155
+ const state = release();
156
+ if (!state)
157
+ return;
158
+ setSwiping(false);
159
+ const side = sideOf(state.start);
160
+ if (state.swiping && side)
161
+ open(side, state.widths[side]);
162
+ else
163
+ close();
164
+ };
165
+ latest.current = { close, release, finish, cancel, sync };
166
+ // After each render, and whenever the actions change size, an open row takes their width.
167
+ useEffect(() => {
168
+ latest.current.sync();
169
+ for (const element of [sides.current.leading, sides.current.trailing])
170
+ if (element)
171
+ observer.current?.observe(element, BORDER_BOX);
172
+ });
173
+ useEffect(() => {
174
+ if (typeof ResizeObserver !== "undefined")
175
+ observer.current = new ResizeObserver(() => latest.current.sync());
176
+ for (const element of [sides.current.leading, sides.current.trailing])
177
+ if (element)
178
+ observer.current?.observe(element, BORDER_BOX);
179
+ // The open row lets go of the list, and of the finger, when it goes away.
180
+ return () => {
181
+ observer.current?.disconnect();
182
+ observer.current = null;
183
+ latest.current.release();
184
+ if (closeOpenRow === closer)
185
+ closeOpenRow = null;
186
+ };
187
+ }, [closer, latest]);
188
+ // A press anywhere outside the open row closes it.
189
+ useEffect(() => {
190
+ if (!revealed || swiping)
191
+ return;
192
+ const handlePointerDown = (event) => {
193
+ if (event.target instanceof Node && root.current?.contains(event.target))
194
+ return;
195
+ latest.current.close();
196
+ };
197
+ document.addEventListener("pointerdown", handlePointerDown, true);
198
+ return () => document.removeEventListener("pointerdown", handlePointerDown, true);
199
+ }, [revealed, swiping, latest]);
200
+ const handlePointerDown = (event) => {
201
+ if (event.button !== 0 || gesture.current)
202
+ return;
203
+ // A new press of the primary pointer starts clean: a swipe that another row ended and that was then cancelled leaves
204
+ // no click to swallow. Another finger's press keeps it, as only the primary pointer clicks.
205
+ if (event.isPrimary)
206
+ suppressClick.current = false;
207
+ if (leading.length < 1 && trailing.length < 1)
208
+ return;
209
+ // A drag in a text field or along a slider belongs to that control.
210
+ if (event.target instanceof Element && event.target.closest(OWN_DRAG))
211
+ return;
212
+ const pointerId = event.pointerId;
213
+ // The end of the gesture is heard wherever the finger lifts, inside the row or not.
214
+ const handleUp = (end) => {
215
+ if (end.pointerId === pointerId)
216
+ latest.current.finish();
217
+ };
218
+ const handleCancel = (end) => {
219
+ if (end.pointerId === pointerId)
220
+ latest.current.cancel();
221
+ };
222
+ window.addEventListener("pointerup", handleUp, true);
223
+ window.addEventListener("pointercancel", handleCancel, true);
224
+ gesture.current = {
225
+ pointerId,
226
+ x: event.clientX,
227
+ y: event.clientY,
228
+ start: current.current.offset,
229
+ swiping: undefined,
230
+ rtl: isRtl(),
231
+ widths: { leading: widthOf("leading"), trailing: widthOf("trailing") },
232
+ rowWidth: root.current?.clientWidth ?? 0,
233
+ detach: () => {
234
+ window.removeEventListener("pointerup", handleUp, true);
235
+ window.removeEventListener("pointercancel", handleCancel, true);
236
+ },
237
+ };
238
+ };
239
+ const handlePointerMove = (event) => {
240
+ const state = gesture.current;
241
+ if (!state || state.pointerId !== event.pointerId || state.swiping === false)
242
+ return;
243
+ const across = (event.clientX - state.x) * (state.rtl ? -1 : 1);
244
+ const down = event.clientY - state.y;
245
+ if (state.swiping === undefined) {
246
+ if (Math.abs(across) < SLOP && Math.abs(down) < SLOP)
247
+ return;
248
+ if (Math.abs(across) <= Math.abs(down)) {
249
+ state.swiping = false;
250
+ return;
251
+ }
252
+ state.swiping = true;
253
+ capture(event.currentTarget, event.pointerId);
254
+ window.getSelection?.()?.removeAllRanges();
255
+ claim();
256
+ setRtl(state.rtl);
257
+ setSwiping(true);
258
+ }
259
+ const next = swipeActionsOffset(state.start + across, state.widths, state.rowWidth, fullSwipe);
260
+ move(next.offset, next.full);
261
+ };
262
+ /** The content lost the finger it held. A child that loses the finger to the content (as a touch moves its implicit capture) ends nothing. */
263
+ const handleLostPointerCapture = (event) => {
264
+ if (event.target === event.currentTarget && gesture.current?.pointerId === event.pointerId)
265
+ cancel();
266
+ };
267
+ /** A swipe or a press that closed the row is not a click on the content; a click from the keys still is. */
268
+ const handleClickCapture = (event) => {
269
+ if (!suppressClick.current || event.detail === 0)
270
+ return;
271
+ suppressClick.current = false;
272
+ event.preventDefault();
273
+ event.stopPropagation();
274
+ };
275
+ /** The focus on an action shows its side; on the content it closes the row. */
276
+ const handleFocus = (event) => {
277
+ if (gesture.current?.swiping)
278
+ return;
279
+ const side = ["leading", "trailing"].find((name) => sides.current[name]?.contains(event.target));
280
+ if (side) {
281
+ if (sideOf(current.current.offset) !== side)
282
+ open(side);
283
+ }
284
+ else if (current.current.offset !== 0) {
285
+ close();
286
+ }
287
+ };
288
+ const handleBlur = (event) => {
289
+ if (gesture.current?.swiping)
290
+ return;
291
+ if (event.relatedTarget instanceof Node && root.current?.contains(event.relatedTarget))
292
+ return;
293
+ if (current.current.offset !== 0)
294
+ close();
295
+ };
296
+ const select = (action, event) => {
297
+ action.onSelect?.();
298
+ // A press closes the row, as iOS does. From the keys the action keeps the focus, so its side stays open until
299
+ // the focus leaves the row.
300
+ if (event.detail === 0)
301
+ return;
302
+ event.currentTarget.blur();
303
+ close();
304
+ };
305
+ const renderSide = (side, actions) => {
306
+ if (actions.length < 1)
307
+ return null;
308
+ const shown = side === "leading" ? actions : [...actions].reverse();
309
+ const isFull = full && revealed === side;
310
+ return (_jsx("div", { ref: (element) => {
311
+ sides.current[side] = element;
312
+ }, className: s.Actions, "data-side": side, "data-full": isFull ? "" : undefined, style: isFull ? { width: Math.abs(offset) } : undefined, children: shown.map((action) => {
313
+ const color = action.color ?? "secondary";
314
+ const labelInside = labelPlacement === "inside" || !action.Icon;
315
+ const labelBelow = labelPlacement === "below" && !!action.Icon;
316
+ return (_jsxs("button", { type: "button", className: s.Action, "data-color": color, "data-first": action === actions[0] ? "" : undefined, "aria-label": labelInside || labelBelow ? undefined : action.label, onClick: (event) => select(action, event), children: [_jsxs("span", { className: s.Capsule, children: [action.Icon && _jsx(action.Icon, { className: s.Icon, "aria-hidden": "true" }), labelInside && _jsx("span", { className: s.Label, children: action.label })] }), labelBelow && _jsx("span", { className: s.Caption, children: action.label })] }, action.id));
317
+ }) }));
318
+ };
319
+ return (_jsxs("div", { ref: root, className: clsx(s.SwipeActions, className), "data-row": "", "data-swipe-actions": "", "data-label-placement": labelPlacement, "data-revealed": revealed, "data-swiping": swiping ? "" : undefined, onFocus: handleFocus, onBlur: handleBlur, children: [renderSide("leading", leading), _jsx("div", { className: s.Content, "data-swipe-content": "", style: offset !== 0 ? { "--swipe-actions-offset": `${rtl ? -offset : offset}px` } : undefined, onPointerDown: handlePointerDown, onPointerMove: handlePointerMove, onLostPointerCapture: handleLostPointerCapture, onClickCapture: handleClickCapture, children: children }), renderSide("trailing", trailing)] }));
320
+ }
321
+ //# sourceMappingURL=SwipeActions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SwipeActions.js","sourceRoot":"","sources":["../../../../src/components/SwipeActions/SwipeActions.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EAQL,SAAS,EACT,MAAM,EACN,QAAQ,GACT,MAAM,OAAO,CAAA;AACd,OAAO,CAAC,MAAM,gEAAgE,CAAA;AAC9E,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AA0C3D,gGAAgG;AAChG,MAAM,IAAI,GAAG,EAAE,CAAA;AAEf,uGAAuG;AACvG,MAAM,UAAU,GAA0B,EAAE,GAAG,EAAE,YAAY,EAAE,CAAA;AAE/D,uDAAuD;AACvD,MAAM,QAAQ,GAAG,4FAA4F,CAAA;AAgB7G,iFAAiF;AACjF,IAAI,YAAY,GAAwB,IAAI,CAAA;AAE5C,6HAA6H;AAC7H,MAAM,OAAO,GAAG,CAAC,OAAgB,EAAE,SAAiB,EAAE,EAAE;IACtD,IAAI,CAAC;QACH,OAAO,CAAC,iBAAiB,EAAE,CAAC,SAAS,CAAC,CAAA;IACxC,CAAC;IAAC,MAAM,CAAC;QACP,wDAAwD;IAC1D,CAAC;AACH,CAAC,CAAA;AAED,MAAM,MAAM,GAAG,CAAC,MAAc,EAAgC,EAAE,CAC9D,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,SAAS,CAAA;AAE9D;;;;;GAKG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAChC,GAAW,EACX,MAAwC,EACxC,QAAgB,EAChB,SAAkB,EACiB,EAAE;IACrC,MAAM,IAAI,GAAG,MAAM,CAAC,GAAG,CAAC,CAAA;IACxB,MAAM,KAAK,GAAG,IAAI,CAAC,CAA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iBAAiB,EAChC,aAAa,EAAE,iBAAiB,EAChC,oBAAoB,EAAE,wBAAwB,EAC9C,cAAc,EAAE,kBAAkB,YAEjC,QAAQ,GACL,EACL,UAAU,CAAC,UAAU,EAAE,QAAQ,CAAC,IAC7B,CACP,CAAA;AACH,CAAC","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n type ComponentType,\n type CSSProperties,\n type FocusEvent,\n type MouseEvent,\n type PointerEvent,\n type ReactNode,\n type SVGProps,\n useEffect,\n useRef,\n useState,\n} from \"react\"\nimport s from \"@plexui/styles/components/SwipeActions/SwipeActions.module.css\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\n\nexport type SwipeActionColor =\n | \"primary\"\n | \"secondary\"\n | \"danger\"\n | \"success\"\n | \"info\"\n | \"discovery\"\n | \"caution\"\n | \"warning\"\n\nexport type SwipeAction = {\n /** Unique ID of the action within its side */\n id: string\n /** Name of the action: shown with `labelPlacement` `\"inside\"` or `\"below\"` (and on an action without an icon), and its accessible name always */\n label: string\n /** Icon of the action */\n Icon?: ComponentType<SVGProps<SVGSVGElement>>\n /** Solid color of the action. @default \"secondary\" */\n color?: SwipeActionColor\n /** Called when the action is pressed, or by a full swipe when it is the first action of its side */\n onSelect?: () => void\n}\n\nexport type SwipeActionsSide = \"leading\" | \"trailing\"\n\nexport type SwipeActionsProps = {\n /** Actions revealed by a swipe toward the trailing edge, the first one at the leading edge */\n leading?: SwipeAction[]\n /** Actions revealed by a swipe toward the leading edge, the first one at the trailing edge */\n trailing?: SwipeAction[]\n /** Where the actions show their labels: `\"hidden\"` (symbols only), `\"inside\"` the capsule, or `\"below\"` it (for rows of 68px and taller). @default \"hidden\" */\n labelPlacement?: \"hidden\" | \"inside\" | \"below\"\n /** A swipe past the middle between the open actions and the far edge runs the first action of that side. @default true */\n fullSwipe?: boolean\n /** CSS classes applied to the row */\n className?: string\n /** The content of the row */\n children?: ReactNode\n}\n\n/** A finger has to travel this far, and farther across than down, before the row follows it. */\nconst SLOP = 10\n\n/** The width an open row moves by is the border box of its actions, edge and content gaps included. */\nconst BORDER_BOX: ResizeObserverOptions = { box: \"border-box\" }\n\n/** Controls that take a horizontal drag themselves. */\nconst OWN_DRAG = 'input, textarea, select, [contenteditable]:not([contenteditable=\"false\"]), [role=\"slider\"]'\n\ntype Gesture = {\n pointerId: number\n x: number\n y: number\n start: number\n /** Undecided while within the slop, then a swipe (true) or a scroll (false). */\n swiping: boolean | undefined\n rtl: boolean\n widths: Record<SwipeActionsSide, number>\n rowWidth: number\n /** Removes the listeners for the end of the gesture. */\n detach: () => void\n}\n\n/** The open row: opening another one closes it, as a list keeps one row open. */\nlet closeOpenRow: (() => void) | null = null\n\n/** The row keeps the finger past its edges; a pointer that is no longer active (it lifted between events) cannot be held. */\nconst capture = (element: Element, pointerId: number) => {\n try {\n element.setPointerCapture?.(pointerId)\n } catch {\n // The swipe goes on with the events the row still gets.\n }\n}\n\nconst sideOf = (offset: number): SwipeActionsSide | undefined =>\n offset > 0 ? \"leading\" : offset < 0 ? \"trailing\" : undefined\n\n/**\n * Where the content goes for a swipe of `raw` px toward the trailing edge (negative: toward the leading edge), and\n * whether that is a full swipe. A side without actions stays shut. Past its actions the content follows the finger\n * where a full swipe is allowed, and a third as fast where it is not; past the middle between the open actions and\n * the far edge of the row the swipe is full.\n */\nexport const swipeActionsOffset = (\n raw: number,\n widths: Record<SwipeActionsSide, number>,\n rowWidth: number,\n fullSwipe: boolean,\n): { offset: number; full: boolean } => {\n const side = sideOf(raw)\n const width = side ? widths[side] : 0\n if (!side || !(width > 0)) return { offset: 0, full: false }\n const sign = Math.sign(raw)\n const distance = Math.abs(raw)\n if (distance <= width) return { offset: raw, full: false }\n if (!fullSwipe) return { offset: sign * (width + (distance - width) / 3), full: false }\n const travel = Math.min(distance, Math.max(width, rowWidth))\n return { offset: sign * travel, full: travel >= (width + rowWidth) / 2 }\n}\n\n/**\n * Actions behind a row of a list, as the swipe actions of an iOS list: a swipe toward the leading edge reveals the\n * trailing actions, a swipe toward the trailing edge the leading ones, and a full swipe runs the first action of\n * that side. The row is a `data-row` of a FieldGroup. Each action is also a button in the order of the screen, and\n * the focus on one shows its side.\n */\nexport function SwipeActions({\n leading = [],\n trailing = [],\n labelPlacement = \"hidden\",\n fullSwipe = true,\n className,\n children,\n}: SwipeActionsProps) {\n const [offset, setOffset] = useState(0)\n const [full, setFull] = useState(false)\n const [swiping, setSwiping] = useState(false)\n const [rtl, setRtl] = useState(false)\n const root = useRef<HTMLDivElement>(null)\n const sides = useRef<Record<SwipeActionsSide, HTMLDivElement | null>>({ leading: null, trailing: null })\n const gesture = useRef<Gesture | null>(null)\n const current = useRef({ offset: 0, full: false })\n const suppressClick = useRef(false)\n const observer = useRef<ResizeObserver | null>(null)\n const actionsRef = useLatestValue({ leading, trailing })\n const revealed = sideOf(offset)\n\n const widthOf = (side: SwipeActionsSide) => sides.current[side]?.getBoundingClientRect().width ?? 0\n\n const isRtl = () => !!root.current && getComputedStyle(root.current).direction === \"rtl\"\n\n const move = (next: number, nextFull = false) => {\n current.current = { offset: next, full: nextFull }\n setOffset(next)\n setFull(nextFull)\n }\n\n /** Lets go of the gesture: the listeners for its end go, and the row no longer follows the finger. */\n const release = () => {\n const state = gesture.current\n gesture.current = null\n state?.detach()\n return state\n }\n\n /** The handlers of the latest render, for listeners and observers set up once. */\n const latest = useRef({ close: () => {}, release, finish: () => {}, cancel: () => {}, sync: () => {} })\n\n /** One function for the life of the row, so the list knows which row is open; another row that opens ends this one's gesture too. */\n const closer = useRef(() => {\n const state = latest.current.release()\n if (state) {\n setSwiping(false)\n // The finger of the ended swipe still lifts over this row: its click is not a click on the content.\n if (state.swiping) suppressClick.current = true\n }\n latest.current.close()\n }).current\n\n const close = () => {\n if (closeOpenRow === closer) closeOpenRow = null\n move(0)\n }\n\n /** This row takes the place of the open one. */\n const claim = () => {\n if (closeOpenRow && closeOpenRow !== closer) closeOpenRow()\n closeOpenRow = closer\n }\n\n /** Shows a side as wide as its actions (`width` when known), or closes the row when that side has none (any more). */\n const open = (side: SwipeActionsSide, width = widthOf(side)) => {\n if (!(width > 0)) return close()\n claim()\n setRtl(isRtl())\n move(side === \"leading\" ? width : -width)\n }\n\n /** An open row follows its actions: more of them, other labels or another width move it to their new width. */\n const sync = () => {\n const side = sideOf(current.current.offset)\n if (!side || gesture.current?.swiping || current.current.full) return\n const width = widthOf(side)\n if (!(width > 0)) return close()\n const target = side === \"leading\" ? width : -width\n if (target !== current.current.offset) move(target)\n }\n\n const settle = (state: Gesture) => {\n const { offset: last, full: wasFull } = current.current\n const side = sideOf(last)\n if (!side) return close()\n if (wasFull) {\n actionsRef.current[side][0]?.onSelect?.()\n return close()\n }\n // The widths from the start of the swipe: a full swipe may have stretched the actions since.\n if (Math.abs(last) >= state.widths[side] / 2) open(side, state.widths[side])\n else close()\n }\n\n /** The finger lifted (anywhere): a swipe settles, a press on an open row closes it. */\n const finish = () => {\n const state = release()\n if (!state) return\n if (state.swiping) {\n suppressClick.current = true\n setSwiping(false)\n settle(state)\n } else if (state.start !== 0) {\n if (state.swiping === undefined) suppressClick.current = true\n close()\n }\n }\n\n /** The browser took the gesture (a scroll) or the row lost the finger: the row goes back to where it was. */\n const cancel = () => {\n const state = release()\n if (!state) return\n setSwiping(false)\n const side = sideOf(state.start)\n if (state.swiping && side) open(side, state.widths[side])\n else close()\n }\n\n latest.current = { close, release, finish, cancel, sync }\n\n // After each render, and whenever the actions change size, an open row takes their width.\n useEffect(() => {\n latest.current.sync()\n for (const element of [sides.current.leading, sides.current.trailing]) if (element) observer.current?.observe(element, BORDER_BOX)\n })\n\n useEffect(() => {\n if (typeof ResizeObserver !== \"undefined\") observer.current = new ResizeObserver(() => latest.current.sync())\n for (const element of [sides.current.leading, sides.current.trailing]) if (element) observer.current?.observe(element, BORDER_BOX)\n // The open row lets go of the list, and of the finger, when it goes away.\n return () => {\n observer.current?.disconnect()\n observer.current = null\n latest.current.release()\n if (closeOpenRow === closer) closeOpenRow = null\n }\n }, [closer, latest])\n\n // A press anywhere outside the open row closes it.\n useEffect(() => {\n if (!revealed || swiping) return\n const handlePointerDown = (event: globalThis.PointerEvent) => {\n if (event.target instanceof Node && root.current?.contains(event.target)) return\n latest.current.close()\n }\n document.addEventListener(\"pointerdown\", handlePointerDown, true)\n return () => document.removeEventListener(\"pointerdown\", handlePointerDown, true)\n }, [revealed, swiping, latest])\n\n const handlePointerDown = (event: PointerEvent<HTMLDivElement>) => {\n if (event.button !== 0 || gesture.current) return\n // A new press of the primary pointer starts clean: a swipe that another row ended and that was then cancelled leaves\n // no click to swallow. Another finger's press keeps it, as only the primary pointer clicks.\n if (event.isPrimary) suppressClick.current = false\n if (leading.length < 1 && trailing.length < 1) return\n // A drag in a text field or along a slider belongs to that control.\n if (event.target instanceof Element && event.target.closest(OWN_DRAG)) return\n const pointerId = event.pointerId\n // The end of the gesture is heard wherever the finger lifts, inside the row or not.\n const handleUp = (end: globalThis.PointerEvent) => {\n if (end.pointerId === pointerId) latest.current.finish()\n }\n const handleCancel = (end: globalThis.PointerEvent) => {\n if (end.pointerId === pointerId) latest.current.cancel()\n }\n window.addEventListener(\"pointerup\", handleUp, true)\n window.addEventListener(\"pointercancel\", handleCancel, true)\n gesture.current = {\n pointerId,\n x: event.clientX,\n y: event.clientY,\n start: current.current.offset,\n swiping: undefined,\n rtl: isRtl(),\n widths: { leading: widthOf(\"leading\"), trailing: widthOf(\"trailing\") },\n rowWidth: root.current?.clientWidth ?? 0,\n detach: () => {\n window.removeEventListener(\"pointerup\", handleUp, true)\n window.removeEventListener(\"pointercancel\", handleCancel, true)\n },\n }\n }\n\n const handlePointerMove = (event: PointerEvent<HTMLDivElement>) => {\n const state = gesture.current\n if (!state || state.pointerId !== event.pointerId || state.swiping === false) return\n const across = (event.clientX - state.x) * (state.rtl ? -1 : 1)\n const down = event.clientY - state.y\n if (state.swiping === undefined) {\n if (Math.abs(across) < SLOP && Math.abs(down) < SLOP) return\n if (Math.abs(across) <= Math.abs(down)) {\n state.swiping = false\n return\n }\n state.swiping = true\n capture(event.currentTarget, event.pointerId)\n window.getSelection?.()?.removeAllRanges()\n claim()\n setRtl(state.rtl)\n setSwiping(true)\n }\n const next = swipeActionsOffset(state.start + across, state.widths, state.rowWidth, fullSwipe)\n move(next.offset, next.full)\n }\n\n /** The content lost the finger it held. A child that loses the finger to the content (as a touch moves its implicit capture) ends nothing. */\n const handleLostPointerCapture = (event: PointerEvent<HTMLDivElement>) => {\n if (event.target === event.currentTarget && gesture.current?.pointerId === event.pointerId) cancel()\n }\n\n /** A swipe or a press that closed the row is not a click on the content; a click from the keys still is. */\n const handleClickCapture = (event: MouseEvent<HTMLDivElement>) => {\n if (!suppressClick.current || event.detail === 0) return\n suppressClick.current = false\n event.preventDefault()\n event.stopPropagation()\n }\n\n /** The focus on an action shows its side; on the content it closes the row. */\n const handleFocus = (event: FocusEvent<HTMLDivElement>) => {\n if (gesture.current?.swiping) return\n const side = ([\"leading\", \"trailing\"] as const).find((name) => sides.current[name]?.contains(event.target))\n if (side) {\n if (sideOf(current.current.offset) !== side) open(side)\n } else if (current.current.offset !== 0) {\n close()\n }\n }\n\n const handleBlur = (event: FocusEvent<HTMLDivElement>) => {\n if (gesture.current?.swiping) return\n if (event.relatedTarget instanceof Node && root.current?.contains(event.relatedTarget)) return\n if (current.current.offset !== 0) close()\n }\n\n const select = (action: SwipeAction, event: MouseEvent<HTMLButtonElement>) => {\n action.onSelect?.()\n // A press closes the row, as iOS does. From the keys the action keeps the focus, so its side stays open until\n // the focus leaves the row.\n if (event.detail === 0) return\n event.currentTarget.blur()\n close()\n }\n\n const renderSide = (side: SwipeActionsSide, actions: SwipeAction[]) => {\n if (actions.length < 1) return null\n const shown = side === \"leading\" ? actions : [...actions].reverse()\n const isFull = full && revealed === side\n return (\n <div\n ref={(element) => {\n sides.current[side] = element\n }}\n className={s.Actions}\n data-side={side}\n data-full={isFull ? \"\" : undefined}\n style={isFull ? { width: Math.abs(offset) } : undefined}\n >\n {shown.map((action) => {\n const color = action.color ?? \"secondary\"\n const labelInside = labelPlacement === \"inside\" || !action.Icon\n const labelBelow = labelPlacement === \"below\" && !!action.Icon\n return (\n <button\n key={action.id}\n type=\"button\"\n className={s.Action}\n data-color={color}\n data-first={action === actions[0] ? \"\" : undefined}\n aria-label={labelInside || labelBelow ? undefined : action.label}\n onClick={(event) => select(action, event)}\n >\n <span className={s.Capsule}>\n {action.Icon && <action.Icon className={s.Icon} aria-hidden=\"true\" />}\n {labelInside && <span className={s.Label}>{action.label}</span>}\n </span>\n {labelBelow && <span className={s.Caption}>{action.label}</span>}\n </button>\n )\n })}\n </div>\n )\n }\n\n return (\n <div\n ref={root}\n className={clsx(s.SwipeActions, className)}\n data-row=\"\"\n data-swipe-actions=\"\"\n data-label-placement={labelPlacement}\n data-revealed={revealed}\n data-swiping={swiping ? \"\" : undefined}\n onFocus={handleFocus}\n onBlur={handleBlur}\n >\n {renderSide(\"leading\", leading)}\n <div\n className={s.Content}\n data-swipe-content=\"\"\n style={offset !== 0 ? { \"--swipe-actions-offset\": `${rtl ? -offset : offset}px` } as CSSProperties : undefined}\n onPointerDown={handlePointerDown}\n onPointerMove={handlePointerMove}\n onLostPointerCapture={handleLostPointerCapture}\n onClickCapture={handleClickCapture}\n >\n {children}\n </div>\n {renderSide(\"trailing\", trailing)}\n </div>\n )\n}\n"]}
@@ -0,0 +1,2 @@
1
+ export { SwipeActions, swipeActionsOffset } from "./SwipeActions.js";
2
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/SwipeActions/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAA0F,MAAM,gBAAgB,CAAA","sourcesContent":["export { SwipeActions, swipeActionsOffset, type SwipeAction, type SwipeActionColor, type SwipeActionsProps, type SwipeActionsSide } from \"./SwipeActions\"\n"]}
@@ -18,10 +18,10 @@ function useTabBarContext(part) {
18
18
  /**
19
19
  * The tab bar of a phone screen after the iOS 26 kit Tab Bar - iPhone (507:24689): two to five tabs, each a
20
20
  * symbol over a label, in a floating glass capsule at the bottom, the selected tab on a pill, and an optional
21
- * search tab in a circle of its own. It minimizes to the selected tab while the content scrolls down. A desktop
22
- * layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.
21
+ * search or prominent tab in a circle of its own. It minimizes to the selected tab while the content scrolls
22
+ * down. A desktop layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.
23
23
  */
24
- function TabBarRoot({ value: valueProp, defaultValue, onValueChange, search, minimizeBehavior = "never", minimized: minimizedProp, defaultMinimized = false, onMinimizedChange, background = "soft", "aria-label": ariaLabel = "Tabs", children, className, ref, }) {
24
+ function TabBarRoot({ value: valueProp, defaultValue, onValueChange, search, prominent, minimizeBehavior = "never", minimized: minimizedProp, defaultMinimized = false, onMinimizedChange, background = "soft", "aria-label": ariaLabel = "Tabs", children, className, ref, }) {
25
25
  const host = useContext(ToolbarHostContext);
26
26
  const [internalValue, setInternalValue] = useState(defaultValue);
27
27
  const value = valueProp ?? internalValue;
@@ -90,7 +90,7 @@ function TabBarRoot({ value: valueProp, defaultValue, onValueChange, search, min
90
90
  return () => { observer?.disconnect(); setHeight("bottom", undefined); };
91
91
  }, [setHeight]);
92
92
  const context = { value, minimized, select, expand };
93
- return (_jsx("nav", { ref: setRef, "aria-label": ariaLabel, className: clsx(s.TabBar, className), "data-host": host?.kind, "data-background": background, "data-content-below": host?.contentBelow ? "" : undefined, "data-minimized": minimized ? "" : undefined, "data-search": search ? "" : undefined, children: _jsxs(TabBarContext.Provider, { value: context, children: [_jsx("div", { className: s.Tabs, children: children }), search && (_jsx(TabBarItem, { className: s.Search, value: search.value, label: search.label ?? "Search", icon: _jsx(SearchIcon, {}), hideLabel: true }))] }) }));
93
+ return (_jsx("nav", { ref: setRef, "aria-label": ariaLabel, className: clsx(s.TabBar, className), "data-host": host?.kind, "data-background": background, "data-content-below": host?.contentBelow ? "" : undefined, "data-minimized": minimized ? "" : undefined, "data-search": search && !prominent ? "" : undefined, "data-prominent": prominent ? "" : undefined, children: _jsxs(TabBarContext.Provider, { value: context, children: [_jsxs("div", { className: s.Tabs, children: [children, search && prominent && _jsx(TabBarItem, { value: search.value, label: search.label ?? "Search", icon: _jsx(SearchIcon, {}) })] }), prominent ? (_jsx(TabBarItem, { className: s.Prominent, value: prominent.value, label: prominent.label, icon: prominent.icon, hideLabel: true })) : search && (_jsx(TabBarItem, { className: s.Search, value: search.value, label: search.label ?? "Search", icon: _jsx(SearchIcon, {}), hideLabel: true }))] }) }));
94
94
  }
95
95
  TabBarRoot.displayName = "TabBar";
96
96
  function TabBarItem({ value, label, icon, href, disabled = false, onClick, className, hideLabel = false }) {
@@ -1 +1 @@
1
- {"version":3,"file":"TabBar.js","sourceRoot":"","sources":["../../../../src/components/TabBar/TabBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,CAAC,MAAM,oDAAoD,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,SAAS,CAAA;AAC9C,OAAO,EAAE,kBAAkB,EAAsB,MAAM,oBAAoB,CAAA;AAE3E,2FAA2F;AAC3F,MAAM,cAAc,GAAG,CAAC,CAAA;AASxB,MAAM,aAAa,GAAG,aAAa,CAA4B,IAAI,CAAC,CAAA;AAEpE,SAAS,gBAAgB,CAAC,IAAY;IACpC,MAAM,OAAO,GAAG,UAAU,CAAC,aAAa,CAAC,CAAA;IACzC,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,6BAA6B,CAAC,CAAA;IACnE,OAAO,OAAO,CAAA;AAChB,CAA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AAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport s from \"@plexui/styles/components/TabBar/TabBar.module.css\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { Search as SearchIcon } from \"../Icon\"\nimport { ToolbarHostContext, type BarBackground } from \"../Toolbar/Toolbar\"\n\n/** A scroll of at least this many pixels in one direction minimizes or expands the bar. */\nconst MINIMIZE_AFTER = 8\n\ntype TabBarContextValue = {\n value: string | undefined\n minimized: boolean\n select: (value: string) => void\n expand: () => void\n}\n\nconst TabBarContext = createContext<TabBarContextValue | null>(null)\n\nfunction useTabBarContext(part: string) {\n const context = useContext(TabBarContext)\n if (!context) throw new Error(`${part} must be used within TabBar`)\n return context\n}\n\nexport type TabBarSearch = {\n /** The value of the search tab. */\n value: string\n /** Accessible name of the search tab. @default \"Search\" */\n label?: string\n}\n\nexport type TabBarProps = {\n /** The controlled value of the selected tab. Use with `onValueChange`. */\n value?: string\n /** The selected tab when it is initially rendered. */\n defaultValue?: string\n /** Called with the value of the tab a person selects. */\n onValueChange?: (value: string) => void\n /** A search tab in a glass circle of its own at the trailing end, as the iOS 26 separate search tab. */\n search?: TabBarSearch\n /**\n * `onScrollDown` minimizes the bar to the selected tab while the content of the `Page` scrolls down and\n * expands it when the content scrolls back up; a tap on the minimized tab expands it too. @default \"never\"\n */\n minimizeBehavior?: \"never\" | \"onScrollDown\"\n /** Controlled minimized state. Use with `onMinimizedChange`. */\n minimized?: boolean\n /** The minimized state when it is initially rendered. @default false */\n defaultMinimized?: boolean\n /** Called when the bar minimizes or expands. */\n onMinimizedChange?: (minimized: boolean) => void\n /** How the bar meets the content scrolled under it; see `BarBackground`. @default \"soft\" */\n background?: BarBackground\n /** Accessible name of the navigation. @default \"Tabs\" */\n \"aria-label\"?: string\n /** `TabBar.Item` elements. */\n children?: ReactNode\n /** CSS classes applied to the bar */\n className?: string\n ref?: Ref<HTMLElement>\n}\n\n/**\n * The tab bar of a phone screen after the iOS 26 kit Tab Bar - iPhone (507:24689): two to five tabs, each a\n * symbol over a label, in a floating glass capsule at the bottom, the selected tab on a pill, and an optional\n * search tab in a circle of its own. It minimizes to the selected tab while the content scrolls down. A desktop\n * layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.\n */\nfunction TabBarRoot({\n value: valueProp,\n defaultValue,\n onValueChange,\n search,\n minimizeBehavior = \"never\",\n minimized: minimizedProp,\n defaultMinimized = false,\n onMinimizedChange,\n background = \"soft\",\n \"aria-label\": ariaLabel = \"Tabs\",\n children,\n className,\n ref,\n}: TabBarProps) {\n const host = useContext(ToolbarHostContext)\n const [internalValue, setInternalValue] = useState(defaultValue)\n const value = valueProp ?? internalValue\n const [internalMinimized, setInternalMinimized] = useState(defaultMinimized)\n const minimized = minimizedProp ?? internalMinimized\n const onValueChangeRef = useLatestValue(onValueChange)\n const onMinimizedChangeRef = useLatestValue(onMinimizedChange)\n const minimizedRef = useLatestValue(minimized)\n const controlledMinimized = minimizedProp !== undefined\n\n const select = useCallback((next: string) => {\n if (valueProp === undefined) setInternalValue(next)\n onValueChangeRef.current?.(next)\n }, [valueProp, onValueChangeRef])\n\n const setMinimized = useCallback((next: boolean) => {\n if (next === minimizedRef.current) return\n // A controlled state changes only when the owner passes it back.\n if (!controlledMinimized) {\n minimizedRef.current = next\n setInternalMinimized(next)\n }\n onMinimizedChangeRef.current?.(next)\n }, [controlledMinimized, minimizedRef, onMinimizedChangeRef])\n\n const expand = useCallback(() => setMinimized(false), [setMinimized])\n\n // The bar follows the Page content: down by MINIMIZE_AFTER minimizes it, up by as much (or the top) expands it.\n const subscribeScroll = host?.subscribeScroll\n useEffect(() => {\n if (minimizeBehavior !== \"onScrollDown\" || !subscribeScroll) return\n let anchor = 0\n return subscribeScroll((scrollTop) => {\n if (scrollTop <= 0) {\n anchor = 0\n return setMinimized(false)\n }\n const delta = scrollTop - anchor\n if (minimizedRef.current ? delta < 0 : delta > 0) {\n if (Math.abs(delta) >= MINIMIZE_AFTER) {\n anchor = scrollTop\n setMinimized(!minimizedRef.current)\n }\n return\n }\n anchor = scrollTop\n })\n }, [minimizeBehavior, subscribeScroll, setMinimized, minimizedRef])\n\n const element = useRef<HTMLElement | null>(null)\n const setRef = useCallback((node: HTMLElement | null) => {\n element.current = node\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n\n // Like a bottom Toolbar, the bar reserves its height on the Page; a desktop layout hides it.\n const setHeight = host?.setHeight\n useLayoutEffect(() => {\n const bar = element.current\n if (!bar || !setHeight) return\n const update = () => setHeight(\"bottom\", bar.offsetHeight || undefined)\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(bar, { box: \"border-box\" })\n return () => { observer?.disconnect(); setHeight(\"bottom\", undefined) }\n }, [setHeight])\n\n const context = { value, minimized, select, expand }\n\n return (\n <nav\n ref={setRef}\n aria-label={ariaLabel}\n className={clsx(s.TabBar, className)}\n data-host={host?.kind}\n data-background={background}\n data-content-below={host?.contentBelow ? \"\" : undefined}\n data-minimized={minimized ? \"\" : undefined}\n data-search={search ? \"\" : undefined}\n >\n <TabBarContext.Provider value={context}>\n <div className={s.Tabs}>{children}</div>\n {search && (\n <TabBarItem className={s.Search} value={search.value} label={search.label ?? \"Search\"} icon={<SearchIcon />} hideLabel />\n )}\n </TabBarContext.Provider>\n </nav>\n )\n}\nTabBarRoot.displayName = \"TabBar\"\n\nexport type TabBarItemProps = {\n /** The value of the tab. */\n value: string\n /** The label under the symbol, and the accessible name of the tab. */\n label: string\n /** The symbol, a PlexUI icon. */\n icon: ReactNode\n /** Makes the tab a link to this URL. */\n href?: string\n /** When `true`, the tab cannot be selected. */\n disabled?: boolean\n /** Called when the tab is pressed, before it is selected. */\n onClick?: (event: MouseEvent<HTMLElement>) => void\n /** CSS classes applied to the tab */\n className?: string\n /** @internal The search tab shows its symbol only. */\n hideLabel?: boolean\n}\n\nfunction TabBarItem({ value, label, icon, href, disabled = false, onClick, className, hideLabel = false }: TabBarItemProps) {\n const context = useTabBarContext(\"TabBar.Item\")\n const selected = context.value === value\n // A minimized bar shows the selected tab only; pressing it brings the other tabs back.\n const collapsed = context.minimized && selected && !hideLabel\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n onClick?.(event)\n if (event.defaultPrevented || disabled) return\n if (collapsed) {\n event.preventDefault()\n return context.expand()\n }\n context.select(value)\n }\n const content = (\n <>\n <span className={s.Icon} aria-hidden=\"true\">{icon}</span>\n {!hideLabel && <span className={s.Label}>{label}</span>}\n </>\n )\n const props = {\n \"className\": clsx(s.Item, className),\n \"aria-current\": selected ? (\"page\" as const) : undefined,\n \"aria-label\": hideLabel ? label : undefined,\n \"aria-expanded\": collapsed ? false : undefined,\n \"data-selected\": selected ? \"\" : undefined,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-value\": value,\n \"onClick\": handleClick,\n }\n if (href !== undefined && !disabled) return <a href={href} {...props}>{content}</a>\n return <button type=\"button\" disabled={disabled} {...props}>{content}</button>\n}\nTabBarItem.displayName = \"TabBar.Item\"\n\nexport const TabBar = Object.assign(TabBarRoot, { Item: TabBarItem })\n"]}
1
+ {"version":3,"file":"TabBar.js","sourceRoot":"","sources":["../../../../src/components/TabBar/TabBar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,SAAS,EACT,eAAe,EACf,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,CAAC,MAAM,oDAAoD,CAAA;AAClE,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,MAAM,IAAI,UAAU,EAAE,MAAM,SAAS,CAA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M,KAAK,GAAG;QACZ,WAAW,EAAE,IAAI,CAAC,CAAC,CAAC,IAAI,EAAE,SAAS,CAAC;QACpC,cAAc,EAAE,QAAQ,CAAC,CAAC,CAAE,MAAgB,CAAC,CAAC,CAAC,SAAS;QACxD,YAAY,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAC3C,eAAe,EAAE,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;QAC9C,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAC1C,eAAe,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,SAAS;QAC1C,YAAY,EAAE,KAAK;QACnB,SAAS,EAAE,WAAW;KACvB,CAAA;IACD,IAAI,IAAI,KAAK,SAAS,IAAI,CAAC,QAAQ;QAAE,OAAO,YAAG,IAAI,EAAE,IAAI,KAAM,KAAK,YAAG,OAAO,GAAK,CAAA;IACnF,OAAO,iBAAQ,IAAI,EAAC,QAAQ,EAAC,QAAQ,EAAE,QAAQ,KAAM,KAAK,YAAG,OAAO,GAAU,CAAA;AAChF,CAAC;AACD,UAAU,CAAC,WAAW,GAAG,aAAa,CAAA;AAEtC,MAAM,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useCallback,\n useContext,\n useEffect,\n useLayoutEffect,\n useRef,\n useState,\n type MouseEvent,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport s from \"@plexui/styles/components/TabBar/TabBar.module.css\"\nimport { useLatestValue } from \"../../hooks/useLatestValue\"\nimport { Search as SearchIcon } from \"../Icon\"\nimport { ToolbarHostContext, type BarBackground } from \"../Toolbar/Toolbar\"\n\n/** A scroll of at least this many pixels in one direction minimizes or expands the bar. */\nconst MINIMIZE_AFTER = 8\n\ntype TabBarContextValue = {\n value: string | undefined\n minimized: boolean\n select: (value: string) => void\n expand: () => void\n}\n\nconst TabBarContext = createContext<TabBarContextValue | null>(null)\n\nfunction useTabBarContext(part: string) {\n const context = useContext(TabBarContext)\n if (!context) throw new Error(`${part} must be used within TabBar`)\n return context\n}\n\nexport type TabBarSearch = {\n /** The value of the search tab. */\n value: string\n /** Accessible name of the search tab. @default \"Search\" */\n label?: string\n}\n\nexport type TabBarProminent = {\n /** The value of the prominent tab. */\n value: string\n /** Accessible name of the prominent tab: its circle shows the symbol only. */\n label: string\n /** The symbol, a PlexUI icon. */\n icon: ReactNode\n}\n\nexport type TabBarProps = {\n /** The controlled value of the selected tab. Use with `onValueChange`. */\n value?: string\n /** The selected tab when it is initially rendered. */\n defaultValue?: string\n /** Called with the value of the tab a person selects. */\n onValueChange?: (value: string) => void\n /** A search tab in a glass circle of its own at the trailing end, as the iOS 26 separate search tab. */\n search?: TabBarSearch\n /**\n * The one destination the app lifts out of the capsule, a cart or a library, in a glass circle of its own at\n * the trailing end, as the iOS 27 prominent tab role. It takes the circle of the search tab: with both, search\n * is the last tab of the capsule, as iOS gives search that place only when no other tab is prominent.\n */\n prominent?: TabBarProminent\n /**\n * `onScrollDown` minimizes the bar to the selected tab while the content of the `Page` scrolls down and\n * expands it when the content scrolls back up; a tap on the minimized tab expands it too. @default \"never\"\n */\n minimizeBehavior?: \"never\" | \"onScrollDown\"\n /** Controlled minimized state. Use with `onMinimizedChange`. */\n minimized?: boolean\n /** The minimized state when it is initially rendered. @default false */\n defaultMinimized?: boolean\n /** Called when the bar minimizes or expands. */\n onMinimizedChange?: (minimized: boolean) => void\n /** How the bar meets the content scrolled under it; see `BarBackground`. @default \"soft\" */\n background?: BarBackground\n /** Accessible name of the navigation. @default \"Tabs\" */\n \"aria-label\"?: string\n /** `TabBar.Item` elements. */\n children?: ReactNode\n /** CSS classes applied to the bar */\n className?: string\n ref?: Ref<HTMLElement>\n}\n\n/**\n * The tab bar of a phone screen after the iOS 26 kit Tab Bar - iPhone (507:24689): two to five tabs, each a\n * symbol over a label, in a floating glass capsule at the bottom, the selected tab on a pill, and an optional\n * search or prominent tab in a circle of its own. It minimizes to the selected tab while the content scrolls\n * down. A desktop layout navigates with a Sidebar or Tabs, so the bar never renders from 768px up.\n */\nfunction TabBarRoot({\n value: valueProp,\n defaultValue,\n onValueChange,\n search,\n prominent,\n minimizeBehavior = \"never\",\n minimized: minimizedProp,\n defaultMinimized = false,\n onMinimizedChange,\n background = \"soft\",\n \"aria-label\": ariaLabel = \"Tabs\",\n children,\n className,\n ref,\n}: TabBarProps) {\n const host = useContext(ToolbarHostContext)\n const [internalValue, setInternalValue] = useState(defaultValue)\n const value = valueProp ?? internalValue\n const [internalMinimized, setInternalMinimized] = useState(defaultMinimized)\n const minimized = minimizedProp ?? internalMinimized\n const onValueChangeRef = useLatestValue(onValueChange)\n const onMinimizedChangeRef = useLatestValue(onMinimizedChange)\n const minimizedRef = useLatestValue(minimized)\n const controlledMinimized = minimizedProp !== undefined\n\n const select = useCallback((next: string) => {\n if (valueProp === undefined) setInternalValue(next)\n onValueChangeRef.current?.(next)\n }, [valueProp, onValueChangeRef])\n\n const setMinimized = useCallback((next: boolean) => {\n if (next === minimizedRef.current) return\n // A controlled state changes only when the owner passes it back.\n if (!controlledMinimized) {\n minimizedRef.current = next\n setInternalMinimized(next)\n }\n onMinimizedChangeRef.current?.(next)\n }, [controlledMinimized, minimizedRef, onMinimizedChangeRef])\n\n const expand = useCallback(() => setMinimized(false), [setMinimized])\n\n // The bar follows the Page content: down by MINIMIZE_AFTER minimizes it, up by as much (or the top) expands it.\n const subscribeScroll = host?.subscribeScroll\n useEffect(() => {\n if (minimizeBehavior !== \"onScrollDown\" || !subscribeScroll) return\n let anchor = 0\n return subscribeScroll((scrollTop) => {\n if (scrollTop <= 0) {\n anchor = 0\n return setMinimized(false)\n }\n const delta = scrollTop - anchor\n if (minimizedRef.current ? delta < 0 : delta > 0) {\n if (Math.abs(delta) >= MINIMIZE_AFTER) {\n anchor = scrollTop\n setMinimized(!minimizedRef.current)\n }\n return\n }\n anchor = scrollTop\n })\n }, [minimizeBehavior, subscribeScroll, setMinimized, minimizedRef])\n\n const element = useRef<HTMLElement | null>(null)\n const setRef = useCallback((node: HTMLElement | null) => {\n element.current = node\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n\n // Like a bottom Toolbar, the bar reserves its height on the Page; a desktop layout hides it.\n const setHeight = host?.setHeight\n useLayoutEffect(() => {\n const bar = element.current\n if (!bar || !setHeight) return\n const update = () => setHeight(\"bottom\", bar.offsetHeight || undefined)\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(bar, { box: \"border-box\" })\n return () => { observer?.disconnect(); setHeight(\"bottom\", undefined) }\n }, [setHeight])\n\n const context = { value, minimized, select, expand }\n\n return (\n <nav\n ref={setRef}\n aria-label={ariaLabel}\n className={clsx(s.TabBar, className)}\n data-host={host?.kind}\n data-background={background}\n data-content-below={host?.contentBelow ? \"\" : undefined}\n data-minimized={minimized ? \"\" : undefined}\n data-search={search && !prominent ? \"\" : undefined}\n data-prominent={prominent ? \"\" : undefined}\n >\n <TabBarContext.Provider value={context}>\n <div className={s.Tabs}>\n {children}\n {search && prominent && <TabBarItem value={search.value} label={search.label ?? \"Search\"} icon={<SearchIcon />} />}\n </div>\n {prominent ? (\n <TabBarItem className={s.Prominent} value={prominent.value} label={prominent.label} icon={prominent.icon} hideLabel />\n ) : search && (\n <TabBarItem className={s.Search} value={search.value} label={search.label ?? \"Search\"} icon={<SearchIcon />} hideLabel />\n )}\n </TabBarContext.Provider>\n </nav>\n )\n}\nTabBarRoot.displayName = \"TabBar\"\n\nexport type TabBarItemProps = {\n /** The value of the tab. */\n value: string\n /** The label under the symbol, and the accessible name of the tab. */\n label: string\n /** The symbol, a PlexUI icon. */\n icon: ReactNode\n /** Makes the tab a link to this URL. */\n href?: string\n /** When `true`, the tab cannot be selected. */\n disabled?: boolean\n /** Called when the tab is pressed, before it is selected. */\n onClick?: (event: MouseEvent<HTMLElement>) => void\n /** CSS classes applied to the tab */\n className?: string\n /** @internal The search and the prominent tab show their symbol only. */\n hideLabel?: boolean\n}\n\nfunction TabBarItem({ value, label, icon, href, disabled = false, onClick, className, hideLabel = false }: TabBarItemProps) {\n const context = useTabBarContext(\"TabBar.Item\")\n const selected = context.value === value\n // A minimized bar shows the selected tab only; pressing it brings the other tabs back.\n const collapsed = context.minimized && selected && !hideLabel\n const handleClick = (event: MouseEvent<HTMLElement>) => {\n onClick?.(event)\n if (event.defaultPrevented || disabled) return\n if (collapsed) {\n event.preventDefault()\n return context.expand()\n }\n context.select(value)\n }\n const content = (\n <>\n <span className={s.Icon} aria-hidden=\"true\">{icon}</span>\n {!hideLabel && <span className={s.Label}>{label}</span>}\n </>\n )\n const props = {\n \"className\": clsx(s.Item, className),\n \"aria-current\": selected ? (\"page\" as const) : undefined,\n \"aria-label\": hideLabel ? label : undefined,\n \"aria-expanded\": collapsed ? false : undefined,\n \"data-selected\": selected ? \"\" : undefined,\n \"data-disabled\": disabled ? \"\" : undefined,\n \"data-value\": value,\n \"onClick\": handleClick,\n }\n if (href !== undefined && !disabled) return <a href={href} {...props}>{content}</a>\n return <button type=\"button\" disabled={disabled} {...props}>{content}</button>\n}\nTabBarItem.displayName = \"TabBar.Item\"\n\nexport const TabBar = Object.assign(TabBarRoot, { Item: TabBarItem })\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/TabBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAA6D,MAAM,UAAU,CAAA","sourcesContent":["export { TabBar, type TabBarItemProps, type TabBarProps, type TabBarSearch } from \"./TabBar\"\n"]}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/TabBar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAmF,MAAM,UAAU,CAAA","sourcesContent":["export { TabBar, type TabBarItemProps, type TabBarProminent, type TabBarProps, type TabBarSearch } from \"./TabBar\"\n"]}
@@ -171,7 +171,7 @@ const TabsRoot = ({ value, onChange, children, variant = "segmented", orientatio
171
171
  const isPill = variant === "segmented" && pill;
172
172
  // Only apply flush for underline variant
173
173
  const isFlush = variant === "underline" && flush;
174
- return (_jsxs(ToggleGroup.Root, { ref: rootRef, className: clsx(s.Tabs, className), type: "single", value: value, loop: false, onValueChange: handleValueChange, onClick: onClick, "data-variant": variant, "data-orientation": orientation, "data-block": block ? "" : undefined, "data-pill": isPill ? "" : undefined, "data-flush": isFlush ? "" : undefined, "data-size": size, "data-gutter-size": gutterSize, ...restProps, children: [_jsx("div", { className: s.TabsThumb, ref: thumbRef }), _jsx(TabsVerticalContext.Provider, { value: isVertical, children: children })] }));
174
+ return (_jsxs(ToggleGroup.Root, { ref: rootRef, className: clsx(s.Tabs, className), type: "single", value: value, loop: false, onValueChange: handleValueChange, onClick: onClick, "data-variant": variant, "data-orientation": orientation, "data-block": block ? "" : undefined, "data-pill": isPill ? "" : undefined, "data-flush": isFlush ? "" : undefined, "data-size": size, "data-gutter-size": gutterSize, "data-disabled": restProps.disabled ? "" : undefined, ...restProps, children: [_jsx("div", { className: s.TabsThumb, ref: thumbRef }), _jsx(TabsVerticalContext.Provider, { value: isVertical, children: children })] }));
175
175
  };
176
176
  // Type guard for badge object form
177
177
  const isBadgeObject = (badge) => {