@bitforgehq/ui 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (281) hide show
  1. package/CHANGELOG.md +3665 -0
  2. package/LICENSE +21 -0
  3. package/README.md +175 -0
  4. package/ai/MANIFEST.index.json +383 -0
  5. package/ai/MANIFEST.json +7528 -0
  6. package/ai/REFERENCE.index.json +1461 -0
  7. package/ai/REFERENCE.json +7213 -0
  8. package/ai/UI_GUIDE.md +1159 -0
  9. package/ai/components/action-bar.md +209 -0
  10. package/ai/components/action-sheet.md +526 -0
  11. package/ai/components/alert-dialog.md +509 -0
  12. package/ai/components/alert.md +376 -0
  13. package/ai/components/avatar.md +146 -0
  14. package/ai/components/back-button.md +286 -0
  15. package/ai/components/badge.md +171 -0
  16. package/ai/components/button.md +431 -0
  17. package/ai/components/card.md +303 -0
  18. package/ai/components/checkbox.md +418 -0
  19. package/ai/components/chip-group.md +205 -0
  20. package/ai/components/chip.md +300 -0
  21. package/ai/components/content.md +474 -0
  22. package/ai/components/desktop-toast.md +420 -0
  23. package/ai/components/dialog.md +962 -0
  24. package/ai/components/empty-state.md +146 -0
  25. package/ai/components/field.md +319 -0
  26. package/ai/components/header.md +809 -0
  27. package/ai/components/icon-button.md +221 -0
  28. package/ai/components/icon.md +176 -0
  29. package/ai/components/input.md +455 -0
  30. package/ai/components/list-item.md +326 -0
  31. package/ai/components/list.md +178 -0
  32. package/ai/components/menu-button.md +377 -0
  33. package/ai/components/menu.md +661 -0
  34. package/ai/components/modal.md +613 -0
  35. package/ai/components/number-input.md +423 -0
  36. package/ai/components/page.md +299 -0
  37. package/ai/components/progress.md +215 -0
  38. package/ai/components/radio-group.md +432 -0
  39. package/ai/components/refresher.md +377 -0
  40. package/ai/components/segmented.md +517 -0
  41. package/ai/components/select.md +510 -0
  42. package/ai/components/sheet.md +845 -0
  43. package/ai/components/spinner.md +171 -0
  44. package/ai/components/stack-outlet.md +661 -0
  45. package/ai/components/tab-bar.md +427 -0
  46. package/ai/components/tab.md +295 -0
  47. package/ai/components/tabs.md +408 -0
  48. package/ai/components/textarea.md +371 -0
  49. package/ai/components/toast.md +522 -0
  50. package/ai/components/toggle.md +387 -0
  51. package/ai/reference/bf-action-directive.md +21 -0
  52. package/ai/reference/bf-action-sheet-action-role.md +27 -0
  53. package/ai/reference/bf-action-sheet-action.md +28 -0
  54. package/ai/reference/bf-action-sheet-options.md +28 -0
  55. package/ai/reference/bf-action-sheet-service.md +33 -0
  56. package/ai/reference/bf-alert-dialog-button-role.md +27 -0
  57. package/ai/reference/bf-alert-dialog-button.md +27 -0
  58. package/ai/reference/bf-alert-dialog-options.md +29 -0
  59. package/ai/reference/bf-alert-dialog-service.md +34 -0
  60. package/ai/reference/bf-alert-variant.md +28 -0
  61. package/ai/reference/bf-autocapitalize.md +30 -0
  62. package/ai/reference/bf-avatar-size.md +27 -0
  63. package/ai/reference/bf-avatar-variant.md +28 -0
  64. package/ai/reference/bf-back-at-root.md +28 -0
  65. package/ai/reference/bf-back-button-service.md +40 -0
  66. package/ai/reference/bf-badge-variant.md +29 -0
  67. package/ai/reference/bf-button-size.md +29 -0
  68. package/ai/reference/bf-button-type.md +28 -0
  69. package/ai/reference/bf-button-variant.md +29 -0
  70. package/ai/reference/bf-card-padding.md +26 -0
  71. package/ai/reference/bf-card-variant.md +28 -0
  72. package/ai/reference/bf-chip-group-mode.md +27 -0
  73. package/ai/reference/bf-chip-variant.md +26 -0
  74. package/ai/reference/bf-compare-with.md +24 -0
  75. package/ai/reference/bf-component-overlay-ref.md +33 -0
  76. package/ai/reference/bf-confirm-button-role.md +26 -0
  77. package/ai/reference/bf-confirm-button.md +27 -0
  78. package/ai/reference/bf-confirm-options.md +31 -0
  79. package/ai/reference/bf-confirm-size.md +26 -0
  80. package/ai/reference/bf-content-scroll-event.md +21 -0
  81. package/ai/reference/bf-defaults-options.md +32 -0
  82. package/ai/reference/bf-defaults.md +28 -0
  83. package/ai/reference/bf-desktop-toast-config.md +28 -0
  84. package/ai/reference/bf-desktop-toast-harness.md +33 -0
  85. package/ai/reference/bf-desktop-toast-options.md +28 -0
  86. package/ai/reference/bf-desktop-toast-position.md +28 -0
  87. package/ai/reference/bf-desktop-toast-service.md +42 -0
  88. package/ai/reference/bf-dialog-config.md +44 -0
  89. package/ai/reference/bf-dialog-harness.md +52 -0
  90. package/ai/reference/bf-dialog-ref.md +44 -0
  91. package/ai/reference/bf-dialog-role.md +26 -0
  92. package/ai/reference/bf-dialog-service.md +55 -0
  93. package/ai/reference/bf-dialog-size.md +31 -0
  94. package/ai/reference/bf-dialog-template-context.md +32 -0
  95. package/ai/reference/bf-empty-state-heading-level.md +26 -0
  96. package/ai/reference/bf-enter-key-hint.md +31 -0
  97. package/ai/reference/bf-field-control-class.md +32 -0
  98. package/ai/reference/bf-field-control-state.md +28 -0
  99. package/ai/reference/bf-field-size.md +29 -0
  100. package/ai/reference/bf-haptics-impact-style.md +27 -0
  101. package/ai/reference/bf-haptics-notification-type.md +27 -0
  102. package/ai/reference/bf-haptics-service.md +41 -0
  103. package/ai/reference/bf-harness-filters.md +29 -0
  104. package/ai/reference/bf-horizontal-scroll-directive.md +129 -0
  105. package/ai/reference/bf-icon-button-variant.md +28 -0
  106. package/ai/reference/bf-icon-size.md +27 -0
  107. package/ai/reference/bf-input-autocapitalize.md +36 -0
  108. package/ai/reference/bf-input-enter-key-hint.md +38 -0
  109. package/ai/reference/bf-input-input-mode.md +38 -0
  110. package/ai/reference/bf-input-mode.md +32 -0
  111. package/ai/reference/bf-input-type.md +35 -0
  112. package/ai/reference/bf-jsdom-shim-options.md +22 -0
  113. package/ai/reference/bf-keyboard-assist-behavior.md +26 -0
  114. package/ai/reference/bf-keyboard-assist-directive.md +185 -0
  115. package/ai/reference/bf-keyboard-phase.md +30 -0
  116. package/ai/reference/bf-keyboard-service.md +50 -0
  117. package/ai/reference/bf-labels-overrides.md +26 -0
  118. package/ai/reference/bf-labels.md +44 -0
  119. package/ai/reference/bf-menu-button-harness.md +40 -0
  120. package/ai/reference/bf-menu-button-variant.md +27 -0
  121. package/ai/reference/bf-menu-divider-directive.md +13 -0
  122. package/ai/reference/bf-menu-group-directive.md +14 -0
  123. package/ai/reference/bf-menu-harness.md +55 -0
  124. package/ai/reference/bf-menu-item-checkbox-directive.md +31 -0
  125. package/ai/reference/bf-menu-item-directive.md +31 -0
  126. package/ai/reference/bf-menu-item-harness.md +52 -0
  127. package/ai/reference/bf-menu-item-radio-directive.md +29 -0
  128. package/ai/reference/bf-menu-placement.md +29 -0
  129. package/ai/reference/bf-menu-trigger-directive.md +46 -0
  130. package/ai/reference/bf-modal-options.md +30 -0
  131. package/ai/reference/bf-modal-presentation.md +26 -0
  132. package/ai/reference/bf-modal-service.md +38 -0
  133. package/ai/reference/bf-nav-controller.md +59 -0
  134. package/ai/reference/bf-nav-direction.md +23 -0
  135. package/ai/reference/bf-nav-target.md +21 -0
  136. package/ai/reference/bf-number-input-mode.md +28 -0
  137. package/ai/reference/bf-number-input-step.md +25 -0
  138. package/ai/reference/bf-overlay-auto-focus.md +29 -0
  139. package/ai/reference/bf-overlay-controller.md +22 -0
  140. package/ai/reference/bf-overlay-host.md +36 -0
  141. package/ai/reference/bf-overlay-options.md +53 -0
  142. package/ai/reference/bf-overlay-position.md +30 -0
  143. package/ai/reference/bf-overlay-ref.md +53 -0
  144. package/ai/reference/bf-overlay-role.md +27 -0
  145. package/ai/reference/bf-overlay-service.md +53 -0
  146. package/ai/reference/bf-overlay-stack-options.md +24 -0
  147. package/ai/reference/bf-overlay-stack.md +81 -0
  148. package/ai/reference/bf-overlay-template-context.md +24 -0
  149. package/ai/reference/bf-overscroll-stretch-directive.md +163 -0
  150. package/ai/reference/bf-page-context.md +24 -0
  151. package/ai/reference/bf-platform-service.md +53 -0
  152. package/ai/reference/bf-platform.md +28 -0
  153. package/ai/reference/bf-progress-size.md +26 -0
  154. package/ai/reference/bf-progress-tone.md +28 -0
  155. package/ai/reference/bf-radio-group-harness.md +49 -0
  156. package/ai/reference/bf-radio-group-orientation.md +26 -0
  157. package/ai/reference/bf-radio-option.md +30 -0
  158. package/ai/reference/bf-refresher-refresh-event.md +22 -0
  159. package/ai/reference/bf-segment-option.md +29 -0
  160. package/ai/reference/bf-segmented-harness.md +48 -0
  161. package/ai/reference/bf-segmented-size.md +29 -0
  162. package/ai/reference/bf-select-harness.md +70 -0
  163. package/ai/reference/bf-select-option.md +29 -0
  164. package/ai/reference/bf-sheet-auto-focus.md +29 -0
  165. package/ai/reference/bf-sheet-options.md +32 -0
  166. package/ai/reference/bf-sheet-ref.md +45 -0
  167. package/ai/reference/bf-sheet-service.md +34 -0
  168. package/ai/reference/bf-shell-config-mode.md +28 -0
  169. package/ai/reference/bf-shell-config.md +38 -0
  170. package/ai/reference/bf-shell-dynamic-type-limit.md +21 -0
  171. package/ai/reference/bf-shell-dynamic-type.md +25 -0
  172. package/ai/reference/bf-shell-mode.md +28 -0
  173. package/ai/reference/bf-shell-testing-options.md +26 -0
  174. package/ai/reference/bf-size.md +45 -0
  175. package/ai/reference/bf-spinner-size.md +27 -0
  176. package/ai/reference/bf-stack-change.md +22 -0
  177. package/ai/reference/bf-stack-reuse-strategy.md +32 -0
  178. package/ai/reference/bf-stack-transition-event.md +26 -0
  179. package/ai/reference/bf-stack-transition.md +26 -0
  180. package/ai/reference/bf-stacked-overlay.md +23 -0
  181. package/ai/reference/bf-system-bars-style.md +38 -0
  182. package/ai/reference/bf-tab-bar-controller.md +51 -0
  183. package/ai/reference/bf-tab-bar-host.md +52 -0
  184. package/ai/reference/bf-tab-context.md +32 -0
  185. package/ai/reference/bf-tab-links.md +37 -0
  186. package/ai/reference/bf-testing-options.md +27 -0
  187. package/ai/reference/bf-text-scale-service.md +35 -0
  188. package/ai/reference/bf-theme.md +27 -0
  189. package/ai/reference/bf-toast-action.md +25 -0
  190. package/ai/reference/bf-toast-controller.md +17 -0
  191. package/ai/reference/bf-toast-dismiss-reason.md +29 -0
  192. package/ai/reference/bf-toast-options.md +29 -0
  193. package/ai/reference/bf-toast-position.md +26 -0
  194. package/ai/reference/bf-toast-ref.md +41 -0
  195. package/ai/reference/bf-toast-service.md +39 -0
  196. package/ai/reference/bf-toggle-label-position.md +26 -0
  197. package/ai/reference/bf-transition-kind.md +28 -0
  198. package/ai/reference/bf-validation-message.md +31 -0
  199. package/ai/reference/bf-validation-messages.md +33 -0
  200. package/ai/reference/bf-view-event.md +28 -0
  201. package/ai/reference/bf-view-lifecycle.md +41 -0
  202. package/ai/reference/bf-view-state.md +28 -0
  203. package/ai/reference/bf_default_labels.md +21 -0
  204. package/ai/reference/bf_default_values.md +21 -0
  205. package/ai/reference/bf_defaults.md +21 -0
  206. package/ai/reference/bf_desktop_toast_defaults.md +21 -0
  207. package/ai/reference/bf_dialog_data.md +17 -0
  208. package/ai/reference/bf_labels.md +21 -0
  209. package/ai/reference/bf_overlay_data.md +19 -0
  210. package/ai/reference/bf_overlay_host.md +21 -0
  211. package/ai/reference/bf_sheet_default_snap_points.md +17 -0
  212. package/ai/reference/bf_shell_config.md +21 -0
  213. package/ai/reference/bf_shell_defaults.md +21 -0
  214. package/ai/reference/bf_tab_bar.md +21 -0
  215. package/ai/reference/bf_tab_bar_controller.md +21 -0
  216. package/ai/reference/bf_tab_context.md +21 -0
  217. package/ai/reference/bf_tab_links.md +21 -0
  218. package/ai/reference/bf_theme_storage.md +19 -0
  219. package/ai/reference/create-transition.md +36 -0
  220. package/ai/reference/duration_fast.md +17 -0
  221. package/ai/reference/duration_md.md +17 -0
  222. package/ai/reference/duration_overlay.md +17 -0
  223. package/ai/reference/duration_push.md +17 -0
  224. package/ai/reference/fade-down.md +26 -0
  225. package/ai/reference/fade-in.md +25 -0
  226. package/ai/reference/fade-out.md +25 -0
  227. package/ai/reference/fade-up.md +26 -0
  228. package/ai/reference/inject-shell-mode.md +23 -0
  229. package/ai/reference/install-bf-jsdom-shims.md +31 -0
  230. package/ai/reference/ios_duration.md +17 -0
  231. package/ai/reference/ios_easing.md +17 -0
  232. package/ai/reference/is-text-entry.md +25 -0
  233. package/ai/reference/max_complete_ms.md +17 -0
  234. package/ai/reference/md-transition.md +31 -0
  235. package/ai/reference/md_duration.md +17 -0
  236. package/ai/reference/md_easing.md +17 -0
  237. package/ai/reference/overlay_duration.md +21 -0
  238. package/ai/reference/overlay_easing.md +19 -0
  239. package/ai/reference/overlay_reduced_duration.md +17 -0
  240. package/ai/reference/pop-frames-at.md +25 -0
  241. package/ai/reference/prefers-reduced-motion.md +25 -0
  242. package/ai/reference/provide-bf-defaults.md +33 -0
  243. package/ai/reference/provide-bf-desktop-toast.md +28 -0
  244. package/ai/reference/provide-bf-labels.md +38 -0
  245. package/ai/reference/provide-bf-shell-testing.md +34 -0
  246. package/ai/reference/provide-bf-shell.md +41 -0
  247. package/ai/reference/provide-bf-testing.md +33 -0
  248. package/ai/reference/reduced-transition.md +28 -0
  249. package/ai/reference/reduced_duration.md +17 -0
  250. package/ai/reference/resolve-shell-mode.md +33 -0
  251. package/ai/reference/scale-in.md +25 -0
  252. package/ai/reference/settle-duration.md +25 -0
  253. package/ai/reference/settle-pop.md +33 -0
  254. package/ai/reference/settle_easing.md +17 -0
  255. package/ai/reference/should-complete-pop.md +26 -0
  256. package/ai/reference/slide-down.md +26 -0
  257. package/ai/reference/slide-up.md +26 -0
  258. package/ai/reference/with-bf-shell-routing.md +19 -0
  259. package/bin/bf-ui.js +81 -0
  260. package/fesm2022/bitforgehq-ui-icons.mjs +230 -0
  261. package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -0
  262. package/fesm2022/bitforgehq-ui-mobile.mjs +5530 -0
  263. package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -0
  264. package/fesm2022/bitforgehq-ui-number-input.mjs +680 -0
  265. package/fesm2022/bitforgehq-ui-number-input.mjs.map +1 -0
  266. package/fesm2022/bitforgehq-ui-overlay.mjs +2675 -0
  267. package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -0
  268. package/fesm2022/bitforgehq-ui-testing.mjs +402 -0
  269. package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -0
  270. package/fesm2022/bitforgehq-ui.mjs +7765 -0
  271. package/fesm2022/bitforgehq-ui.mjs.map +1 -0
  272. package/llms-full.txt +25394 -0
  273. package/llms.txt +329 -0
  274. package/package.json +94 -0
  275. package/theme.css +253 -0
  276. package/types/bitforgehq-ui-icons.d.ts +50 -0
  277. package/types/bitforgehq-ui-mobile.d.ts +2914 -0
  278. package/types/bitforgehq-ui-number-input.d.ts +282 -0
  279. package/types/bitforgehq-ui-overlay.d.ts +1514 -0
  280. package/types/bitforgehq-ui-testing.d.ts +495 -0
  281. package/types/bitforgehq-ui.d.ts +3499 -0
