@haatlabs-core/ui 0.21.0 → 0.22.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 (53) hide show
  1. package/README.md +14 -3
  2. package/dist/client/LoginPage.d.ts +8 -2
  3. package/dist/client/LoginPage.js +24 -4
  4. package/dist/client/LoginPage.js.map +1 -1
  5. package/dist/client/UsagePage.d.ts +10 -1
  6. package/dist/client/UsagePage.js +44 -14
  7. package/dist/client/UsagePage.js.map +1 -1
  8. package/dist/client/index.d.ts +5 -1
  9. package/dist/client/index.js +5 -0
  10. package/dist/client/index.js.map +1 -1
  11. package/dist/client/sign-in-styles.d.ts +1 -1
  12. package/dist/client/sign-in-styles.js +6 -0
  13. package/dist/client/sign-in-styles.js.map +1 -1
  14. package/dist/client/usage-css.d.ts +1 -1
  15. package/dist/client/usage-css.js +5 -0
  16. package/dist/client/usage-css.js.map +1 -1
  17. package/dist/index.d.ts +8 -2
  18. package/dist/index.js +7 -2
  19. package/dist/index.js.map +1 -1
  20. package/dist/shell/AppShell.d.ts +4 -1
  21. package/dist/shell/AppShell.js +44 -58
  22. package/dist/shell/AppShell.js.map +1 -1
  23. package/dist/shell/BottomNav.d.ts +34 -0
  24. package/dist/shell/BottomNav.js +40 -0
  25. package/dist/shell/BottomNav.js.map +1 -0
  26. package/dist/shell/MoreSheet.d.ts +21 -0
  27. package/dist/shell/MoreSheet.js +46 -0
  28. package/dist/shell/MoreSheet.js.map +1 -0
  29. package/dist/shell/bottom-nav-css.d.ts +6 -0
  30. package/dist/shell/bottom-nav-css.js +40 -0
  31. package/dist/shell/bottom-nav-css.js.map +1 -0
  32. package/dist/shell/breakpoint.d.ts +12 -0
  33. package/dist/shell/breakpoint.js +29 -0
  34. package/dist/shell/breakpoint.js.map +1 -0
  35. package/dist/shell/focus-trap.d.ts +9 -0
  36. package/dist/shell/focus-trap.js +35 -0
  37. package/dist/shell/focus-trap.js.map +1 -0
  38. package/dist/shell/icons.d.ts +23 -0
  39. package/dist/shell/icons.js +21 -0
  40. package/dist/shell/icons.js.map +1 -0
  41. package/dist/shell/nav.d.ts +20 -0
  42. package/dist/shell/nav.js +22 -0
  43. package/dist/shell/nav.js.map +1 -1
  44. package/dist/shell/shell-css.d.ts +1 -1
  45. package/dist/shell/shell-css.js +19 -7
  46. package/dist/shell/shell-css.js.map +1 -1
  47. package/dist/theme/ThemeSwitch.d.ts +7 -2
  48. package/dist/theme/ThemeSwitch.js +8 -4
  49. package/dist/theme/ThemeSwitch.js.map +1 -1
  50. package/dist/theme/tokens.d.ts +7 -2
  51. package/dist/theme/tokens.js +24 -1
  52. package/dist/theme/tokens.js.map +1 -1
  53. package/package.json +4 -4
package/dist/index.js CHANGED
@@ -3,13 +3,18 @@ export { EmptyState } from './EmptyState.js';
3
3
  export { FullScreen } from './FullScreen.js';
4
4
  export { Loading } from './Loading.js';
5
5
  export { SearchBox } from './SearchBox.js';
6
- export { ACCENTS, NEUTRALS, themeCss } from './theme/tokens.js';
6
+ export { ACCENTS, NEUTRALS, accentHover, themeCss } from './theme/tokens.js';
7
7
  export { ThemeStyles } from './theme/ThemeStyles.js';
8
8
  export { contrastRatio } from './theme/contrast.js';
9
9
  export { THEME_BOOT_SCRIPT, THEME_STORAGE_KEY, applyThemeChoice, readThemeChoice, useTheme, } from './theme/theme-choice.js';
10
10
  export { ThemeCycle, ThemeSwitch } from './theme/ThemeSwitch.js';
11
11
  export { AppShell } from './shell/AppShell.js';
12
- export { flattenNav } from './shell/nav.js';
12
+ export { bottomItems, flattenNav } from './shell/nav.js';
13
+ export { BottomNav, MobileNav } from './shell/BottomNav.js';
14
+ export { MoreSheet } from './shell/MoreSheet.js';
15
+ export { NAV_ICON_NAMES, NavIcon } from './shell/icons.js';
16
+ export { BOTTOM_NAV_CSS } from './shell/bottom-nav-css.js';
17
+ export { NARROW_BREAKPOINT, NARROW_QUERY, useNarrow } from './shell/breakpoint.js';
13
18
  export { ShellSearch } from './shell/ShellSearch.js';
14
19
  export { PageHeader } from './layout/PageHeader.js';
15
20
  export { Card } from './layout/Card.js';
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AACrC,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAEhE,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EACL,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,eAAe,EACf,QAAQ,GACT,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAE/C,OAAO,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AAE5C,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAErD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO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OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC"}
@@ -6,7 +6,10 @@ export type { ShellAccount } from './Account.js';
6
6
  /**
7
7
  * The dashboards' frame: the sidebar (brand, grouped pages, the theme switch, the account),
8
8
  * a top bar (search, the notifications slot and a status chip) and the page. On a computer the
9
- * sidebar collapses to a strip of icons (remembered in this browser); on a phone it is a menu.
9
+ * sidebar collapses to a strip of icons (remembered in this browser). Below 1024px (phones and
10
+ * tablets) there is no sidebar: a bottom bar has the pages marked `bottom` and More (the rest,
11
+ * the theme and the account), and the top bar is one row of the logo, a search button, the
12
+ * notifications slot and the status chip.
10
13
  * Keyboard: ⌘K or / search, ⌘B the sidebar, ⇧⌘L the theme, N notifications, G then a letter
11
14
  * a page, ? the list of them all (Ctrl for ⌘ off a Mac).
12
15
  */
