@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.
Files changed (144) hide show
  1. package/CHANGELOG.md +482 -0
  2. package/README.md +17 -11
  3. package/ai/MANIFEST.index.json +288 -0
  4. package/ai/MANIFEST.json +8716 -3926
  5. package/ai/REFERENCE.index.json +413 -0
  6. package/ai/REFERENCE.json +4710 -2047
  7. package/ai/UI_GUIDE.md +185 -57
  8. package/ai/components/back-button.md +42 -2
  9. package/ai/components/badge.md +17 -7
  10. package/ai/components/bar-chart.md +188 -0
  11. package/ai/components/breadcrumb-item.md +121 -0
  12. package/ai/components/breadcrumb.md +277 -0
  13. package/ai/components/button.md +82 -15
  14. package/ai/components/calendar.md +300 -0
  15. package/ai/components/card.md +63 -2
  16. package/ai/components/chart-card.md +283 -0
  17. package/ai/components/combobox.md +411 -0
  18. package/ai/components/date-input.md +396 -0
  19. package/ai/components/datetime-input.md +215 -0
  20. package/ai/components/description-item.md +111 -0
  21. package/ai/components/description-list.md +160 -0
  22. package/ai/components/donut-chart.md +169 -0
  23. package/ai/components/header.md +67 -2
  24. package/ai/components/icon-button.md +74 -16
  25. package/ai/components/icon.md +63 -7
  26. package/ai/components/line-chart.md +234 -0
  27. package/ai/components/list.md +70 -6
  28. package/ai/components/menu.md +5 -0
  29. package/ai/components/multi-combobox.md +257 -0
  30. package/ai/components/nav-group.md +178 -0
  31. package/ai/components/nav-item.md +210 -0
  32. package/ai/components/page-header.md +237 -0
  33. package/ai/components/pagination.md +173 -0
  34. package/ai/components/popover.md +250 -0
  35. package/ai/components/side-panel.md +391 -0
  36. package/ai/components/sidebar.md +363 -0
  37. package/ai/components/skeleton.md +215 -0
  38. package/ai/components/sparkline.md +188 -0
  39. package/ai/components/stat.md +233 -0
  40. package/ai/components/tab-group.md +226 -0
  41. package/ai/components/tab-panel.md +163 -0
  42. package/ai/components/table.md +568 -0
  43. package/ai/components/tabs.md +42 -2
  44. package/ai/components/theme-menu-button.md +182 -0
  45. package/ai/components/theme-switch.md +170 -0
  46. package/ai/components/time-input.md +240 -0
  47. package/ai/components/toolbar.md +289 -0
  48. package/ai/components/tooltip.md +230 -0
  49. package/ai/components/top-nav.md +159 -0
  50. package/ai/reference/bf-badge-appearance.md +36 -0
  51. package/ai/reference/bf-badge-variant.md +1 -1
  52. package/ai/reference/bf-bar-chart-orientation.md +27 -0
  53. package/ai/reference/bf-button-appearance.md +36 -0
  54. package/ai/reference/bf-button-variant.md +1 -1
  55. package/ai/reference/bf-calendar-disabled-date.md +23 -0
  56. package/ai/reference/bf-calendar-harness.md +51 -0
  57. package/ai/reference/bf-calendar-weekday.md +31 -0
  58. package/ai/reference/bf-chart-card-heading-level.md +26 -0
  59. package/ai/reference/bf-chart-curve.md +28 -0
  60. package/ai/reference/bf-chart-harness.md +51 -0
  61. package/ai/reference/bf-chart-legend-position.md +30 -0
  62. package/ai/reference/bf-chart-series.md +23 -0
  63. package/ai/reference/bf-chart-value-format.md +23 -0
  64. package/ai/reference/bf-color-scheme-service.md +30 -0
  65. package/ai/reference/bf-color-scheme.md +31 -0
  66. package/ai/reference/bf-combobox-filter.md +27 -0
  67. package/ai/reference/bf-combobox-harness.md +89 -0
  68. package/ai/reference/bf-combobox-option.md +33 -0
  69. package/ai/reference/bf-compare-with.md +2 -0
  70. package/ai/reference/bf-date-input-harness.md +67 -0
  71. package/ai/reference/bf-date-input-picker.md +27 -0
  72. package/ai/reference/bf-date-time-input-harness.md +76 -0
  73. package/ai/reference/bf-date-time-input-picker.md +27 -0
  74. package/ai/reference/bf-description-list-layout.md +26 -0
  75. package/ai/reference/bf-donut-slice.md +22 -0
  76. package/ai/reference/bf-labels.md +67 -20
  77. package/ai/reference/bf-menu-button-variant.md +1 -0
  78. package/ai/reference/bf-menu-placement.md +1 -0
  79. package/ai/reference/bf-overlay-options.md +28 -27
  80. package/ai/reference/bf-overlay-placement.md +34 -0
  81. package/ai/reference/bf-overlay-position.md +1 -1
  82. package/ai/reference/bf-overlay-service.md +5 -3
  83. package/ai/reference/bf-page-header-heading-level.md +26 -0
  84. package/ai/reference/bf-pagination-harness.md +61 -0
  85. package/ai/reference/bf-platform-service.md +17 -15
  86. package/ai/reference/bf-popover-harness.md +42 -0
  87. package/ai/reference/bf-popover-placement.md +28 -0
  88. package/ai/reference/bf-popover-trigger-directive.md +56 -0
  89. package/ai/reference/bf-side-panel-config.md +35 -0
  90. package/ai/reference/bf-side-panel-harness.md +34 -0
  91. package/ai/reference/bf-side-panel-ref.md +44 -0
  92. package/ai/reference/bf-side-panel-service.md +43 -0
  93. package/ai/reference/bf-side-panel-template-context.md +32 -0
  94. package/ai/reference/bf-side-panel-width.md +28 -0
  95. package/ai/reference/bf-size.md +12 -0
  96. package/ai/reference/bf-skeleton-shape.md +28 -0
  97. package/ai/reference/bf-stat-trend-intent.md +27 -0
  98. package/ai/reference/bf-stat-trend.md +27 -0
  99. package/ai/reference/bf-stat-variant.md +26 -0
  100. package/ai/reference/bf-tab-group-harness.md +44 -0
  101. package/ai/reference/bf-table-align.md +26 -0
  102. package/ai/reference/bf-table-cell-context.md +24 -0
  103. package/ai/reference/bf-table-cell-directive.md +22 -0
  104. package/ai/reference/bf-table-column.md +28 -0
  105. package/ai/reference/bf-table-harness.md +77 -0
  106. package/ai/reference/bf-table-row-key.md +21 -0
  107. package/ai/reference/bf-table-sort-direction.md +26 -0
  108. package/ai/reference/bf-table-sort.md +27 -0
  109. package/ai/reference/bf-theme.md +5 -4
  110. package/ai/reference/bf-time-input-harness.md +67 -0
  111. package/ai/reference/bf-time-input-hour-cycle.md +27 -0
  112. package/ai/reference/bf-time-input-picker.md +27 -0
  113. package/ai/reference/bf-tooltip-directive.md +43 -0
  114. package/ai/reference/bf-tooltip-harness.md +43 -0
  115. package/ai/reference/bf-tooltip-placement.md +28 -0
  116. package/ai/reference/bf_color_scheme_storage.md +20 -0
  117. package/ai/reference/bf_side_panel_data.md +17 -0
  118. package/ai/reference/bf_theme_storage.md +3 -1
  119. package/ai/reference/provide-bf-color-scheme.md +20 -0
  120. package/ai/reference/provide-bf-labels.md +12 -4
  121. package/ai/reference/slide-in-from-end.md +24 -0
  122. package/ai/reference/slide-out-to-end.md +24 -0
  123. package/fesm2022/bitforgehq-ui-charts.mjs +3045 -0
  124. package/fesm2022/bitforgehq-ui-charts.mjs.map +1 -0
  125. package/fesm2022/bitforgehq-ui-icons.mjs +107 -3
  126. package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -1
  127. package/fesm2022/bitforgehq-ui-mobile.mjs +14 -59
  128. package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -1
  129. package/fesm2022/bitforgehq-ui-overlay.mjs +6436 -33
  130. package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
  131. package/fesm2022/bitforgehq-ui-testing.mjs +618 -1
  132. package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
  133. package/fesm2022/bitforgehq-ui.mjs +5092 -153
  134. package/fesm2022/bitforgehq-ui.mjs.map +1 -1
  135. package/llms-full.txt +25177 -14398
  136. package/llms.txt +95 -1
  137. package/package.json +7 -3
  138. package/theme.css +101 -0
  139. package/types/bitforgehq-ui-charts.d.ts +967 -0
  140. package/types/bitforgehq-ui-icons.d.ts +13 -1
  141. package/types/bitforgehq-ui-mobile.d.ts +25 -18
  142. package/types/bitforgehq-ui-overlay.d.ts +1844 -7
  143. package/types/bitforgehq-ui-testing.d.ts +748 -1
  144. package/types/bitforgehq-ui.d.ts +2136 -44
