@haatlabs-core/ui 0.19.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 (88) 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 +13 -1
  9. package/dist/client/index.js +11 -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 +9 -3
  18. package/dist/index.js +8 -3
  19. package/dist/index.js.map +1 -1
  20. package/dist/notifications/NotificationBell.d.ts +12 -0
  21. package/dist/notifications/NotificationBell.js +94 -0
  22. package/dist/notifications/NotificationBell.js.map +1 -0
  23. package/dist/notifications/NotificationInbox.d.ts +23 -0
  24. package/dist/notifications/NotificationInbox.js +92 -0
  25. package/dist/notifications/NotificationInbox.js.map +1 -0
  26. package/dist/notifications/NotificationPreferences.d.ts +10 -0
  27. package/dist/notifications/NotificationPreferences.js +135 -0
  28. package/dist/notifications/NotificationPreferences.js.map +1 -0
  29. package/dist/notifications/notifications-css.d.ts +6 -0
  30. package/dist/notifications/notifications-css.js +62 -0
  31. package/dist/notifications/notifications-css.js.map +1 -0
  32. package/dist/notifications/types.d.ts +80 -0
  33. package/dist/notifications/types.js +12 -0
  34. package/dist/notifications/types.js.map +1 -0
  35. package/dist/notifications/use-notification-stream.d.ts +15 -0
  36. package/dist/notifications/use-notification-stream.js +123 -0
  37. package/dist/notifications/use-notification-stream.js.map +1 -0
  38. package/dist/shell/Account.d.ts +24 -0
  39. package/dist/shell/Account.js +48 -0
  40. package/dist/shell/Account.js.map +1 -0
  41. package/dist/shell/AppShell.d.ts +13 -7
  42. package/dist/shell/AppShell.js +139 -65
  43. package/dist/shell/AppShell.js.map +1 -1
  44. package/dist/shell/BottomNav.d.ts +34 -0
  45. package/dist/shell/BottomNav.js +40 -0
  46. package/dist/shell/BottomNav.js.map +1 -0
  47. package/dist/shell/MoreSheet.d.ts +21 -0
  48. package/dist/shell/MoreSheet.js +46 -0
  49. package/dist/shell/MoreSheet.js.map +1 -0
  50. package/dist/shell/ShellSearch.d.ts +6 -2
  51. package/dist/shell/ShellSearch.js +3 -3
  52. package/dist/shell/ShellSearch.js.map +1 -1
  53. package/dist/shell/ShortcutsDialog.d.ts +11 -0
  54. package/dist/shell/ShortcutsDialog.js +26 -0
  55. package/dist/shell/ShortcutsDialog.js.map +1 -0
  56. package/dist/shell/bottom-nav-css.d.ts +6 -0
  57. package/dist/shell/bottom-nav-css.js +40 -0
  58. package/dist/shell/bottom-nav-css.js.map +1 -0
  59. package/dist/shell/breakpoint.d.ts +12 -0
  60. package/dist/shell/breakpoint.js +29 -0
  61. package/dist/shell/breakpoint.js.map +1 -0
  62. package/dist/shell/focus-trap.d.ts +9 -0
  63. package/dist/shell/focus-trap.js +35 -0
  64. package/dist/shell/focus-trap.js.map +1 -0
  65. package/dist/shell/icons.d.ts +23 -0
  66. package/dist/shell/icons.js +21 -0
  67. package/dist/shell/icons.js.map +1 -0
  68. package/dist/shell/nav.d.ts +22 -0
  69. package/dist/shell/nav.js +22 -0
  70. package/dist/shell/nav.js.map +1 -1
  71. package/dist/shell/shell-css.d.ts +1 -1
  72. package/dist/shell/shell-css.js +67 -16
  73. package/dist/shell/shell-css.js.map +1 -1
  74. package/dist/shell/shortcuts.d.ts +22 -0
  75. package/dist/shell/shortcuts.js +48 -0
  76. package/dist/shell/shortcuts.js.map +1 -0
  77. package/dist/shell/sidebar-state.d.ts +5 -0
  78. package/dist/shell/sidebar-state.js +38 -0
  79. package/dist/shell/sidebar-state.js.map +1 -0
  80. package/dist/theme/ThemeStyles.js +2 -1
  81. package/dist/theme/ThemeStyles.js.map +1 -1
  82. package/dist/theme/ThemeSwitch.d.ts +12 -2
  83. package/dist/theme/ThemeSwitch.js +19 -3
  84. package/dist/theme/ThemeSwitch.js.map +1 -1
  85. package/dist/theme/tokens.d.ts +7 -2
  86. package/dist/theme/tokens.js +24 -1
  87. package/dist/theme/tokens.js.map +1 -1
  88. package/package.json +4 -4
