@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.
Files changed (152) hide show
  1. package/ai/README.md +15 -0
  2. package/ai/case-studies/dockerhub.md +7 -0
  3. package/ai/case-studies/index.md +1 -0
  4. package/ai/catalog/component.schema.json +6 -0
  5. package/ai/catalog/components/good-action-menu.json +2 -2
  6. package/ai/catalog/components/good-alert.json +2 -2
  7. package/ai/catalog/components/{good-topbar.json → good-app-header.json} +77 -83
  8. package/ai/catalog/components/{good-app-layout.json → good-app-shell.json} +32 -68
  9. package/ai/catalog/components/good-avatar-menu-item.json +2 -2
  10. package/ai/catalog/components/good-brand-icon.json +6 -6
  11. package/ai/catalog/components/good-button.json +2 -2
  12. package/ai/catalog/components/good-dropdown.json +2 -2
  13. package/ai/catalog/components/{good-main-menu.json → good-header-actions.json} +19 -10
  14. package/ai/catalog/components/{good-avatar-menu.json → good-header-avatar.json} +5 -5
  15. package/ai/catalog/components/{good-topbar-dropdown-item.json → good-header-dropdown-item.json} +17 -17
  16. package/ai/catalog/components/{good-topbar-dropdown-menu.json → good-header-dropdown-menu.json} +14 -14
  17. package/ai/catalog/components/{good-topbar-menu-item.json → good-header-menu-item.json} +17 -15
  18. package/ai/catalog/components/{good-topbar-menu-container.json → good-header-menu.json} +16 -14
  19. package/ai/catalog/components/{good-notifications.json → good-header-notification.json} +5 -5
  20. package/ai/catalog/components/{good-search.json → good-header-search.json} +16 -7
  21. package/ai/catalog/components/{good-topbar-submenu.json → good-header-submenu.json} +12 -12
  22. package/ai/catalog/components/{good-theme-toggle.json → good-header-themetoggle.json} +8 -6
  23. package/ai/catalog/components/{good-heading.json → good-heading-1.json} +15 -33
  24. package/ai/catalog/components/good-heading-2.json +46 -0
  25. package/ai/catalog/components/{good-subheading.json → good-heading-3.json} +9 -30
  26. package/ai/catalog/components/good-heading-4.json +46 -0
  27. package/ai/catalog/components/good-heading-5.json +46 -0
  28. package/ai/catalog/components/good-heading-6.json +46 -0
  29. package/ai/catalog/components/good-heading-7.json +46 -0
  30. package/ai/catalog/components/good-heading-group.json +1 -1
  31. package/ai/catalog/components/good-main-view.json +6 -49
  32. package/ai/catalog/components/good-notification-host.json +1 -1
  33. package/ai/catalog/components/good-section.json +20 -2
  34. package/ai/catalog/components/good-settings.json +1 -1
  35. package/ai/catalog/components/good-sidebar-item.json +4 -2
  36. package/ai/catalog/components/good-sidebar-menu-container.json +4 -2
  37. package/ai/catalog/components/good-sidebar-submenu-group.json +1 -1
  38. package/ai/catalog/components/good-sidebar-submenu-item.json +1 -1
  39. package/ai/catalog/components/{good-sidebar-container.json → good-sidebar.json} +23 -26
  40. package/ai/catalog/components/good-summary.json +6 -1
  41. package/ai/catalog/index.json +231 -171
  42. package/ai/examples/edit-form.html +3 -1
  43. package/ai/examples/edit-form.ts +2 -2
  44. package/ai/examples/login.html +3 -1
  45. package/ai/examples/login.ts +2 -2
  46. package/ai/examples/settings.html +3 -1
  47. package/ai/examples/settings.ts +2 -2
  48. package/ai/examples/shell.html +18 -0
  49. package/ai/examples/shell.ts +11 -0
  50. package/ai/examples/table-view.html +3 -1
  51. package/ai/examples/table-view.ts +2 -2
  52. package/ai/examples/tsconfig.json +2 -1
  53. package/ai/guides/component-discovery.md +2 -2
  54. package/ai/guides/layout.md +5 -3
  55. package/ai/guides/page-patterns.md +7 -3
  56. package/ai/manifest.json +2 -2
  57. package/ai/skill/goodui/SKILL.md +11 -3
  58. package/angular/projects/goodui/package.json +1 -1
  59. package/angular/projects/goodui/src/lib/actions.ts +47 -23
  60. package/angular/projects/goodui/src/lib/app-shell.ts +109 -0
  61. package/angular/projects/goodui/src/lib/{topbar.ts → header.ts} +98 -72
  62. package/angular/projects/goodui/src/lib/main-view.ts +22 -13
  63. package/angular/projects/goodui/src/lib/shell-context.ts +46 -0
  64. package/angular/projects/goodui/src/lib/sidebar.ts +58 -40
  65. package/angular/projects/goodui/src/lib/typography.ts +51 -41
  66. package/angular/projects/goodui/src/public-api.ts +2 -2
  67. package/angular/projects/goodui/src/styles.css +99 -65
  68. package/angular/projects/goodui/src/tokens.generated.css +43 -6
  69. package/design/app-shell-contract.json +118 -0
  70. package/design/component-map.json +171 -82
  71. package/design/header-search-variants.json +55 -0
  72. package/design/typography-components.json +327 -0
  73. package/design-tokens/penpot.tokens.json +160 -6
  74. package/design.md +51 -39
  75. package/fesm2022/cloudfrogger-goodui.mjs +541 -383
  76. package/fesm2022/cloudfrogger-goodui.mjs.map +1 -1
  77. package/guides/README.md +2 -1
  78. package/guides/components/action-bar.md +1 -1
  79. package/guides/components/app-header.md +27 -0
  80. package/guides/components/columns.md +3 -3
  81. package/guides/components/header-actions.md +34 -0
  82. package/guides/components/{avatar-menu.md → header-avatar.md} +5 -5
  83. package/guides/components/header-menu.md +64 -0
  84. package/guides/components/header-notification.md +13 -0
  85. package/guides/components/header-search.md +72 -0
  86. package/guides/components/{theme-toggle.md → header-themetoggle.md} +6 -6
  87. package/guides/components/icon.md +1 -1
  88. package/guides/components/main-view.md +30 -8
  89. package/guides/components/notifications.md +2 -2
  90. package/guides/components/settings.md +2 -2
  91. package/guides/components/sidebar.md +16 -34
  92. package/guides/components/submenus.md +4 -4
  93. package/guides/components/subnav.md +4 -3
  94. package/guides/components/typography.md +76 -19
  95. package/guides/contributing/design-to-code.md +62 -32
  96. package/guides/foundations/naming.md +1 -1
  97. package/guides/foundations/tokens.md +9 -9
  98. package/guides/intro.md +17 -19
  99. package/guides/layout/app-shell.md +37 -0
  100. package/guides/layout/layout-rules.md +3 -3
  101. package/guides/migrations/app-shell.md +28 -0
  102. package/guides/migrations/explicit-headings.md +20 -0
  103. package/guides/migrations/header-actions.md +17 -0
  104. package/guides/migrations/header-menu.md +16 -0
  105. package/homepage/src/app/examples/calendar-workspace/calendar-workspace-page.ts +2 -10
  106. package/homepage/src/app/examples/calendar-workspace/source-code.generated.ts +1 -1
  107. package/homepage/src/app/examples/case-studies/cloudhoster/billing-page.html +6 -4
  108. package/homepage/src/app/examples/case-studies/cloudhoster/billing-page.ts +2 -20
  109. package/homepage/src/app/examples/case-studies/cloudhoster/create-database-page.html +5 -5
  110. package/homepage/src/app/examples/case-studies/cloudhoster/create-database-page.ts +2 -20
  111. package/homepage/src/app/examples/case-studies/cloudhoster/database-detail-page.html +3 -1
  112. package/homepage/src/app/examples/case-studies/cloudhoster/database-detail-page.ts +2 -20
  113. package/homepage/src/app/examples/case-studies/cloudhoster/databases-page.html +7 -5
  114. package/homepage/src/app/examples/case-studies/cloudhoster/databases-page.ts +2 -14
  115. package/homepage/src/app/examples/case-studies/cloudhoster/home-page.html +4 -4
  116. package/homepage/src/app/examples/case-studies/cloudhoster/home-page.ts +2 -12
  117. package/homepage/src/app/examples/case-studies/cloudhoster/source-code.generated.ts +10 -10
  118. package/homepage/src/app/examples/case-studies/vpshoster/create-server-page.html +6 -6
  119. package/homepage/src/app/examples/case-studies/vpshoster/create-server-page.ts +2 -18
  120. package/homepage/src/app/examples/case-studies/vpshoster/overview-page.html +4 -4
  121. package/homepage/src/app/examples/case-studies/vpshoster/overview-page.ts +2 -8
  122. package/homepage/src/app/examples/case-studies/vpshoster/servers-page.html +4 -1
  123. package/homepage/src/app/examples/case-studies/vpshoster/servers-page.ts +2 -12
  124. package/homepage/src/app/examples/case-studies/vpshoster/source-code.generated.ts +4 -4
  125. package/homepage/src/app/examples/case-studies/webmailer/webmailer-page.html +4 -4
  126. package/homepage/src/app/examples/case-studies/webmailer/webmailer-page.ts +2 -8
  127. package/homepage/src/app/examples/error-pages/error-pages-example-page.html +3 -1
  128. package/homepage/src/app/examples/error-pages/error-pages-example-page.ts +2 -7
  129. package/homepage/src/app/examples/error-pages/source-code.generated.ts +2 -2
  130. package/homepage/src/app/examples/mail-compose/mail-compose-page.ts +2 -4
  131. package/homepage/src/app/examples/mail-workspace/mail-workspace-page.ts +2 -10
  132. package/homepage/src/app/examples/mail-workspace/source-code.generated.ts +1 -1
  133. package/homepage/src/app/examples/notifications/notifications-page.html +3 -1
  134. package/homepage/src/app/examples/notifications/notifications-page.ts +2 -8
  135. package/homepage/src/app/examples/notifications/source-code.generated.ts +2 -2
  136. package/homepage/src/app/examples/pdf-reader/pdf-reader-page.html +3 -1
  137. package/homepage/src/app/examples/pdf-reader/pdf-reader-page.ts +2 -7
  138. package/homepage/src/app/examples/pdf-reader/source-code.generated.ts +2 -2
  139. package/homepage/src/app/examples/user-registration/source-code.generated.ts +3 -3
  140. package/homepage/src/app/examples/user-registration/user-registration-example-page.html +1 -1
  141. package/homepage/src/app/examples/user-registration/user-registration-example-page.ts +2 -2
  142. package/homepage/src/app/examples/user-registration/user-registration-form.ts +2 -13
  143. package/homepage/src/app/examples/user-registration/user-registration-page.html +1 -1
  144. package/homepage/src/app/examples/user-registration/user-registration-page.ts +2 -7
  145. package/package.json +2 -2
  146. package/styles.css +1 -1
  147. package/types/cloudfrogger-goodui.d.ts +301 -207
  148. package/angular/projects/goodui/src/lib/app-layout.ts +0 -84
  149. package/guides/components/main-menu.md +0 -23
  150. package/guides/components/search.md +0 -51
  151. package/guides/components/topbar.md +0 -89
  152. package/guides/layout/app-layout.md +0 -81
