@conciso/design-system-angular 2.1.0 → 2.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
CHANGED
|
@@ -11,13 +11,28 @@ nur deren CSS-Klassen zusammen und liefern **kein eigenes CSS**.
|
|
|
11
11
|
> und importiert ausschließlich von hier
|
|
12
12
|
> ([ADR-0002](../../../docs/adr/0002-topologie-und-quelle-der-wahrheit.md)).
|
|
13
13
|
|
|
14
|
-
## Installation
|
|
14
|
+
## Installation von npmjs.org
|
|
15
15
|
|
|
16
|
-
Beide Pakete (`@conciso/design-system-angular` **und**
|
|
17
|
-
[Lockstep](../../../CONTEXT.md#lockstep-versionierung))
|
|
18
|
-
|
|
19
|
-
[ADR-
|
|
20
|
-
|
|
16
|
+
Der empfohlene Weg: Beide Pakete (`@conciso/design-system-angular` **und**
|
|
17
|
+
`@conciso/design-system`, [Lockstep](../../../CONTEXT.md#lockstep-versionierung))
|
|
18
|
+
liegen auf der öffentlichen npm-Registry (seit
|
|
19
|
+
[ADR-0011](../../../docs/adr/0011-veroeffentlichung-auf-npmjs.md)). Keine `.npmrc`,
|
|
20
|
+
kein Token nötig:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
npm install @conciso/design-system-angular @conciso/design-system
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Gilt ab dem ersten echten Release nach dem Merge dieser Änderung; bis dahin liegt auf
|
|
27
|
+
npmjs nur eine Bootstrap-Platzhalterversion (siehe ADR-0011).
|
|
28
|
+
|
|
29
|
+
## Installation aus GitHub Packages (Alternative)
|
|
30
|
+
|
|
31
|
+
Beide Pakete liegen **zusätzlich** weiterhin privat, org-scoped in
|
|
32
|
+
[GitHub Packages](https://npm.pkg.github.com) (siehe
|
|
33
|
+
[ADR-0004](../../../docs/adr/0004-verteilung-und-versionierung.md)) — z. B. für
|
|
34
|
+
Consumer innerhalb der GitHub-Organisation `conciso`, die ohnehin schon so
|
|
35
|
+
eingerichtet sind. Ein einziger `.npmrc`-Mechanismus deckt beide ab, weil
|
|
21
36
|
beide unter dem `@conciso`-Scope veröffentlicht werden.
|
|
22
37
|
|
|
23
38
|
**1. `.npmrc`** im Konsumenten-Projekt (oder `~/.npmrc` für den eigenen Rechner)
|
|
@@ -163,5 +178,6 @@ Das Artefakt (Angular Package Format, via ng-packagr) landet unter
|
|
|
163
178
|
|
|
164
179
|
MIT, siehe [LICENSE](../../../LICENSE) im Repository-Root (im gebauten Paket unter
|
|
165
180
|
`dist/design-system-angular/LICENSE`). Ausnahmen (Brand-Assets, Schriften, Icons)
|
|
166
|
-
siehe [NOTICE](../../../NOTICE). Das betrifft nur die Lizenz —
|
|
167
|
-
|
|
181
|
+
siehe [NOTICE](../../../NOTICE). Das betrifft nur die Lizenz — an den beiden
|
|
182
|
+
Bezugswegen (npmjs.org als Standard, GitHub Packages als Alternative, siehe oben)
|
|
183
|
+
ändert sich dadurch nichts.
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { signal, Injectable, input, output, computed, ChangeDetectionStrategy, Component, inject, ElementRef, model, Directive, forwardRef, DestroyRef, viewChild, linkedSignal, numberAttribute, afterNextRender, TemplateRef, contentChildren, effect, viewChildren, afterRenderEffect } from '@angular/core';
|
|
3
3
|
import { DOCUMENT, NgTemplateOutlet } from '@angular/common';
|
|
4
4
|
import { provideIcons, NgIcon } from '@ng-icons/core';
|
|
5
|
-
import {
|
|
5
|
+
import { uiCaretDown as uiCaretDown$1, uiCheck as uiCheck$1 } from '@conciso/design-system/icons';
|
|
6
6
|
import { heroComputerDesktop, heroMoon, heroSun, heroXMark, heroMagnifyingGlass, heroBars3, heroChevronDown } from '@ng-icons/heroicons/outline';
|
|
7
7
|
import { NG_VALUE_ACCESSOR } from '@angular/forms';
|
|
8
8
|
import { DomSanitizer } from '@angular/platform-browser';
|
|
@@ -138,9 +138,12 @@ class ButtonComponent {
|
|
|
138
138
|
* .btn-text; `filled-on-band` → .btn-filled + .btn-on-band (invertiert). */
|
|
139
139
|
variant = input('filled', /* @ts-ignore */
|
|
140
140
|
...(ngDevMode ? [{ debugName: "variant" }] : /* istanbul ignore next */ []));
|
|
141
|
-
/** Markenbereich → .btn-co / .btn-ki / .btn-es / .btn-wo */
|
|
141
|
+
/** Markenbereich → .btn-co / .btn-ki / .btn-es / .btn-wo. Wirkungslos bei `tone="err"`. */
|
|
142
142
|
area = input('co', /* @ts-ignore */
|
|
143
143
|
...(ngDevMode ? [{ debugName: "area" }] : /* istanbul ignore next */ []));
|
|
144
|
+
/** Ton → `err` setzt .btn-err (destruktive Aktion) statt der Bereichsklasse. */
|
|
145
|
+
tone = input('def', /* @ts-ignore */
|
|
146
|
+
...(ngDevMode ? [{ debugName: "tone" }] : /* istanbul ignore next */ []));
|
|
144
147
|
/** Größe → .btn-sm / (md = Default) / .btn-lg */
|
|
145
148
|
size = input('md', /* @ts-ignore */
|
|
146
149
|
...(ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []));
|
|
@@ -157,7 +160,10 @@ class ButtonComponent {
|
|
|
157
160
|
classes = computed(() => {
|
|
158
161
|
// filled-on-band = invertierter Filled-Button; rendert .btn-filled + .btn-on-band.
|
|
159
162
|
const onBand = this.variant() === 'filled-on-band';
|
|
160
|
-
|
|
163
|
+
// Ton ersetzt den Bereich, statt ihn zu überlagern: so hängt das Ergebnis nicht an der
|
|
164
|
+
// Reihenfolge der Regeln in components.css und dark-mode.css.
|
|
165
|
+
const color = this.tone() === 'err' ? 'err' : this.area();
|
|
166
|
+
const cls = ['btn', `btn-${onBand ? 'filled' : this.variant()}`, `btn-${color}`];
|
|
161
167
|
if (this.size() === 'sm')
|
|
162
168
|
cls.push('btn-sm');
|
|
163
169
|
if (this.size() === 'lg')
|
|
@@ -170,7 +176,7 @@ class ButtonComponent {
|
|
|
170
176
|
}, /* @ts-ignore */
|
|
171
177
|
...(ngDevMode ? [{ debugName: "classes" }] : /* istanbul ignore next */ []));
|
|
172
178
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.7", ngImport: i0, type: ButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
173
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: ButtonComponent, isStandalone: true, selector: "cds-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, area: { classPropertyName: "area", publicName: "area", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, full: { classPropertyName: "full", publicName: "full", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "style.display": "full() ? 'block' : null" } }, ngImport: i0, template: `
|
|
179
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.7", type: ButtonComponent, isStandalone: true, selector: "cds-button", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, area: { classPropertyName: "area", publicName: "area", isSignal: true, isRequired: false, transformFunction: null }, tone: { classPropertyName: "tone", publicName: "tone", isSignal: true, isRequired: false, transformFunction: null }, size: { classPropertyName: "size", publicName: "size", isSignal: true, isRequired: false, transformFunction: null }, full: { classPropertyName: "full", publicName: "full", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null }, type: { classPropertyName: "type", publicName: "type", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { clicked: "clicked" }, host: { properties: { "style.display": "full() ? 'block' : null" } }, ngImport: i0, template: `
|
|
174
180
|
<button [class]="classes()" [disabled]="disabled()" [attr.type]="type()" (click)="clicked.emit($event)">
|
|
175
181
|
{{ label() }}
|
|
176
182
|
</button>
|
|
@@ -191,7 +197,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
191
197
|
</button>
|
|
192
198
|
`,
|
|
193
199
|
}]
|
|
194
|
-
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], area: [{ type: i0.Input, args: [{ isSignal: true, alias: "area", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], full: [{ type: i0.Input, args: [{ isSignal: true, alias: "full", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
200
|
+
}], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], variant: [{ type: i0.Input, args: [{ isSignal: true, alias: "variant", required: false }] }], area: [{ type: i0.Input, args: [{ isSignal: true, alias: "area", required: false }] }], tone: [{ type: i0.Input, args: [{ isSignal: true, alias: "tone", required: false }] }], size: [{ type: i0.Input, args: [{ isSignal: true, alias: "size", required: false }] }], full: [{ type: i0.Input, args: [{ isSignal: true, alias: "full", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }], type: [{ type: i0.Input, args: [{ isSignal: true, alias: "type", required: false }] }], clicked: [{ type: i0.Output, args: ["clicked"] }] } });
|
|
195
201
|
|
|
196
202
|
/**
|
|
197
203
|
* Zentrale Icon-Registry des Storybooks — die EINZIGE Import-Fläche für
|
|
@@ -203,6 +209,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
203
209
|
* · `ui-caret-down` — kräftiger Caret (10er-viewBox), kein Heroicon-Pendant.
|
|
204
210
|
* · `ui-check` — eigener Haken (12er-viewBox), weicht vom heroCheck (24er) ab.
|
|
205
211
|
*
|
|
212
|
+
* Importiert werden ausschließlich die BENANNTEN Exporte der beiden gebrauchten Glyphen
|
|
213
|
+
* (`uiCaretDown`, `uiCheck`), nie das aggregierte `icons`-Objekt — ein Property-Zugriff
|
|
214
|
+
* darauf (`icons['ui-caret-down']`) ist für Bundler nicht tree-shakable und zöge alle
|
|
215
|
+
* alle DS-Icons in jedes Consumer-Bundle (siehe icons/README.md „Verwendung“).
|
|
216
|
+
*
|
|
206
217
|
* 2. **Heroicons**: für Glyphen, die im DS mit dem Heroicon glyph-identisch sind
|
|
207
218
|
* (chevron-down, magnifying-glass — gleicher Pfad, das DS setzt nur einen dünneren
|
|
208
219
|
* Stroke) sowie für die im DS-Set (noch) fehlenden Chrome-Icons (bars-3, x-mark,
|
|
@@ -212,13 +223,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.7", ngImpor
|
|
|
212
223
|
* Komponenten importieren ausschließlich aus dieser Datei, nie direkt aus
|
|
213
224
|
* `@ng-icons/heroicons`.
|
|
214
225
|
*/
|
|
215
|
-
//
|
|
216
|
-
// eigene Typdeklaration; die Form ist in ds-icons-export.d.ts dokumentiert (ngtsc greift die
|
|
217
|
-
// Ambient-Deklaration dort nicht, anders als tsc, deshalb die explizite Unterdrückung hier).
|
|
218
|
-
// DS-eigene Glyphen aus dem generierten Export (kein Duplizieren des SVG-Markups).
|
|
226
|
+
// DS-eigene Glyphen aus dem generierten, benannten Export (kein Duplizieren des SVG-Markups).
|
|
219
227
|
// Als @ng-icons-Custom-Icons registrierbar: der Wert ist das komplette <svg>-Markup.
|
|
220
|
-
const uiCaretDown =
|
|
221
|
-
const uiCheck =
|
|
228
|
+
const uiCaretDown = uiCaretDown$1.svg;
|
|
229
|
+
const uiCheck = uiCheck$1.svg;
|
|
222
230
|
|
|
223
231
|
/**
|
|
224
232
|
* Theme-Cycle-Button — ein einzelner Icon-Button (Stil `.ep-nav-icon-btn` aus der
|