@takazudo/zudo-sg 0.4.0 → 0.4.1
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/CHANGELOG.md +27 -0
- package/README.md +11 -0
- package/dist/code-panel/editor-setup.d.ts +3 -0
- package/dist/code-panel/editor-setup.js +15 -3
- package/dist/code-panel/editor-theme.d.ts +2 -0
- package/dist/code-panel/editor-theme.js +54 -0
- package/dist/code-panel/source-editor.d.ts +10 -1
- package/dist/code-panel/source-editor.js +4 -2
- package/dist/safelist.css +1 -1
- package/package.json +4 -3
- package/styles.css +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,33 @@ All notable changes to `@takazudo/zudo-sg` are documented in this file.
|
|
|
4
4
|
|
|
5
5
|
The format is based on Keep a Changelog, and release notes are generated from the changelog MDX pages.
|
|
6
6
|
|
|
7
|
+
## [0.4.1] - 2026-09-27
|
|
8
|
+
|
|
9
|
+
This release replaces the code panel's fixed dark editor theme with an
|
|
10
|
+
engine-owned theme that meets WCAG AA text contrast, follows the page's light
|
|
11
|
+
or dark scheme, and exposes the editor colors as host-overridable tokens.
|
|
12
|
+
|
|
13
|
+
### Features
|
|
14
|
+
|
|
15
|
+
- Color the code panel's CodeMirror editors from 16 `--sg-code-*` custom
|
|
16
|
+
properties (background, text, gutter, active line, selection, cursor, and
|
|
17
|
+
nine syntax roles). Their defaults are `light-dark()` pairs chosen so every
|
|
18
|
+
text and syntax color reaches at least 4.5:1 against the surface it sits on,
|
|
19
|
+
so the editor is light on light pages, dark on dark pages, and switches when
|
|
20
|
+
the page theme toggles. Override any token on `:root` to match the host's
|
|
21
|
+
palette.
|
|
22
|
+
- Highlight the active line and its gutter number in the editable Live CSS
|
|
23
|
+
editor. The read-only source view is unchanged.
|
|
24
|
+
- Add an `extensions` option to `SourceEditor` for hosts that mount it
|
|
25
|
+
directly. The engine theme is low precedence, so a host-supplied CodeMirror
|
|
26
|
+
theme wins on conflicting rules. It is read once at mount, like `value`.
|
|
27
|
+
|
|
28
|
+
### Bug Fixes
|
|
29
|
+
|
|
30
|
+
- The editor gutter and comment text no longer fall below WCAG AA contrast:
|
|
31
|
+
the previous `oneDark` theme drew them at 3.86:1 and stayed dark on light
|
|
32
|
+
pages. `@codemirror/theme-one-dark` is no longer a dependency.
|
|
33
|
+
|
|
7
34
|
## [0.4.0] - 2026-09-27
|
|
8
35
|
|
|
9
36
|
This release lets a non-Preact host adopt the catalog, nav, search, and
|
package/README.md
CHANGED
|
@@ -259,6 +259,17 @@ migrate that declaration to `--sg-border` (and use the matching `--sg-*` role fo
|
|
|
259
259
|
other chrome color). Bare `--color-border` remains a valid host component token, but it
|
|
260
260
|
no longer controls zudo-sg chrome.
|
|
261
261
|
|
|
262
|
+
The code panel's editor surface has its own sixteen `--sg-code-*` roles (background,
|
|
263
|
+
foreground, gutter, active line, selection, cursor, and the syntax token colors), themed
|
|
264
|
+
the same order-independent way. Their `light-dark()` defaults hold WCAG AA (≥ 4.5:1)
|
|
265
|
+
contrast and follow the host's `color-scheme`; any override must preserve that contrast.
|
|
266
|
+
`SourceEditor`'s `extensions` prop lets a host mounting the editor directly pass its own
|
|
267
|
+
CodeMirror extensions, which win over the engine's theme extension — it's read once at
|
|
268
|
+
mount, so change it by remounting with a new `key`. `CodePanel` doesn't expose this prop,
|
|
269
|
+
since island props must be JSON-serializable. See
|
|
270
|
+
[Tokens and preview CSS](../../src/content/docs/architecture/tokens-and-preview-css.mdx)
|
|
271
|
+
for the full token list and override example.
|
|
272
|
+
|
|
262
273
|
The zudo-doc theme supplies framework defaults, including the breakpoints
|
|
263
274
|
needed by responsive sidebar utilities. Its color-token reset precedes your
|
|
264
275
|
tokens so they survive. Use `theme-no-reset.css` instead to preserve
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EditorView } from "@codemirror/view";
|
|
2
|
+
import { type Extension } from "@codemirror/state";
|
|
2
3
|
export interface CreateEditorOptions {
|
|
3
4
|
/** "css" enables the CSS language (live-injection buffer); else TS/JSX. */
|
|
4
5
|
language: "css" | "tsx";
|
|
@@ -8,5 +9,7 @@ export interface CreateEditorOptions {
|
|
|
8
9
|
label?: string;
|
|
9
10
|
/** Fired on every document change with the full text. */
|
|
10
11
|
onChange?: (value: string) => void;
|
|
12
|
+
/** Host extensions appended after the engine's; they win over its `Prec.low` theme. */
|
|
13
|
+
extensions?: Extension[];
|
|
11
14
|
}
|
|
12
15
|
export declare function createEditorView(doc: string, parent: HTMLElement, opts: CreateEditorOptions): EditorView;
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
EditorView,
|
|
3
|
+
highlightActiveLine,
|
|
4
|
+
highlightActiveLineGutter,
|
|
5
|
+
lineNumbers,
|
|
6
|
+
keymap
|
|
7
|
+
} from "@codemirror/view";
|
|
2
8
|
import { EditorState } from "@codemirror/state";
|
|
3
9
|
import { defaultKeymap, history, historyKeymap } from "@codemirror/commands";
|
|
4
10
|
import { javascript } from "@codemirror/lang-javascript";
|
|
5
11
|
import { css } from "@codemirror/lang-css";
|
|
6
|
-
import {
|
|
12
|
+
import { engineTheme } from "./editor-theme.js";
|
|
7
13
|
function createEditorView(doc, parent, opts) {
|
|
8
14
|
const langExtension = opts.language === "css" ? css() : javascript({ jsx: true, typescript: true });
|
|
9
15
|
const extensions = [
|
|
@@ -11,11 +17,14 @@ function createEditorView(doc, parent, opts) {
|
|
|
11
17
|
history(),
|
|
12
18
|
keymap.of([...defaultKeymap, ...historyKeymap]),
|
|
13
19
|
langExtension,
|
|
14
|
-
|
|
20
|
+
engineTheme,
|
|
15
21
|
EditorView.lineWrapping,
|
|
16
22
|
EditorState.readOnly.of(!opts.editable),
|
|
17
23
|
EditorView.editable.of(opts.editable)
|
|
18
24
|
];
|
|
25
|
+
if (opts.editable) {
|
|
26
|
+
extensions.push(highlightActiveLine(), highlightActiveLineGutter());
|
|
27
|
+
}
|
|
19
28
|
if (opts.label) {
|
|
20
29
|
extensions.push(EditorView.contentAttributes.of({ "aria-label": opts.label }));
|
|
21
30
|
}
|
|
@@ -26,6 +35,9 @@ function createEditorView(doc, parent, opts) {
|
|
|
26
35
|
})
|
|
27
36
|
);
|
|
28
37
|
}
|
|
38
|
+
if (opts.extensions) {
|
|
39
|
+
extensions.push(...opts.extensions);
|
|
40
|
+
}
|
|
29
41
|
return new EditorView({
|
|
30
42
|
state: EditorState.create({ doc, extensions }),
|
|
31
43
|
parent
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { Prec } from "@codemirror/state";
|
|
2
|
+
import { EditorView } from "@codemirror/view";
|
|
3
|
+
import { HighlightStyle, syntaxHighlighting } from "@codemirror/language";
|
|
4
|
+
import { tags as t } from "@lezer/highlight";
|
|
5
|
+
const code = (name) => `var(--sg-code-${name})`;
|
|
6
|
+
const selectionBg = { backgroundColor: code("selection-bg") };
|
|
7
|
+
const engineEditorTheme = EditorView.theme({
|
|
8
|
+
"&": {
|
|
9
|
+
color: code("fg"),
|
|
10
|
+
backgroundColor: code("bg")
|
|
11
|
+
},
|
|
12
|
+
".cm-content": {
|
|
13
|
+
caretColor: code("cursor")
|
|
14
|
+
},
|
|
15
|
+
".cm-cursor, .cm-dropCursor": {
|
|
16
|
+
borderLeftColor: code("cursor")
|
|
17
|
+
},
|
|
18
|
+
"&.cm-focused > .cm-scroller > .cm-selectionLayer .cm-selectionBackground": selectionBg,
|
|
19
|
+
".cm-selectionBackground": selectionBg,
|
|
20
|
+
".cm-content ::selection": selectionBg,
|
|
21
|
+
".cm-gutters": {
|
|
22
|
+
color: code("gutter-fg"),
|
|
23
|
+
backgroundColor: code("gutter-bg"),
|
|
24
|
+
border: "none"
|
|
25
|
+
},
|
|
26
|
+
".cm-activeLine": {
|
|
27
|
+
backgroundColor: code("active-line-bg")
|
|
28
|
+
},
|
|
29
|
+
".cm-activeLineGutter": {
|
|
30
|
+
backgroundColor: code("active-line-bg")
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const engineHighlightStyle = HighlightStyle.define([
|
|
34
|
+
{ tag: t.keyword, color: code("keyword") },
|
|
35
|
+
{ tag: [t.string, t.special(t.string), t.regexp, t.escape], color: code("string") },
|
|
36
|
+
{ tag: [t.number, t.bool, t.null, t.atom, t.unit, t.color], color: code("number") },
|
|
37
|
+
{ tag: t.comment, color: code("comment"), fontStyle: "italic" },
|
|
38
|
+
{
|
|
39
|
+
tag: [t.function(t.variableName), t.function(t.propertyName), t.macroName],
|
|
40
|
+
color: code("function")
|
|
41
|
+
},
|
|
42
|
+
{ tag: [t.propertyName, t.definition(t.propertyName)], color: code("property") },
|
|
43
|
+
{ tag: [t.typeName, t.className, t.namespace], color: code("type") },
|
|
44
|
+
{ tag: t.tagName, color: code("tag") },
|
|
45
|
+
{ tag: t.attributeName, color: code("attribute") },
|
|
46
|
+
{ tag: t.invalid, color: code("keyword") }
|
|
47
|
+
]);
|
|
48
|
+
const engineTheme = [
|
|
49
|
+
Prec.low(engineEditorTheme),
|
|
50
|
+
Prec.low(syntaxHighlighting(engineHighlightStyle))
|
|
51
|
+
];
|
|
52
|
+
export {
|
|
53
|
+
engineTheme
|
|
54
|
+
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { JSX } from "preact";
|
|
2
|
+
import type { Extension } from "@codemirror/state";
|
|
2
3
|
export interface SourceEditorProps {
|
|
3
4
|
value: string;
|
|
4
5
|
language: "css" | "tsx";
|
|
@@ -6,5 +7,13 @@ export interface SourceEditorProps {
|
|
|
6
7
|
/** Accessible name for the editor (and its <pre> fallback before it mounts). */
|
|
7
8
|
label?: string;
|
|
8
9
|
onChange?: (value: string) => void;
|
|
10
|
+
/**
|
|
11
|
+
* Extra CodeMirror extensions (e.g. a host theme), applied after — and so
|
|
12
|
+
* overriding — the engine's own. For direct `SourceEditor` use only: they are
|
|
13
|
+
* not serializable across the `CodePanel` island boundary, so `CodePanel`
|
|
14
|
+
* does not accept them. Initial configuration only, like `value` — change
|
|
15
|
+
* them by remounting with a new `key`.
|
|
16
|
+
*/
|
|
17
|
+
extensions?: Extension[];
|
|
9
18
|
}
|
|
10
|
-
export default function SourceEditor({ value, language, editable, label, onChange, }: SourceEditorProps): JSX.Element;
|
|
19
|
+
export default function SourceEditor({ value, language, editable, label, onChange, extensions, }: SourceEditorProps): JSX.Element;
|
|
@@ -6,7 +6,8 @@ function SourceEditor({
|
|
|
6
6
|
language,
|
|
7
7
|
editable = false,
|
|
8
8
|
label,
|
|
9
|
-
onChange
|
|
9
|
+
onChange,
|
|
10
|
+
extensions
|
|
10
11
|
}) {
|
|
11
12
|
const containerRef = useRef(null);
|
|
12
13
|
const viewRef = useRef(null);
|
|
@@ -21,7 +22,8 @@ function SourceEditor({
|
|
|
21
22
|
language,
|
|
22
23
|
editable,
|
|
23
24
|
label,
|
|
24
|
-
onChange: (v) => onChangeRef.current?.(v)
|
|
25
|
+
onChange: (v) => onChangeRef.current?.(v),
|
|
26
|
+
extensions
|
|
25
27
|
});
|
|
26
28
|
setLoaded(true);
|
|
27
29
|
});
|
package/dist/safelist.css
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/* generated by gen-safelist.mjs — do not edit by hand */
|
|
2
|
-
@source inline("-components -mb-px -panel -tab- [--check] [--nested] [--skip-barrel] [data-sg-card] [data-sg-catalog] [data-sg-empty] [data-sg-section] [data-sg-tile] [options] [slug] [zudo-sg] a accent accent-0 accent-1 accent-2 accent-3 accent/state accept across add adjusted after alias all allow-forms allow-same-origin allow-scripts alphabetical alphabetically already always among an and any anything appear application/json apply-css-vars are arguments aria-activedescendant aria-controls aria-describedby aria-details aria-expanded aria-hidden aria-label aria-labelledby aria-live aria-orientation aria-owns aria-pressed aria-selected array arrays as aside assumes async at authored auto await back bar barrel barrel-export base be because before below beneath bg bg-[var(--sg-accent)] bg-[var(--sg-bg)] bg-[var(--sg-surface)] bg-[var(--sg-surface-2)] bg-bg block body bogus boolean border border-[color:var(--sg-accent)] border-[color:var(--sg-border)] border-[color:var(--sg-border-strong)] border-b border-b-2 border-t border-transparent both break build builds but button by cache-control cannot canvas carries cascading case catalog catch categories category caution change changing checkbox children circle clamp class classes clear-css-vars clickable client code codegen collapsing collection collides color colors command commit compact compare compile compiled component components components2026 config configured confirm const contain content-type continue control controls copy count counts css cursor-pointer custom custom-property danger dark dashboard dashboards data data-category data-copied data-keywords data-name data-sg-card data-sg-catalog data-sg-catalog-intro data-sg-code-panel-hidden data-sg-code-panel-resizer data-sg-code-region data-sg-empty data-sg-engine-route data-sg-injected-css data-sg-preview-css data-sg-preview-doc data-sg-preview-loading data-sg-preview-scope data-sg-section data-sg-stage-grid data-sg-thumb-image data-sg-thumb-note data-sg-tile data-sg-tile-size data-sg-variant-root data-theme data-zudo-sg-tokens-empty date dead debugger declaration declarations declare declared default defaults delete demo derived describe description descriptor descriptors design design-token desktop detail detect dev different differs digit directory disabled discovered display distinct div do doc doc-chrome does drift driven dual-scheme duplicate duration each edit editing edits either el element else empty en enabled endpoint engine entries entry entrypoint enum equivalent eval every exactly exists expected explicit explicitly export exported exports exposes expressions extends extension failed fails false family fg field file files filled finally find finite first first-authored five fixed flag flex flex-1 flex-col flex-wrap focus-visible:-outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[color:var(--sg-focus)] focus-visible:outline-offset-2 follow followed follows font font-bold font-family font-medium font-semibold font-size font-size-lh font-weight for form found frame frames free-form from frost full function g gap-hsp-2xs gap-hsp-3xs gap-hsp-md gap-hsp-sm gap-hsp-xs gap-vsp-2xs gap-vsp-lg gap-vsp-md gap-x-hsp-xl gap-y-vsp-xl gate gen-registry gen-token-manifest gen:sg-registry generated get give glob-relative grid grid-cols-1 grid-cols-[repeat(auto-fit,minmax(min(18rem,100%),1fr))] group groups guards h-[1.5rem] h-full h1 h2 h3 hand handle hands has have head header headers height here hex hidden hold host hover:text-[color:var(--sg-fg)] hover:text-fg hsp html human-friendly id if iframe iframes image img implements import important in in-engine include including inert info init inject inline-block inline-flex input inserting inserts inside installed instanceof instead interface into intro invalid inventory is isolated it items-center items-start its itself justify-between justify-center kebab-case keeps key key-enumeration keyboard keydown keyed kind known label large layout lazy leading leading-normal left length let lh light like line line-beauty-accent line-beauty-accent-dark line-beauty-hover line-beauty-hover-dark line-height line-laser-accent line-laser-accent-dark line-laser-hover line-laser-hover-dark line-meeting-accent line-meeting-accent-dark line-meeting-hover line-meeting-hover-dark line-process-accent line-process-accent-dark line-process-hover line-process-hover-dark line-vacuum-accent line-vacuum-accent-dark line-vacuum-hover line-vacuum-hover-dark link lint:tokens list listed lists live live-css load loading m-0 m21 makes malformed manifest map marker markers match matching material max-w-[56rem] may mb-vsp-2xs mb-vsp-lg mb-vsp-sm mb-vsp-xl message meta metadata min-h-0 mirroring missing mobile mode mode-dependent mode-independent model module ms ms-auto mt-vsp-2xs mt-vsp-3xs mt-vsp-xl mt-vsp-xs must mx-auto name name/value named named-export names namespace navigation needs neutral-0 neutral-1 neutral-2 neutral-3 never new new-component new:component no no-store node:crypto node:fs node:fs/promises node:module node:path node:url noindex non-empty none not note nowhere null number object of off oklch omit omitted on once one one-sentence only option options opts or order ordered other out outline-none outside overflow-auto overflow-hidden overflow-x-auto overriding p p-hsp-2xs p-hsp-md p-hsp-sm package pages pairs palette palette- panel panels parse parsed parser pass passes path per-element per-variant pick pill placeholder placeholders plain plugin plugins pnpm point polite polyline portable positive postcss pre preact-render-to-string preact/hooks preact/jsx-runtime presentation preserve preview previews primary private property protected provided pt-vsp-xl public pushes px px-hsp-2xs px-hsp-md px-hsp-sm px-hsp-xs py-vsp-2xs py-vsp-3xs py-vsp-xs radius rail ramp ramps range raw re-executed re-run read-only readonly ready real recover rect reference references regenerated region registration registry relative rem rem-aware rem-based renamed/removed render rendered renders replace replaces require required requires reserved resolve resolved return returns rhythm robots root-absolute round rounded rounded-full rounded-md rounded-sm rounded-t-sm route router routes routes-src row rows run runtime s same saved scaffold scaffolds screen scrim script search secondary section segment segments select semantic separator set settings sg-catalog-tile-size sg-chip sg-chip-row sg-code-live-css sg-code-panel sg-code-panel- sg-code-panel-hidden sg-code-panel-resizer sg-code-panel-width sg-code-source sg-copy-btn sg-filter sg-filter-row sg-gallery-section sg-grid sg-injected- sg-preview-design-token-panel-modal sg-preview-design-tokens sg-preview-design-tokens/v1 sg-preview-tokens-trigger sg-preview-tweak sg-registry sg-search-clear sg-search-field sg-search-input sg-seg sg-seg-btn sg-single-stage sg-thumb sg-thumb-img sg-thumb-inner sg-thumb-note sg-tile sg-tile-count sg-tile-desc sg-tile-meta sg-tile-title sg-workbench- sg-workbench-toolbar sg:height sg:ready sgt- shadow shape shared show shown shrink-0 sidebar sidebar- single single-axis site size skipped skips slider slug so solid sorts source spacing span spec specimen stacked starting state state-danger state-danger-dark state-info state-info-dark state-success state-success-dark state-warning state-warning-dark static stay step still stories story string strings stroke-linecap stroke-linejoin stroke-width style styleguide stylesheet super supplies supply support supported surface surfaces svg swaps swatch switch tab tablet tablist tabpanel tabs tabular-nums text text-2xl text-[color:var(--sg-accent)] text-[color:var(--sg-fg)] text-[color:var(--sg-muted)] text-[color:var(--sg-on-accent)] text-caption text-fg text-heading text-muted text-right text-sm text-small text-xl text-xs text/icons textarea that the their them theme then these this three-tier throw thumbnail tier tier-model tile time tip title to together toggle toggle-design-token-panel toggle-preview-token-panel token tokens toolbar total tracking-wide transition-colors trigger true try tsx tweaks twice two type typechecks typeof ui- ui-color ui-defaults-dark ui-defaults-light ui-defaults-shared undefined under underline underline-offset-2 unique unit unitless units unknown unsupported until unwired up uppercase url us use used uses utf-8 utf8 valid value values var variant variants vertical via viewport views virtual:zudo-doc-chrome-bindings virtual:zudo-doc-route-context virtual:zudo-sg-context virtual:zudo-sg-preview-token-panel virtual:zudo-sg-registry virtual:zudo-sg-tokens visible visit void vs vsp w-[2.5rem] w-[5rem] warning was weight were what when which while whole whose width will window with without would written yield you your zd-content zdtp-preview-prehydrate zfb zfb:after-swap zudo-doc zudo-doc-sidebar-width zudo-sg zudo-sg-token-tweak-bridge");
|
|
2
|
+
@source inline("-components -mb-px -panel -tab- [--check] [--nested] [--skip-barrel] [data-sg-card] [data-sg-catalog] [data-sg-empty] [data-sg-section] [data-sg-tile] [options] [slug] [zudo-sg] a accent accent-0 accent-1 accent-2 accent-3 accent/state accept across active-line-bg add adjusted after alias all allow-forms allow-same-origin allow-scripts alphabetical alphabetically already always among an and any anything appear application/json apply-css-vars are arguments aria-activedescendant aria-controls aria-describedby aria-details aria-expanded aria-hidden aria-label aria-labelledby aria-live aria-orientation aria-owns aria-pressed aria-selected array arrays as aside assumes async at attribute authored auto await back bar barrel barrel-export base be because before below beneath bg bg-[var(--sg-accent)] bg-[var(--sg-bg)] bg-[var(--sg-surface)] bg-[var(--sg-surface-2)] bg-bg block body bogus boolean border border-[color:var(--sg-accent)] border-[color:var(--sg-border)] border-[color:var(--sg-border-strong)] border-b border-b-2 border-t border-transparent both break build builds but button by cache-control cannot canvas carries cascading case catalog catch categories category caution change changing checkbox children circle clamp class classes clear-css-vars clickable client code codegen collapsing collection collides color colors command comment commit compact compare compile compiled component components components2026 config configured confirm const contain content-type continue control controls copy count counts css cursor cursor-pointer custom custom-property danger dark dashboard dashboards data data-category data-copied data-keywords data-name data-sg-card data-sg-catalog data-sg-catalog-intro data-sg-code-panel-hidden data-sg-code-panel-resizer data-sg-code-region data-sg-empty data-sg-engine-route data-sg-injected-css data-sg-preview-css data-sg-preview-doc data-sg-preview-loading data-sg-preview-scope data-sg-section data-sg-stage-grid data-sg-thumb-image data-sg-thumb-note data-sg-tile data-sg-tile-size data-sg-variant-root data-theme data-zudo-sg-tokens-empty date dead debugger declaration declarations declare declared default defaults delete demo derived describe description descriptor descriptors design design-token desktop detail detect dev different differs digit directory disabled discovered display distinct div do doc doc-chrome does drift driven dual-scheme duplicate duration each edit editing edits either el element else empty en enabled endpoint engine entries entry entrypoint enum equivalent eval every exactly exists expected explicit explicitly export exported exports exposes expressions extends extension failed fails false family fg field file files filled finally find finite first first-authored five fixed flag flex flex-1 flex-col flex-wrap focus-visible:-outline-offset-2 focus-visible:outline focus-visible:outline-2 focus-visible:outline-[color:var(--sg-focus)] focus-visible:outline-offset-2 follow followed follows font font-bold font-family font-medium font-semibold font-size font-size-lh font-weight for form found frame frames free-form from frost full function g gap-hsp-2xs gap-hsp-3xs gap-hsp-md gap-hsp-sm gap-hsp-xs gap-vsp-2xs gap-vsp-lg gap-vsp-md gap-x-hsp-xl gap-y-vsp-xl gate gen-registry gen-token-manifest gen:sg-registry generated get give glob-relative grid grid-cols-1 grid-cols-[repeat(auto-fit,minmax(min(18rem,100%),1fr))] group groups guards gutter-bg gutter-fg h-[1.5rem] h-full h1 h2 h3 hand handle hands has have head header headers height here hex hidden hold host hover:text-[color:var(--sg-fg)] hover:text-fg hsp html human-friendly id if iframe iframes image img implements import important in in-engine include including inert info init inject inline-block inline-flex input inserting inserts inside installed instanceof instead interface into intro invalid inventory is isolated it italic items-center items-start its itself justify-between justify-center kebab-case keeps key key-enumeration keyboard keydown keyed keyword kind known label large layout lazy leading leading-normal left length let lh light like line line-beauty-accent line-beauty-accent-dark line-beauty-hover line-beauty-hover-dark line-height line-laser-accent line-laser-accent-dark line-laser-hover line-laser-hover-dark line-meeting-accent line-meeting-accent-dark line-meeting-hover line-meeting-hover-dark line-process-accent line-process-accent-dark line-process-hover line-process-hover-dark line-vacuum-accent line-vacuum-accent-dark line-vacuum-hover line-vacuum-hover-dark link lint:tokens list listed lists live live-css load loading m-0 m21 makes malformed manifest map marker markers match matching material max-w-[56rem] may mb-vsp-2xs mb-vsp-lg mb-vsp-sm mb-vsp-xl message meta metadata min-h-0 mirroring missing mobile mode mode-dependent mode-independent model module ms ms-auto mt-vsp-2xs mt-vsp-3xs mt-vsp-xl mt-vsp-xs must mx-auto name name/value named named-export names namespace navigation needs neutral-0 neutral-1 neutral-2 neutral-3 never new new-component new:component no no-store node:crypto node:fs node:fs/promises node:module node:path node:url noindex non-empty none not note nowhere null number object of off oklch omit omitted on once one one-sentence only option options opts or order ordered other out outline-none outside overflow-auto overflow-hidden overflow-x-auto overriding p p-hsp-2xs p-hsp-md p-hsp-sm package pages pairs palette palette- panel panels parse parsed parser pass passes path per-element per-variant pick pill placeholder placeholders plain plugin plugins pnpm point polite polyline portable positive postcss pre preact-render-to-string preact/hooks preact/jsx-runtime presentation preserve preview previews primary private property protected provided pt-vsp-xl public pushes px px-hsp-2xs px-hsp-md px-hsp-sm px-hsp-xs py-vsp-2xs py-vsp-3xs py-vsp-xs radius rail ramp ramps range raw re-executed re-run read-only readonly ready real recover rect reference references regenerated region registration registry relative rem rem-aware rem-based renamed/removed render rendered renders replace replaces require required requires reserved resolve resolved return returns rhythm robots root-absolute round rounded rounded-full rounded-md rounded-sm rounded-t-sm route router routes routes-src row rows run runtime s same saved scaffold scaffolds screen scrim script search secondary section segment segments select selection-bg semantic separator set settings sg-catalog-tile-size sg-chip sg-chip-row sg-code-live-css sg-code-panel sg-code-panel- sg-code-panel-hidden sg-code-panel-resizer sg-code-panel-width sg-code-source sg-copy-btn sg-filter sg-filter-row sg-gallery-section sg-grid sg-injected- sg-preview-design-token-panel-modal sg-preview-design-tokens sg-preview-design-tokens/v1 sg-preview-tokens-trigger sg-preview-tweak sg-registry sg-search-clear sg-search-field sg-search-input sg-seg sg-seg-btn sg-single-stage sg-thumb sg-thumb-img sg-thumb-inner sg-thumb-note sg-tile sg-tile-count sg-tile-desc sg-tile-meta sg-tile-title sg-workbench- sg-workbench-toolbar sg:height sg:ready sgt- shadow shape shared show shown shrink-0 sidebar sidebar- single single-axis site size skipped skips slider slug so solid sorts source spacing span spec specimen stacked starting state state-danger state-danger-dark state-info state-info-dark state-success state-success-dark state-warning state-warning-dark static stay step still stories story string strings stroke-linecap stroke-linejoin stroke-width style styleguide stylesheet super supplies supply support supported surface surfaces svg swaps swatch switch tab tablet tablist tabpanel tabs tabular-nums tag text text-2xl text-[color:var(--sg-accent)] text-[color:var(--sg-fg)] text-[color:var(--sg-muted)] text-[color:var(--sg-on-accent)] text-caption text-fg text-heading text-muted text-right text-sm text-small text-xl text-xs text/icons textarea that the their them theme then these this three-tier throw thumbnail tier tier-model tile time tip title to together toggle toggle-design-token-panel toggle-preview-token-panel token tokens toolbar total tracking-wide transition-colors trigger true try tsx tweaks twice two type typechecks typeof ui- ui-color ui-defaults-dark ui-defaults-light ui-defaults-shared undefined under underline underline-offset-2 unique unit unitless units unknown unsupported until unwired up uppercase url us use used uses utf-8 utf8 valid value values var variant variants vertical via viewport views virtual:zudo-doc-chrome-bindings virtual:zudo-doc-route-context virtual:zudo-sg-context virtual:zudo-sg-preview-token-panel virtual:zudo-sg-registry virtual:zudo-sg-tokens visible visit void vs vsp w-[2.5rem] w-[5rem] warning was weight were what when which while whole whose width will window with without would written yield you your zd-content zdtp-preview-prehydrate zfb zfb:after-swap zudo-doc zudo-doc-sidebar-width zudo-sg zudo-sg-token-tweak-bridge");
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@takazudo/zudo-sg",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "zudo-sg styleguide engine — story registry, catalog routes and preview machinery for zfb + zudo-doc hosts.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -135,9 +135,10 @@
|
|
|
135
135
|
"@codemirror/commands": "^6.0.0",
|
|
136
136
|
"@codemirror/lang-css": "^6.0.0",
|
|
137
137
|
"@codemirror/lang-javascript": "^6.0.0",
|
|
138
|
+
"@codemirror/language": "^6.0.0",
|
|
138
139
|
"@codemirror/state": "^6.0.0",
|
|
139
|
-
"@codemirror/theme-one-dark": "^6.0.0",
|
|
140
140
|
"@codemirror/view": "^6.0.0",
|
|
141
|
+
"@lezer/highlight": "^1.0.0",
|
|
141
142
|
"postcss": "^8.5.28",
|
|
142
143
|
"@tailwindcss/node": "^4.3.3",
|
|
143
144
|
"@tailwindcss/oxide": "^4.3.3"
|
|
@@ -151,7 +152,7 @@
|
|
|
151
152
|
"devDependencies": {
|
|
152
153
|
"@takazudo/zdtp": "0.8.5",
|
|
153
154
|
"@takazudo/zfb": "2.21.1",
|
|
154
|
-
"@takazudo/zudo-doc": "5.
|
|
155
|
+
"@takazudo/zudo-doc": "5.28.0",
|
|
155
156
|
"@testing-library/jest-dom": "^6.9.1",
|
|
156
157
|
"@testing-library/preact": "^3.2.4",
|
|
157
158
|
"@types/culori": "^4.0.1",
|
package/styles.css
CHANGED
|
@@ -60,6 +60,25 @@
|
|
|
60
60
|
var(--zd-fg, light-dark(oklch(.185 .005 65), oklch(.965 .004 65)))
|
|
61
61
|
);
|
|
62
62
|
--sg-success: var(--zd-success, light-dark(oklch(.470 .140 145), oklch(.680 .145 145)));
|
|
63
|
+
/* Code editor (#910): fixed literals, not chained to --zd-*, so the WCAG AA
|
|
64
|
+
* contrast asserted by src/code-panel/__tests__/editor-theme-contrast.test.ts
|
|
65
|
+
* holds regardless of host palette. Override any of them on :root. */
|
|
66
|
+
--sg-code-bg: light-dark(#ffffff, #161b22);
|
|
67
|
+
--sg-code-fg: light-dark(#1f2328, #e6edf3);
|
|
68
|
+
--sg-code-gutter-bg: light-dark(#f6f8fa, #0d1117);
|
|
69
|
+
--sg-code-gutter-fg: light-dark(#57606a, #8b949e);
|
|
70
|
+
--sg-code-active-line-bg: light-dark(#eaeef2, #212830);
|
|
71
|
+
--sg-code-selection-bg: light-dark(#c8ddf7, #264f78);
|
|
72
|
+
--sg-code-cursor: light-dark(#1f2328, #e6edf3);
|
|
73
|
+
--sg-code-keyword: light-dark(#b3261e, #ff7b72);
|
|
74
|
+
--sg-code-string: light-dark(#0a3069, #a5d6ff);
|
|
75
|
+
--sg-code-number: light-dark(#0550ae, #79c0ff);
|
|
76
|
+
--sg-code-comment: light-dark(#57606a, #8b949e);
|
|
77
|
+
--sg-code-function: light-dark(#6639ba, #d2a8ff);
|
|
78
|
+
--sg-code-property: light-dark(#0550ae, #79c0ff);
|
|
79
|
+
--sg-code-type: light-dark(#8a3700, #ffa657);
|
|
80
|
+
--sg-code-tag: light-dark(#116329, #7ee787);
|
|
81
|
+
--sg-code-attribute: light-dark(#0550ae, #79c0ff);
|
|
63
82
|
}
|
|
64
83
|
|
|
65
84
|
:root {
|