@cloudfrogger/goodui 0.0.72 → 0.0.73
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/ai/catalog/components/good-header-themetoggle.json +1 -8
- package/ai/catalog/index.json +3 -3
- package/ai/manifest.json +2 -2
- package/angular/projects/goodui/package.json +1 -1
- package/angular/projects/goodui/src/lib/actions.ts +4 -4
- package/angular/projects/goodui/src/lib/theme.ts +1 -2
- package/design/component-map.json +0 -7
- package/fesm2022/cloudfrogger-goodui.mjs +7 -8
- package/fesm2022/cloudfrogger-goodui.mjs.map +1 -1
- package/guides/components/header-themetoggle.md +3 -3
- package/guides/contributing/design-to-code.md +1 -1
- package/package.json +2 -2
- package/types/cloudfrogger-goodui.d.ts +1 -1
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
},
|
|
25
25
|
"usageGuide": "guides/components/header-themetoggle.md",
|
|
26
26
|
"usage": {
|
|
27
|
-
"summary": "`goodui.theme-toggle` maps to `good-header-themetoggle`. It is an optional 36 × 36 px topbar action. One click
|
|
27
|
+
"summary": "`goodui.theme-toggle` maps to `good-header-themetoggle`. It is an optional 36 × 36 px topbar action. One click switches **Light ↔ Dark** without opening a menu. The icon shows the currently active theme: sun for Light or moon for Dark, including when the initial theme follows the system. The accessible button label names both the current and next mode; keyboard users activate it with Enter or Space.",
|
|
28
28
|
"examples": [
|
|
29
29
|
"ai/examples/shell.html"
|
|
30
30
|
]
|
|
@@ -37,13 +37,6 @@
|
|
|
37
37
|
"state": "light",
|
|
38
38
|
"owner": null
|
|
39
39
|
},
|
|
40
|
-
{
|
|
41
|
-
"penpotName": "goodui.theme-toggle.system",
|
|
42
|
-
"penpotId": "f52a309e-8b45-80e4-8008-d86c7bab8421",
|
|
43
|
-
"kind": "component",
|
|
44
|
-
"state": "system",
|
|
45
|
-
"owner": null
|
|
46
|
-
},
|
|
47
40
|
{
|
|
48
41
|
"penpotName": "goodui.theme-toggle.dark",
|
|
49
42
|
"penpotId": "f52a309e-8b45-80e4-8008-d86c7c8f020f",
|
package/ai/catalog/index.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "index.schema.json",
|
|
3
3
|
"package": "@cloudfrogger/goodui",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.73",
|
|
5
5
|
"generatedFrom": "angular/projects/goodui/src/public-api.ts",
|
|
6
6
|
"components": [
|
|
7
7
|
{
|
|
@@ -733,8 +733,8 @@
|
|
|
733
733
|
"symbol": "GoodHeaderThemeToggleComponent"
|
|
734
734
|
},
|
|
735
735
|
"usageGuide": "guides/components/header-themetoggle.md",
|
|
736
|
-
"summary": "`goodui.theme-toggle` maps to `good-header-themetoggle`. It is an optional 36 × 36 px topbar action. One click
|
|
737
|
-
"penpotCount":
|
|
736
|
+
"summary": "`goodui.theme-toggle` maps to `good-header-themetoggle`. It is an optional 36 × 36 px topbar action. One click switches **Light ↔ Dark** without opening a menu. The icon shows the currently active theme: sun for Light or moon for Dark, including when the initial theme follows the system. The accessible button label names both the current and next mode; keyboard users activate it with Enter or Space.",
|
|
737
|
+
"penpotCount": 2
|
|
738
738
|
},
|
|
739
739
|
{
|
|
740
740
|
"selector": "good-heading-1",
|
package/ai/manifest.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"package": "@cloudfrogger/goodui",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"sourceRevision": "
|
|
3
|
+
"version": "0.0.73",
|
|
4
|
+
"sourceRevision": "e97aa9c98d68a156a00e3cc6e3c8d96fe9f0d57f",
|
|
5
5
|
"note": "References bundled with the npm package."
|
|
6
6
|
}
|
|
@@ -159,15 +159,15 @@ export class GoodHeaderNotificationComponent {
|
|
|
159
159
|
standalone: true,
|
|
160
160
|
imports: [GoodIconComponent],
|
|
161
161
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
162
|
-
template: `<button type="button" class="good-action-button" [attr.aria-label]="label()" [attr.title]="label()" (click)="theme.
|
|
162
|
+
template: `<button type="button" class="good-action-button" [attr.aria-label]="label()" [attr.title]="label()" (click)="theme.toggle()">
|
|
163
163
|
<good-icon [name]="icon()" />
|
|
164
164
|
</button>`,
|
|
165
165
|
host: { class: 'good-header-themetoggle' },
|
|
166
166
|
})
|
|
167
167
|
export class GoodHeaderThemeToggleComponent {
|
|
168
168
|
readonly theme = inject(GoodThemeService);
|
|
169
|
-
readonly icon = computed(() => (
|
|
170
|
-
readonly label = computed(() => `Appearance: ${this.theme.
|
|
169
|
+
readonly icon = computed(() => this.theme.theme() === 'light' ? 'sun' : 'moon');
|
|
170
|
+
readonly label = computed(() => `Appearance: ${this.theme.theme()}. Switch to ${this.theme.theme() === 'light' ? 'dark' : 'light'} mode`);
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
@Component({
|
|
@@ -288,7 +288,7 @@ export class GoodAvatarMenuItemComponent {
|
|
|
288
288
|
@if (action.variant !== 'sign-out') { <good-avatar-menu-item [action]="action" [path]="action.id" (closed)="closeMenu()" /> }
|
|
289
289
|
}
|
|
290
290
|
<span class="good-avatar-separator" role="separator"></span>
|
|
291
|
-
<label class="good-avatar-theme-row"><span>Dark Mode</span><input type="checkbox" role="switch" [checked]="theme.
|
|
291
|
+
<label class="good-avatar-theme-row"><span>Dark Mode</span><input type="checkbox" role="switch" [checked]="theme.theme() === 'dark'" (change)="theme.setTheme($any($event.target).checked ? 'dark' : 'light')" /><span class="good-avatar-switch" aria-hidden="true"></span></label>
|
|
292
292
|
@for (action of actions(); track action.id) {
|
|
293
293
|
@if (action.variant === 'sign-out') { <good-avatar-menu-item [action]="action" [path]="action.id" (closed)="closeMenu()" /> }
|
|
294
294
|
}
|
|
@@ -32,8 +32,7 @@ export class GoodThemeService {
|
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
cycle(): void {
|
|
35
|
-
|
|
36
|
-
this.setTheme(next[this.preference()]);
|
|
35
|
+
this.toggle();
|
|
37
36
|
}
|
|
38
37
|
|
|
39
38
|
toggle(): void {
|
|
@@ -1240,13 +1240,6 @@
|
|
|
1240
1240
|
"kind": "component",
|
|
1241
1241
|
"state": "light"
|
|
1242
1242
|
},
|
|
1243
|
-
{
|
|
1244
|
-
"penpotName": "goodui.theme-toggle.system",
|
|
1245
|
-
"penpotId": "f52a309e-8b45-80e4-8008-d86c7bab8421",
|
|
1246
|
-
"angularSelector": "good-header-themetoggle",
|
|
1247
|
-
"kind": "component",
|
|
1248
|
-
"state": "system"
|
|
1249
|
-
},
|
|
1250
1243
|
{
|
|
1251
1244
|
"penpotName": "goodui.theme-toggle.dark",
|
|
1252
1245
|
"penpotId": "f52a309e-8b45-80e4-8008-d86c7c8f020f",
|
|
@@ -167,8 +167,7 @@ class GoodThemeService {
|
|
|
167
167
|
}
|
|
168
168
|
}
|
|
169
169
|
cycle() {
|
|
170
|
-
|
|
171
|
-
this.setTheme(next[this.preference()]);
|
|
170
|
+
this.toggle();
|
|
172
171
|
}
|
|
173
172
|
toggle() {
|
|
174
173
|
this.setTheme(this.theme() === 'light' ? 'dark' : 'light');
|
|
@@ -1306,10 +1305,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1306
1305
|
}], propDecorators: { items: [{ type: i0.Input, args: [{ isSignal: true, alias: "items", required: false }] }], dialog: [{ type: i0.ViewChild, args: ['dialog', { isSignal: true }] }] } });
|
|
1307
1306
|
class GoodHeaderThemeToggleComponent {
|
|
1308
1307
|
theme = inject(GoodThemeService);
|
|
1309
|
-
icon = computed(() => (
|
|
1310
|
-
label = computed(() => `Appearance: ${this.theme.
|
|
1308
|
+
icon = computed(() => this.theme.theme() === 'light' ? 'sun' : 'moon', ...(ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []));
|
|
1309
|
+
label = computed(() => `Appearance: ${this.theme.theme()}. Switch to ${this.theme.theme() === 'light' ? 'dark' : 'light'} mode`, ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
|
|
1311
1310
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.25", ngImport: i0, type: GoodHeaderThemeToggleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
1312
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: GoodHeaderThemeToggleComponent, isStandalone: true, selector: "good-header-themetoggle", host: { classAttribute: "good-header-themetoggle" }, ngImport: i0, template: `<button type="button" class="good-action-button" [attr.aria-label]="label()" [attr.title]="label()" (click)="theme.
|
|
1311
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.25", type: GoodHeaderThemeToggleComponent, isStandalone: true, selector: "good-header-themetoggle", host: { classAttribute: "good-header-themetoggle" }, ngImport: i0, template: `<button type="button" class="good-action-button" [attr.aria-label]="label()" [attr.title]="label()" (click)="theme.toggle()">
|
|
1313
1312
|
<good-icon [name]="icon()" />
|
|
1314
1313
|
</button>`, isInline: true, dependencies: [{ kind: "component", type: GoodIconComponent, selector: "good-icon", inputs: ["name"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
1315
1314
|
}
|
|
@@ -1320,7 +1319,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1320
1319
|
standalone: true,
|
|
1321
1320
|
imports: [GoodIconComponent],
|
|
1322
1321
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1323
|
-
template: `<button type="button" class="good-action-button" [attr.aria-label]="label()" [attr.title]="label()" (click)="theme.
|
|
1322
|
+
template: `<button type="button" class="good-action-button" [attr.aria-label]="label()" [attr.title]="label()" (click)="theme.toggle()">
|
|
1324
1323
|
<good-icon [name]="icon()" />
|
|
1325
1324
|
</button>`,
|
|
1326
1325
|
host: { class: 'good-header-themetoggle' },
|
|
@@ -1512,7 +1511,7 @@ class GoodHeaderAvatarComponent {
|
|
|
1512
1511
|
@if (action.variant !== 'sign-out') { <good-avatar-menu-item [action]="action" [path]="action.id" (closed)="closeMenu()" /> }
|
|
1513
1512
|
}
|
|
1514
1513
|
<span class="good-avatar-separator" role="separator"></span>
|
|
1515
|
-
<label class="good-avatar-theme-row"><span>Dark Mode</span><input type="checkbox" role="switch" [checked]="theme.
|
|
1514
|
+
<label class="good-avatar-theme-row"><span>Dark Mode</span><input type="checkbox" role="switch" [checked]="theme.theme() === 'dark'" (change)="theme.setTheme($any($event.target).checked ? 'dark' : 'light')" /><span class="good-avatar-switch" aria-hidden="true"></span></label>
|
|
1516
1515
|
@for (action of actions(); track action.id) {
|
|
1517
1516
|
@if (action.variant === 'sign-out') { <good-avatar-menu-item [action]="action" [path]="action.id" (closed)="closeMenu()" /> }
|
|
1518
1517
|
}
|
|
@@ -1540,7 +1539,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.25", ngImpo
|
|
|
1540
1539
|
@if (action.variant !== 'sign-out') { <good-avatar-menu-item [action]="action" [path]="action.id" (closed)="closeMenu()" /> }
|
|
1541
1540
|
}
|
|
1542
1541
|
<span class="good-avatar-separator" role="separator"></span>
|
|
1543
|
-
<label class="good-avatar-theme-row"><span>Dark Mode</span><input type="checkbox" role="switch" [checked]="theme.
|
|
1542
|
+
<label class="good-avatar-theme-row"><span>Dark Mode</span><input type="checkbox" role="switch" [checked]="theme.theme() === 'dark'" (change)="theme.setTheme($any($event.target).checked ? 'dark' : 'light')" /><span class="good-avatar-switch" aria-hidden="true"></span></label>
|
|
1544
1543
|
@for (action of actions(); track action.id) {
|
|
1545
1544
|
@if (action.variant === 'sign-out') { <good-avatar-menu-item [action]="action" [path]="action.id" (closed)="closeMenu()" /> }
|
|
1546
1545
|
}
|