@softure-ai/theme-notion 0.21.1 → 0.23.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 +26 -0
- package/README.md +44 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/notion/List.d.ts +44 -0
- package/dist/notion/List.d.ts.map +1 -0
- package/dist/notion/List.js +36 -0
- package/dist/notion/List.js.map +1 -0
- package/dist/notion/ResizeHandle.d.ts +12 -2
- package/dist/notion/ResizeHandle.d.ts.map +1 -1
- package/dist/notion/ResizeHandle.js +36 -6
- package/dist/notion/ResizeHandle.js.map +1 -1
- package/dist/notion/SidePanel.d.ts.map +1 -1
- package/dist/notion/SidePanel.js +2 -1
- package/dist/notion/SidePanel.js.map +1 -1
- package/dist/notion/side-panel-width.d.ts +7 -0
- package/dist/notion/side-panel-width.d.ts.map +1 -0
- package/dist/notion/side-panel-width.js +7 -0
- package/dist/notion/side-panel-width.js.map +1 -0
- package/dist/page.css +10 -0
- package/dist/theme.css +12 -0
- package/package.json +2 -2
- package/src/index.ts +11 -0
- package/src/notion/List.tsx +70 -0
- package/src/notion/ResizeHandle.tsx +44 -6
- package/src/notion/SidePanel.tsx +2 -1
- package/src/notion/side-panel-width.ts +6 -0
- package/src/page.css +10 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,32 @@ 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.23.0
|
|
8
|
+
|
|
9
|
+
- List density (#1341): `List`, `ListItem` and `ListRow`, a list of rows that is `compact` (tight rows, no line
|
|
10
|
+
between them, the default) or `roomy` (a quiet `border` line between rows and one more 4 px step around each), by
|
|
11
|
+
`data-density` on `<html>`, a page or a section, or `density` on the list. They read theme-kit 0.1.10's
|
|
12
|
+
`--list-row-y`, `--list-item-y`, `--list-divider-width`. `List surface="tinted"` draws the line in the page's
|
|
13
|
+
`background` on a grey card, where the dark scheme's `border` is the card's own grey. `ListItem asChild` and
|
|
14
|
+
`ListRow asChild` keep the app's element; `LIST_CLASSES` gives the same classes to a list the app renders itself (a
|
|
15
|
+
`SortableList`).
|
|
16
|
+
- Migration: none; no existing component changes. An app with its own roomy list classes (`divide-y divide-border` on
|
|
17
|
+
the list, `py-1` on each item, `py-2` on each row) can move to `List` and set `data-density="roomy"`.
|
|
18
|
+
|
|
19
|
+
## 0.22.0
|
|
20
|
+
|
|
21
|
+
- Smooth resize drags over a large `SidePanel` (#1326):
|
|
22
|
+
- `page.css` registers `--side-panel-width` with `@property … inherits: false`. A change of the panel's width no
|
|
23
|
+
longer restyles every element inside it: an adopting app measured ~1.3 s of style recalculation per 40-step drag
|
|
24
|
+
over ~460 rows before, ~30 ms after. The layout is unchanged.
|
|
25
|
+
- `ResizeHandle liveVariable` (optional): during a drag the handle writes the width to that CSS variable on the
|
|
26
|
+
`controls` element and to its own `aria-valuenow`, and calls `onChange` and `onCommit` once, on release. The
|
|
27
|
+
screen no longer re-renders on every pointer move. Keys and a double click are unchanged; without the prop the
|
|
28
|
+
handle behaves as before.
|
|
29
|
+
- `SIDE_PANEL_WIDTH_VARIABLE` (`"--side-panel-width"`) names the panel's variable for `liveVariable`.
|
|
30
|
+
- Migration: none required. An app that writes the variable on the panel itself during a drag and keeps the width in
|
|
31
|
+
`onCommit` can drop that code and pass `liveVariable={SIDE_PANEL_WIDTH_VARIABLE}`.
|
|
32
|
+
|
|
7
33
|
## 0.21.1
|
|
8
34
|
|
|
9
35
|
- Modal surfaces on `popover` (#1310): `DialogContent`, `AlertDialogContent` and `SheetContent` (so `CommandDialog`
|
package/README.md
CHANGED
|
@@ -145,6 +145,7 @@ and count, the shown tab in the address; `Tabs` keeps it in client state), `Mark
|
|
|
145
145
|
list of what it counts, below), `FilterChip` and `FilterChipAdd` (a list's filter pills, below), `Steps` (numbered
|
|
146
146
|
stages with a state, below), `Timeline` (dated entries on a vertical rail, below), `Code` (inline code) and `CodeBlock` (a mono block for logs and paths, below),
|
|
147
147
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below),
|
|
148
|
+
`List`, `ListItem` and `ListRow` (a list of rows, compact or roomy by the page's density, below),
|
|
148
149
|
`MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
|
|
149
150
|
`UpdatePrompt` (the offer to reload into a new build, for an installed app, below),
|
|
150
151
|
`InstallBar` (the offer to install the app on a phone, below),
|
|
@@ -246,7 +247,9 @@ action that belongs to the panel's foot; without it the panel has no strip.
|
|
|
246
247
|
```
|
|
247
248
|
|
|
248
249
|
`SidePanel width` (pixels, optional) sets its width on a wide screen; phone-wide `beside` and `list` keep covering the
|
|
249
|
-
canvas.
|
|
250
|
+
canvas. The width lives in the CSS variable `SIDE_PANEL_WIDTH_VARIABLE` (`--side-panel-width`) on the panel itself;
|
|
251
|
+
`page.css` registers it with `@property … inherits: false`, so a change restyles the panel alone, not every row inside
|
|
252
|
+
it (a panel of a few hundred rows went from ~1.3 s to ~30 ms of style work per drag, #1326).
|
|
250
253
|
|
|
251
254
|
**`ResizeHandle`.** A vertical handle on the right edge of a column (a list, a `SidePanel layout="list"`) that sets the
|
|
252
255
|
column's width: a pointer drags it, the arrow keys step it by `RESIZE_HANDLE_STEP` (16 px, Shift four times that), Home
|
|
@@ -265,6 +268,18 @@ max, fallback)` (a plain module, callable in a Server Component) reads a kept wi
|
|
|
265
268
|
</div>
|
|
266
269
|
```
|
|
267
270
|
|
|
271
|
+
A drag calls `onChange` on every pointer move, so a width kept in React state re-renders its whole screen per move.
|
|
272
|
+
`liveVariable` avoids that: during a drag the handle writes the width straight to that CSS variable on the `controls`
|
|
273
|
+
element and to its own `aria-valuenow`, then calls `onChange` and `onCommit` once, on release, with the final width
|
|
274
|
+
(nothing for a drag that ends where it started). Keys and a double click still call both at once. On release the
|
|
275
|
+
handle puts the variable back to its rendered value before `onChange`, so the next render owns the width again; a
|
|
276
|
+
missing `controls` element falls back to `onChange` per move. For a `SidePanel`:
|
|
277
|
+
|
|
278
|
+
```tsx
|
|
279
|
+
<ResizeHandle label={copy.resizeDays} controls="days" value={width} min={240} max={480} defaultValue={384}
|
|
280
|
+
liveVariable={SIDE_PANEL_WIDTH_VARIABLE} onChange={setWidth} onCommit={keepWidth} />
|
|
281
|
+
```
|
|
282
|
+
|
|
268
283
|
**`AsidePanel`.** A column of the app shell that slides in from the right, beside `SidebarInset`: the content
|
|
269
284
|
narrows next to it and stays usable (`SidePanel` is a panel over a canvas instead). `AsidePanelProvider` replaces
|
|
270
285
|
`SidebarProvider` (every other prop passes through) and keeps one side panel open at a time: while the panel is open
|
|
@@ -443,6 +458,34 @@ and the body's parts mark the parts.
|
|
|
443
458
|
/>
|
|
444
459
|
```
|
|
445
460
|
|
|
461
|
+
**`List`, `ListItem`, `ListRow`: list density.** A list of rows (days, places, a bag of items) that is `compact`
|
|
462
|
+
(tight rows, no line between them, the default) or `roomy` (a quiet `border` line between rows and one more 4 px step
|
|
463
|
+
around each, so the rows breathe). The density comes from `data-density` on the nearest ancestor (`<html>` for a user
|
|
464
|
+
setting, a page, a section) or `density` on the list itself; the lengths are theme-kit's `--list-row-y`,
|
|
465
|
+
`--list-item-y` and `--list-divider-width` (theme-kit README, "List density"). The line is drawn between rows only, so
|
|
466
|
+
a list of one has none; `ListItem` keeps the row away from the lines, so a row's rounded hover never touches them. On a
|
|
467
|
+
grey card (`secondary`, `muted`) pass `surface="tinted"`: the line takes the page's `background`, because in the dark
|
|
468
|
+
scheme the theme's `border` is that card's own grey.
|
|
469
|
+
|
|
470
|
+
```tsx
|
|
471
|
+
<html data-density="roomy">
|
|
472
|
+
…
|
|
473
|
+
<List as="ol" aria-label="Days">
|
|
474
|
+
{days.map((day) => (
|
|
475
|
+
<ListItem key={day.id}>
|
|
476
|
+
<ListRow asChild>
|
|
477
|
+
<button type="button" onClick={() => open(day.id)}>{day.label}</button>
|
|
478
|
+
</ListRow>
|
|
479
|
+
</ListItem>
|
|
480
|
+
))}
|
|
481
|
+
</List>
|
|
482
|
+
<List surface="tinted" density="compact">…</List> {/* this one stays compact on a roomy page */}
|
|
483
|
+
```
|
|
484
|
+
|
|
485
|
+
`ListItem asChild` and `ListRow asChild` keep the app's own element (a sortable item, a link). For a list the app
|
|
486
|
+
renders with other components, `LIST_CLASSES` holds the same classes (`list`, `tintedList`, `item`, `row`), e.g.
|
|
487
|
+
`<SortableList className={LIST_CLASSES.list}>` with `<SortableItem className={LIST_CLASSES.item}>`.
|
|
488
|
+
|
|
446
489
|
**`MiniProgress`.** A share with its figure inside the bar, for a table cell or a tile where a figure next to a
|
|
447
490
|
`Progress` would collide with it: a 20 px rounded track (`primary/12`) that takes the cell's width (at least 64 px),
|
|
448
491
|
filled in `primary` (the link blue in dark, as in `Progress`) or in its `tone`'s colour. `value` is 0–100, clamped
|
package/dist/index.d.ts
CHANGED
|
@@ -49,6 +49,7 @@ export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProp
|
|
|
49
49
|
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
50
50
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
51
51
|
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
52
|
+
export { LIST_CLASSES, List, ListItem, ListRow, type ListItemProps, type ListProps, type ListRowProps, type ListSurface, } from "./notion/List.js";
|
|
52
53
|
export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
|
|
53
54
|
export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
54
55
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
@@ -60,6 +61,7 @@ export { ResizeHandle, type ResizeHandleProps } from "./notion/ResizeHandle.js";
|
|
|
60
61
|
export { RouteLoading, type RouteLoadingProps } from "./notion/RouteLoading.js";
|
|
61
62
|
export { SheetMenu, SheetMenuButton, SheetMenuItem, type SheetMenuButtonProps } from "./notion/SheetMenu.js";
|
|
62
63
|
export { SidePanel, type SidePanelLayout, type SidePanelProps } from "./notion/SidePanel.js";
|
|
64
|
+
export { SIDE_PANEL_WIDTH_VARIABLE } from "./notion/side-panel-width.js";
|
|
63
65
|
export { SortableActivator, SortableHandle, SortableItem, SortableList, type SortableActivatorProps, type SortableAnnouncements, type SortableDragBy, type SortableHandleProps, type SortableItemProps, type SortableListProps, type SortableMove, } from "./notion/Sortable.js";
|
|
64
66
|
export { StatCards, StatPills, StatsFold, type StatCard, type StatCardAside, type StatCardsProps, type StatPill, type StatPillsProps, type StatsFoldProps, } from "./notion/Stats.js";
|
|
65
67
|
export { FileInput, type FileInputMessages, type FileInputMessagesOverride, type FileInputProps } from "./notion/FileInput.js";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -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,MAAM,qBAAqB,CAAC;AAE1E,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AA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AAO,EAAE,aAAa,EAAE,KAAK,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,eAAe,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
|
@@ -51,6 +51,7 @@ export { FilterChip, FilterChipAdd } from "./notion/FilterChip.js";
|
|
|
51
51
|
export { FoldRow } from "./notion/FoldRow.js";
|
|
52
52
|
export { InstallBar } from "./notion/InstallBar.js";
|
|
53
53
|
export { LaunchScreen } from "./notion/LaunchScreen.js";
|
|
54
|
+
export { LIST_CLASSES, List, ListItem, ListRow, } from "./notion/List.js";
|
|
54
55
|
export { PALETTE_COLORS } from "./notion/palette.js";
|
|
55
56
|
export { MarkPopover } from "./notion/MarkPopover.js";
|
|
56
57
|
export { MiniProgress } from "./notion/MiniProgress.js";
|
|
@@ -62,6 +63,7 @@ export { ResizeHandle } from "./notion/ResizeHandle.js";
|
|
|
62
63
|
export { RouteLoading } from "./notion/RouteLoading.js";
|
|
63
64
|
export { SheetMenu, SheetMenuButton, SheetMenuItem } from "./notion/SheetMenu.js";
|
|
64
65
|
export { SidePanel } from "./notion/SidePanel.js";
|
|
66
|
+
export { SIDE_PANEL_WIDTH_VARIABLE } from "./notion/side-panel-width.js";
|
|
65
67
|
export { SortableActivator, SortableHandle, SortableItem, SortableList, } from "./notion/Sortable.js";
|
|
66
68
|
export { StatCards, StatPills, StatsFold, } from "./notion/Stats.js";
|
|
67
69
|
export { FileInput } from "./notion/FileInput.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,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAClD,OAAO,EAAE,EAAE,EAAE,MAAM,gBAAgB,CAAC;AACpC,OAAO,EAAE,cAAc,EAAuB,MAAM,qBAAqB,CAAC;AAE1E,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,sBAAsB,CAAC;AACrC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,eAAe,CAAC;AAC9B,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,qBAAqB,CAAC;AACpC,cA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QX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Density } from "@softure-ai/theme-kit";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
/**
|
|
4
|
+
* The classes of a list that follows the density (`data-density` on the list or an ancestor; theme-kit's
|
|
5
|
+
* `--list-*` variables). For a list the app renders itself, such as a `SortableList` and its `SortableItem`s.
|
|
6
|
+
* - `list`: the line between rows only, in the theme's `border`, as wide as the density says (none when compact).
|
|
7
|
+
* - `tintedList`: the same on a tinted card (`secondary`, `muted`), where the line takes the page's `background`: in the
|
|
8
|
+
* dark scheme `border` is the card's own grey.
|
|
9
|
+
* - `item`: the room between a row and the lines around it, so a row's rounded hover never touches a line.
|
|
10
|
+
* - `row`: a row's padding and hover, for a button or link that fills its item.
|
|
11
|
+
*/
|
|
12
|
+
export declare const LIST_CLASSES: {
|
|
13
|
+
readonly list: "flex flex-col divide-y-(length:--list-divider-width) divide-border";
|
|
14
|
+
readonly tintedList: "flex flex-col divide-y-(length:--list-divider-width) divide-background";
|
|
15
|
+
readonly item: "py-(--list-item-y)";
|
|
16
|
+
readonly row: "flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-(--list-row-y) text-start text-ui outline-none transition-colors duration-100 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50";
|
|
17
|
+
};
|
|
18
|
+
export type ListSurface = "page" | "tinted";
|
|
19
|
+
export type ListProps = Omit<ComponentProps<"ul">, "ref"> & {
|
|
20
|
+
/** The list element: `ol` for a numbered list. */
|
|
21
|
+
readonly as?: "ul" | "ol";
|
|
22
|
+
/** `tinted` on a grey card: the line between rows takes the page's `background`. */
|
|
23
|
+
readonly surface?: ListSurface;
|
|
24
|
+
/** Sets the density on this list (its `data-density`); without it the list follows the nearest ancestor's. */
|
|
25
|
+
readonly density?: Density;
|
|
26
|
+
};
|
|
27
|
+
/**
|
|
28
|
+
* A list of rows that follows the density: compact (tight rows, no line, the default) or roomy (a quiet line between
|
|
29
|
+
* rows, more room around each), set with `data-density` on `<html>`, a page, a section, or with `density` here.
|
|
30
|
+
*/
|
|
31
|
+
export declare function List({ as: Element, surface, density, className, ...props }: ListProps): import("react").JSX.Element;
|
|
32
|
+
export type ListItemProps = ComponentProps<"li"> & {
|
|
33
|
+
/** Renders the child element (a sortable item, an app's own `li`) with the item's classes. */
|
|
34
|
+
readonly asChild?: boolean;
|
|
35
|
+
};
|
|
36
|
+
/** One entry of a `List`: the room between its row and the lines around it. */
|
|
37
|
+
export declare function ListItem({ asChild, className, ...props }: ListItemProps): import("react").JSX.Element;
|
|
38
|
+
export type ListRowProps = ComponentProps<"div"> & {
|
|
39
|
+
/** Renders the child element (a `button`, a link) as the row, keeping its own element and role. */
|
|
40
|
+
readonly asChild?: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** A row in a `ListItem`: full width, the density's vertical padding, the theme's hover. */
|
|
43
|
+
export declare function ListRow({ asChild, className, ...props }: ListRowProps): import("react").JSX.Element;
|
|
44
|
+
//# sourceMappingURL=List.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/notion/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAErD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C;;;;;;;;GAQG;AACH,eAAO,MAAM,YAAY;aACvB,IAAI,EAAE,oEAAoE;aAC1E,UAAU,EAAE,wEAAwE;aACpF,IAAI,EAAE,oBAAoB;aAC1B,GAAG,EAAE,uPAAuP;CACpP,CAAC;AAEX,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,QAAQ,CAAC;AAE5C,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,EAAE,KAAK,CAAC,GAAG;IAC1D,kDAAkD;IAClD,QAAQ,CAAC,EAAE,CAAC,EAAE,IAAI,GAAG,IAAI,CAAC;IAC1B,oFAAoF;IACpF,QAAQ,CAAC,OAAO,CAAC,EAAE,WAAW,CAAC;IAC/B,8GAA8G;IAC9G,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,IAAI,CAAC,EAAE,EAAE,EAAE,OAAc,EAAE,OAAgB,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,SAAS,+BAUrG;AAED,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC,IAAI,CAAC,GAAG;IACjD,8FAA8F;IAC9F,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,+EAA+E;AAC/E,wBAAgB,QAAQ,CAAC,EAAE,OAAe,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,+BAG/E;AAED,MAAM,MAAM,YAAY,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IACjD,mGAAmG;IACnG,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF,4FAA4F;AAC5F,wBAAgB,OAAO,CAAC,EAAE,OAAe,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,+BAG7E"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* The classes of a list that follows the density (`data-density` on the list or an ancestor; theme-kit's
|
|
6
|
+
* `--list-*` variables). For a list the app renders itself, such as a `SortableList` and its `SortableItem`s.
|
|
7
|
+
* - `list`: the line between rows only, in the theme's `border`, as wide as the density says (none when compact).
|
|
8
|
+
* - `tintedList`: the same on a tinted card (`secondary`, `muted`), where the line takes the page's `background`: in the
|
|
9
|
+
* dark scheme `border` is the card's own grey.
|
|
10
|
+
* - `item`: the room between a row and the lines around it, so a row's rounded hover never touches a line.
|
|
11
|
+
* - `row`: a row's padding and hover, for a button or link that fills its item.
|
|
12
|
+
*/
|
|
13
|
+
export const LIST_CLASSES = {
|
|
14
|
+
list: "flex flex-col divide-y-(length:--list-divider-width) divide-border",
|
|
15
|
+
tintedList: "flex flex-col divide-y-(length:--list-divider-width) divide-background",
|
|
16
|
+
item: "py-(--list-item-y)",
|
|
17
|
+
row: "flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-(--list-row-y) text-start text-ui outline-none transition-colors duration-100 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A list of rows that follows the density: compact (tight rows, no line, the default) or roomy (a quiet line between
|
|
21
|
+
* rows, more room around each), set with `data-density` on `<html>`, a page, a section, or with `density` here.
|
|
22
|
+
*/
|
|
23
|
+
export function List({ as: Element = "ul", surface = "page", density, className, ...props }) {
|
|
24
|
+
return (_jsx(Element, { "data-slot": "list", "data-surface": surface, "data-density": density, className: cn(surface === "tinted" ? LIST_CLASSES.tintedList : LIST_CLASSES.list, className), ...props }));
|
|
25
|
+
}
|
|
26
|
+
/** One entry of a `List`: the room between its row and the lines around it. */
|
|
27
|
+
export function ListItem({ asChild = false, className, ...props }) {
|
|
28
|
+
const Comp = asChild ? Slot.Root : "li";
|
|
29
|
+
return _jsx(Comp, { "data-slot": "list-item", className: cn(LIST_CLASSES.item, className), ...props });
|
|
30
|
+
}
|
|
31
|
+
/** A row in a `ListItem`: full width, the density's vertical padding, the theme's hover. */
|
|
32
|
+
export function ListRow({ asChild = false, className, ...props }) {
|
|
33
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
34
|
+
return _jsx(Comp, { "data-slot": "list-row", className: cn(LIST_CLASSES.row, className), ...props });
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=List.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../src/notion/List.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC;;;;;;;;GAQG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,oEAAoE;IAC1E,UAAU,EAAE,wEAAwE;IACpF,IAAI,EAAE,oBAAoB;IAC1B,GAAG,EAAE,uPAAuP;CACpP,CAAC;AAaX;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,EAAE,EAAE,EAAE,OAAO,GAAG,IAAI,EAAE,OAAO,GAAG,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,KAAK,EAAa;IACpG,OAAO,CACL,KAAC,OAAO,iBACI,MAAM,kBACF,OAAO,kBACP,OAAO,EACrB,SAAS,EAAE,EAAE,CAAC,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,YAAY,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,KACxF,KAAK,GACT,CACH,CAAC;AACJ,CAAC;AAOD,+EAA+E;AAC/E,MAAM,UAAU,QAAQ,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAiB;IAC9E,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;IACxC,OAAO,KAAC,IAAI,iBAAW,WAAW,EAAC,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,IAAI,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAChG,CAAC;AAOD,4FAA4F;AAC5F,MAAM,UAAU,OAAO,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAgB;IAC5E,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACzC,OAAO,KAAC,IAAI,iBAAW,UAAU,EAAC,SAAS,EAAE,EAAE,CAAC,YAAY,CAAC,GAAG,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AAC9F,CAAC"}
|
|
@@ -9,10 +9,20 @@ export interface ResizeHandleProps {
|
|
|
9
9
|
readonly max: number;
|
|
10
10
|
/** The width a double click restores. */
|
|
11
11
|
readonly defaultValue: number;
|
|
12
|
-
/**
|
|
12
|
+
/**
|
|
13
|
+
* Every new width, during a drag and on each key. With `liveVariable` a drag calls it once, on release, with the
|
|
14
|
+
* final width.
|
|
15
|
+
*/
|
|
13
16
|
readonly onChange: (value: number) => void;
|
|
14
17
|
/** The width once a drag, a key or the reset ends: the moment to keep it. */
|
|
15
18
|
readonly onCommit?: (value: number) => void;
|
|
19
|
+
/**
|
|
20
|
+
* A CSS variable on the `controls` element that a drag writes straight to the DOM (in pixels), with the handle's own
|
|
21
|
+
* `aria-valuenow`, instead of calling `onChange` on every pointer move: the screen does not re-render while the
|
|
22
|
+
* pointer moves. `SIDE_PANEL_WIDTH_VARIABLE` for a `SidePanel width`. Without the element, every move calls
|
|
23
|
+
* `onChange` as without this prop.
|
|
24
|
+
*/
|
|
25
|
+
readonly liveVariable?: `--${string}`;
|
|
16
26
|
readonly className?: string;
|
|
17
27
|
}
|
|
18
28
|
/**
|
|
@@ -21,5 +31,5 @@ export interface ResizeHandleProps {
|
|
|
21
31
|
* hovered, focused or dragged. Arrow keys step the width (Shift: four steps), Home and End go to the limits, a double
|
|
22
32
|
* click restores the default. Hidden phone-wide, where the columns stack.
|
|
23
33
|
*/
|
|
24
|
-
export declare function ResizeHandle({ label, controls, value, min, max, defaultValue, onChange, onCommit, className }: ResizeHandleProps): import("react").JSX.Element;
|
|
34
|
+
export declare function ResizeHandle({ label, controls, value, min, max, defaultValue, onChange, onCommit, liveVariable, className }: ResizeHandleProps): import("react").JSX.Element;
|
|
25
35
|
//# sourceMappingURL=ResizeHandle.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../src/notion/ResizeHandle.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,iBAAiB;IAChC,kGAAkG;IAClG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B
|
|
1
|
+
{"version":3,"file":"ResizeHandle.d.ts","sourceRoot":"","sources":["../../src/notion/ResizeHandle.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,iBAAiB;IAChC,kGAAkG;IAClG,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,+CAA+C;IAC/C,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iDAAiD;IACjD,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,yCAAyC;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B;;;OAGG;IACH,QAAQ,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC3C,6EAA6E;IAC7E,QAAQ,CAAC,QAAQ,CAAC,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IAC5C;;;;;OAKG;IACH,QAAQ,CAAC,YAAY,CAAC,EAAE,KAAK,MAAM,EAAE,CAAC;IACtC,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AAUD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,YAAY,EAAE,QAAQ,EAAE,QAAQ,EAAE,YAAY,EAAE,SAAS,EAAE,EAAE,iBAAiB,+BA4G9I"}
|
|
@@ -10,11 +10,13 @@ const LARGE_STEP_FACTOR = 4;
|
|
|
10
10
|
* hovered, focused or dragged. Arrow keys step the width (Shift: four steps), Home and End go to the limits, a double
|
|
11
11
|
* click restores the default. Hidden phone-wide, where the columns stack.
|
|
12
12
|
*/
|
|
13
|
-
export function ResizeHandle({ label, controls, value, min, max, defaultValue, onChange, onCommit, className }) {
|
|
13
|
+
export function ResizeHandle({ label, controls, value, min, max, defaultValue, onChange, onCommit, liveVariable, className }) {
|
|
14
14
|
const dragRef = useRef(null);
|
|
15
15
|
const lastRef = useRef(value);
|
|
16
16
|
const [isDragging, setIsDragging] = useState(false);
|
|
17
|
-
|
|
17
|
+
// During a live drag the handle owns the width; a render in between (the dragging flag) must not reset it.
|
|
18
|
+
if (dragRef.current === null || dragRef.current.live === null)
|
|
19
|
+
lastRef.current = value;
|
|
18
20
|
function change(next) {
|
|
19
21
|
const clamped = clampSize(next, min, max, defaultValue);
|
|
20
22
|
if (clamped !== lastRef.current) {
|
|
@@ -23,19 +25,37 @@ export function ResizeHandle({ label, controls, value, min, max, defaultValue, o
|
|
|
23
25
|
}
|
|
24
26
|
return clamped;
|
|
25
27
|
}
|
|
28
|
+
function findLiveColumn(handle) {
|
|
29
|
+
if (liveVariable === undefined)
|
|
30
|
+
return null;
|
|
31
|
+
const column = handle.ownerDocument.getElementById(controls);
|
|
32
|
+
if (column === null)
|
|
33
|
+
return null;
|
|
34
|
+
return { column, variable: liveVariable, before: column.style.getPropertyValue(liveVariable) };
|
|
35
|
+
}
|
|
26
36
|
function startDrag(event) {
|
|
27
37
|
if (event.button !== 0)
|
|
28
38
|
return;
|
|
29
39
|
event.preventDefault();
|
|
30
40
|
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
31
|
-
dragRef.current = { pointerId: event.pointerId, startX: event.clientX, startValue: value };
|
|
41
|
+
dragRef.current = { pointerId: event.pointerId, startX: event.clientX, startValue: value, live: findLiveColumn(event.currentTarget) };
|
|
32
42
|
setIsDragging(true);
|
|
33
43
|
}
|
|
34
44
|
function moveDrag(event) {
|
|
35
45
|
const drag = dragRef.current;
|
|
36
46
|
if (drag === null || drag.pointerId !== event.pointerId)
|
|
37
47
|
return;
|
|
38
|
-
|
|
48
|
+
const next = drag.startValue + event.clientX - drag.startX;
|
|
49
|
+
if (drag.live === null) {
|
|
50
|
+
change(next);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
const clamped = clampSize(next, min, max, defaultValue);
|
|
54
|
+
if (clamped === lastRef.current)
|
|
55
|
+
return;
|
|
56
|
+
lastRef.current = clamped;
|
|
57
|
+
drag.live.column.style.setProperty(drag.live.variable, `${clamped}px`);
|
|
58
|
+
event.currentTarget.setAttribute("aria-valuenow", String(clamped));
|
|
39
59
|
}
|
|
40
60
|
function endDrag(event) {
|
|
41
61
|
const drag = dragRef.current;
|
|
@@ -44,8 +64,18 @@ export function ResizeHandle({ label, controls, value, min, max, defaultValue, o
|
|
|
44
64
|
dragRef.current = null;
|
|
45
65
|
setIsDragging(false);
|
|
46
66
|
event.currentTarget.releasePointerCapture?.(event.pointerId);
|
|
47
|
-
|
|
48
|
-
|
|
67
|
+
const final = lastRef.current;
|
|
68
|
+
if (drag.live !== null) {
|
|
69
|
+
// Back to what React rendered, so the parent's next render owns the width (and a parent that keeps the old
|
|
70
|
+
// width is not left with the dragged one).
|
|
71
|
+
drag.live.column.style.setProperty(drag.live.variable, drag.live.before);
|
|
72
|
+
event.currentTarget.setAttribute("aria-valuenow", String(drag.startValue));
|
|
73
|
+
lastRef.current = drag.startValue;
|
|
74
|
+
if (final !== drag.startValue)
|
|
75
|
+
change(final);
|
|
76
|
+
}
|
|
77
|
+
if (final !== drag.startValue)
|
|
78
|
+
onCommit?.(final);
|
|
49
79
|
}
|
|
50
80
|
function stepByKey(event) {
|
|
51
81
|
const step = event.shiftKey ? RESIZE_HANDLE_STEP * LARGE_STEP_FACTOR : RESIZE_HANDLE_STEP;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ResizeHandle.js","sourceRoot":"","sources":["../../src/notion/ResizeHandle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAyC,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,iBAAiB,GAAG,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ResizeHandle.js","sourceRoot":"","sources":["../../src/notion/ResizeHandle.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAyC,MAAM,OAAO,CAAC;AAEhF,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,MAAM,iBAAiB,GAAG,CAAC,CAAC;AAsC5B;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,EAAE,YAA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AC,cAAc,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,KAAK,CAAC;QACrB,MAAM,IAAI,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC;QAC5B,IAAI,IAAI,KAAK,MAAM;YAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,SAAS,cAAc;QACrB,MAAM,MAAM,GAAG,KAAK,CAAC;QACrB,MAAM,IAAI,GAAG,MAAM,CAAC,YAAY,CAAC,CAAC;QAClC,IAAI,IAAI,KAAK,MAAM;YAAE,QAAQ,EAAE,CAAC,IAAI,CAAC,CAAC;IACxC,CAAC;IAED,OAAO,CACL,cACE,IAAI,EAAC,WAAW,sBACC,UAAU,gBACf,KAAK,mBACF,QAAQ,mBACR,KAAK,mBACL,GAAG,mBACH,GAAG,EAClB,QAAQ,EAAE,CAAC,EACX,KAAK,EAAE,KAAK,eACF,eAAe,mBACV,UAAU,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,EAC9C,SAAS,EAAE,EAAE,CACX,sGAAsG,EACtG,+HAA+H,EAC/H,oFAAoF,EACpF,SAAS,CACV,EACD,aAAa,EAAE,SAAS,EACxB,aAAa,EAAE,QAAQ,EACvB,WAAW,EAAE,OAAO,EACpB,eAAe,EAAE,OAAO,EACxB,SAAS,EAAE,SAAS,EACpB,aAAa,EAAE,cAAc,GAC7B,CACH,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../src/notion/SidePanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA6D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"SidePanel.d.ts","sourceRoot":"","sources":["../../src/notion/SidePanel.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA6D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAUlG,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,QAAQ,GAAG,MAAM,GAAG,MAAM,CAAC;AAElE,MAAM,WAAW,cAAc;IAE7B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,EAAE,eAAe,CAAC;IACjC,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC;IAEzB,QAAQ,CAAC,OAAO,EAAE,MAAM,IAAI,CAAC;IAE7B,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;IAG7B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IAExB,QAAQ,CAAC,MAAM,CAAC,EAAE,SAAS,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;CAC9B;AAID,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,UAAqC,EAAE,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,cAAc,+BAkDjJ"}
|
package/dist/notion/SidePanel.js
CHANGED
|
@@ -5,6 +5,7 @@ import { useEffect, useRef } from "react";
|
|
|
5
5
|
import { en as messages } from "../messages/en.js";
|
|
6
6
|
import { Button } from "../ui/button.js";
|
|
7
7
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
8
|
+
import { SIDE_PANEL_WIDTH_VARIABLE } from "./side-panel-width.js";
|
|
8
9
|
// A non-modal panel at a side of a canvas (a map) that leaves the canvas usable. Its parent is a `relative` flex row
|
|
9
10
|
// holding the canvas and the panel. Hidden while closed, so its content leaves the reading order.
|
|
10
11
|
export function SidePanel({ id, heading, layout, isOpen, onClose, closeLabel = messages.sidePanel.close, width, footer, children }) {
|
|
@@ -23,6 +24,6 @@ export function SidePanel({ id, heading, layout, isOpen, onClose, closeLabel = m
|
|
|
23
24
|
event.stopPropagation();
|
|
24
25
|
onClose();
|
|
25
26
|
}
|
|
26
|
-
return (_jsxs("aside", { ref: panelRef, id: id, tabIndex: -1, "data-slot": "side-panel", className: "absolute inset-y-0 right-0 z-3 flex w-[min(24rem,100%)] flex-col border-l border-border bg-background text-foreground shadow-menu outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset data-[layout=beside]:relative data-[layout=beside]:w-auto data-[layout=beside]:max-w-full data-[layout=beside]:flex-[0_0_max(50%,24rem)] data-[layout=left]:right-auto data-[layout=left]:left-0 data-[layout=left]:border-r data-[layout=left]:border-l-0 max-sm:data-[layout=beside]:absolute max-sm:data-[layout=beside]:inset-0 max-sm:data-[layout=beside]:w-full max-sm:data-[layout=beside]:border-l-0 data-[layout=list]:relative data-[layout=list]:flex-none data-[layout=list]:border-r data-[layout=list]:border-l-0 max-sm:data-[layout=list]:absolute max-sm:data-[layout=list]:inset-0 max-sm:data-[layout=list]:w-full max-sm:data-[layout=list]:border-r-0 [&[hidden]]:hidden sm:data-[sized=true]:w-(--side-panel-width) sm:data-[sized=true]:flex-none", "data-layout": layout, "data-sized": width === undefined ? undefined : "true", style: width === undefined ? undefined : {
|
|
27
|
+
return (_jsxs("aside", { ref: panelRef, id: id, tabIndex: -1, "data-slot": "side-panel", className: "absolute inset-y-0 right-0 z-3 flex w-[min(24rem,100%)] flex-col border-l border-border bg-background text-foreground shadow-menu outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset data-[layout=beside]:relative data-[layout=beside]:w-auto data-[layout=beside]:max-w-full data-[layout=beside]:flex-[0_0_max(50%,24rem)] data-[layout=left]:right-auto data-[layout=left]:left-0 data-[layout=left]:border-r data-[layout=left]:border-l-0 max-sm:data-[layout=beside]:absolute max-sm:data-[layout=beside]:inset-0 max-sm:data-[layout=beside]:w-full max-sm:data-[layout=beside]:border-l-0 data-[layout=list]:relative data-[layout=list]:flex-none data-[layout=list]:border-r data-[layout=list]:border-l-0 max-sm:data-[layout=list]:absolute max-sm:data-[layout=list]:inset-0 max-sm:data-[layout=list]:w-full max-sm:data-[layout=list]:border-r-0 [&[hidden]]:hidden sm:data-[sized=true]:w-(--side-panel-width) sm:data-[sized=true]:flex-none", "data-layout": layout, "data-sized": width === undefined ? undefined : "true", style: width === undefined ? undefined : { [SIDE_PANEL_WIDTH_VARIABLE]: `${width}px` }, hidden: !isOpen, "aria-labelledby": headingId, "data-testid": id, onKeyDown: closeOnEscape, children: [_jsxs("div", { className: "flex items-center justify-between gap-2 border-b border-border py-2 pr-2 pl-4", children: [_jsx("h2", { id: headingId, className: "text-heading-3", children: heading }), _jsx(Button, { type: "button", variant: "ghost", size: "icon", "aria-label": closeLabel, onClick: onClose, children: _jsx(X, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }) })] }), _jsx("div", { "data-slot": "side-panel-content", className: "grid flex-1 content-start gap-3 overflow-y-auto p-3", children: children }), footer === undefined ? null : (_jsx("div", { "data-slot": "side-panel-footer", className: "flex flex-none border-t border-border p-2", children: footer }))] }));
|
|
27
28
|
}
|
|
28
29
|
//# sourceMappingURL=SidePanel.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidePanel.js","sourceRoot":"","sources":["../../src/notion/SidePanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,EAA0D,MAAM,OAAO,CAAC;AAElG,OAAO,EAAE,EAAE,IAAI,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAEzC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"SidePanel.js","sourceRoot":"","sources":["../../src/notion/SidePanel.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,CAAC,EAAE,MAAM,cAAc,CAAC;AACjC,OAAO,EAAE,SAAS,EAAE,MAAM,E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M,EACpD,KAAK,EAAE,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAE,EAAE,CAAC,yBAAyB,CAAC,EAAE,GAAG,KAAK,IAAI,EAAoB,EACzG,MAAM,EAAE,CAAC,MAAM,qBACE,SAAS,iBACb,EAAE,EACf,SAAS,EAAE,aAAa,aAExB,eAAK,SAAS,EAAC,+EAA+E,aAC5F,aAAI,EAAE,EAAE,SAAS,EAAE,SAAS,EAAC,gBAAgB,YAC1C,OAAO,GACL,EACL,KAAC,MAAM,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAC,OAAO,EAAC,IAAI,EAAC,MAAM,gBAAa,UAAU,EAAE,OAAO,EAAE,OAAO,YACxF,KAAC,CAAC,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,GACjD,IACL,EACN,2BAAe,oBAAoB,EAAC,SAAS,EAAC,qDAAqD,YAChG,QAAQ,GACL,EACL,MAAM,KAAK,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAC7B,2BAAe,mBAAmB,EAAC,SAAS,EAAC,2CAA2C,YACrF,MAAM,GACH,CACP,IACK,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CSS variable that holds a `SidePanel`'s width; `page.css` registers it as non-inherited, so changing it restyles
|
|
3
|
+
* only the panel, not its content (#1326). A `ResizeHandle liveVariable` writes it during a drag. Plain module, so a
|
|
4
|
+
* Server Component can read it.
|
|
5
|
+
*/
|
|
6
|
+
export declare const SIDE_PANEL_WIDTH_VARIABLE = "--side-panel-width";
|
|
7
|
+
//# sourceMappingURL=side-panel-width.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-width.d.ts","sourceRoot":"","sources":["../../src/notion/side-panel-width.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,uBAAuB,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CSS variable that holds a `SidePanel`'s width; `page.css` registers it as non-inherited, so changing it restyles
|
|
3
|
+
* only the panel, not its content (#1326). A `ResizeHandle liveVariable` writes it during a drag. Plain module, so a
|
|
4
|
+
* Server Component can read it.
|
|
5
|
+
*/
|
|
6
|
+
export const SIDE_PANEL_WIDTH_VARIABLE = "--side-panel-width";
|
|
7
|
+
//# sourceMappingURL=side-panel-width.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"side-panel-width.js","sourceRoot":"","sources":["../../src/notion/side-panel-width.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,CAAC,MAAM,yBAAyB,GAAG,oBAAoB,CAAC"}
|
package/dist/page.css
CHANGED
|
@@ -5,7 +5,17 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Import it after `theme.css` and the kit's `base.css`, through the app's Tailwind (it reads the type scale with
|
|
7
7
|
* `--theme()`).
|
|
8
|
+
*
|
|
9
|
+
* It also registers the size variables a component sets on a large subtree as non-inherited: an inherited custom
|
|
10
|
+
* property makes the browser restyle every descendant on each change, so a drag that resizes a `SidePanel` full of rows
|
|
11
|
+
* would restyle all of them on every move (#1326). The panel reads the variable on the element that sets it.
|
|
8
12
|
*/
|
|
13
|
+
@property --side-panel-width {
|
|
14
|
+
syntax: "<length>";
|
|
15
|
+
inherits: false;
|
|
16
|
+
initial-value: 0px;
|
|
17
|
+
}
|
|
18
|
+
|
|
9
19
|
@layer base {
|
|
10
20
|
html {
|
|
11
21
|
-webkit-font-smoothing: antialiased;
|
package/dist/theme.css
CHANGED
|
@@ -262,6 +262,18 @@
|
|
|
262
262
|
--shadow-card: 0 0 0 1px rgba(255, 255, 255, 0.094), 0 2px 4px rgba(0, 0, 0, 0.3);
|
|
263
263
|
}
|
|
264
264
|
|
|
265
|
+
:root, [data-density="compact"] {
|
|
266
|
+
--list-row-y: 0.25rem;
|
|
267
|
+
--list-item-y: 0px;
|
|
268
|
+
--list-divider-width: 0px;
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
[data-density="roomy"] {
|
|
272
|
+
--list-row-y: 0.5rem;
|
|
273
|
+
--list-item-y: 0.25rem;
|
|
274
|
+
--list-divider-width: 1px;
|
|
275
|
+
}
|
|
276
|
+
|
|
265
277
|
@theme inline {
|
|
266
278
|
--color-*: initial;
|
|
267
279
|
--color-background: var(--background);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.23.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",
|
|
@@ -61,7 +61,7 @@
|
|
|
61
61
|
"@dnd-kit/core": "^6.3.1",
|
|
62
62
|
"@dnd-kit/sortable": "^10.0.0",
|
|
63
63
|
"@dnd-kit/utilities": "^3.2.2",
|
|
64
|
-
"@softure-ai/theme-kit": "^0.1.
|
|
64
|
+
"@softure-ai/theme-kit": "^0.1.10",
|
|
65
65
|
"class-variance-authority": "^0.7.1",
|
|
66
66
|
"cmdk": "^1.1.1",
|
|
67
67
|
"lucide-react": "^1.72.0",
|
package/src/index.ts
CHANGED
|
@@ -65,6 +65,16 @@ export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProp
|
|
|
65
65
|
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
66
66
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
67
67
|
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
68
|
+
export {
|
|
69
|
+
LIST_CLASSES,
|
|
70
|
+
List,
|
|
71
|
+
ListItem,
|
|
72
|
+
ListRow,
|
|
73
|
+
type ListItemProps,
|
|
74
|
+
type ListProps,
|
|
75
|
+
type ListRowProps,
|
|
76
|
+
type ListSurface,
|
|
77
|
+
} from "./notion/List.js";
|
|
68
78
|
export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
|
|
69
79
|
export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
70
80
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
@@ -76,6 +86,7 @@ export { ResizeHandle, type ResizeHandleProps } from "./notion/ResizeHandle.js";
|
|
|
76
86
|
export { RouteLoading, type RouteLoadingProps } from "./notion/RouteLoading.js";
|
|
77
87
|
export { SheetMenu, SheetMenuButton, SheetMenuItem, type SheetMenuButtonProps } from "./notion/SheetMenu.js";
|
|
78
88
|
export { SidePanel, type SidePanelLayout, type SidePanelProps } from "./notion/SidePanel.js";
|
|
89
|
+
export { SIDE_PANEL_WIDTH_VARIABLE } from "./notion/side-panel-width.js";
|
|
79
90
|
export {
|
|
80
91
|
SortableActivator,
|
|
81
92
|
SortableHandle,
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { Density } from "@softure-ai/theme-kit";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import type { ComponentProps } from "react";
|
|
4
|
+
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* The classes of a list that follows the density (`data-density` on the list or an ancestor; theme-kit's
|
|
9
|
+
* `--list-*` variables). For a list the app renders itself, such as a `SortableList` and its `SortableItem`s.
|
|
10
|
+
* - `list`: the line between rows only, in the theme's `border`, as wide as the density says (none when compact).
|
|
11
|
+
* - `tintedList`: the same on a tinted card (`secondary`, `muted`), where the line takes the page's `background`: in the
|
|
12
|
+
* dark scheme `border` is the card's own grey.
|
|
13
|
+
* - `item`: the room between a row and the lines around it, so a row's rounded hover never touches a line.
|
|
14
|
+
* - `row`: a row's padding and hover, for a button or link that fills its item.
|
|
15
|
+
*/
|
|
16
|
+
export const LIST_CLASSES = {
|
|
17
|
+
list: "flex flex-col divide-y-(length:--list-divider-width) divide-border",
|
|
18
|
+
tintedList: "flex flex-col divide-y-(length:--list-divider-width) divide-background",
|
|
19
|
+
item: "py-(--list-item-y)",
|
|
20
|
+
row: "flex w-full min-w-0 items-center gap-2 rounded-md px-2 py-(--list-row-y) text-start text-ui outline-none transition-colors duration-100 hover:bg-accent focus-visible:ring-2 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
21
|
+
} as const;
|
|
22
|
+
|
|
23
|
+
export type ListSurface = "page" | "tinted";
|
|
24
|
+
|
|
25
|
+
export type ListProps = Omit<ComponentProps<"ul">, "ref"> & {
|
|
26
|
+
/** The list element: `ol` for a numbered list. */
|
|
27
|
+
readonly as?: "ul" | "ol";
|
|
28
|
+
/** `tinted` on a grey card: the line between rows takes the page's `background`. */
|
|
29
|
+
readonly surface?: ListSurface;
|
|
30
|
+
/** Sets the density on this list (its `data-density`); without it the list follows the nearest ancestor's. */
|
|
31
|
+
readonly density?: Density;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* A list of rows that follows the density: compact (tight rows, no line, the default) or roomy (a quiet line between
|
|
36
|
+
* rows, more room around each), set with `data-density` on `<html>`, a page, a section, or with `density` here.
|
|
37
|
+
*/
|
|
38
|
+
export function List({ as: Element = "ul", surface = "page", density, className, ...props }: ListProps) {
|
|
39
|
+
return (
|
|
40
|
+
<Element
|
|
41
|
+
data-slot="list"
|
|
42
|
+
data-surface={surface}
|
|
43
|
+
data-density={density}
|
|
44
|
+
className={cn(surface === "tinted" ? LIST_CLASSES.tintedList : LIST_CLASSES.list, className)}
|
|
45
|
+
{...props}
|
|
46
|
+
/>
|
|
47
|
+
);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export type ListItemProps = ComponentProps<"li"> & {
|
|
51
|
+
/** Renders the child element (a sortable item, an app's own `li`) with the item's classes. */
|
|
52
|
+
readonly asChild?: boolean;
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
/** One entry of a `List`: the room between its row and the lines around it. */
|
|
56
|
+
export function ListItem({ asChild = false, className, ...props }: ListItemProps) {
|
|
57
|
+
const Comp = asChild ? Slot.Root : "li";
|
|
58
|
+
return <Comp data-slot="list-item" className={cn(LIST_CLASSES.item, className)} {...props} />;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type ListRowProps = ComponentProps<"div"> & {
|
|
62
|
+
/** Renders the child element (a `button`, a link) as the row, keeping its own element and role. */
|
|
63
|
+
readonly asChild?: boolean;
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
/** A row in a `ListItem`: full width, the density's vertical padding, the theme's hover. */
|
|
67
|
+
export function ListRow({ asChild = false, className, ...props }: ListRowProps) {
|
|
68
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
69
|
+
return <Comp data-slot="list-row" className={cn(LIST_CLASSES.row, className)} {...props} />;
|
|
70
|
+
}
|
|
@@ -19,10 +19,20 @@ export interface ResizeHandleProps {
|
|
|
19
19
|
readonly max: number;
|
|
20
20
|
/** The width a double click restores. */
|
|
21
21
|
readonly defaultValue: number;
|
|
22
|
-
/**
|
|
22
|
+
/**
|
|
23
|
+
* Every new width, during a drag and on each key. With `liveVariable` a drag calls it once, on release, with the
|
|
24
|
+
* final width.
|
|
25
|
+
*/
|
|
23
26
|
readonly onChange: (value: number) => void;
|
|
24
27
|
/** The width once a drag, a key or the reset ends: the moment to keep it. */
|
|
25
28
|
readonly onCommit?: (value: number) => void;
|
|
29
|
+
/**
|
|
30
|
+
* A CSS variable on the `controls` element that a drag writes straight to the DOM (in pixels), with the handle's own
|
|
31
|
+
* `aria-valuenow`, instead of calling `onChange` on every pointer move: the screen does not re-render while the
|
|
32
|
+
* pointer moves. `SIDE_PANEL_WIDTH_VARIABLE` for a `SidePanel width`. Without the element, every move calls
|
|
33
|
+
* `onChange` as without this prop.
|
|
34
|
+
*/
|
|
35
|
+
readonly liveVariable?: `--${string}`;
|
|
26
36
|
readonly className?: string;
|
|
27
37
|
}
|
|
28
38
|
|
|
@@ -30,6 +40,8 @@ interface Drag {
|
|
|
30
40
|
readonly pointerId: number;
|
|
31
41
|
readonly startX: number;
|
|
32
42
|
readonly startValue: number;
|
|
43
|
+
// A live drag's column and the variable's inline value before the drag; null: every move calls `onChange`.
|
|
44
|
+
readonly live: { readonly column: HTMLElement; readonly variable: string; readonly before: string } | null;
|
|
33
45
|
}
|
|
34
46
|
|
|
35
47
|
/**
|
|
@@ -38,11 +50,12 @@ interface Drag {
|
|
|
38
50
|
* hovered, focused or dragged. Arrow keys step the width (Shift: four steps), Home and End go to the limits, a double
|
|
39
51
|
* click restores the default. Hidden phone-wide, where the columns stack.
|
|
40
52
|
*/
|
|
41
|
-
export function ResizeHandle({ label, controls, value, min, max, defaultValue, onChange, onCommit, className }: ResizeHandleProps) {
|
|
53
|
+
export function ResizeHandle({ label, controls, value, min, max, defaultValue, onChange, onCommit, liveVariable, className }: ResizeHandleProps) {
|
|
42
54
|
const dragRef = useRef<Drag | null>(null);
|
|
43
55
|
const lastRef = useRef(value);
|
|
44
56
|
const [isDragging, setIsDragging] = useState(false);
|
|
45
|
-
|
|
57
|
+
// During a live drag the handle owns the width; a render in between (the dragging flag) must not reset it.
|
|
58
|
+
if (dragRef.current === null || dragRef.current.live === null) lastRef.current = value;
|
|
46
59
|
|
|
47
60
|
function change(next: number): number {
|
|
48
61
|
const clamped = clampSize(next, min, max, defaultValue);
|
|
@@ -53,18 +66,34 @@ export function ResizeHandle({ label, controls, value, min, max, defaultValue, o
|
|
|
53
66
|
return clamped;
|
|
54
67
|
}
|
|
55
68
|
|
|
69
|
+
function findLiveColumn(handle: HTMLElement): Drag["live"] {
|
|
70
|
+
if (liveVariable === undefined) return null;
|
|
71
|
+
const column = handle.ownerDocument.getElementById(controls);
|
|
72
|
+
if (column === null) return null;
|
|
73
|
+
return { column, variable: liveVariable, before: column.style.getPropertyValue(liveVariable) };
|
|
74
|
+
}
|
|
75
|
+
|
|
56
76
|
function startDrag(event: PointerEvent<HTMLDivElement>) {
|
|
57
77
|
if (event.button !== 0) return;
|
|
58
78
|
event.preventDefault();
|
|
59
79
|
event.currentTarget.setPointerCapture?.(event.pointerId);
|
|
60
|
-
dragRef.current = { pointerId: event.pointerId, startX: event.clientX, startValue: value };
|
|
80
|
+
dragRef.current = { pointerId: event.pointerId, startX: event.clientX, startValue: value, live: findLiveColumn(event.currentTarget) };
|
|
61
81
|
setIsDragging(true);
|
|
62
82
|
}
|
|
63
83
|
|
|
64
84
|
function moveDrag(event: PointerEvent<HTMLDivElement>) {
|
|
65
85
|
const drag = dragRef.current;
|
|
66
86
|
if (drag === null || drag.pointerId !== event.pointerId) return;
|
|
67
|
-
|
|
87
|
+
const next = drag.startValue + event.clientX - drag.startX;
|
|
88
|
+
if (drag.live === null) {
|
|
89
|
+
change(next);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
const clamped = clampSize(next, min, max, defaultValue);
|
|
93
|
+
if (clamped === lastRef.current) return;
|
|
94
|
+
lastRef.current = clamped;
|
|
95
|
+
drag.live.column.style.setProperty(drag.live.variable, `${clamped}px`);
|
|
96
|
+
event.currentTarget.setAttribute("aria-valuenow", String(clamped));
|
|
68
97
|
}
|
|
69
98
|
|
|
70
99
|
function endDrag(event: PointerEvent<HTMLDivElement>) {
|
|
@@ -73,7 +102,16 @@ export function ResizeHandle({ label, controls, value, min, max, defaultValue, o
|
|
|
73
102
|
dragRef.current = null;
|
|
74
103
|
setIsDragging(false);
|
|
75
104
|
event.currentTarget.releasePointerCapture?.(event.pointerId);
|
|
76
|
-
|
|
105
|
+
const final = lastRef.current;
|
|
106
|
+
if (drag.live !== null) {
|
|
107
|
+
// Back to what React rendered, so the parent's next render owns the width (and a parent that keeps the old
|
|
108
|
+
// width is not left with the dragged one).
|
|
109
|
+
drag.live.column.style.setProperty(drag.live.variable, drag.live.before);
|
|
110
|
+
event.currentTarget.setAttribute("aria-valuenow", String(drag.startValue));
|
|
111
|
+
lastRef.current = drag.startValue;
|
|
112
|
+
if (final !== drag.startValue) change(final);
|
|
113
|
+
}
|
|
114
|
+
if (final !== drag.startValue) onCommit?.(final);
|
|
77
115
|
}
|
|
78
116
|
|
|
79
117
|
function stepByKey(event: KeyboardEvent<HTMLDivElement>) {
|
package/src/notion/SidePanel.tsx
CHANGED
|
@@ -7,6 +7,7 @@ import { en as messages } from "../messages/en.js";
|
|
|
7
7
|
import { Button } from "../ui/button.js";
|
|
8
8
|
|
|
9
9
|
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
10
|
+
import { SIDE_PANEL_WIDTH_VARIABLE } from "./side-panel-width.js";
|
|
10
11
|
|
|
11
12
|
// `over` and `left` float over the canvas's right or left side; `beside` and `list` sit next to it (after or before)
|
|
12
13
|
// and shrink it, and cover the whole canvas on a phone.
|
|
@@ -58,7 +59,7 @@ export function SidePanel({ id, heading, layout, isOpen, onClose, closeLabel = m
|
|
|
58
59
|
className="absolute inset-y-0 right-0 z-3 flex w-[min(24rem,100%)] flex-col border-l border-border bg-background text-foreground shadow-menu outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset data-[layout=beside]:relative data-[layout=beside]:w-auto data-[layout=beside]:max-w-full data-[layout=beside]:flex-[0_0_max(50%,24rem)] data-[layout=left]:right-auto data-[layout=left]:left-0 data-[layout=left]:border-r data-[layout=left]:border-l-0 max-sm:data-[layout=beside]:absolute max-sm:data-[layout=beside]:inset-0 max-sm:data-[layout=beside]:w-full max-sm:data-[layout=beside]:border-l-0 data-[layout=list]:relative data-[layout=list]:flex-none data-[layout=list]:border-r data-[layout=list]:border-l-0 max-sm:data-[layout=list]:absolute max-sm:data-[layout=list]:inset-0 max-sm:data-[layout=list]:w-full max-sm:data-[layout=list]:border-r-0 [&[hidden]]:hidden sm:data-[sized=true]:w-(--side-panel-width) sm:data-[sized=true]:flex-none"
|
|
59
60
|
data-layout={layout}
|
|
60
61
|
data-sized={width === undefined ? undefined : "true"}
|
|
61
|
-
style={width === undefined ? undefined : ({
|
|
62
|
+
style={width === undefined ? undefined : ({ [SIDE_PANEL_WIDTH_VARIABLE]: `${width}px` } as CSSProperties)}
|
|
62
63
|
hidden={!isOpen}
|
|
63
64
|
aria-labelledby={headingId}
|
|
64
65
|
data-testid={id}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CSS variable that holds a `SidePanel`'s width; `page.css` registers it as non-inherited, so changing it restyles
|
|
3
|
+
* only the panel, not its content (#1326). A `ResizeHandle liveVariable` writes it during a drag. Plain module, so a
|
|
4
|
+
* Server Component can read it.
|
|
5
|
+
*/
|
|
6
|
+
export const SIDE_PANEL_WIDTH_VARIABLE = "--side-panel-width";
|
package/src/page.css
CHANGED
|
@@ -5,7 +5,17 @@
|
|
|
5
5
|
*
|
|
6
6
|
* Import it after `theme.css` and the kit's `base.css`, through the app's Tailwind (it reads the type scale with
|
|
7
7
|
* `--theme()`).
|
|
8
|
+
*
|
|
9
|
+
* It also registers the size variables a component sets on a large subtree as non-inherited: an inherited custom
|
|
10
|
+
* property makes the browser restyle every descendant on each change, so a drag that resizes a `SidePanel` full of rows
|
|
11
|
+
* would restyle all of them on every move (#1326). The panel reads the variable on the element that sets it.
|
|
8
12
|
*/
|
|
13
|
+
@property --side-panel-width {
|
|
14
|
+
syntax: "<length>";
|
|
15
|
+
inherits: false;
|
|
16
|
+
initial-value: 0px;
|
|
17
|
+
}
|
|
18
|
+
|
|
9
19
|
@layer base {
|
|
10
20
|
html {
|
|
11
21
|
-webkit-font-smoothing: antialiased;
|