@bitforgehq/ui 0.3.0 → 0.3.2
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 +598 -0
- package/README.md +18 -11
- package/ai/MANIFEST.index.json +306 -0
- package/ai/MANIFEST.json +8915 -3788
- package/ai/REFERENCE.index.json +476 -0
- package/ai/REFERENCE.json +5810 -2905
- package/ai/UI_GUIDE.md +212 -58
- package/ai/components/app-frame.md +328 -0
- 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 +119 -4
- 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/empty-state.md +99 -6
- package/ai/components/header.md +71 -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-toggle.md +287 -0
- package/ai/components/sidebar.md +541 -0
- package/ai/components/skeleton.md +215 -0
- package/ai/components/sparkline.md +188 -0
- package/ai/components/stat.md +297 -0
- package/ai/components/tab-group.md +226 -0
- package/ai/components/tab-panel.md +163 -0
- package/ai/components/table.md +697 -0
- package/ai/components/tabs.md +46 -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 +354 -0
- package/ai/components/tooltip.md +230 -0
- package/ai/components/top-nav.md +159 -0
- package/ai/reference/bf-app-frame-breakpoint.md +27 -0
- package/ai/reference/bf-app-frame-content-width.md +29 -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-empty-state-heading-level.md +1 -1
- package/ai/reference/bf-empty-state-heading.md +33 -0
- package/ai/reference/bf-labels.md +73 -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-sidebar-state-service.md +21 -0
- package/ai/reference/bf-sidebar-toggle-harness.md +32 -0
- package/ai/reference/bf-size.md +13 -0
- package/ai/reference/bf-skeleton-shape.md +28 -0
- package/ai/reference/bf-stat-appearance.md +33 -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-table-stack.md +29 -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_sidebar_state_storage.md +20 -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 +13 -4
- package/ai/reference/provide-bf-sidebar-state.md +20 -0
- package/ai/reference/slide-in-from-end.md +24 -0
- package/ai/reference/slide-out-to-end.md +24 -0
- package/bin/bf-ui.js +433 -3
- 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 +6566 -38
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +634 -1
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +5708 -137
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +26766 -14470
- package/llms.txt +106 -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 +1895 -7
- package/types/bitforgehq-ui-testing.d.ts +782 -1
- package/types/bitforgehq-ui.d.ts +2393 -45
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
# BfTableHarness
|
|
2
|
+
|
|
3
|
+
Test harness for the data table: reads rows and cells, sorts and selects rows
|
|
4
|
+
|
|
5
|
+
Class from `@bitforgehq/ui/testing` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Harness for `bf-table`. It works by column header text and row position, so a test never needs
|
|
8
|
+
the column keys or the row keys (except `getSort()`, which returns the column's `key`, as the
|
|
9
|
+
`sort` model holds it). It reads and drives a stacked table (`stack`) the same way.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { BfTableHarness } from '@bitforgehq/ui/testing';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
class BfTableHarness extends ComponentHarness
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Methods
|
|
22
|
+
|
|
23
|
+
### `getLabel(): Promise<string>`
|
|
24
|
+
|
|
25
|
+
The table's name, its visually hidden caption.
|
|
26
|
+
|
|
27
|
+
### `getRowCount(): Promise<number>`
|
|
28
|
+
|
|
29
|
+
The number of body rows; `0` while the empty slot shows.
|
|
30
|
+
|
|
31
|
+
### `getHeaderLabels(): Promise<string[]>`
|
|
32
|
+
|
|
33
|
+
The column headers' text, in order, without the selection column.
|
|
34
|
+
|
|
35
|
+
### `getCellText(row: number, column: string): Promise<string>`
|
|
36
|
+
|
|
37
|
+
The text of one cell.
|
|
38
|
+
|
|
39
|
+
| Parameter | Type | Description |
|
|
40
|
+
| --------- | -------- | --------------------------- |
|
|
41
|
+
| `row` | `number` | The row's position, from 0. |
|
|
42
|
+
| `column` | `string` | The column's header text. |
|
|
43
|
+
|
|
44
|
+
### `sortBy(column: string): Promise<void>`
|
|
45
|
+
|
|
46
|
+
Clicks a sortable column's header, as a user would: ascending first, then descending.
|
|
47
|
+
Throws for an unknown or unsortable column.
|
|
48
|
+
|
|
49
|
+
| Parameter | Type | Description |
|
|
50
|
+
| --------- | -------- | ------------------------- |
|
|
51
|
+
| `column` | `string` | The column's header text. |
|
|
52
|
+
|
|
53
|
+
### `getSort(): Promise<BfTableSort | null>`
|
|
54
|
+
|
|
55
|
+
The sorted column (its `key`) and direction, from `aria-sort`.
|
|
56
|
+
|
|
57
|
+
### `selectRow(index: number): Promise<void>`
|
|
58
|
+
|
|
59
|
+
Checks one row's checkbox, as a user would; a selected row stays selected. Throws when the
|
|
60
|
+
table is not selectable or the row does not exist.
|
|
61
|
+
|
|
62
|
+
| Parameter | Type | Description |
|
|
63
|
+
| --------- | -------- | --------------------------- |
|
|
64
|
+
| `index` | `number` | The row's position, from 0. |
|
|
65
|
+
|
|
66
|
+
### `selectAll(): Promise<void>`
|
|
67
|
+
|
|
68
|
+
Checks the header checkbox, as a user would, so every row is selected. Throws when the table
|
|
69
|
+
is not selectable.
|
|
70
|
+
|
|
71
|
+
### `getSelectedCount(): Promise<number>`
|
|
72
|
+
|
|
73
|
+
The number of selected rows (checked row checkboxes).
|
|
74
|
+
|
|
75
|
+
## Uses
|
|
76
|
+
|
|
77
|
+
- [BfTableSort](bf-table-sort.md)
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# BfTableRowKey
|
|
2
|
+
|
|
3
|
+
Function that returns the unique string key of one table row
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Returns the string that identifies a `bf-table` row in `selection` and in the `@for` track.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfTableRowKey } from '@bitforgehq/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type BfTableRowKey<T> = (row: T) => string
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Used by
|
|
20
|
+
|
|
21
|
+
- [bf-table](../components/table.md)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# BfTableSortDirection
|
|
2
|
+
|
|
3
|
+
The direction a sorted table column is in, ascending or descending
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
The direction of a sorted `bf-table` column, as `aria-sort` names it.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfTableSortDirection } from '@bitforgehq/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type BfTableSortDirection = 'ascending' | 'descending'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Values
|
|
20
|
+
|
|
21
|
+
- `ascending`
|
|
22
|
+
- `descending`
|
|
23
|
+
|
|
24
|
+
## Used by
|
|
25
|
+
|
|
26
|
+
- [BfTableSort](bf-table-sort.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# BfTableSort
|
|
2
|
+
|
|
3
|
+
The column key and direction a table is sorted by, set by its headers
|
|
4
|
+
|
|
5
|
+
Interface from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
The column a `bf-table` is sorted by and the direction; the consumer sorts the rows.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfTableSort } from '@bitforgehq/ui';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Properties
|
|
14
|
+
|
|
15
|
+
| Name | Type | Default | Description |
|
|
16
|
+
| ----------- | ------------------------------------------------------ | -------- | ------------------------------- |
|
|
17
|
+
| `column` | `string` | required | The `key` of the sorted column. |
|
|
18
|
+
| `direction` | `BfTableSortDirection` (`'ascending' \| 'descending'`) | required | The sort direction. |
|
|
19
|
+
|
|
20
|
+
## Uses
|
|
21
|
+
|
|
22
|
+
- [BfTableSortDirection](bf-table-sort-direction.md)
|
|
23
|
+
|
|
24
|
+
## Used by
|
|
25
|
+
|
|
26
|
+
- [bf-table](../components/table.md)
|
|
27
|
+
- [BfTableHarness](bf-table-harness.md)
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# BfTableStack
|
|
2
|
+
|
|
3
|
+
When a table stacks its rows into cards: never, when narrow, or under touch
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui` · since 0.3.2
|
|
6
|
+
|
|
7
|
+
When a `bf-table` renders each row as a card of label/value pairs: `never` (the default),
|
|
8
|
+
`narrow` while the table is narrower than 36rem (a container query), or `coarse` under a coarse
|
|
9
|
+
pointer at any width.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { type BfTableStack } from '@bitforgehq/ui';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
type BfTableStack = 'never' | 'narrow' | 'coarse'
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Values
|
|
22
|
+
|
|
23
|
+
- `never`
|
|
24
|
+
- `narrow`
|
|
25
|
+
- `coarse`
|
|
26
|
+
|
|
27
|
+
## Used by
|
|
28
|
+
|
|
29
|
+
- [bf-table](../components/table.md)
|
package/ai/reference/bf-theme.md
CHANGED
|
@@ -4,7 +4,8 @@ The app theme choice, following the system or forcing light or dark
|
|
|
4
4
|
|
|
5
5
|
Type from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
6
|
|
|
7
|
-
The app theme choice: follow the system, or force light or dark.
|
|
7
|
+
The app theme choice: follow the system, or force light or dark. The same type as
|
|
8
|
+
`BfColorScheme` from `@bitforgehq/ui`.
|
|
8
9
|
|
|
9
10
|
```ts
|
|
10
11
|
import { type BfTheme } from '@bitforgehq/ui/mobile';
|
|
@@ -13,7 +14,7 @@ import { type BfTheme } from '@bitforgehq/ui/mobile';
|
|
|
13
14
|
## Signature
|
|
14
15
|
|
|
15
16
|
```ts
|
|
16
|
-
type BfTheme =
|
|
17
|
+
type BfTheme = BfColorScheme
|
|
17
18
|
```
|
|
18
19
|
|
|
19
20
|
## Values
|
|
@@ -22,6 +23,6 @@ type BfTheme = 'system' | 'light' | 'dark'
|
|
|
22
23
|
- `light`
|
|
23
24
|
- `dark`
|
|
24
25
|
|
|
25
|
-
##
|
|
26
|
+
## Uses
|
|
26
27
|
|
|
27
|
-
- [
|
|
28
|
+
- [BfColorScheme](bf-color-scheme.md)
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# BfTimeInputHarness
|
|
2
|
+
|
|
3
|
+
Test harness for the time input: types a time or picks one from its list
|
|
4
|
+
|
|
5
|
+
Class from `@bitforgehq/ui/testing` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Harness for `bf-time-input`. It reads and types the field as a user sees it and picks a time
|
|
8
|
+
from the popover list.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { BfTimeInputHarness } from '@bitforgehq/ui/testing';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
class BfTimeInputHarness extends ComponentHarness
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Methods
|
|
21
|
+
|
|
22
|
+
### `getLabel(): Promise<string>`
|
|
23
|
+
|
|
24
|
+
The visible label without the required mark, else the field's `aria-label`.
|
|
25
|
+
|
|
26
|
+
### `getValue(): Promise<string>`
|
|
27
|
+
|
|
28
|
+
The field's text as the locale shows it ("14:30" or "02:30 PM"); the ISO value in native mode.
|
|
29
|
+
|
|
30
|
+
### `setValue(text: string): Promise<void>`
|
|
31
|
+
|
|
32
|
+
Types a time as a user would: clears the field, then types each run of digits (or letters)
|
|
33
|
+
into the next part in the field's order, such as "2:30 PM" in a 12-hour field. In native mode it sets the
|
|
34
|
+
platform input to the ISO value.
|
|
35
|
+
|
|
36
|
+
| Parameter | Type | Description |
|
|
37
|
+
| --------- | -------- | ------------------------------- |
|
|
38
|
+
| `text` | `string` | The time as the field shows it. |
|
|
39
|
+
|
|
40
|
+
### `clear(): Promise<void>`
|
|
41
|
+
|
|
42
|
+
Clears every part with `Backspace`, as a user would.
|
|
43
|
+
|
|
44
|
+
### `isInvalid(): Promise<boolean>`
|
|
45
|
+
|
|
46
|
+
Whether the field shows its error state (`aria-invalid` on its parts or native input).
|
|
47
|
+
|
|
48
|
+
### `isDisabled(): Promise<boolean>`
|
|
49
|
+
|
|
50
|
+
Whether the field is disabled.
|
|
51
|
+
|
|
52
|
+
### `openPicker(): Promise<void>`
|
|
53
|
+
|
|
54
|
+
Opens the list of times with a click on its button; throws when the field has none or it is disabled.
|
|
55
|
+
|
|
56
|
+
### `isPickerOpen(): Promise<boolean>`
|
|
57
|
+
|
|
58
|
+
Whether the list of times is open (`aria-expanded` on its button).
|
|
59
|
+
|
|
60
|
+
### `pickTime(time: string): Promise<void>`
|
|
61
|
+
|
|
62
|
+
Picks a time in the list as a user would: opens the list (when closed), then clicks the
|
|
63
|
+
time, which closes it. Throws for a time the list does not hold (off the `step`) or disables.
|
|
64
|
+
|
|
65
|
+
| Parameter | Type | Description |
|
|
66
|
+
| --------- | -------- | -------------------------------------- |
|
|
67
|
+
| `time` | `string` | The ISO time to pick, such as '14:30'. |
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# BfTimeInputHourCycle
|
|
2
|
+
|
|
3
|
+
A twelve-hour clock with AM and PM, or a twenty-four-hour clock
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
The clock of a time field: `h12` counts 1–12 with an AM/PM part, `h23` counts 0–23.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfTimeInputHourCycle } from '@bitforgehq/ui/overlay';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type BfTimeInputHourCycle = 'h12' | 'h23'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Values
|
|
20
|
+
|
|
21
|
+
- `h12`
|
|
22
|
+
- `h23`
|
|
23
|
+
|
|
24
|
+
## Used by
|
|
25
|
+
|
|
26
|
+
- [bf-datetime-input](../components/datetime-input.md)
|
|
27
|
+
- [bf-time-input](../components/time-input.md)
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
# BfTimeInputPicker
|
|
2
|
+
|
|
3
|
+
Whether a time input offers a popover list of times besides typing
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
How `bf-time-input` picks a time besides typing: `list` adds a button that opens a list of
|
|
8
|
+
times every `step` minutes, `none` keeps the field typed only.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { type BfTimeInputPicker } from '@bitforgehq/ui/overlay';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
type BfTimeInputPicker = 'list' | 'none'
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Values
|
|
21
|
+
|
|
22
|
+
- `list`
|
|
23
|
+
- `none`
|
|
24
|
+
|
|
25
|
+
## Used by
|
|
26
|
+
|
|
27
|
+
- [bf-time-input](../components/time-input.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# BfTooltipDirective
|
|
2
|
+
|
|
3
|
+
Adds a hover and keyboard-focus tooltip to any control on desktop
|
|
4
|
+
|
|
5
|
+
Directive from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Shows a short `bf-tooltip` beside an element: after a 500 ms rest of a fine pointer, at once on
|
|
8
|
+
keyboard focus. It hides when the pointer leaves (it stays while the pointer moves onto the
|
|
9
|
+
tooltip itself), on blur and on `Escape`, and while it shows, the focusable element (the host,
|
|
10
|
+
or the first control inside it, so it works on a `bf-icon-button`) is described by it
|
|
11
|
+
(`aria-describedby`). Nothing shows under a coarse pointer (touch), so never put information
|
|
12
|
+
only in a tooltip. The tooltip flips to the opposite side when it would overflow the viewport.
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { BfTooltipDirective } from '@bitforgehq/ui/overlay';
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Selector: `[bfTooltip]`
|
|
19
|
+
|
|
20
|
+
## Inputs
|
|
21
|
+
|
|
22
|
+
| Name | Type | Default | Description |
|
|
23
|
+
| -------------------- | -------------------------------------------------------------- | -------- | -------------------------------------------------------------------------------- |
|
|
24
|
+
| `bfTooltip` | `string` | required | The tooltip's text; empty shows no tooltip. |
|
|
25
|
+
| `bfTooltipPlacement` | `BfTooltipPlacement` (`'top' \| 'bottom' \| 'start' \| 'end'`) | `'top'` | The side it shows on (flipping when it would overflow), read each time it shows. |
|
|
26
|
+
|
|
27
|
+
## Methods
|
|
28
|
+
|
|
29
|
+
### `isShown(): boolean`
|
|
30
|
+
|
|
31
|
+
Whether the tooltip is showing.
|
|
32
|
+
|
|
33
|
+
### `show(): void`
|
|
34
|
+
|
|
35
|
+
Shows the tooltip now (no delay). Does nothing under a coarse pointer or without text.
|
|
36
|
+
|
|
37
|
+
### `hide(): void`
|
|
38
|
+
|
|
39
|
+
Hides the tooltip now and cancels a pending show.
|
|
40
|
+
|
|
41
|
+
## Uses
|
|
42
|
+
|
|
43
|
+
- [BfTooltipPlacement](bf-tooltip-placement.md)
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# BfTooltipHarness
|
|
2
|
+
|
|
3
|
+
Test harness for a tooltip: shows it, reads its text and whether it shows
|
|
4
|
+
|
|
5
|
+
Class from `@bitforgehq/ui/testing` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Harness for an element with a `[bfTooltip]`. The tooltip renders in the CDK overlay container
|
|
8
|
+
only while it shows, so `show()` focuses the element (the tooltip shows at once on keyboard
|
|
9
|
+
focus; a 500 ms hover would need real time) and `getText()` reads the `bf-tooltip` its control
|
|
10
|
+
is described by. Its `label` filter matches the element's accessible name (`aria-label`, else
|
|
11
|
+
its text). Under a coarse pointer no tooltip shows.
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { BfTooltipHarness } from '@bitforgehq/ui/testing';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Signature
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
class BfTooltipHarness extends ComponentHarness
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## Methods
|
|
24
|
+
|
|
25
|
+
### `getLabel(): Promise<string>`
|
|
26
|
+
|
|
27
|
+
The element's accessible name: its control's `aria-label`, else its text.
|
|
28
|
+
|
|
29
|
+
### `show(): Promise<void>`
|
|
30
|
+
|
|
31
|
+
Shows the tooltip by focusing the element (or the first control inside it).
|
|
32
|
+
|
|
33
|
+
### `hide(): Promise<void>`
|
|
34
|
+
|
|
35
|
+
Hides the tooltip by moving focus off the element.
|
|
36
|
+
|
|
37
|
+
### `isOpen(): Promise<boolean>`
|
|
38
|
+
|
|
39
|
+
Whether the tooltip shows.
|
|
40
|
+
|
|
41
|
+
### `getText(): Promise<string>`
|
|
42
|
+
|
|
43
|
+
The tooltip's text, showing it first when it is hidden.
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# BfTooltipPlacement
|
|
2
|
+
|
|
3
|
+
Which side of its element a tooltip sits on: top, bottom, start or end
|
|
4
|
+
|
|
5
|
+
Type from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Which side of its element a tooltip sits on; `start` and `end` follow the text direction.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { type BfTooltipPlacement } from '@bitforgehq/ui/overlay';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
type BfTooltipPlacement = 'top' | 'bottom' | 'start' | 'end'
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Values
|
|
20
|
+
|
|
21
|
+
- `top`
|
|
22
|
+
- `bottom`
|
|
23
|
+
- `start`
|
|
24
|
+
- `end`
|
|
25
|
+
|
|
26
|
+
## Used by
|
|
27
|
+
|
|
28
|
+
- [BfTooltipDirective](bf-tooltip-directive.md)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# BF_COLOR_SCHEME_STORAGE
|
|
2
|
+
|
|
3
|
+
Injection token for the store that keeps the colour scheme choice between visits
|
|
4
|
+
|
|
5
|
+
Injection token from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Where `BfColorSchemeService` keeps the colour scheme choice (the key `bf-theme`): `localStorage`
|
|
8
|
+
when it is available, otherwise an in-memory map. Provide another store (a native preferences
|
|
9
|
+
plugin, or an in-memory one in tests) to keep the choice elsewhere. `BF_THEME_STORAGE` from
|
|
10
|
+
`@bitforgehq/ui/mobile` is this same token.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { BF_COLOR_SCHEME_STORAGE } from '@bitforgehq/ui';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Signature
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
const BF_COLOR_SCHEME_STORAGE: InjectionToken<Pick<Storage, "getItem" | "setItem">>
|
|
20
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# BF_SIDE_PANEL_DATA
|
|
2
|
+
|
|
3
|
+
Injection token carrying the data a side panel was opened with, for its content
|
|
4
|
+
|
|
5
|
+
Injection token from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
The `data` passed to `BfSidePanelService.open()`, injectable in the panel's content.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { BF_SIDE_PANEL_DATA } from '@bitforgehq/ui/overlay';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const BF_SIDE_PANEL_DATA: InjectionToken<unknown>
|
|
17
|
+
```
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# BF_SIDEBAR_STATE_STORAGE
|
|
2
|
+
|
|
3
|
+
Injection token for the store that keeps the collapsed sidebar between visits
|
|
4
|
+
|
|
5
|
+
Injection token from `@bitforgehq/ui` · since 0.3.2
|
|
6
|
+
|
|
7
|
+
Where `BfSidebarStateService` keeps whether the sidebar is collapsed (the key
|
|
8
|
+
`bf-sidebar-collapsed`, `'true'` or `'false'`): `localStorage` when it is available, otherwise
|
|
9
|
+
an in-memory map. Provide another store (`sessionStorage`, or an in-memory one in tests) to keep
|
|
10
|
+
it elsewhere.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { BF_SIDEBAR_STATE_STORAGE } from '@bitforgehq/ui';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Signature
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
const BF_SIDEBAR_STATE_STORAGE: InjectionToken<Pick<Storage, "getItem" | "setItem">>
|
|
20
|
+
```
|
|
@@ -6,7 +6,9 @@ Injection token from `@bitforgehq/ui/mobile` · since 0.3.0
|
|
|
6
6
|
|
|
7
7
|
Where `BfPlatformService` keeps the theme choice (the key `bf-theme`): `localStorage` when it is
|
|
8
8
|
available, otherwise an in-memory map. Provide another store (a native preferences plugin, or an
|
|
9
|
-
in-memory one in tests, as `provideBfShellTesting()` does) to keep the choice elsewhere.
|
|
9
|
+
in-memory one in tests, as `provideBfShellTesting()` does) to keep the choice elsewhere. It is
|
|
10
|
+
the same token as `BF_COLOR_SCHEME_STORAGE` from `@bitforgehq/ui`, which `BfColorSchemeService`
|
|
11
|
+
reads, so providing either one moves the choice for both.
|
|
10
12
|
|
|
11
13
|
```ts
|
|
12
14
|
import { BF_THEME_STORAGE } from '@bitforgehq/ui/mobile';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# provideBfColorScheme
|
|
2
|
+
|
|
3
|
+
Applies the stored colour scheme choice to html, for desktop web apps
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Lets `BfColorSchemeService` own the app's colour scheme: it toggles `dark` on `<html>`, follows
|
|
8
|
+
`prefers-color-scheme` under `system` and stores the choice (key `bf-theme`). For a desktop web
|
|
9
|
+
app; a Capacitor app gets it from `provideBfShell()`. Add it to `ApplicationConfig.providers`
|
|
10
|
+
and switch with `inject(BfColorSchemeService).scheme.set('dark')`.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { provideBfColorScheme } from '@bitforgehq/ui';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Signature
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
function provideBfColorScheme(): EnvironmentProviders
|
|
20
|
+
```
|
|
@@ -7,10 +7,19 @@ Function from `@bitforgehq/ui` · since 0.3.0
|
|
|
7
7
|
Replaces built-in strings, merged over the parent's (validation merged key by key); a key left
|
|
8
8
|
out or set to `undefined` keeps the parent's string. In `ApplicationConfig.providers` it covers
|
|
9
9
|
every string. In a component's `providers` it covers that sub-tree's widgets and form controls
|
|
10
|
-
(`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `
|
|
11
|
-
|
|
12
|
-
`
|
|
13
|
-
|
|
10
|
+
(`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `tableSelectAll`, `tableSortBy`,
|
|
11
|
+
`tableSortAscending`, `tableSortDescending`, `theme`, `themeSystem`, `themeLight`, `themeDark`,
|
|
12
|
+
`breadcrumb`, `breadcrumbExpand`, `navigation`, `navBadge`, `sidebarCollapse`, `sidebarExpand`,
|
|
13
|
+
`skipToContent`, `pagination`, `previousPage`, `nextPage`, `pageOf`, `goToPage`, `tabGroup`,
|
|
14
|
+
`calendarPreviousMonth`, `calendarNextMonth`, `calendarChooseMonth`, `calendarChooseYear`,
|
|
15
|
+
`statTrendUp`, `statTrendDown`, `statTrendFlat`, `comboboxEmpty`, `comboboxRemove`,
|
|
16
|
+
`dateInputDay`, `dateInputMonth`, `dateInputYear`, `dateInputOpenCalendar`, `dateInputInvalid`,
|
|
17
|
+
`dateInputUnavailable`, `timeInputHour`, `timeInputMinute`, `timeInputSecond`,
|
|
18
|
+
`timeInputDayPeriod`, `timeInputOpenList`, `timeInputInvalid`, `timeInputMin`, `timeInputMax`,
|
|
19
|
+
`chart`, `chartLegend`, `chartValues`, `chartShowData`, `chartHideData`, `chartCategory`,
|
|
20
|
+
`chartValue`, `chartEmpty`, `chartError`, `validation`); the overlay services (`ok`, `cancel`,
|
|
21
|
+
`actions`, `sheet`, `modal`, `close`, `expand`, `collapse`, `sheetPosition`, `dialog`,
|
|
22
|
+
`notifications`) are root singletons and pick it up only when the caller passes its injector:
|
|
14
23
|
`open(…, { injector: inject(Injector) })`.
|
|
15
24
|
|
|
16
25
|
```ts
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# provideBfSidebarState
|
|
2
|
+
|
|
3
|
+
Remembers the collapsed sidebar between visits, for desktop web apps
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui` · since 0.3.2
|
|
6
|
+
|
|
7
|
+
Lets `BfSidebarStateService` remember the collapsed sidebar: it stores every change of its
|
|
8
|
+
`collapsed` signal (key `bf-sidebar-collapsed`, `localStorage` in the browser), so the app opens
|
|
9
|
+
with the sidebar as the user left it. Add it to `ApplicationConfig.providers` and bind the
|
|
10
|
+
sidebar's `[(collapsed)]` to `sidebarState.collapsed`.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { provideBfSidebarState } from '@bitforgehq/ui';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Signature
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
function provideBfSidebarState(): EnvironmentProviders
|
|
20
|
+
```
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# slideInFromEnd
|
|
2
|
+
|
|
3
|
+
Slides an element in from the inline end, the enter animation of a side panel
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Slides `el` in from beyond the inline end edge of the viewport (the right, the left under
|
|
8
|
+
`dir="rtl"`) by its own width: the enter animation of a side panel.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { slideInFromEnd } from '@bitforgehq/ui/overlay';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
function slideInFromEnd(el: HTMLElement): Animation
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| --------- | ------------- | -------------------------------------------------- |
|
|
24
|
+
| `el` | `HTMLElement` | The element to animate, usually the overlay panel. |
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# slideOutToEnd
|
|
2
|
+
|
|
3
|
+
Slides an element out past the inline end, the exit animation of a side panel
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/overlay` · since 0.3.1
|
|
6
|
+
|
|
7
|
+
Slides `el` out past the inline end edge of the viewport by its own width (the reverse of
|
|
8
|
+
`slideInFromEnd`): the exit animation of a side panel.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { slideOutToEnd } from '@bitforgehq/ui/overlay';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
function slideOutToEnd(el: HTMLElement): Animation
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| --------- | ------------- | -------------------------------------------------- |
|
|
24
|
+
| `el` | `HTMLElement` | The element to animate, usually the overlay panel. |
|