@@ -0,0 +1,11 @@
1
+ import { Component } from '@angular/core';
2
+ import { RouterOutlet } from '@angular/router';
3
+ import { GoodAppShellComponent, GoodAppHeaderComponent, GoodSidebarComponent, GoodSidebarMenuContainerComponent, GoodSidebarItemComponent, GoodHeaderMenuComponent, GoodHeaderMenuItemComponent, GoodHeaderActionsComponent, GoodHeaderThemeToggleComponent } from '@cloudfrogger/goodui';
4
+
5
+ // The consuming application provides provideRouter(routes) and provideGoodUI() at bootstrap.
6
+ @Component({
7
+ selector: 'app-shell-example', standalone: true,
8
+ imports: [RouterOutlet, GoodAppShellComponent, GoodAppHeaderComponent, GoodSidebarComponent, GoodSidebarMenuContainerComponent, GoodSidebarItemComponent, GoodHeaderMenuComponent, GoodHeaderMenuItemComponent, GoodHeaderActionsComponent, GoodHeaderThemeToggleComponent],
9
+ templateUrl: './shell.html',
10
+ })
11
+ export class ShellExample {}
@@ -1,3 +1,5 @@
1
- <good-main-view title="People" description="Search and sort the directory.">
1
+ <good-main-view>
2
+ <good-heading-1>People</good-heading-1>
3
+ <good-summary>Search and sort the directory.</good-summary>
2
4
  <good-table label="People" [data]="people" [columns]="columns" [searchable]="true" [pagination]="pagination" />