@@ -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,OA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AAC;IACxB,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,0EAA0E;IAC1E,SAAS,CAAC,GAAG,EAAE;QACb,OAAO,CAAC,KAAK,CAAC,CAAC;IACjB,CAAC,EAAE,CAAC,QAAQ,CAAC,CAAC,CAAC;IACf,OAAO,CACL,8BACE,KAAC,SAAS,IACR,KAAK,EAAE,GAAG,EACV,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,GAAG,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,EAC3B,OAAO,EAAE,IAAI,EACb,QAAQ,EAAE,IAAI,EACd,WAAW,EAAE,UAAU,KAAK,SAAS,IAAI,OAAO,KAAK,SAAS,EAC9D,MAAM,EAAE,KAAK,CAAC,MAAM,GACpB,EACD,IAAI,IAAI,CACP,KAAC,SAAS,IACR,GAAG,EAAE,KAAK,CAAC,GAAG,EACd,GAAG,EAAE,GAAG,EACR,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,KAAK,CAAC,OAAO,EACtB,MAAM,EAAE,KAAK,CAAC,MAAM,EACpB,OAAO,EAAE,KAAK,GACd,CACH,IACA,CACJ,CAAC;AACJ,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":"MoreShe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CAAC,CAAC,CAAC,EAAE,CAiBvC,CACP,CAAC,EACF,eAAK,SAAS,EAAC,gBAAgB,aAC7B,mCAAkB,EAClB,KAAC,WAAW,IAAC,MAAM,SAAG,IAClB,EACL,OAAO,IAAI,KAAK,IAAI,CACnB,eAAK,SAAS,EAAC,kBAAkB,aAC/B,8BAAkB,MAAM,EAAC,SAAS,EAAC,WAAW,YAC3C,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAChC,EACP,gBAAM,SAAS,EAAC,cAAc,aAC5B,2BAAS,KAAK,CAAC,KAAK,GAAU,EAC7B,KAAK,CAAC,MAAM,IAAI,yBAAO,KAAK,CAAC,MAAM,GAAQ,IACvC,EACP,kBACE,IAAI,EAAC,QAAQ,EACb,SAAS,EAAC,kBAAkB,EAC5B,QAAQ,EAAE,OAAO,CAAC,UAAU,EAC5B,OAAO,EAAE,OAAO,CAAC,SAAS,aAEzB,aAAa,EACb,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,cAAc,CAAC,CAAC,CAAC,UAAU,IAC1C,IACL,CACP,IACG,IACL,CACJ,CAAC;AACJ,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { ReactElement } from 'react';
1
+ import type { ReactElement, Ref } from 'react';
2
2
  /** A page the search can find: by its name or any of its keywords. */
