@dreamlake/dockit 0.2.3 → 0.2.5
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/Chip.d.ts +22 -0
- package/dist/components/Chip.js +43 -0
- package/dist/components/Sidebar.js +3 -2
- package/dist/components/StatusTable.d.ts +3 -0
- package/dist/components/StatusTable.js +4 -8
- package/dist/components/Topbar.js +3 -17
- package/dist/components/VersionBadge.d.ts +5 -0
- package/dist/components/mdx-components.d.ts +2 -0
- package/dist/components/mdx-components.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/renderer/Layout.js +1 -1
- package/dist/renderer/onRenderHtml.js +1 -1
- package/dist/site-config.d.ts +6 -0
- package/package.json +1 -1
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ComponentPropsWithoutRef } from 'react';
|
|
2
|
+
export type ChipVariant = 'muted' | 'accent' | 'warn';
|
|
3
|
+
export interface ChipProps extends ComponentPropsWithoutRef<'button'> {
|
|
4
|
+
/** Color pair: `muted` (default), `accent`, or `warn`. */
|
|
5
|
+
variant?: ChipVariant;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The canonical chip idiom of the shell — this component IS the design
|
|
9
|
+
* guide's badge spec, not an approximation of it: mono
|
|
10
|
+
* (`--font-doc-template-mono`), 10px / 600, `0.08em` tracking, uppercase,
|
|
11
|
+
* `2px 7px` padding, 4px radius, and a hairline `currentColor` border at
|
|
12
|
+
* 45% opacity. The topbar's DEV badge renders through it, and the
|
|
13
|
+
* segments of [`VersionBadge`](./VersionBadge.tsx) and the data-driven
|
|
14
|
+
* [`TestStatus`](./StatusTable.tsx) badge follow the same idiom.
|
|
15
|
+
*
|
|
16
|
+
* Renders a `<span>` by default, or a `<button type="button">` (with a
|
|
17
|
+
* pointer cursor) when `onClick` is given. All other props — `title`,
|
|
18
|
+
* `aria-*`, `className`, `style` — pass straight through; `style` wins
|
|
19
|
+
* over the base + variant styles, so one-off recolors are just inline
|
|
20
|
+
* overrides.
|
|
21
|
+
*/
|
|
22
|
+
export declare function Chip({ variant, onClick, className, style, children, ...rest }: ChipProps): import("react").JSX.Element;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
const VARIANT_COLORS = {
|
|
3
|
+
muted: {
|
|
4
|
+
color: "var(--color-doc-template-muted)",
|
|
5
|
+
background: "var(--color-doc-template-chip)"
|
|
6
|
+
},
|
|
7
|
+
accent: {
|
|
8
|
+
color: "var(--color-doc-template-accent)",
|
|
9
|
+
background: "var(--color-doc-template-accent-soft)"
|
|
10
|
+
},
|
|
11
|
+
warn: {
|
|
12
|
+
color: "var(--color-doc-template-warn)",
|
|
13
|
+
background: "var(--color-doc-template-warn-soft)"
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const BASE_STYLE = {
|
|
17
|
+
display: "inline-flex",
|
|
18
|
+
alignItems: "center",
|
|
19
|
+
fontFamily: "var(--font-doc-template-mono)",
|
|
20
|
+
fontSize: 10,
|
|
21
|
+
fontWeight: 600,
|
|
22
|
+
letterSpacing: "0.08em",
|
|
23
|
+
lineHeight: 1.4,
|
|
24
|
+
textTransform: "uppercase",
|
|
25
|
+
padding: "2px 7px",
|
|
26
|
+
borderRadius: 4,
|
|
27
|
+
border: "1px solid color-mix(in srgb, currentColor 45%, transparent)"
|
|
28
|
+
};
|
|
29
|
+
function Chip({ variant = "muted", onClick, className, style, children, ...rest }) {
|
|
30
|
+
const mergedStyle = {
|
|
31
|
+
...BASE_STYLE,
|
|
32
|
+
...VARIANT_COLORS[variant],
|
|
33
|
+
...onClick ? { cursor: "pointer" } : {},
|
|
34
|
+
...style
|
|
35
|
+
};
|
|
36
|
+
if (onClick) {
|
|
37
|
+
return /* @__PURE__ */ jsx("button", { type: "button", onClick, className, style: mergedStyle, ...rest, children });
|
|
38
|
+
}
|
|
39
|
+
return /* @__PURE__ */ jsx("span", { className, style: mergedStyle, ...rest, children });
|
|
40
|
+
}
|
|
41
|
+
export {
|
|
42
|
+
Chip
|
|
43
|
+
};
|
|
@@ -54,9 +54,10 @@ function Sidebar() {
|
|
|
54
54
|
className: "hidden md:flex sticky overflow-y-auto flex-col",
|
|
55
55
|
style: { top: 40, height: "calc(100vh - 40px)", padding: "22px 12px 32px 18px", gap: 2 },
|
|
56
56
|
children: groups.map((group) => {
|
|
57
|
-
const
|
|
57
|
+
const soleSection = groups.length === 1;
|
|
58
|
+
const isFolded = !soleSection && group.label ? collapsed.has(group.label) : false;
|
|
58
59
|
return /* @__PURE__ */ jsxs("div", { className: "flex flex-col", style: { gap: 1, marginBottom: isFolded ? 4 : 14, transition: "margin-bottom 0.2s ease" }, children: [
|
|
59
|
-
group.label && /* @__PURE__ */ jsxs(
|
|
60
|
+
group.label && !soleSection && /* @__PURE__ */ jsxs(
|
|
60
61
|
"button",
|
|
61
62
|
{
|
|
62
63
|
type: "button",
|
|
@@ -12,6 +12,9 @@ export declare function StatusTable({ kind }: {
|
|
|
12
12
|
/**
|
|
13
13
|
* Inline single-suite status badge for embedding in API docs. Example:
|
|
14
14
|
* <TestStatus suite="lakeshore-controlplane" />
|
|
15
|
+
*
|
|
16
|
+
* The badge itself is the data-driven face of the canonical chip idiom —
|
|
17
|
+
* see [`Chip`](./Chip.tsx) and the `StatusBadge` notes above.
|
|
15
18
|
*/
|
|
16
19
|
export declare function TestStatus({ suite, example }: {
|
|
17
20
|
suite?: string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { useState, useEffect } from "react";
|
|
3
|
+
import { Chip } from "./Chip.js";
|
|
3
4
|
const STATUS_COLOR = {
|
|
4
5
|
pass: "oklch(62% .15 145)",
|
|
5
6
|
fail: "oklch(58% .19 25)",
|
|
@@ -27,21 +28,16 @@ function StatusDot({ status }) {
|
|
|
27
28
|
function StatusBadge({ status }) {
|
|
28
29
|
const color = STATUS_COLOR[status] ?? "var(--color-doc-template-muted)";
|
|
29
30
|
return /* @__PURE__ */ jsxs(
|
|
30
|
-
|
|
31
|
+
Chip,
|
|
31
32
|
{
|
|
32
33
|
style: {
|
|
33
|
-
display: "inline-flex",
|
|
34
|
-
alignItems: "center",
|
|
35
34
|
gap: 6,
|
|
36
35
|
padding: "2px 8px",
|
|
37
|
-
|
|
36
|
+
border: "none",
|
|
38
37
|
background: `color-mix(in srgb, ${color} 12%, transparent)`,
|
|
39
38
|
color,
|
|
40
|
-
fontFamily: "var(--font-doc-template-mono)",
|
|
41
39
|
fontSize: 11,
|
|
42
|
-
|
|
43
|
-
textTransform: "uppercase",
|
|
44
|
-
letterSpacing: "0.08em"
|
|
40
|
+
lineHeight: "inherit"
|
|
45
41
|
},
|
|
46
42
|
children: [
|
|
47
43
|
/* @__PURE__ */ jsx(StatusDot, { status }),
|
|
@@ -5,6 +5,7 @@ import { findPage } from "../lib/navigation.js";
|
|
|
5
5
|
import { siteConfig } from "../site-config.js";
|
|
6
6
|
import { useMediaQuery } from "../lib/use-media-query.js";
|
|
7
7
|
import { useHiddenToggle } from "../lib/use-hidden-toggle.js";
|
|
8
|
+
import { Chip } from "./Chip.js";
|
|
8
9
|
import { ThemeToggle } from "./ThemeToggle.js";
|
|
9
10
|
import { VersionBadge } from "./VersionBadge.js";
|
|
10
11
|
import { useMerge } from "../renderer/Layout.js";
|
|
@@ -13,27 +14,12 @@ function HiddenRevealChip() {
|
|
|
13
14
|
const [show, setShow] = useHiddenToggle();
|
|
14
15
|
if (!show) return null;
|
|
15
16
|
return /* @__PURE__ */ jsx(
|
|
16
|
-
|
|
17
|
+
Chip,
|
|
17
18
|
{
|
|
18
|
-
|
|
19
|
+
variant: "warn",
|
|
19
20
|
onClick: () => setShow(false),
|
|
20
21
|
"aria-label": "Dev mode on — hidden pages are visible. Click to hide again.",
|
|
21
22
|
title: "Dev mode on — hidden pages are visible (Cmd+Shift+D to toggle)",
|
|
22
|
-
className: "text-doc-template-warn",
|
|
23
|
-
style: {
|
|
24
|
-
display: "inline-flex",
|
|
25
|
-
alignItems: "center",
|
|
26
|
-
padding: "2px 7px",
|
|
27
|
-
border: "1px solid color-mix(in srgb, var(--color-doc-template-warn) 45%, transparent)",
|
|
28
|
-
borderRadius: 4,
|
|
29
|
-
background: "var(--color-doc-template-warn-soft)",
|
|
30
|
-
fontFamily: "var(--font-doc-template-mono)",
|
|
31
|
-
fontSize: 10,
|
|
32
|
-
fontWeight: 600,
|
|
33
|
-
letterSpacing: "0.08em",
|
|
34
|
-
lineHeight: 1.4,
|
|
35
|
-
cursor: "pointer"
|
|
36
|
-
},
|
|
37
23
|
children: "DEV"
|
|
38
24
|
}
|
|
39
25
|
);
|
|
@@ -27,5 +27,10 @@ export interface VersionBadgeProps {
|
|
|
27
27
|
*
|
|
28
28
|
* Rendered by the Topbar for each `siteConfig.versionChips` entry, and
|
|
29
29
|
* exported from the library index for standalone placement.
|
|
30
|
+
*
|
|
31
|
+
* Visually, each segment follows the canonical chip idiom encapsulated by
|
|
32
|
+
* [`Chip`](./Chip.tsx) — mono 10px/600, 0.08em tracking, uppercase, 4px
|
|
33
|
+
* radius, hairline border. The two-segment (label | version) layout is
|
|
34
|
+
* bespoke, so this component does not compose `Chip` internally.
|
|
30
35
|
*/
|
|
31
36
|
export declare function VersionBadge({ label, version, collapsed, dropdown, }: VersionBadgeProps): import("react").JSX.Element;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ComponentPropsWithoutRef } from 'react';
|
|
2
2
|
import { Callout } from './Callout';
|
|
3
|
+
import { Chip } from './Chip';
|
|
3
4
|
import { Preview } from './Preview';
|
|
4
5
|
import { StatusTable, TestStatus } from './StatusTable';
|
|
5
6
|
/**
|
|
@@ -23,6 +24,7 @@ export declare const mdxComponents: {
|
|
|
23
24
|
code: import('react').FC<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLElement>, HTMLElement>, "ref">>;
|
|
24
25
|
pre: typeof PreWrapper;
|
|
25
26
|
Callout: typeof Callout;
|
|
27
|
+
Chip: typeof Chip;
|
|
26
28
|
Preview: typeof Preview;
|
|
27
29
|
StatusTable: typeof StatusTable;
|
|
28
30
|
TestStatus: typeof TestStatus;
|
|
@@ -2,6 +2,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
|
2
2
|
import { useContext, createContext, useState } from "react";
|
|
3
3
|
import { CodeBlock } from "./CodeBlock.js";
|
|
4
4
|
import { Callout } from "./Callout.js";
|
|
5
|
+
import { Chip } from "./Chip.js";
|
|
5
6
|
import { Preview } from "./Preview.js";
|
|
6
7
|
import { TestStatus, StatusTable } from "./StatusTable.js";
|
|
7
8
|
const InsidePreContext = createContext(false);
|
|
@@ -337,6 +338,7 @@ const mdxComponents = {
|
|
|
337
338
|
code: Code,
|
|
338
339
|
pre: PreWrapper,
|
|
339
340
|
Callout,
|
|
341
|
+
Chip,
|
|
340
342
|
Preview,
|
|
341
343
|
StatusTable,
|
|
342
344
|
TestStatus
|
package/dist/index.d.ts
CHANGED
|
@@ -27,6 +27,7 @@ export { useLineNumbers } from './lib/use-line-numbers';
|
|
|
27
27
|
export { useLocalStorage, DOC_PREFIX, docKey } from './lib/use-local-storage';
|
|
28
28
|
export { useMediaQuery } from './lib/use-media-query';
|
|
29
29
|
export { Callout } from './components/Callout';
|
|
30
|
+
export { Chip, type ChipProps, type ChipVariant } from './components/Chip';
|
|
30
31
|
export { ClientOnly } from './components/ClientOnly';
|
|
31
32
|
export { CodeBlock } from './components/CodeBlock';
|
|
32
33
|
export { DocFooter } from './components/DocFooter';
|
package/dist/index.js
CHANGED
|
@@ -12,6 +12,7 @@ import { useLineNumbers } from "./lib/use-line-numbers.js";
|
|
|
12
12
|
import { DOC_PREFIX, docKey, useLocalStorage } from "./lib/use-local-storage.js";
|
|
13
13
|
import { useMediaQuery } from "./lib/use-media-query.js";
|
|
14
14
|
import { Callout } from "./components/Callout.js";
|
|
15
|
+
import { Chip } from "./components/Chip.js";
|
|
15
16
|
import { ClientOnly } from "./components/ClientOnly.js";
|
|
16
17
|
import { CodeBlock } from "./components/CodeBlock.js";
|
|
17
18
|
import { DocFooter } from "./components/DocFooter.js";
|
|
@@ -36,6 +37,7 @@ function initDocs(opts) {
|
|
|
36
37
|
}
|
|
37
38
|
export {
|
|
38
39
|
Callout,
|
|
40
|
+
Chip,
|
|
39
41
|
ClientOnly,
|
|
40
42
|
CodeBlock,
|
|
41
43
|
DOC_PREFIX,
|
package/dist/renderer/Layout.js
CHANGED
|
@@ -96,7 +96,7 @@ function HeadSync() {
|
|
|
96
96
|
tag.remove();
|
|
97
97
|
}
|
|
98
98
|
let robotsTag = document.querySelector('meta[name="robots"]');
|
|
99
|
-
if (current?.noindex) {
|
|
99
|
+
if (current?.noindex || siteConfig.indexable !== true) {
|
|
100
100
|
if (!robotsTag) {
|
|
101
101
|
robotsTag = document.createElement("meta");
|
|
102
102
|
robotsTag.name = "robots";
|
|
@@ -32,7 +32,7 @@ async function onRenderHtml(pageContext) {
|
|
|
32
32
|
<link href="https://fonts.googleapis.com/css2?family=Inter+Tight:wght@400;500;600;700&family=Fira+Code:wght@400;500;600&display=swap" rel="stylesheet" />
|
|
33
33
|
<title>${title}</title>
|
|
34
34
|
${description ? escapeInject`<meta name="description" content="${description}" />` : ""}
|
|
35
|
-
${current?.noindex ? escapeInject`<meta name="robots" content="noindex, nofollow" />` : ""}
|
|
35
|
+
${current?.noindex || siteConfig.indexable !== true ? escapeInject`<meta name="robots" content="noindex, nofollow" />` : ""}
|
|
36
36
|
${mdHref ? escapeInject`<link rel="alternate" type="text/markdown" href="${mdHref}" />` : ""}
|
|
37
37
|
</head>
|
|
38
38
|
<body>
|
package/dist/site-config.d.ts
CHANGED
|
@@ -69,6 +69,12 @@ export interface SiteConfig {
|
|
|
69
69
|
* — http(s), protocol-relative, or absolute-path; anything else is
|
|
70
70
|
* silently dropped. */
|
|
71
71
|
headScripts?: string[];
|
|
72
|
+
/** Search-engine visibility. DEFAULT FALSE per org policy: every page
|
|
73
|
+
* gets `<meta name="robots" content="noindex, nofollow">` unless a site
|
|
74
|
+
* explicitly opts in with `indexable: true`. Page-level `noindex`
|
|
75
|
+
* frontmatter still applies on indexable sites. The site's own pagefind
|
|
76
|
+
* search and the llms/skill surfaces are unaffected. */
|
|
77
|
+
indexable?: boolean;
|
|
72
78
|
}
|
|
73
79
|
export declare const siteConfig: SiteConfig;
|
|
74
80
|
/** Merge site-provided values into the singleton (mutates in place). */
|
package/package.json
CHANGED