3
5
  </good-main-view>
@@ -1,9 +1,9 @@
1
1
  import { Component } from '@angular/core';
2
- import { GoodMainViewComponent, GoodTableComponent, GoodTableColumn } from '@cloudfrogger/goodui';
2
+ import { GoodMainViewComponent, GoodTableComponent, GoodTableColumn, GoodHeading1Component, GoodSummaryComponent } from '@cloudfrogger/goodui';
3
3
  interface Person { id: number; name: string; email: string; status: string; }
4
4
  @Component({
5
5
  selector: 'app-table-example', standalone: true,
6
- imports: [GoodMainViewComponent, GoodTableComponent],
6
+ imports: [GoodMainViewComponent, GoodTableComponent, GoodHeading1Component, GoodSummaryComponent],
7
7
  templateUrl: './table-view.html',
8
8
  })
9
9
  export class TableViewExample {
@@ -22,6 +22,7 @@
22
22
  "login.ts",
23
23
  "table-view.ts",
24
24
  "edit-form.ts",
25
- "settings.ts"
25
+ "settings.ts",
26
+ "shell.ts"
26
27
  ]
27
28
  }
@@ -4,7 +4,7 @@ Start with `ai/catalog/index.json`. Each entry gives a selector, Angular import
4
4
 
5
5
  | User need | Starting points |
6
6
  | --- | --- |
7
- | Application frame, sidebar, navigation, page spacing | `good-app-layout`, `good-main-view`, `good-subnav`, `good-breadcrumbs`; `ai/guides/layout.md` |
7
+ | Application frame, sidebar, navigation, page spacing | `good-app-shell`, `good-main-view`, `good-subnav`, `good-breadcrumbs`; `ai/guides/layout.md` |
8
8
  | Form, validation, fields, choices, date, phone, file | `form[goodForm]`, `good-group`, `good-form-row`, `good-form-field`; input, select, checkbox, radio, date, and upload families |
9
9
  | Records, filters, ordering, pagination, row actions | `good-table`, `good-input`, `good-select`, `good-action-menu`; `guides/components/table.md` |
10
10
  | Commands, menus, confirmations, notifications | Button, ActionGroup, ActionBar, Dropdown, Modal, Alert; `guides/components/notifications.md` |
