@softure-ai/theme-notion 0.6.0 → 0.7.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,13 @@ 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.7.0
8
+
9
+ - `Timeline` (#838): a new composition for dated entries on one vertical rail: a marker in a palette colour with an
10
+ optional icon, the time, title, description, badges and content, `compact` minor entries between major ones, a
11
+ dashed rail for something missing, the body as a button (`onSelect`, `actionLabel`) and marks at the right edge
12
+ outside it (`aside`). An app that drew a timeline from list rows with coloured left borders moves to `Timeline`.
13
+
7
14
  ## 0.6.0
8
15
 
9
16
  - `FoldRow` (#832): the opened content (`fold-row-content`) is padded equally on all four sides (`p-3`, 12 px) instead
package/README.md CHANGED
@@ -123,7 +123,7 @@ and more, a native `<details>`), `PageFrame` (a page outside the app shell, the
123
123
  `SidePanel` (a non-modal panel at a side of a canvas, below), `TabBar` (a screen's tabs as links with an optional icon
124
124
  and count, the shown tab in the address; `Tabs` keeps it in client state), `MarkPopover` (a counted tag that opens a
125
125
  list of what it counts, below), `FilterChip` and `FilterChipAdd` (a list's filter pills, below), `Steps` (numbered
126
- stages with a state, below), `Code` (inline code) and `CodeBlock` (a mono block for logs and paths, below),
126
+ stages with a state, below), `Timeline` (dated entries on a vertical rail, below), `Code` (inline code) and `CodeBlock` (a mono block for logs and paths, below),
127
127
  `SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below).
128
128
 
129
129
  **`FoldRow`.** An item as one list row in a native `<details>`: a chevron, the title, short facts and badges on the
@@ -219,6 +219,36 @@ reader (`stateLabels` replaces the English words). `data-slot="steps"`, `data-st
219
219
  />
220
220
  ```
221
221
 
222
+ A dated sequence: `Timeline` (a trip's stays and the moves between them, an order's history, a project's milestones).
223
+ An `<ol>` named by `label` where each entry sits on one continuous vertical rail, running from the first marker to the
224
+ last: a marker in a palette `color` (`gray` by default) with an optional Lucide `icon`, then the body: an optional `time`
225
+ (muted, tabular figures), the `title`, an optional muted `description`, an optional `badges` row (statuses, tags) and
226
+ optional `children` under it (deadlines, notes). `size` `default` is a major entry (a 24 px round marker in the colour's
227
+ tag fill, the time above the title); `compact` is a minor entry between two major ones (the icon or a dot in the
228
+ colour on the page, the time after the title, the description and badges on one wrapping line). `line: "dashed"` dashes the rail through an entry for something
229
+ missing. With `onSelect` the body is a button; `actionLabel` is read before its visible text ("Show on the map"), so
230
+ the button's name says what it does and still contains every word it shows; `aside` sits at the right edge outside that
231
+ button, so a mark with its own popover never nests in it. The colour never carries a meaning alone: put the state in
232
+ words in `badges`. `data` sets an app's own `data-*` attributes on the item. `data-slot="timeline"`,
233
+ `timeline-item` (with `data-item`, `data-size`, `data-line`), `timeline-rail`, `timeline-marker`, `timeline-item-body`
234
+ and the body's parts mark the parts.
235
+
236
+ ```tsx
237
+ <Timeline
238
+ label="Trip"
239
+ items={[
240
+ { key: "flight", size: "compact", icon: Plane, color: "green", title: "Flight", time: "7 Dec, 07:15", description: "Home → Hanoi" },
241
+ {
242
+ key: "hanoi", icon: BedDouble, color: "green", time: "8–9 Dec · 2 nights", title: "Hanoi",
243
+ badges: <Status color="green" icon={CircleCheck}>Booked</Status>,
244
+ onSelect: () => showOnMap("hanoi"), actionLabel: "Show on the map",
245
+ },
246
+ { key: "sapa", icon: CircleDashed, color: "yellow", line: "dashed", time: "11–12 Dec", title: "Sa Pa",
247
+ badges: <Status color="yellow" icon={CircleDashed}>No stay</Status> },
248
+ ]}
249
+ />
250
+ ```
251
+
222
252
  **`MarkPopover`.** A tag in a palette colour with an icon and a count; a click or Enter opens the design system's
223
253
  popover listing the entries, Escape or a click outside closes it. It runs on the browser's Popover API (no client
224
254
  state, no portal): the panel sits in the top layer, so a card's `overflow` never clips it, centred on a phone and
package/dist/index.d.ts CHANGED
@@ -55,5 +55,6 @@ export { StatCards, StatPills, StatsFold, type StatCard, type StatCardAside, typ
55
55
  export { Status, type StatusProps } from "./notion/Status.js";
56
56
  export { Steps, type StepItem, type StepState, type StepsLayout, type StepsProps } from "./notion/Steps.js";
57
57
  export { TabBar, type TabBarItem, type TabBarProps } from "./notion/TabBar.js";
58
+ export { Timeline, type TimelineItem, type TimelineItemSize, type TimelineLine, type TimelineProps } from "./notion/Timeline.js";
58
59
  export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT, type Tone } from "./notion/tones.js";
59
60
  //# sourceMappingURL=index.d.ts.map
@@ -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;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AE,MAAM,EAAE,KAAK,UAAU,EAAE,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAE,KAAK,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACjI,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -57,5 +57,6 @@ export { StatCards, StatPills, StatsFold, } from "./notion/Stats.js";
57
57
  export { Status } from "./notion/Status.js";
58
58
  export { Steps } from "./notion/Steps.js";
59
59
  export { TabBar } from "./notion/TabBar.js";
60
+ export { Timeline } from "./notion/Timeline.js";
60
61
  export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT } from "./notion/tones.js";
61
62
  //# sourceMappingURL=index.js.map
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,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CA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AAS,EACT,SAAS,EACT,SAAS,GAOV,MAAM,mBAAmB,CAAC;AAC3B,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,EAAmF,MAAM,sBAAsB,CAAC;AACjI,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
@@ -0,0 +1,28 @@
1
+ import type { LucideIcon } from "lucide-react";
2
+ import type { ReactNode } from "react";
3
+ import type { PaletteColor } from "./palette.js";
4
+ export type TimelineItemSize = "default" | "compact";
5
+ export type TimelineLine = "solid" | "dashed";
6
+ export interface TimelineItem {
7
+ readonly key: string;
8
+ readonly title: ReactNode;
9
+ readonly time?: ReactNode;
10
+ readonly description?: ReactNode;
11
+ readonly badges?: ReactNode;
12
+ readonly aside?: ReactNode;
13
+ readonly children?: ReactNode;
14
+ readonly icon?: LucideIcon;
15
+ readonly color?: PaletteColor;
16
+ readonly size?: TimelineItemSize;
17
+ readonly line?: TimelineLine;
18
+ readonly onSelect?: () => void;
19
+ readonly actionLabel?: string;
20
+ readonly data?: Readonly<Record<`data-${string}`, string | undefined>>;
21
+ }
22
+ export interface TimelineProps {
23
+ readonly label: string;
24
+ readonly items: readonly TimelineItem[];
25
+ readonly className?: string;
26
+ }
27
+ export declare function Timeline({ label, items, className }: TimelineProps): import("react").JSX.Element;
28
+ //# sourceMappingURL=Timeline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timeline.d.ts","sourceRoot":"","sources":["../../src/notion/Timeline.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAKvC,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,+BAQlE"}
@@ -0,0 +1,84 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
4
+ // Literal class names per palette colour, so Tailwind generates each one (the theme's `@source` covers this folder).
5
+ const MARKER_FILL = {
6
+ gray: "bg-gray-tag text-gray-tag-foreground",
7
+ brown: "bg-brown-tag text-brown-tag-foreground",
8
+ orange: "bg-orange-tag text-orange-tag-foreground",
9
+ yellow: "bg-yellow-tag text-yellow-tag-foreground",
10
+ green: "bg-green-tag text-green-tag-foreground",
11
+ blue: "bg-blue-tag text-blue-tag-foreground",
12
+ purple: "bg-purple-tag text-purple-tag-foreground",
13
+ pink: "bg-pink-tag text-pink-tag-foreground",
14
+ red: "bg-red-tag text-red-tag-foreground",
15
+ };
16
+ const MARKER_TEXT = {
17
+ gray: "text-gray",
18
+ brown: "text-brown",
19
+ orange: "text-orange",
20
+ yellow: "text-yellow",
21
+ green: "text-green",
22
+ blue: "text-blue",
23
+ purple: "text-purple",
24
+ pink: "text-pink",
25
+ red: "text-red",
26
+ };
27
+ const MARKER_DOT = {
28
+ gray: "bg-gray",
29
+ brown: "bg-brown",
30
+ orange: "bg-orange",
31
+ yellow: "bg-yellow",
32
+ green: "bg-green",
33
+ blue: "bg-blue",
34
+ purple: "bg-purple",
35
+ pink: "bg-pink",
36
+ red: "bg-red",
37
+ };
38
+ // The marker column is 24 px wide; the rail runs down its middle, from the first marker to the last.
39
+ const ITEM_CLASS = "group/timeline-item relative grid grid-cols-[1.5rem_minmax(0,1fr)_auto] gap-x-1";
40
+ const RAIL_CLASS = "absolute top-0 bottom-0 left-3 -translate-x-1/2 border-l-2 border-border group-first/timeline-item:top-4 group-last/timeline-item:bottom-auto group-last/timeline-item:h-4 group-only/timeline-item:hidden";
41
+ const RAIL_LINE = {
42
+ solid: "border-solid",
43
+ dashed: "border-dashed",
44
+ };
45
+ const MARKER_CLASS = {
46
+ default: "relative mt-1 flex size-6 items-center justify-center justify-self-center rounded-full [&>svg]:size-3.5",
47
+ compact: "relative mt-1.5 flex size-5 items-center justify-center justify-self-center rounded-full bg-background [&>svg]:size-3.5",
48
+ };
49
+ const BODY_CLASS = {
50
+ default: "flex min-w-0 flex-col gap-0.5 rounded-md px-2 py-1 text-start",
51
+ compact: "flex min-w-0 flex-col rounded-md px-2 py-1 text-start",
52
+ };
53
+ const BUTTON_CLASS = "cursor-pointer text-foreground transition-colors duration-120 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none";
54
+ const ITEM_PADDING = {
55
+ default: "pb-2",
56
+ compact: "pb-1",
57
+ };
58
+ // A dated sequence on a vertical rail: each entry a marker in a palette colour, its time, title, description and
59
+ // badges, minor entries (`compact`) between major ones, a dashed rail where something is missing, and marks at the
60
+ // right edge outside the entry's button.
61
+ export function Timeline({ label, items, className }) {
62
+ return (_jsx("ol", { "aria-label": label, "data-slot": "timeline", className: cn("flex flex-col", className), children: items.map((item) => (_jsx(TimelineEntry, { item: item }, item.key))) }));
63
+ }
64
+ function TimelineEntry({ item }) {
65
+ const size = item.size ?? "default";
66
+ const line = item.line ?? "solid";
67
+ const color = item.color ?? "gray";
68
+ return (_jsxs("li", { ...item.data, "data-slot": "timeline-item", "data-item": item.key, "data-size": size, "data-line": line, className: cn(ITEM_CLASS, ITEM_PADDING[size]), children: [_jsx("span", { "aria-hidden": "true", "data-slot": "timeline-rail", className: cn(RAIL_CLASS, RAIL_LINE[line]) }), _jsx(TimelineMarker, { icon: item.icon, color: color, size: size }), _jsxs("div", { className: cn("flex min-w-0 flex-col", item.aside === undefined && "col-span-2"), children: [_jsx(TimelineBody, { item: item, size: size }), item.children === undefined ? null : (_jsx("div", { "data-slot": "timeline-item-content", className: "px-2 pb-1", children: item.children }))] }), item.aside === undefined ? null : (_jsx("div", { "data-slot": "timeline-item-aside", className: "flex shrink-0 items-start gap-1 pt-1", children: item.aside }))] }));
69
+ }
70
+ function TimelineMarker({ icon: Icon, color, size }) {
71
+ const look = size === "default" ? MARKER_FILL[color] : MARKER_TEXT[color];
72
+ return (_jsx("span", { "aria-hidden": "true", "data-slot": "timeline-marker", "data-color": color, className: cn(MARKER_CLASS[size], look), children: Icon === undefined ? (_jsx("span", { className: cn("rounded-full", size === "default" ? "size-2 bg-current" : cn("size-2", MARKER_DOT[color])) })) : (_jsx(Icon, { strokeWidth: ICON_STROKE_WIDTH })) }));
73
+ }
74
+ function TimelineBody({ item, size }) {
75
+ const time = item.time === undefined ? null : (_jsx("span", { "data-slot": "timeline-item-time", className: "text-small text-muted-foreground tabular-nums", children: item.time }));
76
+ const description = item.description === undefined ? null : (_jsx("span", { "data-slot": "timeline-item-description", className: "text-small text-muted-foreground [overflow-wrap:anywhere]", children: item.description }));
77
+ const badges = item.badges === undefined ? null : (_jsx("span", { "data-slot": "timeline-item-badges", className: cn("flex flex-wrap items-center gap-x-3 gap-y-1", size === "default" && "mt-0.5"), children: item.badges }));
78
+ const content = (_jsxs(_Fragment, { children: [size === "default" ? (_jsxs(_Fragment, { children: [time, _jsx("span", { "data-slot": "timeline-item-title", className: "text-ui-medium [overflow-wrap:anywhere]", children: item.title })] })) : (_jsxs("span", { className: "flex flex-wrap items-baseline gap-x-2", children: [_jsx("span", { "data-slot": "timeline-item-title", className: "text-ui-medium [overflow-wrap:anywhere]", children: item.title }), time] })), size === "default" ? (_jsxs(_Fragment, { children: [description, badges] })) : description === null || badges === null ? ((description ?? badges)) : (_jsxs("span", { className: "flex flex-wrap items-center gap-x-3", children: [description, badges] }))] }));
79
+ if (item.onSelect === undefined) {
80
+ return (_jsx("div", { "data-slot": "timeline-item-body", className: BODY_CLASS[size], children: content }));
81
+ }
82
+ return (_jsxs("button", { type: "button", "data-slot": "timeline-item-body", className: cn(BODY_CLASS[size], BUTTON_CLASS), onClick: item.onSelect, children: [item.actionLabel === undefined ? null : _jsx("span", { className: "sr-only", children: `${item.actionLabel}: ` }), content] }));
83
+ }
84
+ //# sourceMappingURL=Timeline.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Timeline.js","sourceRoot":"","sources":["../../src/notion/Timeline.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AA4CrD,qHAAqH;AACrH,MAAM,WAAW,GAA2C;IAC1D,IAAI,EAAE,sCAAsC;IAC5C,KAAK,EAAE,wCAAwC;IAC/C,MAAM,EAAE,0CAA0C;IAClD,MAAM,EAAE,0CAA0C;IAClD,KAAK,EAAE,wCAAwC;IAC/C,IAAI,EAAE,sCAAsC;IAC5C,MAAM,EAAE,0CAA0C;IAClD,IAAI,EAAE,sCAAsC;IAC5C,GAAG,EAAE,oCAAoC;CAC1C,CAAC;AAEF,MAAM,WAAW,GAA2C;IAC1D,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,YAAY;IACnB,MAAM,EAAE,aAAa;IACrB,MAAM,EAAE,aAAa;IACrB,KAAK,EAAE,YAAY;IACnB,IAAI,EAAE,WAAW;IACjB,MAAM,EAAE,aAAa;IACrB,IAAI,EAAE,WAAW;IACjB,GAAG,EAAE,UAAU;CAChB,CAAC;AAEF,MAAM,UAAU,GAA2C;IACzD,IAAI,EAAE,SAAS;IACf,KAAK,EAAE,UAAU;IACjB,MAAM,EAAE,WAAW;IACnB,MAAM,EAAE,WAAW;IACnB,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,WAAW;IACnB,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,QAAQ;CACd,CAAC;AAEF,qGAAqG;AACrG,MAAM,UAAU,GAAG,iFAAiF,CAAC;AACrG,MAAM,UAAU,GACd,4MAA4M,CAAC;AAC/M,MAAM,SAAS,GAA2C;IACxD,KAAK,EAAE,cAAc;IACrB,MAAM,EAAE,eAAe;CACxB,CAAC;AAEF,MAAM,YAAY,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,CAAC,CAAC,CAEF,gBAAM,SAAS,EAAC,qCAAqC,aAClD,WAAW,EACX,MAAM,IACF,CACR,IACA,CACJ,CAAC;IACF,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAChC,OAAO,CACL,2BAAe,oBAAoB,EAAC,SAAS,EAAE,UAAU,CAAC,IAAI,CAAC,YAC5D,OAAO,GACJ,CACP,CAAC;IACJ,CAAC;IACD,OAAO,CACL,kBAAQ,IAAI,EAAC,QAAQ,eAAW,oBAAoB,EAAC,SAAS,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,QAAQ,aACvH,IAAI,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,eAAM,SAAS,EAAC,SAAS,YAAE,GAAG,IAAI,CAAC,WAAW,IAAI,GAAQ,EAClG,OAAO,IACD,CACV,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softure-ai/theme-notion",
3
- "version": "0.6.0",
3
+ "version": "0.7.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
@@ -81,4 +81,5 @@ export {
81
81
  export { Status, type StatusProps } from "./notion/Status.js";
82
82
  export { Steps, type StepItem, type StepState, type StepsLayout, type StepsProps } from "./notion/Steps.js";
83
83
  export { TabBar, type TabBarItem, type TabBarProps } from "./notion/TabBar.js";
84
+ export { Timeline, type TimelineItem, type TimelineItemSize, type TimelineLine, type TimelineProps } from "./notion/Timeline.js";
84
85
  export { TONES, TONE_COLORS, TONE_EDGE, TONE_FILL, TONE_TEXT, type Tone } from "./notion/tones.js";
@@ -0,0 +1,229 @@
1
+ import type { LucideIcon } from "lucide-react";
2
+ import type { ReactNode } from "react";
3
+
4
+ import { cn } from "../lib/utils.js";
5
+
6
+ import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
7
+ import type { PaletteColor } from "./palette.js";
8
+
9
+ // `default`: a major entry with a filled round marker; `compact`: a minor entry between two major ones.
10
+ export type TimelineItemSize = "default" | "compact";
11
+
12
+ // The rail through an entry: `dashed` for something missing (a gap).
13
+ export type TimelineLine = "solid" | "dashed";
14
+
15
+ export interface TimelineItem {
16
+ // Unique within the timeline; kept on the item as `data-item`.
17
+ readonly key: string;
18
+ readonly title: ReactNode;
19
+ // When it happens, drawn above the title (`default`) or after it (`compact`) in muted tabular figures.
20
+ readonly time?: ReactNode;
21
+ // A muted line under the title: a route, a place.
22
+ readonly description?: ReactNode;
23
+ // Statuses and tags in a wrapping row under the description.
24
+ readonly badges?: ReactNode;
25
+ // Drawn at the item's right edge, outside its button: marks that open their own popovers.
26
+ readonly aside?: ReactNode;
27
+ // More content under the body: deadlines, notes.
28
+ readonly children?: ReactNode;
29
+ // A Lucide icon inside the marker; without it a `default` marker is a filled circle, a `compact` one a dot.
30
+ readonly icon?: LucideIcon;
31
+ // The marker's palette colour, `gray` by default; the entry's words carry the meaning, never the colour alone.
32
+ readonly color?: PaletteColor;
33
+ readonly size?: TimelineItemSize;
34
+ readonly line?: TimelineLine;
35
+ // Makes the body a button; `actionLabel` is read before its visible text ("Show on the map"), so the button's name
36
+ // starts with what it does and still contains every word it shows.
37
+ readonly onSelect?: () => void;
38
+ readonly actionLabel?: string;
39
+ // `data-*` attributes set on the item, for an app's own hooks.
40
+ readonly data?: Readonly<Record<`data-${string}`, string | undefined>>;
41
+ }
42
+
43
+ export interface TimelineProps {
44
+ // The list's accessible name.
45
+ readonly label: string;
46
+ readonly items: readonly TimelineItem[];
47
+ readonly className?: string;
48
+ }
49
+
50
+ // Literal class names per palette colour, so Tailwind generates each one (the theme's `@source` covers this folder).
51
+ const MARKER_FILL: Readonly<Record<PaletteColor, string>> = {
52
+ gray: "bg-gray-tag text-gray-tag-foreground",
53
+ brown: "bg-brown-tag text-brown-tag-foreground",
54
+ orange: "bg-orange-tag text-orange-tag-foreground",
55
+ yellow: "bg-yellow-tag text-yellow-tag-foreground",
56
+ green: "bg-green-tag text-green-tag-foreground",
57
+ blue: "bg-blue-tag text-blue-tag-foreground",
58
+ purple: "bg-purple-tag text-purple-tag-foreground",
59
+ pink: "bg-pink-tag text-pink-tag-foreground",
60
+ red: "bg-red-tag text-red-tag-foreground",
61
+ };
62
+
63
+ const MARKER_TEXT: Readonly<Record<PaletteColor, string>> = {
64
+ gray: "text-gray",
65
+ brown: "text-brown",
66
+ orange: "text-orange",
67
+ yellow: "text-yellow",
68
+ green: "text-green",
69
+ blue: "text-blue",
70
+ purple: "text-purple",
71
+ pink: "text-pink",
72
+ red: "text-red",
73
+ };
74
+
75
+ const MARKER_DOT: Readonly<Record<PaletteColor, string>> = {
76
+ gray: "bg-gray",
77
+ brown: "bg-brown",
78
+ orange: "bg-orange",
79
+ yellow: "bg-yellow",
80
+ green: "bg-green",
81
+ blue: "bg-blue",
82
+ purple: "bg-purple",
83
+ pink: "bg-pink",
84
+ red: "bg-red",
85
+ };
86
+
87
+ // The marker column is 24 px wide; the rail runs down its middle, from the first marker to the last.
88
+ const ITEM_CLASS = "group/timeline-item relative grid grid-cols-[1.5rem_minmax(0,1fr)_auto] gap-x-1";
89
+ const RAIL_CLASS =
90
+ "absolute top-0 bottom-0 left-3 -translate-x-1/2 border-l-2 border-border group-first/timeline-item:top-4 group-last/timeline-item:bottom-auto group-last/timeline-item:h-4 group-only/timeline-item:hidden";
91
+ const RAIL_LINE: Readonly<Record<TimelineLine, string>> = {
92
+ solid: "border-solid",
93
+ dashed: "border-dashed",
94
+ };
95
+
96
+ const MARKER_CLASS: Readonly<Record<TimelineItemSize, string>> = {
97
+ default: "relative mt-1 flex size-6 items-center justify-center justify-self-center rounded-full [&>svg]:size-3.5",
98
+ compact: "relative mt-1.5 flex size-5 items-center justify-center justify-self-center rounded-full bg-background [&>svg]:size-3.5",
99
+ };
100
+
101
+ const BODY_CLASS: Readonly<Record<TimelineItemSize, string>> = {
102
+ default: "flex min-w-0 flex-col gap-0.5 rounded-md px-2 py-1 text-start",
103
+ compact: "flex min-w-0 flex-col rounded-md px-2 py-1 text-start",
104
+ };
105
+ const BUTTON_CLASS =
106
+ "cursor-pointer text-foreground transition-colors duration-120 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none";
107
+
108
+ const ITEM_PADDING: Readonly<Record<TimelineItemSize, string>> = {
109
+ default: "pb-2",
110
+ compact: "pb-1",
111
+ };
112
+
113
+ // A dated sequence on a vertical rail: each entry a marker in a palette colour, its time, title, description and
114
+ // badges, minor entries (`compact`) between major ones, a dashed rail where something is missing, and marks at the
115
+ // right edge outside the entry's button.
116
+ export function Timeline({ label, items, className }: TimelineProps) {
117
+ return (
118
+ <ol aria-label={label} data-slot="timeline" className={cn("flex flex-col", className)}>
119
+ {items.map((item) => (
120
+ <TimelineEntry key={item.key} item={item} />
121
+ ))}
122
+ </ol>
123
+ );
124
+ }
125
+
126
+ function TimelineEntry({ item }: { readonly item: TimelineItem }) {
127
+ const size = item.size ?? "default";
128
+ const line = item.line ?? "solid";
129
+ const color = item.color ?? "gray";
130
+ return (
131
+ <li {...item.data} data-slot="timeline-item" data-item={item.key} data-size={size} data-line={line} className={cn(ITEM_CLASS, ITEM_PADDING[size])}>
132
+ <span aria-hidden="true" data-slot="timeline-rail" className={cn(RAIL_CLASS, RAIL_LINE[line])} />
133
+ <TimelineMarker icon={item.icon} color={color} size={size} />
134
+ <div className={cn("flex min-w-0 flex-col", item.aside === undefined && "col-span-2")}>
135
+ <TimelineBody item={item} size={size} />
136
+ {item.children === undefined ? null : (
137
+ <div data-slot="timeline-item-content" className="px-2 pb-1">
138
+ {item.children}
139
+ </div>
140
+ )}
141
+ </div>
142
+ {item.aside === undefined ? null : (
143
+ <div data-slot="timeline-item-aside" className="flex shrink-0 items-start gap-1 pt-1">
144
+ {item.aside}
145
+ </div>
146
+ )}
147
+ </li>
148
+ );
149
+ }
150
+
151
+ function TimelineMarker({ icon: Icon, color, size }: { readonly icon?: LucideIcon; readonly color: PaletteColor; readonly size: TimelineItemSize }) {
152
+ const look = size === "default" ? MARKER_FILL[color] : MARKER_TEXT[color];
153
+ return (
154
+ <span aria-hidden="true" data-slot="timeline-marker" data-color={color} className={cn(MARKER_CLASS[size], look)}>
155
+ {Icon === undefined ? (
156
+ <span className={cn("rounded-full", size === "default" ? "size-2 bg-current" : cn("size-2", MARKER_DOT[color]))} />
157
+ ) : (
158
+ <Icon strokeWidth={ICON_STROKE_WIDTH} />
159
+ )}
160
+ </span>
161
+ );
162
+ }
163
+
164
+ function TimelineBody({ item, size }: { readonly item: TimelineItem; readonly size: TimelineItemSize }) {
165
+ const time =
166
+ item.time === undefined ? null : (
167
+ <span data-slot="timeline-item-time" className="text-small text-muted-foreground tabular-nums">
168
+ {item.time}
169
+ </span>
170
+ );
171
+ const description =
172
+ item.description === undefined ? null : (
173
+ <span data-slot="timeline-item-description" className="text-small text-muted-foreground [overflow-wrap:anywhere]">
174
+ {item.description}
175
+ </span>
176
+ );
177
+ const badges =
178
+ item.badges === undefined ? null : (
179
+ <span data-slot="timeline-item-badges" className={cn("flex flex-wrap items-center gap-x-3 gap-y-1", size === "default" && "mt-0.5")}>
180
+ {item.badges}
181
+ </span>
182
+ );
183
+ const content = (
184
+ <>
185
+ {size === "default" ? (
186
+ <>
187
+ {time}
188
+ <span data-slot="timeline-item-title" className="text-ui-medium [overflow-wrap:anywhere]">
189
+ {item.title}
190
+ </span>
191
+ </>
192
+ ) : (
193
+ <span className="flex flex-wrap items-baseline gap-x-2">
194
+ <span data-slot="timeline-item-title" className="text-ui-medium [overflow-wrap:anywhere]">
195
+ {item.title}
196
+ </span>
197
+ {time}
198
+ </span>
199
+ )}
200
+ {size === "default" ? (
201
+ <>
202
+ {description}
203
+ {badges}
204
+ </>
205
+ ) : description === null || badges === null ? (
206
+ (description ?? badges)
207
+ ) : (
208
+ // A minor entry keeps its route and its status on one wrapping line.
209
+ <span className="flex flex-wrap items-center gap-x-3">
210
+ {description}
211
+ {badges}
212
+ </span>
213
+ )}
214
+ </>
215
+ );
216
+ if (item.onSelect === undefined) {
217
+ return (
218
+ <div data-slot="timeline-item-body" className={BODY_CLASS[size]}>
219
+ {content}
220
+ </div>
221
+ );
222
+ }
223
+ return (
224
+ <button type="button" data-slot="timeline-item-body" className={cn(BODY_CLASS[size], BUTTON_CLASS)} onClick={item.onSelect}>
225
+ {item.actionLabel === undefined ? null : <span className="sr-only">{`${item.actionLabel}: `}</span>}
226
+ {content}
227
+ </button>
228
+ );
229
+ }