@apliteni/apliteni-ui 0.149.0 → 0.151.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.
@@ -32,11 +32,11 @@
32
32
 
33
33
  <!-- rule: menu -->
34
34
 
35
- **Rule:** Keep the account menu to the reader, the row that opens the modal, and Sign out.
35
+ **Rule:** Keep the account menu to the reader, a few ways in, a Theme submenu and Sign out.
36
36
 
37
37
  **Why:** A setting answered inside a menu has no address to link, search or come back to.
38
38
 
39
- **Do:** Name the reader, then the way in and the way out.
39
+ **Do:** Name the reader, then Account settings and Support.
40
40
 
41
41
  **Don't:** Answer the settings in the menu, a row per setting.
42
42
 
@@ -8,7 +8,7 @@
8
8
 
9
9
  **Rule:** Put tables on a white surface in light mode and the base canvas in dark mode.
10
10
 
11
- **Do:** Use a white surface in light mode and the base canvas in dark mode; let the row edge mark hover.
11
+ **Do:** Let the row edge mark hover.
12
12
 
13
13
  **Don't:** Add a grey zebra or hover fill.
14
14
 
@@ -32,7 +32,7 @@
32
32
 
33
33
  **Rule:** Right-align numeric headers and values.
34
34
 
35
- **Do:** Right-align numeric headers and values, use tabular numerals, and keep text left-aligned.
35
+ **Do:** Use tabular numerals, and keep text left-aligned.
36
36
 
37
37
  **Don't:** Align numbers to their labels or sort formatted strings.
38
38
 
@@ -111,3 +111,17 @@
111
111
  **Do:** Retain rows while refreshing, report busy state, distinguish no data from no matches and errors, and preserve focus when filters change.
112
112
 
113
113
  **Don't:** Replace the table with a blank state or move focus without telling the reader why.
114
+
115
+ ## Give every table its filter bar
116
+
117
+ <!-- rule: filter-bar -->
118
+
119
+ **Why:** Readers narrow rows before reading them, and look for the bar where other tables put it.
120
+
121
+ **Rule:** Put a bar with a search field and column filters directly above every table.
122
+
123
+ **Do:** Search, then a status filter, on the row above the table.
124
+
125
+ **Don't:** Leave rows that the reader cannot narrow.
126
+
127
+ **Except:** Two tables take no bar: one that compares a document line by line, where a filter hides lines the reviewer must check, and a chart's Table view, which holds only the chart's points.
@@ -48,6 +48,6 @@
48
48
 
49
49
  **Do:** Lead with the extracted fields, in the wider column, with each value heavier than its label, and put the accent on the pane's own name.
50
50
 
51
- **Don't:** Give the source document the leading, wider pane, or let a control inside it hold the only accent on the screen while the saved values hold none.
51
+ **Don't:** Give the document preview the leading, wider pane, or let a control inside it hold the only accent on the screen while the saved values hold none.
52
52
 
53
53
  **Except:** Fade nothing to make a block quieter; a quieter block is smaller, later or uncoloured, never muted.
@@ -40,17 +40,17 @@
40
40
 
41
41
  **Except:** After search or another record, still link to the parent; browser Back returns to the previous location.
42
42
 
43
- ## Choose one navigation method
43
+ ## Skip the trail
44
44
 
45
45
  <!-- rule: one-or-the-other -->
46
46
 
47
- **Rule:** Put one back link or trail above the title, never both.
47
+ **Rule:** Put one back link, to the parent, above a subpage’s title.
48
48
 
49
- **Why:** A trail shows several levels; a back link shows one step, and `appShell()` draws only the link when both are provided.
49
+ **Why:** The sidebar already shows the section, so a trail names the same place again.
50
50
 
51
- **Do:** Align the single line above the title.
51
+ **Do:** Link Invoices above an invoice.
52
52
 
53
- **Don't:** Repeat the hierarchy with both; the current page is then named three times.
53
+ **Don't:** Stack a link for each level, such as Finance then Invoices.
54
54
 
55
55
  ## Keep the section active
56
56
 
@@ -36,6 +36,8 @@
36
36
 
37
37
  **Don't:** Put filters above the title.
38
38
 
39
+ **Except:** Small tools for the whole page, such as a version badge, stand at the end of the title row.
40
+
39
41
  ## Use one page title
40
42
 
41
43
  <!-- rule: one-h1 -->
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@apliteni/apliteni-ui",
3
- "version": "0.149.0",
3
+ "version": "0.151.0",
4
4
  "workspaces": [
5
5
  "react"
6
6
  ],
package/react/README.md CHANGED
@@ -1004,7 +1004,7 @@ avatar mark, the reader's name and address, the rows in `items` and Sign out. Bo
1004
1004
  kit's `Dropdown`, so they share its keyboard and placement. `current` marks one account page in
1005
1005
  accent ink and defaults to `prefs`.
1006
1006
 
1007
- ## NavTabs and Breadcrumbs
1007
+ ## NavTabs
1008
1008
 
1009
1009
  `NavTabs` renders route links with the kit’s underline or pill presentation. Pass
1010
1010
  unique item IDs and set `active` to the current route’s ID. The current link has
@@ -1017,11 +1017,6 @@ badges accept text, numbers (including zero), or `{ text, tone }`.
1017
1017
  { id: 'payouts', label: 'Payouts', href: '/payouts', badge: 3 },
1018
1018
  { id: 'exports', label: 'Exports', disabled: true },
1019
1019
  ]} />
1020
- <Breadcrumbs items={[
1021
- { label: 'Finance', href: '/finance' },
1022
- { label: 'Payouts', href: '/payouts' },
1023
- { label: 'PY-4821' },
1024
- ]} />
1025
1020
  ```
1026
1021
 
1027
1022
  Use `Tabs` for panels within a page. `NavTabs` keeps normal link keyboard behavior.
@@ -1029,7 +1024,7 @@ An omitted `href` falls back to `#` plus the item ID. `variant="pill"` selects t
1029
1024
  existing pill styles. A badge of `null` renders no badge, so a count that is not in
1030
1025
  yet costs nothing to pass.
1031
1026
 
1032
- Both components take `renderLink`, the prop `AppShell` already uses, so a router
1027
+ `NavTabs` takes `renderLink`, the prop `AppShell` already uses, so a router
1033
1028
  handles the navigation instead of the browser reloading the document:
1034
1029
 
1035
1030
  ```tsx
@@ -1039,18 +1034,14 @@ handles the navigation instead of the browser reloading the document:
1039
1034
  )} />
1040
1035
  ```
1041
1036
 
1042
- Without it both render a plain `<a>`. The kit's class, destination, current state
1037
+ Without it, it renders a plain `<a>`. The kit's class, destination, current state
1043
1038
  and children all arrive in `linkProps`, so pass them through rather than rebuilding
1044
1039
  them.
1045
1040
 
1046
- `Breadcrumbs` renders an ordered trail. Earlier items link only when they have an
1047
- `href`; the final item is always current-page text. Items accept a decorative kit
1048
- `icon` name. Both components accept native navigation attributes and a forwarded
1049
- root ref. Use `aria-label` to distinguish navigation landmarks. Link items accept
1041
+ `NavTabs` accepts native navigation attributes and a forwarded root ref. Use `aria-label` to distinguish navigation landmarks. Link items accept
1050
1042
  `target`. Script, data, and VBScript destinations fall back to `#`.
1051
1043
 
1052
- Tab rows scroll within their container when the links do not fit; a breadcrumb
1053
- trail wraps instead. A row whose links do fit scrolls nothing and clips nothing, so
1044
+ Tab rows scroll within their container when the links do not fit. A row whose links do fit scrolls nothing and clips nothing, so
1054
1045
  a focus ring in it keeps its complete band. The current route is revealed after
1055
1046
  mounting and route changes. Content and container changes update the fit state
1056
1047
  without revealing the route again, so they preserve the reader's scroll position
