@zenit-hosting/zenit-ui 0.1.0 → 0.2.0
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/fesm2022/zenit-hosting-zenit-ui.mjs +1 -1
- package/fesm2022/zenit-hosting-zenit-ui.mjs.map +1 -1
- package/llms-full.txt +6 -6
- package/llms.txt +2 -2
- package/package.json +1 -1
- package/schematics/ng-add/init-script.js +1 -1
- package/styles/themes/accents.css +77 -2
- package/types/zenit-hosting-zenit-ui.d.ts +1 -1
package/llms-full.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# zenit-ui — complete reference
|
|
2
2
|
|
|
3
|
-
> Version 0.
|
|
3
|
+
> Version 0.2.0. Everything needed to use this library correctly, with no other file and
|
|
4
4
|
> no access to its sources. Generated from the sources; do not edit by hand.
|
|
5
5
|
|
|
6
6
|
## Contents
|
|
@@ -79,9 +79,9 @@ is no `NgModule` and no `forRoot`.
|
|
|
79
79
|
1. **Install.** The package is not on npm; it is installed from the tarball built by
|
|
80
80
|
`npm pack` inside `dist/zenit-ui`:
|
|
81
81
|
```bash
|
|
82
|
-
npm i ./zenit-ui-0.
|
|
82
|
+
npm i ./zenit-ui-0.2.0.tgz
|
|
83
83
|
```
|
|
84
|
-
`ng add ./zenit-ui-0.
|
|
84
|
+
`ng add ./zenit-ui-0.2.0.tgz --themes` performs steps 2 to 6 automatically.
|
|
85
85
|
|
|
86
86
|
2. **Register the stylesheets** in `angular.json` (`projects.<app>.architect.build.options.styles`)
|
|
87
87
|
or via `@import` in your entry stylesheet. The order is binding:
|
|
@@ -158,7 +158,7 @@ is no `NgModule` and no `forRoot`.
|
|
|
158
158
|
the first paint; ZTheme only gets to it after bootstrap, a few frames late.
|
|
159
159
|
Generated, not written: a test in projects/zenit-ui/schematics compares it. -->
|
|
160
160
|
<!-- prettier-ignore -->
|
|
161
|
-
<script>(function(k,S,A,ds,da){var s=ds,a=da,d=document.documentElement,m=function(q,f){try{return matchMedia(q).matches}catch(e){return f}};try{var v=JSON.parse((k&&localStorage.getItem(k))||'null');if(v&&typeof v==='object'){if(v.scheme==='system'||S.indexOf(v.scheme)>-1)s=v.scheme;if(A.indexOf(v.accent)>-1)a=v.accent}}catch(e){}if(s==='system')s=S.indexOf('contrast')>-1&&m('(prefers-contrast: more)',false)?'contrast':m('(prefers-color-scheme: dark)',true)?'dark':'light';d.setAttribute('data-theme',s);if(a!==da)d.setAttribute('data-accent',a)})("zenit-theme",["dark","light","contrast"],["rot","blau","gruen","violett"],"system","rot")</script>
|
|
161
|
+
<script>(function(k,S,A,ds,da){var s=ds,a=da,d=document.documentElement,m=function(q,f){try{return matchMedia(q).matches}catch(e){return f}};try{var v=JSON.parse((k&&localStorage.getItem(k))||'null');if(v&&typeof v==='object'){if(v.scheme==='system'||S.indexOf(v.scheme)>-1)s=v.scheme;if(A.indexOf(v.accent)>-1)a=v.accent}}catch(e){}if(s==='system')s=S.indexOf('contrast')>-1&&m('(prefers-contrast: more)',false)?'contrast':m('(prefers-color-scheme: dark)',true)?'dark':'light';d.setAttribute('data-theme',s);if(a!==da)d.setAttribute('data-accent',a)})("zenit-theme",["dark","light","contrast"],["rot","blau","gruen","violett","indigo","orange","rose","schwarz"],"system","rot")</script>
|
|
162
162
|
<title>Gameserver · Zenit-Hosting Beispiel</title>
|
|
163
163
|
<base href="/" />
|
|
164
164
|
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
|
@@ -4494,7 +4494,7 @@ Configuration of `provideZenitTheme`. Every field is optional; the defaults matc
|
|
|
4494
4494
|
| Field | Type | Default | Description |
|
|
4495
4495
|
| --- | --- | --- | --- |
|
|
4496
4496
|
| `schemes?` | `readonly string[]` | `['dark', 'light', 'contrast']` | Ids of the selectable colour schemes. Each id is written to the target as `data-theme="<id>"` and needs a matching CSS block; the ids shipped with the library are `dark`, `light` and `contrast`. Own ids are allowed and are validated against exactly this list. (from ZThemeInitConfig) |
|
|
4497
|
-
| `accents?` | `readonly string[]` | `['rot', 'blau', 'gruen', 'violett']` | Ids of the selectable accents, written as `data-accent="<id>"`. The entry named by `defaultAccent` carries no attribute, because the default accent already lives in `tokens.css` and in the scheme blocks. (from ZThemeInitConfig) |
|
|
4497
|
+
| `accents?` | `readonly string[]` | `['rot', 'blau', 'gruen', 'violett', 'indigo', 'orange', 'rose', 'schwarz']` | Ids of the selectable accents, written as `data-accent="<id>"`. The entry named by `defaultAccent` carries no attribute, because the default accent already lives in `tokens.css` and in the scheme blocks. (from ZThemeInitConfig) |
|
|
4498
4498
|
| `defaultScheme?` | `string` | `'dark'` | Scheme before the first choice of the user. Either one of `schemes` or `'system'`, which follows the operating system: `contrast` while `prefers-contrast: more` matches and `contrast` is one of `schemes`, otherwise `dark` or `light` after `prefers-color-scheme`. (from ZThemeInitConfig) |
|
|
4499
4499
|
| `defaultAccent?` | `string` | `'rot'` | Accent before the first choice of the user. It has to be one of `accents` and gets no `data-accent` attribute. (from ZThemeInitConfig) |
|
|
4500
4500
|
| `storageKey?` | `string \| null` | `'zenit-theme'` | Key under which the choice is stored in `localStorage`. `null` turns the storage off: nothing is read or written, and `ZTheme` starts from the `data-theme` and `data-accent` that are already on the target, which is how an application with its own preference storage hands its choice over. Without such attributes the theme starts from the defaults on every load. The init script does not look at them, it always writes the defaults. (from ZThemeInitConfig) |
|
|
@@ -4519,7 +4519,7 @@ The part of the theme configuration that decides which attributes end up on the
|
|
|
4519
4519
|
| Field | Type | Default | Description |
|
|
4520
4520
|
| --- | --- | --- | --- |
|
|
4521
4521
|
| `schemes?` | `readonly string[]` | `['dark', 'light', 'contrast']` | Ids of the selectable colour schemes. Each id is written to the target as `data-theme="<id>"` and needs a matching CSS block; the ids shipped with the library are `dark`, `light` and `contrast`. Own ids are allowed and are validated against exactly this list. |
|
|
4522
|
-
| `accents?` | `readonly string[]` | `['rot', 'blau', 'gruen', 'violett']` | Ids of the selectable accents, written as `data-accent="<id>"`. The entry named by `defaultAccent` carries no attribute, because the default accent already lives in `tokens.css` and in the scheme blocks. |
|
|
4522
|
+
| `accents?` | `readonly string[]` | `['rot', 'blau', 'gruen', 'violett', 'indigo', 'orange', 'rose', 'schwarz']` | Ids of the selectable accents, written as `data-accent="<id>"`. The entry named by `defaultAccent` carries no attribute, because the default accent already lives in `tokens.css` and in the scheme blocks. |
|
|
4523
4523
|
| `defaultScheme?` | `string` | `'dark'` | Scheme before the first choice of the user. Either one of `schemes` or `'system'`, which follows the operating system: `contrast` while `prefers-contrast: more` matches and `contrast` is one of `schemes`, otherwise `dark` or `light` after `prefers-color-scheme`. |
|
|
4524
4524
|
| `defaultAccent?` | `string` | `'rot'` | Accent before the first choice of the user. It has to be one of `accents` and gets no `data-accent` attribute. |
|
|
4525
4525
|
| `storageKey?` | `string \| null` | `'zenit-theme'` | Key under which the choice is stored in `localStorage`. `null` turns the storage off: nothing is read or written, and `ZTheme` starts from the `data-theme` and `data-accent` that are already on the target, which is how an application with its own preference storage hands its choice over. Without such attributes the theme starts from the defaults on every load. The init script does not look at them, it always writes the defaults. |
|
package/llms.txt
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# zenit-ui
|
|
2
2
|
|
|
3
|
-
> Component library 0.
|
|
3
|
+
> Component library 0.2.0 for Angular 22 of the Zenit design system:
|
|
4
4
|
> 84 standalone components and directives, dark by default, token-driven,
|
|
5
5
|
> `@angular/cdk` for overlays and no Angular Material anywhere. This file is the index;
|
|
6
6
|
> `llms-full.txt` next to it is the complete reference and needs no other file.
|
|
@@ -42,7 +42,7 @@ Business logic, routes and copy stay in your application.
|
|
|
42
42
|
|
|
43
43
|
## Setup in 6 steps
|
|
44
44
|
|
|
45
|
-
1. `npm i ./zenit-ui-0.
|
|
45
|
+
1. `npm i ./zenit-ui-0.2.0.tgz` (the package is not on npm). `ng add ./zenit-ui-0.2.0.tgz --themes`
|
|
46
46
|
does steps 2 to 6 for you.
|
|
47
47
|
2. Register the stylesheets in `angular.json`, in this order:
|
|
48
48
|
`zenit-ui/styles/tokens.css`, `@angular/cdk/overlay-prebuilt.css`,
|
package/package.json
CHANGED
|
@@ -14,7 +14,7 @@ exports.zenitThemeInitScript = zenitThemeInitScript;
|
|
|
14
14
|
/** @internal Defaults shared by `ZTheme` and the init script. */
|
|
15
15
|
exports.THEME_STANDARD = {
|
|
16
16
|
schemes: ['dark', 'light', 'contrast'],
|
|
17
|
-
accents: ['rot', 'blau', 'gruen', 'violett'],
|
|
17
|
+
accents: ['rot', 'blau', 'gruen', 'violett', 'indigo', 'orange', 'rose', 'schwarz'],
|
|
18
18
|
defaultScheme: 'dark',
|
|
19
19
|
defaultAccent: 'rot',
|
|
20
20
|
storageKey: 'zenit-theme',
|
|
@@ -36,8 +36,11 @@
|
|
|
36
36
|
4. accent-subtle follows accent-text: 12 % of it on the dark grounds, an
|
|
37
37
|
opaque light tint of the same hue on the light ground.
|
|
38
38
|
|
|
39
|
-
Known overlap: with gruen, accent-text sits close to --success,
|
|
40
|
-
|
|
39
|
+
Known overlap: with gruen, accent-text sits close to --success, with blau
|
|
40
|
+
close to --info, and with orange close to --warning. orange on the light
|
|
41
|
+
ground is the one accent whose accent-text is deeper than accent-hover
|
|
42
|
+
(#7c2d12): at #9a3412 it stood 1.20:1 from --danger, below the 1.25:1 the
|
|
43
|
+
check asks for. The design system answers that itself, because a
|
|
41
44
|
status is always written out as a word as well (CLAUDE.md, "Farbe").
|
|
42
45
|
|
|
43
46
|
All values are verified by tools/check-theme-contrast.mjs. */
|
|
@@ -89,3 +92,75 @@
|
|
|
89
92
|
--accent-text: #6b1fae;
|
|
90
93
|
--accent-subtle: #f0e4fb;
|
|
91
94
|
}
|
|
95
|
+
|
|
96
|
+
/* Indigo */
|
|
97
|
+
[data-accent="indigo"] {
|
|
98
|
+
--accent: #4f46e5;
|
|
99
|
+
--accent-hover: #4338ca;
|
|
100
|
+
--on-accent: #ffffff;
|
|
101
|
+
--accent-text: #a5b4fc;
|
|
102
|
+
--accent-subtle: rgba(165, 180, 252, 0.12);
|
|
103
|
+
}
|
|
104
|
+
[data-theme="light"][data-accent="indigo"] {
|
|
105
|
+
--accent: #4f46e5;
|
|
106
|
+
--accent-hover: #4338ca;
|
|
107
|
+
--on-accent: #ffffff;
|
|
108
|
+
--accent-text: #4338ca;
|
|
109
|
+
--accent-subtle: #e8e7fc;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/* Orange */
|
|
113
|
+
[data-accent="orange"] {
|
|
114
|
+
--accent: #c2410c;
|
|
115
|
+
--accent-hover: #9a3412;
|
|
116
|
+
--on-accent: #ffffff;
|
|
117
|
+
--accent-text: #fdba74;
|
|
118
|
+
--accent-subtle: rgba(253, 186, 116, 0.12);
|
|
119
|
+
}
|
|
120
|
+
[data-theme="light"][data-accent="orange"] {
|
|
121
|
+
--accent: #c2410c;
|
|
122
|
+
--accent-hover: #9a3412;
|
|
123
|
+
--on-accent: #ffffff;
|
|
124
|
+
--accent-text: #7c2d12;
|
|
125
|
+
--accent-subtle: #fdeee3;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/* Rose */
|
|
129
|
+
[data-accent="rose"] {
|
|
130
|
+
--accent: #db2777;
|
|
131
|
+
--accent-hover: #be185d;
|
|
132
|
+
--on-accent: #ffffff;
|
|
133
|
+
--accent-text: #f9a8d4;
|
|
134
|
+
--accent-subtle: rgba(249, 168, 212, 0.12);
|
|
135
|
+
}
|
|
136
|
+
[data-theme="light"][data-accent="rose"] {
|
|
137
|
+
--accent: #db2777;
|
|
138
|
+
--accent-hover: #be185d;
|
|
139
|
+
--on-accent: #ffffff;
|
|
140
|
+
--accent-text: #9d174d;
|
|
141
|
+
--accent-subtle: #fce7f3;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/* Schwarz. Der einzige Akzent ohne Farbton: auf hellem Grund ist die Handlung
|
|
145
|
+
schwarz statt farbig. Zwei Abweichungen von den übrigen Akzenten:
|
|
146
|
+
- Auf dem dunklen Grund gibt es kein Schwarz, das sich vom Grund abhebt, und
|
|
147
|
+
ein helles Grau hielte die 3:1 gegen den weißen Fokus nicht. Die Fläche ist
|
|
148
|
+
dort Graphit (#52525b) mit weißer Schrift, accent-text ein helles Grau.
|
|
149
|
+
- Auf dem hellen Grund ist focus fast schwarz und läge auf einer schwarzen
|
|
150
|
+
Fläche bei 1:1. Nur hier setzt der Akzent deshalb auch focus, und zwar auf
|
|
151
|
+
ein Blau, das gegen alle vier Flächen und gegen accent über 3:1 bleibt. */
|
|
152
|
+
[data-accent="schwarz"] {
|
|
153
|
+
--accent: #52525b;
|
|
154
|
+
--accent-hover: #3f3f46;
|
|
155
|
+
--on-accent: #ffffff;
|
|
156
|
+
--accent-text: #d4d4d8;
|
|
157
|
+
--accent-subtle: rgba(212, 212, 216, 0.12);
|
|
158
|
+
}
|
|
159
|
+
[data-theme="light"][data-accent="schwarz"] {
|
|
160
|
+
--accent: #18181b;
|
|
161
|
+
--accent-hover: #3f3f46;
|
|
162
|
+
--on-accent: #ffffff;
|
|
163
|
+
--accent-text: #18181b;
|
|
164
|
+
--accent-subtle: #e4e4e7;
|
|
165
|
+
--focus: #2563eb;
|
|
166
|
+
}
|
|
@@ -5686,7 +5686,7 @@ interface ZThemeInitConfig {
|
|
|
5686
5686
|
* named by {@link defaultAccent} carries no attribute, because the default
|
|
5687
5687
|
* accent already lives in `tokens.css` and in the scheme blocks.
|
|
5688
5688
|
*
|
|
5689
|
-
* @default ['rot', 'blau', 'gruen', 'violett']
|
|
5689
|
+
* @default ['rot', 'blau', 'gruen', 'violett', 'indigo', 'orange', 'rose', 'schwarz']
|
|
5690
5690
|
*/
|
|
5691
5691
|
readonly accents?: readonly string[];
|
|
5692
5692
|
/**
|