@softure-ai/theme-notion 0.33.0 → 0.35.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 +30 -0
- package/README.md +82 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/messages/en.d.ts +3 -0
- package/dist/messages/en.d.ts.map +1 -1
- package/dist/messages/en.js +1 -0
- package/dist/messages/en.js.map +1 -1
- package/dist/messages/index.d.ts +3 -0
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/notion/List.d.ts +43 -1
- package/dist/notion/List.d.ts.map +1 -1
- package/dist/notion/List.js +27 -1
- package/dist/notion/List.js.map +1 -1
- package/dist/notion/ResultBadge.d.ts +20 -0
- package/dist/notion/ResultBadge.d.ts.map +1 -0
- package/dist/notion/ResultBadge.js +25 -0
- package/dist/notion/ResultBadge.js.map +1 -0
- package/dist/notion/RowActionsMenu.d.ts +42 -0
- package/dist/notion/RowActionsMenu.d.ts.map +1 -0
- package/dist/notion/RowActionsMenu.js +36 -0
- package/dist/notion/RowActionsMenu.js.map +1 -0
- package/dist/ui/badge.d.ts.map +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/badge.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +11 -0
- package/src/messages/en.ts +1 -0
- package/src/notion/List.tsx +145 -1
- package/src/notion/ResultBadge.tsx +59 -0
- package/src/notion/RowActionsMenu.tsx +151 -0
- package/src/ui/badge.tsx +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,36 @@ 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.35.0
|
|
8
|
+
|
|
9
|
+
- `RowActionsMenu` (#1486): a row's overflow menu. An icon-only "More actions" button (`label` for the app's words)
|
|
10
|
+
opens a `DropdownMenu` of `actions`; `destructiveAction` is last, after a separator, in the danger tone, and with
|
|
11
|
+
`confirm` opens an `AlertDialog` first and runs only on the destructive confirm, focus returning to the button.
|
|
12
|
+
- `ListEntry` (#1486): a `menu` slot at the end of the actions line; the inline control and the menu button stay on
|
|
13
|
+
one line, each at least 44 px on a phone. The docs state the rules: at most one control inline, the rest in the
|
|
14
|
+
menu (a row with a single action keeps it inline); each fact once (a switch is its own state, a `ResultBadge` its own
|
|
15
|
+
icon). The phone's 44 px rule no longer stretches a switch's track into a blob: a `Switch size="touch"` keeps its
|
|
16
|
+
square beside the menu.
|
|
17
|
+
- Migration: an app that built its own row overflow menu replaces it with `menu={<RowActionsMenu … />}`.
|
|
18
|
+
|
|
19
|
+
## 0.34.0
|
|
20
|
+
|
|
21
|
+
- `ListEntry` (#1481): a list row with an identity and a right column. `title` and `details` (the lines under it) on
|
|
22
|
+
the left; `status` at the top of the right column and `actions` under it. With `href` (and `linkComponent` for a
|
|
23
|
+
router's link) the title's link is stretched over the whole row with an arrow beside the column, which never wraps
|
|
24
|
+
alone; the column stays above the link. Below `md` the column wraps under the identity, right-aligned, with 44 px
|
|
25
|
+
controls. A control marked `data-row-wide` makes the column take the full row width, its lines starting on the left.
|
|
26
|
+
`ListRow` is unchanged.
|
|
27
|
+
- `ResultBadge` (#1481): a result as a filled tag in its tone's colour (`TONE_COLORS`), the tone's icon
|
|
28
|
+
(`RESULT_BADGE_ICONS`, overridable with `icon`) and always a word; `isSpinning` spins the icon
|
|
29
|
+
(`motion-safe:animate-spin`) for a run in progress.
|
|
30
|
+
- Migration: an app that built its own list row with a state/actions column and a stretched title link, or its own
|
|
31
|
+
result badge on the tones, replaces them with `ListEntry` and `ResultBadge`.
|
|
32
|
+
- `Badge` (#1482): a badge given a palette `color` renders `data-color="<color>"` next to its `data-variant`, the way
|
|
33
|
+
`Status` names its colour, so a browser test checks a filled tag with `[data-color=red]` as it checks a status.
|
|
34
|
+
`color="none"` or no colour sets nothing; an app's own `data-color` still wins.
|
|
35
|
+
- Migration: an app that added its own `data-tone` or `data-color` to its badges to test their colour drops it.
|
|
36
|
+
|
|
7
37
|
## 0.33.0
|
|
8
38
|
|
|
9
39
|
- `DialogContent` and `SheetContent` (#1476): on open they focus the first form field (`input` other than hidden,
|
package/README.md
CHANGED
|
@@ -109,6 +109,9 @@ name outside a `CommandDialog`; without it the field has none), `SortableList in
|
|
|
109
109
|
does not fit ends in an ellipsis while the icon keeps its size, and the full word is the badge's `title` when it is
|
|
110
110
|
a string or a number (pass `title` for any other node). A plain `Badge` clips its text at the end; wrap the
|
|
111
111
|
text in `<span className="min-w-0 truncate">` for an ellipsis.
|
|
112
|
+
- A badge names its colour and variant in attributes, so a browser test checks them without parsing classes: a
|
|
113
|
+
`Badge` with a palette `color` renders `data-color="<color>"` next to `data-variant` (none for `color="none"`), and
|
|
114
|
+
a `Status` renders `data-color` the same way (`[data-slot=badge][data-color=red]`).
|
|
112
115
|
- Installed on a phone's home screen (`viewport-fit=cover`), the parts at a screen edge pad by the screen's
|
|
113
116
|
safe-area insets on the edges they touch: `SheetContent` (every `side`, its close button too), the `Sidebar` on a
|
|
114
117
|
phone, the popper `SelectContent` (its height stops short of the inset it opens towards) and `PageFrame`. The insets
|
|
@@ -139,7 +142,7 @@ All 37 shadcn/ui components of the design system, exported from the package root
|
|
|
139
142
|
avatar, badge, breadcrumb, button, button-group, card, checkbox, collapsible, command, dialog, dropdown-menu, empty,
|
|
140
143
|
field, input, input-group, item, kbd, label, popover, progress, radio-group, scroll-area, select, separator, sheet,
|
|
141
144
|
sidebar, skeleton, sonner (`Toaster`), spinner, switch, table, tabs, textarea, tooltip. Compositions: `Status` (badge, icon,
|
|
142
|
-
word), `PageHeader` (breadcrumb, icon box, title, description, actions), `PageLayout` (a screen in the app shell: its
|
|
145
|
+
word), `ResultBadge` (a result as a filled tag in its tone's colour, with an icon and a word, below), `PageHeader` (breadcrumb, icon box, title, description, actions), `PageLayout` (a screen in the app shell: its
|
|
143
146
|
`PageHeader`, then its sections, at one width and spacing, below), `PropertyList` (fields of one record),
|
|
144
147
|
`DetailTable` (an item's details as a label and value table, laid out fixed at its container's width, each label
|
|
145
148
|
above its value where the table is narrower than 28rem), `FoldRow` (a list row folding open to a `DetailTable`
|
|
@@ -154,6 +157,8 @@ stages with a state, below), `Timeline` (dated entries on a vertical rail, below
|
|
|
154
157
|
`Prose` (the text styles of a long read the app does not draw itself, such as Markdown rendered to HTML, below),
|
|
155
158
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below),
|
|
156
159
|
`List`, `ListItem` and `ListRow` (a list of rows, compact or roomy by the page's density, below),
|
|
160
|
+
`ListEntry` (a list row with an identity and a right column, its state over its controls, below),
|
|
161
|
+
`RowActionsMenu` (a row's other actions behind a "More actions" button, the destructive one last and confirmed, below),
|
|
157
162
|
`ListGroup` and `ListGroupHeading` (a run of rows under a heading that sticks at the top of its scroll, below),
|
|
158
163
|
`MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
|
|
159
164
|
`UpdatePrompt` (the offer to reload into a new build, for an installed app, below),
|
|
@@ -521,6 +526,82 @@ scheme the theme's `border` is that card's own grey.
|
|
|
521
526
|
renders with other components, `LIST_CLASSES` holds the same classes (`list`, `tintedList`, `item`, `row`), e.g.
|
|
522
527
|
`<SortableList className={LIST_CLASSES.list}>` with `<SortableItem className={LIST_CLASSES.item}>`.
|
|
523
528
|
|
|
529
|
+
**`ListEntry`: a row with a right column.** The most common row of an admin list: what the row is on the left
|
|
530
|
+
(`title`, in the medium weight, and `details`, the lines under it in the muted colour) and a right column with the
|
|
531
|
+
row's state on top (`status`, badges that wrap right-aligned) and its controls under it (`actions`). With `href` the
|
|
532
|
+
title is a link stretched over the whole row, so the row is one box lit on hover with one focus ring, and a muted arrow
|
|
533
|
+
sits beside the column; the arrow and the column are one group, so the arrow never wraps onto a line of its own. The
|
|
534
|
+
column stays above the link: its controls are their own targets, and a click on the gap between them or on the arrow
|
|
535
|
+
still opens the row. Pass `linkComponent` for a router's link (it takes `href`, `className` and `children`). On a
|
|
536
|
+
phone (below `md`) the column wraps under the identity, right-aligned, and every control is at least the touch target
|
|
537
|
+
(44 px). A control that needs room while it is open (an inline answer form) carries `data-row-wide`: the column then
|
|
538
|
+
takes the full row width under the identity, its lines starting on the left. Place the row in a `ListItem`, so it
|
|
539
|
+
follows the list's density.
|
|
540
|
+
|
|
541
|
+
```tsx
|
|
542
|
+
<List aria-label="Deploys">
|
|
543
|
+
{deploys.map((deploy) => (
|
|
544
|
+
<ListItem key={deploy.id}>
|
|
545
|
+
<ListEntry
|
|
546
|
+
href={`/deploys/${deploy.id}`}
|
|
547
|
+
linkComponent={Link}
|
|
548
|
+
title={deploy.name}
|
|
549
|
+
details={<><span>{deploy.branch}</span><span>{deploy.startedAt}</span></>}
|
|
550
|
+
status={<ResultBadge tone={TONE_BY_RESULT[deploy.result]}>{deploy.resultLabel}</ResultBadge>}
|
|
551
|
+
actions={<Button variant="ghost" size="icon-sm" aria-label="Retry"><RotateCw /></Button>}
|
|
552
|
+
/>
|
|
553
|
+
</ListItem>
|
|
554
|
+
))}
|
|
555
|
+
</List>
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
**Row controls and row state.** A row shows at most one control inline in `actions`: a switch, or the row's one
|
|
559
|
+
primary action. Every other action goes into `menu`, a `RowActionsMenu` on the same line: an icon-only "More actions"
|
|
560
|
+
button (its name from `label`, English by default) that opens a menu of `actions`, with `destructiveAction` last,
|
|
561
|
+
after a separator, in the danger tone. Give the destructive action a `confirm` (`title`, `description`,
|
|
562
|
+
`confirmLabel`, `cancelLabel`) and it opens an alert dialog first, running only on the destructive confirm; focus goes
|
|
563
|
+
back to the menu button. The menu opens with Enter, Space or ArrowDown, and the arrow keys move between items. A row
|
|
564
|
+
with a single action keeps it inline and has no menu. The inline control and the menu button never wrap apart, and on
|
|
565
|
+
a phone each is at least the touch target (44 px): pass the switch `size="touch"` (with `className="md:m-0 md:h-4
|
|
566
|
+
md:w-[26px]"` for the plain switch on a desktop), since the row never stretches a switch's track. Each fact is said once: a switch is its own on/off state, so no
|
|
567
|
+
badge or label repeats it; a `ResultBadge` carries its own icon, so no separate state icon stands next to it.
|
|
568
|
+
|
|
569
|
+
```tsx
|
|
570
|
+
<ListEntry
|
|
571
|
+
title={hook.name}
|
|
572
|
+
details={<span>{hook.url}</span>}
|
|
573
|
+
status={<ResultBadge tone={TONE_BY_RESULT[hook.lastResult]}>{hook.lastResultLabel}</ResultBadge>}
|
|
574
|
+
actions={<Switch size="touch" className="md:m-0 md:h-4 md:w-[26px]" checked={hook.isOn} onCheckedChange={toggle} aria-label={t.hooks.enabled} />}
|
|
575
|
+
menu={
|
|
576
|
+
<RowActionsMenu
|
|
577
|
+
label={t.rows.more}
|
|
578
|
+
actions={[
|
|
579
|
+
{ label: t.hooks.test, onSelect: test },
|
|
580
|
+
{ label: t.hooks.replaceToken, onSelect: replaceToken },
|
|
581
|
+
]}
|
|
582
|
+
destructiveAction={{
|
|
583
|
+
label: t.hooks.delete,
|
|
584
|
+
onSelect: remove,
|
|
585
|
+
confirm: { title: t.hooks.deleteTitle, confirmLabel: t.hooks.delete, cancelLabel: t.common.cancel },
|
|
586
|
+
}}
|
|
587
|
+
/>
|
|
588
|
+
}
|
|
589
|
+
/>
|
|
590
|
+
```
|
|
591
|
+
|
|
592
|
+
**`ResultBadge`: a result in its tone.** A result (passed, failed, skipped, running) as a filled tag in its tone's
|
|
593
|
+
colour (`TONE_COLORS`: `success` green, `warning` orange, `danger` red, `muted` gray, `default` the default tag), with
|
|
594
|
+
the tone's icon (`RESULT_BADGE_ICONS`: `CircleCheck`, `TriangleAlert`, `CircleX`, `CircleMinus`, `Circle`; pass
|
|
595
|
+
`icon` for another) and always a word. The app keeps its own table of which result takes which tone; the theme owns
|
|
596
|
+
the colours, so "failed" is red in every list. `isSpinning` marks a run still in progress: the icon (a
|
|
597
|
+
`LoaderCircle` unless `icon` is given) spins with `motion-safe:animate-spin`, still for a reader who asked for reduced
|
|
598
|
+
motion. `Status` is the ghost counterpart, for a state written in text colour.
|
|
599
|
+
|
|
600
|
+
```tsx
|
|
601
|
+
<ResultBadge tone="danger">Failed</ResultBadge>
|
|
602
|
+
<ResultBadge tone="muted" isSpinning>Running</ResultBadge>
|
|
603
|
+
```
|
|
604
|
+
|
|
524
605
|
**`ListGroup`, `ListGroupHeading`: a sticky group heading.** A heading over a run of rows (a country's days, a month's
|
|
525
606
|
entries) that sticks at the top of the scroll container while its rows pass under it, and is pushed away by the next
|
|
526
607
|
group's heading. Put the groups straight in the scrolling element and give it no padding: a sticky box sticks at the
|
package/dist/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProp
|
|
|
50
50
|
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
51
51
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
52
52
|
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
53
|
-
export { LIST_CLASSES, List, ListGroup, ListGroupHeading, ListItem, ListRow, type ListGroupHeadingProps, type ListGroupProps, type ListItemProps, type ListProps, type ListRowProps, type ListSurface, } from "./notion/List.js";
|
|
53
|
+
export { LIST_CLASSES, List, ListGroup, ListGroupHeading, ListItem, ListEntry, ListRow, type ListGroupHeadingProps, type ListGroupProps, type ListItemProps, type ListProps, type ListEntryLinkComponent, type ListEntryProps, type ListRowProps, type ListSurface, } from "./notion/List.js";
|
|
54
54
|
export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
|
|
55
55
|
export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
56
56
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
@@ -69,6 +69,8 @@ export { SortableActivator, SortableHandle, SortableItem, SortableList, type Sor
|
|
|
69
69
|
export { StatCards, StatPills, StatsFold, type StatCard, type StatCardAside, type StatCardsProps, type StatPill, type StatPillsProps, type StatsFoldProps, } from "./notion/Stats.js";
|
|
70
70
|
export { FileInput, type FileInputMessages, type FileInputMessagesOverride, type FileInputProps } from "./notion/FileInput.js";
|
|
71
71
|
export { FormGrid, type FormGridColumns, type FormGridProps } from "./notion/FormGrid.js";
|
|
72
|
+
export { RESULT_BADGE_ICONS, ResultBadge, type ResultBadgeProps } from "./notion/ResultBadge.js";
|
|
73
|
+
export { RowActionsMenu, type RowActionsMenuProps, type RowMenuAction, type RowMenuConfirmation, type RowMenuDestructiveAction, } from "./notion/RowActionsMenu.js";
|
|
72
74
|
export { Status, type StatusProps } from "./notion/Status.js";
|
|
73
75
|
export { Steps, type StepItem, type StepState, type StepsLayout, type StepsProps } from "./notion/Steps.js";
|
|
74
76
|
export { TabBar, type TabBarItem, type TabBarProps } from "./notion/TabBar.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;AAC/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,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
|
@@ -52,7 +52,7 @@ export { FilterChip, FilterChipAdd } from "./notion/FilterChip.js";
|
|
|
52
52
|
export { FoldRow } from "./notion/FoldRow.js";
|
|
53
53
|
export { InstallBar } from "./notion/InstallBar.js";
|
|
54
54
|
export { LaunchScreen } from "./notion/LaunchScreen.js";
|
|
55
|
-
export { LIST_CLASSES, List, ListGroup, ListGroupHeading, ListItem, ListRow, } from "./notion/List.js";
|
|
55
|
+
export { LIST_CLASSES, List, ListGroup, ListGroupHeading, ListItem, ListEntry, ListRow, } from "./notion/List.js";
|
|
56
56
|
export { PALETTE_COLORS } from "./notion/palette.js";
|
|
57
57
|
export { MarkPopover } from "./notion/MarkPopover.js";
|
|
58
58
|
export { MiniProgress } from "./notion/MiniProgress.js";
|
|
@@ -71,6 +71,8 @@ export { SortableActivator, SortableHandle, SortableItem, SortableList, } from "
|
|
|
71
71
|
export { StatCards, StatPills, StatsFold, } from "./notion/Stats.js";
|
|
72
72
|
export { FileInput } from "./notion/FileInput.js";
|
|
73
73
|
export { FormGrid } from "./notion/FormGrid.js";
|
|
74
|
+
export { RESULT_BADGE_ICONS, ResultBadge } from "./notion/ResultBadge.js";
|
|
75
|
+
export { RowActionsMenu, } from "./notion/RowActionsMenu.js";
|
|
74
76
|
export { Status } from "./notion/Status.js";
|
|
75
77
|
export { Steps } from "./notion/Steps.js";
|
|
76
78
|
export { TabBar } from "./notion/TabBar.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,cAAc,cAAc,CAAC;AAC7B,cAA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ElB,QAAQ;iBACN,KAAK,EAAE,OAAO;iBACd,MAAM,EAAE,SAAS;iBACjB,OAAO,EAAE,UAAU;iBACnB,IAAI,EAAE,YAAY;iBAClB,SAAS,EAAE,eAAe;iBAC1B,YAAY,EAAE,QAAQ;iBACtB,IAAI,EAAE,0BAA0B;iBAChC,OAAO,EAAE,sBAAsB;iBAC/B,MAAM,EAAE,gCAAgC;iBACxC,WAAW,EAAE,6CAA6C;iBAC1D,OAAO,EAAE,mBAAmB;iBAC5B,IAAI,EAAE,MAAM;;aAEd,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"}
|
package/dist/messages/en.js
CHANGED
|
@@ -12,6 +12,7 @@ export const en = {
|
|
|
12
12
|
},
|
|
13
13
|
breadcrumb: { label: "breadcrumb", more: "More" },
|
|
14
14
|
copy: { copy: "Copy", copied: "Copied" },
|
|
15
|
+
rowActions: { more: "More actions" },
|
|
15
16
|
dialog: { close: "Close" },
|
|
16
17
|
fileInput: { choose: "Choose a file", chooseMany: "Choose files", none: "No file chosen", count: "{count} files" },
|
|
17
18
|
filterChip: { add: "Add filter" },
|
package/dist/messages/en.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"en.js","sourceRoot":"","sources":["../../src/messages/en.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,MAAM,CAAC,MAAM,EAAE,GAAG;IAChB,UAAU,EAAE;QACV,IAAI,EAAE,gBAAgB;QACtB,IAAI,EAAE,gBAAgB;QACtB,KAAK,EAAE,iBAAiB;QACxB,MAAM,EAAE,kBAAkB;QAC1B,WAAW,EAAE,kCAAkC;KAChD;IACD,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EA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AE,WAAW,EAAE,gCAAgC,EAAE;CAC5E,CAAC"}
|
package/dist/messages/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qGAAqG;AACrG,eAAO,MAAM,cAAc
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/messages/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,SAAS,CAAC;AAE7B,qGAAqG;AACrG,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAAS,CAAC;AAErC,MAAM,MAAM,cAAc,GAAG,OAAO,EAAE,CAAC"}
|
package/dist/notion/List.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { Density } from "@softure-ai/theme-kit";
|
|
2
|
-
import type { ComponentProps } from "react";
|
|
2
|
+
import type { ComponentProps, ElementType, ReactNode } from "react";
|
|
3
3
|
/**
|
|
4
4
|
* The classes of a list that follows the density (`data-density` on the list or an ancestor; theme-kit's
|
|
5
5
|
* `--list-*` variables). For a list the app renders itself, such as a `SortableList` and its `SortableItem`s.
|
|
@@ -48,6 +48,48 @@ export type ListRowProps = ComponentProps<"div"> & {
|
|
|
48
48
|
};
|
|
49
49
|
/** A row in a `ListItem`: full width, the density's vertical padding, the theme's hover. */
|
|
50
50
|
export declare function ListRow({ asChild, className, ...props }: ListRowProps): import("react").JSX.Element;
|
|
51
|
+
/** The link a `ListEntry` title renders: a plain `a`, or the app's router link taking the same props. */
|
|
52
|
+
export type ListEntryLinkComponent = ElementType<{
|
|
53
|
+
href: string;
|
|
54
|
+
className?: string;
|
|
55
|
+
children?: ReactNode;
|
|
56
|
+
}>;
|
|
57
|
+
export type ListEntryProps = Omit<ComponentProps<"div">, "title" | "children"> & {
|
|
58
|
+
/** What the row is: its name, in the medium weight. With `href` it is the link that opens the row. */
|
|
59
|
+
readonly title: ReactNode;
|
|
60
|
+
/** Lines under the title (facts, a path, a time), in the muted colour; the app lays out its own lines. */
|
|
61
|
+
readonly details?: ReactNode;
|
|
62
|
+
/** The row's state, at the top of the right column (one or more badges, which wrap right-aligned). */
|
|
63
|
+
readonly status?: ReactNode;
|
|
64
|
+
/**
|
|
65
|
+
* The row's controls, under the status. They stay their own targets above the row's link, and are at least the
|
|
66
|
+
* touch target (44 px) on a phone; a switch keeps its track and takes its 44 px square from `size="touch"` (with
|
|
67
|
+
* `className="md:m-0 md:h-4 md:w-[26px]"` for the plain switch on a desktop). A control marked `data-row-wide` (an inline form that needs room) makes the right
|
|
68
|
+
* column take the full row width under the identity, its lines starting on the left.
|
|
69
|
+
*/
|
|
70
|
+
readonly actions?: ReactNode;
|
|
71
|
+
/**
|
|
72
|
+
* The row's other actions behind a "More actions" button (a `RowActionsMenu`), at the end of the actions line: it
|
|
73
|
+
* stays on one line with the inline control and is at least the touch target (44 px) on a phone.
|
|
74
|
+
*/
|
|
75
|
+
readonly menu?: ReactNode;
|
|
76
|
+
/** The row opens this address: the title's link is stretched over the whole row, with an arrow at its right. */
|
|
77
|
+
readonly href?: string;
|
|
78
|
+
/** The element for the link (a router's link component); a plain `a` by default. */
|
|
79
|
+
readonly linkComponent?: ListEntryLinkComponent;
|
|
80
|
+
};
|
|
81
|
+
/**
|
|
82
|
+
* A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
|
|
83
|
+
* top of the right column and its controls under it. With `href` the title is a link stretched over the whole row, so
|
|
84
|
+
* the row is one box lit on hover, and an arrow sits beside the column (never on a line of its own); the column stays
|
|
85
|
+
* above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
|
|
86
|
+
*
|
|
87
|
+
* Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
|
|
88
|
+
* action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
|
|
89
|
+
* Row state: each fact once. A switch is its own on/off state (no badge or label repeating it); a `ResultBadge`
|
|
90
|
+
* carries its own icon, so no separate state icon stands next to it.
|
|
91
|
+
*/
|
|
92
|
+
export declare function ListEntry({ title, details, status, actions, menu, href, linkComponent: Link, className, ...props }: ListEntryProps): import("react").JSX.Element;
|
|
51
93
|
export type ListGroupProps = ComponentProps<"div"> & {
|
|
52
94
|
/** Renders the child element (a `section`, an app's own `li`) with the group's classes. */
|
|
53
95
|
readonly asChild?: boolean;
|
|
@@ -1 +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;
|
|
1
|
+
{"version":3,"file":"List.d.ts","sourceRoot":"","sources":["../../src/notion/List.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAGrD,OAAO,KAAK,EAAE,cAAc,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMpE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,YAAY;aACvB,IAAI,EAAE,oEAAoE;aAC1E,UAAU,EAAE,wEAAwE;aACpF,IAAI,EAAE,oBAAoB;aAC1B,GAAG,EAAE,uPAAuP;aAC5P,KAAK,EAAE,4CAA4C;aACnD,YAAY,EACV,kIAAkI;aACpI,kBAAkB,EAChB,qIAAqI;CAC/H,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,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sx-runtime";
|
|
2
|
+
import { ChevronRight } from "lucide-react";
|
|
2
3
|
import { Slot } from "radix-ui";
|
|
3
4
|
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
4
6
|
/**
|
|
5
7
|
* The classes of a list that follows the density (`data-density` on the list or an ancestor; theme-kit's
|
|
6
8
|
* `--list-*` variables). For a list the app renders itself, such as a `SortableList` and its `SortableItem`s.
|
|
@@ -40,6 +42,30 @@ export function ListRow({ asChild = false, className, ...props }) {
|
|
|
40
42
|
const Comp = asChild ? Slot.Root : "div";
|
|
41
43
|
return _jsx(Comp, { "data-slot": "list-row", className: cn(LIST_CLASSES.row, className), ...props });
|
|
42
44
|
}
|
|
45
|
+
function isDrawn(node) {
|
|
46
|
+
return node !== undefined && node !== null && node !== false;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
|
|
50
|
+
* top of the right column and its controls under it. With `href` the title is a link stretched over the whole row, so
|
|
51
|
+
* the row is one box lit on hover, and an arrow sits beside the column (never on a line of its own); the column stays
|
|
52
|
+
* above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
|
|
53
|
+
*
|
|
54
|
+
* Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
|
|
55
|
+
* action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
|
|
56
|
+
* Row state: each fact once. A switch is its own on/off state (no badge or label repeating it); a `ResultBadge`
|
|
57
|
+
* carries its own icon, so no separate state icon stands next to it.
|
|
58
|
+
*/
|
|
59
|
+
export function ListEntry({ title, details, status, actions, menu, href, linkComponent: Link = "a", className, ...props }) {
|
|
60
|
+
const hasStatus = isDrawn(status);
|
|
61
|
+
const hasActions = isDrawn(actions);
|
|
62
|
+
const hasMenu = isDrawn(menu);
|
|
63
|
+
const hasControls = hasActions || hasMenu;
|
|
64
|
+
const hasColumn = hasStatus || hasControls;
|
|
65
|
+
const hasLink = href !== undefined;
|
|
66
|
+
const titleClasses = "min-w-0 text-ui-medium text-foreground";
|
|
67
|
+
return (_jsxs("div", { "data-slot": "list-entry", className: cn("relative flex w-full min-w-0 flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-2 py-(--list-row-y) text-ui transition-colors duration-100 hover:bg-accent", "has-[[data-slot=list-entry-title]:focus-visible]:ring-2 has-[[data-slot=list-entry-title]:focus-visible]:ring-ring", className), ...props, children: [_jsxs("div", { "data-slot": "list-entry-identity", className: "flex min-w-0 flex-1 basis-48 flex-col gap-0.5 max-md:basis-full", children: [hasLink ? (_jsx(Link, { "data-slot": "list-entry-title", href: href, className: cn(titleClasses, "outline-none after:absolute after:inset-0 after:rounded-md after:content-['']"), children: title })) : (_jsx("span", { "data-slot": "list-entry-title", className: titleClasses, children: title })), isDrawn(details) ? (_jsx("div", { "data-slot": "list-entry-details", className: "flex min-w-0 flex-col text-ui text-muted-foreground", children: details })) : null] }), hasColumn || hasLink ? (_jsxs("div", { "data-slot": "list-entry-side", className: "group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-center gap-2 has-[[data-row-wide]]:ml-0 has-[[data-row-wide]]:basis-full", children: [hasColumn ? (_jsxs("div", { "data-slot": "list-entry-column", className: "flex min-w-0 flex-col items-end gap-1 has-[[data-row-wide]]:flex-1 has-[[data-row-wide]]:items-stretch", children: [hasStatus ? (_jsx("div", { "data-slot": "list-entry-status", className: "pointer-events-auto flex min-w-0 flex-wrap items-center justify-end gap-1 group-has-[[data-row-wide]]/list-entry-side:justify-start", children: status })) : null, hasControls ? (_jsxs("div", { "data-slot": "list-entry-actions", className: cn("pointer-events-auto flex min-w-0 items-center justify-end gap-1 has-[[data-row-wide]]:flex-col has-[[data-row-wide]]:items-stretch has-[[data-row-wide]]:justify-start max-md:*:not-data-[slot=switch]:min-h-touch-target max-md:*:not-data-[slot=switch]:min-w-touch-target max-md:*:data-[slot=switch]:mx-0", hasMenu ? "flex-nowrap" : "flex-wrap"), children: [actions, hasMenu ? (_jsx("div", { "data-slot": "list-entry-menu", className: "flex shrink-0 items-center justify-center max-md:*:min-h-touch-target max-md:*:min-w-touch-target", children: menu })) : null] })) : null] })) : null, hasLink ? (_jsx("span", { "data-slot": "list-entry-arrow", "aria-hidden": "true", className: "flex shrink-0 text-muted-foreground", children: _jsx(ChevronRight, { strokeWidth: ICON_STROKE_WIDTH, className: "size-4" }) })) : null] })) : null] }));
|
|
68
|
+
}
|
|
43
69
|
/**
|
|
44
70
|
* A run of rows under a `ListGroupHeading` (a country's days, a month's entries), placed straight in the scroll
|
|
45
71
|
* container, which has no top padding of its own: the heading sticks at the top while the group's rows pass under it,
|
package/dist/notion/List.js.map
CHANGED
|
@@ -1 +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;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,IAAI,EAAE,oEAAoE;IAC1E,UAAU,EAAE,wEAAwE;IACpF,IAAI,EAAE,oBAAoB;IAC1B,GAAG,EAAE,uPAAuP;IAC5P,KAAK,EAAE,4CAA4C;IACnD,YAAY,EACV,kIAAkI;IACpI,kBAAkB,EAChB,qIAAqI;CAC/H,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,UAA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C;AACJ,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type LucideIcon } from "lucide-react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
import { type Tone } from "./tones.js";
|
|
4
|
+
/** The icon a result badge draws for each tone when the app passes none. */
|
|
5
|
+
export declare const RESULT_BADGE_ICONS: Readonly<Record<Tone, LucideIcon>>;
|
|
6
|
+
export interface ResultBadgeProps {
|
|
7
|
+
/** What the result means; the theme owns its colour (`TONE_COLORS`), so one result reads alike in every list. */
|
|
8
|
+
readonly tone: Tone;
|
|
9
|
+
/** The app's own icon in place of the tone's default (a spinning run defaults to a loader). */
|
|
10
|
+
readonly icon?: LucideIcon;
|
|
11
|
+
/** A run still in progress: the icon spins, unless the reader asked for reduced motion. */
|
|
12
|
+
readonly isSpinning?: boolean;
|
|
13
|
+
/** The word: a result always carries one, so results read apart without telling colours apart. */
|
|
14
|
+
readonly children: ReactNode;
|
|
15
|
+
/** The full word on hover; defaults to the word itself when it is a string or a number. */
|
|
16
|
+
readonly title?: string;
|
|
17
|
+
readonly className?: string;
|
|
18
|
+
}
|
|
19
|
+
export declare function ResultBadge({ tone, icon, isSpinning, children, title, className }: ResultBadgeProps): import("react").JSX.Element;
|
|
20
|
+
//# sourceMappingURL=ResultBadge.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResultBadge.d.ts","sourceRoot":"","sources":["../../src/notion/ResultBadge.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA0E,KAAK,UAAU,EAAE,MAAM,cAAc,CAAC;AACvH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAMvC,OAAO,EAAe,KAAK,IAAI,EAAE,MAAM,YAAY,CAAC;AAEpD,4EAA4E;AAC5E,eAAO,MAAM,kBAAkB,EAAE,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,UAAU,CAAC,CAMjE,CAAC;AAEF,MAAM,WAAW,gBAAgB;IAC/B,iHAAiH;IACjH,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC;IACpB,+FAA+F;IAC/F,QAAQ,CAAC,IAAI,CAAC,EAAE,UAAU,CAAC;IAC3B,2FAA2F;IAC3F,QAAQ,CAAC,UAAU,CAAC,EAAE,OAAO,CAAC;IAC9B,kGAAkG;IAClG,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAC;IAC7B,2FAA2F;IAC3F,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;CAC7B;AASD,wBAAgB,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAkB,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAE,EAAE,gBAAgB,+BAmB3G"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Circle, CircleCheck, CircleMinus, CircleX, LoaderCircle, TriangleAlert } from "lucide-react";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
import { Badge } from "../ui/badge.js";
|
|
5
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
6
|
+
import { TONE_COLORS } from "./tones.js";
|
|
7
|
+
/** The icon a result badge draws for each tone when the app passes none. */
|
|
8
|
+
export const RESULT_BADGE_ICONS = {
|
|
9
|
+
default: Circle,
|
|
10
|
+
success: CircleCheck,
|
|
11
|
+
warning: TriangleAlert,
|
|
12
|
+
danger: CircleX,
|
|
13
|
+
muted: CircleMinus,
|
|
14
|
+
};
|
|
15
|
+
/** The word as plain text, or undefined when it is any other node. */
|
|
16
|
+
function getPlainText(children) {
|
|
17
|
+
return typeof children === "string" || typeof children === "number" ? String(children) : undefined;
|
|
18
|
+
}
|
|
19
|
+
// A result (passed, failed, skipped, running): a filled tag in its tone's colour, with an icon and a word. The filled
|
|
20
|
+
// counterpart of `Status`, for a list whose rows each end in a result.
|
|
21
|
+
export function ResultBadge({ tone, icon, isSpinning = false, children, title, className }) {
|
|
22
|
+
const Icon = icon ?? (isSpinning ? LoaderCircle : RESULT_BADGE_ICONS[tone]);
|
|
23
|
+
return (_jsxs(Badge, { variant: "tag", color: TONE_COLORS[tone] ?? "default", "data-slot": "result-badge", "data-tone": tone, "data-color": TONE_COLORS[tone] ?? "default", "data-spinning": isSpinning || undefined, title: title ?? getPlainText(children), className: cn("gap-1 [&>svg]:size-3.5 [&>svg]:shrink-0", className), children: [_jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH, className: isSpinning ? "motion-safe:animate-spin" : undefined }), _jsx("span", { "data-slot": "result-badge-label", className: "min-w-0 truncate", children: children })] }));
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=ResultBadge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ResultBadge.js","sourceRoot":"","sources":["../../src/notion/ResultBadge.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,YAAY,EAAE,aAAa,EAAmB,MAAM,cAAc,CAAC;AAGvH,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,MAAM,gBAAgB,CAAC;AAEvC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAa,MAAM,YAAY,CAAC;AAEpD,4EAA4E;AAC5E,MAAM,CAAC,MAAM,kBAAkB,GAAuC;IACpE,OAAO,EAAE,MAAM;IACf,OAAO,EAAE,WAAW;IACpB,OAAO,EAAE,aAAa;IACtB,MAAM,EAAE,OAAO;IACf,KAAK,EAAE,WAAW;CACnB,CAAC;AAgBF,sEAAsE;AACtE,SAAS,YAAY,CAAC,QAAmB;IACvC,OAAO,OAAO,QAAQ,KAAK,QAAQ,IAAI,OAAO,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;AACrG,CAAC;AAED,sHAAsH;AACtH,uEAAuE;AACvE,MAAM,UAAU,WAAW,CAAC,EAAE,IAAI,EAAE,IAAI,EAAE,UAAU,GAAG,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,SAAS,EAAoB;IAC1G,MAAM,IAAI,GAAG,IAAI,IAAI,CAAC,UAAU,CAAC,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC,CAAC;IAC5E,OAAO,CACL,MAAC,KAAK,IACJ,OAAO,EAAC,KAAK,EACb,KAAK,EAAE,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,eAC3B,cAAc,eACb,IAAI,gBACH,WAAW,CAAC,IAAI,CAAC,IAAI,SAAS,mBAC3B,UAAU,IAAI,SAAS,EACtC,KAAK,EAAE,KAAK,IAAI,YAAY,CAAC,QAAQ,CAAC,EACtC,SAAS,EAAE,EAAE,CAAC,yCAAyC,EAAE,SAAS,CAAC,aAEnE,KAAC,IAAI,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,EAAE,SAAS,EAAE,UAAU,CAAC,CAAC,CAAC,0BAA0B,CAAC,CAAC,CAAC,SAAS,GAAI,EAC3H,4BAAgB,oBAAoB,EAAC,SAAS,EAAC,kBAAkB,YAC9D,QAAQ,GACJ,IACD,CACT,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
/** One secondary action of a row: its words, an optional icon, and what it does. */
|
|
3
|
+
export interface RowMenuAction {
|
|
4
|
+
readonly label: string;
|
|
5
|
+
/** A line icon before the words (the theme's stroke and size apply). */
|
|
6
|
+
readonly icon?: ReactNode;
|
|
7
|
+
readonly onSelect: () => void;
|
|
8
|
+
readonly isDisabled?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/** The confirmation a destructive action asks for: the app's own copy. */
|
|
11
|
+
export interface RowMenuConfirmation {
|
|
12
|
+
readonly title: ReactNode;
|
|
13
|
+
readonly description?: ReactNode;
|
|
14
|
+
/** The words of the destructive confirm button. */
|
|
15
|
+
readonly confirmLabel: string;
|
|
16
|
+
/** The words of the button that keeps things as they are. */
|
|
17
|
+
readonly cancelLabel: string;
|
|
18
|
+
}
|
|
19
|
+
/** The destructive action of a row (delete, revoke): last in the menu, in the danger tone. */
|
|
20
|
+
export interface RowMenuDestructiveAction extends RowMenuAction {
|
|
21
|
+
/** Ask first: the action runs only after the alert dialog's confirm button. Without it the action runs at once. */
|
|
22
|
+
readonly confirm?: RowMenuConfirmation;
|
|
23
|
+
}
|
|
24
|
+
export interface RowActionsMenuProps {
|
|
25
|
+
/** The secondary actions, in the order they are listed. */
|
|
26
|
+
readonly actions?: readonly RowMenuAction[];
|
|
27
|
+
/** The destructive action, always last, after a separator. */
|
|
28
|
+
readonly destructiveAction?: RowMenuDestructiveAction;
|
|
29
|
+
/** The button's accessible name; the English default is "More actions". */
|
|
30
|
+
readonly label?: string;
|
|
31
|
+
/** The menu's edge against the button; `end` (the row's right edge) by default. */
|
|
32
|
+
readonly align?: "start" | "center" | "end";
|
|
33
|
+
readonly className?: string;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* A row's overflow menu: an icon-only "More actions" button that opens a menu of the row's secondary actions, the
|
|
37
|
+
* destructive one last, after a separator and in the danger tone, optionally confirmed in an alert dialog. Opens with
|
|
38
|
+
* Enter, Space or ArrowDown; the arrow keys move between items. Place it in `ListEntry`'s `menu` slot, next to the
|
|
39
|
+
* row's one inline control.
|
|
40
|
+
*/
|
|
41
|
+
export declare function RowActionsMenu({ actions, destructiveAction, label, align, className, }: RowActionsMenuProps): import("react").JSX.Element;
|
|
42
|
+
//# sourceMappingURL=RowActionsMenu.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowActionsMen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AChC,KAAa,EACb,SAAS,GACV,EAAE,mBAAmB,+BAyErB"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Ellipsis } from "lucide-react";
|
|
4
|
+
import { useRef, useState } from "react";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { en as messages } from "../messages/en.js";
|
|
7
|
+
import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, } from "../ui/alert-dialog.js";
|
|
8
|
+
import { Button } from "../ui/button.js";
|
|
9
|
+
import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuSeparator, DropdownMenuTrigger, } from "../ui/dropdown-menu.js";
|
|
10
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
11
|
+
/**
|
|
12
|
+
* A row's overflow menu: an icon-only "More actions" button that opens a menu of the row's secondary actions, the
|
|
13
|
+
* destructive one last, after a separator and in the danger tone, optionally confirmed in an alert dialog. Opens with
|
|
14
|
+
* Enter, Space or ArrowDown; the arrow keys move between items. Place it in `ListEntry`'s `menu` slot, next to the
|
|
15
|
+
* row's one inline control.
|
|
16
|
+
*/
|
|
17
|
+
export function RowActionsMenu({ actions = [], destructiveAction, label = messages.rowActions.more, align = "end", className, }) {
|
|
18
|
+
const [isConfirming, setIsConfirming] = useState(false);
|
|
19
|
+
const trigger = useRef(null);
|
|
20
|
+
const confirmation = destructiveAction?.confirm;
|
|
21
|
+
const selectDestructive = () => {
|
|
22
|
+
if (destructiveAction === undefined)
|
|
23
|
+
return;
|
|
24
|
+
if (confirmation === undefined) {
|
|
25
|
+
destructiveAction.onSelect();
|
|
26
|
+
return;
|
|
27
|
+
}
|
|
28
|
+
setIsConfirming(true);
|
|
29
|
+
};
|
|
30
|
+
return (_jsxs(_Fragment, { children: [_jsxs(DropdownMenu, { children: [_jsx(DropdownMenuTrigger, { asChild: true, children: _jsx(Button, { ref: trigger, "data-slot": "row-actions-menu-trigger", type: "button", variant: "ghost", size: "icon", "aria-label": label, className: cn("text-muted-foreground", className), children: _jsx(Ellipsis, { strokeWidth: ICON_STROKE_WIDTH, "aria-hidden": "true" }) }) }), _jsxs(DropdownMenuContent, { align: align, children: [actions.map((action) => (_jsxs(DropdownMenuItem, { disabled: action.isDisabled, onSelect: action.onSelect, children: [action.icon, action.label] }, action.label))), destructiveAction !== undefined && actions.length > 0 ? _jsx(DropdownMenuSeparator, {}) : null, destructiveAction !== undefined ? (_jsxs(DropdownMenuItem, { variant: "destructive", disabled: destructiveAction.isDisabled, onSelect: selectDestructive, children: [destructiveAction.icon, destructiveAction.label] })) : null] })] }), confirmation !== undefined && destructiveAction !== undefined ? (_jsx(AlertDialog, { open: isConfirming, onOpenChange: setIsConfirming, children: _jsxs(AlertDialogContent, { size: "sm", onCloseAutoFocus: (event) => {
|
|
31
|
+
// The menu item that opened the dialog is gone: focus goes back to the menu button.
|
|
32
|
+
event.preventDefault();
|
|
33
|
+
trigger.current?.focus();
|
|
34
|
+
}, children: [_jsxs(AlertDialogHeader, { children: [_jsx(AlertDialogTitle, { children: confirmation.title }), confirmation.description !== undefined ? (_jsx(AlertDialogDescription, { children: confirmation.description })) : null] }), _jsxs(AlertDialogFooter, { children: [_jsx(AlertDialogCancel, { children: confirmation.cancelLabel }), _jsx(AlertDialogAction, { variant: "destructive", onClick: destructiveAction.onSelect, children: confirmation.confirmLabel })] })] }) })) : null] }));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=RowActionsMenu.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RowActionsMenu.js","sourceRoot":"","sources":["../../src/notion/RowActionsMenu.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AACxC,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KAAK,EAAE,CAAC;oBAC3B,CAAC,aAED,MAAC,iBAAiB,eAChB,KAAC,gBAAgB,cAAE,YAAY,CAAC,KAAK,GAAoB,EACxD,YAAY,CAAC,WAAW,KAAK,SAAS,CAAC,CAAC,CAAC,CACxC,KAAC,sBAAsB,cAAE,YAAY,CAAC,WAAW,GAA0B,CAC5E,CAAC,CAAC,CAAC,IAAI,IACU,EACpB,MAAC,iBAAiB,eAChB,KAAC,iBAAiB,cAAE,YAAY,CAAC,WAAW,GAAqB,EACjE,KAAC,iBAAiB,IAAC,OAAO,EAAC,aAAa,EAAC,OAAO,EAAE,iBAAiB,CAAC,QAAQ,YACzE,YAAY,CAAC,YAAY,GACR,IACF,IACD,GACT,CACf,CAAC,CAAC,CAAC,IAAI,IACP,CACJ,CAAC;AACJ,CAAC"}
|
package/dist/ui/badge.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAoBjE,QAAA,MAAM,aAAa;;;8EAyClB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAmB,EACnB,KAAK,EACL,OAAe,EACf,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,GAC5C,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../src/ui/badge.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAO,KAAK,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAoBjE,QAAA,MAAM,aAAa;;;8EAyClB,CAAA;AAED,iBAAS,KAAK,CAAC,EACb,SAAS,EACT,OAAmB,EACnB,KAAK,EACL,OAAe,EACf,GAAG,KAAK,EACT,EAAE,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,GAC5C,YAAY,CAAC,OAAO,aAAa,CAAC,GAAG;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAE,qBAY3D;AAED,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,CAAA"}
|
package/dist/ui/badge.js
CHANGED
|
@@ -55,7 +55,7 @@ const badgeVariants = cva("inline-flex w-fit max-w-full shrink-0 items-center ju
|
|
|
55
55
|
});
|
|
56
56
|
function Badge({ className, variant = "default", color, asChild = false, ...props }) {
|
|
57
57
|
const Comp = asChild ? Slot.Root : "span";
|
|
58
|
-
return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, className: cn(badgeVariants({ variant, color }), className), ...props }));
|
|
58
|
+
return (_jsx(Comp, { "data-slot": "badge", "data-variant": variant, "data-color": color === "none" ? undefined : (color ?? undefined), className: cn(badgeVariants({ variant, color }), className), ...props }));
|
|
59
59
|
}
|
|
60
60
|
export { Badge, badgeVariants };
|
|
61
61
|
//# sourceMappingURL=badge.js.map
|
package/dist/ui/badge.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sourceRoot":"","sources":["../../src/ui/badge.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAC9B,OAAO,EAAE,GAAG,EAAqB,MAAM,0BAA0B,CAAA;AACjE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAA;AACpC,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAA;AAE/B,MAAM,UAAU,GAAG;IACjB,OAAO,EAAE,4CAA4C;IACrD,IAAI,EAAE,sCAAsC;IAC5C,KAAK,EAAE,wCAAwC;IAC/C,MAAM,EAA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|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.35.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",
|
package/src/index.ts
CHANGED
|
@@ -72,11 +72,14 @@ export {
|
|
|
72
72
|
ListGroup,
|
|
73
73
|
ListGroupHeading,
|
|
74
74
|
ListItem,
|
|
75
|
+
ListEntry,
|
|
75
76
|
ListRow,
|
|
76
77
|
type ListGroupHeadingProps,
|
|
77
78
|
type ListGroupProps,
|
|
78
79
|
type ListItemProps,
|
|
79
80
|
type ListProps,
|
|
81
|
+
type ListEntryLinkComponent,
|
|
82
|
+
type ListEntryProps,
|
|
80
83
|
type ListRowProps,
|
|
81
84
|
type ListSurface,
|
|
82
85
|
} from "./notion/List.js";
|
|
@@ -121,6 +124,14 @@ export {
|
|
|
121
124
|
} from "./notion/Stats.js";
|
|
122
125
|
export { FileInput, type FileInputMessages, type FileInputMessagesOverride, type FileInputProps } from "./notion/FileInput.js";
|
|
123
126
|
export { FormGrid, type FormGridColumns, type FormGridProps } from "./notion/FormGrid.js";
|
|
127
|
+
export { RESULT_BADGE_ICONS, ResultBadge, type ResultBadgeProps } from "./notion/ResultBadge.js";
|
|
128
|
+
export {
|
|
129
|
+
RowActionsMenu,
|
|
130
|
+
type RowActionsMenuProps,
|
|
131
|
+
type RowMenuAction,
|
|
132
|
+
type RowMenuConfirmation,
|
|
133
|
+
type RowMenuDestructiveAction,
|
|
134
|
+
} from "./notion/RowActionsMenu.js";
|
|
124
135
|
export { Status, type StatusProps } from "./notion/Status.js";
|
|
125
136
|
export { Steps, type StepItem, type StepState, type StepsLayout, type StepsProps } from "./notion/Steps.js";
|
|
126
137
|
export { TabBar, type TabBarItem, type TabBarProps } from "./notion/TabBar.js";
|
package/src/messages/en.ts
CHANGED
|
@@ -12,6 +12,7 @@ export const en = {
|
|
|
12
12
|
},
|
|
13
13
|
breadcrumb: { label: "breadcrumb", more: "More" },
|
|
14
14
|
copy: { copy: "Copy", copied: "Copied" },
|
|
15
|
+
rowActions: { more: "More actions" },
|
|
15
16
|
dialog: { close: "Close" },
|
|
16
17
|
fileInput: { choose: "Choose a file", chooseMany: "Choose files", none: "No file chosen", count: "{count} files" },
|
|
17
18
|
filterChip: { add: "Add filter" },
|
package/src/notion/List.tsx
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import type { Density } from "@softure-ai/theme-kit";
|
|
2
|
+
import { ChevronRight } from "lucide-react";
|
|
2
3
|
import { Slot } from "radix-ui";
|
|
3
|
-
import type { ComponentProps } from "react";
|
|
4
|
+
import type { ComponentProps, ElementType, ReactNode } from "react";
|
|
4
5
|
|
|
5
6
|
import { cn } from "../lib/utils.js";
|
|
6
7
|
|
|
8
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
9
|
+
|
|
7
10
|
/**
|
|
8
11
|
* The classes of a list that follows the density (`data-density` on the list or an ancestor; theme-kit's
|
|
9
12
|
* `--list-*` variables). For a list the app renders itself, such as a `SortableList` and its `SortableItem`s.
|
|
@@ -78,6 +81,147 @@ export function ListRow({ asChild = false, className, ...props }: ListRowProps)
|
|
|
78
81
|
return <Comp data-slot="list-row" className={cn(LIST_CLASSES.row, className)} {...props} />;
|
|
79
82
|
}
|
|
80
83
|
|
|
84
|
+
/** The link a `ListEntry` title renders: a plain `a`, or the app's router link taking the same props. */
|
|
85
|
+
export type ListEntryLinkComponent = ElementType<{ href: string; className?: string; children?: ReactNode }>;
|
|
86
|
+
|
|
87
|
+
export type ListEntryProps = Omit<ComponentProps<"div">, "title" | "children"> & {
|
|
88
|
+
/** What the row is: its name, in the medium weight. With `href` it is the link that opens the row. */
|
|
89
|
+
readonly title: ReactNode;
|
|
90
|
+
/** Lines under the title (facts, a path, a time), in the muted colour; the app lays out its own lines. */
|
|
91
|
+
readonly details?: ReactNode;
|
|
92
|
+
/** The row's state, at the top of the right column (one or more badges, which wrap right-aligned). */
|
|
93
|
+
readonly status?: ReactNode;
|
|
94
|
+
/**
|
|
95
|
+
* The row's controls, under the status. They stay their own targets above the row's link, and are at least the
|
|
96
|
+
* touch target (44 px) on a phone; a switch keeps its track and takes its 44 px square from `size="touch"` (with
|
|
97
|
+
* `className="md:m-0 md:h-4 md:w-[26px]"` for the plain switch on a desktop). A control marked `data-row-wide` (an inline form that needs room) makes the right
|
|
98
|
+
* column take the full row width under the identity, its lines starting on the left.
|
|
99
|
+
*/
|
|
100
|
+
readonly actions?: ReactNode;
|
|
101
|
+
/**
|
|
102
|
+
* The row's other actions behind a "More actions" button (a `RowActionsMenu`), at the end of the actions line: it
|
|
103
|
+
* stays on one line with the inline control and is at least the touch target (44 px) on a phone.
|
|
104
|
+
*/
|
|
105
|
+
readonly menu?: ReactNode;
|
|
106
|
+
/** The row opens this address: the title's link is stretched over the whole row, with an arrow at its right. */
|
|
107
|
+
readonly href?: string;
|
|
108
|
+
/** The element for the link (a router's link component); a plain `a` by default. */
|
|
109
|
+
readonly linkComponent?: ListEntryLinkComponent;
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
function isDrawn(node: ReactNode): boolean {
|
|
113
|
+
return node !== undefined && node !== null && node !== false;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
/**
|
|
117
|
+
* A list row with an identity and a right column: the title and its detail lines on the left, the row's state at the
|
|
118
|
+
* top of the right column and its controls under it. With `href` the title is a link stretched over the whole row, so
|
|
119
|
+
* the row is one box lit on hover, and an arrow sits beside the column (never on a line of its own); the column stays
|
|
120
|
+
* above the link. On a phone (below `md`) the column wraps under the identity, right-aligned. Place it in a `ListItem`.
|
|
121
|
+
*
|
|
122
|
+
* Row controls: at most one control inline in `actions` (a switch, or the row's one primary action); every other
|
|
123
|
+
* action goes into `menu`, the destructive one last. A row with a single action keeps it inline and has no menu.
|
|
124
|
+
* Row state: each fact once. A switch is its own on/off state (no badge or label repeating it); a `ResultBadge`
|
|
125
|
+
* carries its own icon, so no separate state icon stands next to it.
|
|
126
|
+
*/
|
|
127
|
+
export function ListEntry({
|
|
128
|
+
title,
|
|
129
|
+
details,
|
|
130
|
+
status,
|
|
131
|
+
actions,
|
|
132
|
+
menu,
|
|
133
|
+
href,
|
|
134
|
+
linkComponent: Link = "a",
|
|
135
|
+
className,
|
|
136
|
+
...props
|
|
137
|
+
}: ListEntryProps) {
|
|
138
|
+
const hasStatus = isDrawn(status);
|
|
139
|
+
const hasActions = isDrawn(actions);
|
|
140
|
+
const hasMenu = isDrawn(menu);
|
|
141
|
+
const hasControls = hasActions || hasMenu;
|
|
142
|
+
const hasColumn = hasStatus || hasControls;
|
|
143
|
+
const hasLink = href !== undefined;
|
|
144
|
+
const titleClasses = "min-w-0 text-ui-medium text-foreground";
|
|
145
|
+
return (
|
|
146
|
+
<div
|
|
147
|
+
data-slot="list-entry"
|
|
148
|
+
className={cn(
|
|
149
|
+
"relative flex w-full min-w-0 flex-wrap items-center gap-x-3 gap-y-1 rounded-md px-2 py-(--list-row-y) text-ui transition-colors duration-100 hover:bg-accent",
|
|
150
|
+
"has-[[data-slot=list-entry-title]:focus-visible]:ring-2 has-[[data-slot=list-entry-title]:focus-visible]:ring-ring",
|
|
151
|
+
className,
|
|
152
|
+
)}
|
|
153
|
+
{...props}
|
|
154
|
+
>
|
|
155
|
+
<div data-slot="list-entry-identity" className="flex min-w-0 flex-1 basis-48 flex-col gap-0.5 max-md:basis-full">
|
|
156
|
+
{hasLink ? (
|
|
157
|
+
<Link
|
|
158
|
+
data-slot="list-entry-title"
|
|
159
|
+
href={href}
|
|
160
|
+
className={cn(titleClasses, "outline-none after:absolute after:inset-0 after:rounded-md after:content-['']")}
|
|
161
|
+
>
|
|
162
|
+
{title}
|
|
163
|
+
</Link>
|
|
164
|
+
) : (
|
|
165
|
+
<span data-slot="list-entry-title" className={titleClasses}>
|
|
166
|
+
{title}
|
|
167
|
+
</span>
|
|
168
|
+
)}
|
|
169
|
+
{isDrawn(details) ? (
|
|
170
|
+
<div data-slot="list-entry-details" className="flex min-w-0 flex-col text-ui text-muted-foreground">
|
|
171
|
+
{details}
|
|
172
|
+
</div>
|
|
173
|
+
) : null}
|
|
174
|
+
</div>
|
|
175
|
+
{hasColumn || hasLink ? (
|
|
176
|
+
<div
|
|
177
|
+
data-slot="list-entry-side"
|
|
178
|
+
className="group/list-entry-side pointer-events-none relative z-10 ml-auto flex max-w-full min-w-0 flex-nowrap items-center gap-2 has-[[data-row-wide]]:ml-0 has-[[data-row-wide]]:basis-full"
|
|
179
|
+
>
|
|
180
|
+
{hasColumn ? (
|
|
181
|
+
<div
|
|
182
|
+
data-slot="list-entry-column"
|
|
183
|
+
className="flex min-w-0 flex-col items-end gap-1 has-[[data-row-wide]]:flex-1 has-[[data-row-wide]]:items-stretch"
|
|
184
|
+
>
|
|
185
|
+
{hasStatus ? (
|
|
186
|
+
<div
|
|
187
|
+
data-slot="list-entry-status"
|
|
188
|
+
className="pointer-events-auto flex min-w-0 flex-wrap items-center justify-end gap-1 group-has-[[data-row-wide]]/list-entry-side:justify-start"
|
|
189
|
+
>
|
|
190
|
+
{status}
|
|
191
|
+
</div>
|
|
192
|
+
) : null}
|
|
193
|
+
{hasControls ? (
|
|
194
|
+
<div
|
|
195
|
+
data-slot="list-entry-actions"
|
|
196
|
+
className={cn(
|
|
197
|
+
"pointer-events-auto flex min-w-0 items-center justify-end gap-1 has-[[data-row-wide]]:flex-col has-[[data-row-wide]]:items-stretch has-[[data-row-wide]]:justify-start max-md:*:not-data-[slot=switch]:min-h-touch-target max-md:*:not-data-[slot=switch]:min-w-touch-target max-md:*:data-[slot=switch]:mx-0",
|
|
198
|
+
hasMenu ? "flex-nowrap" : "flex-wrap",
|
|
199
|
+
)}
|
|
200
|
+
>
|
|
201
|
+
{actions}
|
|
202
|
+
{hasMenu ? (
|
|
203
|
+
<div
|
|
204
|
+
data-slot="list-entry-menu"
|
|
205
|
+
className="flex shrink-0 items-center justify-center max-md:*:min-h-touch-target max-md:*:min-w-touch-target"
|
|
206
|
+
>
|
|
207
|
+
{menu}
|
|
208
|
+
</div>
|
|
209
|
+
) : null}
|
|
210
|
+
</div>
|
|
211
|
+
) : null}
|
|
212
|
+
</div>
|
|
213
|
+
) : null}
|
|
214
|
+
{hasLink ? (
|
|
215
|
+
<span data-slot="list-entry-arrow" aria-hidden="true" className="flex shrink-0 text-muted-foreground">
|
|
216
|
+
<ChevronRight strokeWidth={ICON_STROKE_WIDTH} className="size-4" />
|
|
217
|
+
</span>
|
|
218
|
+
) : null}
|
|
219
|
+
</div>
|
|
220
|
+
) : null}
|
|
221
|
+
</div>
|
|
222
|
+
);
|
|
223
|
+
}
|
|
224
|
+
|
|
81
225
|
export type ListGroupProps = ComponentProps<"div"> & {
|
|
82
226
|
/** Renders the child element (a `section`, an app's own `li`) with the group's classes. */
|
|
83
227
|
readonly asChild?: boolean;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { Circle, CircleCheck, CircleMinus, CircleX, LoaderCircle, TriangleAlert, type LucideIcon } from "lucide-react";
|
|
2
|
+
import type { ReactNode } from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
import { Badge } from "../ui/badge.js";
|
|
6
|
+
|
|
7
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
8
|
+
import { TONE_COLORS, type Tone } from "./tones.js";
|
|
9
|
+
|
|
10
|
+
/** The icon a result badge draws for each tone when the app passes none. */
|
|
11
|
+
export const RESULT_BADGE_ICONS: Readonly<Record<Tone, LucideIcon>> = {
|
|
12
|
+
default: Circle,
|
|
13
|
+
success: CircleCheck,
|
|
14
|
+
warning: TriangleAlert,
|
|
15
|
+
danger: CircleX,
|
|
16
|
+
muted: CircleMinus,
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export interface ResultBadgeProps {
|
|
20
|
+
/** What the result means; the theme owns its colour (`TONE_COLORS`), so one result reads alike in every list. */
|
|
21
|
+
readonly tone: Tone;
|
|
22
|
+
/** The app's own icon in place of the tone's default (a spinning run defaults to a loader). */
|
|
23
|
+
readonly icon?: LucideIcon;
|
|
24
|
+
/** A run still in progress: the icon spins, unless the reader asked for reduced motion. */
|
|
25
|
+
readonly isSpinning?: boolean;
|
|
26
|
+
/** The word: a result always carries one, so results read apart without telling colours apart. */
|
|
27
|
+
readonly children: ReactNode;
|
|
28
|
+
/** The full word on hover; defaults to the word itself when it is a string or a number. */
|
|
29
|
+
readonly title?: string;
|
|
30
|
+
readonly className?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** The word as plain text, or undefined when it is any other node. */
|
|
34
|
+
function getPlainText(children: ReactNode): string | undefined {
|
|
35
|
+
return typeof children === "string" || typeof children === "number" ? String(children) : undefined;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
// A result (passed, failed, skipped, running): a filled tag in its tone's colour, with an icon and a word. The filled
|
|
39
|
+
// counterpart of `Status`, for a list whose rows each end in a result.
|
|
40
|
+
export function ResultBadge({ tone, icon, isSpinning = false, children, title, className }: ResultBadgeProps) {
|
|
41
|
+
const Icon = icon ?? (isSpinning ? LoaderCircle : RESULT_BADGE_ICONS[tone]);
|
|
42
|
+
return (
|
|
43
|
+
<Badge
|
|
44
|
+
variant="tag"
|
|
45
|
+
color={TONE_COLORS[tone] ?? "default"}
|
|
46
|
+
data-slot="result-badge"
|
|
47
|
+
data-tone={tone}
|
|
48
|
+
data-color={TONE_COLORS[tone] ?? "default"}
|
|
49
|
+
data-spinning={isSpinning || undefined}
|
|
50
|
+
title={title ?? getPlainText(children)}
|
|
51
|
+
className={cn("gap-1 [&>svg]:size-3.5 [&>svg]:shrink-0", className)}
|
|
52
|
+
>
|
|
53
|
+
<Icon aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} className={isSpinning ? "motion-safe:animate-spin" : undefined} />
|
|
54
|
+
<span data-slot="result-badge-label" className="min-w-0 truncate">
|
|
55
|
+
{children}
|
|
56
|
+
</span>
|
|
57
|
+
</Badge>
|
|
58
|
+
);
|
|
59
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Ellipsis } from "lucide-react";
|
|
4
|
+
import { useRef, useState, type ReactNode } from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { en as messages } from "../messages/en.js";
|
|
8
|
+
import {
|
|
9
|
+
AlertDialog,
|
|
10
|
+
AlertDialogAction,
|
|
11
|
+
AlertDialogCancel,
|
|
12
|
+
AlertDialogContent,
|
|
13
|
+
AlertDialogDescription,
|
|
14
|
+
AlertDialogFooter,
|
|
15
|
+
AlertDialogHeader,
|
|
16
|
+
AlertDialogTitle,
|
|
17
|
+
} from "../ui/alert-dialog.js";
|
|
18
|
+
import { Button } from "../ui/button.js";
|
|
19
|
+
import {
|
|
20
|
+
DropdownMenu,
|
|
21
|
+
DropdownMenuContent,
|
|
22
|
+
DropdownMenuItem,
|
|
23
|
+
DropdownMenuSeparator,
|
|
24
|
+
DropdownMenuTrigger,
|
|
25
|
+
} from "../ui/dropdown-menu.js";
|
|
26
|
+
|
|
27
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
28
|
+
|
|
29
|
+
/** One secondary action of a row: its words, an optional icon, and what it does. */
|
|
30
|
+
export interface RowMenuAction {
|
|
31
|
+
readonly label: string;
|
|
32
|
+
/** A line icon before the words (the theme's stroke and size apply). */
|
|
33
|
+
readonly icon?: ReactNode;
|
|
34
|
+
readonly onSelect: () => void;
|
|
35
|
+
readonly isDisabled?: boolean;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/** The confirmation a destructive action asks for: the app's own copy. */
|
|
39
|
+
export interface RowMenuConfirmation {
|
|
40
|
+
readonly title: ReactNode;
|
|
41
|
+
readonly description?: ReactNode;
|
|
42
|
+
/** The words of the destructive confirm button. */
|
|
43
|
+
readonly confirmLabel: string;
|
|
44
|
+
/** The words of the button that keeps things as they are. */
|
|
45
|
+
readonly cancelLabel: string;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
/** The destructive action of a row (delete, revoke): last in the menu, in the danger tone. */
|
|
49
|
+
export interface RowMenuDestructiveAction extends RowMenuAction {
|
|
50
|
+
/** Ask first: the action runs only after the alert dialog's confirm button. Without it the action runs at once. */
|
|
51
|
+
readonly confirm?: RowMenuConfirmation;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface RowActionsMenuProps {
|
|
55
|
+
/** The secondary actions, in the order they are listed. */
|
|
56
|
+
readonly actions?: readonly RowMenuAction[];
|
|
57
|
+
/** The destructive action, always last, after a separator. */
|
|
58
|
+
readonly destructiveAction?: RowMenuDestructiveAction;
|
|
59
|
+
/** The button's accessible name; the English default is "More actions". */
|
|
60
|
+
readonly label?: string;
|
|
61
|
+
/** The menu's edge against the button; `end` (the row's right edge) by default. */
|
|
62
|
+
readonly align?: "start" | "center" | "end";
|
|
63
|
+
readonly className?: string;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* A row's overflow menu: an icon-only "More actions" button that opens a menu of the row's secondary actions, the
|
|
68
|
+
* destructive one last, after a separator and in the danger tone, optionally confirmed in an alert dialog. Opens with
|
|
69
|
+
* Enter, Space or ArrowDown; the arrow keys move between items. Place it in `ListEntry`'s `menu` slot, next to the
|
|
70
|
+
* row's one inline control.
|
|
71
|
+
*/
|
|
72
|
+
export function RowActionsMenu({
|
|
73
|
+
actions = [],
|
|
74
|
+
destructiveAction,
|
|
75
|
+
label = messages.rowActions.more,
|
|
76
|
+
align = "end",
|
|
77
|
+
className,
|
|
78
|
+
}: RowActionsMenuProps) {
|
|
79
|
+
const [isConfirming, setIsConfirming] = useState(false);
|
|
80
|
+
const trigger = useRef<HTMLButtonElement>(null);
|
|
81
|
+
const confirmation = destructiveAction?.confirm;
|
|
82
|
+
|
|
83
|
+
const selectDestructive = () => {
|
|
84
|
+
if (destructiveAction === undefined) return;
|
|
85
|
+
if (confirmation === undefined) {
|
|
86
|
+
destructiveAction.onSelect();
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
setIsConfirming(true);
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
return (
|
|
93
|
+
<>
|
|
94
|
+
<DropdownMenu>
|
|
95
|
+
<DropdownMenuTrigger asChild>
|
|
96
|
+
<Button
|
|
97
|
+
ref={trigger}
|
|
98
|
+
data-slot="row-actions-menu-trigger"
|
|
99
|
+
type="button"
|
|
100
|
+
variant="ghost"
|
|
101
|
+
size="icon"
|
|
102
|
+
aria-label={label}
|
|
103
|
+
className={cn("text-muted-foreground", className)}
|
|
104
|
+
>
|
|
105
|
+
<Ellipsis strokeWidth={ICON_STROKE_WIDTH} aria-hidden="true" />
|
|
106
|
+
</Button>
|
|
107
|
+
</DropdownMenuTrigger>
|
|
108
|
+
<DropdownMenuContent align={align}>
|
|
109
|
+
{actions.map((action) => (
|
|
110
|
+
<DropdownMenuItem key={action.label} disabled={action.isDisabled} onSelect={action.onSelect}>
|
|
111
|
+
{action.icon}
|
|
112
|
+
{action.label}
|
|
113
|
+
</DropdownMenuItem>
|
|
114
|
+
))}
|
|
115
|
+
{destructiveAction !== undefined && actions.length > 0 ? <DropdownMenuSeparator /> : null}
|
|
116
|
+
{destructiveAction !== undefined ? (
|
|
117
|
+
<DropdownMenuItem variant="destructive" disabled={destructiveAction.isDisabled} onSelect={selectDestructive}>
|
|
118
|
+
{destructiveAction.icon}
|
|
119
|
+
{destructiveAction.label}
|
|
120
|
+
</DropdownMenuItem>
|
|
121
|
+
) : null}
|
|
122
|
+
</DropdownMenuContent>
|
|
123
|
+
</DropdownMenu>
|
|
124
|
+
{confirmation !== undefined && destructiveAction !== undefined ? (
|
|
125
|
+
<AlertDialog open={isConfirming} onOpenChange={setIsConfirming}>
|
|
126
|
+
<AlertDialogContent
|
|
127
|
+
size="sm"
|
|
128
|
+
onCloseAutoFocus={(event) => {
|
|
129
|
+
// The menu item that opened the dialog is gone: focus goes back to the menu button.
|
|
130
|
+
event.preventDefault();
|
|
131
|
+
trigger.current?.focus();
|
|
132
|
+
}}
|
|
133
|
+
>
|
|
134
|
+
<AlertDialogHeader>
|
|
135
|
+
<AlertDialogTitle>{confirmation.title}</AlertDialogTitle>
|
|
136
|
+
{confirmation.description !== undefined ? (
|
|
137
|
+
<AlertDialogDescription>{confirmation.description}</AlertDialogDescription>
|
|
138
|
+
) : null}
|
|
139
|
+
</AlertDialogHeader>
|
|
140
|
+
<AlertDialogFooter>
|
|
141
|
+
<AlertDialogCancel>{confirmation.cancelLabel}</AlertDialogCancel>
|
|
142
|
+
<AlertDialogAction variant="destructive" onClick={destructiveAction.onSelect}>
|
|
143
|
+
{confirmation.confirmLabel}
|
|
144
|
+
</AlertDialogAction>
|
|
145
|
+
</AlertDialogFooter>
|
|
146
|
+
</AlertDialogContent>
|
|
147
|
+
</AlertDialog>
|
|
148
|
+
) : null}
|
|
149
|
+
</>
|
|
150
|
+
);
|
|
151
|
+
}
|