@@ -0,0 +1,36 @@
1
+ # BfBadgeAppearance
2
+
3
+ Every badge tone, the five variants plus the informational info tone
4
+
5
+ Type from `@bitforgehq/ui` · since 0.3.1
6
+
7
+ Every tone the `variant` input of a `bf-badge` takes: the five `BfBadgeVariant` tones plus
8
+ `info`, for an informational label such as a category. A new type, so `Record`s and exhaustive
9
+ switches over `BfBadgeVariant` keep compiling.
10
+
11
+ ```ts
12
+ import { type BfBadgeAppearance } from '@bitforgehq/ui';
13
+ ```
14
+
15
+ ## Signature
16
+
17
+ ```ts
18
+ type BfBadgeAppearance = BfBadgeVariant | 'info'
19
+ ```
20
+
21
+ ## Values
22
+
23
+ - `neutral`
24
+ - `primary`
25
+ - `success`
26
+ - `warning`
27
+ - `danger`
28
+ - `info`
29
+
30
+ ## Uses
31
+
32
+ - [BfBadgeVariant](bf-badge-variant.md)
33
+
34
+ ## Used by
35
+
36
+ - [bf-badge](../components/badge.md)
@@ -26,4 +26,4 @@ type BfBadgeVariant = 'neutral' | 'primary' | 'success' | 'warning' | 'danger'
26
26
 