@@ -16,4 +16,4 @@ For services and TypeScript types, search `angular/projects/goodui/src/public-ap
16
16
 
17
17
  Before using a candidate, check its required inputs and projection selectors. A catalog description helps discovery; the detail file and guide establish the actual API. Follow each `source` and `usageGuide` path relative to the reference root. This applies equally to a source checkout, the installed npm package, and a full archive.
18
18
 
19
- For configurable topbar actions, project `good-main-menu` into `good-app-layout` or `good-topbar`, then compose `good-search`, `good-notifications`, `good-theme-toggle`, and `good-avatar-menu` as its children. See `guides/components/main-menu.md`; configure each projected action directly.
19
+ For configurable topbar actions, project `good-header-actions` into `good-app-shell` or `good-app-header`, then compose `good-header-search`, `good-header-notification`, `good-header-themetoggle`, and `good-header-avatar` as its children. See `guides/components/header-actions.md`; configure each projected action directly.
@@ -1,10 +1,10 @@
1
1
  # Layout rules
2
2
 
3
- Use `good-app-layout` for a full application shell. Its composition is AppLayout → SidebarContainer / Topbar / MainView. `good-main-view` owns the page title, description, eyebrow, actions, and content flow. Use `good-heading-group` only when building an independent heading composition; do not nest it around a `good-main-view` title.
3
+ Use `good-app-shell` for a full application shell. Its composition is AppShell → Sidebar / AppHeader / MainView. `good-main-view` owns the layout of projected headings, summary, eyebrow, actions, and content. Place `good-heading-1` and optional `good-summary` directly inside it; there are no title or description inputs. Use `good-heading-group` when building an independent heading composition; do not nest it around a `good-main-view` title.
4
4
 
5
5
  Choose one page pattern. For a centered content page, put `good-section` elements directly inside `good-main-view`; MainView aligns its heading and entire content area to the same 1024 px width. For a free full-width page, use no `good-section`; heading and content then begin at the same left edge. Do not mix direct Sections and free page content. A standard page title belongs in MainView's `title` input in either pattern.
6
6
 
7
- `good-main-view layout="page"` is the default and lets the page scroll. For a workspace that fills the client area below the topbar without outer padding, set `layout="fill"`, project one primary child, and let that child scroll internally. For `good-calendar`, also set `[fillHeight]="true"` for a flush frame. See `guides/layout/app-layout.md` and `homepage/src/app/examples/calendar-workspace/` for the complete pattern.
7
+ `good-main-view layout="page"` is the default and lets the page scroll. For a workspace that fills the client area below the topbar without outer padding, set `layout="fill"`, project one primary child, and let that child scroll internally. For `good-calendar`, also set `[fillHeight]="true"` for a flush frame. See `guides/layout/app-shell.md` and `homepage/src/app/examples/calendar-workspace/` for the complete pattern.
8
8
 
9
9
  For forms, use native `<form goodForm>` with Angular forms, `good-group` for sections, `good-form-row` for two or three responsive fields, and `good-action-group` for buttons. For bounded content, use `good-card` with `good-card-header` and `good-card-footer`; project content into the documented slots. Avoid app-specific CSS or Tailwind layout rules in examples. If a layout need cannot be expressed with GoodUI components, verify the library capability before adding a local workaround.
10
10
 
@@ -16,4 +16,6 @@ For a page-level Card or framed Group that still needs more horizontal room, set
16
16
 
17
17
  Read the exact catalog detail for each selected component. Required inputs are explicit there; selector names and imports come from `public-api.ts`.
18
18
 
19
- For a custom action area, project `good-main-menu` directly into AppLayout or Topbar, then place action components inside it in the desired order. The container owns spacing. See `guides/components/main-menu.md`.
19
+ For a custom action area, project `good-header-actions` into AppHeader, then place action components inside it in the desired order. The container owns spacing. See `guides/components/header-actions.md`.
20
+
21
+ Declare `good-sidebar` and `good-app-header` directly inside AppShell. Put `good-header-menu` and `good-header-actions` inside AppHeader, and `good-sidebar-item` children inside Sidebar. AppShell has no navigation-array inputs. Route activity and Sidebar ancestors follow Angular Router; the same Sidebar instance becomes the mobile drawer. Read `guides/components/sidebar.md` and `guides/components/app-header.md`.
@@ -4,14 +4,18 @@ Pick the page width before composing controls:
4
4
 
5
5
  ```html
6
6
  <!-- Centered content: heading and sections share one width. -->
7
- <good-main-view title="Settings" description="Manage your preferences">
7
+ <good-main-view>
8
+ <good-heading-1>Settings</good-heading-1>
9
+ <good-summary>Manage your preferences</good-summary>
8
10
  <good-section>
9
11
  <good-group title="Notifications">...</good-group>
10
12
  </good-section>
11
13
  </good-main-view>
12
14
 
13
15
  <!-- Free content: heading and content both start at the page edge. -->
14
- <good-main-view title="Schedule" description="Upcoming work">
16
+ <good-main-view>
17
+ <good-heading-1>Schedule</good-heading-1>
18
+ <good-summary>Upcoming work</good-summary>
15
19
  <good-calendar />
16
20
  </good-main-view>
17
21
 
@@ -34,6 +38,6 @@ The example app in `ai/examples/main.ts` renders all four pages. It compiles aga
34
38
 
35
39
  ## Place notifications in the shell
36
40
 
37
- If the application uses `good-app-layout`, it already has the Notifications bell and one notification host. For maintenance notices, background jobs, and other messages a person may need to revisit, publish through `GoodNotificationCenter`; use `delivery: 'inbox'` when no toast should interrupt the page. Do not reproduce a reference screenshot's notification banner as an Expandable or permanent page Alert merely because it appears above the content. Read `guides/components/notifications.md` before implementing that part of a screen.
41
+ If the application uses `good-app-shell`, it already has the Notifications bell and one notification host. For maintenance notices, background jobs, and other messages a person may need to revisit, publish through `GoodNotificationCenter`; use `delivery: 'inbox'` when no toast should interrupt the page. Do not reproduce a reference screenshot's notification banner as an Expandable or permanent page Alert merely because it appears above the content. Read `guides/components/notifications.md` before implementing that part of a screen.
38
42
 