@@ -0,0 +1,59 @@
1
+ # BfNavController
2
+
3
+ Stack-aware navigation that pushes, pops through the history and replaces the root
4
+
5
+ Service from `@bitforgehq/ui/mobile` · since 0.2.0
6
+
7
+ Stack-aware navigation. `forward` pushes, `back` pops through the real history (so the browser
8
+ or WebView history stays in sync), `root` replaces the whole stack. Each call leaves a direction
9
+ hint that `bf-stack-outlet` consumes on the next activation; without a hint the outlet infers
10
+ the direction from the router event. A hint lives only as long as the navigation it started:
11
+ when that navigation ends without an activation (a guard refused it), the hint is dropped so it
12
+ cannot mislabel the next one. Every primary `bf-stack-outlet` registers here with its nesting
13
+ level; `depth`, `canGoBack` and `back()` follow the **deepest active outlet** (the innermost one
14
+ whose page is shown, e.g. the outlet inside `bf-tabs`, or the root outlet once it pushed a page
15
+ above the tabs page). The controller also owns the priority-0 hardware back handler: it pops the
16
+ deepest active outlet that has a page to pop, and lets the app exit only when every active
17
+ outlet is at its first page (a parked outlet cannot be popped, so it never blocks the exit).
18
+
19
+ ```ts
20
+ import { BfNavController } from '@bitforgehq/ui/mobile';
21
+ ```
22
+
23
+ ## Properties
24
+
25
+ | Name | Type | Default | Description |
26
+ | ----------- | ----------------- | ------- | ------------------------------------------------------------------------- |
27
+ | `depth` | `Signal<number>` | | Number of pages in the deepest active stack outlet (0 without an outlet). |
28
+ | `canGoBack` | `Signal<boolean>` | | True when the deepest active stack has a page to go back to. |
29
+
30
+ ## Methods
31
+
32
+ ### `forward(url: BfNavTarget, extras?: NavigationExtras): Promise<boolean>`
33
+
34
+ Pushes a page.
35
+
36
+ | Parameter | Type | Description |
37
+ | --------- | ------------------ | ------------------------------------------------ |
38
+ | `url` | `BfNavTarget` | Where to go. |
39
+ | `extras?` | `NavigationExtras` | Router navigation extras, such as `queryParams`. |
40
+
41
+ ### `root(url: BfNavTarget, extras?: NavigationExtras): Promise<boolean>`
42
+
43
+ Replaces the whole stack with one page (`replaceUrl`, no animation).
44
+
45
+ | Parameter | Type | Description |
46
+ | --------- | ------------------ | ------------------------------------------------ |
47
+ | `url` | `BfNavTarget` | Where to go. |
48
+ | `extras?` | `NavigationExtras` | Router navigation extras, such as `queryParams`. |
49
+
50
+ ### `back(): void`
51
+
52
+ Pops the top page of the deepest active outlet that has one to pop: always a real history
53
+ step. When the page added history entries of its own (a query-only or nested child
54
+ navigation), it goes back past them in one step (`Location.historyGo(-n)`) so the page below
55
+ is shown; otherwise `Location.back()`.
56
+
57
+ ## Uses
58
+
59
+ - [BfNavTarget](bf-nav-target.md)
@@ -0,0 +1,23 @@
1
+ # BfNavDirection
2
+
3
+ The direction a stack navigation animates in: forward, back or a new root
4
+
5
+ Type from `@bitforgehq/ui/mobile` · since 0.2.0
6
+
7
+ The direction a navigation should animate in.
8
+
9
+ ```ts
10
+ import { type BfNavDirection } from '@bitforgehq/ui/mobile';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfNavDirection = 'forward' | 'back' | 'root'
17
+ ```
18
+
19
+ ## Values
20
+
21
+ - `forward`
22
+ - `back`
23
+ - `root`
@@ -0,0 +1,21 @@
1
+ # BfNavTarget
2
+
3
+ A navigation target as the router accepts it: a URL, a UrlTree or commands
4
+
5
+ Type from `@bitforgehq/ui/mobile` · since 0.2.0
6
+
7
+ A router target: a URL string, a `UrlTree` or a commands array, as `Router` accepts.
8
+
9
+ ```ts
10
+ import { type BfNavTarget } from '@bitforgehq/ui/mobile';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfNavTarget = string | UrlTree | readonly unknown[]
17
+ ```
18
+
19
+ ## Used by
20
+
21
+ - [BfNavController](bf-nav-controller.md)
@@ -0,0 +1,28 @@
1
+ # BfNumberInputMode
2
+
3
+ The virtual keyboards a number field can ask a phone to show
4
+
5
+ Type from `@bitforgehq/ui/number-input` · since 0.3.0
6
+
7
+ The virtual keyboard of a `bf-number-input` (native `inputmode`); `''` picks one from `min` and
8
+ `step`.
9
+
10
+ ```ts
11
+ import { type BfNumberInputMode } from '@bitforgehq/ui/number-input';
12
+ ```
13
+
14
+ ## Signature
15
+
16
+ ```ts
17
+ type BfNumberInputMode = 'numeric' | 'decimal' | ''
18
+ ```
19
+
20
+ ## Values
21
+
22
+ - `numeric`
23
+ - `decimal`
24
+ - ``
25
+
26
+ ## Used by
27
+
28
+ - [bf-number-input](../components/number-input.md)
@@ -0,0 +1,25 @@
1
+ # BfNumberInputStep
2
+
3
+ The step of a number field, a number or any for no step check
4
+
5
+ Type from `@bitforgehq/ui/number-input` · since 0.3.0
6
+
7
+ The `step` of a `bf-number-input`: a number, or `'any'` for no step check.
8
+
9
+ ```ts
10
+ import { type BfNumberInputStep } from '@bitforgehq/ui/number-input';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfNumberInputStep = number | 'any'
17
+ ```
18
+
19
+ ## Values
20
+
21
+ - `any`
22
+
23
+ ## Used by
24
+
25
+ - [bf-number-input](../components/number-input.md)
@@ -0,0 +1,29 @@
1
+ # BfOverlayAutoFocus
2
+
3
+ Where focus lands when an overlay opens, its first control or the panel
4
+
5
+ Type from `@bitforgehq/ui/overlay` · since 0.3.0
6
+
7
+ Where focus goes when an overlay opens: the first tabbable element of the content
8
+ (`first-tabbable`, skipping the container's own controls such as `bf-sheet`'s hidden Close) or
9
+ the panel itself (`panel`).
10
+
11
+ ```ts
12
+ import { type BfOverlayAutoFocus } from '@bitforgehq/ui/overlay';
13
+ ```
14
+
15
+ ## Signature
16
+
17
+ ```ts
18
+ type BfOverlayAutoFocus = 'first-tabbable' | 'panel'
19
+ ```
20
+
21
+ ## Values
22
+
23
+ - `first-tabbable`
24
+ - `panel`
25
+
26
+ ## Used by
27
+
28
+ - [BfDialogConfig](bf-dialog-config.md)
29
+ - [BfOverlayOptions](bf-overlay-options.md)
@@ -0,0 +1,22 @@
1
+ # BfOverlayController
2
+
3
+ What the overlay service does for a ref: close it and re-apply its position
4
+
5
+ Interface from `@bitforgehq/ui/overlay` · since 0.2.0
6
+
7
+ What the overlay service does for a ref. Exported for entries that extend `BfOverlayRef` with
8
+ their own controller (the `/mobile` `BfSheetRef`); apps never implement it.
9
+
10
+ ```ts
11
+ import { type BfOverlayController } from '@bitforgehq/ui/overlay';
12
+ ```
13
+
14
+ ## Methods
15
+
16
+ ### `close(): Promise<void>`
17
+
18
+ Plays the exit animation, detaches the overlay and cleans up. Never rejects.
19
+
20
+ ### `updatePosition(): void`
21
+
22
+ Re-applies the overlay's position (after its size changed).
@@ -0,0 +1,36 @@
1
+ # BfOverlayHost
2
+
3
+ What a host shell tells the overlay core: back handling and document scroll
4
+
5
+ Interface from `@bitforgehq/ui/overlay` · since 0.3.0
6
+
7
+ What a host shell (the `/mobile` `provideBfShell()`) tells the overlay core. The core itself
8
+ depends on no platform code: without a host, overlays register no hardware back handler and
9
+ lock document scroll behind a modal overlay, and where the browser has `CloseWatcher`, its close
10
+ requests (Android back in Chrome) close the top overlay.
11
+
12
+ ```ts
13
+ import { type BfOverlayHost } from '@bitforgehq/ui/overlay';
14
+ ```
15
+
16
+ ## Properties
17
+
18
+ | Name | Type | Default | Description |
19
+ | ------------------- | --------- | -------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
20
+ | `documentScrolls` | `boolean` | required | False when the document never scrolls (the mobile shell): overlays skip the scroll lock. |
21
+ | `handlesSystemBack` | `boolean` | | True when the host already delivers the system back action to `registerBack` (the mobile shell on native Android, through Capacitor's `backButton` event): overlays then create no `CloseWatcher` of their own, so one back press never closes two things. |
22
+
23
+ ## Methods
24
+
25
+ ### `registerBack(priority: number, handler: () => boolean | Promise<boolean>): () => void`
26
+
27
+ Registers a hardware back handler at `priority`; returns its unregister function.
28
+
29
+ | Parameter | Type | Description |
30
+ | ---------- | ----------------------------------- | ---------------------------------------------------------- |
31
+ | `priority` | `number` | Higher runs first; the overlay core uses 100. |
32
+ | `handler` | `() => boolean \| Promise<boolean>` | Returns (or resolves) true when it handled the back press. |
33
+
34
+ ## Used by
35
+
36
+ - [BF_OVERLAY_HOST](bf_overlay_host.md)
@@ -0,0 +1,53 @@
1
+ # BfOverlayOptions
2
+
3
+ Options of an overlay: its data, backdrop, focus, dismissal, position and motion
4
+
5
+ Interface from `@bitforgehq/ui/overlay` · since 0.2.0
6
+
7
+ Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use BfOverlayOptions from '@bitforgehq/ui/overlay'; removed in 0.4.0).
8
+
9
+ Options of `BfOverlayService.open()`.
10
+
11
+ ```ts
12
+ import { type BfOverlayOptions } from '@bitforgehq/ui/overlay';
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Name | Type | Default | Description |
18
+ | ------------------- | --------------------------------------------------------------------- | ----------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
19
+ | `data` | `unknown` | | Injected into the content as `BF_OVERLAY_DATA`. |
20
+ | `panelClass` | `string[]` | | Extra classes on the panel (it always carries `bf-overlay-panel`). |
21
+ | `backdrop` | `boolean` | `true` | Renders a backdrop behind the panel (default true; never for passive overlays). |
22
+ | `backdropClass` | `string` | `'bf-overlay-backdrop'` | Class of the backdrop (default `bf-overlay-backdrop`: a black scrim, 40 % light / 60 % dark). |
23
+ | `dismissOnBackdrop` | `boolean` | `true` | A backdrop click closes the overlay (default true). |
24
+ | `dismissOnEscape` | `boolean` | `true` | `Escape` closes the overlay (default true). |
25
+ | `onEscape` | `() => void` | | Runs instead of closing when the overlay is on top and `Escape` is pressed (e.g. an alert resolving with its cancel button). The key is always claimed by the topmost non-passive overlay, so it never reaches an overlay underneath. |
26
+ | `role` | `BfOverlayRole` (`'dialog' \| 'alertdialog' \| 'status'`) | `'dialog'` | Role of the panel (default `dialog`; passive overlays get none unless one is given — a toast is announced through `LiveAnnouncer`). |
27
+ | `ariaLabel` | `string` | | Accessible name of the panel. |
28
+ | `ariaLabelledBy` | `string` | | Id of the element naming the panel. Dropped after the content renders when no element inside the panel carries it and `ariaLabel` is unset, so the panel never points at nothing. |
29
+ | `ariaDescribedBy` | `string` | | Id of the element describing the panel (an alert's message). |
30
+ | `trapFocus` | `boolean` | `true` | Traps Tab focus inside the panel (default true). |
31
+ | `autoFocus` | `BfOverlayAutoFocus` (`'first-tabbable' \| 'panel'`) | `'first-tabbable'` | Where focus goes on open (non-passive overlays): `first-tabbable` (default) — the element marked `[autofocus]`/`[cdkFocusInitial]` when it is focusable (a control, or any element with a `tabindex`, also `-1`), else the first tabbable element inside it, else (all its controls disabled) the first tabbable element of the panel, else the panel; `panel` — the panel itself, so a long text is read from its start (APG dialog pattern). `first-tabbable` skips the library's own container controls (`bf-sheet`'s hidden Close and grabber button, marked with the internal `data-bf-overlay-chrome`): they stay in the Tab order but never take the initial focus, so it lands on your content. |
32
+ | `restoreFocus` | `boolean` | `true` | Returns focus to the previously focused element on close (default true); when that element is gone, to the topmost overlay still open, else focus stays on the body (move it yourself, e.g. to the next row after a delete). |
33
+ | `position` | `BfOverlayPosition` (`'bottom' \| 'center' \| 'top' \| 'fullscreen'`) | `'center'` | Placement of the panel (default `center`). |
34
+ | `closeOnNavigation` | `boolean` | `true` | Closes the overlay when the URL path changes (default true; false for passive overlays): a router navigation, a link, the browser's back and forward buttons. Query- or fragment-only changes never close; a matrix-parameter change (`/a;x=1`) is a path change and closes. Read from `Location.onUrlChange()`, so no router is needed, and a `history.pushState()` made outside Angular's `Location` is not seen. An overlay opened before the first navigation ends (root component, `APP_INITIALIZER`) closes when the start URL redirects: open it after the first `NavigationEnd`, or pass false. |
35
+ | `onNavigation` | `() => void` | | Runs instead of `close()` when a navigation closes the overlay (e.g. an alert answering with its cancel id); it should close the overlay. |
36
+ | `backPriority` | `number` | `100` | Priority of the hardware back handler that closes the overlay (default 100). |
37
+ | `countsAsModal` | `boolean` | `false` | Counts towards `BfOverlayStack.depth()` / `--bf-modal-depth` (default false). |
38
+ | `passive` | `boolean` | `false` | A passive overlay (a toast) has no backdrop, no focus trap, does not move focus, does not count in `BfOverlayStack.count()`, registers no back handler and leaves the page interactive. |
39
+ | `enter` | `(el: HTMLElement) => Animation \| null` | `fadeIn` | Enter animation of the panel (default `fadeIn`); return null for none. |
40
+ | `exit` | `(el: HTMLElement) => Animation \| null` | `fadeOut` | Exit animation of the panel (default `fadeOut`), awaited before detaching. |
41
+ | `injector` | `Injector` | | Parent of the content's injector (default the root injector), so the content resolves the opener's providers, e.g. a feature-level `provideBfLabels()`. |
42
+ | `providers` | `(ref: BfOverlayRef<unknown>) => StaticProvider[]` | | Extra providers of the content's injector, next to `BF_OVERLAY_DATA` and `BfOverlayRef`, built with the new overlay's ref (e.g. a typed ref of a service built on the core). |
43
+
44
+ ## Uses
45
+
46
+ - [BfOverlayAutoFocus](bf-overlay-auto-focus.md)
47
+ - [BfOverlayPosition](bf-overlay-position.md)
48
+ - [BfOverlayRef](bf-overlay-ref.md)
49
+ - [BfOverlayRole](bf-overlay-role.md)
50
+
51
+ ## Used by
52
+
53
+ - [BfOverlayService](bf-overlay-service.md)
@@ -0,0 +1,30 @@
1
+ # BfOverlayPosition
2
+
3
+ Where an overlay panel sits in the viewport: bottom, centre, top or fullscreen
4
+
5
+ Type from `@bitforgehq/ui/overlay` · since 0.2.0
6
+
7
+ Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use BfOverlayPosition from '@bitforgehq/ui/overlay'; removed in 0.4.0).
8
+
9
+ Where the overlay's panel sits in the viewport.
10
+
11
+ ```ts
12
+ import { type BfOverlayPosition } from '@bitforgehq/ui/overlay';
13
+ ```
14
+
15
+ ## Signature
16
+
17
+ ```ts
18
+ type BfOverlayPosition = 'bottom' | 'center' | 'top' | 'fullscreen'
19
+ ```
20
+
21
+ ## Values
22
+
23
+ - `bottom`
24
+ - `center`
25
+ - `top`
26
+ - `fullscreen`
27
+
28
+ ## Used by
29
+
30
+ - [BfOverlayOptions](bf-overlay-options.md)
@@ -0,0 +1,53 @@
1
+ # BfOverlayRef
2
+
3
+ Handle on an open overlay that closes it and resolves with its result
4
+
5
+ Class from `@bitforgehq/ui/overlay` · since 0.2.0
6
+
7
+ Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use BfOverlayRef from '@bitforgehq/ui/overlay'; removed in 0.4.0).
8
+
9
+ Handle to an open overlay, returned by `BfOverlayService.open()` and injectable in the
10
+ overlay's content. `close(result)` plays the exit animation, detaches the overlay and resolves
11
+ `afterClosed` with `result`; later calls are ignored.
12
+
13
+ ```ts
14
+ import { BfOverlayRef } from '@bitforgehq/ui/overlay';
15
+ ```
16
+
17
+ ## Signature
18
+
19
+ ```ts
20
+ class BfOverlayRef<T = unknown>
21
+ ```
22
+
23
+ ## Properties
24
+
25
+ | Name | Type | Default | Description |
26
+ | ------------- | ------------------------- | ------- | -------------------------------------------------------------------------------- |
27
+ | `id` | `string` | | Unique id of the overlay (`bf-overlay-N`). |
28
+ | `afterClosed` | `Promise<T \| undefined>` | | Resolves with the result given to `close()` once the overlay is detached. |
29
+ | `closed` | `Signal<boolean>` | | True once the overlay has been detached. |
30
+ | `isClosing` | `boolean` | | True from the first `close()` call on (the exit animation may still be running). |
31
+
32
+ ## Methods
33
+
34
+ ### `close(result?: T): void`
35
+
36
+ Closes the overlay with an optional result; ignored once closing.
37
+
38
+ | Parameter | Type | Description |
39
+ | --------- | ---- | -------------------------------------- |
40
+ | `result?` | `T` | The value `afterClosed` resolves with. |
41
+
42
+ ### `updatePosition(): void`
43
+
44
+ Re-applies the overlay's position (after its size changed).
45
+
46
+ ## Used by
47
+
48
+ - [BfComponentOverlayRef](bf-component-overlay-ref.md)
49
+ - [BfModalService](bf-modal-service.md)
50
+ - [BfOverlayOptions](bf-overlay-options.md)
51
+ - [BfOverlayService](bf-overlay-service.md)
52
+ - [BfOverlayTemplateContext](bf-overlay-template-context.md)
53
+ - [BfSheetRef](bf-sheet-ref.md)
@@ -0,0 +1,27 @@
1
+ # BfOverlayRole
2
+
3
+ The role an overlay panel carries: a dialog, an alert dialog or a status
4
+
5
+ Type from `@bitforgehq/ui/overlay` · since 0.3.0
6
+
7
+ The ARIA role of an overlay panel: a `dialog`, an `alertdialog` or a passive `status`.
8
+
9
+ ```ts
10
+ import { type BfOverlayRole } from '@bitforgehq/ui/overlay';
11
+ ```
12
+
13
+ ## Signature
14
+
15
+ ```ts
16
+ type BfOverlayRole = 'dialog' | 'alertdialog' | 'status'
17
+ ```
18
+
19
+ ## Values
20
+
21
+ - `dialog`
22
+ - `alertdialog`
23
+ - `status`
24
+
25
+ ## Used by
26
+
27
+ - [BfOverlayOptions](bf-overlay-options.md)
@@ -0,0 +1,53 @@
1
+ # BfOverlayService
2
+
3
+ Opens a component or template in an overlay panel on the Angular CDK
4
+
5
+ Service from `@bitforgehq/ui/overlay` · since 0.2.0
6
+
7
+ Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use BfOverlayService from '@bitforgehq/ui/overlay'; removed in 0.4.0).
8
+
9
+ Opens overlays on the Angular CDK `Overlay`: a component or template in a panel with a
10
+ backdrop, a focus trap, `role`/`aria-modal`/`aria-labelledby`, `Escape` and backdrop click
11
+ closing it, and the page behind it `inert` (see `BfOverlayStack`). A non-passive overlay blocks
12
+ document scroll (CDK `block()` scroll strategy); passive overlays, and every overlay under a
13
+ `BF_OVERLAY_HOST` whose document never scrolls (the `/mobile` `provideBfShell()`), use `noop()`.
14
+ Under `provideBfShell()` the hardware back button (priority 100) closes it too; without a host
15
+ no back handler is registered. Where the browser has `CloseWatcher` (Chromium 120+), a close
16
+ request (Android back in Chrome or a PWA) runs the `Escape` path on the top non-passive overlay,
17
+ unless the host handles the system back itself (`handlesSystemBack`). An overlay that does not
18
+ close on it (`dismissOnEscape: false` without `onEscape`, or an `onEscape` that keeps it open)
19
+ swallows Android web back for as long as it is open, as a non-dismissible sheet swallows the
20
+ hardware back button. A navigation to another URL path closes every non-passive
21
+ overlay (`closeOnNavigation`, read from `Location`, so no router is needed). The content
22
+ injects `BF_OVERLAY_DATA` and `BfOverlayRef` (plus any `providers`). `BfDialogService` and the
23
+ `/mobile` sheet, modal, toast, action sheet and alert services build on it.
24
+
25
+ ```ts
26
+ import { BfOverlayService } from '@bitforgehq/ui/overlay';
27
+ ```
28
+
29
+ ## Methods
30
+
31
+ ### `open<C, T = unknown>(component: Type<C>, options?: BfOverlayOptions): BfComponentOverlayRef<C, T>`
32
+
33
+ Opens `component` in an overlay.
34
+
35
+ | Parameter | Type | Description |
36
+ | ----------- | ------------------ | -------------------------------------------------------------------- |
37
+ | `component` | `Type<C>` | The component to render in the panel. |
38
+ | `options?` | `BfOverlayOptions` | The overlay's data, backdrop, focus, dismissal, position and motion. |
39
+
40
+ ### `open<T = unknown>(template: TemplateRef<unknown>, options?: BfOverlayOptions): BfOverlayRef<T>`
41
+
42
+ Opens `template` in an overlay; its context is `{ $implicit: ref, data }`.
43
+
44
+ | Parameter | Type | Description |
45
+ | ---------- | ---------------------- | -------------------------------------------------------------------- |
46
+ | `template` | `TemplateRef<unknown>` | The template to render in the panel. |
47
+ | `options?` | `BfOverlayOptions` | The overlay's data, backdrop, focus, dismissal, position and motion. |
48
+
49
+ ## Uses
50
+
51
+ - [BfComponentOverlayRef](bf-component-overlay-ref.md)
52
+ - [BfOverlayOptions](bf-overlay-options.md)
53
+ - [BfOverlayRef](bf-overlay-ref.md)
@@ -0,0 +1,24 @@
1
+ # BfOverlayStackOptions
2
+
3
+ How an overlay takes part in the stack: its back priority and modal depth
4
+
5
+ Interface from `@bitforgehq/ui/overlay` · since 0.2.0
6
+
7
+ Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use BfOverlayStackOptions from '@bitforgehq/ui/overlay'; removed in 0.4.0).
8
+
9
+ How an overlay takes part in the stack.
10
+
11
+ ```ts
12
+ import { type BfOverlayStackOptions } from '@bitforgehq/ui/overlay';
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Name | Type | Default | Description |
18
+ | --------------- | --------- | ------- | -------------------------------------------------------------------- |
19
+ | `backPriority` | `number` | `100` | Priority of its hardware back handler (default 100). |
20
+ | `countsAsModal` | `boolean` | `false` | Counts towards `depth()` and `--bf-modal-depth` (page-sheet modals). |
21
+
22
+ ## Used by
23
+
24
+ - [BfOverlayStack](bf-overlay-stack.md)
@@ -0,0 +1,81 @@
1
+ # BfOverlayStack
2
+
3
+ Keeps the open overlays in order and makes the page behind them inert
4
+
5
+ Service from `@bitforgehq/ui/overlay` · since 0.2.0
6
+
7
+ Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use BfOverlayStack from '@bitforgehq/ui/overlay'; removed in 0.4.0).
8
+
9
+ The open modal-like overlays, in order. While any is open, every registered page root (the
10
+ `/mobile` `bf-stack-outlet` hosts register themselves) is `inert`, and `--bf-modal-depth` on the
11
+ roots carries the number of open modals. With no registered root (a desktop page), every direct
12
+ child of `document.body` becomes `inert` instead, except those holding a CDK overlay container
13
+ (`.cdk-overlay-container`, found without importing the CDK), the CDK live
14
+ announcer and `AriaDescriber` containers, `script`/`style`/`template`/`link` and body children
15
+ carrying `data-bf-overlay-keep`; an element that was already `inert` keeps it on close. When
16
+ the stack's injector is destroyed (the app torn down with an overlay open), it removes every
17
+ `inert` and `--bf-modal-depth` it set. Under a `BF_OVERLAY_HOST`
18
+ (`provideBfShell()`) each pushed overlay registers a hardware back handler that closes it; on
19
+ equal priority the newest overlay closes first. Passive overlays (toasts) are never pushed.
20
+
21
+ ```ts
22
+ import { BfOverlayStack } from '@bitforgehq/ui/overlay';
23
+ ```
24
+
25
+ ## Properties
26
+
27
+ | Name | Type | Default | Description |
28
+ | ------- | ---------------- | ------- | ------------------------------------------------------------------------- |
29
+ | `count` | `Signal<number>` | | Number of open modal-like overlays. |
30
+ | `depth` | `Signal<number>` | | Number of open overlays that count as modals (drives `--bf-modal-depth`). |
31
+
32
+ ## Methods
33
+
34
+ ### `registerRoot(el: HTMLElement): () => void`
35
+
36
+ Registers a page root that becomes `inert` while an overlay is open. Returns a function that
37
+ unregisters it (and clears what the stack set on it).
38
+
39
+ | Parameter | Type | Description |
40
+ | --------- | ------------- | ------------------------------------------------ |
41
+ | `el` | `HTMLElement` | The page root, such as a `bf-stack-outlet` host. |
42
+
43
+ ### `push(ref: BfStackedOverlay, options?: BfOverlayStackOptions): void`
44
+
45
+ Adds an overlay on top of the stack. Outside a shell, every body child that holds a CDK
46
+ overlay container (`.cdk-overlay-container`) stays active, so an overlay created on the CDK
47
+ directly, not through `BfOverlayService`, can be pushed as well.
48
+
49
+ | Parameter | Type | Description |
50
+ | ---------- | ----------------------- | --------------------------------------------------- |
51
+ | `ref` | `BfStackedOverlay` | The overlay's ref. |
52
+ | `options?` | `BfOverlayStackOptions` | Its back priority and whether it counts as a modal. |
53
+
54
+ ### `pop(ref: BfStackedOverlay): void`
55
+
56
+ Removes an overlay from the stack.
57
+
58
+ | Parameter | Type | Description |
59
+ | --------- | ------------------ | ------------------ |
60
+ | `ref` | `BfStackedOverlay` | The overlay's ref. |
61
+
62
+ ### `isTop(ref: BfStackedOverlay): boolean`
63
+
64
+ True when `ref` is the newest overlay in the stack (the one that answers `Escape`).
65
+
66
+ | Parameter | Type | Description |
67
+ | --------- | ------------------ | ------------------ |
68
+ | `ref` | `BfStackedOverlay` | The overlay's ref. |
69
+
70
+ ### `releaseBack(ref: BfStackedOverlay): void`
71
+
72
+ Stops the back handler of an overlay that is closing, while it stays in the stack.
73
+
74
+ | Parameter | Type | Description |
75
+ | --------- | ------------------ | ------------------ |
76
+ | `ref` | `BfStackedOverlay` | The overlay's ref. |
77
+
78
+ ## Uses
79
+
80
+ - [BfOverlayStackOptions](bf-overlay-stack-options.md)
81
+ - [BfStackedOverlay](bf-stacked-overlay.md)
@@ -0,0 +1,24 @@
1
+ # BfOverlayTemplateContext
2
+
3
+ The context a template opened as an overlay receives: its ref and data
4
+
5
+ Interface from `@bitforgehq/ui/overlay` · since 0.2.0
6
+
7
+ Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use BfOverlayTemplateContext from '@bitforgehq/ui/overlay'; removed in 0.4.0).
8
+
9
+ Context of a template opened as an overlay: `let-ref` and `let-data="data"`.
10
+
11
+ ```ts
12
+ import { type BfOverlayTemplateContext } from '@bitforgehq/ui/overlay';
13
+ ```
14
+
15
+ ## Properties
16
+
17
+ | Name | Type | Default | Description |
18
+ | ----------- | ----------------------- | -------- | ----------------------------------------------------------- |
19
+ | `$implicit` | `BfOverlayRef<unknown>` | required | The overlay's ref (`let-ref`), to close it with a result. |
20
+ | `data` | `unknown` | required | The `data` the overlay was opened with (`let-data="data"`). |
21
+
22
+ ## Uses
23
+
24
+ - [BfOverlayRef](bf-overlay-ref.md)