@haatlabs-core/ui 0.19.0 → 0.21.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/dist/client/index.d.ts +8 -0
  2. package/dist/client/index.js +6 -0
  3. package/dist/client/index.js.map +1 -1
  4. package/dist/index.d.ts +1 -1
  5. package/dist/index.js +1 -1
  6. package/dist/index.js.map +1 -1
  7. package/dist/notifications/NotificationBell.d.ts +12 -0
  8. package/dist/notifications/NotificationBell.js +94 -0
  9. package/dist/notifications/NotificationBell.js.map +1 -0
  10. package/dist/notifications/NotificationInbox.d.ts +23 -0
  11. package/dist/notifications/NotificationInbox.js +92 -0
  12. package/dist/notifications/NotificationInbox.js.map +1 -0
  13. package/dist/notifications/NotificationPreferences.d.ts +10 -0
  14. package/dist/notifications/NotificationPreferences.js +135 -0
  15. package/dist/notifications/NotificationPreferences.js.map +1 -0
  16. package/dist/notifications/notifications-css.d.ts +6 -0
  17. package/dist/notifications/notifications-css.js +62 -0
  18. package/dist/notifications/notifications-css.js.map +1 -0
  19. package/dist/notifications/types.d.ts +80 -0
  20. package/dist/notifications/types.js +12 -0
  21. package/dist/notifications/types.js.map +1 -0
  22. package/dist/notifications/use-notification-stream.d.ts +15 -0
  23. package/dist/notifications/use-notification-stream.js +123 -0
  24. package/dist/notifications/use-notification-stream.js.map +1 -0
  25. package/dist/shell/Account.d.ts +24 -0
  26. package/dist/shell/Account.js +48 -0
  27. package/dist/shell/Account.js.map +1 -0
  28. package/dist/shell/AppShell.d.ts +10 -7
  29. package/dist/shell/AppShell.js +104 -16
  30. package/dist/shell/AppShell.js.map +1 -1
  31. package/dist/shell/ShellSearch.d.ts +6 -2
  32. package/dist/shell/ShellSearch.js +3 -3
  33. package/dist/shell/ShellSearch.js.map +1 -1
  34. package/dist/shell/ShortcutsDialog.d.ts +11 -0
  35. package/dist/shell/ShortcutsDialog.js +26 -0
  36. package/dist/shell/ShortcutsDialog.js.map +1 -0
  37. package/dist/shell/nav.d.ts +2 -0
  38. package/dist/shell/nav.js.map +1 -1
  39. package/dist/shell/shell-css.d.ts +1 -1
  40. package/dist/shell/shell-css.js +48 -9
  41. package/dist/shell/shell-css.js.map +1 -1
  42. package/dist/shell/shortcuts.d.ts +22 -0
  43. package/dist/shell/shortcuts.js +48 -0
  44. package/dist/shell/shortcuts.js.map +1 -0
  45. package/dist/shell/sidebar-state.d.ts +5 -0
  46. package/dist/shell/sidebar-state.js +38 -0
  47. package/dist/shell/sidebar-state.js.map +1 -0
  48. package/dist/theme/ThemeStyles.js +2 -1
  49. package/dist/theme/ThemeStyles.js.map +1 -1
  50. package/dist/theme/ThemeSwitch.d.ts +5 -0
  51. package/dist/theme/ThemeSwitch.js +12 -0
  52. package/dist/theme/ThemeSwitch.js.map +1 -1
  53. package/package.json +4 -4
@@ -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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B,EAAE,CAAC,KAAK,CAAC,CAAC;oBACZ,CAAC,YAEA,KAAK,CAAC,KAAK,IATP,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,GA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,SAAS,EAAC,mBAAmB,aAC9C,uBAAK,IAAI,CAAC,KAAK,GAAM,EACrB,KAAC,IAAI,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"}
@@ -4,6 +4,8 @@ export interface NavItem {
4
4
  label: string;
5
5
  to: string;
6
6
  icon?: ReactNode;
7
+ /** The letter for "G then a letter"; by default the first free letter of `label`. */
8
+ shortcut?: string;
7
9
  children?: NavItem[];
8
10
  }
9
11
  /** A group of pages under an optional small heading. */
