@cloudfrogger/goodui 0.0.60 → 0.0.63
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 +247 -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 +140 -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 +19 -0
- package/ai/guides/design-tokens.md +10 -0
- package/ai/guides/layout.md +19 -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 +320 -0
- package/angular/projects/goodui/src/lib/alert.ts +60 -0
- package/angular/projects/goodui/src/lib/app-layout.ts +84 -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 +403 -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/fesm2022/cloudfrogger-goodui.mjs +32 -18
- package/fesm2022/cloudfrogger-goodui.mjs.map +1 -1
- 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 +23 -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 +51 -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 +89 -0
- package/guides/components/typography.md +155 -0
- package/guides/components/world-map.md +72 -0
- package/guides/contributing/design-to-code.md +265 -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 +81 -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
- package/types/cloudfrogger-goodui.d.ts +2 -2
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Rich text editor
|
|
2
|
+
|
|
3
|
+
`good-rich-text-editor` is a full-width HTML editor. It provides a toolbar, a scrollable writing area, undo and redo commands, and an optional assistant pane. The assistant is intentionally empty until an application projects content through `[goodRichTextAssistant]`. On narrow screens the pane overlays the editor.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<good-rich-text-editor label="Message" [(value)]="body"
|
|
7
|
+
[showAssistant]="true" [(assistantOpen)]="assistantOpen">
|
|
8
|
+
<div goodRichTextAssistant><!-- Application content -->
|
|
9
|
+
</div>
|
|
10
|
+
</good-rich-text-editor>
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
`value` is an HTML string. It can also be bound through Angular Forms because the component implements `ControlValueAccessor`. `valueChange` emits the current sanitized HTML. `commandExecuted` emits command names such as `Bold`, `insert-link`, `insert-table:3x4`, `undo:Bold`, and `redo:Bold`. Keep one value source per instance. `disabled` and `readonly` prevent editing. `label` defaults to `Rich text editor`, `value` to an empty paragraph, `minHeight` to 320 pixels, and `showAssistant` and `assistantOpen` to `false`.
|
|
14
|
+
|
|
15
|
+
## Choose the editing tools
|
|
16
|
+
|
|
17
|
+
Omit `features` to show every editing tool. When you supply `[features]`, the array is an allowlist: only named tools appear and their commands are available. `[]` leaves the editable writing area without a toolbar. Change the array at runtime to update the toolbar. The Format menu shows only allowed entries and hides empty groups. `showAssistant` remains a separate opt-in for application content; it is not an editing feature.
|
|
18
|
+
|
|
19
|
+
| Feature name | What it enables |
|
|
20
|
+
| --- | --- |
|
|
21
|
+
| `undo`, `redo` | History buttons and their keyboard shortcuts. |
|
|
22
|
+
| `heading1` … `heading6` | The corresponding heading level in Format → Headings. Each level is independent. |
|
|
23
|
+
| `bold`, `italic`, `underline` | Direct toolbar buttons and matching Format → Inline commands. |
|
|
24
|
+
| `strikethrough`, `superscript`, `subscript`, `code` | The corresponding Format → Inline command. |
|
|
25
|
+
| `paragraph`, `blockquote`, `div`, `pre` | The corresponding Format → Blocks command. |
|
|
26
|
+
| `alignment` | Format → Align and the toolbar alignment menu: left, center, right, justify. |
|
|
27
|
+
| `smallcaps`, `subtitle`, `highlight` | The corresponding Format → Styles command. |
|
|
28
|
+
| `fontfamily`, `fontsize` | Local font-family selection and font size control. |
|
|
29
|
+
| `textcolor`, `background` | Text-color and background-color pickers. |
|
|
30
|
+
| `link`, `image` | Insert-link and insert-image buttons and dialogs. |
|
|
31
|
+
| `bullets` | Bulleted list menu with disc, circle, and block markers. |
|
|
32
|
+
| `numbering` | Numbered list menu with decimal, alphabetic, Greek, and Roman markers. |
|
|
33
|
+
| `table` | Insert-table grid, contextual table menu, cell selection, and row/column resize grips. |
|
|
34
|
+
| `clearformatting` | Clear formatting button. |
|
|
35
|
+
|
|
36
|
+
This is the complete allowlist. Copy it and remove the names you do not need:
|
|
37
|
+
|
|
38
|
+
`editor-example.html`:
|
|
39
|
+
|
|
40
|
+
```html
|
|
41
|
+
<good-rich-text-editor label="Note" [(value)]="body"
|
|
42
|
+
[features]="editorFeatures" />
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`editor-example.ts`:
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
import { Component, signal } from '@angular/core';
|
|
49
|
+
import { GoodRichTextEditorComponent, type GoodRichTextFeature } from '@cloudfrogger/goodui';
|
|
50
|
+
|
|
51
|
+
@Component({
|
|
52
|
+
standalone: true,
|
|
53
|
+
imports: [GoodRichTextEditorComponent],
|
|
54
|
+
templateUrl: './editor-example.html',
|
|
55
|
+
})
|
|
56
|
+
export class EditorExampleComponent {
|
|
57
|
+
readonly body = signal('<p>Start writing.</p>');
|
|
58
|
+
readonly editorFeatures: readonly GoodRichTextFeature[] = [
|
|
59
|
+
'undo', 'redo',
|
|
60
|
+
'heading1', 'heading2', 'heading3', 'heading4', 'heading5', 'heading6',
|
|
61
|
+
'bold', 'italic', 'underline', 'strikethrough', 'superscript', 'subscript', 'code',
|
|
62
|
+
'paragraph', 'blockquote', 'div', 'pre',
|
|
63
|
+
'alignment', 'smallcaps', 'subtitle', 'highlight',
|
|
64
|
+
'fontfamily', 'fontsize', 'textcolor', 'background',
|
|
65
|
+
'link', 'image', 'bullets', 'numbering', 'table', 'clearformatting',
|
|
66
|
+
];
|
|
67
|
+
}
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
For a smaller editor, use `[features]="['textcolor', 'background', 'alignment']"`. These keys control editor tools; they do not strip formatting from HTML that you load. Native typing and paste remain available. The editor still sanitizes incoming and outgoing HTML.
|
|
71
|
+
|
|
72
|
+
## Load HTML and read the result
|
|
73
|
+
|
|
74
|
+
Bind a signal containing HTML to `[(value)]`. To load a saved document, set the signal to the HTML string. The editor parses it into editable DOM, keeps its supported tags and formatting, and replaces the bound value with the sanitized HTML after rendering. Later edits update the same signal; `(valueChange)` is available when a separate change handler is useful. Read the current visible text through the editor's `getPlainText()` method. It includes browser-rendered line breaks and is available after the editor has rendered.
|
|
75
|
+
|
|
76
|
+
```html
|
|
77
|
+
<good-rich-text-editor label="Article body" [(value)]="html" />
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
```ts
|
|
81
|
+
import { signal, viewChild } from '@angular/core';
|
|
82
|
+
import { GoodRichTextEditorComponent } from '@cloudfrogger/goodui';
|
|
83
|
+
|
|
84
|
+
readonly editor = viewChild(GoodRichTextEditorComponent);
|
|
85
|
+
readonly html = signal('<p>Initial draft</p>');
|
|
86
|
+
|
|
87
|
+
load(savedHtml: string): void {
|
|
88
|
+
this.html.set(savedHtml);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
save(): { html: string; text: string } {
|
|
92
|
+
return {
|
|
93
|
+
html: this.html(),
|
|
94
|
+
text: this.editor()?.getPlainText() ?? '',
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
With Angular Forms, use `formControlName` or a `FormControl<string>` instead of `[(value)]`; call `control.setValue(savedHtml)` to load and read `control.value` to obtain the HTML. The editor sanitizes incoming and emitted markup, retaining supported headings, paragraphs, lists, tables, links, and inline formatting. Unsupported wrappers are unwrapped, while unsafe elements, event handlers, and unsupported styles are removed. A whole web page or word processor export may therefore lose layout and styles; the remaining content is editable. Store the returned HTML if formatting matters, or the plain text when it does not. Avoid treating the returned HTML as a trusted document outside the editor's supported scope.
|
|
100
|
+
|
|
101
|
+
For a workspace that fills the application area, pair `good-main-view layout="fill"` with `[fillHeight]="true"`. The editor then owns its scrollable writing area. Optional `[goodRichTextHeader]` and `[goodRichTextFooter]` slots hold controls above the toolbar and actions below the writing area. The [Compose mail](../../homepage/src/app/examples/mail-compose/mail-compose-page.html) example projects a GoodUI form into the header and Send actions into the footer; its To, Cc, and Subject labels sit before their inputs. These slots are optional for a plain editor.
|
|
102
|
+
|
|
103
|
+
The Format menu offers headings 1–6, inline styles, paragraph/blockquote/div/pre blocks, alignment, small caps, subtitle, and highlight. The toolbar adds a [font select](select-font.md) with previews of locally available families, font size, direct bold/italic/underline, text and background colors, links, images, alignment, unordered and ordered list styles, tables, and clear formatting. The table grid chooses up to 10 columns and 8 rows. Tap or click a cell to show its nearby Table actions button; activate the button to open the icon-labeled menu. A mouse right-click also opens it. The grip at the cell's right edge resizes its entire column; the grip at the bottom resizes its row. Drag either with a mouse or touch, or focus a grip and use the arrow keys. Shift makes the keyboard step larger. Dimensions are stored in the HTML and can be undone. Column resizing applies to regular grids without merged cells; row resizing also works with merged cells. A fixed table width may scroll horizontally on narrow screens. Changing the table width in Table properties resets explicit column widths.
|
|
104
|
+
|
|
105
|
+
For several cells, Shift-click selects a rectangular range and Ctrl/Command-click adds or removes a cell. On touch, choose **Select multiple cells** in Table actions, tap the other cells, then reopen Table actions. The selection is highlighted but is not written into the HTML. **Make header cells** and **Make body cells** change the entire selection in one undo step. Other row and column actions apply to the active cell. Header cells use the theme's table header colors and preserve their content and formatting. Cells in the first row get column header semantics; cells in the first column get row header semantics. Table properties control width, cell padding, and caption.
|
|
106
|
+
|
|
107
|
+
Alignment changes the selected paragraphs, headings, table cells, or list items. List markers stay immediately before their items, and wrapped lines align with the item text.
|
|
108
|
+
|
|
109
|
+
Each toolbar action is a `GoodRichTextCommand`. The command history stores before/after HTML and text selection; typing, paste, and structural edits can be undone and redone. Browser editing uses `contenteditable` and `execCommand` for native text-format actions; inserted links, images, and tables use a saved DOM selection so modals do not lose the insertion point. The component sanitizes incoming, pasted, and emitted HTML. It accepts common formatting tags, approved font-family and color/size styles, web and in-app links, and PNG/JPEG/GIF/WebP images. Image uploads are embedded as data URLs up to 5 MB; applications that need persistent image hosting should replace embedded URLs before saving. No mail sending or storage is provided.
|
|
110
|
+
|
|
111
|
+
The toolbar composes the independent [color controls](color-controls.md) for text and background color.
|
|
112
|
+
|
|
113
|
+
Penpot page `35 Rich Text` publishes `goodui.rich-text-editor`. Its verified ID is in [rich-text-contract.json](../../design/rich-text-contract.json). Toolbar and dialog states are runtime interactions, not separate published variants. The Angular example is [Compose mail](../../homepage/src/app/examples/mail-compose/mail-compose-page.html).
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# Scatter plot
|
|
2
|
+
|
|
3
|
+
`good-scatter-chart` plots independent two-dimensional observations. Each row has an X and Y value; two rows with the same X value remain two dots. Use it to compare a relationship, a spread, or several groups. It uses the shared `GoodChartDataSource`, `good-chart-axis`, GoodUI Card, marker palette, and optional Table view.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { Component } from '@angular/core';
|
|
7
|
+
import { GoodChartAxisComponent, GoodChartScatterComponent, GoodScatterChartComponent,
|
|
8
|
+
type GoodChartDataSource } from '@cloudfrogger/goodui';
|
|
9
|
+
|
|
10
|
+
@Component({
|
|
11
|
+
selector: 'app-measurements', standalone: true,
|
|
12
|
+
imports: [GoodScatterChartComponent, GoodChartAxisComponent, GoodChartScatterComponent],
|
|
13
|
+
templateUrl: './measurements.html',
|
|
14
|
+
})
|
|
15
|
+
export class MeasurementsComponent {
|
|
16
|
+
readonly seriesA: GoodChartDataSource = {
|
|
17
|
+
id: 'a',
|
|
18
|
+
keys: [{ key: 'size', type: 'number' }, { key: 'duration', type: 'number' }],
|
|
19
|
+
rows: [{ size: 10, duration: 24 }, { size: 10, duration: 28 }, { size: 20, duration: 35 }],
|
|
20
|
+
};
|
|
21
|
+
readonly seriesB: GoodChartDataSource = {
|
|
22
|
+
id: 'b',
|
|
23
|
+
keys: [{ key: 'size', type: 'number' }, { key: 'duration', type: 'number' }],
|
|
24
|
+
rows: [{ size: 12, duration: 30 }, { size: 22, duration: 42 }],
|
|
25
|
+
};
|
|
26
|
+
readonly sources = [this.seriesA, this.seriesB];
|
|
27
|
+
}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
```html
|
|
31
|
+
<good-scatter-chart title="Size and duration" [sources]="sources" [showDataToggle]="true">
|
|
32
|
+
<good-chart-axis position="x" type="number" label="Size" [min]="0" />
|
|
33
|
+
<good-chart-axis position="y" type="number" label="Duration" [min]="0" />
|
|
34
|
+
<good-chart-scatter source="a" xKey="size" yKey="duration" label="Group A" />
|
|
35
|
+
<good-chart-scatter source="b" xKey="size" yKey="duration" label="Group B" />
|
|
36
|
+
</good-scatter-chart>
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
`title` and `sources` are required on the chart. Every `good-chart-scatter` requires `source`, `xKey`, and `yKey`; the two keys must be declared in that source. X accepts `number` or `integer` on a numeric axis, or `date` or `datetime` on a time axis. Y accepts `number` or `integer`. Category X axes are not supported because scatter position represents a continuous quantity. Invalid rows are skipped without converting strings into numbers.
|
|
40
|
+
|
|
41
|
+
The optional `showDataToggle` defaults to false. Its GoodUI Button switches to a GoodUI Table with one row per observation, so points sharing X remain separate. The chart uses marker blue, teal, violet, amber, rose, and lime by default. Set `[colors]` to a string array of marker names or CSS colors; an individual `color` on `good-chart-scatter` takes precedence. `ariaLabel` overrides the chart title as the SVG description. Each point also has its source and values in a native tooltip.
|
|
42
|
+
|
|
43
|
+
Axes accept `min`, `max`, `ticks`, `precision`, and `label` as on the other charts. The default range adds a little padding around the data. Points outside an explicit range are clipped. A time X axis can use `groupBy="day/month/year"`; points in the same bucket remain separate unless `aggregate` is explicitly set to `mean`, `sum`, `min`, `max`, `count`, `first`, or `last`. Read [Chart data sources](chart-data.md) for the common type contract and see the [homepage example](../../homepage/src/app/visualizations/scatter-plots-page.html).
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# Search
|
|
2
|
+
|
|
3
|
+
`good-search` opens a modal navigation search from a round magnifier action. It filters application-supplied link labels and descriptions locally, with automatic input focus, keyboard navigation, and an empty state. The homepage documents it at `/components/search` with a working preview and copyable examples.
|
|
4
|
+
|
|
5
|
+
## Standalone usage
|
|
6
|
+
|
|
7
|
+
Import `GoodSearchComponent` and `GoodSearchItem` from `@cloudfrogger/goodui`. Configure Angular Router through `provideRouter(routes)` in the consuming app.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
readonly items: readonly GoodSearchItem[] = [
|
|
11
|
+
{ id: 'buttons', label: 'Buttons', description: 'Actions and icons', route: '/components/buttons' },
|
|
12
|
+
{ id: 'tables', label: 'Tables', description: 'Records and pagination', route: '/components/tables' },
|
|
13
|
+
];
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
```html
|
|
17
|
+
<good-search [items]="items" />
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## API
|
|
21
|
+
|
|
22
|
+
`items` is the sole component input. It accepts `readonly GoodSearchItem[]` and defaults to `[]`.
|
|
23
|
+
|
|
24
|
+
| Field | Required | Meaning |
|
|
25
|
+
| --- | --- | --- |
|
|
26
|
+
| `id` | Yes | Unique, stable result key |
|
|
27
|
+
| `label` | Yes | Visible result title, searched locally |
|
|
28
|
+
| `description` | No | Supporting result text, searched locally |
|
|
29
|
+
| `route` | Yes | Angular Router destination |
|
|
30
|
+
|
|
31
|
+
`open()` opens the native dialog and focuses its search input. `close()` closes the dialog. The `query` signal holds the search field’s current text. The `results` signal computes the matching supplied records. Matching is case-insensitive and uses a substring of the combined label and description. An empty query includes every item. An unmatched query displays **No results**.
|
|
32
|
+
|
|
33
|
+
## Shell integration
|
|
34
|
+
|
|
35
|
+
`good-app-layout`, `good-topbar`, and `good-main-menu` accept the navigation records through `searchItems`.
|
|
36
|
+
|
|
37
|
+
```html
|
|
38
|
+
<good-app-layout [searchItems]="items">
|
|
39
|
+
<router-outlet />
|
|
40
|
+
</good-app-layout>
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
MainMenu shows the action by default. A standalone MainMenu can set `[showSearch]="false"` to hide it.
|
|
44
|
+
|
|
45
|
+
## Keyboard and navigation
|
|
46
|
+
|
|
47
|
+
The native modal dialog contains focus. Tab and Shift+Tab move between the input, results, and close action. Enter activates a focused result. Escape or Close dismisses the dialog and restores focus to the trigger. Selecting a result closes the dialog and follows its `route` through Angular Router.
|
|
48
|
+
|
|
49
|
+
## Search fields within a page
|
|
50
|
+
|
|
51
|
+
Use `good-input type="search"` for a continuously visible field above a list, table, or card grid. Bind its value to application filtering. See [Input](input.md). GoodUI Table and Select also document their integrated search behavior in their respective guides.
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Font select
|
|
2
|
+
|
|
3
|
+
`good-select-font` shows familiar web font families with each option rendered in its own typeface. It tries to load each named family from the current browser's local fonts and omits names that fail. Sans serif, serif, monospace, and system UI are always offered.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<good-select-font label="Font family" [(value)]="fontFamily"
|
|
7
|
+
(fontSelected)="onFontSelected($event)" />
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
`value` defaults to `sans-serif` and can be set programmatically. `fontSelected` fires after a user choice; `valueChange` supports two-way binding. The control also implements Angular Forms `ControlValueAccessor`. `label` defaults to `Font family`; `size` accepts `small`, `default`, or `large`; `disabled` defaults to `false`. Keyboard users can open with Enter, Space, or an arrow key, move with arrows or Home/End, choose with Enter/Space, and close with Escape.
|
|
11
|
+
|
|
12
|
+
The built-in candidates include common names such as Arial, Verdana, Georgia, Times New Roman, Courier New, Liberation, DejaVu, and Noto families. `options` can replace that candidate list with `GoodFontOption[]`; named candidates are still checked before display. Each option needs `value`, `label`, and a `fallback` family (`sans-serif`, `serif`, or `monospace`). Set `generic: true` only for CSS generic families that always render. The selected value is a family name, not a CSS declaration; `goodFontFamilyCss()` supplies a safe fallback list when applying it to content.
|
|
13
|
+
|
|
14
|
+
The control probes each candidate with CSS `local()` through the [Font Loading API](https://www.w3.org/TR/css-font-loading/). A missing face rejects the load, even when ordinary CSS would silently substitute a different family. If the browser blocks local font loading, only generic families remain. The control does not request local-font access permission or download fonts. A font available while writing may be absent on another reader's device; saved HTML uses a generic fallback.
|
|
15
|
+
|
|
16
|
+
The [rich text editor](rich-text-editor.md) uses this control in its toolbar. The homepage [Font select](/components/select-font) chapter demonstrates independent use.
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# Select
|
|
2
|
+
|
|
3
|
+
`good-select` chooses one or more values from an application supplied list. Its control, popup, option spacing, selected marks, and removable multi selection badges use the GoodUI design tokens. Use `good-select-country` when the options are countries: it supplies localized country names and SVG flags while retaining the same Select behavior.
|
|
4
|
+
|
|
5
|
+
## Single selection
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
import { Component, signal } from '@angular/core';
|
|
9
|
+
import { GoodSelectComponent, type GoodSelectOption, type GoodSelectValue } from '@cloudfrogger/goodui';
|
|
10
|
+
|
|
11
|
+
@Component({
|
|
12
|
+
standalone: true,
|
|
13
|
+
imports: [GoodSelectComponent],
|
|
14
|
+
template: `<good-select label="Plan" [showLabel]="true" [options]="plans"
|
|
15
|
+
placeholder="Choose a plan" [(value)]="plan" />`,
|
|
16
|
+
})
|
|
17
|
+
export class PlanField {
|
|
18
|
+
readonly plans: readonly GoodSelectOption[] = [
|
|
19
|
+
{ value: 'starter', label: 'Starter', description: 'For smaller teams' },
|
|
20
|
+
{ value: 'growth', label: 'Growth', tags: ['Popular'] },
|
|
21
|
+
{ value: 'enterprise', label: 'Enterprise', disabled: true },
|
|
22
|
+
];
|
|
23
|
+
readonly plan = signal<GoodSelectValue>('growth');
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Set `value` to a string for an initial selection or `null` to show `placeholder`. Options use stable string `value` keys; duplicate keys are unsupported. `disabled` on an option makes only that choice unavailable. The entire control accepts `[disabled]` and the sizes `small`, `default`, and `large`. `required` adds Angular Forms validation and `aria-required`; pair it with a visible required label when appropriate. The control also works with `formControl` or `formControlName` through `ControlValueAccessor`.
|
|
28
|
+
|
|
29
|
+
An option may provide `triggerLabel` to show shorter text in the closed control while keeping its full `label` in the popup and accessible name. Phone Input uses this to display `+49` beside the flag while announcing the country name and calling code.
|
|
30
|
+
|
|
31
|
+
## Multiple selection and search
|
|
32
|
+
|
|
33
|
+
```html
|
|
34
|
+
<good-select label="Teams" [showLabel]="true" [options]="teams"
|
|
35
|
+
[multiple]="true" [maxSelected]="3" [searchable]="true"
|
|
36
|
+
[(value)]="selectedTeams" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
For multiple selection, `value` is a `readonly string[]`. Selected values remain in their supplied order and appear as removable GoodUI badges. Choosing an option again toggles it off. `maxSelected` makes further unselected options unavailable until a badge is removed; selected options can still be deselected. An externally supplied value over the maximum remains visible and receives a `maxSelected` Angular Forms validation error until enough selections are removed. A disabled selected option remains visible and cannot be toggled or removed. Each option can have a Lucide `icon`, custom `iconSrc`, a smaller gray `description`, and `tags`. Icons and image sources carry into selected badges, including country flags. Tags appear inside popup rows; they do not change the selected value. `[searchable]="true"` places a search field at the top of the popup and filters labels, descriptions, values, and tags on the client. The popup list scrolls inside a 320 px maximum height. `searchPlaceholder` and `emptyMessage` can be customized.
|
|
40
|
+
|
|
41
|
+
## Countries
|
|
42
|
+
|
|
43
|
+
```ts
|
|
44
|
+
import { GoodSelectCountryComponent } from '@cloudfrogger/goodui';
|
|
45
|
+
|
|
46
|
+
// In a standalone component's imports: [GoodSelectCountryComponent]
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
```html
|
|
50
|
+
<good-select-country label="Country" [showLabel]="true" locale="en-US"
|
|
51
|
+
[(value)]="country" />
|
|
52
|
+
|
|
53
|
+
<good-select-country label="Supported markets" [showLabel]="true"
|
|
54
|
+
[countries]="['DE', 'FR', 'GB', 'US']" [value]="'DE'" />
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Country Select searches by default. `countries` is an optional allowlist of country codes; `excludedCountries` removes codes from the full list or allowlist. Input codes are normalized to uppercase. `locale` determines displayed names and sorting through `Intl.DisplayNames`; it defaults to `en-US`. The bundled flags come from [country-flag-icons](https://github.com/catamphetamine/country-flag-icons/blob/master/README.md), an MIT licensed dependency, and are loaded on demand. Country Select accepts the same `multiple`, `maxSelected`, `size`, `disabled`, `required`, `error`, `showLabel`, `placeholder`, `searchable`, `searchPlaceholder`, and `describedBy` inputs as Select. Its selected value is a country code or a list of codes.
|
|
58
|
+
|
|
59
|
+
## Interaction and design mapping
|
|
60
|
+
|
|
61
|
+
The trigger is a combobox controlling a listbox. Arrow keys move through enabled options; Home and End jump to the ends; Enter or Space selects; Escape closes and returns focus; Tab leaves the control. Search receives focus when the searchable popup opens. Selected options expose `aria-selected`, unavailable options `aria-disabled`, and multi selection sets `aria-multiselectable`. Clicking away closes the popup. On a narrow viewport the popup stays within the screen and its list scrolls. The caller should provide a meaningful `label`; `showLabel` determines whether it is also visible.
|
|
62
|
+
|
|
63
|
+
Penpot page `17 Selects` publishes `goodui.select` (`size=small/default/large`, `state=placeholder/selected/multi/disabled`) and `goodui.select-country` for the country specific presentation. `goodui.select-option` and `goodui.select-panel` are internal visual parts of `good-select`. The documented names and stable IDs are in [select-variants.json](../../design/select-variants.json). Values, option count, descriptions, tags, icons, search text, and the exact selected set are runtime data. The `select.*` tokens alias the existing Input, Dropdown, spacing, radius, and color roles; the Penpot export generates the matching CSS variables. Browser focus, filtering, list scrolling, and the dynamic SVG flag load are runtime behavior.
|
|
64
|
+
|
|
65
|
+
Control and option disabled opacity have separate `select.*` tokens. Flag stripe colors are intrinsic to the country artwork. Penpot cannot bind browser combobox semantics, the scrolling viewport, or the current search query to tokens; Angular owns those behaviors. During token verification, the plugin resolved edited aliases immediately, while bound shape colors and spacing repainted after changing the active appearance theme. The original token values were restored and the file left on the light theme.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Settings
|
|
2
|
+
|
|
3
|
+
`goodui.settings` has a round trigger and an anchored menu. Apps can supply action buttons and links. The independent [Theme toggle](./theme-toggle.md) handles appearance from a single topbar click.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<good-settings [actions]="settingsActions" />
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The menu stays inside the viewport near its right edge, is keyboard accessible, and returns focus to its trigger when closed.
|
|
10
|
+
|
|
11
|
+
Settings is optional in the standard topbar: set `[showSettings]="true"` on `good-app-layout`, `good-topbar`, or `good-main-menu` to include it.
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# Sidebar
|
|
2
|
+
|
|
3
|
+
**Design IDs:** `goodui.sidebar-container`, `goodui.sidebar-menu-container`, `goodui.sidebar-item`, `goodui.sidebar-submenu-group`, `goodui.sidebar-submenu-item`.
|
|
4
|
+
|
|
5
|
+
`SidebarContainer` owns the brand area, scrolling, and desktop/drawer display. A `SidebarMenuContainer` contains an optional heading and repeated `SidebarItem` children. Each item can show an icon, label, badge, or expander. Penpot includes `default`, `active`, and `expanded` states. Expanded groups contain another expandable row, guide lines, and repeated `SidebarSubmenuItem` instances; groups have `collapsed`/`expanded` states and child links have `default`/`active` states.
|
|
6
|
+
|
|
7
|
+
For a product logo, set `brandLogoSrc` and optionally `brandLogoDarkSrc` on `good-app-layout` or directly on `good-sidebar-container`. `brand` provides the image's accessible name. Without a logo URL, the generic mark and text remain available.
|
|
8
|
+
|
|
9
|
+
The homepage's Account / Get Started navigation shows two expansion levels. GoodUI uses 36 px child rows, a 4 px gap, indentation, and a dot on the active link. The active child uses `color.selected` for its surface, `color.accent` for text and dot, and `radius.item` for its corners. `SidebarSubmenuGroup` owns the guide lines and indentation; child links need no external margins.
|
|
10
|
+
|
|
11
|
+
### Component composition
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<good-sidebar-container>
|
|
15
|
+
<good-sidebar-menu-container heading="USER">
|
|
16
|
+
<good-sidebar-item label="Dashboard" icon="dashboard" route="/dashboard" [active]="true" />
|
|
17
|
+
<good-sidebar-item label="My Account" icon="account" [expanded]="true">
|
|
18
|
+
<good-sidebar-submenu-group label="Account Home" [expanded]="true">
|
|
19
|
+
<good-sidebar-submenu-item label="Get Started" route="/account/home/get-started" [active]="true" />
|
|
20
|
+
<good-sidebar-submenu-item label="User Profile" route="/account/home/user-profile" />
|
|
21
|
+
</good-sidebar-submenu-group>
|
|
22
|
+
</good-sidebar-item>
|
|
23
|
+
</good-sidebar-menu-container>
|
|
24
|
+
</good-sidebar-container>
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
For most apps, `good-app-layout` builds the same structure from `sidebarSections`. A section has `id`, optional `heading`, and `items`. Each item has `id`, `label`, and optional `icon`, `badge`, `disabled`, `route`, or recursive `children`. GoodUI calculates spacing, indentation, guide lines, and scroll height. Route matching uses the route and its descendants by default. Set `activeMatch: 'exact'` on an overview item whose URL is also the prefix of sibling pages; then only that exact URL is marked active. The same choice is available as `activeMatch="exact"` on a directly declared sidebar item.
|
|
28
|
+
|
|
29
|
+
For a large catalog, use a small number of named parents instead of placing every page directly under the section heading. The homepage groups its component pages under Controls, Inputs, Content and data, Feedback, and Navigation. For example:
|
|
30
|
+
|
|
31
|
+
```ts
|
|
32
|
+
import { type GoodSidebarSection } from '@cloudfrogger/goodui';
|
|
33
|
+
|
|
34
|
+
readonly navigation: readonly GoodSidebarSection[] = [
|
|
35
|
+
{ id: 'components', heading: 'COMPONENTS', items: [
|
|
36
|
+
{ id: 'inputs-category', label: 'Inputs', icon: 'card', children: [
|
|
37
|
+
{ id: 'text-inputs', label: 'Text and file', route: '/components/inputs' },
|
|
38
|
+
{ id: 'number-inputs', label: 'Number inputs', route: '/components/number-inputs' },
|
|
39
|
+
{ id: 'date-inputs', label: 'Date inputs', route: '/components/date-inputs' },
|
|
40
|
+
] },
|
|
41
|
+
] },
|
|
42
|
+
];
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
The parent is an expandable button; its smaller child rows are links. Keep routes on the leaves so the active route opens its parent automatically. The same hierarchy works in the mobile drawer.
|
|
46
|
+
|
|
47
|
+
Parents and nested groups are buttons with `aria-expanded` and `aria-controls`; only leaf nodes are links. Enter and Space expand groups, and Tab follows the visible menu order. Hidden children cannot receive focus. An active link gets `aria-current="page"`, and its ancestors open when its route loads. One group per level can be open; clicking it again closes it. Long nested menus remain independently scrollable in the mobile drawer.
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
# Signature pad
|
|
2
|
+
|
|
3
|
+
`good-signature-pad` captures a handwritten signature from a pen, finger, or mouse. Its dashed white writing surface, baseline, and **Clear** button make the intended action visible. Clear is available by default. Each completed stroke produces two independent results: a structured sequence of sampled points and a standalone SVG image.
|
|
4
|
+
|
|
5
|
+
```html
|
|
6
|
+
<good-signature-pad label="Your signature" [(value)]="signature"
|
|
7
|
+
(svgChange)="savedSvg.set($event)" />
|
|
8
|
+
```
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { signal } from '@angular/core';
|
|
12
|
+
import { GoodSignatureData, goodSignatureSvg, goodSignatureInkml } from '@cloudfrogger/goodui';
|
|
13
|
+
|
|
14
|
+
readonly signature = signal<GoodSignatureData | null>(null);
|
|
15
|
+
readonly savedSvg = signal('');
|
|
16
|
+
|
|
17
|
+
save(): void {
|
|
18
|
+
const data = this.signature(); // ordered strokes and timed samples
|
|
19
|
+
const svg = goodSignatureSvg(data); // standalone SVG string
|
|
20
|
+
const inkml = goodSignatureInkml(data); // optional standards-based exchange
|
|
21
|
+
// Store the values your application needs.
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
`value` is `GoodSignatureData | null`. The object has `version: 1`, `capturedAt` (UTC ISO timestamp of first contact), `width` and `height` (the drawing surface in CSS pixels at first contact), and `strokes` in drawing order. Each stroke records `pointerType` (`pen`, `touch`, or `mouse`) and `points`. A point has `x` and `y` in that recorded surface, `t` in milliseconds since first contact, and `pressure` from 0 to 1. The component uses [Pointer Events](https://www.w3.org/TR/pointerevents3/) and captures coalesced move samples when the browser exposes them. This keeps fast strokes more faithful without inventing intermediate points. A mouse typically reports a constant pressure while pressed.
|
|
26
|
+
|
|
27
|
+
Read the points as a time series: pen down starts a stroke, samples follow the pen in order, and pen up ends that stroke. The clock does not reset for the next stroke. For example, points at `t: 0` and `t: 45` were captured 45 ms apart; if the next stroke starts at `t: 260`, the gap between strokes is preserved. Combine `t` with each point's `x` and `y` to replay the movement. The SVG shows the final lines but carries no timing.
|
|
28
|
+
|
|
29
|
+
The data model follows the X, Y, T, and F channel meanings in [W3C InkML](https://www.w3.org/TR/InkML/). It is a convenient typed JSON object, not InkML XML. Call `goodSignatureInkml(data)` or `component.inkml()` when an InkML document is needed. `goodSignatureSvg(data)` or `component.svg()` returns a self-contained SVG containing one line path per stroke; a single tap becomes a dot. Pressure is recorded but the visible line keeps a constant width. The SVG contains the visible shape, while the data object preserves stroke order and timing for replay or analysis. Neither format proves who signed or that the signature is legally valid.
|
|
30
|
+
|
|
31
|
+
| API | Default | Use |
|
|
32
|
+
| --- | --- | --- |
|
|
33
|
+
| `label` | `Signature` | Accessible name and visible label. |
|
|
34
|
+
| `height` | `180` | Drawing surface height in CSS pixels; the control fills available width. |
|
|
35
|
+
| `value` / `valueChange` | `null` | Two-way structured signature data. A completed stroke updates the value; Clear sets it to `null`. |
|
|
36
|
+
| `svg` | derived | Signal containing the current standalone SVG, or `''` when empty. |
|
|
37
|
+
| `inkml` | derived | Signal containing optional InkML XML, or `''` when empty. |
|
|
38
|
+
| `svgChange` | event | Emits the SVG after each completed stroke and `''` after Clear. |
|
|
39
|
+
| `strokeCompleted` | event | Emits the newly completed stroke, including its sampled points. |
|
|
40
|
+
| `showClear` | `true` | Show the built-in Clear button. `clear()` remains callable when it is hidden. |
|
|
41
|
+
| `disabled`, `readonly` | `false` | Block drawing and clearing. |
|
|
42
|
+
|
|
43
|
+
Bind `value` to a saved `GoodSignatureData` object to show an existing signature; the SVG is recreated from those strokes. A reactive `FormControl<GoodSignatureData | null>` can be used instead of `[(value)]`. Use one value source per instance. The canvas keeps the recorded aspect ratio when its layout size changes, so a loaded signature is not stretched.
|
|
44
|
+
|
|
45
|
+
The Penpot page `38 Signature Pads` publishes `goodui.signature-pad`, mapped to `good-signature-pad`. Its master shows the empty state; drawing, clearing, and outputs are runtime behavior. The stable component ID is in [signature-pad-contract.json](../../design/signature-pad-contract.json).
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# Sparkline
|
|
2
|
+
|
|
3
|
+
`good-sparkline` shows one compact trend without a Card, axes, legend, or interactive controls. Use it beside a metric or inside a GoodUI Table cell. It reads the same typed `GoodChartDataSource` as Line and Bar charts, so the same source can power a full chart elsewhere.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { Component } from '@angular/core';
|
|
7
|
+
import { GoodSparklineComponent, type GoodChartDataSource } from '@cloudfrogger/goodui';
|
|
8
|
+
|
|
9
|
+
@Component({
|
|
10
|
+
selector: 'app-visits', standalone: true,
|
|
11
|
+
imports: [GoodSparklineComponent],
|
|
12
|
+
templateUrl: './visits.html',
|
|
13
|
+
})
|
|
14
|
+
export class VisitsComponent {
|
|
15
|
+
readonly visits: GoodChartDataSource = {
|
|
16
|
+
id: 'visits',
|
|
17
|
+
keys: [{ key: 'count', type: 'integer', label: 'Visits' }],
|
|
18
|
+
rows: [42, 51, 48, 63, 74, 68, 82].map(count => ({ count })),
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
```html
|
|
24
|
+
<good-sparkline [source]="visits" yKey="count" ariaLabel="Weekly visits trend" />
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
`source` and `yKey` are required. The Y key must be `number` or `integer`; invalid rows are skipped without coercion. Without `xKey`, row positions 1, 2, 3, and so on become X values. An explicit `xKey` can be `category`, `number`, `integer`, `date`, or `datetime`, using the same validation and ordering rules as the larger charts. For time values, `groupBy="day/month/year"` and `aggregate="mean/sum/min/max/count/first/last"` have the same meaning as on `good-chart-axis`; duplicate X values require an explicit aggregation.
|
|
28
|
+
|
|
29
|
+
The default `size="default"` is 128 × 32 px; `small` is 88 × 24 px and `large` is 180 × 48 px. Set `[width]` to a pixel number when the available cell needs another width. `min` and `max` optionally fix the vertical scale for comparable Sparklines; by default each line scales to its own data. `showEndpoint` defaults to true. The default stroke uses theme-aware marker blue; `color` accepts a marker name, another GoodUI semantic name, or a CSS color. Give `ariaLabel` a concise name in a repeated context such as a table; otherwise the SVG describes the metric, point count, and first and last values automatically.
|
|
30
|
+
|
|
31
|
+
Invalid configuration appears as “Invalid data” with the detailed error in its title. An empty valid source shows “No data”. The [homepage example](../../homepage/src/app/visualizations/sparklines-page.html) shows a metric and custom Table cells. Penpot publishes `goodui.sparkline` with ID `1b6260d7-e591-805d-8008-e3e1ea06ba12` on `42 Charts`.
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# StatusIcon
|
|
2
|
+
|
|
3
|
+
`good-status-icon` is a compact, non-interactive status indicator. Set its required `status` and use the default flat dot (`appearance="plain"`) unless the surrounding UI needs a stronger visual cue. The component owns its shape, color, size, and accessible name; it does not change application state or emit events.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { GoodStatusIconComponent } from '@cloudfrogger/goodui';
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
```html
|
|
10
|
+
<good-status-icon status="completed" />
|
|
11
|
+
<good-status-icon status="pending" appearance="led" size="large" />
|
|
12
|
+
<good-status-icon status="pending" appearance="clock-mono" />
|
|
13
|
+
<good-status-icon status="error" appearance="symbol" />
|
|
14
|
+
<span><good-status-icon status="revising" [decorative]="true" /> Revising</span>
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
| Input | Values | Default |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| `status` | `completed`, `pending`, `progressing`, `revising`, `dismissed`, `error` | Required |
|
|
20
|
+
| `appearance` | `plain`, `led`, `clock`, `clock-mono`, `circle`, `circle-mono`, `symbol` | `plain` |
|
|
21
|
+
| `size` | `small`, `default`, `large` | `default` |
|
|
22
|
+
| `disabled` | Boolean | `false` |
|
|
23
|
+
| `decorative` | Boolean | `false` |
|
|
24
|
+
| `ariaLabel` | Accessible name override, for example for localization | Status name in English |
|
|
25
|
+
|
|
26
|
+
The three outer sizes are 16, 24, and 32 px. The mark inside scales with the treatment, while every size keeps a stable inline alignment box.
|
|
27
|
+
|
|
28
|
+
The colored appearances follow GoodUI's light and dark tokens: completed uses Success green, pending uses the shared orange hue, progressing uses Warning yellow, revising uses Info blue, dismissed uses muted gray, and error uses Error red. `clock-mono` and `circle-mono` use the theme text color for every status, matching GoodUI's other mono components; pair them with visible status text because color and shape do not distinguish their states. Disabled uses muted gray and lowers its emphasis. LED adds a restrained highlight, gradient, and bevel. Clock is a filled face with contrasting hands; Clock mono is outlined. Circle is a substantial ring; Circle mono is a fine outline. Symbol adds a status-specific check, dots, arrow, revision mark, minus, or X, so it communicates more than color alone. The shapes are static, including Progressing; use `good-progress` when an actual percentage or ongoing animation is needed.
|
|
29
|
+
|
|
30
|
+
Without `decorative`, the host has `role="img"` and a status-based accessible label. Set `[decorative]="true"` when nearby visible text already names the state, preventing duplicate announcements. `ariaLabel` can replace the English label. StatusIcon has no button behavior; `disabled` is a visual state and is included in its default accessible label.
|
|
31
|
+
|
|
32
|
+
Penpot page `30 Status Icons` publishes 42 `goodui.status-icon` variants for `status × appearance`. The variant group demonstrates the enabled default size; a linked specimen board shows small, default, large, and disabled runtime options. Colored appearances bind theme-aware semantic tokens; all 12 mono variants bind their outlines to `color.text`. The LED highlight is a local white effect over token-bound color. The progressing Clock's Penpot hands use a local dark brown because the shared `color.warning-foreground` becomes yellow in Dark mode; Angular uses the dark canvas color for contrast. See [status-icon-variants.json](../../design/status-icon-variants.json) for every published ID.
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Submenus
|
|
2
|
+
|
|
3
|
+
GoodUI provides nested navigation in the sidebar, topbar, avatar menu, and page Subnav. Each parent owns its trigger, open state, child placement, and keyboard behavior. Supply recursive `children` data to the owning component; consuming pages do not position submenu panels themselves.
|
|
4
|
+
|
|
5
|
+
| Area | Public component or input | Penpot family | Layout behavior |
|
|
6
|
+
| --- | --- | --- | --- |
|
|
7
|
+
| Sidebar | `good-sidebar-item` and `good-sidebar-submenu-group`, or `sidebarSections[].items[].children` | `goodui.sidebar-submenu-group` and `goodui.sidebar-submenu-item` | Indented rows, guide lines, and scrolling in the drawer |
|
|
8
|
+
| Topbar | `topbarItems[].children` | `goodui.topbar-dropdown-menu`, `goodui.topbar-dropdown-item`, and `goodui.topbar-submenu` | Floating desktop panels that flip at the viewport edge; stacked levels in the mobile drawer or topbar popup |
|
|
9
|
+
| Avatar menu | `avatarActions[].children` | `goodui.avatar-submenu` inside `goodui.avatar-menu` | Panel opens toward available space and nests inside the mobile menu |
|
|
10
|
+
| Page Subnav | `subnavItems[].children` | `goodui.subnav-dropdown` inside `goodui.subnav` | Menu stays visible outside the horizontally scrolling item track |
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import type { GoodTopbarItem } from '@cloudfrogger/goodui';
|
|
14
|
+
|
|
15
|
+
const supportMenu: GoodTopbarItem = {
|
|
16
|
+
id: 'support',
|
|
17
|
+
label: 'Support',
|
|
18
|
+
children: [
|
|
19
|
+
{ id: 'guides', label: 'Guides', route: '/guides' },
|
|
20
|
+
{ id: 'community', label: 'Community', children: [
|
|
21
|
+
{ id: 'questions', label: 'Questions', route: '/community/questions' },
|
|
22
|
+
{ id: 'ask', label: 'Ask a question', route: '/community/ask' },
|
|
23
|
+
] },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
Parents use buttons with `aria-expanded` and `aria-controls`; leaves use links and expose `aria-current="page"` when active. Escape closes an open level and restores focus to its trigger. The sidebar opens active ancestors from the current route. The topbar and avatar menus also close on outside click; the Subnav closes on outside click, scroll, resize, or navigation. See the [Topbar](./topbar.md), [Sidebar](./sidebar.md), [Avatar menu](./avatar-menu.md), and [Subnav](./subnav.md) guides for the full APIs and behavior.
|
|
29
|
+
|
|
30
|
+
`good-topbar-submenu` is also a standalone public component for a nested menu level. Pass the same `GoodTopbarItem[]` structure through `[items]`, give the level an accessible `label`, and handle `(navigate)` if a surrounding menu must close. The library owns placement, edge flipping, and the rows. The homepage has a dedicated **Topbar submenu** component page with a working example.
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# Subnav
|
|
2
|
+
|
|
3
|
+
`good-subnav` navigates between sections of one area, such as account pages. It is a 60 px strip on desktop and a 44 px strip on mobile. `good-main-view` can place it above the heading without extra layout CSS.
|
|
4
|
+
|
|
5
|
+
```ts
|
|
6
|
+
import { GoodMainViewComponent, type GoodSubnavItem } from '@cloudfrogger/goodui';
|
|
7
|
+
|
|
8
|
+
readonly accountSections: readonly GoodSubnavItem[] = [
|
|
9
|
+
{ id: 'home', label: 'Account Home', route: '/account/home', children: [
|
|
10
|
+
{ id: 'profile', label: 'Profile', route: '/account/home/profile' },
|
|
11
|
+
] },
|
|
12
|
+
{ id: 'billing', label: 'Billing', route: '/account/billing', children: [
|
|
13
|
+
{ id: 'basic', label: 'Basic', route: '/account/billing' },
|
|
14
|
+
{ id: 'history', label: 'History', route: '/account/billing/history' },
|
|
15
|
+
] },
|
|
16
|
+
{ id: 'security', label: 'Security', route: '/account/security' },
|
|
17
|
+
];
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<good-main-view title="Billing" [subnavItems]="accountSections" subnavLabel="Account sections">
|
|
22
|
+
<app-billing-content />
|
|
23
|
+
</good-main-view>
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The component can also be placed directly with `<good-subnav [items]="accountSections" ariaLabel="Account sections" />`. Its `activeRoute` input overrides automatic Angular Router tracking when necessary. Provide stable `id` values and actual routes for links. A parent with both `route` and `children` renders a link and a separate chevron; a parent with only children renders a menu button. `disabled` removes interaction.
|
|
27
|
+
|
|
28
|
+
The strip never wraps. On narrow screens, users can swipe or scroll the item row horizontally. The active item moves into view after navigation. The scroll belongs to the item track, so the page width remains unchanged. The active item has an accent underline. Child links open in a panel that is not clipped by the scroll area and is clamped to the viewport edge.
|
|
29
|
+
|
|
30
|
+
Place optional controls at the right edge without page-level layout CSS:
|
|
31
|
+
|
|
32
|
+
```ts
|
|
33
|
+
import { GoodMainViewComponent, LucideCircleQuestionMark, LucideEllipsis, type GoodSubnavAction } from '@cloudfrogger/goodui';
|
|
34
|
+
|
|
35
|
+
readonly subnavActions: readonly GoodSubnavAction[] = [
|
|
36
|
+
{ id: 'help', label: 'Help', icon: LucideCircleQuestionMark, variant: 'outline', size: 'small', route: '/help' },
|
|
37
|
+
{ id: 'account-actions', label: 'Account actions', icon: LucideEllipsis, menuItems: [
|
|
38
|
+
{ id: 'profile', label: 'Profile', route: '/account/profile' },
|
|
39
|
+
{ id: 'settings', label: 'Settings', route: '/account/settings' },
|
|
40
|
+
] },
|
|
41
|
+
];
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<good-main-view [subnavItems]="accountSections" [subnavActions]="subnavActions" subnavLabel="Account sections">
|
|
46
|
+
<app-account-content />
|
|
47
|
+
</good-main-view>
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
`GoodSubnavAction` renders either a `good-button` or a `good-action-menu` when `menuItems` is present. The `icon` value is a Lucide icon class or icon data; `variant` and `size` use the same Button API. Subnav controls default to `outline` and `small` to preserve the compact strip. `route` navigates and `action` calls a callback. `iconOnly` needs a meaningful `label`, used as the accessible name. When using `good-subnav` directly, you can also project a `[good-subnav-actions]` group of custom controls. The action area remains visible while only the items scroll. It is optional; without actions the strip uses its full width. The `goodui.subnav.with-actions` Penpot composition is the design counterpart of this API.
|
|
51
|
+
|
|
52
|
+
`Subnav` is a named navigation landmark. Current links use `aria-current="page"`; menu buttons use `aria-expanded` and `aria-controls`. Arrow Left/Right and Home/End move among top-level links or buttons. Opening a menu focuses its first link; Escape closes it and returns focus. Outside click, horizontal scroll, window resize, and route changes also close it. Keep labels concise enough to scan, and use an explicit accessible label when a page has more than one navigation landmark.
|
|
53
|
+
|
|
54
|
+
Penpot states: `goodui.subnav.desktop`, `.mobile`, `.menu-open`, `.with-actions`; `goodui.subnav-item.link`, `.parent`, `.active`; and `goodui.subnav-dropdown.default`. The mobile viewport clips a longer nested item track to document the scroll behavior.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# Switch
|
|
2
|
+
|
|
3
|
+
`good-switch` is a reusable on/off control for a setting that takes effect immediately. Its visible track and thumb come from the Penpot `goodui.switch` component. The component keeps the label, hit area, focus ring, and input behavior together, so pages do not need custom alignment or click handling.
|
|
4
|
+
|
|
5
|
+
| Input | Meaning |
|
|
6
|
+
| --- | --- |
|
|
7
|
+
| `label` | Required accessible name; set `showLabel` to display it beside the track |
|
|
8
|
+
| `checked` | Current on/off value; supports `[(checked)]` |
|
|
9
|
+
| `size` | `small`, `default`, or `large` |
|
|
10
|
+
| `appearance` | `brand` (default) or `mono`; mono uses theme text colors instead of the brand color |
|
|
11
|
+
| `disabled` | Prevents changes and dims the control |
|
|
12
|
+
| `error` | Adds a theme-aware error outline and `aria-invalid`; the value remains on or off |
|
|
13
|
+
| `describedBy` | ID of a hint or error message for assistive technology |
|
|
14
|
+
| `name`, `inputId`, `required` | Native input and form attributes |
|
|
15
|
+
|
|
16
|
+
The visible track sizes are 28 × 16, 36 × 20, and 44 × 24 px. Every size has at least a 44 × 44 px interactive area. The native checkbox has `role="switch"`; Space toggles it, Tab reaches it, and disabled switches cannot change. Focus is visible. Error and disabled are independent inputs; disabled takes visual priority if both are true. An error does not force the switch off. Provide a nearby explanation and connect it with `describedBy`.
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
import { signal } from '@angular/core';
|
|
20
|
+
import { GoodSwitchComponent } from '@cloudfrogger/goodui';
|
|
21
|
+
|
|
22
|
+
readonly emailEnabled = signal(false);
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<good-switch label="Email notifications" [showLabel]="true" [(checked)]="emailEnabled" />
|
|
27
|
+
|
|
28
|
+
<good-switch label="Automatic renewal" [checked]="true" [disabled]="true" />
|
|
29
|
+
|
|
30
|
+
<good-switch label="Publishing" [error]="true" describedBy="publish-error" />
|
|
31
|
+
<p id="publish-error">Choose a publishing option before continuing.</p>
|
|
32
|
+
|
|
33
|
+
<good-switch label="Compact setting" appearance="mono" [checked]="true" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
The component is also an Angular `ControlValueAccessor` for reactive and template-driven forms. Use either a form binding or `[(checked)]` as the source of truth for a given instance. In reactive forms, `disabled` also follows the form control's disabled state.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { FormControl } from '@angular/forms';
|
|
40
|
+
|
|
41
|
+
readonly notifications = new FormControl(false, { nonNullable: true });
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
```html
|
|
45
|
+
<good-switch label="Email notifications" [showLabel]="true" [formControl]="notifications" />
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Penpot `03 Controls` contains a `goodui.switch` variant group with `state=off/on`, `size=small/default/large`, `status=default/disabled/error`, and `appearance=brand/mono`. All 36 variants map to `good-switch`; the first 18 brand variants retain their published IDs. The [Switch variant manifest](https://github.com/cloudfrogger/goodui/blob/master/design/switch-variants.json) records every ID. Penpot binds the track, thumb, dimensions, error outline, and pill radius to the same semantic tokens used by Angular. Mono uses the active theme text color for its on track and the inverse surface for its thumb; its off thumb follows the text color. Error remains a separate validation color: `#DC2626` in light mode and `#F87171` in dark mode.
|