39
43
  Keep a `good-alert` in page content when it explains the current task or a nearby field, such as a form validation error. Use a toast for brief action feedback when the user should see it immediately; choose `persist` according to whether it belongs in the bell history. Avoid publishing the same seeded message on every route visit.
package/ai/manifest.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "package": "@cloudfrogger/goodui",
3
- "version": "0.0.64",
4
- "sourceRevision": "e775bfccc74810b4452d7f976f9e9acd620ff9db",
3
+ "version": "0.0.71",
4
+ "sourceRevision": "e24d78a13a80eefa1894c2bd24f32cbfe1fef980",
5
5
  "note": "References bundled with the npm package."
6
6
  }
@@ -1,11 +1,19 @@
1
1
  ---
2
2
  name: goodui
3
- description: Build or refine Angular screens with GoodUI components, or compose linked GoodUI designs in Penpot. Use the installed package's component catalog, API details, layout rules, and examples.
3
+ description: Design linked GoodUI screens in Penpot, or build Angular screens with GoodUI components. Use the live design library for Penpot and version-matched component references for Angular.
4
4
  ---
5
5
 
6
6
  # GoodUI
7
7
 
8
- ## Find the matching references
8
+ ## Start with a Penpot design
9
+
10
+ For a design-only task, no Angular project or npm package is required. Use the available Penpot MCP connection to inspect the target file and the live shared GoodUI library. Ask for a missing file link or connection when it cannot be discovered. The skill itself does not install the Penpot library or configure MCP.
11
+
12
+ Compose linked GoodUI instances in the target file, reuse published variants and tokens, and inspect the rendered desktop and mobile designs. Keep domain-specific content in the consuming design. Do not create Angular code unless requested. If a reusable capability is missing, explain the gap before substituting an unrelated custom component.
13
+
14
+ If local GoodUI references are unavailable, read only the relevant design guides and mapping from `https://github.com/cloudfrogger/goodui`: start with `design.md` and `design/component-map.json`, then the affected component guides under `guides/components/`. Use the live library to verify names, IDs, variants, and availability; repository references do not replace live inspection. When implementation begins, use the installed Angular package's matching references as described below.
15
+
16
+ ## Find the matching Angular references
9
17
 
10
18
  In the consuming application's root, read `node_modules/@cloudfrogger/goodui/package.json`. Prefer the references bundled in that same package. Set your reference root to `node_modules/@cloudfrogger/goodui`; paths below are relative to that directory. Check its `ai/manifest.json` and `ai/catalog/index.json` against the installed package name and version.
11
19
 
@@ -16,7 +24,7 @@ For a source checkout, use its root and `angular/projects/goodui/package.json`.
16
24
  1. Read `ai/catalog/index.json` to find suitable selectors and import symbols. `ai/guides/component-discovery.md` explains how to find components, services, and exported types from a task description. Read only the relevant component detail files and linked guides. Catalog files record inputs, defaults, required values, outputs, model changes, projection slots, forms integration, and Penpot ownership. Use `angular/projects/goodui/src/public-api.ts` and the referenced source files for exported types, services, and behavior that needs clarification.
17
25
  2. Read `ai/guides/layout.md` and `ai/guides/page-patterns.md` when composing a page. Choose the shell and page layout before arranging controls. MainView owns page insets and heading alignment; Group, FormRow, Card, Columns, ActionGroup, and the workspace components own their layout. Prefer these capabilities and shared tokens when they satisfy the requested screen. Describe a missing reusable capability when the library cannot express the requested layout, and agree on the approach with the user.
18
26
  3. Import public symbols from `@cloudfrogger/goodui` and global CSS from `@cloudfrogger/goodui/styles.css`. Check the app's root `provideGoodUI()` configuration and router. Use the catalog's exact inputs, outputs, projected slots, and Angular Forms integration. Keep domain data, persistence, and product-specific commands in the consuming application.
19
- 4. For configurable topbar actions, project `good-main-menu` into AppLayout or Topbar and compose action components inside it. Read `guides/components/main-menu.md` and each child guide; configure projected children directly. For notifications, read `guides/components/notifications.md`. AppLayout includes a notification host and a bell in its default menu. A custom MainMenu chooses whether to include the bell. Use `GoodNotificationCenter` for revisitable messages, an inline Alert for nearby task/form problems, and a transient toast for immediate feedback.
27
+ 4. For configurable topbar actions, project `good-header-actions` into `good-app-header` inside AppShell and compose action components inside it. Read `guides/components/header-actions.md` and each child guide; configure projected children directly. For notifications, read `guides/components/notifications.md`. AppShell includes a notification host; AppHeader supplies a bell when it renders its default actions. A custom HeaderActions chooses whether to include the bell. Use `GoodNotificationCenter` for revisitable messages, an inline Alert for nearby task/form problems, and a transient toast for immediate feedback.
20
28
  5. Use `ai/examples/` for small form, table, and settings patterns. Guides link to complete homepage examples when useful. For a named case study, read `ai/case-studies/index.md`, then that study and its relevant screen. Keep routine component work focused on its relevant references.