@@ -921,29 +921,19 @@ type ToastProps = {
921
921
  declare function useToast(): (notice: ToastNotice) => void;
922
922
  declare function Toast({ children, collapse }: ToastProps): react.JSX.Element;
923
923
 
924
- type BreadcrumbItem = {
925
- label: string;
926
- href?: string;
927
- target?: string;
928
- icon?: string;
929
- };
930
- type BreadcrumbsProps = Omit<ComponentPropsWithoutRef<'nav'>, 'children'> & {
931
- items: readonly BreadcrumbItem[];
932
- /** Spread linkProps onto the router link, including children. */
933
- renderLink?: (item: BreadcrumbItem, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
934
- };
935
- declare const Breadcrumbs: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedHTMLProps<react.HTMLAttributes<HTMLElement>, HTMLElement>, "ref">, "children"> & {
936
- items: readonly BreadcrumbItem[];
937
- /** Spread linkProps onto the router link, including children. */
938
- renderLink?: (item: BreadcrumbItem, linkProps: ComponentPropsWithoutRef<"a">) => ReactNode;
939
- } & react.RefAttributes<HTMLElement>>;
940
-
941
924
  type AppShellSection = {
942
925
  href: string;
943
926
  label: string;
944
927
  icon: string;
945
928
  count?: number;
946
929
  };
930
+ /** A product's own row in the account menu, such as Account settings or Support (#736). */
931
+ type AppShellAccountItem = {
932
+ label: string;
933
+ icon?: string;
934
+ href?: string;
935
+ onSelect?: () => void;
936
+ };
947
937
  type AppShellProps = {
948
938
  sections: AppShellSection[];
949
939
  /** The vanilla rail layout, or the existing band layout. */
@@ -960,9 +950,11 @@ type AppShellProps = {
960
950
  href: string;
961
951
  label: string;
962
952
  };
963
- crumbs?: readonly BreadcrumbItem[];
964
953
  lede?: string;
965
954
  actions?: ReactNode;
955
+ /** Small tools for the whole page, at the end of the title row: a version badge, a
956
+ * small button. The lede stands under the whole row (#736). */
957
+ tools?: ReactNode;
966
958
  bandControl?: ReactNode;
967
959
  /** One glyph control in the sidebar head, before the fold button, drawn as the fold is.
968
960
  * On a phone it stands in the menu panel's head. Topbar layout only (#732). */
@@ -976,6 +968,8 @@ type AppShellProps = {
976
968
  name: string;
977
969
  email: string;
978
970
  };
971
+ /** Rows above the theme row and Sign out in every account menu (#736). */
972
+ accountItems?: readonly AppShellAccountItem[];
979
973
  onSignOut: () => void;
980
974
  /** Server-read fold preference. The browser restores the shared rail cookie. */
981
975
  defaultCollapsed?: boolean;
@@ -983,7 +977,7 @@ type AppShellProps = {
983
977
  /** Spread linkProps onto the router link, including children and onClick. */
984
978
  renderLink?: (section: AppShellSection, linkProps: ComponentPropsWithoutRef<'a'>) => ReactNode;
985
979
  };
986
- declare function AppShell({ sections, pathname, title, children, word, brand, layout, brandHref, width, back, crumbs, lede, actions, bandControl, headControl, account, onSignOut, searchLabel, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
980
+ declare function AppShell({ sections, pathname, title, children, word, brand, layout, brandHref, width, back, lede, actions, tools, bandControl, headControl, account, accountItems, onSignOut, searchLabel, defaultCollapsed, palette, renderLink }: AppShellProps): react.JSX.Element;
987
981
 
988
982
  type AuthShellProps = Omit<HTMLAttributes<HTMLDivElement>, 'children'> & {
989
983
  brand: ReactNode;
@@ -1407,4 +1401,4 @@ declare const NavTabs: react.ForwardRefExoticComponent<Omit<Omit<react.DetailedH
1407
1401
  declare const PAGE_SIZES: readonly number[];
1408
1402
  declare const DEFAULT_PAGE_SIZE: number;
1409
1403
 
1410
- export { type Accent, AccentPicker, type AccentPickerProps, AccountMenu, type AccountMenuProps, type AccountReader, type AccountSection, AccountWindow, type AccountWindowProps, type AddFilter, AppShell, type AppShellProps, type AppShellSection, AuthShell, type AuthShellProps, Avatar, type AvatarProps, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, type BreadcrumbItem, Breadcrumbs, type BreadcrumbsProps, BusyRegion, type BusyRegionProps, Button, type ButtonLinkProps, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, Chart, type ChartAreaLook, type ChartBridgeStep, type ChartBridgeTones, type ChartDonutLook, type ChartLineLook, type ChartLookSeries, type ChartPeriod, type ChartProps, type ChartSeries, type ChartSlice, type ChartStackedLook, type ChartTone, CheckList, type CheckListProps, Checkbox, type CheckboxProps, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DatePicker, type DatePickerMode, type DatePickerPreset, type DatePickerProps, type DatePickerRange, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownAvatar, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, Feedback, type FeedbackPayload, type FeedbackProps, type FeedbackResult, type FeedbackSection, Field, type FieldControlProps, type FieldProps, FileDrop, type FileDropFile, type FileDropProps, type FileDropStatus, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Footer, type FooterColumn, type FooterLink, type FooterProps, type FooterSocial, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, type NativeButtonProps, type NavTabBadge, type NavTabItem, NavTabs, type NavTabsProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, Pill, type PillProps, RowIdentity, type RowIdentityProps, SearchField, type SearchFieldProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, SidebarNav, type SidebarNavBadge, type SidebarNavItem, type SidebarNavLeaf, type SidebarNavProps, type SidebarNavSection, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, StatusDot, type StatusDotProps, Success, SuccessCheck, type SuccessCheckProps, type SuccessCountdown, SuccessPanel, type SuccessPanelProps, type SuccessProps, Switch, type SwitchProps, THEME_INIT_SCRIPT, type TabItem, type TableSort, Tabs, type TabsProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, ThemeToggle, type ThemeToggleProps, Timeline, type TimelineEvent, type TimelineEventKind, type TimelineProps, Toast, type ToastNotice, type ToastProps, Tooltip, type TooltipProps, TopBar, type TopBarProps, type Version, VersionSwitcher, type VersionSwitcherProps, ViewSwitch, type ViewSwitchItem, type ViewSwitchProps, sortTableRows, useToast };
1404
+ export { type Accent, AccentPicker, type AccentPickerProps, AccountMenu, type AccountMenuProps, type AccountReader, type AccountSection, AccountWindow, type AccountWindowProps, type AddFilter, AppShell, type AppShellProps, type AppShellSection, AuthShell, type AuthShellProps, Avatar, type AvatarProps, BackLink, type BackLinkOwnProps, type BackLinkProps, Badge, BusyRegion, type BusyRegionProps, Button, type ButtonLinkProps, type ButtonProps, Callout, type CalloutProps, type CalloutVariant, Card, Chart, type ChartAreaLook, type ChartBridgeStep, type ChartBridgeTones, type ChartDonutLook, type ChartLineLook, type ChartLookSeries, type ChartPeriod, type ChartProps, type ChartSeries, type ChartSlice, type ChartStackedLook, type ChartTone, CheckList, type CheckListProps, Checkbox, type CheckboxProps, type Column, type CommandGroup, type CommandItem, CommandPalette, type CommandPaletteProps, Confirm, type ConfirmProps, DEFAULT_PAGE_SIZE, DataTable, type DataTableProps, DatePicker, type DatePickerMode, type DatePickerPreset, type DatePickerProps, type DatePickerRange, DeltaValue, type DeltaValueProps, Denied, type DeniedProps, Drawer, type DrawerProps, DrawerSection, type DrawerSectionProps, Dropdown, type DropdownAvatar, type DropdownBadge, type DropdownEntry, type DropdownItem, type DropdownProps, type DropdownRowProps, type DropdownSearch, type DropdownSection, type DropdownSeparator, EmptyState, type EmptyStateProps, type EmptyStateVariant, Feedback, type FeedbackPayload, type FeedbackProps, type FeedbackResult, type FeedbackSection, Field, type FieldControlProps, type FieldProps, FileDrop, type FileDropFile, type FileDropProps, type FileDropStatus, FileField, type FileFieldProps, type Filter, FilterBar, type FilterBarProps, Footer, type FooterColumn, type FooterLink, type FooterProps, type FooterSocial, Icon, KeyValueList, type KeyValueListProps, type KeyValueRow, Modal, type ModalProps, type NativeButtonProps, type NavTabBadge, type NavTabItem, NavTabs, type NavTabsProps, NumericValue, type NumericValueProps, PAGE_SIZES, Pagination, type PaginationProps, Pill, type PillProps, RowIdentity, type RowIdentityProps, SearchField, type SearchFieldProps, type SegmentOption, Segmented, type SegmentedProps, SelectField, type SelectFieldProps, SidebarNav, type SidebarNavBadge, type SidebarNavItem, type SidebarNavLeaf, type SidebarNavProps, type SidebarNavSection, Skeleton, type SkeletonProps, SkeletonTable, type SkeletonTableProps, Snippet, type SnippetProps, StatBand, type StatBandProps, type StatDelta, type StatFigure, type StatTone, type StatVariant, StatusDot, type StatusDotProps, Success, SuccessCheck, type SuccessCheckProps, type SuccessCountdown, SuccessPanel, type SuccessPanelProps, type SuccessProps, Switch, type SwitchProps, THEME_INIT_SCRIPT, type TabItem, type TableSort, Tabs, type TabsProps, TextArea, type TextAreaProps, TextField, type TextFieldProps, ThemeToggle, type ThemeToggleProps, Timeline, type TimelineEvent, type TimelineEventKind, type TimelineProps, Toast, type ToastNotice, type ToastProps, Tooltip, type TooltipProps, TopBar, type TopBarProps, type Version, VersionSwitcher, type VersionSwitcherProps, ViewSwitch, type ViewSwitchItem, type ViewSwitchProps, sortTableRows, useToast };
@@ -3789,7 +3789,7 @@ function Field({ id: suppliedId, label, hint, error, required, children }) {
3789
3789
  const labelId = `${id}-label`;
3790
3790
  return /* @__PURE__ */ jsx34(Frame, { ...{ id, labelId, label, hint, error, required }, children: /* @__PURE__ */ jsx34(FieldContext.Provider, { value: { id, labelId }, children: children({ ...wiring(id, hint, error), required }) }) });
3791
3791
  }
3792
- var TextField = forwardRef8(function TextField2({ label, hint, error, required, type = "text", unit, icon: glyph, className = "", ...props }, ref) {
3792
+ var TextField = forwardRef8(function TextField2({ label, hint, error, required, type = "text", unit, icon: glyph2, className = "", ...props }, ref) {
3793
3793
  const id = useId12();
3794
3794
  const hasUnit = type === "number" && !!unit;
3795
3795
  const describedBy = [messages(id, hint, error), hasUnit ? `${id}-unit` : ""].filter(Boolean).join(" ") || void 0;
@@ -3807,8 +3807,8 @@ var TextField = forwardRef8(function TextField2({ label, hint, error, required,
3807
3807
  }
3808
3808
  );
3809
3809
  const unitSpan = hasUnit ? /* @__PURE__ */ jsx34("span", { id: `${id}-unit`, className: "ui-field-number__unit", children: unit }) : null;
3810
- return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: glyph ? /* @__PURE__ */ jsxs30("div", { className: `ui-input-group${hasUnit ? " ui-field-number" : ""}`, children: [
3811
- /* @__PURE__ */ jsx34("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon5(glyph) } }),
3810
+ return /* @__PURE__ */ jsx34(Frame, { ...{ id, label, hint, error, required }, children: glyph2 ? /* @__PURE__ */ jsxs30("div", { className: `ui-input-group${hasUnit ? " ui-field-number" : ""}`, children: [
3811
+ /* @__PURE__ */ jsx34("span", { className: "ui-input-group__icon", dangerouslySetInnerHTML: { __html: icon5(glyph2) } }),
3812
3812
  control,
3813
3813
  unitSpan
3814
3814
  ] }) : hasUnit ? /* @__PURE__ */ jsxs30("div", { className: "ui-field-number", children: [
@@ -3921,9 +3921,9 @@ function EmptyState({ variant = "first-run", title, sub, icon: icon9, art, actio
3921
3921
  const preset = cases[variant];
3922
3922
  const heading = title ?? preset.title;
3923
3923
  const guidance = sub ?? preset.sub;
3924
- const glyph = icon9 ?? preset.icon;
3924
+ const glyph2 = icon9 ?? preset.icon;
3925
3925
  return /* @__PURE__ */ jsxs31("div", { className: "ui-empty", children: [
3926
- art ? typeof art === "string" ? /* @__PURE__ */ jsx35("div", { className: "ui-empty__art", dangerouslySetInnerHTML: { __html: /<svg/.test(art) ? art : illo(art) } }) : /* @__PURE__ */ jsx35("div", { className: "ui-empty__art", "aria-hidden": "true", children: art }) : glyph ? /* @__PURE__ */ jsx35("div", { className: "ui-empty__icon", dangerouslySetInnerHTML: { __html: kitIcon3(glyph) } }) : null,
3926
+ art ? typeof art === "string" ? /* @__PURE__ */ jsx35("div", { className: "ui-empty__art", dangerouslySetInnerHTML: { __html: /<svg/.test(art) ? art : illo(art) } }) : /* @__PURE__ */ jsx35("div", { className: "ui-empty__art", "aria-hidden": "true", children: art }) : glyph2 ? /* @__PURE__ */ jsx35("div", { className: "ui-empty__icon", dangerouslySetInnerHTML: { __html: kitIcon3(glyph2) } }) : null,
3927
3927
  heading && /* @__PURE__ */ jsx35("div", { className: "ui-empty__title", children: heading }),
3928
3928
  guidance && /* @__PURE__ */ jsx35("div", { className: "ui-empty__sub", children: guidance }),
3929
3929
  actions && /* @__PURE__ */ jsx35("div", { className: "ui-empty__actions", children: actions })
@@ -4419,8 +4419,8 @@ function Toast({ children, collapse = false }) {
4419
4419
  }
4420
4420
 
4421
4421
  // src/AppShell.tsx
4422
- import { useEffect as useEffect17, useId as useId13, useMemo as useMemo4, useRef as useRef22, useState as useState17 } from "react";
4423
- import { prism, themeIcon as themeIcon2 } from "@apliteni/apliteni-ui";
4422
+ import { useEffect as useEffect18, useId as useId13, useMemo as useMemo4, useRef as useRef23, useState as useState18 } from "react";
4423
+ import { prism } from "@apliteni/apliteni-ui";
4424
4424
 
4425
4425
  // src/lib/palette-hotkey.ts
4426
4426
  function paletteHotkey(platform = typeof navigator === "undefined" ? "" : navigator.platform) {
@@ -4448,48 +4448,15 @@ function storeRailCollapsed(collapsed) {
4448
4448
  }
4449
4449
  }
4450
4450
 
4451
- // src/Breadcrumbs.tsx
4452
- import { forwardRef as forwardRef10 } from "react";
4453
- import { icon as icon7, safeUrl as safeUrl3 } from "@apliteni/apliteni-ui";
4454
- import { Fragment as Fragment17, jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
4455
- var Breadcrumbs = forwardRef10(function Breadcrumbs2({
4456
- items,
4457
- renderLink,
4458
- className,
4459
- "aria-label": ariaLabel = "Breadcrumb",
4460
- ...rest
4461
- }, ref) {
4462
- return /* @__PURE__ */ jsx39(
4463
- "nav",
4464
- {
4465
- ...rest,
4466
- ref,
4467
- className: ["ui-nav", "ui-nav--crumbs", className].filter(Boolean).join(" "),
4468
- "aria-label": ariaLabel,
4469
- children: /* @__PURE__ */ jsx39("ol", { className: "ui-nav__crumbs", children: items.map((item, index) => {
4470
- const current = index === items.length - 1;
4471
- const inner = /* @__PURE__ */ jsxs35(Fragment17, { children: [
4472
- item.icon && /* @__PURE__ */ jsx39("span", { className: "ui-nav__ic", dangerouslySetInnerHTML: { __html: icon7(item.icon) } }),
4473
- /* @__PURE__ */ jsx39("span", { className: "ui-nav__crumb-label", children: item.label })
4474
- ] });
4475
- const linkProps = !current && item.href ? { className: "ui-nav__crumb", href: safeUrl3(item.href), target: item.target, children: inner } : null;
4476
- return /* @__PURE__ */ jsx39("li", { className: "ui-nav__crumb-item", children: linkProps ? renderLink ? renderLink(item, linkProps) : /* @__PURE__ */ jsx39("a", { ...linkProps }) : /* @__PURE__ */ jsx39(
4477
- "span",
4478
- {
4479
- className: ["ui-nav__crumb", current && "is-current"].filter(Boolean).join(" "),
4480
- "aria-current": current ? "page" : void 0,
4481
- children: inner
4482
- }
4483
- ) }, index);
4484
- }) })
4485
- }
4486
- );
4487
- });
4451
+ // src/AccountMenu.tsx
4452
+ import { useEffect as useEffect17, useRef as useRef22, useState as useState17 } from "react";
4453
+ import { createPortal as createPortal7 } from "react-dom";
4454
+ import { icon as icon7, themeIcon as themeIcon2, transitionMs as transitionMs3 } from "@apliteni/apliteni-ui";
4488
4455
 
4489
4456
  // src/ThemeToggle.tsx
4490
4457
  import { useSyncExternalStore } from "react";
4491
4458
  import { themeIcon } from "@apliteni/apliteni-ui";
4492
- import { jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
4459
+ import { jsx as jsx39, jsxs as jsxs35 } from "react/jsx-runtime";
4493
4460
  var STORAGE_KEY = "apliteni-strategy-theme";
4494
4461
  var CHOICE_EVENT = "apliteni-theme-choice";
4495
4462
  var THEME_INIT_SCRIPT = `(()=>{let t;try{t=localStorage.getItem('apliteni-strategy-theme')}catch{}document.documentElement.setAttribute('data-theme',t==='dark'||t==='light'?t:window.matchMedia?.('(prefers-color-scheme: light)').matches?'light':'dark')})()`;
@@ -4538,29 +4505,203 @@ function useThemeChoice() {
4538
4505
  const next = theme === "dark" ? "light" : theme === "light" ? "auto" : "dark";
4539
4506
  const label = theme === "auto" ? "Auto" : theme === "light" ? "Light" : "Dark";
4540
4507
  const name = `Theme: ${label}. Switch to ${next}.`;
4541
- const toggle = () => {
4542
- document.documentElement.setAttribute("data-theme-choice", next);
4543
- document.documentElement.setAttribute("data-theme", next === "auto" ? window.matchMedia?.("(prefers-color-scheme: light)").matches ? "light" : "dark" : next);
4508
+ const set = (choice) => {
4509
+ document.documentElement.setAttribute("data-theme-choice", choice);
4510
+ document.documentElement.setAttribute("data-theme", choice === "auto" ? window.matchMedia?.("(prefers-color-scheme: light)").matches ? "light" : "dark" : choice);
4544
4511
  try {
4545
- localStorage.setItem(STORAGE_KEY, next);
4512
+ localStorage.setItem(STORAGE_KEY, choice);
4546
4513
  } catch {
4547
4514
  }
4548
4515
  window.dispatchEvent(new Event(CHOICE_EVENT));
4549
4516
  };
4550
- return { theme, next, label, name, toggle };
4517
+ const toggle = () => set(next);
4518
+ return { theme, next, label, name, toggle, set };
4551
4519
  }
4552
4520
  function ThemeToggle({ labelled = false }) {
4553
4521
  const { theme, label, name, toggle } = useThemeChoice();
4554
- const button = /* @__PURE__ */ jsx40("button", { type: "button", className: "toggle", "aria-label": name, title: name, onClick: toggle, children: /* @__PURE__ */ jsx40("span", { className: "ic", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: themeIcon(theme) } }) });
4555
- return labelled ? /* @__PURE__ */ jsxs36("span", { className: "ui-theme-toggle", children: [
4522
+ const button = /* @__PURE__ */ jsx39("button", { type: "button", className: "toggle", "aria-label": name, title: name, onClick: toggle, children: /* @__PURE__ */ jsx39("span", { className: "ic", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: themeIcon(theme) } }) });
4523
+ return labelled ? /* @__PURE__ */ jsxs35("span", { className: "ui-theme-toggle", children: [
4556
4524
  button,
4557
- /* @__PURE__ */ jsxs36("span", { children: [
4525
+ /* @__PURE__ */ jsxs35("span", { children: [
4558
4526
  label,
4559
4527
  " theme"
4560
4528
  ] })
4561
4529
  ] }) : button;
4562
4530
  }
4563
4531
 
4532
+ // src/AccountMenu.tsx
4533
+ import { Fragment as Fragment17, jsx as jsx40, jsxs as jsxs36 } from "react/jsx-runtime";
4534
+ var THEMES = [["auto", "Auto"], ["light", "Light"], ["dark", "Dark"]];
4535
+ var glyph = (svg, className) => /* @__PURE__ */ jsx40("span", { className, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: svg } });
4536
+ function AccountMenu({ account, items, onSelect, withTheme, inPlace, away }) {
4537
+ const theme = useThemeChoice();
4538
+ const [open, setOpen] = useState17(false);
4539
+ const [sub, setSub] = useState17(false);
4540
+ const block = useRef22(null);
4541
+ const themeRow = useRef22(null);
4542
+ const list = useRef22(null);
4543
+ const flyout = useRef22(null);
4544
+ const refocus = useRef22(false);
4545
+ const close = () => {
4546
+ refocus.current = true;
4547
+ setSub(false);
4548
+ };
4549
+ useIsoLayoutEffect(() => {
4550
+ if (!sub || inPlace) return;
4551
+ const place = () => {
4552
+ const row = themeRow.current;
4553
+ const fly = flyout.current;
4554
+ const panel2 = row?.closest(".ui-dropdown__panel");
4555
+ if (!row || !fly || !panel2) return;
4556
+ const right = panel2.getBoundingClientRect().right;
4557
+ const style = getComputedStyle(fly);
4558
+ const pad2 = parseFloat(style.paddingTop) + parseFloat(style.borderTopWidth);
4559
+ const top = Math.min(row.getBoundingClientRect().top - pad2, window.innerHeight - fly.offsetHeight - parseFloat(style.paddingTop));
4560
+ fly.style.left = `${right + parseFloat(style.paddingLeft)}px`;
4561
+ fly.style.top = `${Math.max(0, top)}px`;
4562
+ };
4563
+ const panel = themeRow.current?.closest(".ui-dropdown__panel");
4564
+ place();
4565
+ window.addEventListener("resize", place);
4566
+ panel?.addEventListener("transitionend", place);
4567
+ const landed = panel ? setTimeout(place, transitionMs3(panel)) : void 0;
4568
+ return () => {
4569
+ window.removeEventListener("resize", place);
4570
+ panel?.removeEventListener("transitionend", place);
4571
+ clearTimeout(landed);
4572
+ };
4573
+ }, [sub, inPlace]);
4574
+ useEffect17(() => {
4575
+ if (!open || !away) return;
4576
+ const gone = () => {
4577
+ if (block.current?.getClientRects().length) return;
4578
+ const el = document.activeElement;
4579
+ const held = !el || el === document.body || block.current?.contains(el) || flyout.current?.contains(el);
4580
+ setSub(false);
4581
+ setOpen(false);
4582
+ if (held) away.current?.focus();
4583
+ };
4584
+ window.addEventListener("resize", gone);
4585
+ return () => window.removeEventListener("resize", gone);
4586
+ }, [open, away]);
4587
+ useEffect17(() => {
4588
+ if (sub) list.current?.querySelector('[role="menuitemradio"]')?.focus();
4589
+ else if (refocus.current) {
4590
+ refocus.current = false;
4591
+ themeRow.current?.focus();
4592
+ }
4593
+ }, [sub]);
4594
+ const subKeys = (e) => {
4595
+ const rows = [...e.currentTarget.querySelectorAll(".ui-dropdown__item")];
4596
+ const i = rows.indexOf(document.activeElement);
4597
+ if (e.key === "ArrowDown" || e.key === "ArrowUp") rows[(i + (e.key === "ArrowDown" ? 1 : rows.length - 1)) % rows.length]?.focus();
4598
+ else if (e.key === "Home" || e.key === "End") rows[e.key === "Home" ? 0 : rows.length - 1]?.focus();
4599
+ else if (e.key === "Enter" || e.key === " ") rows[i]?.click();
4600
+ else if (e.key === "ArrowLeft" || e.key === "Escape") close();
4601
+ else {
4602
+ if (e.key === "Tab" && !inPlace) themeRow.current?.focus();
4603
+ return;
4604
+ }
4605
+ e.preventDefault();
4606
+ e.stopPropagation();
4607
+ };
4608
+ const choices = /* @__PURE__ */ jsxs36(
4609
+ "div",
4610
+ {
4611
+ ref: list,
4612
+ role: "menu",
4613
+ "aria-label": "Theme",
4614
+ className: "ui-dropdown__sub",
4615
+ onKeyDown: subKeys,
4616
+ onClick: (e) => e.stopPropagation(),
4617
+ children: [
4618
+ inPlace && /* @__PURE__ */ jsxs36("div", { role: "menuitem", tabIndex: -1, className: "ui-dropdown__item", "aria-label": "Back from Theme", onClick: close, children: [
4619
+ glyph(icon7("chevronLeft"), "ui-dropdown__ic"),
4620
+ /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__label", children: "Theme" }) })
4621
+ ] }),
4622
+ THEMES.map(([value, label]) => /* @__PURE__ */ jsxs36(
4623
+ "div",
4624
+ {
4625
+ role: "menuitemradio",
4626
+ "aria-checked": theme.theme === value,
4627
+ tabIndex: -1,
4628
+ className: `ui-dropdown__item${theme.theme === value ? " is-selected" : ""}`,
4629
+ onClick: () => {
4630
+ theme.set(value);
4631
+ close();
4632
+ },
4633
+ children: [
4634
+ glyph(themeIcon2(value), "ui-dropdown__ic"),
4635
+ /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__label", children: label }) }),
4636
+ glyph(icon7("check"), "ui-dropdown__tick")
4637
+ ]
4638
+ },
4639
+ value
4640
+ ))
4641
+ ]
4642
+ }
4643
+ );
4644
+ return /* @__PURE__ */ jsx40("div", { ref: block, className: "ui-app__user", children: /* @__PURE__ */ jsx40(
4645
+ Dropdown,
4646
+ {
4647
+ variant: "menu",
4648
+ direction: "up",
4649
+ align: "start",
4650
+ chevron: true,
4651
+ open,
4652
+ ariaLabel: `Signed in as ${account.name}, ${account.email}`,
4653
+ triggerClass: "ui-app__user-trigger",
4654
+ panelClass: `ui-app__user-panel${sub && inPlace ? " is-sub" : ""}`,
4655
+ onOpenChange: (next) => {
4656
+ setOpen(next);
4657
+ if (!next) setSub(false);
4658
+ },
4659
+ triggerContent: /* @__PURE__ */ jsxs36(Fragment17, { children: [
4660
+ /* @__PURE__ */ jsx40("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx40(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
4661
+ /* @__PURE__ */ jsxs36("span", { className: "ui-app__who", children: [
4662
+ /* @__PURE__ */ jsx40("b", { children: account.name }),
4663
+ /* @__PURE__ */ jsx40("span", { children: account.email })
4664
+ ] })
4665
+ ] }),
4666
+ items: [...items, ...withTheme ? [{ label: "Theme", value: "theme" }, "---"] : [], { label: "Sign out", value: "sign-out", icon: "logout", danger: true }],
4667
+ row: (item, props) => item.value === "theme" ? /* @__PURE__ */ jsxs36(Fragment17, { children: [
4668
+ /* @__PURE__ */ jsxs36(
4669
+ "div",
4670
+ {
4671
+ ...props,
4672
+ ref: themeRow,
4673
+ "aria-haspopup": "menu",
4674
+ "aria-expanded": sub,
4675
+ onClick: () => setSub((open2) => !open2),
4676
+ onKeyDown: (e) => {
4677
+ if (e.key === "ArrowRight") {
4678
+ e.preventDefault();
4679
+ e.stopPropagation();
4680
+ setSub(true);
4681
+ }
4682
+ },
4683
+ children: [
4684
+ glyph(themeIcon2(theme.theme), "ui-dropdown__ic"),
4685
+ /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__label", children: "Theme" }) }),
4686
+ /* @__PURE__ */ jsx40("span", { className: "ui-dropdown__aside", children: theme.label }),
4687
+ glyph(icon7("chevronRight"), "ui-dropdown__more")
4688
+ ]
4689
+ }
4690
+ ),
4691
+ sub && (inPlace ? choices : createPortal7(/* @__PURE__ */ jsx40(
4692
+ "div",
4693
+ {
4694
+ ref: flyout,
4695
+ className: "ui-dropdown__panel ui-dropdown__panel--portal ui-dropdown__panel--sub is-open",
4696
+ children: choices
4697
+ }
4698
+ ), document.body))
4699
+ ] }) : props.href ? /* @__PURE__ */ jsx40("a", { ...props }) : /* @__PURE__ */ jsx40("div", { ...props }),
4700
+ onSelect
4701
+ }
4702
+ ) });
4703
+ }
4704
+
4564
4705
  // src/AppShell.tsx
4565
4706
  import { Fragment as Fragment18, jsx as jsx41, jsxs as jsxs37 } from "react/jsx-runtime";
4566
4707
  var path = (value) => value.split(/[?#]/)[0].replace(/\/+$/, "") || "/";
@@ -4575,12 +4716,13 @@ function AppShell({
4575
4716
  brandHref = "/",
4576
4717
  width = "centered",
4577
4718
  back,
4578
- crumbs,
4579
4719
  lede,
4580
4720
  actions,
4721
+ tools,
4581
4722
  bandControl,
4582
4723
  headControl,
4583
4724
  account,
4725
+ accountItems = [],
4584
4726
  onSignOut,
4585
4727
  searchLabel = "Search or run a command\u2026",
4586
4728
  defaultCollapsed = false,
@@ -4588,25 +4730,24 @@ function AppShell({
4588
4730
  renderLink
4589
4731
  }) {
4590
4732
  const uid = useId13();
4591
- const theme = useThemeChoice();
4592
- const [collapsed, setCollapsed] = useState17(defaultCollapsed);
4593
- const [search, setSearch] = useState17(false);
4594
- const [menu, setMenu] = useState17(false);
4595
- const menuButton = useRef22(null);
4596
- const menuBody = useRef22(null);
4733
+ const [collapsed, setCollapsed] = useState18(defaultCollapsed);
4734
+ const [search, setSearch] = useState18(false);
4735
+ const [menu, setMenu] = useState18(false);
4736
+ const menuButton = useRef23(null);
4737
+ const menuBody = useRef23(null);
4597
4738
  const firstRow = useMemo4(() => ({ get current() {
4598
4739
  return menuBody.current?.querySelector(".ui-nav__item") ?? null;
4599
4740
  } }), []);
4600
4741
  const current = path(pathname);
4601
4742
  const active = sections.filter((section) => current === path(section.href) || path(section.href) !== "/" && current.startsWith(`${path(section.href)}/`)).sort((a, b) => path(b.href).length - path(a.href).length)[0];
4602
- useEffect17(() => {
4743
+ useEffect18(() => {
4603
4744
  setCollapsed(railCollapsed() ?? defaultCollapsed);
4604
4745
  }, [defaultCollapsed]);
4605
- useEffect17(() => {
4746
+ useEffect18(() => {
4606
4747
  setMenu(false);
4607
4748
  setSearch(false);
4608
4749
  }, [pathname]);
4609
- useEffect17(() => {
4750
+ useEffect18(() => {
4610
4751
  if (!menu) return;
4611
4752
  const grown = () => {
4612
4753
  const button = menuButton.current;
@@ -4615,7 +4756,7 @@ function AppShell({
4615
4756
  window.addEventListener("resize", grown);
4616
4757
  return () => window.removeEventListener("resize", grown);
4617
4758
  }, [menu]);
4618
- useEffect17(() => {
4759
+ useEffect18(() => {
4619
4760
  if (layout === "rail") return;
4620
4761
  const hotkey = (event) => {
4621
4762
  if (!(event.metaKey || event.ctrlKey) || event.altKey || event.shiftKey || event.key.toLowerCase() !== "k") return;
@@ -4654,41 +4795,22 @@ function AppShell({
4654
4795
  brand ?? /* @__PURE__ */ jsx41("i", { "aria-hidden": "true", className: "ui-react-app__mark", dangerouslySetInnerHTML: { __html: prism(uid, 24) } }),
4655
4796
  /* @__PURE__ */ jsx41("span", { children: word })
4656
4797
  ] });
4657
- const accountBlock = (withTheme = false) => /* @__PURE__ */ jsx41("div", { className: "ui-app__user", children: /* @__PURE__ */ jsx41(
4658
- Dropdown,
4798
+ const ownItems = accountItems.map(({ label, icon: icon9, href }, i) => ({ label, icon: icon9, href, value: `item-${i}` }));
4799
+ const pick = (value) => {
4800
+ if (value === "sign-out") onSignOut();
4801
+ else accountItems[Number(String(value).slice(5))]?.onSelect?.();
4802
+ };
4803
+ const accountBlock = (withTheme = false, inPlace = false) => /* @__PURE__ */ jsx41(
4804
+ AccountMenu,
4659
4805
  {
4660
- variant: "menu",
4661
- direction: "up",
4662
- align: "start",
4663
- chevron: true,
4664
- ariaLabel: `Signed in as ${account.name}, ${account.email}`,
4665
- triggerClass: "ui-app__user-trigger",
4666
- panelClass: "ui-app__user-panel",
4667
- triggerContent: /* @__PURE__ */ jsxs37(Fragment18, { children: [
4668
- /* @__PURE__ */ jsx41("span", { className: "ui-app__av", "aria-hidden": "true", children: /* @__PURE__ */ jsx41(Avatar, { personKey: account.email || account.name, name: account.name, size: 32 }) }),
4669
- /* @__PURE__ */ jsxs37("span", { className: "ui-app__who", children: [
4670
- /* @__PURE__ */ jsx41("b", { children: account.name }),
4671
- /* @__PURE__ */ jsx41("span", { children: account.email })
4672
- ] })
4673
- ] }),
4674
- items: [...withTheme ? [{ label: `${theme.label} theme`, value: "theme" }] : [], { label: "Sign out", value: "sign-out", icon: "logout", danger: true }],
4675
- row: (item, props) => item.value === "theme" ? /* @__PURE__ */ jsxs37(
4676
- "div",
4677
- {
4678
- ...props,
4679
- "aria-label": `${item.label}. Switch to ${theme.next}.`,
4680
- onClick: theme.toggle,
4681
- children: [
4682
- /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__ic", "aria-hidden": "true", dangerouslySetInnerHTML: { __html: themeIcon2(theme.theme) } }),
4683
- /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__main", children: /* @__PURE__ */ jsx41("span", { className: "ui-dropdown__label", children: item.label }) })
4684
- ]
4685
- }
4686
- ) : /* @__PURE__ */ jsx41("div", { ...props }),
4687
- onSelect: (value) => {
4688
- if (value === "sign-out") onSignOut();
4689
- }
4806
+ account,
4807
+ items: ownItems,
4808
+ onSelect: pick,
4809
+ withTheme,
4810
+ inPlace,
4811
+ away: menuButton
4690
4812
  }
4691
- ) });
4813
+ );
4692
4814
  const headSlot = layout === "topbar" && headControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__head-control", children: headControl });
4693
4815
  const foldControl = /* @__PURE__ */ jsxs37("div", { className: "ui-app__fold-row", children: [
4694
4816
  headSlot,
@@ -4712,8 +4834,11 @@ function AppShell({
4712
4834
  )
4713
4835
  ] });
4714
4836
  const page = /* @__PURE__ */ jsxs37("main", { className: `ui-app__main${width === "wide" ? " ui-app__main--wide" : ""}`, children: [
4715
- back ? /* @__PURE__ */ jsx41(BackLink, { ...back }) : crumbs?.length ? /* @__PURE__ */ jsx41(Breadcrumbs, { items: crumbs }) : null,
4716
- /* @__PURE__ */ jsx41("h1", { children: title }),
4837
+ back && /* @__PURE__ */ jsx41(BackLink, { ...back }),
4838
+ tools ? /* @__PURE__ */ jsxs37("div", { className: "ui-app__title-row", children: [
4839
+ /* @__PURE__ */ jsx41("h1", { children: title }),
4840
+ /* @__PURE__ */ jsx41("div", { className: "ui-app__tools", children: tools })
4841
+ ] }) : /* @__PURE__ */ jsx41("h1", { children: title }),
4717
4842
  lede && /* @__PURE__ */ jsx41("p", { className: "ui-app__sub", children: lede }),
4718
4843
  actions && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__actions", children: actions }),
4719
4844
  /* @__PURE__ */ jsx41("div", { className: "ui-app__body", children })
@@ -4812,8 +4937,8 @@ function AppShell({
4812
4937
  /* @__PURE__ */ jsx41("b", { children: account.name }),
4813
4938
  /* @__PURE__ */ jsx41("span", { children: account.email })
4814
4939
  ] }),
4815
- items: [{ label: "Sign out", icon: "logout", danger: true }],
4816
- onSelect: onSignOut
4940
+ items: [...ownItems, { label: "Sign out", value: "sign-out", icon: "logout", danger: true }],
4941
+ onSelect: pick
4817
4942
  }
4818
4943
  ) })
4819
4944
  ] })
@@ -4830,7 +4955,7 @@ function AppShell({
4830
4955
  size: "sm",
4831
4956
  initialFocusRef: firstRow,
4832
4957
  headerActions: headSlot,
4833
- footer: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: accountBlock(true) }),
4958
+ footer: /* @__PURE__ */ jsx41("div", { className: "ui-app__drawer", children: accountBlock(true, true) }),
4834
4959
  children: /* @__PURE__ */ jsxs37("div", { className: "ui-react-app__menu", ref: menuBody, children: [
4835
4960
  bandControl && /* @__PURE__ */ jsx41("div", { className: "ui-react-app__control", children: bandControl }),
4836
4961
  sidebar("Menu sections")
@@ -4842,9 +4967,9 @@ function AppShell({
4842
4967
  }
4843
4968
 
4844
4969
  // src/AuthShell.tsx
4845
- import { forwardRef as forwardRef11 } from "react";
4970
+ import { forwardRef as forwardRef10 } from "react";
4846
4971
  import { jsx as jsx42, jsxs as jsxs38 } from "react/jsx-runtime";
4847
- var AuthShell = forwardRef11(function AuthShell2({ brand, children, className, ...rest }, ref) {
4972
+ var AuthShell = forwardRef10(function AuthShell2({ brand, children, className, ...rest }, ref) {
4848
4973
  return /* @__PURE__ */ jsx42("div", { ...rest, ref, className: ["ui-auth", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs38("div", { className: "ui-auth__card", children: [
4849
4974
  /* @__PURE__ */ jsx42("div", { className: "ui-auth__brand", children: brand }),
4850
4975
  children
@@ -4853,7 +4978,7 @@ var AuthShell = forwardRef11(function AuthShell2({ brand, children, className, .
4853
4978
 
4854
4979
  // src/Footer.tsx
4855
4980
  import { useId as useId14 } from "react";
4856
- import { prism as prism2, safeUrl as safeUrl4 } from "@apliteni/apliteni-ui";
4981
+ import { prism as prism2, safeUrl as safeUrl3 } from "@apliteni/apliteni-ui";
4857
4982
  import { jsx as jsx43, jsxs as jsxs39 } from "react/jsx-runtime";
4858
4983
  var SOCIAL_GLYPHS = {
4859
4984
  github: '<path d="M12 2a10 10 0 0 0-3.16 19.49c.5.09.68-.22.68-.48v-1.7c-2.78.6-3.37-1.34-3.37-1.34-.45-1.16-1.11-1.47-1.11-1.47-.9-.62.07-.6.07-.6 1 .07 1.53 1.03 1.53 1.03.9 1.53 2.34 1.09 2.91.83.09-.65.35-1.09.63-1.34-2.22-.25-4.55-1.11-4.55-4.94 0-1.09.39-1.98 1.03-2.68-.1-.25-.45-1.27.1-2.64 0 0 .84-.27 2.75 1.02a9.5 9.5 0 0 1 5 0c1.91-1.29 2.75-1.02 2.75-1.02.55 1.37.2 2.39.1 2.64.64.7 1.03 1.59 1.03 2.68 0 3.84-2.34 4.68-4.57 4.93.36.31.68.92.68 1.85v2.74c0 .27.18.58.69.48A10 10 0 0 0 12 2z"/>',
@@ -4865,7 +4990,7 @@ var escapeText = (t) => t.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/
4865
4990
  function Legal({ legal, legalLinks, switcher }) {
4866
4991
  return /* @__PURE__ */ jsxs39("div", { className: "ui-footer__bar", children: [
4867
4992
  /* @__PURE__ */ jsx43("span", { className: "ui-footer__legal", children: legal }),
4868
- legalLinks && legalLinks.length > 0 && /* @__PURE__ */ jsx43("nav", { className: "ui-footer__legal-links", "aria-label": "Legal", children: legalLinks.map(({ label, href: to }) => /* @__PURE__ */ jsx43("a", { href: safeUrl4(to ?? "#"), children: label }, label)) }),
4993
+ legalLinks && legalLinks.length > 0 && /* @__PURE__ */ jsx43("nav", { className: "ui-footer__legal-links", "aria-label": "Legal", children: legalLinks.map(({ label, href: to }) => /* @__PURE__ */ jsx43("a", { href: safeUrl3(to ?? "#"), children: label }, label)) }),
4869
4994
  switcher ? /* @__PURE__ */ jsx43("div", { className: "ui-footer__switcher", children: switcher }) : null
4870
4995
  ] });
4871
4996
  }
@@ -4895,7 +5020,7 @@ function Footer({
4895
5020
  "a",
4896
5021
  {
4897
5022
  className: "brand",
4898
- href: safeUrl4(brandHref),
5023
+ href: safeUrl3(brandHref),
4899
5024
  "aria-label": `Apliteni ${word}`,
4900
5025
  dangerouslySetInnerHTML: { __html: `${mark}<span>${escapeText(word)}</span>` }
4901
5026
  }
@@ -4909,12 +5034,12 @@ function Footer({
4909
5034
  const markup = SOCIAL_GLYPHS[icon9];
4910
5035
  const fill = icon9 === "mail" ? "none" : "currentColor";
4911
5036
  const viewBox = icon9 === "linkedin" ? "0 0 448 512" : "0 0 24 24";
4912
- return /* @__PURE__ */ jsx43("a", { className: "ui-footer__social", href: safeUrl4(to ?? "#"), "aria-label": label, children: /* @__PURE__ */ jsx43("svg", { viewBox, fill, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: markup } }) }, label);
5037
+ return /* @__PURE__ */ jsx43("a", { className: "ui-footer__social", href: safeUrl3(to ?? "#"), "aria-label": label, children: /* @__PURE__ */ jsx43("svg", { viewBox, fill, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: markup } }) }, label);
4913
5038
  }) })
4914
5039
  ] }),
4915
5040
  (links || columns.length > 0) && /* @__PURE__ */ jsx43("nav", { className: "ui-footer__nav", "aria-label": "Footer", children: links ?? columns.map(({ title, links: columnLinks }, i) => /* @__PURE__ */ jsxs39("div", { className: "ui-footer__col", children: [
4916
5041
  title && /* @__PURE__ */ jsx43("h2", { className: "ui-footer__col-title", children: title }),
4917
- /* @__PURE__ */ jsx43("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx43("li", { children: /* @__PURE__ */ jsx43("a", { href: safeUrl4(to ?? "#"), target, rel: target ? "noreferrer" : void 0, children: label }) }, label)) })
5042
+ /* @__PURE__ */ jsx43("ul", { className: "ui-footer__links", children: columnLinks.map(({ label, href: to, target }) => /* @__PURE__ */ jsx43("li", { children: /* @__PURE__ */ jsx43("a", { href: safeUrl3(to ?? "#"), target, rel: target ? "noreferrer" : void 0, children: label }) }, label)) })
4918
5043
  ] }, title ?? i)) })
4919
5044
  ] }),
4920
5045
  bar
@@ -4922,9 +5047,9 @@ function Footer({
4922
5047
  }
4923
5048
 
4924
5049
  // src/Success.tsx
4925
- import { forwardRef as forwardRef12, useEffect as useEffect18, useRef as useRef23, useState as useState18 } from "react";
5050
+ import { forwardRef as forwardRef11, useEffect as useEffect19, useRef as useRef24, useState as useState19 } from "react";
4926
5051
  import { jsx as jsx44, jsxs as jsxs40 } from "react/jsx-runtime";
4927
- var SuccessCheck = forwardRef12(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
5052
+ var SuccessCheck = forwardRef11(function SuccessCheck2({ variant = "line", className, ...rest }, ref) {
4928
5053
  const circled = variant === "circled";
4929
5054
  return /* @__PURE__ */ jsxs40(
4930
5055
  "svg",
@@ -4944,7 +5069,7 @@ var SuccessCheck = forwardRef12(function SuccessCheck2({ variant = "line", class
4944
5069
  }
4945
5070
  );
4946
5071
  });
4947
- var SuccessPanel = forwardRef12(function SuccessPanel2({ title = "Done", sub, check = "line", className, ...rest }, ref) {
5072
+ var SuccessPanel = forwardRef11(function SuccessPanel2({ title = "Done", sub, check = "line", className, ...rest }, ref) {
4948
5073
  const circled = check === "circled";
4949
5074
  return /* @__PURE__ */ jsxs40("div", { ...rest, ref, className: ["ui-success", className].filter(Boolean).join(" "), children: [
4950
5075
  /* @__PURE__ */ jsx44("div", { className: ["ui-success__check", circled && "ui-success__check--circled"].filter(Boolean).join(" "), children: /* @__PURE__ */ jsx44(SuccessCheck, { variant: circled ? "circled" : "line" }) }),
@@ -4969,12 +5094,12 @@ var pieces = [
4969
5094
  [80, 0.36, -20, "c", 1.05]
4970
5095
  ];
4971
5096
  function Countdown({ seconds, label = "Redirecting", onDone }) {
4972
- const [remaining, setRemaining] = useState18(seconds);
4973
- const callback = useRef23(onDone);
4974
- useEffect18(() => {
5097
+ const [remaining, setRemaining] = useState19(seconds);
5098
+ const callback = useRef24(onDone);
5099
+ useEffect19(() => {
4975
5100
  callback.current = onDone;
4976
5101
  }, [onDone]);
4977
- useEffect18(() => {
5102
+ useEffect19(() => {
4978
5103
  let count = seconds;
4979
5104
  const timer = setInterval(() => {
4980
5105
  count -= 1;
@@ -4996,7 +5121,7 @@ function Countdown({ seconds, label = "Redirecting", onDone }) {
4996
5121
  ] })
4997
5122
  ] });
4998
5123
  }
4999
- var Success = forwardRef12(function Success2({
5124
+ var Success = forwardRef11(function Success2({
5000
5125
  layout = "hero",
5001
5126
  level,
5002
5127
  check = "line",
@@ -5047,12 +5172,12 @@ var Success = forwardRef12(function Success2({
5047
5172
  // src/Chart.tsx
5048
5173
  import {
5049
5174
  useCallback as useCallback7,
5050
- useEffect as useEffect19,
5175
+ useEffect as useEffect20,
5051
5176
  useId as useId15,
5052
5177
  useLayoutEffect as useLayoutEffect5,
5053
5178
  useMemo as useMemo5,
5054
- useRef as useRef24,
5055
- useState as useState19
5179
+ useRef as useRef25,
5180
+ useState as useState20
5056
5181
  } from "react";
5057
5182
  import { CHART_FLOOR, bridgeWalk, chartScale, pointTarget } from "@apliteni/apliteni-ui";
5058
5183
 
@@ -5536,8 +5661,8 @@ function barPath(m) {
5536
5661
  return `M${px2(x)} ${px2(roundBottom ? bottom - r : bottom)}V${px2(roundTop ? top + r : top)}` + (roundTop ? `${arc2(r, -r, 1)}h${px2(w - r * 2)}${arc2(r, r, 1)}` : `h${px2(w)}`) + `V${px2(roundBottom ? bottom - r : bottom)}` + (roundBottom ? `${arc2(-r, r, 1)}h${px2(-(w - r * 2))}${arc2(-r, -r, 1)}` : `h${px2(-w)}`) + "z";
5537
5662
  }
5538
5663
  function useTapFloor() {
5539
- const [floor, setFloor] = useState19(TARGET);
5540
- useEffect19(() => {
5664
+ const [floor, setFloor] = useState20(TARGET);
5665
+ useEffect20(() => {
5541
5666
  const query = typeof window === "undefined" ? null : window.matchMedia?.(`(max-width: ${PHONE_MAX2}px) and (pointer: coarse)`);
5542
5667
  if (!query) return;
5543
5668
  const read = () => setFloor(query.matches ? TAP_FLOOR : TARGET);
@@ -5772,25 +5897,25 @@ function Chart(props) {
5772
5897
  const spark = variant === "spark";
5773
5898
  const plotHeight = height ?? HEIGHT[variant];
5774
5899
  const showTable = table ?? !spark;
5775
- const [view, setView] = useState19("chart");
5900
+ const [view, setView] = useState20("chart");
5776
5901
  const asTable = showTable && view === "table";
5777
5902
  const uid = useId15().replace(/[^\w-]/g, "");
5778
- const frameEl = useRef24(null);
5779
- const scroller = useRef24(null);
5780
- const plot = useRef24(null);
5781
- const tipEl = useRef24(null);
5782
- const svgEl = useRef24(null);
5783
- const ignoreMouseUntil = useRef24(0);
5784
- const touchMoved = useRef24(false);
5785
- const dismissed = useRef24(null);
5786
- const opening = useRef24(false);
5787
- const pointerFocus = useRef24(false);
5903
+ const frameEl = useRef25(null);
5904
+ const scroller = useRef25(null);
5905
+ const plot = useRef25(null);
5906
+ const tipEl = useRef25(null);
5907
+ const svgEl = useRef25(null);
5908
+ const ignoreMouseUntil = useRef25(0);
5909
+ const touchMoved = useRef25(false);
5910
+ const dismissed = useRef25(null);
5911
+ const opening = useRef25(false);
5912
+ const pointerFocus = useRef25(false);
5788
5913
  const floor = useTapFloor();
5789
- const [width, setWidth] = useState19(0);
5790
- const [openId, setOpenId] = useState19(null);
5791
- const [rawCursor, setCursor] = useState19(0);
5792
- const [said, setSaid] = useState19("");
5793
- const [ownPick, setOwnPick] = useState19(null);
5914
+ const [width, setWidth] = useState20(0);
5915
+ const [openId, setOpenId] = useState20(null);
5916
+ const [rawCursor, setCursor] = useState20(0);
5917
+ const [said, setSaid] = useState20("");
5918
+ const [ownPick, setOwnPick] = useState20(null);
5794
5919
  const pick = selected === void 0 ? ownPick : selected;
5795
5920
  const steps = props.variant === "bridge" ? props.steps : void 0;
5796
5921
  const bridgeTones = props.variant === "bridge" ? props.tones : void 0;
@@ -5923,7 +6048,7 @@ function Chart(props) {
5923
6048
  const fades = useMemo5(() => new Map(marks.filter((m) => m.kind === "bar").map((m) => fadeOf(uid, m, variant === "bridge")).filter((f) => f !== null).map((f) => [f.id, f])), [marks, uid, variant]);
5924
6049
  const lead = useCallback7((column) => marks.find((m) => m.column === column), [marks]);
5925
6050
  const open = openId ? byId.get(openId) : void 0;
5926
- useEffect19(() => {
6051
+ useEffect20(() => {
5927
6052
  const el = plot.current;
5928
6053
  if (!el) return;
5929
6054
  const read = () => setWidth(el.clientWidth);
@@ -5943,7 +6068,7 @@ function Chart(props) {
5943
6068
  const anchor = [...svgEl.current.querySelectorAll("[data-anchor]")].find((el) => el.getAttribute("data-anchor") === openId);
5944
6069
  if (anchor) placeTip(frameEl.current, anchor, tipEl.current, frameEl.current);
5945
6070
  }, [openId, plotWidth, plotHeight]);
5946
- useEffect19(() => {
6071
+ useEffect20(() => {
5947
6072
  if (!openId) return;
5948
6073
  const doc = frameEl.current?.ownerDocument;
5949
6074
  const view2 = doc?.defaultView;
@@ -6359,10 +6484,10 @@ function Chart(props) {
6359
6484
  }
6360
6485
 
6361
6486
  // src/AccentPicker.tsx
6362
- import { forwardRef as forwardRef13 } from "react";
6487
+ import { forwardRef as forwardRef12 } from "react";
6363
6488
  import { ACCENTS, accentSwatchStyle } from "@apliteni/apliteni-ui";
6364
6489
  import { jsx as jsx47 } from "react/jsx-runtime";
6365
- var AccentPicker = forwardRef13(function AccentPicker2({
6490
+ var AccentPicker = forwardRef12(function AccentPicker2({
6366
6491
  value,
6367
6492
  onChange,
6368
6493
  options = ACCENTS,
@@ -6401,7 +6526,7 @@ var AccentPicker = forwardRef13(function AccentPicker2({
6401
6526
 
6402
6527
  // src/TopBar.tsx
6403
6528
  import { Fragment as Fragment21 } from "react";
6404
- import { prism as prism3, safeUrl as safeUrl5, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
6529
+ import { prism as prism3, safeUrl as safeUrl4, icon as icon8, ACCOUNT_NAV } from "@apliteni/apliteni-ui";
6405
6530
  import { Fragment as Fragment22, jsx as jsx48, jsxs as jsxs43 } from "react/jsx-runtime";
6406
6531
  function TopBar({
6407
6532
  brand,
@@ -6415,7 +6540,7 @@ function TopBar({
6415
6540
  ...rest
6416
6541
  }) {
6417
6542
  return /* @__PURE__ */ jsx48("header", { ...rest, className: ["topbar", className].filter(Boolean).join(" "), children: /* @__PURE__ */ jsxs43("div", { className: "topbar__in", children: [
6418
- brand ?? /* @__PURE__ */ jsxs43("a", { className: "brand", href: safeUrl5(brandHref), "aria-label": `Apliteni ${word}`, children: [
6543
+ brand ?? /* @__PURE__ */ jsxs43("a", { className: "brand", href: safeUrl4(brandHref), "aria-label": `Apliteni ${word}`, children: [
6419
6544
  /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: prism3("tb-mark", 22) } }),
6420
6545
  /* @__PURE__ */ jsx48("span", { children: word })
6421
6546
  ] }),
@@ -6431,7 +6556,7 @@ function ViewSwitch({ items, active, label = "View", renderLink }) {
6431
6556
  const current = item.id === active;
6432
6557
  const linkProps = {
6433
6558
  className: current ? "cur" : void 0,
6434
- href: safeUrl5(item.href || `#${item.id}`),
6559
+ href: safeUrl4(item.href || `#${item.id}`),
6435
6560
  target: item.target,
6436
6561
  "aria-current": current ? "page" : void 0,
6437
6562
  children: item.label
@@ -6484,7 +6609,7 @@ var ACCOUNT_ITEMS = ACCOUNT_NAV.map((item) => ({
6484
6609
  value: item.id,
6485
6610
  href: `#${item.id}`
6486
6611
  }));
6487
- function AccountMenu({
6612
+ function AccountMenu2({
6488
6613
  name,
6489
6614
  email,
6490
6615
  items = ACCOUNT_ITEMS,
@@ -6518,7 +6643,7 @@ function AccountMenu({
6518
6643
  "a",
6519
6644
  {
6520
6645
  ...props,
6521
- href: item.disabled ? void 0 : item.href ? safeUrl5(item.href) : item.value === "sign-out" && onSignOut ? void 0 : safeUrl5(item.value === "sign-out" ? "#logout" : `#${item.value}`),
6646
+ href: item.disabled ? void 0 : item.href ? safeUrl4(item.href) : item.value === "sign-out" && onSignOut ? void 0 : safeUrl4(item.value === "sign-out" ? "#logout" : `#${item.value}`),
6522
6647
  className: [props.className.replace(/\bui-dropdown__item\b/, "").trim(), !item.disabled && item.value === current && "cur", item.value === "sign-out" && "aout"].filter(Boolean).join(" "),
6523
6648
  children: [
6524
6649
  item.icon && /* @__PURE__ */ jsx48("span", { "aria-hidden": "true", dangerouslySetInnerHTML: { __html: icon8(item.icon) } }),
@@ -6539,14 +6664,13 @@ var PAGE_SIZES = KIT_PAGE_SIZES;
6539
6664
  var DEFAULT_PAGE_SIZE3 = KIT_DEFAULT_PAGE_SIZE;
6540
6665
  export {
6541
6666
  AccentPicker,
6542
- AccountMenu,
6667
+ AccountMenu2 as AccountMenu,
6543
6668
  AccountWindow,
6544
6669
  AppShell,
6545
6670
  AuthShell,
6546
6671
  Avatar,
6547
6672
  BackLink,
6548
6673
  Badge,
6549
- Breadcrumbs,
6550
6674
  BusyRegion,
6551
6675
  Button,
6552
6676
  Callout,
@@ -184,6 +184,12 @@ export const iconOnlyAllowed = {
184
184
  // and one button opens the full navigation in a drawer. The three-bar glyph is the
185
185
  // reader's own mark for this action.
186
186
  menu: 'open the navigation drawer',
187
+ // A document viewer's page and zoom steps, chosen by Artur on #736: a slim row of
188
+ // steppers either side of the readout they move, so the readout names the action.
189
+ chevronLeft: 'step to the previous page',
190
+ chevronRight: 'step to the next page',
191
+ minus: 'zoom out',
192
+ plus: 'zoom in',
187
193
  // A chart card's view switch, decided by Artur on #742: the bars and the grid
188
194
  // are the two views themselves, side by side in one toolbar at the card's corner.
189
195
  chart: 'show the values as a chart',
@@ -209,6 +215,10 @@ export const iconOnlyNames = {
209
215
  // something else.
210
216
  download: ['export', 'download'],
211
217
  menu: ['menu'],
218
+ chevronLeft: ['previous'],
219
+ chevronRight: ['next'],
220
+ minus: ['zoom'],
221
+ plus: ['zoom'],
212
222
  chart: ['chart'],
213
223
  table: ['table'],
214
224
  };
@@ -216,6 +216,19 @@ function ddScrollBox(dd, panel) {
216
216
  return { el: el || els[0], els, top, bottom, height };
217
217
  }
218
218
 
219
+ /* Does a body round the panel hide part of its width? Only `hidden` and `clip` count:
220
+ * a body that scrolls across still shows the rest. */
221
+ function ddClipsAcross(box, panel) {
222
+ const view = ddViewOf(panel);
223
+ const p = panel.getBoundingClientRect();
224
+ return box.els.some((at) => {
225
+ const overflow = view.getComputedStyle(at).overflowX;
226
+ if (overflow !== 'hidden' && overflow !== 'clip') return false;
227
+ const left = at.getBoundingClientRect().left + at.clientLeft;
228
+ return p.left < left - 0.5 || p.right > left + at.clientWidth + 0.5;
229
+ });
230
+ }
231
+
219
232
  /* The top of what has to stay in view over the panel: the field's label when the
220
233
  * trigger has one above it, so the reader still sees what the list is for. */
221
234
  function ddAnchorTop(dd, t) {
@@ -240,12 +253,15 @@ function ddContentHeight(panel) {
240
253
  * the 8px edge where the body cannot. Where even then the body cannot hold the floor
241
254
  * (or the whole list, when that is shorter), the panel is lifted out of the body.
242
255
  * Measured from the heights alone, so the answer is the same however far the body is
243
- * scrolled. `null` with no scrolling body.
256
+ * scrolled. A body that clips across and is narrower than the panel lifts it too: no
257
+ * scroll shows what it cuts off, as the shell's rail cut the account menu (#736).
258
+ * `null` with no scrolling body.
244
259
  */
245
260
  function ddBodyFit(dd, panel) {
246
261
  const trigger = dd.querySelector('[data-dropdown-trigger]');
247
262
  const box = ddScrollBox(dd, panel);
248
263
  if (!box || !trigger) return null;
264
+ if (ddClipsAcross(box, panel)) return { box, lift: true };
249
265
  const t = trigger.getBoundingClientRect();
250
266
  const edge = ddEdge(panel);
251
267
  const gap = ddGap(panel);
@@ -1,8 +1,8 @@
1
1
  /* ============================================================================
2
2
  * Back link — .ui-back
3
3
  * The way up from a page to the page it sits under. It stands above the page
4
- * title, in the slot a breadcrumb trail would take, and it is quiet at rest: it
5
- * is on every page below a list, and it is never what the page is for.
4
+ * title, and it is quiet at rest: it is on every page below a list, and it
5
+ * is never what the page is for.
6
6
  * why: docs/components.md#the-back-link
7
7
  * ========================================================================== */
8
8
 
@@ -61,6 +61,49 @@
61
61
  border-color: color-mix(in srgb, var(--green) 22%, transparent);
62
62
  }
63
63
 
64
+ /* A viewer: a document shown inside a card, set apart from the controls that act on it.
65
+ The card's .ui-toolbar becomes a slim row between two hairlines, and its scroll box
66
+ becomes a recessed stage that runs to the card's sides and bottom. The document
67
+ itself is a .ui-card__page on that stage: a sheet one level up, so it reads as the
68
+ object and the row above it as the tools. Decided on #736.
69
+ why: docs/foundations.md#elevation */
70
+ .ui-card__viewer {
71
+ margin: var(--space-4) calc(-1 * var(--space-6)) calc(-1 * var(--space-6));
72
+ border-top: 1px solid var(--card-edge);
73
+ }
74
+ .ui-card__viewer > .ui-toolbar {
75
+ /* One row on a phone too: the page steps hold the start and the zoom the end. */
76
+ flex-wrap: nowrap;
77
+ align-items: center;
78
+ padding: var(--space-2) var(--space-4);
79
+ border-bottom: 1px solid var(--card-edge);
80
+ }
81
+ .ui-card__viewer > .ui-table-scroll {
82
+ /* The stage is the lowest rung, so an inline code chip on it takes the card. */
83
+ --table-bg: var(--surface-2);
84
+ --table-code-bg: var(--surface);
85
+ max-height: none;
86
+ /* With the scroll box's own 4px band at the sides and bottom, an even 24px inset. */
87
+ padding: var(--space-6) var(--space-5) var(--space-5);
88
+ border-radius: 0 0 calc(var(--radius-xl) - 1px) calc(var(--radius-xl) - 1px);
89
+ }
90
+ /* A4 at the least, so a short document still reads as a page and not as a panel.
91
+ The page carries the light palette in both themes (src/tokens/tokens.css), so its
92
+ own ink is set here: the inherited colour is the theme's. */
93
+ .ui-card__page {
94
+ box-sizing: border-box;
95
+ aspect-ratio: 210 / 297;
96
+ padding: var(--space-6) var(--space-5);
97
+ color: var(--text);
98
+ background: var(--surface);
99
+ border: 1px solid var(--card-edge);
100
+ box-shadow: var(--elev-rest);
101
+ border-radius: var(--radius-xs);
102
+ /* A table on the page takes the page's ground, not the stage's, and hands a chip the page. */
103
+ --table-bg: var(--surface);
104
+ --table-code-bg: var(--bg);
105
+ }
106
+
64
107
  /* Interactive card (link / button semantics) */
65
108
  .ui-card--interactive {
66
109
  cursor: pointer;
@@ -331,11 +331,13 @@
331
331
  /* Hover is a fill and an outline means focus, so a hovered row draws no edge. A row that is
332
332
  hovered AND focused draws the ring over the fill.
333
333
  why: docs/foundations.md#elevation */
334
+ .ui-dropdown__item[aria-expanded="true"],
334
335
  .ui-dropdown__item:hover { background: var(--surface); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ }
335
336
  /* Light only: the panel is --bg-elevated, which --surface matches exactly there, so the
336
337
  hover fill above changed nothing. --surface-3 is the quiet fill the drawer's close mark
337
338
  takes on hover, one step under the --surface-2 that .is-active takes below.
338
339
  why: docs/foundations.md#elevation */
340
+ :where(:root[data-theme="light"]) .ui-dropdown__item[aria-expanded="true"],
339
341
  :where(:root[data-theme="light"]) .ui-dropdown__item:hover { background: var(--surface-3); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ }
340
342
  @media (forced-colors: active) {
341
343
  .ui-dropdown__item:hover { border: 1px solid Highlight; padding: 8px 11px; }
@@ -356,6 +358,18 @@
356
358
  .ui-dropdown__item.is-selected .ui-dropdown__tick { display: inline-flex; } /* motion: still — a mark inside a row whose highlight already transitions; picking it closes the panel, which fades out over --dur-med */
357
359
  .ui-dropdown__item.is-selected .ui-dropdown__label { color: var(--text); }
358
360
 
361
+ /* A row that opens a submenu (#736): the current value at the trailing edge in body ink,
362
+ then a chevron. The submenu is a second panel beside this one, or, in a panel marked
363
+ is-sub, the only rows showing.
364
+ why: docs/components.md#a-submenu-row */
365
+ .ui-dropdown__aside { margin-left: auto; flex: none; font-size: var(--text-xs); color: var(--text); }
366
+ .ui-dropdown__more { margin-left: auto; display: inline-flex; flex: none; /* muted-ink: glyph — submenu chevron */ color: var(--muted); }
367
+ .ui-dropdown__aside + .ui-dropdown__more { margin-left: 0; }
368
+ .ui-dropdown__more svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 2.25; }
369
+ .ui-dropdown__panel.is-sub > :not(.ui-dropdown__sub) { display: none; } /* The rows swap in one step, inside a panel that is already open. */
370
+ /* Three short choices: the width of a choice and its tick, not the 240px a menu of labels needs. */
371
+ .ui-dropdown__panel--sub { min-width: 180px; }
372
+
359
373
  /* When a row has both a badge and a tick, keep the badge from eating the margin */
360
374
  .ui-dropdown__badge + .ui-dropdown__tick { margin-left: 8px; }
361
375
 
@@ -401,9 +401,6 @@
401
401
  why: docs/components.md#the-page-shell */
402
402
  .ui-app__bar .toggle, .topbar__in .toggle { flex: none; }
403
403
  .ui-app__user--bar .ui-app__av { margin-inline-start: 0; }
404
- /* Crumb, then the title block. At --space-2 the crumb sat 8px off the h1 and
405
- the h1 8px off its subtitle, so all three ranks read as one. */
406
- .ui-app__main .ui-nav--crumbs { margin-bottom: var(--space-5); }
407
404
  .ui-app__main h1 {
408
405
  color: var(--strong);
409
406
  /* rank: page-title */
@@ -416,6 +413,13 @@
416
413
  .ui-app__sub { color: var(--text); font-size: calc(var(--text-base) + 0.5px); line-height: 1.6; max-width: var(--prose-body); margin-bottom: var(--space-8); }
417
414
  /* A page may open on its title alone; then the title carries the head's step. */
418
415
  .ui-app__main > h1:not(:has(+ .ui-app__sub)) { margin-bottom: var(--space-8); }
416
+ /* Page tools stand at the end of the title row, and the lede goes under the whole row.
417
+ The row takes the h1's steps: 8px to a lede, 32px when the page opens on its title alone.
418
+ 16px keeps the tools off a long title, and the tools stand 12px apart. */
419
+ .ui-app__title-row { display: flex; align-items: center; gap: var(--space-4); margin-bottom: 8px; }
420
+ .ui-app__title-row:not(:has(+ .ui-app__sub)) { margin-bottom: var(--space-8); }
421
+ .ui-app__main .ui-app__title-row > h1 { flex: 1 1 auto; min-width: 0; margin-bottom: 0; }
422
+ .ui-app__tools { display: flex; flex: none; align-items: center; gap: var(--space-3); }
419
423
  .ui-app__body { display: flex; flex-direction: column; gap: var(--space-5); }
420
424
  /* A flex child's min-width is its content by default, so one wide block — a
421
425
  ledger, a code sample — pushes the whole page sideways instead of scrolling
@@ -1,5 +1,5 @@
1
1
  /* ============================================================================
2
- * Navigation — sidebar rail, horizontal tabs, breadcrumbs. One token-driven
2
+ * Navigation — sidebar rail and horizontal tabs. One token-driven
3
3
  * class family (ui-nav__…) so every variant re-themes across accents +
4
4
  * light/dark. appShell() draws its rail from sidebarNav(), so this file is the
5
5
  * page shell's rail as well as a standalone component. States are pure tokens.
@@ -394,39 +394,6 @@
394
394
  .ui-nav__tab.is-disabled { /* muted-ink: state — unavailable control */ color: var(--disabled-ink); cursor: default; }
395
395
  .ui-nav__tab .ui-nav__badge { height: 18px; }
396
396
 
397
- /* -- Breadcrumbs --------------------------------------------------------- */
398
- /* The chip hangs out by its own padding so the first LABEL lands on the column's edge,
399
- level with the page title under it. */
400
- .ui-nav__crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin-inline-start: -6px; }
401
- .ui-nav__crumb-item { display: inline-flex; align-items: center; }
402
- .ui-nav__crumb-item + .ui-nav__crumb-item::before {
403
- content: "";
404
- width: 6px; height: 6px;
405
- margin: 0 8px;
406
- border-right: 1.4px solid var(--muted);
407
- border-bottom: 1.4px solid var(--muted);
408
- transform: rotate(-45deg);
409
- opacity: 0.7;
410
- }
411
- .ui-nav__crumb {
412
- display: inline-flex;
413
- align-items: center;
414
- gap: 6px;
415
- padding: 3px 6px;
416
- border-radius: 7px;
417
- text-decoration: none;
418
- font-size: var(--text-sm);
419
- transition: color var(--dur-fast) var(--ease), background var(--dur-fast) var(--ease);
420
- }
421
- /* Carries the block's class as well as its own, for the reason .ui-nav__item
422
- does above: a linked crumb is an <a>, and a host stylesheet's `a:link` is
423
- (0,1,1), which outranks a bare (0,1,0) class. */
424
- .ui-nav .ui-nav__crumb { color: var(--text); }
425
- a.ui-nav__crumb:hover { color: var(--strong); background: var(--surface); /* code-bg: inherit — control paint; the containing surface is the ground, for a chip and for a band alike. */ }
426
- a.ui-nav__crumb:focus-visible { outline: var(--ring); outline-offset: var(--ring-offset); }
427
- .ui-nav__crumb.is-current { color: var(--strong); font-weight: 500; }
428
- .ui-nav__crumb .ui-nav__ic svg { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 2.5; }
429
-
430
397
  /* Forced colours replace every author background, so a selected item takes the system
431
398
  pair as its fill. `forced-color-adjust: none` is what keeps the pair from sitting on
432
399
  Chromium's Canvas backplate, which would leave the label unreadable. Focus keeps its
@@ -438,8 +405,7 @@ a.ui-nav__crumb:focus-visible { outline: var(--ring); outline-offset: var(--ring
438
405
  .ui-nav__item.is-active:not(.is-disabled),
439
406
  .ui-nav__item.is-current:not(.is-disabled),
440
407
  .ui-nav__tab.is-active:not(.is-disabled),
441
- .ui-nav--tabs.is-pill .ui-nav__tab.is-active:not(.is-disabled),
442
- .ui-nav__crumb.is-current {
408
+ .ui-nav--tabs.is-pill .ui-nav__tab.is-active:not(.is-disabled) {
443
409
  forced-color-adjust: none;
444
410
  background: Highlight !important;
445
411
  color: HighlightText !important;
@@ -447,8 +413,7 @@ a.ui-nav__crumb:focus-visible { outline: var(--ring); outline-offset: var(--ring
447
413
  }
448
414
  .ui-nav__item.is-active:not(.is-disabled) .ui-nav__ic svg,
449
415
  .ui-nav__item.is-current:not(.is-disabled) .ui-nav__ic svg,
450
- .ui-nav__tab.is-active:not(.is-disabled) .ui-nav__ic svg,
451
- .ui-nav__crumb.is-current .ui-nav__ic svg { stroke: HighlightText; }
416
+ .ui-nav__tab.is-active:not(.is-disabled) .ui-nav__ic svg { stroke: HighlightText; }
452
417
  .ui-nav__item.is-active .ui-nav__caret,
453
418
  .ui-nav__item.is-current .ui-nav__caret { border-color: currentColor; }
454
419
  .ui-nav__item.is-active:not(.is-disabled) .ui-nav__badge,
@@ -358,7 +358,11 @@
358
358
 
359
359
  /* ============================================================================
360
360
  * LIGHT THEME — deck light palette from viz/account.mjs
361
+ *
362
+ * A document sheet (.ui-card__page) takes this palette in both themes: the document
363
+ * is paper, so it stays white with dark ink on a dark stage too. Decided on #736.
361
364
  * ========================================================================== */
365
+ .ui-card__page,
362
366
  :root[data-theme="light"] {
363
367
  color-scheme: light;
364
368
 
@@ -537,6 +541,13 @@
537
541
  --grad-from: var(--purple-light);
538
542
  --grad-to: var(--cyan);
539
543
  }
544
+ /* The ring is declared once, in the dark block, and computed at :root. The sheet takes the
545
+ light accent above, so it computes its ring again or a focus on the paper keeps the dark one. */
546
+ .ui-card__page {
547
+ --ring-color: var(--accent);
548
+ --ring: var(--ring-width) solid var(--ring-color);
549
+ --ring-scroll: var(--ring);
550
+ }
540
551
 
541
552
  /* ============================================================================
542
553
  * WIDTHS BELOW THE PAGE — the box, and the line. Two scales, and one rule for
@@ -592,6 +603,7 @@
592
603
  .ui-card,
593
604
  .ui-card--accent,
594
605
  .ui-card--live,
606
+ .ui-card__page,
595
607
  .ui-cmdk__panel,
596
608
  .ui-confirm__panel,
597
609
  .ui-drawer__footer,