@softure-ai/theme-notion 0.5.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 +29 -0
- package/README.md +52 -3
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/notion/FoldRow.d.ts +21 -3
- package/dist/notion/FoldRow.d.ts.map +1 -1
- package/dist/notion/FoldRow.js +15 -6
- package/dist/notion/FoldRow.js.map +1 -1
- package/dist/notion/Stats.d.ts +6 -1
- package/dist/notion/Stats.d.ts.map +1 -1
- package/dist/notion/Stats.js +4 -3
- package/dist/notion/Stats.js.map +1 -1
- package/dist/notion/Timeline.d.ts +28 -0
- package/dist/notion/Timeline.d.ts.map +1 -0
- package/dist/notion/Timeline.js +84 -0
- package/dist/notion/Timeline.js.map +1 -0
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.d.ts.map +1 -1
- package/dist/ui/button.js +2 -1
- package/dist/ui/button.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -0
- package/src/notion/FoldRow.tsx +106 -43
- package/src/notion/Stats.tsx +13 -3
- package/src/notion/Timeline.tsx +229 -0
- package/src/ui/button.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,35 @@ 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
|
+
|
|
14
|
+
## 0.6.0
|
|
15
|
+
|
|
16
|
+
- `FoldRow` (#832): the opened content (`fold-row-content`) is padded equally on all four sides (`p-3`, 12 px) instead
|
|
17
|
+
of 24 px on the left and 4 px on the right, so a `DetailTable` sits centred under the row. `isInset` (default `false`)
|
|
18
|
+
keeps the old indented look (`py-2 pr-1 pl-6`) and sets `data-inset="true"` on `fold-row-content` (`"false"` without
|
|
19
|
+
it, as `StatsFold` does). New `summary` slot: a node drawn after the chevron in place of `title`, `facts` and
|
|
20
|
+
`badges`; `details` and `detailsLabel` are now optional together (no table without them). An app that wants the old
|
|
21
|
+
indent adds `isInset`; an app that drew rows "as `FoldRow` is" with its own markup for a custom summary or content
|
|
22
|
+
passes `summary` and `children` and drops its copy of the classes. Existing calls compile unchanged.
|
|
23
|
+
- `Button` (#833): the `outline` hover no longer swaps the opaque `bg-background` for the translucent `bg-accent`; the
|
|
24
|
+
accent is laid over the background as a gradient layer, so an outline button over a map or an image keeps its
|
|
25
|
+
surface on hover (on the page it looks the same as before). A new `floating` variant is for a button that floats over
|
|
26
|
+
content: opaque `bg-background` in every state, `text-foreground`, `shadow-menu` and no border, the `accent` tint on
|
|
27
|
+
hover and the `accent-strong` tint while `aria-expanded="true"`, and a disabled state with muted text at full
|
|
28
|
+
opacity. An app drops its `hover:bg-background hover:bg-linear-to-r hover:from-accent hover:to-accent` workaround
|
|
29
|
+
and uses `variant="floating"` for map and image controls.
|
|
30
|
+
- `StatsFold` (#831): the content spans the heading row's full width by default, with the same left and right edges
|
|
31
|
+
as the row; it was indented on the left only (`pl-6`), so a card or a full-width bar under the heading sat off-centre.
|
|
32
|
+
The indented look is the new `isInset` prop (default `false`), which lines the content up with the title after the
|
|
33
|
+
chevron. The content carries `data-inset="true|false"`. An app that wants the old look passes `isInset`; an app that
|
|
34
|
+
undid the indent with its own class drops it.
|
|
35
|
+
|
|
7
36
|
## 0.5.0
|
|
8
37
|
|
|
9
38
|
- Needs `@softure-ai/theme-kit` `^0.1.4` (was `^0.1.3`): the version whose `softure-theme-css` writes `preflight.css`
|
package/README.md
CHANGED
|
@@ -83,7 +83,8 @@ name outside a `CommandDialog`; without it the field has none), `SortableList in
|
|
|
83
83
|
|
|
84
84
|
- Background `background`, text `foreground`, secondary text `muted-foreground`. Never pure black.
|
|
85
85
|
- Hover is the grey `accent` background, never a border or a shadow; selected and pressed use `accent-strong`.
|
|
86
|
-
- One `primary` (blue, `#0171cf`) action per screen. Other buttons are `secondary`, `outline` or `ghost
|
|
86
|
+
- One `primary` (blue, `#0171cf`) action per screen. Other buttons are `secondary`, `outline` or `ghost`; a button
|
|
87
|
+
over a map or an image is `floating`.
|
|
87
88
|
- A palette colour (`gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`, `red`, each with `-bg`,
|
|
88
89
|
`-tag`, `-tag-foreground`) marks an area (a tag) or a state (a status, a callout), never decoration. The same
|
|
89
90
|
colour always means the same thing; the app keeps its own table of meanings.
|
|
@@ -122,9 +123,23 @@ and more, a native `<details>`), `PageFrame` (a page outside the app shell, the
|
|
|
122
123
|
`SidePanel` (a non-modal panel at a side of a canvas, below), `TabBar` (a screen's tabs as links with an optional icon
|
|
123
124
|
and count, the shown tab in the address; `Tabs` keeps it in client state), `MarkPopover` (a counted tag that opens a
|
|
124
125
|
list of what it counts, below), `FilterChip` and `FilterChipAdd` (a list's filter pills, below), `Steps` (numbered
|
|
125
|
-
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),
|
|
126
127
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below).
|
|
127
128
|
|
|
129
|
+
**`FoldRow`.** An item as one list row in a native `<details>`: a chevron, the title, short facts and badges on the
|
|
130
|
+
right; opened, it shows a `DetailTable` and its `children`. The opened content is padded 12 px on all four sides
|
|
131
|
+
(`p-3`), so a table sits centred under the row; `isInset` indents it under the title instead (24 px on the left) and
|
|
132
|
+
sets `data-inset` on the content, like `StatsFold`. A row with a summary of its own (icons, a status) passes `summary`,
|
|
133
|
+
drawn after the chevron in place of `title`, `facts` and `badges`; `details` and `detailsLabel` are optional together,
|
|
134
|
+
so the content can be several tables or a list.
|
|
135
|
+
|
|
136
|
+
```tsx
|
|
137
|
+
<FoldRow title="Dentist" facts={["12.01.2027"]} badges={[]} detailsLabel="Visit details" details={rows} />
|
|
138
|
+
<FoldRow summary={<><Receipt aria-hidden="true" className="size-4" /> Invoice 12/2026 <Badge>Paid</Badge></>}>
|
|
139
|
+
<InvoiceLines />
|
|
140
|
+
</FoldRow>
|
|
141
|
+
```
|
|
142
|
+
|
|
128
143
|
**`FilterChip`.** The filters above a list or a table, drawn the way a Notion database view draws them: a 24 px pill
|
|
129
144
|
`icon · Label: value ▾` that opens a menu of options in the design system's popover. While the default value is
|
|
130
145
|
chosen the pill is muted; `isActive` (a non-default value) turns it into the blue tag and sets `data-active`. The
|
|
@@ -169,6 +184,8 @@ optional `hint`, optional `aside` tag; `isFullWidth` and `isOneRow` change the g
|
|
|
169
184
|
the package's 6 px `Progress` under the figure, filled in the card's tone (primary without one) and named by
|
|
170
185
|
`progressLabel` (default: the card's `label`). A card's `icon` (a Lucide icon component) is drawn before the label: 16 px,
|
|
171
186
|
`ICON_STROKE_WIDTH`, the label's muted colour, 6 px apart, `aria-hidden` (the label stays the card's text).
|
|
187
|
+
`StatsFold`'s content spans the heading row's full width (the same left and right edges as the row); `isInset` indents
|
|
188
|
+
it to line up with the title after the chevron.
|
|
172
189
|
|
|
173
190
|
```tsx
|
|
174
191
|
<StatsFold title="Summary">
|
|
@@ -202,6 +219,36 @@ reader (`stateLabels` replaces the English words). `data-slot="steps"`, `data-st
|
|
|
202
219
|
/>
|
|
203
220
|
```
|
|
204
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
|
+
|
|
205
252
|
**`MarkPopover`.** A tag in a palette colour with an icon and a count; a click or Enter opens the design system's
|
|
206
253
|
popover listing the entries, Escape or a click outside closes it. It runs on the browser's Popover API (no client
|
|
207
254
|
state, no portal): the panel sits in the top layer, so a card's `overflow` never clips it, centred on a phone and
|
|
@@ -292,7 +339,9 @@ secondary content with `group` on the list). `as="ol"` renders a numbered list;
|
|
|
292
339
|
Deltas from stock shadcn:
|
|
293
340
|
|
|
294
341
|
- `button`: sizes 28/24/32 px, a smaller padding on the icon side, a Notion `ghost`, `secondary` hover
|
|
295
|
-
`accent-strong`, no shadows.
|
|
342
|
+
`accent-strong`, no shadows. `outline` lays its hover tint over its opaque background. A `floating` variant is for a
|
|
343
|
+
button over a map, an image or any non-page surface: opaque in every state, `shadow-menu`, no border, the `accent`
|
|
344
|
+
tint on hover and `accent-strong` while `aria-expanded="true"`.
|
|
296
345
|
- `badge`: a `tag` variant and a `color` prop with the nine palette colours (and `default`); `color` applies to every
|
|
297
346
|
variant but `destructive`, which keeps its own fill and white text. `alert`: palette colour variants (a
|
|
298
347
|
Notion callout).
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
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|
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,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;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;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AS,EAAa,MAAM,mBAAmB,CAAC"}
|
package/dist/notion/FoldRow.d.ts
CHANGED
|
@@ -7,17 +7,35 @@ export interface FoldRowBadge {
|
|
|
7
7
|
readonly text: string;
|
|
8
8
|
readonly tone?: Tone;
|
|
9
9
|
}
|
|
10
|
-
|
|
10
|
+
/** The row's summary: the fixed title, facts and badges, or a node of the app's own. */
|
|
11
|
+
export type FoldRowSummaryProps = {
|
|
11
12
|
readonly title: ReactNode;
|
|
12
13
|
/** Short facts after the title; left out when empty. */
|
|
13
14
|
readonly facts?: readonly ReactNode[];
|
|
14
15
|
/** Badges on the row's right, in order. */
|
|
15
16
|
readonly badges: readonly FoldRowBadge[];
|
|
17
|
+
readonly summary?: never;
|
|
18
|
+
} | {
|
|
19
|
+
/** Drawn after the chevron in place of the title, facts and badges, as a wrapping row. */
|
|
20
|
+
readonly summary: ReactNode;
|
|
21
|
+
readonly title?: never;
|
|
22
|
+
readonly facts?: never;
|
|
23
|
+
readonly badges?: never;
|
|
24
|
+
};
|
|
25
|
+
/** The details table at the top of the opened content, or none. */
|
|
26
|
+
export type FoldRowDetailsProps = {
|
|
16
27
|
/** The details table's accessible name. */
|
|
17
28
|
readonly detailsLabel: string;
|
|
18
29
|
readonly details: readonly DetailRow[];
|
|
30
|
+
} | {
|
|
31
|
+
readonly detailsLabel?: never;
|
|
32
|
+
readonly details?: never;
|
|
33
|
+
};
|
|
34
|
+
export type FoldRowProps = FoldRowSummaryProps & FoldRowDetailsProps & {
|
|
35
|
+
/** Indents the opened content to line up with the title after the chevron; by default it is padded equally. */
|
|
36
|
+
readonly isInset?: boolean;
|
|
19
37
|
/** More content under the table when opened. */
|
|
20
38
|
readonly children?: ReactNode;
|
|
21
|
-
}
|
|
22
|
-
export declare function FoldRow(
|
|
39
|
+
};
|
|
40
|
+
export declare function FoldRow(props: FoldRowProps): import("react").JSX.Element;
|
|
23
41
|
//# 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;AAIvC,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,MAAM,
|
|
1
|
+
{"version":3,"file":"FoldRow.d.ts","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAIvC,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,KAAK,CAAC;CAC1B,GACD;IACE,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC;CACzB,CAAC;AAEN,mEAAmE;AACnE,MAAM,MAAM,mBAAmB,GAC3B;IACE,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;CACxC,GACD;IACE,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAC5C,mBAAmB,GAAG;IACpB,+GAA+G;IAC/G,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;CAC/B,CAAC;AA4DJ,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BA4B1C"}
|
package/dist/notion/FoldRow.js
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRight } from "lucide-react";
|
|
3
3
|
import { Badge } from "../ui/badge.js";
|
|
4
4
|
import { DetailTable } from "./DetailTable.js";
|
|
5
5
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
6
6
|
import { TONE_COLORS } from "./tones.js";
|
|
7
|
+
const CONTENT_CLASS = "flex flex-col gap-2 p-3 empty:hidden";
|
|
8
|
+
const INSET_CONTENT_CLASS = "flex flex-col gap-2 py-2 pr-1 pl-6 empty:hidden";
|
|
9
|
+
function FoldRowFixedSummary({ title, facts = [], badges, }) {
|
|
10
|
+
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) => {
|
|
11
|
+
const tone = badge.tone ?? "default";
|
|
12
|
+
return (_jsx(Badge, { variant: "tag", color: TONE_COLORS[tone] ?? "default", "data-badge": badge.key, "data-tone": tone, children: badge.text }, badge.key));
|
|
13
|
+
}) }))] }));
|
|
14
|
+
}
|
|
15
|
+
function FoldRowChevron() {
|
|
16
|
+
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" }));
|
|
17
|
+
}
|
|
7
18
|
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
8
|
-
export function FoldRow(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
return (_jsx(Badge, { variant: "tag", color: TONE_COLORS[tone] ?? "default", "data-badge": badge.key, "data-tone": tone, children: badge.text }, badge.key));
|
|
12
|
-
}) }))] }), _jsxs("div", { "data-slot": "fold-row-content", className: "flex flex-col gap-2 py-2 pr-1 pl-6 empty:hidden", children: [_jsx(DetailTable, { label: detailsLabel, rows: details }), children] })] }));
|
|
19
|
+
export function FoldRow(props) {
|
|
20
|
+
const { isInset = false, children } = props;
|
|
21
|
+
return (_jsxs("details", { "data-slot": "fold-row", className: "group/fold-row border-b border-border", children: [_jsx("summary", { "data-slot": "fold-row-summary", className: "flex min-h-row-height cursor-pointer list-none flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-1 py-1 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", 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 })] })) }), _jsxs("div", { "data-slot": "fold-row-content", "data-inset": isInset, className: isInset ? INSET_CONTENT_CLASS : CONTENT_CLASS, children: [props.details === undefined ? null : _jsx(DetailTable, { label: props.detailsLabel, rows: props.details }), children] })] }));
|
|
13
22
|
}
|
|
14
23
|
//# 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,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;
|
|
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,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+CpD,MAAM,aAAa,GAAG,sCAAsC,CAAC;AAC7D,MAAM,mBAAmB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C,uCAAuC,aAC7E,+BACY,kBAAkB,EAC5B,SAAS,EAAC,oSAAoS,YAE7S,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,GAAI,CAC5F,CAAC,CAAC,CAAC,CACF,8BACE,KAAC,cAAc,KAAG,EAClB,4BACY,uBAAuB,EACjC,SAAS,EAAC,4DAA4D,YAErE,KAAK,CAAC,OAAO,GACT,IACN,CACJ,GACO,EACV,4BAAe,kBAAkB,gBAAa,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,aAC5G,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,GAAI,EACpG,QAAQ,IACL,IACE,CACX,CAAC;AACJ,CAAC"}
|
package/dist/notion/Stats.d.ts
CHANGED
|
@@ -6,8 +6,13 @@ export interface StatsFoldProps {
|
|
|
6
6
|
readonly title: string;
|
|
7
7
|
readonly children: ReactNode;
|
|
8
8
|
readonly className?: string;
|
|
9
|
+
/**
|
|
10
|
+
* Indents the content to line up with the title after the chevron. Off by default: the content spans the fold's
|
|
11
|
+
* full width, with the same left and right edges as the heading row.
|
|
12
|
+
*/
|
|
13
|
+
readonly isInset?: boolean;
|
|
9
14
|
}
|
|
10
|
-
export declare function StatsFold({ title, children, className }: StatsFoldProps): import("react").JSX.Element;
|
|
15
|
+
export declare function StatsFold({ title, children, className, isInset }: StatsFoldProps): import("react").JSX.Element;
|
|
11
16
|
export interface StatCardAside {
|
|
12
17
|
readonly text: string;
|
|
13
18
|
readonly tone?: Tone;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stats.d.ts","sourceRoot":"","sources":["../../src/notion/Stats.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAqC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"Stats.d.ts","sourceRoot":"","sources":["../../src/notion/Stats.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AAC7D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAOvC,OAAO,EAAqC,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAE1E,MAAM,WAAW,cAAc;IAC7B,6BAA6B;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B;;;OAGG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B;AAKD,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAe,EAAE,EAAE,cAAc,+BAuBxF;AAED,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,QAAQ;IACvB,kDAAkD;IAClD,QAAQ,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AE,KAAK,EAAE,KAAK,EAAE,EAAE,cAAc,+BAYzD"}
|
package/dist/notion/Stats.js
CHANGED
|
@@ -6,9 +6,10 @@ import { cn } from "../lib/utils.js";
|
|
|
6
6
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
7
7
|
import { TONE_COLORS, TONE_FILL, TONE_TEXT } from "./tones.js";
|
|
8
8
|
// A screen's summary figures folded under a heading, closed by default: the design system's collapsible (a ghost row
|
|
9
|
-
// with a chevron that turns when open, the content
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
// with a chevron that turns when open, the content under it at the row's full width or, with `isInset`, indented to
|
|
10
|
+
// the title), on native `<details>` so it needs no client.
|
|
11
|
+
export function StatsFold({ title, children, className, isInset = false }) {
|
|
12
|
+
return (_jsxs("details", { "data-slot": "stats-fold", className: cn("group/stats-fold", className), children: [_jsxs("summary", { "data-slot": "stats-fold-summary", className: "flex h-row-height cursor-pointer list-none items-center gap-1 rounded-md px-1 text-foreground transition-colors duration-120 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden", children: [_jsx(ChevronRight, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/stats-fold:rotate-90" }), _jsx("h2", { className: "text-ui-medium", children: title })] }), _jsx("div", { "data-slot": "stats-fold-content", "data-inset": isInset, className: cn("flex flex-col gap-3 pt-2 pb-1", isInset && "pl-6"), children: children })] }));
|
|
12
13
|
}
|
|
13
14
|
function clampProgress(progress) {
|
|
14
15
|
if (!Number.isFinite(progress))
|
package/dist/notion/Stats.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stats.js","sourceRoot":"","sources":["../../src/notion/Stats.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAmB,MAAM,cAAc,CAAC;AAG7D,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CA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CACT,KA9BI,IAAI,CAAC,GAAG,CA+BV,CACN,CAAC;QACJ,CAAC,CAAC,GACC,CACN,CAAC;AACJ,CAAC;AAeD,0GAA0G;AAC1G,MAAM,UAAU,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAkB;IACxD,OAAO,CACL,2BAAgB,KAAK,eAAY,YAAY,EAAC,SAAS,EAAC,0DAA0D,YAC/G,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CACnB,0BAA8B,IAAI,CAAC,GAAG,eAAa,IAAI,CAAC,IAAI,IAAI,SAAS,YACvE,MAAC,KAAK,IAAC,OAAO,EAAC,KAAK,EAAC,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,IAAI,SAAS,CAAC,IAAI,SAAS,aACzE,IAAI,CAAC,KAAK,OAAE,iBAAQ,SAAS,EAAC,0BAA0B,YAAE,IAAI,CAAC,KAAK,GAAU,IACzE,IAHD,IAAI,CAAC,GAAG,CAIZ,CACN,CAAC,GACC,CACN,CAAC;AACJ,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,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,SAAS,CAAC;AAGrD,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,QAAQ,CAAC;AAE9C,MAAM,WAAW,YAAY;IAE3B,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAE1B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,CAAC;IAE1B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IAEjC,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAE5B,QAAQ,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC;IAE3B,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAE9B,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAE3B,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;IAC9B,QAAQ,CAAC,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACjC,QAAQ,CAAC,IAAI,CAAC,EAAE,YAAY,CAAC;IAG7B,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;IAC/B,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAE9B,QAAQ,CAAC,IAAI,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,QAAQ,MAAM,EAAE,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;CACxE;AAED,MAAM,WAAW,aAAa;IAE5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,YAAY,EAAE,CAAC;IACxC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAoED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,aAAa,+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":"","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,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/dist/ui/button.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "link" | "secondary" | "destructive" | "default" | "outline" | "ghost" | null | undefined;
|
|
4
|
+
variant?: "link" | "secondary" | "destructive" | "default" | "outline" | "ghost" | "floating" | null | undefined;
|
|
5
5
|
size?: "xs" | "sm" | "lg" | "default" | "icon" | "icon-xs" | "icon-sm" | "icon-lg" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
package/dist/ui/button.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;
|
|
1
|
+
{"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIjE,QAAA,MAAM,cAAc;;;8EAiCnB,CAAA;AAED,iBAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,OAAe,EACf,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,QAAQ,CAAC,GAC/B,YAAY,CAAC,OAAO,cAAc,CAAC,GAAG;IACpC,OAAO,CAAC,EAAE,OAAO,CAAA;CAClB,qBAYF;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
package/dist/ui/button.js
CHANGED
|
@@ -8,10 +8,11 @@ const buttonVariants = cva("inline-flex shrink-0 items-center justify-center gap
|
|
|
8
8
|
variant: {
|
|
9
9
|
default: "bg-primary text-primary-foreground hover:bg-primary-hover",
|
|
10
10
|
destructive: "bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:hover:bg-destructive/50 dark:focus-visible:ring-destructive/40",
|
|
11
|
-
outline: "border border-border bg-background hover:bg-accent hover:text-accent-foreground",
|
|
11
|
+
outline: "border border-border bg-background hover:bg-linear-to-r hover:from-accent hover:to-accent hover:text-accent-foreground",
|
|
12
12
|
secondary: "bg-secondary text-secondary-foreground hover:bg-accent-strong",
|
|
13
13
|
ghost: "text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
14
14
|
link: "text-link underline-offset-4 hover:underline",
|
|
15
|
+
floating: "bg-background text-foreground shadow-menu hover:bg-linear-to-r hover:from-accent hover:to-accent aria-expanded:bg-linear-to-r aria-expanded:from-accent-strong aria-expanded:to-accent-strong disabled:text-muted-foreground disabled:opacity-100 disabled:shadow-none",
|
|
15
16
|
},
|
|
16
17
|
size: {
|
|
17
18
|
default: "h-7 px-2.5 has-[>svg:first-child]:pl-2 has-[>svg:last-child]:pr-2",
|
package/dist/ui/button.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,MAAM,cAAc,GAAG,GAAG,CACxB,wbAAwb,EACxb;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,2DAA2D;YACpE,WAAW,EACT,iMAAiM;YACnM,OAAO,EACL,
|
|
1
|
+
{"version":3,"file":"button.js","sourceRoot":"","sources":["../../src/ui/button.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,MAAM,cAAc,GAAG,GAAG,CACxB,wbAAwb,EACxb;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,2DAA2D;YACpE,WAAW,EACT,iMAAiM;YACnM,OAAO,EACL,wHAAwH;YAC1H,SAAS,EAAE,+DAA+D;YAC1E,KAAK,EAAE,6DAA6D;YACpE,IAAI,EAAE,8CAA8C;YACpD,QAAQ,EACN,wQAAwQ;SAC3Q;QACD,IAAI,EAAE;YACJ,OAAO,EACL,mEAAmE;YACrE,EAAE,EAAE,0FAA0F;YAC9F,EAAE,EAAE,kGAAkG;YACtG,EAAE,EAAE,gFAAgF;YACpF,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,wDAAwD;YACnE,SAAS,EAAE,QAAQ;YACnB,SAAS,EAAE,QAAQ;SACpB;KACF;IACD,eAAe,EAAE;QACf,OAAO,EAAE,SAAS;QAClB,IAAI,EAAE,SAAS;KAChB;CACF,CACF,CAAA;AAED,SAAS,MAAM,CAAC,EACd,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,OAAO,GAAG,KAAK,EACf,GAAG,KAAK,EAIP;IACD,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,QAAQ,CAAA;IAE3C,OAAO,CACL,KAAC,IAAI,iBACO,QAAQ,kBACJ,OAAO,eACV,IAAI,EACf,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,CAAC,CAAC,KACvD,KAAK,GACT,CACH,CAAA;AACH,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "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";
|
package/src/notion/FoldRow.tsx
CHANGED
|
@@ -14,63 +14,126 @@ export interface FoldRowBadge {
|
|
|
14
14
|
readonly tone?: Tone;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
|
|
17
|
+
/** The row's summary: the fixed title, facts and badges, or a node of the app's own. */
|
|
18
|
+
export type FoldRowSummaryProps =
|
|
19
|
+
| {
|
|
20
|
+
readonly title: ReactNode;
|
|
21
|
+
/** Short facts after the title; left out when empty. */
|
|
22
|
+
readonly facts?: readonly ReactNode[];
|
|
23
|
+
/** Badges on the row's right, in order. */
|
|
24
|
+
readonly badges: readonly FoldRowBadge[];
|
|
25
|
+
readonly summary?: never;
|
|
26
|
+
}
|
|
27
|
+
| {
|
|
28
|
+
/** Drawn after the chevron in place of the title, facts and badges, as a wrapping row. */
|
|
29
|
+
readonly summary: ReactNode;
|
|
30
|
+
readonly title?: never;
|
|
31
|
+
readonly facts?: never;
|
|
32
|
+
readonly badges?: never;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
/** The details table at the top of the opened content, or none. */
|
|
36
|
+
export type FoldRowDetailsProps =
|
|
37
|
+
| {
|
|
38
|
+
/** The details table's accessible name. */
|
|
39
|
+
readonly detailsLabel: string;
|
|
40
|
+
readonly details: readonly DetailRow[];
|
|
41
|
+
}
|
|
42
|
+
| {
|
|
43
|
+
readonly detailsLabel?: never;
|
|
44
|
+
readonly details?: never;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
export type FoldRowProps = FoldRowSummaryProps &
|
|
48
|
+
FoldRowDetailsProps & {
|
|
49
|
+
/** Indents the opened content to line up with the title after the chevron; by default it is padded equally. */
|
|
50
|
+
readonly isInset?: boolean;
|
|
51
|
+
/** More content under the table when opened. */
|
|
52
|
+
readonly children?: ReactNode;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const CONTENT_CLASS = "flex flex-col gap-2 p-3 empty:hidden";
|
|
56
|
+
const INSET_CONTENT_CLASS = "flex flex-col gap-2 py-2 pr-1 pl-6 empty:hidden";
|
|
57
|
+
|
|
58
|
+
function FoldRowFixedSummary({
|
|
59
|
+
title,
|
|
60
|
+
facts = [],
|
|
61
|
+
badges,
|
|
62
|
+
}: {
|
|
18
63
|
readonly title: ReactNode;
|
|
19
|
-
/** Short facts after the title; left out when empty. */
|
|
20
64
|
readonly facts?: readonly ReactNode[];
|
|
21
|
-
/** Badges on the row's right, in order. */
|
|
22
65
|
readonly badges: readonly FoldRowBadge[];
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
66
|
+
}) {
|
|
67
|
+
return (
|
|
68
|
+
<>
|
|
69
|
+
{/* The chevron and the title wrap as one: a long title folds onto lines beside its chevron. */}
|
|
70
|
+
<span data-slot="fold-row-heading" className="flex min-w-0 items-center gap-2">
|
|
71
|
+
<FoldRowChevron />
|
|
72
|
+
<span className="min-w-0 text-ui-medium">{title}</span>
|
|
73
|
+
</span>
|
|
74
|
+
{facts.map((fact, index) => (
|
|
75
|
+
// Facts have no identity of their own; their order is fixed for one render.
|
|
76
|
+
<span key={index} data-slot="fold-row-fact" className="text-ui text-muted-foreground">
|
|
77
|
+
{fact}
|
|
78
|
+
</span>
|
|
79
|
+
))}
|
|
80
|
+
{badges.length === 0 ? null : (
|
|
81
|
+
<span data-slot="fold-row-badges" className="ml-auto inline-flex flex-wrap gap-1">
|
|
82
|
+
{badges.map((badge) => {
|
|
83
|
+
const tone = badge.tone ?? "default";
|
|
84
|
+
return (
|
|
85
|
+
<Badge
|
|
86
|
+
key={badge.key}
|
|
87
|
+
variant="tag"
|
|
88
|
+
color={TONE_COLORS[tone] ?? "default"}
|
|
89
|
+
data-badge={badge.key}
|
|
90
|
+
data-tone={tone}
|
|
91
|
+
>
|
|
92
|
+
{badge.text}
|
|
93
|
+
</Badge>
|
|
94
|
+
);
|
|
95
|
+
})}
|
|
96
|
+
</span>
|
|
97
|
+
)}
|
|
98
|
+
</>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function FoldRowChevron() {
|
|
103
|
+
return (
|
|
104
|
+
<ChevronRight
|
|
105
|
+
aria-hidden="true"
|
|
106
|
+
strokeWidth={ICON_STROKE_WIDTH}
|
|
107
|
+
className="size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/fold-row:rotate-90"
|
|
108
|
+
/>
|
|
109
|
+
);
|
|
28
110
|
}
|
|
29
111
|
|
|
30
112
|
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
31
|
-
export function FoldRow(
|
|
113
|
+
export function FoldRow(props: FoldRowProps) {
|
|
114
|
+
const { isInset = false, children } = props;
|
|
32
115
|
return (
|
|
33
116
|
<details data-slot="fold-row" className="group/fold-row border-b border-border">
|
|
34
117
|
<summary
|
|
35
118
|
data-slot="fold-row-summary"
|
|
36
119
|
className="flex min-h-row-height cursor-pointer list-none flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-1 py-1 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"
|
|
37
120
|
>
|
|
38
|
-
{
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
{fact}
|
|
51
|
-
</span>
|
|
52
|
-
))}
|
|
53
|
-
{badges.length === 0 ? null : (
|
|
54
|
-
<span data-slot="fold-row-badges" className="ml-auto inline-flex flex-wrap gap-1">
|
|
55
|
-
{badges.map((badge) => {
|
|
56
|
-
const tone = badge.tone ?? "default";
|
|
57
|
-
return (
|
|
58
|
-
<Badge
|
|
59
|
-
key={badge.key}
|
|
60
|
-
variant="tag"
|
|
61
|
-
color={TONE_COLORS[tone] ?? "default"}
|
|
62
|
-
data-badge={badge.key}
|
|
63
|
-
data-tone={tone}
|
|
64
|
-
>
|
|
65
|
-
{badge.text}
|
|
66
|
-
</Badge>
|
|
67
|
-
);
|
|
68
|
-
})}
|
|
69
|
-
</span>
|
|
121
|
+
{props.summary === undefined ? (
|
|
122
|
+
<FoldRowFixedSummary title={props.title} facts={props.facts} badges={props.badges ?? []} />
|
|
123
|
+
) : (
|
|
124
|
+
<>
|
|
125
|
+
<FoldRowChevron />
|
|
126
|
+
<span
|
|
127
|
+
data-slot="fold-row-summary-slot"
|
|
128
|
+
className="flex min-w-0 flex-1 flex-wrap items-center gap-x-2 gap-y-1"
|
|
129
|
+
>
|
|
130
|
+
{props.summary}
|
|
131
|
+
</span>
|
|
132
|
+
</>
|
|
70
133
|
)}
|
|
71
134
|
</summary>
|
|
72
|
-
<div data-slot="fold-row-content" className=
|
|
73
|
-
<DetailTable label={detailsLabel} rows={details} />
|
|
135
|
+
<div data-slot="fold-row-content" data-inset={isInset} className={isInset ? INSET_CONTENT_CLASS : CONTENT_CLASS}>
|
|
136
|
+
{props.details === undefined ? null : <DetailTable label={props.detailsLabel} rows={props.details} />}
|
|
74
137
|
{children}
|
|
75
138
|
</div>
|
|
76
139
|
</details>
|
package/src/notion/Stats.tsx
CHANGED
|
@@ -13,11 +13,17 @@ export interface StatsFoldProps {
|
|
|
13
13
|
readonly title: string;
|
|
14
14
|
readonly children: ReactNode;
|
|
15
15
|
readonly className?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Indents the content to line up with the title after the chevron. Off by default: the content spans the fold's
|
|
18
|
+
* full width, with the same left and right edges as the heading row.
|
|
19
|
+
*/
|
|
20
|
+
readonly isInset?: boolean;
|
|
16
21
|
}
|
|
17
22
|
|
|
18
23
|
// A screen's summary figures folded under a heading, closed by default: the design system's collapsible (a ghost row
|
|
19
|
-
// with a chevron that turns when open, the content
|
|
20
|
-
|
|
24
|
+
// with a chevron that turns when open, the content under it at the row's full width or, with `isInset`, indented to
|
|
25
|
+
// the title), on native `<details>` so it needs no client.
|
|
26
|
+
export function StatsFold({ title, children, className, isInset = false }: StatsFoldProps) {
|
|
21
27
|
return (
|
|
22
28
|
<details data-slot="stats-fold" className={cn("group/stats-fold", className)}>
|
|
23
29
|
<summary
|
|
@@ -31,7 +37,11 @@ export function StatsFold({ title, children, className }: StatsFoldProps) {
|
|
|
31
37
|
/>
|
|
32
38
|
<h2 className="text-ui-medium">{title}</h2>
|
|
33
39
|
</summary>
|
|
34
|
-
<div
|
|
40
|
+
<div
|
|
41
|
+
data-slot="stats-fold-content"
|
|
42
|
+
data-inset={isInset}
|
|
43
|
+
className={cn("flex flex-col gap-3 pt-2 pb-1", isInset && "pl-6")}
|
|
44
|
+
>
|
|
35
45
|
{children}
|
|
36
46
|
</div>
|
|
37
47
|
</details>
|
|
@@ -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
|
+
}
|
package/src/ui/button.tsx
CHANGED
|
@@ -12,10 +12,12 @@ const buttonVariants = cva(
|
|
|
12
12
|
destructive:
|
|
13
13
|
"bg-destructive text-destructive-foreground hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:hover:bg-destructive/50 dark:focus-visible:ring-destructive/40",
|
|
14
14
|
outline:
|
|
15
|
-
"border border-border bg-background hover:bg-accent hover:text-accent-foreground",
|
|
15
|
+
"border border-border bg-background hover:bg-linear-to-r hover:from-accent hover:to-accent hover:text-accent-foreground",
|
|
16
16
|
secondary: "bg-secondary text-secondary-foreground hover:bg-accent-strong",
|
|
17
17
|
ghost: "text-muted-foreground hover:bg-accent hover:text-foreground",
|
|
18
18
|
link: "text-link underline-offset-4 hover:underline",
|
|
19
|
+
floating:
|
|
20
|
+
"bg-background text-foreground shadow-menu hover:bg-linear-to-r hover:from-accent hover:to-accent aria-expanded:bg-linear-to-r aria-expanded:from-accent-strong aria-expanded:to-accent-strong disabled:text-muted-foreground disabled:opacity-100 disabled:shadow-none",
|
|
19
21
|
},
|
|
20
22
|
size: {
|
|
21
23
|
default:
|