@@ -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,KAAK,CAAC,CAAC;IAC9C,OAAO,GAAG,CAAC;AACb,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAgB,EAAE,EAAU,EAAW,EAAE,CAC/D,QAAQ,KAAK,EAAE,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC"}
1
+ {"version":3,"file":"nav.js","sourceRoot":"","sources":["../../src/shell/nav.ts"],"names":[],"mappings":"AAkBA,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,KAAK,CAAC,CAAC;IAC9C,OAAO,GAAG,CAAC;AACb,CAAC;AAED,qDAAqD;AACrD,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,QAAgB,EAAE,EAAU,EAAW,EAAE,CAC/D,QAAQ,KAAK,EAAE,IAAI,QAAQ,CAAC,UAAU,CAAC,GAAG,EAAE,GAAG,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 = "\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: 260px; flex: none; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; background: var(--hl-sidebar); border-right: 1px solid var(--hl-border); position: sticky; top: 0; z-index: 20; height: 100vh; overflow-y: auto; transition: width .2s ease, padding .2s ease; }\n.hl-sidebar[data-collapsed] { width: 72px; padding: 14px 10px; align-items: center; overflow: visible; }\n@media (prefers-reduced-motion: reduce) { .hl-sidebar { transition: none; } }\n.hl-brand-row { display: flex; align-items: center; gap: 6px; padding: 0 0 12px; }\n.hl-sidebar[data-collapsed] .hl-brand-row { flex-direction: column; gap: 8px; }\n.hl-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: var(--hl-text); text-decoration: none; }\n.hl-sidebar[data-collapsed] .hl-brand { flex: none; padding: 0; justify-content: center; }\n.hl-shell button.hl-sidebar-toggle { width: 32px; height: 32px; min-height: 32px; flex: none; 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; }\n.hl-shell button.hl-sidebar-toggle:hover:not(:disabled) { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }\n.hl-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }\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[data-collapsed] .hl-nav { align-items: center; }\n.hl-sidebar[data-collapsed] .hl-nav a { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }\n.hl-nav__initial { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--hl-faint); }\n.hl-nav a[aria-current=\"page\"] .hl-nav__initial { background: transparent; }\n.hl-nav__divider { width: 28px; margin: 8px auto; border: 0; border-top: 1px solid var(--hl-border); }\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-sidebar[data-collapsed] .hl-sidebar__foot { align-self: stretch; align-items: center; }\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-shell button.hl-theme-cycle { width: 40px; height: 40px; min-height: 40px; padding: 0; box-sizing: border-box; border: 0; border-radius: 999px; display: grid; place-items: center; background: var(--hl-faint); color: var(--hl-text); cursor: pointer; }\n.hl-shell button.hl-theme-cycle:hover:not(:disabled) { background: var(--hl-surface); border-color: transparent; color: var(--hl-text); }\n.hl-account { position: relative; }\n.hl-shell button.hl-account__trigger { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 6px; box-sizing: border-box; border: 0; border-radius: var(--hl-radius-control); background: transparent; color: var(--hl-text); font: inherit; text-align: left; cursor: pointer; }\n.hl-shell button.hl-account__trigger:hover:not(:disabled), .hl-shell button.hl-account__trigger[aria-expanded=\"true\"] { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }\n.hl-sidebar[data-collapsed] button.hl-account__trigger { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: 999px; }\n.hl-avatar { width: 32px; height: 32px; 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 { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }\n.hl-account__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hl-account__text span { font-size: 13px; color: var(--hl-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }\n.hl-account__chevron { flex: none; color: var(--hl-muted); }\n.hl-account__menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 25; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-surface); box-shadow: 0 14px 34px rgba(0,0,0,.25); }\n.hl-sidebar[data-collapsed] .hl-account__menu { left: calc(100% + 10px); right: auto; bottom: 0; width: 260px; }\n.hl-account__head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--hl-border); }\n.hl-account__caption { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }\n.hl-account__full { overflow-wrap: anywhere; }\n.hl-account__head span.hl-account__full { font-size: 13px; color: var(--hl-muted); }\n.hl-shell button.hl-signout { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--hl-text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }\n.hl-shell button.hl-signout:hover:not(:disabled) { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }\n.hl-shell button.hl-signout:disabled { background: transparent; border-color: transparent; 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__kbd, .hl-shortcuts kbd { flex: none; min-width: 22px; box-sizing: border-box; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--hl-border); background: var(--hl-ground); font-family: inherit; font-size: 11px; font-weight: 700; text-align: center; color: var(--hl-muted); }\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-shortcuts-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); }\n.hl-shortcuts { position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow-y: auto; box-sizing: border-box; padding: 18px 22px 22px; border-radius: 14px; border: 1px solid var(--hl-border); background: var(--hl-surface); color: var(--hl-text); box-shadow: 0 20px 50px rgba(0,0,0,.35); }\n.hl-shortcuts__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }\n.hl-shortcuts h2 { margin: 0; font-size: 17px; }\n.hl-shortcuts h3 { margin: 16px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }\n.hl-shortcuts dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }\n.hl-shortcuts dt { min-width: 0; }\n.hl-shortcuts dd { margin: 0; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }\n.hl-shortcuts__row { display: contents; }\n.hl-shortcuts__or { padding: 0 4px; font-size: 12px; color: var(--hl-muted); }\n.hl-shell button.hl-shortcuts__close { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: var(--hl-radius-control); display: grid; place-items: center; background: transparent; color: var(--hl-muted); cursor: pointer; }\n.hl-shell button.hl-shortcuts__close:hover:not(:disabled) { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }\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";
@@ -3,8 +3,16 @@ export const SHELL_CSS = `
3
3
  .hl-shell { min-height: 100vh; display: flex; background: var(--hl-ground); color: var(--hl-text); }
4
4
  .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; }
5
5
  .hl-skip:focus { left: 8px; }
6
- .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; }
7
- .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; }
6
+ .hl-sidebar { width: 260px; flex: none; box-sizing: border-box; display: flex; flex-direction: column; gap: 4px; padding: 14px 12px; background: var(--hl-sidebar); border-right: 1px solid var(--hl-border); position: sticky; top: 0; z-index: 20; height: 100vh; overflow-y: auto; transition: width .2s ease, padding .2s ease; }
7
+ .hl-sidebar[data-collapsed] { width: 72px; padding: 14px 10px; align-items: center; overflow: visible; }
8
+ @media (prefers-reduced-motion: reduce) { .hl-sidebar { transition: none; } }
9
+ .hl-brand-row { display: flex; align-items: center; gap: 6px; padding: 0 0 12px; }
10
+ .hl-sidebar[data-collapsed] .hl-brand-row { flex-direction: column; gap: 8px; }
11
+ .hl-brand { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 4px 6px; font-size: 15px; font-weight: 800; letter-spacing: -0.02em; color: var(--hl-text); text-decoration: none; }
12
+ .hl-sidebar[data-collapsed] .hl-brand { flex: none; padding: 0; justify-content: center; }
13
+ .hl-shell button.hl-sidebar-toggle { width: 32px; height: 32px; min-height: 32px; flex: none; 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; }
14
+ .hl-shell button.hl-sidebar-toggle:hover:not(:disabled) { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }
15
+ .hl-sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
8
16
  .hl-nav { display: flex; flex-direction: column; gap: 2px; }
9
17
  .hl-nav__group { margin: 12px 10px 4px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }
10
18
  .hl-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
@@ -13,25 +21,44 @@ export const SHELL_CSS = `
13
21
  .hl-nav a[aria-current="page"] { background: var(--hl-accent-soft); color: var(--hl-accent-text); font-weight: 700; }
14
22
  .hl-nav ul ul a { min-height: 28px; padding-left: 36px; font-weight: 500; color: var(--hl-muted); }
15
23
  .hl-nav ul ul a[aria-current="page"] { color: var(--hl-accent-text); }
24
+ .hl-sidebar[data-collapsed] .hl-nav { align-items: center; }
25
+ .hl-sidebar[data-collapsed] .hl-nav a { position: relative; width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; }
26
+ .hl-nav__initial { width: 24px; height: 24px; border-radius: 6px; display: grid; place-items: center; font-size: 12px; font-weight: 800; background: var(--hl-faint); }
27
+ .hl-nav a[aria-current="page"] .hl-nav__initial { background: transparent; }
28
+ .hl-nav__divider { width: 28px; margin: 8px auto; border: 0; border-top: 1px solid var(--hl-border); }
16
29
  .hl-sidebar__foot { margin-top: auto; display: flex; flex-direction: column; gap: 12px; padding-top: 20px; border-top: 1px solid var(--hl-border); }
30
+ .hl-sidebar[data-collapsed] .hl-sidebar__foot { align-self: stretch; align-items: center; }
17
31
  .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); }
