@pie-players/pie-theme 0.3.64 → 0.3.66
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 +165 -18
- package/dist/color-schemes.css +386 -441
- package/dist/color-schemes.d.ts +12 -21
- package/dist/color-schemes.js +507 -385
- package/dist/components.css +216 -66
- package/dist/contrast.d.ts +67 -0
- package/dist/contrast.js +151 -0
- package/dist/daisyui-mapping.d.ts +58 -0
- package/dist/daisyui-mapping.js +168 -0
- package/dist/index.d.ts +6 -4
- package/dist/index.js +4 -3
- package/dist/providers.d.ts +16 -0
- package/dist/providers.js +68 -91
- package/dist/scheme-participation.d.ts +88 -0
- package/dist/scheme-participation.js +89 -0
- package/dist/theme-css.d.ts +5 -0
- package/dist/theme-css.js +26 -0
- package/dist/theme-definitions.d.ts +21 -0
- package/dist/theme-definitions.js +1081 -0
- package/dist/theme-element.d.ts +5 -0
- package/dist/theme-element.js +154 -36
- package/dist/theme-types.d.ts +54 -0
- package/dist/token-registry-types.d.ts +57 -0
- package/dist/token-registry-types.js +15 -0
- package/dist/token-registry.json +1311 -0
- package/dist/tokens.css +84 -76
- package/package.json +8 -4
- package/dist/theme-defaults.d.ts +0 -3
- package/dist/theme-defaults.js +0 -100
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export declare const PIE_THEME_SCHEME_PARTICIPATION: {
|
|
2
|
+
readonly "--pie-answer-eliminator-strike-color": "optional";
|
|
3
|
+
readonly "--pie-background": "required";
|
|
4
|
+
readonly "--pie-background-dark": "required";
|
|
5
|
+
readonly "--pie-background-light": "excluded";
|
|
6
|
+
readonly "--pie-black": "required";
|
|
7
|
+
readonly "--pie-blue-grey-100": "required";
|
|
8
|
+
readonly "--pie-blue-grey-300": "required";
|
|
9
|
+
readonly "--pie-blue-grey-600": "required";
|
|
10
|
+
readonly "--pie-blue-grey-900": "required";
|
|
11
|
+
readonly "--pie-border": "required";
|
|
12
|
+
readonly "--pie-border-dark": "required";
|
|
13
|
+
readonly "--pie-border-gray": "required";
|
|
14
|
+
readonly "--pie-border-light": "required";
|
|
15
|
+
readonly "--pie-button-active-bg": "required";
|
|
16
|
+
readonly "--pie-button-background-color": "excluded";
|
|
17
|
+
readonly "--pie-button-bg": "required";
|
|
18
|
+
readonly "--pie-button-border": "required";
|
|
19
|
+
readonly "--pie-button-border-color": "excluded";
|
|
20
|
+
readonly "--pie-button-color": "required";
|
|
21
|
+
readonly "--pie-button-focus-outline": "required";
|
|
22
|
+
readonly "--pie-button-hover-background-color": "excluded";
|
|
23
|
+
readonly "--pie-button-hover-bg": "required";
|
|
24
|
+
readonly "--pie-button-hover-border": "required";
|
|
25
|
+
readonly "--pie-button-hover-color": "required";
|
|
26
|
+
readonly "--pie-content-styles": "excluded";
|
|
27
|
+
readonly "--pie-content-emphasis": "required";
|
|
28
|
+
readonly "--pie-correct": "required";
|
|
29
|
+
readonly "--pie-correct-icon": "required";
|
|
30
|
+
readonly "--pie-correct-secondary": "required";
|
|
31
|
+
readonly "--pie-correct-tertiary": "required";
|
|
32
|
+
readonly "--pie-disabled": "required";
|
|
33
|
+
readonly "--pie-disabled-secondary": "required";
|
|
34
|
+
readonly "--pie-dropdown-background": "required";
|
|
35
|
+
readonly "--pie-faded-primary": "required";
|
|
36
|
+
readonly "--pie-fixed-hue-collapse": "required";
|
|
37
|
+
readonly "--pie-focus-checked": "required";
|
|
38
|
+
readonly "--pie-focus-checked-border": "required";
|
|
39
|
+
readonly "--pie-focus-outline": "excluded";
|
|
40
|
+
readonly "--pie-focus-ring-color": "excluded";
|
|
41
|
+
readonly "--pie-focus-unchecked": "required";
|
|
42
|
+
readonly "--pie-focus-unchecked-border": "required";
|
|
43
|
+
readonly "--pie-font-scale": "excluded";
|
|
44
|
+
readonly "--pie-incorrect": "required";
|
|
45
|
+
readonly "--pie-incorrect-icon": "required";
|
|
46
|
+
readonly "--pie-incorrect-secondary": "required";
|
|
47
|
+
readonly "--pie-missing": "required";
|
|
48
|
+
readonly "--pie-missing-icon": "required";
|
|
49
|
+
readonly "--pie-passage-header-background": "optional";
|
|
50
|
+
readonly "--pie-primary": "required";
|
|
51
|
+
readonly "--pie-primary-dark": "required";
|
|
52
|
+
readonly "--pie-primary-light": "required";
|
|
53
|
+
readonly "--pie-secondary": "required";
|
|
54
|
+
readonly "--pie-secondary-background": "required";
|
|
55
|
+
readonly "--pie-secondary-dark": "required";
|
|
56
|
+
readonly "--pie-secondary-light": "required";
|
|
57
|
+
readonly "--pie-section-player-card-header-background": "optional";
|
|
58
|
+
readonly "--pie-section-player-card-header-radius": "excluded";
|
|
59
|
+
readonly "--pie-section-player-card-radius": "excluded";
|
|
60
|
+
readonly "--pie-section-player-item-media-aspect-ratio": "excluded";
|
|
61
|
+
readonly "--pie-section-player-item-media-min-height": "excluded";
|
|
62
|
+
readonly "--pie-section-player-item-media-max-height": "excluded";
|
|
63
|
+
readonly "--pie-section-player-layout-max-width": "excluded";
|
|
64
|
+
readonly "--pie-section-player-tab-active-background": "optional";
|
|
65
|
+
readonly "--pie-section-player-tab-active-color": "optional";
|
|
66
|
+
readonly "--pie-section-player-tab-background": "optional";
|
|
67
|
+
readonly "--pie-section-player-tab-color": "optional";
|
|
68
|
+
readonly "--pie-section-player-tab-gap": "excluded";
|
|
69
|
+
readonly "--pie-section-player-tab-padding-block": "excluded";
|
|
70
|
+
readonly "--pie-section-player-tab-track-padding": "excluded";
|
|
71
|
+
readonly "--pie-section-player-tab-track-radius": "excluded";
|
|
72
|
+
readonly "--pie-section-player-tab-zoom-comp": "excluded";
|
|
73
|
+
readonly "--pie-tertiary": "required";
|
|
74
|
+
readonly "--pie-tertiary-light": "required";
|
|
75
|
+
readonly "--pie-text": "required";
|
|
76
|
+
readonly "--pie-annotation-underline": "required";
|
|
77
|
+
readonly "--pie-annotation-underline-dark": "required";
|
|
78
|
+
readonly "--pie-tool-annotation-toolbar-border": "required";
|
|
79
|
+
readonly "--pie-tool-line-reader-control-color": "excluded";
|
|
80
|
+
readonly "--pie-tool-line-reader-frame-color": "excluded";
|
|
81
|
+
readonly "--pie-tool-line-reader-frame-opacity": "excluded";
|
|
82
|
+
readonly "--pie-tool-trigger-active-background": "optional";
|
|
83
|
+
readonly "--pie-tool-trigger-active-border-color": "optional";
|
|
84
|
+
readonly "--pie-tool-trigger-active-color": "optional";
|
|
85
|
+
readonly "--pie-toolbar-tools-row-height": "excluded";
|
|
86
|
+
readonly "--pie-tts-controls-row-height": "excluded";
|
|
87
|
+
readonly "--pie-white": "required";
|
|
88
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
/* Generated from token-registry.json by scripts/generate-theme-css.ts. */
|
|
2
|
+
export const PIE_THEME_SCHEME_PARTICIPATION = {
|
|
3
|
+
"--pie-answer-eliminator-strike-color": "optional",
|
|
4
|
+
"--pie-background": "required",
|
|
5
|
+
"--pie-background-dark": "required",
|
|
6
|
+
"--pie-background-light": "excluded",
|
|
7
|
+
"--pie-black": "required",
|
|
8
|
+
"--pie-blue-grey-100": "required",
|
|
9
|
+
"--pie-blue-grey-300": "required",
|
|
10
|
+
"--pie-blue-grey-600": "required",
|
|
11
|
+
"--pie-blue-grey-900": "required",
|
|
12
|
+
"--pie-border": "required",
|
|
13
|
+
"--pie-border-dark": "required",
|
|
14
|
+
"--pie-border-gray": "required",
|
|
15
|
+
"--pie-border-light": "required",
|
|
16
|
+
"--pie-button-active-bg": "required",
|
|
17
|
+
"--pie-button-background-color": "excluded",
|
|
18
|
+
"--pie-button-bg": "required",
|
|
19
|
+
"--pie-button-border": "required",
|
|
20
|
+
"--pie-button-border-color": "excluded",
|
|
21
|
+
"--pie-button-color": "required",
|
|
22
|
+
"--pie-button-focus-outline": "required",
|
|
23
|
+
"--pie-button-hover-background-color": "excluded",
|
|
24
|
+
"--pie-button-hover-bg": "required",
|
|
25
|
+
"--pie-button-hover-border": "required",
|
|
26
|
+
"--pie-button-hover-color": "required",
|
|
27
|
+
"--pie-content-styles": "excluded",
|
|
28
|
+
"--pie-content-emphasis": "required",
|
|
29
|
+
"--pie-correct": "required",
|
|
30
|
+
"--pie-correct-icon": "required",
|
|
31
|
+
"--pie-correct-secondary": "required",
|
|
32
|
+
"--pie-correct-tertiary": "required",
|
|
33
|
+
"--pie-disabled": "required",
|
|
34
|
+
"--pie-disabled-secondary": "required",
|
|
35
|
+
"--pie-dropdown-background": "required",
|
|
36
|
+
"--pie-faded-primary": "required",
|
|
37
|
+
"--pie-fixed-hue-collapse": "required",
|
|
38
|
+
"--pie-focus-checked": "required",
|
|
39
|
+
"--pie-focus-checked-border": "required",
|
|
40
|
+
"--pie-focus-outline": "excluded",
|
|
41
|
+
"--pie-focus-ring-color": "excluded",
|
|
42
|
+
"--pie-focus-unchecked": "required",
|
|
43
|
+
"--pie-focus-unchecked-border": "required",
|
|
44
|
+
"--pie-font-scale": "excluded",
|
|
45
|
+
"--pie-incorrect": "required",
|
|
46
|
+
"--pie-incorrect-icon": "required",
|
|
47
|
+
"--pie-incorrect-secondary": "required",
|
|
48
|
+
"--pie-missing": "required",
|
|
49
|
+
"--pie-missing-icon": "required",
|
|
50
|
+
"--pie-passage-header-background": "optional",
|
|
51
|
+
"--pie-primary": "required",
|
|
52
|
+
"--pie-primary-dark": "required",
|
|
53
|
+
"--pie-primary-light": "required",
|
|
54
|
+
"--pie-secondary": "required",
|
|
55
|
+
"--pie-secondary-background": "required",
|
|
56
|
+
"--pie-secondary-dark": "required",
|
|
57
|
+
"--pie-secondary-light": "required",
|
|
58
|
+
"--pie-section-player-card-header-background": "optional",
|
|
59
|
+
"--pie-section-player-card-header-radius": "excluded",
|
|
60
|
+
"--pie-section-player-card-radius": "excluded",
|
|
61
|
+
"--pie-section-player-item-media-aspect-ratio": "excluded",
|
|
62
|
+
"--pie-section-player-item-media-min-height": "excluded",
|
|
63
|
+
"--pie-section-player-item-media-max-height": "excluded",
|
|
64
|
+
"--pie-section-player-layout-max-width": "excluded",
|
|
65
|
+
"--pie-section-player-tab-active-background": "optional",
|
|
66
|
+
"--pie-section-player-tab-active-color": "optional",
|
|
67
|
+
"--pie-section-player-tab-background": "optional",
|
|
68
|
+
"--pie-section-player-tab-color": "optional",
|
|
69
|
+
"--pie-section-player-tab-gap": "excluded",
|
|
70
|
+
"--pie-section-player-tab-padding-block": "excluded",
|
|
71
|
+
"--pie-section-player-tab-track-padding": "excluded",
|
|
72
|
+
"--pie-section-player-tab-track-radius": "excluded",
|
|
73
|
+
"--pie-section-player-tab-zoom-comp": "excluded",
|
|
74
|
+
"--pie-tertiary": "required",
|
|
75
|
+
"--pie-tertiary-light": "required",
|
|
76
|
+
"--pie-text": "required",
|
|
77
|
+
"--pie-annotation-underline": "required",
|
|
78
|
+
"--pie-annotation-underline-dark": "required",
|
|
79
|
+
"--pie-tool-annotation-toolbar-border": "required",
|
|
80
|
+
"--pie-tool-line-reader-control-color": "excluded",
|
|
81
|
+
"--pie-tool-line-reader-frame-color": "excluded",
|
|
82
|
+
"--pie-tool-line-reader-frame-opacity": "excluded",
|
|
83
|
+
"--pie-tool-trigger-active-background": "optional",
|
|
84
|
+
"--pie-tool-trigger-active-border-color": "optional",
|
|
85
|
+
"--pie-tool-trigger-active-color": "optional",
|
|
86
|
+
"--pie-toolbar-tools-row-height": "excluded",
|
|
87
|
+
"--pie-tts-controls-row-height": "excluded",
|
|
88
|
+
"--pie-white": "required",
|
|
89
|
+
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { assertCanonicalThemeDefinitions, getBaseThemeVariables, listBuiltInColorSchemeDefinitions, } from "./theme-definitions.js";
|
|
2
|
+
const GENERATED_HEADER = "/* Generated by @pie-players/pie-theme. Run `bun run generate:css`; do not edit. */";
|
|
3
|
+
function renderDeclarations(variables) {
|
|
4
|
+
return Object.entries(variables)
|
|
5
|
+
.sort(([left], [right]) => (left < right ? -1 : left > right ? 1 : 0))
|
|
6
|
+
.map(([token, value]) => `\t${token}: ${value};`)
|
|
7
|
+
.join("\n");
|
|
8
|
+
}
|
|
9
|
+
function renderRule(selectors, variables) {
|
|
10
|
+
return `${selectors.join(",\n")} {\n${renderDeclarations(variables)}\n}`;
|
|
11
|
+
}
|
|
12
|
+
function renderTokensCss() {
|
|
13
|
+
return `${GENERATED_HEADER}\n\n${renderRule([":root", '[data-theme="light"]', ':where(pie-theme[theme="light"])'], getBaseThemeVariables("light"))}\n\n${renderRule(['[data-theme="dark"]', ':where(pie-theme[theme="dark"])'], getBaseThemeVariables("dark"))}\n`;
|
|
14
|
+
}
|
|
15
|
+
function renderColorSchemesCss() {
|
|
16
|
+
const rules = listBuiltInColorSchemeDefinitions().map((scheme) => renderRule([`[data-color-scheme="${scheme.id}"]`], scheme.variables));
|
|
17
|
+
return `${GENERATED_HEADER}\n\n${rules.join("\n\n")}\n`;
|
|
18
|
+
}
|
|
19
|
+
/** Package-internal pure renderer for the two checked-in CSS adapters. */
|
|
20
|
+
export function renderPieThemeCss() {
|
|
21
|
+
assertCanonicalThemeDefinitions();
|
|
22
|
+
return Object.freeze({
|
|
23
|
+
tokensCss: renderTokensCss(),
|
|
24
|
+
colorSchemesCss: renderColorSchemesCss(),
|
|
25
|
+
});
|
|
26
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PieThemeSchemeParticipation } from "./token-registry-types.js";
|
|
2
|
+
import type { PieColorSchemeDescriptor, PieColorSchemePreview, PieThemeDiagnostic, ThemeTokenName, ThemeVariables } from "./theme-types.js";
|
|
3
|
+
type BuiltInColorSchemeDefinition = Readonly<{
|
|
4
|
+
id: string;
|
|
5
|
+
name: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
variables: Readonly<ThemeVariables>;
|
|
8
|
+
}>;
|
|
9
|
+
export declare function diagnoseThemeContrast(variables: Readonly<ThemeVariables>, schemeId?: string, relevantTokens?: ReadonlySet<string>): readonly PieThemeDiagnostic[];
|
|
10
|
+
export declare function getBaseThemeVariables(baseTheme: "light" | "dark"): Readonly<ThemeVariables>;
|
|
11
|
+
export declare function listBuiltInColorSchemeDefinitions(): readonly BuiltInColorSchemeDefinition[];
|
|
12
|
+
export declare function getBuiltInColorSchemeDefinition(id: string): BuiltInColorSchemeDefinition | undefined;
|
|
13
|
+
export declare function getDefaultColorSchemeDescriptor(): PieColorSchemeDescriptor;
|
|
14
|
+
export declare function createPieColorSchemePreview(variables: Readonly<ThemeVariables>): PieColorSchemePreview;
|
|
15
|
+
export declare function getSchemeParticipation(token: string): PieThemeSchemeParticipation | undefined;
|
|
16
|
+
export declare function getRequiredSchemeTokens(): readonly ThemeTokenName[];
|
|
17
|
+
export declare function getOptionalSchemeTokens(): readonly ThemeTokenName[];
|
|
18
|
+
export declare function createBuiltInColorSchemeDescriptor(definition: BuiltInColorSchemeDefinition): PieColorSchemeDescriptor;
|
|
19
|
+
/** Build-time invariant check; browser entries only read the frozen definitions. */
|
|
20
|
+
export declare function assertCanonicalThemeDefinitions(): void;
|
|
21
|
+
export {};
|