@astryxdesign/cli 0.7.17 → 0.7.18-canary.g170df15
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/template/template.type.d.mts +3 -3
- package/api/template/template.type.mjs +3 -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/icons.doc.mjs +7 -6
- 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/config/parse.mjs +1 -1
- package/authoring/debug/parse.d.mts +1 -1
- package/authoring/doctypes/_schema.d.mts +13 -13
- package/authoring/doctypes/icon-definition/parse.mjs +2 -2
- package/authoring/doctypes/icon-set/parse.mjs +1 -1
- package/authoring/doctypes/template/parse.mjs +1 -4
- 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/template.mjs +1 -1
- 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/template-icon-notes.mjs +3 -3
- package/foundation/discovery/template-icons.mjs +2 -2
- package/foundation/discovery/template-placeholders.mjs +1 -1
- 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/suggest/other-command.mjs +25 -1
- package/foundation/text/icon-set-next.d.mts +1 -1
- package/foundation/text/icon-set-next.mjs +2 -2
- 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,239 @@
|
|
|
1
|
+
// Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @file The word tables the how reader reads: hues people name, states a
|
|
5
|
+
* word names, words of the languages the docs ship, and the design words
|
|
6
|
+
* a near miss is corrected to.
|
|
7
|
+
* @position api/theme-edit — a leaf read by _how-question.mjs
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import {wordTable} from './_tables.mjs';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Words of other languages the docs ship, and the English word each means.
|
|
14
|
+
* Matched as whole words, or anywhere for scripts without spaces.
|
|
15
|
+
* @type {Array<[RegExp, string]>}
|
|
16
|
+
*/
|
|
17
|
+
export const TRANSLATE = /** @type {Array<[RegExp, string]>} */ (
|
|
18
|
+
[
|
|
19
|
+
[
|
|
20
|
+
'botones?|boutons?|knöpfe|knopf|кнопк[аиу]|botões|botão|botao|pulsanti|bottoni|الأزرار|أزرار|زر|बटन',
|
|
21
|
+
'按钮|ボタン|버튼',
|
|
22
|
+
'buttons',
|
|
23
|
+
],
|
|
24
|
+
[
|
|
25
|
+
'tarjetas?|cartes|karten?|карточк[аи]|schede|carte',
|
|
26
|
+
'卡片|カード|카드',
|
|
27
|
+
'cards',
|
|
28
|
+
],
|
|
29
|
+
[
|
|
30
|
+
'redondead[oa]s?|redond[oa]s|arrondi[es]*|abgerundet\\p{L}*|скругл\\p{L}*|arredondad\\p{L}*|arrotondat\\p{L}*|مستدير\\p{L}*|गोल',
|
|
31
|
+
'圆|丸く|丸い|둥글게|둥근',
|
|
32
|
+
'rounded',
|
|
33
|
+
],
|
|
34
|
+
// ("eckiger": more angular, a step, never all the way square.)
|
|
35
|
+
['eckiger(?:e[nrs]?)?', '(?!)', 'sharper'],
|
|
36
|
+
['cuadrad[oa]s|carrés|eckig(?:e\\p{L}*)?', '四角|方形|네모', 'square'],
|
|
37
|
+
['esquinas?|coins|ecken|углы', '角', 'corners'],
|
|
38
|
+
[
|
|
39
|
+
'sombras?|ombres?|ombra|ombre|schatten|тен[ьи]|ظل',
|
|
40
|
+
'阴影|影|그림자',
|
|
41
|
+
'shadow',
|
|
42
|
+
],
|
|
43
|
+
[
|
|
44
|
+
'entfernen|quitar|enlever|supprimer|убрать|togliere|rimuovere|remover|हटाओ',
|
|
45
|
+
'去掉|删除|消して|없애',
|
|
46
|
+
'remove',
|
|
47
|
+
],
|
|
48
|
+
['цвет\\p{L}*|colore|farbe', '颜色|色', 'color'],
|
|
49
|
+
['акцент\\p{L}*', '强调', 'accent'],
|
|
50
|
+
['más|mais|mehr|più|более', '更', 'more'],
|
|
51
|
+
// "sans" is a typeface word before serif or font, or after a kind of
|
|
52
|
+
// typeface ("humanist sans", "geometric sans").
|
|
53
|
+
[
|
|
54
|
+
'sin|(?<!(?<!\\p{L})(?:humanist|geometric|grotesque|grotesk)[\\s-]+)sans(?![\\s-]*(serif|fonts?|typefaces?))|ohne|без|sem|senza',
|
|
55
|
+
'没有|无',
|
|
56
|
+
'without',
|
|
57
|
+
],
|
|
58
|
+
[
|
|
59
|
+
'bordes?|bordures?|rand|rahmen|границ\\p{L}*|bordas?|bordi',
|
|
60
|
+
'边框|枠線',
|
|
61
|
+
'border',
|
|
62
|
+
],
|
|
63
|
+
['azul(es)?|bleus?|blaue?n?|син\\p{L}*|blu', '蓝色?|青い|青く|青', 'blue'],
|
|
64
|
+
['rojos?|rouges?|rote?n?|красн\\p{L}*', '红色?|赤い', 'red'],
|
|
65
|
+
['verdes?|verts?|grüne?n?|зелён\\p{L}*', '绿色?|緑', 'green'],
|
|
66
|
+
].map(([words, cjk, en]) => [
|
|
67
|
+
new RegExp(`(?<!\\p{L})(?:${words})(?!\\p{L})|${cjk}`, 'gu'),
|
|
68
|
+
` ${en} `,
|
|
69
|
+
])
|
|
70
|
+
);
|
|
71
|
+
|
|
72
|
+
/** Design words a near miss is corrected to, beside the one-word part names. */
|
|
73
|
+
export const DESIGN_WORDS = [
|
|
74
|
+
'leading',
|
|
75
|
+
// A part's name, never a near miss of "radius".
|
|
76
|
+
'radio',
|
|
77
|
+
'radios',
|
|
78
|
+
'header',
|
|
79
|
+
'headers',
|
|
80
|
+
'input',
|
|
81
|
+
'inputs',
|
|
82
|
+
'checkbox',
|
|
83
|
+
'toggle',
|
|
84
|
+
'sidebar',
|
|
85
|
+
'progress',
|
|
86
|
+
'shadow',
|
|
87
|
+
'shadows',
|
|
88
|
+
'border',
|
|
89
|
+
'borders',
|
|
90
|
+
'background',
|
|
91
|
+
'rounded',
|
|
92
|
+
'rounder',
|
|
93
|
+
'corners',
|
|
94
|
+
'radius',
|
|
95
|
+
'padding',
|
|
96
|
+
'spacing',
|
|
97
|
+
'gradient',
|
|
98
|
+
'color',
|
|
99
|
+
'colour',
|
|
100
|
+
'bigger',
|
|
101
|
+
'smaller',
|
|
102
|
+
'darker',
|
|
103
|
+
'lighter',
|
|
104
|
+
'thicker',
|
|
105
|
+
'italic',
|
|
106
|
+
'uppercase',
|
|
107
|
+
'compact',
|
|
108
|
+
'accent',
|
|
109
|
+
'remove',
|
|
110
|
+
'outline',
|
|
111
|
+
];
|
|
112
|
+
|
|
113
|
+
/** Hues people name, as fills a part can take. */
|
|
114
|
+
export const HUES = wordTable(
|
|
115
|
+
/** @type {Record<string, string>} */ ({
|
|
116
|
+
red: '#dc2626',
|
|
117
|
+
orange: '#f97316',
|
|
118
|
+
amber: '#f59e0b',
|
|
119
|
+
yellow: '#eab308',
|
|
120
|
+
lime: '#65a30d',
|
|
121
|
+
green: '#16a34a',
|
|
122
|
+
mint: '#34d399',
|
|
123
|
+
minty: '#34d399',
|
|
124
|
+
teal: '#0d9488',
|
|
125
|
+
cyan: '#0891b2',
|
|
126
|
+
blue: '#2563eb',
|
|
127
|
+
navy: '#1e3a8a',
|
|
128
|
+
indigo: '#4f46e5',
|
|
129
|
+
purple: '#7c3aed',
|
|
130
|
+
charcoal: '#333333',
|
|
131
|
+
violet: '#7c3aed',
|
|
132
|
+
pink: '#db2777',
|
|
133
|
+
magenta: '#c026d3',
|
|
134
|
+
brown: '#92400e',
|
|
135
|
+
gray: '#9ca3af',
|
|
136
|
+
grey: '#9ca3af',
|
|
137
|
+
black: '#000000',
|
|
138
|
+
white: '#ffffff',
|
|
139
|
+
cream: '#fef3c7',
|
|
140
|
+
beige: '#f5f5dc',
|
|
141
|
+
silver: '#c0c0c0',
|
|
142
|
+
// (The color names designers use for a palette, beside the hues.)
|
|
143
|
+
terracotta: '#c2603d',
|
|
144
|
+
sage: '#87a96b',
|
|
145
|
+
rust: '#b7410e',
|
|
146
|
+
mustard: '#d4a017',
|
|
147
|
+
olive: '#6b8e23',
|
|
148
|
+
burgundy: '#800020',
|
|
149
|
+
maroon: '#7f1d1d',
|
|
150
|
+
coral: '#f87171',
|
|
151
|
+
salmon: '#fa8072',
|
|
152
|
+
sand: '#d6c6a5',
|
|
153
|
+
sky: '#38bdf8',
|
|
154
|
+
taupe: '#8b7d6b',
|
|
155
|
+
slate: '#64748b',
|
|
156
|
+
emerald: '#059669',
|
|
157
|
+
forest: '#166534',
|
|
158
|
+
ruby: '#be123c',
|
|
159
|
+
plum: '#7e22ce',
|
|
160
|
+
lavender: '#c4b5fd',
|
|
161
|
+
peach: '#fdba74',
|
|
162
|
+
ivory: '#fffff0',
|
|
163
|
+
khaki: '#c3b091',
|
|
164
|
+
ochre: '#cc7722',
|
|
165
|
+
copper: '#b87333',
|
|
166
|
+
gold: '#ca8a04',
|
|
167
|
+
bronze: '#a16207',
|
|
168
|
+
mauve: '#b784a7',
|
|
169
|
+
tan: '#d2b48c',
|
|
170
|
+
paper: '#f7f3e9',
|
|
171
|
+
// (Names said in two words, joined by the reader into one: "off-white",
|
|
172
|
+
// "ink blue", "grass green", "safety orange", "blue-gray".)
|
|
173
|
+
offwhite: '#faf8f3',
|
|
174
|
+
inkblue: '#1e3a5f',
|
|
175
|
+
grassgreen: '#4caf50',
|
|
176
|
+
safetyorange: '#ff6700',
|
|
177
|
+
bluegray: '#64748b',
|
|
178
|
+
}),
|
|
179
|
+
);
|
|
180
|
+
|
|
181
|
+
/** States a word names. */
|
|
182
|
+
export const STATE_WORDS = /** @type {Array<[RegExp, string]>} */ ([
|
|
183
|
+
[/\b(hover(ed|ing)?|mouse ?over)\b/, 'hover'],
|
|
184
|
+
[/\b(focus(ed|ing)?|on focus)\b/, 'focus'],
|
|
185
|
+
[/\b(disabled|inactive)\b/, 'disabled'],
|
|
186
|
+
// (A switch's "on color", "on state": its checked look.)
|
|
187
|
+
[
|
|
188
|
+
/\b(checked|ticked|when on|turned on|toggled on|is on|on[- ](?:colou?r|state|look))\b/,
|
|
189
|
+
'checked',
|
|
190
|
+
],
|
|
191
|
+
[
|
|
192
|
+
/\b(selected|active (tab|nav|item|link|page))\b|\bactive\b(?=.*\b(nav|tab|item)\b)/,
|
|
193
|
+
'selected',
|
|
194
|
+
],
|
|
195
|
+
// ("Pressed" is its own word: a toggle's pressed state, else active.)
|
|
196
|
+
[/\b(press(ed|es)?|on press)\b/, 'pressed'],
|
|
197
|
+
[
|
|
198
|
+
/\b(click(ed|s)?|tap(ped|s)?(?! targets?)|on click|when i click|active)\b/,
|
|
199
|
+
'active',
|
|
200
|
+
],
|
|
201
|
+
[/\b(typing|type in|tab to|tabbing|keyboard focus)\b/, 'focus'],
|
|
202
|
+
[/\b(after i check|once checked|i check)\b/, 'checked'],
|
|
203
|
+
// ("Blue selection" said of a part: its selected items. The text
|
|
204
|
+
// highlight, said with no part, is read before states are.)
|
|
205
|
+
[/\b(picked|chosen|choose|pick|selections?)\b/, 'selected'],
|
|
206
|
+
[
|
|
207
|
+
/\b(invalid|errors? state|has an error|with an error|with errors|in (?:an )?error(?: state)?|erroring|errored)\b/,
|
|
208
|
+
'invalid',
|
|
209
|
+
],
|
|
210
|
+
// ("valid inputs", "fields in a success state": the success status.)
|
|
211
|
+
[/\b(valid|validated|in (?:a )?success(?: state)?)\b/, 'valid'],
|
|
212
|
+
// ("after visiting", "once you've been there": the visited look.)
|
|
213
|
+
[
|
|
214
|
+
/\b(visited|(?:after|once|when) (?:i'?ve |you'?ve |they'?ve )?(?:visiting|visited|been (?:there|clicked)))\b/,
|
|
215
|
+
'visited',
|
|
216
|
+
],
|
|
217
|
+
// ("The open select", "when open": a part shown open.)
|
|
218
|
+
[
|
|
219
|
+
/\bopened\b|\b(?:when|while|once|if) (?:it'?s |they'?re |it is |they are )?open\b|\bthe open\b/,
|
|
220
|
+
'open',
|
|
221
|
+
],
|
|
222
|
+
[/\bexpanded\b/, 'expanded'],
|
|
223
|
+
// (The option a list points at, by keyboard or pointer.)
|
|
224
|
+
[/\b(highlighted|keyboard[- ]highlighted)\b/, 'highlighted'],
|
|
225
|
+
// (A page or step shown as the one you are on: aria-current.)
|
|
226
|
+
[/\bcurrent\b/, 'current'],
|
|
227
|
+
// Words for states a part may not have: the answer says so.
|
|
228
|
+
[/\bread-?only\b/, 'readonly'],
|
|
229
|
+
[/\bindeterminate\b/, 'indeterminate'],
|
|
230
|
+
[
|
|
231
|
+
/\bloading\b(?! (bars?|placeholders?|skeletons?|spinners?|states?|indicators?))/,
|
|
232
|
+
'loading',
|
|
233
|
+
],
|
|
234
|
+
[
|
|
235
|
+
/\b(unchecked|not checked|unticked|when off|turned off|toggled off|switched off|is off)\b/,
|
|
236
|
+
'unchecked',
|
|
237
|
+
],
|
|
238
|
+
[/\b(unselected|not selected|non-selected)\b/, 'unselected'],
|
|
239
|
+
]);
|
|
@@ -15,7 +15,7 @@ export function isPicture(subject: string, cwd: string): boolean;
|
|
|
15
15
|
* setting (a dial's rungs, a token's type and readers, a CSS property), an
|
|
16
16
|
* aspect (text, corners...: the whole-theme tokens and dial), `colors` (how
|
|
17
17
|
* the theme's colors are made), a plain-words question (exact commands), a
|
|
18
|
-
* PNG picture (its main colors, or the color at points), or with `list` a
|
|
18
|
+
* PNG picture (its main colors and the look's traits measured from it, or the color at points), or with `list` a
|
|
19
19
|
* list of dials, tokens, parts, groups or CSS properties.
|
|
20
20
|
* @experimental
|
|
21
21
|
* @param {string} subject a part, group, setting, aspect, question, or PNG file; with `list`, a filter
|