@masmarino/gabarit 2.0.0 → 2.1.1
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 +131 -85
- package/accordion/README.md +56 -0
- package/alert/README.md +87 -0
- package/app-shell/README.md +133 -0
- package/auth/README.md +155 -0
- package/auth-activate/README.md +119 -0
- package/auth-login/README.md +113 -0
- package/auth-register/README.md +104 -0
- package/auth-reset-password/README.md +120 -0
- package/autocomplete/README.md +77 -0
- package/avatar/README.md +34 -0
- package/avatar-group/README.md +47 -0
- package/badge/README.md +177 -0
- package/bar-chart/README.md +44 -0
- package/breadcrumb/README.md +38 -0
- package/button/README.md +175 -0
- package/card/README.md +179 -0
- package/checkbox/README.md +50 -0
- package/checkbox-group/README.md +78 -0
- package/confirm-danger-modal/README.md +77 -0
- package/copy-button/README.md +90 -0
- package/copy-field/README.md +54 -0
- package/date-picker/README.md +84 -0
- package/description-list/README.md +63 -0
- package/dimension-card/README.md +39 -0
- package/disclosure/README.md +48 -0
- package/divider/README.md +31 -0
- package/drawer/README.md +49 -0
- package/empty-state/README.md +84 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs +243 -0
- package/fesm2022/masmarino-gabarit-accordion.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-alert.mjs +208 -0
- package/fesm2022/masmarino-gabarit-alert.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-app-shell.mjs +378 -0
- package/fesm2022/masmarino-gabarit-app-shell.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-activate.mjs +415 -0
- package/fesm2022/masmarino-gabarit-auth-activate.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-login.mjs +467 -0
- package/fesm2022/masmarino-gabarit-auth-login.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-register.mjs +457 -0
- package/fesm2022/masmarino-gabarit-auth-register.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs +364 -0
- package/fesm2022/masmarino-gabarit-auth-reset-password.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-auth.mjs +844 -0
- package/fesm2022/masmarino-gabarit-auth.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-autocomplete.mjs +475 -0
- package/fesm2022/masmarino-gabarit-autocomplete.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-avatar-group.mjs +202 -0
- package/fesm2022/masmarino-gabarit-avatar-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-avatar.mjs +107 -0
- package/fesm2022/masmarino-gabarit-avatar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-badge.mjs +449 -0
- package/fesm2022/masmarino-gabarit-badge.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-bar-chart.mjs +408 -0
- package/fesm2022/masmarino-gabarit-bar-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs +59 -0
- package/fesm2022/masmarino-gabarit-breadcrumb.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-button.mjs +374 -0
- package/fesm2022/masmarino-gabarit-button.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-card.mjs +400 -0
- package/fesm2022/masmarino-gabarit-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-chart.mjs +1289 -0
- package/fesm2022/masmarino-gabarit-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs +335 -0
- package/fesm2022/masmarino-gabarit-checkbox-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-checkbox.mjs +170 -0
- package/fesm2022/masmarino-gabarit-checkbox.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs +387 -0
- package/fesm2022/masmarino-gabarit-confirm-danger-modal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-copy-button.mjs +407 -0
- package/fesm2022/masmarino-gabarit-copy-button.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-copy-field.mjs +229 -0
- package/fesm2022/masmarino-gabarit-copy-field.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-date-picker.mjs +1242 -0
- package/fesm2022/masmarino-gabarit-date-picker.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-description-list.mjs +127 -0
- package/fesm2022/masmarino-gabarit-description-list.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-dimension-card.mjs +162 -0
- package/fesm2022/masmarino-gabarit-dimension-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-disclosure.mjs +154 -0
- package/fesm2022/masmarino-gabarit-disclosure.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-divider.mjs +90 -0
- package/fesm2022/masmarino-gabarit-divider.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-docs.mjs +16 -2
- package/fesm2022/masmarino-gabarit-docs.mjs.map +1 -1
- package/fesm2022/masmarino-gabarit-drawer.mjs +209 -0
- package/fesm2022/masmarino-gabarit-drawer.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-empty-state.mjs +226 -0
- package/fesm2022/masmarino-gabarit-empty-state.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-file-upload.mjs +335 -0
- package/fesm2022/masmarino-gabarit-file-upload.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-floating-panel.mjs +24 -0
- package/fesm2022/masmarino-gabarit-floating-panel.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-format.mjs +345 -0
- package/fesm2022/masmarino-gabarit-format.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs +247 -0
- package/fesm2022/masmarino-gabarit-funnel-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs +180 -0
- package/fesm2022/masmarino-gabarit-gauge-bar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-git-field.mjs +127 -0
- package/fesm2022/masmarino-gabarit-git-field.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-icon-marker.mjs +150 -0
- package/fesm2022/masmarino-gabarit-icon-marker.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-icon.mjs +308 -0
- package/fesm2022/masmarino-gabarit-icon.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-input.mjs +493 -0
- package/fesm2022/masmarino-gabarit-input.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-job-graph.mjs +216 -0
- package/fesm2022/masmarino-gabarit-job-graph.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-job-status.mjs +104 -0
- package/fesm2022/masmarino-gabarit-job-status.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-line-chart.mjs +574 -0
- package/fesm2022/masmarino-gabarit-line-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-card.mjs +320 -0
- package/fesm2022/masmarino-gabarit-list-card.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-row.mjs +58 -0
- package/fesm2022/masmarino-gabarit-list-row.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs +369 -0
- package/fesm2022/masmarino-gabarit-list-toolbar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-menu.mjs +464 -0
- package/fesm2022/masmarino-gabarit-menu.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs +897 -0
- package/fesm2022/masmarino-gabarit-mfa-enrollment.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs +629 -0
- package/fesm2022/masmarino-gabarit-mfa-settings.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-modal.mjs +260 -0
- package/fesm2022/masmarino-gabarit-modal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs +332 -0
- package/fesm2022/masmarino-gabarit-nav-tabs.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-notification-dot.mjs +119 -0
- package/fesm2022/masmarino-gabarit-notification-dot.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-page-header.mjs +78 -0
- package/fesm2022/masmarino-gabarit-page-header.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-page-layout.mjs +157 -0
- package/fesm2022/masmarino-gabarit-page-layout.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-pagination.mjs +415 -0
- package/fesm2022/masmarino-gabarit-pagination.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-panel.mjs +80 -0
- package/fesm2022/masmarino-gabarit-panel.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs +606 -0
- package/fesm2022/masmarino-gabarit-passkey-settings.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-pie-chart.mjs +317 -0
- package/fesm2022/masmarino-gabarit-pie-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-popover.mjs +142 -0
- package/fesm2022/masmarino-gabarit-popover.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-radio-group.mjs +202 -0
- package/fesm2022/masmarino-gabarit-radio-group.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-save-status.mjs +142 -0
- package/fesm2022/masmarino-gabarit-save-status.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-search-bar.mjs +576 -0
- package/fesm2022/masmarino-gabarit-search-bar.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs +348 -0
- package/fesm2022/masmarino-gabarit-secret-reveal.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-segmented-control.mjs +272 -0
- package/fesm2022/masmarino-gabarit-segmented-control.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-select.mjs +512 -0
- package/fesm2022/masmarino-gabarit-select.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs +189 -0
- package/fesm2022/masmarino-gabarit-skeleton-list.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-skeleton.mjs +109 -0
- package/fesm2022/masmarino-gabarit-skeleton.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-slider.mjs +239 -0
- package/fesm2022/masmarino-gabarit-slider.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-sparkline.mjs +276 -0
- package/fesm2022/masmarino-gabarit-sparkline.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-spinner.mjs +86 -0
- package/fesm2022/masmarino-gabarit-spinner.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stat-grid.mjs +139 -0
- package/fesm2022/masmarino-gabarit-stat-grid.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stat-tile.mjs +312 -0
- package/fesm2022/masmarino-gabarit-stat-tile.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-stepper.mjs +219 -0
- package/fesm2022/masmarino-gabarit-stepper.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-switch.mjs +151 -0
- package/fesm2022/masmarino-gabarit-switch.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-table.mjs +206 -0
- package/fesm2022/masmarino-gabarit-table.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tabs.mjs +210 -0
- package/fesm2022/masmarino-gabarit-tabs.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tag-input.mjs +288 -0
- package/fesm2022/masmarino-gabarit-tag-input.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tag.mjs +155 -0
- package/fesm2022/masmarino-gabarit-tag.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-textarea.mjs +369 -0
- package/fesm2022/masmarino-gabarit-textarea.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs +521 -0
- package/fesm2022/masmarino-gabarit-timeline-chart.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-toaster.mjs +220 -0
- package/fesm2022/masmarino-gabarit-toaster.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tooltip.mjs +185 -0
- package/fesm2022/masmarino-gabarit-tooltip.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-tree.mjs +258 -0
- package/fesm2022/masmarino-gabarit-tree.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit-user-chip.mjs +106 -0
- package/fesm2022/masmarino-gabarit-user-chip.mjs.map +1 -0
- package/fesm2022/masmarino-gabarit.mjs +83 -24785
- package/fesm2022/masmarino-gabarit.mjs.map +1 -1
- package/file-upload/README.md +47 -0
- package/funnel-chart/README.md +39 -0
- package/gauge-bar/README.md +35 -0
- package/git-field/README.md +34 -0
- package/icon/README.md +52 -0
- package/icon-marker/README.md +37 -0
- package/input/README.md +120 -0
- package/job-graph/README.md +76 -0
- package/job-status/README.md +34 -0
- package/line-chart/README.md +52 -0
- package/list-card/README.md +144 -0
- package/list-row/README.md +72 -0
- package/list-toolbar/README.md +52 -0
- package/menu/README.md +90 -0
- package/mfa-enrollment/README.md +189 -0
- package/mfa-settings/README.md +154 -0
- package/modal/README.md +72 -0
- package/nav-tabs/README.md +106 -0
- package/notification-dot/README.md +43 -0
- package/package.json +329 -1
- package/page-header/README.md +56 -0
- package/page-layout/README.md +76 -0
- package/pagination/README.md +73 -0
- package/panel/README.md +56 -0
- package/passkey-settings/README.md +120 -0
- package/pie-chart/README.md +85 -0
- package/popover/README.md +62 -0
- package/radio-group/README.md +47 -0
- package/save-status/README.md +44 -0
- package/search-bar/README.md +84 -0
- package/secret-reveal/README.md +60 -0
- package/segmented-control/README.md +79 -0
- package/select/README.md +61 -0
- package/skeleton/README.md +49 -0
- package/skeleton-list/README.md +40 -0
- package/slider/README.md +44 -0
- package/sparkline/README.md +37 -0
- package/spinner/README.md +41 -0
- package/stat-grid/README.md +47 -0
- package/stat-tile/README.md +75 -0
- package/stepper/README.md +67 -0
- package/switch/README.md +51 -0
- package/table/README.md +75 -0
- package/tabs/README.md +34 -0
- package/tag/README.md +34 -0
- package/tag-input/README.md +45 -0
- package/textarea/README.md +76 -0
- package/timeline-chart/README.md +49 -0
- package/toaster/README.md +92 -0
- package/tooltip/README.md +50 -0
- package/tree/README.md +79 -0
- package/types/masmarino-gabarit-accordion.d.ts +54 -0
- package/types/masmarino-gabarit-alert.d.ts +65 -0
- package/types/masmarino-gabarit-app-shell.d.ts +102 -0
- package/types/masmarino-gabarit-auth-activate.d.ts +70 -0
- package/types/masmarino-gabarit-auth-login.d.ts +63 -0
- package/types/masmarino-gabarit-auth-register.d.ts +66 -0
- package/types/masmarino-gabarit-auth-reset-password.d.ts +53 -0
- package/types/masmarino-gabarit-auth.d.ts +543 -0
- package/types/masmarino-gabarit-autocomplete.d.ts +140 -0
- package/types/masmarino-gabarit-avatar-group.d.ts +60 -0
- package/types/masmarino-gabarit-avatar.d.ts +31 -0
- package/types/masmarino-gabarit-badge.d.ts +139 -0
- package/types/masmarino-gabarit-bar-chart.d.ts +111 -0
- package/types/masmarino-gabarit-breadcrumb.d.ts +12 -0
- package/types/masmarino-gabarit-button.d.ts +108 -0
- package/types/masmarino-gabarit-card.d.ts +102 -0
- package/types/masmarino-gabarit-chart.d.ts +361 -0
- package/types/masmarino-gabarit-checkbox-group.d.ts +113 -0
- package/types/masmarino-gabarit-checkbox.d.ts +49 -0
- package/types/masmarino-gabarit-confirm-danger-modal.d.ts +94 -0
- package/types/masmarino-gabarit-copy-button.d.ts +111 -0
- package/types/masmarino-gabarit-copy-field.d.ts +64 -0
- package/types/masmarino-gabarit-date-picker.d.ts +399 -0
- package/types/masmarino-gabarit-description-list.d.ts +40 -0
- package/types/masmarino-gabarit-dimension-card.d.ts +55 -0
- package/types/masmarino-gabarit-disclosure.d.ts +44 -0
- package/types/masmarino-gabarit-divider.d.ts +20 -0
- package/types/masmarino-gabarit-docs.d.ts +2 -1
- package/types/masmarino-gabarit-drawer.d.ts +51 -0
- package/types/masmarino-gabarit-empty-state.d.ts +67 -0
- package/types/masmarino-gabarit-file-upload.d.ts +95 -0
- package/types/masmarino-gabarit-floating-panel.d.ts +14 -0
- package/types/masmarino-gabarit-format.d.ts +54 -0
- package/types/masmarino-gabarit-funnel-chart.d.ts +78 -0
- package/types/masmarino-gabarit-gauge-bar.d.ts +54 -0
- package/types/masmarino-gabarit-git-field.d.ts +39 -0
- package/types/masmarino-gabarit-icon-marker.d.ts +47 -0
- package/types/masmarino-gabarit-icon.d.ts +23 -0
- package/types/masmarino-gabarit-input.d.ts +181 -0
- package/types/masmarino-gabarit-job-graph.d.ts +63 -0
- package/types/masmarino-gabarit-job-status.d.ts +20 -0
- package/types/masmarino-gabarit-line-chart.d.ts +153 -0
- package/types/masmarino-gabarit-list-card.d.ts +87 -0
- package/types/masmarino-gabarit-list-row.d.ts +14 -0
- package/types/masmarino-gabarit-list-toolbar.d.ts +100 -0
- package/types/masmarino-gabarit-menu.d.ts +93 -0
- package/types/masmarino-gabarit-mfa-enrollment.d.ts +142 -0
- package/types/masmarino-gabarit-mfa-settings.d.ts +89 -0
- package/types/masmarino-gabarit-modal.d.ts +60 -0
- package/types/masmarino-gabarit-nav-tabs.d.ts +65 -0
- package/types/masmarino-gabarit-notification-dot.d.ts +34 -0
- package/types/masmarino-gabarit-page-header.d.ts +20 -0
- package/types/masmarino-gabarit-page-layout.d.ts +46 -0
- package/types/masmarino-gabarit-pagination.d.ts +109 -0
- package/types/masmarino-gabarit-panel.d.ts +21 -0
- package/types/masmarino-gabarit-passkey-settings.d.ts +94 -0
- package/types/masmarino-gabarit-pie-chart.d.ts +94 -0
- package/types/masmarino-gabarit-popover.d.ts +33 -0
- package/types/masmarino-gabarit-radio-group.d.ts +66 -0
- package/types/masmarino-gabarit-save-status.d.ts +39 -0
- package/types/masmarino-gabarit-search-bar.d.ts +183 -0
- package/types/masmarino-gabarit-secret-reveal.d.ts +95 -0
- package/types/masmarino-gabarit-segmented-control.d.ts +76 -0
- package/types/masmarino-gabarit-select.d.ts +146 -0
- package/types/masmarino-gabarit-skeleton-list.d.ts +54 -0
- package/types/masmarino-gabarit-skeleton.d.ts +26 -0
- package/types/masmarino-gabarit-slider.d.ts +73 -0
- package/types/masmarino-gabarit-sparkline.d.ts +70 -0
- package/types/masmarino-gabarit-spinner.d.ts +20 -0
- package/types/masmarino-gabarit-stat-grid.d.ts +39 -0
- package/types/masmarino-gabarit-stat-tile.d.ts +79 -0
- package/types/masmarino-gabarit-stepper.d.ts +67 -0
- package/types/masmarino-gabarit-switch.d.ts +42 -0
- package/types/masmarino-gabarit-table.d.ts +60 -0
- package/types/masmarino-gabarit-tabs.d.ts +40 -0
- package/types/masmarino-gabarit-tag-input.d.ts +78 -0
- package/types/masmarino-gabarit-tag.d.ts +35 -0
- package/types/masmarino-gabarit-textarea.d.ts +109 -0
- package/types/masmarino-gabarit-timeline-chart.d.ts +145 -0
- package/types/masmarino-gabarit-toaster.d.ts +62 -0
- package/types/masmarino-gabarit-tooltip.d.ts +39 -0
- package/types/masmarino-gabarit-tree.d.ts +71 -0
- package/types/masmarino-gabarit-user-chip.d.ts +26 -0
- package/types/masmarino-gabarit.d.ts +83 -6599
- package/user-chip/README.md +42 -0
package/card/README.md
ADDED
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
# Card
|
|
2
|
+
|
|
3
|
+
Titled container: an optional heading over a box. Two looks for the box —
|
|
4
|
+
`elevated` (a shadow) and `outlined` (a quiet 1px edge) —, an optional
|
|
5
|
+
description and counter under / after the heading, a flush body for rows, a
|
|
6
|
+
tone and a selected state, and a link mode that makes the whole box
|
|
7
|
+
clickable.
|
|
8
|
+
|
|
9
|
+
**Selector**: `gbt-card` (+ the `CardHeader` directive and the `a[gbtCardLink]`
|
|
10
|
+
component, see below)
|
|
11
|
+
|
|
12
|
+
## Inputs
|
|
13
|
+
|
|
14
|
+
| Input | Type | Default | Role |
|
|
15
|
+
| --------------- | ------------------------------------------------ | ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| `hoverable` | `boolean` | `false` | Adds a visual hover treatment. |
|
|
17
|
+
| `heading` | `string` | `''` | Header title. Empty by default: no header is rendered without it (or a `[card-header]` slot). |
|
|
18
|
+
| `icon` | `string` | `''` | Icon shown beside the title, in the header. A toned header without one shows the tone's icon. |
|
|
19
|
+
| `headingLevel` | `1 \| 2 \| 3 \| 4 \| 5 \| 6` | `2` | Level of the rendered heading — choose it based on the block's place in the page hierarchy (RGAA 9.1). |
|
|
20
|
+
| `variant` | `'elevated' \| 'outlined'` | `'elevated'` | `outlined` swaps the box's shadow for a border. |
|
|
21
|
+
| `description` | `string` | `''` | One-line help text under the heading (built-in header only). |
|
|
22
|
+
| `count` | `number \| null` | `null` | Counter pill after the heading, `0` included. |
|
|
23
|
+
| `flush` | `boolean` | `false` | No padding inside the box: rows and tables reach its edges (clipped to its rounded corners). |
|
|
24
|
+
| `tone` | `'default' \| 'success' \| 'warning' \| 'error'` | `'default'` | Colours the header's icon and title (`error` for a subsystem that is down, `success` for a result). Needs a header; the box is never tinted. |
|
|
25
|
+
| `selected` | `boolean` | `false` | Accent ring (2px) and a faint wash on the box — the chosen option of a set of cards. |
|
|
26
|
+
| `selectedLabel` | `string` | `'Selected'` | Visually hidden text read by screen readers on a `selected` card (colour and ring are not enough). Empty removes it. |
|
|
27
|
+
| `href` | `string \| null` | `null` | Link mode: the heading becomes a link whose hit area covers the card's box (see below). |
|
|
28
|
+
| `linkLabel` | `string \| null` | `null` | `aria-label` of the link — the name of a link-mode card that has NO heading text. Ignored when there is a heading (the visible text stays the name: WCAG label in name). |
|
|
29
|
+
|
|
30
|
+
There is no `headerStyle` input: the header has a single look. A static
|
|
31
|
+
`headerStyle="…"` attribute still compiles (it renders as an inert
|
|
32
|
+
`headerstyle` DOM attribute); a bound `[headerStyle]="…"` fails to compile
|
|
33
|
+
(NG8002).
|
|
34
|
+
|
|
35
|
+
## Structure: a heading over a box
|
|
36
|
+
|
|
37
|
+
The component renders two siblings:
|
|
38
|
+
|
|
39
|
+
1. **The header** (`.gbt-card__header`, only when there is a `heading` or a
|
|
40
|
+
`[card-header]`): a plain heading **above** the card, like a section title
|
|
41
|
+
over a panel. It has no background, no border and no radius of its own —
|
|
42
|
+
the icon, the title (with its count), the description under it, and the
|
|
43
|
+
`[card-header-actions]` on the right. `0.5rem` separates it from the box
|
|
44
|
+
(the heading-to-content gap of `gbt-panel`).
|
|
45
|
+
2. **The box** (`.gbt-card`): the card itself — shadow (`elevated`) or 1px
|
|
46
|
+
edge (`outlined`), background, padding, and a full radius on all four
|
|
47
|
+
corners. It holds the body only. `selected` and the link target are the
|
|
48
|
+
box's; the header is a label over it.
|
|
49
|
+
|
|
50
|
+
```
|
|
51
|
+
<gbt-card> display: grid, position: relative
|
|
52
|
+
div.gbt-card__header heading, count, description, actions
|
|
53
|
+
div.gbt-card the box: data-variant, data-flush, data-selected, data-link
|
|
54
|
+
div.gbt-card__body your content
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
`tone` is carried by the header (`data-tone` on `.gbt-card__header`), the
|
|
58
|
+
other states by the box. To restyle the box (padding, a flex column…), target
|
|
59
|
+
`.gbt-card`: it does not contain the heading.
|
|
60
|
+
|
|
61
|
+
## Projected content
|
|
62
|
+
|
|
63
|
+
- Default: the card's body. It sits in a `.gbt-card__body` wrapper that is `display: contents` (invisible to layout) unless the card is `flush`, so a `display: flex; gap` you put on the box (`.gbt-card`) still reaches your children directly.
|
|
64
|
+
- `[card-header-actions]`: actions shown on the right of the header (button, menu…).
|
|
65
|
+
- `[card-header]`: replaces the `heading` / `icon` / `description` / `count` block with your own header content, above the box. **Import the `CardHeader` directive next to `Card`** for the header layout (flex row, actions on the right). Without the import the marked element is still rendered — plain, at the top of the box, above the body — never dropped (same fallback as `gbt-menu`'s `MenuTrigger`).
|
|
66
|
+
|
|
67
|
+
## Tone
|
|
68
|
+
|
|
69
|
+
`tone` colours the header's icon and title in the tone's text colour
|
|
70
|
+
(`--color-success-text`, `--color-warning-text`, `--color-error-text` — the
|
|
71
|
+
pair `gbt-badge`'s outline look uses on the page). No wash, no tinted edge:
|
|
72
|
+
the box, the description and the count stay neutral. A toned header always
|
|
73
|
+
shows an icon — the one you give, or the tone's own (`check-circle`,
|
|
74
|
+
`alert-triangle`, `alert-circle`, as `gbt-alert`) — so the tone is never
|
|
75
|
+
conveyed by colour alone; the title text carries the meaning. A card without a
|
|
76
|
+
header shows no tone.
|
|
77
|
+
|
|
78
|
+
With a custom `[card-header]`, `tone` only sets `data-tone` on
|
|
79
|
+
`.gbt-card__header` — it does not colour your projected content or add an
|
|
80
|
+
icon (there is no built-in icon or title to colour). Style your own header
|
|
81
|
+
content by tone if needed, and pair the colour with an icon or a word so the
|
|
82
|
+
tone is not conveyed by colour alone:
|
|
83
|
+
|
|
84
|
+
```css
|
|
85
|
+
/* A global stylesheet, or behind `:host ::ng-deep` in a component's styles:
|
|
86
|
+
.gbt-card__header is gbt-card's own element, outside your encapsulation. */
|
|
87
|
+
.gbt-card__header[data-tone='warning'] .my-title {
|
|
88
|
+
color: var(--color-warning-text);
|
|
89
|
+
}
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
## Flush
|
|
93
|
+
|
|
94
|
+
`flush` only removes the box's padding: rows, a table, a `gbt-list-row` or a
|
|
95
|
+
`gbt-empty-state` reach the box's edges, and the body clips them to the box's
|
|
96
|
+
inner corners. The header is not in the box, so it is not affected.
|
|
97
|
+
|
|
98
|
+
## Examples
|
|
99
|
+
|
|
100
|
+
```html
|
|
101
|
+
<gbt-card heading="Registre Docker" [headingLevel]="2">
|
|
102
|
+
<gbt-gauge-bar ... />
|
|
103
|
+
</gbt-card>
|
|
104
|
+
|
|
105
|
+
<!-- A settings card: outlined, a heading above it, rows to the edges -->
|
|
106
|
+
<gbt-card
|
|
107
|
+
variant="outlined"
|
|
108
|
+
heading="Variables"
|
|
109
|
+
icon="key"
|
|
110
|
+
description="Injectées dans chaque job."
|
|
111
|
+
[count]="variables().length"
|
|
112
|
+
[flush]="true"
|
|
113
|
+
>
|
|
114
|
+
<gbt-button card-header-actions size="small" text="Ajouter" />
|
|
115
|
+
<ul>
|
|
116
|
+
…
|
|
117
|
+
</ul>
|
|
118
|
+
</gbt-card>
|
|
119
|
+
|
|
120
|
+
<!-- Your own header -->
|
|
121
|
+
<gbt-card variant="outlined">
|
|
122
|
+
<div card-header><strong>src/app/app.ts</strong> <gbt-badge>+12 −3</gbt-badge></div>
|
|
123
|
+
</gbt-card>
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
## Whole-card link
|
|
127
|
+
|
|
128
|
+
Two ways, both use the **stretched link** pattern: the anchor stays the heading
|
|
129
|
+
text only (that is its accessible name), and a pseudo-element of the anchor
|
|
130
|
+
stretches its hit area over the card's **box**. There is **no interactive
|
|
131
|
+
content nested inside the link**, so screen readers announce one clear link and
|
|
132
|
+
axe's `nested-interactive` rule is satisfied.
|
|
133
|
+
|
|
134
|
+
The heading sits above the box, so the anchor is not inside the box: the host
|
|
135
|
+
is a positioned grid (`gbt-card-header` / `gbt-card-box` areas) and the
|
|
136
|
+
anchor's overlay names the `gbt-card-box` area, which makes the box's area its
|
|
137
|
+
containing block. The overlay therefore covers the box exactly — not the
|
|
138
|
+
heading row, whose only target is the heading text itself — and the hover
|
|
139
|
+
shadow and the focus ring are drawn on the box. Keep the host's
|
|
140
|
+
`display: grid` (do not set `display: block` on `gbt-card`): when the grid
|
|
141
|
+
does not apply, the overlay covers the header row too. The header's controls
|
|
142
|
+
(`[card-header-actions]`, anything interactive in a `[card-header]`) still
|
|
143
|
+
stay operable then, because they are lifted above the overlay the same way the
|
|
144
|
+
body's controls are (see below).
|
|
145
|
+
|
|
146
|
+
```html
|
|
147
|
+
<!-- 1. href: the heading becomes the link -->
|
|
148
|
+
<gbt-card
|
|
149
|
+
variant="outlined"
|
|
150
|
+
heading="Guide de démarrage"
|
|
151
|
+
href="/guide"
|
|
152
|
+
description="Installer le projet"
|
|
153
|
+
/>
|
|
154
|
+
|
|
155
|
+
<!-- 2. a projected anchor — router-agnostic, works with routerLink -->
|
|
156
|
+
<gbt-card variant="outlined">
|
|
157
|
+
<h3 card-header><a gbtCardLink [routerLink]="['/releases', id]">Release {{ version }}</a></h3>
|
|
158
|
+
<gbt-button card-header-actions size="small" variant="secondary" text="Télécharger" />
|
|
159
|
+
<p>Notes de version…</p>
|
|
160
|
+
<a [routerLink]="['/releases', id, 'notes']">Notes</a>
|
|
161
|
+
</gbt-card>
|
|
162
|
+
```
|
|
163
|
+
|
|
164
|
+
Import `CardLink` (and `CardHeader` for the second form). Rules of the pattern:
|
|
165
|
+
|
|
166
|
+
- **One link per card.** The stretched anchor is the card's target; put the heading, not a paragraph, in it. No heading? Use `href` with `linkLabel`.
|
|
167
|
+
- **Other controls stay separate.** Buttons, menus and links elsewhere in the card — in the box or in the header — are lifted above the stretched area (`z-index: 2`, and `position: relative` unless the control positions itself — a `gbt-switch`'s hidden input stays `absolute`) so they stay clickable and keep their own tab stop. The lifting rule has zero specificity: your own `position`/`z-index` on such a control wins. Do not wrap them in the link and do not put the link around the card (`<a>` around interactive content is a nested-interactive trap).
|
|
168
|
+
- The focus ring is drawn around the box (inside its edge).
|
|
169
|
+
- Trade-off of the pattern: text inside a linked card cannot be selected with the mouse.
|
|
170
|
+
|
|
171
|
+
## Heading level
|
|
172
|
+
|
|
173
|
+
`headingLevel` (default `2`) picks the `h1`…`h6`. Choose it from the card's
|
|
174
|
+
place in the page, not its size.
|
|
175
|
+
|
|
176
|
+
## Container queries
|
|
177
|
+
|
|
178
|
+
The card is not a size container: a page that adapts its contents to the card's
|
|
179
|
+
width should wrap the card in its own `container-type: inline-size` element.
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Checkbox
|
|
2
|
+
|
|
3
|
+
Checkbox, integrated with reactive forms and `ngModel`.
|
|
4
|
+
|
|
5
|
+
**Selector**: `gbt-checkbox`
|
|
6
|
+
|
|
7
|
+
Implements `ControlValueAccessor` — driven via `formControlName` or
|
|
8
|
+
`[(ngModel)]`. Without Angular forms, use the `checked` model
|
|
9
|
+
(`[checked]` + `(checkedChange)`, or `[(checked)]`).
|
|
10
|
+
|
|
11
|
+
## Inputs
|
|
12
|
+
|
|
13
|
+
| Input | Type | Default | Role |
|
|
14
|
+
| ---------- | ----------------- | ---------------------------- | --------------------------------------------------------------------------------------------------- |
|
|
15
|
+
| `id` | `string` | generated (`gbt-checkbox-N`) | DOM id, associates the `<label>`. |
|
|
16
|
+
| `label` | `string` | `''` | Visible label. |
|
|
17
|
+
| `disabled` | `boolean` | `false` | Disables the checkbox (cumulative with the form's disabled state). |
|
|
18
|
+
| `hint` | `string` | `''` | Help text under the label, linked to the input with `aria-describedby`. |
|
|
19
|
+
| `checked` | `boolean` (model) | `false` | Checked state for use **without** Angular forms: `[checked]` sets it, `(checkedChange)` follows it. |
|
|
20
|
+
|
|
21
|
+
## Outputs
|
|
22
|
+
|
|
23
|
+
| Output | Type | Role |
|
|
24
|
+
| --------------- | --------- | ------------------------------------------------ |
|
|
25
|
+
| `checkedChange` | `boolean` | Emitted when the user toggles the box (`model`). |
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```html
|
|
30
|
+
<gbt-checkbox label="Se souvenir de moi" formControlName="remember" />
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Without Angular forms (`checked` model)
|
|
34
|
+
|
|
35
|
+
```html
|
|
36
|
+
<gbt-checkbox label="Push" [checked]="selected().has('push')" (checkedChange)="toggle('push')" />
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
The native box reflects the bound value, and the user's toggle is reported
|
|
40
|
+
through `checkedChange` — the pattern for a list of options whose state lives
|
|
41
|
+
in a signal or a `Set`. For a whole group use [`gbt-checkbox-group`](../checkbox-group/README.md).
|
|
42
|
+
`checked` and the form value are the same state: do not bind both.
|
|
43
|
+
Set it with a binding, `[checked]="true"`: a bare `checked` attribute is not a boolean
|
|
44
|
+
attribute here (the model is not transformed) and fails strict templates.
|
|
45
|
+
|
|
46
|
+
## Hint
|
|
47
|
+
|
|
48
|
+
Without `hint` nothing is added. With it, the host becomes a block and the text
|
|
49
|
+
shows under the label, aligned with the label text; it is a `<p>` outside the
|
|
50
|
+
`<label>`, so it describes the checkbox (`aria-describedby`) without joining its name.
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# CheckboxGroup
|
|
2
|
+
|
|
3
|
+
A set of checkboxes that answer one question ("Which events?") — a
|
|
4
|
+
`<fieldset>` with a `<legend>`, whose value is the **array of the checked
|
|
5
|
+
options' values**. Use [`Checkbox`](../checkbox/README.md) for a single
|
|
6
|
+
yes/no, [`RadioGroup`](../radio-group/README.md) for a single choice.
|
|
7
|
+
|
|
8
|
+
**Selector**: `gbt-checkbox-group`
|
|
9
|
+
|
|
10
|
+
Implements `ControlValueAccessor` (`formControlName`, `[(ngModel)]`) **and** exposes a
|
|
11
|
+
`value` model, so it also works without Angular forms (`[(value)]`).
|
|
12
|
+
|
|
13
|
+
## Inputs
|
|
14
|
+
|
|
15
|
+
| Input | Type | Default | Role |
|
|
16
|
+
| -------------- | --------------------------- | ---------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
17
|
+
| `legend` | `string` | required | The group's question, rendered as the `<legend>` (its accessible name). |
|
|
18
|
+
| `options` | `CheckboxGroupOption<T>[]` | `[]` | Flat list of options. |
|
|
19
|
+
| `groups` | `CheckboxGroupSection<T>[]` | `[]` | Options split into named sections, rendered after `options`. Each section is a `role="group"` named by its heading. |
|
|
20
|
+
| `value` | `T[]` (model) | `[]` | The checked options' values, in option order. Also the form value. |
|
|
21
|
+
| `columns` | `number \| 'auto'` | `1` | Equal columns, or `'auto'` to fit as many (min 11rem) as the width allows. On the flat list, or on the sections when there are `groups`. Only `'auto'` collapses on a narrow screen; a fixed count keeps its columns (short options only). |
|
|
22
|
+
| `hint` | `string` | `''` | Help text under the legend, linked with `aria-describedby`; replaced by the error while one shows. |
|
|
23
|
+
| `errorMessage` | `string \| null` | `null` | Error text (`role="alert"`), `aria-describedby` and `aria-invalid` on the fieldset. |
|
|
24
|
+
| `required` | `boolean` | `false` | Adds ` *` to the legend (same convention as `RadioGroup`). |
|
|
25
|
+
| `hideLegend` | `boolean` | `false` | Keeps the legend for assistive technology, removes it from the layout. |
|
|
26
|
+
| `disabled` | `boolean` | `false` | Disables every checkbox (cumulative with the form's disabled state). |
|
|
27
|
+
| `id` | `string` | generated (`gbt-checkbox-group-N`) | Prefix of the ids of the checkboxes, hint and error. |
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
interface CheckboxGroupOption<T = string> {
|
|
31
|
+
value: T
|
|
32
|
+
label: string
|
|
33
|
+
hint?: string // help text under this option
|
|
34
|
+
disabled?: boolean // disables this option only
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
interface CheckboxGroupSection<T = string> {
|
|
38
|
+
label: string // visible heading, names the role="group"
|
|
39
|
+
options: CheckboxGroupOption<T>[]
|
|
40
|
+
}
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
`T` is compared by identity (`includes`), so primitives and shared object
|
|
44
|
+
references both work.
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
```html
|
|
49
|
+
<!-- With Angular forms -->
|
|
50
|
+
<gbt-checkbox-group legend="Notify me about" [options]="options" formControlName="events" />
|
|
51
|
+
|
|
52
|
+
<!-- Without: two-way model -->
|
|
53
|
+
<gbt-checkbox-group legend="Notify me about" [options]="options" [(value)]="events" />
|
|
54
|
+
|
|
55
|
+
<!-- Named sections, as many columns as fit -->
|
|
56
|
+
<gbt-checkbox-group
|
|
57
|
+
legend="Events"
|
|
58
|
+
[groups]="eventGroups"
|
|
59
|
+
columns="auto"
|
|
60
|
+
formControlName="events"
|
|
61
|
+
/>
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Behavior
|
|
65
|
+
|
|
66
|
+
- Toggling a box emits the new array (`valueChange` / form `onChange`) **in
|
|
67
|
+
option order**, not click order, so the value is stable; values that match no
|
|
68
|
+
option are kept at the end. The control is marked touched on the first toggle.
|
|
69
|
+
- Unchecking the last box emits `[]`, never `null`. `writeValue(null)` reads as `[]`.
|
|
70
|
+
|
|
71
|
+
## Accessibility
|
|
72
|
+
|
|
73
|
+
Native checkboxes (each is the existing `gbt-checkbox`) inside a
|
|
74
|
+
`<fieldset>`/`<legend>`: the group name is announced with each box, every box
|
|
75
|
+
is a tab stop and Space toggles it — no scripted keyboard handling, no roving
|
|
76
|
+
tabindex (it is a set of independent controls, not a composite widget). Named
|
|
77
|
+
sections add `role="group"` + `aria-labelledby` on the visible heading. See
|
|
78
|
+
[`AUDIT.md`](AUDIT.md).
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# ConfirmDangerModal
|
|
2
|
+
|
|
3
|
+
A confirmation dialog for a destructive, hard-to-reverse action. Two forms:
|
|
4
|
+
|
|
5
|
+
- **Typed** (`confirmText` given): the confirm button stays disabled until the user types an exact
|
|
6
|
+
match of a given string (e.g. the name of the thing being deleted), the same "type-to-confirm"
|
|
7
|
+
pattern GitLab uses for project/group deletion.
|
|
8
|
+
- **Light** (`confirmText` left out): no field, a normal confirm button, and a tinted icon beside
|
|
9
|
+
the message. For what is easy to redo (a webhook, a token, a collaborator).
|
|
10
|
+
|
|
11
|
+
**Selector**: `gbt-confirm-danger-modal`
|
|
12
|
+
|
|
13
|
+
Built on `Modal`: Escape, a backdrop click, or its own close button all
|
|
14
|
+
already work exactly as `Modal` documents them (including `busy`); this component only adds
|
|
15
|
+
the optional typed-confirmation gate and the Cancel/Confirm footer.
|
|
16
|
+
|
|
17
|
+
## Inputs
|
|
18
|
+
|
|
19
|
+
| Input | Type | Default | Role |
|
|
20
|
+
| ------------------- | ------------------------------------ | ------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
21
|
+
| `isOpen` | `boolean` | required | Open/closed state, driven by the application. |
|
|
22
|
+
| `heading` | `string` | required | Dialog title. |
|
|
23
|
+
| `message` | `string` | required | Warning text shown above the confirmation input (typed) or beside the icon (light). |
|
|
24
|
+
| `confirmText` | `string \| null \| undefined` | `undefined` | The exact string the user must type before the confirm button enables — typically the name of the item being deleted. **Absent (or `null`): no typing gate, a light confirmation.** An empty string is still typed and fail-closed: it disables the confirm button permanently. An unresolved binding (`[confirmText]="repo()?.name"` while `repo()` is still `null`/`undefined`) also counts as absent and yields a light, one-click confirmation: for a destructive action, guard the `@if` that renders the modal until the name is known. |
|
|
25
|
+
| `confirmInputLabel` | `string` | `'Type to confirm'` | Label of the confirmation text field (typed form). |
|
|
26
|
+
| `confirmLabel` | `string` | `'Confirm'` | Text of the confirm button. |
|
|
27
|
+
| `cancelLabel` | `string` | `'Cancel'` | Text of the cancel button. |
|
|
28
|
+
| `closeLabel` | `string` | `'Close'` | Accessible name of the modal's own close (X) button. |
|
|
29
|
+
| `busy` | `boolean` | `false` | The request is running: the confirm button shows a spinner (and is disabled), Cancel is disabled, and Escape, the backdrop, the close button and a second click are ignored — nothing is emitted. The typing field is locked too. |
|
|
30
|
+
| `busyLabel` | `string` | `'Working'` | Read out on the confirm button and by the dialog while `busy`. |
|
|
31
|
+
| `confirmIcon` | `string \| null` | `null` | Icon (a registered `gbt-icon` name) before the confirm label. None by default. |
|
|
32
|
+
| `tone` | `'danger' \| 'warning' \| 'neutral'` | `'danger'` | `danger`: red confirm button and disc. `warning`: primary button, amber disc. `neutral`: primary button, blue disc (a plain confirmation). The disc only shows on the light form. |
|
|
33
|
+
|
|
34
|
+
## Outputs
|
|
35
|
+
|
|
36
|
+
| Output | Type | Role |
|
|
37
|
+
| ----------- | ------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
38
|
+
| `confirmed` | `void` | Emitted only when the confirm button is clicked — for a typed confirmation, only once the typed text exactly matches `confirmText`; never while `busy`. |
|
|
39
|
+
| `closed` | `void` | Emitted on Cancel, Escape, the close button, or a backdrop click (never while `busy`). The application must respond by setting `isOpen` to `false`. Never emitted together with `confirmed`. |
|
|
40
|
+
|
|
41
|
+
Whatever the user typed is cleared automatically whenever the modal closes,
|
|
42
|
+
so a later reopen never shows a stale value.
|
|
43
|
+
|
|
44
|
+
## Example
|
|
45
|
+
|
|
46
|
+
```html
|
|
47
|
+
<gbt-confirm-danger-modal
|
|
48
|
+
[isOpen]="confirming()"
|
|
49
|
+
heading="Supprimer le dépôt"
|
|
50
|
+
message="Cette action supprimera définitivement le dépôt et tout son contenu."
|
|
51
|
+
[confirmText]="repo().name"
|
|
52
|
+
confirmInputLabel="Tapez le nom du dépôt pour confirmer"
|
|
53
|
+
confirmLabel="Supprimer"
|
|
54
|
+
cancelLabel="Annuler"
|
|
55
|
+
closeLabel="Fermer"
|
|
56
|
+
(confirmed)="deleteRepository()"
|
|
57
|
+
(closed)="confirming.set(false)"
|
|
58
|
+
/>
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
A light confirmation whose request is running:
|
|
62
|
+
|
|
63
|
+
```html
|
|
64
|
+
@if (pending(); as webhook) {
|
|
65
|
+
<gbt-confirm-danger-modal
|
|
66
|
+
[isOpen]="true"
|
|
67
|
+
heading="Delete the webhook"
|
|
68
|
+
[message]="'Deliveries to ' + webhook.url + ' will stop.'"
|
|
69
|
+
confirmLabel="Delete"
|
|
70
|
+
confirmIcon="trash-2"
|
|
71
|
+
[busy]="deleting()"
|
|
72
|
+
busyLabel="Deleting"
|
|
73
|
+
(confirmed)="delete(webhook)"
|
|
74
|
+
(closed)="pending.set(null)"
|
|
75
|
+
/>
|
|
76
|
+
}
|
|
77
|
+
```
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# CopyButton
|
|
2
|
+
|
|
3
|
+
A button that copies a value to the clipboard and says so. It replaces the five hand-written
|
|
4
|
+
"copy + Copied for 2 s + select the text on failure" implementations of an application (clone box,
|
|
5
|
+
recovery codes, file view, one-time token, row menu).
|
|
6
|
+
|
|
7
|
+
**Selector**: `gbt-copy-button`. Built on [`gbt-button`](../button/README.md); the clipboard logic
|
|
8
|
+
(`copyToClipboard`, `ClipboardFeedback`) lives in `clipboard.ts` and is shared with
|
|
9
|
+
[`gbt-copy-field`](../copy-field/README.md), [`gbt-secret-reveal`](../secret-reveal/README.md)
|
|
10
|
+
and [`gbt-badge`](../badge/README.md)'s `copyable` input.
|
|
11
|
+
|
|
12
|
+
## Inputs
|
|
13
|
+
|
|
14
|
+
| Input | Type | Default | Role |
|
|
15
|
+
| -------------- | ---------------------------------- | --------------- | --------------------------------------------------------------------------------------------------- |
|
|
16
|
+
| `value` | `string \| (() => string)` | `''` | The text to copy. A function is called when the button is pressed (a big file body, a fresh token). |
|
|
17
|
+
| `text` | `string` | `''` | Visible label. Empty: an icon-only square. |
|
|
18
|
+
| `ariaLabel` | `string \| null` | `null` | Accessible name. Defaults to `Copy` when icon-only and to `text` otherwise. |
|
|
19
|
+
| `copiedText` | `string` | `'Copied'` | Message shown and announced after a successful copy. |
|
|
20
|
+
| `failedText` | `string` | `'Copy failed'` | Message shown and announced when the copy is refused. |
|
|
21
|
+
| `feedbackMs` | `number` | `2000` | How long the "copied" message stays. A failure message stays twice as long. |
|
|
22
|
+
| `variant` | `ButtonVariant` | `'secondary'` | Same values as `gbt-button`. |
|
|
23
|
+
| `size` | `ButtonSize` | `'small'` | `small \| medium \| large`. |
|
|
24
|
+
| `icon` | `string` | `'copy'` | Glyph of the idle button (registered icon name; `copy` is built in). |
|
|
25
|
+
| `disabled` | `boolean` | `false` | |
|
|
26
|
+
| `feedback` | `'bubble' \| 'inline' \| 'hidden'` | `'bubble'` | Where the message is drawn (see below). |
|
|
27
|
+
| `selectTarget` | `HTMLElement \| null` | `null` | Selected when the copy fails, so the user can copy by hand with Ctrl+C / Cmd+C. |
|
|
28
|
+
|
|
29
|
+
## Outputs
|
|
30
|
+
|
|
31
|
+
| Output | Payload | Role |
|
|
32
|
+
| ------------ | -------- | ------------------------------------------------------------------------------------------------------------ |
|
|
33
|
+
| `copied` | `string` | The text that was copied. |
|
|
34
|
+
| `copyFailed` | `void` | Neither the Clipboard API nor the fallback could copy (the text is shown selected if `selectTarget` is set). |
|
|
35
|
+
|
|
36
|
+
## How it copies
|
|
37
|
+
|
|
38
|
+
1. `navigator.clipboard.writeText` (secure contexts only: HTTPS or `localhost`).
|
|
39
|
+
2. Otherwise, or when the write is refused, `document.execCommand('copy')` on a throw-away textarea
|
|
40
|
+
(the focus and the selection of the page are restored). This is what makes a **plain-HTTP
|
|
41
|
+
self-hosted instance** work.
|
|
42
|
+
3. Otherwise `copyFailed` is emitted, the failure message shows and `selectTarget` is selected.
|
|
43
|
+
|
|
44
|
+
No browser API is read until the button is pressed, so rendering (SSR, jsdom) never touches
|
|
45
|
+
`navigator.clipboard`. A write that settles after the component is destroyed schedules nothing and
|
|
46
|
+
emits nothing.
|
|
47
|
+
|
|
48
|
+
## Stale messages
|
|
49
|
+
|
|
50
|
+
A "Copied" message belongs to the text that was copied: when `value` changes to a different **string** the message is
|
|
51
|
+
dropped (a function value is left alone, since a template may hand out a new closure on every change detection).
|
|
52
|
+
`reset()` (a public method) drops it on demand; `gbt-secret-reveal` calls it when the secret is hidden.
|
|
53
|
+
|
|
54
|
+
The legacy fallback puts its temporary textarea inside the trigger's `dialog` / `[role="dialog"]` when there is
|
|
55
|
+
one: a native modal `<dialog>` makes the rest of the page inert, and a textarea outside it could not be focused.
|
|
56
|
+
|
|
57
|
+
## Feedback
|
|
58
|
+
|
|
59
|
+
The accessible name never changes. The outcome is told by:
|
|
60
|
+
|
|
61
|
+
- a polite `role="status"` region that is **always in the DOM** (a live region only announces changes if
|
|
62
|
+
it was already rendered), holding `copiedText` or `failedText`;
|
|
63
|
+
- the icon: `copy`, then `check` (or `alert-circle` on failure), so it is never colour alone;
|
|
64
|
+
- visually, according to `feedback`: `bubble` is a small pill floating above the button, right-aligned
|
|
65
|
+
(clipped by an ancestor with `overflow: hidden`: use `inline` there); `inline` is the same message in
|
|
66
|
+
the flow after the button; `hidden` is for screen readers only.
|
|
67
|
+
|
|
68
|
+
The host carries `data-status="idle | copied | failed"` for styling.
|
|
69
|
+
|
|
70
|
+
## Example
|
|
71
|
+
|
|
72
|
+
```html
|
|
73
|
+
<code #url>{{ cloneUrl }}</code>
|
|
74
|
+
<gbt-copy-button
|
|
75
|
+
[value]="cloneUrl"
|
|
76
|
+
ariaLabel="Copy the clone URL"
|
|
77
|
+
copiedText="Copied"
|
|
78
|
+
failedText="Copy failed, press Ctrl+C"
|
|
79
|
+
[selectTarget]="url"
|
|
80
|
+
(copied)="analytics.track('clone-url-copied')"
|
|
81
|
+
/>
|
|
82
|
+
|
|
83
|
+
<!-- A label, and a value produced only when needed -->
|
|
84
|
+
<gbt-copy-button text="Copy the file" [value]="() => file().content" feedback="inline" />
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
## Accessibility
|
|
88
|
+
|
|
89
|
+
See [AUDIT.md](AUDIT.md). The icon-only button needs (and gets) a name; localise `ariaLabel`,
|
|
90
|
+
`copiedText` and `failedText` (the defaults are English).
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
# CopyField
|
|
2
|
+
|
|
3
|
+
A read-only value in monospace with a copy button beside it: a clone URL, a webhook URL, an activation
|
|
4
|
+
link, a token that is shown in full.
|
|
5
|
+
|
|
6
|
+
**Selector**: `gbt-copy-field`. Built on [`gbt-copy-button`](../copy-button/README.md) (Clipboard API,
|
|
7
|
+
`execCommand` fallback, live-region confirmation). For a secret that must stay masked until asked for,
|
|
8
|
+
use [`gbt-secret-reveal`](../secret-reveal/README.md).
|
|
9
|
+
|
|
10
|
+
## Inputs
|
|
11
|
+
|
|
12
|
+
| Input | Type | Default | Role |
|
|
13
|
+
| ------------ | ---------------------------------- | ------------------------------- | ------------------------------------------------------------------------------------------- |
|
|
14
|
+
| `value` | `string` | — | Required. The value shown and copied. |
|
|
15
|
+
| `label` | `string \| null` | `null` | Visible label above the field. It also names the group (`role="group"`, `aria-labelledby`). |
|
|
16
|
+
| `copyLabel` | `string` | `'Copy'` | Accessible name of the copy button. Say what is copied ("Copy the clone URL"). |
|
|
17
|
+
| `copiedText` | `string` | `'Copied'` | Message shown and announced after a successful copy. |
|
|
18
|
+
| `failedText` | `string` | `'Copy failed, value selected'` | Message when the copy is refused; the value is then selected for a manual Ctrl+C. |
|
|
19
|
+
| `feedbackMs` | `number` | `2000` | How long the confirmation stays (a failure stays twice as long). |
|
|
20
|
+
| `feedback` | `'bubble' \| 'inline' \| 'hidden'` | `'bubble'` | Where the confirmation is drawn (see `gbt-copy-button`). |
|
|
21
|
+
| `wrapAt` | `RegExp \| null` | after each `/` (not in `//`) | Where the value may wrap: it is cut after each match, with a `<wbr>`. `null`: no hint. |
|
|
22
|
+
|
|
23
|
+
## Outputs
|
|
24
|
+
|
|
25
|
+
| Output | Payload | Role |
|
|
26
|
+
| ------------ | -------- | ----------------------------------------------- |
|
|
27
|
+
| `copied` | `string` | The copied value. |
|
|
28
|
+
| `copyFailed` | `void` | Neither copy API worked; the value is selected. |
|
|
29
|
+
|
|
30
|
+
## Behaviour
|
|
31
|
+
|
|
32
|
+
- The value **wraps** instead of scrolling: it stays readable in a 240 px aside or on a phone with no scroll
|
|
33
|
+
region to reach by keyboard. Break opportunities follow `wrapAt`; a segment too long for a line breaks
|
|
34
|
+
anywhere.
|
|
35
|
+
- One click selects the whole value (`user-select: all`).
|
|
36
|
+
- The value is cut **after** each match of `wrapAt` (a `<wbr>` is inserted); the text itself is never altered, so a
|
|
37
|
+
capturing group or a separator such as `/\//` cannot drop or duplicate characters.
|
|
38
|
+
- `COPY_FIELD_WRAP_AT` (the default pattern) is exported by the component file if you want to extend it.
|
|
39
|
+
|
|
40
|
+
## Example
|
|
41
|
+
|
|
42
|
+
```html
|
|
43
|
+
<gbt-copy-field
|
|
44
|
+
label="Clone with HTTPS"
|
|
45
|
+
copyLabel="Copy the clone URL"
|
|
46
|
+
failedText="Copy failed, press Ctrl+C"
|
|
47
|
+
[value]="repo.cloneUrl"
|
|
48
|
+
(copied)="toast.show('URL copied', 'success')"
|
|
49
|
+
/>
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Accessibility
|
|
53
|
+
|
|
54
|
+
See [AUDIT.md](AUDIT.md). Localise `label`, `copyLabel`, `copiedText` and `failedText`.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# DatePicker
|
|
2
|
+
|
|
3
|
+
Single-date selection — a trigger button showing the chosen date, and
|
|
4
|
+
a calendar grid dropdown, positioned like `Select`/`Menu`. Integrates
|
|
5
|
+
with Angular forms via `ControlValueAccessor`, like `Select` and
|
|
6
|
+
`Textarea`.
|
|
7
|
+
|
|
8
|
+
**Selector**: `gbt-date-picker`
|
|
9
|
+
|
|
10
|
+
## Inputs
|
|
11
|
+
|
|
12
|
+
| Input | Type | Default | Role |
|
|
13
|
+
| --------------------- | -------------------- | ---------------------- | -------------------------------------------------------------------- |
|
|
14
|
+
| `label` | `string` | `''` | Field label. |
|
|
15
|
+
| `placeholder` | `string` | `'Select a date…'` | Shown in the trigger when no date is selected. |
|
|
16
|
+
| `locale` | `string` | `'en-US'` | Passed to `Intl.DateTimeFormat` for the trigger's date, the month/year heading, and weekday names. |
|
|
17
|
+
| `weekStartsOn` | `0 \| 1` | `1` (Monday) | `0` for a Sunday-first week. |
|
|
18
|
+
| `disabled` | `boolean` | `false` | — |
|
|
19
|
+
| `required` | `boolean` | `false` | Appends `*` to the label. |
|
|
20
|
+
| `errorMessage` | `string \| null` | `null` | Rendered as `role="alert"` below the field. |
|
|
21
|
+
| `previousMonthLabel` | `string` | `'Previous month'` | Accessible name of the "go back a month" button. |
|
|
22
|
+
| `nextMonthLabel` | `string` | `'Next month'` | Accessible name of the "go forward a month" button. |
|
|
23
|
+
| `clearable` | `boolean` | `false` | Shows a clear button in place of the calendar icon once a date is selected. |
|
|
24
|
+
| `clearLabel` | `string` | `'Clear date'` | Accessible name of the clear button. |
|
|
25
|
+
| `visibleMonths` | `1 \| 2` | `1` | Shows one or two consecutive months side by side. |
|
|
26
|
+
| `monthSelectLabel` | `string` | `'Month'` | Accessible name of the month dropdown. |
|
|
27
|
+
| `yearSelectLabel` | `string` | `'Year'` | Accessible name of the year dropdown. |
|
|
28
|
+
| `minYear`/`maxYear` | `number` | current year ∓ 100/+10 | Bounds the year dropdown's options. |
|
|
29
|
+
|
|
30
|
+
## Example
|
|
31
|
+
|
|
32
|
+
```html
|
|
33
|
+
<gbt-date-picker label="Appointment date" [formControl]="date" />
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Behavior
|
|
37
|
+
|
|
38
|
+
- The trigger is a plain button showing the formatted date (or the
|
|
39
|
+
placeholder) — not an editable text field. Typing a date string
|
|
40
|
+
would need locale-aware parsing this component doesn't attempt; the
|
|
41
|
+
calendar is the only way to set a value.
|
|
42
|
+
- Keyboard, inside the open grid: `ArrowLeft`/`Right`/`Up`/`Down` move
|
|
43
|
+
focus by a day/week, rolling into the next or previous month at the
|
|
44
|
+
edges; `Home`/`End` jump to the start/end of the focused week;
|
|
45
|
+
`PageUp`/`PageDown` shift the view a month; `Shift+PageUp`/`PageDown`
|
|
46
|
+
shift a year; `Enter`/`Space` select the focused day. This matches
|
|
47
|
+
the WAI-ARIA "Date Picker Dialog" pattern.
|
|
48
|
+
- Clicking a leading/trailing day from an adjacent month (shown dimmed)
|
|
49
|
+
selects it and shifts the view to that month.
|
|
50
|
+
- `Escape` and an outside click close the panel without changing the
|
|
51
|
+
value; `Escape` also returns focus to the trigger.
|
|
52
|
+
- With `clearable`, a clear button replaces the calendar icon once a
|
|
53
|
+
date is selected — same position, so nothing shifts. It's a separate
|
|
54
|
+
button next to the trigger, not inside it (a `<button>` can't
|
|
55
|
+
contain another interactive element), overlapping the trigger's icon
|
|
56
|
+
slot visually. Hidden while `disabled`.
|
|
57
|
+
- The previous/next buttons sit on their own full-width row above the
|
|
58
|
+
calendar(s), one at each outer edge — not tied to either month's own
|
|
59
|
+
heading. With `visibleMonths="2"`, they move both visible months
|
|
60
|
+
together (the second is always the first's next month — the two
|
|
61
|
+
aren't independently navigable). Arrowing past the last day of the
|
|
62
|
+
first visible month moves focus into the second (already visible)
|
|
63
|
+
month without shifting the view; only arrowing past the *last*
|
|
64
|
+
visible month, or before the first, slides the view by one month.
|
|
65
|
+
- The first visible month's heading is two native `<select>` dropdowns
|
|
66
|
+
(month, year) for jumping directly anywhere, instead of plain text —
|
|
67
|
+
reused as-is rather than nesting the library's own `Select` (a
|
|
68
|
+
floating-panel component) inside this panel's own floating panel,
|
|
69
|
+
which would multiply the positioning/z-index/outside-click concerns
|
|
70
|
+
for no real benefit here. A second visible month (with
|
|
71
|
+
`visibleMonths="2"`) keeps a plain-text heading, sized to match the
|
|
72
|
+
selects' height exactly so both calendars stay aligned.
|
|
73
|
+
|
|
74
|
+
## Scope
|
|
75
|
+
|
|
76
|
+
Single date only. A range picker (start/end) is [`DateRangePicker`](date-range-picker/README.md),
|
|
77
|
+
a separate component rather than a mode of this one. `min`/`max` date bounds (disabling
|
|
78
|
+
out-of-range days) are also out of scope: nothing in the current use cases needs them, and they're a
|
|
79
|
+
straightforward addition later if one does.
|
|
80
|
+
|
|
81
|
+
No date library (day.js, date-fns) is used — calendar math (month
|
|
82
|
+
grid, leap years) is hand-rolled in `date-picker-calendar.ts` on top of
|
|
83
|
+
native `Date`/`Intl`, consistent with the rest of this library having
|
|
84
|
+
no such dependency.
|