27
27
  ## Used by
28
28
 
29
- - [bf-badge](../components/badge.md)
29
+ - [BfBadgeAppearance](bf-badge-appearance.md)
@@ -0,0 +1,27 @@
1
+ # BfBarChartOrientation
2
+
3
+ The two bar directions, vertical columns or horizontal bars
4
+
5
+ Type from `@bitforgehq/ui/charts` · since 0.3.1
6
+
7
+ The direction of a `bf-bar-chart`'s bars: up from a horizontal baseline, or along from a
8
+ vertical one (for long category names or many categories).
9
+
10
+ ```ts
11
+ import { type BfBarChartOrientation } from '@bitforgehq/ui/charts';
12
+ ```
13
+
14
+ ## Signature
15
+
16
+ ```ts
17
+ type BfBarChartOrientation = 'vertical' | 'horizontal'
18
+ ```
19
+
20
+ ## Values
21
+
22
+ - `vertical`
23
+ - `horizontal`
24
+
25
+ ## Used by
26
+
27
+ - [bf-bar-chart](../components/bar-chart.md)
@@ -0,0 +1,36 @@
1
+ # BfButtonAppearance
2
+
3
+ Every button style, the five variants plus the quiet neutral ghost
4
+
5
+ Type from `@bitforgehq/ui` · since 0.3.1
6
+
7
+ Every value the `variant` input of a `bf-button` takes: the five `BfButtonVariant` styles plus
8
+ `ghost`, the quiet neutral one. A new type, so `Record`s and exhaustive switches over
9
+ `BfButtonVariant` keep compiling.
10
+
11
+ ```ts
12
+ import { type BfButtonAppearance } from '@bitforgehq/ui';
13
+ ```
14
+
15
+ ## Signature
16
+
17
+ ```ts
18
+ type BfButtonAppearance = BfButtonVariant | 'ghost'
19
+ ```
20
+
21
+ ## Values
22
+
23
+ - `primary`
24
+ - `tonal`
25
+ - `outline`
26
+ - `text`
27
+ - `danger`
28
+ - `ghost`
29
+
30
+ ## Uses
31
+
32
+ - [BfButtonVariant](bf-button-variant.md)
33
+
34
+ ## Used by
35
+
36
+ - [bf-button](../components/button.md)
@@ -26,4 +26,4 @@ type BfButtonVariant = 'primary' | 'tonal' | 'outline' | 'text' | 'danger'
26
26
 
