theme-vir 28.15.4 → 28.16.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.
|
@@ -43,11 +43,11 @@ export declare const defaultLightThemePair: RequiredAndNotNull<NoRefColorInit>;
|
|
|
43
43
|
/** @category Internal */
|
|
44
44
|
export declare const defaultContrastLevels: Readonly<ArrayOrSelectParam<ContrastLevelName>>;
|
|
45
45
|
/**
|
|
46
|
-
*
|
|
46
|
+
* Options for {@link buildLowLevelColorTheme}.
|
|
47
47
|
*
|
|
48
|
-
* @category
|
|
48
|
+
* @category Internal
|
|
49
49
|
*/
|
|
50
|
-
export
|
|
50
|
+
export type BuildLowLevelColorThemeOptions = PartialWithUndefined<{
|
|
51
51
|
/**
|
|
52
52
|
* The default theme colors for {@link defineColorTheme}. Defaults to
|
|
53
53
|
* {@link defaultLightThemePair}.
|
|
@@ -68,7 +68,13 @@ export declare function buildLowLevelColorTheme(colorPalette: Readonly<ColorPale
|
|
|
68
68
|
* @default defaultOmittedColorGroupColorValues
|
|
69
69
|
*/
|
|
70
70
|
omittedColorValues: ReadonlyArray<string>;
|
|
71
|
-
}
|
|
71
|
+
}>;
|
|
72
|
+
/**
|
|
73
|
+
* Creates a color theme from a color palette.
|
|
74
|
+
*
|
|
75
|
+
* @category Color Theme
|
|
76
|
+
*/
|
|
77
|
+
export declare function buildLowLevelColorTheme(colorPalette: Readonly<ColorPaletteVars>, { defaultTheme, omittedColorValues, crossContrastLevels, }?: Readonly<BuildLowLevelColorThemeOptions>): import("./color-theme.js").ColorTheme<{
|
|
72
78
|
[k: string]: ((Required<Pick<{
|
|
73
79
|
foreground: import("./color-theme.js").ColorInitValue;
|
|
74
80
|
background: import("./color-theme.js").ColorInitValue;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { type PartialWithUndefined } from '@augment-vir/common';
|
|
2
2
|
import { type BookPage } from 'element-book';
|
|
3
|
-
import { type ColorPaletteVars } from './build-color-theme.js';
|
|
3
|
+
import { type BuildLowLevelColorThemeOptions, type ColorPaletteVars } from './build-color-theme.js';
|
|
4
4
|
/**
|
|
5
5
|
* Create multiple element-book pages to showcase a bunch of color CSS variables.
|
|
6
6
|
*
|
|
7
7
|
* @category Color Theme
|
|
8
8
|
* @see `createColorThemeBookPages` for creating full color theme pages.
|
|
9
9
|
*/
|
|
10
|
-
export declare function createColorPaletteBookPages({ colors, parent, title, includeContrast, includeTheme, useVerticalTheme, }: {
|
|
10
|
+
export declare function createColorPaletteBookPages({ colors, parent, title, includeContrast, includeTheme, useVerticalTheme, options, }: {
|
|
11
11
|
parent: Readonly<BookPage>;
|
|
12
12
|
title: string;
|
|
13
13
|
colors: Readonly<ColorPaletteVars>;
|
|
@@ -15,4 +15,5 @@ export declare function createColorPaletteBookPages({ colors, parent, title, inc
|
|
|
15
15
|
includeContrast: boolean;
|
|
16
16
|
includeTheme: boolean;
|
|
17
17
|
useVerticalTheme: boolean;
|
|
18
|
+
options: Readonly<BuildLowLevelColorThemeOptions>;
|
|
18
19
|
}>): BookPage[];
|
|
@@ -53,7 +53,7 @@ const blackWhiteCells = [
|
|
|
53
53
|
* @category Color Theme
|
|
54
54
|
* @see `createColorThemeBookPages` for creating full color theme pages.
|
|
55
55
|
*/
|
|
56
|
-
export function createColorPaletteBookPages({ colors, parent, title, includeContrast, includeTheme, useVerticalTheme, }) {
|
|
56
|
+
export function createColorPaletteBookPages({ colors, parent, title, includeContrast, includeTheme, useVerticalTheme, options, }) {
|
|
57
57
|
const colorGroups = groupColors(colors);
|
|
58
58
|
const topColorsPage = defineBookPage({
|
|
59
59
|
parent,
|
|
@@ -222,7 +222,7 @@ export function createColorPaletteBookPages({ colors, parent, title, includeCont
|
|
|
222
222
|
? createColorThemeBookPages({
|
|
223
223
|
parent: topColorsPage,
|
|
224
224
|
title: 'Theme (auto)',
|
|
225
|
-
theme: buildLowLevelColorTheme(colors),
|
|
225
|
+
theme: buildLowLevelColorTheme(colors, options),
|
|
226
226
|
hideInverseColors: true,
|
|
227
227
|
useVerticalLayout: useVerticalTheme,
|
|
228
228
|
prefixGroupByCount: 2,
|
|
@@ -20,10 +20,10 @@ export function createColorCssVarDefault(fromName, init, defaultInit, colorsInit
|
|
|
20
20
|
return init;
|
|
21
21
|
}
|
|
22
22
|
else if ('refDefaultBackground' in init) {
|
|
23
|
-
return
|
|
23
|
+
return `var(--default-bg, ${noRefColorInitToString(defaultInit.background)})`;
|
|
24
24
|
}
|
|
25
25
|
else if ('refDefaultForeground' in init) {
|
|
26
|
-
return
|
|
26
|
+
return `var(--default-fg, ${noRefColorInitToString(defaultInit.foreground)})`;
|
|
27
27
|
}
|
|
28
28
|
else if ('refBackground' in init || 'refForeground' in init) {
|
|
29
29
|
const referenceKey = check.hasKey(init, 'refBackground')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "theme-vir",
|
|
3
|
-
"version": "28.
|
|
3
|
+
"version": "28.16.1",
|
|
4
4
|
"description": "Create an entire web theme.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"design",
|
|
@@ -42,31 +42,31 @@
|
|
|
42
42
|
"test:docs": "virmator docs check"
|
|
43
43
|
},
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@augment-vir/assert": "^31.57.
|
|
46
|
-
"@augment-vir/common": "^31.57.
|
|
47
|
-
"@electrovir/color": "^1.
|
|
45
|
+
"@augment-vir/assert": "^31.57.5",
|
|
46
|
+
"@augment-vir/common": "^31.57.5",
|
|
47
|
+
"@electrovir/color": "^1.6.4",
|
|
48
48
|
"apca-w3": "^0.1.9",
|
|
49
49
|
"lit-css-vars": "^3.0.11",
|
|
50
50
|
"type-fest": "^5.3.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"@augment-vir/test": "^31.57.
|
|
53
|
+
"@augment-vir/test": "^31.57.5",
|
|
54
54
|
"@types/apca-w3": "^0.1.3",
|
|
55
55
|
"@web/dev-server-esbuild": "^1.0.4",
|
|
56
56
|
"@web/test-runner": "^0.20.2",
|
|
57
57
|
"@web/test-runner-commands": "^0.9.0",
|
|
58
58
|
"@web/test-runner-playwright": "^0.11.1",
|
|
59
59
|
"@web/test-runner-visual-regression": "^0.10.0",
|
|
60
|
-
"element-book": "^26.14.
|
|
60
|
+
"element-book": "^26.14.2",
|
|
61
61
|
"element-vir": "^26.14.0",
|
|
62
62
|
"esbuild": "^0.27.2",
|
|
63
63
|
"istanbul-smart-text-reporter": "^1.1.5",
|
|
64
64
|
"markdown-code-example-inserter": "^3.0.3",
|
|
65
65
|
"typedoc": "^0.28.15",
|
|
66
66
|
"typescript": "5.9.3",
|
|
67
|
-
"vira": "^28.
|
|
68
|
-
"vite": "^7.3.
|
|
69
|
-
"vite-tsconfig-paths": "^6.0.
|
|
67
|
+
"vira": "^28.19.2",
|
|
68
|
+
"vite": "^7.3.1",
|
|
69
|
+
"vite-tsconfig-paths": "^6.0.4"
|
|
70
70
|
},
|
|
71
71
|
"peerDependencies": {
|
|
72
72
|
"element-book": ">=17",
|