@softure-ai/theme-notion 0.26.0 → 0.27.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,19 @@ 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.27.0
8
+
9
+ - Sticky group heading for `List` (#1350): `ListGroup` and `ListGroupHeading`, a run of rows under a heading that sticks
10
+ at the top of its scroll container while the rows pass under it and is pushed away by the next group's heading. The
11
+ group holds the side room the heading bleeds over, so the heading spans the scrollport; the heading is
12
+ `text-ui-medium` on `background` with a `border` line under it (`surface="tinted"`: `secondary` with a `background`
13
+ line), 40 px high, and every `ListItem` in the group stops below it when scrolled into view. `asChild` keeps the
14
+ app's `section` and `h3`; `LIST_CLASSES.group`, `groupHeading`, `tintedGroupHeading` give the classes to a group the
15
+ app renders itself.
16
+ - Migration: none; no existing component changes. An app that composes the heading from tokens (`sticky top-0 z-10
17
+ -mx-2 px-4 py-2 bg-background border-b`, `scroll-mt-10` on each item) can move to `ListGroup`; its scroll container
18
+ drops its own padding.
19
+
7
20
  ## 0.26.0
8
21
 
9
22
  - `DetailTable` is laid out fixed at its container's width (`table-fixed`, #1349): a long unbreakable value (a
package/README.md CHANGED
@@ -149,6 +149,7 @@ stages with a state, below), `Timeline` (dated entries on a vertical rail, below
149
149
  `Prose` (the text styles of a long read the app does not draw itself, such as Markdown rendered to HTML, below),
150
150
  `SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below),
151
151
  `List`, `ListItem` and `ListRow` (a list of rows, compact or roomy by the page's density, below),
152
+ `ListGroup` and `ListGroupHeading` (a run of rows under a heading that sticks at the top of its scroll, below),
152
153
  `MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
153
154
  `UpdatePrompt` (the offer to reload into a new build, for an installed app, below),
154
155
  `InstallBar` (the offer to install the app on a phone, below),
@@ -489,6 +490,41 @@ scheme the theme's `border` is that card's own grey.
489
490
  renders with other components, `LIST_CLASSES` holds the same classes (`list`, `tintedList`, `item`, `row`), e.g.
490
491
  `<SortableList className={LIST_CLASSES.list}>` with `<SortableItem className={LIST_CLASSES.item}>`.
491
492
 
493
+ **`ListGroup`, `ListGroupHeading`: a sticky group heading.** A heading over a run of rows (a country's days, a month's
494
+ entries) that sticks at the top of the scroll container while its rows pass under it, and is pushed away by the next
495
+ group's heading. Put the groups straight in the scrolling element and give it no padding: a sticky box sticks at the
496
+ scroll container's padding edge, so top padding would leave a strip above the stuck heading. `ListGroup` holds the side
497
+ room (`px-2`) and the heading bleeds over it (`-mx-2 px-4`), so the heading spans the whole scrollport and its text
498
+ lines up with the rows'. The heading is `text-ui-medium` in `foreground` on the page's `background` with a `border`
499
+ line under it, 40 px high; every `ListItem` in the group gets the same scroll margin, so a row scrolled into view
500
+ (`scrollIntoView({ block: "nearest" })`) stops below the heading. On a grey card pass `surface="tinted"` to both the
501
+ heading and the list: the heading takes `secondary` and its line the page's `background`.
502
+
503
+ ```tsx
504
+ <div className="h-full overflow-y-auto">
505
+ {countries.map((country) => (
506
+ <ListGroup key={country.id} asChild aria-labelledby={`country-${country.id}`}>
507
+ <section>
508
+ <ListGroupHeading asChild>
509
+ <h3 id={`country-${country.id}`}>{country.name}</h3>
510
+ </ListGroupHeading>
511
+ <List as="ol" aria-label={`Days in ${country.name}`}>
512
+ {country.days.map((day) => (
513
+ <ListItem key={day.id}>
514
+ <ListRow asChild>
515
+ <button type="button" onClick={() => open(day.id)}>{day.label}</button>
516
+ </ListRow>
517
+ </ListItem>
518
+ ))}
519
+ </List>
520
+ </section>
521
+ </ListGroup>
522
+ ))}
523
+ </div>
524
+ ```
525
+
526
+ `LIST_CLASSES.group`, `groupHeading` and `tintedGroupHeading` give the same classes to a group the app renders itself.
527
+
492
528
  **`MiniProgress`.** A share with its figure inside the bar, for a table cell or a tile where a figure next to a
493
529
  `Progress` would collide with it: a 20 px rounded track (`primary/12`) that takes the cell's width (at least 64 px),
494
530
  filled in `primary` (the link blue in dark, as in `Progress`) or in its `tone`'s colour. `value` is 0–100, clamped
package/dist/index.d.ts CHANGED
@@ -50,7 +50,7 @@ export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProp
50
50
  export { FoldRow, 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
- export { LIST_CLASSES, List, ListItem, ListRow, type ListItemProps, type ListProps, type ListRowProps, type ListSurface, } from "./notion/List.js";
53
+ export { LIST_CLASSES, List, ListGroup, ListGroupHeading, ListItem, ListRow, type ListGroupHeadingProps, type ListGroupProps, type ListItemProps, type ListProps, type ListRowProps, type ListSurface, } from "./notion/List.js";
54
54
  export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
55
55
  export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
56
56
  export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.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,cAA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AK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -52,7 +52,7 @@ export { FilterChip, FilterChipAdd } from "./notion/FilterChip.js";
52
52
  export { FoldRow } from "./notion/FoldRow.js";
53
53
  export { InstallBar } from "./notion/InstallBar.js";
54
54
  export { LaunchScreen } from "./notion/LaunchScreen.js";
55
- export { LIST_CLASSES, List, ListItem, ListRow, } from "./notion/List.js";
55
+ export { LIST_CLASSES, List, ListGroup, ListGroupHeading, ListItem, ListRow, } from "./notion/List.js";
56
56
  export { PALETTE_COLORS } from "./notion/palette.js";
57
57
  export { MarkPopover } from "./notion/MarkPopover.js";
58
58
  export { MiniProgress } from "./notion/MiniProgress.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,oGAAoG;AACpG,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAuB,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,C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L,SAAS,EACT,SAAS,EACT,SAAS,GAOV,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAAE,SAAS,EAA+E,MAAM,uBAAuB,CAAC;AAC/H,OAAO,EAAE,QAAQ,EAA4C,MAAM,sBAAsB,CAAC;AAC1F,OAAO,EAAE,MAAM,EAAoB,MAAM,oBAAoB,CAAC;AAC9D,OAAO,EAAE,KAAK,EAAoE,MAAM,mBAAmB,CAAC;AAC5G,OAAO,EAAE,MAAM,EAAqC,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAA0G,MAAM,sBAAsB,CAAC;AACxJ,OAAO,EAAE,aAAa,EAA2B,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAqB,MAAM,2BAA2B,CAAC;AACpG,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,GAOf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAA0C,MAAM,wBAAwB,CAAC;AACjG,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,GAQX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
@@ -8,12 +8,19 @@ import type { ComponentProps } from "react";
8
8
  * dark scheme `border` is the card's own grey.
9
9
  * - `item`: the room between a row and the lines around it, so a row's rounded hover never touches a line.
10
10
  * - `row`: a row's padding and hover, for a button or link that fills its item.
11
+ * - `group`: a run of lists under a sticky heading, with the side room the heading bleeds over; every item in it stops
12
+ * below the heading when scrolled into view.
13
+ * - `groupHeading` / `tintedGroupHeading`: the heading that sticks at the top of the scroll container, on the page's
14
+ * `background` or on a tinted card's `secondary`, with the list's line under it.
11
15
  */
12
16
  export declare const LIST_CLASSES: {
13
17
  readonly list: "flex flex-col divide-y-(length:--list-divider-width) divide-border";
14
18
  readonly tintedList: "flex flex-col divide-y-(length:--list-divider-width) divide-background";
15
19
  readonly item: "py-(--list-item-y)";
16
20
  readonly row: "flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-(--list-row-y) text-start text-ui outline-none transition-colors duration-100 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
21
+ readonly group: "px-2 **:data-[slot=list-item]:scroll-mt-10";
22
+ readonly groupHeading: "sticky top-0 z-10 -mx-2 flex min-h-10 items-center border-b border-border bg-background px-4 py-2 text-ui-medium text-foreground";
23
+ readonly tintedGroupHeading: "sticky top-0 z-10 -mx-2 flex min-h-10 items-center border-b border-background bg-secondary px-4 py-2 text-ui-medium text-foreground";
17
24
  };
18
25
  export type ListSurface = "page" | "tinted";
19
26
  export type ListProps = Omit<ComponentProps<"ul">, "ref"> & {
@@ -41,4 +48,23 @@ export type ListRowProps = ComponentProps<"div"> & {
41
48
  };
42
49
  /** A row in a `ListItem`: full width, the density's vertical padding, the theme's hover. */
43
50
  export declare function ListRow({ asChild, className, ...props }: ListRowProps): import("react").JSX.Element;
51
+ export type ListGroupProps = ComponentProps<"div"> & {
52
+ /** Renders the child element (a `section`, an app's own `li`) with the group's classes. */
53
+ readonly asChild?: boolean;
54
+ };
55
+ /**
56
+ * A run of rows under a `ListGroupHeading` (a country's days, a month's entries), placed straight in the scroll
57
+ * container, which has no top padding of its own: the heading sticks at the top while the group's rows pass under it,
58
+ * and the next group's heading pushes it away. The group holds the side room the heading bleeds over, so the heading
59
+ * spans the whole scrollport; a row scrolled into view (`block: "nearest"`) stops below the heading.
60
+ */
61
+ export declare function ListGroup({ asChild, className, ...props }: ListGroupProps): import("react").JSX.Element;
62
+ export type ListGroupHeadingProps = ComponentProps<"div"> & {
63
+ /** `tinted` on a grey card: the heading takes the card's `secondary`, its line the page's `background`. */
64
+ readonly surface?: ListSurface;
65
+ /** Renders the child element (an `h2`, an `h3`) as the heading, keeping its own element. */
66
+ readonly asChild?: boolean;
67
+ };
68
+ /** The heading of a `ListGroup`: sticks at the top of the scroll container, full width, a line under it. */
69
+ export declare function ListGroupHeading({ surface, asChild, className, ...props }: ListGroupHeadingProps): import("react").JSX.Element;
44
70
  //# sourceMappingURL=List.d.ts.map
@@ -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;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;aACvB,IAAI,EAAE,oEAAoE;aAC1E,UAAU,EAAE,wEAAwE;aACpF,IAAI,EAAE,oBAAoB;aAC1B,GAAG,EAAE,uPAAuP;CACpP,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,GAAG,KAAK,EAAE,EAAE,SAAS,+BAUrG;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG;IACjD,8FAA8F;IAC9F,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,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10
10
  * - `item`: the room between a row and the lines around it, so a row's rounded hover never touches a line.
11
11
  * - `row`: a row's padding and hover, for a button or link that fills its item.
12
+ * - `group`: a run of lists under a sticky heading, with the side room the heading bleeds over; every item in it stops
13
+ * below the heading when scrolled into view.
14
+ * - `groupHeading` / `tintedGroupHeading`: the heading that sticks at the top of the scroll container, on the page's
15
+ * `background` or on a tinted card's `secondary`, with the list's line under it.
12
16
  */
13
17
  export const LIST_CLASSES = {
14
18
  list: "flex flex-col divide-y-(length:--list-divider-width) divide-border",
15
19
  tintedList: "flex flex-col divide-y-(length:--list-divider-width) divide-background",
16
20
  item: "py-(--list-item-y)",
17
21
  row: "flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-(--list-row-y) text-start text-ui outline-none transition-colors duration-100 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
22
+ group: "px-2 **:data-[slot=list-item]:scroll-mt-10",
23
+ groupHeading: "sticky top-0 z-10 -mx-2 flex min-h-10 items-center border-b border-border bg-background px-4 py-2 text-ui-medium text-foreground",
24
+ tintedGroupHeading: "sticky top-0 z-10 -mx-2 flex min-h-10 items-center border-b border-background bg-secondary px-4 py-2 text-ui-medium text-foreground",
18
25
  };
19
26
  /**
20
27
  * A list of rows that follows the density: compact (tight rows, no line, the default) or roomy (a quiet line between
@@ -33,4 +40,19 @@ export function ListRow({ asChild = false, className, ...props }) {
33
40
  const Comp = asChild ? Slot.Root : "div";
34
41
  return _jsx(Comp, { "data-slot": "list-row", className: cn(LIST_CLASSES.row, className), ...props });
35
42
  }
43
+ /**
44
+ * A run of rows under a `ListGroupHeading` (a country's days, a month's entries), placed straight in the scroll
45
+ * container, which has no top padding of its own: the heading sticks at the top while the group's rows pass under it,
46
+ * and the next group's heading pushes it away. The group holds the side room the heading bleeds over, so the heading
47
+ * spans the whole scrollport; a row scrolled into view (`block: "nearest"`) stops below the heading.
48
+ */
49
+ export function ListGroup({ asChild = false, className, ...props }) {
50
+ const Comp = asChild ? Slot.Root : "div";
51
+ return _jsx(Comp, { "data-slot": "list-group", className: cn(LIST_CLASSES.group, className), ...props });
52
+ }
53
+ /** The heading of a `ListGroup`: sticks at the top of the scroll container, full width, a line under it. */
54
+ export function ListGroupHeading({ surface = "page", asChild = false, className, ...props }) {
55
+ const Comp = asChild ? Slot.Root : "div";
56
+ return (_jsx(Comp, { "data-slot": "list-group-heading", "data-surface": surface, className: cn(surface === "tinted" ? LIST_CLASSES.tintedGroupHeading : LIST_CLASSES.groupHeading, className), ...props }));
57
+ }
36
58
  //# sourceMappingURL=List.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/notion/List.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,oEAAoE;IAC1E,UAAU,EAAE,wEAAwE;IACpF,IAAI,EAAE,oBAAoB;IAC1B,GAAG,EAAE,uPAAuP;CACpP,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;IAC9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M,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softure-ai/theme-notion",
3
- "version": "0.26.0",
3
+ "version": "0.27.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
@@ -69,8 +69,12 @@ export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
69
69
  export {
70
70
  LIST_CLASSES,
71
71
  List,
72
+ ListGroup,
73
+ ListGroupHeading,
72
74
  ListItem,
73
75
  ListRow,
76
+ type ListGroupHeadingProps,
77
+ type ListGroupProps,
74
78
  type ListItemProps,
75
79
  type ListProps,
76
80
  type ListRowProps,
@@ -12,12 +12,21 @@ import { cn } from "../lib/utils.js";
12
12
  * dark scheme `border` is the card's own grey.
13
13
  * - `item`: the room between a row and the lines around it, so a row's rounded hover never touches a line.
14
14
  * - `row`: a row's padding and hover, for a button or link that fills its item.
15
+ * - `group`: a run of lists under a sticky heading, with the side room the heading bleeds over; every item in it stops
16
+ * below the heading when scrolled into view.
17
+ * - `groupHeading` / `tintedGroupHeading`: the heading that sticks at the top of the scroll container, on the page's
18
+ * `background` or on a tinted card's `secondary`, with the list's line under it.
15
19
  */
16
20
  export const LIST_CLASSES = {
17
21
  list: "flex flex-col divide-y-(length:--list-divider-width) divide-border",
18
22
  tintedList: "flex flex-col divide-y-(length:--list-divider-width) divide-background",
19
23
  item: "py-(--list-item-y)",
20
24
  row: "flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-(--list-row-y) text-start text-ui outline-none transition-colors duration-100 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
25
+ group: "px-2 **:data-[slot=list-item]:scroll-mt-10",
26
+ groupHeading:
27
+ "sticky top-0 z-10 -mx-2 flex min-h-10 items-center border-b border-border bg-background px-4 py-2 text-ui-medium text-foreground",
28
+ tintedGroupHeading:
29
+ "sticky top-0 z-10 -mx-2 flex min-h-10 items-center border-b border-background bg-secondary px-4 py-2 text-ui-medium text-foreground",
21
30
  } as const;
22
31
 
23
32
  export type ListSurface = "page" | "tinted";
@@ -68,3 +77,39 @@ export function ListRow({ asChild = false, className, ...props }: ListRowProps)
68
77
  const Comp = asChild ? Slot.Root : "div";
69
78
  return <Comp data-slot="list-row" className={cn(LIST_CLASSES.row, className)} {...props} />;
70
79
  }
80
+
81
+ export type ListGroupProps = ComponentProps<"div"> & {
82
+ /** Renders the child element (a `section`, an app's own `li`) with the group's classes. */
83
+ readonly asChild?: boolean;
84
+ };
85
+
86
+ /**
87
+ * A run of rows under a `ListGroupHeading` (a country's days, a month's entries), placed straight in the scroll
88
+ * container, which has no top padding of its own: the heading sticks at the top while the group's rows pass under it,
89
+ * and the next group's heading pushes it away. The group holds the side room the heading bleeds over, so the heading
90
+ * spans the whole scrollport; a row scrolled into view (`block: "nearest"`) stops below the heading.
91
+ */
92
+ export function ListGroup({ asChild = false, className, ...props }: ListGroupProps) {
93
+ const Comp = asChild ? Slot.Root : "div";
94
+ return <Comp data-slot="list-group" className={cn(LIST_CLASSES.group, className)} {...props} />;
95
+ }
96
+
97
+ export type ListGroupHeadingProps = ComponentProps<"div"> & {
98
+ /** `tinted` on a grey card: the heading takes the card's `secondary`, its line the page's `background`. */
99
+ readonly surface?: ListSurface;
100
+ /** Renders the child element (an `h2`, an `h3`) as the heading, keeping its own element. */
101
+ readonly asChild?: boolean;
102
+ };
103
+
104
+ /** The heading of a `ListGroup`: sticks at the top of the scroll container, full width, a line under it. */
105
+ export function ListGroupHeading({ surface = "page", asChild = false, className, ...props }: ListGroupHeadingProps) {
106
+ const Comp = asChild ? Slot.Root : "div";
107
+ return (
108
+ <Comp
109
+ data-slot="list-group-heading"
110
+ data-surface={surface}
111
+ className={cn(surface === "tinted" ? LIST_CLASSES.tintedGroupHeading : LIST_CLASSES.groupHeading, className)}
112
+ {...props}
113
+ />
114
+ );
115
+ }