@cloudfrogger/goodui 0.0.65 → 0.0.72

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 (146) 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} +75 -81
  8. package/ai/catalog/components/{good-app-layout.json → good-app-shell.json} +32 -68
  9. package/ai/catalog/components/good-brand-icon.json +6 -6
  10. package/ai/catalog/components/good-button.json +2 -2
  11. package/ai/catalog/components/good-dropdown.json +2 -2
  12. package/ai/catalog/components/good-header-actions.json +10 -1
  13. package/ai/catalog/components/{good-topbar-dropdown-item.json → good-header-dropdown-item.json} +17 -17
  14. package/ai/catalog/components/{good-topbar-dropdown-menu.json → good-header-dropdown-menu.json} +14 -14
  15. package/ai/catalog/components/{good-topbar-menu-item.json → good-header-menu-item.json} +17 -15
  16. package/ai/catalog/components/{good-topbar-menu-container.json → good-header-menu.json} +16 -14
  17. package/ai/catalog/components/good-header-search.json +12 -3
  18. package/ai/catalog/components/{good-topbar-submenu.json → good-header-submenu.json} +12 -12
  19. package/ai/catalog/components/good-header-themetoggle.json +3 -1
  20. package/ai/catalog/components/{good-heading.json → good-heading-1.json} +15 -33
  21. package/ai/catalog/components/good-heading-2.json +46 -0
  22. package/ai/catalog/components/{good-subheading.json → good-heading-3.json} +9 -30
  23. package/ai/catalog/components/good-heading-4.json +46 -0
  24. package/ai/catalog/components/good-heading-5.json +46 -0
  25. package/ai/catalog/components/good-heading-6.json +46 -0
  26. package/ai/catalog/components/good-heading-7.json +46 -0
  27. package/ai/catalog/components/good-heading-group.json +1 -1
  28. package/ai/catalog/components/good-main-view.json +6 -49
  29. package/ai/catalog/components/good-notification-host.json +1 -1
  30. package/ai/catalog/components/good-section.json +20 -2
  31. package/ai/catalog/components/good-sidebar-item.json +4 -2
  32. package/ai/catalog/components/good-sidebar-menu-container.json +4 -2
  33. package/ai/catalog/components/good-sidebar-submenu-group.json +1 -1
  34. package/ai/catalog/components/good-sidebar-submenu-item.json +1 -1
  35. package/ai/catalog/components/{good-sidebar-container.json → good-sidebar.json} +23 -26
  36. package/ai/catalog/components/good-summary.json +6 -1
  37. package/ai/catalog/index.json +170 -110
  38. package/ai/examples/edit-form.html +3 -1
  39. package/ai/examples/edit-form.ts +2 -2
  40. package/ai/examples/login.html +3 -1
  41. package/ai/examples/login.ts +2 -2
  42. package/ai/examples/settings.html +3 -1
  43. package/ai/examples/settings.ts +2 -2
  44. package/ai/examples/shell.html +18 -0
  45. package/ai/examples/shell.ts +11 -0
  46. package/ai/examples/table-view.html +3 -1
  47. package/ai/examples/table-view.ts +2 -2
  48. package/ai/examples/tsconfig.json +2 -1
  49. package/ai/guides/component-discovery.md +2 -2
  50. package/ai/guides/layout.md +5 -3
  51. package/ai/guides/page-patterns.md +7 -3
  52. package/ai/manifest.json +2 -2
  53. package/ai/skill/goodui/SKILL.md +11 -3
  54. package/angular/projects/goodui/package.json +1 -1
  55. package/angular/projects/goodui/src/lib/actions.ts +27 -3
  56. package/angular/projects/goodui/src/lib/app-shell.ts +109 -0
  57. package/angular/projects/goodui/src/lib/{topbar.ts → header.ts} +96 -69
  58. package/angular/projects/goodui/src/lib/main-view.ts +22 -13
  59. package/angular/projects/goodui/src/lib/shell-context.ts +46 -0
  60. package/angular/projects/goodui/src/lib/sidebar.ts +58 -40
  61. package/angular/projects/goodui/src/lib/typography.ts +51 -41
  62. package/angular/projects/goodui/src/public-api.ts +2 -2
  63. package/angular/projects/goodui/src/styles.css +95 -61
  64. package/angular/projects/goodui/src/tokens.generated.css +43 -6
  65. package/design/app-shell-contract.json +118 -0
  66. package/design/component-map.json +153 -71
  67. package/design/header-search-variants.json +55 -0
  68. package/design/typography-components.json +327 -0
  69. package/design-tokens/penpot.tokens.json +160 -6
  70. package/design.md +49 -37
  71. package/fesm2022/cloudfrogger-goodui.mjs +501 -342
  72. package/fesm2022/cloudfrogger-goodui.mjs.map +1 -1
  73. package/guides/README.md +1 -1
  74. package/guides/components/action-bar.md +1 -1
  75. package/guides/components/app-header.md +27 -0
  76. package/guides/components/columns.md +3 -3
  77. package/guides/components/header-actions.md +10 -5
  78. package/guides/components/header-avatar.md +1 -1
  79. package/guides/components/header-menu.md +64 -0
  80. package/guides/components/header-notification.md +1 -1
  81. package/guides/components/header-search.md +26 -5
  82. package/guides/components/header-themetoggle.md +3 -3
  83. package/guides/components/icon.md +1 -1
  84. package/guides/components/main-view.md +30 -8
  85. package/guides/components/notifications.md +1 -1
  86. package/guides/components/settings.md +1 -1
  87. package/guides/components/sidebar.md +16 -34
  88. package/guides/components/submenus.md +4 -4
  89. package/guides/components/subnav.md +4 -3
  90. package/guides/components/typography.md +76 -19
  91. package/guides/contributing/design-to-code.md +61 -31
  92. package/guides/foundations/naming.md +1 -1
  93. package/guides/foundations/tokens.md +7 -7
  94. package/guides/intro.md +17 -19
  95. package/guides/layout/app-shell.md +37 -0
  96. package/guides/layout/layout-rules.md +2 -2
  97. package/guides/migrations/app-shell.md +28 -0
  98. package/guides/migrations/explicit-headings.md +20 -0
  99. package/guides/migrations/header-actions.md +1 -1
  100. package/guides/migrations/header-menu.md +16 -0
  101. package/homepage/src/app/examples/calendar-workspace/calendar-workspace-page.ts +2 -10
  102. package/homepage/src/app/examples/calendar-workspace/source-code.generated.ts +1 -1
  103. package/homepage/src/app/examples/case-studies/cloudhoster/billing-page.html +6 -4
  104. package/homepage/src/app/examples/case-studies/cloudhoster/billing-page.ts +2 -20
  105. package/homepage/src/app/examples/case-studies/cloudhoster/create-database-page.html +5 -5
  106. package/homepage/src/app/examples/case-studies/cloudhoster/create-database-page.ts +2 -20
  107. package/homepage/src/app/examples/case-studies/cloudhoster/database-detail-page.html +3 -1
  108. package/homepage/src/app/examples/case-studies/cloudhoster/database-detail-page.ts +2 -20
  109. package/homepage/src/app/examples/case-studies/cloudhoster/databases-page.html +7 -5
  110. package/homepage/src/app/examples/case-studies/cloudhoster/databases-page.ts +2 -14
  111. package/homepage/src/app/examples/case-studies/cloudhoster/home-page.html +4 -4
  112. package/homepage/src/app/examples/case-studies/cloudhoster/home-page.ts +2 -12
  113. package/homepage/src/app/examples/case-studies/cloudhoster/source-code.generated.ts +10 -10
  114. package/homepage/src/app/examples/case-studies/vpshoster/create-server-page.html +6 -6
  115. package/homepage/src/app/examples/case-studies/vpshoster/create-server-page.ts +2 -18
  116. package/homepage/src/app/examples/case-studies/vpshoster/overview-page.html +4 -4
  117. package/homepage/src/app/examples/case-studies/vpshoster/overview-page.ts +2 -8
  118. package/homepage/src/app/examples/case-studies/vpshoster/servers-page.html +4 -1
  119. package/homepage/src/app/examples/case-studies/vpshoster/servers-page.ts +2 -12
  120. package/homepage/src/app/examples/case-studies/vpshoster/source-code.generated.ts +4 -4
  121. package/homepage/src/app/examples/case-studies/webmailer/webmailer-page.html +4 -4
  122. package/homepage/src/app/examples/case-studies/webmailer/webmailer-page.ts +2 -8
  123. package/homepage/src/app/examples/error-pages/error-pages-example-page.html +3 -1
  124. package/homepage/src/app/examples/error-pages/error-pages-example-page.ts +2 -7
  125. package/homepage/src/app/examples/error-pages/source-code.generated.ts +2 -2
  126. package/homepage/src/app/examples/mail-compose/mail-compose-page.ts +2 -4
  127. package/homepage/src/app/examples/mail-workspace/mail-workspace-page.ts +2 -10
  128. package/homepage/src/app/examples/mail-workspace/source-code.generated.ts +1 -1
  129. package/homepage/src/app/examples/notifications/notifications-page.html +3 -1
  130. package/homepage/src/app/examples/notifications/notifications-page.ts +2 -8
  131. package/homepage/src/app/examples/notifications/source-code.generated.ts +2 -2
  132. package/homepage/src/app/examples/pdf-reader/pdf-reader-page.html +3 -1
  133. package/homepage/src/app/examples/pdf-reader/pdf-reader-page.ts +2 -7
  134. package/homepage/src/app/examples/pdf-reader/source-code.generated.ts +2 -2
  135. package/homepage/src/app/examples/user-registration/source-code.generated.ts +3 -3
  136. package/homepage/src/app/examples/user-registration/user-registration-example-page.html +1 -1
  137. package/homepage/src/app/examples/user-registration/user-registration-example-page.ts +2 -2
  138. package/homepage/src/app/examples/user-registration/user-registration-form.ts +2 -13
  139. package/homepage/src/app/examples/user-registration/user-registration-page.html +1 -1
  140. package/homepage/src/app/examples/user-registration/user-registration-page.ts +2 -7
  141. package/package.json +2 -2
  142. package/styles.css +1 -1
  143. package/types/cloudfrogger-goodui.d.ts +202 -107
  144. package/angular/projects/goodui/src/lib/app-layout.ts +0 -84
  145. package/guides/components/topbar.md +0 -89
  146. package/guides/layout/app-layout.md +0 -81
