@softure-ai/theme-notion 0.35.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,29 @@ Newest first. Each version lists what changed for an app that uses the theme. Wh
4
4
  production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
5
5
  "Definition of done").
6
6
 
7
+ ## 0.37.0
8
+
9
+ - `FoldRow` (#1495): `align="start"` lines the bar up with the summary's first line: the chevron sits on that line
10
+ (in a box one line of `ui` text high, `data-slot="fold-row-chevron"`) and the right column is top-aligned, the
11
+ status on the first line and the actions under it. The default (`center`) keeps the centred bar. An app drops its
12
+ local `[data-slot=fold-row-summary]:items-start` and chevron margin overrides.
13
+ - `ListEntry` (#1497): the identity and the right column align to the top (`items-start`), so with a multi-line
14
+ identity (a title with detail lines, chips, a time) the state stands on the title's line and the controls under it,
15
+ instead of floating in the middle of the row; the arrow of a linked row sits on the title's line. Single-line rows
16
+ look as before; on a phone the column still wraps under the identity.
17
+
18
+ ## 0.36.0
19
+
20
+ - `RowActionsMenu` (#1492): a destructive `onSelect` may return a promise (a server action); with `confirm` the
21
+ dialog stays open while it is pending, both buttons disabled and the confirm button showing `confirm.pendingLabel`
22
+ ("Deleting…"), closes when it resolves and stays open when it rejects. `RowMenuAction.opensDialog` leaves focus to
23
+ the app's own dialog when the menu closes, and `triggerRef` reaches the menu button so that dialog can return focus
24
+ to it. Below `md` every item is the 44 px touch target; `id` on an action renders as `data-row-action` for browser
25
+ tests.
26
+ - `ResultBadge` (#1493): every other `span` prop (`data-*`, `id`, ARIA) reaches the badge, so an app marks a badge
27
+ with what it shows (`data-read-status="ok"`) without wrapping it. The theme's `data-slot`, `data-tone`,
28
+ `data-color` and `data-spinning` stay the theme's.
29
+
7
30
  ## 0.35.0
8
31
 
9
32
  - `RowActionsMenu` (#1486): a row's overflow menu. An icon-only "More actions" button (`label` for the app's words)
package/README.md CHANGED
@@ -236,7 +236,10 @@ delete button, a menu), beside the `<details>` rather than inside its `<summary>
236
236
  many lines it wraps to, and the summary and the column light as one box when the row is open or hovered. Below `md`
237
237
  the column falls under the summary and each action is at least 44 px. With a column the row is a grid
238
238
  (`data-slot="fold-row-with-actions"`, which carries the bottom border) and the opened content sits under the whole bar
239
- as the details' sibling, shown while it is open. `isOpenInitially` renders the row open (`<details open>`), for the row the
239
+ as the details' sibling, shown while it is open. By default the chevron and the column are centred on the bar;
240
+ `align="start"` lines both up with the summary's first line instead, for a summary of several lines (a title, a stage,
241
+ an outcome): the chevron sits in a box one line of `ui` text high (`data-slot="fold-row-chevron"`), and the column is
242
+ top-aligned, the status on the first line and the actions under it. `isOpenInitially` renders the row open (`<details open>`), for the row the
240
243
  address points at; only the first render reads it, and the reader can still fold the row.
241
244
 
242
245
  ```tsx
@@ -245,6 +248,7 @@ address points at; only the first render reads it, and the reader can still fold
245
248
  <InvoiceLines />
246
249
  </FoldRow>
247
250
  <FoldRow title="clip.mp4" badges={[]} status={<Status color="green">Paid</Status>} actions={<DeleteButton />} />
251
+ <FoldRow align="start" size="touch" summary={<ItemLines />} status={<Status color="blue">In progress</Status>} actions={<OpenButton />} />
248
252
  ```
249
253
 
250
254
  **`FilterChip`.** The filters above a list or a table, drawn the way a Notion database view draws them: a 24 px pill
@@ -528,9 +532,11 @@ renders with other components, `LIST_CLASSES` holds the same classes (`list`, `t
528
532
 
529
533
  **`ListEntry`: a row with a right column.** The most common row of an admin list: what the row is on the left
530
534
  (`title`, in the medium weight, and `details`, the lines under it in the muted colour) and a right column with the
531
- row's state on top (`status`, badges that wrap right-aligned) and its controls under it (`actions`). With `href` the
535
+ row's state on top (`status`, badges that wrap right-aligned) and its controls under it (`actions`). Both sides align
536
+ to the top: the state stands on the title's line however many detail lines the identity has. With `href` the
532
537
  title is a link stretched over the whole row, so the row is one box lit on hover with one focus ring, and a muted arrow
533
- sits beside the column; the arrow and the column are one group, so the arrow never wraps onto a line of its own. The
538
+ sits beside the column on the title's line; the arrow and the column are one group, so the arrow never wraps onto a
539
+ line of its own. The
534
540
  column stays above the link: its controls are their own targets, and a click on the gap between them or on the arrow
535
541
  still opens the row. Pass `linkComponent` for a router's link (it takes `href`, `className` and `children`). On a
536
542
  phone (below `md`) the column wraps under the identity, right-aligned, and every control is at least the touch target
@@ -560,7 +566,12 @@ primary action. Every other action goes into `menu`, a `RowActionsMenu` on the s
560
566
  button (its name from `label`, English by default) that opens a menu of `actions`, with `destructiveAction` last,
561
567
  after a separator, in the danger tone. Give the destructive action a `confirm` (`title`, `description`,
562
568
  `confirmLabel`, `cancelLabel`) and it opens an alert dialog first, running only on the destructive confirm; focus goes
563
- back to the menu button. The menu opens with Enter, Space or ArrowDown, and the arrow keys move between items. A row
569
+ back to the menu button. A destructive `onSelect` that returns a promise (a server action) keeps the dialog open with
570
+ both buttons disabled and `confirm.pendingLabel` ("Deleting…") on the confirm button until it settles: it closes on
571
+ success and stays open on failure, where the app shows its own error. An action that opens the app's own dialog sets
572
+ `opensDialog`, so the menu leaves focus to that dialog; pass `triggerRef` and return focus to the menu button from the
573
+ dialog's `onCloseAutoFocus`. Below `md` every item is the 44 px touch target; an action's `id` renders as
574
+ `data-row-action` for browser tests. The menu opens with Enter, Space or ArrowDown, and the arrow keys move between items. A row
564
575
  with a single action keeps it inline and has no menu. The inline control and the menu button never wrap apart, and on
565
576
  a phone each is at least the touch target (44 px): pass the switch `size="touch"` (with `className="md:m-0 md:h-4
566
577
  md:w-[26px]"` for the plain switch on a desktop), since the row never stretches a switch's track. Each fact is said once: a switch is its own on/off state, so no
@@ -577,12 +588,19 @@ badge or label repeats it; a `ResultBadge` carries its own icon, so no separate
577
588
  label={t.rows.more}
578
589
  actions={[
579
590
  { label: t.hooks.test, onSelect: test },
580
- { label: t.hooks.replaceToken, onSelect: replaceToken },
591
+ { id: "replace-token", label: t.hooks.replaceToken, onSelect: openReplaceDialog, opensDialog: true },
581
592
  ]}
593
+ triggerRef={menuButton}
582
594
  destructiveAction={{
595
+ id: "delete",
583
596
  label: t.hooks.delete,
584
- onSelect: remove,
585
- confirm: { title: t.hooks.deleteTitle, confirmLabel: t.hooks.delete, cancelLabel: t.common.cancel },
597
+ onSelect: () => deleteHook(hook.id),
598
+ confirm: {
599
+ title: t.hooks.deleteTitle,
600
+ confirmLabel: t.hooks.delete,
601
+ pendingLabel: t.hooks.deleting,
602
+ cancelLabel: t.common.cancel,
603
+ },
586
604
  }}
587
605
  />
588
606
  }
@@ -595,11 +613,14 @@ the tone's icon (`RESULT_BADGE_ICONS`: `CircleCheck`, `TriangleAlert`, `CircleX`
595
613
  `icon` for another) and always a word. The app keeps its own table of which result takes which tone; the theme owns
596
614
  the colours, so "failed" is red in every list. `isSpinning` marks a run still in progress: the icon (a
597
615
  `LoaderCircle` unless `icon` is given) spins with `motion-safe:animate-spin`, still for a reader who asked for reduced
598
- motion. `Status` is the ghost counterpart, for a state written in text colour.
616
+ motion. `Status` is the ghost counterpart, for a state written in text colour. Every other `span` prop (`data-*`,
617
+ `id`, ARIA) reaches the badge, so an app marks it with what it shows and its tests read that; the theme's own
618
+ `data-slot`, `data-tone`, `data-color` and `data-spinning` always win.
599
619
 
600
620
  ```tsx
601
621
  <ResultBadge tone="danger">Failed</ResultBadge>
602
622
  <ResultBadge tone="muted" isSpinning>Running</ResultBadge>
623
+ <ResultBadge tone="success" data-read-status="ok">Read</ResultBadge>
603
624
  ```
604
625
 
605
626
  **`ListGroup`, `ListGroupHeading`: a sticky group heading.** A heading over a run of rows (a country's days, a month's
package/dist/index.d.ts CHANGED
@@ -47,7 +47,7 @@ export { Code, CodeBlock, type CodeBlockProps } from "./notion/Code.js";
47
47
  export { CopyButton, type CopyButtonProps } from "./notion/CopyButton.js";
48
48
  export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/DetailTable.js";
49
49
  export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProps } from "./notion/FilterChip.js";
50
- export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
50
+ export { FoldRow, type FoldRowAlign, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
51
51
  export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
52
52
  export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
53
53
  export { LIST_CLASSES, List, ListGroup, ListGroupHeading, ListItem, ListEntry, ListRow, type ListGroupHeadingProps, type ListGroupProps, type ListItemProps, type ListProps, type ListEntryLinkComponent, type ListEntryProps, type ListRowProps, type ListSurface, } from "./notion/List.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAE1E,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;A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E,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
@@ -52,6 +52,13 @@ export type FoldRowProps = FoldRowSummaryProps & FoldRowDetailsProps & {
52
52
  readonly actions?: ReactNode;
53
53
  /** The item's status, drawn in the same column above the actions (with no actions, the column holds only it). */
54
54
  readonly status?: ReactNode;
55
+ /**
56
+ * How the bar lines up with a summary of several lines. `center` (default) centres the chevron and the right
57
+ * column vertically; `start` puts the chevron on the summary's first line (one line of `ui` text) and the right
58
+ * column at the top, the status on the first line and the actions under it.
59
+ */
60
+ readonly align?: FoldRowAlign;
55
61
  };
62
+ export type FoldRowAlign = "center" | "start";
56
63
  export declare function FoldRow(props: FoldRowProps): import("react").JSX.Element;
57
64
  //# sourceMappingURL=FoldRow.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"FoldRow.d.ts","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,OAAO,EAAe,KAAK,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAE/D,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACtB;AAED,wFAAwF;AACxF,MAAM,MAAM,mBAAmB,GAC3B;IACE,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,wDAAwD;IACxD,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,SAAS,EAAE,CAAC;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,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AAE,SAAS,GAAG,OAAO,CAAC;IACpC,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,iHAAiH;IACjH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;CAC/B,CAAC;AAEJ,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC;AA+E9C,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAqD1C"}
@@ -5,25 +5,31 @@ import { Badge } from "../ui/badge.js";
5
5
  import { DetailTable } from "./DetailTable.js";
6
6
  import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
7
7
  import { TONE_COLORS } from "./tones.js";
8
+ const ITEMS_CLASS = { center: "items-center", start: "items-start" };
8
9
  // The bar and its opened content share one 8 px horizontal inset, so the details start under the chevron; the inset
9
10
  // variant starts under the title instead (8 px inset, 16 px chevron, 8 px gap).
10
11
  const CONTENT_LAYOUT = "flex-col gap-2 px-2 py-3";
11
12
  const INSET_CONTENT_LAYOUT = "flex-col gap-2 py-2 pr-2 pl-8";
12
- function FoldRowFixedSummary({ title, facts = [], badges, }) {
13
- return (_jsxs(_Fragment, { children: [_jsxs("span", { "data-slot": "fold-row-heading", className: "flex min-w-0 items-center gap-2", children: [_jsx(FoldRowChevron, {}), _jsx("span", { className: "min-w-0 text-ui-medium", children: title })] }), facts.map((fact, index) => (_jsx("span", { "data-slot": "fold-row-fact", className: "text-ui text-muted-foreground", children: fact }, index))), badges.length === 0 ? null : (_jsx("span", { "data-slot": "fold-row-badges", className: "ml-auto inline-flex flex-wrap gap-1", children: badges.map((badge) => {
13
+ function FoldRowFixedSummary({ title, facts = [], badges, align, }) {
14
+ return (_jsxs(_Fragment, { children: [_jsxs("span", { "data-slot": "fold-row-heading", className: cn("flex min-w-0", ITEMS_CLASS[align], "gap-2"), children: [_jsx(FoldRowChevron, { align: align }), _jsx("span", { className: "min-w-0 text-ui-medium", children: title })] }), facts.map((fact, index) => (_jsx("span", { "data-slot": "fold-row-fact", className: "text-ui text-muted-foreground", children: fact }, index))), badges.length === 0 ? null : (_jsx("span", { "data-slot": "fold-row-badges", className: "ml-auto inline-flex flex-wrap gap-1", children: badges.map((badge) => {
14
15
  const tone = badge.tone ?? "default";
15
16
  return (_jsx(Badge, { variant: "tag", color: TONE_COLORS[tone] ?? "default", "data-badge": badge.key, "data-tone": tone, children: badge.text }, badge.key));
16
17
  }) }))] }));
17
18
  }
18
- function FoldRowChevron() {
19
- return (_jsx(ChevronRight, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/fold-row:rotate-90" }));
19
+ function FoldRowChevron({ align }) {
20
+ const chevron = (_jsx(ChevronRight, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/fold-row:rotate-90" }));
21
+ if (align === "center") {
22
+ return chevron;
23
+ }
24
+ // A box one line of `ui` text high, so the chevron sits in the middle of the summary's first line.
25
+ return (_jsx("span", { "data-slot": "fold-row-chevron", className: "flex h-lh shrink-0 items-center text-ui", children: chevron }));
20
26
  }
21
27
  function isDrawn(node) {
22
28
  return node !== undefined && node !== null;
23
29
  }
24
30
  // An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
25
31
  export function FoldRow(props) {
26
- const { actions, status, isInset = false } = props;
32
+ const { actions, status, isInset = false, align = "center" } = props;
27
33
  if (!isDrawn(actions) && !isDrawn(status)) {
28
34
  return (_jsx(FoldRowDetails, { ...props, className: "border-b border-border", content: _jsx(FoldRowContent, { ...props, className: cn("flex", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "empty:hidden") }) }));
29
35
  }
@@ -31,14 +37,14 @@ export function FoldRow(props) {
31
37
  // row. To make the column exactly as high as the summary, the `<details>` holds only its summary and shares a grid
32
38
  // row with the column (grid items stretch to their row); the opened content is the next row, shown while the
33
39
  // details is open (`peer-open`). The details and the column carry the bar's light together, so they read as one box.
34
- return (_jsxs("div", { "data-slot": "fold-row-with-actions", className: "group/fold-row-with-actions grid grid-cols-1 border-b border-border md:grid-cols-[minmax(0,1fr)_auto]", children: [_jsx(FoldRowDetails, { ...props, className: "peer/fold-row min-w-0 rounded-md transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent open:bg-accent max-md:rounded-b-none md:rounded-r-none", isLitByRow: true }), _jsxs("div", { "data-slot": "fold-row-actions", className: "flex flex-wrap items-center gap-2 rounded-b-md pr-2 pb-1 pl-8 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent md:flex-col md:flex-nowrap md:items-end md:justify-center md:gap-1 md:rounded-b-none md:rounded-r-md md:py-1 md:pl-0", children: [isDrawn(status) ? (_jsx("div", { "data-slot": "fold-row-status", className: "flex items-center", children: status })) : null, isDrawn(actions) ? (_jsx("div", { "data-slot": "fold-row-action-list", className: "flex items-center gap-1 max-md:*:min-h-touch-target max-md:*:min-w-touch-target", children: actions })) : null] }), _jsx(FoldRowContent, { ...props, className: cn("col-span-full hidden", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "peer-open/fold-row:not-empty:flex") })] }));
40
+ return (_jsxs("div", { "data-slot": "fold-row-with-actions", className: "group/fold-row-with-actions grid grid-cols-1 border-b border-border md:grid-cols-[minmax(0,1fr)_auto]", children: [_jsx(FoldRowDetails, { ...props, className: "peer/fold-row min-w-0 rounded-md transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent open:bg-accent max-md:rounded-b-none md:rounded-r-none", isLitByRow: true }), _jsxs("div", { "data-slot": "fold-row-actions", className: cn("flex flex-wrap items-center gap-2 rounded-b-md pr-2 pb-1 pl-8 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent md:flex-col md:flex-nowrap md:items-end", align === "start" ? "md:justify-start" : "md:justify-center", "md:gap-1 md:rounded-b-none md:rounded-r-md md:py-1 md:pl-0"), children: [isDrawn(status) ? (_jsx("div", { "data-slot": "fold-row-status", className: "flex items-center", children: status })) : null, isDrawn(actions) ? (_jsx("div", { "data-slot": "fold-row-action-list", className: "flex items-center gap-1 max-md:*:min-h-touch-target max-md:*:min-w-touch-target", children: actions })) : null] }), _jsx(FoldRowContent, { ...props, className: cn("col-span-full hidden", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "peer-open/fold-row:not-empty:flex") })] }));
35
41
  }
36
42
  function FoldRowContent(props) {
37
43
  const { isInset = false, children, className } = props;
38
44
  return (_jsxs("div", { "data-slot": "fold-row-content", "data-inset": isInset, className: className, children: [props.details === undefined ? null : _jsx(DetailTable, { label: props.detailsLabel, rows: props.details }), children] }));
39
45
  }
40
46
  function FoldRowDetails(props) {
41
- const { isOpenInitially = false, size = "default", className, isLitByRow = false, content } = props;
42
- return (_jsxs("details", { "data-slot": "fold-row", open: isOpenInitially || undefined, className: cn("group/fold-row", className), children: [_jsx("summary", { "data-slot": "fold-row-summary", className: cn("flex cursor-pointer list-none flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-2 py-1", !isLitByRow && "transition-colors duration-120 group-open/fold-row:bg-accent hover:bg-accent", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden", size === "touch" ? "min-h-touch-target" : "min-h-row-height"), children: props.summary === undefined ? (_jsx(FoldRowFixedSummary, { title: props.title, facts: props.facts, badges: props.badges ?? [] })) : (_jsxs(_Fragment, { children: [_jsx(FoldRowChevron, {}), _jsx("span", { "data-slot": "fold-row-summary-slot", className: "flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1", children: props.summary })] })) }), content] }));
47
+ const { isOpenInitially = false, size = "default", align = "center", className, isLitByRow = false, content } = props;
48
+ return (_jsxs("details", { "data-slot": "fold-row", open: isOpenInitially || undefined, className: cn("group/fold-row", className), children: [_jsx("summary", { "data-slot": "fold-row-summary", className: cn("flex cursor-pointer list-none flex-wrap", ITEMS_CLASS[align], "gap-x-2 gap-y-1 rounded-md px-2 py-1", !isLitByRow && "transition-colors duration-120 group-open/fold-row:bg-accent hover:bg-accent", "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden", size === "touch" ? "min-h-touch-target" : "min-h-row-height"), children: props.summary === undefined ? (_jsx(FoldRowFixedSummary, { title: props.title, facts: props.facts, badges: props.badges ?? [], align: align })) : (_jsxs(_Fragment, { children: [_jsx(FoldRowChevron, { align: align }), _jsx("span", { "data-slot": "fold-row-summary-slot", className: cn("flex min-w-0 flex-1 flex-wrap", ITEMS_CLASS[align], "gap-x-2 gap-y-1"), children: props.summary })] })) }), content] }));
43
49
  }
44
50
  //# sourceMappingURL=FoldRow.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"FoldRow.js","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,WAAW,EAAkB,MAAM,kBAAkB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;AA+DpD,oHAAoH;AACpH,gFAAgF;AAChF,MAAM,cAAc,GAAG,0BAA0B,CAAC;AAClD,MAAM,oBAAoB,GAAG,+BAA+B,CAAC;AAE7D,SAAS,mBAAmB,CAAC,EAC3B,KAAK,EACL,KAAK,GAAG,EAAE,EACV,MAAM,GAKP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,EAAE,SAAS,EAAE,UAAU,GAAG,KAAK,EAAE,OAAO,EAAE,GAAG,KAAK,CAAC;IACtH,OAAO,CACL,gCAAmB,UAAU,EAAC,IAAI,EAAE,eAAe,IAAI,SAAS,EAAE,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,aAC1G,+BACY,kBAAkB,EAC5B,SAAS,EAAE,EAAE,CACX,yCAAyC,EACzC,WAAW,CAAC,KAAK,CAAC,EAClB,sCAAsC,EACtC,CAAC,UAAU,IAAI,8EAA8E,EAC7F,4GAA4G,EAC5G,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,kBAAkB,CAC7D,YAEA,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,CAC7B,KAAC,mBAAmB,IAAC,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,KAAK,EAAE,KAAK,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,CAAC,MAAM,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,GAAI,CAC1G,CAAC,CAAC,CAAC,CACF,8BACE,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,GAAI,EAChC,4BACY,uBAAuB,EACjC,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC,YAEpF,KAAK,CAAC,OAAO,GACT,IACN,CACJ,GACO,EACT,OAAO,IACA,CACX,CAAC;AACJ,CAAC"}
@@ -80,9 +80,10 @@ export type ListEntryProps = Omit<ComponentProps<"div">, "title" | "children"> &
80
80
  };
81
81
  /**
82
82
  * A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
83
- * top of the right column and its controls under it. With `href` the title is a link stretched over the whole row, so
84
- * the row is one box lit on hover, and an arrow sits beside the column (never on a line of its own); the column stays
85
- * above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
83
+ * top of the right column and its controls under it. Both sides align to the top, so the state stands on the title's
84
+ * line however many detail lines the identity has. With `href` the title is a link stretched over the whole row, so
85
+ * the row is one box lit on hover, and an arrow sits beside the column on the title's line (never on a line of its
86
+ * own); the column stays above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
86
87
  *
87
88
  * Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
88
89
  * action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
@@ -1 +1 @@
1
- {"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/notion/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY;aACvB,IAAI,EAAE,oEAAoE;aAC1E,UAAU,EAAE,wEAAwE;aACpF,IAAI,EAAE,oBAAoB;aAC1B,GAAG,EAAE,uPAAuP;aAC5P,KAAK,EAAE,4CAA4C;aACnD,YAAY,EACV,kIAAkI;aACpI,kBAAkB,EAChB,qIAAqI;CAC/H,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG;IAC1D,kDAAkD;IAClD,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAC/B,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,EAAE,OAAc,EAAE,OAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,G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EF,4GAA4G;AAC5G,wBAAgB,gBAAgB,CAAC,EAAE,OAAgB,EAAE,OAAe,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,+BAUjH"}
@@ -47,9 +47,10 @@ function isDrawn(node) {
47
47
  }
48
48
  /**
49
49
  * A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
50
- * top of the right column and its controls under it. With `href` the title is a link stretched over the whole row, so
51
- * the row is one box lit on hover, and an arrow sits beside the column (never on a line of its own); the column stays
52
- * above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
50
+ * top of the right column and its controls under it. Both sides align to the top, so the state stands on the title's
51
+ * line however many detail lines the identity has. With `href` the title is a link stretched over the whole row, so
52
+ * the row is one box lit on hover, and an arrow sits beside the column on the title's line (never on a line of its
53
+ * own); the column stays above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
53
54
  *
54
55
  * Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
55
56
  * action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
@@ -64,7 +65,7 @@ export function ListEntry({ title, details, status, actions, menu, href, linkCom
64
65
  const hasColumn = hasStatus || hasControls;
65
66
  const hasLink = href !== undefined;
66
67
  const titleClasses = "min-w-0 text-ui-medium text-foreground";
67
- return (_jsxs("div", { "data-slot": "list-entry", className: cn("relative flex w-full min-w-0 flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-2 py-(--list-row-y) text-ui transition-colors duration-100 hover:bg-accent", "has-[[data-slot=list-entry-title]:focus-visible]:ring-2 has-[[data-slot=list-entry-title]:focus-visible]:ring-ring", className), ...props, children: [_jsxs("div", { "data-slot": "list-entry-identity", className: "flex min-w-0 flex-1 basis-48 flex-col gap-0.5 max-md:basis-full", children: [hasLink ? (_jsx(Link, { "data-slot": "list-entry-title", href: href, className: cn(titleClasses, "outline-none after:absolute after:inset-0 after:rounded-md after:content-['']"), children: title })) : (_jsx("span", { "data-slot": "list-entry-title", className: titleClasses, children: title })), isDrawn(details) ? (_jsx("div", { "data-slot": "list-entry-details", className: "flex min-w-0 flex-col text-ui text-muted-foreground", children: details })) : null] }), hasColumn || hasLink ? (_jsxs("div", { "data-slot": "list-entry-side", className: "group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-center gap-2 has-[[data-row-wide]]:ml-0 has-[[data-row-wide]]:basis-full", children: [hasColumn ? (_jsxs("div", { "data-slot": "list-entry-column", className: "flex min-w-0 flex-col items-end gap-1 has-[[data-row-wide]]:flex-1 has-[[data-row-wide]]:items-stretch", children: [hasStatus ? (_jsx("div", { "data-slot": "list-entry-status", className: "pointer-events-auto flex min-w-0 flex-wrap items-center justify-end gap-1 group-has-[[data-row-wide]]/list-entry-side:justify-start", children: status })) : null, hasControls ? (_jsxs("div", { "data-slot": "list-entry-actions", className: cn("pointer-events-auto flex min-w-0 items-center justify-end gap-1 has-[[data-row-wide]]:flex-col has-[[data-row-wide]]:items-stretch has-[[data-row-wide]]:justify-start max-md:*:not-data-[slot=switch]:min-h-touch-target max-md:*:not-data-[slot=switch]:min-w-touch-target max-md:*:data-[slot=switch]:mx-0", hasMenu ? "flex-nowrap" : "flex-wrap"), children: [actions, hasMenu ? (_jsx("div", { "data-slot": "list-entry-menu", className: "flex shrink-0 items-center justify-center max-md:*:min-h-touch-target max-md:*:min-w-touch-target", children: menu })) : null] })) : null] })) : null, hasLink ? (_jsx("span", { "data-slot": "list-entry-arrow", "aria-hidden": "true", className: "flex shrink-0 text-muted-foreground", children: _jsx(ChevronRight, { strokeWidth: ICON_STROKE_WIDTH, className: "size-4" }) })) : null] })) : null] }));
68
+ return (_jsxs("div", { "data-slot": "list-entry", className: cn("relative flex w-full min-w-0 flex-wrap items-start gap-x-3 gap-y-1 rounded-md px-2 py-(--list-row-y) text-ui transition-colors duration-100 hover:bg-accent", "has-[[data-slot=list-entry-title]:focus-visible]:ring-2 has-[[data-slot=list-entry-title]:focus-visible]:ring-ring", className), ...props, children: [_jsxs("div", { "data-slot": "list-entry-identity", className: "flex min-w-0 flex-1 basis-48 flex-col gap-0.5 max-md:basis-full", children: [hasLink ? (_jsx(Link, { "data-slot": "list-entry-title", href: href, className: cn(titleClasses, "outline-none after:absolute after:inset-0 after:rounded-md after:content-['']"), children: title })) : (_jsx("span", { "data-slot": "list-entry-title", className: titleClasses, children: title })), isDrawn(details) ? (_jsx("div", { "data-slot": "list-entry-details", className: "flex min-w-0 flex-col text-ui text-muted-foreground", children: details })) : null] }), hasColumn || hasLink ? (_jsxs("div", { "data-slot": "list-entry-side", className: "group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-start gap-2 has-[[data-row-wide]]:ml-0 has-[[data-row-wide]]:basis-full", children: [hasColumn ? (_jsxs("div", { "data-slot": "list-entry-column", className: "flex min-w-0 flex-col items-end gap-1 has-[[data-row-wide]]:flex-1 has-[[data-row-wide]]:items-stretch", children: [hasStatus ? (_jsx("div", { "data-slot": "list-entry-status", className: "pointer-events-auto flex min-w-0 flex-wrap items-center justify-end gap-1 group-has-[[data-row-wide]]/list-entry-side:justify-start", children: status })) : null, hasControls ? (_jsxs("div", { "data-slot": "list-entry-actions", className: cn("pointer-events-auto flex min-w-0 items-center justify-end gap-1 has-[[data-row-wide]]:flex-col has-[[data-row-wide]]:items-stretch has-[[data-row-wide]]:justify-start max-md:*:not-data-[slot=switch]:min-h-touch-target max-md:*:not-data-[slot=switch]:min-w-touch-target max-md:*:data-[slot=switch]:mx-0", hasMenu ? "flex-nowrap" : "flex-wrap"), children: [actions, hasMenu ? (_jsx("div", { "data-slot": "list-entry-menu", className: "flex shrink-0 items-center justify-center max-md:*:min-h-touch-target max-md:*:min-w-touch-target", children: menu })) : null] })) : null] })) : null, hasLink ? (_jsx("span", { "data-slot": "list-entry-arrow", "aria-hidden": "true", className: "flex h-5 shrink-0 items-center text-muted-foreground", children: _jsx(ChevronRight, { strokeWidth: ICON_STROKE_WIDTH, className: "size-4" }) })) : null] })) : null] }));
68
69
  }
69
70
  /**
70
71
  * A run of rows under a `ListGroupHeading` (a country's days, a month's entries), placed straight in the scroll
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/notion/List.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,oEAAoE;IAC1E,UAAU,EAAE,wEAAwE;IACpF,IAAI,EAAE,oBAAoB;IAC1B,GAAG,EAAE,uPAAuP;IAC5P,KAAK,EAAE,4CAA4C;IACnD,YAAY,EACV,kIAAkI;IACpI,kBAAkB,EAChB,qIAAqI;CAC/H,CAAC;AAaX;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAa;IACpG,OAAO,CACL,KAAC,OAAO,iBACI,MAAM,kBACF,OAAO,kBACP,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,KACxF,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAOD,+EAA+E;AAC/E,MAAM,UAAU,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiB;IAC9E,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,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,CAAC,CAAC,KAAK,CAAC;IACzC,OAAO,KAAC,IAAI,iBAAW,YAAY,EAAC,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,KAAK,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAClG,CAAC;AASD,4GAA4G;AAC5G,MAAM,UAAU,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAChH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACzC,OAAO,CACL,KAAC,IAAI,iBACO,oBAAoB,kBAChB,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,KACxG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -1,9 +1,14 @@
1
1
  import { type LucideIcon } from "lucide-react";
2
- import type { ReactNode } from "react";
2
+ import type { ComponentProps, ReactNode } from "react";
3
3
  import { type Tone } from "./tones.js";
4
4
  /** The icon a result badge draws for each tone when the app passes none. */
5
5
  export declare const RESULT_BADGE_ICONS: Readonly<Record<Tone, LucideIcon>>;
6
- export interface ResultBadgeProps {
6
+ /**
7
+ * The badge's remaining `span` props (`data-*`, `id`, ARIA, handlers) reach the element, so an app can mark a badge with
8
+ * what it shows (`data-read-status="ok"`). The theme's own `data-slot`, `data-tone`, `data-color` and `data-spinning`
9
+ * always win, and the look (`variant`, `color`) is the theme's.
10
+ */
11
+ export interface ResultBadgeProps extends Omit<ComponentProps<"span">, "color" | "children" | "title" | "className"> {
7
12
  /** What the result means; the theme owns its colour (`TONE_COLORS`), so one result reads alike in every list. */
8
13
  readonly tone: Tone;
9
14
  /** The app's own icon in place of the tone's default (a spinning run defaults to a loader). */
@@ -16,5 +21,5 @@ export interface ResultBadgeProps {
16
21
  readonly title?: string;
17
22
  readonly className?: string;
18
23
  }
19
- export declare function ResultBadge({ tone, icon, isSpinning, children, title, className }: ResultBadgeProps): import("react").JSX.Element;
24
+ export declare function ResultBadge({ tone, icon, isSpinning, children, title, className, ...attributes }: ResultBadgeProps): import("react").JSX.Element;
20
25
  //# sourceMappingURL=ResultBadge.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultBadge.d.ts","sourceRoot":"","sources":["../../src/notion/ResultBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0E,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACvH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpD,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAMjE,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,iHAAiH;IACjH,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,+FAA+F;IAC/F,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AASD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAmB3G"}
1
+ {"version":3,"file":"ResultBadge.d.ts","sourceRoot":"","sources":["../../src/notion/ResultBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0E,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACvH,OAAO,KAAK,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvD,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpD,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAMjE,CAAC;AAEF;;;;GAIG;AACH,MAAM,WAAW,gBAAiB,SAAQ,IAAI,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,OAAO,GAAG,UAAU,GAAG,OAAO,GAAG,WAAW,CAAC;IAClH,iHAAiH;IACjH,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,+FAA+F;IAC/F,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AASD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,UAAU,EAAE,EAAE,gBAAgB,+BAoB1H"}
@@ -18,8 +18,8 @@ function getPlainText(children) {
18
18
  }
19
19
  // A result (passed, failed, skipped, running): a filled tag in its tone's colour, with an icon and a word. The filled
20
20
  // counterpart of `Status`, for a list whose rows each end in a result.
21
- export function ResultBadge({ tone, icon, isSpinning = false, children, title, className }) {
21
+ export function ResultBadge({ tone, icon, isSpinning = false, children, title, className, ...attributes }) {
22
22
  const Icon = icon ?? (isSpinning ? LoaderCircle : RESULT_BADGE_ICONS[tone]);
23
- return (_jsxs(Badge, { variant: "tag", color: TONE_COLORS[tone] ?? "default", "data-slot": "result-badge", "data-tone": tone, "data-color": TONE_COLORS[tone] ?? "default", "data-spinning": isSpinning || undefined, title: title ?? getPlainText(children), className: cn("gap-1 [&>svg]:size-3.5 [&>svg]:shrink-0", className), children: [_jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: isSpinning ? "motion-safe:animate-spin" : undefined }), _jsx("span", { "data-slot": "result-badge-label", className: "min-w-0 truncate", children: children })] }));
23
+ return (_jsxs(Badge, { ...attributes, variant: "tag", color: TONE_COLORS[tone] ?? "default", "data-slot": "result-badge", "data-tone": tone, "data-color": TONE_COLORS[tone] ?? "default", "data-spinning": isSpinning || undefined, title: title ?? getPlainText(children), className: cn("gap-1 [&>svg]:size-3.5 [&>svg]:shrink-0", className), children: [_jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: isSpinning ? "motion-safe:animate-spin" : undefined }), _jsx("span", { "data-slot": "result-badge-label", className: "min-w-0 truncate", children: children })] }));
24
24
  }
25
25
  //# sourceMappingURL=ResultBadge.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ResultBadge.js","sourceRoot":"","sources":["../../src/notion/ResultBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AAGvH,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAuC;IACpE,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,WAAW;IAC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tC,SAAS,EAAE,EAAE,CAAC,yCAAyC,EAAE,SAAS,CAAC,aAEnE,KAAC,IAAI,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,SAAS,GAAI,EAC3H,4BAAgB,oBAAoB,EAAC,SAAS,EAAC,kBAAkB,YAC9D,QAAQ,GACJ,IACD,CACT,CAAC;AACJ,CAAC"}
@@ -1,11 +1,18 @@
1
- import { type ReactNode } from "react";
1
+ import { type ReactNode, type Ref } from "react";
2
2
  /** One secondary action of a row: its words, an optional icon, and what it does. */
3
3
  export interface RowMenuAction {
4
+ /** A stable hook for browser tests, rendered as `data-row-action` on the item. */
5
+ readonly id?: string;
4
6
  readonly label: string;
5
7
  /** A line icon before the words (the theme's stroke and size apply). */
6
8
  readonly icon?: ReactNode;
7
9
  readonly onSelect: () => void;
8
10
  readonly isDisabled?: boolean;
11
+ /**
12
+ * The action opens the app's own dialog: the menu leaves focus to that dialog when it closes instead of taking it
13
+ * back to its button. Return focus to the button from the dialog's `onCloseAutoFocus` through `triggerRef`.
14
+ */
15
+ readonly opensDialog?: boolean;
9
16
  }
10
17
  /** The confirmation a destructive action asks for: the app's own copy. */
11
18
  export interface RowMenuConfirmation {
@@ -13,11 +20,19 @@ export interface RowMenuConfirmation {
13
20
  readonly description?: ReactNode;
14
21
  /** The words of the destructive confirm button. */
15
22
  readonly confirmLabel: string;
23
+ /** The words of the confirm button while an async action runs ("Deleting…"); `confirmLabel` when not given. */
24
+ readonly pendingLabel?: string;
16
25
  /** The words of the button that keeps things as they are. */
17
26
  readonly cancelLabel: string;
18
27
  }
19
28
  /** The destructive action of a row (delete, revoke): last in the menu, in the danger tone. */
20
- export interface RowMenuDestructiveAction extends RowMenuAction {
29
+ export interface RowMenuDestructiveAction extends Omit<RowMenuAction, "onSelect"> {
30
+ /**
31
+ * What the action does. With `confirm` it may return a promise (a server action): the dialog then stays open with
32
+ * both buttons disabled and `pendingLabel` on the confirm button until it settles, closes when it resolves and stays
33
+ * open when it rejects. The app reports the error itself; the menu only keeps the dialog open.
34
+ */
35
+ readonly onSelect: () => void | Promise<unknown>;
21
36
  /** Ask first: the action runs only after the alert dialog's confirm button. Without it the action runs at once. */
22
37
  readonly confirm?: RowMenuConfirmation;
23
38
  }
@@ -30,6 +45,8 @@ export interface RowActionsMenuProps {
30
45
  readonly label?: string;
31
46
  /** The menu's edge against the button; `end` (the row's right edge) by default. */
32
47
  readonly align?: "start" | "center" | "end";
48
+ /** Reaches the menu button, so an app's dialog opened from the menu can return focus to it. */
49
+ readonly triggerRef?: Ref<HTMLButtonElement>;
33
50
  readonly className?: string;
34
51
  }
35
52
  /**
@@ -38,5 +55,5 @@ export interface RowActionsMenuProps {
38
55
  * Enter, Space or ArrowDown; the arrow keys move between items. Place it in `ListEntry`'s `menu` slot, next to the
39
56
  * row's one inline control.
40
57
  */
41
- export declare function RowActionsMenu({ actions, destructiveAction, label, align, className, }: RowActionsMenuProps): import("react").JSX.Element;
58
+ export declare function RowActionsMenu({ actions, destructiveAction, label, align, triggerRef, className, }: RowActionsMenuProps): import("react").JSX.Element;
42
59
  //# sourceMappingURL=RowActionsMenu.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"RowActionsMenu.d.ts","sourceRoot":"","sources":["../../src/notion/RowActionsMenu.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAoB,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAyBzD,oFAAoF;AACpF,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,wEAAwE;IACxE,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,QAAQ,EAAE,MAAM,IAAI,CAAC;IAC9B,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;CAC/B;AAED,0EAA0E;AAC1E,MAAM,WAAW,mBAAmB;IAClC,Q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;;GAKG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAY,EACZ,iBAAiB,EACjB,KAAgC,EAChC,KAAa,EACb,UAAU,EACV,SAAS,GACV,EAAE,mBAAmB,+BA2IrB"}
@@ -1,36 +1,84 @@
1
1
  "use client";
2
2
  import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
3
  import { Ellipsis } from "lucide-react";
4
- import { useRef, useState } from "react";
4
+ import { useCallback, useRef, useState } from "react";
5
5
  import { cn } from "../lib/utils.js";
6
6
  import { en as messages } from "../messages/en.js";
7
7
  import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "../ui/alert-dialog.js";
8
8
  import { Button } from "../ui/button.js";
9
9
  import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "../ui/dropdown-menu.js";
10
10
  import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
11
+ // Below `md` every item is the touch target, as the row's own controls are; a desktop keeps the compact items.
12
+ const ITEM_TOUCH_CLASS = "max-md:min-h-touch-target";
13
+ function assignRef(ref, value) {
14
+ if (typeof ref === "function")
15
+ ref(value);
16
+ else if (ref !== null && ref !== undefined)
17
+ ref.current = value;
18
+ }
11
19
  /**
12
20
  * A row's overflow menu: an icon-only "More actions" button that opens a menu of the row's secondary actions, the
13
21
  * destructive one last, after a separator and in the danger tone, optionally confirmed in an alert dialog. Opens with
14
22
  * Enter, Space or ArrowDown; the arrow keys move between items. Place it in `ListEntry`'s `menu` slot, next to the
15
23
  * row's one inline control.
16
24
  */
17
- export function RowActionsMenu({ actions = [], destructiveAction, label = messages.rowActions.more, align = "end", className, }) {
25
+ export function RowActionsMenu({ actions = [], destructiveAction, label = messages.rowActions.more, align = "end", triggerRef, className, }) {
18
26
  const [isConfirming, setIsConfirming] = useState(false);
27
+ const [isPending, setIsPending] = useState(false);
19
28
  const trigger = useRef(null);
29
+ const isLeavingFocus = useRef(false);
20
30
  const confirmation = destructiveAction?.confirm;
31
+ const setTrigger = useCallback((node) => {
32
+ trigger.current = node;
33
+ assignRef(triggerRef, node);
34
+ }, [triggerRef]);
35
+ const selectAction = (action) => {
36
+ isLeavingFocus.current = action.opensDialog === true;
37
+ action.onSelect();
38
+ };
21
39
  const selectDestructive = () => {
22
40
  if (destructiveAction === undefined)
23
41
  return;
42
+ isLeavingFocus.current = false;
24
43
  if (confirmation === undefined) {
25
- destructiveAction.onSelect();
44
+ // The menu is already closed, so a returned promise is the app's to handle.
45
+ void destructiveAction.onSelect();
26
46
  return;
27
47
  }
28
48
  setIsConfirming(true);
29
49
  };
30
- return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { ref: trigger, "data-slot": "row-actions-menu-trigger", type: "button", variant: "ghost", size: "icon", "aria-label": label, className: cn("text-muted-foreground", className), children: _jsx(Ellipsis, { strokeWidth: ICON_STROKE_WIDTH, "aria-hidden": "true" }) }) }), _jsxs(DropdownMenuContent, { align: align, children: [actions.map((action) => (_jsxs(DropdownMenuItem, { disabled: action.isDisabled, onSelect: action.onSelect, children: [action.icon, action.label] }, action.label))), destructiveAction !== undefined && actions.length > 0 ? _jsx(DropdownMenuSeparator, {}) : null, destructiveAction !== undefined ? (_jsxs(DropdownMenuItem, { variant: "destructive", disabled: destructiveAction.isDisabled, onSelect: selectDestructive, children: [destructiveAction.icon, destructiveAction.label] })) : null] })] }), confirmation !== undefined && destructiveAction !== undefined ? (_jsx(AlertDialog, { open: isConfirming, onOpenChange: setIsConfirming, children: _jsxs(AlertDialogContent, { size: "sm", onCloseAutoFocus: (event) => {
50
+ const confirmDestructive = (event) => {
51
+ if (destructiveAction === undefined)
52
+ return;
53
+ const result = destructiveAction.onSelect();
54
+ if (!(result instanceof Promise))
55
+ return;
56
+ // Keep the dialog open until the action settles.
57
+ event.preventDefault();
58
+ setIsPending(true);
59
+ result.then(() => {
60
+ setIsPending(false);
61
+ setIsConfirming(false);
62
+ }, () => {
63
+ // The app reports its own error; the dialog stays open so the reader can retry or cancel.
64
+ setIsPending(false);
65
+ });
66
+ };
67
+ const changeConfirming = (isOpen) => {
68
+ if (isPending)
69
+ return;
70
+ setIsConfirming(isOpen);
71
+ };
72
+ return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { ref: setTrigger, "data-slot": "row-actions-menu-trigger", type: "button", variant: "ghost", size: "icon", "aria-label": label, className: cn("text-muted-foreground", className), children: _jsx(Ellipsis, { strokeWidth: ICON_STROKE_WIDTH, "aria-hidden": "true" }) }) }), _jsxs(DropdownMenuContent, { align: align, onCloseAutoFocus: (event) => {
73
+ // An item that opened the app's dialog leaves focus to that dialog.
74
+ if (!isLeavingFocus.current)
75
+ return;
76
+ isLeavingFocus.current = false;
77
+ event.preventDefault();
78
+ }, children: [actions.map((action) => (_jsxs(DropdownMenuItem, { "data-row-action": action.id, className: ITEM_TOUCH_CLASS, disabled: action.isDisabled, onSelect: () => selectAction(action), children: [action.icon, action.label] }, action.label))), destructiveAction !== undefined && actions.length > 0 ? _jsx(DropdownMenuSeparator, {}) : null, destructiveAction !== undefined ? (_jsxs(DropdownMenuItem, { variant: "destructive", "data-row-action": destructiveAction.id, className: ITEM_TOUCH_CLASS, disabled: destructiveAction.isDisabled, onSelect: selectDestructive, children: [destructiveAction.icon, destructiveAction.label] })) : null] })] }), confirmation !== undefined && destructiveAction !== undefined ? (_jsx(AlertDialog, { open: isConfirming, onOpenChange: changeConfirming, children: _jsxs(AlertDialogContent, { size: "sm", onCloseAutoFocus: (event) => {
31
79
  // The menu item that opened the dialog is gone: focus goes back to the menu button.
32
80
  event.preventDefault();
33
81
  trigger.current?.focus();
34
- }, children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: confirmation.title }), confirmation.description !== undefined ? (_jsx(AlertDialogDescription, { children: confirmation.description })) : null] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: confirmation.cancelLabel }), _jsx(AlertDialogAction, { variant: "destructive", onClick: destructiveAction.onSelect, children: confirmation.confirmLabel })] })] }) })) : null] }));
82
+ }, children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: confirmation.title }), confirmation.description !== undefined ? (_jsx(AlertDialogDescription, { children: confirmation.description })) : null] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { disabled: isPending, children: confirmation.cancelLabel }), _jsx(AlertDialogAction, { variant: "destructive", disabled: isPending, "aria-busy": isPending || undefined, onClick: confirmDestructive, children: isPending ? (confirmation.pendingLabel ?? confirmation.confirmLabel) : confirmation.confirmLabel })] })] }) })) : null] }));
35
83
  }
