@bitforgehq/ui 0.3.0 → 0.3.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/CHANGELOG.md +482 -0
- package/README.md +17 -11
- package/ai/MANIFEST.index.json +288 -0
- package/ai/MANIFEST.json +8716 -3926
- package/ai/REFERENCE.index.json +413 -0
- package/ai/REFERENCE.json +4710 -2047
- package/ai/UI_GUIDE.md +185 -57
- package/ai/components/back-button.md +42 -2
- package/ai/components/badge.md +17 -7
- package/ai/components/bar-chart.md +188 -0
- package/ai/components/breadcrumb-item.md +121 -0
- package/ai/components/breadcrumb.md +277 -0
- package/ai/components/button.md +82 -15
- package/ai/components/calendar.md +300 -0
- package/ai/components/card.md +63 -2
- package/ai/components/chart-card.md +283 -0
- package/ai/components/combobox.md +411 -0
- package/ai/components/date-input.md +396 -0
- package/ai/components/datetime-input.md +215 -0
- package/ai/components/description-item.md +111 -0
- package/ai/components/description-list.md +160 -0
- package/ai/components/donut-chart.md +169 -0
- package/ai/components/header.md +67 -2
- package/ai/components/icon-button.md +74 -16
- package/ai/components/icon.md +63 -7
- package/ai/components/line-chart.md +234 -0
- package/ai/components/list.md +70 -6
- package/ai/components/menu.md +5 -0
- package/ai/components/multi-combobox.md +257 -0
- package/ai/components/nav-group.md +178 -0
- package/ai/components/nav-item.md +210 -0
- package/ai/components/page-header.md +237 -0
- package/ai/components/pagination.md +173 -0
- package/ai/components/popover.md +250 -0
- package/ai/components/side-panel.md +391 -0
- package/ai/components/sidebar.md +363 -0
- package/ai/components/skeleton.md +215 -0
- package/ai/components/sparkline.md +188 -0
- package/ai/components/stat.md +233 -0
- package/ai/components/tab-group.md +226 -0
- package/ai/components/tab-panel.md +163 -0
- package/ai/components/table.md +568 -0
- package/ai/components/tabs.md +42 -2
- package/ai/components/theme-menu-button.md +182 -0
- package/ai/components/theme-switch.md +170 -0
- package/ai/components/time-input.md +240 -0
- package/ai/components/toolbar.md +289 -0
- package/ai/components/tooltip.md +230 -0
- package/ai/components/top-nav.md +159 -0
- package/ai/reference/bf-badge-appearance.md +36 -0
- package/ai/reference/bf-badge-variant.md +1 -1
- package/ai/reference/bf-bar-chart-orientation.md +27 -0
- package/ai/reference/bf-button-appearance.md +36 -0
- package/ai/reference/bf-button-variant.md +1 -1
- package/ai/reference/bf-calendar-disabled-date.md +23 -0
- package/ai/reference/bf-calendar-harness.md +51 -0
- package/ai/reference/bf-calendar-weekday.md +31 -0
- package/ai/reference/bf-chart-card-heading-level.md +26 -0
- package/ai/reference/bf-chart-curve.md +28 -0
- package/ai/reference/bf-chart-harness.md +51 -0
- package/ai/reference/bf-chart-legend-position.md +30 -0
- package/ai/reference/bf-chart-series.md +23 -0
- package/ai/reference/bf-chart-value-format.md +23 -0
- package/ai/reference/bf-color-scheme-service.md +30 -0
- package/ai/reference/bf-color-scheme.md +31 -0
- package/ai/reference/bf-combobox-filter.md +27 -0
- package/ai/reference/bf-combobox-harness.md +89 -0
- package/ai/reference/bf-combobox-option.md +33 -0
- package/ai/reference/bf-compare-with.md +2 -0
- package/ai/reference/bf-date-input-harness.md +67 -0
- package/ai/reference/bf-date-input-picker.md +27 -0
- package/ai/reference/bf-date-time-input-harness.md +76 -0
- package/ai/reference/bf-date-time-input-picker.md +27 -0
- package/ai/reference/bf-description-list-layout.md +26 -0
- package/ai/reference/bf-donut-slice.md +22 -0
- package/ai/reference/bf-labels.md +67 -20
- package/ai/reference/bf-menu-button-variant.md +1 -0
- package/ai/reference/bf-menu-placement.md +1 -0
- package/ai/reference/bf-overlay-options.md +28 -27
- package/ai/reference/bf-overlay-placement.md +34 -0
- package/ai/reference/bf-overlay-position.md +1 -1
- package/ai/reference/bf-overlay-service.md +5 -3
- package/ai/reference/bf-page-header-heading-level.md +26 -0
- package/ai/reference/bf-pagination-harness.md +61 -0
- package/ai/reference/bf-platform-service.md +17 -15
- package/ai/reference/bf-popover-harness.md +42 -0
- package/ai/reference/bf-popover-placement.md +28 -0
- package/ai/reference/bf-popover-trigger-directive.md +56 -0
- package/ai/reference/bf-side-panel-config.md +35 -0
- package/ai/reference/bf-side-panel-harness.md +34 -0
- package/ai/reference/bf-side-panel-ref.md +44 -0
- package/ai/reference/bf-side-panel-service.md +43 -0
- package/ai/reference/bf-side-panel-template-context.md +32 -0
- package/ai/reference/bf-side-panel-width.md +28 -0
- package/ai/reference/bf-size.md +12 -0
- package/ai/reference/bf-skeleton-shape.md +28 -0
- package/ai/reference/bf-stat-trend-intent.md +27 -0
- package/ai/reference/bf-stat-trend.md +27 -0
- package/ai/reference/bf-stat-variant.md +26 -0
- package/ai/reference/bf-tab-group-harness.md +44 -0
- package/ai/reference/bf-table-align.md +26 -0
- package/ai/reference/bf-table-cell-context.md +24 -0
- package/ai/reference/bf-table-cell-directive.md +22 -0
- package/ai/reference/bf-table-column.md +28 -0
- package/ai/reference/bf-table-harness.md +77 -0
- package/ai/reference/bf-table-row-key.md +21 -0
- package/ai/reference/bf-table-sort-direction.md +26 -0
- package/ai/reference/bf-table-sort.md +27 -0
- package/ai/reference/bf-theme.md +5 -4
- package/ai/reference/bf-time-input-harness.md +67 -0
- package/ai/reference/bf-time-input-hour-cycle.md +27 -0
- package/ai/reference/bf-time-input-picker.md +27 -0
- package/ai/reference/bf-tooltip-directive.md +43 -0
- package/ai/reference/bf-tooltip-harness.md +43 -0
- package/ai/reference/bf-tooltip-placement.md +28 -0
- package/ai/reference/bf_color_scheme_storage.md +20 -0
- package/ai/reference/bf_side_panel_data.md +17 -0
- package/ai/reference/bf_theme_storage.md +3 -1
- package/ai/reference/provide-bf-color-scheme.md +20 -0
- package/ai/reference/provide-bf-labels.md +12 -4
- package/ai/reference/slide-in-from-end.md +24 -0
- package/ai/reference/slide-out-to-end.md +24 -0
- package/fesm2022/bitforgehq-ui-charts.mjs +3045 -0
- package/fesm2022/bitforgehq-ui-charts.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-icons.mjs +107 -3
- package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-mobile.mjs +14 -59
- package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-overlay.mjs +6436 -33
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +618 -1
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +5092 -153
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +25177 -14398
- package/llms.txt +95 -1
- package/package.json +7 -3
- package/theme.css +101 -0
- package/types/bitforgehq-ui-charts.d.ts +967 -0
- package/types/bitforgehq-ui-icons.d.ts +13 -1
- package/types/bitforgehq-ui-mobile.d.ts +25 -18
- package/types/bitforgehq-ui-overlay.d.ts +1844 -7
- package/types/bitforgehq-ui-testing.d.ts +748 -1
- package/types/bitforgehq-ui.d.ts +2136 -44
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# BfPaginationHarness
|
|
2
|
+
|
|
3
|
+
Test harness for pagination: reads the current page and moves between pages
|
|
4
|
+
|
|
5
|
+
Class from `@bitforgehq/ui/testing` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Harness for `bf-pagination`. It reads the current page and the page count as numbers, so a test
|
|
8
|
+
never parses the "Page 3 of 12" text, and clicks the buttons as a user would.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { BfPaginationHarness } from '@bitforgehq/ui/testing';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
class BfPaginationHarness extends ComponentHarness
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Methods
|
|
21
|
+
|
|
22
|
+
### `getLabel(): Promise<string>`
|
|
23
|
+
|
|
24
|
+
The navigation's accessible name (`label`, else "Pagination").
|
|
25
|
+
|
|
26
|
+
### `getCurrentPage(): Promise<number>`
|
|
27
|
+
|
|
28
|
+
The page shown as current, 1-based.
|
|
29
|
+
|
|
30
|
+
### `getPageCount(): Promise<number>`
|
|
31
|
+
|
|
32
|
+
The number of pages in effect (`pageCount`, else `total` over `pageSize`, at least 1).
|
|
33
|
+
|
|
34
|
+
### `getVisiblePages(): Promise<number[]>`
|
|
35
|
+
|
|
36
|
+
The page numbers the row shows right now, in order, without the gaps; empty when compact.
|
|
37
|
+
|
|
38
|
+
### `goTo(page: number): Promise<void>`
|
|
39
|
+
|
|
40
|
+
Clicks the button of this page, as a user would. Throws when the row does not show it (behind
|
|
41
|
+
a gap, or in a compact pagination).
|
|
42
|
+
|
|
43
|
+
| Parameter | Type | Description |
|
|
44
|
+
| --------- | -------- | -------------------------- |
|
|
45
|
+
| `page` | `number` | The 1-based page to go to. |
|
|
46
|
+
|
|
47
|
+
### `next(): Promise<void>`
|
|
48
|
+
|
|
49
|
+
Clicks Next. Throws on the last page, where the button is disabled.
|
|
50
|
+
|
|
51
|
+
### `previous(): Promise<void>`
|
|
52
|
+
|
|
53
|
+
Clicks Previous. Throws on the first page, where the button is disabled.
|
|
54
|
+
|
|
55
|
+
### `isPreviousDisabled(): Promise<boolean>`
|
|
56
|
+
|
|
57
|
+
Whether Previous is disabled (on the first page).
|
|
58
|
+
|
|
59
|
+
### `isNextDisabled(): Promise<boolean>`
|
|
60
|
+
|
|
61
|
+
Whether Next is disabled (on the last page).
|
|
@@ -6,15 +6,17 @@ Service from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
|
6
6
|
|
|
7
7
|
Platform facts and the app theme: native or web, iOS or Android, the shell mode that follows
|
|
8
8
|
from it, and the user's theme choice (system, light, dark) reflected as the `dark` class on
|
|
9
|
-
`<html>`.
|
|
10
|
-
theme
|
|
9
|
+
`<html>`. The theme is `BfColorSchemeService` from `@bitforgehq/ui` (the Capacitor-free colour
|
|
10
|
+
scheme a desktop app uses through `provideBfColorScheme()`): `theme` and `dark` are its
|
|
11
|
+
`scheme` and `dark` signals, and `matchMedia('(prefers-color-scheme: dark)')` is the single
|
|
12
|
+
source for the system theme on every platform.
|
|
11
13
|
|
|
12
14
|
The `theme`/`dark` signals always compute, but the `<html>` class and storage writes
|
|
13
|
-
only run when `provideBfShell()` provided `BF_SHELL_CONFIG`
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
only run when `provideBfShell()` provided `BF_SHELL_CONFIG` (or the app provided
|
|
16
|
+
`provideBfColorScheme()`) — i.e. this service is the app's own shell, not merely injected by
|
|
17
|
+
something that wants `platform`/`mode`. Without it (e.g. a docs demo that instantiates
|
|
18
|
+
`BfPlatformService` directly to preview `bf-tabs`), this service would otherwise fight the host
|
|
19
|
+
page's own theme, overwriting `<html class="dark">` with whatever `prefers-color-scheme` says.
|
|
18
20
|
|
|
19
21
|
With `provideBfShell()` on a native platform it also makes the viewport meta forbid zoom
|
|
20
22
|
(`maximum-scale=1, user-scalable=no`, other directives kept; the meta is created if missing):
|
|
@@ -34,19 +36,19 @@ import { BfPlatformService } from '@bitforgehq/ui/mobile';
|
|
|
34
36
|
|
|
35
37
|
## Properties
|
|
36
38
|
|
|
37
|
-
| Name | Type | Default | Description
|
|
38
|
-
| ---------- | -------------------------------------------- | ------- |
|
|
39
|
-
| `isNative` | `boolean` | | True inside the native iOS or Android app, false in a browser.
|
|
40
|
-
| `platform` | `BfPlatform` (`'ios' \| 'android' \| 'web'`) | | The platform the app runs on.
|
|
41
|
-
| `mode` | `Signal<BfShellMode>` | | The platform's shell mode: `ios` on iOS, else `md`; `resolveShellMode()` applies the config.
|
|
42
|
-
| `theme` | `WritableSignal<
|
|
43
|
-
| `dark` | `Signal<boolean>` | | Whether the app is dark now: the theme choice, or the system's under `system`.
|
|
39
|
+
| Name | Type | Default | Description |
|
|
40
|
+
| ---------- | -------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
41
|
+
| `isNative` | `boolean` | | True inside the native iOS or Android app, false in a browser. |
|
|
42
|
+
| `platform` | `BfPlatform` (`'ios' \| 'android' \| 'web'`) | | The platform the app runs on. |
|
|
43
|
+
| `mode` | `Signal<BfShellMode>` | | The platform's shell mode: `ios` on iOS, else `md`; `resolveShellMode()` applies the config. |
|
|
44
|
+
| `theme` | `WritableSignal<BfColorScheme>` | | The user's theme choice, stored in `BF_THEME_STORAGE` (`localStorage`); set it with `theme.set(…)`. The same signal as `BfColorSchemeService.scheme`. |
|
|
45
|
+
| `dark` | `Signal<boolean>` | | Whether the app is dark now: the theme choice, or the system's under `system`. The same signal as `BfColorSchemeService.dark`. |
|
|
44
46
|
|
|
45
47
|
## Uses
|
|
46
48
|
|
|
49
|
+
- [BfColorScheme](bf-color-scheme.md)
|
|
47
50
|
- [BfPlatform](bf-platform.md)
|
|
48
51
|
- [BfShellMode](bf-shell-mode.md)
|
|
49
|
-
- [BfTheme](bf-theme.md)
|
|
50
52
|
|
|
51
53
|
## Used by
|
|
52
54
|
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# BfPopoverHarness
|
|
2
|
+
|
|
3
|
+
Test harness for a popover: opens and closes it and reads its panel
|
|
4
|
+
|
|
5
|
+
Class from `@bitforgehq/ui/testing` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Harness for an element with a `[bfPopoverTriggerFor]` and the `bf-popover` it opens, which
|
|
8
|
+
renders in the CDK overlay container while open (found through the trigger's
|
|
9
|
+
`aria-controls`). Its `label` filter matches the trigger's accessible name (`aria-label`, else
|
|
10
|
+
its text).
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { BfPopoverHarness } from '@bitforgehq/ui/testing';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Signature
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
class BfPopoverHarness extends ComponentHarness
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Methods
|
|
23
|
+
|
|
24
|
+
### `getLabel(): Promise<string>`
|
|
25
|
+
|
|
26
|
+
The trigger's accessible name: its control's `aria-label`, else its text.
|
|
27
|
+
|
|
28
|
+
### `open(): Promise<void>`
|
|
29
|
+
|
|
30
|
+
Opens the popover with a click; does nothing while it is open.
|
|
31
|
+
|
|
32
|
+
### `close(): Promise<void>`
|
|
33
|
+
|
|
34
|
+
Closes the popover with `Escape`, as a user would; does nothing while it is closed.
|
|
35
|
+
|
|
36
|
+
### `isOpen(): Promise<boolean>`
|
|
37
|
+
|
|
38
|
+
Whether the popover is open (`aria-expanded`).
|
|
39
|
+
|
|
40
|
+
### `getPanelText(): Promise<string>`
|
|
41
|
+
|
|
42
|
+
The open panel's text, opening it first when it is closed.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# BfPopoverPlacement
|
|
2
|
+
|
|
3
|
+
Where a popover opens against its trigger, above or below, at either end
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Where a popover opens against its trigger; `start`/`end` follow the text direction.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfPopoverPlacement } from '@bitforgehq/ui/overlay';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type BfPopoverPlacement = 'below-start' | 'below-end' | 'above-start' | 'above-end'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Values
|
|
20
|
+
|
|
21
|
+
- `below-start`
|
|
22
|
+
- `below-end`
|
|
23
|
+
- `above-start`
|
|
24
|
+
- `above-end`
|
|
25
|
+
|
|
26
|
+
## Used by
|
|
27
|
+
|
|
28
|
+
- [BfPopoverTriggerDirective](bf-popover-trigger-directive.md)
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# BfPopoverTriggerDirective
|
|
2
|
+
|
|
3
|
+
Opens an anchored, non-modal popover panel from any element or button
|
|
4
|
+
|
|
5
|
+
Directive from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Opens an `ng-template` (usually a `bf-popover`) as a non-modal panel anchored to the element:
|
|
8
|
+
a click (`Enter` or `Space` on a button) toggles it, focus moves to its first control, `Tab`
|
|
9
|
+
moves through it and on out (closing it, past the trigger), and `Escape`, a click outside or a
|
|
10
|
+
navigation to another URL path close it, returning focus to the trigger. The control it
|
|
11
|
+
decorates (the host, or the first control inside it, such as a `bf-button`'s button) carries
|
|
12
|
+
`aria-haspopup="dialog"`, `aria-expanded` and, while open, `aria-controls`. Export it as
|
|
13
|
+
`bfPopoverTrigger` to open and close it from code or from inside the panel.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { BfPopoverTriggerDirective } from '@bitforgehq/ui/overlay';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Selector: `[bfPopoverTriggerFor]`
|
|
20
|
+
|
|
21
|
+
## Inputs
|
|
22
|
+
|
|
23
|
+
| Name | Type | Default | Description |
|
|
24
|
+
| --------------------- | ------------------------------------------------------------------------------------- | --------------- | ---------------------------------------------------------------------------------- |
|
|
25
|
+
| `bfPopoverTriggerFor` | `TemplateRef<unknown>` | required | The `ng-template` holding the panel (a `bf-popover`) this element opens. |
|
|
26
|
+
| `bfPopoverPlacement` | `BfPopoverPlacement` (`'below-start' \| 'below-end' \| 'above-start' \| 'above-end'`) | `'below-start'` | Where the panel opens (flipping when it would overflow), read each time it opens. |
|
|
27
|
+
| `bfPopoverLabel` | `string` | `''` | Accessible name of the panel. Empty: its first heading names it, else the trigger. |
|
|
28
|
+
|
|
29
|
+
## Outputs
|
|
30
|
+
|
|
31
|
+
| Name | Payload | Description |
|
|
32
|
+
| ----------------- | ------- | ----------------------------------------------------------------------------------------- |
|
|
33
|
+
| `bfPopoverOpened` | `void` | Emits when the panel opens. |
|
|
34
|
+
| `bfPopoverClosed` | `void` | Emits when the panel closes (`Escape`, a click outside, `Tab` out, a navigation or code). |
|
|
35
|
+
|
|
36
|
+
## Methods
|
|
37
|
+
|
|
38
|
+
### `open(): void`
|
|
39
|
+
|
|
40
|
+
Opens the panel and moves focus into it; does nothing while it is open.
|
|
41
|
+
|
|
42
|
+
### `close(restoreFocus?: boolean): void`
|
|
43
|
+
|
|
44
|
+
Closes the panel; does nothing while it is closed.
|
|
45
|
+
|
|
46
|
+
| Parameter | Type | Description |
|
|
47
|
+
| --------------- | --------- | ----------------------------------------------- |
|
|
48
|
+
| `restoreFocus?` | `boolean` | Moves focus back to the trigger (default true). |
|
|
49
|
+
|
|
50
|
+
### `toggle(): void`
|
|
51
|
+
|
|
52
|
+
Opens the panel when it is closed, closes it when it is open.
|
|
53
|
+
|
|
54
|
+
## Uses
|
|
55
|
+
|
|
56
|
+
- [BfPopoverPlacement](bf-popover-placement.md)
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# BfSidePanelConfig
|
|
2
|
+
|
|
3
|
+
Options of a side panel: its data, width, modality, name and injector
|
|
4
|
+
|
|
5
|
+
Interface from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Options of `BfSidePanelService.open()`.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfSidePanelConfig } from '@bitforgehq/ui/overlay';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
interface BfSidePanelConfig<D = unknown>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
| Name | Type | Default | Description |
|
|
22
|
+
| ----------- | ------------------------------------------- | ------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
23
|
+
| `data` | `D` | | Injected into the content as `BF_SIDE_PANEL_DATA` (and a template's `data`). |
|
|
24
|
+
| `width` | `BfSidePanelWidth` (`'sm' \| 'md' \| 'lg'`) | `'md'` | Width of the `bf-side-panel` in the content (default `md`, 480 px), capped at the viewport. |
|
|
25
|
+
| `modal` | `boolean` | `true` | A modal panel (default true) has a scrim, traps focus and makes the page behind it inert; `false` keeps the page usable beside it. |
|
|
26
|
+
| `ariaLabel` | `string` | | Accessible name, when the content renders no `bf-side-panel` title and no heading. |
|
|
27
|
+
| `injector` | `Injector` | | Parent of the content's injector and source of its labels (default the root injector). Pass the opener's `inject(Injector)` so a feature-level `provideBfLabels()` reaches the panel. |
|
|
28
|
+
|
|
29
|
+
## Uses
|
|
30
|
+
|
|
31
|
+
- [BfSidePanelWidth](bf-side-panel-width.md)
|
|
32
|
+
|
|
33
|
+
## Used by
|
|
34
|
+
|
|
35
|
+
- [BfSidePanelService](bf-side-panel-service.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# BfSidePanelHarness
|
|
2
|
+
|
|
3
|
+
Test harness for a side panel: its title, its close button and its state
|
|
4
|
+
|
|
5
|
+
Class from `@bitforgehq/ui/testing` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Harness for `bf-side-panel`, the panel `BfSidePanelService` opens. Side panels render in the
|
|
8
|
+
CDK overlay container outside the tested component, so get it through
|
|
9
|
+
`TestbedHarnessEnvironment.documentRootLoader(fixture)`.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { BfSidePanelHarness } from '@bitforgehq/ui/testing';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
class BfSidePanelHarness extends ComponentHarness
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Methods
|
|
22
|
+
|
|
23
|
+
### `getTitle(): Promise<string>`
|
|
24
|
+
|
|
25
|
+
The title heading.
|
|
26
|
+
|
|
27
|
+
### `close(): Promise<void>`
|
|
28
|
+
|
|
29
|
+
Clicks the close button (×), which closes the side panel with no result.
|
|
30
|
+
|
|
31
|
+
### `isOpen(): Promise<boolean>`
|
|
32
|
+
|
|
33
|
+
Whether the side panel is open: its overlay pane is in the page and not sliding out. The pane
|
|
34
|
+
is found by the panel's own `data-bf-side-panel-id`.
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# BfSidePanelRef
|
|
2
|
+
|
|
3
|
+
Handle on an open side panel that closes it and resolves with its result
|
|
4
|
+
|
|
5
|
+
Class from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Handle to an open side panel, returned by `BfSidePanelService.open()` and injectable in the
|
|
8
|
+
panel's content (`inject(BfSidePanelRef)`). `close(result)` slides the panel out, detaches it
|
|
9
|
+
and resolves `afterClosed` with `result`; later calls are ignored. Closing with `Escape`, the
|
|
10
|
+
backdrop, the `bf-side-panel` close button or a navigation resolves `undefined`.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { BfSidePanelRef } from '@bitforgehq/ui/overlay';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Signature
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
class BfSidePanelRef<R = unknown, C = unknown>
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Properties
|
|
23
|
+
|
|
24
|
+
| Name | Type | Default | Description |
|
|
25
|
+
| ------------------- | ------------------------- | ------- | ---------------------------------------------------------------------------------------- |
|
|
26
|
+
| `id` | `string` | | Unique id of the side panel (its overlay's `bf-overlay-N`). |
|
|
27
|
+
| `afterClosed` | `Promise<R \| undefined>` | | Resolves with the result given to `close()`, or `undefined`, once the panel is detached. |
|
|
28
|
+
| `closed` | `Signal<boolean>` | | True once the panel has been detached. |
|
|
29
|
+
| `componentInstance` | `C \| null` | | The content component; `null` for a panel opened from a template. |
|
|
30
|
+
|
|
31
|
+
## Methods
|
|
32
|
+
|
|
33
|
+
### `close(result?: R): void`
|
|
34
|
+
|
|
35
|
+
Closes the panel with an optional result; ignored once closing.
|
|
36
|
+
|
|
37
|
+
| Parameter | Type | Description |
|
|
38
|
+
| --------- | ---- | -------------------------------------- |
|
|
39
|
+
| `result?` | `R` | The value `afterClosed` resolves with. |
|
|
40
|
+
|
|
41
|
+
## Used by
|
|
42
|
+
|
|
43
|
+
- [BfSidePanelService](bf-side-panel-service.md)
|
|
44
|
+
- [BfSidePanelTemplateContext](bf-side-panel-template-context.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# BfSidePanelService
|
|
2
|
+
|
|
3
|
+
Opens a full-height panel from the end edge, modal or beside the page
|
|
4
|
+
|
|
5
|
+
Service from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Opens side panels on the overlay core: a component or template in a full-height pane that
|
|
8
|
+
slides in from the inline end edge (the right, the left under `dir="rtl"`; a cross-fade under
|
|
9
|
+
reduced motion), labelled by its `bf-side-panel` title, with focus moved in, `Escape` closing
|
|
10
|
+
it and focus returned to the opener. A modal panel (the default) adds a scrim that closes it on
|
|
11
|
+
a click, traps focus, locks document scroll and makes the page behind it `inert`, as a dialog
|
|
12
|
+
does; `modal: false` keeps the page usable and scrollable beside it, and `Escape` closes it
|
|
13
|
+
only while focus is inside it. A navigation to another URL path closes it. Desktop only.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { BfSidePanelService } from '@bitforgehq/ui/overlay';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Methods
|
|
20
|
+
|
|
21
|
+
### `open<C, D = unknown, R = unknown>(component: Type<C>, config?: BfSidePanelConfig<D>): BfSidePanelRef<R, C>`
|
|
22
|
+
|
|
23
|
+
Opens `component` as a side panel; it injects `BfSidePanelRef` and `BF_SIDE_PANEL_DATA`.
|
|
24
|
+
|
|
25
|
+
| Parameter | Type | Description |
|
|
26
|
+
| ----------- | ---------------------- | ------------------------------------------------------------------------------ |
|
|
27
|
+
| `component` | `Type<C>` | The component to render; it injects `BfSidePanelRef` and `BF_SIDE_PANEL_DATA`. |
|
|
28
|
+
| `config?` | `BfSidePanelConfig<D>` | The panel's data, width, modality, name and injector. |
|
|
29
|
+
|
|
30
|
+
### `open<D = unknown, R = unknown>(template: TemplateRef<BfSidePanelTemplateContext<D, R>>, config?: BfSidePanelConfig<D>): BfSidePanelRef<R>`
|
|
31
|
+
|
|
32
|
+
Opens `template` as a side panel; its context is `{ $implicit: ref, data }`.
|
|
33
|
+
|
|
34
|
+
| Parameter | Type | Description |
|
|
35
|
+
| ---------- | ----------------------------------------------- | -------------------------------------------------------------------- |
|
|
36
|
+
| `template` | `TemplateRef<BfSidePanelTemplateContext<D, R>>` | The template to render, with the context `{ $implicit: ref, data }`. |
|
|
37
|
+
| `config?` | `BfSidePanelConfig<D>` | The panel's data, width, modality, name and injector. |
|
|
38
|
+
|
|
39
|
+
## Uses
|
|
40
|
+
|
|
41
|
+
- [BfSidePanelConfig](bf-side-panel-config.md)
|
|
42
|
+
- [BfSidePanelRef](bf-side-panel-ref.md)
|
|
43
|
+
- [BfSidePanelTemplateContext](bf-side-panel-template-context.md)
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# BfSidePanelTemplateContext
|
|
2
|
+
|
|
3
|
+
The context a template opened as a side panel receives: its ref and its data
|
|
4
|
+
|
|
5
|
+
Interface from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Context of a template opened with `BfSidePanelService.open()`: `let-ref` and `let-data="data"`.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfSidePanelTemplateContext } from '@bitforgehq/ui/overlay';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
interface BfSidePanelTemplateContext<D = unknown, R = unknown>
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
| Name | Type | Default | Description |
|
|
22
|
+
| ----------- | ------------------- | -------- | --------------------------------------------------------- |
|
|
23
|
+
| `$implicit` | `BfSidePanelRef<R>` | required | The panel's ref (`let-ref`), to close it with a result. |
|
|
24
|
+
| `data` | `D` | required | The `data` the panel was opened with (`let-data="data"`). |
|
|
25
|
+
|
|
26
|
+
## Uses
|
|
27
|
+
|
|
28
|
+
- [BfSidePanelRef](bf-side-panel-ref.md)
|
|
29
|
+
|
|
30
|
+
## Used by
|
|
31
|
+
|
|
32
|
+
- [BfSidePanelService](bf-side-panel-service.md)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# BfSidePanelWidth
|
|
2
|
+
|
|
3
|
+
The side panel widths, from a 360 px detail list to a 640 px form
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
The side panel's width scale: `sm` 360 px, `md` 480 px, `lg` 640 px (22.5, 30 and 40 rem), each
|
|
8
|
+
never wider than the viewport.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { type BfSidePanelWidth } from '@bitforgehq/ui/overlay';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
type BfSidePanelWidth = 'sm' | 'md' | 'lg'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Values
|
|
21
|
+
|
|
22
|
+
- `sm`
|
|
23
|
+
- `md`
|
|
24
|
+
- `lg`
|
|
25
|
+
|
|
26
|
+
## Used by
|
|
27
|
+
|
|
28
|
+
- [BfSidePanelConfig](bf-side-panel-config.md)
|
package/ai/reference/bf-size.md
CHANGED
|
@@ -26,8 +26,12 @@ type BfSize = 'sm' | 'md' | 'lg'
|
|
|
26
26
|
|
|
27
27
|
- [bf-button](../components/button.md)
|
|
28
28
|
- [BfButtonSize](bf-button-size.md)
|
|
29
|
+
- [bf-calendar](../components/calendar.md)
|
|
29
30
|
- [bf-checkbox](../components/checkbox.md)
|
|
30
31
|
- [bf-chip](../components/chip.md)
|
|
32
|
+
- [bf-combobox](../components/combobox.md)
|
|
33
|
+
- [bf-date-input](../components/date-input.md)
|
|
34
|
+
- [bf-datetime-input](../components/datetime-input.md)
|
|
31
35
|
- [BfDefaults](bf-defaults.md)
|
|
32
36
|
- [BfDefaultsOptions](bf-defaults-options.md)
|
|
33
37
|
- [BfFieldControlState](bf-field-control-state.md)
|
|
@@ -36,10 +40,18 @@ type BfSize = 'sm' | 'md' | 'lg'
|
|
|
36
40
|
- [bf-input](../components/input.md)
|
|
37
41
|
- [bf-menu-button](../components/menu-button.md)
|
|
38
42
|
- [bf-menu](../components/menu.md)
|
|
43
|
+
- [bf-multi-combobox](../components/multi-combobox.md)
|
|
44
|
+
- [a[bfNavItem]](../components/nav-item.md)
|
|
39
45
|
- [bf-number-input](../components/number-input.md)
|
|
46
|
+
- [bf-pagination](../components/pagination.md)
|
|
40
47
|
- [bf-radio-group](../components/radio-group.md)
|
|
41
48
|
- [bf-segmented](../components/segmented.md)
|
|
42
49
|
- [BfSegmentedSize](bf-segmented-size.md)
|
|
43
50
|
- [bf-select](../components/select.md)
|
|
51
|
+
- [bf-tab-group](../components/tab-group.md)
|
|
52
|
+
- [bf-table](../components/table.md)
|
|
44
53
|
- [bf-textarea](../components/textarea.md)
|
|
54
|
+
- [bf-theme-menu-button](../components/theme-menu-button.md)
|
|
55
|
+
- [bf-theme-switch](../components/theme-switch.md)
|
|
56
|
+
- [bf-time-input](../components/time-input.md)
|
|
45
57
|
- [bf-toggle](../components/toggle.md)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# BfSkeletonShape
|
|
2
|
+
|
|
3
|
+
The three skeleton shapes, text lines, a rectangle or a circle
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
The shape of a `bf-skeleton`: text lines, a rectangle (an image, a chart, a field) or a circle
|
|
8
|
+
(an avatar).
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { type BfSkeletonShape } from '@bitforgehq/ui';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
type BfSkeletonShape = 'text' | 'rect' | 'circle'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Values
|
|
21
|
+
|
|
22
|
+
- `text`
|
|
23
|
+
- `rect`
|
|
24
|
+
- `circle`
|
|
25
|
+
|
|
26
|
+
## Used by
|
|
27
|
+
|
|
28
|
+
- [bf-skeleton](../components/skeleton.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# BfStatTrendIntent
|
|
2
|
+
|
|
3
|
+
Whether a rising or a falling figure is the good news for a stat
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Which direction of a `bf-stat` delta is good: positive (up is good, such as revenue) or
|
|
8
|
+
negative (down is good, such as costs or churn).
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { type BfStatTrendIntent } from '@bitforgehq/ui';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
type BfStatTrendIntent = 'positive' | 'negative'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Values
|
|
21
|
+
|
|
22
|
+
- `positive`
|
|
23
|
+
- `negative`
|
|
24
|
+
|
|
25
|
+
## Used by
|
|
26
|
+
|
|
27
|
+
- [bf-stat](../components/stat.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# BfStatTrend
|
|
2
|
+
|
|
3
|
+
The three directions of a stat's delta pill, up, down or no change
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
The direction of a `bf-stat` delta: up, down or flat (no change).
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfStatTrend } from '@bitforgehq/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type BfStatTrend = 'up' | 'down' | 'flat'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Values
|
|
20
|
+
|
|
21
|
+
- `up`
|
|
22
|
+
- `down`
|
|
23
|
+
- `flat`
|
|
24
|
+
|
|
25
|
+
## Used by
|
|
26
|
+
|
|
27
|
+
- [bf-stat](../components/stat.md)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# BfStatVariant
|
|
2
|
+
|
|
3
|
+
The two stat surfaces, plain on its container or an outlined card tile
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
The surface of a `bf-stat`: plain (on whatever holds it) or card (its own outlined tile).
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfStatVariant } from '@bitforgehq/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type BfStatVariant = 'plain' | 'card'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Values
|
|
20
|
+
|
|
21
|
+
- `plain`
|
|
22
|
+
- `card`
|
|
23
|
+
|
|
24
|
+
## Used by
|
|
25
|
+
|
|
26
|
+
- [bf-stat](../components/stat.md)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
# BfTabGroupHarness
|
|
2
|
+
|
|
3
|
+
Test harness for the tab group: reads its tabs and panel and selects a tab
|
|
4
|
+
|
|
5
|
+
Class from `@bitforgehq/ui/testing` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Harness for `bf-tab-group`. It works by tab label, so a test never needs the panel values.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { BfTabGroupHarness } from '@bitforgehq/ui/testing';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
class BfTabGroupHarness extends ComponentHarness
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Methods
|
|
20
|
+
|
|
21
|
+
### `getLabel(): Promise<string>`
|
|
22
|
+
|
|
23
|
+
The tablist's accessible name (`label`, else the `tabGroup` label).
|
|
24
|
+
|
|
25
|
+
### `getTabLabels(): Promise<string[]>`
|
|
26
|
+
|
|
27
|
+
The tabs' labels, in order (without their badges).
|
|
28
|
+
|
|
29
|
+
### `getSelectedLabel(): Promise<string | null>`
|
|
30
|
+
|
|
31
|
+
The selected tab's label, `null` when the group has no tabs.
|
|
32
|
+
|
|
33
|
+
### `selectTab(label: string): Promise<void>`
|
|
34
|
+
|
|
35
|
+
Clicks the tab with this label, as a user would. Throws for an unknown label, and for a
|
|
36
|
+
disabled tab (a user's click would do nothing).
|
|
37
|
+
|
|
38
|
+
| Parameter | Type | Description |
|
|
39
|
+
| --------- | -------- | ---------------- |
|
|
40
|
+
| `label` | `string` | The tab's label. |
|
|
41
|
+
|
|
42
|
+
### `getPanelText(): Promise<string>`
|
|
43
|
+
|
|
44
|
+
The text of the panel shown.
|