@bitforgehq/ui 0.3.0
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/CHANGELOG.md +3665 -0
- package/LICENSE +21 -0
- package/README.md +175 -0
- package/ai/MANIFEST.index.json +383 -0
- package/ai/MANIFEST.json +7528 -0
- package/ai/REFERENCE.index.json +1461 -0
- package/ai/REFERENCE.json +7213 -0
- package/ai/UI_GUIDE.md +1159 -0
- package/ai/components/action-bar.md +209 -0
- package/ai/components/action-sheet.md +526 -0
- package/ai/components/alert-dialog.md +509 -0
- package/ai/components/alert.md +376 -0
- package/ai/components/avatar.md +146 -0
- package/ai/components/back-button.md +286 -0
- package/ai/components/badge.md +171 -0
- package/ai/components/button.md +431 -0
- package/ai/components/card.md +303 -0
- package/ai/components/checkbox.md +418 -0
- package/ai/components/chip-group.md +205 -0
- package/ai/components/chip.md +300 -0
- package/ai/components/content.md +474 -0
- package/ai/components/desktop-toast.md +420 -0
- package/ai/components/dialog.md +962 -0
- package/ai/components/empty-state.md +146 -0
- package/ai/components/field.md +319 -0
- package/ai/components/header.md +809 -0
- package/ai/components/icon-button.md +221 -0
- package/ai/components/icon.md +176 -0
- package/ai/components/input.md +455 -0
- package/ai/components/list-item.md +326 -0
- package/ai/components/list.md +178 -0
- package/ai/components/menu-button.md +377 -0
- package/ai/components/menu.md +661 -0
- package/ai/components/modal.md +613 -0
- package/ai/components/number-input.md +423 -0
- package/ai/components/page.md +299 -0
- package/ai/components/progress.md +215 -0
- package/ai/components/radio-group.md +432 -0
- package/ai/components/refresher.md +377 -0
- package/ai/components/segmented.md +517 -0
- package/ai/components/select.md +510 -0
- package/ai/components/sheet.md +845 -0
- package/ai/components/spinner.md +171 -0
- package/ai/components/stack-outlet.md +661 -0
- package/ai/components/tab-bar.md +427 -0
- package/ai/components/tab.md +295 -0
- package/ai/components/tabs.md +408 -0
- package/ai/components/textarea.md +371 -0
- package/ai/components/toast.md +522 -0
- package/ai/components/toggle.md +387 -0
- package/ai/reference/bf-action-directive.md +21 -0
- package/ai/reference/bf-action-sheet-action-role.md +27 -0
- package/ai/reference/bf-action-sheet-action.md +28 -0
- package/ai/reference/bf-action-sheet-options.md +28 -0
- package/ai/reference/bf-action-sheet-service.md +33 -0
- package/ai/reference/bf-alert-dialog-button-role.md +27 -0
- package/ai/reference/bf-alert-dialog-button.md +27 -0
- package/ai/reference/bf-alert-dialog-options.md +29 -0
- package/ai/reference/bf-alert-dialog-service.md +34 -0
- package/ai/reference/bf-alert-variant.md +28 -0
- package/ai/reference/bf-autocapitalize.md +30 -0
- package/ai/reference/bf-avatar-size.md +27 -0
- package/ai/reference/bf-avatar-variant.md +28 -0
- package/ai/reference/bf-back-at-root.md +28 -0
- package/ai/reference/bf-back-button-service.md +40 -0
- package/ai/reference/bf-badge-variant.md +29 -0
- package/ai/reference/bf-button-size.md +29 -0
- package/ai/reference/bf-button-type.md +28 -0
- package/ai/reference/bf-button-variant.md +29 -0
- package/ai/reference/bf-card-padding.md +26 -0
- package/ai/reference/bf-card-variant.md +28 -0
- package/ai/reference/bf-chip-group-mode.md +27 -0
- package/ai/reference/bf-chip-variant.md +26 -0
- package/ai/reference/bf-compare-with.md +24 -0
- package/ai/reference/bf-component-overlay-ref.md +33 -0
- package/ai/reference/bf-confirm-button-role.md +26 -0
- package/ai/reference/bf-confirm-button.md +27 -0
- package/ai/reference/bf-confirm-options.md +31 -0
- package/ai/reference/bf-confirm-size.md +26 -0
- package/ai/reference/bf-content-scroll-event.md +21 -0
- package/ai/reference/bf-defaults-options.md +32 -0
- package/ai/reference/bf-defaults.md +28 -0
- package/ai/reference/bf-desktop-toast-config.md +28 -0
- package/ai/reference/bf-desktop-toast-harness.md +33 -0
- package/ai/reference/bf-desktop-toast-options.md +28 -0
- package/ai/reference/bf-desktop-toast-position.md +28 -0
- package/ai/reference/bf-desktop-toast-service.md +42 -0
- package/ai/reference/bf-dialog-config.md +44 -0
- package/ai/reference/bf-dialog-harness.md +52 -0
- package/ai/reference/bf-dialog-ref.md +44 -0
- package/ai/reference/bf-dialog-role.md +26 -0
- package/ai/reference/bf-dialog-service.md +55 -0
- package/ai/reference/bf-dialog-size.md +31 -0
- package/ai/reference/bf-dialog-template-context.md +32 -0
- package/ai/reference/bf-empty-state-heading-level.md +26 -0
- package/ai/reference/bf-enter-key-hint.md +31 -0
- package/ai/reference/bf-field-control-class.md +32 -0
- package/ai/reference/bf-field-control-state.md +28 -0
- package/ai/reference/bf-field-size.md +29 -0
- package/ai/reference/bf-haptics-impact-style.md +27 -0
- package/ai/reference/bf-haptics-notification-type.md +27 -0
- package/ai/reference/bf-haptics-service.md +41 -0
- package/ai/reference/bf-harness-filters.md +29 -0
- package/ai/reference/bf-horizontal-scroll-directive.md +129 -0
- package/ai/reference/bf-icon-button-variant.md +28 -0
- package/ai/reference/bf-icon-size.md +27 -0
- package/ai/reference/bf-input-autocapitalize.md +36 -0
- package/ai/reference/bf-input-enter-key-hint.md +38 -0
- package/ai/reference/bf-input-input-mode.md +38 -0
- package/ai/reference/bf-input-mode.md +32 -0
- package/ai/reference/bf-input-type.md +35 -0
- package/ai/reference/bf-jsdom-shim-options.md +22 -0
- package/ai/reference/bf-keyboard-assist-behavior.md +26 -0
- package/ai/reference/bf-keyboard-assist-directive.md +185 -0
- package/ai/reference/bf-keyboard-phase.md +30 -0
- package/ai/reference/bf-keyboard-service.md +50 -0
- package/ai/reference/bf-labels-overrides.md +26 -0
- package/ai/reference/bf-labels.md +44 -0
- package/ai/reference/bf-menu-button-harness.md +40 -0
- package/ai/reference/bf-menu-button-variant.md +27 -0
- package/ai/reference/bf-menu-divider-directive.md +13 -0
- package/ai/reference/bf-menu-group-directive.md +14 -0
- package/ai/reference/bf-menu-harness.md +55 -0
- package/ai/reference/bf-menu-item-checkbox-directive.md +31 -0
- package/ai/reference/bf-menu-item-directive.md +31 -0
- package/ai/reference/bf-menu-item-harness.md +52 -0
- package/ai/reference/bf-menu-item-radio-directive.md +29 -0
- package/ai/reference/bf-menu-placement.md +29 -0
- package/ai/reference/bf-menu-trigger-directive.md +46 -0
- package/ai/reference/bf-modal-options.md +30 -0
- package/ai/reference/bf-modal-presentation.md +26 -0
- package/ai/reference/bf-modal-service.md +38 -0
- package/ai/reference/bf-nav-controller.md +59 -0
- package/ai/reference/bf-nav-direction.md +23 -0
- package/ai/reference/bf-nav-target.md +21 -0
- package/ai/reference/bf-number-input-mode.md +28 -0
- package/ai/reference/bf-number-input-step.md +25 -0
- package/ai/reference/bf-overlay-auto-focus.md +29 -0
- package/ai/reference/bf-overlay-controller.md +22 -0
- package/ai/reference/bf-overlay-host.md +36 -0
- package/ai/reference/bf-overlay-options.md +53 -0
- package/ai/reference/bf-overlay-position.md +30 -0
- package/ai/reference/bf-overlay-ref.md +53 -0
- package/ai/reference/bf-overlay-role.md +27 -0
- package/ai/reference/bf-overlay-service.md +53 -0
- package/ai/reference/bf-overlay-stack-options.md +24 -0
- package/ai/reference/bf-overlay-stack.md +81 -0
- package/ai/reference/bf-overlay-template-context.md +24 -0
- package/ai/reference/bf-overscroll-stretch-directive.md +163 -0
- package/ai/reference/bf-page-context.md +24 -0
- package/ai/reference/bf-platform-service.md +53 -0
- package/ai/reference/bf-platform.md +28 -0
- package/ai/reference/bf-progress-size.md +26 -0
- package/ai/reference/bf-progress-tone.md +28 -0
- package/ai/reference/bf-radio-group-harness.md +49 -0
- package/ai/reference/bf-radio-group-orientation.md +26 -0
- package/ai/reference/bf-radio-option.md +30 -0
- package/ai/reference/bf-refresher-refresh-event.md +22 -0
- package/ai/reference/bf-segment-option.md +29 -0
- package/ai/reference/bf-segmented-harness.md +48 -0
- package/ai/reference/bf-segmented-size.md +29 -0
- package/ai/reference/bf-select-harness.md +70 -0
- package/ai/reference/bf-select-option.md +29 -0
- package/ai/reference/bf-sheet-auto-focus.md +29 -0
- package/ai/reference/bf-sheet-options.md +32 -0
- package/ai/reference/bf-sheet-ref.md +45 -0
- package/ai/reference/bf-sheet-service.md +34 -0
- package/ai/reference/bf-shell-config-mode.md +28 -0
- package/ai/reference/bf-shell-config.md +38 -0
- package/ai/reference/bf-shell-dynamic-type-limit.md +21 -0
- package/ai/reference/bf-shell-dynamic-type.md +25 -0
- package/ai/reference/bf-shell-mode.md +28 -0
- package/ai/reference/bf-shell-testing-options.md +26 -0
- package/ai/reference/bf-size.md +45 -0
- package/ai/reference/bf-spinner-size.md +27 -0
- package/ai/reference/bf-stack-change.md +22 -0
- package/ai/reference/bf-stack-reuse-strategy.md +32 -0
- package/ai/reference/bf-stack-transition-event.md +26 -0
- package/ai/reference/bf-stack-transition.md +26 -0
- package/ai/reference/bf-stacked-overlay.md +23 -0
- package/ai/reference/bf-system-bars-style.md +38 -0
- package/ai/reference/bf-tab-bar-controller.md +51 -0
- package/ai/reference/bf-tab-bar-host.md +52 -0
- package/ai/reference/bf-tab-context.md +32 -0
- package/ai/reference/bf-tab-links.md +37 -0
- package/ai/reference/bf-testing-options.md +27 -0
- package/ai/reference/bf-text-scale-service.md +35 -0
- package/ai/reference/bf-theme.md +27 -0
- package/ai/reference/bf-toast-action.md +25 -0
- package/ai/reference/bf-toast-controller.md +17 -0
- package/ai/reference/bf-toast-dismiss-reason.md +29 -0
- package/ai/reference/bf-toast-options.md +29 -0
- package/ai/reference/bf-toast-position.md +26 -0
- package/ai/reference/bf-toast-ref.md +41 -0
- package/ai/reference/bf-toast-service.md +39 -0
- package/ai/reference/bf-toggle-label-position.md +26 -0
- package/ai/reference/bf-transition-kind.md +28 -0
- package/ai/reference/bf-validation-message.md +31 -0
- package/ai/reference/bf-validation-messages.md +33 -0
- package/ai/reference/bf-view-event.md +28 -0
- package/ai/reference/bf-view-lifecycle.md +41 -0
- package/ai/reference/bf-view-state.md +28 -0
- package/ai/reference/bf_default_labels.md +21 -0
- package/ai/reference/bf_default_values.md +21 -0
- package/ai/reference/bf_defaults.md +21 -0
- package/ai/reference/bf_desktop_toast_defaults.md +21 -0
- package/ai/reference/bf_dialog_data.md +17 -0
- package/ai/reference/bf_labels.md +21 -0
- package/ai/reference/bf_overlay_data.md +19 -0
- package/ai/reference/bf_overlay_host.md +21 -0
- package/ai/reference/bf_sheet_default_snap_points.md +17 -0
- package/ai/reference/bf_shell_config.md +21 -0
- package/ai/reference/bf_shell_defaults.md +21 -0
- package/ai/reference/bf_tab_bar.md +21 -0
- package/ai/reference/bf_tab_bar_controller.md +21 -0
- package/ai/reference/bf_tab_context.md +21 -0
- package/ai/reference/bf_tab_links.md +21 -0
- package/ai/reference/bf_theme_storage.md +19 -0
- package/ai/reference/create-transition.md +36 -0
- package/ai/reference/duration_fast.md +17 -0
- package/ai/reference/duration_md.md +17 -0
- package/ai/reference/duration_overlay.md +17 -0
- package/ai/reference/duration_push.md +17 -0
- package/ai/reference/fade-down.md +26 -0
- package/ai/reference/fade-in.md +25 -0
- package/ai/reference/fade-out.md +25 -0
- package/ai/reference/fade-up.md +26 -0
- package/ai/reference/inject-shell-mode.md +23 -0
- package/ai/reference/install-bf-jsdom-shims.md +31 -0
- package/ai/reference/ios_duration.md +17 -0
- package/ai/reference/ios_easing.md +17 -0
- package/ai/reference/is-text-entry.md +25 -0
- package/ai/reference/max_complete_ms.md +17 -0
- package/ai/reference/md-transition.md +31 -0
- package/ai/reference/md_duration.md +17 -0
- package/ai/reference/md_easing.md +17 -0
- package/ai/reference/overlay_duration.md +21 -0
- package/ai/reference/overlay_easing.md +19 -0
- package/ai/reference/overlay_reduced_duration.md +17 -0
- package/ai/reference/pop-frames-at.md +25 -0
- package/ai/reference/prefers-reduced-motion.md +25 -0
- package/ai/reference/provide-bf-defaults.md +33 -0
- package/ai/reference/provide-bf-desktop-toast.md +28 -0
- package/ai/reference/provide-bf-labels.md +38 -0
- package/ai/reference/provide-bf-shell-testing.md +34 -0
- package/ai/reference/provide-bf-shell.md +41 -0
- package/ai/reference/provide-bf-testing.md +33 -0
- package/ai/reference/reduced-transition.md +28 -0
- package/ai/reference/reduced_duration.md +17 -0
- package/ai/reference/resolve-shell-mode.md +33 -0
- package/ai/reference/scale-in.md +25 -0
- package/ai/reference/settle-duration.md +25 -0
- package/ai/reference/settle-pop.md +33 -0
- package/ai/reference/settle_easing.md +17 -0
- package/ai/reference/should-complete-pop.md +26 -0
- package/ai/reference/slide-down.md +26 -0
- package/ai/reference/slide-up.md +26 -0
- package/ai/reference/with-bf-shell-routing.md +19 -0
- package/bin/bf-ui.js +81 -0
- package/fesm2022/bitforgehq-ui-icons.mjs +230 -0
- package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-mobile.mjs +5530 -0
- package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-number-input.mjs +680 -0
- package/fesm2022/bitforgehq-ui-number-input.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-overlay.mjs +2675 -0
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-testing.mjs +402 -0
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui.mjs +7765 -0
- package/fesm2022/bitforgehq-ui.mjs.map +1 -0
- package/llms-full.txt +25394 -0
- package/llms.txt +329 -0
- package/package.json +94 -0
- package/theme.css +253 -0
- package/types/bitforgehq-ui-icons.d.ts +50 -0
- package/types/bitforgehq-ui-mobile.d.ts +2914 -0
- package/types/bitforgehq-ui-number-input.d.ts +282 -0
- package/types/bitforgehq-ui-overlay.d.ts +1514 -0
- package/types/bitforgehq-ui-testing.d.ts +495 -0
- package/types/bitforgehq-ui.d.ts +3499 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
# bf-spinner
|
|
2
|
+
|
|
3
|
+
Indeterminate loading spinner in three sizes that inherits its parent's text color
|
|
4
|
+
|
|
5
|
+
`BfSpinnerComponent` from `@bitforgehq/ui` · Feedback · since 0.1.0
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { Component } from '@angular/core';
|
|
11
|
+
import { BfSpinnerComponent } from '@bitforgehq/ui';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The bf-spinner overview.
|
|
15
|
+
*
|
|
16
|
+
* Live demo of `bf-spinner`: the three sizes on a muted background, as it inherits `currentColor`.
|
|
17
|
+
*/
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'app-example-spinner-overview',
|
|
20
|
+
imports: [BfSpinnerComponent],
|
|
21
|
+
template: `
|
|
22
|
+
<div class="text-text-muted flex flex-wrap items-center gap-3">
|
|
23
|
+
<bf-spinner size="sm" />
|
|
24
|
+
<bf-spinner size="md" />
|
|
25
|
+
<bf-spinner size="lg" />
|
|
26
|
+
</div>
|
|
27
|
+
`,
|
|
28
|
+
})
|
|
29
|
+
export class SpinnerOverviewExampleComponent {}
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## Overview
|
|
33
|
+
|
|
34
|
+
Indeterminate progress indicator. Inherits `currentColor`, so place it inside a colored parent
|
|
35
|
+
(a button, a muted paragraph) rather than coloring it directly.
|
|
36
|
+
|
|
37
|
+
An indeterminate progress indicator for short waits. It inherits the current text color, so placing it inside a muted paragraph or a button gives the right tone without extra classes.
|
|
38
|
+
|
|
39
|
+
## When to use
|
|
40
|
+
|
|
41
|
+
Use `bf-spinner` for a short wait of unknown length inside a region: a panel loading, a list refreshing. Use [bf-button](https://bitforge-ui.web.app/components/button) `loading` instead while a button's own action runs, and [bf-progress](https://bitforge-ui.web.app/components/progress) when the share of work done is known.
|
|
42
|
+
|
|
43
|
+
## Basic usage
|
|
44
|
+
|
|
45
|
+
```ts
|
|
46
|
+
import { Component } from '@angular/core';
|
|
47
|
+
import { BfSpinnerComponent } from '@bitforgehq/ui';
|
|
48
|
+
|
|
49
|
+
/** A small spinner beside its loading text. */
|
|
50
|
+
@Component({
|
|
51
|
+
selector: 'app-example-spinner-basic',
|
|
52
|
+
imports: [BfSpinnerComponent],
|
|
53
|
+
template: `
|
|
54
|
+
<p class="text-text-muted flex items-center gap-2"><bf-spinner size="sm" /> Loading recipes</p>
|
|
55
|
+
`,
|
|
56
|
+
})
|
|
57
|
+
export class SpinnerBasicExampleComponent {}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
## Sizes
|
|
61
|
+
|
|
62
|
+
`sm` 16 px, `md` 20 px (default), `lg` 24 px: the `bf-icon` sizes, so a spinner can replace an icon without shifting the layout.
|
|
63
|
+
|
|
64
|
+
```ts
|
|
65
|
+
import { Component } from '@angular/core';
|
|
66
|
+
import { BfSpinnerComponent } from '@bitforgehq/ui';
|
|
67
|
+
|
|
68
|
+
/** The sm, md and lg spinner sizes. */
|
|
69
|
+
@Component({
|
|
70
|
+
selector: 'app-example-spinner-sizes',
|
|
71
|
+
imports: [BfSpinnerComponent],
|
|
72
|
+
template: `
|
|
73
|
+
<div class="flex items-center gap-4">
|
|
74
|
+
<bf-spinner size="sm" />
|
|
75
|
+
<bf-spinner />
|
|
76
|
+
<bf-spinner size="lg" />
|
|
77
|
+
</div>
|
|
78
|
+
`,
|
|
79
|
+
})
|
|
80
|
+
export class SpinnerSizesExampleComponent {}
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
## Decorative
|
|
84
|
+
|
|
85
|
+
Inside a control that already reports its busy state (`aria-busy`), mark the spinner `decorative` so assistive tech does not hear a second status.
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
import { Component } from '@angular/core';
|
|
89
|
+
import { BfSpinnerComponent } from '@bitforgehq/ui';
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* A decorative spinner inside a busy button.
|
|
93
|
+
*
|
|
94
|
+
* The button already says it is busy, so the spinner adds no second announcement.
|
|
95
|
+
*/
|
|
96
|
+
@Component({
|
|
97
|
+
selector: 'app-example-spinner-decorative',
|
|
98
|
+
imports: [BfSpinnerComponent],
|
|
99
|
+
template: `
|
|
100
|
+
<button
|
|
101
|
+
type="button"
|
|
102
|
+
aria-busy="true"
|
|
103
|
+
aria-disabled="true"
|
|
104
|
+
class="bg-surface-muted text-text rounded-control inline-flex h-10 items-center gap-2 px-4"
|
|
105
|
+
>
|
|
106
|
+
<bf-spinner size="sm" decorative /> Syncing
|
|
107
|
+
</button>
|
|
108
|
+
`,
|
|
109
|
+
})
|
|
110
|
+
export class SpinnerDecorativeExampleComponent {}
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
## Theming
|
|
114
|
+
|
|
115
|
+
`bf-spinner` defines no color of its own. It is a pure-CSS ring (no SVG): a `rounded-full` box whose border is `currentColor` at 25 % for the track and a solid `currentColor` top edge for the arc, so it takes on whatever text color its parent sets. The ring is 14, 18 or 22 px inset by a 1 px margin, so the box stays the `bf-icon` size, with a 2, 2 or 3 px border; its arc ends are square.
|
|
116
|
+
|
|
117
|
+
## Accessibility
|
|
118
|
+
|
|
119
|
+
The wrapper is `role="status"` with `aria-live="polite"`; the ring itself is `aria-hidden`, and the visible-but-`sr-only` `label` text is what gets announced; without a `label` it is `provideBfLabels()`'s `loading` ("Loading"), so translate it once app-wide. With `decorative`, the spinner has no role, no live region and no label, and the wrapper is `aria-hidden="true"`: use it inside a control that already reports its busy state (a loading `bf-button` does this for you).
|
|
120
|
+
|
|
121
|
+
The ring rotates only when motion is allowed (`motion-safe:animate-spin`). Under `prefers-reduced-motion: reduce` it does not rotate at all; it pulses its opacity instead (`motion-reduce:animate-pulse`), so the wait still reads as ongoing without spinning motion. Under forced colours (Windows High Contrast) the track is drawn in `GrayText` and the arc in `CanvasText`, so the arc stays distinct.
|
|
122
|
+
|
|
123
|
+
## Inputs
|
|
124
|
+
|
|
125
|
+
| Name | Type | Default | Description |
|
|
126
|
+
| ------------ | ---------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
127
|
+
| `size` | `BfSpinnerSize` (`'sm' \| 'md' \| 'lg'`) | `'md'` | Visual size: 16, 20 or 24 px (the `bf-icon` sizes). |
|
|
128
|
+
| `label` | `string` | `''` | Screen-reader text; keep it a short verb phrase. Empty falls back to `provideBfLabels()`'s `loading` ("Loading"). Not rendered while `decorative`. |
|
|
129
|
+
| `decorative` | `boolean` | `false` | Hides the spinner from assistive tech (no status role, no live region, no label), for a spinner inside a control that already reports its busy state, such as a loading `bf-button`. |
|
|
130
|
+
|
|
131
|
+
## Notes
|
|
132
|
+
|
|
133
|
+
### Do
|
|
134
|
+
|
|
135
|
+
- Give `label` a short verb phrase ("Saving") when the default "Loading" is wrong; translate the default with `provideBfLabels({ loading: 'Laden' })`.
|
|
136
|
+
- Prefer `bf-button [loading]` over a spinner next to a button.
|
|
137
|
+
|
|
138
|
+
### Don't
|
|
139
|
+
|
|
140
|
+
- Don't color the spinner directly; color its parent.
|
|
141
|
+
- Don't use it for waits longer than a few seconds; show progress or a skeleton instead.
|
|
142
|
+
|
|
143
|
+
## Migration notes
|
|
144
|
+
|
|
145
|
+
### 0.3.0
|
|
146
|
+
|
|
147
|
+
**Behaviour:** `label` defaults to `''` and falls back to `provideBfLabels()`'s `loading`
|
|
148
|
+
("Loading"); the rendered English default is unchanged.
|
|
149
|
+
|
|
150
|
+
JSDoc of `spinner.component.ts` for the API reference: `@summary`/`@since` on the exported symbols.
|
|
151
|
+
No behaviour change.
|
|
152
|
+
|
|
153
|
+
**Behaviour:** a pure-CSS ring with no inline SVG (F-066): a `rounded-full` ring sized
|
|
154
|
+
`size-3.5`, `size-4.5` or `size-5.5` (14/18/22 px, close to the old SVG's 14/17.5/21 px outer
|
|
155
|
+
edge) and inset by `m-px`, so the box stays 16/20/24 px, with a `border-2`, `border-2` or
|
|
156
|
+
`border-[3px]` border, `border-current/25` for the track and `border-t-current` for the arc; the
|
|
157
|
+
arc ends are square. It rotates with `motion-safe:animate-spin`; under `prefers-reduced-motion` it no longer
|
|
158
|
+
rotates at all but pulses its opacity (`motion-reduce:animate-pulse`, F-064). Under forced colours
|
|
159
|
+
the track is `GrayText` and the arc `CanvasText`. The `decorative`, `label` and status semantics
|
|
160
|
+
are unchanged.
|
|
161
|
+
|
|
162
|
+
**Deprecated:** `px` (the box in px, 16/20/24): use the `size` input; removed in 0.4.0. See
|
|
163
|
+
Migration 26.
|
|
164
|
+
|
|
165
|
+
### 0.2.0
|
|
166
|
+
|
|
167
|
+
Sizes are now the `bf-icon` sizes: `sm` 16, `md` 20 (default), `lg` 24 px (were 16/24/32).
|
|
168
|
+
|
|
169
|
+
Added: `decorative` input (`booleanAttribute`). A decorative spinner has no `role="status"`, no
|
|
170
|
+
`aria-live` and no `sr-only` label, and its wrapper is `aria-hidden="true"`: for a spinner inside a
|
|
171
|
+
control that already reports its busy state, such as a loading `bf-button`.
|