@softure-ai/theme-notion 0.15.0 → 0.16.1
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 +12 -0
- package/README.md +4 -2
- package/dist/notion/FoldRow.d.ts +8 -2
- package/dist/notion/FoldRow.d.ts.map +1 -1
- package/dist/notion/FoldRow.js +7 -3
- package/dist/notion/FoldRow.js.map +1 -1
- package/package.json +1 -1
- package/src/notion/FoldRow.tsx +21 -8
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ 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.16.1
|
|
8
|
+
|
|
9
|
+
- `FoldRow actions` sit inside the row's bar: the summary's background now runs under them when the row is open or
|
|
10
|
+
hovered (hovering the actions lights the bar too), with the controls at its right end, instead of a separate
|
|
11
|
+
column beside a shorter bar. They stay outside the `<summary>`, so a click still never folds the row. Same API.
|
|
12
|
+
|
|
13
|
+
## 0.16.0
|
|
14
|
+
|
|
15
|
+
- `FoldRow isOpenInitially`: renders the row open (`<details open>`), so a page can open the row its address points at (a
|
|
16
|
+
`?item=` link, a tab inside the row that lives in the address). Only the first render reads it; the native element
|
|
17
|
+
keeps its own state afterwards. New optional prop only.
|
|
18
|
+
|
|
7
19
|
## 0.15.0
|
|
8
20
|
|
|
9
21
|
- Form controls that line up: `FileInput`, a compact file picker for a form row (a button at the 28 px height of
|
package/README.md
CHANGED
|
@@ -185,8 +185,10 @@ drawn after the chevron in place of `title`, `facts` and `badges`; `details` and
|
|
|
185
185
|
so the content can be several tables or a list. `size="touch"` makes the summary at least the `touch-target` height
|
|
186
186
|
(44 px) instead of the row height, for a phone list. `actions` puts controls on the row's right (a delete button,
|
|
187
187
|
a menu), beside the `<details>` rather than inside its `<summary>`, so clicking one never folds the row; they show
|
|
188
|
-
whether the row is open or closed, centred on the summary's first line
|
|
189
|
-
|
|
188
|
+
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:
|
|
189
|
+
the summary's background runs under them when the row is open or hovered, so the bar reads as one. The row's bottom
|
|
190
|
+
border moves to the wrapper (`data-slot="fold-row-with-actions"`). `isOpenInitially` renders the row open (`<details open>`), for the row the
|
|
191
|
+
address points at; only the first render reads it, and the reader can still fold the row.
|
|
190
192
|
|
|
191
193
|
```tsx
|
|
192
194
|
<FoldRow title="Dentist" facts={["12.01.2027"]} badges={[]} detailsLabel="Visit details" details={rows} />
|
package/dist/notion/FoldRow.d.ts
CHANGED
|
@@ -39,8 +39,14 @@ export type FoldRowProps = FoldRowSummaryProps & FoldRowDetailsProps & {
|
|
|
39
39
|
/** More content under the table when opened. */
|
|
40
40
|
readonly children?: ReactNode;
|
|
41
41
|
/**
|
|
42
|
-
*
|
|
43
|
-
*
|
|
42
|
+
* Renders the row open (`<details open>`), for a row the address points at; the reader still folds it. Only the
|
|
43
|
+
* first render reads it: the native element keeps its own state afterwards.
|
|
44
|
+
*/
|
|
45
|
+
readonly isOpenInitially?: boolean;
|
|
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.
|
|
44
50
|
*/
|
|
45
51
|
readonly actions?: ReactNode;
|
|
46
52
|
};
|
|
@@ -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,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,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;CACxC,GACD;IACE,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,CAAC;IAC9B,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;CAC1B,CAAC;AAEN,MAAM,MAAM,YAAY,GAAG,mBAAmB,GAC5C,mBAAmB,GAAG;IACpB,+GAA+G;IAC/G,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;IAC3B,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;;;;OAIG;IACH,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B,CAAC;AA4DJ,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAsB1C"}
|
package/dist/notion/FoldRow.js
CHANGED
|
@@ -23,10 +23,14 @@ export function FoldRow(props) {
|
|
|
23
23
|
return _jsx(FoldRowDetails, { ...props, className: "border-b border-border" });
|
|
24
24
|
}
|
|
25
25
|
// The actions sit beside the `<details>`, not in its `<summary>`: a control inside the summary would fold the row.
|
|
26
|
-
|
|
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 })] }));
|
|
27
29
|
}
|
|
28
30
|
function FoldRowDetails(props) {
|
|
29
|
-
const { isInset = false, size = "default", children, className } = props;
|
|
30
|
-
return (_jsxs("details", { "data-slot": "fold-row", 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"
|
|
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] })] }));
|
|
31
35
|
}
|
|
32
36
|
//# 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;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,YACl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QAAQ,IACL,IACE,CACX,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.16.1",
|
|
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
|
@@ -54,8 +54,14 @@ export type FoldRowProps = FoldRowSummaryProps &
|
|
|
54
54
|
/** More content under the table when opened. */
|
|
55
55
|
readonly children?: ReactNode;
|
|
56
56
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
57
|
+
* Renders the row open (`<details open>`), for a row the address points at; the reader still folds it. Only the
|
|
58
|
+
* first render reads it: the native element keeps its own state afterwards.
|
|
59
|
+
*/
|
|
60
|
+
readonly isOpenInitially?: boolean;
|
|
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.
|
|
59
65
|
*/
|
|
60
66
|
readonly actions?: ReactNode;
|
|
61
67
|
};
|
|
@@ -124,12 +130,17 @@ export function FoldRow(props: FoldRowProps) {
|
|
|
124
130
|
return <FoldRowDetails {...props} className="border-b border-border" />;
|
|
125
131
|
}
|
|
126
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.
|
|
127
135
|
return (
|
|
128
|
-
<div data-slot="fold-row-with-actions" className="flex items-start
|
|
129
|
-
<FoldRowDetails {...props} className="min-w-0 flex-1" />
|
|
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 />
|
|
130
138
|
<div
|
|
131
139
|
data-slot="fold-row-actions"
|
|
132
|
-
className={cn(
|
|
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
|
+
)}
|
|
133
144
|
>
|
|
134
145
|
{actions}
|
|
135
146
|
</div>
|
|
@@ -137,15 +148,17 @@ export function FoldRow(props: FoldRowProps) {
|
|
|
137
148
|
);
|
|
138
149
|
}
|
|
139
150
|
|
|
140
|
-
function FoldRowDetails(props: FoldRowProps & { readonly className: string }) {
|
|
141
|
-
const { isInset = false, size = "default", children, className } = props;
|
|
151
|
+
function FoldRowDetails(props: FoldRowProps & { readonly className: string; readonly hasActions?: boolean }) {
|
|
152
|
+
const { isInset = false, isOpenInitially = false, size = "default", children, className, hasActions = false } = props;
|
|
142
153
|
return (
|
|
143
|
-
<details data-slot="fold-row" className={cn("group/fold-row", className)}>
|
|
154
|
+
<details data-slot="fold-row" open={isOpenInitially || undefined} className={cn("group/fold-row", className)}>
|
|
144
155
|
<summary
|
|
145
156
|
data-slot="fold-row-summary"
|
|
146
157
|
className={cn(
|
|
147
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",
|
|
148
159
|
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",
|
|
149
162
|
)}
|
|
150
163
|
>
|
|
151
164
|
{props.summary === undefined ? (
|