36
84
  //# sourceMappingURL=RowActionsMenu.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RowActionsMenu.js","sourceRoot":"","sources":["../../src/notion/RowActionsMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAkB,MAAM,OAAO,CAAC;AAEzD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,GACjB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AACzC,OAAO,EACL,YAAY,EACZ,mBAAmB,EACnB,gBAAgB,EAChB,qBAAqB,EACrB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,iBAAi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S,IAAI,SAAS,EACjC,OAAO,EAAE,kBAAkB,YAE1B,SAAS,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,IAAI,YAAY,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,GAC/E,IACF,IACD,GACT,CACf,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softure-ai/theme-notion",
3
- "version": "0.35.0",
3
+ "version": "0.37.0",
4
4
  "description": "SOFTURE AI Notion theme: shadcn/ui components (new-york v4, Radix, Tailwind CSS v4, lucide) with the Notion design system's tokens and deltas, ready to import.",
5
5
  "license": "MIT",
6
6
  "type": "module",
package/src/index.ts CHANGED
@@ -63,7 +63,7 @@ export { Code, CodeBlock, type CodeBlockProps } from "./notion/Code.js";
63
63
  export { CopyButton, type CopyButtonProps } from "./notion/CopyButton.js";
64
64
  export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/DetailTable.js";
65
65
  export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProps } from "./notion/FilterChip.js";