@@ -1,3 +1,3 @@
1
1
  // Generated from the editable example files. Run npm run examples:sync after changing them.
2
- export const notificationsHtml = "<good-main-view title=\"Notifications\" description=\"Try alerts, job progress, timed toasts, acknowledgement, and the notification panel.\">\n <good-section>\n <good-breadcrumbs [items]=\"breadcrumbs\" />\n <good-group title=\"Inline alerts\" appearance=\"plain\">\n <good-alert tone=\"info\" title=\"Always in context\" message=\"An inline alert remains in the page until your application removes it.\" />\n <good-alert tone=\"success\" appearance=\"light\" title=\"Changes saved\"\n message=\"Your preferences were saved successfully.\" />\n <good-alert tone=\"warning\" appearance=\"mono\" title=\"Quiet visual style\"\n message=\"Mono keeps the message neutral and uses color only on the icon.\" />\n <good-alert tone=\"destructive\" appearance=\"light\" title=\"Dismissible\"\n message=\"Close this example with its accessible button.\" [dismissible]=\"true\" />\n </good-group>\n <good-group title=\"Send a notification\" appearance=\"plain\">\n <good-action-group orientation=\"responsive\">\n <good-button (click)=\"show('toast')\">Success toast at top right</good-button>\n <good-button variant=\"secondary\" (click)=\"show('top')\">Slide from top</good-button>\n <good-button variant=\"outline\" (click)=\"show('inbox')\">Inbox only</good-button>\n </good-action-group>\n <good-action-group orientation=\"responsive\">\n <good-button variant=\"secondary\" (click)=\"requireAcknowledgement()\">Wait for acknowledgement</good-button>\n <good-button variant=\"outline\" (click)=\"showActions()\">Toast with actions</good-button>\n <good-button variant=\"ghost\" (click)=\"showTemporary()\">Toast without history</good-button>\n </good-action-group>\n <good-alert tone=\"neutral\" appearance=\"light\" title=\"Notification panel\"\n message=\"Open the bell to review saved messages. Toast without history uses persist: false and leaves no panel entry.\" />\n <p role=\"status\">{{ lastAction() }}</p>\n </good-group>\n <good-group title=\"Jobs with progress\" appearance=\"plain\">\n <good-action-group orientation=\"responsive\">\n <good-button (click)=\"startJob('top')\" [disabled]=\"toastJobRunning()\">Run report job</good-button>\n <good-button variant=\"outline\" (click)=\"startJob('inbox')\" [disabled]=\"inboxJobRunning()\">Run inbox-only job</good-button>\n </good-action-group>\n @if (inlineProgress() !== null) {\n <good-alert [tone]=\"inlineProgress() === 100 ? 'success' : 'info'\"\n [title]=\"inlineProgress() === 100 ? 'Report ready' : 'Generating report'\"\n message=\"This job updates here and in its notification.\">\n <good-progress title=\"Report generation\" [value]=\"inlineProgress() ?? 0\"\n [showPercent]=\"true\" [color]=\"inlineProgress() === 100 ? 'success' : 'info'\" />\n </good-alert>\n }\n <good-alert tone=\"neutral\" appearance=\"light\" title=\"Inbox-only job\"\n message=\"The second job has no toast or inline status. Open the bell to follow its progress.\" />\n </good-group>\n <good-group title=\"Use this example\" appearance=\"plain\">\n <good-code-block [code]=\"htmlSource\" language=\"html\" title=\"notifications-page.html\"\n [collapsible]=\"true\" [collapsedLines]=\"20\" />\n <good-code-block [code]=\"typescriptSource\" language=\"typescript\" title=\"notifications-page.ts\"\n [collapsible]=\"true\" [collapsedLines]=\"20\" />\n </good-group>\n </good-section>\n</good-main-view>\n";
3
- export const notificationsTs = "import { ChangeDetectionStrategy, Component, DestroyRef, inject, signal } from '@angular/core';\nimport {\n GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent,\n GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodNotificationCenter,\n GoodNotificationDelivery, GoodProgressComponent, GoodSectionComponent,\n type GoodBreadcrumbItem,\n} from '@cloudfrogger/goodui';\nimport { notificationsHtml, notificationsTs } from './source-code.generated';\n\n@Component({\n selector: 'example-notifications-page',\n standalone: true,\n imports: [GoodMainViewComponent, GoodSectionComponent, GoodBreadcrumbsComponent, GoodGroupComponent,\n GoodActionGroupComponent, GoodButtonComponent, GoodAlertComponent, GoodCodeBlockComponent, GoodProgressComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './notifications-page.html',\n})\nexport class NotificationsPageComponent {\n readonly center = inject(GoodNotificationCenter);\n private readonly destroyRef = inject(DestroyRef);\n private readonly jobIntervals = new Set<ReturnType<typeof setInterval>>();\n private readonly completionTimers = new Set<ReturnType<typeof setTimeout>>();\n private readonly activeJobs = new Map<string, 'top' | 'inbox'>();\n private readonly completedToasts = new Set<string>();\n readonly breadcrumbs: readonly GoodBreadcrumbItem[] = [\n { label: 'Home', route: '/dashboard' }, { label: 'Examples' }, { label: 'Notifications' },\n ];\n readonly lastAction = signal('No action selected yet.');\n readonly inlineProgress = signal<number | null>(null);\n readonly toastJobRunning = signal(false);\n readonly inboxJobRunning = signal(false);\n readonly htmlSource = notificationsHtml;\n readonly typescriptSource = notificationsTs;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n for (const timer of this.jobIntervals) clearInterval(timer);\n for (const timer of this.completionTimers) clearTimeout(timer);\n for (const [id, delivery] of this.activeJobs) {\n this.center.update(id, { title: 'Demo job stopped', message: 'The example page was closed before this job finished.', tone: 'warning', progress: undefined });\n if (delivery === 'top') this.center.dismissToast(id);\n }\n for (const id of this.completedToasts) this.center.dismissToast(id);\n });\n }\n\n startJob(delivery: 'top' | 'inbox'): void {\n const running = delivery === 'top' ? this.toastJobRunning : this.inboxJobRunning;\n if (running()) return;\n running.set(true);\n if (delivery === 'top') this.inlineProgress.set(0);\n\n const inboxOnly = delivery === 'inbox';\n const id = this.center.publish({\n title: inboxOnly ? 'Synchronizing account' : 'Generating report',\n message: inboxOnly ? 'This job appears only in the notification panel.' : 'Progress is visible here and in the toast.',\n tone: 'info', delivery, duration: 0, persist: true,\n progress: { value: 0, appearance: inboxOnly ? 'segmented' : 'solid', color: 'info', showPercent: true },\n });\n this.activeJobs.set(id, delivery);\n this.lastAction.set(inboxOnly ? 'Inbox-only job started. Open the bell to follow it.' : 'Report job started.');\n\n let value = 0;\n const timer = setInterval(() => {\n if (!this.center.entries().some(entry => entry.id === id)) {\n clearInterval(timer);\n this.jobIntervals.delete(timer);\n this.activeJobs.delete(id);\n running.set(false);\n return;\n }\n value = Math.min(100, value + 10);\n this.center.update(id, { progress: { value, appearance: inboxOnly ? 'segmented' : 'solid', color: value === 100 ? 'success' : 'info', showPercent: true } });\n if (!inboxOnly) this.inlineProgress.set(value);\n if (value < 100) return;\n\n clearInterval(timer);\n this.jobIntervals.delete(timer);\n this.activeJobs.delete(id);\n running.set(false);\n this.center.update(id, {\n title: inboxOnly ? 'Account synchronized' : 'Report ready',\n message: inboxOnly ? 'The inbox-only job finished.' : 'The report job finished successfully.',\n tone: 'success',\n });\n this.lastAction.set(inboxOnly ? 'Inbox-only job finished.' : 'Report job finished.');\n if (!inboxOnly) {\n this.completedToasts.add(id);\n const completion = setTimeout(() => {\n this.center.dismissToast(id);\n this.completedToasts.delete(id);\n this.completionTimers.delete(completion);\n }, 2500);\n this.completionTimers.add(completion);\n }\n }, 500);\n this.jobIntervals.add(timer);\n }\n\n show(delivery: GoodNotificationDelivery): void {\n this.center.publish({\n title: delivery === 'inbox' ? 'Inbox-only notice' : 'Your changes were saved',\n message: delivery === 'inbox' ? 'Open the bell to find this message.' : 'This message also stays in the notification panel.',\n tone: delivery === 'inbox' ? 'brand' : 'success',\n delivery,\n });\n }\n\n requireAcknowledgement(): void {\n this.center.publish({\n title: 'Review required', message: 'This notification stays until you acknowledge it.',\n tone: 'warning', appearance: 'light', requireAcknowledgement: true, delivery: 'top',\n });\n }\n\n showActions(): void {\n this.center.publish({\n title: 'New feature available', message: 'Try the Alert component and its reusable actions.',\n tone: 'info', appearance: 'outline', delivery: 'toast', duration: 10000,\n actions: [\n { label: 'View alerts', route: '/components/alerts' },\n { label: 'Remind me later', run: () => this.lastAction.set('Remind me later selected.') },\n ],\n });\n }\n\n showTemporary(): void {\n this.center.publish({\n title: 'Temporary toast', message: 'This toast disappears after three seconds and is not stored.',\n tone: 'neutral', duration: 3000, persist: false,\n });\n }\n}\n";
2
+ export const notificationsHtml = "<good-main-view>\n <good-heading-1>Notifications</good-heading-1>\n <good-summary>Try alerts, job progress, timed toasts, acknowledgement, and the notification panel.</good-summary>\n <good-section>\n <good-breadcrumbs [items]=\"breadcrumbs\" />\n <good-group title=\"Inline alerts\" appearance=\"plain\">\n <good-alert tone=\"info\" title=\"Always in context\" message=\"An inline alert remains in the page until your application removes it.\" />\n <good-alert tone=\"success\" appearance=\"light\" title=\"Changes saved\"\n message=\"Your preferences were saved successfully.\" />\n <good-alert tone=\"warning\" appearance=\"mono\" title=\"Quiet visual style\"\n message=\"Mono keeps the message neutral and uses color only on the icon.\" />\n <good-alert tone=\"destructive\" appearance=\"light\" title=\"Dismissible\"\n message=\"Close this example with its accessible button.\" [dismissible]=\"true\" />\n </good-group>\n <good-group title=\"Send a notification\" appearance=\"plain\">\n <good-action-group orientation=\"responsive\">\n <good-button (click)=\"show('toast')\">Success toast at top right</good-button>\n <good-button variant=\"secondary\" (click)=\"show('top')\">Slide from top</good-button>\n <good-button variant=\"outline\" (click)=\"show('inbox')\">Inbox only</good-button>\n </good-action-group>\n <good-action-group orientation=\"responsive\">\n <good-button variant=\"secondary\" (click)=\"requireAcknowledgement()\">Wait for acknowledgement</good-button>\n <good-button variant=\"outline\" (click)=\"showActions()\">Toast with actions</good-button>\n <good-button variant=\"ghost\" (click)=\"showTemporary()\">Toast without history</good-button>\n </good-action-group>\n <good-alert tone=\"neutral\" appearance=\"light\" title=\"Notification panel\"\n message=\"Open the bell to review saved messages. Toast without history uses persist: false and leaves no panel entry.\" />\n <p role=\"status\">{{ lastAction() }}</p>\n </good-group>\n <good-group title=\"Jobs with progress\" appearance=\"plain\">\n <good-action-group orientation=\"responsive\">\n <good-button (click)=\"startJob('top')\" [disabled]=\"toastJobRunning()\">Run report job</good-button>\n <good-button variant=\"outline\" (click)=\"startJob('inbox')\" [disabled]=\"inboxJobRunning()\">Run inbox-only job</good-button>\n </good-action-group>\n @if (inlineProgress() !== null) {\n <good-alert [tone]=\"inlineProgress() === 100 ? 'success' : 'info'\"\n [title]=\"inlineProgress() === 100 ? 'Report ready' : 'Generating report'\"\n message=\"This job updates here and in its notification.\">\n <good-progress title=\"Report generation\" [value]=\"inlineProgress() ?? 0\"\n [showPercent]=\"true\" [color]=\"inlineProgress() === 100 ? 'success' : 'info'\" />\n </good-alert>\n }\n <good-alert tone=\"neutral\" appearance=\"light\" title=\"Inbox-only job\"\n message=\"The second job has no toast or inline status. Open the bell to follow its progress.\" />\n </good-group>\n <good-group title=\"Use this example\" appearance=\"plain\">\n <good-code-block [code]=\"htmlSource\" language=\"html\" title=\"notifications-page.html\"\n [collapsible]=\"true\" [collapsedLines]=\"20\" />\n <good-code-block [code]=\"typescriptSource\" language=\"typescript\" title=\"notifications-page.ts\"\n [collapsible]=\"true\" [collapsedLines]=\"20\" />\n </good-group>\n </good-section>\n</good-main-view>\n";
3
+ export const notificationsTs = "import { ChangeDetectionStrategy, Component, DestroyRef, inject, signal } from '@angular/core';\nimport { GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent, GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodNotificationCenter, GoodNotificationDelivery, GoodProgressComponent, GoodSectionComponent, type GoodBreadcrumbItem, GoodHeading1Component, GoodSummaryComponent } from '@cloudfrogger/goodui';\nimport { notificationsHtml, notificationsTs } from './source-code.generated';\n\n@Component({\n selector: 'example-notifications-page',\n standalone: true,\n imports: [GoodMainViewComponent, GoodSectionComponent, GoodBreadcrumbsComponent, GoodGroupComponent, GoodActionGroupComponent, GoodButtonComponent, GoodAlertComponent, GoodCodeBlockComponent, GoodProgressComponent, GoodHeading1Component, GoodSummaryComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './notifications-page.html',\n})\nexport class NotificationsPageComponent {\n readonly center = inject(GoodNotificationCenter);\n private readonly destroyRef = inject(DestroyRef);\n private readonly jobIntervals = new Set<ReturnType<typeof setInterval>>();\n private readonly completionTimers = new Set<ReturnType<typeof setTimeout>>();\n private readonly activeJobs = new Map<string, 'top' | 'inbox'>();\n private readonly completedToasts = new Set<string>();\n readonly breadcrumbs: readonly GoodBreadcrumbItem[] = [\n { label: 'Home', route: '/dashboard' }, { label: 'Examples' }, { label: 'Notifications' },\n ];\n readonly lastAction = signal('No action selected yet.');\n readonly inlineProgress = signal<number | null>(null);\n readonly toastJobRunning = signal(false);\n readonly inboxJobRunning = signal(false);\n readonly htmlSource = notificationsHtml;\n readonly typescriptSource = notificationsTs;\n\n constructor() {\n this.destroyRef.onDestroy(() => {\n for (const timer of this.jobIntervals) clearInterval(timer);\n for (const timer of this.completionTimers) clearTimeout(timer);\n for (const [id, delivery] of this.activeJobs) {\n this.center.update(id, { title: 'Demo job stopped', message: 'The example page was closed before this job finished.', tone: 'warning', progress: undefined });\n if (delivery === 'top') this.center.dismissToast(id);\n }\n for (const id of this.completedToasts) this.center.dismissToast(id);\n });\n }\n\n startJob(delivery: 'top' | 'inbox'): void {\n const running = delivery === 'top' ? this.toastJobRunning : this.inboxJobRunning;\n if (running()) return;\n running.set(true);\n if (delivery === 'top') this.inlineProgress.set(0);\n\n const inboxOnly = delivery === 'inbox';\n const id = this.center.publish({\n title: inboxOnly ? 'Synchronizing account' : 'Generating report',\n message: inboxOnly ? 'This job appears only in the notification panel.' : 'Progress is visible here and in the toast.',\n tone: 'info', delivery, duration: 0, persist: true,\n progress: { value: 0, appearance: inboxOnly ? 'segmented' : 'solid', color: 'info', showPercent: true },\n });\n this.activeJobs.set(id, delivery);\n this.lastAction.set(inboxOnly ? 'Inbox-only job started. Open the bell to follow it.' : 'Report job started.');\n\n let value = 0;\n const timer = setInterval(() => {\n if (!this.center.entries().some(entry => entry.id === id)) {\n clearInterval(timer);\n this.jobIntervals.delete(timer);\n this.activeJobs.delete(id);\n running.set(false);\n return;\n }\n value = Math.min(100, value + 10);\n this.center.update(id, { progress: { value, appearance: inboxOnly ? 'segmented' : 'solid', color: value === 100 ? 'success' : 'info', showPercent: true } });\n if (!inboxOnly) this.inlineProgress.set(value);\n if (value < 100) return;\n\n clearInterval(timer);\n this.jobIntervals.delete(timer);\n this.activeJobs.delete(id);\n running.set(false);\n this.center.update(id, {\n title: inboxOnly ? 'Account synchronized' : 'Report ready',\n message: inboxOnly ? 'The inbox-only job finished.' : 'The report job finished successfully.',\n tone: 'success',\n });\n this.lastAction.set(inboxOnly ? 'Inbox-only job finished.' : 'Report job finished.');\n if (!inboxOnly) {\n this.completedToasts.add(id);\n const completion = setTimeout(() => {\n this.center.dismissToast(id);\n this.completedToasts.delete(id);\n this.completionTimers.delete(completion);\n }, 2500);\n this.completionTimers.add(completion);\n }\n }, 500);\n this.jobIntervals.add(timer);\n }\n\n show(delivery: GoodNotificationDelivery): void {\n this.center.publish({\n title: delivery === 'inbox' ? 'Inbox-only notice' : 'Your changes were saved',\n message: delivery === 'inbox' ? 'Open the bell to find this message.' : 'This message also stays in the notification panel.',\n tone: delivery === 'inbox' ? 'brand' : 'success',\n delivery,\n });\n }\n\n requireAcknowledgement(): void {\n this.center.publish({\n title: 'Review required', message: 'This notification stays until you acknowledge it.',\n tone: 'warning', appearance: 'light', requireAcknowledgement: true, delivery: 'top',\n });\n }\n\n showActions(): void {\n this.center.publish({\n title: 'New feature available', message: 'Try the Alert component and its reusable actions.',\n tone: 'info', appearance: 'outline', delivery: 'toast', duration: 10000,\n actions: [\n { label: 'View alerts', route: '/components/alerts' },\n { label: 'Remind me later', run: () => this.lastAction.set('Remind me later selected.') },\n ],\n });\n }\n\n showTemporary(): void {\n this.center.publish({\n title: 'Temporary toast', message: 'This toast disappears after three seconds and is not stored.',\n tone: 'neutral', duration: 3000, persist: false,\n });\n }\n}\n";
@@ -1,4 +1,6 @@
1
- <good-main-view title="PDF reader" description="Open several local PDFs with the reusable GoodUI preview.">
1
+ <good-main-view>
2
+ <good-heading-1>PDF reader</good-heading-1>
3
+ <good-summary>Open several local PDFs with the reusable GoodUI preview.</good-summary>
2
4
  <good-section>