18
32
  .hl-theme-switch { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--hl-faint); }
19
33
  .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; }
20
34
  .hl-shell .hl-theme-switch button:hover:not(:disabled) { background: var(--hl-surface); border-color: transparent; color: var(--hl-text); }
21
35
  .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); }
22
- .hl-account { display: flex; flex-direction: column; gap: 8px; padding: 0 4px; }
23
- .hl-account__who { display: flex; align-items: center; gap: 10px; padding: 4px 6px; }
24
- .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; }
25
- .hl-account__text { display: flex; flex-direction: column; min-width: 0; }
36
+ .hl-shell button.hl-theme-cycle { width: 40px; height: 40px; min-height: 40px; padding: 0; box-sizing: border-box; border: 0; border-radius: 999px; display: grid; place-items: center; background: var(--hl-faint); color: var(--hl-text); cursor: pointer; }
37
+ .hl-shell button.hl-theme-cycle:hover:not(:disabled) { background: var(--hl-surface); border-color: transparent; color: var(--hl-text); }
38
+ .hl-account { position: relative; }
39
+ .hl-shell button.hl-account__trigger { width: 100%; min-height: 48px; display: flex; align-items: center; gap: 10px; padding: 6px; box-sizing: border-box; border: 0; border-radius: var(--hl-radius-control); background: transparent; color: var(--hl-text); font: inherit; text-align: left; cursor: pointer; }
40
+ .hl-shell button.hl-account__trigger:hover:not(:disabled), .hl-shell button.hl-account__trigger[aria-expanded="true"] { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }
41
+ .hl-sidebar[data-collapsed] button.hl-account__trigger { width: 44px; height: 44px; min-height: 44px; padding: 0; justify-content: center; border-radius: 999px; }
42
+ .hl-avatar { width: 32px; height: 32px; flex: none; border-radius: 999px; display: grid; place-items: center; background: var(--hl-accent); color: var(--hl-on-accent); font-weight: 700; }
43
+ .hl-account__text { flex: 1; display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
44
+ .hl-account__text strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
26
45
  .hl-account__text span { font-size: 13px; color: var(--hl-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
27
- .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; }
28
- .hl-shell button.hl-signout:hover:not(:disabled) { background: var(--hl-faint); border-color: var(--hl-border); color: var(--hl-text); }
29
- .hl-shell button.hl-signout:disabled { background: transparent; border-color: var(--hl-border); color: var(--hl-muted); opacity: .7; cursor: default; }
46
+ .hl-account__chevron { flex: none; color: var(--hl-muted); }
47
+ .hl-account__menu { position: absolute; left: 0; right: 0; bottom: calc(100% + 8px); z-index: 25; display: flex; flex-direction: column; gap: 2px; padding: 6px; border-radius: var(--hl-radius-control); border: 1px solid var(--hl-border); background: var(--hl-surface); box-shadow: 0 14px 34px rgba(0,0,0,.25); }
48
+ .hl-sidebar[data-collapsed] .hl-account__menu { left: calc(100% + 10px); right: auto; bottom: 0; width: 260px; }
49
+ .hl-account__head { display: flex; flex-direction: column; gap: 2px; padding: 8px 10px 10px; margin-bottom: 4px; border-bottom: 1px solid var(--hl-border); }
50
+ .hl-account__caption { font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }
51
+ .hl-account__full { overflow-wrap: anywhere; }
52
+ .hl-account__head span.hl-account__full { font-size: 13px; color: var(--hl-muted); }
53
+ .hl-shell button.hl-signout { display: flex; align-items: center; gap: 10px; min-height: 38px; padding: 0 10px; border: 0; border-radius: 8px; background: transparent; color: var(--hl-text); font: inherit; font-weight: 600; text-align: left; cursor: pointer; }
54
+ .hl-shell button.hl-signout:hover:not(:disabled) { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }
55
+ .hl-shell button.hl-signout:disabled { background: transparent; border-color: transparent; color: var(--hl-muted); opacity: .7; cursor: default; }
30
56
  .hl-content { flex: 1; min-width: 0; display: flex; flex-direction: column; }
31
57
  .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; }
32
58
  .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; }
