@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,209 @@
|
|
|
1
|
+
# bf-action-bar
|
|
2
|
+
|
|
3
|
+
Floating pill of contextual actions that appears while items are selected
|
|
4
|
+
|
|
5
|
+
`BfActionBarComponent` from `@bitforgehq/ui` · Actions · since 0.1.0
|
|
6
|
+
|
|
7
|
+
## Example
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { Component, computed, signal } from '@angular/core';
|
|
11
|
+
import { BfActionBarComponent, BfButtonComponent } from '@bitforgehq/ui';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* The bf-action-bar overview.
|
|
15
|
+
*
|
|
16
|
+
* Live demo of `bf-action-bar`: a selection count whose Clear, Move and Mark done actions act on it.
|
|
17
|
+
*/
|
|
18
|
+
@Component({
|
|
19
|
+
selector: 'app-example-action-bar-overview',
|
|
20
|
+
imports: [BfActionBarComponent, BfButtonComponent],
|
|
21
|
+
template: `
|
|
22
|
+
<div class="flex flex-col gap-3">
|
|
23
|
+
<bf-action-bar [label]="label()">
|
|
24
|
+
@if (selected() > 0) {
|
|
25
|
+
<bf-button variant="text" size="sm" (clicked)="clear()">Clear</bf-button>
|
|
26
|
+
<bf-button variant="text" size="sm" (clicked)="move()">Move</bf-button>
|
|
27
|
+
<bf-button size="sm" (clicked)="markDone()">Mark done</bf-button>
|
|
28
|
+
} @else {
|
|
29
|
+
<bf-button variant="text" size="sm" (clicked)="selectTwo()">Select 2</bf-button>
|
|
30
|
+
}
|
|
31
|
+
</bf-action-bar>
|
|
32
|
+
<p data-status aria-live="polite" class="text-caption text-text-muted">{{ status() }}</p>
|
|
33
|
+
</div>
|
|
34
|
+
`,
|
|
35
|
+
})
|
|
36
|
+
export class ActionBarOverviewExampleComponent {
|
|
37
|
+
readonly selected = signal(2);
|
|
38
|
+
readonly status = signal('Pick an action.');
|
|
39
|
+
|
|
40
|
+
readonly label = computed(() =>
|
|
41
|
+
this.selected() > 0 ? `${this.selected()} selected` : 'Nothing selected',
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
clear(): void {
|
|
45
|
+
this.selected.set(0);
|
|
46
|
+
this.status.set('Selection cleared.');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
move(): void {
|
|
50
|
+
this.status.set(`Moved ${this.selected()} tasks to Atlas.`);
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
markDone(): void {
|
|
54
|
+
this.status.set(`Marked ${this.selected()} tasks done.`);
|
|
55
|
+
this.selected.set(0);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
selectTwo(): void {
|
|
59
|
+
this.selected.set(2);
|
|
60
|
+
this.status.set('Selected 2 tasks.');
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
## Overview
|
|
66
|
+
|
|
67
|
+
Floating pill of actions that appears when items are selected. Position it yourself
|
|
68
|
+
(bottom-centre, above the safe area on mobile); the bar only styles itself.
|
|
69
|
+
|
|
70
|
+
A floating pill of actions that appears when items are selected, such as rows in a `bf-list`. `bf-action-bar` only styles the pill; you position it and control when it appears.
|
|
71
|
+
|
|
72
|
+
## When to use
|
|
73
|
+
|
|
74
|
+
Use `bf-action-bar` for the actions that apply to a selection while it lasts: delete, move or share the selected rows. Use [bf-menu-button](https://bitforge-ui.web.app/components/menu-button) instead for actions on a single item, and a row of [bf-button](https://bitforge-ui.web.app/components/button)s in a toolbar for actions that are always available.
|
|
75
|
+
|
|
76
|
+
## Basic usage
|
|
77
|
+
|
|
78
|
+
```ts
|
|
79
|
+
import { Component, computed, signal } from '@angular/core';
|
|
80
|
+
import { BfActionBarComponent, BfButtonComponent } from '@bitforgehq/ui';
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* An action bar for a selection.
|
|
84
|
+
*
|
|
85
|
+
* The label counts the selected tasks; Clear empties the selection, Mark done completes it.
|
|
86
|
+
*/
|
|
87
|
+
@Component({
|
|
88
|
+
selector: 'app-example-action-bar-basic',
|
|
89
|
+
imports: [BfActionBarComponent, BfButtonComponent],
|
|
90
|
+
template: `
|
|
91
|
+
<div class="flex flex-col items-center gap-3">
|
|
92
|
+
<bf-action-bar [label]="selected().length + ' selected'">
|
|
93
|
+
<bf-button variant="text" size="sm" (clicked)="clear()">Clear</bf-button>
|
|
94
|
+
<bf-button size="sm" (clicked)="complete()">Mark done</bf-button>
|
|
95
|
+
</bf-action-bar>
|
|
96
|
+
<p aria-live="polite" class="text-caption text-text-muted">{{ status() }}</p>
|
|
97
|
+
</div>
|
|
98
|
+
`,
|
|
99
|
+
})
|
|
100
|
+
export class ActionBarBasicExampleComponent {
|
|
101
|
+
protected readonly selected = signal(['Brief', 'Moodboard', 'Deck']);
|
|
102
|
+
private readonly done = signal(0);
|
|
103
|
+
protected readonly status = computed(() => `${this.done()} done`);
|
|
104
|
+
|
|
105
|
+
protected clear(): void {
|
|
106
|
+
this.selected.set([]);
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
protected complete(): void {
|
|
110
|
+
this.done.update((n) => n + this.selected().length);
|
|
111
|
+
this.selected.set([]);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
## Positioning
|
|
117
|
+
|
|
118
|
+
On the web, fix it to the bottom-centre of the viewport or the scroll container. On mobile, add `pb-safe-bottom` so it clears the tab bar and the device's safe area instead of sitting under it.
|
|
119
|
+
|
|
120
|
+
```ts
|
|
121
|
+
import { Component, signal } from '@angular/core';
|
|
122
|
+
import { BfActionBarComponent, BfButtonComponent } from '@bitforgehq/ui';
|
|
123
|
+
|
|
124
|
+
/**
|
|
125
|
+
* An action bar pinned above the bottom edge.
|
|
126
|
+
*
|
|
127
|
+
* The app positions the bar: a fixed, centred row that keeps clear of the home indicator
|
|
128
|
+
* (`pb-safe-bottom`).
|
|
129
|
+
*
|
|
130
|
+
* @preview none
|
|
131
|
+
*/
|
|
132
|
+
@Component({
|
|
133
|
+
selector: 'app-example-action-bar-positioning',
|
|
134
|
+
imports: [BfActionBarComponent, BfButtonComponent],
|
|
135
|
+
template: `
|
|
136
|
+
<div class="pb-safe-bottom fixed inset-x-0 bottom-6 flex justify-center">
|
|
137
|
+
<bf-action-bar [label]="selected().length + ' selected'">
|
|
138
|
+
<bf-button variant="text" size="sm" (clicked)="selected.set([])">Clear</bf-button>
|
|
139
|
+
<bf-button size="sm" (clicked)="selected.set([])">Mark done</bf-button>
|
|
140
|
+
</bf-action-bar>
|
|
141
|
+
</div>
|
|
142
|
+
`,
|
|
143
|
+
})
|
|
144
|
+
export class ActionBarPositioningExampleComponent {
|
|
145
|
+
protected readonly selected = signal(['Brief', 'Deck']);
|
|
146
|
+
}
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
## Theming
|
|
150
|
+
|
|
151
|
+
The pill itself carries the only tokens on `bf-action-bar`; the projected `bf-button`s theme themselves.
|
|
152
|
+
|
|
153
|
+
- Background: `surface`; text: `text`.
|
|
154
|
+
- Elevation: `shadow-floating`.
|
|
155
|
+
- Shape: `rounded-control` (`--radius-control`, `9999px` by default, so a pill).
|
|
156
|
+
|
|
157
|
+
The bar never grows past its container: the `label` never truncates (a long word breaks only past the bar's width), the buttons keep their size and wrap onto a second row when they do not fit beside it.
|
|
158
|
+
|
|
159
|
+
The pill's padding is logical (18 px at the inline start, 6 px at the end), so the label leads under `dir="rtl"` too.
|
|
160
|
+
|
|
161
|
+
## Accessibility
|
|
162
|
+
|
|
163
|
+
The pill has `role="group"`; when `label` is set it also gets `aria-labelledby` pointing at the label text, so assistive tech announces the count before the actions. The bar sets no focus state of its own — keyboard and focus behaviour come entirely from the `bf-button`s projected into it.
|
|
164
|
+
|
|
165
|
+
## Inputs
|
|
166
|
+
|
|
167
|
+
| Name | Type | Default | Description |
|
|
168
|
+
| ------- | -------- | ------- | -------------------------------- |
|
|
169
|
+
| `label` | `string` | `''` | Leading text, e.g. "2 selected". |
|
|
170
|
+
|
|
171
|
+
## Slots
|
|
172
|
+
|
|
173
|
+
- `default`: The actions: buttons and icon buttons, laid out in the bar.
|
|
174
|
+
|
|
175
|
+
## Notes
|
|
176
|
+
|
|
177
|
+
### Do
|
|
178
|
+
|
|
179
|
+
- Show the bar only while at least one item is selected; remove it otherwise.
|
|
180
|
+
- Keep it to two or three actions; more belongs in an overflow menu.
|
|
181
|
+
|
|
182
|
+
### Don't
|
|
183
|
+
|
|
184
|
+
- Don't rely on `bf-action-bar` for layout; it never positions itself.
|
|
185
|
+
|
|
186
|
+
## Migration notes
|
|
187
|
+
|
|
188
|
+
### 0.3.0
|
|
189
|
+
|
|
190
|
+
**Behaviour:** logical properties: the pill's and the label's padding use `ps-*`/`pe-*`, so the
|
|
191
|
+
label leads under `dir="rtl"`.
|
|
192
|
+
|
|
193
|
+
**Behaviour:** shaped with the new `rounded-control` (`--radius-control`, `9999px` by default, so it renders as before); override the token to move off the pill.
|
|
194
|
+
|
|
195
|
+
JSDoc of `action-bar.component.ts` for the API reference: `@slot` docs for `default`. No behaviour
|
|
196
|
+
change.
|
|
197
|
+
|
|
198
|
+
### 0.2.0
|
|
199
|
+
|
|
200
|
+
The bar and its host are capped at `max-w-full`, so a long label no longer pushes the actions out
|
|
201
|
+
of a narrow container (the label keeps its width and the actions wrap, see "Changed" below).
|
|
202
|
+
|
|
203
|
+
Changed: the label (the selection count) never truncates: it keeps its width (`shrink-0`, breaking a
|
|
204
|
+
long word only past the bar's width), and the bar is `flex-wrap`, so actions that do not fit beside
|
|
205
|
+
it move to a second row.
|
|
206
|
+
|
|
207
|
+
### 0.1.0
|
|
208
|
+
|
|
209
|
+
New `bf-action-bar`: a floating pill for actions on a selection, with an optional leading `label` and a default slot for buttons. It only styles itself; the consumer positions it (fixed bottom-centre on web, `pb-safe-bottom` on mobile). Uses `role="group"` (was toolbar): the bar's contents aren't a fixed, single-tab-stop toolbar of controls, so `group` is the correct ARIA role; `aria-labelledby` now points at the `label` span instead of relying on visible text alone.
|