@softure-ai/theme-notion 0.22.0 → 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 +12 -0
- package/README.md +29 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -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/theme.css +12 -0
- package/package.json +2 -2
- package/src/index.ts +10 -0
- package/src/notion/List.tsx +70 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,18 @@ Newest first. Each version lists what changed for an app that uses the theme. Wh
|
|
|
4
4
|
production, the version gets a line `verified in: <app>@<commit>` ([docs/05](../../docs/05-adoption-playbook.md),
|
|
5
5
|
"Definition of done").
|
|
6
6
|
|
|
7
|
+
## 0.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
|
+
|
|
7
19
|
## 0.22.0
|
|
8
20
|
|
|
9
21
|
- Smooth resize drags over a large `SidePanel` (#1326):
|
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),
|
|
@@ -457,6 +458,34 @@ and the body's parts mark the parts.
|
|
|
457
458
|
/>
|
|
458
459
|
```
|
|
459
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
|
+
|
|
460
489
|
**`MiniProgress`.** A share with its figure inside the bar, for a table cell or a tile where a figure next to a
|
|
461
490
|
`Progress` would collide with it: a 20 px rounded track (`primary/12`) that takes the cell's width (at least 64 px),
|
|
462
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";
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot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AoB,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";
|
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,CA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2B,CAAC;AACnF,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAqB,MAAM,2BAA2B,CAAC;AACpG,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,GAOf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAA0C,MAAM,wBAAwB,CAAC;AACjG,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,GAQX,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,O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,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"}
|
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";
|
|
@@ -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
|
+
}
|