@addiscorp/kit 0.2.3 → 0.2.4

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.
@@ -14,5 +14,7 @@ export type FooterProps = {
14
14
  year?: number;
15
15
  /** Anything else for the end of the footer, before the theme switch. */
16
16
  children?: ReactNode;
17
+ /** A small line under the footer row, e.g. trademark notices. */
18
+ note?: ReactNode;
17
19
  };
18
- export declare function Footer({ site, owner, year, children }: FooterProps): import("react/jsx-runtime").JSX.Element;
20
+ export declare function Footer({ site, owner, year, children, note }: FooterProps): import("react/jsx-runtime").JSX.Element;
@@ -6,8 +6,8 @@ export const ADDIS = {
6
6
  href: 'https://addis.gg',
7
7
  logo: _jsx(AddisMark, {}),
8
8
  };
9
- export function Footer({ site, owner = ADDIS, year = new Date().getFullYear(), children }) {
10
- return (_jsxs("footer", { className: "ak-foot", children: [_jsxs("a", { className: "ak-credit", href: owner.href, children: [owner.logo, "\u00A9 ", year, " ", owner.name] }), _jsxs("span", { className: "ak-foot-end", children: [children, _jsx("span", { children: site }), _jsx(ThemeToggle, {})] })] }));
9
+ export function Footer({ site, owner = ADDIS, year = new Date().getFullYear(), children, note }) {
10
+ return (_jsxs("footer", { className: "ak-foot", children: [_jsxs("a", { className: "ak-credit", href: owner.href, children: [owner.logo, "\u00A9 ", year, " ", owner.name] }), _jsxs("span", { className: "ak-foot-end", children: [children, _jsx("span", { children: site }), _jsx(ThemeToggle, {})] }), note && _jsx("p", { className: "ak-foot-note", children: note })] }));
11
11
  }
12
12
  function AddisMark() {
13
13
  return (_jsx("svg", { className: "ak-owner-mark", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 64 64", width: 32, height: 32, "aria-hidden": "true", dangerouslySetInnerHTML: { __html: '<circle cx="32" cy="32" r="31" fill="#1b1914"/><path fill="#f3efe3" d="M28.48 41L23.89 41L29.63 28.07Q26.87 27.73 25.60 26.27Q24.33 24.82 24.33 22.28L24.33 22.28L24.33 18.87L28.73 18.87L28.73 21.44Q28.73 23.27 29.52 23.95Q30.31 24.63 32.11 24.63L32.11 24.63L35.70 24.63L28.48 41ZM40.17 41L35.55 41Q35.52 38.21 35.08 36.51Q34.65 34.80 33.81 33.85Q32.98 32.91 31.74 32.38L31.74 32.38L33.19 28.91Q35.39 29.69 36.93 31.11Q38.46 32.54 39.28 34.92Q40.11 37.31 40.17 41L40.17 41Z"/><rect x="20" y="47.5" width="8" height="3" fill="#078930"/><rect x="28" y="47.5" width="8" height="3" fill="#fcdd09"/><rect x="36" y="47.5" width="8" height="3" fill="#da121a"/>' } }));
package/dist/kit.css CHANGED
@@ -108,6 +108,7 @@
108
108
  .ak-credit { display: inline-flex; align-items: center; gap: 8px; color: var(--ak-ink); text-decoration: none; }
109
109
  .ak-credit img, .ak-owner-mark { width: 32px; height: 32px; border-radius: 50%; }
110
110
  .ak-foot-end { display: inline-flex; align-items: center; gap: 12px; }
111
+ .ak-foot-note { flex-basis: 100%; margin: 0; font-size: 11px; line-height: 1.6; color: var(--ak-soft); opacity: .8; }
111
112
 
112
113
  /* The theme switch */
113
114
  .ak-theme-toggle { box-sizing: border-box; border: 0; background: transparent; border-radius: 4px; color: inherit; cursor: pointer; display: inline-flex; height: 32px; width: 32px; align-items: center; justify-content: center; padding: 8px; }
@@ -1,7 +1,7 @@
1
1
  import type { ReactNode } from 'react';
2
2
  import type { LinkComponent } from '../header/index.js';
3
3
  import { type ToolId } from './tools.js';
4
- export { TOOLS, toolInfo, type ToolId, type ToolInfo } from './tools.js';
4
+ export { TOOLS, toolInfo, toolName, type ToolId, type ToolInfo } from './tools.js';
5
5
  export { MARKS } from './marks.js';
6
6
  export { CopyButton } from './copy.js';
7
7
  /** A tool's mark, drawn for light and dark; the theme picks one. */
@@ -15,12 +15,14 @@ export type HeaderLink = {
15
15
  href: string;
16
16
  };
17
17
  /** Everything a tool site shows sits inside this: it sets the tool's colours, the header and the footer. */
18
- export declare function ToolSite({ tool, home, docs, links, Link, children }: {
18
+ export declare function ToolSite({ tool, home, docs, links, footnote, Link, children }: {
19
19
  tool: ToolId;
20
20
  home?: string;
21
21
  docs?: string;
22
22
  /** More header links, after docs, for what only this tool has. */
23
23
  links?: HeaderLink[];
24
+ /** A small line under the footer, e.g. trademark notices. */
25
+ footnote?: ReactNode;
24
26
  Link?: LinkComponent;
25
27
  children: ReactNode;
26
28
  }): import("react/jsx-runtime").JSX.Element;
@@ -80,7 +82,7 @@ export type DocsPage = {
80
82
  title: string;
81
83
  };
82
84
  /** The docs, after rixse.dev: the pages down the side, the page on the right. */
83
- export declare function DocsLayout({ tool, pages, pathname, eyebrow, title, lede, note, home, Link, children }: {
85
+ export declare function DocsLayout({ tool, pages, pathname, eyebrow, title, lede, note, footnote, home, Link, children }: {
84
86
  tool: ToolId;
85
87
  pages: DocsPage[];
86
88
  pathname: string;
@@ -89,6 +91,8 @@ export declare function DocsLayout({ tool, pages, pathname, eyebrow, title, lede
89
91
  lede?: string;
90
92
  /** A small note under the page list, e.g. what the docs describe. */
91
93
  note?: string;
94
+ /** A small line under the footer, e.g. trademark notices. */
95
+ footnote?: ReactNode;
92
96
  home?: string;
93
97
  Link?: LinkComponent;
94
98
  children: ReactNode;
@@ -2,8 +2,8 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { Footer } from '../footer/index.js';
3
3
  import { CopyButton } from './copy.js';
4
4
  import { MARKS } from './marks.js';
5
- import { TOOLS, toolInfo } from './tools.js';
6
- export { TOOLS, toolInfo } from './tools.js';
5
+ import { TOOLS, toolInfo, toolName } from './tools.js';
6
+ export { TOOLS, toolInfo, toolName } from './tools.js';
7
7
  export { MARKS } from './marks.js';
8
8
  export { CopyButton } from './copy.js';
9
9
  const PlainLink = (props) => _jsx("a", { ...props });
@@ -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/', 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 })] }));
16
+ export function ToolSite({ tool, home = '/', docs = '/docs/', links = [], footnote, 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 }), toolName(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, note: footnote })] }));
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. */
@@ -36,12 +36,12 @@ export function Reel({ scenes }) {
36
36
  }
37
37
  /** "Why <tool> · the short version": three benefits, and the other Addis tools. */
38
38
  export function Why({ tool, benefits }) {
39
- return (_jsxs("section", { className: "akt-why", children: [_jsxs("h2", { children: ["Why ", tool, _jsx("small", { children: "the short version" })] }), _jsxs("div", { className: "akt-cards", children: [benefits.map((benefit) => (_jsxs("div", { className: "akt-card", children: [_jsx("div", { className: "akt-dash" }), _jsx("h3", { children: benefit.title }), _jsx("p", { children: benefit.text })] }, benefit.title))), _jsxs("div", { className: "akt-card", children: [_jsxs("h3", { children: ["Addis tools", _jsx("small", { children: "they work together" })] }), _jsx("div", { className: "akt-family", children: TOOLS.filter((t) => t.id !== tool).map((t) => (_jsxs("a", { className: "akt-row", href: `https://${t.domain}`, children: [_jsxs("strong", { children: [_jsx(Mark, { tool: t.id, size: 18 }), t.id] }), _jsx("span", { children: t.short })] }, t.id))) })] })] })] }));
39
+ return (_jsxs("section", { className: "akt-why", children: [_jsxs("h2", { children: ["Why ", toolName(tool), _jsx("small", { children: "the short version" })] }), _jsxs("div", { className: "akt-cards", children: [benefits.map((benefit) => (_jsxs("div", { className: "akt-card", children: [_jsx("div", { className: "akt-dash" }), _jsx("h3", { children: benefit.title }), _jsx("p", { children: benefit.text })] }, benefit.title))), _jsxs("div", { className: "akt-card", children: [_jsxs("h3", { children: ["Addis tools", _jsx("small", { children: "they work together" })] }), _jsx("div", { className: "akt-family", children: TOOLS.filter((t) => t.id !== tool).map((t) => (_jsxs("a", { className: "akt-row", href: `https://${t.domain}`, children: [_jsxs("strong", { children: [_jsx(Mark, { tool: t.id, size: 18 }), t.name ?? t.id] }), _jsx("span", { children: t.short })] }, t.id))) })] })] })] }));
40
40
  }
41
41
  /** The docs, after rixse.dev: the pages down the side, the page on the right. */
42
- export function DocsLayout({ tool, pages, pathname, eyebrow = 'Documentation', title, lede, note, home = '/', Link = PlainLink, children }) {
42
+ export function DocsLayout({ tool, pages, pathname, eyebrow = 'Documentation', title, lede, note, footnote, home = '/', Link = PlainLink, children }) {
43
43
  const here = (href) => href.replace(/\/$/, '') === pathname.replace(/\/$/, '');
44
- return (_jsxs("div", { className: "akt akt-docs", "data-tool": tool, children: [_jsxs("div", { className: "akt-docs-grid", children: [_jsxs("aside", { className: "akt-side", children: [_jsxs(Link, { className: "akt-brand", href: home, children: [_jsx(Mark, { tool: tool }), tool, _jsx("span", { className: "akt-brand-docs", children: "docs" })] }), _jsx("nav", { "aria-label": "Docs", children: pages.map((page) => (_jsx(Link, { href: page.href, "aria-current": here(page.href) ? 'page' : undefined, children: page.title }, page.href))) }), note && _jsx("p", { className: "akt-side-note", children: note })] }), _jsxs("article", { className: "akt-doc", children: [_jsx("div", { className: "akt-eyebrow", children: eyebrow }), _jsx("h1", { children: title }), lede && _jsx("p", { className: "akt-lede", children: lede }), _jsx("div", { className: "akt-prose", children: children })] })] }), _jsx(Footer, { site: toolInfo(tool).domain })] }));
44
+ return (_jsxs("div", { className: "akt akt-docs", "data-tool": tool, children: [_jsxs("div", { className: "akt-docs-grid", children: [_jsxs("aside", { className: "akt-side", children: [_jsxs(Link, { className: "akt-brand", href: home, children: [_jsx(Mark, { tool: tool }), toolName(tool), _jsx("span", { className: "akt-brand-docs", children: "docs" })] }), _jsx("nav", { "aria-label": "Docs", children: pages.map((page) => (_jsx(Link, { href: page.href, "aria-current": here(page.href) ? 'page' : undefined, children: page.title }, page.href))) }), note && _jsx("p", { className: "akt-side-note", children: note })] }), _jsxs("article", { className: "akt-doc", children: [_jsx("div", { className: "akt-eyebrow", children: eyebrow }), _jsx("h1", { children: title }), lede && _jsx("p", { className: "akt-lede", children: lede }), _jsx("div", { className: "akt-prose", children: children })] })] }), _jsx(Footer, { site: toolInfo(tool).domain, note: footnote })] }));
45
45
  }
46
46
  /** A boxed aside. */
47
47
  export function Callout({ children }) {
@@ -5,6 +5,10 @@ export type ToolInfo = {
5
5
  domain: string;
6
6
  /** One line, as the family list shows it. */
7
7
  short: string;
8
+ /** The name as shown, when it isn't the id: `SecureCore`. */
9
+ name?: string;
8
10
  };
9
11
  export declare const TOOLS: ToolInfo[];
10
12
  export declare function toolInfo(id: ToolId): ToolInfo;
13
+ /** A tool's name as every site shows it: its display name, else its id. */
14
+ export declare function toolName(id: ToolId): string;
@@ -6,7 +6,7 @@ export const TOOLS = [
6
6
  { id: 'gelada', domain: 'gelada.addis.gg', short: 'OS sandboxes, without a container.' },
7
7
  { id: 'harar', domain: 'harar.addis.gg', short: 'A simple vault for your keys.' },
8
8
  { id: 'p8', domain: 'p8.addis.gg', short: 'PHP in pure Rust. Memory-safe.' },
9
- { id: 'securecore', domain: 'securecore.addis.gg', short: 'Every WordPress plugin in its own sandbox.' },
9
+ { id: 'securecore', name: 'SecureCore', domain: 'securecore.addis.gg', short: 'Every WordPress plugin in its own sandbox.' },
10
10
  ];
11
11
  export function toolInfo(id) {
12
12
  const info = TOOLS.find((t) => t.id === id);
@@ -14,3 +14,7 @@ export function toolInfo(id) {
14
14
  throw new Error(`unknown tool: ${id}`);
15
15
  return info;
16
16
  }
17
+ /** A tool's name as every site shows it: its display name, else its id. */
18
+ export function toolName(id) {
19
+ return toolInfo(id).name ?? id;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@addiscorp/kit",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
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",