3
5
  <good-breadcrumbs [items]="breadcrumbs" />
4
6
  <good-group title="Choose a document" appearance="plain">
@@ -1,9 +1,5 @@
1
1
  import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
2
- import {
3
- GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent,
4
- GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodPdfPreviewComponent,
5
- GoodSectionComponent, type GoodBreadcrumbItem,
6
- } from '@cloudfrogger/goodui';
2
+ import { GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent, GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodPdfPreviewComponent, GoodSectionComponent, type GoodBreadcrumbItem, GoodHeading1Component, GoodSummaryComponent } from '@cloudfrogger/goodui';
7
3
  import { pdfReaderHtml, pdfReaderTs } from './source-code.generated';
8
4
 
9
5
  interface SamplePdf { name: string; file: string; description: string }
@@ -11,8 +7,7 @@ interface SamplePdf { name: string; file: string; description: string }
11
7
  @Component({
12
8
  selector: 'example-pdf-reader-page',
13
9
  standalone: true,
14
- imports: [GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent,
15
- GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodPdfPreviewComponent, GoodSectionComponent],
10
+ imports: [GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent, GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodPdfPreviewComponent, GoodSectionComponent, GoodHeading1Component, GoodSummaryComponent],
16
11
  changeDetection: ChangeDetectionStrategy.OnPush,
17
12
  templateUrl: './pdf-reader-page.html',
18
13
  })
