@cloudfrogger/goodui 0.0.60 → 0.0.62
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/ai/README.md +47 -0
- package/ai/case-studies/index.md +10 -0
- package/ai/case-studies/vpshoster.md +18 -0
- package/ai/case-studies/webmailer.md +21 -0
- package/ai/catalog/README.md +7 -0
- package/ai/catalog/component.schema.json +289 -0
- package/ai/catalog/components/div-goodDetailRow.json +33 -0
- package/ai/catalog/components/form-goodForm.json +84 -0
- package/ai/catalog/components/good-action-bar.json +83 -0
- package/ai/catalog/components/good-action-group.json +143 -0
- package/ai/catalog/components/good-action-menu.json +121 -0
- package/ai/catalog/components/good-alert.json +184 -0
- package/ai/catalog/components/good-app-layout.json +245 -0
- package/ai/catalog/components/good-assistant-body.json +43 -0
- package/ai/catalog/components/good-assistant-footer.json +43 -0
- package/ai/catalog/components/good-assistant-header.json +43 -0
- package/ai/catalog/components/good-assistant-main.json +61 -0
- package/ai/catalog/components/good-assistant-mobile.json +43 -0
- package/ai/catalog/components/good-assistant-panel.json +131 -0
- package/ai/catalog/components/good-avatar-menu-item.json +82 -0
- package/ai/catalog/components/good-avatar-menu.json +83 -0
- package/ai/catalog/components/good-badge.json +180 -0
- package/ai/catalog/components/good-bar-chart.json +118 -0
- package/ai/catalog/components/good-brand-icon.json +71 -0
- package/ai/catalog/components/good-breadcrumbs.json +102 -0
- package/ai/catalog/components/good-button.json +192 -0
- package/ai/catalog/components/good-calendar.json +430 -0
- package/ai/catalog/components/good-card-footer.json +63 -0
- package/ai/catalog/components/good-card-header.json +100 -0
- package/ai/catalog/components/good-card.json +57 -0
- package/ai/catalog/components/good-chart-axis.json +168 -0
- package/ai/catalog/components/good-chart-bar.json +89 -0
- package/ai/catalog/components/good-chart-histogram.json +78 -0
- package/ai/catalog/components/good-chart-line.json +89 -0
- package/ai/catalog/components/good-chart-scatter.json +87 -0
- package/ai/catalog/components/good-checkbox.json +171 -0
- package/ai/catalog/components/good-citation.json +62 -0
- package/ai/catalog/components/good-code-block.json +116 -0
- package/ai/catalog/components/good-color-controls.json +58 -0
- package/ai/catalog/components/good-color-picker.json +141 -0
- package/ai/catalog/components/good-column.json +53 -0
- package/ai/catalog/components/good-columns.json +77 -0
- package/ai/catalog/components/good-date-input.json +386 -0
- package/ai/catalog/components/good-detail-list.json +43 -0
- package/ai/catalog/components/good-dropdown.json +259 -0
- package/ai/catalog/components/good-error-page.json +133 -0
- package/ai/catalog/components/good-error-text.json +43 -0
- package/ai/catalog/components/good-expandable.json +159 -0
- package/ai/catalog/components/good-eyebrow.json +61 -0
- package/ai/catalog/components/good-field-label.json +62 -0
- package/ai/catalog/components/good-form-field.json +67 -0
- package/ai/catalog/components/good-form-row.json +70 -0
- package/ai/catalog/components/good-group.json +150 -0
- package/ai/catalog/components/good-heading-group.json +45 -0
- package/ai/catalog/components/good-heading.json +69 -0
- package/ai/catalog/components/good-hint.json +43 -0
- package/ai/catalog/components/good-histogram.json +103 -0
- package/ai/catalog/components/good-icon.json +97 -0
- package/ai/catalog/components/good-image-input.json +190 -0
- package/ai/catalog/components/good-image-preview.json +97 -0
- package/ai/catalog/components/good-inline-image.json +131 -0
- package/ai/catalog/components/good-input-phone.json +226 -0
- package/ai/catalog/components/good-input.json +350 -0
- package/ai/catalog/components/good-line-chart.json +94 -0
- package/ai/catalog/components/good-link.json +147 -0
- package/ai/catalog/components/good-listbox.json +248 -0
- package/ai/catalog/components/good-main-menu.json +138 -0
- package/ai/catalog/components/good-main-view.json +179 -0
- package/ai/catalog/components/good-map-color-scale.json +163 -0
- package/ai/catalog/components/good-map-overlay.json +136 -0
- package/ai/catalog/components/good-modal-footer.json +63 -0
- package/ai/catalog/components/good-modal-header.json +73 -0
- package/ai/catalog/components/good-modal.json +131 -0
- package/ai/catalog/components/good-month-calendar.json +170 -0
- package/ai/catalog/components/good-notification-host.json +46 -0
- package/ai/catalog/components/good-notifications.json +72 -0
- package/ai/catalog/components/good-number-input.json +180 -0
- package/ai/catalog/components/good-paragraph.json +47 -0
- package/ai/catalog/components/good-pdf-preview.json +153 -0
- package/ai/catalog/components/good-pin-input.json +211 -0
- package/ai/catalog/components/good-progress.json +158 -0
- package/ai/catalog/components/good-prose.json +43 -0
- package/ai/catalog/components/good-radio-group.json +181 -0
- package/ai/catalog/components/good-range-slider.json +285 -0
- package/ai/catalog/components/good-rating.json +160 -0
- package/ai/catalog/components/good-resizable-pane.json +61 -0
- package/ai/catalog/components/good-resizable.json +185 -0
- package/ai/catalog/components/good-rich-text-editor.json +164 -0
- package/ai/catalog/components/good-scatter-chart.json +94 -0
- package/ai/catalog/components/good-search.json +60 -0
- package/ai/catalog/components/good-section.json +43 -0
- package/ai/catalog/components/good-select-country.json +205 -0
- package/ai/catalog/components/good-select-font.json +111 -0
- package/ai/catalog/components/good-select.json +217 -0
- package/ai/catalog/components/good-separator.json +59 -0
- package/ai/catalog/components/good-settings.json +60 -0
- package/ai/catalog/components/good-sidebar-container.json +112 -0
- package/ai/catalog/components/good-sidebar-item.json +210 -0
- package/ai/catalog/components/good-sidebar-menu-container.json +80 -0
- package/ai/catalog/components/good-sidebar-submenu-group.json +98 -0
- package/ai/catalog/components/good-sidebar-submenu-item.json +113 -0
- package/ai/catalog/components/good-signature-pad.json +115 -0
- package/ai/catalog/components/good-sparkline.json +188 -0
- package/ai/catalog/components/good-status-icon.json +425 -0
- package/ai/catalog/components/good-subheading.json +67 -0
- package/ai/catalog/components/good-subnav.json +132 -0
- package/ai/catalog/components/good-summary.json +43 -0
- package/ai/catalog/components/good-switch.json +167 -0
- package/ai/catalog/components/good-tab.json +129 -0
- package/ai/catalog/components/good-table.json +294 -0
- package/ai/catalog/components/good-tabs.json +90 -0
- package/ai/catalog/components/good-textarea.json +194 -0
- package/ai/catalog/components/good-theme-toggle.json +57 -0
- package/ai/catalog/components/good-timeline-section.json +105 -0
- package/ai/catalog/components/good-timeline-step.json +248 -0
- package/ai/catalog/components/good-timeline.json +302 -0
- package/ai/catalog/components/good-topbar-dropdown-item.json +115 -0
- package/ai/catalog/components/good-topbar-dropdown-menu.json +85 -0
- package/ai/catalog/components/good-topbar-menu-container.json +96 -0
- package/ai/catalog/components/good-topbar-menu-item.json +99 -0
- package/ai/catalog/components/good-topbar-submenu.json +77 -0
- package/ai/catalog/components/good-topbar.json +259 -0
- package/ai/catalog/components/good-world-map.json +145 -0
- package/ai/catalog/components/goodCardActions.json +33 -0
- package/ai/catalog/components/goodDropdownFooter.json +33 -0
- package/ai/catalog/components/goodDropdownHeader.json +33 -0
- package/ai/catalog/components/goodExpandableHeader.json +33 -0
- package/ai/catalog/components/ng-template-goodListboxItem.json +33 -0
- package/ai/catalog/components/ng-template-goodTableCell.json +43 -0
- package/ai/catalog/index.json +1484 -0
- package/ai/catalog/index.schema.json +13 -0
- package/ai/examples/angular.json +26 -0
- package/ai/examples/edit-form.html +13 -0
- package/ai/examples/edit-form.ts +18 -0
- package/ai/examples/index.html +1 -0
- package/ai/examples/login.html +11 -0
- package/ai/examples/login.ts +14 -0
- package/ai/examples/main.ts +25 -0
- package/ai/examples/settings.html +10 -0
- package/ai/examples/settings.ts +13 -0
- package/ai/examples/table-view.html +3 -0
- package/ai/examples/table-view.ts +21 -0
- package/ai/examples/tsconfig.json +27 -0
- package/ai/guides/common-mistakes.md +9 -0
- package/ai/guides/component-discovery.md +17 -0
- package/ai/guides/design-tokens.md +10 -0
- package/ai/guides/layout.md +17 -0
- package/ai/guides/page-patterns.md +39 -0
- package/ai/install.mjs +25 -0
- package/ai/manifest.json +6 -0
- package/ai/skill/goodui/SKILL.md +27 -0
- package/angular/projects/goodui/package.json +28 -0
- package/angular/projects/goodui/src/action-bar.css +20 -0
- package/angular/projects/goodui/src/assistant-panel.css +38 -0
- package/angular/projects/goodui/src/calendar.css +161 -0
- package/angular/projects/goodui/src/chart.css +35 -0
- package/angular/projects/goodui/src/color-picker.css +40 -0
- package/angular/projects/goodui/src/error-page.css +24 -0
- package/angular/projects/goodui/src/lib/action-bar.ts +161 -0
- package/angular/projects/goodui/src/lib/action-group.ts +31 -0
- package/angular/projects/goodui/src/lib/action-menu.ts +81 -0
- package/angular/projects/goodui/src/lib/actions.ts +318 -0
- package/angular/projects/goodui/src/lib/alert.ts +60 -0
- package/angular/projects/goodui/src/lib/app-layout.ts +79 -0
- package/angular/projects/goodui/src/lib/assistant-panel.ts +133 -0
- package/angular/projects/goodui/src/lib/badge.ts +47 -0
- package/angular/projects/goodui/src/lib/bar-chart.html +80 -0
- package/angular/projects/goodui/src/lib/bar-chart.ts +233 -0
- package/angular/projects/goodui/src/lib/breadcrumbs.ts +81 -0
- package/angular/projects/goodui/src/lib/button.ts +38 -0
- package/angular/projects/goodui/src/lib/calendar-layout.ts +68 -0
- package/angular/projects/goodui/src/lib/calendar-service.ts +144 -0
- package/angular/projects/goodui/src/lib/calendar-working-hours.ts +65 -0
- package/angular/projects/goodui/src/lib/calendar.html +200 -0
- package/angular/projects/goodui/src/lib/calendar.ts +471 -0
- package/angular/projects/goodui/src/lib/card.ts +64 -0
- package/angular/projects/goodui/src/lib/chart-colors.ts +22 -0
- package/angular/projects/goodui/src/lib/chart-data.ts +269 -0
- package/angular/projects/goodui/src/lib/checkbox.ts +87 -0
- package/angular/projects/goodui/src/lib/code-block.ts +147 -0
- package/angular/projects/goodui/src/lib/color-controls.ts +107 -0
- package/angular/projects/goodui/src/lib/color-picker.ts +142 -0
- package/angular/projects/goodui/src/lib/color-utils.ts +69 -0
- package/angular/projects/goodui/src/lib/country-data.ts +16 -0
- package/angular/projects/goodui/src/lib/date-input.ts +542 -0
- package/angular/projects/goodui/src/lib/dropdown.ts +309 -0
- package/angular/projects/goodui/src/lib/error-page.ts +46 -0
- package/angular/projects/goodui/src/lib/expandable.ts +64 -0
- package/angular/projects/goodui/src/lib/form.ts +12 -0
- package/angular/projects/goodui/src/lib/goodui-config.ts +16 -0
- package/angular/projects/goodui/src/lib/group.ts +45 -0
- package/angular/projects/goodui/src/lib/histogram.html +52 -0
- package/angular/projects/goodui/src/lib/histogram.ts +146 -0
- package/angular/projects/goodui/src/lib/icon.ts +44 -0
- package/angular/projects/goodui/src/lib/image-input.ts +154 -0
- package/angular/projects/goodui/src/lib/image-preview.ts +26 -0
- package/angular/projects/goodui/src/lib/input-phone.ts +305 -0
- package/angular/projects/goodui/src/lib/input.ts +143 -0
- package/angular/projects/goodui/src/lib/line-chart.html +53 -0
- package/angular/projects/goodui/src/lib/line-chart.ts +193 -0
- package/angular/projects/goodui/src/lib/link.ts +46 -0
- package/angular/projects/goodui/src/lib/listbox.ts +254 -0
- package/angular/projects/goodui/src/lib/main-view.ts +39 -0
- package/angular/projects/goodui/src/lib/marker-colors.ts +7 -0
- package/angular/projects/goodui/src/lib/modal.ts +199 -0
- package/angular/projects/goodui/src/lib/models.ts +115 -0
- package/angular/projects/goodui/src/lib/month-calendar.ts +289 -0
- package/angular/projects/goodui/src/lib/notification-center.ts +170 -0
- package/angular/projects/goodui/src/lib/notification-host.ts +86 -0
- package/angular/projects/goodui/src/lib/number-input.ts +180 -0
- package/angular/projects/goodui/src/lib/pdf-preview.ts +242 -0
- package/angular/projects/goodui/src/lib/pdf-worker.generated.ts +2 -0
- package/angular/projects/goodui/src/lib/pin-input.ts +193 -0
- package/angular/projects/goodui/src/lib/progress.ts +93 -0
- package/angular/projects/goodui/src/lib/provide-goodui.ts +15 -0
- package/angular/projects/goodui/src/lib/radio-group.ts +94 -0
- package/angular/projects/goodui/src/lib/range-slider.ts +313 -0
- package/angular/projects/goodui/src/lib/rating.ts +90 -0
- package/angular/projects/goodui/src/lib/required-control.ts +4 -0
- package/angular/projects/goodui/src/lib/resizable.ts +168 -0
- package/angular/projects/goodui/src/lib/rich-text-command.ts +111 -0
- package/angular/projects/goodui/src/lib/rich-text-editor.html +193 -0
- package/angular/projects/goodui/src/lib/rich-text-editor.ts +864 -0
- package/angular/projects/goodui/src/lib/rich-text-sanitize.ts +99 -0
- package/angular/projects/goodui/src/lib/scatter-chart.html +48 -0
- package/angular/projects/goodui/src/lib/scatter-chart.ts +150 -0
- package/angular/projects/goodui/src/lib/select-country.ts +104 -0
- package/angular/projects/goodui/src/lib/select-font.ts +189 -0
- package/angular/projects/goodui/src/lib/select.ts +336 -0
- package/angular/projects/goodui/src/lib/sidebar.ts +232 -0
- package/angular/projects/goodui/src/lib/signature-pad.ts +238 -0
- package/angular/projects/goodui/src/lib/sparkline.html +15 -0
- package/angular/projects/goodui/src/lib/sparkline.ts +106 -0
- package/angular/projects/goodui/src/lib/status-icon.ts +79 -0
- package/angular/projects/goodui/src/lib/subnav.ts +156 -0
- package/angular/projects/goodui/src/lib/switch.ts +54 -0
- package/angular/projects/goodui/src/lib/table.ts +538 -0
- package/angular/projects/goodui/src/lib/tabs.ts +251 -0
- package/angular/projects/goodui/src/lib/textarea.ts +83 -0
- package/angular/projects/goodui/src/lib/theme.ts +49 -0
- package/angular/projects/goodui/src/lib/timeline.ts +252 -0
- package/angular/projects/goodui/src/lib/topbar.ts +402 -0
- package/angular/projects/goodui/src/lib/typography.ts +250 -0
- package/angular/projects/goodui/src/lib/world-map-data.ts +3 -0
- package/angular/projects/goodui/src/lib/world-map.html +73 -0
- package/angular/projects/goodui/src/lib/world-map.ts +391 -0
- package/angular/projects/goodui/src/month-calendar.css +47 -0
- package/angular/projects/goodui/src/pdf-preview.css +25 -0
- package/angular/projects/goodui/src/progress.css +38 -0
- package/angular/projects/goodui/src/public-api.ts +74 -0
- package/angular/projects/goodui/src/range-slider.css +54 -0
- package/angular/projects/goodui/src/resizable.css +32 -0
- package/angular/projects/goodui/src/rich-text-editor.css +33 -0
- package/angular/projects/goodui/src/select-font.css +16 -0
- package/angular/projects/goodui/src/signature-pad.css +14 -0
- package/angular/projects/goodui/src/styles.css +1105 -0
- package/angular/projects/goodui/src/timeline.css +138 -0
- package/angular/projects/goodui/src/tokens.generated.css +754 -0
- package/design/component-map.json +2233 -0
- package/design-tokens/penpot.tokens.json +3339 -0
- package/design.md +452 -0
- package/guides/README.md +17 -0
- package/guides/components/action-bar.md +43 -0
- package/guides/components/action-group.md +43 -0
- package/guides/components/action-menu.md +22 -0
- package/guides/components/alert.md +28 -0
- package/guides/components/assistant-panel.md +50 -0
- package/guides/components/avatar-menu.md +34 -0
- package/guides/components/badge.md +39 -0
- package/guides/components/bar-chart.md +40 -0
- package/guides/components/breadcrumbs.md +37 -0
- package/guides/components/button.md +40 -0
- package/guides/components/calendar.md +166 -0
- package/guides/components/card.md +62 -0
- package/guides/components/chart-axis.md +5 -0
- package/guides/components/chart-bar.md +5 -0
- package/guides/components/chart-data.md +58 -0
- package/guides/components/chart-histogram.md +16 -0
- package/guides/components/chart-line.md +5 -0
- package/guides/components/chart-scatter.md +14 -0
- package/guides/components/checkbox.md +36 -0
- package/guides/components/code-block.md +35 -0
- package/guides/components/color-controls.md +22 -0
- package/guides/components/column.md +5 -0
- package/guides/components/columns.md +13 -0
- package/guides/components/date-input.md +62 -0
- package/guides/components/detail-list.md +25 -0
- package/guides/components/dropdown.md +48 -0
- package/guides/components/error-page.md +31 -0
- package/guides/components/expandable.md +36 -0
- package/guides/components/form.md +49 -0
- package/guides/components/group.md +41 -0
- package/guides/components/histogram.md +45 -0
- package/guides/components/icon.md +13 -0
- package/guides/components/image-input.md +34 -0
- package/guides/components/input-phone.md +45 -0
- package/guides/components/input.md +59 -0
- package/guides/components/line-chart.md +37 -0
- package/guides/components/link.md +31 -0
- package/guides/components/listbox.md +109 -0
- package/guides/components/main-menu.md +11 -0
- package/guides/components/main-view.md +21 -0
- package/guides/components/modal.md +58 -0
- package/guides/components/month-calendar.md +88 -0
- package/guides/components/notifications.md +76 -0
- package/guides/components/number-input.md +21 -0
- package/guides/components/pdf-preview.md +38 -0
- package/guides/components/pin-input.md +37 -0
- package/guides/components/progress.md +41 -0
- package/guides/components/radio-group.md +41 -0
- package/guides/components/range-slider.md +42 -0
- package/guides/components/rating.md +39 -0
- package/guides/components/resizable-pane.md +3 -0
- package/guides/components/resizable.md +75 -0
- package/guides/components/rich-text-editor.md +113 -0
- package/guides/components/scatter-chart.md +43 -0
- package/guides/components/search.md +9 -0
- package/guides/components/select-font.md +16 -0
- package/guides/components/select.md +65 -0
- package/guides/components/settings.md +11 -0
- package/guides/components/sidebar.md +47 -0
- package/guides/components/signature-pad.md +45 -0
- package/guides/components/sparkline.md +31 -0
- package/guides/components/status-icon.md +32 -0
- package/guides/components/submenus.md +30 -0
- package/guides/components/subnav.md +54 -0
- package/guides/components/switch.md +48 -0
- package/guides/components/table.md +256 -0
- package/guides/components/tabs.md +46 -0
- package/guides/components/textarea.md +44 -0
- package/guides/components/theme-toggle.md +33 -0
- package/guides/components/timeline-section.md +7 -0
- package/guides/components/timeline-step.md +12 -0
- package/guides/components/timeline.md +179 -0
- package/guides/components/topbar.md +83 -0
- package/guides/components/typography.md +155 -0
- package/guides/components/world-map.md +72 -0
- package/guides/contributing/design-to-code.md +261 -0
- package/guides/deployment/drone.md +77 -0
- package/guides/examples/user-registration.md +11 -0
- package/guides/foundations/naming.md +7 -0
- package/guides/foundations/tokens.md +203 -0
- package/guides/intro.md +80 -0
- package/guides/layout/app-layout.md +64 -0
- package/guides/layout/layout-rules.md +16 -0
- package/homepage/src/app/examples/calendar-workspace/calendar-workspace-page.html +22 -0
- package/homepage/src/app/examples/calendar-workspace/calendar-workspace-page.ts +111 -0
- package/homepage/src/app/examples/calendar-workspace/source-code.generated.ts +3 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/billing-page.html +166 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/billing-page.ts +134 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/cloudhoster-store.ts +92 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/create-database-page.html +93 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/create-database-page.ts +115 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/database-detail-page.html +202 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/database-detail-page.ts +143 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/databases-page.html +70 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/databases-page.ts +44 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/home-page.html +70 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/home-page.ts +32 -0
- package/homepage/src/app/examples/case-studies/cloudhoster/source-code.generated.ts +12 -0
- package/homepage/src/app/examples/case-studies/vpshoster/create-server-page.html +208 -0
- package/homepage/src/app/examples/case-studies/vpshoster/create-server-page.ts +214 -0
- package/homepage/src/app/examples/case-studies/vpshoster/overview-page.html +35 -0
- package/homepage/src/app/examples/case-studies/vpshoster/overview-page.ts +17 -0
- package/homepage/src/app/examples/case-studies/vpshoster/servers-page.html +111 -0
- package/homepage/src/app/examples/case-studies/vpshoster/servers-page.ts +206 -0
- package/homepage/src/app/examples/case-studies/vpshoster/source-code.generated.ts +6 -0
- package/homepage/src/app/examples/case-studies/vpshoster/vps-store.ts +92 -0
- package/homepage/src/app/examples/case-studies/webmailer/webmailer-page.html +35 -0
- package/homepage/src/app/examples/case-studies/webmailer/webmailer-page.ts +17 -0
- package/homepage/src/app/examples/error-pages/error-pages-example-page.html +27 -0
- package/homepage/src/app/examples/error-pages/error-pages-example-page.ts +34 -0
- package/homepage/src/app/examples/error-pages/not-found-page.html +8 -0
- package/homepage/src/app/examples/error-pages/not-found-page.ts +19 -0
- package/homepage/src/app/examples/error-pages/server-error-page.html +8 -0
- package/homepage/src/app/examples/error-pages/server-error-page.ts +20 -0
- package/homepage/src/app/examples/error-pages/source-code.generated.ts +7 -0
- package/homepage/src/app/examples/mail-compose/mail-compose-page.html +25 -0
- package/homepage/src/app/examples/mail-compose/mail-compose-page.ts +28 -0
- package/homepage/src/app/examples/mail-workspace/mail-workspace-page.html +59 -0
- package/homepage/src/app/examples/mail-workspace/mail-workspace-page.ts +128 -0
- package/homepage/src/app/examples/mail-workspace/source-code.generated.ts +3 -0
- package/homepage/src/app/examples/notifications/notifications-page.html +51 -0
- package/homepage/src/app/examples/notifications/notifications-page.ts +133 -0
- package/homepage/src/app/examples/notifications/source-code.generated.ts +3 -0
- package/homepage/src/app/examples/pdf-reader/pdf-reader-page.html +27 -0
- package/homepage/src/app/examples/pdf-reader/pdf-reader-page.ts +39 -0
- package/homepage/src/app/examples/pdf-reader/source-code.generated.ts +3 -0
- package/homepage/src/app/examples/user-registration/source-code.generated.ts +5 -0
- package/homepage/src/app/examples/user-registration/user-registration-example-page.html +11 -0
- package/homepage/src/app/examples/user-registration/user-registration-example-page.ts +21 -0
- package/homepage/src/app/examples/user-registration/user-registration-form.html +116 -0
- package/homepage/src/app/examples/user-registration/user-registration-form.ts +93 -0
- package/homepage/src/app/examples/user-registration/user-registration-page.html +11 -0
- package/homepage/src/app/examples/user-registration/user-registration-page.ts +23 -0
- package/package.json +2 -2
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, Component, ElementRef, HostListener, OnDestroy, computed, contentChild, forwardRef, inject, input, output, signal, viewChild } from '@angular/core';
|
|
2
|
+
import { RouterLink } from '@angular/router';
|
|
3
|
+
import { GoodMainMenuComponent } from './actions';
|
|
4
|
+
import { GoodIconComponent } from './icon';
|
|
5
|
+
import { GoodMenuAction, GoodNotification, GoodSearchItem, GoodTopbarItem, GoodUser, goodRouteActive, goodTopbarItemContainsRoute } from './models';
|
|
6
|
+
|
|
7
|
+
let nextDropdownId = 0;
|
|
8
|
+
|
|
9
|
+
export type GoodTopbarMobileMenuMode = 'hidden' | 'popup';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
selector: 'good-brand-icon',
|
|
13
|
+
standalone: true,
|
|
14
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
15
|
+
template: `
|
|
16
|
+
@if (src()) {
|
|
17
|
+
<span class="good-brand-icon-art" [class.good-has-dark-logo]="!!darkSrc()">
|
|
18
|
+
<img class="good-brand-logo good-brand-logo-light" [src]="src()" [alt]="label()" />
|
|
19
|
+
@if (darkSrc()) { <img class="good-brand-logo good-brand-logo-dark" [src]="darkSrc()" [alt]="label()" /> }
|
|
20
|
+
</span>
|
|
21
|
+
} @else { <span class="good-brand-mark" aria-hidden="true"></span> }
|
|
22
|
+
<ng-content />
|
|
23
|
+
`,
|
|
24
|
+
host: { class: 'good-brand-icon' },
|
|
25
|
+
})
|
|
26
|
+
export class GoodBrandIconComponent {
|
|
27
|
+
readonly src = input('');
|
|
28
|
+
readonly darkSrc = input('');
|
|
29
|
+
readonly label = input('');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
@Component({
|
|
33
|
+
selector: 'good-topbar-dropdown-item',
|
|
34
|
+
standalone: true,
|
|
35
|
+
imports: [RouterLink, GoodIconComponent],
|
|
36
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
37
|
+
template: `
|
|
38
|
+
@if (item().children?.length) {
|
|
39
|
+
<button type="button" class="good-dropdown-link" [class.good-is-open]="expanded()" [class.good-is-active]="isActive()"
|
|
40
|
+
aria-haspopup="true" [attr.aria-expanded]="expanded()" [attr.aria-controls]="panelId()"
|
|
41
|
+
(pointerenter)="hover.emit()" (focus)="focused.emit()" (click)="toggle.emit()">
|
|
42
|
+
@if (item().icon) { <good-icon [name]="item().icon!" /> }
|
|
43
|
+
<span class="good-dropdown-label">{{ item().label }}</span><good-icon name="chevron-right" />
|
|
44
|
+
</button>
|
|
45
|
+
} @else if (item().route) {
|
|
46
|
+
<a class="good-dropdown-link" [class.good-is-active]="isActive()" [routerLink]="item().route!"
|
|
47
|
+
[attr.aria-current]="isActive() ? 'page' : null" (pointerenter)="hover.emit()" (focus)="focused.emit()" (click)="navigate.emit()">
|
|
48
|
+
@if (item().icon) { <good-icon [name]="item().icon!" /> }
|
|
49
|
+
<span class="good-dropdown-label">{{ item().label }}</span>
|
|
50
|
+
</a>
|
|
51
|
+
} @else {
|
|
52
|
+
<span class="good-dropdown-link" (pointerenter)="hover.emit()">
|
|
53
|
+
@if (item().icon) { <good-icon [name]="item().icon!" /> }
|
|
54
|
+
<span class="good-dropdown-label">{{ item().label }}</span>
|
|
55
|
+
</span>
|
|
56
|
+
}
|
|
57
|
+
`,
|
|
58
|
+
host: { class: 'good-topbar-dropdown-item' },
|
|
59
|
+
})
|
|
60
|
+
export class GoodTopbarDropdownItemComponent {
|
|
61
|
+
readonly item = input.required<GoodTopbarItem>();
|
|
62
|
+
readonly activeRoute = input('');
|
|
63
|
+
readonly expanded = input(false);
|
|
64
|
+
readonly panelId = input<string | null>(null);
|
|
65
|
+
readonly hover = output<void>();
|
|
66
|
+
readonly focused = output<void>();
|
|
67
|
+
readonly toggle = output<void>();
|
|
68
|
+
readonly navigate = output<void>();
|
|
69
|
+
readonly isActive = computed(() => goodTopbarItemContainsRoute(this.item(), this.activeRoute()));
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@Component({
|
|
73
|
+
selector: 'good-topbar-dropdown-menu',
|
|
74
|
+
standalone: true,
|
|
75
|
+
imports: [GoodTopbarDropdownItemComponent, forwardRef(() => GoodTopbarSubmenuComponent)],
|
|
76
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
77
|
+
template: `
|
|
78
|
+
<div class="good-dropdown-panel" role="group" [attr.aria-label]="label()">
|
|
79
|
+
@for (item of items(); track item.id) {
|
|
80
|
+
<div class="good-dropdown-entry" [class.good-dropdown-separated]="item.separatorBefore">
|
|
81
|
+
<good-topbar-dropdown-item [item]="item" [activeRoute]="activeRoute()"
|
|
82
|
+
[expanded]="openChildId() === item.id" [panelId]="item.children?.length ? panelId(item) : null"
|
|
83
|
+
(hover)="onHover(item)" (focused)="onFocus(item)" (toggle)="onToggle(item)" (navigate)="onNavigate()" />
|
|
84
|
+
@if (item.children?.length && openChildId() === item.id) {
|
|
85
|
+
<good-topbar-submenu [id]="panelId(item)" [items]="item.children!" [activeRoute]="activeRoute()"
|
|
86
|
+
[label]="item.label" (navigate)="onNavigate()" />
|
|
87
|
+
}
|
|
88
|
+
</div>
|
|
89
|
+
}
|
|
90
|
+
</div>
|
|
91
|
+
`,
|
|
92
|
+
host: { class: 'good-topbar-dropdown-menu' },
|
|
93
|
+
})
|
|
94
|
+
export class GoodTopbarDropdownMenuComponent {
|
|
95
|
+
readonly items = input<readonly GoodTopbarItem[]>([]);
|
|
96
|
+
readonly label = input('Menu');
|
|
97
|
+
readonly activeRoute = input('');
|
|
98
|
+
readonly navigate = output<void>();
|
|
99
|
+
readonly openChildId = signal<string | null>(null);
|
|
100
|
+
readonly submenu = viewChild(GoodTopbarSubmenuComponent);
|
|
101
|
+
private readonly uid = `good-dropdown-${++nextDropdownId}`;
|
|
102
|
+
private readonly element: ElementRef<HTMLElement> = inject(ElementRef);
|
|
103
|
+
private openedByClick = false;
|
|
104
|
+
private suppressFocusOpen = false;
|
|
105
|
+
|
|
106
|
+
panelId(item: GoodTopbarItem): string { return `${this.uid}-${item.id}`; }
|
|
107
|
+
|
|
108
|
+
private desktopHover(): boolean {
|
|
109
|
+
return !!this.element.nativeElement.ownerDocument.defaultView?.matchMedia('(min-width: 901px) and (hover: hover)').matches;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
onHover(item: GoodTopbarItem): void {
|
|
113
|
+
if (!this.desktopHover()) return;
|
|
114
|
+
this.openChildId.set(item.children?.length ? item.id : null);
|
|
115
|
+
this.openedByClick = false;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
onFocus(item: GoodTopbarItem): void {
|
|
119
|
+
if (this.suppressFocusOpen) return;
|
|
120
|
+
this.openChildId.set(item.children?.length ? item.id : null);
|
|
121
|
+
this.openedByClick = false;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
onToggle(item: GoodTopbarItem): void {
|
|
125
|
+
if (this.openChildId() === item.id && this.openedByClick) {
|
|
126
|
+
this.openChildId.set(null);
|
|
127
|
+
this.openedByClick = false;
|
|
128
|
+
} else {
|
|
129
|
+
this.openChildId.set(item.id);
|
|
130
|
+
this.openedByClick = true;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
onNavigate(): void {
|
|
135
|
+
this.openChildId.set(null);
|
|
136
|
+
this.navigate.emit();
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
closeDeepest(): boolean {
|
|
140
|
+
if (this.submenu()?.menu()?.closeDeepest()) return true;
|
|
141
|
+
if (!this.openChildId()) return false;
|
|
142
|
+
const trigger = this.element.nativeElement.querySelector<HTMLElement>(':scope > .good-dropdown-panel > .good-dropdown-entry > good-topbar-dropdown-item > button[aria-expanded="true"]');
|
|
143
|
+
this.openChildId.set(null);
|
|
144
|
+
this.openedByClick = false;
|
|
145
|
+
this.suppressFocusOpen = true;
|
|
146
|
+
trigger?.focus();
|
|
147
|
+
queueMicrotask(() => this.suppressFocusOpen = false);
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@HostListener('keydown.escape', ['$event']) onEscape(event: Event): void {
|
|
152
|
+
if (!this.closeDeepest()) return;
|
|
153
|
+
event.preventDefault();
|
|
154
|
+
event.stopPropagation();
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
@Component({
|
|
159
|
+
selector: 'good-topbar-submenu',
|
|
160
|
+
standalone: true,
|
|
161
|
+
imports: [GoodTopbarDropdownMenuComponent],
|
|
162
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
163
|
+
template: `<good-topbar-dropdown-menu [items]="items()" [label]="label()" [activeRoute]="activeRoute()" (navigate)="navigate.emit()" />`,
|
|
164
|
+
host: { class: 'good-topbar-submenu', '[class.good-submenu-flipped]': 'flipped()' },
|
|
165
|
+
})
|
|
166
|
+
export class GoodTopbarSubmenuComponent {
|
|
167
|
+
readonly items = input<readonly GoodTopbarItem[]>([]);
|
|
168
|
+
readonly label = input('Submenu');
|
|
169
|
+
readonly activeRoute = input('');
|
|
170
|
+
readonly navigate = output<void>();
|
|
171
|
+
readonly flipped = signal(false);
|
|
172
|
+
readonly menu = viewChild(GoodTopbarDropdownMenuComponent);
|
|
173
|
+
private readonly element: ElementRef<HTMLElement> = inject(ElementRef);
|
|
174
|
+
|
|
175
|
+
constructor() { setTimeout(() => this.updatePlacement()); }
|
|
176
|
+
|
|
177
|
+
@HostListener('window:resize') updatePlacement(): void {
|
|
178
|
+
const win = this.element.nativeElement.ownerDocument.defaultView;
|
|
179
|
+
if (!win || !win.matchMedia('(min-width: 901px)').matches) { this.flipped.set(false); return; }
|
|
180
|
+
this.flipped.set(false);
|
|
181
|
+
win.requestAnimationFrame(() => {
|
|
182
|
+
if (this.element.nativeElement.getBoundingClientRect().right > win.innerWidth - 8) this.flipped.set(true);
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
@Component({
|
|
188
|
+
selector: 'good-topbar-menu-item',
|
|
189
|
+
standalone: true,
|
|
190
|
+
imports: [RouterLink, GoodIconComponent, GoodTopbarDropdownMenuComponent],
|
|
191
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
192
|
+
template: `
|
|
193
|
+
@if (children().length) {
|
|
194
|
+
<button #trigger type="button" class="good-topbar-link" [class.good-is-active]="isActive() || open()"
|
|
195
|
+
aria-haspopup="true" [attr.aria-expanded]="open()" [attr.aria-controls]="panelId"
|
|
196
|
+
(focus)="openFromFocus()" (click)="toggleMenu()">
|
|
197
|
+
{{ text() }}<good-icon name="chevron-down" />
|
|
198
|
+
</button>
|
|
199
|
+
@if (open()) {
|
|
200
|
+
<good-topbar-dropdown-menu [id]="panelId" [items]="children()" [label]="text()" [activeRoute]="activeRoute()" (navigate)="closeMenu()" />
|
|
201
|
+
}
|
|
202
|
+
} @else if (link()) {
|
|
203
|
+
<a class="good-topbar-link" [class.good-is-active]="isActive()" [routerLink]="link()"
|
|
204
|
+
[attr.aria-current]="isActive() ? 'page' : null">{{ text() }}</a>
|
|
205
|
+
} @else { <span class="good-topbar-link">{{ text() }}</span> }
|
|
206
|
+
`,
|
|
207
|
+
host: { class: 'good-topbar-menu-item' },
|
|
208
|
+
})
|
|
209
|
+
export class GoodTopbarMenuItemComponent implements OnDestroy {
|
|
210
|
+
readonly item = input<GoodTopbarItem | null>(null);
|
|
211
|
+
readonly label = input('');
|
|
212
|
+
readonly route = input<string | undefined>();
|
|
213
|
+
readonly active = input(false);
|
|
214
|
+
readonly activeRoute = input('');
|
|
215
|
+
readonly text = computed(() => this.item()?.label ?? this.label());
|
|
216
|
+
readonly link = computed(() => this.item()?.route ?? this.route());
|
|
217
|
+
readonly children = computed(() => this.item()?.children ?? []);
|
|
218
|
+
readonly isActive = computed(() => this.active() || goodRouteActive(this.link(), this.activeRoute()) || (this.item() ? goodTopbarItemContainsRoute(this.item()!, this.activeRoute()) : false));
|
|
219
|
+
readonly open = signal(false);
|
|
220
|
+
readonly dropdown = viewChild(GoodTopbarDropdownMenuComponent);
|
|
221
|
+
readonly panelId = `good-topbar-panel-${++nextDropdownId}`;
|
|
222
|
+
private readonly element: ElementRef<HTMLElement> = inject(ElementRef);
|
|
223
|
+
private openedByClick = false;
|
|
224
|
+
private suppressFocusOpen = false;
|
|
225
|
+
private closeTimer: ReturnType<typeof setTimeout> | null = null;
|
|
226
|
+
|
|
227
|
+
private desktopHover(): boolean {
|
|
228
|
+
return !!this.element.nativeElement.ownerDocument.defaultView?.matchMedia('(min-width: 901px) and (hover: hover)').matches;
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@HostListener('pointerenter') onPointerEnter(): void {
|
|
232
|
+
if (this.closeTimer) clearTimeout(this.closeTimer);
|
|
233
|
+
if (this.children().length && this.desktopHover() && !this.open()) {
|
|
234
|
+
this.open.set(true);
|
|
235
|
+
this.openedByClick = false;
|
|
236
|
+
}
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
@HostListener('pointerleave') onPointerLeave(): void {
|
|
240
|
+
if (!this.open() || this.openedByClick || !this.desktopHover()) return;
|
|
241
|
+
this.closeTimer = setTimeout(() => this.closeMenu(), 140);
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
openFromFocus(): void {
|
|
245
|
+
if (this.suppressFocusOpen) return;
|
|
246
|
+
if (this.children().length && !this.open()) {
|
|
247
|
+
this.open.set(true);
|
|
248
|
+
this.openedByClick = false;
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
|
|
252
|
+
toggleMenu(): void {
|
|
253
|
+
if (this.open() && this.openedByClick) this.closeMenu();
|
|
254
|
+
else { this.open.set(true); this.openedByClick = true; }
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
closeMenu(): void {
|
|
258
|
+
if (this.closeTimer) clearTimeout(this.closeTimer);
|
|
259
|
+
this.closeTimer = null;
|
|
260
|
+
this.open.set(false);
|
|
261
|
+
this.openedByClick = false;
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
private returnFocus(): void {
|
|
265
|
+
this.suppressFocusOpen = true;
|
|
266
|
+
this.element.nativeElement.querySelector<HTMLElement>(':scope > button')?.focus();
|
|
267
|
+
queueMicrotask(() => this.suppressFocusOpen = false);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
@HostListener('keydown.escape', ['$event']) onEscape(event: Event): void {
|
|
271
|
+
if (!this.open()) return;
|
|
272
|
+
event.preventDefault();
|
|
273
|
+
event.stopPropagation();
|
|
274
|
+
if (this.dropdown()?.closeDeepest()) return;
|
|
275
|
+
this.closeMenu();
|
|
276
|
+
this.returnFocus();
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
@HostListener('focusout', ['$event']) onFocusOut(event: FocusEvent): void {
|
|
280
|
+
if (event.relatedTarget && !this.element.nativeElement.contains(event.relatedTarget as Node)) this.closeMenu();
|
|
281
|
+
}
|
|
282
|
+
|
|
283
|
+
@HostListener('document:pointerdown', ['$event']) onDocumentPointerDown(event: PointerEvent): void {
|
|
284
|
+
if (!this.element.nativeElement.contains(event.target as Node)) this.closeMenu();
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
@HostListener('document:keydown.escape') onDocumentEscape(): void {
|
|
288
|
+
if (!this.open()) return;
|
|
289
|
+
if (this.dropdown()?.closeDeepest()) return;
|
|
290
|
+
this.closeMenu();
|
|
291
|
+
this.returnFocus();
|
|
292
|
+
}
|
|
293
|
+
|
|
294
|
+
ngOnDestroy(): void { if (this.closeTimer) clearTimeout(this.closeTimer); }
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
@Component({
|
|
298
|
+
selector: 'good-topbar-menu-container',
|
|
299
|
+
standalone: true,
|
|
300
|
+
imports: [GoodIconComponent, GoodTopbarMenuItemComponent],
|
|
301
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
302
|
+
template: `
|
|
303
|
+
<button #mobileTrigger type="button" class="good-topbar-mobile-trigger good-action-button"
|
|
304
|
+
[attr.aria-label]="mobileOpen() ? 'Close topbar menu' : 'Open topbar menu'"
|
|
305
|
+
aria-haspopup="true" [attr.aria-expanded]="mobileOpen()" [attr.aria-controls]="mobilePanelId"
|
|
306
|
+
(click)="toggleMobileMenu()"><good-icon name="grid" /></button>
|
|
307
|
+
<div class="good-topbar-menu-items" [id]="mobilePanelId" [class.good-topbar-menu-popup-open]="mobileOpen()"
|
|
308
|
+
[attr.role]="mobileMode() === 'popup' ? 'navigation' : null" [attr.aria-label]="mobileMode() === 'popup' ? 'Topbar menu' : null">
|
|
309
|
+
@for (item of items(); track item.id) { <good-topbar-menu-item [item]="item" [activeRoute]="activeRoute()" /> }
|
|
310
|
+
<ng-content />
|
|
311
|
+
</div>
|
|
312
|
+
`,
|
|
313
|
+
host: { class: 'good-topbar-menu-container', '[attr.data-mobile-mode]': 'mobileMode()' },
|
|
314
|
+
})
|
|
315
|
+
export class GoodTopbarMenuContainerComponent {
|
|
316
|
+
readonly items = input<readonly GoodTopbarItem[]>([]);
|
|
317
|
+
readonly activeRoute = input('');
|
|
318
|
+
readonly mobileMode = input<GoodTopbarMobileMenuMode>('hidden');
|
|
319
|
+
readonly mobileOpen = signal(false);
|
|
320
|
+
readonly mobilePanelId = `good-topbar-mobile-panel-${++nextDropdownId}`;
|
|
321
|
+
private readonly element: ElementRef<HTMLElement> = inject(ElementRef);
|
|
322
|
+
|
|
323
|
+
toggleMobileMenu(): void { this.mobileOpen.update(open => !open); }
|
|
324
|
+
|
|
325
|
+
private closeMobileMenu(returnFocus = false): void {
|
|
326
|
+
if (!this.mobileOpen()) return;
|
|
327
|
+
this.mobileOpen.set(false);
|
|
328
|
+
if (returnFocus) this.element.nativeElement.querySelector<HTMLElement>('.good-topbar-mobile-trigger')?.focus();
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
@HostListener('click', ['$event']) onClick(event: MouseEvent): void {
|
|
332
|
+
if ((event.target as Element).closest('a.good-topbar-link, a.good-dropdown-link')) this.closeMobileMenu();
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
@HostListener('document:pointerdown', ['$event']) onOutsidePointer(event: PointerEvent): void {
|
|
336
|
+
if (!this.element.nativeElement.contains(event.target as Node)) this.closeMobileMenu();
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
@HostListener('keydown.escape', ['$event']) onEscape(event: Event): void {
|
|
340
|
+
if (!this.mobileOpen()) return;
|
|
341
|
+
event.preventDefault();
|
|
342
|
+
event.stopPropagation();
|
|
343
|
+
this.closeMobileMenu(true);
|
|
344
|
+
}
|
|
345
|
+
|
|
346
|
+
@HostListener('window:resize') onResize(): void {
|
|
347
|
+
const width = this.element.nativeElement.ownerDocument.defaultView?.innerWidth;
|
|
348
|
+
if (width && width > 900) this.closeMobileMenu();
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
@Component({
|
|
353
|
+
selector: 'good-topbar',
|
|
354
|
+
standalone: true,
|
|
355
|
+
imports: [GoodIconComponent, GoodBrandIconComponent, GoodTopbarMenuContainerComponent, GoodMainMenuComponent],
|
|
356
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
357
|
+
template: `
|
|
358
|
+
<div class="good-topbar-left">
|
|
359
|
+
<button type="button" class="good-mobile-menu-button good-action-button" aria-label="Open sidebar" (click)="menuToggle.emit()"><good-icon name="menu" /></button>
|
|
360
|
+
@if (showMobileBrand()) {
|
|
361
|
+
@if (brandMarkSrc()) {
|
|
362
|
+
<good-brand-icon class="good-mobile-brand-icon" [src]="brandMarkSrc()" [darkSrc]="brandMarkDarkSrc()" [label]="brand()" />
|
|
363
|
+
} @else {
|
|
364
|
+
<span class="good-mobile-brand" [class.good-has-dark-logo]="!!brandLogoDarkSrc()">
|
|
365
|
+
@if (brandLogoSrc()) {
|
|
366
|
+
<img class="good-brand-logo good-brand-logo-light" [src]="brandLogoSrc()" [alt]="brand()" />
|
|
367
|
+
@if (brandLogoDarkSrc()) { <img class="good-brand-logo good-brand-logo-dark" [src]="brandLogoDarkSrc()" [alt]="brand()" /> }
|
|
368
|
+
} @else { {{ brand() }} }
|
|
369
|
+
</span>
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
@if (showBrandIcon()) { <good-brand-icon class="good-desktop-brand-icon" [src]="brandMarkSrc()" [darkSrc]="brandMarkDarkSrc()" [label]="brand()" /> }
|
|
373
|
+
@if (!projectedMenu()) { <good-topbar-menu-container [items]="items()" [activeRoute]="activeRoute()" [mobileMode]="mobileMenuMode()" /> }
|
|
374
|
+
<ng-content select="good-topbar-menu-container" />
|
|
375
|
+
</div>
|
|
376
|
+
@if (!projectedMainMenu()) { <good-main-menu [user]="user()" [notifications]="notifications()" [searchItems]="searchItems()" [settingsActions]="settingsActions()" [avatarActions]="avatarActions()" [showThemeToggle]="showThemeToggle()" [showSettings]="showSettings()" /> }
|
|
377
|
+
<ng-content select="good-main-menu" />
|
|
378
|
+
`,
|
|
379
|
+
host: { class: 'good-topbar', '[attr.data-mobile-menu]': 'mobileMenuMode()' },
|
|
380
|
+
})
|
|
381
|
+
export class GoodTopbarComponent {
|
|
382
|
+
readonly brand = input('GOODUI');
|
|
383
|
+
readonly brandLogoSrc = input('');
|
|
384
|
+
readonly brandLogoDarkSrc = input('');
|
|
385
|
+
readonly brandMarkSrc = input('');
|
|
386
|
+
readonly brandMarkDarkSrc = input('');
|
|
387
|
+
readonly showBrandIcon = input(false);
|
|
388
|
+
readonly showMobileBrand = input(true);
|
|
389
|
+
readonly items = input<readonly GoodTopbarItem[]>([]);
|
|
390
|
+
readonly activeRoute = input('');
|
|
391
|
+
readonly mobileMenuMode = input<GoodTopbarMobileMenuMode>('hidden');
|
|
392
|
+
readonly user = input<GoodUser | null>(null);
|
|
393
|
+
readonly notifications = input<readonly GoodNotification[]>([]);
|
|
394
|
+
readonly searchItems = input<readonly GoodSearchItem[]>([]);
|
|
395
|
+
readonly settingsActions = input<readonly GoodMenuAction[]>([]);
|
|
396
|
+
readonly showThemeToggle = input(true);
|
|
397
|
+
readonly showSettings = input(false);
|
|
398
|
+
readonly avatarActions = input<readonly GoodMenuAction[]>([]);
|
|
399
|
+
readonly menuToggle = output<void>();
|
|
400
|
+
readonly projectedMenu = contentChild(GoodTopbarMenuContainerComponent);
|
|
401
|
+
readonly projectedMainMenu = contentChild(GoodMainMenuComponent);
|
|
402
|
+
}
|
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
import { NgTemplateOutlet } from '@angular/common';
|
|
2
|
+
import { ChangeDetectionStrategy, Component, Directive, booleanAttribute, contentChild, effect, input, signal, computed } from '@angular/core';
|
|
3
|
+
import { GoodInputComponent } from './input';
|
|
4
|
+
import { GoodCheckboxComponent } from './checkbox';
|
|
5
|
+
import { GoodRadioGroupComponent } from './radio-group';
|
|
6
|
+
import { GoodImageInputComponent } from './image-input';
|
|
7
|
+
import { GoodImagePreviewComponent } from './image-preview';
|
|
8
|
+
import { GOOD_COMPOSITE_REQUIRED_CONTROL } from './required-control';
|
|
9
|
+
|
|
10
|
+
export type GoodEyebrowAppearance = 'brand' | 'mono';
|
|
11
|
+
export type GoodHeadingLevel = 1 | 2 | 3 | 4 | 5 | 6;
|
|
12
|
+
export type GoodSubheadingLevel = 2 | 3 | 4 | 5 | 6;
|
|
13
|
+
export type GoodSeparatorVariant = 'dots' | 'line';
|
|
14
|
+
export type GoodImageAlign = 'center' | 'left' | 'right';
|
|
15
|
+
export type GoodColumnBreakpoint = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
16
|
+
|
|
17
|
+
@Component({
|
|
18
|
+
selector: 'good-heading-group', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
19
|
+
host: { class: 'good-heading-group' },
|
|
20
|
+
template: `<ng-content select="good-eyebrow" /><div class="good-heading-group-text"><ng-content select="good-heading" /><ng-content select="good-summary" /></div>`,
|
|
21
|
+
})
|
|
22
|
+
export class GoodHeadingGroupComponent {}
|
|
23
|
+
|
|
24
|
+
@Component({
|
|
25
|
+
selector: 'good-eyebrow', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
26
|
+
host: { class: 'good-eyebrow', '[attr.data-appearance]': 'appearance()' },
|
|
27
|
+
template: `<span><ng-content /></span>`,
|
|
28
|
+
})
|
|
29
|
+
export class GoodEyebrowComponent {
|
|
30
|
+
readonly appearance = input<GoodEyebrowAppearance>('brand');
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
@Component({
|
|
34
|
+
selector: 'good-heading', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
35
|
+
imports: [NgTemplateOutlet],
|
|
36
|
+
host: { class: 'good-heading', '[attr.data-level]': 'level()' },
|
|
37
|
+
template: `
|
|
38
|
+
<ng-template #content><ng-content /></ng-template>
|
|
39
|
+
@switch (level()) {
|
|
40
|
+
@case (2) { <h2><ng-container [ngTemplateOutlet]="content" /></h2> }
|
|
41
|
+
@case (3) { <h3><ng-container [ngTemplateOutlet]="content" /></h3> }
|
|
42
|
+
@case (4) { <h4><ng-container [ngTemplateOutlet]="content" /></h4> }
|
|
43
|
+
@case (5) { <h5><ng-container [ngTemplateOutlet]="content" /></h5> }
|
|
44
|
+
@case (6) { <h6><ng-container [ngTemplateOutlet]="content" /></h6> }
|
|
45
|
+
@default { <h1><ng-container [ngTemplateOutlet]="content" /></h1> }
|
|
46
|
+
}
|
|
47
|
+
`,
|
|
48
|
+
})
|
|
49
|
+
export class GoodHeadingComponent {
|
|
50
|
+
readonly level = input<GoodHeadingLevel>(1);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
@Component({
|
|
54
|
+
selector: 'good-summary', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
55
|
+
host: { class: 'good-summary' }, template: `<p><ng-content /></p>`,
|
|
56
|
+
})
|
|
57
|
+
export class GoodSummaryComponent {}
|
|
58
|
+
|
|
59
|
+
@Component({
|
|
60
|
+
selector: 'good-section', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
61
|
+
host: { class: 'good-section' }, template: `<section><ng-content /></section>`,
|
|
62
|
+
})
|
|
63
|
+
export class GoodSectionComponent {}
|
|
64
|
+
|
|
65
|
+
@Component({
|
|
66
|
+
selector: 'good-prose', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
67
|
+
host: { class: 'good-prose' }, template: `<ng-content />`,
|
|
68
|
+
})
|
|
69
|
+
export class GoodProseComponent {}
|
|
70
|
+
|
|
71
|
+
/** A semantic label/value list for summaries, metadata, and price breakdowns. */
|
|
72
|
+
@Component({
|
|
73
|
+
selector: 'good-detail-list', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
74
|
+
host: { class: 'good-detail-list' },
|
|
75
|
+
template: `<dl><ng-content /></dl>`,
|
|
76
|
+
})
|
|
77
|
+
export class GoodDetailListComponent {}
|
|
78
|
+
|
|
79
|
+
/** Place a native dt and dd inside this row to preserve description-list semantics. */
|
|
80
|
+
@Directive({
|
|
81
|
+
selector: 'div[goodDetailRow]', standalone: true,
|
|
82
|
+
host: { class: 'good-detail-row' },
|
|
83
|
+
})
|
|
84
|
+
export class GoodDetailRowDirective {}
|
|
85
|
+
|
|
86
|
+
@Component({
|
|
87
|
+
selector: 'good-columns', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
88
|
+
host: { class: 'good-columns', '[attr.data-columns]': 'columns()' },
|
|
89
|
+
template: `<div class="good-columns-grid"><ng-content select="good-column" /></div>`,
|
|
90
|
+
})
|
|
91
|
+
export class GoodColumnsComponent {
|
|
92
|
+
readonly columns = input<2 | 3 | 4>(2);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
@Component({
|
|
96
|
+
selector: 'good-column', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
97
|
+
host: {
|
|
98
|
+
class: 'good-column',
|
|
99
|
+
'[attr.data-visible-xs]': "isVisibleAt('xs')",
|
|
100
|
+
'[attr.data-visible-sm]': "isVisibleAt('sm')",
|
|
101
|
+
'[attr.data-visible-md]': "isVisibleAt('md')",
|
|
102
|
+
'[attr.data-visible-lg]': "isVisibleAt('lg')",
|
|
103
|
+
'[attr.data-visible-xl]': "isVisibleAt('xl')",
|
|
104
|
+
},
|
|
105
|
+
template: `<div class="good-prose good-column-content"><ng-content /></div>`,
|
|
106
|
+
})
|
|
107
|
+
export class GoodColumnComponent {
|
|
108
|
+
readonly visibleAt = input<readonly GoodColumnBreakpoint[] | 'all'>('all');
|
|
109
|
+
|
|
110
|
+
isVisibleAt(breakpoint: GoodColumnBreakpoint): boolean {
|
|
111
|
+
const visibleAt = this.visibleAt();
|
|
112
|
+
return visibleAt === 'all' || visibleAt.includes(breakpoint);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@Component({
|
|
117
|
+
selector: 'good-paragraph', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
118
|
+
host: { class: 'good-paragraph' }, template: `<p><ng-content /></p>`,
|
|
119
|
+
})
|
|
120
|
+
export class GoodParagraphComponent {}
|
|
121
|
+
|
|
122
|
+
@Component({
|
|
123
|
+
selector: 'good-subheading', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
124
|
+
imports: [NgTemplateOutlet],
|
|
125
|
+
host: { class: 'good-subheading' },
|
|
126
|
+
template: `
|
|
127
|
+
<ng-template #content><ng-content /></ng-template>
|
|
128
|
+
@switch (level()) {
|
|
129
|
+
@case (3) { <h3><ng-container [ngTemplateOutlet]="content" /></h3> }
|
|
130
|
+
@case (4) { <h4><ng-container [ngTemplateOutlet]="content" /></h4> }
|
|
131
|
+
@case (5) { <h5><ng-container [ngTemplateOutlet]="content" /></h5> }
|
|
132
|
+
@case (6) { <h6><ng-container [ngTemplateOutlet]="content" /></h6> }
|
|
133
|
+
@default { <h2><ng-container [ngTemplateOutlet]="content" /></h2> }
|
|
134
|
+
}
|
|
135
|
+
`,
|
|
136
|
+
})
|
|
137
|
+
export class GoodSubheadingComponent {
|
|
138
|
+
readonly level = input<GoodSubheadingLevel>(2);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
@Component({
|
|
142
|
+
selector: 'good-citation', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
143
|
+
host: { class: 'good-citation' },
|
|
144
|
+
template: `<blockquote [attr.cite]="cite() || null"><ng-content /></blockquote>@if (source()) { <cite>{{ source() }}</cite> }`,
|
|
145
|
+
})
|
|
146
|
+
export class GoodCitationComponent {
|
|
147
|
+
readonly cite = input('');
|
|
148
|
+
readonly source = input('');
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
@Component({
|
|
152
|
+
selector: 'good-separator', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
153
|
+
host: { class: 'good-separator', role: 'separator', 'aria-orientation': 'horizontal', '[attr.data-style]': 'variant()' },
|
|
154
|
+
template: `
|
|
155
|
+
@if (variant() === 'dots') {
|
|
156
|
+
<span class="good-separator-dots" aria-hidden="true"><i></i><i></i><i></i></span>
|
|
157
|
+
} @else { <span class="good-separator-line" aria-hidden="true"></span> }
|
|
158
|
+
`,
|
|
159
|
+
})
|
|
160
|
+
export class GoodSeparatorComponent {
|
|
161
|
+
readonly variant = input<GoodSeparatorVariant>('dots');
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
@Component({
|
|
165
|
+
selector: 'good-inline-image', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
166
|
+
imports: [GoodImagePreviewComponent],
|
|
167
|
+
host: { class: 'good-inline-image', '[attr.data-align]': 'align()', '[attr.data-full-width]': 'fullWidth()' },
|
|
168
|
+
template: `<figure>
|
|
169
|
+
@if (previewable()) {
|
|
170
|
+
<button type="button" class="good-inline-image-preview" [attr.aria-label]="'Preview ' + (alt() || 'image')" (click)="previewOpen.set(true)">
|
|
171
|
+
<img [src]="src()" alt="" [attr.loading]="loading()" decoding="async" />
|
|
172
|
+
</button>
|
|
173
|
+
} @else { <img [src]="src()" [alt]="alt()" [attr.loading]="loading()" decoding="async" /> }
|
|
174
|
+
@if (caption()) { <figcaption>{{ caption() }}</figcaption> }
|
|
175
|
+
</figure>
|
|
176
|
+
@if (previewable()) { <good-image-preview [(open)]="previewOpen" [src]="src()" [alt]="alt()" [caption]="caption()" /> }`,
|
|
177
|
+
})
|
|
178
|
+
export class GoodInlineImageComponent {
|
|
179
|
+
readonly src = input.required<string>();
|
|
180
|
+
readonly alt = input.required<string>();
|
|
181
|
+
readonly caption = input('');
|
|
182
|
+
readonly align = input<GoodImageAlign>('center');
|
|
183
|
+
readonly fullWidth = input(false, { transform: booleanAttribute });
|
|
184
|
+
readonly loading = input<'lazy' | 'eager'>('lazy');
|
|
185
|
+
readonly previewable = input(false);
|
|
186
|
+
readonly previewOpen = signal(false);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
@Component({
|
|
190
|
+
selector: 'good-field-label', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
191
|
+
imports: [NgTemplateOutlet],
|
|
192
|
+
host: { class: 'good-field-label' },
|
|
193
|
+
template: `@if (forId()) {
|
|
194
|
+
<label [attr.for]="forId()"><ng-container [ngTemplateOutlet]="content" /></label>
|
|
195
|
+
} @else {
|
|
196
|
+
<span class="good-field-label-text"><ng-container [ngTemplateOutlet]="content" /></span>
|
|
197
|
+
}
|
|
198
|
+
<ng-template #content><ng-content />@if (isRequired()) { <span class="good-required-mark" aria-hidden="true">*</span><span class="good-sr-only"> required</span> }</ng-template>`,
|
|
199
|
+
})
|
|
200
|
+
export class GoodFieldLabelComponent {
|
|
201
|
+
readonly forId = input('');
|
|
202
|
+
readonly required = input(false);
|
|
203
|
+
readonly inheritedRequired = signal(false);
|
|
204
|
+
readonly isRequired = computed(() => this.required() || this.inheritedRequired());
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
@Component({
|
|
208
|
+
selector: 'good-form-field', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
209
|
+
host: { class: 'good-form-field' }, template: `<ng-content />`,
|
|
210
|
+
})
|
|
211
|
+
export class GoodFormFieldComponent {
|
|
212
|
+
readonly required = input(false);
|
|
213
|
+
readonly label = contentChild(GoodFieldLabelComponent);
|
|
214
|
+
readonly control = contentChild(GoodInputComponent);
|
|
215
|
+
readonly checkbox = contentChild(GoodCheckboxComponent);
|
|
216
|
+
readonly radioGroup = contentChild(GoodRadioGroupComponent);
|
|
217
|
+
readonly imageInput = contentChild(GoodImageInputComponent);
|
|
218
|
+
readonly compositeInput = contentChild(GOOD_COMPOSITE_REQUIRED_CONTROL);
|
|
219
|
+
|
|
220
|
+
constructor() {
|
|
221
|
+
effect(() => {
|
|
222
|
+
const label = this.label();
|
|
223
|
+
const control = this.control();
|
|
224
|
+
const checkbox = this.checkbox();
|
|
225
|
+
const radioGroup = this.radioGroup();
|
|
226
|
+
const imageInput = this.imageInput();
|
|
227
|
+
const compositeInput = this.compositeInput();
|
|
228
|
+
const required = this.required();
|
|
229
|
+
label?.inheritedRequired.set(required);
|
|
230
|
+
const effectiveRequired = required || !!label?.required();
|
|
231
|
+
control?.setFieldRequired(effectiveRequired);
|
|
232
|
+
checkbox?.setFieldRequired(effectiveRequired);
|
|
233
|
+
radioGroup?.setFieldRequired(effectiveRequired);
|
|
234
|
+
imageInput?.setFieldRequired(effectiveRequired);
|
|
235
|
+
compositeInput?.setFieldRequired(effectiveRequired);
|
|
236
|
+
});
|
|
237
|
+
}
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
@Component({
|
|
241
|
+
selector: 'good-hint', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
242
|
+
host: { class: 'good-hint' }, template: `<small><ng-content /></small>`,
|
|
243
|
+
})
|
|
244
|
+
export class GoodHintComponent {}
|
|
245
|
+
|
|
246
|
+
@Component({
|
|
247
|
+
selector: 'good-error-text', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush,
|
|
248
|
+
host: { class: 'good-error-text', role: 'alert' }, template: `<small><ng-content /></small>`,
|
|
249
|
+
})
|
|
250
|
+
export class GoodErrorTextComponent {}
|