@softure-ai/theme-notion 0.16.0 → 0.16.2
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 +3 -2
- package/dist/notion/FoldRow.d.ts +3 -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/dist/ui/select.js +1 -1
- package/dist/ui/select.js.map +1 -1
- package/package.json +1 -1
- package/src/notion/FoldRow.tsx +15 -7
- package/src/ui/select.tsx +1 -1
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.2
|
|
8
|
+
|
|
9
|
+
- `SelectTrigger` shrinks to its cell: `min-w-0 max-w-full` on the trigger and `min-w-0` on its value, so a long
|
|
10
|
+
option label in a narrow `FormGrid` column (a flex or grid item whose minimum width was its text) is clipped inside
|
|
11
|
+
the field instead of pushing the control past the cell's edge. Same API; a trigger with room keeps its size.
|
|
12
|
+
|
|
13
|
+
## 0.16.1
|
|
14
|
+
|
|
15
|
+
- `FoldRow actions` sit inside the row's bar: the summary's background now runs under them when the row is open or
|
|
16
|
+
hovered (hovering the actions lights the bar too), with the controls at its right end, instead of a separate
|
|
17
|
+
column beside a shorter bar. They stay outside the `<summary>`, so a click still never folds the row. Same API.
|
|
18
|
+
|
|
7
19
|
## 0.16.0
|
|
8
20
|
|
|
9
21
|
- `FoldRow isOpenInitially`: renders the row open (`<details open>`), so a page can open the row its address points at (a
|
package/README.md
CHANGED
|
@@ -185,8 +185,9 @@ 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
|
|
190
191
|
address points at; only the first render reads it, and the reader can still fold the row.
|
|
191
192
|
|
|
192
193
|
```tsx
|
package/dist/notion/FoldRow.d.ts
CHANGED
|
@@ -44,8 +44,9 @@ export type FoldRowProps = FoldRowSummaryProps & FoldRowDetailsProps & {
|
|
|
44
44
|
*/
|
|
45
45
|
readonly isOpenInitially?: boolean;
|
|
46
46
|
/**
|
|
47
|
-
* Controls
|
|
48
|
-
*
|
|
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.
|
|
49
50
|
*/
|
|
50
51
|
readonly actions?: ReactNode;
|
|
51
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,CAAC;AAEpD,MAAM,WAAW,YAAY;IAC3B,gEAAgE;IAChE,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,IAAI,EAAE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,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, isOpenInitially = false, size = "default", children, className } = props;
|
|
30
|
-
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"
|
|
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;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ot": "select-value", ...props });
|
|
17
17
|
}
|
|
18
18
|
function SelectTrigger({ className, size = "default", children, ...props }) {
|
|
19
|
-
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-field px-2.5 py-1 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", size === "touch" && "h-touch-target", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
|
|
19
|
+
return (_jsxs(SelectPrimitive.Trigger, { "data-slot": "select-trigger", "data-size": size, className: cn("flex w-fit min-w-0 max-w-full items-center justify-between gap-2 rounded-md border border-input bg-field px-2.5 py-1 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:min-w-0 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground", size === "touch" && "h-touch-target", className), ...props, children: [children, _jsx(SelectPrimitive.Icon, { asChild: true, children: _jsx(ChevronDownIcon, { className: "size-4 opacity-50" }) })] }));
|
|
20
20
|
}
|
|
21
21
|
function SelectContent({ className, children, position = "item-aligned", align = "center", size = "default", ...props }) {
|
|
22
22
|
return (_jsx(SelectPrimitive.Portal, { children: _jsxs(SelectPrimitive.Content, { "data-slot": "select-content", className: cn("relative z-50 max-h-(--radix-select-content-available-height) data-[side=bottom]:max-h-[calc(var(--radix-select-content-available-height)-env(safe-area-inset-bottom))] data-[side=top]:max-h-[calc(var(--radix-select-content-available-height)-env(safe-area-inset-top))] min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-xl bg-popover text-popover-foreground shadow-menu data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95", position === "popper" &&
|
package/dist/ui/select.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"select.js","sourceRoot":"","sources":["../../src/ui/select.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,SAAS,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AACxE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,UAAU,CAAA;AAIpD,4FAA4F;AAC5F,MAAM,qBAAqB,GAAG,KAAK,CAAC,aAAa,CAAiB,SAAS,CAAC,CAAA;AAE5E,SAAS,MAAM,CAAC,EACd,GAAG,KAAK,EAC0C;IAClD,OAAO,KAAC,eAAe,CAAC,IAAI,iBAAW,QAAQ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,SAAS,EACT,GAAG,KAAK,EACsD;IAC9D,OAAO,CACL,KAAC,eAAe,CAAC,gBAAgB,iBACrB,2BAA2B,EACrC,SAAS,EAAE,EAAE,CACX,sDAAsD,EACtD,SAAS,CACV,KACG,KAAK,YAET,KAAC,eAAe,IAAC,SAAS,EAAC,QAAQ,GAAG,GACL,CACpC,CAAA;AACH,CAAC;AAED,OAAO,EACL,MAAM,EACN,aAAa,EACb,WAAW,EACX,UAAU,EACV,WAAW,EACX,sBAAsB,EACtB,oBAAoB,EACpB,eAAe,EACf,aAAa,EACb,WAAW,GACZ,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.2",
|
|
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
|
@@ -59,8 +59,9 @@ export type FoldRowProps = FoldRowSummaryProps &
|
|
|
59
59
|
*/
|
|
60
60
|
readonly isOpenInitially?: boolean;
|
|
61
61
|
/**
|
|
62
|
-
* Controls
|
|
63
|
-
*
|
|
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.
|
|
64
65
|
*/
|
|
65
66
|
readonly actions?: ReactNode;
|
|
66
67
|
};
|
|
@@ -129,12 +130,17 @@ export function FoldRow(props: FoldRowProps) {
|
|
|
129
130
|
return <FoldRowDetails {...props} className="border-b border-border" />;
|
|
130
131
|
}
|
|
131
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.
|
|
132
135
|
return (
|
|
133
|
-
<div data-slot="fold-row-with-actions" className="flex items-start
|
|
134
|
-
<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 />
|
|
135
138
|
<div
|
|
136
139
|
data-slot="fold-row-actions"
|
|
137
|
-
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
|
+
)}
|
|
138
144
|
>
|
|
139
145
|
{actions}
|
|
140
146
|
</div>
|
|
@@ -142,8 +148,8 @@ export function FoldRow(props: FoldRowProps) {
|
|
|
142
148
|
);
|
|
143
149
|
}
|
|
144
150
|
|
|
145
|
-
function FoldRowDetails(props: FoldRowProps & { readonly className: string }) {
|
|
146
|
-
const { isInset = false, isOpenInitially = 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;
|
|
147
153
|
return (
|
|
148
154
|
<details data-slot="fold-row" open={isOpenInitially || undefined} className={cn("group/fold-row", className)}>
|
|
149
155
|
<summary
|
|
@@ -151,6 +157,8 @@ function FoldRowDetails(props: FoldRowProps & { readonly className: string }) {
|
|
|
151
157
|
className={cn(
|
|
152
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",
|
|
153
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",
|
|
154
162
|
)}
|
|
155
163
|
>
|
|
156
164
|
{props.summary === undefined ? (
|
package/src/ui/select.tsx
CHANGED
|
@@ -41,7 +41,7 @@ function SelectTrigger({
|
|
|
41
41
|
data-slot="select-trigger"
|
|
42
42
|
data-size={size}
|
|
43
43
|
className={cn(
|
|
44
|
-
"flex w-fit items-center justify-between gap-2 rounded-md border border-input bg-field px-2.5 py-1 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
44
|
+
"flex w-fit min-w-0 max-w-full items-center justify-between gap-2 rounded-md border border-input bg-field px-2.5 py-1 text-sm whitespace-nowrap transition-[color,box-shadow] outline-none focus-visible:border-ring focus-visible:ring-2 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[placeholder]:text-muted-foreground data-[size=default]:h-7 data-[size=sm]:h-6 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:min-w-0 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground",
|
|
45
45
|
size === "touch" && "h-touch-target",
|
|
46
46
|
className
|
|
47
47
|
)}
|