@@ -1,3 +1,3 @@
1
1
  // Generated from the editable example files. Run npm run examples:sync after changing them.
2
- export const pdfReaderHtml = "<good-main-view title=\"PDF reader\" description=\"Open several local PDFs with the reusable GoodUI preview.\">\n <good-section>\n <good-breadcrumbs [items]=\"breadcrumbs\" />\n <good-group title=\"Choose a document\" appearance=\"plain\">\n <good-action-group orientation=\"responsive\">\n @for (sample of samples; track sample.file) {\n <good-button [variant]=\"selected().file === sample.file ? 'default' : 'outline'\"\n (click)=\"choose(sample)\">{{ sample.name }}</good-button>\n }\n </good-action-group>\n <good-alert tone=\"neutral\" appearance=\"light\" [title]=\"selected().name\"\n [message]=\"selected().description + (pageCount() ? ' · ' + pageCount() + (pageCount() === 1 ? ' page ready' : ' pages ready') : '')\" />\n </good-group>\n <good-group title=\"Preview\" appearance=\"plain\">\n <good-pdf-preview [source]=\"selected().file\" [title]=\"selected().name\" workerUrl=\"/pdf.worker.min.mjs\"\n [downloadName]=\"selected().file.split('/').at(-1) ?? 'document.pdf'\"\n (loaded)=\"pageCount.set($event)\" (loadError)=\"error.set($event)\" />\n @if (error()) { <good-alert tone=\"destructive\" [message]=\"error()\" /> }\n </good-group>\n <good-group title=\"Use this example\" appearance=\"plain\">\n <good-code-block [code]=\"htmlSource\" language=\"html\" title=\"pdf-reader-page.html\"\n [collapsible]=\"true\" [collapsedLines]=\"20\" />\n <good-code-block [code]=\"typescriptSource\" language=\"typescript\" title=\"pdf-reader-page.ts\"\n [collapsible]=\"true\" [collapsedLines]=\"20\" />\n </good-group>\n </good-section>\n</good-main-view>\n";
3
- export const pdfReaderTs = "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport {\n GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent,\n GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodPdfPreviewComponent,\n GoodSectionComponent, type GoodBreadcrumbItem,\n} from '@cloudfrogger/goodui';\nimport { pdfReaderHtml, pdfReaderTs } from './source-code.generated';\n\ninterface SamplePdf { name: string; file: string; description: string }\n\n@Component({\n selector: 'example-pdf-reader-page',\n standalone: true,\n imports: [GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent,\n GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodPdfPreviewComponent, GoodSectionComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './pdf-reader-page.html',\n})\nexport class PdfReaderPageComponent {\n readonly breadcrumbs: readonly GoodBreadcrumbItem[] = [\n { label: 'Home', route: '/dashboard' }, { label: 'Examples' }, { label: 'PDF reader' },\n ];\n readonly samples: readonly SamplePdf[] = [\n { name: 'Welcome guide', file: '/pdf/welcome-guide.pdf', description: 'A two-page introduction' },\n { name: 'Project report', file: '/pdf/project-report.pdf', description: 'A three-page status report' },\n { name: 'Sample invoice', file: '/pdf/invoice-sample.pdf', description: 'A one-page invoice' },\n ];\n readonly selected = signal<SamplePdf>(this.samples[0]);\n readonly pageCount = signal(0);\n readonly error = signal('');\n readonly htmlSource = pdfReaderHtml;\n readonly typescriptSource = pdfReaderTs;\n\n choose(sample: SamplePdf): void {\n this.selected.set(sample);\n this.pageCount.set(0);\n this.error.set('');\n }\n}\n";
2
+ export const pdfReaderHtml = "<good-main-view>\n <good-heading-1>PDF reader</good-heading-1>\n <good-summary>Open several local PDFs with the reusable GoodUI preview.</good-summary>\n <good-section>\n <good-breadcrumbs [items]=\"breadcrumbs\" />\n <good-group title=\"Choose a document\" appearance=\"plain\">\n <good-action-group orientation=\"responsive\">\n @for (sample of samples; track sample.file) {\n <good-button [variant]=\"selected().file === sample.file ? 'default' : 'outline'\"\n (click)=\"choose(sample)\">{{ sample.name }}</good-button>\n }\n </good-action-group>\n <good-alert tone=\"neutral\" appearance=\"light\" [title]=\"selected().name\"\n [message]=\"selected().description + (pageCount() ? ' · ' + pageCount() + (pageCount() === 1 ? ' page ready' : ' pages ready') : '')\" />\n </good-group>\n <good-group title=\"Preview\" appearance=\"plain\">\n <good-pdf-preview [source]=\"selected().file\" [title]=\"selected().name\" workerUrl=\"/pdf.worker.min.mjs\"\n [downloadName]=\"selected().file.split('/').at(-1) ?? 'document.pdf'\"\n (loaded)=\"pageCount.set($event)\" (loadError)=\"error.set($event)\" />\n @if (error()) { <good-alert tone=\"destructive\" [message]=\"error()\" /> }\n </good-group>\n <good-group title=\"Use this example\" appearance=\"plain\">\n <good-code-block [code]=\"htmlSource\" language=\"html\" title=\"pdf-reader-page.html\"\n [collapsible]=\"true\" [collapsedLines]=\"20\" />\n <good-code-block [code]=\"typescriptSource\" language=\"typescript\" title=\"pdf-reader-page.ts\"\n [collapsible]=\"true\" [collapsedLines]=\"20\" />\n </good-group>\n </good-section>\n</good-main-view>\n";
3
+ export const pdfReaderTs = "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent, GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodPdfPreviewComponent, GoodSectionComponent, type GoodBreadcrumbItem, GoodHeading1Component, GoodSummaryComponent } from '@cloudfrogger/goodui';\nimport { pdfReaderHtml, pdfReaderTs } from './source-code.generated';\n\ninterface SamplePdf { name: string; file: string; description: string }\n\n@Component({\n selector: 'example-pdf-reader-page',\n standalone: true,\n imports: [GoodActionGroupComponent, GoodAlertComponent, GoodBreadcrumbsComponent, GoodButtonComponent, GoodCodeBlockComponent, GoodGroupComponent, GoodMainViewComponent, GoodPdfPreviewComponent, GoodSectionComponent, GoodHeading1Component, GoodSummaryComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './pdf-reader-page.html',\n})\nexport class PdfReaderPageComponent {\n readonly breadcrumbs: readonly GoodBreadcrumbItem[] = [\n { label: 'Home', route: '/dashboard' }, { label: 'Examples' }, { label: 'PDF reader' },\n ];\n readonly samples: readonly SamplePdf[] = [\n { name: 'Welcome guide', file: '/pdf/welcome-guide.pdf', description: 'A two-page introduction' },\n { name: 'Project report', file: '/pdf/project-report.pdf', description: 'A three-page status report' },\n { name: 'Sample invoice', file: '/pdf/invoice-sample.pdf', description: 'A one-page invoice' },\n ];\n readonly selected = signal<SamplePdf>(this.samples[0]);\n readonly pageCount = signal(0);\n readonly error = signal('');\n readonly htmlSource = pdfReaderHtml;\n readonly typescriptSource = pdfReaderTs;\n\n choose(sample: SamplePdf): void {\n this.selected.set(sample);\n this.pageCount.set(0);\n this.error.set('');\n }\n}\n";
@@ -1,5 +1,5 @@
1
1
  // Generated from the editable example files. Run npm run examples:sync after changing them.