@@ -7,108 +7,89 @@ import { useTheme } from '../theme/theme-choice.js';
7
7
  import { Account } from './Account.js';
8
8
  import { ShellSearch } from './ShellSearch.js';
9
9
  import { ShortcutsDialog } from './ShortcutsDialog.js';
10
- import { flattenNav, isUnder } from './nav.js';
10
+ import { MobileNav } from './BottomNav.js';
11
+ import { useNarrow } from './breakpoint.js';
12
+ import { trapTab, useScrollLock } from './focus-trap.js';
13
+ import { currentPage, flattenNav, isUnder } from './nav.js';
11
14
  import { useSidebarCollapsed } from './sidebar-state.js';
12
15
  import { GO_WINDOW_MS, goKeys, isMac, isTyping, keyNames } from './shortcuts.js';
13
- const NARROW = '(max-width: 899px)';
14
- /** Whether the screen is phone-sized: the sidebar becomes a menu. */
15
- function useNarrow() {
16
- const query = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function'
17
- ? window.matchMedia(NARROW)
18
- : null;
19
- const [narrow, setNarrow] = useState(() => query()?.matches ?? false);
20
- useEffect(() => {
21
- const list = query();
22
- if (!list)
23
- return;
24
- const onChange = () => setNarrow(list.matches);
25
- list.addEventListener('change', onChange);
26
- return () => list.removeEventListener('change', onChange);
27
- }, []);
28
- return narrow;
29
- }
30
16
  function Items({ items, pathname, current, collapsed, }) {
31
17
  return (_jsx("ul", { children: items.map((item) => (_jsxs("li", { children: [_jsxs(Link, { to: item.to, "aria-current": item.to === current ? 'page' : undefined, title: collapsed ? item.label : undefined, children: [item.icon ??
32
18
  (collapsed && (_jsx("span", { "aria-hidden": "true", className: "hl-nav__initial", children: item.label.charAt(0).toUpperCase() }))), _jsx("span", { className: collapsed ? 'hl-sr-only' : undefined, children: item.label })] }), !collapsed && item.children && isUnder(pathname, item.to) && (_jsx(Items, { items: item.children, pathname: pathname, current: current, collapsed: collapsed }))] }, item.to))) }));
33
19
  }
34
20
  function Nav({ groups, collapsed }) {
35
21
  const { pathname } = useLocation();
36
- // The open page is the deepest one the address is under: a detail page (/lists/7) marks
37
- // its list page, and a page that redirects deeper (/research → /research/x) stays marked.
38
- const current = flattenNav(groups)
39
- .filter((item) => isUnder(pathname, item.to))
40
- .sort((a, b) => b.to.length - a.to.length)[0]?.to;
22
+ const current = currentPage(flattenNav(groups), pathname);
41
23
  return (_jsx("nav", { "aria-label": "Main", className: "hl-nav", children: groups.map((group, i) => (_jsxs("div", { children: [group.label &&
42
24
  (collapsed ? (i > 0 && _jsx("hr", { className: "hl-nav__divider" })) : (_jsx("p", { className: "hl-nav__group", children: group.label }))), _jsx(Items, { items: group.items, pathname: pathname, current: current, collapsed: collapsed })] }, group.label ?? `group-${String(i)}`))) }));
43
25
  }
44
26
  const PANEL_ICON = (opening) => (_jsxs("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: [_jsx("rect", { x: "3", y: "4", width: "18", height: "16", rx: "3" }), _jsx("path", { d: opening ? 'M9 4v16M14 10l2 2-2 2' : 'M9 4v16M16 10l-2 2 2 2' })] }));
45
27
  function SidebarBody(props) {
46
- const collapsed = props.collapse?.collapsed ?? false;
47
- return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "hl-brand-row", children: [collapsed ? (props.brandMark && (_jsx(Link, { to: "/", className: "hl-brand", "aria-label": "Start page", children: props.brandMark }))) : (_jsx(Link, { to: "/", className: "hl-brand", children: props.brand })), props.collapse && (_jsx("button", { type: "button", className: "hl-sidebar-toggle", "aria-label": collapsed ? 'Expand sidebar' : 'Collapse sidebar', "aria-keyshortcuts": "Meta+B Control+B", title: `${collapsed ? 'Expand' : 'Collapse'} sidebar (${props.collapse.mod}B)`, onClick: props.collapse.toggle, children: PANEL_ICON(collapsed) }))] }), _jsx(Nav, { groups: props.nav, collapsed: collapsed }), _jsxs("div", { className: "hl-sidebar__foot", children: [collapsed ? (_jsx(ThemeCycle, {})) : (_jsxs("div", { className: "hl-theme-row", children: [_jsx("span", { children: "Theme" }), _jsx(ThemeSwitch, {})] })), _jsx(Account, { account: props.account, compact: collapsed })] })] }));
28
+ const collapsed = props.collapse.collapsed;
29
+ return (_jsxs(_Fragment, { children: [_jsxs("div", { className: "hl-brand-row", children: [collapsed ? (props.brandMark && (_jsx(Link, { to: "/", className: "hl-brand", "aria-label": "Start page", children: props.brandMark }))) : (_jsx(Link, { to: "/", className: "hl-brand", children: props.brand })), _jsx("button", { type: "button", className: "hl-sidebar-toggle", "aria-label": collapsed ? 'Expand sidebar' : 'Collapse sidebar', "aria-keyshortcuts": "Meta+B Control+B", title: `${collapsed ? 'Expand' : 'Collapse'} sidebar (${props.collapse.mod}B)`, onClick: props.collapse.toggle, children: PANEL_ICON(collapsed) })] }), _jsx(Nav, { groups: props.nav, collapsed: collapsed }), _jsxs("div", { className: "hl-sidebar__foot", children: [collapsed ? (_jsx(ThemeCycle, {})) : (_jsxs("div", { className: "hl-theme-row", children: [_jsx("span", { children: "Theme" }), _jsx(ThemeSwitch, {})] })), _jsx(Account, { account: props.account, compact: collapsed })] })] }));
48
30
  }