3
3
  export interface SearchEntry {
4
4
  label: string;
@@ -6,6 +6,10 @@ export interface SearchEntry {
6
6
  keywords?: string[];
7
7
  }
8
8
  /** The top bar's "Search pages": a combobox that goes to the page picked. */
9
- export declare function ShellSearch({ entries }: {
9
+ export declare function ShellSearch({ entries, inputRef, hint, }: {
10
10
  entries: SearchEntry[];
11
+ /** For the shell's ⌘K and / shortcuts, which focus it. */
12
+ inputRef?: Ref<HTMLInputElement>;
13
+ /** The shortcut shown at the end of the box, such as ⌘K. */
14
+ hint?: string;
11
15
  }): ReactElement;
@@ -3,7 +3,7 @@ import { useId, useMemo, useState } from 'react';
3
3
  import { useNavigate } from 'react-router-dom';
4
4
  const MAX_RESULTS = 8;
5
5
  /** The top bar's "Search pages": a combobox that goes to the page picked. */
6
- export function ShellSearch({ entries }) {
6
+ export function ShellSearch({ entries, inputRef, hint, }) {
7
7
  const navigate = useNavigate();
8
8
  const listId = useId();
9
9
  const [query, setQuery] = useState('');
@@ -43,11 +43,11 @@ export function ShellSearch({ entries }) {
43
43
  setActive(0);
44
44
  }
45
45
  };
46
- return (_jsxs("div", { className: "hl-search", children: [_jsxs("svg", { width: "18", height: "18", 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" })] }), _jsx("input", { type: "search", role: "combobox", "aria-label": "Search pages", "aria-expanded": open, "aria-controls": listId, "aria-autocomplete": "list", "aria-activedescendant": open && results[active] ? `${listId}-${String(active)}` : undefined, placeholder: "Search pages\u2026", value: query, onChange: (e) => {
46
+ return (_jsxs("div", { className: "hl-search", children: [_jsxs("svg", { width: "18", height: "18", 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" })] }), _jsx("input", { ref: inputRef, type: "search", role: "combobox", "aria-label": "Search pages", "aria-expanded": open, "aria-controls": listId, "aria-autocomplete": "list", "aria-activedescendant": open && results[active] ? `${listId}-${String(active)}` : undefined, placeholder: "Search pages\u2026", value: query, onChange: (e) => {
47
47
  setQuery(e.target.value);
48
48
  setActive(0);
49
49
  setFocused(true);
50
- }, onKeyDown: onKeyDown, onFocus: () => setFocused(true), onBlur: () => setFocused(false) }), open && (_jsx("ul", { id: listId, role: "listbox", "aria-label": "Pages", className: "hl-search__list", children: results.length === 0 ? (_jsx("li", { role: "option", "aria-disabled": "true", "aria-selected": false, className: "hl-search__empty", children: "No pages match" })) : (results.map((entry, i) => (_jsx("li", { id: `${listId}-${String(i)}`, role: "option", "aria-selected": i === active, onMouseDown: (e) => {
50
+ }, onKeyDown: onKeyDown, onFocus: () => setFocused(true), onBlur: () => setFocused(false) }), hint && !focused && (_jsx("kbd", { className: "hl-search__kbd", "aria-hidden": "true", children: hint })), open && (_jsx("ul", { id: listId, role: "listbox", "aria-label": "Pages", className: "hl-search__list", children: results.length === 0 ? (_jsx("li", { role: "option", "aria-disabled": "true", "aria-selected": false, className: "hl-search__empty", children: "No pages match" })) : (results.map((entry, i) => (_jsx("li", { id: `${listId}-${String(i)}`, role: "option", "aria-selected": i === active, onMouseDown: (e) => {
51
51
  e.preventDefault();
52
52
  go(entry);
53
53
  }, children: entry.label }, entry.to)))) }))] }));
@@ -1 +1 @@
1
- {"version":3,"file":"ShellSearch.js","sourceRoot":"","sources":["../../src/shell/ShellSearch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAS/C,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB,6EAA6E;AAC7E,MAAM,UAAU,WAAW,CAAC,EAAE,OAAO,EAA8B;IACjE,MAAM,QAAQ,GAAG,WAAW,EAAE,CAAC;IAC/B,MAAM,MAAM,GAAG,KAAK,EAAE,CAAC;IACvB,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IACvC,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC;IACxC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC9C,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,EAAE;QAC3B,MAAM,CAAC,GAAG,KAAK,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;QACrC,IAAI,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,KAAK,CAAC,EAAE,CAUV,CACN,CAAC,CACH,GACE,CACN,IACG,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,11 @@
1
+ import type { ReactElement } from 'react';
2
+ import type { GoKey } from './shortcuts.js';
3
+ /** The list of keyboard shortcuts (? or ⌘/): a dialog that closes with Escape. */
4
+ export declare function ShortcutsDialog(props: {
5
+ mod: string;
6
+ shift: string;
7
+ go: GoKey[];
8
+ canCollapse: boolean;
9
+ hasNotifications: boolean;
10
+ onClose: () => void;
11
+ }): ReactElement;
@@ -0,0 +1,26 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useRef } from 'react';
3
+ function Keys({ keys, or }) {
4
+ return (_jsxs("dd", { children: [keys.map((key, i) => (_jsx("kbd", { children: key }, `${key}-${String(i)}`))), or && (_jsxs(_Fragment, { children: [_jsx("span", { className: "hl-shortcuts__or", children: "or" }), or.map((key, i) => (_jsx("kbd", { children: key }, `or-${key}-${String(i)}`)))] }))] }));
5
+ }
6
+ /** The list of keyboard shortcuts (? or ⌘/): a dialog that closes with Escape. */
7
+ export function ShortcutsDialog(props) {
8
+ const close = useRef(null);
9
+ useEffect(() => {
10
+ close.current?.focus();
11
+ }, []);
12
+ const onKeyDown = (event) => {
13
+ if (event.key === 'Escape') {
14
+ event.stopPropagation();
15
+ props.onClose();
16
+ }
17
+ else if (event.key === 'Tab') {
18
+ // The close button is the only stop: keep focus in the dialog.
19
+ event.preventDefault();
20
+ close.current?.focus();
21
+ }
22
+ };
23
+ const { mod, shift } = props;
24
+ return (_jsxs(_Fragment, { children: [_jsx("div", { className: "hl-shortcuts-backdrop", "aria-hidden": "true", onClick: props.onClose }), _jsxs("div", { role: "dialog", "aria-modal": "true", "aria-labelledby": "hl-shortcuts-title", className: "hl-shortcuts", onKeyDown: onKeyDown, children: [_jsxs("div", { className: "hl-shortcuts__head", children: [_jsx("h2", { id: "hl-shortcuts-title", children: "Keyboard shortcuts" }), _jsx("button", { ref: close, type: "button", className: "hl-shortcuts__close", "aria-label": "Close", onClick: props.onClose, children: _jsx("svg", { width: "16", height: "16", 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" }) }) })] }), _jsx("h3", { children: "General" }), _jsxs("dl", { children: [_jsx("dt", { children: "Search pages" }), _jsx(Keys, { keys: [mod, 'K'], or: ['/'] }), props.canCollapse && (_jsxs(_Fragment, { children: [_jsx("dt", { children: "Collapse or expand the sidebar" }), _jsx(Keys, { keys: [mod, 'B'] })] })), _jsx("dt", { children: "Change theme" }), _jsx(Keys, { keys: [shift, mod, 'L'] }), props.hasNotifications && (_jsxs(_Fragment, { children: [_jsx("dt", { children: "Notifications" }), _jsx(Keys, { keys: ['N'] })] })), _jsx("dt", { children: "This list" }), _jsx(Keys, { keys: ['?'], or: [mod, '/'] })] }), props.go.length > 0 && (_jsxs(_Fragment, { children: [_jsx("h3", { children: "Go to" }), _jsx("dl", { children: props.go.map(({ key, item }) => (_jsxs("div", { className: "hl-shortcuts__row", children: [_jsx("dt", { children: item.label }), _jsx(Keys, { keys: ['G', key.toUpperCase()] })] }, item.to))) })] }))] })] }));
25
+ }
26
+ //# sourceMappingURL=ShortcutsDialog.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ShortcutsDialog.js","sourceRoot":"","sources":["../../src/shell/ShortcutsDialog.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AAI1C,SAAS,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,EAAqC;IAC3D,OAAO,CACL,yBACG,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,CAAC,CACpB,wBAAkC,GAAG,IAA3B,GAAG,GAAG,IAAI,MAAM,CAAC,CAAC,CAAC,EAAE,CAAa,CAC7C,C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AAI,IAAC,IAAI,EAAE,CAAC,GAAG,EAAE,GAAG,CAAC,WAAW,EAAE,CAAC,GAAI,KAFhC,IAAI,CAAC,EAAE,CAGX,CACP,CAAC,GACC,IACJ,CACJ,IACG,IACL,CACJ,CAAC;AACJ,CAAC"}
@@ -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;
@@ -0,0 +1,35 @@
1
+ import { useEffect } from 'react';
2
+ export 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 function trapTab(event, container) {
5
+ if (event.key !== 'Tab' || !container)
6
+ return;
7
+ const stops = [...container.querySelectorAll(FOCUSABLE)];
8
+ const first = stops[0];
9
+ const last = stops[stops.length - 1];
10
+ if (!first || !last)
11
+ return;
12
+ if (!event.shiftKey && document.activeElement === last) {
13
+ event.preventDefault();
14
+ first.focus();
15
+ }
16
+ else if (event.shiftKey && document.activeElement === first) {
17
+ event.preventDefault();
18
+ last.focus();
19
+ }
20
+ }
21
+ /**
22
+ * While the component that calls it is shown (the More sheet, the phone search), the page
23
+ * behind does not scroll; its own overflow comes back when it closes.
24
+ */
25
+ export function useScrollLock() {
26
+ useEffect(() => {
27
+ const body = document.body;
28
+ const before = body.style.overflow;
29
+ body.style.overflow = 'hidden';
30
+ return () => {
31
+ body.style.overflow = before;
32
+ };
33
+ }, []);
34
+ }
35
+ //# sourceMappingURL=focus-trap.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"focus-trap.js","sourceRoot":"","sources":["../../src/shell/focus-trap.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGlC,MAAM,CAAC,MAAM,SAAS,GACpB,2FAA2F,CAAC;AAE9F,+FAA+F;AAC/F,MAAM,UAAU,OAAO,CAAC,KAAiC,EAAE,SAA6B;IACtF,IAAI,KAAK,CAAC,GAAG,KAAK,KAAK,IAAI,CAAC,SAAS;QAAE,OAAO;IAC9C,MAAM,KAAK,GAAG,CAAC,GAAG,SAAS,CAAC,gBAAgB,CAAc,SAAS,CAAC,CAAC,CAAC;IACtE,MAAM,KAAK,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC;IACvB,MAAM,IAAI,GAAG,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IACrC,IAAI,CAAC,KAAK,IAAI,CAAC,IAAI;QAAE,OAAO;IAC5B,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,KAAK,IAAI,EAAE,CAAC;QACvD,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,KAAK,CAAC,KAAK,EAAE,CAAC;IAChB,CAAC;SAAM,IAAI,KAAK,CAAC,QAAQ,IAAI,QAAQ,CAAC,aAAa,KAAK,KAAK,EAAE,CAAC;QAC9D,KAAK,CAAC,cAAc,EAAE,CAAC;QACvB,IAAI,CAAC,KAAK,EAAE,CAAC;IACf,CAAC;AACH,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,aAAa;IAC3B,SAAS,CAAC,GAAG,EAAE;QACb,MAAM,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC;QAC3B,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;QACnC,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC/B,OAAO,GAAG,EAAE;YACV,IAAI,CAAC,KAAK,CAAC,QAAQ,GAAG,MAAM,CAAC;QAC/B,CAAC,CAAC;IACJ,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC"}
@@ -0,0 +1,23 @@
1
+ import type { ReactElement } from 'react';
2
+ /** The platform's page icons (24 × 24, drawn with a 1.7 stroke in the text colour). */
3
+ declare const PATHS: {
4
+ readonly home: "M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z";
5
+ readonly store: "M4 9.5V20h16V9.5M3 5h18l-1.5 4.5a2.5 2.5 0 0 1-4.5 0 2.5 2.5 0 0 1-5 0 2.5 2.5 0 0 1-4.5 0zM10 20v-5h4v5";
6
+ readonly plan: "M4 6h16v12H4zM4 10h16M8 15h3";
7
+ readonly images: "M4 5h16v14H4zM4 16l5-5 4 4 2-2 5 5M15 9.5a1.5 1.5 0 1 0 0-.01";
8
+ readonly orders: "M6 7h12l-1 13H7zM9 7a3 3 0 0 1 6 0";
9
+ readonly products: "M12 3 4 7v10l8 4 8-4V7zM4 7l8 4 8-4M12 11v10";
10
+ readonly reports: "M4 20V4M4 20h16M8 16v-4M12 16V8M16 16v-6";
11
+ readonly notifications: "M6 16V11a6 6 0 0 1 12 0v5l2 2H4zM10 20a2 2 0 0 0 4 0";
12
+ readonly settings: "M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM4 12h2M18 12h2M12 4v2M12 18v2M6.5 6.5l1.4 1.4M16.1 16.1l1.4 1.4M6.5 17.5l1.4-1.4M16.1 7.9l1.4-1.4";
13
+ /** For a page without an icon of its own: a neutral square, never a letter. */
14
+ readonly generic: "M7 7h10v10H7z";
15
+ };
16
+ export type NavIconName = keyof typeof PATHS;
17
+ export declare const NAV_ICON_NAMES: NavIconName[];
18
+ /** A page icon for `NavItem.icon`: the sidebar and the phone and tablet bottom bar draw it. */
19
+ export declare function NavIcon({ name, size }: {
20
+ name: NavIconName;
21
+ size?: number;
22
+ }): ReactElement;
23
+ export {};
@@ -0,0 +1,21 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ /** The platform's page icons (24 × 24, drawn with a 1.7 stroke in the text colour). */
3
+ const PATHS = {
4
+ home: 'M3 10.5 12 3l9 7.5V20a1 1 0 0 1-1 1h-5v-6H9v6H4a1 1 0 0 1-1-1z',
5
+ store: 'M4 9.5V20h16V9.5M3 5h18l-1.5 4.5a2.5 2.5 0 0 1-4.5 0 2.5 2.5 0 0 1-5 0 2.5 2.5 0 0 1-4.5 0zM10 20v-5h4v5',
6
+ plan: 'M4 6h16v12H4zM4 10h16M8 15h3',
7
+ images: 'M4 5h16v14H4zM4 16l5-5 4 4 2-2 5 5M15 9.5a1.5 1.5 0 1 0 0-.01',
8
+ orders: 'M6 7h12l-1 13H7zM9 7a3 3 0 0 1 6 0',
9
+ products: 'M12 3 4 7v10l8 4 8-4V7zM4 7l8 4 8-4M12 11v10',
10
+ reports: 'M4 20V4M4 20h16M8 16v-4M12 16V8M16 16v-6',
11
+ notifications: 'M6 16V11a6 6 0 0 1 12 0v5l2 2H4zM10 20a2 2 0 0 0 4 0',
12
+ settings: 'M12 9a3 3 0 1 0 0 6 3 3 0 0 0 0-6zM4 12h2M18 12h2M12 4v2M12 18v2M6.5 6.5l1.4 1.4M16.1 16.1l1.4 1.4M6.5 17.5l1.4-1.4M16.1 7.9l1.4-1.4',
13
+ /** For a page without an icon of its own: a neutral square, never a letter. */
14
+ generic: 'M7 7h10v10H7z',
15
+ };
16
+ export const NAV_ICON_NAMES = Object.keys(PATHS);
17
+ /** A page icon for `NavItem.icon`: the sidebar and the phone and tablet bottom bar draw it. */
18
+ export function NavIcon({ name, size = 18 }) {
19
+ return (_jsx("svg", { className: `hl-nav-icon hl-nav-icon--${name}`, width: size, height: size, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.7", strokeLinecap: "round", strokeLinejoin: "round", "aria-hidden": "true", children: _jsx("path", { d: PATHS[name] }) }));
20
+ }
21
+ //# sourceMappingURL=icons.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"icons.js","sourceRoot":"","sources":["../../src/shell/icons.tsx"],"names":[],"mappings":";AAEA,uFAAuF;AACvF,MAAM,KAAK,GAAG;IACZ,IAAI,EAAE,gEAAgE;IACtE,KAAK,EACH,0GAA0G;IAC5G,IAAI,EAAE,8BAA8B;IACpC,MAAM,EAAE,+DAA+D;IACvE,MAAM,EAAE,oCAAoC;IAC5C,QAAQ,EAAE,8CAA8C;IACxD,OAAO,EAAE,0CAA0C;IACnD,aAAa,EAAE,sDAAsD;IACrE,QAAQ,EACN,sIAAsI;IACxI,+EAA+E;IAC/E,OAAO,EAAE,eAAe;CAChB,CAAC;AAGX,MAAM,CAAC,MAAM,cAAc,GAAG,MAAM,CAAC,IAAI,CAAC,KAAK,CAAkB,CAAC;AAElE,+FAA+F;AAC/F,MAAM,UAAU,OAAO,CAAC,EAAE,IAAI,EAAE,IAAI,GAAG,EAAE,EAAwC;IAC/E,OAAO,CACL,cACE,SAAS,EAAE,4BAA4B,IAAI,EAAE,EAC7C,KAAK,EAAE,IAAI,EACX,MAAM,EAAE,IAAI,EACZ,OAAO,EAAC,WAAW,EACnB,IAAI,EAAC,MAAM,EACX,MAAM,EAAC,cAAc,EACrB,WAAW,EAAC,KAAK,EACjB,aAAa,EAAC,OAAO,EACrB,cAAc,EAAC,OAAO,iBACV,MAAM,YAElB,eAAM,CAAC,EAAE,KAAK,CAAC,IAAI,CAAC,GAAI,GACpB,CACP,CAAC;AACJ,CAAC"}
@@ -3,7 +3,12 @@ import type { ReactNode } from 'react';
3
3
  export interface NavItem {
4
4
  label: string;
5
5
  to: string;
6
+ /** Beside the label in the sidebar, and above it in the phone and tablet bottom bar. */
6
7
  icon?: ReactNode;
8
+ /** One of the (at most 4) pages in the phone and tablet bottom bar; the rest go under More. */
9
+ bottom?: boolean;
10
+ /** The letter for "G then a letter"; by default the first free letter of `label`. */
11
+ shortcut?: string;
7
12
  children?: NavItem[];
8
13
  }
9
14
  /** A group of pages under an optional small heading. */
@@ -15,3 +20,20 @@ export interface NavGroup {
15
20
  export declare function flattenNav(groups: NavGroup[]): NavItem[];
16
21
  /** Whether `pathname` is `to` or a page under it. */
17
22
  export declare const isUnder: (pathname: string, to: string) => boolean;
23
+ /** How many pages the bottom bar has, before More. */
24
+ export declare const BOTTOM_SLOTS = 4;
25
+ /**
26
+ * The bottom bar's pages: the ones marked `bottom`, in nav order; with none marked, the first
27
+ * top-level pages. Never more than 4.
28
+ */
29
+ export declare function bottomItems(nav: NavGroup[]): NavItem[];
30
+ /**
31
+ * The page open: the deepest one the address is under, so a detail page (/lists/7) marks its
32
+ * list page, and a page that redirects deeper (/research → /research/x) stays marked.
33
+ */
34
+ export declare function currentPage(items: NavItem[], pathname: string): string | undefined;
35
+ /** A page's link target, keeping `search` (Shopify's `?host=…&shop=…`) when given. */
36
+ export declare const navTarget: (to: string, search: string | undefined) => string | {
37
+ pathname: string;
38
+ search: string;
39
+ };
package/dist/shell/nav.js CHANGED
@@ -14,4 +14,26 @@ export function flattenNav(groups) {
14
14
  }
15
15
  /** Whether `pathname` is `to` or a page under it. */
16
16
  export const isUnder = (pathname, to) => pathname === to || pathname.startsWith(`${to}/`);
17
+ /** How many pages the bottom bar has, before More. */
18
+ export const BOTTOM_SLOTS = 4;
19
+ /**
20
+ * The bottom bar's pages: the ones marked `bottom`, in nav order; with none marked, the first
21
+ * top-level pages. Never more than 4.
22
+ */
23
+ export function bottomItems(nav) {
24
+ const marked = flattenNav(nav).filter((item) => item.bottom);
25
+ const items = marked.length > 0 ? marked : nav.flatMap((group) => group.items);
26
+ return items.slice(0, BOTTOM_SLOTS);
27
+ }
28
+ /**
29
+ * The page open: the deepest one the address is under, so a detail page (/lists/7) marks its
30
+ * list page, and a page that redirects deeper (/research → /research/x) stays marked.
31
+ */
32
+ export function currentPage(items, pathname) {
33
+ return items
34
+ .filter((item) => isUnder(pathname, item.to))
35
+ .sort((a, b) => b.to.length - a.to.length)[0]?.to;
36
+ }
37
+ /** A page's link target, keeping `search` (Shopify's `?host=…&shop=…`) when given. */
38
+ export const navTarget = (to, search) => (search ? { pathname: to, search } : to);
17
39
  //# sourceMappingURL=nav.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"nav.js","sourceRoot":"","sources":["../../src/shell/nav.ts"],"names":[],"mappings":"AAgBA,6DAA6D;AAC7D,MAAM,UAAU,UAAU,CAAC,MAAkB;IAC3C,MAAM,GAAG,GAAc,EAAE,CAAC;IAC1B,MAAM,IAAI,GAAG,CAAC,KAAgB,EAAQ,EAAE;QACtC,KAAK,MAAM,IAAI,IAAI,KAAK,EAAE,CAAC;YACzB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACf,IAAI,IAAI,CAAC,QAAQ;gBAAE,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QACzC,CAAC;IACH,CAAC,CAAC;IACF,KAAK,MAAM,KAAK,IAAI,MAAM;QAAE,IAAI,CAAC,KAAK,CAAC,KAA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C,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC/E,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC;AACtC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,KAAgB,EAAE,QAAgB;IAC5D,OAAO,KAAK;SACT,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,OAAO,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;SAC5C,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;AACtD,CAAC;AAED,sFAAsF;AACtF,MAAM,CAAC,MAAM,SAAS,GAAG,CACvB,EAAU,EACV,MAA0B,EACqB,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC"}
@@ -1,2 +1,2 @@
1
1
  /** The app shell's look, on the theme tokens only (see tokens.ts). */
2
- export declare const SHELL_CSS = "\n.hl-shell { min-height: 100vh; display: flex; background: var(--hl-ground); color: var(--hl-text); }\n.hl-skip { position: absolute; left: -9999px; top: 8px; z-index: 30; padding: 10px 16px; border-radius: var(--hl-radius-control); background: var(--hl-accent); color: #FFFFFF; font-weight: 700; }\n.hl-skip:focus { left: 8px; }\n.hl-sidebar { width: 210px; flex: none; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: 14px 10px; background: var(--hl-sidebar); border-right: 1px solid var(--hl-border); position: sticky; top: 0; height: 100vh; overflow-y: auto; }\n.hl-brand { display: flex; align-items: center; gap: 10px; padding: 4px 10px 12px; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: var(--hl-text); text-decoration: none; }\n.hl-nav { display: flex; flex-direction: column; gap: 2px; }\n.hl-nav__group { margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }\n.hl-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }\n.hl-nav a { display: flex; align-items: center; gap: 10px; min-height: 32px; padding: 0 10px; border-radius: var(--hl-radius-control); color: var(--hl-text); text-decoration: none; font-weight: 600; }\n.hl-nav a:hover { background: var(--hl-faint); }\n.hl-nav a[aria-current=\"page\"] { background: var(--hl-accent-soft); color: var(--hl-accent-text); font-weight: 700; }\n.hl-nav ul ul a { min-height: 28px; padding-left: 36px; font-weight: 500; color: var(--hl-muted); }\n.hl-nav ul ul a[aria-current=\"page\"] { color: var(--hl-accent-text); }\n.hl-sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 1px solid var(--hl-border); }\n.hl-theme-row { display: flex; align-items: center; justify-content: space-between; padding: 0 10px; font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }\n.hl-theme-switch { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hl-faint); }\n.hl-shell .hl-theme-switch button { width: 34px; height: 30px; min-height: 30px; padding: 0; box-sizing: border-box; border: 0; border-radius: 999px; display: grid; place-items: center; background: transparent; color: var(--hl-muted); cursor: pointer; }\n.hl-shell .hl-theme-switch button:hover:not(:disabled) { background: var(--hl-surface); border-color: transparent; color: var(--hl-text); }\n.hl-shell .hl-theme-switch button[aria-pressed=\"true\"], .hl-shell .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-account { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }\n.hl-account__who { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }\n.hl-avatar { width: 30px; height: 30px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--hl-accent); color: var(--hl-on-accent); font-weight: 700; }\n.hl-account__text { display: flex; flex-direction: column; min-width: 0; }\n.hl-account__text span { font-size: 13px; color: var(--hl-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hl-shell button.hl-signout { min-height: 34px; padding: 0 12px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: transparent; color: var(--hl-text); font: inherit; font-weight: 600; cursor: pointer; }\n.hl-shell button.hl-signout:hover:not(:disabled) { background: var(--hl-faint); border-color: var(--hl-border); color: var(--hl-text); }\n.hl-shell button.hl-signout:disabled { background: transparent; border-color: var(--hl-border); color: var(--hl-muted); opacity: .7; cursor: default; }\n.hl-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }\n.hl-topbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 8px 24px; border-bottom: 1px solid var(--hl-border); background: var(--hl-ground); position: sticky; top: 0; z-index: 10; }\n.hl-search { position: relative; flex: 1 1 280px; max-width: 520px; display: flex; align-items: center; gap: 10px; min-height: 36px; padding: 0 12px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-surface); color: var(--hl-muted); box-sizing: border-box; }\n.hl-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--hl-text); font: inherit; }\n.hl-search:focus-within { border-color: var(--hl-accent); }\n.hl-search__list { position: absolute; top: calc(100% + 6px); left: 0; right: 0; z-index: 20; list-style: none; margin: 0; padding: 6px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-surface); box-shadow: 0 12px 30px rgba(0,0,0,.18); }\n.hl-search__list li { padding: 10px 12px; border-radius: 8px; color: var(--hl-text); cursor: pointer; }\n.hl-search__list li[aria-selected=\"true\"] { background: var(--hl-accent-soft); color: var(--hl-accent-text); }\n.hl-search__list .hl-search__empty { color: var(--hl-muted); cursor: default; }\n.hl-topbar__end { margin-left: auto; display: flex; align-items: center; gap: 10px; }\n.hl-shell button.hl-menu-button { min-height: 32px; padding: 0 12px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-surface); color: var(--hl-text); font: inherit; font-weight: 700; cursor: pointer; }\n.hl-shell button.hl-menu-button:hover:not(:disabled) { background: var(--hl-faint); border-color: var(--hl-border); color: var(--hl-text); }\n.hl-main { padding: 20px 24px; width: 100%; max-width: 1180px; box-sizing: border-box; }\n.hl-drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); }\n.hl-drawer { position: fixed; inset: 0 auto 0 0; z-index: 41; width: min(300px, 86vw); display: flex; flex-direction: column; gap: 6px; padding: 16px 14px; background: var(--hl-sidebar); overflow-y: auto; }\n@media (max-width: 899px) {\n .hl-topbar { padding: 12px 16px; }\n .hl-main { padding: 20px 16px; }\n}\n";
2
+ export declare const SHELL_CSS: string;