@softure-ai/theme-notion 0.4.0 → 0.6.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 +42 -0
- package/README.md +49 -10
- package/dist/base.css +2 -0
- package/dist/maplibre.css +2 -0
- 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 +9 -1
- package/dist/notion/Stats.d.ts.map +1 -1
- package/dist/notion/Stats.js +13 -7
- package/dist/notion/Stats.js.map +1 -1
- package/dist/preflight.css +2 -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/dist/ui/command.d.ts +6 -1
- package/dist/ui/command.d.ts.map +1 -1
- package/dist/ui/command.js +3 -3
- package/dist/ui/command.js.map +1 -1
- package/package.json +6 -3
- package/src/notion/FoldRow.tsx +106 -43
- package/src/notion/Stats.tsx +30 -8
- package/src/ui/button.tsx +3 -1
- package/src/ui/command.tsx +11 -3
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,48 @@ 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.6.0
|
|
8
|
+
|
|
9
|
+
- `FoldRow` (#832): the opened content (`fold-row-content`) is padded equally on all four sides (`p-3`, 12 px) instead
|
|
10
|
+
of 24 px on the left and 4 px on the right, so a `DetailTable` sits centred under the row. `isInset` (default `false`)
|
|
11
|
+
keeps the old indented look (`py-2 pr-1 pl-6`) and sets `data-inset="true"` on `fold-row-content` (`"false"` without
|
|
12
|
+
it, as `StatsFold` does). New `summary` slot: a node drawn after the chevron in place of `title`, `facts` and
|
|
13
|
+
`badges`; `details` and `detailsLabel` are now optional together (no table without them). An app that wants the old
|
|
14
|
+
indent adds `isInset`; an app that drew rows "as `FoldRow` is" with its own markup for a custom summary or content
|
|
15
|
+
passes `summary` and `children` and drops its copy of the classes. Existing calls compile unchanged.
|
|
16
|
+
- `Button` (#833): the `outline` hover no longer swaps the opaque `bg-background` for the translucent `bg-accent`; the
|
|
17
|
+
accent is laid over the background as a gradient layer, so an outline button over a map or an image keeps its
|
|
18
|
+
surface on hover (on the page it looks the same as before). A new `floating` variant is for a button that floats over
|
|
19
|
+
content: opaque `bg-background` in every state, `text-foreground`, `shadow-menu` and no border, the `accent` tint on
|
|
20
|
+
hover and the `accent-strong` tint while `aria-expanded="true"`, and a disabled state with muted text at full
|
|
21
|
+
opacity. An app drops its `hover:bg-background hover:bg-linear-to-r hover:from-accent hover:to-accent` workaround
|
|
22
|
+
and uses `variant="floating"` for map and image controls.
|
|
23
|
+
- `StatsFold` (#831): the content spans the heading row's full width by default, with the same left and right edges
|
|
24
|
+
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.
|
|
25
|
+
The indented look is the new `isInset` prop (default `false`), which lines the content up with the title after the
|
|
26
|
+
chevron. The content carries `data-inset="true|false"`. An app that wants the old look passes `isInset`; an app that
|
|
27
|
+
undid the indent with its own class drops it.
|
|
28
|
+
|
|
29
|
+
## 0.5.0
|
|
30
|
+
|
|
31
|
+
- Needs `@softure-ai/theme-kit` `^0.1.4` (was `^0.1.3`): the version whose `softure-theme-css` writes `preflight.css`
|
|
32
|
+
and the stylesheet re-exports (#795).
|
|
33
|
+
- `Command` (#809): `CommandDialog` passes its `title` to cmdk's `label`, so the palette's combobox is named by the
|
|
34
|
+
dialog's title (it had an empty name: cmdk's `aria-labelledby` points at its hidden label and wins over an
|
|
35
|
+
`aria-label` on `CommandInput`). A bare `Command` needs `label` from the app. `CommandInput` takes `children`,
|
|
36
|
+
rendered after the input inside the input row (a `Kbd` "Esc" sits at its right end with no positioning), and
|
|
37
|
+
`wrapperClassName`, merged into the row's classes (`h-12` for the 48 px row). An app drops its absolutely
|
|
38
|
+
positioned `Kbd` beside `CommandInput` and its parent selector on `data-slot=command-input-wrapper`; a `label` it
|
|
39
|
+
set on `Command` keeps working. Without the new props the classes are unchanged.
|
|
40
|
+
- `StatCards` (#813): a card takes an optional `icon` (a Lucide icon component, e.g. `icon: Wallet`), drawn before the
|
|
41
|
+
label at 16 px with `ICON_STROKE_WIDTH` in the label's muted colour, 6 px apart, `aria-hidden`. An app that rebuilt
|
|
42
|
+
the card from `Card` to show the icon goes back to `StatCards`. A card without `icon` renders as before.
|
|
43
|
+
- `base.css`, `preflight.css`, `maplibre.css` (#795): the kit's page stylesheets, exported by the theme as
|
|
44
|
+
`@softure-ai/theme-notion/<name>.css`. Each is one `@import` of the kit's file, resolved from the theme's own dependency,
|
|
45
|
+
so the app gets the kit version the theme was built against and needs no `@softure-ai/theme-kit` of its own. An app
|
|
46
|
+
replaces `@softure-ai/theme-kit/` with `@softure-ai/theme-notion/` in its `globals.css` and drops a direct
|
|
47
|
+
`@softure-ai/theme-kit` dependency it kept only for the CSS. The old imports keep working while the kit is hoisted.
|
|
48
|
+
|
|
7
49
|
## 0.4.0
|
|
8
50
|
|
|
9
51
|
- Server Components (#770): the package root imports from a React Server Component again. 0.3.0's `ui/item.tsx`
|
package/README.md
CHANGED
|
@@ -16,11 +16,16 @@ npm i @softure-ai/theme-notion tailwindcss @tailwindcss/postcss
|
|
|
16
16
|
@import "tailwindcss";
|
|
17
17
|
@import "@softure-ai/theme-notion/theme.css"; /* tokens, utilities, dark:, animations, the components' classes */
|
|
18
18
|
@import "@softure-ai/theme-notion/sft-bridge.css"; /* optional: pages of the SOFTURE packages in a PageFrame */
|
|
19
|
-
@import "@softure-ai/theme-
|
|
19
|
+
@import "@softure-ai/theme-notion/base.css"; /* body on the theme's background, text colour and font */
|
|
20
20
|
@import "@softure-ai/theme-notion/page.css"; /* body text 14 px, blue text selection, font smoothing */
|
|
21
|
-
@import "@softure-ai/theme-
|
|
21
|
+
@import "@softure-ai/theme-notion/maplibre.css"; /* only if the app shows MapLibre maps */
|
|
22
22
|
```
|
|
23
23
|
|
|
24
|
+
Every stylesheet comes from the theme. `base.css`, `maplibre.css` and `preflight.css` are the kit's
|
|
25
|
+
([`@softure-ai/theme-kit`](../theme-kit/README.md)), re-exported by the theme: they resolve the kit from the theme's own
|
|
26
|
+
dependency, so the app declares only the theme and gets the kit version the theme was built against, in any package
|
|
27
|
+
manager layout.
|
|
28
|
+
|
|
24
29
|
`theme.css` names the package's components as Tailwind sources, so their classes are generated without the app
|
|
25
30
|
listing `node_modules`. It clears Tailwind's default palette: only the theme's colours exist as utilities.
|
|
26
31
|
|
|
@@ -31,13 +36,13 @@ taking the scoped preflight instead of Tailwind's:
|
|
|
31
36
|
@import "@softure-ai/ui/styles.css"; /* first: it declares the layer order */
|
|
32
37
|
@layer theme, base, components, utilities;
|
|
33
38
|
@import "tailwindcss/theme.css" layer(theme);
|
|
34
|
-
@import "@softure-ai/theme-
|
|
39
|
+
@import "@softure-ai/theme-notion/preflight.css"; /* Tailwind's preflight, only inside [data-slot] elements */
|
|
35
40
|
@import "tailwindcss/utilities.css" layer(utilities);
|
|
36
41
|
@import "@softure-ai/theme-notion/theme.css";
|
|
37
42
|
@import "@softure-ai/theme-notion/sft-bridge.css";
|
|
38
|
-
@import "@softure-ai/theme-
|
|
43
|
+
@import "@softure-ai/theme-notion/base.css"; /* nothing else styles body under the scoped preflight */
|
|
39
44
|
@import "@softure-ai/theme-notion/page.css";
|
|
40
|
-
@import "@softure-ai/theme-
|
|
45
|
+
@import "@softure-ai/theme-notion/maplibre.css"; /* only if the app shows MapLibre maps */
|
|
41
46
|
```
|
|
42
47
|
|
|
43
48
|
`base.css` gives `body` the theme's background, text colour and sans font without the browser's 8 px margin, so a
|
|
@@ -71,13 +76,15 @@ import { CircleCheck } from "lucide-react";
|
|
|
71
76
|
wording by props: `Breadcrumb aria-label`, `BreadcrumbEllipsis label`, `PageHeader crumbsLabel`,
|
|
72
77
|
`DialogContent closeLabel`, `SheetContent closeLabel`, `SidePanel closeLabel`, `Steps stateLabels`,
|
|
73
78
|
`Sidebar mobileTitle mobileDescription`, `SidebarTrigger label`, `SidebarRail label`, `Spinner aria-label`,
|
|
74
|
-
`CommandDialog title description
|
|
79
|
+
`CommandDialog title description` (`title` also names its search field), `Command label` (the search field's
|
|
80
|
+
name outside a `CommandDialog`; without it the field has none), `SortableList instructions announcements`, `SortableHandle label`.
|
|
75
81
|
|
|
76
82
|
## Rules, in short
|
|
77
83
|
|
|
78
84
|
- Background `background`, text `foreground`, secondary text `muted-foreground`. Never pure black.
|
|
79
85
|
- Hover is the grey `accent` background, never a border or a shadow; selected and pressed use `accent-strong`.
|
|
80
|
-
- 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`.
|
|
81
88
|
- A palette colour (`gray`, `brown`, `orange`, `yellow`, `green`, `blue`, `purple`, `pink`, `red`, each with `-bg`,
|
|
82
89
|
`-tag`, `-tag-foreground`) marks an area (a tag) or a state (a status, a callout), never decoration. The same
|
|
83
90
|
colour always means the same thing; the app keeps its own table of meanings.
|
|
@@ -119,6 +126,20 @@ list of what it counts, below), `FilterChip` and `FilterChipAdd` (a list's filte
|
|
|
119
126
|
stages with a state, below), `Code` (inline code) and `CodeBlock` (a mono block for logs and paths, below),
|
|
120
127
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below).
|
|
121
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
|
+
|
|
122
143
|
**`FilterChip`.** The filters above a list or a table, drawn the way a Notion database view draws them: a 24 px pill
|
|
123
144
|
`icon · Label: value ▾` that opens a menu of options in the design system's popover. While the default value is
|
|
124
145
|
chosen the pill is muted; `isActive` (a non-default value) turns it into the blue tag and sets `data-active`. The
|
|
@@ -161,14 +182,17 @@ A screen's summary figures: `StatsFold` (figures folded under a heading, closed
|
|
|
161
182
|
optional `hint`, optional `aside` tag; `isFullWidth` and `isOneRow` change the grid) and `StatPills` ("label **value**" tags in one row). Each figure takes a
|
|
162
183
|
`tone`; the app keeps only its own table of which meaning takes which tone. A card's `progress` (0–100, clamped) draws
|
|
163
184
|
the package's 6 px `Progress` under the figure, filled in the card's tone (primary without one) and named by
|
|
164
|
-
`progressLabel` (default: the card's `label`).
|
|
185
|
+
`progressLabel` (default: the card's `label`). A card's `icon` (a Lucide icon component) is drawn before the label: 16 px,
|
|
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.
|
|
165
189
|
|
|
166
190
|
```tsx
|
|
167
191
|
<StatsFold title="Summary">
|
|
168
192
|
<StatCards
|
|
169
193
|
label="Totals"
|
|
170
194
|
cards={[
|
|
171
|
-
{ key: "paid", label: "Paid", value: "1,200", tone: "success" },
|
|
195
|
+
{ key: "paid", label: "Paid", value: "1,200", tone: "success", icon: Wallet },
|
|
172
196
|
{ key: "owed", label: "Owed", value: "300", tone: "danger", hint: "2 invoices", aside: { text: "+5%" } },
|
|
173
197
|
{ key: "hours", label: "Hours", value: "21.5 / 23.4 h", progress: 92, progressLabel: "Hours used" },
|
|
174
198
|
]}
|
|
@@ -285,12 +309,27 @@ secondary content with `group` on the list). `as="ol"` renders a numbered list;
|
|
|
285
309
|
Deltas from stock shadcn:
|
|
286
310
|
|
|
287
311
|
- `button`: sizes 28/24/32 px, a smaller padding on the icon side, a Notion `ghost`, `secondary` hover
|
|
288
|
-
`accent-strong`, no shadows.
|
|
312
|
+
`accent-strong`, no shadows. `outline` lays its hover tint over its opaque background. A `floating` variant is for a
|
|
313
|
+
button over a map, an image or any non-page surface: opaque in every state, `shadow-menu`, no border, the `accent`
|
|
314
|
+
tint on hover and `accent-strong` while `aria-expanded="true"`.
|
|
289
315
|
- `badge`: a `tag` variant and a `color` prop with the nine palette colours (and `default`); `color` applies to every
|
|
290
316
|
variant but `destructive`, which keeps its own fill and white text. `alert`: palette colour variants (a
|
|
291
317
|
Notion callout).
|
|
292
318
|
- `input`, `textarea`, `select`, `input-group`: 28 px high, grey `field` background, thin `input` border.
|
|
293
319
|
- `dropdown-menu`, `select`, `popover`, `command`: radius 10, `shadow-menu` without a border, 28 px items.
|
|
320
|
+
- `command`: `CommandDialog` passes its `title` to cmdk's `label`, the search field's accessible name (cmdk's
|
|
321
|
+
`aria-labelledby` wins over an `aria-label` on `CommandInput`). `CommandInput` renders its `children` at the end of
|
|
322
|
+
the input row and merges `wrapperClassName` into the row:
|
|
323
|
+
|
|
324
|
+
```tsx
|
|
325
|
+
<CommandDialog open={open} onOpenChange={setOpen} title="Search pages">
|
|
326
|
+
<CommandInput placeholder="Search…" wrapperClassName="h-12">
|
|
327
|
+
<Kbd>Esc</Kbd>
|
|
328
|
+
</CommandInput>
|
|
329
|
+
<CommandList>…</CommandList>
|
|
330
|
+
</CommandDialog>
|
|
331
|
+
```
|
|
332
|
+
|
|
294
333
|
- `dialog`, `alert-dialog`: radius 10, `shadow-dialog`, no border. `card`: `shadow-card` instead of a border.
|
|
295
334
|
- `checkbox` 16 px with a 1.5 px border, `radio-group` drawn the same (round, a `primary` dot), `switch` 26 × 16
|
|
296
335
|
(thumb shadow in `SWITCH_THUMB_SHADOW_CLASS`, for a native switch drawn the same), `tooltip` dark without an arrow,
|
package/dist/base.css
ADDED
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,MA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Right } 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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,CAAC;AACJ,CAAC;AAED,SAAS,cAAc;IACrB,OAAO,CACL,KAAC,YAAY,mBACC,MAAM,EAClB,WAAW,EAAE,iBAAiB,EAC9B,SAAS,EAAC,uGAAuG,GACjH,CACH,CAAC;AACJ,CAAC;AAED,kHAAkH;AAClH,MAAM,UAAU,OAAO,CAAC,KAAmB;IACzC,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;IAC5C,OAAO,CACL,gCAAmB,UAAU,EAAC,SAAS,EAAC,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
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
1
2
|
import type { ReactNode } from "react";
|
|
2
3
|
import { type Tone } from "./tones.js";
|
|
3
4
|
export interface StatsFoldProps {
|
|
@@ -5,8 +6,13 @@ export interface StatsFoldProps {
|
|
|
5
6
|
readonly title: string;
|
|
6
7
|
readonly children: ReactNode;
|
|
7
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;
|
|
8
14
|
}
|
|
9
|
-
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;
|
|
10
16
|
export interface StatCardAside {
|
|
11
17
|
readonly text: string;
|
|
12
18
|
readonly tone?: Tone;
|
|
@@ -15,6 +21,8 @@ export interface StatCard {
|
|
|
15
21
|
/** Unique within the row; kept as `data-stat`. */
|
|
16
22
|
readonly key: string;
|
|
17
23
|
readonly label: string;
|
|
24
|
+
/** A decorative icon before the label: 16 px, the design system's stroke, the label's muted colour. */
|
|
25
|
+
readonly icon?: LucideIcon;
|
|
18
26
|
readonly value: string;
|
|
19
27
|
readonly hint?: string;
|
|
20
28
|
readonly tone?: Tone;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Stats.d.ts","sourceRoot":"","sources":["../../src/notion/Stats.tsx"],"names":[],"mappings":"
|
|
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,SAA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AE,EAAE,cAAc,+BAsDhG;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;CACrC;AAGD,wBAAgB,SAAS,CAAC,EAAE,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))
|
|
@@ -20,15 +21,20 @@ function getStatCardsLayout(isFullWidth, isOneRow) {
|
|
|
20
21
|
return "row";
|
|
21
22
|
return isFullWidth ? "full" : "grid";
|
|
22
23
|
}
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
function StatCardLabel({ label, icon: Icon }) {
|
|
25
|
+
if (Icon === undefined)
|
|
26
|
+
return _jsx("div", { className: "text-section-label text-muted-foreground", children: label });
|
|
27
|
+
return (_jsxs("div", { className: "flex items-center gap-1.5 text-section-label text-muted-foreground", children: [_jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: "size-4 shrink-0" }), label] }));
|
|
28
|
+
}
|
|
29
|
+
// Summary figures as a row of cards wrapping on a narrow screen: the label (after an optional icon), the figure in its
|
|
30
|
+
// tone's colour (never broken, tabular numbers), an optional bar under it, an optional note and an optional short
|
|
31
|
+
// figure on its right as a tag.
|
|
26
32
|
export function StatCards({ label, cards, isFullWidth = false, isOneRow = false }) {
|
|
27
33
|
return (_jsx("ul", { "aria-label": label, "data-slot": "stat-cards", "data-layout": getStatCardsLayout(isFullWidth, isOneRow), className: cn("grid gap-2", isFullWidth
|
|
28
34
|
? "grid-cols-[repeat(auto-fit,minmax(min(14rem,100%),1fr))]"
|
|
29
35
|
: "grid-cols-[repeat(auto-fill,minmax(min(10rem,100%),1fr))]", isOneRow && "sm:auto-cols-fr sm:grid-flow-col sm:grid-cols-none"), children: cards.map((card) => {
|
|
30
36
|
const tone = card.tone ?? "default";
|
|
31
|
-
return (_jsxs("li", { "data-stat": card.key, className: "flex min-w-0 items-start justify-between gap-2 rounded-lg bg-card p-3 text-card-foreground shadow-card", children: [_jsxs("div", { className: cn("min-w-0", card.progress !== undefined && "flex-1"), children: [_jsx(
|
|
37
|
+
return (_jsxs("li", { "data-stat": card.key, className: "flex min-w-0 items-start justify-between gap-2 rounded-lg bg-card p-3 text-card-foreground shadow-card", children: [_jsxs("div", { className: cn("min-w-0", card.progress !== undefined && "flex-1"), children: [_jsx(StatCardLabel, { label: card.label, icon: card.icon }), _jsx("div", { "data-tone": tone, className: cn("mt-1 text-heading-3 whitespace-nowrap tabular-nums", TONE_TEXT[tone]), children: card.value }), card.progress === undefined ? null : (_jsx(Progress, { value: clampProgress(card.progress), "aria-label": card.progressLabel ?? card.label, "data-slot": "stat-card-progress", className: "mt-2", indicatorClassName: card.tone === undefined ? undefined : TONE_FILL[card.tone] })), card.hint === undefined ? null : _jsx("div", { className: "mt-1 text-small text-muted-foreground", children: card.hint })] }), card.aside === undefined ? null : (_jsx(Badge, { variant: "tag", color: TONE_COLORS[card.aside.tone ?? "default"] ?? "default", "data-slot": "stat-card-aside", "data-tone": card.aside.tone ?? "default", className: "text-small", children: card.aside.text }))] }, card.key));
|
|
32
38
|
}) }));
|
|
33
39
|
}
|
|
34
40
|
// Small counts as "label **value**" tags in one row, wrapping only on a phone, each in its tone's colour.
|
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,
|
|
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,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,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AC,KAAK,GAAU,IACzE,IAHD,IAAI,CAAC,GAAG,CAIZ,CACN,CAAC,GACC,CACN,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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E3C,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/dist/ui/command.d.ts
CHANGED
|
@@ -8,7 +8,12 @@ declare function CommandDialog({ title, description, children, className, showCl
|
|
|
8
8
|
className?: string;
|
|
9
9
|
showCloseButton?: boolean;
|
|
10
10
|
}): React.JSX.Element;
|
|
11
|
-
declare function CommandInput({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Input>
|
|
11
|
+
declare function CommandInput({ className, wrapperClassName, children, ...props }: React.ComponentProps<typeof CommandPrimitive.Input> & {
|
|
12
|
+
/** Classes for the input row (e.g. its height), merged after the row's own. */
|
|
13
|
+
wrapperClassName?: string;
|
|
14
|
+
/** Content at the end of the input row, after the input (e.g. a `Kbd`). */
|
|
15
|
+
children?: React.ReactNode;
|
|
16
|
+
}): React.JSX.Element;
|
|
12
17
|
declare function CommandList({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.List>): React.JSX.Element;
|
|
13
18
|
declare function CommandEmpty({ ...props }: React.ComponentProps<typeof CommandPrimitive.Empty>): React.JSX.Element;
|
|
14
19
|
declare function CommandGroup({ className, ...props }: React.ComponentProps<typeof CommandPrimitive.Group>): React.JSX.Element;
|
package/dist/ui/command.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.d.ts","sourceRoot":"","sources":["../../src/ui/command.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAKlD,OAAO,EACL,MAAM,EAKP,MAAM,aAAa,CAAA;AAEpB,iBAAS,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_jsx(CommandPrimitive, { "data-slot": "command", className: cn("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground", className), ...props }));
|
|
11
11
|
}
|
|
12
12
|
function CommandDialog({ title = messages.command.title, description = messages.command.description, children, className, showCloseButton = true, ...props }) {
|
|
13
|
-
return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("overflow-hidden p-0", className), showCloseButton: showCloseButton, children: _jsx(Command, { className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) })] }));
|
|
13
|
+
return (_jsxs(Dialog, { ...props, children: [_jsxs(DialogHeader, { className: "sr-only", children: [_jsx(DialogTitle, { children: title }), _jsx(DialogDescription, { children: description })] }), _jsx(DialogContent, { className: cn("overflow-hidden p-0", className), showCloseButton: showCloseButton, children: _jsx(Command, { label: title, className: "**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5", children: children }) })] }));
|
|
14
14
|
}
|
|
15
|
-
function CommandInput({ className, ...props }) {
|
|
16
|
-
return (_jsxs("div", { "data-slot": "command-input-wrapper", className: "flex h-9 items-center gap-2 border-b px-3", children: [_jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className), ...props })] }));
|
|
15
|
+
function CommandInput({ className, wrapperClassName, children, ...props }) {
|
|
16
|
+
return (_jsxs("div", { "data-slot": "command-input-wrapper", className: cn("flex h-9 items-center gap-2 border-b px-3", wrapperClassName), children: [_jsx(SearchIcon, { className: "size-4 shrink-0 opacity-50" }), _jsx(CommandPrimitive.Input, { "data-slot": "command-input", className: cn("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50", className), ...props }), children] }));
|
|
17
17
|
}
|
|
18
18
|
function CommandList({ className, ...props }) {
|
|
19
19
|
return (_jsx(CommandPrimitive.List, { "data-slot": "command-list", className: cn("max-h-[300px] scroll-py-1 overflow-x-hidden overflow-y-auto", className), ...props }));
|
package/dist/ui/command.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"command.js","sourceRoot":"","sources":["../../src/ui/command.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,MAAM,CAAA;AAClD,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AAEzC,OAAO,EACL,MAAM,EACN,aAAa,EACb,iBAAiB,E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
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.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",
|
|
@@ -34,7 +34,10 @@
|
|
|
34
34
|
},
|
|
35
35
|
"./theme.css": "./dist/theme.css",
|
|
36
36
|
"./sft-bridge.css": "./dist/sft-bridge.css",
|
|
37
|
-
"./page.css": "./dist/page.css"
|
|
37
|
+
"./page.css": "./dist/page.css",
|
|
38
|
+
"./preflight.css": "./dist/preflight.css",
|
|
39
|
+
"./base.css": "./dist/base.css",
|
|
40
|
+
"./maplibre.css": "./dist/maplibre.css"
|
|
38
41
|
},
|
|
39
42
|
"softureTheme": {
|
|
40
43
|
"sources": [
|
|
@@ -58,7 +61,7 @@
|
|
|
58
61
|
"@dnd-kit/core": "^6.3.1",
|
|
59
62
|
"@dnd-kit/sortable": "^10.0.0",
|
|
60
63
|
"@dnd-kit/utilities": "^3.2.2",
|
|
61
|
-
"@softure-ai/theme-kit": "^0.1.
|
|
64
|
+
"@softure-ai/theme-kit": "^0.1.4",
|
|
62
65
|
"class-variance-authority": "^0.7.1",
|
|
63
66
|
"cmdk": "^1.1.1",
|
|
64
67
|
"lucide-react": "^1.61.0",
|
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
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ChevronRight } from "lucide-react";
|
|
1
|
+
import { ChevronRight, type LucideIcon } from "lucide-react";
|
|
2
2
|
import type { ReactNode } from "react";
|
|
3
3
|
|
|
4
4
|
import { Badge } from "../ui/badge.js";
|
|
@@ -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>
|
|
@@ -47,6 +57,8 @@ export interface StatCard {
|
|
|
47
57
|
/** Unique within the row; kept as `data-stat`. */
|
|
48
58
|
readonly key: string;
|
|
49
59
|
readonly label: string;
|
|
60
|
+
/** A decorative icon before the label: 16 px, the design system's stroke, the label's muted colour. */
|
|
61
|
+
readonly icon?: LucideIcon;
|
|
50
62
|
readonly value: string;
|
|
51
63
|
readonly hint?: string;
|
|
52
64
|
readonly tone?: Tone;
|
|
@@ -77,9 +89,19 @@ function getStatCardsLayout(isFullWidth: boolean, isOneRow: boolean): "row" | "f
|
|
|
77
89
|
return isFullWidth ? "full" : "grid";
|
|
78
90
|
}
|
|
79
91
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
92
|
+
function StatCardLabel({ label, icon: Icon }: { readonly label: string; readonly icon: LucideIcon | undefined }) {
|
|
93
|
+
if (Icon === undefined) return <div className="text-section-label text-muted-foreground">{label}</div>;
|
|
94
|
+
return (
|
|
95
|
+
<div className="flex items-center gap-1.5 text-section-label text-muted-foreground">
|
|
96
|
+
<Icon aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} className="size-4 shrink-0" />
|
|
97
|
+
{label}
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
// Summary figures as a row of cards wrapping on a narrow screen: the label (after an optional icon), the figure in its
|
|
103
|
+
// tone's colour (never broken, tabular numbers), an optional bar under it, an optional note and an optional short
|
|
104
|
+
// figure on its right as a tag.
|
|
83
105
|
export function StatCards({ label, cards, isFullWidth = false, isOneRow = false }: StatCardsProps) {
|
|
84
106
|
return (
|
|
85
107
|
<ul
|
|
@@ -103,7 +125,7 @@ export function StatCards({ label, cards, isFullWidth = false, isOneRow = false
|
|
|
103
125
|
className="flex min-w-0 items-start justify-between gap-2 rounded-lg bg-card p-3 text-card-foreground shadow-card"
|
|
104
126
|
>
|
|
105
127
|
<div className={cn("min-w-0", card.progress !== undefined && "flex-1")}>
|
|
106
|
-
<
|
|
128
|
+
<StatCardLabel label={card.label} icon={card.icon} />
|
|
107
129
|
<div data-tone={tone} className={cn("mt-1 text-heading-3 whitespace-nowrap tabular-nums", TONE_TEXT[tone])}>
|
|
108
130
|
{card.value}
|
|
109
131
|
</div>
|
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:
|
package/src/ui/command.tsx
CHANGED
|
@@ -53,7 +53,7 @@ function CommandDialog({
|
|
|
53
53
|
className={cn("overflow-hidden p-0", className)}
|
|
54
54
|
showCloseButton={showCloseButton}
|
|
55
55
|
>
|
|
56
|
-
<Command className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
56
|
+
<Command label={title} className="**:data-[slot=command-input-wrapper]:h-12 [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]]:px-2 [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-input-wrapper]_svg]:h-5 [&_[cmdk-input-wrapper]_svg]:w-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]]:py-3 [&_[cmdk-item]_svg]:h-5 [&_[cmdk-item]_svg]:w-5">
|
|
57
57
|
{children}
|
|
58
58
|
</Command>
|
|
59
59
|
</DialogContent>
|
|
@@ -63,12 +63,19 @@ function CommandDialog({
|
|
|
63
63
|
|
|
64
64
|
function CommandInput({
|
|
65
65
|
className,
|
|
66
|
+
wrapperClassName,
|
|
67
|
+
children,
|
|
66
68
|
...props
|
|
67
|
-
}: React.ComponentProps<typeof CommandPrimitive.Input>
|
|
69
|
+
}: React.ComponentProps<typeof CommandPrimitive.Input> & {
|
|
70
|
+
/** Classes for the input row (e.g. its height), merged after the row's own. */
|
|
71
|
+
wrapperClassName?: string
|
|
72
|
+
/** Content at the end of the input row, after the input (e.g. a `Kbd`). */
|
|
73
|
+
children?: React.ReactNode
|
|
74
|
+
}) {
|
|
68
75
|
return (
|
|
69
76
|
<div
|
|
70
77
|
data-slot="command-input-wrapper"
|
|
71
|
-
className="flex h-9 items-center gap-2 border-b px-3"
|
|
78
|
+
className={cn("flex h-9 items-center gap-2 border-b px-3", wrapperClassName)}
|
|
72
79
|
>
|
|
73
80
|
<SearchIcon className="size-4 shrink-0 opacity-50" />
|
|
74
81
|
<CommandPrimitive.Input
|
|
@@ -79,6 +86,7 @@ function CommandInput({
|
|
|
79
86
|
)}
|
|
80
87
|
{...props}
|
|
81
88
|
/>
|
|
89
|
+
{children}
|
|
82
90
|
</div>
|
|
83
91
|
)
|
|
84
92
|
}
|