49
- const FOCUSABLE = 'a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex="-1"])';
50
- /** The phone menu: a dialog that keeps focus inside, closes with Escape or on navigation. */
51
- function MenuDrawer(props) {
31
+ const SEARCH_ICON = (_jsxs("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.8", "aria-hidden": "true", children: [_jsx("circle", { cx: "11", cy: "11", r: "7" }), _jsx("path", { d: "M20 20l-3.5-3.5" })] }));
32
+ /**
33
+ * The phone and tablet search: the top bar's search over the page, full width, on its input.
34
+ * Escape, Back or the backdrop close it; picking a page closes it too (the address changes).
35
+ */
36
+ function SearchOverlay(props) {
52
37
  const ref = useRef(null);
38
+ useScrollLock();
53
39
  useEffect(() => {
54
- ref.current?.querySelector(FOCUSABLE)?.focus();
40
+ ref.current?.querySelector('input')?.focus();
55
41
  }, []);
56
42
  const onKeyDown = (event) => {
57
43
  if (event.key === 'Escape') {
44
+ event.stopPropagation();
58
45
  props.onClose();
59
46
  return;
60
47
  }
61
- if (event.key !== 'Tab' || !ref.current)
62
- return;
63
- const items = [...ref.current.querySelectorAll(FOCUSABLE)];
64
- const first = items[0];
65
- const last = items[items.length - 1];
66
- if (!first || !last)
67
- return;
68
- if (!event.shiftKey && document.activeElement === last) {
69
- event.preventDefault();
70
- first.focus();
71
- }
72
- else if (event.shiftKey && document.activeElement === first) {
73
- event.preventDefault();
74
- last.focus();
75
- }
48
+ trapTab(event, ref.current);
76
49
  };
77
- return (_jsxs(_Fragment, { children: [_jsx("div", { className: "hl-drawer-backdrop", onClick: props.onClose, "aria-hidden": "true" }), _jsx("div", { ref: ref, role: "dialog", "aria-modal": "true", "aria-label": "Menu", className: "hl-drawer", onKeyDown: onKeyDown, children: props.children })] }));
50
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "hl-search-backdrop", onClick: props.onClose, "aria-hidden": "true" }), _jsxs("div", { ref: ref, role: "dialog", "aria-modal": "true", "aria-label": "Search", className: "hl-search-overlay", onKeyDown: onKeyDown, children: [_jsx("button", { type: "button", className: "hl-search-close", "aria-label": "Close search", onClick: props.onClose, children: _jsx("svg", { width: "20", height: "20", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M19 12H5M11 18l-6-6 6-6" }) }) }), _jsx(ShellSearch, { entries: props.entries, inputRef: props.inputRef })] })] }));
78
51
  }
79
52
  /**
80
53
  * The dashboards' frame: the sidebar (brand, grouped pages, the theme switch, the account),
81
54
  * a top bar (search, the notifications slot and a status chip) and the page. On a computer the
82
- * sidebar collapses to a strip of icons (remembered in this browser); on a phone it is a menu.
55
+ * sidebar collapses to a strip of icons (remembered in this browser). Below 1024px (phones and
56
+ * tablets) there is no sidebar: a bottom bar has the pages marked `bottom` and More (the rest,
57
+ * the theme and the account), and the top bar is one row of the logo, a search button, the
58
+ * notifications slot and the status chip.
83
59
  * Keyboard: ⌘K or / search, ⌘B the sidebar, ⇧⌘L the theme, N notifications, G then a letter
84
60
  * a page, ? the list of them all (Ctrl for ⌘ off a Mac).
85
61
  */
86
62
  export function AppShell(props) {
87
63
  const narrow = useNarrow();
88
- const [menuOpen, setMenuOpen] = useState(false);
64
+ const [searchOpen, setSearchOpen] = useState(false);
89
65
  const [helpOpen, setHelpOpen] = useState(false);
90
66
  const [collapsedChoice, toggleCollapsed] = useSidebarCollapsed();
91
67
  const collapsed = !narrow && collapsedChoice;
92
68
  const { choice, setChoice } = useTheme();
93
69
  const navigate = useNavigate();
94
- const menuButton = useRef(null);
70
+ const searchButton = useRef(null);
95
71
  const searchInput = useRef(null);
96
72
  const topbar = useRef(null);
97
73
  const goPressedAt = useRef(0);
98
74
  const helpReturn = useRef(null);
99
75
  const keys = useMemo(() => keyNames(isMac()), []);
100
76
  const { pathname } = useLocation();
101
- const closeMenu = useCallback(() => {
102
- setMenuOpen(false);
103
- menuButton.current?.focus();
77
+ const closeSearch = useCallback(() => {
78
+ setSearchOpen(false);
79
+ searchButton.current?.focus();
104
80
  }, []);
105
81
  const closeHelp = useCallback(() => {
106
82
  setHelpOpen(false);
107
83
  helpReturn.current?.focus();
108
84
  }, []);
109
85
  useEffect(() => {
110
- setMenuOpen(false);
86
+ setSearchOpen(false);
111
87
  }, [pathname]);
88
+ // The search box's own place changes with the layout: an open overlay goes with it.
89
+ useEffect(() => {
90
+ if (!narrow)
91
+ setSearchOpen(false);
92
+ }, [narrow]);
112
93
  const pages = useMemo(() => flattenNav(props.nav), [props.nav]);
113
94
  const go = useMemo(() => goKeys(pages), [pages]);
114
95
  const entries = useMemo(() => [
@@ -121,14 +102,20 @@ export function AppShell(props) {
121
102
  setHelpOpen(true);
122
103
  };
123
104
  const onKeyDown = (event) => {
124
- if (event.defaultPrevented || event.isComposing || helpOpen || menuOpen)
105
+ if (event.defaultPrevented || event.isComposing || helpOpen || searchOpen)
125
106
  return;
107
+ const focusSearch = () => {
108
+ if (narrow)
109
+ setSearchOpen(true);
110
+ else
111
+ searchInput.current?.focus();
112
+ };
126
113
  const key = event.key.toLowerCase();
127
114
  const mod = event.metaKey || event.ctrlKey;
128
115
  if (mod && !event.altKey) {
129
116
  if (key === 'k' && !event.shiftKey) {
130
117
  event.preventDefault();
131
- searchInput.current?.focus();
118
+ focusSearch();
132
119
  }
133
120
  else if (key === 'b' && !event.shiftKey && !narrow && !isTyping(event.target)) {
134
121
  event.preventDefault();
@@ -158,7 +145,7 @@ export function AppShell(props) {
158
145
  }
159
146
  if (event.key === '/') {
160
147
  event.preventDefault();
161
- searchInput.current?.focus();
148
+ focusSearch();
162
149
  }
163
150
  else if (event.key === '?') {
164
151
  event.preventDefault();
@@ -177,8 +164,7 @@ export function AppShell(props) {
177
164
  };
178
165
  window.addEventListener('keydown', onKeyDown);
179
166
  return () => window.removeEventListener('keydown', onKeyDown);
180
- }, [helpOpen, menuOpen, narrow, toggleCollapsed, choice, setChoice, go, navigate]);
181
- const sidebar = (_jsx(SidebarBody, { brand: props.brand, brandMark: props.brandMark, nav: props.nav, account: props.account, collapse: narrow ? undefined : { collapsed, toggle: toggleCollapsed, mod: keys.mod } }));
182
- return (_jsxs("div", { className: "hl-shell", children: [_jsx("a", { className: "hl-skip", href: "#main", children: "Skip to the page" }), !narrow && (_jsx("aside", { className: "hl-sidebar", "data-collapsed": collapsed ? '' : undefined, children: sidebar })), narrow && menuOpen && _jsx(MenuDrawer, { onClose: closeMenu, children: sidebar }), _jsxs("div", { className: "hl-content", children: [_jsxs("header", { ref: topbar, className: "hl-topbar", children: [narrow && (_jsx("button", { ref: menuButton, type: "button", className: "hl-menu-button", "aria-expanded": menuOpen, onClick: () => setMenuOpen(true), children: "Menu" })), _jsx(ShellSearch, { entries: entries, inputRef: searchInput, hint: narrow ? undefined : `${keys.mod === '⌘' ? '⌘' : 'Ctrl '}K` }), (props.notifications || props.statusChip) && (_jsxs("div", { className: "hl-topbar__end", children: [props.notifications, props.statusChip] }))] }), _jsx("div", { id: "main", className: "hl-main", tabIndex: -1, children: props.children })] }), helpOpen && (_jsx(ShortcutsDialog, { mod: keys.mod, shift: keys.shift, go: go, canCollapse: !narrow, hasNotifications: Boolean(props.notifications), onClose: closeHelp }))] }));
167
+ }, [helpOpen, searchOpen, narrow, toggleCollapsed, choice, setChoice, go, navigate]);
168
+ return (_jsxs("div", { className: "hl-shell", "data-narrow": narrow ? '' : undefined, children: [_jsx("a", { className: "hl-skip", href: "#main", children: "Skip to the page" }), !narrow && (_jsx("aside", { className: "hl-sidebar", "data-collapsed": collapsed ? '' : undefined, children: _jsx(SidebarBody, { brand: props.brand, brandMark: props.brandMark, nav: props.nav, account: props.account, collapse: { collapsed, toggle: toggleCollapsed, mod: keys.mod } }) })), _jsxs("div", { className: "hl-content", children: [_jsxs("header", { ref: topbar, className: "hl-topbar", "data-narrow": narrow ? '' : undefined, children: [narrow ? (_jsx(Link, { to: "/", className: "hl-brand", "aria-label": props.brandMark ? 'Start page' : undefined, children: props.brandMark ?? props.brand })) : (_jsx(ShellSearch, { entries: entries, inputRef: searchInput, hint: `${keys.mod === '⌘' ? '⌘' : 'Ctrl '}K` })), (narrow || props.notifications || props.statusChip) && (_jsxs("div", { className: "hl-topbar__end", children: [narrow && (_jsx("button", { ref: searchButton, type: "button", className: "hl-search-button", "aria-label": "Search", "aria-haspopup": "dialog", "aria-expanded": searchOpen, onClick: () => setSearchOpen(true), children: SEARCH_ICON })), props.notifications, props.statusChip] }))] }), _jsx("div", { id: "main", className: "hl-main", tabIndex: -1, children: props.children })] }), narrow && _jsx(MobileNav, { nav: props.nav, account: props.account }), narrow && searchOpen && (_jsx(SearchOverlay, { entries: entries, inputRef: searchInput, onClose: closeSearch })), helpOpen && (_jsx(ShortcutsDialog, { mod: keys.mod, shift: keys.shift, go: go, canCollapse: !narrow, hasNotifications: Boolean(props.notifications), onClose: closeHelp }))] }));
183
169
  }
184
170
  //# sourceMappingURL=AppShell.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AppShell.js","sourceRoot":"","sources":["../../src/shell/AppShell.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAE/C,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAE/C,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,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 +1,34 @@
1
+ import type { ReactElement, Ref } from 'react';
2
+ import type { ShellAccount } from './Account.js';
3
+ import type { NavGroup, NavItem } from './nav.js';
4
+ /**
5
+ * The phone and tablet bar at the bottom of the screen: up to 4 pages, each an icon over its
6
+ * name (a neutral square when it has no icon), then More. `current` is the page open; by
7
+ * default the deepest of `items` that `pathname` is under.
8
+ */
9
+ export declare function BottomNav(props: {
10
+ items: NavItem[];
11
+ pathname: string;
12
+ current?: string;
13
+ onMore: () => void;
14
+ /** For giving focus back to More when the sheet it opens closes. */
15
+ moreRef?: Ref<HTMLButtonElement>;
16
+ /** Whether the sheet More opens is open. */
17
+ moreOpen?: boolean;
18
+ /** Marks More: the page open is one of those under it. */
19
+ moreCurrent?: boolean;
20
+ /** A query string every link keeps, such as Shopify's `?host=…&shop=…`. */
21
+ search?: string;
22
+ }): ReactElement;
23
+ /**
24
+ * The bottom bar and the More sheet together, as the dashboards and the embedded Shopify app
25
+ * use them below 1024px: the bar has the pages marked `bottom` (or the first 4), the sheet
26
+ * the rest, the theme switch and, given an account, who is signed in with Sign out.
27
+ */
28
+ export declare function MobileNav(props: {
29
+ nav: NavGroup[];
30
+ /** Absent inside Shopify admin, where there is nobody to sign out. */
31
+ account?: ShellAccount;
32
+ /** A query string every link keeps, such as Shopify's `?host=…&shop=…`. */
33
+ search?: string;
34
+ }): ReactElement;
@@ -0,0 +1,40 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
3
+ import { Link, useLocation } from 'react-router-dom';
4
+ import { NavIcon } from './icons.js';
5
+ import { MoreSheet } from './MoreSheet.js';
6
+ import { bottomItems, currentPage, flattenNav, navTarget } from './nav.js';
7
+ const MORE_ICON = (_jsxs("svg", { width: "22", height: "22", viewBox: "0 0 24 24", fill: "currentColor", "aria-hidden": "true", children: [_jsx("circle", { cx: "5", cy: "12", r: "1.8" }), _jsx("circle", { cx: "12", cy: "12", r: "1.8" }), _jsx("circle", { cx: "19", cy: "12", r: "1.8" })] }));
8
+ /**
9
+ * The phone and tablet bar at the bottom of the screen: up to 4 pages, each an icon over its
10
+ * name (a neutral square when it has no icon), then More. `current` is the page open; by
11
+ * default the deepest of `items` that `pathname` is under.
12
+ */
13
+ export function BottomNav(props) {
14
+ const current = props.current ?? currentPage(props.items, props.pathname);
15
+ return (_jsxs("nav", { "aria-label": "Main", className: "hl-bottom-nav", children: [props.items.map((item) => (_jsxs(Link, { to: navTarget(item.to, props.search), "aria-current": item.to === current ? 'page' : undefined, children: [_jsx("span", { className: "hl-bottom-nav__icon", children: item.icon ?? _jsx(NavIcon, { name: "generic", size: 20 }) }), _jsx("span", { className: "hl-bottom-nav__label", children: item.label })] }, item.to))), _jsxs("button", { ref: props.moreRef, type: "button", className: "hl-bottom-nav__more", "aria-haspopup": "dialog", "aria-expanded": props.moreOpen ?? false, "data-current": props.moreCurrent ? '' : undefined, onClick: props.onMore, children: [_jsx("span", { className: "hl-bottom-nav__icon", children: MORE_ICON }), _jsx("span", { className: "hl-bottom-nav__label", children: "More" })] })] }));
16
+ }
17
+ /**
18
+ * The bottom bar and the More sheet together, as the dashboards and the embedded Shopify app
19
+ * use them below 1024px: the bar has the pages marked `bottom` (or the first 4), the sheet
20
+ * the rest, the theme switch and, given an account, who is signed in with Sign out.
21
+ */
22
+ export function MobileNav(props) {
23
+ const { pathname } = useLocation();
24
+ const [open, setOpen] = useState(false);
25
+ const more = useRef(null);
26
+ const bar = useMemo(() => bottomItems(props.nav), [props.nav]);
27
+ const current = useMemo(() => currentPage(flattenNav(props.nav), pathname), [props.nav, pathname]);
28
+ // A bar page stays marked on the pages under it; More is marked for a page of its own.
29
+ const barCurrent = currentPage(bar, pathname);
30
+ const close = useCallback(() => {
31
+ setOpen(false);
32
+ more.current?.focus();
33
+ }, []);
34
+ // A page opened some other way (the browser's Back) closes the sheet too.
35
+ useEffect(() => {
36
+ setOpen(false);
37
+ }, [pathname]);
38
+ return (_jsxs(_Fragment, { children: [_jsx(BottomNav, { items: bar, pathname: pathname, current: barCurrent, onMore: () => setOpen(true), moreRef: more, moreOpen: open, moreCurrent: barCurrent === undefined && current !== undefined, search: props.search }), open && (_jsx(MoreSheet, { nav: props.nav, bar: bar, current: current, account: props.account, search: props.search, onClose: close }))] }));
39
+ }
40
+ //# sourceMappingURL=BottomNav.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomNav.js","sourceRoot":"","sources":["../../src/shell/BottomNav.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE1E,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,OAAO,EAAE,MAAM,YAAY,CAAC;AACrC,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAG3E,MAAM,SAAS,GAAG,CAChB,eAAK,KAAK,EAAC,IAAI,EAAC,MAAM,EAAC,IAAI,EAAC,OAAO,EAAC,WAAW,EAAC,IAAI,EAAC,cAAc,iBAAa,MAAM,aACpF,iBAAQ,EAAE,EAAC,GAAG,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,EACjC,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,EAClC,iBAAQ,EAAE,EAAC,IAAI,EAAC,EAAE,EAAC,IAAI,EAAC,CAAC,EAAC,KAAK,GAAG,IAC9B,CACP,CAAC;AAEF;;;;GAIG;AACH,MAAM,UAAU,SAAS,CAAC,KAazB;IACC,MAAM,OAAO,GAAG,KAAK,CAAC,OAAO,IAAI,WAAW,CAAC,KAAK,CAAC,KAAK,EAAE,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,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { ShellAccount } from './Account.js';
3
+ import type { NavGroup, NavItem } from './nav.js';
4
+ /**
5
+ * What More opens on a phone or tablet: a sheet from the bottom with every page the bar has
6
+ * not, grouped as in the sidebar, the theme switch, and (given an account) who is signed in
7
+ * with Sign out at the right end of that row. It keeps focus inside and closes with Escape,
8
+ * the backdrop, Close or a page picked; `onClose` gives focus back to More.
9
+ */
10
+ export declare function MoreSheet(props: {
11
+ nav: NavGroup[];
12
+ /** The bar's pages, which the sheet leaves out. */
13
+ bar: NavItem[];
14
+ /** The page open. */
15
+ current: string | undefined;
16
+ /** Absent inside Shopify admin: the sheet then has the theme switch only. */
17
+ account?: ShellAccount;
18
+ /** A query string every link keeps, such as Shopify's `?host=…&shop=…`. */
19
+ search?: string;
20
+ onClose: () => void;
21
+ }): ReactElement;
@@ -0,0 +1,46 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { useEffect, useId, useRef } from 'react';
3
+ import { Link } from 'react-router-dom';
4
+ import { ThemeSwitch } from '../theme/ThemeSwitch.js';
5
+ import { accountLines } from './Account.js';
6
+ import { FOCUSABLE, trapTab, useScrollLock } from './focus-trap.js';
7
+ import { navTarget } from './nav.js';
8
+ /** The pages of `items` and their children, with how deep each is. */
9
+ function walk(items, depth = 0) {
10
+ return items.flatMap((item) => [{ item, depth }, ...walk(item.children ?? [], depth + 1)]);
11
+ }
12
+ const SIGN_OUT_ICON = (_jsx("svg", { width: "16", height: "16", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: "M15 4h3a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-3M10 16l-4-4 4-4M6 12h10" }) }));
13
+ /**
14
+ * What More opens on a phone or tablet: a sheet from the bottom with every page the bar has
15
+ * not, grouped as in the sidebar, the theme switch, and (given an account) who is signed in
16
+ * with Sign out at the right end of that row. It keeps focus inside and closes with Escape,
17
+ * the backdrop, Close or a page picked; `onClose` gives focus back to More.
18
+ */
19
+ export function MoreSheet(props) {
20
+ const ref = useRef(null);
21
+ const titleId = useId();
22
+ useScrollLock();
23
+ useEffect(() => {
24
+ ref.current?.querySelector(FOCUSABLE)?.focus();
25
+ }, []);
26
+ const onKeyDown = (event) => {
27
+ // The sheet keeps the keyboard to itself: the shell's shortcuts wait until it closes.
28
+ event.stopPropagation();
29
+ if (event.key === 'Escape') {
30
+ props.onClose();
31
+ return;
32
+ }
33
+ trapTab(event, ref.current);
34
+ };
35
+ const inBar = new Set(props.bar.map((item) => item.to));
36
+ const groups = props.nav
37
+ .map((group) => ({
38
+ label: group.label,
39
+ pages: walk(group.items).filter(({ item }) => !inBar.has(item.to)),
40
+ }))
41
+ .filter((group) => group.pages.length > 0);
42
+ const account = props.account;
43
+ const lines = account ? accountLines(account) : undefined;
44
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "hl-more-backdrop", onClick: props.onClose, "aria-hidden": "true" }), _jsxs("div", { ref: ref, role: "dialog", "aria-modal": "true", "aria-labelledby": titleId, className: "hl-more", onKeyDown: onKeyDown, children: [_jsxs("div", { className: "hl-more__head", children: [_jsx("h2", { id: titleId, children: "More" }), _jsx("button", { type: "button", className: "hl-more__close", "aria-label": "Close", onClick: props.onClose, children: _jsx("svg", { width: "18", height: "18", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", "aria-hidden": "true", children: _jsx("path", { d: "M6 6l12 12M18 6L6 18" }) }) })] }), groups.map((group, i) => (_jsxs("div", { children: [group.label && _jsx("p", { className: "hl-more__group", children: group.label }), _jsx("ul", { children: group.pages.map(({ item, depth }) => (_jsx("li", { children: _jsxs(Link, { to: navTarget(item.to, props.search), className: depth > 0 ? 'hl-more__sub' : undefined, "aria-current": item.to === props.current ? 'page' : undefined, onClick: props.onClose, children: [item.icon, _jsx("span", { children: item.label })] }) }, item.to))) })] }, group.label ?? `group-${String(i)}`))), _jsxs("div", { className: "hl-more__theme", children: [_jsx("span", { children: "Theme" }), _jsx(ThemeSwitch, { labels: true })] }), account && lines && (_jsxs("div", { className: "hl-more__account", children: [_jsx("span", { "aria-hidden": "true", className: "hl-avatar", children: account.name.charAt(0).toUpperCase() }), _jsxs("span", { className: "hl-more__who", children: [_jsx("strong", { children: lines.first }), lines.second && _jsx("span", { children: lines.second })] }), _jsxs("button", { type: "button", className: "hl-more__signout", disabled: account.signingOut, onClick: account.onSignOut, children: [SIGN_OUT_ICON, account.signingOut ? 'Signing out…' : 'Sign out'] })] }))] })] }));
45
+ }
46
+ //# sourceMappingURL=MoreSheet.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MoreSheet.js","sourceRoot":"","sources":["../../src/shell/MoreSheet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AACxC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAE5C,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAGrC,sEAAsE;AACtE,SAAS,IAAI,CAAC,KAAgB,EAAE,KAAK,GAAG,CAAC;IACvC,OAAO,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,IAAI,EAAE,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;AAC7F,CAAC;AAED,MAAM,aAAa,GAAG,CACpB,cACE,K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 -0,0 +1,6 @@
1
+ /**
2
+ * The phone and tablet bottom bar and its More sheet, on the theme tokens only. Part of
3
+ * SHELL_CSS; the embedded Shopify app, which has no dashboard theme, renders it on its own
4
+ * and gives the tokens its own values.
5
+ */
6
+ export declare const BOTTOM_NAV_CSS = "\n.hl-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(56px + env(safe-area-inset-bottom)); box-sizing: border-box; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--hl-surface); border-top: 1px solid var(--hl-border); font-family: var(--hl-font, inherit); }\n.hl-bottom-nav a, .hl-bottom-nav button.hl-bottom-nav__more { min-width: 0; min-height: 44px; height: 56px; margin: 0; padding: 4px 2px; box-sizing: border-box; border: 0; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; color: var(--hl-muted); font: inherit; font-size: 11px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: none; }\n.hl-bottom-nav a:hover { color: var(--hl-text); text-decoration: none; }\n.hl-bottom-nav button.hl-bottom-nav__more:hover:not(:disabled) { background: transparent; border-color: transparent; color: var(--hl-text); }\n.hl-bottom-nav a[aria-current=\"page\"], .hl-bottom-nav button.hl-bottom-nav__more[data-current] { color: var(--hl-accent-text); font-weight: 700; }\n.hl-bottom-nav__icon { width: 48px; height: 28px; border-radius: 999px; display: grid; place-items: center; }\n.hl-bottom-nav a[aria-current=\"page\"] .hl-bottom-nav__icon, .hl-bottom-nav button.hl-bottom-nav__more[data-current] .hl-bottom-nav__icon { background: var(--hl-accent-soft); }\n.hl-bottom-nav__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hl-more-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); }\n.hl-more { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 85vh; overflow-y: auto; box-sizing: border-box; padding: 6px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-radius: 16px 16px 0 0; background: var(--hl-surface); color: var(--hl-text); font-family: var(--hl-font, inherit); font-size: 13px; box-shadow: 0 -12px 40px rgba(0,0,0,.25); }\n.hl-more__head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }\n.hl-more h2 { margin: 0 0 0 10px; font-size: 15px; font-weight: 800; }\n.hl-more button.hl-more__close { width: 44px; height: 44px; min-height: 44px; padding: 0; box-sizing: border-box; border: 0; border-radius: var(--hl-radius-control); display: grid; place-items: center; background: transparent; color: var(--hl-muted); cursor: pointer; box-shadow: none; }\n.hl-more button.hl-more__close:hover:not(:disabled) { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }\n.hl-more__group { margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }\n.hl-more ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }\n.hl-more a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: var(--hl-radius-control); color: var(--hl-text); font-weight: 600; text-decoration: none; }\n.hl-more a:hover { background: var(--hl-faint); color: var(--hl-text); text-decoration: none; }\n.hl-more a.hl-more__sub { padding-left: 30px; font-weight: 500; color: var(--hl-muted); }\n.hl-more a[aria-current=\"page\"] { background: var(--hl-accent-soft); color: var(--hl-accent-text); font-weight: 700; }\n.hl-more__theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 10px 0; border-top: 1px solid var(--hl-border); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }\n.hl-more .hl-theme-switch { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--hl-faint); }\n.hl-more .hl-theme-switch button { width: auto; min-width: 44px; height: 40px; min-height: 40px; padding: 0 12px; box-sizing: border-box; border: 0; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; color: var(--hl-muted); font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer; box-shadow: none; }\n.hl-more .hl-theme-switch button:hover:not(:disabled) { background: var(--hl-surface); border-color: transparent; color: var(--hl-text); }\n.hl-more .hl-theme-switch button[aria-pressed=\"true\"], .hl-more .hl-theme-switch button[aria-pressed=\"true\"]:hover:not(:disabled) { background: var(--hl-accent); border-color: var(--hl-accent); color: var(--hl-on-accent); }\n.hl-more__account { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 0 0 10px; border-top: 1px solid var(--hl-border); }\n.hl-more__who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }\n.hl-more__who strong, .hl-more__who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hl-more__who span { color: var(--hl-muted); }\n.hl-more button.hl-more__signout { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; box-sizing: border-box; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-control); background: transparent; color: var(--hl-text); font: inherit; font-weight: 600; cursor: pointer; box-shadow: none; }\n.hl-more button.hl-more__signout:hover:not(:disabled) { background: var(--hl-faint); border-color: var(--hl-border); color: var(--hl-text); }\n.hl-more button.hl-more__signout:disabled { background: transparent; border-color: var(--hl-border); color: var(--hl-muted); opacity: .7; cursor: default; }\n";
@@ -0,0 +1,40 @@
1
+ /**
2
+ * The phone and tablet bottom bar and its More sheet, on the theme tokens only. Part of
3
+ * SHELL_CSS; the embedded Shopify app, which has no dashboard theme, renders it on its own
4
+ * and gives the tokens its own values.
5
+ */
6
+ export const BOTTOM_NAV_CSS = `
7
+ .hl-bottom-nav { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(56px + env(safe-area-inset-bottom)); box-sizing: border-box; padding: 0 env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); background: var(--hl-surface); border-top: 1px solid var(--hl-border); font-family: var(--hl-font, inherit); }
8
+ .hl-bottom-nav a, .hl-bottom-nav button.hl-bottom-nav__more { min-width: 0; min-height: 44px; height: 56px; margin: 0; padding: 4px 2px; box-sizing: border-box; border: 0; border-radius: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; background: transparent; color: var(--hl-muted); font: inherit; font-size: 11px; font-weight: 600; line-height: 1.2; text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent; box-shadow: none; }
9
+ .hl-bottom-nav a:hover { color: var(--hl-text); text-decoration: none; }
10
+ .hl-bottom-nav button.hl-bottom-nav__more:hover:not(:disabled) { background: transparent; border-color: transparent; color: var(--hl-text); }
11
+ .hl-bottom-nav a[aria-current="page"], .hl-bottom-nav button.hl-bottom-nav__more[data-current] { color: var(--hl-accent-text); font-weight: 700; }
12
+ .hl-bottom-nav__icon { width: 48px; height: 28px; border-radius: 999px; display: grid; place-items: center; }
13
+ .hl-bottom-nav a[aria-current="page"] .hl-bottom-nav__icon, .hl-bottom-nav button.hl-bottom-nav__more[data-current] .hl-bottom-nav__icon { background: var(--hl-accent-soft); }
14
+ .hl-bottom-nav__label { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
15
+ .hl-more-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); }
16
+ .hl-more { position: fixed; left: 0; right: 0; bottom: 0; z-index: 41; max-height: 85vh; overflow-y: auto; box-sizing: border-box; padding: 6px max(16px, env(safe-area-inset-right)) calc(16px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left)); border-radius: 16px 16px 0 0; background: var(--hl-surface); color: var(--hl-text); font-family: var(--hl-font, inherit); font-size: 13px; box-shadow: 0 -12px 40px rgba(0,0,0,.25); }
17
+ .hl-more__head { display: flex; align-items: center; justify-content: space-between; min-height: 44px; }
18
+ .hl-more h2 { margin: 0 0 0 10px; font-size: 15px; font-weight: 800; }
19
+ .hl-more button.hl-more__close { width: 44px; height: 44px; min-height: 44px; padding: 0; box-sizing: border-box; border: 0; border-radius: var(--hl-radius-control); display: grid; place-items: center; background: transparent; color: var(--hl-muted); cursor: pointer; box-shadow: none; }
20
+ .hl-more button.hl-more__close:hover:not(:disabled) { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }
21
+ .hl-more__group { margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }
22
+ .hl-more ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
23
+ .hl-more a { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 10px; border-radius: var(--hl-radius-control); color: var(--hl-text); font-weight: 600; text-decoration: none; }
24
+ .hl-more a:hover { background: var(--hl-faint); color: var(--hl-text); text-decoration: none; }
25
+ .hl-more a.hl-more__sub { padding-left: 30px; font-weight: 500; color: var(--hl-muted); }
26
+ .hl-more a[aria-current="page"] { background: var(--hl-accent-soft); color: var(--hl-accent-text); font-weight: 700; }
27
+ .hl-more__theme { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 12px; padding: 12px 10px 0; border-top: 1px solid var(--hl-border); font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }
28
+ .hl-more .hl-theme-switch { display: flex; gap: 2px; padding: 2px; border-radius: 999px; background: var(--hl-faint); }
29
+ .hl-more .hl-theme-switch button { width: auto; min-width: 44px; height: 40px; min-height: 40px; padding: 0 12px; box-sizing: border-box; border: 0; border-radius: 999px; display: flex; align-items: center; justify-content: center; gap: 6px; background: transparent; color: var(--hl-muted); font: inherit; font-size: 13px; font-weight: 600; letter-spacing: 0; text-transform: none; cursor: pointer; box-shadow: none; }
30
+ .hl-more .hl-theme-switch button:hover:not(:disabled) { background: var(--hl-surface); border-color: transparent; color: var(--hl-text); }
31
+ .hl-more .hl-theme-switch button[aria-pressed="true"], .hl-more .hl-theme-switch button[aria-pressed="true"]:hover:not(:disabled) { background: var(--hl-accent); border-color: var(--hl-accent); color: var(--hl-on-accent); }
32
+ .hl-more__account { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 0 0 10px; border-top: 1px solid var(--hl-border); }
33
+ .hl-more__who { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
34
+ .hl-more__who strong, .hl-more__who span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
35
+ .hl-more__who span { color: var(--hl-muted); }
36
+ .hl-more button.hl-more__signout { flex: none; display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; box-sizing: border-box; border: 1px solid var(--hl-border); border-radius: var(--hl-radius-control); background: transparent; color: var(--hl-text); font: inherit; font-weight: 600; cursor: pointer; box-shadow: none; }
37
+ .hl-more button.hl-more__signout:hover:not(:disabled) { background: var(--hl-faint); border-color: var(--hl-border); color: var(--hl-text); }
38
+ .hl-more button.hl-more__signout:disabled { background: transparent; border-color: var(--hl-border); color: var(--hl-muted); opacity: .7; cursor: default; }
39
+ `;
40
+ //# sourceMappingURL=bottom-nav-css.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bottom-nav-css.js","sourceRoot":"","sources":["../../src/shell/bottom-nav-css.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAiC7B,CAAC"}
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Below this width (phones and tablets) the dashboards have a bottom bar instead of the
3
+ * sidebar, and the sign-in page shows its card alone. The CSS and `useNarrow` both use it.
4
+ */
5
+ export declare const NARROW_BREAKPOINT = 1024;
6
+ /** The media query for "below the breakpoint". */
7
+ export declare const NARROW_QUERY: string;
8
+ /**
9
+ * Whether the screen is below the breakpoint. Read as the first render is made, so a phone
10
+ * never draws the sidebar first; it follows the window as it is resized or turned.
11
+ */
12
+ export declare function useNarrow(): boolean;
@@ -0,0 +1,29 @@
1
+ import { useEffect, useState } from 'react';
2
+ /**
3
+ * Below this width (phones and tablets) the dashboards have a bottom bar instead of the
4
+ * sidebar, and the sign-in page shows its card alone. The CSS and `useNarrow` both use it.
5
+ */
6
+ export const NARROW_BREAKPOINT = 1024;
7
+ /** The media query for "below the breakpoint". */
8
+ export const NARROW_QUERY = `(max-width: ${String(NARROW_BREAKPOINT - 1)}px)`;
9
+ const query = () => typeof window !== 'undefined' && typeof window.matchMedia === 'function'
10
+ ? window.matchMedia(NARROW_QUERY)
11
+ : null;
12
+ /**
13
+ * Whether the screen is below the breakpoint. Read as the first render is made, so a phone
14
+ * never draws the sidebar first; it follows the window as it is resized or turned.
15
+ */
16
+ export function useNarrow() {
17
+ const [narrow, setNarrow] = useState(() => query()?.matches ?? false);
18
+ useEffect(() => {
19
+ const list = query();
20
+ if (!list)
21
+ return;
22
+ const onChange = () => setNarrow(list.matches);
23
+ onChange();
24
+ list.addEventListener('change', onChange);
25
+ return () => list.removeEventListener('change', onChange);
26
+ }, []);
27
+ return narrow;
28
+ }
29
+ //# sourceMappingURL=breakpoint.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"breakpoint.js","sourceRoot":"","sources":["../../src/shell/breakpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C;;;GAGG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,IAAI,CAAC;AACtC,kDAAkD;AAClD,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,MAAM,CAAC,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC;AAE9E,MAAM,KAAK,GAAG,GAA0B,EAAE,CACxC,OAAO,MAAM,KAAK,WAAW,IAAI,OAAO,MAAM,CAAC,UAAU,KAAK,UAAU;IACtE,CAAC,CAAC,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC;IACjC,CAAC,CAAC,IAAI,CAAC;AAEX;;;GAGG;AACH,MAAM,UAAU,SAAS;IACvB,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,EAAE,OAAO,IAAI,KAAK,CAAC,CAAC;IACtE,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,KAAK,EAAE,CAAC;QACrB,IAAI,CAAC,IAAI;YAAE,OAAO;QAClB,MAAM,QAAQ,GAAG,GAAS,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACrD,QAAQ,EAAE,CAAC;QACX,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAC1C,OAAO,GAAG,EAAE,CAAC,IAAI,CAAC,mBAAmB,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC5D,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,9 @@
1
+ import type { KeyboardEvent } from 'react';
2
+ export declare const FOCUSABLE = "a[href], button:not([disabled]), input, select, textarea, [tabindex]:not([tabindex=\"-1\"])";
3
+ /** Keeps Tab and Shift+Tab inside `container`, going round from the last stop to the first. */
4
+ export declare function trapTab(event: KeyboardEvent<HTMLElement>, container: HTMLElement | null): void;
5
+ /**
6
+ * While the component that calls it is shown (the More sheet, the phone search), the page
7
+ * behind does not scroll; its own overflow comes back when it closes.
8
+ */
9
+ export declare function useScrollLock(): void;