@cloudfrogger/goodui 0.0.64 → 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} +77 -83
- package/ai/catalog/components/{good-app-layout.json → good-app-shell.json} +32 -68
- package/ai/catalog/components/good-avatar-menu-item.json +2 -2
- 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-main-menu.json → good-header-actions.json} +19 -10
- package/ai/catalog/components/{good-avatar-menu.json → good-header-avatar.json} +5 -5
- 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-notifications.json → good-header-notification.json} +5 -5
- package/ai/catalog/components/{good-search.json → good-header-search.json} +16 -7
- package/ai/catalog/components/{good-topbar-submenu.json → good-header-submenu.json} +12 -12
- package/ai/catalog/components/{good-theme-toggle.json → good-header-themetoggle.json} +8 -6
- 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-settings.json +1 -1
- 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 +231 -171
- 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 +47 -23
- package/angular/projects/goodui/src/lib/app-shell.ts +109 -0
- package/angular/projects/goodui/src/lib/{topbar.ts → header.ts} +98 -72
- 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 +99 -65
- package/angular/projects/goodui/src/tokens.generated.css +43 -6
- package/design/app-shell-contract.json +118 -0
- package/design/component-map.json +171 -82
- 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 +51 -39
- package/fesm2022/cloudfrogger-goodui.mjs +541 -383
- package/fesm2022/cloudfrogger-goodui.mjs.map +1 -1
- package/guides/README.md +2 -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 +34 -0
- package/guides/components/{avatar-menu.md → header-avatar.md} +5 -5
- package/guides/components/header-menu.md +64 -0
- package/guides/components/header-notification.md +13 -0
- package/guides/components/header-search.md +72 -0
- package/guides/components/{theme-toggle.md → header-themetoggle.md} +6 -6
- package/guides/components/icon.md +1 -1
- package/guides/components/main-view.md +30 -8
- package/guides/components/notifications.md +2 -2
- package/guides/components/settings.md +2 -2
- 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 +62 -32
- package/guides/foundations/naming.md +1 -1
- package/guides/foundations/tokens.md +9 -9
- package/guides/intro.md +17 -19
- package/guides/layout/app-shell.md +37 -0
- package/guides/layout/layout-rules.md +3 -3
- package/guides/migrations/app-shell.md +28 -0
- package/guides/migrations/explicit-headings.md +20 -0
- package/guides/migrations/header-actions.md +17 -0
- 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 +301 -207
- package/angular/projects/goodui/src/lib/app-layout.ts +0 -84
- package/guides/components/main-menu.md +0 -23
- package/guides/components/search.md +0 -51
- package/guides/components/topbar.md +0 -89
- package/guides/layout/app-layout.md +0 -81
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, ElementRef, inject, input, signal, viewChild } from '@angular/core';
|
|
2
|
-
import { NavigationEnd, Router } from '@angular/router';
|
|
3
|
-
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
4
|
-
import { filter } from 'rxjs';
|
|
5
|
-
import { GoodMainMenuComponent } from './actions';
|
|
6
|
-
import { GoodSidebarContainerComponent } from './sidebar';
|
|
7
|
-
import { GoodTopbarComponent, GoodTopbarMenuContainerComponent, GoodTopbarMobileMenuMode } from './topbar';
|
|
8
|
-
import { GoodMainViewComponent } from './main-view';
|
|
9
|
-
import { GoodMenuAction, GoodNotification, GoodSearchItem, GoodSidebarSection, GoodTopbarItem, GoodUser } from './models';
|
|
10
|
-
import { GoodNotificationHostComponent } from './notification-host';
|
|
11
|
-
|
|
12
|
-
@Component({
|
|
13
|
-
selector: 'good-app-layout',
|
|
14
|
-
standalone: true,
|
|
15
|
-
imports: [GoodMainMenuComponent, GoodSidebarContainerComponent, GoodTopbarComponent, GoodTopbarMenuContainerComponent, GoodMainViewComponent, GoodNotificationHostComponent],
|
|
16
|
-
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
17
|
-
template: `
|
|
18
|
-
<good-sidebar-container class="good-desktop-sidebar" [brand]="brand()" [brandLogoSrc]="brandLogoSrc()" [brandLogoDarkSrc]="brandLogoDarkSrc()" [sections]="sidebarSections()" [activeRoute]="activeRoute()" />
|
|
19
|
-
<div class="good-app-main">
|
|
20
|
-
<good-topbar [brand]="brand()" [brandLogoSrc]="brandLogoSrc()" [brandLogoDarkSrc]="brandLogoDarkSrc()" [brandMarkSrc]="brandMarkSrc()" [brandMarkDarkSrc]="brandMarkDarkSrc()" [showBrandIcon]="showBrandIcon()" [showMobileBrand]="showMobileBrand()" [items]="topbarItems()" [activeRoute]="activeRoute()" [mobileMenuMode]="mobileTopbarMenuMode()"
|
|
21
|
-
[user]="user()" [notifications]="notifications()" [searchItems]="searchItems()" [settingsActions]="settingsActions()" [avatarActions]="avatarActions()" [showThemeToggle]="showThemeToggle()" [showSettings]="showSettings()"
|
|
22
|
-
(menuToggle)="openDrawer()">
|
|
23
|
-
<ng-content select="good-main-menu" ngProjectAs="good-main-menu">
|
|
24
|
-
<good-main-menu [user]="user()" [notifications]="notifications()" [searchItems]="searchItems()" [settingsActions]="settingsActions()" [avatarActions]="avatarActions()" [showThemeToggle]="showThemeToggle()" [showSettings]="showSettings()" />
|
|
25
|
-
</ng-content>
|
|
26
|
-
</good-topbar>
|
|
27
|
-
<div class="good-app-page"><ng-content /></div>
|
|
28
|
-
</div>
|
|
29
|
-
<dialog #drawer class="good-sidebar-drawer" aria-label="Navigation" (click)="onBackdropClick($event)" (close)="onDrawerClose()">
|
|
30
|
-
<good-sidebar-container [brand]="brand()" [brandLogoSrc]="brandLogoSrc()" [brandLogoDarkSrc]="brandLogoDarkSrc()" [sections]="sidebarSections()" [activeRoute]="activeRoute()" />
|
|
31
|
-
@if (topbarItems().length && mobileTopbarMenuMode() === 'hidden') {
|
|
32
|
-
<nav class="good-drawer-topbar-nav" aria-label="More navigation">
|
|
33
|
-
<strong>Menu</strong><good-topbar-menu-container [items]="topbarItems()" [activeRoute]="activeRoute()" />
|
|
34
|
-
</nav>
|
|
35
|
-
}
|
|
36
|
-
<button type="button" class="good-drawer-close" aria-label="Close sidebar" (click)="closeDrawer()">Close</button>
|
|
37
|
-
</dialog>
|
|
38
|
-
<good-notification-host />
|
|
39
|
-
`,
|
|
40
|
-
host: { class: 'good-app-layout' },
|
|
41
|
-
})
|
|
42
|
-
export class GoodAppLayoutComponent {
|
|
43
|
-
private readonly router = inject(Router);
|
|
44
|
-
private readonly drawer = viewChild.required<ElementRef<HTMLDialogElement>>('drawer');
|
|
45
|
-
private returnFocus: HTMLElement | null = null;
|
|
46
|
-
|
|
47
|
-
readonly brand = input('GOODUI');
|
|
48
|
-
readonly brandLogoSrc = input('');
|
|
49
|
-
readonly brandLogoDarkSrc = input('');
|
|
50
|
-
readonly brandMarkSrc = input('');
|
|
51
|
-
readonly brandMarkDarkSrc = input('');
|
|
52
|
-
readonly showBrandIcon = input(false);
|
|
53
|
-
readonly showMobileBrand = input(true);
|
|
54
|
-
readonly sidebarSections = input<readonly GoodSidebarSection[]>([]);
|
|
55
|
-
readonly topbarItems = input<readonly GoodTopbarItem[]>([]);
|
|
56
|
-
readonly mobileTopbarMenuMode = input<GoodTopbarMobileMenuMode>('hidden');
|
|
57
|
-
readonly user = input<GoodUser | null>(null);
|
|
58
|
-
readonly notifications = input<readonly GoodNotification[]>([]);
|
|
59
|
-
readonly searchItems = input<readonly GoodSearchItem[]>([]);
|
|
60
|
-
readonly settingsActions = input<readonly GoodMenuAction[]>([]);
|
|
61
|
-
readonly showThemeToggle = input(true);
|
|
62
|
-
readonly showSettings = input(false);
|
|
63
|
-
readonly avatarActions = input<readonly GoodMenuAction[]>([]);
|
|
64
|
-
readonly activeRoute = signal('/');
|
|
65
|
-
|
|
66
|
-
constructor() {
|
|
67
|
-
this.activeRoute.set(this.router.url.split(/[?#]/)[0] || '/');
|
|
68
|
-
this.router.events.pipe(filter((event): event is NavigationEnd => event instanceof NavigationEnd), takeUntilDestroyed())
|
|
69
|
-
.subscribe(event => {
|
|
70
|
-
this.activeRoute.set(event.urlAfterRedirects.split(/[?#]/)[0] || '/');
|
|
71
|
-
if (this.drawer()?.nativeElement.open) this.closeDrawer();
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
openDrawer(): void {
|
|
76
|
-
this.returnFocus = document.activeElement as HTMLElement;
|
|
77
|
-
this.drawer().nativeElement.showModal();
|
|
78
|
-
}
|
|
79
|
-
closeDrawer(): void { this.drawer().nativeElement.close(); }
|
|
80
|
-
onBackdropClick(event: MouseEvent): void {
|
|
81
|
-
if (event.target === this.drawer().nativeElement) this.closeDrawer();
|
|
82
|
-
}
|
|
83
|
-
onDrawerClose(): void { this.returnFocus?.focus(); }
|
|
84
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
# Main menu
|
|
2
|
-
|
|
3
|
-
`good-main-menu` is the topbar action container. It owns alignment and responsive gaps. Applications compose its children in any order without adding layout CSS.
|
|
4
|
-
|
|
5
|
-
```html
|
|
6
|
-
<good-app-layout [sidebarSections]="navigation">
|
|
7
|
-
<good-main-menu>
|
|
8
|
-
<good-search [items]="searchItems" />
|
|
9
|
-
<good-notifications />
|
|
10
|
-
<good-theme-toggle />
|
|
11
|
-
<good-avatar-menu [user]="currentUser" [actions]="accountActions" />
|
|
12
|
-
</good-main-menu>
|
|
13
|
-
<router-outlet />
|
|
14
|
-
</good-app-layout>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Import `GoodMainMenuComponent` and each child component in the standalone component that declares this template. The same composition works directly inside `good-topbar`. Remove or reorder child tags to choose the available actions and their order. Settings is available as `good-settings`. Projected content replaces all generated actions; configure each child directly. Shell inputs configure only the generated default menu.
|
|
18
|
-
|
|
19
|
-
With no projected content, the existing default composition remains Search, Notifications, Theme toggle, and Avatar menu. Its inputs remain `user`, `notifications`, `searchItems`, `settingsActions`, `avatarActions`, `showSearch`, `showNotifications`, `showThemeToggle`, `showSettings`, and `showAvatar`. All visibility inputs default to true except `showSettings`, which defaults to false. AppLayout and Topbar forward `showThemeToggle` and `showSettings`.
|
|
20
|
-
|
|
21
|
-
Each action is documented separately: [Search](search.md), [Notifications](notifications.md), [Theme toggle](theme-toggle.md), [Avatar menu](avatar-menu.md), and [Settings](settings.md). Each owns its 36 × 36 px hit area and interaction. MainMenu owns spacing; actions have no external margins. Use Angular conditional blocks inside the container to control visibility. An explicitly supplied conditional block owns the content even when no actions are currently visible.
|
|
22
|
-
|
|
23
|
-
Penpot `goodui.main-menu.default` retains its stable ID and linked Search, Notifications, ThemeToggle, and AvatarMenu instances. This specimen represents the default composition, rather than a mandatory action list.
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
# Search
|
|
2
|
-
|
|
3
|
-
`good-search` opens a modal navigation search from a round magnifier action. It filters application-supplied link labels and descriptions locally, with automatic input focus, keyboard navigation, and an empty state. The homepage documents it at `/components/search` with a working preview and copyable examples.
|
|
4
|
-
|
|
5
|
-
## Standalone usage
|
|
6
|
-
|
|
7
|
-
Import `GoodSearchComponent` and `GoodSearchItem` from `@cloudfrogger/goodui`. Configure Angular Router through `provideRouter(routes)` in the consuming app.
|
|
8
|
-
|
|
9
|
-
```ts
|
|
10
|
-
readonly items: readonly GoodSearchItem[] = [
|
|
11
|
-
{ id: 'buttons', label: 'Buttons', description: 'Actions and icons', route: '/components/buttons' },
|
|
12
|
-
{ id: 'tables', label: 'Tables', description: 'Records and pagination', route: '/components/tables' },
|
|
13
|
-
];
|
|
14
|
-
```
|
|
15
|
-
|
|
16
|
-
```html
|
|
17
|
-
<good-search [items]="items" />
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## API
|
|
21
|
-
|
|
22
|
-
`items` is the sole component input. It accepts `readonly GoodSearchItem[]` and defaults to `[]`.
|
|
23
|
-
|
|
24
|
-
| Field | Required | Meaning |
|
|
25
|
-
| --- | --- | --- |
|
|
26
|
-
| `id` | Yes | Unique, stable result key |
|
|
27
|
-
| `label` | Yes | Visible result title, searched locally |
|
|
28
|
-
| `description` | No | Supporting result text, searched locally |
|
|
29
|
-
| `route` | Yes | Angular Router destination |
|
|
30
|
-
|
|
31
|
-
`open()` opens the native dialog and focuses its search input. `close()` closes the dialog. The `query` signal holds the search field’s current text. The `results` signal computes the matching supplied records. Matching is case-insensitive and uses a substring of the combined label and description. An empty query includes every item. An unmatched query displays **No results**.
|
|
32
|
-
|
|
33
|
-
## Shell integration
|
|
34
|
-
|
|
35
|
-
`good-app-layout`, `good-topbar`, and `good-main-menu` accept the navigation records through `searchItems`.
|
|
36
|
-
|
|
37
|
-
```html
|
|
38
|
-
<good-app-layout [searchItems]="items">
|
|
39
|
-
<router-outlet />
|
|
40
|
-
</good-app-layout>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
MainMenu shows the action by default. A standalone MainMenu can set `[showSearch]="false"` to hide it.
|
|
44
|
-
|
|
45
|
-
## Keyboard and navigation
|
|
46
|
-
|
|
47
|
-
The native modal dialog contains focus. Tab and Shift+Tab move between the input, results, and close action. Enter activates a focused result. Escape or Close dismisses the dialog and restores focus to the trigger. Selecting a result closes the dialog and follows its `route` through Angular Router.
|
|
48
|
-
|
|
49
|
-
## Search fields within a page
|
|
50
|
-
|
|
51
|
-
Use `good-input type="search"` for a continuously visible field above a list, table, or card grid. Bind its value to application filtering. See [Input](input.md). GoodUI Table and Select also document their integrated search behavior in their respective guides.
|
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
# Topbar
|
|
2
|
-
|
|
3
|
-
**Design IDs:** `goodui.topbar`, `goodui.brand-icon`, `goodui.topbar-menu-container`, `goodui.topbar-menu-item`, `goodui.topbar-dropdown-menu`, `goodui.topbar-dropdown-item`, `goodui.topbar-submenu`.
|
|
4
|
-
|
|
5
|
-
The optional [Theme toggle](./theme-toggle.md) in MainMenu changes appearance with one click and no submenu.
|
|
6
|
-
|
|
7
|
-
The topbar places an optional brand icon and navigation on the left, with [MainMenu](./main-menu.md) on the right. It is 70 px tall on desktop with 30 px horizontal padding. On mobile, the drawer trigger comes first, followed by optional branding. The default `hidden` mode places navigation in the AppLayout drawer; `popup` mode replaces the horizontal row with a topbar icon that opens a separate navigation popup. Penpot contains default, `with-brand`, mobile, mobile icon, and mobile popup states.
|
|
8
|
-
|
|
9
|
-
On mobile, `brandMarkSrc` and optional `brandMarkDarkSrc` display the application symbol after the drawer trigger at 30 × 28 px; `brand` supplies its accessible name. The optional desktop BrandIcon uses the same mark URLs. Existing consumers that only pass `brandLogoSrc` and optional `brandLogoDarkSrc` continue to see the wordmark in the mobile topbar; with no image URL, it displays the brand text. Branding is shown by default. Set `[showMobileBrand]="false"` on `good-app-layout` or a standalone `good-topbar` to leave only the drawer trigger on the left. This does not hide branding in the sidebar or drawer. `good-app-layout` forwards the wordmark and symbol inputs from one place to the topbar and both sidebar presentations.
|
|
10
|
-
|
|
11
|
-
```html
|
|
12
|
-
<good-app-layout [showMobileBrand]="false" [sidebarSections]="navigation">
|
|
13
|
-
<router-outlet />
|
|
14
|
-
</good-app-layout>
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
## Nested menus
|
|
18
|
-
|
|
19
|
-
The Help menu opens a 220 px panel beneath the topbar. It has five 34 px rows and a divider before “Contact Us.” “Support Forum” is a parent row with a chevron. When open, it uses a neutral surface and reveals a 218 × 124 px panel 4 px to its right. Panels have a 6 px radius, subtle border, and semantic light/dark colors.
|
|
20
|
-
|
|
21
|
-
```text
|
|
22
|
-
TopbarMenuContainer
|
|
23
|
-
└─ TopbarMenuItem “Help”
|
|
24
|
-
└─ TopbarDropdownMenu
|
|
25
|
-
├─ TopbarDropdownItem “Getting Started” (link)
|
|
26
|
-
├─ TopbarDropdownItem “Support Forum” (parent)
|
|
27
|
-
│ └─ TopbarSubmenu
|
|
28
|
-
│ ├─ TopbarDropdownItem “All Questions” (link)
|
|
29
|
-
│ ├─ TopbarDropdownItem “Popular Questions” (link)
|
|
30
|
-
│ └─ TopbarDropdownItem “Ask Question” (link)
|
|
31
|
-
├─ TopbarDropdownItem “Licenses & FAQ” (link)
|
|
32
|
-
├─ TopbarDropdownItem “Documentation” (link)
|
|
33
|
-
└─ TopbarDropdownItem “Contact Us” (link after divider)
|
|
34
|
-
```
|
|
35
|
-
|
|
36
|
-
These blocks are Penpot library components with nested instances. Their states include `topbar-menu-item.default/open`, `topbar-dropdown-item.link/parent/open`, `topbar-dropdown-menu.default/nested-open`, `topbar.help-open/help-submenu-open`, and `app-layout.help-submenu-open`. Parent items expand; only leaves navigate. Near the right viewport edge, the submenu opens to the left. On mobile, it expands vertically in the drawer or topbar popup, according to the selected mode.
|
|
37
|
-
|
|
38
|
-
### Data API
|
|
39
|
-
|
|
40
|
-
The library renders `GoodTopbarItem.children` recursively. `icon` adds an optional icon; `separatorBefore` adds a divider above a row.
|
|
41
|
-
|
|
42
|
-
```ts
|
|
43
|
-
import type { GoodTopbarItem } from '@cloudfrogger/goodui';
|
|
44
|
-
|
|
45
|
-
const help: GoodTopbarItem = {
|
|
46
|
-
id: 'help', label: 'Help', children: [
|
|
47
|
-
{ id: 'getting-started', label: 'Getting Started', icon: 'calendar', route: '/help/getting-started' },
|
|
48
|
-
{ id: 'forum', label: 'Support Forum', icon: 'question', children: [
|
|
49
|
-
{ id: 'all', label: 'All Questions', icon: 'book', route: '/help/forum/all' },
|
|
50
|
-
{ id: 'popular', label: 'Popular Questions', icon: 'star', route: '/help/forum/popular' },
|
|
51
|
-
] },
|
|
52
|
-
{ id: 'contact', label: 'Contact Us', icon: 'contact', route: '/help/contact', separatorBefore: true },
|
|
53
|
-
],
|
|
54
|
-
};
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
Parent items are buttons with `aria-expanded` and `aria-controls`; leaves are links. Desktop supports hover, click, and keyboard focus. Escape closes the deepest open level first and returns focus to its trigger. Clicking outside closes the chain. Mobile navigation stacks levels and scrolls when needed.
|
|
58
|
-
|
|
59
|
-
## Mobile menu mode
|
|
60
|
-
|
|
61
|
-
`good-app-layout` accepts `mobileTopbarMenuMode="hidden" | "popup"` and forwards it to `good-topbar` as `mobileMenuMode`. The default is `hidden`, which keeps topbar navigation in the sidebar drawer. In `popup` mode, AppLayout omits that drawer copy, and the topbar shows an icon button with an accessible label, `aria-expanded`, and `aria-controls`. The popup closes on Escape, outside pointer input, navigation, and desktop resize. Escape closes nested levels before the popup and restores focus to the relevant trigger.
|
|
62
|
-
|
|
63
|
-
```html
|
|
64
|
-
<good-app-layout [topbarItems]="navigation" mobileTopbarMenuMode="popup">
|
|
65
|
-
<router-outlet />
|
|
66
|
-
</good-app-layout>
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
For a standalone topbar, use `[mobileMenuMode]="'popup'"`. For a projected menu container, set `mobileMode="popup"` on `good-topbar-menu-container` itself. The Penpot `goodui.topbar-menu-container.mobile-icon` and `.mobile-popup-open` states map to `mobileMode="popup"` with the popup closed/open. `goodui.topbar.mobile-menu-icon` and `.mobile-menu-popup-open` compose those states with the existing mobile topbar. The popup contents reuse linked menu item components in Penpot; Angular renders the supplied `GoodTopbarItem` tree.
|
|
70
|
-
|
|
71
|
-
### Component composition
|
|
72
|
-
|
|
73
|
-
```html
|
|
74
|
-
<good-topbar [showBrandIcon]="false">
|
|
75
|
-
<good-topbar-menu-container>
|
|
76
|
-
<good-topbar-menu-item label="Home" route="/" [active]="true" />
|
|
77
|
-
<good-topbar-menu-item label="Projects" route="/projects" />
|
|
78
|
-
</good-topbar-menu-container>
|
|
79
|
-
<good-main-menu>
|
|
80
|
-
<good-search [items]="searchItems" />
|
|
81
|
-
<good-theme-toggle />
|
|
82
|
-
<good-avatar-menu [user]="currentUser" [actions]="accountActions" />
|
|
83
|
-
</good-main-menu>
|
|
84
|
-
</good-topbar>
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
The topbar owns spacing, hit areas, and responsive behavior. Apps do not need manual `flex`, `gap`, or positioning classes for this structure. `good-app-layout` wires the mobile drawer; with a standalone topbar, use `(menuToggle)` to open your own navigation.
|
|
88
|
-
|
|
89
|
-
AppLayout also accepts a direct `good-main-menu` child and forwards it to the topbar action slot. The container is excluded from the page content. See [Main menu](main-menu.md) for composition and default behavior.
|
|
@@ -1,81 +0,0 @@
|
|
|
1
|
-
# AppLayout
|
|
2
|
-
|
|
3
|
-
`AppLayout` is the complete application shell. On desktop it positions a 280 px sidebar beside a 70 px topbar and the page area. On mobile it uses a 60 px topbar and a sidebar drawer with a scrim. The shell owns offsets, scroll areas, and stacking, so pages do not need layout margins for these regions.
|
|
4
|
-
|
|
5
|
-
The Penpot state `goodui.app-layout.help-submenu-open` shows the [two-level Help menu](../components/topbar.md) above the main view. It uses the existing AppLayout instance and reusable dropdown components.
|
|
6
|
-
|
|
7
|
-
## Reading the Penpot layout page
|
|
8
|
-
|
|
9
|
-
`02 Layout` starts with a guide to the shell, responsive breakpoint, and branding contract. Read its specimens in order: core desktop and mobile states, expanded navigation, Help overlay and Subnav, then application branding examples. All six published `goodui.app-layout.*` boards show the current GoodUI artwork in their brand slots. The SidebarContainer, Topbar, and BrandIcon masters on `01 Components` use the same specimen art. This is sample content in Penpot; the Angular shell still accepts each application's image URLs and ships no default GoodUI logo. The branding examples are compositions of linked shell instances with image previews exported from the logo artwork on `04 Logos`; they are not additional published UI components. Refresh the specimen and example previews if the source logo changes.
|
|
10
|
-
|
|
11
|
-
The desktop example places the light wordmark in the sidebar. The mobile examples show the symbol in the closed topbar and the wordmark in the open drawer. The final light and dark previews explain which image URL belongs to each appearance. The page's content-slot labels are illustrative; consumers project their own page content.
|
|
12
|
-
|
|
13
|
-
```text
|
|
14
|
-
AppLayout
|
|
15
|
-
├─ SidebarContainer → SidebarMenuContainer → SidebarItem
|
|
16
|
-
│ → SidebarSubmenuGroup → SidebarSubmenuItem
|
|
17
|
-
└─ Topbar → TopbarMenuContainer → TopbarMenuItem
|
|
18
|
-
→ MainMenu → Search | Notifications | ThemeToggle | AvatarMenu
|
|
19
|
-
MainView → page heading | page content
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Angular API
|
|
23
|
-
|
|
24
|
-
```html
|
|
25
|
-
<good-app-layout
|
|
26
|
-
[brand]="brand"
|
|
27
|
-
brandLogoSrc="my-logo-light.svg"
|
|
28
|
-
brandLogoDarkSrc="my-logo-dark.svg"
|
|
29
|
-
brandMarkSrc="my-mark-light.svg"
|
|
30
|
-
brandMarkDarkSrc="my-mark-dark.svg"
|
|
31
|
-
[sidebarSections]="navigation"
|
|
32
|
-
[topbarItems]="topbarItems"
|
|
33
|
-
[user]="currentUser"
|
|
34
|
-
[notifications]="notifications">
|
|
35
|
-
<good-main-view title="Dashboard" description="Overview">
|
|
36
|
-
<good-section>
|
|
37
|
-
<!-- Put the page's centered content here. -->
|
|
38
|
-
</good-section>
|
|
39
|
-
</good-main-view>
|
|
40
|
-
</good-app-layout>
|
|
41
|
-
```
|
|
42
|
-
|
|
43
|
-
Choose `layout="page"` (the default) for a scrolling page. Direct `good-section` children give the heading and all content the same centered 1024 px maximum width; put every top-level content block in a Section. For a full-width scrolling page, omit Sections and place content directly in MainView; its heading and content then share the left edge. Keep the two patterns separate.
|
|
44
|
-
|
|
45
|
-
Choose `layout="fill"` when a single workspace must occupy all remaining height below the topbar. MainView removes its outer padding so the projected child meets the edges of the application area; the application page no longer scrolls. The child must own its internal scrolling. For the calendar, opt in with `[fillHeight]="true"` to make its frame flush and its views scroll inside:
|
|
46
|
-
|
|
47
|
-
Add `goodMainViewToolbar` to an optional strip that should stay above the filled content. The strip uses its natural height; the workspace receives the remaining height. Use `good-action-bar` for grouped commands and projected search/filter tools.
|
|
48
|
-
|
|
49
|
-
```html
|
|
50
|
-
<good-main-view layout="fill">
|
|
51
|
-
<good-calendar [fillHeight]="true" [sidebarEnabled]="true">
|
|
52
|
-
<div goodCalendarSidebar><good-month-calendar /></div>
|
|
53
|
-
</good-calendar>
|
|
54
|
-
</good-main-view>
|
|
55
|
-
```
|
|
56
|
-
|
|
57
|
-
The [calendar workspace example](../../homepage/src/app/examples/calendar-workspace/calendar-workspace-page.html) shows a routed page using this layout without a page heading.
|
|
58
|
-
|
|
59
|
-
The simple input API creates the component hierarchy internally. You can compose the exported containers directly for special cases. Navigation requires `provideRouter(...)`; the active path comes from Angular Router.
|
|
60
|
-
The homepage's **Foundation → Layout** chapter starts with **General** for the root component, shell, and providers. **Default layout** shows a scrolling route and the user registration example, followed by its **Fill option** section for a full-height workspace without outer padding.
|
|
61
|
-
|
|
62
|
-
`brand` is the accessible name for optional logo artwork. `brandLogoSrc` and `brandLogoDarkSrc` supply the light and dark wordmarks for the desktop sidebar and mobile drawer. `brandMarkSrc` and `brandMarkDarkSrc` supply the light and dark symbols for the mobile topbar and optional desktop BrandIcon. When a dark URL is omitted, the light image is used in both themes. Without a mark URL, the mobile topbar continues to show the wordmark or text, preserving existing application behavior. Without a wordmark URL, the sidebar and drawer show the text brand and generic accent mark. Put the files in your Angular application's `public/` directory (or use your own hosted URLs). GoodUI does not package an application logo or favicon.
|
|
63
|
-
|
|
64
|
-
The browser favicon belongs to the application. Set its URL in your app's `src/index.html`, for example `<link rel="icon" type="image/svg+xml" href="favicon.svg">`, and put that file in your app's `public/` directory. Replace those with your own favicon when branding a consuming app; no GoodUI API or library file needs changing.
|
|
65
|
-
|
|
66
|
-
## Choose your topbar actions
|
|
67
|
-
|
|
68
|
-
Project a `good-main-menu` directly into AppLayout to choose the actions and their order. AppLayout forwards this container into Topbar and keeps routed content in the page area. Configure projected actions directly; shell action inputs continue to configure the generated default menu when no custom container is present.
|
|
69
|
-
|
|
70
|
-
```html
|
|
71
|
-
<good-app-layout [sidebarSections]="navigation">
|
|
72
|
-
<good-main-menu>
|
|
73
|
-
<good-search [items]="searchItems" />
|
|
74
|
-
<good-theme-toggle />
|
|
75
|
-
<good-avatar-menu [user]="currentUser" [actions]="accountActions" />
|
|
76
|
-
</good-main-menu>
|
|
77
|
-
<router-outlet />
|
|
78
|
-
</good-app-layout>
|
|
79
|
-
```
|
|
80
|
-
|
|
81
|
-
Import MainMenu and its selected child components in the declaring standalone component. See [Main menu](../components/main-menu.md) and its linked action guides.
|