@cloudfrogger/goodui 0.0.65 → 0.0.71
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/README.md +15 -0
- package/ai/case-studies/dockerhub.md +7 -0
- package/ai/case-studies/index.md +1 -0
- package/ai/catalog/component.schema.json +6 -0
- package/ai/catalog/components/good-action-menu.json +2 -2
- package/ai/catalog/components/good-alert.json +2 -2
- package/ai/catalog/components/{good-topbar.json → good-app-header.json} +75 -81
- package/ai/catalog/components/{good-app-layout.json → good-app-shell.json} +32 -68
- package/ai/catalog/components/good-brand-icon.json +6 -6
- package/ai/catalog/components/good-button.json +2 -2
- package/ai/catalog/components/good-dropdown.json +2 -2
- package/ai/catalog/components/good-header-actions.json +10 -1
- package/ai/catalog/components/{good-topbar-dropdown-item.json → good-header-dropdown-item.json} +17 -17
- package/ai/catalog/components/{good-topbar-dropdown-menu.json → good-header-dropdown-menu.json} +14 -14
- package/ai/catalog/components/{good-topbar-menu-item.json → good-header-menu-item.json} +17 -15
- package/ai/catalog/components/{good-topbar-menu-container.json → good-header-menu.json} +16 -14
- package/ai/catalog/components/good-header-search.json +12 -3
- package/ai/catalog/components/{good-topbar-submenu.json → good-header-submenu.json} +12 -12
- package/ai/catalog/components/good-header-themetoggle.json +3 -1
- package/ai/catalog/components/{good-heading.json → good-heading-1.json} +15 -33
- package/ai/catalog/components/good-heading-2.json +46 -0
- package/ai/catalog/components/{good-subheading.json → good-heading-3.json} +9 -30
- package/ai/catalog/components/good-heading-4.json +46 -0
- package/ai/catalog/components/good-heading-5.json +46 -0
- package/ai/catalog/components/good-heading-6.json +46 -0
- package/ai/catalog/components/good-heading-7.json +46 -0
- package/ai/catalog/components/good-heading-group.json +1 -1
- package/ai/catalog/components/good-main-view.json +6 -49
- package/ai/catalog/components/good-notification-host.json +1 -1
- package/ai/catalog/components/good-section.json +20 -2
- package/ai/catalog/components/good-sidebar-item.json +4 -2
- package/ai/catalog/components/good-sidebar-menu-container.json +4 -2
- package/ai/catalog/components/good-sidebar-submenu-group.json +1 -1
- package/ai/catalog/components/good-sidebar-submenu-item.json +1 -1
- package/ai/catalog/components/{good-sidebar-container.json → good-sidebar.json} +23 -26
- package/ai/catalog/components/good-summary.json +6 -1
- package/ai/catalog/index.json +170 -110
- package/ai/examples/edit-form.html +3 -1
- package/ai/examples/edit-form.ts +2 -2
- package/ai/examples/login.html +3 -1
- package/ai/examples/login.ts +2 -2
- package/ai/examples/settings.html +3 -1
- package/ai/examples/settings.ts +2 -2
- package/ai/examples/shell.html +18 -0
- package/ai/examples/shell.ts +11 -0
- package/ai/examples/table-view.html +3 -1
- package/ai/examples/table-view.ts +2 -2
- package/ai/examples/tsconfig.json +2 -1
- package/ai/guides/component-discovery.md +2 -2
- package/ai/guides/layout.md +5 -3
- package/ai/guides/page-patterns.md +7 -3
- package/ai/manifest.json +2 -2
- package/ai/skill/goodui/SKILL.md +11 -3
- package/angular/projects/goodui/package.json +1 -1
- package/angular/projects/goodui/src/lib/actions.ts +27 -3
- package/angular/projects/goodui/src/lib/app-shell.ts +109 -0
- package/angular/projects/goodui/src/lib/{topbar.ts → header.ts} +96 -69
- package/angular/projects/goodui/src/lib/main-view.ts +22 -13
- package/angular/projects/goodui/src/lib/shell-context.ts +46 -0
- package/angular/projects/goodui/src/lib/sidebar.ts +58 -40
- package/angular/projects/goodui/src/lib/typography.ts +51 -41
- package/angular/projects/goodui/src/public-api.ts +2 -2
- package/angular/projects/goodui/src/styles.css +95 -61
- package/angular/projects/goodui/src/tokens.generated.css +43 -6
- package/design/app-shell-contract.json +118 -0
- package/design/component-map.json +153 -71
- package/design/header-search-variants.json +55 -0
- package/design/typography-components.json +327 -0
- package/design-tokens/penpot.tokens.json +160 -6
- package/design.md +49 -37
- package/fesm2022/cloudfrogger-goodui.mjs +501 -342
- package/fesm2022/cloudfrogger-goodui.mjs.map +1 -1
- package/guides/README.md +1 -1
- package/guides/components/action-bar.md +1 -1
- package/guides/components/app-header.md +27 -0
- package/guides/components/columns.md +3 -3
- package/guides/components/header-actions.md +10 -5
- package/guides/components/header-avatar.md +1 -1
- package/guides/components/header-menu.md +64 -0
- package/guides/components/header-notification.md +1 -1
- package/guides/components/header-search.md +26 -5
- package/guides/components/header-themetoggle.md +3 -3
- package/guides/components/icon.md +1 -1
- package/guides/components/main-view.md +30 -8
- package/guides/components/notifications.md +1 -1
- package/guides/components/settings.md +1 -1
- package/guides/components/sidebar.md +16 -34
- package/guides/components/submenus.md +4 -4
- package/guides/components/subnav.md +4 -3
- package/guides/components/typography.md +76 -19
- package/guides/contributing/design-to-code.md +61 -31
- package/guides/foundations/naming.md +1 -1
- package/guides/foundations/tokens.md +7 -7
- package/guides/intro.md +17 -19
- package/guides/layout/app-shell.md +37 -0
- package/guides/layout/layout-rules.md +2 -2
- package/guides/migrations/app-shell.md +28 -0
- package/guides/migrations/explicit-headings.md +20 -0
- package/guides/migrations/header-actions.md +1 -1
- package/guides/migrations/header-menu.md +16 -0
- package/homepage/src/app/examples/calendar-workspace/calendar-workspace-page.ts +2 -10
- package/homepage/src/app/examples/calendar-workspace/source-code.generated.ts +1 -1
- package/homepage/src/app/examples/case-studies/cloudhoster/billing-page.html +6 -4
- package/homepage/src/app/examples/case-studies/cloudhoster/billing-page.ts +2 -20
- package/homepage/src/app/examples/case-studies/cloudhoster/create-database-page.html +5 -5
- package/homepage/src/app/examples/case-studies/cloudhoster/create-database-page.ts +2 -20
- package/homepage/src/app/examples/case-studies/cloudhoster/database-detail-page.html +3 -1
- package/homepage/src/app/examples/case-studies/cloudhoster/database-detail-page.ts +2 -20
- package/homepage/src/app/examples/case-studies/cloudhoster/databases-page.html +7 -5
- package/homepage/src/app/examples/case-studies/cloudhoster/databases-page.ts +2 -14
- package/homepage/src/app/examples/case-studies/cloudhoster/home-page.html +4 -4
- package/homepage/src/app/examples/case-studies/cloudhoster/home-page.ts +2 -12
- package/homepage/src/app/examples/case-studies/cloudhoster/source-code.generated.ts +10 -10
- package/homepage/src/app/examples/case-studies/vpshoster/create-server-page.html +6 -6
- package/homepage/src/app/examples/case-studies/vpshoster/create-server-page.ts +2 -18
- package/homepage/src/app/examples/case-studies/vpshoster/overview-page.html +4 -4
- package/homepage/src/app/examples/case-studies/vpshoster/overview-page.ts +2 -8
- package/homepage/src/app/examples/case-studies/vpshoster/servers-page.html +4 -1
- package/homepage/src/app/examples/case-studies/vpshoster/servers-page.ts +2 -12
- package/homepage/src/app/examples/case-studies/vpshoster/source-code.generated.ts +4 -4
- package/homepage/src/app/examples/case-studies/webmailer/webmailer-page.html +4 -4
- package/homepage/src/app/examples/case-studies/webmailer/webmailer-page.ts +2 -8
- package/homepage/src/app/examples/error-pages/error-pages-example-page.html +3 -1
- package/homepage/src/app/examples/error-pages/error-pages-example-page.ts +2 -7
- package/homepage/src/app/examples/error-pages/source-code.generated.ts +2 -2
- package/homepage/src/app/examples/mail-compose/mail-compose-page.ts +2 -4
- package/homepage/src/app/examples/mail-workspace/mail-workspace-page.ts +2 -10
- package/homepage/src/app/examples/mail-workspace/source-code.generated.ts +1 -1
- package/homepage/src/app/examples/notifications/notifications-page.html +3 -1
- package/homepage/src/app/examples/notifications/notifications-page.ts +2 -8
- package/homepage/src/app/examples/notifications/source-code.generated.ts +2 -2
- package/homepage/src/app/examples/pdf-reader/pdf-reader-page.html +3 -1
- package/homepage/src/app/examples/pdf-reader/pdf-reader-page.ts +2 -7
- package/homepage/src/app/examples/pdf-reader/source-code.generated.ts +2 -2
- package/homepage/src/app/examples/user-registration/source-code.generated.ts +3 -3
- package/homepage/src/app/examples/user-registration/user-registration-example-page.html +1 -1
- package/homepage/src/app/examples/user-registration/user-registration-example-page.ts +2 -2
- package/homepage/src/app/examples/user-registration/user-registration-form.ts +2 -13
- package/homepage/src/app/examples/user-registration/user-registration-page.html +1 -1
- package/homepage/src/app/examples/user-registration/user-registration-page.ts +2 -7
- package/package.json +2 -2
- package/styles.css +1 -1
- package/types/cloudfrogger-goodui.d.ts +202 -107
- package/angular/projects/goodui/src/lib/app-layout.ts +0 -84
- package/guides/components/topbar.md +0 -89
- package/guides/layout/app-layout.md +0 -81
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, computed, contentChildren, effect, forwardRef, inject, input, signal } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, Component, Signal, computed, contentChildren, effect, forwardRef, inject, input, signal } from '@angular/core';
|
|
2
|
+
import { GoodNavigationState, GoodShellContext, GOOD_SHELL_DEFAULTS } from './shell-context';
|
|
2
3
|
import { RouterLink } from '@angular/router';
|
|
3
4
|
import { GoodIconComponent } from './icon';
|
|
4
|
-
import { GoodNavItem,
|
|
5
|
+
import { GoodNavItem, goodItemContainsRoute, goodRouteActive } from './models';
|
|
5
6
|
|
|
6
7
|
let nextPanelId = 0;
|
|
7
8
|
|
|
@@ -44,10 +45,12 @@ export class GoodSidebarSubmenuItemComponent {
|
|
|
44
45
|
readonly active = input(false);
|
|
45
46
|
readonly activeMatch = input<'exact' | 'prefix'>('prefix');
|
|
46
47
|
readonly activeRoute = input('');
|
|
48
|
+
private readonly navigation = inject(GoodNavigationState);
|
|
49
|
+
readonly routeState = computed(() => this.activeRoute() || this.navigation.activeRoute());
|
|
47
50
|
readonly disabled = computed(() => this.item()?.disabled ?? false);
|
|
48
51
|
readonly text = computed(() => this.item()?.label ?? this.label());
|
|
49
52
|
readonly link = computed(() => this.item()?.route ?? this.route());
|
|
50
|
-
readonly isActive = computed(() => this.active() || goodRouteActive(this.link(), this.
|
|
53
|
+
readonly isActive: Signal<boolean> = computed(() => this.active() || goodRouteActive(this.link(), this.routeState(), this.item()?.activeMatch ?? this.activeMatch()));
|
|
51
54
|
}
|
|
52
55
|
|
|
53
56
|
@Component({
|
|
@@ -64,9 +67,9 @@ export class GoodSidebarSubmenuItemComponent {
|
|
|
64
67
|
<div class="good-submenu-children" [id]="panelId" [hidden]="!isOpen()">
|
|
65
68
|
@for (child of children(); track child.id) {
|
|
66
69
|
@if (child.children?.length) {
|
|
67
|
-
<good-sidebar-submenu-group [item]="child" [activeRoute]="
|
|
70
|
+
<good-sidebar-submenu-group [item]="child" [activeRoute]="routeState()" [depth]="depth() + 1" />
|
|
68
71
|
} @else {
|
|
69
|
-
<good-sidebar-submenu-item [item]="child" [activeRoute]="
|
|
72
|
+
<good-sidebar-submenu-item [item]="child" [activeRoute]="routeState()" />
|
|
70
73
|
}
|
|
71
74
|
}
|
|
72
75
|
<ng-content />
|
|
@@ -82,11 +85,15 @@ export class GoodSidebarSubmenuGroupComponent {
|
|
|
82
85
|
readonly label = input('');
|
|
83
86
|
readonly expanded = input(false);
|
|
84
87
|
readonly activeRoute = input('');
|
|
88
|
+
private readonly navigation = inject(GoodNavigationState);
|
|
89
|
+
readonly routeState = computed(() => this.activeRoute() || this.navigation.activeRoute());
|
|
85
90
|
readonly depth = input(1);
|
|
86
91
|
readonly localOpen = signal<boolean | null>(null);
|
|
92
|
+
readonly projectedLinks = contentChildren(GoodSidebarSubmenuItemComponent, { descendants: true });
|
|
93
|
+
readonly projectedGroups = contentChildren(GoodSidebarSubmenuGroupComponent, { descendants: true });
|
|
87
94
|
readonly children = computed(() => this.item()?.children ?? []);
|
|
88
95
|
readonly text = computed(() => this.item()?.label ?? this.label());
|
|
89
|
-
readonly initiallyOpen = computed(() => this.expanded() || (!!this.item() && goodItemContainsRoute(this.item()!, this.
|
|
96
|
+
readonly initiallyOpen: Signal<boolean> = computed(() => this.expanded() || this.projectedLinks().some(link => link.isActive()) || this.projectedGroups().some(group => group.initiallyOpen()) || (!!this.item() && goodItemContainsRoute(this.item()!, this.routeState())));
|
|
90
97
|
readonly isOpen = computed(() => this.accordion
|
|
91
98
|
? this.accordion.isOpen(this.depth(), this.panelId, this.initiallyOpen())
|
|
92
99
|
: (this.localOpen() ?? this.initiallyOpen()));
|
|
@@ -104,7 +111,7 @@ export class GoodSidebarSubmenuGroupComponent {
|
|
|
104
111
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
105
112
|
template: `
|
|
106
113
|
@if (hasChildren()) {
|
|
107
|
-
<button type="button" class="good-sidebar-row" [class.good-is-active]="isActive()" [class.good-is-disabled]="item()?.disabled ?? false" [disabled]="item()?.disabled ?? false"
|
|
114
|
+
<button type="button" [class]="depth > 0 ? 'good-submenu-link' : 'good-sidebar-row'" [class.good-is-active]="isActive()" [class.good-is-disabled]="item()?.disabled ?? false" [disabled]="item()?.disabled ?? false"
|
|
108
115
|
[attr.aria-expanded]="isOpen()" [attr.aria-controls]="panelId" (click)="toggle()">
|
|
109
116
|
@if (iconName()) { <good-icon [name]="iconName()!" /> }
|
|
110
117
|
<span class="good-menu-label">{{ text() }}</span>
|
|
@@ -114,16 +121,17 @@ export class GoodSidebarSubmenuGroupComponent {
|
|
|
114
121
|
<div class="good-sidebar-children" [id]="panelId" [hidden]="!isOpen()">
|
|
115
122
|
@for (child of children(); track child.id) {
|
|
116
123
|
@if (child.children?.length) {
|
|
117
|
-
<good-sidebar-submenu-group [item]="child" [activeRoute]="
|
|
124
|
+
<good-sidebar-submenu-group [item]="child" [activeRoute]="routeState()" [depth]="1" />
|
|
118
125
|
} @else {
|
|
119
|
-
<good-sidebar-submenu-item [item]="child" [activeRoute]="
|
|
126
|
+
<good-sidebar-submenu-item [item]="child" [activeRoute]="routeState()" />
|
|
120
127
|
}
|
|
121
128
|
}
|
|
122
129
|
<ng-content />
|
|
123
130
|
</div>
|
|
124
131
|
} @else if (link() && !item()?.disabled) {
|
|
125
|
-
<a class="good-sidebar-row" [class.good-is-active]="isActive()" [routerLink]="link()"
|
|
132
|
+
<a [class]="depth > 0 ? 'good-submenu-link' : 'good-sidebar-row'" [class.good-is-active]="isActive()" [routerLink]="link()"
|
|
126
133
|
[attr.aria-current]="isActive() ? 'page' : null">
|
|
134
|
+
@if (depth > 0) { <span class="good-submenu-dot" aria-hidden="true"></span> }
|
|
127
135
|
@if (iconName()) { <good-icon [name]="iconName()!" /> }
|
|
128
136
|
<span class="good-menu-label">{{ text() }}</span>
|
|
129
137
|
@if (badgeText()) { <span class="good-menu-badge">{{ badgeText() }}</span> }
|
|
@@ -135,7 +143,7 @@ export class GoodSidebarSubmenuGroupComponent {
|
|
|
135
143
|
</span>
|
|
136
144
|
}
|
|
137
145
|
`,
|
|
138
|
-
host: { class: 'good-sidebar-item' },
|
|
146
|
+
host: { class: 'good-sidebar-item', '[attr.data-depth]': 'depth' },
|
|
139
147
|
})
|
|
140
148
|
export class GoodSidebarItemComponent {
|
|
141
149
|
private readonly accordion = inject(GoodSidebarAccordion, { optional: true });
|
|
@@ -149,22 +157,28 @@ export class GoodSidebarItemComponent {
|
|
|
149
157
|
readonly activeMatch = input<'exact' | 'prefix'>('prefix');
|
|
150
158
|
readonly expanded = input(false);
|
|
151
159
|
readonly activeRoute = input('');
|
|
152
|
-
readonly
|
|
160
|
+
private readonly navigation = inject(GoodNavigationState);
|
|
161
|
+
readonly routeState = computed(() => this.activeRoute() || this.navigation.activeRoute());
|
|
162
|
+
private readonly parentItem = inject(GoodSidebarItemComponent, { optional: true, skipSelf: true });
|
|
163
|
+
readonly depth: number = (this.parentItem?.depth ?? -1) + 1;
|
|
164
|
+
readonly projectedItems = contentChildren(GoodSidebarItemComponent, { descendants: true });
|
|
165
|
+
readonly projectedGroups = contentChildren(GoodSidebarSubmenuGroupComponent, { descendants: true });
|
|
166
|
+
readonly projectedLinks = contentChildren(GoodSidebarSubmenuItemComponent, { descendants: true });
|
|
153
167
|
readonly children = computed(() => this.item()?.children ?? []);
|
|
154
|
-
readonly hasChildren = computed(() => this.children().length > 0 || this.projectedGroups().length > 0);
|
|
168
|
+
readonly hasChildren = computed(() => this.children().length > 0 || this.projectedGroups().length > 0 || this.projectedItems().length > 0 || this.projectedLinks().length > 0);
|
|
155
169
|
readonly text = computed(() => this.item()?.label ?? this.label());
|
|
156
170
|
readonly iconName = computed(() => this.item()?.icon ?? this.icon());
|
|
157
171
|
readonly link = computed(() => this.item()?.route ?? this.route());
|
|
158
172
|
readonly badgeText = computed(() => this.item()?.badge ?? this.badge());
|
|
159
|
-
readonly isActive = computed(() => this.active() || goodRouteActive(this.link(), this.
|
|
160
|
-
readonly initiallyOpen = computed(() => this.expanded() || (!!this.item() && goodItemContainsRoute(this.item()!, this.
|
|
173
|
+
readonly isActive: Signal<boolean> = computed(() => this.active() || goodRouteActive(this.link(), this.routeState(), this.item()?.activeMatch ?? this.activeMatch()) || this.projectedItems().some(item => item.isActive()) || this.projectedGroups().some(group => group.initiallyOpen()) || this.projectedLinks().some(link => link.isActive()));
|
|
174
|
+
readonly initiallyOpen: Signal<boolean> = computed(() => this.expanded() || this.isActive() || (!!this.item() && goodItemContainsRoute(this.item()!, this.routeState())));
|
|
161
175
|
readonly localOpen = signal<boolean | null>(null);
|
|
162
176
|
readonly isOpen = computed(() => this.accordion
|
|
163
|
-
? this.accordion.isOpen(
|
|
177
|
+
? this.accordion.isOpen(this.depth, this.panelId, this.initiallyOpen())
|
|
164
178
|
: (this.localOpen() ?? this.initiallyOpen()));
|
|
165
179
|
|
|
166
180
|
toggle(): void {
|
|
167
|
-
if (this.accordion) this.accordion.toggle(
|
|
181
|
+
if (this.accordion) this.accordion.toggle(this.depth, this.panelId, this.isOpen());
|
|
168
182
|
else this.localOpen.set(!this.isOpen());
|
|
169
183
|
}
|
|
170
184
|
}
|
|
@@ -179,7 +193,7 @@ export class GoodSidebarItemComponent {
|
|
|
179
193
|
@if (heading()) { <h2 class="good-sidebar-heading">{{ heading() }}</h2> }
|
|
180
194
|
<div class="good-sidebar-items">
|
|
181
195
|
@for (item of items(); track item.id) {
|
|
182
|
-
<good-sidebar-item [item]="item" [activeRoute]="
|
|
196
|
+
<good-sidebar-item [item]="item" [activeRoute]="routeState()" />
|
|
183
197
|
}
|
|
184
198
|
<ng-content />
|
|
185
199
|
</div>
|
|
@@ -191,42 +205,46 @@ export class GoodSidebarMenuContainerComponent {
|
|
|
191
205
|
readonly heading = input('');
|
|
192
206
|
readonly items = input<readonly GoodNavItem[]>([]);
|
|
193
207
|
readonly activeRoute = input('');
|
|
208
|
+
private readonly navigation = inject(GoodNavigationState);
|
|
209
|
+
readonly routeState = computed(() => this.activeRoute() || this.navigation.activeRoute());
|
|
194
210
|
|
|
195
211
|
constructor() {
|
|
196
212
|
effect(() => {
|
|
197
|
-
this.
|
|
213
|
+
this.routeState();
|
|
198
214
|
this.accordion.reset();
|
|
199
215
|
});
|
|
200
216
|
}
|
|
201
217
|
}
|
|
202
218
|
|
|
203
219
|
@Component({
|
|
204
|
-
selector: 'good-sidebar
|
|
205
|
-
|
|
206
|
-
imports: [GoodSidebarMenuContainerComponent],
|
|
220
|
+
selector: 'good-sidebar', standalone: true,
|
|
221
|
+
providers: [GoodSidebarAccordion],
|
|
207
222
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
208
223
|
template: `
|
|
209
|
-
<div class="good-sidebar-brand" [class.good-has-dark-logo]="!!
|
|
210
|
-
@if (
|
|
211
|
-
<img class="good-brand-logo good-brand-logo-light" [src]="
|
|
212
|
-
@if (
|
|
224
|
+
<div class="good-sidebar-brand" [class.good-has-dark-logo]="!!branding().brandLogoDarkSrc">
|
|
225
|
+
@if (branding().brandLogoSrc) {
|
|
226
|
+
<img class="good-brand-logo good-brand-logo-light" [src]="branding().brandLogoSrc" [alt]="branding().brand" />
|
|
227
|
+
@if (branding().brandLogoDarkSrc) { <img class="good-brand-logo good-brand-logo-dark" [src]="branding().brandLogoDarkSrc" [alt]="branding().brand" /> }
|
|
213
228
|
} @else {
|
|
214
|
-
<span class="good-brand-mark" aria-hidden="true"></span><span class="good-brand-name">{{
|
|
229
|
+
<span class="good-brand-mark" aria-hidden="true"></span><span class="good-brand-name">{{ branding().brand }}</span>
|
|
215
230
|
}
|
|
216
231
|
</div>
|
|
217
|
-
<nav class="good-sidebar-scroll" aria-label="
|
|
218
|
-
@for (section of sections(); track section.id) {
|
|
219
|
-
<good-sidebar-menu-container [heading]="section.heading ?? ''" [items]="section.items" [activeRoute]="activeRoute()" />
|
|
220
|
-
}
|
|
221
|
-
<ng-content />
|
|
222
|
-
</nav>
|
|
232
|
+
<nav class="good-sidebar-scroll" [attr.aria-label]="label()"><ng-content /></nav>
|
|
223
233
|
`,
|
|
224
|
-
host: { class: 'good-sidebar
|
|
234
|
+
host: { class: 'good-sidebar' },
|
|
225
235
|
})
|
|
226
|
-
export class
|
|
227
|
-
readonly
|
|
228
|
-
readonly
|
|
229
|
-
readonly
|
|
230
|
-
readonly
|
|
231
|
-
readonly
|
|
236
|
+
export class GoodSidebarComponent {
|
|
237
|
+
private readonly shell = inject(GoodShellContext, { optional: true });
|
|
238
|
+
private readonly navigation = inject(GoodNavigationState);
|
|
239
|
+
private readonly accordion = inject(GoodSidebarAccordion);
|
|
240
|
+
readonly brand = input<string>();
|
|
241
|
+
readonly brandLogoSrc = input<string>();
|
|
242
|
+
readonly brandLogoDarkSrc = input<string>();
|
|
243
|
+
readonly label = input('Primary navigation');
|
|
244
|
+
readonly branding = computed(() => ({
|
|
245
|
+
brand: this.brand() ?? this.shell?.options().brand ?? GOOD_SHELL_DEFAULTS.brand,
|
|
246
|
+
brandLogoSrc: this.brandLogoSrc() ?? this.shell?.options().brandLogoSrc ?? '',
|
|
247
|
+
brandLogoDarkSrc: this.brandLogoDarkSrc() ?? this.shell?.options().brandLogoDarkSrc ?? '',
|
|
248
|
+
}));
|
|
249
|
+
constructor() { effect(() => { this.navigation.activeRoute(); this.accordion.reset(); }); }
|
|
232
250
|
}
|
|
@@ -8,8 +8,6 @@ import { GoodImagePreviewComponent } from './image-preview';
|
|
|
8
8
|
import { GOOD_COMPOSITE_REQUIRED_CONTROL } from './required-control';
|
|
9
9
|
|
|
10
10
|
export type GoodEyebrowAppearance = 'brand' | 'mono';
|
|
11
|
-
export type GoodHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
12
|
-
export type GoodSubheadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
13
11
|
export type GoodSeparatorVariant = 'dots' | 'line';
|
|
14
12
|
export type GoodImageAlign = 'center' | 'left' | 'right';
|
|
15
13
|
export type GoodColumnBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
@@ -17,7 +15,7 @@ export type GoodColumnBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
|
17
15
|
@Component({
|
|
18
16
|
selector: 'good-heading-group', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
17
|
host: { class: 'good-heading-group' },
|
|
20
|
-
template: `<ng-content select="good-eyebrow" /><div class="good-heading-group-text"><ng-content select="good-heading" /><ng-content select="good-summary" /></div>`,
|
|
18
|
+
template: `<ng-content select="good-eyebrow" /><div class="good-heading-group-text"><ng-content select="good-heading-1, good-heading-2, good-heading-3, good-heading-4, good-heading-5, good-heading-6, good-heading-7" /><ng-content select="good-summary" /></div>`,
|
|
21
19
|
})
|
|
22
20
|
export class GoodHeadingGroupComponent {}
|
|
23
21
|
|
|
@@ -31,24 +29,53 @@ export class GoodEyebrowComponent {
|
|
|
31
29
|
}
|
|
32
30
|
|
|
33
31
|
@Component({
|
|
34
|
-
selector: 'good-heading', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
template: `
|
|
38
|
-
<ng-template #content><ng-content /></ng-template>
|
|
39
|
-
@switch (level()) {
|
|
40
|
-
@case (2) { <h2><ng-container [ngTemplateOutlet]="content" /></h2> }
|
|
41
|
-
@case (3) { <h3><ng-container [ngTemplateOutlet]="content" /></h3> }
|
|
42
|
-
@case (4) { <h4><ng-container [ngTemplateOutlet]="content" /></h4> }
|
|
43
|
-
@case (5) { <h5><ng-container [ngTemplateOutlet]="content" /></h5> }
|
|
44
|
-
@case (6) { <h6><ng-container [ngTemplateOutlet]="content" /></h6> }
|
|
45
|
-
@default { <h1><ng-container [ngTemplateOutlet]="content" /></h1> }
|
|
46
|
-
}
|
|
47
|
-
`,
|
|
32
|
+
selector: 'good-heading-1', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
33
|
+
host: { class: 'good-heading', 'data-level': '1', 'data-heading-style': '1' },
|
|
34
|
+
template: `<h1><ng-content /></h1>`,
|
|
48
35
|
})
|
|
49
|
-
export class
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
export class GoodHeading1Component {}
|
|
37
|
+
|
|
38
|
+
@Component({
|
|
39
|
+
selector: 'good-heading-2', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
40
|
+
host: { class: 'good-heading', 'data-level': '2', 'data-heading-style': '2' },
|
|
41
|
+
template: `<h2><ng-content /></h2>`,
|
|
42
|
+
})
|
|
43
|
+
export class GoodHeading2Component {}
|
|
44
|
+
|
|
45
|
+
@Component({
|
|
46
|
+
selector: 'good-heading-3', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
47
|
+
host: { class: 'good-subheading', 'data-level': '3', 'data-heading-style': '3' },
|
|
48
|
+
template: `<h3><ng-content /></h3>`,
|
|
49
|
+
})
|
|
50
|
+
export class GoodHeading3Component {}
|
|
51
|
+
|
|
52
|
+
@Component({
|
|
53
|
+
selector: 'good-heading-4', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
54
|
+
host: { class: 'good-subheading', 'data-level': '4', 'data-heading-style': '4' },
|
|
55
|
+
template: `<h4><ng-content /></h4>`,
|
|
56
|
+
})
|
|
57
|
+
export class GoodHeading4Component {}
|
|
58
|
+
|
|
59
|
+
@Component({
|
|
60
|
+
selector: 'good-heading-5', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
61
|
+
host: { class: 'good-subheading', 'data-level': '5', 'data-heading-style': '5' },
|
|
62
|
+
template: `<h5><ng-content /></h5>`,
|
|
63
|
+
})
|
|
64
|
+
export class GoodHeading5Component {}
|
|
65
|
+
|
|
66
|
+
@Component({
|
|
67
|
+
selector: 'good-heading-6', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
68
|
+
host: { class: 'good-subheading', 'data-level': '6', 'data-heading-style': '6' },
|
|
69
|
+
template: `<h6><ng-content /></h6>`,
|
|
70
|
+
})
|
|
71
|
+
export class GoodHeading6Component {}
|
|
72
|
+
|
|
73
|
+
@Component({
|
|
74
|
+
selector: 'good-heading-7', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
75
|
+
host: { class: 'good-subheading', 'data-level': '7', 'data-heading-style': '7', role: 'heading', 'aria-level': '7' },
|
|
76
|
+
template: `<ng-content />`,
|
|
77
|
+
})
|
|
78
|
+
export class GoodHeading7Component {}
|
|
52
79
|
|
|
53
80
|
@Component({
|
|
54
81
|
selector: 'good-summary', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -58,9 +85,11 @@ export class GoodSummaryComponent {}
|
|
|
58
85
|
|
|
59
86
|
@Component({
|
|
60
87
|
selector: 'good-section', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
61
|
-
host: { class: 'good-section' }, template: `<section><ng-content /></section>`,
|
|
88
|
+
host: { class: 'good-section', '[attr.data-spacing]': 'spacing()' }, template: `<section><ng-content /></section>`,
|
|
62
89
|
})
|
|
63
|
-
export class GoodSectionComponent {
|
|
90
|
+
export class GoodSectionComponent {
|
|
91
|
+
readonly spacing = input<'default' | 'content'>('default');
|
|
92
|
+
}
|
|
64
93
|
|
|
65
94
|
@Component({
|
|
66
95
|
selector: 'good-prose', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
@@ -119,25 +148,6 @@ export class GoodColumnComponent {
|
|
|
119
148
|
})
|
|
120
149
|
export class GoodParagraphComponent {}
|
|
121
150
|
|
|
122
|
-
@Component({
|
|
123
|
-
selector: 'good-subheading', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
124
|
-
imports: [NgTemplateOutlet],
|
|
125
|
-
host: { class: 'good-subheading' },
|
|
126
|
-
template: `
|
|
127
|
-
<ng-template #content><ng-content /></ng-template>
|
|
128
|
-
@switch (level()) {
|
|
129
|
-
@case (3) { <h3><ng-container [ngTemplateOutlet]="content" /></h3> }
|
|
130
|
-
@case (4) { <h4><ng-container [ngTemplateOutlet]="content" /></h4> }
|
|
131
|
-
@case (5) { <h5><ng-container [ngTemplateOutlet]="content" /></h5> }
|
|
132
|
-
@case (6) { <h6><ng-container [ngTemplateOutlet]="content" /></h6> }
|
|
133
|
-
@default { <h2><ng-container [ngTemplateOutlet]="content" /></h2> }
|
|
134
|
-
}
|
|
135
|
-
`,
|
|
136
|
-
})
|
|
137
|
-
export class GoodSubheadingComponent {
|
|
138
|
-
readonly level = input<GoodSubheadingLevel>(2);
|
|
139
|
-
}
|
|
140
|
-
|
|
141
151
|
@Component({
|
|
142
152
|
selector: 'good-citation', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
143
153
|
host: { class: 'good-citation' },
|
|
@@ -4,7 +4,7 @@ export * from './lib/provide-goodui';
|
|
|
4
4
|
export * from './lib/theme';
|
|
5
5
|
export * from './lib/icon';
|
|
6
6
|
export * from './lib/sidebar';
|
|
7
|
-
export * from './lib/
|
|
7
|
+
export * from './lib/header';
|
|
8
8
|
export * from './lib/actions';
|
|
9
9
|
export * from './lib/main-view';
|
|
10
10
|
export * from './lib/typography';
|
|
@@ -71,4 +71,4 @@ export * from './lib/status-icon';
|
|
|
71
71
|
export * from './lib/expandable';
|
|
72
72
|
export * from '@lucide/angular';
|
|
73
73
|
export * from './lib/action-menu';
|
|
74
|
-
export * from './lib/app-
|
|
74
|
+
export * from './lib/app-shell';
|