@tenphi/cookbook 0.31.3 → 0.32.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.d.ts +2 -2
- package/dist/components.js +2 -2
- package/docs/authoring.mdx +24 -3
- package/docs/component-styles.md +13 -8
- package/docs/upstream/manifest.json +2 -2
- package/docs/upstream/tasty/README.md +2 -2
- package/docs/upstream/tasty/docs/ai-agents.md +1 -1
- package/package.json +3 -3
package/dist/components.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
import { Callout, Card, CodeGroup, Logo, Preview, Steps, Tab, Tabs } from "@tenphi/renderer/components";
|
|
2
|
+
import { Callout, Card, CardGrid, CodeGroup, Logo, Preview, Steps, Tab, Tabs } from "@tenphi/renderer/components";
|
|
3
3
|
export type * from "@tenphi/renderer/components";
|
|
4
|
-
export { Callout, Card, CodeGroup, Logo, Preview, Steps, Tab, Tabs };
|
|
4
|
+
export { Callout, Card, CardGrid, CodeGroup, Logo, Preview, Steps, Tab, Tabs };
|
package/dist/components.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { Callout, Card, CodeGroup, Logo, Preview, Steps, Tab, Tabs } from "@tenphi/renderer/components";
|
|
3
|
-
export { Callout, Card, CodeGroup, Logo, Preview, Steps, Tab, Tabs };
|
|
2
|
+
import { Callout, Card, CardGrid, CodeGroup, Logo, Preview, Steps, Tab, Tabs } from "@tenphi/renderer/components";
|
|
3
|
+
export { Callout, Card, CardGrid, CodeGroup, Logo, Preview, Steps, Tab, Tabs };
|
package/docs/authoring.mdx
CHANGED
|
@@ -8,6 +8,7 @@ sidebar:
|
|
|
8
8
|
import {
|
|
9
9
|
Callout,
|
|
10
10
|
Card,
|
|
11
|
+
CardGrid,
|
|
11
12
|
CodeGroup,
|
|
12
13
|
Preview,
|
|
13
14
|
Steps,
|
|
@@ -99,16 +100,26 @@ Each panel retains keyboard-accessible tabs and readable fallback content.
|
|
|
99
100
|
Use a card to link to another page, or omit `href` to present a standalone
|
|
100
101
|
summary. `href` is used as written: give a public URL, including any Astro
|
|
101
102
|
`base`, or a `#fragment`. Unlike Markdown links, `.md` paths are not rewritten;
|
|
102
|
-
`cookbook check-build` reports broken targets. `
|
|
103
|
-
|
|
103
|
+
`cookbook check-build` reports broken targets. Wrap cards in `CardGrid` to show
|
|
104
|
+
them in two equal-height columns on wider screens and a single column on narrow
|
|
105
|
+
ones. `Steps` renders an ordered list; put ordinary `li` elements inside it.
|
|
104
106
|
|
|
105
107
|
```mdx
|
|
106
|
-
import { Card, Steps } from "@tenphi/cookbook/components";
|
|
108
|
+
import { Card, CardGrid, Steps } from "@tenphi/cookbook/components";
|
|
107
109
|
|
|
108
110
|
<Card title="On-page navigation" href="#on-page-navigation">
|
|
109
111
|
Offer a compact contents list on smaller screens.
|
|
110
112
|
</Card>
|
|
111
113
|
|
|
114
|
+
<CardGrid>
|
|
115
|
+
<Card title="Tabs" href="#tabs">
|
|
116
|
+
Switch between equivalent examples.
|
|
117
|
+
</Card>
|
|
118
|
+
<Card title="Code groups" href="#code-groups">
|
|
119
|
+
Show the same command for several package managers.
|
|
120
|
+
</Card>
|
|
121
|
+
</CardGrid>
|
|
122
|
+
|
|
112
123
|
<Steps>
|
|
113
124
|
<li>Choose a content source.</li>
|
|
114
125
|
<li>Configure the navigation.</li>
|
|
@@ -120,6 +131,15 @@ import { Card, Steps } from "@tenphi/cookbook/components";
|
|
|
120
131
|
Offer a compact contents list on smaller screens.
|
|
121
132
|
</Card>
|
|
122
133
|
|
|
134
|
+
<CardGrid>
|
|
135
|
+
<Card title="Tabs" href="#tabs">
|
|
136
|
+
Switch between equivalent examples.
|
|
137
|
+
</Card>
|
|
138
|
+
<Card title="Code groups" href="#code-groups">
|
|
139
|
+
Show the same command for several package managers.
|
|
140
|
+
</Card>
|
|
141
|
+
</CardGrid>
|
|
142
|
+
|
|
123
143
|
<Steps>
|
|
124
144
|
<li>Choose a content source.</li>
|
|
125
145
|
<li>Configure the navigation.</li>
|
|
@@ -298,6 +318,7 @@ A `mermaid` fence renders a static, theme-aware diagram; see
|
|
|
298
318
|
| `Callout` | Optional `kind` (`note` by default, `tip`, `caution`, or `danger`) and `title` |
|
|
299
319
|
| `CodeGroup` | Optional `label` (default "Code examples") and required `items`: `{ label, code, language? }[]` |
|
|
300
320
|
| `Card` | Optional `title` and `href`; renders an article or link with slot content |
|
|
321
|
+
| `CardGrid` | Grid container for `Card` elements: one column on narrow screens, two equal-height columns from 40rem |
|
|
301
322
|
| `Steps` | Ordered list container; supply `li` elements |
|
|
302
323
|
| `Logo` | Optional `label`, `decorative`, and root `class`; renders the Cookbook mark |
|
|
303
324
|
| `Preview` | Required `title`; optional `html`, `css`, `javascript`, public-file `scripts`, minimum frame `height`, and overlay `buffer`; isolates examples in a sandboxed iframe that fits scripted content |
|
package/docs/component-styles.md
CHANGED
|
@@ -70,7 +70,7 @@ parts:
|
|
|
70
70
|
| Code and diagrams | `MarkdownCodeBlock`, `MarkdownInlineCode`, `SyntaxHighlight`, `CodeGroup`, `Mermaid` |
|
|
71
71
|
| Search | `SearchButton`, `Search`, `SearchResults` |
|
|
72
72
|
| Table of contents | `TableOfContents`, `MobileTableOfContents`, `TableOfContentsLayout` |
|
|
73
|
-
| Cards, notes, and tabs | `Card`, `Callout`, `MarkdownAlert`, `Tabs`, `Tab`, `Steps`, `Preview`
|
|
73
|
+
| Cards, notes, and tabs | `Card`, `CardGrid`, `Callout`, `MarkdownAlert`, `Tabs`, `Tab`, `Steps`, `Preview` |
|
|
74
74
|
| Home page hero | `Hero` |
|
|
75
75
|
| Page layout | `PageFrame`, `Layout`, `MainPane` |
|
|
76
76
|
| Footer and page controls | `Footer`, `Pagination`, `PageActions`, `ThemeSelect` |
|
|
@@ -136,11 +136,12 @@ it stays complete when a surface changes.
|
|
|
136
136
|
|
|
137
137
|
#### Authoring components
|
|
138
138
|
|
|
139
|
-
* `Card`: `Heading2`, `Heading3`, `Paragraph`
|
|
139
|
+
* `Card`: `Heading2`, `Heading3`, `Paragraph`, `Body`
|
|
140
|
+
* `CardGrid`: `Card`
|
|
140
141
|
* `Callout`: `Title`, `Body`
|
|
141
|
-
* `CodeGroup`: `Caption`, `Pre`, `Code`
|
|
142
|
-
* `Tab`: `Heading`, `HiddenHeading`
|
|
143
|
-
* `Tabs`: `List`, `Button`, `SelectedButton`, `FocusedButton`
|
|
142
|
+
* `CodeGroup`: `Caption`, `MarkdownCodeBlock`, `Pre`, `Code`
|
|
143
|
+
* `Tab`: `Heading`, `HiddenHeading`, `Body`
|
|
144
|
+
* `Tabs`: `List`, `Tab`, `Button`, `SelectedButton`, `FocusedButton`
|
|
144
145
|
* `Steps`: `Item`, `Marker`
|
|
145
146
|
* `Hero`: `Visual`, `DarkVisual`, `LightVisual`, `Stack`, `Copy`, `Title`, `Tagline`, `Actions`, `Action`, `HoverAction`, `PrimaryAction`, `SecondaryAction`, `MinimalAction`, `ActionIcon`
|
|
146
147
|
* `Preview`: `Caption`, `Stage`, `Frame`, `Code`, `Summary`, `HoverSummary`, `ActiveSummary`, `Pre`
|
|
@@ -350,8 +351,8 @@ and accessibility utilities. `MainPane` and `MainContent` own the content
|
|
|
350
351
|
layout. `Markdown` owns prose, lists, links, quotations, and disclosure
|
|
351
352
|
anatomy. `Search` owns the dialog; `SearchResults` owns the search field and
|
|
352
353
|
Pagefind results UI.
|
|
353
|
-
`MarkdownAlert` styles rendered alert blockquotes; `Card`, `
|
|
354
|
-
`Steps` style Cookbook components. `Callout` reads its colors from the root
|
|
354
|
+
`MarkdownAlert` styles rendered alert blockquotes; `Card`, `CardGrid`,
|
|
355
|
+
`Callout`, and `Steps` style Cookbook components. `Callout` reads its colors from the root
|
|
355
356
|
`#callout-border`, `#callout-text`, and `#callout-surface` tokens, which change
|
|
356
357
|
per kind through `[data-kind="tip"]`, `"caution"`, and `"danger"` states.
|
|
357
358
|
|
|
@@ -362,7 +363,11 @@ owning `blockMargin` consumes both tokens, and a surrounding prose/layout rule
|
|
|
362
363
|
changes only the start token. For example, `Callout: { "$margin-block-end": "3x" }`
|
|
363
364
|
changes the end spacing while retaining Markdown's spacing before the callout.
|
|
364
365
|
Document foundations reset these tokens on every element to prevent inheritance
|
|
365
|
-
into nested content.
|
|
366
|
+
into nested content. Markdown's spacing stops at component anatomy:
|
|
367
|
+
`Tabs.Tab`, `Tab.Body`, `CodeGroup.MarkdownCodeBlock`, `Card.Body`, and
|
|
368
|
+
`CardGrid.Card` reset both tokens, so tab panels, code under a caption, card
|
|
369
|
+
bodies, and cards in a grid keep their component gaps. Set the start token on
|
|
370
|
+
those sub-elements to add space back. For content-panel padding, use `MainContent.Panel`'s
|
|
366
371
|
`$padding-block-start` and `$padding-block-end` tokens in the same way.
|
|
367
372
|
|
|
368
373
|
### Code blocks and syntax highlighting
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<p align="center">
|
|
2
|
-
<img src="https://raw.githubusercontent.com/tenphi/tasty/v3.17.
|
|
2
|
+
<img src="https://raw.githubusercontent.com/tenphi/tasty/v3.17.1/assets/tasty.svg" width="128" height="128" alt="Tasty logo" />
|
|
3
3
|
</p>
|
|
4
4
|
|
|
5
5
|
<h1 align="center">Tasty</h1>
|
|
@@ -548,7 +548,7 @@ Covered in [Types and Linting](#eslint-and-oxlint): 40+ rules for ESLint 9+ and
|
|
|
548
548
|
[Tasty for VS Code](https://github.com/tenphi/tasty-vscode-extension) highlights color tokens, units, state keys, presets, and style properties inside `tasty()`, `tastyStatic()`, `styles` objects, and style functions, and adds snippets for components, state maps, and `configure()`. Install the `.vsix` from the [latest release](https://github.com/tenphi/tasty-vscode-extension/releases/latest).
|
|
549
549
|
|
|
550
550
|
<p align="center">
|
|
551
|
-
<img src="https://raw.githubusercontent.com/tenphi/tasty/v3.17.
|
|
551
|
+
<img src="https://raw.githubusercontent.com/tenphi/tasty/v3.17.1/assets/tasty-vscode-highlight.png" width="512" alt="Tasty VS Code syntax highlighting example" />
|
|
552
552
|
</p>
|
|
553
553
|
|
|
554
554
|
### Glaze
|
|
@@ -10,7 +10,7 @@ Notation: ❌ wrong → ✅ correct.
|
|
|
10
10
|
|
|
11
11
|
Color tokens (`#name`), custom properties (`$name`), `preset` names, `recipe` names, state aliases (`@mobile`) and extra units are **project-defined** in `tasty.config.ts` or a `configure({ … })` call. Look them up before writing styles. Never invent a name — reuse an existing one, or add it to the config.
|
|
12
12
|
|
|
13
|
-
Only Tasty's built-ins exist without config: `#white`, `#black`, `#border`, `#outline`, `#current`, `#clear`, and `$gap`, `$radius`, `$border-width`, `$outline-width`, `$transition`, `$sharp-radius`, `$bold-font-weight`, `$font-sans-fallback`, `$font-mono-fallback`.
|
|
13
|
+
Only Tasty's built-ins exist without config: `#white`, `#black`, `#border`, `#outline`, `#current`, `#clear`, and `$gap`, `$radius`, `$border-width`, `$outline-width`, `$transition`, `$sharp-radius`, `$bold-font-weight`, `$icon-size` (only where a `preset` applies), `$font-sans-fallback`, `$font-mono-fallback`.
|
|
14
14
|
|
|
15
15
|
## 1. Where styles go
|
|
16
16
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tenphi/cookbook",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.32.0",
|
|
4
4
|
"description": "Repository-native static documentation for Astro",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
"author": "Andrey Yamanov",
|
|
69
69
|
"license": "MIT",
|
|
70
70
|
"dependencies": {
|
|
71
|
-
"@tenphi/docs": "0.
|
|
72
|
-
"@tenphi/renderer": "0.
|
|
71
|
+
"@tenphi/docs": "0.32.0",
|
|
72
|
+
"@tenphi/renderer": "0.32.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
75
|
"astro": "^7.3.2"
|