21
29
  6. Build the consuming app and exercise the requested interaction. Inspect desktop and mobile layouts, light and dark themes, and applicable keyboard, focus, and form behavior. State what was verified and what still needs a real backend, browser, or device check.
22
30
 
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudfrogger/goodui",
3
- "version": "0.0.64",
3
+ "version": "0.0.71",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -1,3 +1,4 @@
1
+ import { DOCUMENT } from '@angular/common';
1
2
  import { ChangeDetectionStrategy, Component, ElementRef, HostListener, computed, forwardRef, inject, input, output, signal, viewChild } from '@angular/core';
2
3
  import { RouterLink } from '@angular/router';
3
4
  import { GoodIconComponent } from './icon';
@@ -12,12 +13,16 @@ import { GoodNotificationAction, GoodNotificationCenter, GoodNotificationEntry }
12
13
  import { LucideInfo } from '@lucide/angular';
13
14
 
14
15
  @Component({
15
- selector: 'good-search',
16
+ selector: 'good-header-search',
16
17
  standalone: true,
17
18
  imports: [GoodIconComponent, RouterLink],
18
19
  changeDetection: ChangeDetectionStrategy.OnPush,
19
20
  template: `
20
- <button #trigger type="button" class="good-action-button" aria-label="Search" (click)="open()"><good-icon name="search" /></button>
21
+ <button #trigger type="button" class="good-action-button" [class.good-header-search-hotkey]="hotkey()"
22
+ aria-label="Search" [attr.aria-keyshortcuts]="hotkey() ? 'Control+k Meta+k' : null" (click)="open()">
23
+ <good-icon name="search" />
24
+ @if (hotkey()) { <span class="good-header-search-label">Search…</span><kbd class="good-header-search-shortcut" aria-hidden="true">{{ shortcutHint }}</kbd> }
25
+ </button>
21
26
  <dialog #dialog class="good-search-dialog" aria-label="Search" (keydown.escape)="close()" (close)="trigger.focus()">
22
27
  <div class="good-dialog-heading"><strong>Search</strong><button type="button" class="good-action-button" aria-label="Close" (click)="close()"><good-icon name="close" /></button></div>
23
28
  <label class="good-search-field"><good-icon name="search" /><input #searchInput type="search" placeholder="Search…" [value]="query()" (input)="query.set(searchInput.value)" /></label>
@@ -28,24 +33,43 @@ import { LucideInfo } from '@lucide/angular';
28
33
  </div>
29
34
  </dialog>
30
35
  `,
31
- host: { class: 'good-search' },
36
+ host: { class: 'good-header-search' },
32
37
  })
