@softure-ai/theme-notion 0.12.0 → 0.14.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 +16 -0
- package/README.md +12 -4
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/notion/AsidePanel.d.ts +5 -2
- package/dist/notion/AsidePanel.d.ts.map +1 -1
- package/dist/notion/AsidePanel.js +13 -9
- package/dist/notion/AsidePanel.js.map +1 -1
- package/dist/notion/FoldRow.d.ts +5 -0
- package/dist/notion/FoldRow.d.ts.map +1 -1
- package/dist/notion/FoldRow.js +11 -3
- package/dist/notion/FoldRow.js.map +1 -1
- package/dist/notion/PropertyList.js +1 -1
- package/dist/notion/Timeline.js +1 -1
- package/dist/notion/palette.d.ts.map +1 -1
- package/dist/notion/tones.d.ts.map +1 -1
- package/dist/ui/alert.d.ts +1 -1
- package/dist/ui/badge.d.ts +2 -2
- package/dist/ui/button-group.d.ts +1 -1
- package/dist/ui/button.d.ts +2 -2
- package/dist/ui/field.d.ts +1 -1
- package/dist/ui/input-group.d.ts +2 -2
- package/dist/ui/item.d.ts +3 -3
- package/dist/ui/sidebar.d.ts +1 -1
- package/dist/ui/sonner.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/notion/AsidePanel.tsx +21 -8
- package/src/notion/FoldRow.tsx +26 -2
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,22 @@ 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.14.0
|
|
8
|
+
|
|
9
|
+
- `FoldRow actions`: controls on the row's right (a delete button, a menu), rendered beside the `<details>` instead of
|
|
10
|
+
inside its `<summary>`, so clicking one never folds the row; shown open or closed, centred on the summary's first
|
|
11
|
+
line (row height, or the touch target at `size="touch"`). With `actions` the row is wrapped in
|
|
12
|
+
`data-slot="fold-row-with-actions"`, which carries the bottom border. New optional prop only.
|
|
13
|
+
|
|
14
|
+
## 0.13.0
|
|
15
|
+
|
|
16
|
+
- `AsidePanel` follow-ups (#1075): `AsidePanelToggle icon` (a `LucideIcon` drawn in both states, for a panel that
|
|
17
|
+
holds one tool its users know by its icon); the wide-screen `aside` carries `max-md:hidden`, so a phone served the
|
|
18
|
+
server HTML with a kept open panel no longer paints it until hydration swaps in the sheet (an app's
|
|
19
|
+
`contents max-md:hidden` wrapper can go); the toggle, the width switch and the sidebar opener set `title` from
|
|
20
|
+
their labels, so they show a hover hint; `AsidePanel description` adds one line under the phone sheet's title.
|
|
21
|
+
New optional props only.
|
|
22
|
+
|
|
7
23
|
## 0.12.0
|
|
8
24
|
|
|
9
25
|
- A panel slid in from the right of the app shell (#1044): `AsidePanelProvider` (replaces `SidebarProvider`, keeps
|
package/README.md
CHANGED
|
@@ -181,13 +181,17 @@ right; opened, it shows a `DetailTable` and its `children`. The opened content i
|
|
|
181
181
|
sets `data-inset` on the content, like `StatsFold`. A row with a summary of its own (icons, a status) passes `summary`,
|
|
182
182
|
drawn after the chevron in place of `title`, `facts` and `badges`; `details` and `detailsLabel` are optional together,
|
|
183
183
|
so the content can be several tables or a list. `size="touch"` makes the summary at least the `touch-target` height
|
|
184
|
-
(44 px) instead of the row height, for a phone list.
|
|
184
|
+
(44 px) instead of the row height, for a phone list. `actions` puts controls on the row's right (a delete button,
|
|
185
|
+
a menu), beside the `<details>` rather than inside its `<summary>`, so clicking one never folds the row; they show
|
|
186
|
+
whether the row is open or closed, centred on the summary's first line, and the row's bottom border moves to the
|
|
187
|
+
wrapper (`data-slot="fold-row-with-actions"`).
|
|
185
188
|
|
|
186
189
|
```tsx
|
|
187
190
|
<FoldRow title="Dentist" facts={["12.01.2027"]} badges={[]} detailsLabel="Visit details" details={rows} />
|
|
188
191
|
<FoldRow summary={<><Receipt aria-hidden="true" className="size-4" /> Invoice 12/2026 <Badge>Paid</Badge></>}>
|
|
189
192
|
<InvoiceLines />
|
|
190
193
|
</FoldRow>
|
|
194
|
+
<FoldRow title="clip.mp4" badges={[]} actions={<DeleteButton />} />
|
|
191
195
|
```
|
|
192
196
|
|
|
193
197
|
**`FilterChip`.** The filters above a list or a table, drawn the way a Notion database view draws them: a 24 px pill
|
|
@@ -235,12 +239,16 @@ on a wide screen the left `Sidebar` (offcanvas) is folded, and opening the sideb
|
|
|
235
239
|
|
|
236
240
|
- `AsidePanelToggle`: one icon button fixed at the top-right edge, in the same place open or closed, with
|
|
237
241
|
`aria-expanded`, `aria-controls` and a label that switches between show and hide; `outline` while closed,
|
|
238
|
-
`secondary` while open. Opening from it moves focus to the panel's heading (`tabIndex=-1`).
|
|
242
|
+
`secondary` while open. Opening from it moves focus to the panel's heading (`tabIndex=-1`). `icon` (a
|
|
243
|
+
`LucideIcon`) replaces the panel icons in both states, for a panel that holds one tool its users know by its icon.
|
|
244
|
+
The toggle, the width switch and the sidebar opener show their label as a hover hint (`title`) too.
|
|
239
245
|
- `AsidePanel title`: an `aside` (`sticky top-0 h-dvh`, `border-l`) with a header holding the heading and a ghost
|
|
240
246
|
width switch: `standard` (two fifths) or `half` (the shell split half and half). Escape closes it and returns focus
|
|
241
247
|
to the toggle unless a dialog, menu, listbox or popover is open (`isOverlayOpen(document)`: Radix
|
|
242
248
|
`data-state="open"`, `:popover-open` or `dialog[open]`; a closed popover left in the page does not count).
|
|
243
|
-
Below `MOBILE_BREAKPOINT` it is a right `Sheet`, opened for that page only: the kept state never opens it there
|
|
249
|
+
Below `MOBILE_BREAKPOINT` it is a right `Sheet`, opened for that page only: the kept state never opens it there;
|
|
250
|
+
`description` adds one line under the sheet's title (its `aria-describedby`). The `aside` carries `max-md:hidden`,
|
|
251
|
+
so a phone served the wide-screen HTML (the server cannot tell the width) never paints it before hydration.
|
|
244
252
|
Its children render only while it is open, so pass a lazily loaded body (`next/dynamic` with `ssr: false`) and
|
|
245
253
|
screens that never open it never load its code.
|
|
246
254
|
- `AsidePanelSidebarOpener`: an icon button fixed at the top-left edge, shown only while the sidebar is folded on a
|
|
@@ -257,7 +265,7 @@ const MapPanel = dynamic(() => import("./map-panel"), { ssr: false });
|
|
|
257
265
|
<AppSidebar />
|
|
258
266
|
<SidebarInset>
|
|
259
267
|
<AsidePanelSidebarOpener />
|
|
260
|
-
<AsidePanelToggle />
|
|
268
|
+
<AsidePanelToggle icon={MapIcon} />
|
|
261
269
|
{children}
|
|
262
270
|
</SidebarInset>
|
|
263
271
|
<AsidePanel title="Map">
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,EAAE
|
|
1
|
+
{"version":3,"file":"en.d.ts","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,eAAO,MAAM,EAAE;aACb,UAAU;iBACR,IAAI,EAAE,gBAAgB;iBACtB,IAAI,EAAE,gBAAgB;iBACtB,KAAK,EAAE,iBAAiB;iBACxB,MAAM,EAAE,kBAAkB;iBAC1B,WAAW,EAAE,kCAAkC;;aAEjD,UAAU;iBAAI,KAAK,EAAE,YAAY;iBAAE,IAAI,EAAE,MAAM;;aAC/C,MAAM;iBAAI,KAAK,EAAE,OAAO;;aACxB,UAAU;iBAAI,GAAG,EAAE,YAAY;;aAC/B,KAAK;iBAAI,KAAK,EAAE,OAAO;;aACvB,SAAS;iBAAI,KAAK,EAAE,OAAO;;aAC3B,OAAO;iBAAI,WAAW,EAAE,SAAS;iBAAE,iBAAiB,EAAE,8BAA8B;iBAAE,MAAM,EAAE,gBAAgB;;aAC9G,OAAO;iBAAI,KAAK,EAAE,SAAS;;aAC3B,QAAQ;iBACN,YAAY,EACV,mIAAmI;iBACrI,QAAQ,EAAE,mDAAmD;iBAC7D,KAAK,EAAE,iDAAiD;iBACxD,OAAO,EAAE,mDAAmD;iBAC5D,SAAS,EAAE,qCAAqC;iBAChD,MAAM,EAAE,iBAAiB;;aAE3B,MAAM;iBACJ,MAAM,EAAE,cAAc;iBACtB,SAAS,EAAE,eAAe;iBAC1B,IAAI,EAAE,mBAAmB;iBACzB,OAAO,EAAE,iBAAiB;iBAC1B,QAAQ,EAAE,aAAa;iBACvB,KAAK,EAAE,OAAO;iBACd,KAAK,EAAE,cAAc;iBACrB,MAAM,EAAE,eAAe;iBACvB,MAAM,EAAE,eAAe;iBACvB,QAAQ,EAAE,kBAAkB;iBAC5B,MAAM,EAAE,QAAQ;iBAChB,SAAS,EAAE,WAAW;iBACtB,MAAM,EAAE,QAAQ;iBAChB,IAAI,EAAE,MAAM;iBACZ,MAAM,EAAE,QAAQ;;aAElB,KAAK;iBAAI,IAAI,EAAE,MAAM;iBAAE,OAAO,EAAE,SAAS;iBAAE,IAAI,EAAE,OAAO;iBAAE,MAAM,EAAE,QAAQ;;aAC1E,OAAO;iBAAI,KAAK,EAAE,iBAAiB;iBAAE,WAAW,EAAE,gCAAgC;;CAC1E,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
1
2
|
import { type ComponentProps, type ReactNode, type RefObject } from "react";
|
|
2
3
|
import { SidebarProvider } from "../ui/sidebar.js";
|
|
3
4
|
export type AsidePanelWidth = "standard" | "half";
|
|
@@ -37,10 +38,11 @@ export declare function AsidePanelProvider({ initialState, save, onSaveError, is
|
|
|
37
38
|
export interface AsidePanelToggleProps {
|
|
38
39
|
readonly showLabel?: string;
|
|
39
40
|
readonly hideLabel?: string;
|
|
41
|
+
readonly icon?: LucideIcon;
|
|
40
42
|
readonly className?: string;
|
|
41
43
|
}
|
|
42
44
|
/** The icon button at the top-right edge that shows and hides the panel; it stays in place either way. */
|
|
43
|
-
export declare function AsidePanelToggle({ showLabel, hideLabel, className }: AsidePanelToggleProps): import("react").JSX.Element | null;
|
|
45
|
+
export declare function AsidePanelToggle({ showLabel, hideLabel, icon, className }: AsidePanelToggleProps): import("react").JSX.Element | null;
|
|
44
46
|
export interface AsidePanelSidebarOpenerProps {
|
|
45
47
|
readonly label?: string;
|
|
46
48
|
readonly className?: string;
|
|
@@ -53,12 +55,13 @@ export interface AsidePanelProps {
|
|
|
53
55
|
readonly widenLabel?: string;
|
|
54
56
|
readonly narrowLabel?: string;
|
|
55
57
|
readonly closeLabel?: string;
|
|
58
|
+
readonly description?: string;
|
|
56
59
|
readonly className?: string;
|
|
57
60
|
}
|
|
58
61
|
/**
|
|
59
62
|
* The panel: an `aside` beside the shell's content on a wide screen (the content narrows next to it), a right `Sheet`
|
|
60
63
|
* on a phone. Place it after `SidebarInset` inside `AsidePanelProvider`.
|
|
61
64
|
*/
|
|
62
|
-
export declare function AsidePanel({ title, children, widenLabel, narrowLabel, closeLabel, className, }: AsidePanelProps): import("react").JSX.Element | null;
|
|
65
|
+
export declare function AsidePanel({ title, children, widenLabel, narrowLabel, closeLabel, description, className, }: AsidePanelProps): import("react").JSX.Element | null;
|
|
63
66
|
export {};
|
|
64
67
|
//# sourceMappingURL=AsidePanel.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsidePanel.d.ts","sourceRoot":"","sources":["../../src/notion/AsidePanel.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AsidePanel.d.ts","sourceRoot":"","sources":["../../src/notion/AsidePanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA2E,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACxH,OAAO,EAQL,KAAK,cAAc,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACf,MAAM,OAAO,CAAC;AAMf,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAMnD,MAAM,MAAM,eAAe,GAAG,UAAU,GAAG,MAAM,CAAC;AAGlD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,KAAK,EAAE,e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AE,MAAM,CAAC;CAC7B;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,QAAQ,EACR,UAAsC,EACtC,WAAwC,EACxC,UAAU,EACV,WAAW,EACX,SAAS,GACV,EAAE,eAAe,sCA2FjB"}
|
|
@@ -6,7 +6,7 @@ import { createContext, useCallback, useContext, useEffect, useMemo, useRef, use
|
|
|
6
6
|
import { cn } from "../lib/utils.js";
|
|
7
7
|
import { en as messages } from "../messages/en.js";
|
|
8
8
|
import { Button } from "../ui/button.js";
|
|
9
|
-
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
9
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
10
10
|
import { SidebarProvider } from "../ui/sidebar.js";
|
|
11
11
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
12
12
|
import { isOverlayOpen } from "./overlay-open.js";
|
|
@@ -91,25 +91,26 @@ export function AsidePanelProvider({ initialState, save, onSaveError, isHidden =
|
|
|
91
91
|
return (_jsx(AsidePanelContext.Provider, { value: value, children: _jsx(SidebarProvider, { open: isSidebarShown, onOpenChange: changeSidebar, ...props, children: children }) }));
|
|
92
92
|
}
|
|
93
93
|
/** The icon button at the top-right edge that shows and hides the panel; it stays in place either way. */
|
|
94
|
-
export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLabel = messages.asidePanel.hide, className }) {
|
|
94
|
+
export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLabel = messages.asidePanel.hide, icon, className }) {
|
|
95
95
|
const { panelId, isOpen, isHidden, toggleRef, toggle } = useAsidePanelContext("AsidePanelToggle");
|
|
96
96
|
if (isHidden)
|
|
97
97
|
return null;
|
|
98
|
-
const Icon = isOpen ? PanelRightClose : PanelRightOpen;
|
|
99
|
-
|
|
98
|
+
const Icon = icon ?? (isOpen ? PanelRightClose : PanelRightOpen);
|
|
99
|
+
const label = isOpen ? hideLabel : showLabel;
|
|
100
|
+
return (_jsx(Button, { ref: toggleRef, type: "button", "data-slot": "aside-panel-toggle", variant: isOpen ? "secondary" : "outline", size: "icon", "aria-expanded": isOpen, "aria-controls": panelId, "aria-label": label, title: label, className: cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] right-[calc(--spacing(2)+env(safe-area-inset-right))] z-20", className), onClick: toggle, children: _jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
100
101
|
}
|
|
101
102
|
/** The icon button at the top-left edge, shown only while the sidebar is folded: brings it back, closes the panel. */
|
|
102
103
|
export function AsidePanelSidebarOpener({ label = messages.asidePanel.showSidebar, className }) {
|
|
103
104
|
const { isMobile, isSidebarFolded, openSidebar } = useAsidePanelContext("AsidePanelSidebarOpener");
|
|
104
105
|
if (isMobile || !isSidebarFolded)
|
|
105
106
|
return null;
|
|
106
|
-
return (_jsx(Button, { type: "button", "data-slot": "aside-panel-sidebar-opener", variant: "outline", size: "icon", "aria-label": label, className: cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] left-[calc(--spacing(2)+env(safe-area-inset-left))] z-20", className), onClick: openSidebar, children: _jsx(PanelLeft, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
107
|
+
return (_jsx(Button, { type: "button", "data-slot": "aside-panel-sidebar-opener", variant: "outline", size: "icon", "aria-label": label, title: label, className: cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] left-[calc(--spacing(2)+env(safe-area-inset-left))] z-20", className), onClick: openSidebar, children: _jsx(PanelLeft, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) }));
|
|
107
108
|
}
|
|
108
109
|
/**
|
|
109
110
|
* The panel: an `aside` beside the shell's content on a wide screen (the content narrows next to it), a right `Sheet`
|
|
110
111
|
* on a phone. Place it after `SidebarInset` inside `AsidePanelProvider`.
|
|
111
112
|
*/
|
|
112
|
-
export function AsidePanel({ title, children, widenLabel = messages.asidePanel.widen, narrowLabel = messages.asidePanel.narrow, closeLabel, className, }) {
|
|
113
|
+
export function AsidePanel({ title, children, widenLabel = messages.asidePanel.widen, narrowLabel = messages.asidePanel.narrow, closeLabel, description, className, }) {
|
|
113
114
|
const { panelId, isOpen, width, isMobile, isHidden, toggleRef, isHeadingFocusRequested, close, setWidth } = useAsidePanelContext("AsidePanel");
|
|
114
115
|
const headingRef = useRef(null);
|
|
115
116
|
const headingId = `${panelId}-heading`;
|
|
@@ -137,18 +138,21 @@ export function AsidePanel({ title, children, widenLabel = messages.asidePanel.w
|
|
|
137
138
|
if (isHidden)
|
|
138
139
|
return null;
|
|
139
140
|
if (isMobile) {
|
|
140
|
-
return (_jsx(Sheet, { open: isOpen, onOpenChange: (next) => !next && close(), children: _jsxs(SheetContent, { id: panelId, side: "right", "data-slot": "aside-panel-sheet", "aria-describedby": undefined, closeLabel: closeLabel, className: cn("w-full gap-0 sm:max-w-none", className), onOpenAutoFocus: (event) => {
|
|
141
|
+
return (_jsx(Sheet, { open: isOpen, onOpenChange: (next) => !next && close(), children: _jsxs(SheetContent, { id: panelId, side: "right", "data-slot": "aside-panel-sheet", ...(description === undefined ? { "aria-describedby": undefined } : {}), closeLabel: closeLabel, className: cn("w-full gap-0 sm:max-w-none", className), onOpenAutoFocus: (event) => {
|
|
141
142
|
event.preventDefault();
|
|
142
143
|
headingRef.current?.focus();
|
|
143
144
|
}, onCloseAutoFocus: (event) => {
|
|
144
145
|
event.preventDefault();
|
|
145
146
|
toggleRef.current?.focus();
|
|
146
|
-
}, children: [
|
|
147
|
+
}, children: [_jsxs(SheetHeader, { className: "border-b border-border", children: [_jsx(SheetTitle, { ref: headingRef, tabIndex: -1, className: "outline-none", children: title }), description === undefined ? null : _jsx(SheetDescription, { children: description })] }), _jsx("div", { "data-slot": "aside-panel-content", className: "min-h-0 flex-1 overflow-y-auto", children: isOpen ? children : null })] }) }));
|
|
147
148
|
}
|
|
148
149
|
if (!isOpen)
|
|
149
150
|
return null;
|
|
150
151
|
const isHalf = width === "half";
|
|
151
152
|
const WidthIcon = isHalf ? ChevronsRight : ChevronsLeft;
|
|
152
|
-
|
|
153
|
+
const widthLabel = isHalf ? narrowLabel : widenLabel;
|
|
154
|
+
// A phone gets this branch in the server HTML (`useIsMobile` is false there) until hydration swaps in the sheet:
|
|
155
|
+
// `max-md:hidden` keeps it from painting. The `md` breakpoint equals the theme's mobile breakpoint.
|
|
156
|
+
return (_jsxs("aside", { id: panelId, "data-slot": "aside-panel", "data-width": width, "aria-labelledby": headingId, className: cn("sticky top-0 flex h-dvh max-md:hidden w-2/5 shrink-0 flex-col border-l border-border bg-background text-foreground data-[width=half]:w-1/2", className), children: [_jsxs("div", { "data-slot": "aside-panel-header", className: "flex h-11 shrink-0 items-center gap-2 border-b border-border pr-12 pl-4", children: [_jsx("h2", { ref: headingRef, id: headingId, tabIndex: -1, className: "min-w-0 flex-1 truncate text-heading-3 outline-none", children: title }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": widthLabel, title: widthLabel, onClick: () => setWidth(isHalf ? "standard" : "half"), children: _jsx(WidthIcon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) })] }), _jsx("div", { "data-slot": "aside-panel-content", className: "min-h-0 flex-1 overflow-y-auto", children: children })] }));
|
|
153
157
|
}
|
|
154
158
|
//# sourceMappingURL=AsidePanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AsidePanel.js","sourceRoot":"","sources":["../../src/notion/AsidePanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,EAAE,MAAM,6BAA6B,CAAC;AAC1D,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,eAAe,EAAE,cAAc,
|
|
1
|
+
{"version":3,"file":"AsidePanel.js","sourceRoot":"","sources":["../../src/notion/AsidePanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,WAAW,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C,CAAC,aAAa,CAAC,CAAC,CAAC,YAAY,CAAC;IACxD,MAAM,UAAU,GAAG,MAAM,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC;IAErD,iHAAiH;IACjH,oGAAoG;IACpG,OAAO,CACL,iBACE,EAAE,EAAE,OAAO,eACD,aAAa,gBACX,KAAK,qBACA,SAAS,EAC1B,SAAS,EAAE,EAAE,CACX,4IAA4I,EAC5I,SAAS,CACV,aAED,4BAAe,oBAAoB,EAAC,SAAS,EAAC,yEAAyE,aACrH,aAAI,GAAG,EAAE,UAAU,EAAE,EAAE,EAAE,SAAS,EAAE,QAAQ,EAAE,CAAC,CAAC,EAAE,SAAS,EAAC,qDAAqD,YAC9G,KAAK,GACH,EACL,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAa,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE,OAAO,EAAE,GAAG,EAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,YAChJ,KAAC,SAAS,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,GACzD,IACL,EACN,2BAAe,qBAAqB,EAAC,SAAS,EAAC,gCAAgC,YAC5E,QAAQ,GACL,IACA,CACT,CAAC;AACJ,CAAC"}
|
package/dist/notion/FoldRow.d.ts
CHANGED
|
@@ -38,6 +38,11 @@ export type FoldRowProps = FoldRowSummaryProps & FoldRowDetailsProps & {
|
|
|
38
38
|
readonly size?: "default" | "touch";
|
|
39
39
|
/** More content under the table when opened. */
|
|
40
40
|
readonly children?: ReactNode;
|
|
41
|
+
/**
|
|
42
|
+
* Controls on the row's right, outside the summary, so clicking them never folds the row (a delete button, a
|
|
43
|
+
* menu). Shown whether the row is open or closed, centred on the summary's first line.
|
|
44
|
+
*/
|
|
45
|
+
readonly actions?: ReactNode;
|
|
41
46
|
};
|
|
42
47
|
export declare function FoldRow(props: FoldRowProps): import("react").JSX.Element;
|
|
43
48
|
//# 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;IACtC,2CAA2C;IAC3C,QAAQ,CAAC,MAAM,EAAE,SAAS,YAAY,EAAE,CAAC;IACzC,QAAQ,CAAC,OAAO,CAAC,EAAE,KAAK,CAAC;CAC1B,GACD;IACE,0FAA0F;IAC1F,QAAQ,CAAC,OAAO,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC;CACzB,CAAC;AAEN,mEAAmE;AACnE,MAAM,MAAM,mBAAmB,GAC3B;IACE,2CAA2C;IAC3C,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,OAAO,EAAE,SAAS,SAAS,EAAE,CAAC;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C;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,KAAK,CAAC;IACvB,QAAQ,CAAC,MAAM,CAAC,EAAE,KAAK,CAAC;CACzB,CAAC;AAEN,mEAAmE;AACnE,MAAM,MAAM,mBAAmB,GAC3B;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,+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,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B,CAAC;AA4DJ,wBAAgB,OAAO,CAAC,KAAK,EAAE,YAAY,+BAiB1C"}
|
package/dist/notion/FoldRow.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRight } from "lucide-react";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { Badge } from "../ui/badge.js";
|
|
@@ -18,7 +18,15 @@ function FoldRowChevron() {
|
|
|
18
18
|
}
|
|
19
19
|
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
20
20
|
export function FoldRow(props) {
|
|
21
|
-
const {
|
|
22
|
-
|
|
21
|
+
const { actions, size = "default" } = props;
|
|
22
|
+
if (actions === undefined || actions === null) {
|
|
23
|
+
return _jsx(FoldRowDetails, { ...props, className: "border-b border-border" });
|
|
24
|
+
}
|
|
25
|
+
// The actions sit beside the `<details>`, not in its `<summary>`: a control inside the summary would fold the row.
|
|
26
|
+
return (_jsxs("div", { "data-slot": "fold-row-with-actions", className: "flex items-start gap-1 border-b border-border", children: [_jsx(FoldRowDetails, { ...props, className: "min-w-0 flex-1" }), _jsx("div", { "data-slot": "fold-row-actions", className: cn("flex shrink-0 items-center gap-1", size === "touch" ? "min-h-touch-target" : "min-h-row-height"), children: actions })] }));
|
|
27
|
+
}
|
|
28
|
+
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"), 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] })] }));
|
|
23
31
|
}
|
|
24
32
|
//# sourceMappingURL=FoldRow.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FoldRow.js","sourceRoot":"","sources":["../../src/notion/FoldRow.tsx"],"names":[],"m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,MAAM,EAAE,OAAO,GAAG,KAAK,EAAE,IAAI,GAAG,SAAS,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IACzE,OAAO,CACL,gCAAmB,UAAU,EAAC,SAAS,EAAE,EAAE,CAAC,gBAAgB,EAAE,SAAS,CAAC,aACtE,+BACY,kBAAkB,EAC5B,SAAS,EAAE,EAAE,CACX,mRAAmR,EACnR,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,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,EACV,4BAAe,kBAAkB,gBAAa,OAAO,EAAE,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC,mBAAmB,CAAC,CAAC,CAAC,aAAa,aAC5G,KAAK,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAC,WAAW,IAAC,KAAK,EAAE,KAAK,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,CAAC,OAAO,GAAI,EACpG,QAAQ,IACL,IACE,CACX,CAAC;AACJ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Field, FieldGroup, FieldLabel } from "../ui/field.js";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
// Properties as in a Notion database page: a 160 px label with its type icon, then the value.
|
package/dist/notion/Timeline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { ChevronRight } from "lucide-react";
|
|
3
3
|
import { cn } from "../lib/utils.js";
|
|
4
4
|
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "../ui/collapsible.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../src/notion/palette.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,
|
|
1
|
+
{"version":3,"file":"palette.d.ts","sourceRoot":"","sources":["../../src/notion/palette.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,YAAI,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,KAAK,CAAU,CAAC;AAEvH,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,cAAc,CAAC,CAAC,MAAM,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tones.d.ts","sourceRoot":"","sources":["../../src/notion/tones.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,eAAO,MAAM,KAAK
|
|
1
|
+
{"version":3,"file":"tones.d.ts","sourceRoot":"","sources":["../../src/notion/tones.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAIjD,eAAO,MAAM,KAAK,YAAI,SAAS,EAAE,SAAS,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,CAAU,CAAC;AAEnF,MAAM,MAAM,IAAI,GAAG,CAAC,OAAO,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AAG1C,eAAO,MAAM,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,YAAY,GAAG,IAAI,CAAC,CAMnE,CAAC;AAKF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAMpD,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAMpD,CAAC;AAGF,eAAO,MAAM,SAAS,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,CAMpD,CAAC"}
|
package/dist/ui/alert.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const alertVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
4
|
+
variant?: "blue" | "brown" | "default" | "destructive" | "gray" | "green" | "orange" | "pink" | "purple" | "red" | "yellow" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
declare function Alert({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof alertVariants>): React.JSX.Element;
|
|
7
7
|
declare function AlertTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
package/dist/ui/badge.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const badgeVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
5
|
-
color?: "
|
|
4
|
+
variant?: "default" | "destructive" | "ghost" | "link" | "outline" | "secondary" | "tag" | null | undefined;
|
|
5
|
+
color?: "blue" | "brown" | "default" | "gray" | "green" | "none" | "orange" | "pink" | "purple" | "red" | "yellow" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Badge({ className, variant, color, asChild, ...props }: Omit<React.ComponentProps<"span">, "color"> & VariantProps<typeof badgeVariants> & {
|
|
8
8
|
asChild?: boolean;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type VariantProps } from "class-variance-authority";
|
|
2
2
|
import { Separator } from "./separator.js";
|
|
3
3
|
declare const buttonGroupVariants: (props?: ({
|
|
4
|
-
orientation?: "
|
|
4
|
+
orientation?: "horizontal" | "vertical" | null | undefined;
|
|
5
5
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
6
6
|
declare function ButtonGroup({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof buttonGroupVariants>): import("react").JSX.Element;
|
|
7
7
|
declare function ButtonGroupText({ className, asChild, ...props }: React.ComponentProps<"div"> & {
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { type VariantProps } from "class-variance-authority";
|
|
3
3
|
declare const buttonVariants: (props?: ({
|
|
4
|
-
variant?: "
|
|
5
|
-
size?: "
|
|
4
|
+
variant?: "default" | "destructive" | "floating" | "ghost" | "link" | "outline" | "secondary" | null | undefined;
|
|
5
|
+
size?: "default" | "icon" | "icon-lg" | "icon-sm" | "icon-touch" | "icon-xs" | "lg" | "sm" | "touch" | "xs" | null | undefined;
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
declare function Button({ className, variant, size, asChild, ...props }: React.ComponentProps<"button"> & VariantProps<typeof buttonVariants> & {
|
|
8
8
|
asChild?: boolean;
|
package/dist/ui/field.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ declare function FieldLegend({ className, variant, ...props }: React.ComponentPr
|
|
|
6
6
|
}): import("react").JSX.Element;
|
|
7
7
|
declare function FieldGroup({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
|
8
8
|
declare const fieldVariants: (props?: ({
|
|
9
|
-
orientation?: "
|
|
9
|
+
orientation?: "horizontal" | "responsive" | "vertical" | null | undefined;
|
|
10
10
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
11
11
|
declare function Field({ className, orientation, ...props }: React.ComponentProps<"div"> & VariantProps<typeof fieldVariants>): import("react").JSX.Element;
|
|
12
12
|
declare function FieldContent({ className, ...props }: React.ComponentProps<"div">): import("react").JSX.Element;
|
package/dist/ui/input-group.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ import { type VariantProps } from "class-variance-authority";
|
|
|
3
3
|
import { Button } from "./button.js";
|
|
4
4
|
declare function InputGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
5
|
declare const inputGroupAddonVariants: (props?: ({
|
|
6
|
-
align?: "
|
|
6
|
+
align?: "block-end" | "block-start" | "inline-end" | "inline-start" | null | undefined;
|
|
7
7
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
8
8
|
declare function InputGroupAddon({ className, align, ...props }: React.ComponentProps<"div"> & VariantProps<typeof inputGroupAddonVariants>): React.JSX.Element;
|
|
9
9
|
declare const inputGroupButtonVariants: (props?: ({
|
|
10
|
-
size?: "
|
|
10
|
+
size?: "icon-sm" | "icon-xs" | "sm" | "xs" | null | undefined;
|
|
11
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
12
|
declare function InputGroupButton({ className, type, variant, size, ...props }: Omit<React.ComponentProps<typeof Button>, "size"> & VariantProps<typeof inputGroupButtonVariants>): React.JSX.Element;
|
|
13
13
|
declare function InputGroupText({ className, ...props }: React.ComponentProps<"span">): React.JSX.Element;
|
package/dist/ui/item.d.ts
CHANGED
|
@@ -4,14 +4,14 @@ import { Separator } from "./separator.js";
|
|
|
4
4
|
declare function ItemGroup({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
5
|
declare function ItemSeparator({ className, ...props }: React.ComponentProps<typeof Separator>): React.JSX.Element;
|
|
6
6
|
declare const itemVariants: (props?: ({
|
|
7
|
-
variant?: "
|
|
8
|
-
size?: "
|
|
7
|
+
variant?: "default" | "muted" | "outline" | null | undefined;
|
|
8
|
+
size?: "default" | "sm" | null | undefined;
|
|
9
9
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
10
10
|
declare function Item({ className, variant, size, asChild, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & {
|
|
11
11
|
asChild?: boolean;
|
|
12
12
|
}): React.JSX.Element;
|
|
13
13
|
declare const itemMediaVariants: (props?: ({
|
|
14
|
-
variant?: "default" | "
|
|
14
|
+
variant?: "default" | "icon" | "image" | null | undefined;
|
|
15
15
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
16
16
|
declare function ItemMedia({ className, variant, ...props }: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>): React.JSX.Element;
|
|
17
17
|
declare function ItemContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
package/dist/ui/sidebar.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ declare function SidebarMenu({ className, ...props }: React.ComponentProps<"ul">
|
|
|
50
50
|
declare function SidebarMenuItem({ className, ...props }: React.ComponentProps<"li">): React.JSX.Element;
|
|
51
51
|
declare const sidebarMenuButtonVariants: (props?: ({
|
|
52
52
|
variant?: "default" | "outline" | null | undefined;
|
|
53
|
-
size?: "
|
|
53
|
+
size?: "default" | "lg" | "sm" | null | undefined;
|
|
54
54
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
55
55
|
declare function SidebarMenuButton({ asChild, isActive, variant, size, tooltip, className, ...props }: React.ComponentProps<"button"> & {
|
|
56
56
|
asChild?: boolean;
|
package/dist/ui/sonner.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/ui/sonner.tsx"],"names":[],"mappings":"AASA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAI7D,QAAA,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"sonner.d.ts","sourceRoot":"","sources":["../../src/ui/sonner.tsx"],"names":[],"mappings":"AASA,OAAO,EAAqB,KAAK,YAAY,EAAE,MAAM,QAAQ,CAAA;AAI7D,QAAA,MAAM,OAAO,wBAAoC,YAAY,gCAuB5D,CAAA;AAED,OAAO,EAAE,OAAO,EAAE,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.14.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",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"@softure-ai/theme-kit": "^0.1.4",
|
|
65
65
|
"class-variance-authority": "^0.7.1",
|
|
66
66
|
"cmdk": "^1.1.1",
|
|
67
|
-
"lucide-react": "^1.
|
|
67
|
+
"lucide-react": "^1.70.0",
|
|
68
68
|
"radix-ui": "^1.8.1",
|
|
69
69
|
"sonner": "^2.0.8",
|
|
70
70
|
"tw-animate-css": "^1.4.0"
|
|
@@ -78,8 +78,8 @@
|
|
|
78
78
|
"@axe-core/playwright": "^4.14.0",
|
|
79
79
|
"@fontsource/inter": "^5.3.0",
|
|
80
80
|
"@fontsource/jetbrains-mono": "^5.3.0",
|
|
81
|
-
"@playwright/test": "^1.
|
|
81
|
+
"@playwright/test": "^1.64.1",
|
|
82
82
|
"@softure-ai/ui": "^0.3.4",
|
|
83
|
-
"zod": "^4.6.
|
|
83
|
+
"zod": "^4.6.7"
|
|
84
84
|
}
|
|
85
85
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
|
|
3
3
|
import { useIsMobile } from "@softure-ai/theme-kit/react";
|
|
4
|
-
import { ChevronsLeft, ChevronsRight, PanelLeft, PanelRightClose, PanelRightOpen } from "lucide-react";
|
|
4
|
+
import { ChevronsLeft, ChevronsRight, PanelLeft, PanelRightClose, PanelRightOpen, type LucideIcon } from "lucide-react";
|
|
5
5
|
import {
|
|
6
6
|
createContext,
|
|
7
7
|
useCallback,
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
import { cn } from "../lib/utils.js";
|
|
19
19
|
import { en as messages } from "../messages/en.js";
|
|
20
20
|
import { Button } from "../ui/button.js";
|
|
21
|
-
import { Sheet, SheetContent, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
21
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle } from "../ui/sheet.js";
|
|
22
22
|
import { SidebarProvider } from "../ui/sidebar.js";
|
|
23
23
|
|
|
24
24
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
@@ -179,14 +179,18 @@ export interface AsidePanelToggleProps {
|
|
|
179
179
|
// The accessible names while closed and while open, from the app's message layer.
|
|
180
180
|
readonly showLabel?: string;
|
|
181
181
|
readonly hideLabel?: string;
|
|
182
|
+
// The icon drawn in both states, for a panel that holds one tool its users know by its icon (a map, a chat);
|
|
183
|
+
// `PanelRightOpen` and `PanelRightClose` otherwise.
|
|
184
|
+
readonly icon?: LucideIcon;
|
|
182
185
|
readonly className?: string;
|
|
183
186
|
}
|
|
184
187
|
|
|
185
188
|
/** The icon button at the top-right edge that shows and hides the panel; it stays in place either way. */
|
|
186
|
-
export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLabel = messages.asidePanel.hide, className }: AsidePanelToggleProps) {
|
|
189
|
+
export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLabel = messages.asidePanel.hide, icon, className }: AsidePanelToggleProps) {
|
|
187
190
|
const { panelId, isOpen, isHidden, toggleRef, toggle } = useAsidePanelContext("AsidePanelToggle");
|
|
188
191
|
if (isHidden) return null;
|
|
189
|
-
const Icon = isOpen ? PanelRightClose : PanelRightOpen;
|
|
192
|
+
const Icon = icon ?? (isOpen ? PanelRightClose : PanelRightOpen);
|
|
193
|
+
const label = isOpen ? hideLabel : showLabel;
|
|
190
194
|
|
|
191
195
|
return (
|
|
192
196
|
<Button
|
|
@@ -197,7 +201,8 @@ export function AsidePanelToggle({ showLabel = messages.asidePanel.show, hideLab
|
|
|
197
201
|
size="icon"
|
|
198
202
|
aria-expanded={isOpen}
|
|
199
203
|
aria-controls={panelId}
|
|
200
|
-
aria-label={
|
|
204
|
+
aria-label={label}
|
|
205
|
+
title={label}
|
|
201
206
|
className={cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] right-[calc(--spacing(2)+env(safe-area-inset-right))] z-20", className)}
|
|
202
207
|
onClick={toggle}
|
|
203
208
|
>
|
|
@@ -224,6 +229,7 @@ export function AsidePanelSidebarOpener({ label = messages.asidePanel.showSideba
|
|
|
224
229
|
variant="outline"
|
|
225
230
|
size="icon"
|
|
226
231
|
aria-label={label}
|
|
232
|
+
title={label}
|
|
227
233
|
className={cn("fixed top-[calc(--spacing(2)+env(safe-area-inset-top))] left-[calc(--spacing(2)+env(safe-area-inset-left))] z-20", className)}
|
|
228
234
|
onClick={openSidebar}
|
|
229
235
|
>
|
|
@@ -242,6 +248,8 @@ export interface AsidePanelProps {
|
|
|
242
248
|
readonly narrowLabel?: string;
|
|
243
249
|
// The phone sheet's close button text.
|
|
244
250
|
readonly closeLabel?: string;
|
|
251
|
+
// One line under the phone sheet's title, which the sheet is described by.
|
|
252
|
+
readonly description?: string;
|
|
245
253
|
readonly className?: string;
|
|
246
254
|
}
|
|
247
255
|
|
|
@@ -255,6 +263,7 @@ export function AsidePanel({
|
|
|
255
263
|
widenLabel = messages.asidePanel.widen,
|
|
256
264
|
narrowLabel = messages.asidePanel.narrow,
|
|
257
265
|
closeLabel,
|
|
266
|
+
description,
|
|
258
267
|
className,
|
|
259
268
|
}: AsidePanelProps) {
|
|
260
269
|
const { panelId, isOpen, width, isMobile, isHidden, toggleRef, isHeadingFocusRequested, close, setWidth } = useAsidePanelContext("AsidePanel");
|
|
@@ -290,7 +299,7 @@ export function AsidePanel({
|
|
|
290
299
|
id={panelId}
|
|
291
300
|
side="right"
|
|
292
301
|
data-slot="aside-panel-sheet"
|
|
293
|
-
aria-describedby
|
|
302
|
+
{...(description === undefined ? { "aria-describedby": undefined } : {})}
|
|
294
303
|
closeLabel={closeLabel}
|
|
295
304
|
className={cn("w-full gap-0 sm:max-w-none", className)}
|
|
296
305
|
onOpenAutoFocus={(event) => {
|
|
@@ -306,6 +315,7 @@ export function AsidePanel({
|
|
|
306
315
|
<SheetTitle ref={headingRef} tabIndex={-1} className="outline-none">
|
|
307
316
|
{title}
|
|
308
317
|
</SheetTitle>
|
|
318
|
+
{description === undefined ? null : <SheetDescription>{description}</SheetDescription>}
|
|
309
319
|
</SheetHeader>
|
|
310
320
|
<div data-slot="aside-panel-content" className="min-h-0 flex-1 overflow-y-auto">
|
|
311
321
|
{isOpen ? children : null}
|
|
@@ -318,7 +328,10 @@ export function AsidePanel({
|
|
|
318
328
|
if (!isOpen) return null;
|
|
319
329
|
const isHalf = width === "half";
|
|
320
330
|
const WidthIcon = isHalf ? ChevronsRight : ChevronsLeft;
|
|
331
|
+
const widthLabel = isHalf ? narrowLabel : widenLabel;
|
|
321
332
|
|
|
333
|
+
// A phone gets this branch in the server HTML (`useIsMobile` is false there) until hydration swaps in the sheet:
|
|
334
|
+
// `max-md:hidden` keeps it from painting. The `md` breakpoint equals the theme's mobile breakpoint.
|
|
322
335
|
return (
|
|
323
336
|
<aside
|
|
324
337
|
id={panelId}
|
|
@@ -326,7 +339,7 @@ export function AsidePanel({
|
|
|
326
339
|
data-width={width}
|
|
327
340
|
aria-labelledby={headingId}
|
|
328
341
|
className={cn(
|
|
329
|
-
"sticky top-0 flex h-dvh w-2/5 shrink-0 flex-col border-l border-border bg-background text-foreground data-[width=half]:w-1/2",
|
|
342
|
+
"sticky top-0 flex h-dvh max-md:hidden w-2/5 shrink-0 flex-col border-l border-border bg-background text-foreground data-[width=half]:w-1/2",
|
|
330
343
|
className,
|
|
331
344
|
)}
|
|
332
345
|
>
|
|
@@ -334,7 +347,7 @@ export function AsidePanel({
|
|
|
334
347
|
<h2 ref={headingRef} id={headingId} tabIndex={-1} className="min-w-0 flex-1 truncate text-heading-3 outline-none">
|
|
335
348
|
{title}
|
|
336
349
|
</h2>
|
|
337
|
-
<Button type="button" variant="ghost" size="icon" aria-label={
|
|
350
|
+
<Button type="button" variant="ghost" size="icon" aria-label={widthLabel} title={widthLabel} onClick={() => setWidth(isHalf ? "standard" : "half")}>
|
|
338
351
|
<WidthIcon aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
339
352
|
</Button>
|
|
340
353
|
</div>
|
package/src/notion/FoldRow.tsx
CHANGED
|
@@ -53,6 +53,11 @@ export type FoldRowProps = FoldRowSummaryProps &
|
|
|
53
53
|
readonly size?: "default" | "touch";
|
|
54
54
|
/** More content under the table when opened. */
|
|
55
55
|
readonly children?: ReactNode;
|
|
56
|
+
/**
|
|
57
|
+
* Controls on the row's right, outside the summary, so clicking them never folds the row (a delete button, a
|
|
58
|
+
* menu). Shown whether the row is open or closed, centred on the summary's first line.
|
|
59
|
+
*/
|
|
60
|
+
readonly actions?: ReactNode;
|
|
56
61
|
};
|
|
57
62
|
|
|
58
63
|
const CONTENT_CLASS = "flex flex-col gap-2 p-3 empty:hidden";
|
|
@@ -114,9 +119,28 @@ function FoldRowChevron() {
|
|
|
114
119
|
|
|
115
120
|
// An item as one folding list row: a native `<details>` that opens in place to its details, with no client state.
|
|
116
121
|
export function FoldRow(props: FoldRowProps) {
|
|
117
|
-
const {
|
|
122
|
+
const { actions, size = "default" } = props;
|
|
123
|
+
if (actions === undefined || actions === null) {
|
|
124
|
+
return <FoldRowDetails {...props} className="border-b border-border" />;
|
|
125
|
+
}
|
|
126
|
+
// The actions sit beside the `<details>`, not in its `<summary>`: a control inside the summary would fold the row.
|
|
118
127
|
return (
|
|
119
|
-
<
|
|
128
|
+
<div data-slot="fold-row-with-actions" className="flex items-start gap-1 border-b border-border">
|
|
129
|
+
<FoldRowDetails {...props} className="min-w-0 flex-1" />
|
|
130
|
+
<div
|
|
131
|
+
data-slot="fold-row-actions"
|
|
132
|
+
className={cn("flex shrink-0 items-center gap-1", size === "touch" ? "min-h-touch-target" : "min-h-row-height")}
|
|
133
|
+
>
|
|
134
|
+
{actions}
|
|
135
|
+
</div>
|
|
136
|
+
</div>
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function FoldRowDetails(props: FoldRowProps & { readonly className: string }) {
|
|
141
|
+
const { isInset = false, size = "default", children, className } = props;
|
|
142
|
+
return (
|
|
143
|
+
<details data-slot="fold-row" className={cn("group/fold-row", className)}>
|
|
120
144
|
<summary
|
|
121
145
|
data-slot="fold-row-summary"
|
|
122
146
|
className={cn(
|