@zenit-hosting/zenit-ui 0.1.0 → 0.2.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/llms-full.txt CHANGED
@@ -1,6 +1,6 @@
1
1
  # zenit-ui — complete reference
2
2
 
3
- > Version 0.1.0. Everything needed to use this library correctly, with no other file and
3
+ > Version 0.2.1. 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
@@ -76,12 +76,14 @@ is no `NgModule` and no `forRoot`.
76
76
 
77
77
  ## 3. Setup
78
78
 
79
- 1. **Install.** The package is not on npm; it is installed from the tarball built by
80
- `npm pack` inside `dist/zenit-ui`:
79
+ 1. **Install.** The package is `@zenit-hosting/zenit-ui` on npmjs.org. Install it under the
80
+ alias `zenit-ui`, so imports and stylesheet paths stay `zenit-ui`:
81
81
  ```bash
82
- npm i ./zenit-ui-0.1.0.tgz
82
+ npm install zenit-ui@npm:@zenit-hosting/zenit-ui@^0.2.1
83
83
  ```
84
- `ng add ./zenit-ui-0.1.0.tgz --themes` performs steps 2 to 6 automatically.
84
+ Never `npm i zenit-ui` or `ng add zenit-ui`: the unscoped name belongs to somebody else.
85
+ `ng generate zenit-ui:ng-add --themes` then performs steps 2 to 6 automatically (not
86
+ `ng add`, which would add the package a second time without the alias).
85
87
 
86
88
  2. **Register the stylesheets** in `angular.json` (`projects.<app>.architect.build.options.styles`)
87
89
  or via `@import` in your entry stylesheet. The order is binding:
@@ -158,7 +160,7 @@ is no `NgModule` and no `forRoot`.
158
160
  the first paint; ZTheme only gets to it after bootstrap, a few frames late.
159
161
  Generated, not written: a test in projects/zenit-ui/schematics compares it. -->
160
162
  <!-- 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>
163
+ <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
164
  <title>Gameserver · Zenit-Hosting Beispiel</title>
163
165
  <base href="/" />
164
166
  <meta name="viewport" content="width=device-width, initial-scale=1" />
@@ -4136,7 +4138,7 @@ The stylesheet has to block rendering as well. The Angular CLI inlines
4136
4138
  "critical" CSS and loads the rest late; `[data-theme="light"]` is never
4137
4139
  critical, because nothing in `index.html` matches it. Set
4138
4140
  `optimization.styles.inlineCritical` to `false` in the `production`
4139
- configuration of the build target; `ng add zenit-ui --themes` writes both
4141
+ configuration of the build target; `ng generate zenit-ui:ng-add --themes` writes both
4140
4142
  the script and that setting.
4141
4143
 
4142
4144
  With a Content Security Policy the returned string is what you hash
@@ -4494,7 +4496,7 @@ Configuration of `provideZenitTheme`. Every field is optional; the defaults matc
4494
4496
  | Field | Type | Default | Description |
4495
4497
  | --- | --- | --- | --- |
4496
4498
  | `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) |
4499
+ | `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
4500
  | `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
4501
  | `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
4502
  | `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 +4521,7 @@ The part of the theme configuration that decides which attributes end up on the
4519
4521
  | Field | Type | Default | Description |
4520
4522
  | --- | --- | --- | --- |
4521
4523
  | `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. |
4524
+ | `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
4525
  | `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
4526
  | `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
4527
  | `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.1.0 for Angular 22 of the Zenit design system:
3
+ > Component library 0.2.1 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,8 @@ 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.1.0.tgz` (the package is not on npm). `ng add ./zenit-ui-0.1.0.tgz --themes`
45
+ 1. `npm install zenit-ui@npm:@zenit-hosting/zenit-ui@^0.2.1` (the alias keeps the import
46
+ path `zenit-ui`; never install the unscoped `zenit-ui`). `ng generate zenit-ui:ng-add --themes`
46
47
  does steps 2 to 6 for you.
47
48
  2. Register the stylesheets in `angular.json`, in this order:
48
49
  `zenit-ui/styles/tokens.css`, `@angular/cdk/overlay-prebuilt.css`,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zenit-hosting/zenit-ui",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "license": "UNLICENSED",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -5,7 +5,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.ngAdd = ngAdd;
7
7
  /**
8
- * `ng add zenit-ui`.
8
+ * the `ng-add` schematic.
9
9
  *
10
10
  * Performs the setup that `projects/zenit-ui/README.md` documents by hand:
11
11
  * style entries in `angular.json`, `z-root` in `index.html`, `@angular/cdk`,
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  /*
3
- * Plain TypeScript without a single import, on purpose: `ng add zenit-ui`
3
+ * Plain TypeScript without a single import, on purpose: the `ng-add` schematic
4
4
  * needs the same script, and schematics are compiled apart from the library
5
5
  * (CommonJS, no DOM types, `rootDir: schematics`). A byte-identical copy of
6
6
  * this file therefore lives at `schematics/ng-add/init-script.ts`; the test in
@@ -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',
@@ -86,7 +86,7 @@ function alsLiteral(wert) {
86
86
  * "critical" CSS and loads the rest late; `[data-theme="light"]` is never
87
87
  * critical, because nothing in `index.html` matches it. Set
88
88
  * `optimization.styles.inlineCritical` to `false` in the `production`
89
- * configuration of the build target; `ng add zenit-ui --themes` writes both
89
+ * configuration of the build target; `ng generate zenit-ui:ng-add --themes` writes both
90
90
  * the script and that setting.
91
91
  *
92
92
  * With a Content Security Policy the returned string is what you hash
@@ -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, and with
40
- blau close to --info. The design system answers that itself, because a
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
  /**
@@ -5733,7 +5733,7 @@ interface ZThemeInitConfig {
5733
5733
  * "critical" CSS and loads the rest late; `[data-theme="light"]` is never
5734
5734
  * critical, because nothing in `index.html` matches it. Set
5735
5735
  * `optimization.styles.inlineCritical` to `false` in the `production`
5736
- * configuration of the build target; `ng add zenit-ui --themes` writes both
5736
+ * configuration of the build target; `ng generate zenit-ui:ng-add --themes` writes both
5737
5737
  * the script and that setting.
5738
5738
  *
5739
5739
  * With a Content Security Policy the returned string is what you hash