@softure-ai/theme-notion 0.23.0 → 0.25.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 +15 -0
- package/README.md +33 -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/Prose.d.ts +17 -0
- package/dist/notion/Prose.d.ts.map +1 -0
- package/dist/notion/Prose.js +32 -0
- package/dist/notion/Prose.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/messages/en.ts +1 -0
- package/src/notion/CopyButton.tsx +80 -0
- package/src/notion/Prose.tsx +50 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,21 @@ 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.25.0
|
|
8
|
+
|
|
9
|
+
- `Prose`: the text styles of a long read the app does not draw itself (Markdown rendered to HTML, a documentation
|
|
10
|
+
article): headings, paragraphs, lists, links, inline code and code blocks, quotes, rules and tables on the theme's
|
|
11
|
+
tokens, with one rhythm between blocks. `asChild` keeps the app's element; `PROSE_CLASSES` gives the classes to a
|
|
12
|
+
wrapper the app styles itself.
|
|
13
|
+
- Migration: none; no existing component changes.
|
|
14
|
+
|
|
15
|
+
## 0.24.0
|
|
16
|
+
|
|
17
|
+
- `CopyButton`: one value to the clipboard, a `secondary` button with a copy icon that says "Copied" (with a tick) for
|
|
18
|
+
two seconds once the browser took the text, announced politely; a refused write leaves it as it was. Its words are
|
|
19
|
+
props (`label`, `copiedLabel`), English by default (`notionMessages.en.copy`); `onCopied` tells the app.
|
|
20
|
+
- Migration: none; no existing component changes.
|
|
21
|
+
|
|
7
22
|
## 0.23.0
|
|
8
23
|
|
|
9
24
|
- List density (#1341): `List`, `ListItem` and `ListRow`, a list of rows that is `compact` (tight rows, no line
|
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,6 +144,8 @@ 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),
|
|
148
|
+
`Prose` (the text styles of a long read the app does not draw itself, such as Markdown rendered to HTML, below),
|
|
147
149
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below),
|
|
148
150
|
`List`, `ListItem` and `ListRow` (a list of rows, compact or roomy by the page's density, below),
|
|
149
151
|
`MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
|
|
@@ -531,6 +533,36 @@ plain text. No syntax highlighting. `data-slot="code"` and `data-slot="code-bloc
|
|
|
531
533
|
<CodeBlock label="Build log" wrap>{log}</CodeBlock>
|
|
532
534
|
```
|
|
533
535
|
|
|
536
|
+
**`CopyButton`.** One value to the clipboard, for a URL, a command or a code the reader pastes elsewhere: a
|
|
537
|
+
`secondary` button (any `Button` variant and size) with Lucide's copy icon that turns into a tick and says
|
|
538
|
+
`copiedLabel` for two seconds once the browser took the text, announced politely to a screen
|
|
539
|
+
reader. A refused write (an insecure page, a denied permission) leaves it as it was, so keep the value visible beside
|
|
540
|
+
it (a `CodeBlock`) for the reader to select by hand. The value is never part of the button's name; `onCopied` tells the
|
|
541
|
+
app after a copy. A client component. `data-slot="copy-button"`, `data-copied` while it says "Copied".
|
|
542
|
+
|
|
543
|
+
```tsx
|
|
544
|
+
<div className="flex items-center gap-2">
|
|
545
|
+
<CodeBlock className="min-w-0 flex-1">{url}</CodeBlock>
|
|
546
|
+
<CopyButton value={url} label="Copy URL" copiedLabel="Copied" />
|
|
547
|
+
</div>
|
|
548
|
+
```
|
|
549
|
+
|
|
550
|
+
**`Prose`.** A long read whose elements the app does not draw itself, such as Markdown rendered to HTML (a help page,
|
|
551
|
+
a documentation article, a CMS body): headings take `heading-1` to `heading-3` with more room above than below,
|
|
552
|
+
paragraphs the `body` style, lists their markers in the quiet foreground, links the `link` colour underlined, inline
|
|
553
|
+
code the `Code` look and a `pre` block the `CodeBlock` look, quotes and rules a quiet `border` line, and a table the
|
|
554
|
+
`ui` size with lines between rows (a wide one scrolls inside its block). The blocks share one rhythm, with none before
|
|
555
|
+
the first or after the last. Put the page's title in a `PageHeader` above it. `asChild` keeps the app's element (an
|
|
556
|
+
`article`); `PROSE_CLASSES` gives the same classes to a wrapper the app styles itself. Pass HTML only from content the
|
|
557
|
+
app trusts (its own files), never a visitor's text. `data-slot="prose"`.
|
|
558
|
+
|
|
559
|
+
```tsx
|
|
560
|
+
<PageHeader title={doc.title} description={doc.description} />
|
|
561
|
+
<Prose asChild>
|
|
562
|
+
<article dangerouslySetInnerHTML={{ __html: renderMarkdown(doc.body) }} />
|
|
563
|
+
</Prose>
|
|
564
|
+
```
|
|
565
|
+
|
|
534
566
|
**`UpdatePrompt`.** The offer to reload into a new build, for an installed app on `@softure-ai/pwa`: a floating
|
|
535
567
|
`Alert` at the bottom of the screen (`shadow-menu`, at most `max-w-md`), padded by the safe-area insets so it clears a
|
|
536
568
|
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,6 +44,7 @@ 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";
|
|
@@ -55,6 +56,7 @@ export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
|
55
56
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
56
57
|
export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
|
|
57
58
|
export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
|
|
59
|
+
export { PROSE_CLASSES, Prose, type ProseProps } from "./notion/Prose.js";
|
|
58
60
|
export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
|
|
59
61
|
export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
|
|
60
62
|
export { ResizeHandle, type ResizeHandleProps } from "./notion/ResizeHandle.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,cA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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";
|
|
@@ -57,6 +58,7 @@ export { MarkPopover } from "./notion/MarkPopover.js";
|
|
|
57
58
|
export { MiniProgress } from "./notion/MiniProgress.js";
|
|
58
59
|
export { PageFrame } from "./notion/PageFrame.js";
|
|
59
60
|
export { PageHeader } from "./notion/PageHeader.js";
|
|
61
|
+
export { PROSE_CLASSES, Prose } from "./notion/Prose.js";
|
|
60
62
|
export { PropertyList } from "./notion/PropertyList.js";
|
|
61
63
|
export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
|
|
62
64
|
export { ResizeHandle } from "./notion/ResizeHandle.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;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M;iBACJ,MAAM,EAAE,cAAc;iBACtB,SAAS,EAAE,eAAe;iBAC1B,IAAI,EAAE,mBAAmB;iBACzB,OAAO,EAAE,iBAAiB;iBAC1B,QAAQ,EAAE,aAAa;iBACvB,KAAK,EAAE,OAAO;iBACd,KAAK,EAAE,cAAc;iBACrB,MAAM,EAAE,eAAe;iBACvB,MAAM,EAAE,eAAe;iBACvB,QAAQ,EAAE,kBAAkB;iBAC5B,MAAM,EAAE,QAAQ;iBAChB,SAAS,EAAE,WAAW;iBACtB,MAAM,EAAE,QAAQ;iBAChB,IAAI,EAAE,MAAM;iBACZ,MAAM,EAAE,QAAQ;;aAElB,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
|
@@ -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,KAAK,EAAE,SAAS,EAAE;IAC7B,QAAQ,EAAE;QACR,YAAY,EACV,mIAAmI;QACrI,QAAQ,EAAE,mDAAmD;QAC7D,KAAK,EAAE,iDAAiD;QACxD,OAAO,EAAE,mDAAmD;QAC5D,SAAS,EAAE,qCAAqC;QAChD,MAAM,EAAE,iBAAiB;KAC1B;IACD,MAAM,EAAE;QACN,MAAM,EAAE,cAAc;QACtB,SAAS,EAAE,eAAe;QAC1B,IAAI,EAAE,mBAAmB;QACzB,OAAO,EAAE,iBAAiB;QAC1B,QAAQ,EAAE,aAAa;QACvB,KAAK,EAAE,OA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AsB;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,IAAI,GAAG,QAAQ,EACf,GAAG,KAAK,EACQ;IAChB,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,MAAM,CAAuC,IAAI,CAAC,CAAC;IAEjE,SAAS,CACP,GAAG,EAAE,CAAC,GAAG,EAAE;QACT,IAAI,KAAK,CAAC,OAAO,KAAK,IAAI;YAAE,YAAY,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;IAC1D,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,IAAI,GAAG,G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(Markdown rendered to HTML, a CMS body):
|
|
4
|
+
* headings, paragraphs, lists, links, inline code and code blocks, quotes, tables and rules, all on the theme's tokens.
|
|
5
|
+
* The same classes, for an app that styles its own wrapper.
|
|
6
|
+
*/
|
|
7
|
+
export declare const PROSE_CLASSES: string;
|
|
8
|
+
export type ProseProps = ComponentProps<"div"> & {
|
|
9
|
+
/** Renders the child element (an `article`, the app's `main`) with the prose classes. */
|
|
10
|
+
readonly asChild?: boolean;
|
|
11
|
+
};
|
|
12
|
+
/**
|
|
13
|
+
* A long read in the theme: wrap Markdown rendered to HTML (`dangerouslySetInnerHTML` of trusted content) or plain
|
|
14
|
+
* elements, and every heading, list, link, code block, quote and table inside takes the theme's text styles.
|
|
15
|
+
*/
|
|
16
|
+
export declare function Prose({ asChild, className, ...props }: ProseProps): import("react").JSX.Element;
|
|
17
|
+
//# sourceMappingURL=Prose.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prose.d.ts","sourceRoot":"","sources":["../../src/notion/Prose.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAI5C;;;;GAIG;AACH,eAAO,MAAM,aAAa,QAyBzB,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,KAAK,CAAC,GAAG;IAC/C,yFAAyF;IACzF,QAAQ,CAAC,OAAO,CAAC,EAAE,OAAO,CAAC;CAC5B,CAAC;AAEF;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,OAAe,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,UAAU,+BAGzE"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Slot } from "radix-ui";
|
|
3
|
+
import { cn } from "../lib/utils.js";
|
|
4
|
+
/**
|
|
5
|
+
* The text styles of a long read whose elements the app does not draw itself (Markdown rendered to HTML, a CMS body):
|
|
6
|
+
* headings, paragraphs, lists, links, inline code and code blocks, quotes, tables and rules, all on the theme's tokens.
|
|
7
|
+
* The same classes, for an app that styles its own wrapper.
|
|
8
|
+
*/
|
|
9
|
+
export const PROSE_CLASSES = cn("min-w-0 text-body text-foreground",
|
|
10
|
+
// Blocks: one rhythm between them, none before the first or after the last.
|
|
11
|
+
"[&>*]:my-3 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
12
|
+
// Headings: the theme's heading styles, more room above than below, so a heading belongs to what follows it.
|
|
13
|
+
"[&_h1]:mt-10 [&_h1]:mb-3 [&_h1]:text-heading-1 [&_h1]:text-balance", "[&_h2]:mt-8 [&_h2]:mb-2 [&_h2]:text-heading-2 [&_h2]:text-balance", "[&_h3]:mt-6 [&_h3]:mb-1 [&_h3]:text-heading-3", "[&_h4]:mt-4 [&_h4]:mb-1 [&_h4]:text-ui-medium",
|
|
14
|
+
// Lists: markers in the quiet foreground, a little room between items.
|
|
15
|
+
"[&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6 [&_li]:my-1 [&_li]:marker:text-muted-foreground", "[&_li>ul]:my-1 [&_li>ol]:my-1",
|
|
16
|
+
// Inline: links in the link colour, underlined; strong text one weight up.
|
|
17
|
+
"[&_a]:text-link [&_a]:underline [&_a]:underline-offset-2 [&_a:hover]:no-underline [&_strong]:font-semibold",
|
|
18
|
+
// Inline code as `Code`; a block as `CodeBlock`, whose own code element drops the inline look.
|
|
19
|
+
"[&_code]:rounded-xs [&_code]:bg-secondary [&_code]:px-1 [&_code]:font-mono [&_code]:text-code [&_code]:text-code-foreground", "[&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:px-4 [&_pre]:py-3 [&_pre]:font-mono [&_pre]:text-code [&_pre]:whitespace-pre", "[&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-foreground",
|
|
20
|
+
// Quotes and rules: a quiet line.
|
|
21
|
+
"[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground", "[&_hr]:my-8 [&_hr]:border-border",
|
|
22
|
+
// Tables: the UI text size, lines between rows, a header in the quiet foreground; a wide one scrolls in its block.
|
|
23
|
+
"[&_table]:block [&_table]:w-full [&_table]:overflow-x-auto [&_table]:border-collapse [&_table]:text-ui", "[&_th]:border-b [&_th]:border-border [&_th]:px-2 [&_th]:py-1.5 [&_th]:text-start [&_th]:font-medium [&_th]:text-muted-foreground", "[&_td]:border-b [&_td]:border-border [&_td]:px-2 [&_td]:py-1.5 [&_td]:align-top");
|
|
24
|
+
/**
|
|
25
|
+
* A long read in the theme: wrap Markdown rendered to HTML (`dangerouslySetInnerHTML` of trusted content) or plain
|
|
26
|
+
* elements, and every heading, list, link, code block, quote and table inside takes the theme's text styles.
|
|
27
|
+
*/
|
|
28
|
+
export function Prose({ asChild = false, className, ...props }) {
|
|
29
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
30
|
+
return _jsx(Comp, { "data-slot": "prose", className: cn(PROSE_CLASSES, className), ...props });
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=Prose.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Prose.js","sourceRoot":"","sources":["../../src/notion/Prose.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,UAAU,CAAC;AAGhC,OAAO,EAAE,EAAE,EAAE,MAAM,iBAAiB,CAAC;AAErC;;;;GAIG;AACH,MAAM,CAAC,MAAM,aAAa,GAAG,EAAE,CAC7B,mCAAmC;AACnC,4EAA4E;AAC5E,yDAAyD;AACzD,6GAA6G;AAC7G,oEAAoE,EACpE,mEAAmE,EACnE,+CAA+C,EAC/C,+CAA+C;AAC/C,uEAAuE;AACvE,8GAA8G,EAC9G,+BAA+B;AAC/B,2EAA2E;AAC3E,4GAA4G;AAC5G,+FAA+F;AAC/F,6HAA6H,EAC7H,kJAAkJ,EAClJ,2EAA2E;AAC3E,kCAAkC;AAClC,iHAAiH,EACjH,kCAAkC;AAClC,mHAAmH;AACnH,wGAAwG,EACxG,kIAAkI,EAClI,iFAAiF,CAClF,CAAC;AAOF;;;GAGG;AACH,MAAM,UAAU,KAAK,CAAC,EAAE,OAAO,GAAG,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAc;IACxE,MAAM,IAAI,GAAG,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IACzC,OAAO,KAAC,IAAI,iBAAW,OAAO,EAAC,SAAS,EAAE,EAAE,CAAC,aAAa,EAAE,SAAS,CAAC,KAAM,KAAK,GAAI,CAAC;AACxF,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@softure-ai/theme-notion",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.25.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
|
@@ -60,6 +60,7 @@ 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";
|
|
@@ -80,6 +81,7 @@ export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
|
80
81
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
81
82
|
export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
|
|
82
83
|
export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
|
|
84
|
+
export { PROSE_CLASSES, Prose, type ProseProps } from "./notion/Prose.js";
|
|
83
85
|
export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
|
|
84
86
|
export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
|
|
85
87
|
export { ResizeHandle, type ResizeHandleProps } from "./notion/ResizeHandle.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,50 @@
|
|
|
1
|
+
import { Slot } from "radix-ui";
|
|
2
|
+
import type { ComponentProps } from "react";
|
|
3
|
+
|
|
4
|
+
import { cn } from "../lib/utils.js";
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* The text styles of a long read whose elements the app does not draw itself (Markdown rendered to HTML, a CMS body):
|
|
8
|
+
* headings, paragraphs, lists, links, inline code and code blocks, quotes, tables and rules, all on the theme's tokens.
|
|
9
|
+
* The same classes, for an app that styles its own wrapper.
|
|
10
|
+
*/
|
|
11
|
+
export const PROSE_CLASSES = cn(
|
|
12
|
+
"min-w-0 text-body text-foreground",
|
|
13
|
+
// Blocks: one rhythm between them, none before the first or after the last.
|
|
14
|
+
"[&>*]:my-3 [&>*:first-child]:mt-0 [&>*:last-child]:mb-0",
|
|
15
|
+
// Headings: the theme's heading styles, more room above than below, so a heading belongs to what follows it.
|
|
16
|
+
"[&_h1]:mt-10 [&_h1]:mb-3 [&_h1]:text-heading-1 [&_h1]:text-balance",
|
|
17
|
+
"[&_h2]:mt-8 [&_h2]:mb-2 [&_h2]:text-heading-2 [&_h2]:text-balance",
|
|
18
|
+
"[&_h3]:mt-6 [&_h3]:mb-1 [&_h3]:text-heading-3",
|
|
19
|
+
"[&_h4]:mt-4 [&_h4]:mb-1 [&_h4]:text-ui-medium",
|
|
20
|
+
// Lists: markers in the quiet foreground, a little room between items.
|
|
21
|
+
"[&_ul]:list-disc [&_ul]:pl-6 [&_ol]:list-decimal [&_ol]:pl-6 [&_li]:my-1 [&_li]:marker:text-muted-foreground",
|
|
22
|
+
"[&_li>ul]:my-1 [&_li>ol]:my-1",
|
|
23
|
+
// Inline: links in the link colour, underlined; strong text one weight up.
|
|
24
|
+
"[&_a]:text-link [&_a]:underline [&_a]:underline-offset-2 [&_a:hover]:no-underline [&_strong]:font-semibold",
|
|
25
|
+
// Inline code as `Code`; a block as `CodeBlock`, whose own code element drops the inline look.
|
|
26
|
+
"[&_code]:rounded-xs [&_code]:bg-secondary [&_code]:px-1 [&_code]:font-mono [&_code]:text-code [&_code]:text-code-foreground",
|
|
27
|
+
"[&_pre]:overflow-x-auto [&_pre]:rounded-lg [&_pre]:bg-muted [&_pre]:px-4 [&_pre]:py-3 [&_pre]:font-mono [&_pre]:text-code [&_pre]:whitespace-pre",
|
|
28
|
+
"[&_pre_code]:bg-transparent [&_pre_code]:p-0 [&_pre_code]:text-foreground",
|
|
29
|
+
// Quotes and rules: a quiet line.
|
|
30
|
+
"[&_blockquote]:border-l-2 [&_blockquote]:border-border [&_blockquote]:pl-4 [&_blockquote]:text-muted-foreground",
|
|
31
|
+
"[&_hr]:my-8 [&_hr]:border-border",
|
|
32
|
+
// Tables: the UI text size, lines between rows, a header in the quiet foreground; a wide one scrolls in its block.
|
|
33
|
+
"[&_table]:block [&_table]:w-full [&_table]:overflow-x-auto [&_table]:border-collapse [&_table]:text-ui",
|
|
34
|
+
"[&_th]:border-b [&_th]:border-border [&_th]:px-2 [&_th]:py-1.5 [&_th]:text-start [&_th]:font-medium [&_th]:text-muted-foreground",
|
|
35
|
+
"[&_td]:border-b [&_td]:border-border [&_td]:px-2 [&_td]:py-1.5 [&_td]:align-top",
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
export type ProseProps = ComponentProps<"div"> & {
|
|
39
|
+
/** Renders the child element (an `article`, the app's `main`) with the prose classes. */
|
|
40
|
+
readonly asChild?: boolean;
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* A long read in the theme: wrap Markdown rendered to HTML (`dangerouslySetInnerHTML` of trusted content) or plain
|
|
45
|
+
* elements, and every heading, list, link, code block, quote and table inside takes the theme's text styles.
|
|
46
|
+
*/
|
|
47
|
+
export function Prose({ asChild = false, className, ...props }: ProseProps) {
|
|
48
|
+
const Comp = asChild ? Slot.Root : "div";
|
|
49
|
+
return <Comp data-slot="prose" className={cn(PROSE_CLASSES, className)} {...props} />;
|
|
50
|
+
}
|