@timmo001/groundwork-tokens 0.10.0 → 0.10.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/package.json +1 -1
- package/src/choices.ts +5 -2
package/package.json
CHANGED
package/src/choices.ts
CHANGED
|
@@ -69,7 +69,8 @@ export const themeAllows = (choice: ThemeChoice, mode: ThemeMode) =>
|
|
|
69
69
|
|
|
70
70
|
/**
|
|
71
71
|
* Choices as a picker's options, grouped: a choice's `family`, or `group`
|
|
72
|
-
* for those without one.
|
|
72
|
+
* for those without one. Each carries the schemes it covers as search
|
|
73
|
+
* keywords. Order the choices as the picker should list them,
|
|
73
74
|
* usually the app's own theme, then the other core themes, then the optional
|
|
74
75
|
* ones.
|
|
75
76
|
*/
|
|
@@ -77,10 +78,12 @@ export const themeOptions = (
|
|
|
77
78
|
choices: readonly ThemeChoice[],
|
|
78
79
|
group = "Groundwork",
|
|
79
80
|
) =>
|
|
80
|
-
choices.map(({ id, name, family }) => ({
|
|
81
|
+
choices.map(({ id, name, family, mode }) => ({
|
|
81
82
|
value: id,
|
|
82
83
|
label: name,
|
|
83
84
|
group: family ?? group,
|
|
85
|
+
// So a search for light or dark finds the themes that have it
|
|
86
|
+
keywords: mode === undefined ? ["light", "dark"] : [mode],
|
|
84
87
|
}));
|
|
85
88
|
|
|
86
89
|
/** The core themes by id and name, in the order the docs list them. */
|