@tenphi/renderer 0.31.4 → 0.33.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/dist/components/Card.astro +1 -1
- package/dist/components/Card.styles.js +11 -0
- package/dist/components/CardGrid.astro +6 -0
- package/dist/components/CardGrid.styles.js +25 -0
- package/dist/components/CodeGroup.styles.js +8 -0
- package/dist/components/MarkdownCodeBlock.styles.js +6 -3
- package/dist/components/Tab.astro +1 -1
- package/dist/components/Tab.styles.js +9 -1
- package/dist/components/Tabs.styles.js +8 -0
- package/dist/components/props.d.ts +2 -1
- package/dist/components/props.d.ts.map +1 -1
- package/dist/components/props.ts +1 -0
- package/dist/components-public.d.ts +2 -0
- package/dist/components.d.ts +3 -2
- package/dist/components.js +2 -1
- package/package.json +4 -4
|
@@ -9,6 +9,8 @@ export const CardRoot = defineComponent("Card", {
|
|
|
9
9
|
"data-block": "",
|
|
10
10
|
styles: {
|
|
11
11
|
display: "grid",
|
|
12
|
+
// Keep rows at the top when a surrounding grid stretches the card.
|
|
13
|
+
alignContent: "start",
|
|
12
14
|
gap: "1.5x",
|
|
13
15
|
padding: "2.5x",
|
|
14
16
|
color: "#text",
|
|
@@ -55,5 +57,14 @@ export const CardRoot = defineComponent("Card", {
|
|
|
55
57
|
blockMargin: "$margin-block-start $margin-block-end",
|
|
56
58
|
inlineMargin: "0",
|
|
57
59
|
},
|
|
60
|
+
Body: {
|
|
61
|
+
// The sibling selector outranks prose block spacing, so the grid gap
|
|
62
|
+
// alone separates the body from the title.
|
|
63
|
+
$: "> h3 + Body",
|
|
64
|
+
"$margin-block-start": "0",
|
|
65
|
+
"$margin-block-end": "0",
|
|
66
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
67
|
+
},
|
|
58
68
|
},
|
|
69
|
+
elements: { Body: "div" },
|
|
59
70
|
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { configureCookbookStates } from "./tasty-states.js";
|
|
2
|
+
import { defineComponent } from "../define-component.js";
|
|
3
|
+
|
|
4
|
+
configureCookbookStates();
|
|
5
|
+
|
|
6
|
+
export const CardGridRoot = defineComponent("CardGrid", {
|
|
7
|
+
as: "div",
|
|
8
|
+
"data-element": "CardGrid",
|
|
9
|
+
styles: {
|
|
10
|
+
display: "grid",
|
|
11
|
+
gridColumns: {
|
|
12
|
+
"": "minmax(0, 1fr)",
|
|
13
|
+
"@sm": "repeat(2, minmax(0, 1fr))",
|
|
14
|
+
},
|
|
15
|
+
gap: "2x",
|
|
16
|
+
Card: {
|
|
17
|
+
// The sibling selector outranks prose block spacing, so the grid gap
|
|
18
|
+
// alone separates cards and cards in a row keep the same height.
|
|
19
|
+
$: "> Card + Card",
|
|
20
|
+
"$margin-block-start": "0",
|
|
21
|
+
"$margin-block-end": "0",
|
|
22
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
});
|
|
@@ -15,6 +15,14 @@ export const CodeGroupRoot = defineComponent("CodeGroup", {
|
|
|
15
15
|
blockMargin: "$margin-block-start $margin-block-end",
|
|
16
16
|
inlineMargin: "0",
|
|
17
17
|
},
|
|
18
|
+
MarkdownCodeBlock: {
|
|
19
|
+
// The sibling selector outranks prose block spacing, so the caption's
|
|
20
|
+
// own end margin separates it from the code, including when hidden.
|
|
21
|
+
$: "Caption + MarkdownCodeBlock",
|
|
22
|
+
"$margin-block-start": "0",
|
|
23
|
+
"$margin-block-end": "0",
|
|
24
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
25
|
+
},
|
|
18
26
|
Pre: { $: "pre", preset: "code" },
|
|
19
27
|
Code: {
|
|
20
28
|
$: "pre code",
|
|
@@ -32,7 +32,9 @@ export function MarkdownCodeBlockStyles() {
|
|
|
32
32
|
tabSize: "2",
|
|
33
33
|
},
|
|
34
34
|
CopyButton: {
|
|
35
|
-
|
|
35
|
+
// Following the pre outranks prose block spacing, which would otherwise
|
|
36
|
+
// offset the button from the corner in some stylesheet orders.
|
|
37
|
+
$: "> pre + CopyButton",
|
|
36
38
|
position: "absolute",
|
|
37
39
|
zIndex: "1",
|
|
38
40
|
blockInset: "1x start",
|
|
@@ -55,7 +57,8 @@ export function MarkdownCodeBlockStyles() {
|
|
|
55
57
|
transition: "color, fill",
|
|
56
58
|
},
|
|
57
59
|
HoverCopyButton: {
|
|
58
|
-
|
|
60
|
+
// Match CopyButton's selector weight so this overlay still applies.
|
|
61
|
+
$: '> pre + [data-element="CopyButton"]',
|
|
59
62
|
color: { "": null, "@own(:hover)": "#text" },
|
|
60
63
|
fill: {
|
|
61
64
|
"": null,
|
|
@@ -63,7 +66,7 @@ export function MarkdownCodeBlockStyles() {
|
|
|
63
66
|
},
|
|
64
67
|
},
|
|
65
68
|
CopiedButton: {
|
|
66
|
-
$: '> [data-element="CopyButton"]',
|
|
69
|
+
$: '> pre + [data-element="CopyButton"]',
|
|
67
70
|
color: {
|
|
68
71
|
"": null,
|
|
69
72
|
"copy-state=copied": "#green-text",
|
|
@@ -25,6 +25,14 @@ export const TabRoot = defineComponent("Tab", {
|
|
|
25
25
|
$: "> *",
|
|
26
26
|
hide: { "": null, "@own([data-tab-heading] & [hidden])": true },
|
|
27
27
|
},
|
|
28
|
+
Body: {
|
|
29
|
+
// The sibling selector outranks prose block spacing, so content starts at
|
|
30
|
+
// the panel padding while the fallback heading is hidden.
|
|
31
|
+
$: "> Heading + Body",
|
|
32
|
+
"$margin-block-start": "0",
|
|
33
|
+
"$margin-block-end": "0",
|
|
34
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
35
|
+
},
|
|
28
36
|
},
|
|
29
|
-
elements: { Heading: "h3" },
|
|
37
|
+
elements: { Heading: "h3", Body: "div" },
|
|
30
38
|
});
|
|
@@ -22,6 +22,14 @@ export const TabsRoot = defineComponent("Tabs", {
|
|
|
22
22
|
overflow: "auto",
|
|
23
23
|
fill: "#surface-2",
|
|
24
24
|
},
|
|
25
|
+
Tab: {
|
|
26
|
+
// The sibling selector outranks prose block spacing, which would
|
|
27
|
+
// otherwise separate every panel from the tab list.
|
|
28
|
+
$: "> List ~ Tab",
|
|
29
|
+
"$margin-block-start": "0",
|
|
30
|
+
"$margin-block-end": "0",
|
|
31
|
+
blockMargin: "$margin-block-start $margin-block-end",
|
|
32
|
+
},
|
|
25
33
|
Button: {
|
|
26
34
|
$: "> List > button",
|
|
27
35
|
"$margin-block-start": "0",
|
|
@@ -20,6 +20,7 @@ interface PreviewProps {
|
|
|
20
20
|
/** Room below the content of a preview that runs scripts, as a CSS length such as `12rem`, for overlays like a listbox; defaults to `0`. */
|
|
21
21
|
buffer?: string;
|
|
22
22
|
}
|
|
23
|
+
type CardGridProps = Record<string, never>;
|
|
23
24
|
type StepsProps = Record<string, never>;
|
|
24
25
|
interface TabsProps {
|
|
25
26
|
label?: string;
|
|
@@ -40,5 +41,5 @@ interface CodeGroupProps {
|
|
|
40
41
|
}>;
|
|
41
42
|
}
|
|
42
43
|
//#endregion
|
|
43
|
-
export { CalloutProps, CardProps, CodeGroupProps, LogoProps, PreviewProps, StepsProps, TabProps, TabsProps };
|
|
44
|
+
export { CalloutProps, CardGridProps, CardProps, CodeGroupProps, LogoProps, PreviewProps, StepsProps, TabProps, TabsProps };
|
|
44
45
|
//# sourceMappingURL=props.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","names":[],"sources":["../../src/components/props.ts"],"mappings":";UAAiB;EACf;EACA;;UAEe;EACf;EACA;EACA;;UAEe;EACf;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;KAEU,aAAa;UACR;EACf;;UAEe;EACf;;UAEe;EACf;EACA;;UAEe;EACf;EACA,OAAO;IAAQ;IAAe;IAAc"}
|
|
1
|
+
{"version":3,"file":"props.d.ts","names":[],"sources":["../../src/components/props.ts"],"mappings":";UAAiB;EACf;EACA;;UAEe;EACf;EACA;EACA;;UAEe;EACf;EACA;EACA;EACA;;EAEA;;EAEA;;EAEA;;KAEU,gBAAgB;KAChB,aAAa;UACR;EACf;;UAEe;EACf;;UAEe;EACf;EACA;;UAEe;EACf;EACA,OAAO;IAAQ;IAAe;IAAc"}
|
package/dist/components/props.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface PreviewProps {
|
|
|
19
19
|
/** Room below the content of a preview that runs scripts, as a CSS length such as `12rem`, for overlays like a listbox; defaults to `0`. */
|
|
20
20
|
buffer?: string;
|
|
21
21
|
}
|
|
22
|
+
export type CardGridProps = Record<string, never>;
|
|
22
23
|
export type StepsProps = Record<string, never>;
|
|
23
24
|
export interface TabsProps {
|
|
24
25
|
label?: string;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AstroComponentFactory } from "astro/runtime/server/index.js";
|
|
2
2
|
import type {
|
|
3
3
|
CardProps,
|
|
4
|
+
CardGridProps,
|
|
4
5
|
LogoProps,
|
|
5
6
|
PreviewProps,
|
|
6
7
|
StepsProps,
|
|
@@ -12,6 +13,7 @@ import type {
|
|
|
12
13
|
export type * from "./components/props.js";
|
|
13
14
|
type Component<Props> = (props: Props) => ReturnType<AstroComponentFactory>;
|
|
14
15
|
export const Card: Component<CardProps>;
|
|
16
|
+
export const CardGrid: Component<CardGridProps>;
|
|
15
17
|
export const Logo: Component<LogoProps>;
|
|
16
18
|
export const Preview: Component<PreviewProps>;
|
|
17
19
|
export const Steps: Component<StepsProps>;
|
package/dist/components.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { CalloutProps, CardProps, CodeGroupProps, LogoProps, PreviewProps, StepsProps, TabProps, TabsProps } from "./components/props.js";
|
|
1
|
+
import { CalloutProps, CardGridProps, CardProps, CodeGroupProps, LogoProps, PreviewProps, StepsProps, TabProps, TabsProps } from "./components/props.js";
|
|
2
2
|
import Card from "./components/Card.astro";
|
|
3
|
+
import CardGrid from "./components/CardGrid.astro";
|
|
3
4
|
import Logo from "./components/Logo.astro";
|
|
4
5
|
import Preview from "./components/Preview.astro";
|
|
5
6
|
import Steps from "./components/Steps.astro";
|
|
@@ -7,4 +8,4 @@ import Tabs from "./components/Tabs.astro";
|
|
|
7
8
|
import Tab from "./components/Tab.astro";
|
|
8
9
|
import Callout from "./components/Callout.astro";
|
|
9
10
|
import CodeGroup from "./components/CodeGroup.astro";
|
|
10
|
-
export { Callout, type CalloutProps, Card, type CardProps, CodeGroup, type CodeGroupProps, Logo, type LogoProps, Preview, type PreviewProps, Steps, type StepsProps, Tab, type TabProps, Tabs, type TabsProps };
|
|
11
|
+
export { Callout, type CalloutProps, Card, CardGrid, type CardGridProps, type CardProps, CodeGroup, type CodeGroupProps, Logo, type LogoProps, Preview, type PreviewProps, Steps, type StepsProps, Tab, type TabProps, Tabs, type TabsProps };
|
package/dist/components.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import Card from "./components/Card.astro";
|
|
2
|
+
import CardGrid from "./components/CardGrid.astro";
|
|
2
3
|
import Logo from "./components/Logo.astro";
|
|
3
4
|
import Preview from "./components/Preview.astro";
|
|
4
5
|
import Steps from "./components/Steps.astro";
|
|
@@ -6,4 +7,4 @@ import Tabs from "./components/Tabs.astro";
|
|
|
6
7
|
import Tab from "./components/Tab.astro";
|
|
7
8
|
import Callout from "./components/Callout.astro";
|
|
8
9
|
import CodeGroup from "./components/CodeGroup.astro";
|
|
9
|
-
export { Callout, Card, CodeGroup, Logo, Preview, Steps, Tab, Tabs };
|
|
10
|
+
export { Callout, Card, CardGrid, CodeGroup, Logo, Preview, Steps, Tab, Tabs };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/renderer",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.33.0",
|
|
4
4
|
"description": "Astro renderer and Tasty theme for Cookbook",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": [
|
|
@@ -61,9 +61,9 @@
|
|
|
61
61
|
"@fontsource-variable/jetbrains-mono": "^5.3.0",
|
|
62
62
|
"@fontsource-variable/onest": "^5.3.0",
|
|
63
63
|
"@pagefind/default-ui": "1.5.2",
|
|
64
|
-
"@tenphi/docs": "0.
|
|
65
|
-
"@tenphi/eslint-plugin-tasty": "1.
|
|
66
|
-
"@tenphi/glaze": "
|
|
64
|
+
"@tenphi/docs": "0.33.0",
|
|
65
|
+
"@tenphi/eslint-plugin-tasty": "1.17.0",
|
|
66
|
+
"@tenphi/glaze": "3.0.0",
|
|
67
67
|
"@tenphi/tasty": "3.17.1",
|
|
68
68
|
"@uniaria/core": "0.3.0",
|
|
69
69
|
"@uniaria/elements": "0.3.0",
|