27
27
  ## Used by
28
28
 
29
- - [bf-button](../components/button.md)
29
+ - [BfButtonAppearance](bf-button-appearance.md)
@@ -0,0 +1,23 @@
1
+ # BfCalendarDisabledDate
2
+
3
+ A function that marks an ISO date as not pickable in a calendar
4
+
5
+ Type from `@bitforgehq/ui` · since 0.3.1
6
+
7
+ Tells `bf-calendar` which dates cannot be picked, such as weekends or booked days.
8
+
9
+ ```ts
10
+ import { type BfCalendarDisabledDate } from '@bitforgehq/ui';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfCalendarDisabledDate = (iso: string) => boolean
17
+ ```
18
+
19
+ ## Used by
20
+
21
+ - [bf-calendar](../components/calendar.md)
22
+ - [bf-date-input](../components/date-input.md)
23
+ - [bf-datetime-input](../components/datetime-input.md)
@@ -0,0 +1,51 @@
1
+ # BfCalendarHarness
2
+
3
+ Test harness for the calendar: reads the month and picks a date by ISO string
4
+
5
+ Class from `@bitforgehq/ui/testing` · since 0.3.1
6
+
7
+ Harness for `bf-calendar`. It works with ISO dates ('YYYY-MM-DD'), as the calendar's value
8
+ does, and drives it as a user would: `selectDate()` jumps to another month through the month
9
+ and year views, then clicks the day.
10
+
11
+ ```ts
12
+ import { BfCalendarHarness } from '@bitforgehq/ui/testing';
13
+ ```
14
+
15
+ ## Signature
16
+
17
+ ```ts
18
+ class BfCalendarHarness extends ComponentHarness
19
+ ```
20
+
21
+ ## Methods
22
+
23
+ ### `getLabel(): Promise<string>`
24
+
25
+ The calendar's accessible name (`label`, else `ariaLabel`); it is not rendered visibly.
26
+
27
+ ### `getMonthLabel(): Promise<string>`
28
+
29
+ The shown month and year as the header writes them, in the calendar's locale.
30
+
31
+ ### `getSelected(): Promise<string | null>`
32
+
33
+ The picked date while it is in the shown month.
34
+
35
+ ### `nextMonth(): Promise<void>`
36
+
37
+ Clicks the next-month button. Throws when it is disabled (the month is past `max`).
38
+
39
+ ### `previousMonth(): Promise<void>`
40
+
41
+ Clicks the previous-month button. Throws when it is disabled (the month is before `min`).
42
+
43
+ ### `selectDate(iso: string): Promise<void>`
44
+
45
+ Picks a date as a user would: when it is in another month, opens the month view, then the
46
+ year view, clicks its year and month, then clicks the day. Throws for an invalid date, one
47
+ the views do not list, and a disabled date or calendar.
48
+
49
+ | Parameter | Type | Description |
50
+ | --------- | -------- | ------------------------------------------- |
51
+ | `iso` | `string` | The ISO date to pick, such as '2026-11-03'. |
@@ -0,0 +1,31 @@
1
+ # BfCalendarWeekday
2
+
3
+ A weekday number from 0 for Sunday to 6 for Saturday, as Date counts
4
+
5
+ Type from `@bitforgehq/ui` · since 0.3.1
6
+
7
+ A weekday as `Date.getDay()` counts it: 0 Sunday, 1 Monday … 6 Saturday.
8
+
9
+ ```ts
10
+ import { type BfCalendarWeekday } from '@bitforgehq/ui';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfCalendarWeekday = 0 | 1 | 2 | 3 | 4 | 5 | 6
17
+ ```
18
+
19
+ ## Values
20
+
21
+ - `0`
22
+ - `1`
23
+ - `2`
24
+ - `3`
25
+ - `4`
26
+ - `5`
27
+ - `6`
28
+
29
+ ## Used by
30
+
31
+ - [bf-calendar](../components/calendar.md)
@@ -0,0 +1,26 @@
1
+ # BfChartCardHeadingLevel
2
+
3
+ Heading level of a chart card title, two on a page or three inside
4
+
5
+ Type from `@bitforgehq/ui/charts` · since 0.3.1
6
+
7
+ The heading level of a `bf-chart-card` title: `2` for a card on a page, `3` inside a section.
8
+
9
+ ```ts
10
+ import { type BfChartCardHeadingLevel } from '@bitforgehq/ui/charts';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfChartCardHeadingLevel = 2 | 3
17
+ ```
18
+
19
+ ## Values
20
+
21
+ - `2`
22
+ - `3`
23
+
24
+ ## Used by
25
+
26
+ - [bf-chart-card](../components/chart-card.md)
@@ -0,0 +1,28 @@
1
+ # BfChartCurve
2
+
3
+ The two line shapes, straight segments or a smooth monotone curve
4
+
5
+ Type from `@bitforgehq/ui/charts` · since 0.3.1
6
+
7
+ The line between two points of a line chart or a sparkline: straight, or a smooth monotone
8
+ cubic curve that never overshoots the values.
9
+
10
+ ```ts
11
+ import { type BfChartCurve } from '@bitforgehq/ui/charts';
12
+ ```
13
+
14
+ ## Signature
15
+
16
+ ```ts
17
+ type BfChartCurve = 'linear' | 'smooth'
18
+ ```
19
+
20
+ ## Values
21
+
22
+ - `linear`
23
+ - `smooth`
24
+
25
+ ## Used by
26
+
27
+ - [bf-line-chart](../components/line-chart.md)
28
+ - [bf-sparkline](../components/sparkline.md)
@@ -0,0 +1,51 @@
1
+ # BfChartHarness
2
+
3
+ Test harness for the charts: reads the series, toggles one and reads the data table
4
+
5
+ Class from `@bitforgehq/ui/testing` · since 0.3.1
6
+
7
+ Harness for the `@bitforgehq/ui/charts` charts (`bf-line-chart`, `bf-bar-chart`,
8
+ `bf-donut-chart`). It works through what a user sees: the legend's series names, its toggle
9
+ buttons and the Show data table, so a test never reads the SVG.
10
+
11
+ ```ts
12
+ import { BfChartHarness } from '@bitforgehq/ui/testing';
13
+ ```
14
+
15
+ ## Signature
16
+
17
+ ```ts
18
+ class BfChartHarness extends ComponentHarness
19
+ ```
20
+
21
+ ## Methods
22
+
23
+ ### `getLabel(): Promise<string>`
24
+
25
+ The figure's accessible name (`label`, else the chart card's title, else the `chart` label).
26
+
27
+ ### `getSeriesNames(): Promise<string[]>`
28
+
29
+ The series (or slice) names in the legend, in order; empty for a chart of one series, which
30
+ draws no legend.
31
+
32
+ ### `isSeriesShown(name: string): Promise<boolean>`
33
+
34
+ Whether the legend shows the series (or slice) with this name.
35
+
36
+ | Parameter | Type | Description |
37
+ | --------- | -------- | ---------------- |
38
+ | `name` | `string` | The series name. |
39
+
40
+ ### `toggleSeries(name: string): Promise<void>`
41
+
42
+ Clicks the legend button of the series (or slice) with this name, as a user would, to hide
43
+ or show it. Throws for an unknown name.
44
+
45
+ | Parameter | Type | Description |
46
+ | --------- | -------- | ---------------- |
47
+ | `name` | `string` | The series name. |
48
+
49
+ ### `showData(): Promise<string[][]>`
50
+
51
+ Opens the Show data table (if it is closed) and reads it.
@@ -0,0 +1,30 @@
1
+ # BfChartLegendPosition
2
+
3
+ The legend positions of a chart, above or below the plot, or none
4
+
5
+ Type from `@bitforgehq/ui/charts` · since 0.3.1
6
+
7
+ Where a chart draws its legend: above the plot, below it, or not at all.
8
+
9
+ ```ts
10
+ import { type BfChartLegendPosition } from '@bitforgehq/ui/charts';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfChartLegendPosition = 'top' | 'bottom' | 'none'
17
+ ```
18
+
19
+ ## Values
20
+
21
+ - `top`
22
+ - `bottom`
23
+ - `none`
24
+
25
+ ## Used by
26
+
27
+ - [bf-bar-chart](../components/bar-chart.md)
28
+ - [bf-chart-card](../components/chart-card.md)
29
+ - [bf-donut-chart](../components/donut-chart.md)
30
+ - [bf-line-chart](../components/line-chart.md)
@@ -0,0 +1,23 @@
1
+ # BfChartSeries
2
+
3
+ One named series of chart values, one per category, null for a gap
4
+
5
+ Interface from `@bitforgehq/ui/charts` · since 0.3.1
6
+
7
+ One named row of values in a chart, one value per category; `null` leaves a gap.
8
+
9
+ ```ts
10
+ import { type BfChartSeries } from '@bitforgehq/ui/charts';
11
+ ```
12
+
13
+ ## Properties
14
+
15
+ | Name | Type | Default | Description |
16
+ | -------- | ----------------------------- | -------- | --------------------------------------------------------------------------------- |
17
+ | `name` | `string` | required | The series name, shown in the legend, the tooltip and the data table. |
18
+ | `values` | `readonly (number \| null)[]` | required | One value per category, in the categories' order; `null` where there is no value. |
19
+
20
+ ## Used by
21
+
22
+ - [bf-bar-chart](../components/bar-chart.md)
23
+ - [bf-line-chart](../components/line-chart.md)
@@ -0,0 +1,23 @@
1
+ # BfChartValueFormat
2
+
3
+ Function that formats one chart value for axes, tooltips and the table
4
+
5
+ Type from `@bitforgehq/ui/charts` · since 0.3.1
6
+
7
+ Formats a chart value for the axis, the tooltip, the announcements and the data table.
8
+
9
+ ```ts
10
+ import { type BfChartValueFormat } from '@bitforgehq/ui/charts';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfChartValueFormat = (value: number) => string
17
+ ```
18
+
19
+ ## Used by
20
+
21
+ - [bf-bar-chart](../components/bar-chart.md)
22
+ - [bf-donut-chart](../components/donut-chart.md)
23
+ - [bf-line-chart](../components/line-chart.md)
@@ -0,0 +1,30 @@
1
+ # BfColorSchemeService
2
+
3
+ The app colour scheme choice and dark state, applied to html and stored
4
+
5
+ Service from `@bitforgehq/ui` · since 0.3.1
6
+
7
+ The app's colour scheme: the user's choice (system, light, dark), kept in
8
+ `BF_COLOR_SCHEME_STORAGE` under `bf-theme`, and whether the app is dark now. With
9
+ `provideBfColorScheme()` (or `provideBfShell()` in a Capacitor app) it toggles the `dark` class
10
+ on `<html>` and stores every change; `prefers-color-scheme` is the source under `system` and is
11
+ followed live. Without either, the signals still compute but nothing is written, so a page that
12
+ merely injects the service never fights the host page's own theme. Storage and the media query are read in the browser only, so a server render
13
+ starts at `system`, light, and writes nothing. No Capacitor: a desktop web app uses it as is,
14
+ and the shell's `BfPlatformService.theme` and `dark` are these same signals.
15
+
16
+ ```ts
17
+ import { BfColorSchemeService } from '@bitforgehq/ui';
18
+ ```
19
+
20
+ ## Properties
21
+
22
+ | Name | Type | Default | Description |
23
+ | ------------ | ------------------------------- | ------- | ------------------------------------------------------------------------------------------------- |
24
+ | `scheme` | `WritableSignal<BfColorScheme>` | | The user's choice, stored when `provideBfColorScheme()` is provided; set it with `scheme.set(…)`. |
25
+ | `systemDark` | `Signal<boolean>` | | Whether the system prefers dark (`prefers-color-scheme: dark`), followed live. |
26
+ | `dark` | `Signal<boolean>` | | Whether the app is dark now: the choice, or the system's under `system`. |
27
+
28
+ ## Uses
29
+
30
+ - [BfColorScheme](bf-color-scheme.md)
@@ -0,0 +1,31 @@
1
+ # BfColorScheme
2
+
3
+ The colour scheme choice, following the system or forcing light or dark
4
+
5
+ Type from `@bitforgehq/ui` · since 0.3.1
6
+
7
+ The app's colour scheme choice: follow the system, or force light or dark.
8
+
9
+ ```ts
10
+ import { type BfColorScheme } from '@bitforgehq/ui';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfColorScheme = 'system' | 'light' | 'dark'
17
+ ```
18
+
19
+ ## Values
20
+
21
+ - `system`
22
+ - `light`
23
+ - `dark`
24
+
25
+ ## Used by
26
+
27
+ - [BfColorSchemeService](bf-color-scheme-service.md)
28
+ - [BfPlatformService](bf-platform-service.md)
29
+ - [BfTheme](bf-theme.md)
30
+ - [bf-theme-menu-button](../components/theme-menu-button.md)
31
+ - [bf-theme-switch](../components/theme-switch.md)
@@ -0,0 +1,27 @@
1
+ # BfComboboxFilter
2
+
3
+ Decides whether a combobox option matches the text typed into the field
4
+
5
+ Type from `@bitforgehq/ui/overlay` · since 0.3.1
6
+
7
+ Whether an option matches the typed query (the `filter` of the comboboxes). Called only for a
8
+ query that is not empty.
9
+
10
+ ```ts
11
+ import { type BfComboboxFilter } from '@bitforgehq/ui/overlay';
12
+ ```
13
+
14
+ ## Signature
15
+
16
+ ```ts
17
+ type BfComboboxFilter<T = string> = (option: BfComboboxOption<T>, query: string) => boolean
18
+ ```
19
+
20
+ ## Uses
21
+
22
+ - [BfComboboxOption](bf-combobox-option.md)
23
+
24
+ ## Used by
25
+
26
+ - [bf-combobox](../components/combobox.md)
27
+ - [bf-multi-combobox](../components/multi-combobox.md)
@@ -0,0 +1,89 @@
1
+ # BfComboboxHarness
2
+
3
+ Test harness for the comboboxes: types, reads and picks options and tags
4
+
5
+ Class from `@bitforgehq/ui/testing` · since 0.3.1
6
+
7
+ Harness for `bf-combobox` and `bf-multi-combobox`. Its option list renders in the CDK overlay
8
+ container while open (found through the input's `aria-controls`); it works by option label, so a
9
+ test never needs the option values. Its `label` filter matches the visible label, else the
10
+ `aria-label`.
11
+
12
+ ```ts
13
+ import { BfComboboxHarness } from '@bitforgehq/ui/testing';
14
+ ```
15
+
16
+ ## Signature
17
+
18
+ ```ts
19
+ class BfComboboxHarness extends ComponentHarness
20
+ ```
21
+
22
+ ## Methods
23
+
24
+ ### `getLabel(): Promise<string>`
25
+
26
+ The visible label without the required mark, else the `aria-label`.
27
+
28
+ ### `open(): Promise<void>`
29
+
30
+ Opens the option list with a click into the field; does nothing while it is open.
31
+
32
+ ### `close(): Promise<void>`
33
+
34
+ Closes the option list with `Escape`, as a user would; does nothing while it is closed.
35
+
36
+ ### `isOpen(): Promise<boolean>`
37
+
38
+ Whether the option list is open (`aria-expanded`).
39
+
40
+ ### `type(query: string): Promise<void>`
41
+
42
+ Replaces the field's text with `query`, key by key as a user types; the list opens filtered.
43
+
44
+ | Parameter | Type | Description |
45
+ | --------- | -------- | ----------------- |
46
+ | `query` | `string` | The text to type. |
47
+
48
+ ### `getOptionLabels(): Promise<string[]>`
49
+
50
+ The labels of the listed options, in order, opening the list first when it is closed.
51
+
52
+ ### `selectOption(label: string): Promise<void>`
53
+
54
+ Picks the listed option with this label with a click, opening the list first when it is
55
+ closed. Throws for an unknown or disabled option.
56
+
57
+ | Parameter | Type | Description |
58
+ | --------- | -------- | ------------------- |
59
+ | `label` | `string` | The option's label. |
60
+
61
+ ### `getValueText(): Promise<string>`
62
+
63
+ The field's text: the picked option's label on a `bf-combobox` (or the text being typed), the
64
+ typed text on a `bf-multi-combobox` (its picks are tags, see `getChipLabels()`).
65
+
66
+ ### `getChipLabels(): Promise<string[]>`
67
+
68
+ The labels of a `bf-multi-combobox`'s tags, in order; empty for a `bf-combobox`.
69
+
70
+ ### `removeChip(label: string): Promise<void>`
71
+
72
+ Removes the tag with this label with its remove button. Throws for an unknown tag or one
73
+ without a remove button (a disabled or read-only field).
74
+
75
+ | Parameter | Type | Description |
76
+ | --------- | -------- | ---------------- |
77
+ | `label` | `string` | The tag's label. |
78
+
79
+ ### `isDisabled(): Promise<boolean>`
80
+
81
+ Whether the field is disabled.
82
+
83
+ ### `focus(): Promise<void>`
84
+
85
+ Focuses the input.
86
+
87
+ ### `blur(): Promise<void>`
88
+
89
+ Blurs the input, which closes the list and marks a bound form field touched.
@@ -0,0 +1,33 @@
1
+ # BfComboboxOption
2
+
3
+ One combobox choice with its value, label, description, group and disabled flag
4
+
5
+ Interface from `@bitforgehq/ui/overlay` · since 0.3.1
6
+
7
+ One choice of `bf-combobox` and `bf-multi-combobox`; `value` is any type (a string by default).
8
+
9
+ ```ts
10
+ import { type BfComboboxOption } from '@bitforgehq/ui/overlay';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ interface BfComboboxOption<T = string>
17
+ ```
18
+
19
+ ## Properties
20
+
21
+ | Name | Type | Default | Description |
22
+ | ------------- | --------- | -------- | ----------------------------------------------------------------------------------------- |
23
+ | `value` | `T` | required | The value the combobox takes when this option is picked. |
24
+ | `label` | `string` | required | The option's text in the list, and the field's text once it is picked. |
25
+ | `description` | `string` | | A second, muted line under the label (an email, a role). |
26
+ | `disabled` | `boolean` | | Whether this option cannot be picked; it stays in the list, skipped by the arrow keys. |
27
+ | `group` | `string` | | The heading this option is listed under; options with the same group are listed together. |
28
+
29
+ ## Used by
30
+
31
+ - [bf-combobox](../components/combobox.md)
32
+ - [BfComboboxFilter](bf-combobox-filter.md)
33
+ - [bf-multi-combobox](../components/multi-combobox.md)
@@ -19,6 +19,8 @@ type BfCompareWith<T> = (optionValue: T, value: T) => boolean
19
19
 
20
20
  ## Used by
21
21
 
22
+ - [bf-combobox](../components/combobox.md)
23
+ - [bf-multi-combobox](../components/multi-combobox.md)
22
24
  - [bf-radio-group](../components/radio-group.md)
23
25
  - [bf-segmented](../components/segmented.md)
24
26
  - [bf-select](../components/select.md)