33
- export class GoodSearchComponent {
38
+ export class GoodHeaderSearchComponent {
34
39
  readonly items = input<readonly GoodSearchItem[]>([]);
40
+ readonly hotkey = input(false);
41
+ private readonly document = inject(DOCUMENT);
42
+ readonly shortcutHint = /Mac|iPhone|iPad|iPod/i.test(this.document.defaultView?.navigator.platform ?? '') ? '⌘ K' : 'Ctrl K';
43
+ private readonly trigger = viewChild.required<ElementRef<HTMLButtonElement>>('trigger');
35
44
  readonly query = signal('');
36
45
  readonly results = computed(() => this.items().filter(item => `${item.label} ${item.description ?? ''}`.toLocaleLowerCase().includes(this.query().toLocaleLowerCase())));
37
46
  private readonly dialog = viewChild.required<ElementRef<HTMLDialogElement>>('dialog');
38
47
  private readonly searchInput = viewChild.required<ElementRef<HTMLInputElement>>('searchInput');
39
48
 
49
+ @HostListener('document:keydown', ['$event'])
50
+ onShortcut(event: KeyboardEvent): void {
51
+ if (!this.hotkey() || event.defaultPrevented || event.repeat || event.isComposing ||
52
+ event.altKey || event.shiftKey || event.ctrlKey === event.metaKey || event.key.toLowerCase() !== 'k') return;
53
+ const trigger = this.trigger().nativeElement;
54
+ const style = this.document.defaultView?.getComputedStyle(trigger);
55
+ if (!trigger.getClientRects().length || style?.visibility === 'hidden' || style?.visibility === 'collapse' ||
56
+ trigger.closest('[inert]') || this.document.querySelector('dialog[open], [aria-modal="true"]')) return;
57
+ event.preventDefault();
58
+ this.open();
59
+ }
60
+
40
61
  open(): void {
41
- this.dialog().nativeElement.showModal();
42
- queueMicrotask(() => this.searchInput().nativeElement.focus());
62
+ const dialog = this.dialog().nativeElement;
63
+ if (dialog.open) return;
64
+ dialog.showModal();
65
+ const searchInput = this.searchInput().nativeElement;
66
+ queueMicrotask(() => { if (dialog.open) searchInput.focus(); });
43
67
  }
44
68
  close(): void { this.dialog().nativeElement.close(); }
45
69
  }
46
70
 
47
71
  @Component({
48
- selector: 'good-notifications',
72
+ selector: 'good-header-notification',
49
73
  standalone: true,
50
74
  imports: [GoodIconComponent, RouterLink, GoodAlertComponent, GoodBadgeComponent, GoodButtonComponent, GoodLinkComponent, GoodProgressComponent],
51
75
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -98,9 +122,9 @@ export class GoodSearchComponent {
98
122
  </div>
99
123
  </dialog>
100
124
  `,
101
- host: { class: 'good-notifications' },
125
+ host: { class: 'good-header-notification' },
102
126
  })
103
- export class GoodNotificationsComponent {
127
+ export class GoodHeaderNotificationComponent {
104
128
  readonly items = input<readonly GoodNotification[]>([]);
105
129
  readonly center = inject(GoodNotificationCenter);
106
130
  readonly infoIcon = LucideInfo;
@@ -131,16 +155,16 @@ export class GoodNotificationsComponent {
131
155
  }
132
156
 
133
157
  @Component({
134
- selector: 'good-theme-toggle',
158
+ selector: 'good-header-themetoggle',
135
159
  standalone: true,
136
160
  imports: [GoodIconComponent],
137
161
  changeDetection: ChangeDetectionStrategy.OnPush,
138
162
  template: `<button type="button" class="good-action-button" [attr.aria-label]="label()" [attr.title]="label()" (click)="theme.cycle()">
139
163
  <good-icon [name]="icon()" />
140
164
  </button>`,
141
- host: { class: 'good-theme-toggle' },
165
+ host: { class: 'good-header-themetoggle' },
142
166
  })
143
- export class GoodThemeToggleComponent {
167
+ export class GoodHeaderThemeToggleComponent {
144
168
  readonly theme = inject(GoodThemeService);
145
169
  readonly icon = computed(() => ({ light: 'sun', system: 'monitor', dark: 'moon' } as const)[this.theme.preference()]);
146
170
  readonly label = computed(() => `Appearance: ${this.theme.preference()}. Switch to ${{ light: 'system', system: 'dark', dark: 'light' }[this.theme.preference()]} mode`);
@@ -246,7 +270,7 @@ export class GoodAvatarMenuItemComponent {
246
270
  }
247
271
 
248
272
  @Component({
249
- selector: 'good-avatar-menu',
273
+ selector: 'good-header-avatar',
250
274
  standalone: true,
251
275
  imports: [GoodAvatarMenuItemComponent],
252
276
  changeDetection: ChangeDetectionStrategy.OnPush,
@@ -270,9 +294,9 @@ export class GoodAvatarMenuItemComponent {
270
294
  }
271
295
  </div> }
272
296
  `,
273
- host: { class: 'good-avatar-menu' },
297
+ host: { class: 'good-header-avatar' },
274
298
  })
275
- export class GoodAvatarMenuComponent {
299
+ export class GoodHeaderAvatarComponent {
276
300
  readonly user = input<GoodUser | null>(null);
277
301
  readonly actions = input<readonly GoodMenuAction[]>([]);
278
302
  readonly open = signal(false);
@@ -291,22 +315,22 @@ export class GoodAvatarMenuComponent {
291
315
  }
292
316
 
293
317
  @Component({
294
- selector: 'good-main-menu',
318
+ selector: 'good-header-actions',
295
319
  standalone: true,
296
- imports: [GoodSearchComponent, GoodNotificationsComponent, GoodThemeToggleComponent, GoodSettingsComponent, GoodAvatarMenuComponent],
320
+ imports: [GoodHeaderSearchComponent, GoodHeaderNotificationComponent, GoodHeaderThemeToggleComponent, GoodSettingsComponent, GoodHeaderAvatarComponent],
297
321
  changeDetection: ChangeDetectionStrategy.OnPush,
298
322
  template: `
299
323
  <ng-content>
300
- @if (showSearch()) { <good-search [items]="searchItems()" /> }
301
- @if (showNotifications()) { <good-notifications [items]="notifications()" /> }
302
- @if (showThemeToggle()) { <good-theme-toggle /> }
324
+ @if (showSearch()) { <good-header-search [items]="searchItems()" /> }
325
+ @if (showNotifications()) { <good-header-notification [items]="notifications()" /> }
326
+ @if (showThemeToggle()) { <good-header-themetoggle /> }
303
327
  @if (showSettings()) { <good-settings [actions]="settingsActions()" /> }
304
- @if (showAvatar()) { <good-avatar-menu [user]="user()" [actions]="avatarActions()" /> }
328
+ @if (showAvatar()) { <good-header-avatar [user]="user()" [actions]="avatarActions()" /> }
305
329
  </ng-content>
306
330
  `,
307
- host: { class: 'good-main-menu' },
331
+ host: { class: 'good-header-actions' },
308
332
  })
309
- export class GoodMainMenuComponent {
333
+ export class GoodHeaderActionsComponent {
310
334
  readonly user = input<GoodUser | null>(null);
311
335
  readonly notifications = input<readonly GoodNotification[]>([]);
312
336
  readonly searchItems = input<readonly GoodSearchItem[]>([]);
@@ -0,0 +1,109 @@
1
+ import { DOCUMENT } from '@angular/common';
2
+ import { ChangeDetectionStrategy, Component, ElementRef, afterNextRender, contentChild, effect, inject, input, signal, viewChild, DestroyRef } from '@angular/core';
3
+ import { GoodSidebarComponent } from './sidebar';
4
+ import { GoodMenuAction, GoodNotification, GoodSearchItem, GoodUser } from './models';
5
+ import { GoodNotificationHostComponent } from './notification-host';
6
+ import { GoodNavigationState, GoodShellContext } from './shell-context';
7
+
8
+ @Component({
9
+ selector: 'good-app-shell', standalone: true,
10
+ imports: [GoodNotificationHostComponent],
11
+ providers: [GoodShellContext],
12
+ changeDetection: ChangeDetectionStrategy.OnPush,
13
+ template: `
14
+ <dialog #drawer open class="good-shell-sidebar" [attr.role]="mobile() ? 'dialog' : 'presentation'"
15
+ [attr.aria-label]="mobile() ? 'Navigation' : null" (click)="onBackdropClick($event)" (close)="onDrawerClose()">
16
+ <ng-content select="good-sidebar" />
17
+ <button type="button" class="good-drawer-close" aria-label="Close sidebar" (click)="closeDrawer()">Close</button>
18
+ </dialog>
19
+ <div class="good-app-main">
20
+ <ng-content select="good-app-header" />
21
+ <div class="good-app-page"><ng-content /></div>
22
+ </div>
23
+ <good-notification-host />
24
+ `,
25
+ host: { class: 'good-app-shell', '[class.good-shell-without-sidebar]': '!sidebar()' },
26
+ })
27
+ export class GoodAppShellComponent {
28
+ private readonly document = inject(DOCUMENT);
29
+ private readonly destroyRef = inject(DestroyRef);
30
+ private readonly context = inject(GoodShellContext);
31
+ private readonly navigation = inject(GoodNavigationState);
32
+ readonly sidebar = contentChild(GoodSidebarComponent);
33
+ private readonly drawer = viewChild<ElementRef<HTMLDialogElement>>('drawer');
34
+ readonly mobile = signal(false);
35
+ private returnFocus: HTMLElement | null = null;
36
+ readonly brand = input('GOODUI');
37
+ readonly brandLogoSrc = input('');
38
+ readonly brandLogoDarkSrc = input('');
39
+ readonly brandMarkSrc = input('');
40
+ readonly brandMarkDarkSrc = input('');
41
+ readonly showBrandIcon = input(false);
42
+ readonly showMobileBrand = input(true);
43
+ readonly user = input<GoodUser | null>(null);
44
+ readonly notifications = input<readonly GoodNotification[]>([]);
45
+ readonly searchItems = input<readonly GoodSearchItem[]>([]);
46
+ readonly settingsActions = input<readonly GoodMenuAction[]>([]);
47
+ readonly showThemeToggle = input(true);
48
+ readonly showSettings = input(false);
49
+ readonly avatarActions = input<readonly GoodMenuAction[]>([]);
50
+
51
+ constructor() {
52
+ effect(() => {
53
+ this.context.hasSidebar.set(!!this.sidebar());
54
+ this.context.options.set({
55
+ brand: this.brand(),
56
+ brandLogoSrc: this.brandLogoSrc(),
57
+ brandLogoDarkSrc: this.brandLogoDarkSrc(),
58
+ brandMarkSrc: this.brandMarkSrc(),
59
+ brandMarkDarkSrc: this.brandMarkDarkSrc(),
60
+ showBrandIcon: this.showBrandIcon(),
61
+ showMobileBrand: this.showMobileBrand(),
62
+ user: this.user(),
63
+ notifications: this.notifications(),
64
+ searchItems: this.searchItems(),
65
+ settingsActions: this.settingsActions(),
66
+ showThemeToggle: this.showThemeToggle(),
67
+ showSettings: this.showSettings(),
68
+ avatarActions: this.avatarActions(),
69
+ });
70
+ });
71
+ effect(() => {
72
+ this.navigation.activeRoute();
73
+ this.context.sidebarOpen.set(false);
74
+ });
75
+ effect(() => {
76
+ const element = this.drawer()?.nativeElement;
77
+ if (!element) return;
78
+ if (!this.mobile()) {
79
+ this.context.sidebarOpen.set(false);
80
+ if (element.matches(':modal')) element.close();
81
+ if (!element.open) element.open = true;
82
+ } else if (this.context.sidebarOpen() && this.sidebar()) {
83
+ if (!element.open) {
84
+ this.returnFocus = this.document.activeElement as HTMLElement;
85
+ element.showModal();
86
+ }
87
+ } else if (element.open) element.close();
88
+ });
89
+ afterNextRender(() => {
90
+ const query = this.document.defaultView?.matchMedia('(max-width: 900px)');
91
+ if (!query) return;
92
+ this.mobile.set(query.matches);
93
+ const update = () => this.mobile.set(query.matches);
94
+ query.addEventListener('change', update);
95
+ this.destroyRef.onDestroy(() => query.removeEventListener('change', update));
96
+ });
97
+ }
98
+
99
+ openDrawer(): void { this.context.sidebarOpen.set(true); }
100
+ closeDrawer(): void { this.context.sidebarOpen.set(false); }
101
+ onBackdropClick(event: MouseEvent): void {
102
+ if (this.mobile() && event.target === this.drawer()!.nativeElement) this.closeDrawer();
103
+ }
104
+ onDrawerClose(): void {
105
+ if (!this.mobile() || this.drawer()?.nativeElement.open) return;
106
+ this.context.sidebarOpen.set(false);
107
+ this.returnFocus?.focus();
108
+ }
109
+ }