66
- export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
66
+ export { FoldRow, type FoldRowAlign, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
67
67
  export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
68
68
  export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
69
69
  export {
@@ -67,8 +67,18 @@ export type FoldRowProps = FoldRowSummaryProps &
67
67
  readonly actions?: ReactNode;
68
68
  /** The item's status, drawn in the same column above the actions (with no actions, the column holds only it). */
69
69
  readonly status?: ReactNode;
70
+ /**
71
+ * How the bar lines up with a summary of several lines. `center` (default) centres the chevron and the right
72
+ * column vertically; `start` puts the chevron on the summary's first line (one line of `ui` text) and the right
73
+ * column at the top, the status on the first line and the actions under it.
74
+ */
75
+ readonly align?: FoldRowAlign;
70
76
  };
71
77
 
78
+ export type FoldRowAlign = "center" | "start";
79
+
80
+ const ITEMS_CLASS: Record<FoldRowAlign, string> = { center: "items-center", start: "items-start" };
81
+
72
82
  // The bar and its opened content share one 8 px horizontal inset, so the details start under the chevron; the inset
73
83
  // variant starts under the title instead (8 px inset, 16 px chevron, 8 px gap).
74
84
  const CONTENT_LAYOUT = "flex-col gap-2 px-2 py-3";
@@ -78,16 +88,18 @@ function FoldRowFixedSummary({
78
88
  title,
79
89
  facts = [],
80
90
  badges,
91
+ align,
81
92
  }: {
82
93
  readonly title: ReactNode;
83
94
  readonly facts?: readonly ReactNode[];
84
95
  readonly badges: readonly FoldRowBadge[];
96
+ readonly align: FoldRowAlign;
85
97
  }) {
86
98
  return (
87
99
  <>
88
100
  {/* The chevron and the title wrap as one: a long title folds onto lines beside its chevron. */}
89
- <span data-slot="fold-row-heading" className="flex min-w-0 items-center gap-2">
90
- <FoldRowChevron />
101
+ <span data-slot="fold-row-heading" className={cn("flex min-w-0", ITEMS_CLASS[align], "gap-2")}>
102
+ <FoldRowChevron align={align} />
91
103
  <span className="min-w-0 text-ui-medium">{title}</span>
92
104
  </span>
93
105
  {facts.map((fact, index) => (
@@ -118,14 +130,23 @@ function FoldRowFixedSummary({
118
130
  );
119
131
  }
120
132
 
121
- function FoldRowChevron() {
122
- return (
133
+ function FoldRowChevron({ align }: { readonly align: FoldRowAlign }) {
134
+ const chevron = (
123
135
  <ChevronRight
124
136
  aria-hidden="true"
125
137
  strokeWidth={ICON_STROKE_WIDTH}
126
138
  className="size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/fold-row:rotate-90"
127
139
  />
128
140
  );
141
+ if (align === "center") {
142
+ return chevron;
143
+ }
144
+ // A box one line of `ui` text high, so the chevron sits in the middle of the summary's first line.
145
+ return (
146
+ <span data-slot="fold-row-chevron" className="flex h-lh shrink-0 items-center text-ui">
147
+ {chevron}
148
+ </span>
149
+ );
129
150
  }
130
151
 
131
152
  function isDrawn(node: ReactNode): boolean {
@@ -134,7 +155,7 @@ function isDrawn(node: ReactNode): boolean {
134
155
 
135
156
  // An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
136
157
  export function FoldRow(props: FoldRowProps) {
137
- const { actions, status, isInset = false } = props;
158
+ const { actions, status, isInset = false, align = "center" } = props;
138
159
  if (!isDrawn(actions) && !isDrawn(status)) {
139
160
  return (
140
161
  <FoldRowDetails
@@ -160,7 +181,11 @@ export function FoldRow(props: FoldRowProps) {
160
181
  />
161
182
  <div
162
183
  data-slot="fold-row-actions"
163
- className="flex flex-wrap items-center gap-2 rounded-b-md pr-2 pb-1 pl-8 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent md:flex-col md:flex-nowrap md:items-end md:justify-center md:gap-1 md:rounded-b-none md:rounded-r-md md:py-1 md:pl-0"
184
+ className={cn(
185
+ "flex flex-wrap items-center gap-2 rounded-b-md pr-2 pb-1 pl-8 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent md:flex-col md:flex-nowrap md:items-end",
186
+ align === "start" ? "md:justify-start" : "md:justify-center",
187
+ "md:gap-1 md:rounded-b-none md:rounded-r-md md:py-1 md:pl-0",
188
+ )}
164
189
  >
165
190
  {isDrawn(status) ? (
166
191
  <div data-slot="fold-row-status" className="flex items-center">
@@ -203,26 +228,28 @@ function FoldRowDetails(
203
228
  readonly content?: ReactNode;
204
229
  },
205
230
  ) {
206
- const { isOpenInitially = false, size = "default", className, isLitByRow = false, content } = props;
231
+ const { isOpenInitially = false, size = "default", align = "center", className, isLitByRow = false, content } = props;
207
232
  return (
208
233
  <details data-slot="fold-row" open={isOpenInitially || undefined} className={cn("group/fold-row", className)}>
209
234
  <summary
210
235
  data-slot="fold-row-summary"
211
236
  className={cn(
212
- "flex cursor-pointer list-none flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-2 py-1",
237
+ "flex cursor-pointer list-none flex-wrap",
238
+ ITEMS_CLASS[align],
239
+ "gap-x-2 gap-y-1 rounded-md px-2 py-1",
213
240
  !isLitByRow && "transition-colors duration-120 group-open/fold-row:bg-accent hover:bg-accent",
214
241
  "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden",
215
242
  size === "touch" ? "min-h-touch-target" : "min-h-row-height",
216
243
  )}
217
244
  >
218
245
  {props.summary === undefined ? (
219
- <FoldRowFixedSummary title={props.title} facts={props.facts} badges={props.badges ?? []} />
246
+ <FoldRowFixedSummary title={props.title} facts={props.facts} badges={props.badges ?? []} align={align} />
220
247
  ) : (
221
248
  <>
222
- <FoldRowChevron />
249
+ <FoldRowChevron align={align} />
223
250
  <span
224
251
  data-slot="fold-row-summary-slot"
225
- className="flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1"
252
+ className={cn("flex min-w-0 flex-1 flex-wrap", ITEMS_CLASS[align], "gap-x-2 gap-y-1")}
226
253
  >
227
254
  {props.summary}
228
255
  </span>
@@ -115,9 +115,10 @@ function isDrawn(node: ReactNode): boolean {
115
115
 
116
116
  /**
117
117
  * A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
118
- * top of the right column and its controls under it. With `href` the title is a link stretched over the whole row, so
119
- * the row is one box lit on hover, and an arrow sits beside the column (never on a line of its own); the column stays
120
- * above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
118
+ * top of the right column and its controls under it. Both sides align to the top, so the state stands on the title's
119
+ * line however many detail lines the identity has. With `href` the title is a link stretched over the whole row, so
120
+ * the row is one box lit on hover, and an arrow sits beside the column on the title's line (never on a line of its
121
+ * own); the column stays above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
121
122
  *
122
123
  * Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
123
124
  * action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
@@ -146,7 +147,7 @@ export function ListEntry({
146
147
  <div
147
148
  data-slot="list-entry"
148
149
  className={cn(
149
- "relative flex w-full min-w-0 flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-2 py-(--list-row-y) text-ui transition-colors duration-100 hover:bg-accent",
150
+ "relative flex w-full min-w-0 flex-wrap items-start gap-x-3 gap-y-1 rounded-md px-2 py-(--list-row-y) text-ui transition-colors duration-100 hover:bg-accent",
150
151
  "has-[[data-slot=list-entry-title]:focus-visible]:ring-2 has-[[data-slot=list-entry-title]:focus-visible]:ring-ring",
151
152
  className,
152
153
  )}
@@ -175,7 +176,7 @@ export function ListEntry({
175
176
  {hasColumn || hasLink ? (
176
177
  <div
177
178
  data-slot="list-entry-side"
178
- className="group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-center gap-2 has-[[data-row-wide]]:ml-0 has-[[data-row-wide]]:basis-full"
179
+ className="group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-start gap-2 has-[[data-row-wide]]:ml-0 has-[[data-row-wide]]:basis-full"
179
180
  >
180
181
  {hasColumn ? (
181
182
  <div
@@ -212,7 +213,7 @@ export function ListEntry({
212
213
  </div>
213
214
  ) : null}
214
215
  {hasLink ? (
215
- <span data-slot="list-entry-arrow" aria-hidden="true" className="flex shrink-0 text-muted-foreground">
216
+ <span data-slot="list-entry-arrow" aria-hidden="true" className="flex h-5 shrink-0 items-center text-muted-foreground">
216
217
  <ChevronRight strokeWidth={ICON_STROKE_WIDTH} className="size-4" />
217
218
  </span>
218
219
  ) : null}
@@ -1,5 +1,5 @@
1
1
  import { Circle, CircleCheck, CircleMinus, CircleX, LoaderCircle, TriangleAlert, type LucideIcon } from "lucide-react";
2
- import type { ReactNode } from "react";
2
+ import type { ComponentProps, ReactNode } from "react";
3
3
 
4
4
  import { cn } from "../lib/utils.js";
5
5
  import { Badge } from "../ui/badge.js";
@@ -16,7 +16,12 @@ export const RESULT_BADGE_ICONS: Readonly<Record<Tone, LucideIcon>> = {
16
16
  muted: CircleMinus,
17
17
  };
18
18
 
19
- export interface ResultBadgeProps {
19
+ /**
20
+ * The badge's remaining `span` props (`data-*`, `id`, ARIA, handlers) reach the element, so an app can mark a badge with
21
+ * what it shows (`data-read-status="ok"`). The theme's own `data-slot`, `data-tone`, `data-color` and `data-spinning`
22
+ * always win, and the look (`variant`, `color`) is the theme's.
23
+ */
24
+ export interface ResultBadgeProps extends Omit<ComponentProps<"span">, "color" | "children" | "title" | "className"> {
20
25
  /** What the result means; the theme owns its colour (`TONE_COLORS`), so one result reads alike in every list. */
21
26
  readonly tone: Tone;
22
27
  /** The app's own icon in place of the tone's default (a spinning run defaults to a loader). */
@@ -37,10 +42,11 @@ function getPlainText(children: ReactNode): string | undefined {
37
42
 
38
43
  // A result (passed, failed, skipped, running): a filled tag in its tone's colour, with an icon and a word. The filled
39
44
  // counterpart of `Status`, for a list whose rows each end in a result.
40
- export function ResultBadge({ tone, icon, isSpinning = false, children, title, className }: ResultBadgeProps) {
45
+ export function ResultBadge({ tone, icon, isSpinning = false, children, title, className, ...attributes }: ResultBadgeProps) {
41
46
  const Icon = icon ?? (isSpinning ? LoaderCircle : RESULT_BADGE_ICONS[tone]);
42
47
  return (
43
48
  <Badge
49
+ {...attributes}
44
50
  variant="tag"
45
51
  color={TONE_COLORS[tone] ?? "default"}
46
52
  data-slot="result-badge"
@@ -1,7 +1,7 @@
1
1
  "use client";
2
2
 
3
3
  import { Ellipsis } from "lucide-react";
4
- import { useRef, useState, type ReactNode } from "react";
4
+ import { useCallback, useRef, useState, type MouseEvent, type ReactNode, type Ref } from "react";
5
5
 
6
6
  import { cn } from "../lib/utils.js";
7
7
  import { en as messages } from "../messages/en.js";
@@ -28,11 +28,18 @@ import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
28
28
 
29
29
  /** One secondary action of a row: its words, an optional icon, and what it does. */
30
30
  export interface RowMenuAction {
31
+ /** A stable hook for browser tests, rendered as `data-row-action` on the item. */
32
+ readonly id?: string;
31
33
  readonly label: string;
32
34
  /** A line icon before the words (the theme's stroke and size apply). */
33
35
  readonly icon?: ReactNode;
34
36
  readonly onSelect: () => void;
35
37
  readonly isDisabled?: boolean;
38
+ /**
39
+ * The action opens the app's own dialog: the menu leaves focus to that dialog when it closes instead of taking it
40
+ * back to its button. Return focus to the button from the dialog's `onCloseAutoFocus` through `triggerRef`.
41
+ */
42
+ readonly opensDialog?: boolean;
36
43
  }
37
44
 
38
45
  /** The confirmation a destructive action asks for: the app's own copy. */
@@ -41,12 +48,20 @@ export interface RowMenuConfirmation {
41
48
  readonly description?: ReactNode;
42
49
  /** The words of the destructive confirm button. */
43
50
  readonly confirmLabel: string;
51
+ /** The words of the confirm button while an async action runs ("Deleting…"); `confirmLabel` when not given. */
52
+ readonly pendingLabel?: string;
44
53
  /** The words of the button that keeps things as they are. */
45
54
  readonly cancelLabel: string;
46
55
  }
47
56
 
48
57
  /** The destructive action of a row (delete, revoke): last in the menu, in the danger tone. */
49
- export interface RowMenuDestructiveAction extends RowMenuAction {
58
+ export interface RowMenuDestructiveAction extends Omit<RowMenuAction, "onSelect"> {
59
+ /**
60
+ * What the action does. With `confirm` it may return a promise (a server action): the dialog then stays open with
61
+ * both buttons disabled and `pendingLabel` on the confirm button until it settles, closes when it resolves and stays
62
+ * open when it rejects. The app reports the error itself; the menu only keeps the dialog open.
63
+ */
64
+ readonly onSelect: () => void | Promise<unknown>;
50
65
  /** Ask first: the action runs only after the alert dialog's confirm button. Without it the action runs at once. */
51
66
  readonly confirm?: RowMenuConfirmation;
52
67
  }
@@ -60,9 +75,19 @@ export interface RowActionsMenuProps {
60
75
  readonly label?: string;
61
76
  /** The menu's edge against the button; `end` (the row's right edge) by default. */
62
77
  readonly align?: "start" | "center" | "end";
78
+ /** Reaches the menu button, so an app's dialog opened from the menu can return focus to it. */
79
+ readonly triggerRef?: Ref<HTMLButtonElement>;
63
80
  readonly className?: string;
64
81
  }
65
82
 
83
+ // Below `md` every item is the touch target, as the row's own controls are; a desktop keeps the compact items.
84
+ const ITEM_TOUCH_CLASS = "max-md:min-h-touch-target";
85
+
86
+ function assignRef<T>(ref: Ref<T> | undefined, value: T | null): void {
87
+ if (typeof ref === "function") ref(value);
88
+ else if (ref !== null && ref !== undefined) ref.current = value;
89
+ }
90
+
66
91
  /**
67
92
  * A row's overflow menu: an icon-only "More actions" button that opens a menu of the row's secondary actions, the
68
93
  * destructive one last, after a separator and in the danger tone, optionally confirmed in an alert dialog. Opens with
@@ -74,27 +99,69 @@ export function RowActionsMenu({
74
99
  destructiveAction,
75
100
  label = messages.rowActions.more,
76
101
  align = "end",
102
+ triggerRef,
77
103
  className,
78
104
  }: RowActionsMenuProps) {
79
105
  const [isConfirming, setIsConfirming] = useState(false);
80
- const trigger = useRef<HTMLButtonElement>(null);
106
+ const [isPending, setIsPending] = useState(false);
107
+ const trigger = useRef<HTMLButtonElement | null>(null);
108
+ const isLeavingFocus = useRef(false);
81
109
  const confirmation = destructiveAction?.confirm;
82
110
 
111
+ const setTrigger = useCallback(
112
+ (node: HTMLButtonElement | null) => {
113
+ trigger.current = node;
114
+ assignRef(triggerRef, node);
115
+ },
116
+ [triggerRef],
117
+ );
118
+
119
+ const selectAction = (action: RowMenuAction) => {
120
+ isLeavingFocus.current = action.opensDialog === true;
121
+ action.onSelect();
122
+ };
123
+
83
124
  const selectDestructive = () => {
84
125
  if (destructiveAction === undefined) return;
126
+ isLeavingFocus.current = false;
85
127
  if (confirmation === undefined) {
86
- destructiveAction.onSelect();
128
+ // The menu is already closed, so a returned promise is the app's to handle.
129
+ void destructiveAction.onSelect();
87
130
  return;
88
131
  }
89
132
  setIsConfirming(true);
90
133
  };
91
134
 
135
+ const confirmDestructive = (event: MouseEvent<HTMLButtonElement>) => {
136
+ if (destructiveAction === undefined) return;
137
+ const result = destructiveAction.onSelect();
138
+ if (!(result instanceof Promise)) return;
139
+ // Keep the dialog open until the action settles.
140
+ event.preventDefault();
141
+ setIsPending(true);
142
+ result.then(
143
+ () => {
144
+ setIsPending(false);
145
+ setIsConfirming(false);
146
+ },
147
+ () => {
148
+ // The app reports its own error; the dialog stays open so the reader can retry or cancel.
149
+ setIsPending(false);
150
+ },
151
+ );
152
+ };
153
+
154
+ const changeConfirming = (isOpen: boolean) => {
155
+ if (isPending) return;
156
+ setIsConfirming(isOpen);
157
+ };
158
+
92
159
  return (
93
160
  <>
94
161
  <DropdownMenu>
95
162
  <DropdownMenuTrigger asChild>
96
163
  <Button
97
- ref={trigger}
164
+ ref={setTrigger}
98
165
  data-slot="row-actions-menu-trigger"
99
166
  type="button"
100
167
  variant="ghost"
@@ -105,16 +172,36 @@ export function RowActionsMenu({
105
172
  <Ellipsis strokeWidth={ICON_STROKE_WIDTH} aria-hidden="true" />
106
173
  </Button>
107
174
  </DropdownMenuTrigger>
108
- <DropdownMenuContent align={align}>
175
+ <DropdownMenuContent
176
+ align={align}
177
+ onCloseAutoFocus={(event) => {
178
+ // An item that opened the app's dialog leaves focus to that dialog.
179
+ if (!isLeavingFocus.current) return;
180
+ isLeavingFocus.current = false;
181
+ event.preventDefault();
182
+ }}
183
+ >
109
184
  {actions.map((action) => (
110
- <DropdownMenuItem key={action.label} disabled={action.isDisabled} onSelect={action.onSelect}>
185
+ <DropdownMenuItem
186
+ key={action.label}
187
+ data-row-action={action.id}
188
+ className={ITEM_TOUCH_CLASS}
189
+ disabled={action.isDisabled}
190
+ onSelect={() => selectAction(action)}
191
+ >
111
192
  {action.icon}
112
193
  {action.label}
113
194
  </DropdownMenuItem>
114
195
  ))}
115
196
  {destructiveAction !== undefined && actions.length > 0 ? <DropdownMenuSeparator /> : null}
116
197
  {destructiveAction !== undefined ? (
117
- <DropdownMenuItem variant="destructive" disabled={destructiveAction.isDisabled} onSelect={selectDestructive}>
198
+ <DropdownMenuItem
199
+ variant="destructive"
200
+ data-row-action={destructiveAction.id}
201
+ className={ITEM_TOUCH_CLASS}
202
+ disabled={destructiveAction.isDisabled}
203
+ onSelect={selectDestructive}
204
+ >
118
205
  {destructiveAction.icon}
119
206
  {destructiveAction.label}
120
207
  </DropdownMenuItem>
@@ -122,7 +209,7 @@ export function RowActionsMenu({
122
209
  </DropdownMenuContent>
123
210
  </DropdownMenu>
124
211
  {confirmation !== undefined && destructiveAction !== undefined ? (
125
- <AlertDialog open={isConfirming} onOpenChange={setIsConfirming}>
212
+ <AlertDialog open={isConfirming} onOpenChange={changeConfirming}>
126
213
  <AlertDialogContent
127
214
  size="sm"
128
215
  onCloseAutoFocus={(event) => {
@@ -138,9 +225,14 @@ export function RowActionsMenu({
138
225
  ) : null}
139
226
  </AlertDialogHeader>
140
227
  <AlertDialogFooter>
141
- <AlertDialogCancel>{confirmation.cancelLabel}</AlertDialogCancel>
142
- <AlertDialogAction variant="destructive" onClick={destructiveAction.onSelect}>
143
- {confirmation.confirmLabel}
228
+ <AlertDialogCancel disabled={isPending}>{confirmation.cancelLabel}</AlertDialogCancel>
229
+ <AlertDialogAction
230
+ variant="destructive"
231
+ disabled={isPending}
232
+ aria-busy={isPending || undefined}
233
+ onClick={confirmDestructive}
234
+ >
235
+ {isPending ? (confirmation.pendingLabel ?? confirmation.confirmLabel) : confirmation.confirmLabel}
144
236
  </AlertDialogAction>
145
237
  </AlertDialogFooter>
146
238
  </AlertDialogContent>