@softure-ai/theme-notion 0.24.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 +8 -0
- package/README.md +17 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/notion/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 +1 -0
- package/src/notion/Prose.tsx +50 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,14 @@ 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
|
+
|
|
7
15
|
## 0.24.0
|
|
8
16
|
|
|
9
17
|
- `CopyButton`: one value to the clipboard, a `secondary` button with a copy icon that says "Copied" (with a tick) for
|
package/README.md
CHANGED
|
@@ -145,6 +145,7 @@ and count, the shown tab in the address; `Tabs` keeps it in client state), `Mark
|
|
|
145
145
|
list of what it counts, below), `FilterChip` and `FilterChipAdd` (a list's filter pills, below), `Steps` (numbered
|
|
146
146
|
stages with a state, below), `Timeline` (dated entries on a vertical rail, below), `Code` (inline code) and `CodeBlock` (a mono block for logs and paths, below),
|
|
147
147
|
`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),
|
|
148
149
|
`SortableList`, `SortableItem`, `SortableHandle` and `SortableActivator` (rows reordered by dragging, below),
|
|
149
150
|
`List`, `ListItem` and `ListRow` (a list of rows, compact or roomy by the page's density, below),
|
|
150
151
|
`MiniProgress` (a compact bar with its figure inside, for a table cell or a tile, below),
|
|
@@ -546,6 +547,22 @@ app after a copy. A client component. `data-slot="copy-button"`, `data-copied` w
|
|
|
546
547
|
</div>
|
|
547
548
|
```
|
|
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
|
+
|
|
549
566
|
**`UpdatePrompt`.** The offer to reload into a new build, for an installed app on `@softure-ai/pwa`: a floating
|
|
550
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
|
|
551
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
|
@@ -56,6 +56,7 @@ export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
|
56
56
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
57
57
|
export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
|
|
58
58
|
export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
|
|
59
|
+
export { PROSE_CLASSES, Prose, type ProseProps } from "./notion/Prose.js";
|
|
59
60
|
export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
|
|
60
61
|
export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
|
|
61
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,cAAc,eAAe,CAAC;AAC9B,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index.js
CHANGED
|
@@ -58,6 +58,7 @@ export { MarkPopover } from "./notion/MarkPopover.js";
|
|
|
58
58
|
export { MiniProgress } from "./notion/MiniProgress.js";
|
|
59
59
|
export { PageFrame } from "./notion/PageFrame.js";
|
|
60
60
|
export { PageHeader } from "./notion/PageHeader.js";
|
|
61
|
+
export { PROSE_CLASSES, Prose } from "./notion/Prose.js";
|
|
61
62
|
export { PropertyList } from "./notion/PropertyList.js";
|
|
62
63
|
export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
|
|
63
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;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;AAC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C;AACnF,OAAO,EAAE,mBAAmB,EAAE,eAAe,EAAqB,MAAM,2BAA2B,CAAC;AACpG,OAAO,EACL,YAAY,EACZ,WAAW,EACX,cAAc,GAOf,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,eAAe,EAA0C,MAAM,wBAAwB,CAAC;AACjG,OAAO,EACL,WAAW,EACX,UAAU,EACV,UAAU,GAQX,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAA0B,MAAM,0BAA0B,CAAC;AAChF,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,SAAS,EAAE,SAAS,EAAa,MAAM,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { ComponentProps } from "react";
|
|
2
|
+
/**
|
|
3
|
+
* The text styles of a long read whose elements the app does not draw itself (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
|
@@ -81,6 +81,7 @@ export { MarkPopover, type MarkPopoverProps } from "./notion/MarkPopover.js";
|
|
|
81
81
|
export { MiniProgress, type MiniProgressProps } from "./notion/MiniProgress.js";
|
|
82
82
|
export { PageFrame, type PageFrameProps } from "./notion/PageFrame.js";
|
|
83
83
|
export { PageHeader, type PageCrumb, type PageHeaderProps } from "./notion/PageHeader.js";
|
|
84
|
+
export { PROSE_CLASSES, Prose, type ProseProps } from "./notion/Prose.js";
|
|
84
85
|
export { PropertyList, type Property, type PropertyListProps } from "./notion/PropertyList.js";
|
|
85
86
|
export { clampSize, RESIZE_HANDLE_STEP } from "./notion/clamp-size.js";
|
|
86
87
|
export { ResizeHandle, type ResizeHandleProps } from "./notion/ResizeHandle.js";
|
|
@@ -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
|
+
}
|