@softure-ai/theme-notion 0.30.1 → 0.32.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -4,6 +4,34 @@ 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.32.0
8
+
9
+ - `FoldRow` (#1463): the bar and its opened content share one 8 px horizontal inset. The summary is padded `px-2`
10
+ (was `px-1`), the opened content `px-2 py-3` (was `p-3`), so the chevron and the details table start at the same x;
11
+ the actions keep the same inset on the bar's right (`pr-2`, was `pr-1`). `isInset` content starts under the title
12
+ at the new inset (`py-2 pr-2 pl-8`, was `py-2 pr-1 pl-6`).
13
+ - Migration: an app that aligned the row itself
14
+ (`[&_[data-slot=fold-row-summary]]:px-2 [&_[data-slot=fold-row-content]]:px-2` on the row) drops the override.
15
+ - `FoldRow` (#1471): the right column of a row with `actions` spans the summary's full height and lights with it as one
16
+ box, open or hovered, however many lines the summary wraps to (it used to stop under the control). A new `status`
17
+ prop draws a status above the actions in that column (`data-slot="fold-row-status"`; a status alone draws the
18
+ column too); the actions sit in `data-slot="fold-row-action-list"`. Below `md` the column falls under the summary
19
+ and each action is at least 44 px. With a column, the row is a grid and the opened content is the details' sibling
20
+ under the whole bar (shown while the row is open), so find-in-page no longer opens a closed row with actions.
21
+ - Migration: an app that wrapped `FoldRow` to put a status above its action and light both as one box passes
22
+ `status` and `actions` instead and drops the wrapper. Selectors that looked for `fold-row-content` inside the
23
+ `<details>` of a row with actions look in `fold-row-with-actions` instead.
24
+
25
+ ## 0.31.0
26
+
27
+ - `PageLayout`: a screen inside the app shell, its `PageHeader` (the `header` prop takes the same props) and then its
28
+ sections in one grid with the theme's 16 px spacing (`gap-4`, `min-w-0` so a wide table scrolls inside its card).
29
+ `width="full"` (default) takes the content area's width, `width="content"` caps a reading page at 48 rem
30
+ (`max-w-3xl`) and centres it. `data-slot="page-layout"`, `data-width`.
31
+ - Migration: an app with its own page wrapper (`<div className="grid w-full min-w-0 gap-4"><PageHeader {...header} />
32
+ {children}</div>`) replaces it with `<PageLayout header={header}>{children}</PageLayout>`; a test that every page
33
+ uses the wrapper can look for `data-slot="page-layout"` instead.
34
+
7
35
  ## 0.30.1
8
36
 
9
37
  - A modal's overlay leaves together with its content: `Dialog` and `AlertDialog` overlays fade out in 200 ms like their
package/README.md CHANGED
@@ -135,7 +135,8 @@ All 37 shadcn/ui components of the design system, exported from the package root
135
135
  avatar, badge, breadcrumb, button, button-group, card, checkbox, collapsible, command, dialog, dropdown-menu, empty,
136
136
  field, input, input-group, item, kbd, label, popover, progress, radio-group, scroll-area, select, separator, sheet,
137
137
  sidebar, skeleton, sonner (`Toaster`), spinner, switch, table, tabs, textarea, tooltip. Compositions: `Status` (badge, icon,
138
- word), `PageHeader` (breadcrumb, icon box, title, description, actions), `PropertyList` (fields of one record),
138
+ word), `PageHeader` (breadcrumb, icon box, title, description, actions), `PageLayout` (a screen in the app shell: its
139
+ `PageHeader`, then its sections, at one width and spacing, below), `PropertyList` (fields of one record),
139
140
  `DetailTable` (an item's details as a label and value table, laid out fixed at its container's width, each label
140
141
  above its value where the table is narrower than 28rem), `FoldRow` (a list row folding open to a `DetailTable`
141
142
  and more, a native `<details>`), `PageFrame` (a page outside the app shell, such as a package's sign-in page),
@@ -193,17 +194,38 @@ icon. Each sets its height with a plain class, so one breakpoint class brings th
193
194
  </TabsList>
194
195
  ```
195
196
 
197
+ **`PageLayout`.** A screen inside the app shell: its `PageHeader` (the `header` prop takes the same props), then its
198
+ sections, usually titled `Card`s, in one grid with the theme's 16 px spacing (`gap-4`). Every page that uses it gets
199
+ the same width and the same gap under the header, so an app needs no wrapper of its own. `width="full"` (the default)
200
+ takes the content area's width; `width="content"` caps a reading page at 48 rem (`max-w-3xl`) and centres it. The grid
201
+ is `min-w-0`, so a wide table scrolls inside its card instead of widening the page. `data-slot="page-layout"` and
202
+ `data-width` mark the root.
203
+
204
+ ```tsx
205
+ <PageLayout header={{ title: "Projects", crumbs: [{ label: "Workspace", href: "/" }, { label: "Projects" }] }}>
206
+ <Card>
207
+ <CardHeader>
208
+ <CardTitle>Active</CardTitle>
209
+ </CardHeader>
210
+ <CardContent>…</CardContent>
211
+ </Card>
212
+ </PageLayout>
213
+ ```
214
+
196
215
  **`FoldRow`.** An item as one list row in a native `<details>`: a chevron, the title, short facts and badges on the
197
- right; opened, it shows a `DetailTable` and its `children`. The opened content is padded 12 px on all four sides
198
- (`p-3`), so a table sits centred under the row; `isInset` indents it under the title instead (24 px on the left) and
199
- sets `data-inset` on the content, like `StatsFold`. A row with a summary of its own (icons, a status) passes `summary`,
216
+ right; opened, it shows a `DetailTable` and its `children`. The bar and the opened content share one 8 px
217
+ horizontal inset (`px-2`; the content is padded 12 px top and bottom, `py-3`), so the table starts under the chevron;
218
+ `isInset` indents it under the title instead (32 px on the left) and sets `data-inset` on the content, like
219
+ `StatsFold`. A row with a summary of its own (icons, a status) passes `summary`,
200
220
  drawn after the chevron in place of `title`, `facts` and `badges`; `details` and `detailsLabel` are optional together,
201
221
  so the content can be several tables or a list. `size="touch"` makes the summary at least the `touch-target` height
202
- (44 px) instead of the row height, for a phone list. `actions` puts controls on the row's right (a delete button,
203
- a menu), beside the `<details>` rather than inside its `<summary>`, so clicking one never folds the row; they show
204
- whether the row is open or closed, centred on the summary's first line. They sit at the right end of the row's bar:
205
- the summary's background runs under them when the row is open or hovered, so the bar reads as one. The row's bottom
206
- border moves to the wrapper (`data-slot="fold-row-with-actions"`). `isOpenInitially` renders the row open (`<details open>`), for the row the
222
+ (44 px) instead of the row height, for a phone list. `actions` puts controls in a right column of the row's bar (a
223
+ delete button, a menu), beside the `<details>` rather than inside its `<summary>`, so clicking one never folds the row;
224
+ `status` puts the item's status above them in the same column. The column spans the summary's full height however
225
+ many lines it wraps to, and the summary and the column light as one box when the row is open or hovered. Below `md`
226
+ the column falls under the summary and each action is at least 44 px. With a column the row is a grid
227
+ (`data-slot="fold-row-with-actions"`, which carries the bottom border) and the opened content sits under the whole bar
228
+ as the details' sibling, shown while it is open. `isOpenInitially` renders the row open (`<details open>`), for the row the
207
229
  address points at; only the first render reads it, and the reader can still fold the row.
208
230
 
209
231
  ```tsx
@@ -211,7 +233,7 @@ address points at; only the first render reads it, and the reader can still fold
211
233
  <FoldRow summary={<><Receipt aria-hidden="true" className="size-4" /> Invoice 12/2026 <Badge>Paid</Badge></>}>
212
234
  <InvoiceLines />
213
235
  </FoldRow>
214
- <FoldRow title="clip.mp4" badges={[]} actions={<DeleteButton />} />
236
+ <FoldRow title="clip.mp4" badges={[]} status={<Status color="green">Paid</Status>} actions={<DeleteButton />} />
215
237
  ```
216
238
 
217
239
  **`FilterChip`.** The filters above a list or a table, drawn the way a Notion database view draws them: a 24 px pill
package/dist/index.d.ts CHANGED
@@ -56,6 +56,7 @@ export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
56
56
  export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
57
57
  export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
58
58
  export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
59
+ export { PageLayout, type PageLayoutProps, type PageLayoutWidth } from "./notion/PageLayout.js";
59
60
  export { PROSE_CLASSES, Prose, type ProseProps } from "./notion/Prose.js";
60
61
  export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
61
62
  export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAE,KAAK,cAAc,EAAE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,EAAE,KAAK,YAAY,EAAE,MAAM,2BAA2B,CAAC;AACpG,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,EACd,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACrB,KAAK,wBAAwB,EAC7B,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,mBAAmB,GACzB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAAE,KAAK,iBAAiB,EAAE,KAAK,SAAS,EAAE,MAAM,wBAAwB,CAAC;AACjG,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,EACV,KAAK,gBAAgB,EACrB,KAAK,cAAc,EACnB,KAAK,eAAe,EACpB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,sBAAsB,EAC3B,KAAK,WAAW,GACjB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,KAAK,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,KAAK,IAAI,EAAE,MAAM,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -58,6 +58,7 @@ export { MarkPopover } from "./notion/MarkPopover.js";
58
58
  export { MiniProgress } from "./notion/MiniProgress.js";
59
59
  export { PageFrame } from "./notion/PageFrame.js";
60
60
  export { PageHeader } from "./notion/PageHeader.js";
61
+ export { PageLayout } from "./notion/PageLayout.js";
61
62
  export { PROSE_CLASSES, Prose } from "./notion/Prose.js";
62
63
  export { PropertyList } from "./notion/PropertyList.js";
63
64
  export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,oGAAoG;AACpG,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AC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
@@ -32,7 +32,7 @@ export type FoldRowDetailsProps = {
32
32
  readonly details?: never;
33
33
  };
34
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. */
35
+ /** Indents the opened content to line up with the title after the chevron; by default it starts under the chevron. */
36
36
  readonly isInset?: boolean;
37
37
  /** `touch` makes the summary at least the touch target high (44 px) instead of the row height. */
38
38
  readonly size?: "default" | "touch";
@@ -44,11 +44,14 @@ export type FoldRowProps = FoldRowSummaryProps & FoldRowDetailsProps & {
44
44
  */
45
45
  readonly isOpenInitially?: boolean;
46
46
  /**
47
- * Controls at the right end of the row's bar (a delete button, a menu). They sit beside the `<summary>`, not in
48
- * it, so clicking them never folds the row, but they share its background: the bar runs under them when the row
49
- * is open or hovered. Shown whether the row is open or closed, centred on the summary's first line.
47
+ * Controls in the right column of the row's bar (a delete button, a menu). The column sits beside the `<summary>`,
48
+ * not in it, so clicking a control never folds the row; it spans the summary's full height and lights with it when
49
+ * the row is open or hovered, so the bar reads as one box. On a phone (below `md`) the column falls under the
50
+ * summary and each control is at least the touch target (44 px).
50
51
  */
51
52
  readonly actions?: ReactNode;
53
+ /** The item's status, drawn in the same column above the actions (with no actions, the column holds only it). */
54
+ readonly status?: ReactNode;
52
55
  };
53
56
  export declare function FoldRow(props: FoldRowProps): import("react").JSX.Element;
54
57
  //# 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,E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AC3B;IACE,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;CACxC,GACD;IACE,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAC5C,mBAAmB,GAAG;IACpB,sHAAsH;IACtH,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,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;CAC7B,CAAC;AAkEJ,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAiD1C"}
@@ -5,8 +5,10 @@ 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 CONTENT_CLASS = "flex flex-col gap-2 p-3 empty:hidden";
9
- const INSET_CONTENT_CLASS = "flex flex-col gap-2 py-2 pr-1 pl-6 empty:hidden";
8
+ // The bar and its opened content share one 8 px horizontal inset, so the details start under the chevron; the inset
9
+ // variant starts under the title instead (8 px inset, 16 px chevron, 8 px gap).
10
+ const CONTENT_LAYOUT = "flex-col gap-2 px-2 py-3";
11
+ const INSET_CONTENT_LAYOUT = "flex-col gap-2 py-2 pr-2 pl-8";
10
12
  function FoldRowFixedSummary({ title, facts = [], badges, }) {
11
13
  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) => {
12
14
  const tone = badge.tone ?? "default";
@@ -16,21 +18,27 @@ function FoldRowFixedSummary({ title, facts = [], badges, }) {
16
18
  function FoldRowChevron() {
17
19
  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" }));
18
20
  }
21
+ function isDrawn(node) {
22
+ return node !== undefined && node !== null;
23
+ }
19
24
  // An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
20
25
  export function FoldRow(props) {
21
- const { actions, size = "default" } = props;
22
- if (actions === undefined || actions === null) {
23
- return _jsx(FoldRowDetails, { ...props, className: "border-b border-border" });
26
+ const { actions, status, isInset = false } = props;
27
+ if (!isDrawn(actions) && !isDrawn(status)) {
28
+ return (_jsx(FoldRowDetails, { ...props, className: "border-b border-border", content: _jsx(FoldRowContent, { ...props, className: cn("flex", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "empty:hidden") }) }));
24
29
  }
25
- // The actions sit beside the `<details>`, not in its `<summary>`: a control inside the summary would fold the row.
26
- // They carry the summary's background (the details is their peer: open; the wrapper is the hover group), so the
27
- // summary and the actions read as one bar with the controls at its right end.
28
- return (_jsxs("div", { "data-slot": "fold-row-with-actions", className: "group/fold-row-with-actions flex items-start border-b border-border", children: [_jsx(FoldRowDetails, { ...props, className: "peer/fold-row min-w-0 flex-1", hasActions: true }), _jsx("div", { "data-slot": "fold-row-actions", className: cn("flex shrink-0 items-center gap-1 rounded-r-md pr-1 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent", size === "touch" ? "min-h-touch-target" : "min-h-row-height"), children: actions })] }));
30
+ // The right column sits beside the `<details>`, not in its `<summary>`: a control inside the summary would fold the
31
+ // row. To make the column exactly as high as the summary, the `<details>` holds only its summary and shares a grid
32
+ // row with the column (grid items stretch to their row); the opened content is the next row, shown while the
33
+ // 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") })] }));
35
+ }
36
+ function FoldRowContent(props) {
37
+ const { isInset = false, children, className } = props;
38
+ 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] }));
29
39
  }
30
40
  function FoldRowDetails(props) {
31
- const { isInset = false, isOpenInitially = false, size = "default", children, className, hasActions = false } = props;
32
- 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-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", size === "touch" ? "min-h-touch-target" : "min-h-row-height",
33
- // With actions the bar continues under them: no rounding on the right, and hovering them lights it too.
34
- hasActions && "rounded-r-none group-hover/fold-row-with-actions:bg-accent"), 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] })] }));
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 items-center 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 ?? [] })) : (_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 })] })) }), content] }));
35
43
  }
36
44
  //# 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;AA4DpD,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,CAC5B,4BAAgB,iBAAiB,EAAC,SAAS,EAAC,qCAAqC,YAC9E,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE;oBAC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K,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,EACT,OAAO,IACA,CACX,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import type { ReactNode } from "react";
2
+ import { type PageHeaderProps } from "./PageHeader.js";
3
+ /** `full` takes the content area's width; `content` caps a reading page at the Notion reading width and centres it. */
4
+ export type PageLayoutWidth = "full" | "content";
5
+ export interface PageLayoutProps {
6
+ header: PageHeaderProps;
7
+ children?: ReactNode;
8
+ width?: PageLayoutWidth;
9
+ className?: string;
10
+ }
11
+ /**
12
+ * A screen inside the app shell: its `PageHeader`, then its sections, with one width and one spacing on every page.
13
+ * `min-w-0` keeps a wide table scrolling inside its card instead of widening the page.
14
+ */
15
+ export declare function PageLayout({ header, children, width, className }: PageLayoutProps): import("react").JSX.Element;
16
+ //# sourceMappingURL=PageLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageLayout.d.ts","sourceRoot":"","sources":["../../src/notion/PageLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAGvC,OAAO,EAAc,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAEnE,uHAAuH;AACvH,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,SAAS,CAAC;AAEjD,MAAM,WAAW,eAAe;IAE9B,MAAM,EAAE,eAAe,CAAC;IAExB,QAAQ,CAAC,EAAE,SAAS,CAAC;IACrB,KAAK,CAAC,EAAE,eAAe,CAAC;IACxB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAOD;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAc,EAAE,SAAS,EAAE,EAAE,eAAe,+BAO1F"}
@@ -0,0 +1,15 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { cn } from "../lib/utils.js";
3
+ import { PageHeader } from "./PageHeader.js";
4
+ const WIDTH_CLASSES = {
5
+ full: "",
6
+ content: "mx-auto max-w-3xl",
7
+ };
8
+ /**
9
+ * A screen inside the app shell: its `PageHeader`, then its sections, with one width and one spacing on every page.
10
+ * `min-w-0` keeps a wide table scrolling inside its card instead of widening the page.
11
+ */
12
+ export function PageLayout({ header, children, width = "full", className }) {
13
+ return (_jsxs("div", { "data-slot": "page-layout", "data-width": width, className: cn("grid w-full min-w-0 gap-4", WIDTH_CLASSES[width], className), children: [_jsx(PageHeader, { ...header }), children] }));
14
+ }
15
+ //# sourceMappingURL=PageLayout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PageLayout.js","sourceRoot":"","sources":["../../src/notion/PageLayout.tsx"],"names":[],"mappings":";AAEA,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,UAAU,EAAwB,MAAM,iBAAiB,CAAC;AAcnE,MAAM,aAAa,GAAoC;IACrD,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,mBAAmB;CAC7B,CAAC;AAEF;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,GAAG,MAAM,EAAE,SAAS,EAAmB;IACzF,OAAO,CACL,4BAAe,aAAa,gBAAa,KAAK,EAAE,SAAS,EAAE,EAAE,CAAC,2BAA2B,EAAE,aAAa,CAAC,KAAK,CAAC,EAAE,SAAS,CAAC,aACzH,KAAC,UAAU,OAAK,MAAM,GAAI,EACzB,QAAQ,IACL,CACP,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@softure-ai/theme-notion",
3
- "version": "0.30.1",
3
+ "version": "0.32.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
@@ -85,6 +85,7 @@ export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
85
85
  export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
86
86
  export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
87
87
  export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
88
+ export { PageLayout, type PageLayoutProps, type PageLayoutWidth } from "./notion/PageLayout.js";
88
89
  export { PROSE_CLASSES, Prose, type ProseProps } from "./notion/Prose.js";
89
90
  export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
90
91
  export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
@@ -47,7 +47,7 @@ export type FoldRowDetailsProps =
47
47
 
48
48
  export type FoldRowProps = FoldRowSummaryProps &
49
49
  FoldRowDetailsProps & {
50
- /** Indents the opened content to line up with the title after the chevron; by default it is padded equally. */
50
+ /** Indents the opened content to line up with the title after the chevron; by default it starts under the chevron. */
51
51
  readonly isInset?: boolean;
52
52
  /** `touch` makes the summary at least the touch target high (44 px) instead of the row height. */
53
53
  readonly size?: "default" | "touch";
@@ -59,15 +59,20 @@ export type FoldRowProps = FoldRowSummaryProps &
59
59
  */
60
60
  readonly isOpenInitially?: boolean;
61
61
  /**
62
- * Controls at the right end of the row's bar (a delete button, a menu). They sit beside the `<summary>`, not in
63
- * it, so clicking them never folds the row, but they share its background: the bar runs under them when the row
64
- * is open or hovered. Shown whether the row is open or closed, centred on the summary's first line.
62
+ * Controls in the right column of the row's bar (a delete button, a menu). The column sits beside the `<summary>`,
63
+ * not in it, so clicking a control never folds the row; it spans the summary's full height and lights with it when
64
+ * the row is open or hovered, so the bar reads as one box. On a phone (below `md`) the column falls under the
65
+ * summary and each control is at least the touch target (44 px).
65
66
  */
66
67
  readonly actions?: ReactNode;
68
+ /** The item's status, drawn in the same column above the actions (with no actions, the column holds only it). */
69
+ readonly status?: ReactNode;
67
70
  };
68
71
 
69
- const CONTENT_CLASS = "flex flex-col gap-2 p-3 empty:hidden";
70
- const INSET_CONTENT_CLASS = "flex flex-col gap-2 py-2 pr-1 pl-6 empty:hidden";
72
+ // The bar and its opened content share one 8 px horizontal inset, so the details start under the chevron; the inset
73
+ // variant starts under the title instead (8 px inset, 16 px chevron, 8 px gap).
74
+ const CONTENT_LAYOUT = "flex-col gap-2 px-2 py-3";
75
+ const INSET_CONTENT_LAYOUT = "flex-col gap-2 py-2 pr-2 pl-8";
71
76
 
72
77
  function FoldRowFixedSummary({
73
78
  title,
@@ -123,42 +128,91 @@ function FoldRowChevron() {
123
128
  );
124
129
  }
125
130
 
131
+ function isDrawn(node: ReactNode): boolean {
132
+ return node !== undefined && node !== null;
133
+ }
134
+
126
135
  // An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
127
136
  export function FoldRow(props: FoldRowProps) {
128
- const { actions, size = "default" } = props;
129
- if (actions === undefined || actions === null) {
130
- return <FoldRowDetails {...props} className="border-b border-border" />;
137
+ const { actions, status, isInset = false } = props;
138
+ if (!isDrawn(actions) && !isDrawn(status)) {
139
+ return (
140
+ <FoldRowDetails
141
+ {...props}
142
+ className="border-b border-border"
143
+ content={<FoldRowContent {...props} className={cn("flex", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "empty:hidden")} />}
144
+ />
145
+ );
131
146
  }
132
- // The actions sit beside the `<details>`, not in its `<summary>`: a control inside the summary would fold the row.
133
- // They carry the summary's background (the details is their peer: open; the wrapper is the hover group), so the
134
- // summary and the actions read as one bar with the controls at its right end.
147
+ // The right column sits beside the `<details>`, not in its `<summary>`: a control inside the summary would fold the
148
+ // row. To make the column exactly as high as the summary, the `<details>` holds only its summary and shares a grid
149
+ // row with the column (grid items stretch to their row); the opened content is the next row, shown while the
150
+ // details is open (`peer-open`). The details and the column carry the bar's light together, so they read as one box.
135
151
  return (
136
- <div data-slot="fold-row-with-actions" className="group/fold-row-with-actions flex items-start border-b border-border">
137
- <FoldRowDetails {...props} className="peer/fold-row min-w-0 flex-1" hasActions />
152
+ <div
153
+ data-slot="fold-row-with-actions"
154
+ className="group/fold-row-with-actions grid grid-cols-1 border-b border-border md:grid-cols-[minmax(0,1fr)_auto]"
155
+ >
156
+ <FoldRowDetails
157
+ {...props}
158
+ 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"
159
+ isLitByRow
160
+ />
138
161
  <div
139
162
  data-slot="fold-row-actions"
140
- className={cn(
141
- "flex shrink-0 items-center gap-1 rounded-r-md pr-1 transition-colors duration-120 group-hover/fold-row-with-actions:bg-accent peer-open/fold-row:bg-accent",
142
- size === "touch" ? "min-h-touch-target" : "min-h-row-height",
143
- )}
163
+ 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"
144
164
  >
145
- {actions}
165
+ {isDrawn(status) ? (
166
+ <div data-slot="fold-row-status" className="flex items-center">
167
+ {status}
168
+ </div>
169
+ ) : null}
170
+ {isDrawn(actions) ? (
171
+ <div
172
+ data-slot="fold-row-action-list"
173
+ className="flex items-center gap-1 max-md:*:min-h-touch-target max-md:*:min-w-touch-target"
174
+ >
175
+ {actions}
176
+ </div>
177
+ ) : null}
146
178
  </div>
179
+ <FoldRowContent
180
+ {...props}
181
+ className={cn("col-span-full hidden", isInset ? INSET_CONTENT_LAYOUT : CONTENT_LAYOUT, "peer-open/fold-row:not-empty:flex")}
182
+ />
147
183
  </div>
148
184
  );
149
185
  }
150
186
 
151
- function FoldRowDetails(props: FoldRowProps & { readonly className: string; readonly hasActions?: boolean }) {
152
- const { isInset = false, isOpenInitially = false, size = "default", children, className, hasActions = false } = props;
187
+ function FoldRowContent(props: FoldRowProps & { readonly className: string }) {
188
+ const { isInset = false, children, className } = props;
189
+ return (
190
+ <div data-slot="fold-row-content" data-inset={isInset} className={className}>
191
+ {props.details === undefined ? null : <DetailTable label={props.detailsLabel} rows={props.details} />}
192
+ {children}
193
+ </div>
194
+ );
195
+ }
196
+
197
+ function FoldRowDetails(
198
+ props: FoldRowProps & {
199
+ readonly className: string;
200
+ /** The summary lights on its own, or the wrapper lights the whole details (with the right column). */
201
+ readonly isLitByRow?: boolean;
202
+ /** The opened content, when it lives inside the details. */
203
+ readonly content?: ReactNode;
204
+ },
205
+ ) {
206
+ const { isOpenInitially = false, size = "default", className, isLitByRow = false, content } = props;
153
207
  return (
154
208
  <details data-slot="fold-row" open={isOpenInitially || undefined} className={cn("group/fold-row", className)}>
155
209
  <summary
156
210
  data-slot="fold-row-summary"
157
211
  className={cn(
158
- "flex 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",
212
+ "flex cursor-pointer list-none flex-wrap items-center gap-x-2 gap-y-1 rounded-md px-2 py-1",
213
+ !isLitByRow && "transition-colors duration-120 group-open/fold-row:bg-accent hover:bg-accent",
214
+ "focus-visible:ring-2 focus-visible:ring-ring focus-visible:outline-none [&::-webkit-details-marker]:hidden",
159
215
  size === "touch" ? "min-h-touch-target" : "min-h-row-height",
160
- // With actions the bar continues under them: no rounding on the right, and hovering them lights it too.
161
- hasActions && "rounded-r-none group-hover/fold-row-with-actions:bg-accent",
162
216
  )}
163
217
  >
164
218
  {props.summary === undefined ? (
@@ -175,10 +229,7 @@ function FoldRowDetails(props: FoldRowProps & { readonly className: string; read
175
229
  </>
176
230
  )}
177
231
  </summary>
178
- <div data-slot="fold-row-content" data-inset={isInset} className={isInset ? INSET_CONTENT_CLASS : CONTENT_CLASS}>
179
- {props.details === undefined ? null : <DetailTable label={props.detailsLabel} rows={props.details} />}
180
- {children}
181
- </div>
232
+ {content}
182
233
  </details>
183
234
  );
184
235
  }
@@ -0,0 +1,34 @@
1
+ import type { ReactNode } from "react";
2
+
3
+ import { cn } from "../lib/utils.js";
4
+ import { PageHeader, type PageHeaderProps } from "./PageHeader.js";
5
+
6
+ /** `full` takes the content area's width; `content` caps a reading page at the Notion reading width and centres it. */
7
+ export type PageLayoutWidth = "full" | "content";
8
+
9
+ export interface PageLayoutProps {
10
+ // The page's header, rendered once at the top: the same props as `PageHeader`.
11
+ header: PageHeaderProps;
12
+ // The page's sections, usually titled `Card`s, spaced like every other screen.
13
+ children?: ReactNode;
14
+ width?: PageLayoutWidth;
15
+ className?: string;
16
+ }
17
+
18
+ const WIDTH_CLASSES: Record<PageLayoutWidth, string> = {
19
+ full: "",
20
+ content: "mx-auto max-w-3xl",
21
+ };
22
+
23
+ /**
24
+ * A screen inside the app shell: its `PageHeader`, then its sections, with one width and one spacing on every page.
25
+ * `min-w-0` keeps a wide table scrolling inside its card instead of widening the page.
26
+ */
27
+ export function PageLayout({ header, children, width = "full", className }: PageLayoutProps) {
28
+ return (
29
+ <div data-slot="page-layout" data-width={width} className={cn("grid w-full min-w-0 gap-4", WIDTH_CLASSES[width], className)}>
30
+ <PageHeader {...header} />
31
+ {children}
32
+ </div>
33
+ );
34
+ }