@addiscorp/kit 0.2.1 → 0.2.2

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/README.md CHANGED
@@ -86,7 +86,7 @@ import { ToolSite, Hero, Why, DocsLayout, Code, Step, Callout } from '@addiscorp
86
86
  </DocsLayout>
87
87
  ```
88
88
 
89
- - **The header** is the mark, the name and `docs`; nothing else until a tool needs it.
89
+ - **The header** is the mark, the name and `docs`. A tool that has more to link adds it after docs with `links` (p8: `links={[{ label: 'test suite', href: 'https://p8-test-suite.addis.gg' }]}`).
90
90
  - **The reel** is CSS only: its scenes play in turn, 5 s each, and each scene's lines appear one after another. With reduced motion it shows the first scene, still.
91
91
  - **Colours**: `data-tool` picks the tool's palette (`src/tool/palettes.css`, generated from its colour layout): one pale ground in light mode, a ground tinted with the brand in dark. The kit's footer and theme switch take the same colours.
92
92
  - **Marks** (`MARKS`, `<Mark tool size />`) are inline SVG for light and dark; the cut-outs between parts are `var(--ak-cut)`, set to whatever is behind the mark.
@@ -9,11 +9,18 @@ export declare function Mark({ tool, size }: {
9
9
  tool: ToolId;
10
10
  size?: number;
11
11
  }): import("react/jsx-runtime").JSX.Element;
12
+ /** A link in a tool site's header, after docs: `{ label: 'test suite', href: 'https://p8-test-suite.addis.gg' }`. */
13
+ export type HeaderLink = {
14
+ label: string;
15
+ href: string;
16
+ };
12
17
  /** Everything a tool site shows sits inside this: it sets the tool's colours, the header and the footer. */
13
- export declare function ToolSite({ tool, home, docs, Link, children }: {
18
+ export declare function ToolSite({ tool, home, docs, links, Link, children }: {
14
19
  tool: ToolId;
15
20
  home?: string;
16
21
  docs?: string;
22
+ /** More header links, after docs, for what only this tool has. */
23
+ links?: HeaderLink[];
17
24
  Link?: LinkComponent;
18
25
  children: ReactNode;
19
26
  }): import("react/jsx-runtime").JSX.Element;
@@ -13,8 +13,8 @@ export function Mark({ tool, size = 26 }) {
13
13
  return (_jsxs("span", { className: "akt-mark", style: { width: size, height: size }, "aria-hidden": "true", children: [_jsx("svg", { className: "akt-light", viewBox: "0 0 24 24", width: size, height: size, dangerouslySetInnerHTML: { __html: mark.light } }), _jsx("svg", { className: "akt-dark", viewBox: "0 0 24 24", width: size, height: size, dangerouslySetInnerHTML: { __html: mark.dark } })] }));
14
14
  }
15
15
  /** Everything a tool site shows sits inside this: it sets the tool's colours, the header and the footer. */
16
- export function ToolSite({ tool, home = '/', docs = '/docs/', Link = PlainLink, children }) {
17
- return (_jsxs("div", { className: "akt", "data-tool": tool, children: [_jsxs("main", { className: "akt-main", children: [_jsxs("header", { className: "akt-header", children: [_jsxs(Link, { className: "akt-brand", href: home, children: [_jsx(Mark, { tool: tool }), tool] }), _jsx("nav", { "aria-label": "Main", children: _jsx(Link, { href: docs, children: "docs" }) })] }), children] }), _jsx(Footer, { site: toolInfo(tool).domain })] }));
16
+ export function ToolSite({ tool, home = '/', docs = '/docs/', links = [], Link = PlainLink, children }) {
17
+ return (_jsxs("div", { className: "akt", "data-tool": tool, children: [_jsxs("main", { className: "akt-main", children: [_jsxs("header", { className: "akt-header", children: [_jsxs(Link, { className: "akt-brand", href: home, children: [_jsx(Mark, { tool: tool }), tool] }), _jsxs("nav", { "aria-label": "Main", children: [_jsx(Link, { href: docs, children: "docs" }), links.map((link) => _jsx(Link, { href: link.href, children: link.label }, link.href))] })] }), children] }), _jsx(Footer, { site: toolInfo(tool).domain })] }));
18
18
  }
19
19
  const SCENE_SECONDS = 5;
20
20
  /** The hero: headline, buttons, install commands under them, and the demo reel on the right. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@addiscorp/kit",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "The header, footer, theme and tool-site layout every Addis site shares, in each project's own brand colours.",
5
5
  "license": "Apache-2.0",
6
6
  "type": "module",