@astryxdesign/cli 0.7.17 → 0.7.18-canary.g57306fd
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/api/discover/_adapter.d.mts +7 -5
- package/api/discover/_adapter.mjs +12 -11
- package/api/docs/_adapter.d.mts +19 -2
- package/api/docs/_adapter.mjs +66 -5
- package/api/doctor/_adapter.d.mts +11 -62
- package/api/doctor/_adapter.mjs +242 -472
- package/api/doctor/doctor.d.mts +1 -1
- package/api/doctor/doctor.mjs +3 -3
- package/api/doctor/theme-checks.mjs +37 -45
- package/api/error.d.mts +21 -0
- package/api/error.mjs +89 -0
- package/api/hook/list/list.d.mts +1 -1
- package/api/icon/_adapter.d.mts +8 -0
- package/api/icon/_adapter.mjs +17 -0
- package/api/icon/_authoring.mjs +6 -6
- package/api/icon/_default-look.mjs +16 -16
- package/api/icon/add/add.mjs +3 -3
- package/api/icon/exportIconIndex.doc.mjs +2 -2
- package/api/icon/icon.doc.mjs +2 -2
- package/api/icon/icon.type.d.mts +4 -0
- package/api/icon/icon.type.mjs +2 -1
- package/api/icon/search/icon-index.mjs +16 -3
- package/api/icon/search/search.d.mts +15 -5
- package/api/icon/search/search.mjs +74 -16
- package/api/icon/use/use.mjs +4 -4
- package/api/render/_adapter.mjs +233 -40
- package/api/render/render.type.d.mts +1 -1
- package/api/render/render.type.mjs +1 -1
- package/api/search/ORDERING.md +2 -2
- package/api/search/_adapter.mjs +4 -0
- package/api/search/_candidate-score.mjs +32 -8
- package/api/search/_cards.json +1 -1
- package/api/search/_compound.d.mts +0 -1
- package/api/search/_compound.mjs +93 -2
- package/api/search/_icons.d.mts +4 -2
- package/api/search/_icons.mjs +4 -2
- package/api/search/_lexical.mjs +177 -17
- package/api/search/_order.d.mts +3 -1
- package/api/search/_order.mjs +16 -5
- package/api/search/_result.d.mts +9 -0
- package/api/search/_result.mjs +10 -0
- package/api/search/_score.mjs +21 -3
- package/api/swizzle/_moduleGraph.d.mts +8 -0
- package/api/swizzle/_moduleGraph.mjs +61 -3
- package/api/template/copy/copy.mjs +5 -3
- package/api/theme/_adapter.mjs +48 -12
- package/api/theme/build/build.d.mts +4 -0
- package/api/theme/build/build.mjs +69 -18
- package/api/theme/build/style-keys.mjs +4 -5
- package/api/theme/build/theme-object.mjs +5 -0
- package/api/theme/palette/generate/color.d.mts +47 -0
- package/api/theme/palette/generate/color.mjs +58 -1
- package/api/theme/palette/generate/derive-look.d.mts +293 -0
- package/api/theme/palette/generate/derive-look.mjs +1362 -0
- package/api/theme/palette/generate/editor-look.d.mts +62 -0
- package/api/theme/palette/generate/editor-look.mjs +550 -0
- package/api/theme/palette/generate/mapping.d.mts +94 -9
- package/api/theme/palette/generate/mapping.mjs +94 -22
- package/api/theme-edit/_adapter.mjs +13 -2
- package/api/theme-edit/_catalog.d.mts +13 -13
- package/api/theme-edit/_catalog.mjs +66 -28
- package/api/theme-edit/_check.d.mts +82 -6
- package/api/theme-edit/_check.mjs +1270 -238
- package/api/theme-edit/_color.d.mts +74 -0
- package/api/theme-edit/_color.mjs +168 -3
- package/api/theme-edit/_compiler.d.mts +3 -5
- package/api/theme-edit/_compiler.mjs +122 -23
- package/api/theme-edit/_context.d.mts +55 -12
- package/api/theme-edit/_context.mjs +114 -60
- package/api/theme-edit/_css.d.mts +11 -0
- package/api/theme-edit/_css.mjs +40 -0
- package/api/theme-edit/_edit.d.mts +15 -2
- package/api/theme-edit/_edit.mjs +1469 -133
- package/api/theme-edit/_how-commands.d.mts +116 -0
- package/api/theme-edit/_how-commands.mjs +227 -115
- package/api/theme-edit/_how-question.d.mts +74 -29
- package/api/theme-edit/_how-question.mjs +8514 -1256
- package/api/theme-edit/_how-sides.d.mts +22 -0
- package/api/theme-edit/_how-sides.mjs +173 -0
- package/api/theme-edit/_how-steps.d.mts +42 -0
- package/api/theme-edit/_how-steps.mjs +208 -0
- package/api/theme-edit/_how-values.d.mts +29 -0
- package/api/theme-edit/_how-values.mjs +111 -0
- package/api/theme-edit/_how-words.d.mts +15 -0
- package/api/theme-edit/_how-words.mjs +239 -0
- package/api/theme-edit/_how.d.mts +1 -1
- package/api/theme-edit/_how.mjs +422 -37
- package/api/theme-edit/_missed.d.mts +2 -1
- package/api/theme-edit/_missed.mjs +125 -13
- package/api/theme-edit/_normal.d.mts +5 -3
- package/api/theme-edit/_normal.mjs +54 -14
- package/api/theme-edit/_palette.d.mts +204 -4
- package/api/theme-edit/_palette.mjs +901 -25
- package/api/theme-edit/_part-pieces.d.mts +54 -0
- package/api/theme-edit/_part-pieces.mjs +179 -0
- package/api/theme-edit/_part-words.mjs +33 -5
- package/api/theme-edit/_parts.d.mts +133 -0
- package/api/theme-edit/_parts.mjs +599 -10
- package/api/theme-edit/_picture-traits.d.mts +259 -0
- package/api/theme-edit/_picture-traits.mjs +1030 -0
- package/api/theme-edit/_preview.d.mts +95 -4
- package/api/theme-edit/_preview.mjs +284 -31
- package/api/theme-edit/_project.d.mts +14 -4
- package/api/theme-edit/_project.mjs +95 -26
- package/api/theme-edit/_resolved.d.mts +46 -0
- package/api/theme-edit/_resolved.mjs +800 -0
- package/api/theme-edit/_set-line.d.mts +29 -0
- package/api/theme-edit/_set-line.mjs +100 -0
- package/api/theme-edit/_settings.d.mts +625 -28
- package/api/theme-edit/_settings.mjs +4867 -888
- package/api/theme-edit/_tables.d.mts +25 -1
- package/api/theme-edit/_tables.mjs +115 -11
- package/api/theme-edit/_text-looks.d.mts +78 -0
- package/api/theme-edit/_text-looks.mjs +376 -0
- package/api/theme-edit/_vet.d.mts +3 -26
- package/api/theme-edit/_vet.mjs +5 -89
- package/api/theme-edit/how/how.d.mts +1 -1
- package/api/theme-edit/how/how.mjs +1 -1
- package/api/theme-edit/show/show.d.mts +4 -3
- package/api/theme-edit/show/show.mjs +3 -2
- package/api/theme-edit/theme-edit.type.d.mts +117 -1
- package/api/theme-edit/theme-edit.type.mjs +46 -3
- package/api/theme-edit/themeEditHow.doc.mjs +3 -3
- package/api/theme-edit/themeEditNew.doc.mjs +4 -0
- package/api/theme-edit/themeEditSet.doc.mjs +6 -2
- package/api/theme-edit/themeEditShow.doc.mjs +22 -3
- package/api/theme-edit/themeEditUndo.doc.mjs +4 -0
- package/assets/component-list.generated.json +1 -1
- package/assets/docs/author-a-theme.doc.mjs +7 -4
- package/assets/docs/theme.doc.dense.mjs +10 -0
- package/assets/docs/theme.doc.mjs +10 -0
- package/assets/docs/theme.doc.zh.mjs +10 -0
- package/assets/docs/tree/export-pages.doc.mjs +1 -1
- package/assets/docs/tree/icon-sets.doc.mjs +1 -1
- package/assets/docs/use-a-theme.doc.mjs +89 -17
- package/assets/docs-routes.generated.json +1 -1
- package/assets/docs.generated.json +2 -2
- package/assets/icons/definitions/article.doc.mjs +9 -0
- package/assets/icons/template-icons.json +5 -0
- package/assets/search-catalog.generated.json +2 -2
- package/assets/self-audit.generated.json +1 -1
- package/assets/templates/blocks/components/Citation/CitationInlineText.doc.mjs +1 -1
- package/assets/templates/blocks/components/Citation/CitationInlineText.tsx +3 -1
- package/assets/templates/blocks/components/Citation/CitationShowcase.doc.mjs +1 -1
- package/assets/templates/blocks/components/Citation/CitationShowcase.tsx +3 -1
- package/assets/templates/blocks/components/Citation/CitationSourceList.doc.mjs +1 -1
- package/assets/templates/blocks/components/Citation/CitationSourceList.tsx +7 -3
- package/assets/templates/blocks/components/Markdown/MarkdownCitedContent.doc.mjs +1 -1
- package/assets/templates/blocks/components/Markdown/MarkdownCitedContent.tsx +5 -2
- package/assets/templates/components.generated.json +1 -1
- package/assets/templates/pages/ide/page.tsx +5 -10
- package/assets/templates/pages/payment-form/page.tsx +16 -60
- package/assets/templates/themes/neutral/neutralTheme.ts +4 -3
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/doctypes/_schema.d.mts +13 -13
- package/authoring/gap-report/parse.d.mts +1 -1
- package/clients/cli/build-id.generated.json +1 -1
- package/clients/cli/commands/ensure-core-built.mjs +17 -10
- package/clients/cli/commands/experimental/icon.mjs +7 -7
- package/clients/cli/commands/experimental/theme.mjs +175 -13
- package/clients/cli/commands/experimental-icon.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-compile.doc.mjs +1 -1
- package/clients/cli/commands/experimental-theme-editor-how.doc.mjs +11 -3
- package/clients/cli/commands/experimental-theme-editor-set.doc.mjs +3 -3
- package/clients/cli/commands/experimental-theme-editor-show.doc.mjs +15 -5
- package/clients/cli/commands/experimental-theme-editor-undo.doc.mjs +1 -1
- package/clients/cli/commands/hook.mjs +7 -0
- package/clients/cli/commands/theme-build.doc.mjs +1 -1
- package/clients/cli/index.mjs +6 -2
- package/clients/cli/lib/hook-format.mjs +41 -1
- package/clients/cli/lib/json-shim.mjs +34 -14
- package/clients/cli/lib/other-cli-words.mjs +7 -0
- package/clients/cli/lib/unknown-command.mjs +345 -46
- package/clients/cli/manifest.generated.json +1 -1
- package/foundation/agent-docs/agent-docs.d.mts +11 -2
- package/foundation/agent-docs/agent-docs.mjs +51 -8
- package/foundation/config/project.d.mts +11 -1
- package/foundation/config/project.mjs +11 -2
- package/foundation/discovery/component-replacement.d.mts +5 -8
- package/foundation/discovery/component-replacement.mjs +12 -14
- package/foundation/discovery/core-augmentation-points.d.mts +35 -0
- package/foundation/discovery/core-augmentation-points.mjs +410 -9
- package/foundation/discovery/core-elements.d.mts +6 -0
- package/foundation/discovery/core-elements.mjs +10 -2
- package/foundation/discovery/core-prop-types.d.mts +5 -0
- package/foundation/discovery/core-prop-types.mjs +10 -3
- package/foundation/discovery/core-props.d.mts +8 -0
- package/foundation/discovery/core-props.mjs +29 -13
- package/foundation/discovery/icon-ranking.d.mts +5 -2
- package/foundation/discovery/icon-ranking.mjs +101 -18
- package/foundation/discovery/icon-set-checks.mjs +1 -1
- package/foundation/discovery/icon-set-writer.mjs +1 -1
- package/foundation/discovery/official-list.d.mts +17 -0
- package/foundation/discovery/official-list.mjs +77 -0
- package/foundation/discovery/unknown-core-props.d.mts +130 -0
- package/foundation/discovery/unknown-core-props.mjs +601 -0
- package/foundation/discovery/written-prop-values.d.mts +35 -0
- package/foundation/discovery/written-prop-values.mjs +258 -0
- package/foundation/fonts/fontsource-families.generated.d.mts +5 -0
- package/foundation/fonts/fontsource-families.generated.mjs +2110 -0
- package/foundation/fs/package-name.d.mts +10 -0
- package/foundation/fs/package-name.mjs +37 -0
- package/foundation/fs/project-source-files.d.mts +27 -0
- package/foundation/fs/project-source-files.mjs +115 -0
- package/foundation/fs/project-sources.d.mts +25 -0
- package/foundation/fs/project-sources.mjs +83 -0
- package/foundation/fs/read-record.d.mts +18 -0
- package/foundation/fs/read-record.mjs +36 -2
- package/foundation/integrations/integration-warnings.d.mts +39 -7
- package/foundation/integrations/integration-warnings.mjs +141 -19
- package/foundation/integrations/missing-dependency.d.mts +11 -0
- package/foundation/integrations/missing-dependency.mjs +20 -5
- package/foundation/release/folder-lock.d.mts +5 -2
- package/foundation/release/folder-lock.mjs +9 -3
- package/foundation/release/notices.mjs +2 -8
- package/foundation/render/cut-short.d.mts +8 -2
- package/foundation/render/cut-short.mjs +50 -5
- package/foundation/render/drawn-contrast.d.mts +40 -0
- package/foundation/render/drawn-contrast.mjs +355 -0
- package/foundation/render/file-header.mjs +4 -0
- package/foundation/render/layers.d.mts +2 -1
- package/foundation/render/layers.mjs +22 -1
- package/foundation/render/package-resolve-hooks.d.mts +38 -9
- package/foundation/render/package-resolve-hooks.mjs +124 -32
- package/foundation/render/page-worker.mjs +95 -23
- package/foundation/render/part-boxes.d.mts +27 -0
- package/foundation/render/part-boxes.mjs +45 -0
- package/foundation/render/picture-chrome.mjs +36 -4
- package/foundation/render/picture-playwright.mjs +26 -2
- package/foundation/render/picture-window.d.mts +29 -2
- package/foundation/render/picture-window.mjs +99 -1
- package/foundation/render/render-page.d.mts +39 -6
- package/foundation/render/render-page.mjs +26 -10
- package/foundation/render/ts-paths.mjs +2 -1
- package/foundation/response/error-codes.doc.mjs +1 -1
- package/foundation/response/error-codes.mjs +1 -1
- package/foundation/response/response-types.doc.mjs +9 -5
- package/foundation/text/written-string.d.mts +4 -1
- package/foundation/text/written-string.mjs +4 -1
- package/package.json +8 -7
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
// @generated by scripts/sync-api-types.mjs from the JSDoc in api/**/*.mjs.
|
|
2
|
+
// DO NOT EDIT — run `pnpm sync:api-types` to regenerate.
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The seeds of the derived hues: Core's hues at the strength of the accent,
|
|
6
|
+
* in steps of 0.05 so an accent of about the same strength leaves them as
|
|
7
|
+
* they are, turned a little toward the accent's and a tinted neutral's hue
|
|
8
|
+
* (hueLean); Core's strength without a colored accent.
|
|
9
|
+
* @param {string | null | undefined} accent
|
|
10
|
+
* @param {string | null} [neutral]
|
|
11
|
+
* @returns {Record<string, string>}
|
|
12
|
+
*/
|
|
13
|
+
export function lookSeeds(accent: string | null | undefined, neutral?: string | null): Record<string, string>;
|
|
14
|
+
/**
|
|
15
|
+
* Where a look's card tints start, `[light, dark]`: a strong or dark
|
|
16
|
+
* accent draws them a step deeper, a pale accent a step paler; the
|
|
17
|
+
* official neutral theme's stops otherwise.
|
|
18
|
+
* @param {string | null | undefined} accent
|
|
19
|
+
* @returns {readonly [number, number]}
|
|
20
|
+
*/
|
|
21
|
+
export function tintStops(accent: string | null | undefined): readonly [number, number];
|
|
22
|
+
/**
|
|
23
|
+
* Whether a family is one lookSeeds grows: an id, a name and a seed at
|
|
24
|
+
* Core's own lightness and hue for that id (only its strength follows the
|
|
25
|
+
* look).
|
|
26
|
+
* @param {unknown} family
|
|
27
|
+
* @returns {boolean}
|
|
28
|
+
*/
|
|
29
|
+
export function isLookFamily(family: unknown): boolean;
|
|
30
|
+
/**
|
|
31
|
+
* The category and chart colors a palette derives.
|
|
32
|
+
* @param {DeriveLookInput} param0
|
|
33
|
+
* @returns {DerivedLook}
|
|
34
|
+
*/
|
|
35
|
+
export function deriveLookColors({ palette, accent, stops, modes, text, grounds, wanted, shown, }: DeriveLookInput): DerivedLook;
|
|
36
|
+
/**
|
|
37
|
+
* The seeds of the status roles a look derives: each role's own hue and
|
|
38
|
+
* lightness (the base theme's color for it) at the accent's strength. A
|
|
39
|
+
* role keeps its hue whatever the accent: an error stays the base's red,
|
|
40
|
+
* info its blue. Only its strength follows the look; a role that would
|
|
41
|
+
* then read as the accent takes the nearest shade apart from it
|
|
42
|
+
* (deriveStatusColors).
|
|
43
|
+
* `base` holds each role's base color by dial id (info, success, warning,
|
|
44
|
+
* danger).
|
|
45
|
+
* @param {Record<string, string>} base
|
|
46
|
+
* @param {string | null | undefined} accent
|
|
47
|
+
* @returns {Record<string, string>}
|
|
48
|
+
*/
|
|
49
|
+
export function statusSeeds(base: Record<string, string>, accent: string | null | undefined): Record<string, string>;
|
|
50
|
+
/**
|
|
51
|
+
* The status colors a palette derives for the roles a theme leaves unset.
|
|
52
|
+
* @param {DeriveStatusInput} param0
|
|
53
|
+
* @returns {DerivedStatus}
|
|
54
|
+
*/
|
|
55
|
+
export function deriveStatusColors({ palette, stops, modes, roles, grounds, inks, accent, wanted, shown, }: DeriveStatusInput): DerivedStatus;
|
|
56
|
+
/**
|
|
57
|
+
* The code colors and the overlay scrim a palette derives: each syntax role
|
|
58
|
+
* from its hue's family, the nearest stop that reads at 4.5:1 on the code
|
|
59
|
+
* background and on the page; the code background and the scrim from the
|
|
60
|
+
* neutral. A role that cannot read keeps the base theme's.
|
|
61
|
+
* @param {DeriveCodeInput} param0
|
|
62
|
+
* @returns {{ tokens: Record<string, DerivedToken>; unreadable: string[]; }}
|
|
63
|
+
*/
|
|
64
|
+
export function deriveCodeColors({ palette, stops, modes, grounds, codeGround, wanted, }: DeriveCodeInput): {
|
|
65
|
+
tokens: Record<string, DerivedToken>;
|
|
66
|
+
unreadable: string[];
|
|
67
|
+
};
|
|
68
|
+
/**
|
|
69
|
+
* The pairs of status fills that someone red-weak or green-weak may not
|
|
70
|
+
* tell apart: their colors as that vision sees them sit closer than
|
|
71
|
+
* CVD_ALIKE. `fills` holds opaque hex by role.
|
|
72
|
+
* @param {Record<string, string>} fills
|
|
73
|
+
* @returns {{a: string; b: string; vision: 'red-weak' | 'green-weak'}[]}
|
|
74
|
+
*/
|
|
75
|
+
export function cvdClashes(fills: Record<string, string>): {
|
|
76
|
+
a: string;
|
|
77
|
+
b: string;
|
|
78
|
+
vision: "red-weak" | "green-weak";
|
|
79
|
+
}[];
|
|
80
|
+
export { ratioDown };
|
|
81
|
+
/** Core's category hues; gray is the neutral family's. */
|
|
82
|
+
export const CATEGORY_HUES: readonly ["red", "orange", "yellow", "green", "teal", "cyan", "blue", "purple", "pink", "gray"];
|
|
83
|
+
/** The chart's series hues, in Core's series order. */
|
|
84
|
+
export const CHART_SERIES: readonly ["blue", "orange", "purple", "green", "pink", "cyan", "red", "teal", "brown", "indigo"];
|
|
85
|
+
/**
|
|
86
|
+
* Each chart scale and the family it is drawn from.
|
|
87
|
+
* @type {Readonly<Record<string, string>>}
|
|
88
|
+
*/
|
|
89
|
+
export const CHART_SCALES: Readonly<Record<string, string>>;
|
|
90
|
+
/**
|
|
91
|
+
* The seed each derived hue grows from: the official neutral palette's
|
|
92
|
+
* category seeds (packages/themes/neutral/palette.config.json; a test keeps
|
|
93
|
+
* them equal), and Core's own chart colors for the two series no category
|
|
94
|
+
* has.
|
|
95
|
+
* @type {Readonly<Record<string, string>>}
|
|
96
|
+
*/
|
|
97
|
+
export const HUE_SEEDS: Readonly<Record<string, string>>;
|
|
98
|
+
export namespace CATEGORY_STOPS {
|
|
99
|
+
let background: readonly [85, 25];
|
|
100
|
+
let border: readonly [80, 65];
|
|
101
|
+
let icon: readonly [25, 75];
|
|
102
|
+
let text: readonly [25, 80];
|
|
103
|
+
let grayBackground: readonly [90, 20];
|
|
104
|
+
let grayBorder: readonly [85, 15];
|
|
105
|
+
let grayIcon: readonly [30, 65];
|
|
106
|
+
let grayText: readonly [10, 85];
|
|
107
|
+
}
|
|
108
|
+
/**
|
|
109
|
+
* The status roles a palette derives for a look that leaves them unset: each
|
|
110
|
+
* role's dial id and the word its tokens carry.
|
|
111
|
+
* @type {Readonly<Record<string, string>>}
|
|
112
|
+
*/
|
|
113
|
+
export const STATUS_ROLES: Readonly<Record<string, string>>;
|
|
114
|
+
export namespace STATUS_STOPS {
|
|
115
|
+
export let fill: readonly [50, 70];
|
|
116
|
+
export let warningFill: readonly [85, 85];
|
|
117
|
+
let text_1: readonly [45, 80];
|
|
118
|
+
export { text_1 as text };
|
|
119
|
+
export let muted: readonly [85, 75];
|
|
120
|
+
export let mutedDarkAlpha: "3D";
|
|
121
|
+
export let onMuted: readonly [25, 80];
|
|
122
|
+
}
|
|
123
|
+
export namespace SYNTAX_STOPS {
|
|
124
|
+
export let keyword: readonly ["purple", 30, 80];
|
|
125
|
+
export let string: readonly ["green", 30, 80];
|
|
126
|
+
export let comment: readonly ["neutral", 35, 75];
|
|
127
|
+
export let number: readonly ["orange", 30, 80];
|
|
128
|
+
let _function: readonly ["blue", 30, 80];
|
|
129
|
+
export { _function as function };
|
|
130
|
+
export let type: readonly ["purple", 30, 80];
|
|
131
|
+
export let variable: readonly ["neutral", 5, 90];
|
|
132
|
+
export let operator: readonly ["neutral", 35, 75];
|
|
133
|
+
export let constant: readonly ["orange", 30, 80];
|
|
134
|
+
export let tag: readonly ["red", 30, 80];
|
|
135
|
+
export let attribute: readonly ["yellow", 30, 80];
|
|
136
|
+
export let property: readonly ["teal", 30, 80];
|
|
137
|
+
export let punctuation: readonly ["neutral", 35, 75];
|
|
138
|
+
}
|
|
139
|
+
export type Mode = "light" | "dark";
|
|
140
|
+
export type Stop = {
|
|
141
|
+
stop: number;
|
|
142
|
+
color: string;
|
|
143
|
+
family?: string | undefined;
|
|
144
|
+
alpha?: string | undefined;
|
|
145
|
+
};
|
|
146
|
+
/**
|
|
147
|
+
* A derived token: its family and its shade in each mode.
|
|
148
|
+
*/
|
|
149
|
+
export type DerivedToken = {
|
|
150
|
+
family: string;
|
|
151
|
+
light: Stop;
|
|
152
|
+
dark: Stop;
|
|
153
|
+
};
|
|
154
|
+
/**
|
|
155
|
+
* The category and chart colors a palette derives. Each set is always
|
|
156
|
+
* written when the palette has its hues.
|
|
157
|
+
*/
|
|
158
|
+
export type DerivedLook = {
|
|
159
|
+
tokens: Record<string, DerivedToken>;
|
|
160
|
+
badges: "derived" | "none";
|
|
161
|
+
chart: "derived" | "none";
|
|
162
|
+
/**
|
|
163
|
+
* Each limit no shade meets: a color still drawn alike, or one under its contrast at its most readable shade.
|
|
164
|
+
*/
|
|
165
|
+
limits: string[];
|
|
166
|
+
/**
|
|
167
|
+
* Each color moved apart from an earlier one (a tint also from the page).
|
|
168
|
+
*/
|
|
169
|
+
moved: string[];
|
|
170
|
+
/**
|
|
171
|
+
* Whether a color is still drawn like an earlier one.
|
|
172
|
+
*/
|
|
173
|
+
alike: boolean;
|
|
174
|
+
/**
|
|
175
|
+
* Whether a color is under its contrast at its most readable shade.
|
|
176
|
+
*/
|
|
177
|
+
unread: boolean;
|
|
178
|
+
};
|
|
179
|
+
/**
|
|
180
|
+
* What deriveLookColors reads.
|
|
181
|
+
*/
|
|
182
|
+
export type DeriveLookInput = {
|
|
183
|
+
/**
|
|
184
|
+
* Generated families by id.
|
|
185
|
+
*/
|
|
186
|
+
palette: Record<string, Record<Mode, Record<string | number, string>>>;
|
|
187
|
+
/**
|
|
188
|
+
* The palette's stops.
|
|
189
|
+
*/
|
|
190
|
+
stops: ReadonlyArray<number>;
|
|
191
|
+
modes: ReadonlyArray<Mode>;
|
|
192
|
+
/**
|
|
193
|
+
* The theme's text and secondary text colors (opaque hex) in a mode.
|
|
194
|
+
*/
|
|
195
|
+
text: (m: Mode) => string[];
|
|
196
|
+
/**
|
|
197
|
+
* The look's accent seed: how deep its card tints sit (tintStops).
|
|
198
|
+
*/
|
|
199
|
+
accent?: string | null | undefined;
|
|
200
|
+
/**
|
|
201
|
+
* The surfaces text sits on in a mode: page, surface, card (opaque hex).
|
|
202
|
+
*/
|
|
203
|
+
grounds: (m: Mode) => string[];
|
|
204
|
+
/**
|
|
205
|
+
* Whether a token is written (Core has it and the theme does not set it by hand).
|
|
206
|
+
*/
|
|
207
|
+
wanted?: ((token: string) => boolean) | undefined;
|
|
208
|
+
/**
|
|
209
|
+
* The modes the theme shows: notes name only these. Every mode by default.
|
|
210
|
+
*/
|
|
211
|
+
shown?: readonly Mode[] | undefined;
|
|
212
|
+
};
|
|
213
|
+
export type Badge = {
|
|
214
|
+
fill: Stop;
|
|
215
|
+
ink: {
|
|
216
|
+
stop: Stop;
|
|
217
|
+
r: number;
|
|
218
|
+
};
|
|
219
|
+
icon: {
|
|
220
|
+
stop: Stop;
|
|
221
|
+
r: number;
|
|
222
|
+
};
|
|
223
|
+
};
|
|
224
|
+
/**
|
|
225
|
+
* What deriveStatusColors reads.
|
|
226
|
+
*/
|
|
227
|
+
export type DeriveStatusInput = {
|
|
228
|
+
/**
|
|
229
|
+
* Generated families by id; a role's family has the role's dial id.
|
|
230
|
+
*/
|
|
231
|
+
palette: Record<string, Record<Mode, Record<string | number, string>>>;
|
|
232
|
+
stops: ReadonlyArray<number>;
|
|
233
|
+
modes: ReadonlyArray<Mode>;
|
|
234
|
+
/**
|
|
235
|
+
* The dial ids to derive (info, success, warning, danger).
|
|
236
|
+
*/
|
|
237
|
+
roles: ReadonlyArray<string>;
|
|
238
|
+
/**
|
|
239
|
+
* Page, surface, card (opaque hex).
|
|
240
|
+
*/
|
|
241
|
+
grounds: (m: Mode) => string[];
|
|
242
|
+
/**
|
|
243
|
+
* The text the theme draws on a role's fill in a mode, preferred first (white or near-black).
|
|
244
|
+
*/
|
|
245
|
+
inks: (m: Mode, role: string) => (Stop & {
|
|
246
|
+
family: string;
|
|
247
|
+
})[];
|
|
248
|
+
/**
|
|
249
|
+
* The accent fill in a mode, kept apart from.
|
|
250
|
+
*/
|
|
251
|
+
accent: (m: Mode) => string | null;
|
|
252
|
+
wanted?: ((token: string) => boolean) | undefined;
|
|
253
|
+
/**
|
|
254
|
+
* The modes the theme shows: notes name only these. Every mode by default.
|
|
255
|
+
*/
|
|
256
|
+
shown?: readonly Mode[] | undefined;
|
|
257
|
+
};
|
|
258
|
+
/**
|
|
259
|
+
* The status colors a palette derives, and each role's state. A token's stop may name its own family (the text on a fill is the neutral color's, or white or black).
|
|
260
|
+
*/
|
|
261
|
+
export type DerivedStatus = {
|
|
262
|
+
tokens: Record<string, DerivedToken>;
|
|
263
|
+
/**
|
|
264
|
+
* The roles derived and written.
|
|
265
|
+
*/
|
|
266
|
+
roles: Record<string, "derived">;
|
|
267
|
+
/**
|
|
268
|
+
* What the roles gave up to stay written (a fill that cannot meet every limit), and each role that keeps the base theme's colors because its text, icon or border reads at no shade.
|
|
269
|
+
*/
|
|
270
|
+
why: string[];
|
|
271
|
+
/**
|
|
272
|
+
* The roles `why` names, by dial id.
|
|
273
|
+
*/
|
|
274
|
+
short: string[];
|
|
275
|
+
};
|
|
276
|
+
/**
|
|
277
|
+
* What deriveCodeColors reads.
|
|
278
|
+
*/
|
|
279
|
+
export type DeriveCodeInput = {
|
|
280
|
+
palette: Record<string, Record<Mode, Record<string | number, string>>>;
|
|
281
|
+
stops: ReadonlyArray<number>;
|
|
282
|
+
modes: ReadonlyArray<Mode>;
|
|
283
|
+
/**
|
|
284
|
+
* The page colors code sits on, opaque hex.
|
|
285
|
+
*/
|
|
286
|
+
grounds: (m: Mode) => string[];
|
|
287
|
+
/**
|
|
288
|
+
* The code background the theme sets itself in a mode (opaque hex), which code colors read on instead of the neutral's.
|
|
289
|
+
*/
|
|
290
|
+
codeGround?: ((m: Mode) => string | null) | undefined;
|
|
291
|
+
wanted?: ((token: string) => boolean) | undefined;
|
|
292
|
+
};
|
|
293
|
+
import { ratioDown } from './color.mjs';
|