@lostgradient/cinder 0.27.1 → 0.28.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 +41 -0
- package/components.json +1 -1
- package/dist/_internal/code-highlighter-context.d.ts +28 -0
- package/dist/cli/index.js +12 -8
- package/dist/components/approval-card/index.js +4 -4
- package/dist/components/button/button.css +25 -0
- package/dist/components/calendar/calendar.css +14 -0
- package/dist/components/capability-gate/capability-gate.css +5 -0
- package/dist/components/checkbox/checkbox.css +19 -0
- package/dist/components/chip/chip.css +14 -0
- package/dist/components/code-block/code-block.d.svelte.ts +1 -1
- package/dist/components/code-block/code-block.examples.json +1 -1
- package/dist/components/code-block/code-block.schema.js +3 -3
- package/dist/components/code-block/code-block.svelte.d.ts +1 -1
- package/dist/components/code-block/code-block.types.d.ts +14 -12
- package/dist/components/code-block/index.js +2 -2
- package/dist/components/color-picker/color-picker.css +2 -0
- package/dist/components/combobox/combobox.css +9 -1
- package/dist/components/command-palette/command-palette.css +7 -5
- package/dist/components/file-upload/file-upload.css +2 -1
- package/dist/components/guidance-region/index.css +1 -1
- package/dist/components/image/image.examples.json +1 -1
- package/dist/components/input/input.css +20 -6
- package/dist/components/json-schema-editor/index.js +5 -5
- package/dist/components/json-schema-editor/json-view-highlighter.d.ts +14 -0
- package/dist/components/key-value-editor/index.css +1 -1
- package/dist/components/modal-region/index.css +1 -1
- package/dist/components/multi-select/multi-select.css +9 -0
- package/dist/components/pagination/pagination.css +12 -0
- package/dist/components/pin-input/pin-input.css +9 -1
- package/dist/components/radio-group/radio-group.css +16 -0
- package/dist/components/run-step-timeline/index.js +2 -2
- package/dist/components/schema-form/index.js +2 -2
- package/dist/components/schema-form/schema-form.css +9 -0
- package/dist/components/segmented-control/segmented-control.css +3 -3
- package/dist/components/selection-popover/selection-popover.css +7 -1
- package/dist/components/tag-input/tag-input.css +10 -1
- package/dist/components/terminal-frame/index.js +2 -2
- package/dist/components/terminal-frame/terminal-frame.schema.js +2 -2
- package/dist/components/terminal-frame/terminal-frame.types.d.ts +8 -0
- package/dist/components/textarea/textarea.css +1 -1
- package/dist/components/toggle/toggle.css +16 -0
- package/dist/components/tree/tree.examples.json +1 -1
- package/dist/components/virtual-list/index.js +2 -2
- package/dist/components/virtual-list/virtual-list.css +42 -9
- package/dist/highlighters/shiki/default.d.ts +13 -1
- package/dist/highlighters/shiki/default.js +2 -2
- package/dist/highlighters/shiki/index.d.ts +20 -12
- package/dist/highlighters/shiki/index.js +2 -2
- package/dist/index.browser.css +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +23 -23
- package/dist/scripts/knowledge/index.d.ts +5 -1
- package/dist/server/components/approval-card/index.js +1 -1
- package/dist/server/components/code-block/index.js +1 -1
- package/dist/server/components/color-field/index.js +2 -2
- package/dist/server/components/color-picker/index.js +2 -2
- package/dist/server/components/json-schema-editor/index.js +2 -2
- package/dist/server/components/run-step-timeline/index.js +1 -1
- package/dist/server/components/terminal-frame/index.js +1 -1
- package/dist/server/components/virtual-list/index.js +1 -1
- package/dist/server/github-dark-e7nywpbe.js +3 -0
- package/dist/server/github-light-bqtmm1zq.js +3 -0
- package/dist/server/highlighters/shiki/default.js +2 -2
- package/dist/server/highlighters/shiki/index.js +2 -2
- package/dist/server/index.js +6 -6
- package/dist/server/{index.server-4qyyw4y5.js → index.server-043cfznf.js} +1 -1
- package/dist/server/{index.server-p46tn4eb.js → index.server-09tjs48p.js} +2 -2
- package/dist/server/index.server-0hyvdf74.js +8 -0
- package/dist/server/{index.server-dxgkh9tk.js → index.server-17thvpd3.js} +1 -1
- package/dist/server/index.server-19z6hqd6.js +4 -0
- package/dist/server/index.server-31020qgk.js +3 -0
- package/dist/server/{index.server-w3nqzde5.js → index.server-45wmvjrn.js} +3 -3
- package/dist/server/{index.server-3tkgm2gn.js → index.server-6mb7w5g4.js} +2 -2
- package/dist/server/{index.server-2vxmn7x1.js → index.server-c5yajkkc.js} +4 -4
- package/dist/server/index.server-e6fknxd9.js +4 -0
- package/dist/server/index.server-fev4kwm0.js +4 -0
- package/dist/server/index.server-k4vjk75r.js +4 -0
- package/dist/server/index.server-mjbtd1gs.js +7 -0
- package/dist/server/{index.server-2bfkhzzq.js → index.server-rkp4py5n.js} +2 -2
- package/dist/server/index.server-wdz9tsq4.js +3 -0
- package/dist/server/index.server-zj9909hd.js +4 -0
- package/dist/server/json-68twtta3.js +3 -0
- package/dist/server/tokens/registry.generated.js +1 -1
- package/dist/server/tokens/runtime/index.js +92 -0
- package/dist/styles/check-token-contrast-test-values.d.ts +1 -3
- package/dist/styles/token-contrast-test-readers.d.ts +1 -1
- package/dist/tokens/registry.generated.js +2 -2
- package/dist/tokens/resolved/dark-reduced-motion.json +104 -43
- package/dist/tokens/resolved/dark.json +104 -43
- package/dist/tokens/resolved/light-reduced-motion.json +104 -43
- package/dist/tokens/resolved/light.json +104 -43
- package/dist/tokens/runtime/authoring-catalogue.d.ts +19 -0
- package/dist/tokens/runtime/authoring-catalogue.generated.d.ts +8 -0
- package/dist/tokens/runtime/authoring-palette.d.ts +25 -0
- package/dist/tokens/runtime/authoring-profiles.d.ts +48 -0
- package/dist/tokens/runtime/authoring-provenance.d.ts +31 -0
- package/dist/tokens/runtime/authoring-types.d.ts +182 -0
- package/dist/tokens/runtime/base-corpus.d.ts +29 -0
- package/dist/tokens/runtime/base-corpus.generated.d.ts +8 -0
- package/dist/tokens/runtime/context-order.d.ts +60 -0
- package/dist/tokens/runtime/context-stack.d.ts +11 -0
- package/dist/tokens/runtime/contrast/color-difference.d.ts +16 -0
- package/dist/{styles/color-contrast-utilities.d.ts → tokens/runtime/contrast/color-math.d.ts} +2 -17
- package/dist/tokens/runtime/contrast/color-mix.d.ts +3 -0
- package/dist/tokens/runtime/contrast/css-color.d.ts +29 -0
- package/dist/tokens/runtime/contrast/index.d.ts +7 -0
- package/dist/tokens/runtime/contrast/measure.d.ts +45 -0
- package/dist/tokens/runtime/contrast/pairings.d.ts +36 -0
- package/dist/tokens/runtime/contrast/thresholds.d.ts +47 -0
- package/dist/tokens/runtime/corpus-documents.d.ts +36 -0
- package/dist/tokens/runtime/corpus-validation.d.ts +10 -0
- package/dist/tokens/runtime/corpus.d.ts +35 -0
- package/dist/tokens/runtime/css-configuration.d.ts +1 -0
- package/dist/tokens/runtime/css-stylelint.d.ts +2 -0
- package/dist/tokens/runtime/css-support.d.ts +110 -0
- package/dist/tokens/runtime/evaluate.d.ts +95 -0
- package/dist/tokens/runtime/evaluated-provenance.d.ts +36 -0
- package/dist/tokens/runtime/index.d.ts +38 -0
- package/dist/tokens/runtime/index.js +95 -0
- package/dist/tokens/runtime/package-version.generated.d.ts +9 -0
- package/dist/tokens/runtime/projection.d.ts +32 -0
- package/dist/tokens/runtime/registry.d.ts +125 -0
- package/dist/tokens/runtime/resolve-extends.d.ts +30 -0
- package/dist/tokens/runtime/resolve-references.d.ts +49 -0
- package/dist/tokens/runtime/resolve-shared.d.ts +34 -0
- package/dist/tokens/runtime/resolve.d.ts +44 -0
- package/dist/tokens/runtime/resolver-order.d.ts +89 -0
- package/dist/tokens/runtime/source-digest.d.ts +20 -0
- package/dist/tokens/runtime/stylesheet-skeleton.d.ts +31 -0
- package/dist/tokens/runtime/theme-runtime.test-support.d.ts +24 -0
- package/dist/tokens/runtime/theme-sources.d.ts +46 -0
- package/dist/tokens/runtime/theme-stylesheet.d.ts +31 -0
- package/dist/tokens/runtime/types.d.ts +115 -0
- package/dist/tokens/runtime/validate-resolver.d.ts +31 -0
- package/dist/tokens/runtime/validate-schema.d.ts +22 -0
- package/dist/tokens/runtime/validate-tokens.d.ts +25 -0
- package/dist/tokens/runtime/validate-values.d.ts +33 -0
- package/dist/tokens/runtime/validate.d.ts +3 -0
- package/dist/tokens/runtime/value-color-parse.d.ts +128 -0
- package/dist/tokens/runtime/value-color.d.ts +85 -0
- package/dist/tokens/runtime/value-entry.d.ts +3 -0
- package/dist/tokens/runtime/value-formatters.d.ts +59 -0
- package/dist/tokens/sets/colors.tokens.json +65 -13
- package/dist/tokens/sets/foundation.tokens.json +23 -0
- package/dist/tokens/sets/semantic.tokens.json +136 -30
- package/dist/utilities/highlighter.d.ts +5 -5
- package/dist/utilities/retrying-loader-cache.d.ts +3 -6
- package/package.json +15 -3
- package/src/_internal/code-highlighter-context.ts +41 -0
- package/src/components/button/button.css +25 -0
- package/src/components/calendar/calendar.css +14 -0
- package/src/components/capability-gate/capability-gate.css +5 -0
- package/src/components/checkbox/checkbox.css +19 -0
- package/src/components/chip/chip.css +14 -0
- package/src/components/code-block/code-block.examples.json +1 -1
- package/src/components/code-block/code-block.schema.json +2 -2
- package/src/components/code-block/code-block.schema.ts +2 -2
- package/src/components/code-block/code-block.svelte +15 -19
- package/src/components/code-block/code-block.types.ts +14 -12
- package/src/components/color-picker/color-picker.css +2 -0
- package/src/components/combobox/combobox.css +9 -1
- package/src/components/command-palette/command-palette.css +7 -5
- package/src/components/file-upload/file-upload.css +2 -1
- package/src/components/image/image.examples.json +1 -1
- package/src/components/input/input.css +20 -6
- package/src/components/json-schema-editor/json-view-highlighter.ts +23 -0
- package/src/components/json-schema-editor/json-view.svelte +2 -0
- package/src/components/multi-select/multi-select.css +9 -0
- package/src/components/pagination/pagination.css +12 -0
- package/src/components/pin-input/pin-input.css +9 -1
- package/src/components/radio-group/radio-group.css +16 -0
- package/src/components/schema-form/schema-form.css +9 -0
- package/src/components/segmented-control/segmented-control.css +3 -3
- package/src/components/selection-popover/selection-popover.css +7 -1
- package/src/components/tag-input/tag-input.css +10 -1
- package/src/components/terminal-frame/terminal-frame.schema.json +5 -0
- package/src/components/terminal-frame/terminal-frame.schema.ts +6 -0
- package/src/components/terminal-frame/terminal-frame.svelte +6 -2
- package/src/components/terminal-frame/terminal-frame.types.ts +8 -0
- package/src/components/textarea/textarea.css +1 -1
- package/src/components/toggle/toggle.css +16 -0
- package/src/components/tree/tree.examples.json +1 -1
- package/src/components/virtual-list/virtual-list.css +42 -9
- package/src/components/virtual-list/virtual-list.svelte +54 -20
- package/src/highlighters/shiki/default.ts +13 -1
- package/src/highlighters/shiki/index.ts +20 -12
- package/src/index.ts +5 -0
- package/src/styles/foundation.css +33 -1
- package/src/styles/tokens-base.css +4 -4
- package/src/tokens/registry.generated.json +3 -3
- package/src/tokens/resolved/dark-reduced-motion.json +104 -43
- package/src/tokens/resolved/dark.json +104 -43
- package/src/tokens/resolved/light-reduced-motion.json +104 -43
- package/src/tokens/resolved/light.json +104 -43
- package/src/tokens/runtime/authoring-catalogue.generated.ts +19300 -0
- package/src/tokens/runtime/authoring-catalogue.ts +256 -0
- package/src/tokens/runtime/authoring-palette.ts +100 -0
- package/src/tokens/runtime/authoring-profiles.ts +288 -0
- package/src/tokens/runtime/authoring-provenance.ts +290 -0
- package/src/tokens/runtime/authoring-types.ts +199 -0
- package/src/tokens/runtime/base-corpus.generated.ts +10 -0
- package/src/tokens/runtime/base-corpus.ts +78 -0
- package/src/tokens/runtime/context-order.ts +182 -0
- package/src/tokens/runtime/context-stack.ts +52 -0
- package/src/tokens/runtime/contrast/color-difference.ts +114 -0
- package/src/tokens/runtime/contrast/color-math.ts +89 -0
- package/src/tokens/runtime/contrast/color-mix.ts +20 -0
- package/src/tokens/runtime/contrast/css-color.ts +312 -0
- package/src/tokens/runtime/contrast/index.ts +7 -0
- package/src/tokens/runtime/contrast/measure.ts +185 -0
- package/src/tokens/runtime/contrast/pairings.ts +324 -0
- package/src/tokens/runtime/contrast/thresholds.ts +81 -0
- package/src/tokens/runtime/corpus-documents.ts +289 -0
- package/src/tokens/runtime/corpus-validation.ts +336 -0
- package/src/tokens/runtime/corpus.ts +179 -0
- package/src/tokens/runtime/css-configuration.ts +1 -0
- package/src/tokens/runtime/css-stylelint.ts +15 -0
- package/src/tokens/runtime/css-support.ts +407 -0
- package/src/tokens/runtime/evaluate.ts +262 -0
- package/src/tokens/runtime/evaluated-provenance.ts +116 -0
- package/src/tokens/runtime/format-validator.generated.d.ts +18 -0
- package/src/tokens/runtime/format-validator.generated.js +13029 -0
- package/src/tokens/runtime/index.ts +78 -0
- package/src/tokens/runtime/package-version.generated.ts +9 -0
- package/src/tokens/runtime/projection.ts +65 -0
- package/src/tokens/runtime/registry.ts +365 -0
- package/src/tokens/runtime/resolve-extends.ts +211 -0
- package/src/tokens/runtime/resolve-references.ts +313 -0
- package/src/tokens/runtime/resolve-shared.ts +186 -0
- package/src/tokens/runtime/resolve.ts +246 -0
- package/src/tokens/runtime/resolver-order.ts +326 -0
- package/src/tokens/runtime/resolver-validator.generated.d.ts +18 -0
- package/src/tokens/runtime/resolver-validator.generated.js +15492 -0
- package/src/tokens/runtime/source-digest.ts +49 -0
- package/src/tokens/runtime/stylesheet-skeleton.ts +123 -0
- package/src/tokens/runtime/theme-sources.ts +121 -0
- package/src/tokens/runtime/theme-stylesheet.ts +177 -0
- package/src/tokens/runtime/types.ts +140 -0
- package/src/tokens/runtime/validate-resolver.ts +338 -0
- package/src/tokens/runtime/validate-schema.ts +269 -0
- package/src/tokens/runtime/validate-tokens.ts +181 -0
- package/src/tokens/runtime/validate-values.ts +396 -0
- package/src/tokens/runtime/validate.ts +57 -0
- package/src/tokens/runtime/value-color-parse.ts +309 -0
- package/src/tokens/runtime/value-color.ts +217 -0
- package/src/tokens/runtime/value-entry.ts +52 -0
- package/src/tokens/runtime/value-formatters.ts +414 -0
- package/src/tokens/sets/colors.tokens.json +65 -13
- package/src/tokens/sets/foundation.tokens.json +23 -0
- package/src/tokens/sets/semantic.tokens.json +136 -30
- package/src/utilities/highlighter.ts +5 -5
- package/src/utilities/retrying-loader-cache.ts +3 -6
- package/dist/components/code-block/code-block-default-highlighter.d.ts +0 -40
- package/dist/server/index.server-298z43yn.js +0 -4
- package/dist/server/index.server-3h11wjyh.js +0 -8
- package/dist/server/index.server-a3aerbfr.js +0 -4
- package/dist/server/index.server-kge3zp6n.js +0 -4
- package/dist/server/index.server-syf81nwz.js +0 -6
- package/dist/server/index.server-zs08f5te.js +0 -3
- package/src/components/code-block/code-block-default-highlighter.ts +0 -63
|
@@ -3,7 +3,7 @@ export {};
|
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<script lang="ts">
|
|
6
|
-
import {
|
|
6
|
+
import { getCodeHighlighterContext } from '../../_internal/code-highlighter-context.ts';
|
|
7
7
|
import { classNames } from '../../utilities/class-names.ts';
|
|
8
8
|
import { devWarn } from '../../utilities/dev-warn.ts';
|
|
9
9
|
import { overflowFadeEdges } from '../../utilities/attachments.ts';
|
|
@@ -11,47 +11,43 @@ import CopyButton from '../copy-button/copy-button.svelte';
|
|
|
11
11
|
let { code, language, highlight, highlighter, copyable = false, languageLabelVisible = true, scrollFadeVisible = false, class: className, } = $props();
|
|
12
12
|
const noopScrollFadeAttachment = () => { };
|
|
13
13
|
const viewportScrollFadeAttachment = overflowFadeEdges('inline');
|
|
14
|
+
// CodeBlock imports no highlighter of its own. It highlights with its
|
|
15
|
+
// `highlighter` prop, else with the one an ancestor published through
|
|
16
|
+
// `setCodeHighlighterContext`, else not at all. Context is read once, during
|
|
17
|
+
// initialization, as Svelte requires.
|
|
18
|
+
const contextHighlighter = getCodeHighlighterContext();
|
|
14
19
|
let highlighted = $state(null);
|
|
15
20
|
// Two-phase render contract: the server (and the first client paint) emits
|
|
16
21
|
// the plain `<pre><code>` fallback because `$effect` never runs during SSR.
|
|
17
22
|
// The effect below — client-only by definition — enhances the block to the
|
|
18
23
|
// highlighted HTML once the highlighter resolves. The outer viewport stays
|
|
19
24
|
// mounted across both phases so syntax colorization cannot move surrounding
|
|
20
|
-
// layout.
|
|
21
|
-
// what keeps Shiki out of the SSR bundle and the consumer's entry chunk.
|
|
25
|
+
// layout.
|
|
22
26
|
$effect(() => {
|
|
23
27
|
// `highlight={false}` is an absolute off switch: it disables ALL
|
|
24
|
-
// highlighting — including an explicit `highlighter` prop
|
|
25
|
-
//
|
|
26
|
-
//
|
|
27
|
-
|
|
28
|
+
// highlighting — including an explicit `highlighter` prop or a context
|
|
29
|
+
// highlighter. The block stays the escaped plain fallback. (Default when
|
|
30
|
+
// unset: highlight whenever `language` is set and a highlighter resolves.)
|
|
31
|
+
const resolvedHighlighter = highlighter ?? contextHighlighter;
|
|
32
|
+
if (highlight === false || !language || resolvedHighlighter === undefined) {
|
|
28
33
|
highlighted = null;
|
|
29
34
|
return;
|
|
30
35
|
}
|
|
31
36
|
// Snapshot the inputs this run highlights so a later `code`/`language`/
|
|
32
37
|
// `highlighter` change can't let a stale (and `{@html}`-trusted) result
|
|
33
38
|
// overwrite a newer state. The cleanup flips `cancelled`, which gates
|
|
34
|
-
// EVERY assignment below
|
|
35
|
-
// load resolves.
|
|
39
|
+
// EVERY assignment below.
|
|
36
40
|
const pendingCode = code;
|
|
37
41
|
const pendingLanguage = language;
|
|
38
|
-
const explicitHighlighter = highlighter;
|
|
39
42
|
// Drop any stale highlighted output before starting a new request so a
|
|
40
43
|
// change can't leave the previous render visible while the new request
|
|
41
44
|
// is in flight.
|
|
42
45
|
highlighted = null;
|
|
43
46
|
let cancelled = false;
|
|
44
|
-
// The highlighter may throw synchronously OR reject
|
|
45
|
-
//
|
|
46
|
-
// so all failure modes hit the same `catch`.
|
|
47
|
+
// The highlighter may throw synchronously OR reject — wrap the call in one
|
|
48
|
+
// async IIFE so both failure modes hit the same `catch`.
|
|
47
49
|
void (async () => {
|
|
48
50
|
try {
|
|
49
|
-
// An explicit `highlighter` bypasses the default entirely: the default
|
|
50
|
-
// loader is never imported, so its Shiki load + factory side effects
|
|
51
|
-
// never fire (asserted in the unit tests).
|
|
52
|
-
const resolvedHighlighter = explicitHighlighter ?? (await loadDefaultHighlighter());
|
|
53
|
-
if (cancelled)
|
|
54
|
-
return;
|
|
55
51
|
const html = await resolvedHighlighter(pendingCode, pendingLanguage);
|
|
56
52
|
if (!cancelled)
|
|
57
53
|
highlighted = html === '' ? null : html;
|
|
@@ -6,15 +6,15 @@ import type { Highlighter } from '../../utilities/highlighter.ts';
|
|
|
6
6
|
* Renders preformatted code in a `<pre><code>` element. The plain (un-highlighted)
|
|
7
7
|
* path is Svelte-text-interpolated, so HTML entities are escaped automatically.
|
|
8
8
|
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
9
|
+
* CodeBlock imports no highlighter of its own. When `language` is set it
|
|
10
|
+
* highlights with its `highlighter` prop, else with the highlighter an ancestor
|
|
11
|
+
* published through `setCodeHighlighterContext`, and with neither it renders
|
|
12
|
+
* the escaped plain fallback. The server (and the first client paint) always
|
|
13
|
+
* emits the plain `<pre><code>` fallback. Highlighting is a two-phase,
|
|
13
14
|
* client-only enhancement: colorization may appear after first paint, but the
|
|
14
15
|
* stable viewport keeps the block's layout from moving. Pass
|
|
15
16
|
* `highlight={false}` to keep `language` semantics (the header label) with
|
|
16
|
-
* zero highlighting
|
|
17
|
-
* override the bundled default per instance.
|
|
17
|
+
* zero highlighting.
|
|
18
18
|
*/
|
|
19
19
|
export type CodeBlockProps = {
|
|
20
20
|
/** The code to render. */
|
|
@@ -22,20 +22,22 @@ export type CodeBlockProps = {
|
|
|
22
22
|
/** Optional language label rendered in the header; also selects the grammar for highlighting. */
|
|
23
23
|
language?: string;
|
|
24
24
|
/**
|
|
25
|
-
* Whether to highlight. Defaults to `true` whenever `language` is set
|
|
25
|
+
* Whether to highlight. Defaults to `true` whenever `language` is set and a
|
|
26
|
+
* highlighter resolves from the `highlighter` prop or from context.
|
|
26
27
|
*
|
|
27
28
|
* `highlight={false}` is an absolute off switch: it disables ALL
|
|
28
|
-
* highlighting — including an explicit `highlighter` prop
|
|
29
|
-
*
|
|
29
|
+
* highlighting — including an explicit `highlighter` prop and a context
|
|
30
|
+
* highlighter. The block renders the escaped plain `<pre><code>` fallback
|
|
30
31
|
* while keeping the `language` header label. When highlighting is enabled,
|
|
31
32
|
* client-side colorization may appear after first paint, but the block keeps
|
|
32
33
|
* stable layout metrics.
|
|
33
34
|
*/
|
|
34
35
|
highlight?: boolean;
|
|
35
36
|
/**
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
*
|
|
37
|
+
* Highlighter for this instance. Receives `(code, language)` and returns an
|
|
38
|
+
* HTML string (sync or async). Takes precedence over a highlighter an
|
|
39
|
+
* ancestor published through `setCodeHighlighterContext`; with neither, the
|
|
40
|
+
* block renders unhighlighted.
|
|
39
41
|
*
|
|
40
42
|
* @security The returned string is rendered VERBATIM via `{@html}` — it is a
|
|
41
43
|
* trusted-HTML boundary. The highlighter MUST escape any user- or
|
|
@@ -200,6 +200,8 @@
|
|
|
200
200
|
justify-content: space-between;
|
|
201
201
|
gap: var(--cinder-space-2);
|
|
202
202
|
min-width: 0;
|
|
203
|
+
/* WCAG 2.5.8: the three stacked format buttons are 24 CSS px tall at least. */
|
|
204
|
+
min-block-size: 24px;
|
|
203
205
|
padding: 0;
|
|
204
206
|
border: 0;
|
|
205
207
|
background: transparent;
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
|
|
47
47
|
/* Sticky-hover suppression on touch. */
|
|
48
48
|
@media (hover: hover) {
|
|
49
|
-
.cinder-combobox__input:hover:not(:disabled) {
|
|
49
|
+
.cinder-combobox__input:hover:not(:disabled):not(:focus-visible) {
|
|
50
50
|
border-color: var(--cinder-border-strong);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -63,6 +63,14 @@
|
|
|
63
63
|
border-color: var(--cinder-status-danger-solid);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/* COR-1498: the tight ring sits directly on the control edge, so a visible
|
|
67
|
+
border inside it would read as one heavier 3px shape (the COR-1072
|
|
68
|
+
problem). Keep the border transparent while focused, in every state,
|
|
69
|
+
and keep hover from repainting it. */
|
|
70
|
+
.cinder-combobox__input[aria-invalid='true']:focus-visible {
|
|
71
|
+
border-color: transparent;
|
|
72
|
+
}
|
|
73
|
+
|
|
66
74
|
.cinder-combobox__input:disabled {
|
|
67
75
|
background: var(--cinder-surface-inset);
|
|
68
76
|
color: var(--cinder-text-disabled);
|
|
@@ -108,13 +108,15 @@
|
|
|
108
108
|
border-radius: var(--cinder-radius-md);
|
|
109
109
|
}
|
|
110
110
|
|
|
111
|
-
/*
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
111
|
+
/* No visible ring here (COR-1498, a documented exception in
|
|
112
|
+
focus-ring-policy.md). The whole search row reads as the field and the
|
|
113
|
+
caret shows focus; a ring around just the <input> left the search icon
|
|
114
|
+
outside it and competed with the active option's fill. The transparent
|
|
115
|
+
outline keeps the channel the forced-colors block below repaints with
|
|
116
|
+
Highlight, so Windows High Contrast users still get an indicator. */
|
|
115
117
|
.cinder-command-palette__input:focus-visible {
|
|
116
118
|
outline: var(--cinder-ring-width) solid transparent;
|
|
117
|
-
box-shadow:
|
|
119
|
+
box-shadow: none;
|
|
118
120
|
}
|
|
119
121
|
|
|
120
122
|
@media (forced-colors: active) {
|
|
@@ -124,7 +124,8 @@
|
|
|
124
124
|
|
|
125
125
|
.cinder-file-upload__button:focus-visible {
|
|
126
126
|
outline: var(--cinder-ring-width) solid transparent;
|
|
127
|
-
|
|
127
|
+
/* The button is a solid accent fill: gap, then ring (COR-1498). */
|
|
128
|
+
box-shadow: var(--_cinder-focus-ring-filled-shadow);
|
|
128
129
|
}
|
|
129
130
|
|
|
130
131
|
.cinder-file-upload__hint {
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"id": "basic",
|
|
8
8
|
"title": "Basic image",
|
|
9
9
|
"description": "Responsive image with lazy loading and an explicit aspect ratio.",
|
|
10
|
-
"code": "<script lang=\"ts\">\n import { Image } from '@lostgradient/cinder';\n\n const imageSource =\n \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='338' viewBox='0 0 600 338'%3E%3Crect width='600' height='338' fill='
|
|
10
|
+
"code": "<script lang=\"ts\">\n import { Image } from '@lostgradient/cinder';\n\n const imageSource =\n \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='600' height='338' viewBox='0 0 600 338'%3E%3Crect width='600' height='338' fill='%23f1f5f9'/%3E%3Cpath d='M0 260 150 120l100 90 90-70 260 198H0Z' fill='%230f172a'/%3E%3Ccircle cx='455' cy='92' r='34' fill='%230f172a'/%3E%3C/svg%3E\";\n</script>\n\n<Image\n src={imageSource}\n alt=\"An illustration of mountains beneath a sun\"\n ratio=\"16/9\"\n width={600}\n height={338}\n/>\n"
|
|
11
11
|
}
|
|
12
12
|
]
|
|
13
13
|
}
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
|
|
82
82
|
/* Sticky-hover suppression on touch. */
|
|
83
83
|
@media (hover: hover) {
|
|
84
|
-
.cinder-input:hover:not(:disabled) {
|
|
84
|
+
.cinder-input:hover:not(:disabled):not(:focus-visible) {
|
|
85
85
|
border-color: var(--cinder-border-strong);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -183,7 +183,7 @@
|
|
|
183
183
|
}
|
|
184
184
|
|
|
185
185
|
@media (hover: hover) {
|
|
186
|
-
.cinder-input[aria-invalid='true']:hover:not(:disabled) {
|
|
186
|
+
.cinder-input[aria-invalid='true']:hover:not(:disabled):not(:focus-visible) {
|
|
187
187
|
border-color: var(--_cinder-input-invalid-border-hover);
|
|
188
188
|
}
|
|
189
189
|
}
|
|
@@ -236,7 +236,7 @@
|
|
|
236
236
|
group's rules below: invalid beats resting, hover beats both, disabled
|
|
237
237
|
beats everything. Sticky-hover suppression on touch, as for the group. */
|
|
238
238
|
@media (hover: hover) {
|
|
239
|
-
.cinder-input-host:hover:not([data-disabled]) {
|
|
239
|
+
.cinder-input-host:hover:not([data-disabled]):not(:focus-within) {
|
|
240
240
|
border-color: var(--cinder-border-strong);
|
|
241
241
|
}
|
|
242
242
|
}
|
|
@@ -245,7 +245,7 @@
|
|
|
245
245
|
border-color: var(--cinder-status-danger-solid);
|
|
246
246
|
}
|
|
247
247
|
@media (hover: hover) {
|
|
248
|
-
.cinder-input-host[data-invalid]:hover:not([data-disabled]) {
|
|
248
|
+
.cinder-input-host[data-invalid]:hover:not([data-disabled]):not(:focus-within) {
|
|
249
249
|
border-color: var(--_cinder-input-invalid-border-hover);
|
|
250
250
|
}
|
|
251
251
|
}
|
|
@@ -328,7 +328,7 @@
|
|
|
328
328
|
|
|
329
329
|
/* Hover mirrors the standalone input. Sticky-hover suppression on touch. */
|
|
330
330
|
@media (hover: hover) {
|
|
331
|
-
.cinder-input-group:hover:not(.cinder-input-group--disabled) {
|
|
331
|
+
.cinder-input-group:hover:not(.cinder-input-group--disabled):not(:focus-within) {
|
|
332
332
|
border-color: var(--cinder-border-strong);
|
|
333
333
|
}
|
|
334
334
|
}
|
|
@@ -355,7 +355,7 @@
|
|
|
355
355
|
border-color: var(--cinder-status-danger-solid);
|
|
356
356
|
}
|
|
357
357
|
@media (hover: hover) {
|
|
358
|
-
.cinder-input-group--invalid:hover:not(.cinder-input-group--disabled) {
|
|
358
|
+
.cinder-input-group--invalid:hover:not(.cinder-input-group--disabled):not(:focus-within) {
|
|
359
359
|
border-color: var(--_cinder-input-invalid-border-hover);
|
|
360
360
|
}
|
|
361
361
|
}
|
|
@@ -366,6 +366,20 @@
|
|
|
366
366
|
border-color: var(--cinder-border-muted);
|
|
367
367
|
cursor: not-allowed;
|
|
368
368
|
}
|
|
369
|
+
|
|
370
|
+
/* Ring replaces the border while focused rather than stacking on it, as in
|
|
371
|
+
_input-frame.css and button.css. With the tight ring (no offset band) a
|
|
372
|
+
visible border inside it would read as one heavier 3px shape, the problem
|
|
373
|
+
COR-1072 was cancelled over. A transparent border paints the control's
|
|
374
|
+
own fill, so the ring sits directly on the fill. Placed after the invalid
|
|
375
|
+
and disabled rules so it wins at equal specificity; the hover rules above
|
|
376
|
+
exclude the focused state. The host mirrors the group, as its resting
|
|
377
|
+
colours do, so an addon appearing mid-focus does not fade a border in. */
|
|
378
|
+
.cinder-input:focus-visible,
|
|
379
|
+
.cinder-input-host:focus-within,
|
|
380
|
+
.cinder-input-group:focus-within {
|
|
381
|
+
border-color: transparent;
|
|
382
|
+
}
|
|
369
383
|
.cinder-input-group--disabled > .cinder-input {
|
|
370
384
|
background: transparent;
|
|
371
385
|
color: var(--cinder-text-disabled);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The JSON view's own highlighter.
|
|
3
|
+
*
|
|
4
|
+
* The JSON view only ever renders JSON, so it carries a curated highlighter
|
|
5
|
+
* whose only grammar is `json` and highlights with no context provider. Its
|
|
6
|
+
* themes are the adapter's default light/dark pair, so the view follows
|
|
7
|
+
* cinder's color scheme. A consumer bundle that renders the view ships that one
|
|
8
|
+
* grammar and those two themes, never Shiki's full registries.
|
|
9
|
+
*
|
|
10
|
+
* One module-scoped instance, so every JSON view shares one Shiki module and
|
|
11
|
+
* the grammar it loaded.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
import { shikiHighlighter } from '../../highlighters/shiki/index.ts';
|
|
15
|
+
import type { Highlighter } from '../../utilities/highlighter.ts';
|
|
16
|
+
|
|
17
|
+
export const jsonViewHighlighter: Highlighter = /* @__PURE__ */ shikiHighlighter({
|
|
18
|
+
languageLoaders: { json: () => import('@shikijs/langs/json') },
|
|
19
|
+
themeLoaders: {
|
|
20
|
+
'github-light': () => import('@shikijs/themes/github-light'),
|
|
21
|
+
'github-dark': () => import('@shikijs/themes/github-dark'),
|
|
22
|
+
},
|
|
23
|
+
});
|
|
@@ -11,6 +11,7 @@ import Button from '../button/button.svelte';
|
|
|
11
11
|
import { default as CodeBlock } from '../code-block/index.ts';
|
|
12
12
|
import Textarea from '../textarea/textarea.svelte';
|
|
13
13
|
import { tryParseJson, validateMetaSchema } from './json-schema-validator.ts';
|
|
14
|
+
import { jsonViewHighlighter } from './json-view-highlighter.ts';
|
|
14
15
|
// Aliased to `editorState`, not `state` — a local variable literally named
|
|
15
16
|
// `state` shadows the `$state` rune identifier, so `$state(...)` below
|
|
16
17
|
// would compile as a legacy store auto-subscription to that variable
|
|
@@ -245,6 +246,7 @@ async function startEditing() {
|
|
|
245
246
|
<CodeBlock
|
|
246
247
|
code={displayedJson}
|
|
247
248
|
language="json"
|
|
249
|
+
highlighter={jsonViewHighlighter}
|
|
248
250
|
highlight={syntaxHighlightingEnabled}
|
|
249
251
|
languageLabelVisible={false}
|
|
250
252
|
class="cinder-jse-json-view__code-block"
|
|
@@ -65,6 +65,15 @@
|
|
|
65
65
|
border-color: var(--cinder-status-danger-solid);
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
+
/* COR-1498: the tight ring sits directly on the control edge, so a visible
|
|
69
|
+
border inside it would read as one heavier 3px shape (the COR-1072
|
|
70
|
+
problem). Keep the border transparent while focused, in every state,
|
|
71
|
+
and keep hover from repainting it. */
|
|
72
|
+
.cinder-multi-select__trigger[aria-invalid='true']:focus-visible,
|
|
73
|
+
.cinder-multi-select__trigger[data-cinder-invalid='true']:focus-visible {
|
|
74
|
+
border-color: transparent;
|
|
75
|
+
}
|
|
76
|
+
|
|
68
77
|
.cinder-multi-select__summary {
|
|
69
78
|
flex: 1 1 auto;
|
|
70
79
|
min-width: 0;
|
|
@@ -99,6 +99,18 @@
|
|
|
99
99
|
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
+
/* The current page is a solid accent fill: gap, then ring (COR-1498). */
|
|
103
|
+
.cinder-pagination__page[data-cinder-current]:focus-visible {
|
|
104
|
+
box-shadow: var(--_cinder-focus-ring-filled-shadow);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
@media (forced-colors: active) {
|
|
108
|
+
.cinder-pagination__page[data-cinder-current]:focus-visible {
|
|
109
|
+
outline: var(--cinder-ring-width) solid ButtonText;
|
|
110
|
+
outline-offset: 3px;
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
|
|
102
114
|
@media (forced-colors: active) {
|
|
103
115
|
.cinder-pagination__step:focus-visible,
|
|
104
116
|
.cinder-pagination__page:focus-visible {
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
}
|
|
56
56
|
|
|
57
57
|
@media (hover: hover) {
|
|
58
|
-
.cinder-pin-input__segment:hover:not(:disabled) {
|
|
58
|
+
.cinder-pin-input__segment:hover:not(:disabled):not(:focus-visible) {
|
|
59
59
|
border-color: var(--cinder-border-strong);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
@@ -78,6 +78,14 @@
|
|
|
78
78
|
border-color: var(--cinder-status-danger-solid);
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/* COR-1498: the tight ring sits directly on the control edge, so a visible
|
|
82
|
+
border inside it would read as one heavier 3px shape (the COR-1072
|
|
83
|
+
problem). Keep the border transparent while focused, in every state,
|
|
84
|
+
and keep hover from repainting it. */
|
|
85
|
+
.cinder-pin-input[aria-invalid='true'] .cinder-pin-input__segment:focus-visible {
|
|
86
|
+
border-color: transparent;
|
|
87
|
+
}
|
|
88
|
+
|
|
81
89
|
.cinder-pin-input__segment:disabled {
|
|
82
90
|
cursor: not-allowed;
|
|
83
91
|
color: var(--cinder-text-disabled);
|
|
@@ -209,6 +209,22 @@
|
|
|
209
209
|
border-color: var(--cinder-status-danger-solid);
|
|
210
210
|
}
|
|
211
211
|
|
|
212
|
+
/* A checked radio is a solid accent fill, so the ring gets a page-coloured
|
|
213
|
+
gap (COR-1498). Inline so an invalid radio keeps its danger ring. */
|
|
214
|
+
.cinder-radio:checked:focus-visible {
|
|
215
|
+
box-shadow:
|
|
216
|
+
0 0 0 var(--_cinder-focus-ring-filled-gap) var(--cinder-ring-offset-color),
|
|
217
|
+
0 0 0 calc(var(--_cinder-focus-ring-filled-gap) + var(--cinder-ring-width))
|
|
218
|
+
var(--_cinder-radio-ring, var(--cinder-ring-color));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
@media (forced-colors: active) {
|
|
222
|
+
.cinder-radio:checked:focus-visible {
|
|
223
|
+
outline: var(--cinder-ring-width) solid Highlight;
|
|
224
|
+
outline-offset: 1px;
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
|
|
212
228
|
/* Also carries FormFieldFrame's generic `.cinder-form-field__label` class;
|
|
213
229
|
compound with it so Radio's typography out-specificities the shared base
|
|
214
230
|
rule regardless of consumer import order (component sidecars carry layer
|
|
@@ -103,6 +103,15 @@
|
|
|
103
103
|
opacity: 0.65;
|
|
104
104
|
}
|
|
105
105
|
|
|
106
|
+
/* The submit button is a solid accent fill. Without its own rule it fell back
|
|
107
|
+
to the global outline, which now sits directly on that fill. Strategy B
|
|
108
|
+
with a page-coloured gap instead (COR-1498); the forced-colors block below
|
|
109
|
+
repaints the transparent outline. */
|
|
110
|
+
.cinder-schema-form__submit:focus-visible {
|
|
111
|
+
outline: var(--cinder-ring-width) solid transparent;
|
|
112
|
+
box-shadow: var(--_cinder-focus-ring-filled-shadow);
|
|
113
|
+
}
|
|
114
|
+
|
|
106
115
|
@media (forced-colors: active) {
|
|
107
116
|
.cinder-schema-form__secondary-button,
|
|
108
117
|
.cinder-schema-form__submit {
|
|
@@ -312,9 +312,9 @@
|
|
|
312
312
|
.cinder-segmented-control-option[data-cinder-pressed]:focus-visible,
|
|
313
313
|
.cinder-segmented-control:not([data-cinder-variant='tablist'])
|
|
314
314
|
.cinder-segmented-control-option[data-cinder-current]:focus-visible {
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
315
|
+
/* These pills are solid accent fills, so the ring gets a page-coloured gap
|
|
316
|
+
(COR-1498, focus-ring-policy.md). */
|
|
317
|
+
box-shadow: var(--_cinder-focus-ring-filled-shadow);
|
|
318
318
|
z-index: 1;
|
|
319
319
|
}
|
|
320
320
|
|
|
@@ -79,7 +79,8 @@
|
|
|
79
79
|
.cinder-selection-popover__button:focus-visible {
|
|
80
80
|
outline: var(--cinder-ring-width) solid transparent;
|
|
81
81
|
outline-offset: var(--cinder-ring-offset);
|
|
82
|
-
|
|
82
|
+
/* The button is a solid accent fill: gap, then ring (COR-1498). */
|
|
83
|
+
box-shadow: var(--_cinder-focus-ring-filled-shadow), var(--cinder-shadow-md);
|
|
83
84
|
}
|
|
84
85
|
|
|
85
86
|
@media (forced-colors: active) {
|
|
@@ -198,6 +199,11 @@
|
|
|
198
199
|
box-shadow: var(--_cinder-focus-ring-shadow);
|
|
199
200
|
}
|
|
200
201
|
|
|
202
|
+
/* Submit is a solid accent fill: gap, then ring (COR-1498). */
|
|
203
|
+
.cinder-selection-popover__submit:focus-visible {
|
|
204
|
+
box-shadow: var(--_cinder-focus-ring-filled-shadow);
|
|
205
|
+
}
|
|
206
|
+
|
|
201
207
|
@media (forced-colors: active) {
|
|
202
208
|
.cinder-selection-popover__cancel:focus-visible,
|
|
203
209
|
.cinder-selection-popover__submit:focus-visible {
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
@media (hover: hover) {
|
|
30
|
-
.cinder-tag-input__control:hover:not([data-disabled]) {
|
|
30
|
+
.cinder-tag-input__control:hover:not([data-disabled]):not(:focus-within) {
|
|
31
31
|
border-color: var(--cinder-border-strong);
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -59,6 +59,15 @@
|
|
|
59
59
|
cursor: not-allowed;
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
+
/* COR-1498: the tight ring sits directly on the control edge, so a visible
|
|
63
|
+
border inside it would read as one heavier 3px shape (the COR-1072
|
|
64
|
+
problem). Keep the border transparent while focused, in every state,
|
|
65
|
+
and keep hover from repainting it. */
|
|
66
|
+
.cinder-tag-input__control:focus-within,
|
|
67
|
+
.cinder-tag-input[data-invalid] .cinder-tag-input__control:focus-within {
|
|
68
|
+
border-color: transparent;
|
|
69
|
+
}
|
|
70
|
+
|
|
62
71
|
.cinder-tag-input__listbox {
|
|
63
72
|
display: inline-flex;
|
|
64
73
|
flex-wrap: wrap;
|
|
@@ -11,6 +11,11 @@
|
|
|
11
11
|
"description": "Connection status shown in the frame chrome. Defaults to `'connecting'`.",
|
|
12
12
|
"default": "connecting"
|
|
13
13
|
},
|
|
14
|
+
"announceStatus": {
|
|
15
|
+
"type": "boolean",
|
|
16
|
+
"description": "Whether the status chip is a polite live region (`role=\"status\"`), so a change of `status`\nis announced. Set `false` when the consumer announces state itself through a more detailed\nlive region and a second announcement would be noise; the chip keeps its visible text.\nDefaults to `true`.",
|
|
17
|
+
"default": true
|
|
18
|
+
},
|
|
14
19
|
"error": {
|
|
15
20
|
"type": "string",
|
|
16
21
|
"description": "Recovery error message. The recovery UI is gated on `error` being a\nnon-empty string (`{#if error}`), not on `status`—`error=\"\"` shows\nnothing, the same as `undefined`, even though the prop is set. If\n`error` stays non-empty after `status` moves away from `'error'` (for\nexample to `'connected'`), the recovery UI remains visible until the\ncaller clears `error` too."
|
|
@@ -13,6 +13,12 @@ const schema = {
|
|
|
13
13
|
description: "Connection status shown in the frame chrome. Defaults to `'connecting'`.",
|
|
14
14
|
default: 'connecting',
|
|
15
15
|
},
|
|
16
|
+
announceStatus: {
|
|
17
|
+
type: 'boolean',
|
|
18
|
+
description:
|
|
19
|
+
'Whether the status chip is a polite live region (`role="status"`), so a change of `status`\nis announced. Set `false` when the consumer announces state itself through a more detailed\nlive region and a second announcement would be noise; the chip keeps its visible text.\nDefaults to `true`.',
|
|
20
|
+
default: true,
|
|
21
|
+
},
|
|
16
22
|
error: {
|
|
17
23
|
type: 'string',
|
|
18
24
|
description:
|
|
@@ -6,7 +6,7 @@ export {};
|
|
|
6
6
|
import { untrack } from 'svelte';
|
|
7
7
|
import { classNames } from '../../utilities/class-names.ts';
|
|
8
8
|
import { default as Grid } from '../grid/index.ts';
|
|
9
|
-
let { title, status = 'connecting', error, onReloadRequest, onDimensionsChange, columnWidth = 8, rowHeight = 18, children, class: customClassName, ...rest } = $props();
|
|
9
|
+
let { title, status = 'connecting', announceStatus = true, error, onReloadRequest, onDimensionsChange, columnWidth = 8, rowHeight = 18, children, class: customClassName, ...rest } = $props();
|
|
10
10
|
let viewport;
|
|
11
11
|
let previousColumns = -1;
|
|
12
12
|
let previousRows = -1;
|
|
@@ -58,7 +58,11 @@ $effect(() => {
|
|
|
58
58
|
<span></span><span></span><span></span>
|
|
59
59
|
</span>
|
|
60
60
|
<h2 id={titleId} class="cinder-terminal-frame__title">{title}</h2>
|
|
61
|
-
<span
|
|
61
|
+
<span
|
|
62
|
+
class="cinder-terminal-frame__status"
|
|
63
|
+
role={announceStatus ? 'status' : undefined}
|
|
64
|
+
aria-atomic={announceStatus ? 'true' : undefined}>{status}</span
|
|
65
|
+
>
|
|
62
66
|
</Grid>
|
|
63
67
|
|
|
64
68
|
{#if error}
|
|
@@ -13,6 +13,14 @@ export type TerminalFrameProps = Omit<HTMLAttributes<HTMLDivElement>, 'class' |
|
|
|
13
13
|
title: string;
|
|
14
14
|
/** Connection status shown in the frame chrome. Defaults to `'connecting'`. @default 'connecting' */
|
|
15
15
|
status?: TerminalFrameStatus;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the status chip is a polite live region (`role="status"`), so a change of `status`
|
|
18
|
+
* is announced. Set `false` when the consumer announces state itself through a more detailed
|
|
19
|
+
* live region and a second announcement would be noise; the chip keeps its visible text.
|
|
20
|
+
* Defaults to `true`.
|
|
21
|
+
* @default true
|
|
22
|
+
*/
|
|
23
|
+
announceStatus?: boolean;
|
|
16
24
|
/**
|
|
17
25
|
* Recovery error message. The recovery UI is gated on `error` being a
|
|
18
26
|
* non-empty string (`{#if error}`), not on `status`—`error=""` shows
|
|
@@ -91,6 +91,22 @@
|
|
|
91
91
|
var(--cinder-toggle-ring, var(--cinder-ring-color));
|
|
92
92
|
}
|
|
93
93
|
|
|
94
|
+
/* The on track is a solid accent fill, so the ring gets a page-coloured gap
|
|
95
|
+
* (COR-1498). Inline so a consumer's --cinder-toggle-ring still applies. */
|
|
96
|
+
.cinder-toggle[data-cinder-checked]:focus-visible {
|
|
97
|
+
box-shadow:
|
|
98
|
+
0 0 0 var(--_cinder-focus-ring-filled-gap) var(--cinder-ring-offset-color),
|
|
99
|
+
0 0 0 calc(var(--_cinder-focus-ring-filled-gap) + var(--cinder-ring-width))
|
|
100
|
+
var(--cinder-toggle-ring, var(--cinder-ring-color));
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (forced-colors: active) {
|
|
104
|
+
.cinder-toggle[data-cinder-checked]:focus-visible {
|
|
105
|
+
outline: var(--cinder-ring-width) solid ButtonText;
|
|
106
|
+
outline-offset: 3px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
94
110
|
/* Forced Colors Mode: box-shadow is suppressed by Windows High Contrast Mode, so
|
|
95
111
|
* we switch to a solid outline. ButtonText is guaranteed to contrast the button surface.
|
|
96
112
|
*/
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"id": "virtualized",
|
|
44
44
|
"title": "Virtualized tree",
|
|
45
45
|
"description": "A data-driven tree renders a small window from a 10,000-item collection while preserving full aria-posinset and aria-setsize metadata.",
|
|
46
|
-
"code": "<script lang=\"ts\">\n import { Tree, type TreeDataItem } from '@lostgradient/cinder';\n\n const items: TreeDataItem[] = Array.from({ length: 10_000 }, (_, index) => ({\n id: `virtual-file-${index}`,\n label: `Virtual file ${index}`,\n }));\n</script>\n\n<Tree\n aria-label=\"Virtualized files\"\n {items}\n virtualized\n virtualizationEstimatedRowHeight={
|
|
46
|
+
"code": "<script lang=\"ts\">\n import { Tree, type TreeDataItem } from '@lostgradient/cinder';\n\n const items: TreeDataItem[] = Array.from({ length: 10_000 }, (_, index) => ({\n id: `virtual-file-${index}`,\n label: `Virtual file ${index}`,\n }));\n</script>\n\n<Tree\n aria-label=\"Virtualized files\"\n {items}\n virtualized\n virtualizationEstimatedRowHeight={36}\n virtualizationHeight={320}\n style=\"border: 1px solid var(--cinder-border); border-radius: var(--cinder-radius-md);\"\n/>\n"
|
|
47
47
|
}
|
|
48
48
|
]
|
|
49
49
|
}
|