@softure-ai/theme-notion 0.36.0 → 0.37.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 +11 -0
- package/README.md +9 -3
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/notion/FoldRow.d.ts +7 -0
- package/dist/notion/FoldRow.d.ts.map +1 -1
- package/dist/notion/FoldRow.js +14 -8
- package/dist/notion/FoldRow.js.map +1 -1
- package/dist/notion/List.d.ts +4 -3
- package/dist/notion/List.d.ts.map +1 -1
- package/dist/notion/List.js +5 -4
- package/dist/notion/List.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +1 -1
- package/src/notion/FoldRow.tsx +38 -11
- package/src/notion/List.tsx +7 -6
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@ 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.37.0
|
|
8
|
+
|
|
9
|
+
- `FoldRow` (#1495): `align="start"` lines the bar up with the summary's first line: the chevron sits on that line
|
|
10
|
+
(in a box one line of `ui` text high, `data-slot="fold-row-chevron"`) and the right column is top-aligned, the
|
|
11
|
+
status on the first line and the actions under it. The default (`center`) keeps the centred bar. An app drops its
|
|
12
|
+
local `[data-slot=fold-row-summary]:items-start` and chevron margin overrides.
|
|
13
|
+
- `ListEntry` (#1497): the identity and the right column align to the top (`items-start`), so with a multi-line
|
|
14
|
+
identity (a title with detail lines, chips, a time) the state stands on the title's line and the controls under it,
|
|
15
|
+
instead of floating in the middle of the row; the arrow of a linked row sits on the title's line. Single-line rows
|
|
16
|
+
look as before; on a phone the column still wraps under the identity.
|
|
17
|
+
|
|
7
18
|
## 0.36.0
|
|
8
19
|
|
|
9
20
|
- `RowActionsMenu` (#1492): a destructive `onSelect` may return a promise (a server action); with `confirm` the
|
package/README.md
CHANGED
|
@@ -236,7 +236,10 @@ delete button, a menu), beside the `<details>` rather than inside its `<summary>
|
|
|
236
236
|
many lines it wraps to, and the summary and the column light as one box when the row is open or hovered. Below `md`
|
|
237
237
|
the column falls under the summary and each action is at least 44 px. With a column the row is a grid
|
|
238
238
|
(`data-slot="fold-row-with-actions"`, which carries the bottom border) and the opened content sits under the whole bar
|
|
239
|
-
as the details' sibling, shown while it is open.
|
|
239
|
+
as the details' sibling, shown while it is open. By default the chevron and the column are centred on the bar;
|
|
240
|
+
`align="start"` lines both up with the summary's first line instead, for a summary of several lines (a title, a stage,
|
|
241
|
+
an outcome): the chevron sits in a box one line of `ui` text high (`data-slot="fold-row-chevron"`), and the column is
|
|
242
|
+
top-aligned, the status on the first line and the actions under it. `isOpenInitially` renders the row open (`<details open>`), for the row the
|
|
240
243
|
address points at; only the first render reads it, and the reader can still fold the row.
|
|
241
244
|
|
|
242
245
|
```tsx
|
|
@@ -245,6 +248,7 @@ address points at; only the first render reads it, and the reader can still fold
|
|
|
245
248
|
<InvoiceLines />
|
|
246
249
|
</FoldRow>
|
|
247
250
|
<FoldRow title="clip.mp4" badges={[]} status={<Status color="green">Paid</Status>} actions={<DeleteButton />} />
|
|
251
|
+
<FoldRow align="start" size="touch" summary={<ItemLines />} status={<Status color="blue">In progress</Status>} actions={<OpenButton />} />
|
|
248
252
|
```
|
|
249
253
|
|
|
250
254
|
**`FilterChip`.** The filters above a list or a table, drawn the way a Notion database view draws them: a 24 px pill
|
|
@@ -528,9 +532,11 @@ renders with other components, `LIST_CLASSES` holds the same classes (`list`, `t
|
|
|
528
532
|
|
|
529
533
|
**`ListEntry`: a row with a right column.** The most common row of an admin list: what the row is on the left
|
|
530
534
|
(`title`, in the medium weight, and `details`, the lines under it in the muted colour) and a right column with the
|
|
531
|
-
row's state on top (`status`, badges that wrap right-aligned) and its controls under it (`actions`).
|
|
535
|
+
row's state on top (`status`, badges that wrap right-aligned) and its controls under it (`actions`). Both sides align
|
|
536
|
+
to the top: the state stands on the title's line however many detail lines the identity has. With `href` the
|
|
532
537
|
title is a link stretched over the whole row, so the row is one box lit on hover with one focus ring, and a muted arrow
|
|
533
|
-
sits beside the column; the arrow and the column are one group, so the arrow never wraps onto a
|
|
538
|
+
sits beside the column on the title's line; the arrow and the column are one group, so the arrow never wraps onto a
|
|
539
|
+
line of its own. The
|
|
534
540
|
column stays above the link: its controls are their own targets, and a click on the gap between them or on the arrow
|
|
535
541
|
still opens the row. Pass `linkComponent` for a router's link (it takes `href`, `className` and `children`). On a
|
|
536
542
|
phone (below `md`) the column wraps under the identity, right-aligned, and every control is at least the touch target
|
package/dist/index.d.ts
CHANGED
|
@@ -47,7 +47,7 @@ export { Code, CodeBlock, type CodeBlockProps } from "./notion/Code.js";
|
|
|
47
47
|
export { CopyButton, type CopyButtonProps } from "./notion/CopyButton.js";
|
|
48
48
|
export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/DetailTable.js";
|
|
49
49
|
export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProps } from "./notion/FilterChip.js";
|
|
50
|
-
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
50
|
+
export { FoldRow, type FoldRowAlign, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
51
51
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
52
52
|
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
53
53
|
export { LIST_CLASSES, List, ListGroup, ListGroupHeading, ListItem, ListEntry, ListRow, type ListGroupHeadingProps, type ListGroupProps, type ListItemProps, type ListProps, type ListEntryLinkComponent, type ListEntryProps, type ListRowProps, type ListSurface, } from "./notion/List.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":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AE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
|
package/dist/notion/FoldRow.d.ts
CHANGED
|
@@ -52,6 +52,13 @@ export type FoldRowProps = FoldRowSummaryProps & FoldRowDetailsProps & {
|
|
|
52
52
|
readonly actions?: ReactNode;
|
|
53
53
|
/** The item's status, drawn in the same column above the actions (with no actions, the column holds only it). */
|
|
54
54
|
readonly status?: ReactNode;
|
|
55
|
+
/**
|
|
56
|
+
* How the bar lines up with a summary of several lines. `center` (default) centres the chevron and the right
|
|
57
|
+
* column vertically; `start` puts the chevron on the summary's first line (one line of `ui` text) and the right
|
|
58
|
+
* column at the top, the status on the first line and the actions under it.
|
|
59
|
+
*/
|
|
60
|
+
readonly align?: FoldRowAlign;
|
|
55
61
|
};
|
|
62
|
+
export type FoldRowAlign = "center" | "start";
|
|
56
63
|
export declare function FoldRow(props: FoldRowProps): import("react").JSX.Element;
|
|
57
64
|
//# 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;AAKvC,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;IAC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,kGAAkG;IAClG,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,OAAO,CAAC;IACpC,gDAAgD;IAChD,QAAQ,CAAC,QAAQ,CAAC,EAAE,SAAS,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,eAAe,CAAC,EAAE,OAAO,CAAC;IACnC;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;IAC7B,iHAAiH;IACjH,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B;;;;OAIG;IACH,QAAQ,CAAC,KAAK,CAAC,EAAE,YAAY,CAAC;CAC/B,CAAC;AAEJ,MAAM,MAAM,YAAY,GAAG,QAAQ,GAAG,OAAO,CAAC;AA+E9C,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAqD1C"}
|
package/dist/notion/FoldRow.js
CHANGED
|
@@ -5,25 +5,31 @@ import { Badge } from "../ui/badge.js";
|
|
|
5
5
|
import { DetailTable } from "./DetailTable.js";
|
|
6
6
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
7
7
|
import { TONE_COLORS } from "./tones.js";
|
|
8
|
+
const ITEMS_CLASS = { center: "items-center", start: "items-start" };
|
|
8
9
|
// The bar and its opened content share one 8 px horizontal inset, so the details start under the chevron; the inset
|
|
9
10
|
// variant starts under the title instead (8 px inset, 16 px chevron, 8 px gap).
|
|
10
11
|
const CONTENT_LAYOUT = "flex-col gap-2 px-2 py-3";
|
|
11
12
|
const INSET_CONTENT_LAYOUT = "flex-col gap-2 py-2 pr-2 pl-8";
|
|
12
|
-
function FoldRowFixedSummary({ title, facts = [], badges, }) {
|
|
13
|
-
return (_jsxs(_Fragment, { children: [_jsxs("span", { "data-slot": "fold-row-heading", className: "flex min-w-0
|
|
13
|
+
function FoldRowFixedSummary({ title, facts = [], badges, align, }) {
|
|
14
|
+
return (_jsxs(_Fragment, { children: [_jsxs("span", { "data-slot": "fold-row-heading", className: cn("flex min-w-0", ITEMS_CLASS[align], "gap-2"), children: [_jsx(FoldRowChevron, { align: align }), _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) => {
|
|
14
15
|
const tone = badge.tone ?? "default";
|
|
15
16
|
return (_jsx(Badge, { variant: "tag", color: TONE_COLORS[tone] ?? "default", "data-badge": badge.key, "data-tone": tone, children: badge.text }, badge.key));
|
|
16
17
|
}) }))] }));
|
|
17
18
|
}
|
|
18
|
-
function FoldRowChevron() {
|
|
19
|
-
|
|
19
|
+
function FoldRowChevron({ align }) {
|
|
20
|
+
const chevron = (_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" }));
|
|
21
|
+
if (align === "center") {
|
|
22
|
+
return chevron;
|
|
23
|
+
}
|
|
24
|
+
// A box one line of `ui` text high, so the chevron sits in the middle of the summary's first line.
|
|
25
|
+
return (_jsx("span", { "data-slot": "fold-row-chevron", className: "flex h-lh shrink-0 items-center text-ui", children: chevron }));
|
|
20
26
|
}
|
|
21
27
|
function isDrawn(node) {
|
|
22
28
|
return node !== undefined && node !== null;
|
|
23
29
|
}
|
|
24
30
|
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
25
31
|
export function FoldRow(props) {
|
|
26
|
-
const { actions, status, isInset = false } = props;
|
|
32
|
+
const { actions, status, isInset = false, align = "center" } = props;
|
|
27
33
|
if (!isDrawn(actions) && !isDrawn(status)) {
|
|
28
34
|
return (_jsx(FoldRowDetails, { ...props, className: "border-b border-border", content: _jsx(FoldRowContent, { ...props, className: cn("flex", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "empty:hidden") }) }));
|
|
29
35
|
}
|
|
@@ -31,14 +37,14 @@ export function FoldRow(props) {
|
|
|
31
37
|
// row. To make the column exactly as high as the summary, the `<details>` holds only its summary and shares a grid
|
|
32
38
|
// row with the column (grid items stretch to their row); the opened content is the next row, shown while the
|
|
33
39
|
// details is open (`peer-open`). The details and the column carry the bar's light together, so they read as one box.
|
|
34
|
-
return (_jsxs("div", { "data-slot": "fold-row-with-actions", className: "group/fold-row-with-actions grid grid-cols-1 border-b border-border md:grid-cols-[minmax(0,1fr)_auto]", children: [_jsx(FoldRowDetails, { ...props, className: "peer/fold-row min-w-0 rounded-md transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent open:bg-accent max-md:rounded-b-none md:rounded-r-none", isLitByRow: true }), _jsxs("div", { "data-slot": "fold-row-actions", className: "flex flex-wrap items-center gap-2 rounded-b-md pr-2 pb-1 pl-8 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent md:flex-col md:flex-nowrap md:items-end md:justify-center md:gap-1 md:rounded-b-none md:rounded-r-md md:py-1 md:pl-0", children: [isDrawn(status) ? (_jsx("div", { "data-slot": "fold-row-status", className: "flex items-center", children: status })) : null, isDrawn(actions) ? (_jsx("div", { "data-slot": "fold-row-action-list", className: "flex items-center gap-1 max-md:*:min-h-touch-target max-md:*:min-w-touch-target", children: actions })) : null] }), _jsx(FoldRowContent, { ...props, className: cn("col-span-full hidden", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "peer-open/fold-row:not-empty:flex") })] }));
|
|
40
|
+
return (_jsxs("div", { "data-slot": "fold-row-with-actions", className: "group/fold-row-with-actions grid grid-cols-1 border-b border-border md:grid-cols-[minmax(0,1fr)_auto]", children: [_jsx(FoldRowDetails, { ...props, className: "peer/fold-row min-w-0 rounded-md transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent open:bg-accent max-md:rounded-b-none md:rounded-r-none", isLitByRow: true }), _jsxs("div", { "data-slot": "fold-row-actions", className: cn("flex flex-wrap items-center gap-2 rounded-b-md pr-2 pb-1 pl-8 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent md:flex-col md:flex-nowrap md:items-end", align === "start" ? "md:justify-start" : "md:justify-center", "md:gap-1 md:rounded-b-none md:rounded-r-md md:py-1 md:pl-0"), children: [isDrawn(status) ? (_jsx("div", { "data-slot": "fold-row-status", className: "flex items-center", children: status })) : null, isDrawn(actions) ? (_jsx("div", { "data-slot": "fold-row-action-list", className: "flex items-center gap-1 max-md:*:min-h-touch-target max-md:*:min-w-touch-target", children: actions })) : null] }), _jsx(FoldRowContent, { ...props, className: cn("col-span-full hidden", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "peer-open/fold-row:not-empty:flex") })] }));
|
|
35
41
|
}
|
|
36
42
|
function FoldRowContent(props) {
|
|
37
43
|
const { isInset = false, children, className } = props;
|
|
38
44
|
return (_jsxs("div", { "data-slot": "fold-row-content", "data-inset": isInset, className: className, children: [props.details === undefined ? null : _jsx(DetailTable, { label: props.detailsLabel, rows: props.details }), children] }));
|
|
39
45
|
}
|
|
40
46
|
function FoldRowDetails(props) {
|
|
41
|
-
const { isOpenInitially = false, size = "default", className, isLitByRow = false, content } = props;
|
|
42
|
-
return (_jsxs("details", { "data-slot": "fold-row", open: isOpenInitially || undefined, className: cn("group/fold-row", className), children: [_jsx("summary", { "data-slot": "fold-row-summary", className: cn("flex cursor-pointer list-none flex-wrap
|
|
47
|
+
const { isOpenInitially = false, size = "default", align = "center", className, isLitByRow = false, content } = props;
|
|
48
|
+
return (_jsxs("details", { "data-slot": "fold-row", open: isOpenInitially || undefined, className: cn("group/fold-row", className), children: [_jsx("summary", { "data-slot": "fold-row-summary", className: cn("flex cursor-pointer list-none flex-wrap", ITEMS_CLASS[align], "gap-x-2 gap-y-1 rounded-md px-2 py-1", !isLitByRow && "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", size === "touch" ? "min-h-touch-target" : "min-h-row-height"), children: props.summary === undefined ? (_jsx(FoldRowFixedSummary, { title: props.title, facts: props.facts, badges: props.badges ?? [], align: align })) : (_jsxs(_Fragment, { children: [_jsx(FoldRowChevron, { align: align }), _jsx("span", { "data-slot": "fold-row-summary-slot", className: cn("flex min-w-0 flex-1 flex-wrap", ITEMS_CLASS[align], "gap-x-2 gap-y-1"), children: props.summary })] })) }), content] }));
|
|
43
49
|
}
|
|
44
50
|
//# 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,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,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,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,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;AAuEpD,MAAM,WAAW,GAAiC,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE,CAAC;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CAAsC,EACtC,CAAC,UAAU,IAAI,8EAA8E,EAC7F,4GAA4G,EAC5G,IAAI,KAAK,OAAO,CAAC,CAAC,CAAC,oBAAoB,CAAC,CAAC,CAAC,kBAAkB,CAC7D,YAEA,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,EAAE,KAAK,EAAE,KAAK,GAAI,CAC1G,CAAC,CAAC,CAAC,CACF,8BACE,KAAC,cAAc,IAAC,KAAK,EAAE,KAAK,GAAI,EAChC,4BACY,uBAAuB,EACjC,SAAS,EAAE,EAAE,CAAC,+BAA+B,EAAE,WAAW,CAAC,KAAK,CAAC,EAAE,iBAAiB,CAAC,YAEpF,KAAK,CAAC,OAAO,GACT,IACN,CACJ,GACO,EACT,OAAO,IACA,CACX,CAAC;AACJ,CAAC"}
|
package/dist/notion/List.d.ts
CHANGED
|
@@ -80,9 +80,10 @@ export type ListEntryProps = Omit<ComponentProps<"div">, "title" | "children"> &
|
|
|
80
80
|
};
|
|
81
81
|
/**
|
|
82
82
|
* A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
|
|
83
|
-
* top of the right column and its controls under it.
|
|
84
|
-
*
|
|
85
|
-
*
|
|
83
|
+
* top of the right column and its controls under it. Both sides align to the top, so the state stands on the title's
|
|
84
|
+
* line however many detail lines the identity has. With `href` the title is a link stretched over the whole row, so
|
|
85
|
+
* the row is one box lit on hover, and an arrow sits beside the column on the title's line (never on a line of its
|
|
86
|
+
* own); the column stays above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
|
|
86
87
|
*
|
|
87
88
|
* Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
|
|
88
89
|
* action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
|
|
@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BAAqB,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC1D,2GAA2G;IAC3G,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAC/B,4FAA4F;IAC5F,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,4GAA4G;AAC5G,wBAAgB,gBAAgB,CAAC,EAAE,OAAgB,EAAE,OAAe,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,qBAAqB,+BAUjH"}
|
package/dist/notion/List.js
CHANGED
|
@@ -47,9 +47,10 @@ function isDrawn(node) {
|
|
|
47
47
|
}
|
|
48
48
|
/**
|
|
49
49
|
* A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
|
|
50
|
-
* top of the right column and its controls under it.
|
|
51
|
-
*
|
|
52
|
-
*
|
|
50
|
+
* top of the right column and its controls under it. Both sides align to the top, so the state stands on the title's
|
|
51
|
+
* line however many detail lines the identity has. With `href` the title is a link stretched over the whole row, so
|
|
52
|
+
* the row is one box lit on hover, and an arrow sits beside the column on the title's line (never on a line of its
|
|
53
|
+
* own); the column stays above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
|
|
53
54
|
*
|
|
54
55
|
* Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
|
|
55
56
|
* action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
|
|
@@ -64,7 +65,7 @@ export function ListEntry({ title, details, status, actions, menu, href, linkCom
|
|
|
64
65
|
const hasColumn = hasStatus || hasControls;
|
|
65
66
|
const hasLink = href !== undefined;
|
|
66
67
|
const titleClasses = "min-w-0 text-ui-medium text-foreground";
|
|
67
|
-
return (_jsxs("div", { "data-slot": "list-entry", className: cn("relative flex w-full min-w-0 flex-wrap items-
|
|
68
|
+
return (_jsxs("div", { "data-slot": "list-entry", className: cn("relative flex w-full min-w-0 flex-wrap items-start gap-x-3 gap-y-1 rounded-md px-2 py-(--list-row-y) text-ui transition-colors duration-100 hover:bg-accent", "has-[[data-slot=list-entry-title]:focus-visible]:ring-2 has-[[data-slot=list-entry-title]:focus-visible]:ring-ring", className), ...props, children: [_jsxs("div", { "data-slot": "list-entry-identity", className: "flex min-w-0 flex-1 basis-48 flex-col gap-0.5 max-md:basis-full", children: [hasLink ? (_jsx(Link, { "data-slot": "list-entry-title", href: href, className: cn(titleClasses, "outline-none after:absolute after:inset-0 after:rounded-md after:content-['']"), children: title })) : (_jsx("span", { "data-slot": "list-entry-title", className: titleClasses, children: title })), isDrawn(details) ? (_jsx("div", { "data-slot": "list-entry-details", className: "flex min-w-0 flex-col text-ui text-muted-foreground", children: details })) : null] }), hasColumn || hasLink ? (_jsxs("div", { "data-slot": "list-entry-side", className: "group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-start gap-2 has-[[data-row-wide]]:ml-0 has-[[data-row-wide]]:basis-full", children: [hasColumn ? (_jsxs("div", { "data-slot": "list-entry-column", className: "flex min-w-0 flex-col items-end gap-1 has-[[data-row-wide]]:flex-1 has-[[data-row-wide]]:items-stretch", children: [hasStatus ? (_jsx("div", { "data-slot": "list-entry-status", className: "pointer-events-auto flex min-w-0 flex-wrap items-center justify-end gap-1 group-has-[[data-row-wide]]/list-entry-side:justify-start", children: status })) : null, hasControls ? (_jsxs("div", { "data-slot": "list-entry-actions", className: cn("pointer-events-auto flex min-w-0 items-center justify-end gap-1 has-[[data-row-wide]]:flex-col has-[[data-row-wide]]:items-stretch has-[[data-row-wide]]:justify-start max-md:*:not-data-[slot=switch]:min-h-touch-target max-md:*:not-data-[slot=switch]:min-w-touch-target max-md:*:data-[slot=switch]:mx-0", hasMenu ? "flex-nowrap" : "flex-wrap"), children: [actions, hasMenu ? (_jsx("div", { "data-slot": "list-entry-menu", className: "flex shrink-0 items-center justify-center max-md:*:min-h-touch-target max-md:*:min-w-touch-target", children: menu })) : null] })) : null] })) : null, hasLink ? (_jsx("span", { "data-slot": "list-entry-arrow", "aria-hidden": "true", className: "flex h-5 shrink-0 items-center text-muted-foreground", children: _jsx(ChevronRight, { strokeWidth: ICON_STROKE_WIDTH, className: "size-4" }) })) : null] })) : null] }));
|
|
68
69
|
}
|
|
69
70
|
/**
|
|
70
71
|
* A run of rows under a `ListGroupHeading` (a country's days, a month's entries), placed straight in the scroll
|
package/dist/notion/List.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/notion/List.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,oEAAoE;IAC1E,UAAU,EAAE,wEAAwE;IACpF,IAAI,EAAE,oBAAoB;IAC1B,GAAG,EAAE,uPAAuP;IAC5P,KAAK,EAAE,4CAA4C;IACnD,YAAY,EACV,kIAAkI;IACpI,kBAAkB,EAChB,qIAAqI;CAC/H,CAAC;AAaX;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAa;IACpG,OAAO,CACL,KAAC,OAAO,iBACI,MAAM,kBACF,OAAO,kBACP,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,KACxF,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAOD,+EAA+E;AAC/E,MAAM,UAAU,QAAQ,CAAC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B,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAyB;IAChH,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACzC,OAAO,CACL,KAAC,IAAI,iBACO,oBAAoB,kBAChB,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,kBAAkB,CAAC,CAAC,CAAC,YAAY,CAAC,YAAY,EAAE,SAAS,CAAC,KACxG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.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
|
@@ -63,7 +63,7 @@ export { Code, CodeBlock, type CodeBlockProps } from "./notion/Code.js";
|
|
|
63
63
|
export { CopyButton, type CopyButtonProps } from "./notion/CopyButton.js";
|
|
64
64
|
export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/DetailTable.js";
|
|
65
65
|
export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProps } from "./notion/FilterChip.js";
|
|
66
|
-
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
66
|
+
export { FoldRow, type FoldRowAlign, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
67
67
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
68
68
|
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
69
69
|
export {
|
package/src/notion/FoldRow.tsx
CHANGED
|
@@ -67,8 +67,18 @@ export type FoldRowProps = FoldRowSummaryProps &
|
|
|
67
67
|
readonly actions?: ReactNode;
|
|
68
68
|
/** The item's status, drawn in the same column above the actions (with no actions, the column holds only it). */
|
|
69
69
|
readonly status?: ReactNode;
|
|
70
|
+
/**
|
|
71
|
+
* How the bar lines up with a summary of several lines. `center` (default) centres the chevron and the right
|
|
72
|
+
* column vertically; `start` puts the chevron on the summary's first line (one line of `ui` text) and the right
|
|
73
|
+
* column at the top, the status on the first line and the actions under it.
|
|
74
|
+
*/
|
|
75
|
+
readonly align?: FoldRowAlign;
|
|
70
76
|
};
|
|
71
77
|
|
|
78
|
+
export type FoldRowAlign = "center" | "start";
|
|
79
|
+
|
|
80
|
+
const ITEMS_CLASS: Record<FoldRowAlign, string> = { center: "items-center", start: "items-start" };
|
|
81
|
+
|
|
72
82
|
// The bar and its opened content share one 8 px horizontal inset, so the details start under the chevron; the inset
|
|
73
83
|
// variant starts under the title instead (8 px inset, 16 px chevron, 8 px gap).
|
|
74
84
|
const CONTENT_LAYOUT = "flex-col gap-2 px-2 py-3";
|
|
@@ -78,16 +88,18 @@ function FoldRowFixedSummary({
|
|
|
78
88
|
title,
|
|
79
89
|
facts = [],
|
|
80
90
|
badges,
|
|
91
|
+
align,
|
|
81
92
|
}: {
|
|
82
93
|
readonly title: ReactNode;
|
|
83
94
|
readonly facts?: readonly ReactNode[];
|
|
84
95
|
readonly badges: readonly FoldRowBadge[];
|
|
96
|
+
readonly align: FoldRowAlign;
|
|
85
97
|
}) {
|
|
86
98
|
return (
|
|
87
99
|
<>
|
|
88
100
|
{/* The chevron and the title wrap as one: a long title folds onto lines beside its chevron. */}
|
|
89
|
-
<span data-slot="fold-row-heading" className="flex min-w-0
|
|
90
|
-
<FoldRowChevron />
|
|
101
|
+
<span data-slot="fold-row-heading" className={cn("flex min-w-0", ITEMS_CLASS[align], "gap-2")}>
|
|
102
|
+
<FoldRowChevron align={align} />
|
|
91
103
|
<span className="min-w-0 text-ui-medium">{title}</span>
|
|
92
104
|
</span>
|
|
93
105
|
{facts.map((fact, index) => (
|
|
@@ -118,14 +130,23 @@ function FoldRowFixedSummary({
|
|
|
118
130
|
);
|
|
119
131
|
}
|
|
120
132
|
|
|
121
|
-
function FoldRowChevron() {
|
|
122
|
-
|
|
133
|
+
function FoldRowChevron({ align }: { readonly align: FoldRowAlign }) {
|
|
134
|
+
const chevron = (
|
|
123
135
|
<ChevronRight
|
|
124
136
|
aria-hidden="true"
|
|
125
137
|
strokeWidth={ICON_STROKE_WIDTH}
|
|
126
138
|
className="size-4 shrink-0 text-muted-foreground transition-transform duration-150 group-open/fold-row:rotate-90"
|
|
127
139
|
/>
|
|
128
140
|
);
|
|
141
|
+
if (align === "center") {
|
|
142
|
+
return chevron;
|
|
143
|
+
}
|
|
144
|
+
// A box one line of `ui` text high, so the chevron sits in the middle of the summary's first line.
|
|
145
|
+
return (
|
|
146
|
+
<span data-slot="fold-row-chevron" className="flex h-lh shrink-0 items-center text-ui">
|
|
147
|
+
{chevron}
|
|
148
|
+
</span>
|
|
149
|
+
);
|
|
129
150
|
}
|
|
130
151
|
|
|
131
152
|
function isDrawn(node: ReactNode): boolean {
|
|
@@ -134,7 +155,7 @@ function isDrawn(node: ReactNode): boolean {
|
|
|
134
155
|
|
|
135
156
|
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
136
157
|
export function FoldRow(props: FoldRowProps) {
|
|
137
|
-
const { actions, status, isInset = false } = props;
|
|
158
|
+
const { actions, status, isInset = false, align = "center" } = props;
|
|
138
159
|
if (!isDrawn(actions) && !isDrawn(status)) {
|
|
139
160
|
return (
|
|
140
161
|
<FoldRowDetails
|
|
@@ -160,7 +181,11 @@ export function FoldRow(props: FoldRowProps) {
|
|
|
160
181
|
/>
|
|
161
182
|
<div
|
|
162
183
|
data-slot="fold-row-actions"
|
|
163
|
-
className=
|
|
184
|
+
className={cn(
|
|
185
|
+
"flex flex-wrap items-center gap-2 rounded-b-md pr-2 pb-1 pl-8 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent md:flex-col md:flex-nowrap md:items-end",
|
|
186
|
+
align === "start" ? "md:justify-start" : "md:justify-center",
|
|
187
|
+
"md:gap-1 md:rounded-b-none md:rounded-r-md md:py-1 md:pl-0",
|
|
188
|
+
)}
|
|
164
189
|
>
|
|
165
190
|
{isDrawn(status) ? (
|
|
166
191
|
<div data-slot="fold-row-status" className="flex items-center">
|
|
@@ -203,26 +228,28 @@ function FoldRowDetails(
|
|
|
203
228
|
readonly content?: ReactNode;
|
|
204
229
|
},
|
|
205
230
|
) {
|
|
206
|
-
const { isOpenInitially = false, size = "default", className, isLitByRow = false, content } = props;
|
|
231
|
+
const { isOpenInitially = false, size = "default", align = "center", className, isLitByRow = false, content } = props;
|
|
207
232
|
return (
|
|
208
233
|
<details data-slot="fold-row" open={isOpenInitially || undefined} className={cn("group/fold-row", className)}>
|
|
209
234
|
<summary
|
|
210
235
|
data-slot="fold-row-summary"
|
|
211
236
|
className={cn(
|
|
212
|
-
"flex cursor-pointer list-none flex-wrap
|
|
237
|
+
"flex cursor-pointer list-none flex-wrap",
|
|
238
|
+
ITEMS_CLASS[align],
|
|
239
|
+
"gap-x-2 gap-y-1 rounded-md px-2 py-1",
|
|
213
240
|
!isLitByRow && "transition-colors duration-120 group-open/fold-row:bg-accent hover:bg-accent",
|
|
214
241
|
"focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden",
|
|
215
242
|
size === "touch" ? "min-h-touch-target" : "min-h-row-height",
|
|
216
243
|
)}
|
|
217
244
|
>
|
|
218
245
|
{props.summary === undefined ? (
|
|
219
|
-
<FoldRowFixedSummary title={props.title} facts={props.facts} badges={props.badges ?? []} />
|
|
246
|
+
<FoldRowFixedSummary title={props.title} facts={props.facts} badges={props.badges ?? []} align={align} />
|
|
220
247
|
) : (
|
|
221
248
|
<>
|
|
222
|
-
<FoldRowChevron />
|
|
249
|
+
<FoldRowChevron align={align} />
|
|
223
250
|
<span
|
|
224
251
|
data-slot="fold-row-summary-slot"
|
|
225
|
-
className="flex min-w-0 flex-1 flex-wrap
|
|
252
|
+
className={cn("flex min-w-0 flex-1 flex-wrap", ITEMS_CLASS[align], "gap-x-2 gap-y-1")}
|
|
226
253
|
>
|
|
227
254
|
{props.summary}
|
|
228
255
|
</span>
|
package/src/notion/List.tsx
CHANGED
|
@@ -115,9 +115,10 @@ function isDrawn(node: ReactNode): boolean {
|
|
|
115
115
|
|
|
116
116
|
/**
|
|
117
117
|
* A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
|
|
118
|
-
* top of the right column and its controls under it.
|
|
119
|
-
*
|
|
120
|
-
*
|
|
118
|
+
* top of the right column and its controls under it. Both sides align to the top, so the state stands on the title's
|
|
119
|
+
* line however many detail lines the identity has. With `href` the title is a link stretched over the whole row, so
|
|
120
|
+
* the row is one box lit on hover, and an arrow sits beside the column on the title's line (never on a line of its
|
|
121
|
+
* own); the column stays above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
|
|
121
122
|
*
|
|
122
123
|
* Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
|
|
123
124
|
* action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
|
|
@@ -146,7 +147,7 @@ export function ListEntry({
|
|
|
146
147
|
<div
|
|
147
148
|
data-slot="list-entry"
|
|
148
149
|
className={cn(
|
|
149
|
-
"relative flex w-full min-w-0 flex-wrap items-
|
|
150
|
+
"relative flex w-full min-w-0 flex-wrap items-start gap-x-3 gap-y-1 rounded-md px-2 py-(--list-row-y) text-ui transition-colors duration-100 hover:bg-accent",
|
|
150
151
|
"has-[[data-slot=list-entry-title]:focus-visible]:ring-2 has-[[data-slot=list-entry-title]:focus-visible]:ring-ring",
|
|
151
152
|
className,
|
|
152
153
|
)}
|
|
@@ -175,7 +176,7 @@ export function ListEntry({
|
|
|
175
176
|
{hasColumn || hasLink ? (
|
|
176
177
|
<div
|
|
177
178
|
data-slot="list-entry-side"
|
|
178
|
-
className="group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-
|
|
179
|
+
className="group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-start gap-2 has-[[data-row-wide]]:ml-0 has-[[data-row-wide]]:basis-full"
|
|
179
180
|
>
|
|
180
181
|
{hasColumn ? (
|
|
181
182
|
<div
|
|
@@ -212,7 +213,7 @@ export function ListEntry({
|
|
|
212
213
|
</div>
|
|
213
214
|
) : null}
|
|
214
215
|
{hasLink ? (
|
|
215
|
-
<span data-slot="list-entry-arrow" aria-hidden="true" className="flex shrink-0 text-muted-foreground">
|
|
216
|
+
<span data-slot="list-entry-arrow" aria-hidden="true" className="flex h-5 shrink-0 items-center text-muted-foreground">
|
|
216
217
|
<ChevronRight strokeWidth={ICON_STROKE_WIDTH} className="size-4" />
|
|
217
218
|
</span>
|
|
218
219
|
) : null}
|