@softure-ai/theme-notion 0.5.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 +22 -0
- package/README.md +21 -2
- 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/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/notion/FoldRow.tsx +106 -43
- package/src/notion/Stats.tsx +13 -3
- package/src/ui/button.tsx +3 -1
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,28 @@ 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
|
+
|
|
7
29
|
## 0.5.0
|
|
8
30
|
|
|
9
31
|
- 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.
|
|
@@ -125,6 +126,20 @@ list of what it counts, below), `FilterChip` and `FilterChipAdd` (a list's filte
|
|
|
125
126
|
stages with a state, 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">
|
|
@@ -292,7 +309,9 @@ secondary content with `group` on the list). `as="ol"` renders a numbered list;
|
|
|
292
309
|
Deltas from stock shadcn:
|
|
293
310
|
|
|
294
311
|
- `button`: sizes 28/24/32 px, a smaller padding on the icon side, a Notion `ghost`, `secondary` hover
|
|
295
|
-
`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"`.
|
|
296
315
|
- `badge`: a `tag` variant and a `color` prop with the nine palette colours (and `default`); `color` applies to every
|
|
297
316
|
variant but `destructive`, which keeps its own fill and white text. `alert`: palette colour variants (a
|
|
298
317
|
Notion callout).
|
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":["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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,GAAG,iDAAiD,CAAC;AAE9E,SAAS,mBAAmB,CAAC,EAC3B,KAAK,EACL,KAAK,GAAG,EAAE,EACV,MAAM,GAKP;IACC,OAAO,CACL,8BAEE,6BAAgB,kBAAkB,EAAC,SAAS,EAAC,iCAAiC,aAC5E,KAAC,cAAc,KAAG,EAClB,eAAM,SAAS,EAAC,wBAAwB,YAAE,KAAK,GAAQ,IAClD,EACN,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAE1B,4BAA4B,eAAe,EAAC,SAAS,EAAC,+BAA+B,YAClF,IAAI,IADI,KAAK,CAET,CACR,CAAC,EACD,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CA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AmB,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","s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;IAC7B,kCAAkC;IAClC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,EAAE,SAAS,QAAQ,EAAE,CAAC;IACpC,8FAA8F;IAC9F,QAAQ,CAAC,WAAW,CAAC,EAAE,OAAO,CAAC;IAC/B,oEAAoE;IACpE,QAAQ,CAAC,QAAQ,CAAC,EAAE,OAAO,CAAC;CAC7B;AAyBD,wBAAgB,SAAS,CAAC,EAAE,KAAK,EAAE,KAAK,EAAE,WAAmB,EAAE,QAAgB,EAAE,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))
|
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,CAAC;AACvC,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,YAAY,CAAC;
|
|
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,EAA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S,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"}
|
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,iBAA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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.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",
|
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>
|
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:
|