shelving 1.225.0 → 1.226.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/package.json +1 -1
- package/ui/app/App.module.css +4 -0
- package/ui/block/Block.module.css +1 -1
- package/ui/block/Heading.module.css +1 -2
- package/ui/block/Section.module.css +1 -1
- package/ui/block/Subheading.module.css +1 -2
- package/ui/block/Title.module.css +1 -2
- package/ui/docs/DirectoryPage.d.ts +1 -1
- package/ui/docs/DirectoryPage.js +5 -2
- package/ui/docs/DirectoryPage.tsx +9 -2
package/package.json
CHANGED
package/ui/app/App.module.css
CHANGED
|
@@ -56,6 +56,10 @@
|
|
|
56
56
|
--space-xlarge: calc(var(--space) * 2); /* 32px */
|
|
57
57
|
--space-xxlarge: calc(var(--space) * 3); /* 48px */
|
|
58
58
|
|
|
59
|
+
/* Semantic spacings */
|
|
60
|
+
/* Gap between sibling sections/blocks and the top margin of titles/headings, so the rhythm stays consistent whether a heading is wrapped in a Section or rendered bare. */
|
|
61
|
+
--spacing-section: 2rem;
|
|
62
|
+
|
|
59
63
|
/* Radii */
|
|
60
64
|
--radius: 1rem;
|
|
61
65
|
--radius-xxsmall: calc(var(--radius) * 0.25); /* 4px */
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
display: block;
|
|
5
5
|
inline-size: 100%;
|
|
6
6
|
margin-inline: 0;
|
|
7
|
-
|
|
8
|
-
margin-block-start: var(--heading-spacing-before, 1.5em);
|
|
7
|
+
margin-block-start: var(--heading-spacing-before, var(--spacing-section));
|
|
9
8
|
margin-block-end: var(--heading-spacing, var(--space-normal));
|
|
10
9
|
|
|
11
10
|
/* Style */
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
display: block;
|
|
5
5
|
inline-size: 100%;
|
|
6
6
|
margin-inline: 0;
|
|
7
|
-
|
|
8
|
-
margin-block-start: var(--subheading-spacing-before, 1.5em);
|
|
7
|
+
margin-block-start: var(--subheading-spacing-before, var(--spacing-section));
|
|
9
8
|
margin-block-end: var(--subheading-spacing, var(--space-normal));
|
|
10
9
|
|
|
11
10
|
/* Style */
|
|
@@ -4,8 +4,7 @@
|
|
|
4
4
|
display: block;
|
|
5
5
|
inline-size: 100%;
|
|
6
6
|
margin-inline: 0;
|
|
7
|
-
|
|
8
|
-
margin-block-start: var(--title-spacing-before, 1.5em);
|
|
7
|
+
margin-block-start: var(--title-spacing-before, var(--spacing-section));
|
|
9
8
|
margin-block-end: var(--title-spacing, var(--space-normal));
|
|
10
9
|
|
|
11
10
|
/* Style */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type DirectoryElementProps } from "../../util/element.js";
|
|
3
3
|
import type { AbsolutePath } from "../../util/path.js";
|
|
4
4
|
interface DirectoryPageProps extends DirectoryElementProps {
|
|
5
5
|
/** Site-root-relative path of this page — threaded down so child cards build correct hrefs. */
|
package/ui/docs/DirectoryPage.js
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
1
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { walkElements } from "../../util/element.js";
|
|
3
|
+
import { Heading } from "../block/Heading.js";
|
|
2
4
|
import { Prose } from "../block/Prose.js";
|
|
3
5
|
import { Title } from "../block/Title.js";
|
|
4
6
|
import { Markup } from "../misc/Markup.js";
|
|
@@ -6,5 +8,6 @@ import { Page } from "../page/Page.js";
|
|
|
6
8
|
import { TreeCards } from "../tree/TreeCards.js";
|
|
7
9
|
/** Page renderer for a `tree-directory` element — shows title, content, and child cards. */
|
|
8
10
|
export function DirectoryPage({ path, title, name, description, content, children }) {
|
|
9
|
-
|
|
11
|
+
const cards = Array.from(walkElements(children));
|
|
12
|
+
return (_jsxs(Page, { title: title ?? name, description: description, children: [_jsx(Title, { children: title ?? name }), content && (_jsx(Prose, { children: _jsx(Markup, { children: content }) })), cards.length > 0 && (_jsxs(_Fragment, { children: [_jsx(Heading, { children: "Modules" }), _jsx(TreeCards, { path: path, children: cards })] }))] }));
|
|
10
13
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { ReactNode } from "react";
|
|
2
|
-
import type
|
|
2
|
+
import { type DirectoryElementProps, walkElements } from "../../util/element.js";
|
|
3
3
|
import type { AbsolutePath } from "../../util/path.js";
|
|
4
|
+
import { Heading } from "../block/Heading.js";
|
|
4
5
|
import { Prose } from "../block/Prose.js";
|
|
5
6
|
import { Title } from "../block/Title.js";
|
|
6
7
|
import { Markup } from "../misc/Markup.js";
|
|
@@ -14,6 +15,7 @@ interface DirectoryPageProps extends DirectoryElementProps {
|
|
|
14
15
|
|
|
15
16
|
/** Page renderer for a `tree-directory` element — shows title, content, and child cards. */
|
|
16
17
|
export function DirectoryPage({ path, title, name, description, content, children }: DirectoryPageProps): ReactNode {
|
|
18
|
+
const cards = Array.from(walkElements(children));
|
|
17
19
|
return (
|
|
18
20
|
<Page title={title ?? name} description={description}>
|
|
19
21
|
<Title>{title ?? name}</Title>
|
|
@@ -22,7 +24,12 @@ export function DirectoryPage({ path, title, name, description, content, childre
|
|
|
22
24
|
<Markup>{content}</Markup>
|
|
23
25
|
</Prose>
|
|
24
26
|
)}
|
|
25
|
-
|
|
27
|
+
{cards.length > 0 && (
|
|
28
|
+
<>
|
|
29
|
+
<Heading>Modules</Heading>
|
|
30
|
+
<TreeCards path={path}>{cards}</TreeCards>
|
|
31
|
+
</>
|
|
32
|
+
)}
|
|
26
33
|
</Page>
|
|
27
34
|
);
|
|
28
35
|
}
|