@softure-ai/theme-notion 0.22.0 → 0.24.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 +19 -0
- package/README.md +45 -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/messages/en.d.ts +4 -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 +4 -0
- package/dist/messages/index.d.ts.map +1 -1
- package/dist/notion/CopyButton.d.ts +14 -0
- package/dist/notion/CopyButton.d.ts.map +1 -0
- package/dist/notion/CopyButton.js +38 -0
- package/dist/notion/CopyButton.js.map +1 -0
- 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 +11 -0
- package/src/messages/en.ts +1 -0
- package/src/notion/CopyButton.tsx +80 -0
- package/src/notion/List.tsx +70 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,25 @@ 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.24.0
|
|
8
|
+
|
|
9
|
+
- `CopyButton`: one value to the clipboard, a `secondary` button with a copy icon that says "Copied" (with a tick) for
|
|
10
|
+
two seconds once the browser took the text, announced politely; a refused write leaves it as it was. Its words are
|
|
11
|
+
props (`label`, `copiedLabel`), English by default (`notionMessages.en.copy`); `onCopied` tells the app.
|
|
12
|
+
- Migration: none; no existing component changes.
|
|
13
|
+
|
|
14
|
+
## 0.23.0
|
|
15
|
+
|
|
16
|
+
- List density (#1341): `List`, `ListItem` and `ListRow`, a list of rows that is `compact` (tight rows, no line
|
|
17
|
+
between them, the default) or `roomy` (a quiet `border` line between rows and one more 4 px step around each), by
|
|
18
|
+
`data-density` on `<html>`, a page or a section, or `density` on the list. They read theme-kit 0.1.10's
|
|
19
|
+
`--list-row-y`, `--list-item-y`, `--list-divider-width`. `List surface="tinted"` draws the line in the page's
|
|
20
|
+
`background` on a grey card, where the dark scheme's `border` is the card's own grey. `ListItem asChild` and
|
|
21
|
+
`ListRow asChild` keep the app's element; `LIST_CLASSES` gives the same classes to a list the app renders itself (a
|
|
22
|
+
`SortableList`).
|
|
23
|
+
- Migration: none; no existing component changes. An app with its own roomy list classes (`divide-y divide-border` on
|
|
24
|
+
the list, `py-1` on each item, `py-2` on each row) can move to `List` and set `data-density="roomy"`.
|
|
25
|
+
|
|
7
26
|
## 0.22.0
|
|
8
27
|
|
|
9
28
|
- Smooth resize drags over a large `SidePanel` (#1326):
|
package/README.md
CHANGED
|
@@ -81,7 +81,7 @@ import { CircleCheck } from "lucide-react";
|
|
|
81
81
|
**Copy.** The components' built-in texts are accessible names in English (`notionMessages.en`). Pass the app's own
|
|
82
82
|
wording by props: `Breadcrumb aria-label`, `BreadcrumbEllipsis label`, `PageHeader crumbsLabel`,
|
|
83
83
|
`DialogContent closeLabel`, `DialogFooter closeLabel` (the `showCloseButton` button's text), `SheetContent closeLabel`, `SidePanel closeLabel`, `AsidePanelToggle showLabel hideLabel`,
|
|
84
|
-
`AsidePanel widenLabel narrowLabel closeLabel`, `AsidePanelSidebarOpener label`, `Steps stateLabels`,
|
|
84
|
+
`AsidePanel widenLabel narrowLabel closeLabel`, `AsidePanelSidebarOpener label`, `Steps stateLabels`, `CopyButton label copiedLabel`,
|
|
85
85
|
`Sidebar mobileTitle mobileDescription`, `SidebarTrigger label`, `SidebarRail label`, `Spinner aria-label`,
|
|
86
86
|
`CommandDialog title description` (`title` also names its search field), `Command label` (the search field's
|
|
87
87
|
name outside a `CommandDialog`; without it the field has none), `SortableList instructions announcements`, `SortableHandle label`.
|
|
@@ -144,7 +144,9 @@ and more, a native `<details>`), `PageFrame` (a page outside the app shell, such
|
|
|
144
144
|
and count, the shown tab in the address; `Tabs` keeps it in client state), `MarkPopover` (a counted tag that opens a
|
|
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
|
+
`CopyButton` (one value to the clipboard, with a moment of "Copied", below),
|
|
147
148
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below),
|
|
149
|
+
`List`, `ListItem` and `ListRow` (a list of rows, compact or roomy by the page's density, below),
|
|
148
150
|
`MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
|
|
149
151
|
`UpdatePrompt` (the offer to reload into a new build, for an installed app, below),
|
|
150
152
|
`InstallBar` (the offer to install the app on a phone, below),
|
|
@@ -457,6 +459,34 @@ and the body's parts mark the parts.
|
|
|
457
459
|
/>
|
|
458
460
|
```
|
|
459
461
|
|
|
462
|
+
**`List`, `ListItem`, `ListRow`: list density.** A list of rows (days, places, a bag of items) that is `compact`
|
|
463
|
+
(tight rows, no line between them, the default) or `roomy` (a quiet `border` line between rows and one more 4 px step
|
|
464
|
+
around each, so the rows breathe). The density comes from `data-density` on the nearest ancestor (`<html>` for a user
|
|
465
|
+
setting, a page, a section) or `density` on the list itself; the lengths are theme-kit's `--list-row-y`,
|
|
466
|
+
`--list-item-y` and `--list-divider-width` (theme-kit README, "List density"). The line is drawn between rows only, so
|
|
467
|
+
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
|
|
468
|
+
grey card (`secondary`, `muted`) pass `surface="tinted"`: the line takes the page's `background`, because in the dark
|
|
469
|
+
scheme the theme's `border` is that card's own grey.
|
|
470
|
+
|
|
471
|
+
```tsx
|
|
472
|
+
<html data-density="roomy">
|
|
473
|
+
…
|
|
474
|
+
<List as="ol" aria-label="Days">
|
|
475
|
+
{days.map((day) => (
|
|
476
|
+
<ListItem key={day.id}>
|
|
477
|
+
<ListRow asChild>
|
|
478
|
+
<button type="button" onClick={() => open(day.id)}>{day.label}</button>
|
|
479
|
+
</ListRow>
|
|
480
|
+
</ListItem>
|
|
481
|
+
))}
|
|
482
|
+
</List>
|
|
483
|
+
<List surface="tinted" density="compact">…</List> {/* this one stays compact on a roomy page */}
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
`ListItem asChild` and `ListRow asChild` keep the app's own element (a sortable item, a link). For a list the app
|
|
487
|
+
renders with other components, `LIST_CLASSES` holds the same classes (`list`, `tintedList`, `item`, `row`), e.g.
|
|
488
|
+
`<SortableList className={LIST_CLASSES.list}>` with `<SortableItem className={LIST_CLASSES.item}>`.
|
|
489
|
+
|
|
460
490
|
**`MiniProgress`.** A share with its figure inside the bar, for a table cell or a tile where a figure next to a
|
|
461
491
|
`Progress` would collide with it: a 20 px rounded track (`primary/12`) that takes the cell's width (at least 64 px),
|
|
462
492
|
filled in `primary` (the link blue in dark, as in `Progress`) or in its `tone`'s colour. `value` is 0–100, clamped
|
|
@@ -502,6 +532,20 @@ plain text. No syntax highlighting. `data-slot="code"` and `data-slot="code-bloc
|
|
|
502
532
|
<CodeBlock label="Build log" wrap>{log}</CodeBlock>
|
|
503
533
|
```
|
|
504
534
|
|
|
535
|
+
**`CopyButton`.** One value to the clipboard, for a URL, a command or a code the reader pastes elsewhere: a
|
|
536
|
+
`secondary` button (any `Button` variant and size) with Lucide's copy icon that turns into a tick and says
|
|
537
|
+
`copiedLabel` for two seconds once the browser took the text, announced politely to a screen
|
|
538
|
+
reader. A refused write (an insecure page, a denied permission) leaves it as it was, so keep the value visible beside
|
|
539
|
+
it (a `CodeBlock`) for the reader to select by hand. The value is never part of the button's name; `onCopied` tells the
|
|
540
|
+
app after a copy. A client component. `data-slot="copy-button"`, `data-copied` while it says "Copied".
|
|
541
|
+
|
|
542
|
+
```tsx
|
|
543
|
+
<div className="flex items-center gap-2">
|
|
544
|
+
<CodeBlock className="min-w-0 flex-1">{url}</CodeBlock>
|
|
545
|
+
<CopyButton value={url} label="Copy URL" copiedLabel="Copied" />
|
|
546
|
+
</div>
|
|
547
|
+
```
|
|
548
|
+
|
|
505
549
|
**`UpdatePrompt`.** The offer to reload into a new build, for an installed app on `@softure-ai/pwa`: a floating
|
|
506
550
|
`Alert` at the bottom of the screen (`shadow-menu`, at most `max-w-md`), padded by the safe-area insets so it clears a
|
|
507
551
|
phone's home indicator and notch, with a reload `Button` at the touch height (`md:h-7` on a desktop). It is a polite
|
package/dist/index.d.ts
CHANGED
|
@@ -44,11 +44,13 @@ export { ICON_STROKE_WIDTH } from "./notion/icon-stroke.js";
|
|
|
44
44
|
export { AsidePanel, AsidePanelProvider, AsidePanelSidebarOpener, AsidePanelToggle, useAsidePanel, type AsidePanelProps, type AsidePanelProviderProps, type AsidePanelSidebarOpenerProps, type AsidePanelState, type AsidePanelToggleProps, type AsidePanelWidth, } from "./notion/AsidePanel.js";
|
|
45
45
|
export { isOverlayOpen } from "./notion/overlay-open.js";
|
|
46
46
|
export { Code, CodeBlock, type CodeBlockProps } from "./notion/Code.js";
|
|
47
|
+
export { CopyButton, type CopyButtonProps } from "./notion/CopyButton.js";
|
|
47
48
|
export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/DetailTable.js";
|
|
48
49
|
export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProps } from "./notion/FilterChip.js";
|
|
49
50
|
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
50
51
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
51
52
|
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
53
|
+
export { LIST_CLASSES, List, ListItem, ListRow, type ListItemProps, type ListProps, type ListRowProps, type ListSurface, } from "./notion/List.js";
|
|
52
54
|
export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
|
|
53
55
|
export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
54
56
|
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":"","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/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,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cA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AK,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
|
@@ -46,11 +46,13 @@ export { ICON_STROKE_WIDTH } from "./notion/icon-stroke.js";
|
|
|
46
46
|
export { AsidePanel, AsidePanelProvider, AsidePanelSidebarOpener, AsidePanelToggle, useAsidePanel, } from "./notion/AsidePanel.js";
|
|
47
47
|
export { isOverlayOpen } from "./notion/overlay-open.js";
|
|
48
48
|
export { Code, CodeBlock } from "./notion/Code.js";
|
|
49
|
+
export { CopyButton } from "./notion/CopyButton.js";
|
|
49
50
|
export { DetailTable } from "./notion/DetailTable.js";
|
|
50
51
|
export { FilterChip, FilterChipAdd } from "./notion/FilterChip.js";
|
|
51
52
|
export { FoldRow } from "./notion/FoldRow.js";
|
|
52
53
|
export { InstallBar } from "./notion/InstallBar.js";
|
|
53
54
|
export { LaunchScreen } from "./notion/LaunchScreen.js";
|
|
55
|
+
export { LIST_CLASSES, List, ListItem, ListRow, } from "./notion/List.js";
|
|
54
56
|
export { PALETTE_COLORS } from "./notion/palette.js";
|
|
55
57
|
export { MarkPopover } from "./notion/MarkPopover.js";
|
|
56
58
|
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,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,cAAc,aAAa,CAAC;AAC5B,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,yB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AO;iBAAI,KAAK,EAAE,iBAAiB;iBAAE,WAAW,EAAE,gCAAgC;;CAC1E,CAAC"}
|
package/dist/messages/en.js
CHANGED
|
@@ -11,6 +11,7 @@ export const en = {
|
|
|
11
11
|
showSidebar: "Show the menu and hide the panel",
|
|
12
12
|
},
|
|
13
13
|
breadcrumb: { label: "breadcrumb", more: "More" },
|
|
14
|
+
copy: { copy: "Copy", copied: "Copied" },
|
|
14
15
|
dialog: { close: "Close" },
|
|
15
16
|
fileInput: { choose: "Choose a file", chooseMany: "Choose files", none: "No file chosen", count: "{count} files" },
|
|
16
17
|
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,EAAE;IACjD,MAAM,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;IAC1B,SAAS,EAAE,EAAE,MAAM,EAAE,eAAe,EAAE,UAAU,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,EAAE,KAAK,EAAE,eAAe,EAAE;IAClH,UAAU,EAAE,EAAE,GAAG,EAAE,YAAY,EAAE;IACjC,KAAK,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;IACzB,SAAS,EAAE,EAAE,KAAK,EAAE,OAAO,EAAE;IAC7B,OAAO,EAAE,EAAE,WAAW,EAAE,SAAS,EAAE,iBAAiB,EAAE,8BAA8B,EAAE,MAAM,EAAE,gBAAgB,EAAE;IAChH,OAAO,EAAE,EAAE,K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eAAe;QACvB,QAAQ,EAAE,kBAAkB;QAC5B,MAAM,EAAE,QAAQ;QAChB,SAAS,EAAE,WAAW;QACtB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;KACjB;IACD,QAAQ,EAAE;QACR,KAAK,EAAE,OAAO;QACd,MAAM,EAAE,SAAS;QACjB,OAAO,EAAE,UAAU;QACnB,IAAI,EAAE,YAAY;QAClB,SAAS,EAAE,eAAe;QAC1B,YAAY,EAAE,QAAQ;QACtB,IAAI,EAAE,0BAA0B;QAChC,OAAO,EAAE,sBAAsB;QAC/B,MAAM,EAAE,gCAAgC;QACxC,WAAW,EAAE,6CAA6C;QAC1D,OAAO,EAAE,mBAAmB;QAC5B,IAAI,EAAE,MAAM;KACb;IACD,KAAK,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE;IAC5E,OAAO,EAAE,EAAE,KAAK,EAAE,iBAAiB,EAAE,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"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { type ComponentProps } from "react";
|
|
2
|
+
import { Button } from "../ui/button.js";
|
|
3
|
+
export interface CopyButtonProps extends Omit<ComponentProps<typeof Button>, "onClick" | "children" | "asChild" | "value"> {
|
|
4
|
+
/** The text written to the clipboard. */
|
|
5
|
+
readonly value: string;
|
|
6
|
+
/** The button's text before a copy; the English default is "Copy". */
|
|
7
|
+
readonly label?: string;
|
|
8
|
+
/** The button's text for a moment after a copy; the English default is "Copied". */
|
|
9
|
+
readonly copiedLabel?: string;
|
|
10
|
+
/** Told after the value reached the clipboard (e.g. to count a funnel step). */
|
|
11
|
+
readonly onCopied?: () => void;
|
|
12
|
+
}
|
|
13
|
+
export declare function CopyButton({ value, label, copiedLabel, onCopied, variant, className, type, ...props }: CopyButtonProps): import("react").JSX.Element;
|
|
14
|
+
//# sourceMappingURL=CopyButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton.d.ts","sourceRoot":"","sources":["../../src/notion/CopyButton.tsx"],"names":[],"mappings":"AAGA,OAAO,EAA+B,KAAK,cAAc,EAAE,MAAM,OAAO,CAAC;AAIzE,OAAO,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAOzC,MAAM,WAAW,eAAgB,SAAQ,IAAI,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EAAE,SAAS,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC;IACxH,yCAAyC;IACzC,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,sEAAsE;IACtE,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,oFAAoF;IACpF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,gFAAgF;IAChF,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,IAAI,CAAC;CAChC;AAMD,wBAAgB,UAAU,CAAC,EACzB,KAAK,EACL,KAA0B,EAC1B,WAAkC,EAClC,QAAQ,EACR,OAAqB,EACrB,SAAS,EACT,IAAe,EACf,GAAG,KAAK,EACT,EAAE,eAAe,+BAyCjB"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { Check, Copy } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef, useState } from "react";
|
|
5
|
+
import { cn } from "../lib/utils.js";
|
|
6
|
+
import { en as messages } from "../messages/en.js";
|
|
7
|
+
import { Button } from "../ui/button.js";
|
|
8
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
9
|
+
/** How long the button says "Copied" before it goes back to "Copy". */
|
|
10
|
+
const COPY_BUTTON_RESET_MS = 2000;
|
|
11
|
+
// One value to the clipboard: a secondary button with a copy icon that turns into a tick and says "Copied" for two
|
|
12
|
+
// seconds once the browser took the text, announced politely to a screen reader. A refused write (an insecure page, a
|
|
13
|
+
// denied permission) leaves the button as it was, so the value next to it can still be selected by hand. The copy is the
|
|
14
|
+
// app's (`label`, `copiedLabel`); the value is never part of the button's name.
|
|
15
|
+
export function CopyButton({ value, label = messages.copy.copy, copiedLabel = messages.copy.copied, onCopied, variant = "secondary", className, type = "button", ...props }) {
|
|
16
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
17
|
+
const timer = useRef(null);
|
|
18
|
+
useEffect(() => () => {
|
|
19
|
+
if (timer.current !== null)
|
|
20
|
+
clearTimeout(timer.current);
|
|
21
|
+
}, []);
|
|
22
|
+
const copy = () => {
|
|
23
|
+
// A page outside a secure context has no clipboard; the button then does nothing visible.
|
|
24
|
+
const clipboard = typeof navigator === "undefined" ? undefined : navigator.clipboard;
|
|
25
|
+
if (clipboard === undefined)
|
|
26
|
+
return;
|
|
27
|
+
clipboard.writeText(value).then(() => {
|
|
28
|
+
setIsCopied(true);
|
|
29
|
+
onCopied?.();
|
|
30
|
+
if (timer.current !== null)
|
|
31
|
+
clearTimeout(timer.current);
|
|
32
|
+
timer.current = setTimeout(() => setIsCopied(false), COPY_BUTTON_RESET_MS);
|
|
33
|
+
}, () => setIsCopied(false));
|
|
34
|
+
};
|
|
35
|
+
const Icon = isCopied ? Check : Copy;
|
|
36
|
+
return (_jsxs(Button, { "data-slot": "copy-button", "data-copied": isCopied ? "" : undefined, type: type, variant: variant, className: cn("shrink-0", className), onClick: copy, ...props, children: [_jsx(Icon, { "aria-hidden": "true", strokeWidth: ICON_STROKE_WIDTH }), _jsx("span", { "aria-live": "polite", children: isCopied ? copiedLabel : label })] }));
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=CopyButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CopyButton.js","sourceRoot":"","sources":["../../src/notion/CopyButton.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAC;;AAEb,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAuB,MAAM,OAAO,CAAC;AAEzE,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AACrC,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;AAErD,uEAAuE;AACvE,MAAM,oBAAoB,GAAG,IAAI,CAAC;AAalC,mHAAmH;AACnH,sHAAsH;AACtH,yHAAyH;AACzH,gFAAgF;AAChF,MAAM,UAAU,UAAU,CAAC,EACzB,KAAK,EACL,KAAK,GAAG,QAAQ,CAAC,IAAI,CAAC,IAAI,EAC1B,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,EAClC,QAAQ,EACR,OAAO,GAAG,WAAW,EACrB,SAAS,EACT,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AS,EAAE,EAAE,CAAC,UAAU,EAAE,SAAS,CAAC,EACpC,OAAO,EAAE,IAAI,KACT,KAAK,aAET,KAAC,IAAI,mBAAa,MAAM,EAAC,WAAW,EAAE,iBAAiB,GAAI,EAC3D,4BAAgB,QAAQ,YAAE,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,KAAK,GAAQ,IACzD,CACV,CAAC;AACJ,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,IAA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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.24.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
|
@@ -60,11 +60,22 @@ export {
|
|
|
60
60
|
} from "./notion/AsidePanel.js";
|
|
61
61
|
export { isOverlayOpen } from "./notion/overlay-open.js";
|
|
62
62
|
export { Code, CodeBlock, type CodeBlockProps } from "./notion/Code.js";
|
|
63
|
+
export { CopyButton, type CopyButtonProps } from "./notion/CopyButton.js";
|
|
63
64
|
export { DetailTable, type DetailRow, type DetailTableProps } from "./notion/DetailTable.js";
|
|
64
65
|
export { FilterChip, FilterChipAdd, type FilterChipAddProps, type FilterChipProps } from "./notion/FilterChip.js";
|
|
65
66
|
export { FoldRow, type FoldRowBadge, type FoldRowProps } from "./notion/FoldRow.js";
|
|
66
67
|
export { InstallBar, type InstallBarOffer, type InstallBarProps } from "./notion/InstallBar.js";
|
|
67
68
|
export { LaunchScreen, type LaunchScreenProps } from "./notion/LaunchScreen.js";
|
|
69
|
+
export {
|
|
70
|
+
LIST_CLASSES,
|
|
71
|
+
List,
|
|
72
|
+
ListItem,
|
|
73
|
+
ListRow,
|
|
74
|
+
type ListItemProps,
|
|
75
|
+
type ListProps,
|
|
76
|
+
type ListRowProps,
|
|
77
|
+
type ListSurface,
|
|
78
|
+
} from "./notion/List.js";
|
|
68
79
|
export { PALETTE_COLORS, type PaletteColor } from "./notion/palette.js";
|
|
69
80
|
export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
70
81
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
package/src/messages/en.ts
CHANGED
|
@@ -11,6 +11,7 @@ export const en = {
|
|
|
11
11
|
showSidebar: "Show the menu and hide the panel",
|
|
12
12
|
},
|
|
13
13
|
breadcrumb: { label: "breadcrumb", more: "More" },
|
|
14
|
+
copy: { copy: "Copy", copied: "Copied" },
|
|
14
15
|
dialog: { close: "Close" },
|
|
15
16
|
fileInput: { choose: "Choose a file", chooseMany: "Choose files", none: "No file chosen", count: "{count} files" },
|
|
16
17
|
filterChip: { add: "Add filter" },
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
3
|
+
import { Check, Copy } from "lucide-react";
|
|
4
|
+
import { useEffect, useRef, useState, type ComponentProps } from "react";
|
|
5
|
+
|
|
6
|
+
import { cn } from "../lib/utils.js";
|
|
7
|
+
import { en as messages } from "../messages/en.js";
|
|
8
|
+
import { Button } from "../ui/button.js";
|
|
9
|
+
|
|
10
|
+
import { ICON_STROKE_WIDTH } from "./icon-stroke.js";
|
|
11
|
+
|
|
12
|
+
/** How long the button says "Copied" before it goes back to "Copy". */
|
|
13
|
+
const COPY_BUTTON_RESET_MS = 2000;
|
|
14
|
+
|
|
15
|
+
export interface CopyButtonProps extends Omit<ComponentProps<typeof Button>, "onClick" | "children" | "asChild" | "value"> {
|
|
16
|
+
/** The text written to the clipboard. */
|
|
17
|
+
readonly value: string;
|
|
18
|
+
/** The button's text before a copy; the English default is "Copy". */
|
|
19
|
+
readonly label?: string;
|
|
20
|
+
/** The button's text for a moment after a copy; the English default is "Copied". */
|
|
21
|
+
readonly copiedLabel?: string;
|
|
22
|
+
/** Told after the value reached the clipboard (e.g. to count a funnel step). */
|
|
23
|
+
readonly onCopied?: () => void;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
// One value to the clipboard: a secondary button with a copy icon that turns into a tick and says "Copied" for two
|
|
27
|
+
// seconds once the browser took the text, announced politely to a screen reader. A refused write (an insecure page, a
|
|
28
|
+
// denied permission) leaves the button as it was, so the value next to it can still be selected by hand. The copy is the
|
|
29
|
+
// app's (`label`, `copiedLabel`); the value is never part of the button's name.
|
|
30
|
+
export function CopyButton({
|
|
31
|
+
value,
|
|
32
|
+
label = messages.copy.copy,
|
|
33
|
+
copiedLabel = messages.copy.copied,
|
|
34
|
+
onCopied,
|
|
35
|
+
variant = "secondary",
|
|
36
|
+
className,
|
|
37
|
+
type = "button",
|
|
38
|
+
...props
|
|
39
|
+
}: CopyButtonProps) {
|
|
40
|
+
const [isCopied, setIsCopied] = useState(false);
|
|
41
|
+
const timer = useRef<ReturnType<typeof setTimeout> | null>(null);
|
|
42
|
+
|
|
43
|
+
useEffect(
|
|
44
|
+
() => () => {
|
|
45
|
+
if (timer.current !== null) clearTimeout(timer.current);
|
|
46
|
+
},
|
|
47
|
+
[],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
const copy = () => {
|
|
51
|
+
// A page outside a secure context has no clipboard; the button then does nothing visible.
|
|
52
|
+
const clipboard = typeof navigator === "undefined" ? undefined : navigator.clipboard;
|
|
53
|
+
if (clipboard === undefined) return;
|
|
54
|
+
clipboard.writeText(value).then(
|
|
55
|
+
() => {
|
|
56
|
+
setIsCopied(true);
|
|
57
|
+
onCopied?.();
|
|
58
|
+
if (timer.current !== null) clearTimeout(timer.current);
|
|
59
|
+
timer.current = setTimeout(() => setIsCopied(false), COPY_BUTTON_RESET_MS);
|
|
60
|
+
},
|
|
61
|
+
() => setIsCopied(false),
|
|
62
|
+
);
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
const Icon = isCopied ? Check : Copy;
|
|
66
|
+
return (
|
|
67
|
+
<Button
|
|
68
|
+
data-slot="copy-button"
|
|
69
|
+
data-copied={isCopied ? "" : undefined}
|
|
70
|
+
type={type}
|
|
71
|
+
variant={variant}
|
|
72
|
+
className={cn("shrink-0", className)}
|
|
73
|
+
onClick={copy}
|
|
74
|
+
{...props}
|
|
75
|
+
>
|
|
76
|
+
<Icon aria-hidden="true" strokeWidth={ICON_STROKE_WIDTH} />
|
|
77
|
+
<span aria-live="polite">{isCopied ? copiedLabel : label}</span>
|
|
78
|
+
</Button>
|
|
79
|
+
);
|
|
80
|
+
}
|
|
@@ -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
|
+
}
|