2
- export const userRegistrationPageHtml = "<good-main-view>\n <good-section>\n <good-breadcrumbs [items]=\"breadcrumbs\" />\n <good-heading-group>\n <good-heading>User registration</good-heading>\n <good-summary>A complete registration form composed entirely from GoodUI components</good-summary>\n </good-heading-group>\n <example-user-registration-form />\n <ng-content />\n </good-section>\n</good-main-view>\n";
3
- export const userRegistrationPageTs = "import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport {\n GoodBreadcrumbsComponent, GoodHeadingComponent, GoodHeadingGroupComponent,\n GoodMainViewComponent, GoodSectionComponent, GoodSummaryComponent, type GoodBreadcrumbItem,\n} from '@cloudfrogger/goodui';\nimport { UserRegistrationFormExampleComponent } from './user-registration-form';\n\n@Component({\n selector: 'example-user-registration-page',\n standalone: true,\n imports: [GoodMainViewComponent, GoodSectionComponent, GoodBreadcrumbsComponent,\n GoodHeadingGroupComponent, GoodHeadingComponent, GoodSummaryComponent,\n UserRegistrationFormExampleComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './user-registration-page.html',\n})\nexport class UserRegistrationPageComponent {\n readonly breadcrumbs: readonly GoodBreadcrumbItem[] = [\n { label: 'Home', route: '/dashboard' },\n { label: 'Examples' },\n { label: 'User registration' },\n ];\n}\n";
2
+ export const userRegistrationPageHtml = "<good-main-view>\n <good-section>\n <good-breadcrumbs [items]=\"breadcrumbs\" />\n <good-heading-group>\n <good-heading-1>User registration</good-heading-1>\n <good-summary>A complete registration form composed entirely from GoodUI components</good-summary>\n </good-heading-group>\n <example-user-registration-form />\n <ng-content />\n </good-section>\n</good-main-view>\n";
3
+ export const userRegistrationPageTs = "import { ChangeDetectionStrategy, Component } from '@angular/core';\nimport { GoodBreadcrumbsComponent, GoodHeadingGroupComponent, GoodMainViewComponent, GoodSectionComponent, GoodSummaryComponent, type GoodBreadcrumbItem, GoodHeading1Component } from '@cloudfrogger/goodui';\nimport { UserRegistrationFormExampleComponent } from './user-registration-form';\n\n@Component({\n selector: 'example-user-registration-page',\n standalone: true,\n imports: [GoodMainViewComponent, GoodSectionComponent, GoodBreadcrumbsComponent, GoodHeadingGroupComponent, GoodSummaryComponent, UserRegistrationFormExampleComponent, GoodHeading1Component],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './user-registration-page.html',\n})\nexport class UserRegistrationPageComponent {\n readonly breadcrumbs: readonly GoodBreadcrumbItem[] = [\n { label: 'Home', route: '/dashboard' },\n { label: 'Examples' },\n { label: 'User registration' },\n ];\n}\n";
4
4
  export const userRegistrationFormHtml = "<form goodForm layout=\"vertical\" [fullWidth]=\"true\" [formGroup]=\"form\" (ngSubmit)=\"createUser()\" novalidate>\n <good-group title=\"Personal details\" [headingLevel]=\"2\" [mobileBleed]=\"true\">\n <good-radio-group label=\"Title\" orientation=\"horizontal\" [options]=\"salutations\"\n formControlName=\"salutation\" />\n <good-form-row [columns]=\"3\">\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-first-name\">First name</good-field-label>\n <good-input inputId=\"registration-first-name\" label=\"First name\" autocomplete=\"given-name\"\n formControlName=\"firstName\" [error]=\"isInvalid('firstName')\" />\n @if (isInvalid('firstName')) { <good-error-text>Enter your first name.</good-error-text> }\n </good-form-field>\n <good-form-field>\n <good-field-label forId=\"registration-middle-name\">Middle name</good-field-label>\n <good-input inputId=\"registration-middle-name\" label=\"Middle name\" autocomplete=\"additional-name\"\n formControlName=\"middleName\" />\n </good-form-field>\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-last-name\">Last name</good-field-label>\n <good-input inputId=\"registration-last-name\" label=\"Last name\" autocomplete=\"family-name\"\n formControlName=\"lastName\" [error]=\"isInvalid('lastName')\" />\n @if (isInvalid('lastName')) { <good-error-text>Enter your last name.</good-error-text> }\n </good-form-field>\n </good-form-row>\n </good-group>\n <good-group title=\"Address\" [headingLevel]=\"2\" [mobileBleed]=\"true\">\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-street\">Street address</good-field-label>\n <good-input inputId=\"registration-street\" label=\"Street address\" autocomplete=\"street-address\"\n formControlName=\"streetAddress\" [error]=\"isInvalid('streetAddress')\" />\n @if (isInvalid('streetAddress')) { <good-error-text>Enter your street address.</good-error-text> }\n </good-form-field>\n <good-form-row [columns]=\"3\">\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-postal-code\">Postal code</good-field-label>\n <good-input inputId=\"registration-postal-code\" label=\"Postal code\" autocomplete=\"postal-code\"\n formControlName=\"postalCode\" [error]=\"isInvalid('postalCode')\" />\n @if (isInvalid('postalCode')) { <good-error-text>Enter your postal code.</good-error-text> }\n </good-form-field>\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-city\">City</good-field-label>\n <good-input inputId=\"registration-city\" label=\"City\" autocomplete=\"address-level2\"\n formControlName=\"city\" [error]=\"isInvalid('city')\" />\n @if (isInvalid('city')) { <good-error-text>Enter your city.</good-error-text> }\n </good-form-field>\n <good-form-field>\n <good-select-country label=\"Country\" [showLabel]=\"true\" [required]=\"true\"\n formControlName=\"country\" [error]=\"isInvalid('country')\" />\n @if (isInvalid('country')) { <good-error-text>Select a country.</good-error-text> }\n </good-form-field>\n </good-form-row>\n </good-group>\n <good-group title=\"Contact details\" appearance=\"contrast\" [headingLevel]=\"2\" [mobileBleed]=\"true\">\n <good-form-row>\n <good-form-field>\n <good-field-label forId=\"registration-phone\">Phone number</good-field-label>\n <good-input-phone inputId=\"registration-phone\" label=\"Phone number\" formControlName=\"phone\"\n [country]=\"form.controls.country.value\" [error]=\"isInvalid('phone')\" />\n <good-hint>Optional landline number.</good-hint>\n </good-form-field>\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-mobile\">Mobile number</good-field-label>\n <good-input-phone inputId=\"registration-mobile\" label=\"Mobile number\" formControlName=\"mobile\"\n [country]=\"form.controls.country.value\" [error]=\"isInvalid('mobile')\" />\n @if (isInvalid('mobile')) { <good-error-text>Enter a mobile number.</good-error-text> }\n </good-form-field>\n </good-form-row>\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-email\">Email address</good-field-label>\n <good-input inputId=\"registration-email\" label=\"Email address\" type=\"email\" autocomplete=\"email\"\n formControlName=\"email\" [error]=\"isInvalid('email')\" />\n @if (isInvalid('email')) { <good-error-text>Enter a valid email address.</good-error-text> }\n </good-form-field>\n </good-group>\n <good-group title=\"Preferences\" [headingLevel]=\"2\" [mobileBleed]=\"true\">\n <good-listbox label=\"Interests\" [showLabel]=\"true\" [groups]=\"interestGroups\"\n selectionMode=\"multiple\" appearance=\"checkbox\" formControlName=\"interests\" />\n <good-hint>Optional. Select any interests you would like to share.</good-hint>\n <good-form-field>\n <good-field-label forId=\"registration-bio\">About you</good-field-label>\n <good-textarea inputId=\"registration-bio\" label=\"About you\" formControlName=\"bio\"\n placeholder=\"Share a little about yourself\" [resizable]=\"true\" />\n <good-hint>Optional. A short introduction for your profile.</good-hint>\n </good-form-field>\n </good-group>\n <good-group title=\"Account security\" [headingLevel]=\"2\" [mobileBleed]=\"true\">\n <good-form-row>\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-password\">Password</good-field-label>\n <good-input inputId=\"registration-password\" label=\"Password\" type=\"password\" autocomplete=\"new-password\"\n formControlName=\"password\" [error]=\"isInvalid('password')\" />\n @if (isInvalid('password')) { <good-error-text>Enter a password.</good-error-text> }\n </good-form-field>\n <good-form-field [required]=\"true\">\n <good-field-label forId=\"registration-confirm-password\">Confirm password</good-field-label>\n <good-input inputId=\"registration-confirm-password\" label=\"Confirm password\" type=\"password\"\n autocomplete=\"new-password\" formControlName=\"confirmPassword\"\n [error]=\"isInvalid('confirmPassword') || confirmationMismatch()\" />\n @if (confirmationMismatch()) { <good-error-text>Passwords must match.</good-error-text> }\n @else if (isInvalid('confirmPassword')) { <good-error-text>Confirm your password.</good-error-text> }\n </good-form-field>\n </good-form-row>\n </good-group>\n <good-action-group><good-button type=\"submit\">Create user</good-button></good-action-group>\n @if (submitted() && form.invalid) {\n <good-error-text>Review the highlighted fields before creating a user.</good-error-text>\n }\n</form>\n@if (createdUser(); as user) {\n <good-card [mobileBleed]=\"true\">\n <good-card-header title=\"User created in this demo\" />\n <good-paragraph>{{ user.name }} · {{ user.email }}</good-paragraph>\n @if (user.interests.length) { <good-paragraph>Interests: {{ user.interests.join(', ') }}</good-paragraph> }\n @if (user.bio) { <good-paragraph>About: {{ user.bio }}</good-paragraph> }\n <good-hint>This example validates locally and does not save the user to a server.</good-hint>\n </good-card>\n}\n";