33
59
  .hl-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--hl-text); font: inherit; }
34
60
  .hl-search:focus-within { border-color: var(--hl-accent); }
61
+ .hl-search__kbd, .hl-shortcuts kbd { flex: none; min-width: 22px; box-sizing: border-box; padding: 2px 6px; border-radius: 6px; border: 1px solid var(--hl-border); background: var(--hl-ground); font-family: inherit; font-size: 11px; font-weight: 700; text-align: center; color: var(--hl-muted); }
35
62
  .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); }
36
63
  .hl-search__list li { padding: 10px 12px; border-radius: 8px; color: var(--hl-text); cursor: pointer; }
37
64
  .hl-search__list li[aria-selected="true"] { background: var(--hl-accent-soft); color: var(--hl-accent-text); }
@@ -41,6 +68,18 @@ export const SHELL_CSS = `
41
68
  .hl-shell button.hl-menu-button:hover:not(:disabled) { background: var(--hl-faint); border-color: var(--hl-border); color: var(--hl-text); }
42
69
  .hl-main { padding: 20px 24px; width: 100%; max-width: 1180px; box-sizing: border-box; }
43
70
  .hl-drawer-backdrop { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.45); }
71
+ .hl-shortcuts-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(0,0,0,.45); }
72
+ .hl-shortcuts { position: fixed; z-index: 51; top: 50%; left: 50%; transform: translate(-50%, -50%); width: min(460px, calc(100vw - 32px)); max-height: calc(100vh - 64px); overflow-y: auto; box-sizing: border-box; padding: 18px 22px 22px; border-radius: 14px; border: 1px solid var(--hl-border); background: var(--hl-surface); color: var(--hl-text); box-shadow: 0 20px 50px rgba(0,0,0,.35); }
73
+ .hl-shortcuts__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
74
+ .hl-shortcuts h2 { margin: 0; font-size: 17px; }
75
+ .hl-shortcuts h3 { margin: 16px 0 8px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--hl-muted); }
76
+ .hl-shortcuts dl { margin: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; align-items: center; }
77
+ .hl-shortcuts dt { min-width: 0; }
78
+ .hl-shortcuts dd { margin: 0; display: flex; align-items: center; gap: 4px; justify-content: flex-end; }
79
+ .hl-shortcuts__row { display: contents; }
80
+ .hl-shortcuts__or { padding: 0 4px; font-size: 12px; color: var(--hl-muted); }
81
+ .hl-shell button.hl-shortcuts__close { width: 32px; height: 32px; min-height: 32px; padding: 0; border: 0; border-radius: var(--hl-radius-control); display: grid; place-items: center; background: transparent; color: var(--hl-muted); cursor: pointer; }
82
+ .hl-shell button.hl-shortcuts__close:hover:not(:disabled) { background: var(--hl-faint); border-color: transparent; color: var(--hl-text); }
44
83
  .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; }
45
84
  @media (max-width: 899px) {
46
85
  .hl-topbar { padding: 12px 16px; }
@@ -1 +1 @@
1
- {"version":3,"file":"shell-css.js","sourceRoot":"","sources":["../../src/shell/shell-css.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+CxB,CAAC"}
1
+ {"version":3,"file":"shell-css.js","sourceRoot":"","sources":["../../src/shell/shell-css.ts"],"names":[],"mappings":"AAAA,sEAAsE;AACtE,MAAM,CAAC,MAAM,SAAS,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsFxB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import type { NavItem } from './nav.js';
2
+ /** Whether a key press lands where the person is typing: single-key shortcuts leave it alone. */
3
+ export declare function isTyping(target: EventTarget | null): boolean;
4
+ /** Whether this is a Mac (⌘) rather than Windows or Linux (Ctrl). */
5
+ export declare function isMac(): boolean;
6
+ /** The modifier keys' names as shown on this computer's keyboard. */
7
+ export declare function keyNames(mac: boolean): {
8
+ mod: string;
9
+ shift: string;
10
+ };
11
+ /** A page "G then a letter" goes to. */
12
+ export interface GoKey {
13
+ key: string;
14
+ item: NavItem;
15
+ }
16
+ /**
17
+ * The letter for each page, for "G then a letter": the item's own `shortcut`, else the first
18
+ * letter of its name not taken by a page before it. A page with no free letter has none.
19
+ */
20
+ export declare function goKeys(items: NavItem[]): GoKey[];
21
+ /** How long after G the letter still counts. */
22
+ export declare const GO_WINDOW_MS = 1500;
@@ -0,0 +1,48 @@
1
+ /** Whether a key press lands where the person is typing: single-key shortcuts leave it alone. */
2
+ export function isTyping(target) {
3
+ if (!target || typeof target.tagName !== 'string')
4
+ return false;
5
+ const el = target;
6
+ const tag = el.tagName;
7
+ if (tag === 'TEXTAREA' || tag === 'SELECT')
8
+ return true;
9
+ if (tag === 'INPUT') {
10
+ const type = el.type;
11
+ return !['button', 'checkbox', 'radio', 'reset', 'submit', 'range', 'color', 'file'].includes(type);
12
+ }
13
+ return el.isContentEditable === true || el.getAttribute('contenteditable') === 'true';
14
+ }
15
+ /** Whether this is a Mac (⌘) rather than Windows or Linux (Ctrl). */
16
+ export function isMac() {
17
+ if (typeof navigator === 'undefined')
18
+ return false;
19
+ const platform = navigator.userAgentData?.platform ??
20
+ navigator.platform ??
21
+ '';
22
+ return /mac|iphone|ipad/i.test(platform);
23
+ }
24
+ /** The modifier keys' names as shown on this computer's keyboard. */
25
+ export function keyNames(mac) {
26
+ return mac ? { mod: '⌘', shift: '⇧' } : { mod: 'Ctrl', shift: 'Shift' };
27
+ }
28
+ /**
29
+ * The letter for each page, for "G then a letter": the item's own `shortcut`, else the first
30
+ * letter of its name not taken by a page before it. A page with no free letter has none.
31
+ */
32
+ export function goKeys(items) {
33
+ const taken = new Set();
34
+ const out = [];
35
+ for (const item of items) {
36
+ const own = item.shortcut?.toLowerCase();
37
+ const candidates = own ? [own] : [...item.label.toLowerCase()].filter((c) => /[a-z]/.test(c));
38
+ const key = candidates.find((c) => !taken.has(c));
39
+ if (!key)
40
+ continue;
41
+ taken.add(key);
42
+ out.push({ key, item });
43
+ }
44
+ return out;
45
+ }
46
+ /** How long after G the letter still counts. */
47
+ export const GO_WINDOW_MS = 1500;
48
+ //# sourceMappingURL=shortcuts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shortcuts.js","sourceRoot":"","sources":["../../src/shell/shortcuts.ts"],"names":[],"mappings":"AAEA,iGAAiG;AACjG,MAAM,UAAU,QAAQ,CAAC,MAA0B;IACjD,IAAI,CAAC,MAAM,IAAI,OAAQ,MAAkB,CAAC,OAAO,KAAK,QAAQ;QAAE,OAAO,KAAK,CAAC;IAC7E,MAAM,EAAE,GAAG,MAAqB,CAAC;IACjC,MAAM,GAAG,GAAG,EAAE,CAAC,OAAO,CAAC;IACvB,IAAI,GAAG,KAAK,UAAU,IAAI,GAAG,KAAK,QAAQ;QAAE,OAAO,IAAI,CAAC;IACxD,IAAI,GAAG,KAAK,OAAO,EAAE,CAAC;QACpB,MAAM,IAAI,GAAI,EAAuB,CAAC,IAAI,CAAC;QAC3C,OAAO,CAAC,CAAC,QAAQ,EAAE,UAAU,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC,QAAQ,CAC3F,IAAI,CACL,CAAC;IACJ,CAAC;IACD,OAAO,EAAE,CAAC,iBAAiB,KAAK,IAAI,IAAI,EAAE,CAAC,YAAY,CAAC,iBAAiB,CAAC,KAAK,MAAM,CAAC;AACxF,CAAC;AAED,qEAAqE;AACrE,MAAM,UAAU,KAAK;IACnB,IAAI,OAAO,SAAS,KAAK,WAAW;QAAE,OAAO,KAAK,CAAC;IACnD,MAAM,QAAQ,GACX,SAAmE,CAAC,aAAa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AAI,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const SIDEBAR_STORAGE_KEY = "haatlabs:sidebar";
2
+ /** Whether the sidebar was left collapsed in this browser; anything else opens it expanded. */
3
+ export declare function readSidebarCollapsed(store?: Pick<Storage, 'getItem'> | null): boolean;
4
+ /** Collapsed or expanded, remembered in this browser (like the theme). */
5
+ export declare function useSidebarCollapsed(): [boolean, () => void];
@@ -0,0 +1,38 @@
1
+ import { useCallback, useState } from 'react';
2
+ export const SIDEBAR_STORAGE_KEY = 'haatlabs:sidebar';
3
+ /** The browser's storage, or null where reading it throws (blocked site data, some private windows). */
4
+ function storage() {
5
+ try {
6
+ return typeof window === 'undefined' ? null : window.localStorage;
7
+ }
8
+ catch {
9
+ return null;
10
+ }
11
+ }
12
+ /** Whether the sidebar was left collapsed in this browser; anything else opens it expanded. */
13
+ export function readSidebarCollapsed(store = storage()) {
14
+ try {
15
+ return store?.getItem(SIDEBAR_STORAGE_KEY) === 'collapsed';
16
+ }
17
+ catch {
18
+ return false;
19
+ }
20
+ }
21
+ /** Collapsed or expanded, remembered in this browser (like the theme). */
22
+ export function useSidebarCollapsed() {
23
+ const [collapsed, setCollapsed] = useState(() => readSidebarCollapsed());
24
+ const toggle = useCallback(() => {
25
+ setCollapsed((was) => {
26
+ const next = !was;
27
+ try {
28
+ storage()?.setItem(SIDEBAR_STORAGE_KEY, next ? 'collapsed' : 'expanded');
29
+ }
30
+ catch {
31
+ // Not stored: the choice holds for this page only.
32
+ }
33
+ return next;
34
+ });
35
+ }, []);
36
+ return [collapsed, toggle];
37
+ }
38
+ //# sourceMappingURL=sidebar-state.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sidebar-state.js","sourceRoot":"","sources":["../../src/shell/sidebar-state.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE9C,MAAM,CAAC,MAAM,mBAAmB,GAAG,kBAAkB,CAAC;AAEtD,wGAAwG;AACxG,SAAS,OAAO;IACd,IAAI,CAAC;QACH,OAAO,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,YAAY,CAAC;IACpE,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,IAAI,CAAC;IACd,CAAC;AACH,CAAC;AAED,+FAA+F;AAC/F,MAAM,UAAU,oBAAoB,CAAC,QAAyC,OAAO,EAAE;IACrF,IAAI,CAAC;QACH,OAAO,KAAK,EAAE,OAAO,CAAC,mBAAmB,CAAC,KAAK,WAAW,CAAC;IAC7D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,KAAK,CAAC;IACf,CAAC;AACH,CAAC;AAED,0EAA0E;AAC1E,MAAM,UAAU,mBAAmB;IACjC,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE,CAAC,oBAAoB,EAAE,CAAC,CAAC;IACzE,MAAM,MAAM,GAAG,WAAW,CAAC,GAAG,EAAE;QAC9B,YAAY,CAAC,CAAC,GAAG,EAAE,EAAE;YACnB,MAAM,IAAI,GAAG,CAAC,GAAG,CAAC;YAClB,IAAI,CAAC;gBACH,OAAO,EAAE,EAAE,OAAO,CAAC,mBAAmB,EAAE,IAAI,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC;YAC3E,CAAC;YAAC,MAAM,CAAC;gBACP,mDAAmD;YACrD,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC,CAAC,CAAC;IACL,CAAC,EAAE,EAAE,CAAC,CAAC;IACP,OAAO,CAAC,SAAS,EAAE,MAAM,CAAC,CAAC;AAC7B,CAAC"}
@@ -1,10 +1,11 @@
1
1
  import { jsx as _jsx } from "react/jsx-runtime";
2
2
  import { USAGE_CSS } from '../client/usage-css.js';
3
3
  import { LAYOUT_CSS } from '../layout/layout-css.js';
4
+ import { NOTIFICATIONS_CSS } from '../notifications/notifications-css.js';
4
5
  import { SHELL_CSS } from '../shell/shell-css.js';
5
6
  import { themeCss } from './tokens.js';
6
7
  /** The dashboard look as one `<style>`: render it once, at the top of the app. */
7
8
  export function ThemeStyles({ accent }) {
8
- return _jsx("style", { children: themeCss(accent) + SHELL_CSS + LAYOUT_CSS + USAGE_CSS });
9
+ return _jsx("style", { children: themeCss(accent) + SHELL_CSS + LAYOUT_CSS + USAGE_CSS + NOTIFICATIONS_CSS });
9
10
  }
10
11
  //# sourceMappingURL=ThemeStyles.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeStyles.js","sourceRoot":"","sources":["../../src/theme/ThemeStyles.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,kFAAkF;AAClF,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAA2C;IAC7E,OAAO,0BAAQ,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAS,CAAC;AAChF,CAAC"}
1
+ {"version":3,"file":"ThemeStyles.js","sourceRoot":"","sources":["../../src/theme/ThemeStyles.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EAAE,MAAM,uCAAuC,CAAC;AAC1E,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAGvC,kFAAkF;AAClF,MAAM,UAAU,WAAW,CAAC,EAAE,MAAM,EAA2C;IAC7E,OAAO,0BAAQ,QAAQ,CAAC,MAAM,CAAC,GAAG,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,iBAAiB,GAAS,CAAC;AACpG,CAAC"}
@@ -1,3 +1,8 @@
1
1
  import type { ReactElement } from 'react';
2
+ import type { ThemeChoice } from './theme-choice.js';
2
3
  /** System, dark or light: the choice is remembered in this browser. */
3
4
  export declare function ThemeSwitch(): ReactElement;
5
+ /** The theme after this one: system → dark → light → system. */
6
+ export declare function nextTheme(choice: ThemeChoice): ThemeChoice;
7
+ /** One button that steps through system, dark and light: for the collapsed sidebar. */
8
+ export declare function ThemeCycle(): ReactElement;
@@ -31,4 +31,16 @@ export function ThemeSwitch() {
31
31
  const { choice, setChoice } = useTheme();
32
32
  return (_jsx("div", { role: "group", "aria-label": "Theme", className: "hl-theme-switch", children: OPTIONS.map((option) => (_jsx("button", { type: "button", "aria-label": option.label, "aria-pressed": choice === option.choice, onClick: () => setChoice(option.choice), children: option.icon }, option.choice))) }));
33
33
  }
34
+ const NAMES = { system: 'System', dark: 'Dark', light: 'Light' };
35
+ /** The theme after this one: system → dark → light → system. */
36
+ export function nextTheme(choice) {
37
+ return choice === 'system' ? 'dark' : choice === 'dark' ? 'light' : 'system';
38
+ }
39
+ /** One button that steps through system, dark and light: for the collapsed sidebar. */
40
+ export function ThemeCycle() {
41
+ const { choice, setChoice } = useTheme();
42
+ const option = OPTIONS.find((o) => o.choice === choice) ?? OPTIONS[0];
43
+ const next = nextTheme(choice);
44
+ return (_jsx("button", { type: "button", className: "hl-theme-cycle", "aria-label": `Theme: ${NAMES[choice]}. Change to ${NAMES[next]}`, title: `Theme: ${NAMES[choice]}`, onClick: () => setChoice(next), children: option?.icon }));
45
+ }
34
46
  //# sourceMappingURL=ThemeSwitch.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ThemeSwitch.js","sourceRoot":"","sources":["../../src/theme/ThemeSwitch.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAG7C,MAAM,IAAI,GAAG;IACX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MAAM,CAAC,EAAE,EAChC,OAAO,EAAE,GAAG,EAAE,CAAC,SAAS,CAAC,IAAI,CAAC,YAE7B,MAAM,EAAE,IAAI,GACN,CACV,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@haatlabs-core/ui",
3
- "version": "0.19.0",
3
+ "version": "0.21.0",
4
4
  "description": "React components for an app's dashboard, styled by the app.",
5
5
  "keywords": [
6
6
  "haatlabs",
@@ -67,11 +67,11 @@
67
67
  "react-router-dom": "^7.18.4",
68
68
  "@tanstack/react-query": "^5.104.1",
69
69
  "zod": "^4.6.5",
70
- "@haatlabs-core/tsconfig": "0.19.0",
71
- "@haatlabs-core/vitest-config": "0.19.0"
70
+ "@haatlabs-core/vitest-config": "0.21.0",
71
+ "@haatlabs-core/tsconfig": "0.21.0"
72
72
  },
73
73
  "dependencies": {
74
- "@haatlabs-core/auth-contracts": "0.19.0"
74
+ "@haatlabs-core/auth-contracts": "0.21.0"
75
75
  },
76
76
  "scripts": {
77
77
  "build": "rm -rf dist && tsc -p tsconfig.build.json",