@plexui/ui 0.44.3 → 0.46.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/es/components/Dialog/Dialog.js +3 -3
- package/dist/es/components/Dialog/Dialog.js.map +1 -1
- package/dist/es/components/Icon/index.js +1 -0
- package/dist/es/components/Icon/index.js.map +1 -1
- package/dist/es/components/Icon/svg/MinusLg.js +5 -0
- package/dist/es/components/Icon/svg/MinusLg.js.map +1 -0
- package/dist/es/components/Page/Page.js +70 -14
- package/dist/es/components/Page/Page.js.map +1 -1
- package/dist/es/components/Slider/Slider.js +28 -4
- package/dist/es/components/Slider/Slider.js.map +1 -1
- package/dist/es/components/TabBar/TabBar.js +2 -2
- package/dist/es/components/TabBar/TabBar.js.map +1 -1
- package/dist/es/components/Tabs/Tabs.js +24 -0
- package/dist/es/components/Tabs/Tabs.js.map +1 -1
- package/dist/es/components/Tabs/segments.js +92 -0
- package/dist/es/components/Tabs/segments.js.map +1 -0
- package/dist/es/components/Toolbar/Toolbar.js +173 -26
- package/dist/es/components/Toolbar/Toolbar.js.map +1 -1
- package/dist/es/components/Toolbar/index.js.map +1 -1
- package/dist/types/components/Dialog/Dialog.d.ts +2 -2
- package/dist/types/components/Icon/index.d.ts +1 -0
- package/dist/types/components/Icon/svg/MinusLg.d.ts +6 -0
- package/dist/types/components/Page/Page.d.ts +3 -3
- package/dist/types/components/TabBar/TabBar.d.ts +3 -3
- package/dist/types/components/Tabs/segments.d.ts +19 -0
- package/dist/types/components/Toolbar/Toolbar.d.ts +38 -8
- package/dist/types/components/Toolbar/index.d.ts +1 -1
- package/package.json +2 -2
|
@@ -1,16 +1,79 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { jsx as _jsx,
|
|
2
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
3
|
import clsx from "clsx";
|
|
4
|
-
import { createContext, useCallback, useContext, useLayoutEffect, useRef, } from "react";
|
|
4
|
+
import { createContext, useCallback, useContext, useLayoutEffect, useRef, useState, } from "react";
|
|
5
|
+
import { createPortal } from "react-dom";
|
|
5
6
|
import s from "@plexui/styles/components/Toolbar/Toolbar.module.css";
|
|
7
|
+
/** The background a bar draws, from its current name or an earlier one. */
|
|
8
|
+
export const barBackground = (background) => background === "edge" ? "soft" : background === "solid" ? "hard" : background;
|
|
6
9
|
export const ToolbarHostContext = createContext(null);
|
|
7
10
|
// The title style of the top bar, which a large title on a page needs to show itself inline once scrolled.
|
|
8
11
|
const ToolbarTitleStyleContext = createContext(undefined);
|
|
12
|
+
// The bar itself, which a large title in the content marks once it has gone under the bar. It is state, so a title
|
|
13
|
+
// that mounts before its bar (a bar replaced under a page that keeps its content) follows the bar once it is there.
|
|
14
|
+
const ToolbarElementContext = createContext(null);
|
|
15
|
+
// The tokens of a large title a bar can set for itself, which the title in the content no longer inherits from it.
|
|
16
|
+
const LARGE_TITLE_TOKENS = [
|
|
17
|
+
"--toolbar-padding-bottom",
|
|
18
|
+
"--toolbar-large-title-gap",
|
|
19
|
+
"--toolbar-large-title-font-size",
|
|
20
|
+
"--toolbar-large-title-line-height",
|
|
21
|
+
"--toolbar-large-title-descent",
|
|
22
|
+
"--toolbar-large-subtitle-font-size",
|
|
23
|
+
"--toolbar-large-subtitle-line-height",
|
|
24
|
+
"--toolbar-large-subtitle-descent",
|
|
25
|
+
];
|
|
26
|
+
/**
|
|
27
|
+
* Follows a large title in the content: it takes the large title tokens the bar sets for itself, and once its last line
|
|
28
|
+
* is at the bar's bottom the bar shows it inline. Scrolling moves it; a change of layout (a wide window turning into a
|
|
29
|
+
* phone's, which shows the bar and the title) or of a class or style on the bar, the content or around them measures it
|
|
30
|
+
* again. A token the bar shares with the content stays inherited, so it follows the page's changes. A hidden title has
|
|
31
|
+
* not gone under anything.
|
|
32
|
+
*/
|
|
33
|
+
function followLargeTitle(bar, heading, subscribeScroll) {
|
|
34
|
+
const collapse = () => {
|
|
35
|
+
const box = heading.getBoundingClientRect();
|
|
36
|
+
bar.toggleAttribute("data-title-collapsed", box.height > 0 && box.bottom <= bar.getBoundingClientRect().bottom);
|
|
37
|
+
};
|
|
38
|
+
const layout = () => {
|
|
39
|
+
const own = getComputedStyle(bar);
|
|
40
|
+
const place = heading.parentElement ? getComputedStyle(heading.parentElement) : undefined;
|
|
41
|
+
for (const token of LARGE_TITLE_TOKENS) {
|
|
42
|
+
const value = own.getPropertyValue(token).trim();
|
|
43
|
+
if (value && value !== place?.getPropertyValue(token).trim())
|
|
44
|
+
heading.style.setProperty(token, value);
|
|
45
|
+
else
|
|
46
|
+
heading.style.removeProperty(token);
|
|
47
|
+
}
|
|
48
|
+
collapse();
|
|
49
|
+
};
|
|
50
|
+
layout();
|
|
51
|
+
const unsubscribe = subscribeScroll(collapse);
|
|
52
|
+
const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(layout) : undefined;
|
|
53
|
+
observer?.observe(bar);
|
|
54
|
+
observer?.observe(heading);
|
|
55
|
+
const mutations = typeof MutationObserver !== "undefined" ? new MutationObserver(layout) : undefined;
|
|
56
|
+
// A token reaches the bar or the content from the class or style of either or of anything around them.
|
|
57
|
+
for (const start of [bar, heading.parentElement]) {
|
|
58
|
+
for (let node = start; node; node = node.parentElement)
|
|
59
|
+
mutations?.observe(node, { attributes: true, attributeFilter: ["class", "style"] });
|
|
60
|
+
}
|
|
61
|
+
return () => {
|
|
62
|
+
unsubscribe();
|
|
63
|
+
observer?.disconnect();
|
|
64
|
+
mutations?.disconnect();
|
|
65
|
+
bar.removeAttribute("data-title-collapsed");
|
|
66
|
+
for (const token of LARGE_TITLE_TOKENS)
|
|
67
|
+
heading.style.removeProperty(token);
|
|
68
|
+
};
|
|
69
|
+
}
|
|
9
70
|
function ToolbarRoot({ placement = "top", titleStyle = "inline", titleAlign = "center", background = placement === "bottom" ? "soft" : "glass", className, children, ref, ...restProps }) {
|
|
10
71
|
const host = useContext(ToolbarHostContext);
|
|
11
72
|
const element = useRef(null);
|
|
73
|
+
const [barElement, setBarElement] = useState(null);
|
|
12
74
|
const setRef = useCallback((node) => {
|
|
13
75
|
element.current = node;
|
|
76
|
+
setBarElement(node);
|
|
14
77
|
if (typeof ref === "function")
|
|
15
78
|
return ref(node);
|
|
16
79
|
if (ref)
|
|
@@ -22,32 +85,15 @@ function ToolbarRoot({ placement = "top", titleStyle = "inline", titleAlign = "c
|
|
|
22
85
|
if (!bar || !setHeight)
|
|
23
86
|
return;
|
|
24
87
|
// A desktop layout hides the bar; its height then leaves the host's own header in charge.
|
|
25
|
-
const update = () =>
|
|
26
|
-
setHeight(placement, bar.offsetHeight || undefined);
|
|
27
|
-
measureLargeTitle(bar);
|
|
28
|
-
};
|
|
88
|
+
const update = () => setHeight(placement, bar.offsetHeight || undefined);
|
|
29
89
|
update();
|
|
30
90
|
const observer = typeof ResizeObserver !== "undefined" ? new ResizeObserver(update) : undefined;
|
|
31
91
|
observer?.observe(bar, { box: "border-box" });
|
|
32
92
|
return () => { observer?.disconnect(); setHeight(placement, undefined); };
|
|
33
93
|
}, [placement, setHeight]);
|
|
34
|
-
return (_jsx("div", { ref: setRef, className: clsx(s.Toolbar, className), "data-toolbar": "", "data-placement": placement, "data-title-style": placement === "top" ? titleStyle : undefined, "data-title-align": placement === "top" ? titleAlign : undefined, "data-background": background
|
|
94
|
+
return (_jsx("div", { ref: setRef, className: clsx(s.Toolbar, className), "data-toolbar": "", "data-placement": placement, "data-title-style": placement === "top" ? titleStyle : undefined, "data-title-align": placement === "top" ? titleAlign : undefined, "data-background": barBackground(background), "data-host": host?.kind, "data-scrolled": placement === "top" && host?.scrolled ? "" : undefined, "data-content-below": placement === "bottom" && host?.contentBelow ? "" : undefined, "data-rows-pinned": placement === "top" && host?.rowsPinned ? "" : undefined, ...restProps, children: _jsx(ToolbarElementContext.Provider, { value: barElement, children: _jsx(ToolbarTitleStyleContext.Provider, { value: placement === "top" ? titleStyle : undefined, children: children }) }) }));
|
|
35
95
|
}
|
|
36
96
|
ToolbarRoot.displayName = "Toolbar";
|
|
37
|
-
/**
|
|
38
|
-
* A large title on a page scrolls up with the content under the row of controls; the row shows the
|
|
39
|
-
* title inline once it has gone. The distance it travels (the gap above it and its height) goes to
|
|
40
|
-
* `--toolbar-large-title-travel`, in pixels as a number, as the page's `--page-scroll-y` is.
|
|
41
|
-
*/
|
|
42
|
-
function measureLargeTitle(bar) {
|
|
43
|
-
if (bar.dataset.titleStyle !== "large")
|
|
44
|
-
return;
|
|
45
|
-
const heading = Array.from(bar.children).find((child) => child instanceof HTMLElement && child.classList.contains(s.Heading));
|
|
46
|
-
if (!heading)
|
|
47
|
-
return;
|
|
48
|
-
const gap = Number.parseFloat(getComputedStyle(bar).rowGap) || 0;
|
|
49
|
-
bar.style.setProperty("--toolbar-large-title-travel", String(heading.offsetHeight + gap));
|
|
50
|
-
}
|
|
51
97
|
function ToolbarLeading({ className, ...restProps }) {
|
|
52
98
|
return _jsx("div", { className: clsx(s.Leading, className), ...restProps });
|
|
53
99
|
}
|
|
@@ -66,18 +112,118 @@ function ToolbarGroup({ className, ...restProps }) {
|
|
|
66
112
|
return _jsx("div", { role: "group", className: clsx(s.Group, className), ...restProps });
|
|
67
113
|
}
|
|
68
114
|
ToolbarGroup.displayName = "Toolbar.Group";
|
|
115
|
+
const rowOfAnchor = new WeakMap();
|
|
116
|
+
/**
|
|
117
|
+
* Under a large title each row is portaled into the rows' place as it mounts, so a row that comes later (a search field
|
|
118
|
+
* shown over a segmented control already there) would stand last. An empty anchor in the bar keeps the row's place among
|
|
119
|
+
* the bar's rows, and the rows are moved into that order in the content, so the keyboard and a screen reader meet them
|
|
120
|
+
* as they stand (Codex #7); a row added or removed in the bar orders them again.
|
|
121
|
+
*/
|
|
122
|
+
function followRowOrder(anchor, row) {
|
|
123
|
+
const bar = anchor.closest("[data-toolbar]") ?? anchor.parentElement;
|
|
124
|
+
if (!bar)
|
|
125
|
+
return () => { };
|
|
126
|
+
rowOfAnchor.set(anchor, row);
|
|
127
|
+
const place = () => {
|
|
128
|
+
const slot = row.parentElement;
|
|
129
|
+
if (!slot)
|
|
130
|
+
return;
|
|
131
|
+
const rows = Array.from(bar.querySelectorAll("[data-toolbar-row-anchor]"), (mark) => rowOfAnchor.get(mark))
|
|
132
|
+
.filter((each) => each?.parentElement === slot);
|
|
133
|
+
// From the last row back, a row that does not stand before the next one goes right before it: only a row out of
|
|
134
|
+
// place moves (the one that came later), so a field focused in another row keeps its focus (Codex #8); moveBefore,
|
|
135
|
+
// where the browser has it, keeps it even in the row that moves.
|
|
136
|
+
const move = slot.moveBefore;
|
|
137
|
+
for (let index = rows.length - 2; index >= 0; index--) {
|
|
138
|
+
const each = rows[index];
|
|
139
|
+
const next = rows[index + 1];
|
|
140
|
+
if (each.compareDocumentPosition(next) & Node.DOCUMENT_POSITION_FOLLOWING)
|
|
141
|
+
continue;
|
|
142
|
+
try {
|
|
143
|
+
if (move) {
|
|
144
|
+
move.call(slot, each, next);
|
|
145
|
+
continue;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
catch {
|
|
149
|
+
// falls back to a plain move
|
|
150
|
+
}
|
|
151
|
+
slot.insertBefore(each, next);
|
|
152
|
+
}
|
|
153
|
+
};
|
|
154
|
+
place();
|
|
155
|
+
const observer = typeof MutationObserver !== "undefined" ? new MutationObserver(place) : undefined;
|
|
156
|
+
observer?.observe(bar, { childList: true, subtree: true });
|
|
157
|
+
return () => {
|
|
158
|
+
observer?.disconnect();
|
|
159
|
+
rowOfAnchor.delete(anchor);
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* A row under the controls, part of the bar: a segmented control that switches the screen's views (a chat list's
|
|
164
|
+
* folders under its bar), or a search field. It spans the bar, and a control in it fills the row; several rows stand in
|
|
165
|
+
* their order (a search field over a segmented control). Under a large title on a page the rows stand under the title,
|
|
166
|
+
* at the top of the content, and once scrolled up to the bar they stay pinned under its controls, as iOS 27.2 pins a
|
|
167
|
+
* safeAreaBar under a large title's bar.
|
|
168
|
+
*/
|
|
169
|
+
function ToolbarRow({ className, ref, ...restProps }) {
|
|
170
|
+
const host = useContext(ToolbarHostContext);
|
|
171
|
+
const titleStyle = useContext(ToolbarTitleStyleContext);
|
|
172
|
+
const large = titleStyle === "large" && host?.kind === "page";
|
|
173
|
+
const requestSlot = large ? host?.requestLargeTitleSlot : undefined;
|
|
174
|
+
const slot = large ? host?.largeTitleRowSlot ?? null : null;
|
|
175
|
+
useLayoutEffect(() => requestSlot?.(), [requestSlot]);
|
|
176
|
+
const element = useRef(null);
|
|
177
|
+
const anchor = useRef(null);
|
|
178
|
+
const setRef = useCallback((node) => {
|
|
179
|
+
element.current = node;
|
|
180
|
+
if (typeof ref === "function")
|
|
181
|
+
return ref(node);
|
|
182
|
+
if (ref)
|
|
183
|
+
ref.current = node;
|
|
184
|
+
}, [ref]);
|
|
185
|
+
useLayoutEffect(() => {
|
|
186
|
+
if (!slot || !anchor.current || !element.current)
|
|
187
|
+
return;
|
|
188
|
+
return followRowOrder(anchor.current, element.current);
|
|
189
|
+
}, [slot]);
|
|
190
|
+
const row = _jsx("div", { ref: setRef, className: clsx(s.Row, className), "data-toolbar-row": "", "data-in-content": slot ? "" : undefined, ...restProps });
|
|
191
|
+
// Under a large title the row waits for its place in the content (it comes before the first paint) and never stands
|
|
192
|
+
// in the bar first: moving it from the bar into the portal would mount its children again, and a switcher that holds
|
|
193
|
+
// its own selection would lose it (Codex #5).
|
|
194
|
+
if (large)
|
|
195
|
+
return slot ? _jsxs(_Fragment, { children: [createPortal(row, slot), _jsx("span", { ref: anchor, "data-toolbar-row-anchor": "", hidden: true })] }) : null;
|
|
196
|
+
return row;
|
|
197
|
+
}
|
|
198
|
+
ToolbarRow.displayName = "Toolbar.Row";
|
|
69
199
|
function ToolbarTitle({ children, subtitle, as, className, ref, ...restProps }) {
|
|
70
200
|
const host = useContext(ToolbarHostContext);
|
|
71
201
|
const titleStyle = useContext(ToolbarTitleStyleContext);
|
|
202
|
+
const bar = useContext(ToolbarElementContext);
|
|
203
|
+
const headingRef = useRef(null);
|
|
204
|
+
const large = titleStyle === "large" && host?.kind === "page";
|
|
205
|
+
const requestSlot = large ? host?.requestLargeTitleSlot : undefined;
|
|
206
|
+
const slot = large ? host?.largeTitleSlot ?? null : null;
|
|
207
|
+
const subscribeScroll = host?.subscribeScroll;
|
|
208
|
+
useLayoutEffect(() => requestSlot?.(), [requestSlot]);
|
|
209
|
+
// In the content the title scrolls with it, on the compositor and through the overscroll, as on iOS 26. Once it has
|
|
210
|
+
// gone under the bar (its last line at the bar's bottom), the bar shows it inline and a hard or glass bar its line.
|
|
211
|
+
useLayoutEffect(() => {
|
|
212
|
+
const heading = headingRef.current;
|
|
213
|
+
if (!slot || !bar || !heading || !subscribeScroll)
|
|
214
|
+
return;
|
|
215
|
+
return followLargeTitle(bar, heading, subscribeScroll);
|
|
216
|
+
}, [bar, slot, subscribeScroll]);
|
|
72
217
|
const decorative = host?.kind === "dialog";
|
|
73
218
|
const Tag = as ?? "h1";
|
|
74
219
|
const hasSubtitle = subtitle != null && subtitle !== false && subtitle !== "";
|
|
75
|
-
const heading = (_jsxs("div", { className: s.Heading, "aria-hidden": decorative || undefined, children: [_jsx(Tag, { ref: ref, className: clsx(s.Title, className), ...restProps, children: children }), hasSubtitle && _jsx("p", { className: s.Subtitle, children: subtitle })] }));
|
|
76
|
-
if (
|
|
220
|
+
const heading = (_jsxs("div", { ref: headingRef, className: s.Heading, "aria-hidden": decorative || undefined, "data-in-content": slot ? "" : undefined, children: [_jsx(Tag, { ref: ref, className: clsx(s.Title, className), ...restProps, children: children }), hasSubtitle && _jsx("p", { className: s.Subtitle, children: subtitle })] }));
|
|
221
|
+
if (!large)
|
|
77
222
|
return heading;
|
|
78
|
-
//
|
|
79
|
-
//
|
|
80
|
-
|
|
223
|
+
// Until the content has made its place (a server-rendered page before it hydrates), the title stands in the bar
|
|
224
|
+
// where it will stand in the content. The inline copy the row of controls shows once the large title has gone
|
|
225
|
+
// under it keeps a subtitle as a second line, as in the inline title (iOS 26 kit Toolbar - Top - iPhone, Title 2 Line).
|
|
226
|
+
return (_jsxs(_Fragment, { children: [slot ? createPortal(heading, slot) : heading, _jsx("span", { className: s.CollapsedTitle, "aria-hidden": "true", children: hasSubtitle ? _jsxs(_Fragment, { children: [_jsx("span", { className: s.CollapsedLine, children: children }), _jsx("span", { className: s.CollapsedSubtitle, children: subtitle })] }) : children })] }));
|
|
81
227
|
}
|
|
82
228
|
ToolbarTitle.displayName = "Toolbar.Title";
|
|
83
229
|
/* ------------------------------------------------------------------ */
|
|
@@ -89,4 +235,5 @@ Toolbar.Title = ToolbarTitle;
|
|
|
89
235
|
Toolbar.Content = ToolbarContent;
|
|
90
236
|
Toolbar.Group = ToolbarGroup;
|
|
91
237
|
Toolbar.Trailing = ToolbarTrailing;
|
|
238
|
+
Toolbar.Row = ToolbarRow;
|
|
92
239
|
//# sourceMappingURL=Toolbar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,MAAM,GAIP,MAAM,OAAO,CAAA;AACd,OAAO,CAAC,MAAM,sDAAsD,CAAA;AAkCpE,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAA;AAEzE,2GAA2G;AAC3G,MAAM,wBAAwB,GAAG,aAAa,CAAgC,SAAS,CAAC,CAAA;AAkBxF,SAAS,WAAW,CAAC,EACnB,SAAS,GAAG,KAAK,EACjB,UAAU,GAAG,QAAQ,EACrB,UAAU,GAAG,QAAQ,EACrB,UAAU,GAAG,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,EACtD,SAAS,EACT,QAA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AExE,MAAM,CAAC,MAAM,OAAO,GAAG,WAMtB,CAAA;AAED,OAAO,CAAC,OAAO,GAAG,cAAc,CAAA;AAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;AAC5B,OAAO,CAAC,OAAO,GAAG,cAAc,CAAA;AAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;AAC5B,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport s from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\nexport type ToolbarPlacement = \"top\" | \"bottom\"\n/** Title layouts of the phone top bar. */\nexport type ToolbarTitleStyle = \"inline\" | \"large\" | \"compact-large\" | \"compact-medium\"\nexport type ToolbarTitleAlign = \"center\" | \"start\"\n/**\n * How a bar meets the content scrolled under it, after the scroll edge effect of iOS 26:\n * - `\"soft\"` (the default of a bottom bar): at the top, the canvas color covers the content under the bar's controls and fades out past them, over a\n * light blur; at the bottom of a page the content stays clear under and around the controls, as on native iOS 26,\n * and a Sheet's bottom bar fades its content into the panel\n * - `\"hard\"`: an opaque bar of the canvas color with a line once content is under it\n * - `\"glass\"` (the default of a top bar): a translucent, blurred bar with a hairline, shown once content is under it\n * - `\"solid\"`: an opaque bar of the canvas color without a line\n */\nexport type BarBackground = \"soft\" | \"hard\" | \"glass\" | \"solid\"\n/** `\"edge\"` is the earlier name of `\"soft\"`. */\nexport type ToolbarBackground = BarBackground | \"edge\"\n\n/**\n * A surface that places phone toolbars: `Page` puts the top bar over its content\n * and reserves the space; `Dialog` puts it 16px under the Sheet's top edge.\n */\nexport type ToolbarHost = {\n kind: \"page\" | \"dialog\"\n setHeight?: (placement: ToolbarPlacement, height: number | undefined) => void\n /** Content has scrolled under the top bar, so its glass casts a shadow and a hard or glass bar shows its line. */\n scrolled?: boolean\n /** Content continues under the bottom bar, so a hard or glass bar shows its line. */\n contentBelow?: boolean\n /** Calls the listener with the content's scroll offset on every scroll; returns the unsubscribe. A TabBar minimizes with it. */\n subscribeScroll?: (listener: (scrollTop: number) => void) => () => void\n}\n\nexport const ToolbarHostContext = createContext<ToolbarHost | null>(null)\n\n// The title style of the top bar, which a large title on a page needs to show itself inline once scrolled.\nconst ToolbarTitleStyleContext = createContext<ToolbarTitleStyle | undefined>(undefined)\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport type ToolbarProps = HTMLAttributes<HTMLDivElement> & {\n /** @default \"top\" */\n placement?: ToolbarPlacement\n /** Layout of `Toolbar.Title` in a top bar. @default \"inline\" */\n titleStyle?: ToolbarTitleStyle\n /** Alignment of an inline title. Compact and large titles always start at the leading edge. @default \"center\" */\n titleAlign?: ToolbarTitleAlign\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" at the top, \"soft\" at the bottom */\n background?: ToolbarBackground\n ref?: Ref<HTMLDivElement>\n}\n\nfunction ToolbarRoot({\n placement = \"top\",\n titleStyle = \"inline\",\n titleAlign = \"center\",\n background = placement === \"bottom\" ? \"soft\" : \"glass\",\n className,\n children,\n ref,\n ...restProps\n}: ToolbarProps) {\n const host = useContext(ToolbarHostContext)\n const element = useRef<HTMLDivElement | null>(null)\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n const setHeight = host?.setHeight\n useLayoutEffect(() => {\n const bar = element.current\n if (!bar || !setHeight) return\n // A desktop layout hides the bar; its height then leaves the host's own header in charge.\n const update = () => {\n setHeight(placement, bar.offsetHeight || undefined)\n measureLargeTitle(bar)\n }\n update()\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(update) : undefined\n observer?.observe(bar, { box: \"border-box\" })\n return () => { observer?.disconnect(); setHeight(placement, undefined) }\n }, [placement, setHeight])\n\n return (\n <div\n ref={setRef}\n className={clsx(s.Toolbar, className)}\n data-toolbar=\"\"\n data-placement={placement}\n data-title-style={placement === \"top\" ? titleStyle : undefined}\n data-title-align={placement === \"top\" ? titleAlign : undefined}\n data-background={background === \"edge\" ? \"soft\" : background}\n data-host={host?.kind}\n data-scrolled={placement === \"top\" && host?.scrolled ? \"\" : undefined}\n data-content-below={placement === \"bottom\" && host?.contentBelow ? \"\" : undefined}\n {...restProps}\n >\n <ToolbarTitleStyleContext.Provider value={placement === \"top\" ? titleStyle : undefined}>{children}</ToolbarTitleStyleContext.Provider>\n </div>\n )\n}\nToolbarRoot.displayName = \"Toolbar\"\n\n/**\n * A large title on a page scrolls up with the content under the row of controls; the row shows the\n * title inline once it has gone. The distance it travels (the gap above it and its height) goes to\n * `--toolbar-large-title-travel`, in pixels as a number, as the page's `--page-scroll-y` is.\n */\nfunction measureLargeTitle(bar: HTMLElement) {\n if (bar.dataset.titleStyle !== \"large\") return\n const heading = Array.from(bar.children).find((child): child is HTMLElement => child instanceof HTMLElement && child.classList.contains(s.Heading))\n if (!heading) return\n const gap = Number.parseFloat(getComputedStyle(bar).rowGap) || 0\n bar.style.setProperty(\"--toolbar-large-title-travel\", String(heading.offsetHeight + gap))\n}\n\n/* ------------------------------------------------------------------ */\n/* Parts */\n/* ------------------------------------------------------------------ */\n\nexport type ToolbarSlotProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }\n\nfunction ToolbarLeading({ className, ...restProps }: ToolbarSlotProps) {\n return <div className={clsx(s.Leading, className)} {...restProps} />\n}\nToolbarLeading.displayName = \"Toolbar.Leading\"\n\nfunction ToolbarTrailing({ className, ...restProps }: ToolbarSlotProps) {\n return <div className={clsx(s.Trailing, className)} {...restProps} />\n}\nToolbarTrailing.displayName = \"Toolbar.Trailing\"\n\nexport type ToolbarContentProps = ToolbarSlotProps & {\n /** Stretch between the leading and trailing items, as a search field does. */\n fill?: boolean\n}\n\n/** Custom middle content: a search field, a segmented control or a single centered action. */\nfunction ToolbarContent({ fill = false, className, ...restProps }: ToolbarContentProps) {\n return <div className={clsx(s.Content, className)} data-fill={fill ? \"\" : undefined} {...restProps} />\n}\nToolbarContent.displayName = \"Toolbar.Content\"\n\n/** Buttons that share one capsule. */\nfunction ToolbarGroup({ className, ...restProps }: ToolbarSlotProps) {\n return <div role=\"group\" className={clsx(s.Group, className)} {...restProps} />\n}\nToolbarGroup.displayName = \"Toolbar.Group\"\n\nexport type ToolbarTitleProps = Omit<HTMLAttributes<HTMLHeadingElement>, \"children\"> & {\n children: ReactNode\n /** A second, smaller line below the title. */\n subtitle?: ReactNode\n /**\n * Heading level. In a Dialog the dialog's own title names the Sheet, so the bar title is hidden from\n * assistive technology there. @default \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\"\n ref?: Ref<HTMLHeadingElement>\n}\n\nfunction ToolbarTitle({ children, subtitle, as, className, ref, ...restProps }: ToolbarTitleProps) {\n const host = useContext(ToolbarHostContext)\n const titleStyle = useContext(ToolbarTitleStyleContext)\n const decorative = host?.kind === \"dialog\"\n const Tag = as ?? \"h1\"\n const hasSubtitle = subtitle != null && subtitle !== false && subtitle !== \"\"\n const heading = (\n <div className={s.Heading} aria-hidden={decorative || undefined}>\n <Tag ref={ref} className={clsx(s.Title, className)} {...restProps}>{children}</Tag>\n {hasSubtitle && <p className={s.Subtitle}>{subtitle}</p>}\n </div>\n )\n if (titleStyle !== \"large\" || host?.kind !== \"page\") return heading\n // The inline copy the row of controls shows once the large title has scrolled under it. A subtitle stays\n // as a second line, as in the inline title (iOS 26 kit Toolbar - Top - iPhone, Title 2 Line).\n return (\n <>\n {heading}\n <span className={s.CollapsedTitle} aria-hidden=\"true\">\n {hasSubtitle ? <><span className={s.CollapsedLine}>{children}</span><span className={s.CollapsedSubtitle}>{subtitle}</span></> : children}\n </span>\n </>\n )\n}\nToolbarTitle.displayName = \"Toolbar.Title\"\n\n/* ------------------------------------------------------------------ */\n/* Compound */\n/* ------------------------------------------------------------------ */\n\nexport const Toolbar = ToolbarRoot as typeof ToolbarRoot & {\n Leading: typeof ToolbarLeading\n Title: typeof ToolbarTitle\n Content: typeof ToolbarContent\n Group: typeof ToolbarGroup\n Trailing: typeof ToolbarTrailing\n}\n\nToolbar.Leading = ToolbarLeading\nToolbar.Title = ToolbarTitle\nToolbar.Content = ToolbarContent\nToolbar.Group = ToolbarGroup\nToolbar.Trailing = ToolbarTrailing\n"]}
|
|
1
|
+
{"version":3,"file":"Toolbar.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/Toolbar.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,EACL,aAAa,EACb,WAAW,EACX,UAAU,EACV,eAAe,EACf,MAAM,EACN,QAAQ,GAIT,MAAM,OAAO,CAAA;AACd,OAAO,EAAE,YAAY,EAAE,MAAM,WAAW,CAAA;AACxC,OAAO,CAAC,MAAM,sDAAsD,CAAA;AA2BpE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,UAAyC,EAA6B,EAAE,CACpG,UAAU,KAAK,MAAM,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,KAAK,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAA;AAyB/E,MAAM,CAAC,MAAM,kBAAkB,GAAG,aAAa,CAAqB,IAAI,CAAC,CAAA;AAEzE,2GAA2G;AAC3G,MAAM,wBAAwB,GAAG,aAAa,CAAgC,SAAS,CAAC,CAAA;AACxF,mHAAmH;AACnH,oHAAoH;AACpH,MAAM,qBAAqB,GAAG,aAAa,CAAwB,IAAI,CAAC,CAAA;AAExE,mHAAmH;AACnH,MAAM,kBAAkB,GAAG;IACzB,0BAA0B;IAC1B,2BAA2B;IAC3B,iCAAiC;IACjC,mCAAmC;IACnC,+BAA+B;IAC/B,oCAAoC;IACpC,sCAAsC;IACtC,kCAAkC;CACnC,CAAA;AAED;;;;;;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C,8BAAE,eAAM,SAAS,EAAE,CAAC,CAAC,aAAa,YAAG,QAAQ,GAAQ,EAAA,eAAM,SAAS,EAAE,CAAC,CAAC,iBAAiB,YAAG,QAAQ,GAAQ,IAAG,CAAC,CAAC,CAAC,QAAQ,GACpI,IACN,CACJ,CAAA;AACH,CAAC;AACD,YAAY,CAAC,WAAW,GAAG,eAAe,CAAA;AAE1C,wEAAwE;AACxE,yEAAyE;AACzE,wEAAwE;AAExE,MAAM,CAAC,MAAM,OAAO,GAAG,WAOtB,CAAA;AAED,OAAO,CAAC,OAAO,GAAG,cAAc,CAAA;AAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;AAC5B,OAAO,CAAC,OAAO,GAAG,cAAc,CAAA;AAChC,OAAO,CAAC,KAAK,GAAG,YAAY,CAAA;AAC5B,OAAO,CAAC,QAAQ,GAAG,eAAe,CAAA;AAClC,OAAO,CAAC,GAAG,GAAG,UAAU,CAAA","sourcesContent":["\"use client\"\n\nimport clsx from \"clsx\"\nimport {\n createContext,\n useCallback,\n useContext,\n useLayoutEffect,\n useRef,\n useState,\n type HTMLAttributes,\n type ReactNode,\n type Ref,\n} from \"react\"\nimport { createPortal } from \"react-dom\"\nimport s from \"@plexui/styles/components/Toolbar/Toolbar.module.css\"\n\nexport type ToolbarPlacement = \"top\" | \"bottom\"\n/** Title layouts of the phone top bar. */\nexport type ToolbarTitleStyle = \"inline\" | \"large\" | \"compact-large\" | \"compact-medium\"\nexport type ToolbarTitleAlign = \"center\" | \"start\"\n/**\n * How a bar meets the content scrolled under it, after the scroll edge effect of iOS 26:\n * - `\"soft\"` (the default of a bottom bar): at the top, once content is under the bar, a blur that grows toward the top under a\n * thin veil of the canvas color, with no line, which lets go past the bar; at the bottom of a page the content stays clear\n * under and around the controls, as on native iOS 26, and a Sheet's bottom bar fades its content into the panel\n * - `\"hard\"`: an opaque bar of the canvas color with a hairline once content is under it\n * - `\"glass\"` (the default of a top bar): a translucent, blurred bar with a hairline, shown once content is under it\n * - `\"blur\"`: no fill and no line, once content is under the bar: the content blurred a little over the bar and past it,\n * and heavily toward the screen's edge\n *\n * iOS 27.2 has two scroll edges, soft and hard; glass is the bar of earlier iOS and blur an app's own.\n */\nexport type BarBackground = \"soft\" | \"hard\" | \"glass\" | \"blur\"\n/**\n * `\"solid\"` is the earlier name of `\"hard\"`: iOS has no opaque bar without a line, and it draws the line of a hard edge\n * only once content is under the bar, so at rest the two look the same.\n */\nexport type BarBackgroundAlias = \"solid\"\n/** `\"edge\"` is the earlier name of `\"soft\"`, `\"solid\"` of `\"hard\"`. */\nexport type ToolbarBackground = BarBackground | BarBackgroundAlias | \"edge\"\n\n/** The background a bar draws, from its current name or an earlier one. */\nexport const barBackground = (background: ToolbarBackground | undefined): BarBackground | undefined =>\n background === \"edge\" ? \"soft\" : background === \"solid\" ? \"hard\" : background\n\n/**\n * A surface that places phone toolbars: `Page` puts the top bar over its content\n * and reserves the space; `Dialog` puts it 16px under the Sheet's top edge.\n */\nexport type ToolbarHost = {\n kind: \"page\" | \"dialog\"\n setHeight?: (placement: ToolbarPlacement, height: number | undefined) => void\n /** Content has scrolled under the top bar, so its glass casts a shadow and a hard or glass bar shows its line. */\n scrolled?: boolean\n /** Content continues under the bottom bar, so a hard or glass bar shows its line. */\n contentBelow?: boolean\n /** Calls the listener with the content's scroll offset on every scroll; returns the unsubscribe. A TabBar minimizes with it. */\n subscribeScroll?: (listener: (scrollTop: number) => void) => () => void\n /** A large title asks for a place in the content; returns the release. */\n requestLargeTitleSlot?: () => () => void\n /** The place at the top of the content where a large title scrolls with it, once the content has made one. */\n largeTitleSlot?: HTMLElement | null\n /** The place under a large title where the bar's rows stand, pinned under the bar once scrolled up to it. */\n largeTitleRowSlot?: HTMLElement | null\n /** The rows under a large title are pinned under the bar, so its background reaches under them. */\n rowsPinned?: boolean\n}\n\nexport const ToolbarHostContext = createContext<ToolbarHost | null>(null)\n\n// The title style of the top bar, which a large title on a page needs to show itself inline once scrolled.\nconst ToolbarTitleStyleContext = createContext<ToolbarTitleStyle | undefined>(undefined)\n// The bar itself, which a large title in the content marks once it has gone under the bar. It is state, so a title\n// that mounts before its bar (a bar replaced under a page that keeps its content) follows the bar once it is there.\nconst ToolbarElementContext = createContext<HTMLDivElement | null>(null)\n\n// The tokens of a large title a bar can set for itself, which the title in the content no longer inherits from it.\nconst LARGE_TITLE_TOKENS = [\n \"--toolbar-padding-bottom\",\n \"--toolbar-large-title-gap\",\n \"--toolbar-large-title-font-size\",\n \"--toolbar-large-title-line-height\",\n \"--toolbar-large-title-descent\",\n \"--toolbar-large-subtitle-font-size\",\n \"--toolbar-large-subtitle-line-height\",\n \"--toolbar-large-subtitle-descent\",\n]\n\n/**\n * Follows a large title in the content: it takes the large title tokens the bar sets for itself, and once its last line\n * is at the bar's bottom the bar shows it inline. Scrolling moves it; a change of layout (a wide window turning into a\n * phone's, which shows the bar and the title) or of a class or style on the bar, the content or around them measures it\n * again. A token the bar shares with the content stays inherited, so it follows the page's changes. A hidden title has\n * not gone under anything.\n */\nfunction followLargeTitle(bar: HTMLElement, heading: HTMLElement, subscribeScroll: (listener: () => void) => () => void) {\n const collapse = () => {\n const box = heading.getBoundingClientRect()\n bar.toggleAttribute(\"data-title-collapsed\", box.height > 0 && box.bottom <= bar.getBoundingClientRect().bottom)\n }\n const layout = () => {\n const own = getComputedStyle(bar)\n const place = heading.parentElement ? getComputedStyle(heading.parentElement) : undefined\n for (const token of LARGE_TITLE_TOKENS) {\n const value = own.getPropertyValue(token).trim()\n if (value && value !== place?.getPropertyValue(token).trim()) heading.style.setProperty(token, value)\n else heading.style.removeProperty(token)\n }\n collapse()\n }\n layout()\n const unsubscribe = subscribeScroll(collapse)\n const observer = typeof ResizeObserver !== \"undefined\" ? new ResizeObserver(layout) : undefined\n observer?.observe(bar)\n observer?.observe(heading)\n const mutations = typeof MutationObserver !== \"undefined\" ? new MutationObserver(layout) : undefined\n // A token reaches the bar or the content from the class or style of either or of anything around them.\n for (const start of [bar, heading.parentElement]) {\n for (let node = start; node; node = node.parentElement) mutations?.observe(node, { attributes: true, attributeFilter: [\"class\", \"style\"] })\n }\n return () => {\n unsubscribe()\n observer?.disconnect()\n mutations?.disconnect()\n bar.removeAttribute(\"data-title-collapsed\")\n for (const token of LARGE_TITLE_TOKENS) heading.style.removeProperty(token)\n }\n}\n\n/* ------------------------------------------------------------------ */\n/* Root */\n/* ------------------------------------------------------------------ */\n\nexport type ToolbarProps = HTMLAttributes<HTMLDivElement> & {\n /** @default \"top\" */\n placement?: ToolbarPlacement\n /** Layout of `Toolbar.Title` in a top bar. @default \"inline\" */\n titleStyle?: ToolbarTitleStyle\n /** Alignment of an inline title. Compact and large titles always start at the leading edge. @default \"center\" */\n titleAlign?: ToolbarTitleAlign\n /** How the bar meets the content scrolled under it on a phone. @default \"glass\" at the top, \"soft\" at the bottom */\n background?: ToolbarBackground\n ref?: Ref<HTMLDivElement>\n}\n\nfunction ToolbarRoot({\n placement = \"top\",\n titleStyle = \"inline\",\n titleAlign = \"center\",\n background = placement === \"bottom\" ? \"soft\" : \"glass\",\n className,\n children,\n ref,\n ...restProps\n}: ToolbarProps) {\n const host = useContext(ToolbarHostContext)\n const element = useRef<HTMLDivElement | null>(null)\n const [barElement, setBarElement] = useState<HTMLDivElement | null>(null)\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n setBarElement(node)\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n const setHeight = host?.setHeight\n useLayoutEffect(() => {\n const bar = element.current\n if (!bar || !setHeight) return\n // A desktop layout hides the bar; its height then leaves the host's own header in charge.\n const update = () => setHeight(placement, 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(placement, undefined) }\n }, [placement, setHeight])\n\n return (\n <div\n ref={setRef}\n className={clsx(s.Toolbar, className)}\n data-toolbar=\"\"\n data-placement={placement}\n data-title-style={placement === \"top\" ? titleStyle : undefined}\n data-title-align={placement === \"top\" ? titleAlign : undefined}\n data-background={barBackground(background)}\n data-host={host?.kind}\n data-scrolled={placement === \"top\" && host?.scrolled ? \"\" : undefined}\n data-content-below={placement === \"bottom\" && host?.contentBelow ? \"\" : undefined}\n data-rows-pinned={placement === \"top\" && host?.rowsPinned ? \"\" : undefined}\n {...restProps}\n >\n <ToolbarElementContext.Provider value={barElement}>\n <ToolbarTitleStyleContext.Provider value={placement === \"top\" ? titleStyle : undefined}>{children}</ToolbarTitleStyleContext.Provider>\n </ToolbarElementContext.Provider>\n </div>\n )\n}\nToolbarRoot.displayName = \"Toolbar\"\n\n/* ------------------------------------------------------------------ */\n/* Parts */\n/* ------------------------------------------------------------------ */\n\nexport type ToolbarSlotProps = HTMLAttributes<HTMLDivElement> & { ref?: Ref<HTMLDivElement> }\n\nfunction ToolbarLeading({ className, ...restProps }: ToolbarSlotProps) {\n return <div className={clsx(s.Leading, className)} {...restProps} />\n}\nToolbarLeading.displayName = \"Toolbar.Leading\"\n\nfunction ToolbarTrailing({ className, ...restProps }: ToolbarSlotProps) {\n return <div className={clsx(s.Trailing, className)} {...restProps} />\n}\nToolbarTrailing.displayName = \"Toolbar.Trailing\"\n\nexport type ToolbarContentProps = ToolbarSlotProps & {\n /** Stretch between the leading and trailing items, as a search field does. */\n fill?: boolean\n}\n\n/** Custom middle content: a search field, a segmented control or a single centered action. */\nfunction ToolbarContent({ fill = false, className, ...restProps }: ToolbarContentProps) {\n return <div className={clsx(s.Content, className)} data-fill={fill ? \"\" : undefined} {...restProps} />\n}\nToolbarContent.displayName = \"Toolbar.Content\"\n\n/** Buttons that share one capsule. */\nfunction ToolbarGroup({ className, ...restProps }: ToolbarSlotProps) {\n return <div role=\"group\" className={clsx(s.Group, className)} {...restProps} />\n}\nToolbarGroup.displayName = \"Toolbar.Group\"\n\nconst rowOfAnchor = new WeakMap<Element, HTMLElement>()\n\n/**\n * Under a large title each row is portaled into the rows' place as it mounts, so a row that comes later (a search field\n * shown over a segmented control already there) would stand last. An empty anchor in the bar keeps the row's place among\n * the bar's rows, and the rows are moved into that order in the content, so the keyboard and a screen reader meet them\n * as they stand (Codex #7); a row added or removed in the bar orders them again.\n */\nfunction followRowOrder(anchor: HTMLElement, row: HTMLElement) {\n const bar = anchor.closest(\"[data-toolbar]\") ?? anchor.parentElement\n if (!bar) return () => {}\n rowOfAnchor.set(anchor, row)\n const place = () => {\n const slot = row.parentElement\n if (!slot) return\n const rows = Array.from(bar.querySelectorAll(\"[data-toolbar-row-anchor]\"), (mark) => rowOfAnchor.get(mark))\n .filter((each): each is HTMLElement => each?.parentElement === slot)\n // From the last row back, a row that does not stand before the next one goes right before it: only a row out of\n // place moves (the one that came later), so a field focused in another row keeps its focus (Codex #8); moveBefore,\n // where the browser has it, keeps it even in the row that moves.\n const move = (slot as HTMLElement & { moveBefore?: (node: Node, child: Node | null) => void }).moveBefore\n for (let index = rows.length - 2; index >= 0; index--) {\n const each = rows[index]\n const next = rows[index + 1]\n if (each.compareDocumentPosition(next) & Node.DOCUMENT_POSITION_FOLLOWING) continue\n try {\n if (move) {\n move.call(slot, each, next)\n continue\n }\n } catch {\n // falls back to a plain move\n }\n slot.insertBefore(each, next)\n }\n }\n place()\n const observer = typeof MutationObserver !== \"undefined\" ? new MutationObserver(place) : undefined\n observer?.observe(bar, { childList: true, subtree: true })\n return () => {\n observer?.disconnect()\n rowOfAnchor.delete(anchor)\n }\n}\n\n/**\n * A row under the controls, part of the bar: a segmented control that switches the screen's views (a chat list's\n * folders under its bar), or a search field. It spans the bar, and a control in it fills the row; several rows stand in\n * their order (a search field over a segmented control). Under a large title on a page the rows stand under the title,\n * at the top of the content, and once scrolled up to the bar they stay pinned under its controls, as iOS 27.2 pins a\n * safeAreaBar under a large title's bar.\n */\nfunction ToolbarRow({ className, ref, ...restProps }: ToolbarSlotProps) {\n const host = useContext(ToolbarHostContext)\n const titleStyle = useContext(ToolbarTitleStyleContext)\n const large = titleStyle === \"large\" && host?.kind === \"page\"\n const requestSlot = large ? host?.requestLargeTitleSlot : undefined\n const slot = large ? host?.largeTitleRowSlot ?? null : null\n useLayoutEffect(() => requestSlot?.(), [requestSlot])\n const element = useRef<HTMLDivElement | null>(null)\n const anchor = useRef<HTMLSpanElement | null>(null)\n const setRef = useCallback((node: HTMLDivElement | null) => {\n element.current = node\n if (typeof ref === \"function\") return ref(node)\n if (ref) ref.current = node\n }, [ref])\n useLayoutEffect(() => {\n if (!slot || !anchor.current || !element.current) return\n return followRowOrder(anchor.current, element.current)\n }, [slot])\n const row = <div ref={setRef} className={clsx(s.Row, className)} data-toolbar-row=\"\" data-in-content={slot ? \"\" : undefined} {...restProps} />\n // Under a large title the row waits for its place in the content (it comes before the first paint) and never stands\n // in the bar first: moving it from the bar into the portal would mount its children again, and a switcher that holds\n // its own selection would lose it (Codex #5).\n if (large) return slot ? <>{createPortal(row, slot)}<span ref={anchor} data-toolbar-row-anchor=\"\" hidden /></> : null\n return row\n}\nToolbarRow.displayName = \"Toolbar.Row\"\n\nexport type ToolbarTitleProps = Omit<HTMLAttributes<HTMLHeadingElement>, \"children\"> & {\n children: ReactNode\n /** A second, smaller line below the title. */\n subtitle?: ReactNode\n /**\n * Heading level. In a Dialog the dialog's own title names the Sheet, so the bar title is hidden from\n * assistive technology there. @default \"h1\"\n */\n as?: \"h1\" | \"h2\" | \"h3\"\n ref?: Ref<HTMLHeadingElement>\n}\n\nfunction ToolbarTitle({ children, subtitle, as, className, ref, ...restProps }: ToolbarTitleProps) {\n const host = useContext(ToolbarHostContext)\n const titleStyle = useContext(ToolbarTitleStyleContext)\n const bar = useContext(ToolbarElementContext)\n const headingRef = useRef<HTMLDivElement | null>(null)\n const large = titleStyle === \"large\" && host?.kind === \"page\"\n const requestSlot = large ? host?.requestLargeTitleSlot : undefined\n const slot = large ? host?.largeTitleSlot ?? null : null\n const subscribeScroll = host?.subscribeScroll\n useLayoutEffect(() => requestSlot?.(), [requestSlot])\n // In the content the title scrolls with it, on the compositor and through the overscroll, as on iOS 26. Once it has\n // gone under the bar (its last line at the bar's bottom), the bar shows it inline and a hard or glass bar its line.\n useLayoutEffect(() => {\n const heading = headingRef.current\n if (!slot || !bar || !heading || !subscribeScroll) return\n return followLargeTitle(bar, heading, subscribeScroll)\n }, [bar, slot, subscribeScroll])\n const decorative = host?.kind === \"dialog\"\n const Tag = as ?? \"h1\"\n const hasSubtitle = subtitle != null && subtitle !== false && subtitle !== \"\"\n const heading = (\n <div ref={headingRef} className={s.Heading} aria-hidden={decorative || undefined} data-in-content={slot ? \"\" : undefined}>\n <Tag ref={ref} className={clsx(s.Title, className)} {...restProps}>{children}</Tag>\n {hasSubtitle && <p className={s.Subtitle}>{subtitle}</p>}\n </div>\n )\n if (!large) return heading\n // Until the content has made its place (a server-rendered page before it hydrates), the title stands in the bar\n // where it will stand in the content. The inline copy the row of controls shows once the large title has gone\n // under it keeps a subtitle as a second line, as in the inline title (iOS 26 kit Toolbar - Top - iPhone, Title 2 Line).\n return (\n <>\n {slot ? createPortal(heading, slot) : heading}\n <span className={s.CollapsedTitle} aria-hidden=\"true\">\n {hasSubtitle ? <><span className={s.CollapsedLine}>{children}</span><span className={s.CollapsedSubtitle}>{subtitle}</span></> : children}\n </span>\n </>\n )\n}\nToolbarTitle.displayName = \"Toolbar.Title\"\n\n/* ------------------------------------------------------------------ */\n/* Compound */\n/* ------------------------------------------------------------------ */\n\nexport const Toolbar = ToolbarRoot as typeof ToolbarRoot & {\n Leading: typeof ToolbarLeading\n Title: typeof ToolbarTitle\n Content: typeof ToolbarContent\n Group: typeof ToolbarGroup\n Trailing: typeof ToolbarTrailing\n Row: typeof ToolbarRow\n}\n\nToolbar.Leading = ToolbarLeading\nToolbar.Title = ToolbarTitle\nToolbar.Content = ToolbarContent\nToolbar.Group = ToolbarGroup\nToolbar.Trailing = ToolbarTrailing\nToolbar.Row = ToolbarRow\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/components/Toolbar/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,OAAO,EACP,kBAAkB,GAYnB,MAAM,WAAW,CAAA","sourcesContent":["export {\n Toolbar,\n ToolbarHostContext,\n type BarBackground,\n type BarBackgroundAlias,\n type ToolbarBackground,\n type ToolbarContentProps,\n type ToolbarHost,\n type ToolbarPlacement,\n type ToolbarProps,\n type ToolbarSlotProps,\n type ToolbarTitleAlign,\n type ToolbarTitleProps,\n type ToolbarTitleStyle,\n} from \"./Toolbar\"\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type CSSProperties, type ReactNode } from "react";
|
|
2
|
-
import { type BarBackground } from "../Toolbar/Toolbar.js";
|
|
2
|
+
import { type BarBackground, type BarBackgroundAlias } from "../Toolbar/Toolbar.js";
|
|
3
3
|
export type DialogProps = {
|
|
4
4
|
open?: boolean;
|
|
5
5
|
onOpenChange?: (open: boolean) => void;
|
|
@@ -103,7 +103,7 @@ type DialogSlotProps = {
|
|
|
103
103
|
className?: string;
|
|
104
104
|
};
|
|
105
105
|
/** How a Sheet's bar meets the content scrolled under it; see `BarBackground`. */
|
|
106
|
-
export type DialogBarBackground = BarBackground;
|
|
106
|
+
export type DialogBarBackground = BarBackground | BarBackgroundAlias;
|
|
107
107
|
export type DialogHeaderProps = DialogSlotProps & {
|
|
108
108
|
/** How the bar meets the content scrolled under it in a phone Sheet. @default "glass" */
|
|
109
109
|
background?: DialogBarBackground;
|
|
@@ -362,6 +362,7 @@ export { default as MinimizeTop } from "./svg/MinimizeTop.js";
|
|
|
362
362
|
export { default as Minus } from "./svg/Minus.js";
|
|
363
363
|
export { default as MinusCircle } from "./svg/MinusCircle.js";
|
|
364
364
|
export { default as MinusCircleFilled } from "./svg/MinusCircleFilled.js";
|
|
365
|
+
export { default as MinusLg } from "./svg/MinusLg.js";
|
|
365
366
|
export { default as Mobile } from "./svg/Mobile.js";
|
|
366
367
|
export { default as Moon } from "./svg/Moon.js";
|
|
367
368
|
export { default as MoonSun } from "./svg/MoonSun.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type HTMLAttributes, type Ref } from "react";
|
|
2
|
-
import { type BarBackground } from "../Toolbar/Toolbar.js";
|
|
3
|
-
/** How a phone bar of the page meets the content scrolled under it; see `BarBackground`. */
|
|
4
|
-
export type PageBarBackground = BarBackground;
|
|
2
|
+
import { type BarBackground, type BarBackgroundAlias } from "../Toolbar/Toolbar.js";
|
|
3
|
+
/** How a phone bar of the page meets the content scrolled under it; see `BarBackground`. `"solid"` is the earlier name of `"hard"`. */
|
|
4
|
+
export type PageBarBackground = BarBackground | BarBackgroundAlias;
|
|
5
5
|
export type PageWidth = "full" | "wide" | "column";
|
|
6
6
|
export type PageProps = HTMLAttributes<HTMLDivElement> & {
|
|
7
7
|
/**
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type MouseEvent, type ReactNode, type Ref } from "react";
|
|
2
|
-
import { type BarBackground } from "../Toolbar/Toolbar.js";
|
|
2
|
+
import { type BarBackground, type BarBackgroundAlias } from "../Toolbar/Toolbar.js";
|
|
3
3
|
export type TabBarSearch = {
|
|
4
4
|
/** The value of the search tab. */
|
|
5
5
|
value: string;
|
|
@@ -40,8 +40,8 @@ export type TabBarProps = {
|
|
|
40
40
|
defaultMinimized?: boolean;
|
|
41
41
|
/** Called when the bar minimizes or expands. */
|
|
42
42
|
onMinimizedChange?: (minimized: boolean) => void;
|
|
43
|
-
/** How the bar meets the content scrolled under it; see `BarBackground
|
|
44
|
-
background?: BarBackground;
|
|
43
|
+
/** How the bar meets the content scrolled under it; see `BarBackground` (`"solid"` is the earlier name of `"hard"`). @default "soft" */
|
|
44
|
+
background?: BarBackground | BarBackgroundAlias;
|
|
45
45
|
/**
|
|
46
46
|
* Content in a glass capsule above the tabs, a now playing row or a status, as the iOS 27 bottom accessory;
|
|
47
47
|
* minimized, it stands between the two circles. The bar grows by its height.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* One width for the segments of a phone's segmented control. Shared by the React and Vue packages (the Vue copy must
|
|
3
|
+
* match).
|
|
4
|
+
*
|
|
5
|
+
* UISegmentedControl at its own width gives every segment the widest one's width (iOS 27.2); where that does not fit,
|
|
6
|
+
* each segment takes its label and the same air around it, as apportionsSegmentWidthsByContent does (ref-app
|
|
7
|
+
* segmented-hug, 13.11). A grid that hugs its content cannot size its tracks to the widest one by itself (the browser
|
|
8
|
+
* sizes it by the sum of its labels), so the widest is measured here and set as the track. Tabs.module.css asks for it
|
|
9
|
+
* with `--tabs-equal-segments: 1` on a phone's horizontal control that is not `block`; elsewhere nothing is set.
|
|
10
|
+
*/
|
|
11
|
+
/** Sets the track and says whether it changed, so a thumb on a segment that moved can follow. */
|
|
12
|
+
export declare function equalizeSegments(root: HTMLElement | null, thumb: HTMLElement | null): boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Measures again when the room changes (the segments may fit one width now), when the screen crosses into or out of
|
|
15
|
+
* the phone block (the control starts or stops asking, its room unchanged) and when the font loads and the labels
|
|
16
|
+
* widen. `moved` runs when the track changed, so the thumb can follow its segment, and always once the font has
|
|
17
|
+
* loaded: segments sized by their labels move then with no track and no size changing. Returns the cleanup.
|
|
18
|
+
*/
|
|
19
|
+
export declare function watchSegments(root: HTMLElement, thumb: () => HTMLElement | null, moved: () => void): () => void;
|
|
@@ -5,16 +5,26 @@ export type ToolbarTitleStyle = "inline" | "large" | "compact-large" | "compact-
|
|
|
5
5
|
export type ToolbarTitleAlign = "center" | "start";
|
|
6
6
|
/**
|
|
7
7
|
* How a bar meets the content scrolled under it, after the scroll edge effect of iOS 26:
|
|
8
|
-
* - `"soft"` (the default of a bottom bar): at the top,
|
|
9
|
-
*
|
|
10
|
-
* and a Sheet's bottom bar fades its content into the panel
|
|
11
|
-
* - `"hard"`: an opaque bar of the canvas color with a
|
|
8
|
+
* - `"soft"` (the default of a bottom bar): at the top, once content is under the bar, a blur that grows toward the top under a
|
|
9
|
+
* thin veil of the canvas color, with no line, which lets go past the bar; at the bottom of a page the content stays clear
|
|
10
|
+
* under and around the controls, as on native iOS 26, and a Sheet's bottom bar fades its content into the panel
|
|
11
|
+
* - `"hard"`: an opaque bar of the canvas color with a hairline once content is under it
|
|
12
12
|
* - `"glass"` (the default of a top bar): a translucent, blurred bar with a hairline, shown once content is under it
|
|
13
|
-
* - `"
|
|
13
|
+
* - `"blur"`: no fill and no line, once content is under the bar: the content blurred a little over the bar and past it,
|
|
14
|
+
* and heavily toward the screen's edge
|
|
15
|
+
*
|
|
16
|
+
* iOS 27.2 has two scroll edges, soft and hard; glass is the bar of earlier iOS and blur an app's own.
|
|
14
17
|
*/
|
|
15
|
-
export type BarBackground = "soft" | "hard" | "glass" | "
|
|
16
|
-
/**
|
|
17
|
-
|
|
18
|
+
export type BarBackground = "soft" | "hard" | "glass" | "blur";
|
|
19
|
+
/**
|
|
20
|
+
* `"solid"` is the earlier name of `"hard"`: iOS has no opaque bar without a line, and it draws the line of a hard edge
|
|
21
|
+
* only once content is under the bar, so at rest the two look the same.
|
|
22
|
+
*/
|
|
23
|
+
export type BarBackgroundAlias = "solid";
|
|
24
|
+
/** `"edge"` is the earlier name of `"soft"`, `"solid"` of `"hard"`. */
|
|
25
|
+
export type ToolbarBackground = BarBackground | BarBackgroundAlias | "edge";
|
|
26
|
+
/** The background a bar draws, from its current name or an earlier one. */
|
|
27
|
+
export declare const barBackground: (background: ToolbarBackground | undefined) => BarBackground | undefined;
|
|
18
28
|
/**
|
|
19
29
|
* A surface that places phone toolbars: `Page` puts the top bar over its content
|
|
20
30
|
* and reserves the space; `Dialog` puts it 16px under the Sheet's top edge.
|
|
@@ -28,6 +38,14 @@ export type ToolbarHost = {
|
|
|
28
38
|
contentBelow?: boolean;
|
|
29
39
|
/** Calls the listener with the content's scroll offset on every scroll; returns the unsubscribe. A TabBar minimizes with it. */
|
|
30
40
|
subscribeScroll?: (listener: (scrollTop: number) => void) => () => void;
|
|
41
|
+
/** A large title asks for a place in the content; returns the release. */
|
|
42
|
+
requestLargeTitleSlot?: () => () => void;
|
|
43
|
+
/** The place at the top of the content where a large title scrolls with it, once the content has made one. */
|
|
44
|
+
largeTitleSlot?: HTMLElement | null;
|
|
45
|
+
/** The place under a large title where the bar's rows stand, pinned under the bar once scrolled up to it. */
|
|
46
|
+
largeTitleRowSlot?: HTMLElement | null;
|
|
47
|
+
/** The rows under a large title are pinned under the bar, so its background reaches under them. */
|
|
48
|
+
rowsPinned?: boolean;
|
|
31
49
|
};
|
|
32
50
|
export declare const ToolbarHostContext: import("react").Context<ToolbarHost | null>;
|
|
33
51
|
export type ToolbarProps = HTMLAttributes<HTMLDivElement> & {
|
|
@@ -70,6 +88,17 @@ declare function ToolbarGroup({ className, ...restProps }: ToolbarSlotProps): im
|
|
|
70
88
|
declare namespace ToolbarGroup {
|
|
71
89
|
var displayName: string;
|
|
72
90
|
}
|
|
91
|
+
/**
|
|
92
|
+
* A row under the controls, part of the bar: a segmented control that switches the screen's views (a chat list's
|
|
93
|
+
* folders under its bar), or a search field. It spans the bar, and a control in it fills the row; several rows stand in
|
|
94
|
+
* their order (a search field over a segmented control). Under a large title on a page the rows stand under the title,
|
|
95
|
+
* at the top of the content, and once scrolled up to the bar they stay pinned under its controls, as iOS 27.2 pins a
|
|
96
|
+
* safeAreaBar under a large title's bar.
|
|
97
|
+
*/
|
|
98
|
+
declare function ToolbarRow({ className, ref, ...restProps }: ToolbarSlotProps): import("react/jsx-runtime").JSX.Element | null;
|
|
99
|
+
declare namespace ToolbarRow {
|
|
100
|
+
var displayName: string;
|
|
101
|
+
}
|
|
73
102
|
export type ToolbarTitleProps = Omit<HTMLAttributes<HTMLHeadingElement>, "children"> & {
|
|
74
103
|
children: ReactNode;
|
|
75
104
|
/** A second, smaller line below the title. */
|
|
@@ -91,5 +120,6 @@ export declare const Toolbar: typeof ToolbarRoot & {
|
|
|
91
120
|
Content: typeof ToolbarContent;
|
|
92
121
|
Group: typeof ToolbarGroup;
|
|
93
122
|
Trailing: typeof ToolbarTrailing;
|
|
123
|
+
Row: typeof ToolbarRow;
|
|
94
124
|
};
|
|
95
125
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { Toolbar, ToolbarHostContext, type BarBackground, type ToolbarBackground, type ToolbarContentProps, type ToolbarHost, type ToolbarPlacement, type ToolbarProps, type ToolbarSlotProps, type ToolbarTitleAlign, type ToolbarTitleProps, type ToolbarTitleStyle, } from "./Toolbar.js";
|
|
1
|
+
export { Toolbar, ToolbarHostContext, type BarBackground, type BarBackgroundAlias, type ToolbarBackground, type ToolbarContentProps, type ToolbarHost, type ToolbarPlacement, type ToolbarProps, type ToolbarSlotProps, type ToolbarTitleAlign, type ToolbarTitleProps, type ToolbarTitleStyle, } from "./Toolbar.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@plexui/ui",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.46.0",
|
|
4
4
|
"description": "Modern design system for building high-quality applications",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -99,7 +99,7 @@
|
|
|
99
99
|
"@maskito/core": "^5.2.2",
|
|
100
100
|
"@maskito/kit": "^5.2.2",
|
|
101
101
|
"@maskito/react": "^5.2.2",
|
|
102
|
-
"@plexui/styles": "^0.
|
|
102
|
+
"@plexui/styles": "^0.5.0",
|
|
103
103
|
"@radix-ui/react-dismissable-layer": "1.2.1",
|
|
104
104
|
"@radix-ui/react-focus-guards": "1.2.0",
|
|
105
105
|
"@radix-ui/react-focus-scope": "1.3.1",
|