5
- export const userRegistrationFormTs = "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, FormGroup, ReactiveFormsModule, ValidatorFn, Validators } from '@angular/forms';\nimport {\n GoodActionGroupComponent, GoodButtonComponent, GoodCardComponent, GoodCardHeaderComponent,\n GoodErrorTextComponent, GoodFieldLabelComponent, GoodFormDirective, GoodFormFieldComponent,\n GoodFormRowComponent, GoodGroupComponent, GoodHintComponent, GoodInputComponent,\n GoodInputPhoneComponent, GoodListboxComponent, GoodListboxGroup, GoodParagraphComponent,\n GoodRadioGroupComponent, GoodSelectCountryComponent,\n GoodTextareaComponent,\n} from '@cloudfrogger/goodui';\n\nconst passwordsMatch: ValidatorFn = form => {\n const password = form.get('password')?.value;\n const confirmation = form.get('confirmPassword')?.value;\n return password && confirmation && password !== confirmation ? { passwordsMismatch: true } : null;\n};\n\n@Component({\n selector: 'example-user-registration-form', standalone: true,\n imports: [ReactiveFormsModule, GoodActionGroupComponent, GoodButtonComponent, GoodCardComponent,\n GoodCardHeaderComponent, GoodErrorTextComponent, GoodFieldLabelComponent, GoodFormDirective,\n GoodFormFieldComponent, GoodFormRowComponent, GoodGroupComponent, GoodHintComponent,\n GoodInputComponent, GoodInputPhoneComponent, GoodListboxComponent, GoodParagraphComponent, GoodRadioGroupComponent,\n GoodSelectCountryComponent, GoodTextareaComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './user-registration-form.html',\n})\nexport class UserRegistrationFormExampleComponent {\n readonly form = new FormGroup({\n salutation: new FormControl('none', { nonNullable: true }),\n firstName: new FormControl('', { nonNullable: true, validators: Validators.required }),\n middleName: new FormControl('', { nonNullable: true }),\n lastName: new FormControl('', { nonNullable: true, validators: Validators.required }),\n streetAddress: new FormControl('', { nonNullable: true, validators: Validators.required }),\n postalCode: new FormControl('', { nonNullable: true, validators: Validators.required }),\n city: new FormControl('', { nonNullable: true, validators: Validators.required }),\n country: new FormControl<string | null>(null, Validators.required),\n phone: new FormControl('', { nonNullable: true }),\n mobile: new FormControl('', { nonNullable: true, validators: Validators.required }),\n email: new FormControl('', { nonNullable: true, validators: [Validators.required, Validators.email] }),\n interests: new FormControl<readonly string[]>([], { nonNullable: true }),\n bio: new FormControl('', { nonNullable: true }),\n password: new FormControl('', { nonNullable: true, validators: Validators.required }),\n confirmPassword: new FormControl('', { nonNullable: true, validators: Validators.required }),\n }, { validators: passwordsMatch });\n readonly submitted = signal(false);\n readonly salutations = [\n { value: 'mr', label: 'Mr.' },\n { value: 'ms', label: 'Ms.' },\n { value: 'none', label: 'No title' },\n ];\n readonly interestGroups: readonly GoodListboxGroup[] = [\n { id: 'creative', label: 'Creative', items: [\n { id: 'design', label: 'Design' },\n { id: 'photography', label: 'Photography' },\n ] },\n { id: 'outdoors', label: 'Outdoors', items: [\n { id: 'hiking', label: 'Hiking' },\n { id: 'gardening', label: 'Gardening' },\n ] },\n ];\n readonly createdUser = signal<{ name: string; email: string; interests: readonly string[]; bio: string } | null>(null);\n\n constructor() {\n this.form.valueChanges.pipe(takeUntilDestroyed()).subscribe(() => this.createdUser.set(null));\n }\n\n isInvalid(name: keyof typeof this.form.controls): boolean {\n const control = this.form.controls[name];\n return control.invalid && (control.touched || this.submitted());\n }\n\n confirmationMismatch(): boolean {\n return this.form.hasError('passwordsMismatch') &&\n (this.form.controls.confirmPassword.touched || this.submitted());\n }\n\n createUser(): void {\n this.submitted.set(true);\n this.form.markAllAsTouched();\n if (this.form.invalid) return;\n const user = this.form.getRawValue();\n const interestLabels = this.interestGroups.flatMap(group => group.items)\n .filter(item => user.interests.includes(item.id)).map(item => item.label);\n this.createdUser.set({\n name: [user.firstName, user.middleName, user.lastName].filter(Boolean).join(' '),\n email: user.email,\n interests: interestLabels,\n bio: user.bio.trim(),\n });\n }\n}\n";
5
+ export const userRegistrationFormTs = "import { ChangeDetectionStrategy, Component, signal } from '@angular/core';\nimport { takeUntilDestroyed } from '@angular/core/rxjs-interop';\nimport { FormControl, FormGroup, ReactiveFormsModule, ValidatorFn, Validators } from '@angular/forms';\nimport { GoodActionGroupComponent, GoodButtonComponent, GoodCardComponent, GoodCardHeaderComponent, GoodErrorTextComponent, GoodFieldLabelComponent, GoodFormDirective, GoodFormFieldComponent, GoodFormRowComponent, GoodGroupComponent, GoodHintComponent, GoodInputComponent, GoodInputPhoneComponent, GoodListboxComponent, GoodListboxGroup, GoodParagraphComponent, GoodRadioGroupComponent, GoodSelectCountryComponent, GoodTextareaComponent } from '@cloudfrogger/goodui';\n\nconst passwordsMatch: ValidatorFn = form => {\n const password = form.get('password')?.value;\n const confirmation = form.get('confirmPassword')?.value;\n return password && confirmation && password !== confirmation ? { passwordsMismatch: true } : null;\n};\n\n@Component({\n selector: 'example-user-registration-form', standalone: true,\n imports: [ReactiveFormsModule, GoodActionGroupComponent, GoodButtonComponent, GoodCardComponent, GoodCardHeaderComponent, GoodErrorTextComponent, GoodFieldLabelComponent, GoodFormDirective, GoodFormFieldComponent, GoodFormRowComponent, GoodGroupComponent, GoodHintComponent, GoodInputComponent, GoodInputPhoneComponent, GoodListboxComponent, GoodParagraphComponent, GoodRadioGroupComponent, GoodSelectCountryComponent, GoodTextareaComponent],\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './user-registration-form.html',\n})\nexport class UserRegistrationFormExampleComponent {\n readonly form = new FormGroup({\n salutation: new FormControl('none', { nonNullable: true }),\n firstName: new FormControl('', { nonNullable: true, validators: Validators.required }),\n middleName: new FormControl('', { nonNullable: true }),\n lastName: new FormControl('', { nonNullable: true, validators: Validators.required }),\n streetAddress: new FormControl('', { nonNullable: true, validators: Validators.required }),\n postalCode: new FormControl('', { nonNullable: true, validators: Validators.required }),\n city: new FormControl('', { nonNullable: true, validators: Validators.required }),\n country: new FormControl<string | null>(null, Validators.required),\n phone: new FormControl('', { nonNullable: true }),\n mobile: new FormControl('', { nonNullable: true, validators: Validators.required }),\n email: new FormControl('', { nonNullable: true, validators: [Validators.required, Validators.email] }),\n interests: new FormControl<readonly string[]>([], { nonNullable: true }),\n bio: new FormControl('', { nonNullable: true }),\n password: new FormControl('', { nonNullable: true, validators: Validators.required }),\n confirmPassword: new FormControl('', { nonNullable: true, validators: Validators.required }),\n }, { validators: passwordsMatch });\n readonly submitted = signal(false);\n readonly salutations = [\n { value: 'mr', label: 'Mr.' },\n { value: 'ms', label: 'Ms.' },\n { value: 'none', label: 'No title' },\n ];\n readonly interestGroups: readonly GoodListboxGroup[] = [\n { id: 'creative', label: 'Creative', items: [\n { id: 'design', label: 'Design' },\n { id: 'photography', label: 'Photography' },\n ] },\n { id: 'outdoors', label: 'Outdoors', items: [\n { id: 'hiking', label: 'Hiking' },\n { id: 'gardening', label: 'Gardening' },\n ] },\n ];\n readonly createdUser = signal<{ name: string; email: string; interests: readonly string[]; bio: string } | null>(null);\n\n constructor() {\n this.form.valueChanges.pipe(takeUntilDestroyed()).subscribe(() => this.createdUser.set(null));\n }\n\n isInvalid(name: keyof typeof this.form.controls): boolean {\n const control = this.form.controls[name];\n return control.invalid && (control.touched || this.submitted());\n }\n\n confirmationMismatch(): boolean {\n return this.form.hasError('passwordsMismatch') &&\n (this.form.controls.confirmPassword.touched || this.submitted());\n }\n\n createUser(): void {\n this.submitted.set(true);\n this.form.markAllAsTouched();\n if (this.form.invalid) return;\n const user = this.form.getRawValue();\n const interestLabels = this.interestGroups.flatMap(group => group.items)\n .filter(item => user.interests.includes(item.id)).map(item => item.label);\n this.createdUser.set({\n name: [user.firstName, user.middleName, user.lastName].filter(Boolean).join(' '),\n email: user.email,\n interests: interestLabels,\n bio: user.bio.trim(),\n });\n }\n}\n";
@@ -1,5 +1,5 @@
1
1
  <example-user-registration-page>
2
- <good-subheading>Use this example</good-subheading>
2
+ <good-heading-2>Use this example</good-heading-2>
3
3
  <good-code-block [code]="pageMarkup" language="html" title="user-registration-page.html"
4
4
  [collapsible]="true" [collapsedLines]="16" />
5
5
  <good-code-block [code]="pageLogic" language="typescript" title="user-registration-page.ts"
@@ -1,5 +1,5 @@
1
1
  import { ChangeDetectionStrategy, Component } from '@angular/core';
2
- import { GoodCodeBlockComponent, GoodSubheadingComponent } from '@cloudfrogger/goodui';
2
+ import { GoodCodeBlockComponent, GoodHeading2Component } from '@cloudfrogger/goodui';
3
3
  import { UserRegistrationPageComponent } from './user-registration-page';
4
4
  import {
5
5
  userRegistrationFormHtml, userRegistrationFormTs,
@@ -9,7 +9,7 @@ import {
9
9
  @Component({
10
10
  selector: 'showcase-user-registration-example-page',
11
11
  standalone: true,
12
- imports: [UserRegistrationPageComponent, GoodSubheadingComponent, GoodCodeBlockComponent],
12
+ imports: [UserRegistrationPageComponent, GoodCodeBlockComponent, GoodHeading2Component],
13
13
  changeDetection: ChangeDetectionStrategy.OnPush,
14
14
  templateUrl: './user-registration-example-page.html',
15
15
  })
@@ -1,14 +1,7 @@
1
1
  import { ChangeDetectionStrategy, Component, signal } from '@angular/core';
2
2
  import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
3
3
  import { FormControl, FormGroup, ReactiveFormsModule, ValidatorFn, Validators } from '@angular/forms';
4
- import {
5
- GoodActionGroupComponent, GoodButtonComponent, GoodCardComponent, GoodCardHeaderComponent,
6
- GoodErrorTextComponent, GoodFieldLabelComponent, GoodFormDirective, GoodFormFieldComponent,
7
- GoodFormRowComponent, GoodGroupComponent, GoodHintComponent, GoodInputComponent,
8
- GoodInputPhoneComponent, GoodListboxComponent, GoodListboxGroup, GoodParagraphComponent,
9
- GoodRadioGroupComponent, GoodSelectCountryComponent,
10
- GoodTextareaComponent,
11
- } from '@cloudfrogger/goodui';
4
+ import { GoodActionGroupComponent, GoodButtonComponent, GoodCardComponent, GoodCardHeaderComponent, GoodErrorTextComponent, GoodFieldLabelComponent, GoodFormDirective, GoodFormFieldComponent, GoodFormRowComponent, GoodGroupComponent, GoodHintComponent, GoodInputComponent, GoodInputPhoneComponent, GoodListboxComponent, GoodListboxGroup, GoodParagraphComponent, GoodRadioGroupComponent, GoodSelectCountryComponent, GoodTextareaComponent } from '@cloudfrogger/goodui';
12
5
 
13
6
  const passwordsMatch: ValidatorFn = form => {
14
7
  const password = form.get('password')?.value;
@@ -18,11 +11,7 @@ const passwordsMatch: ValidatorFn = form => {
18
11
 
19
12
  @Component({
20
13
  selector: 'example-user-registration-form', standalone: true,
21
- imports: [ReactiveFormsModule, GoodActionGroupComponent, GoodButtonComponent, GoodCardComponent,
22
- GoodCardHeaderComponent, GoodErrorTextComponent, GoodFieldLabelComponent, GoodFormDirective,
23
- GoodFormFieldComponent, GoodFormRowComponent, GoodGroupComponent, GoodHintComponent,
24
- GoodInputComponent, GoodInputPhoneComponent, GoodListboxComponent, GoodParagraphComponent, GoodRadioGroupComponent,
25
- GoodSelectCountryComponent, GoodTextareaComponent],
14
+ imports: [ReactiveFormsModule, GoodActionGroupComponent, GoodButtonComponent, GoodCardComponent, GoodCardHeaderComponent, GoodErrorTextComponent, GoodFieldLabelComponent, GoodFormDirective, GoodFormFieldComponent, GoodFormRowComponent, GoodGroupComponent, GoodHintComponent, GoodInputComponent, GoodInputPhoneComponent, GoodListboxComponent, GoodParagraphComponent, GoodRadioGroupComponent, GoodSelectCountryComponent, GoodTextareaComponent],
26
15
  changeDetection: ChangeDetectionStrategy.OnPush,
27
16
  templateUrl: './user-registration-form.html',
28
17
  })
@@ -2,7 +2,7 @@
2
2
  <good-section>
3
3
  <good-breadcrumbs [items]="breadcrumbs" />
4
4
  <good-heading-group>
5
- <good-heading>User registration</good-heading>
5
+ <good-heading-1>User registration</good-heading-1>
6
6
  <good-summary>A complete registration form composed entirely from GoodUI components</good-summary>
7
7
  </good-heading-group>
8
8
  <example-user-registration-form />
@@ -1,16 +1,11 @@
1
1
  import { ChangeDetectionStrategy, Component } from '@angular/core';
2
- import {
3
- GoodBreadcrumbsComponent, GoodHeadingComponent, GoodHeadingGroupComponent,
4
- GoodMainViewComponent, GoodSectionComponent, GoodSummaryComponent, type GoodBreadcrumbItem,
5
- } from '@cloudfrogger/goodui';
2
+ import { GoodBreadcrumbsComponent, GoodHeadingGroupComponent, GoodMainViewComponent, GoodSectionComponent, GoodSummaryComponent, type GoodBreadcrumbItem, GoodHeading1Component } from '@cloudfrogger/goodui';
6
3
  import { UserRegistrationFormExampleComponent } from './user-registration-form';
7
4
 
8
5
  @Component({
9
6
  selector: 'example-user-registration-page',
10
7
  standalone: true,
11
- imports: [GoodMainViewComponent, GoodSectionComponent, GoodBreadcrumbsComponent,
12
- GoodHeadingGroupComponent, GoodHeadingComponent, GoodSummaryComponent,
13
- UserRegistrationFormExampleComponent],
8
+ imports: [GoodMainViewComponent, GoodSectionComponent, GoodBreadcrumbsComponent, GoodHeadingGroupComponent, GoodSummaryComponent, UserRegistrationFormExampleComponent, GoodHeading1Component],
14
9
  changeDetection: ChangeDetectionStrategy.OnPush,
15
10
  templateUrl: './user-registration-page.html',
16
11
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cloudfrogger/goodui",
3
- "version": "0.0.65",
3
+ "version": "0.0.72",
4
4
  "license": "MIT",
5
5
  "publishConfig": {
6
6
  "access": "public",
@@ -35,5 +35,5 @@
35
35
  "module": "fesm2022/cloudfrogger-goodui.mjs",
36
36
  "typings": "types/cloudfrogger-goodui.d.ts",
37
37
  "type": "module",
38
- "gitHead": "dc83aafa5574436b8f3428c1a88f2dcca98d4e4c"
38
+ "gitHead": "5d1926a175234b41707fd1cda6509178eec00ec2"
39
39
  }