@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
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Bitforge AG
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,175 @@
1
+ # @bitforgehq/ui
2
+
3
+ Bitforge's shared Angular component library: Meadow Sage design, Tailwind CSS v4, signals-first, Angular 22.
4
+
5
+ - Widgets: `@bitforgehq/ui`
6
+ - Number field: `@bitforgehq/ui/number-input` (`bf-number-input`; loads Angular Forms, peer
7
+ dependency `@angular/forms`)
8
+ - Icons: `@bitforgehq/ui/icons` (Lucide data, peer dependency `lucide`)
9
+ - Overlay core: `@bitforgehq/ui/overlay` (no Capacitor; peer dependencies `@angular/cdk` and
10
+ `rxjs`)
11
+ - Mobile shell: `@bitforgehq/ui/mobile` (from v0.2)
12
+ - Test support: `@bitforgehq/ui/testing` (jsdom shims, `provideBfTesting()`, CDK component
13
+ harnesses; needs `@angular/cdk` as a dev dependency)
14
+
15
+ Install, theming and every component's API are documented for humans and agents in `ai/UI_GUIDE.md` and `ai/components/*.md` inside this package, and at the docs site (https://bitforge-ui.web.app).
16
+
17
+ ## Install
18
+
19
+ <!-- install:start -->
20
+
21
+ ### 1. Check the prerequisites
22
+
23
+ Node 22.22.3 or later in the 22 line, 24.15 or later in the 24 line, or 26 and later (the Angular CLI 22 range `^22.22.3 || ^24.15.0 || >=26.0.0`; it refuses older versions and warns on odd releases such as 23 and 25), Bun 1.3 or later and the Angular CLI 22.
24
+
25
+ ```bash
26
+ node --version # v22.22.3+, v24.15+ or v26+
27
+ bun --version # 1.3 or later
28
+ bun add --global @angular/cli@22
29
+ ```
30
+
31
+ ### 2. Create the app
32
+
33
+ A new Angular 22 app with plain CSS styles. Skip this step in an existing app.
34
+
35
+ ```bash
36
+ ng new my-app --style css --package-manager bun
37
+ cd my-app
38
+ ```
39
+
40
+ ### 3. Add Tailwind CSS
41
+
42
+ The theme is a Tailwind CSS 4 theme. `ng add tailwindcss` installs Tailwind and its PostCSS plugin and writes `.postcssrc.json`.
43
+
44
+ ```bash
45
+ ng add tailwindcss
46
+ ```
47
+
48
+ ### 4. Add the packages
49
+
50
+ `lucide` provides the icon data for `bf-icon`; the two `@fontsource` packages provide the Manrope and JetBrains Mono fonts.
51
+
52
+ ```bash
53
+ bun add @bitforgehq/ui lucide @fontsource/manrope @fontsource/jetbrains-mono
54
+ ```
55
+
56
+ ### 5. Wire the theme into styles.css
57
+
58
+ Replace the contents of `src/styles.css`. Keep `tailwindcss` first: the theme redefines the palette its utilities read, and registers the package as a Tailwind source, so no `tailwind.config.js` is needed.
59
+
60
+ ```css
61
+ @import 'tailwindcss';
62
+ @import '@bitforgehq/ui/theme.css';
63
+ @import '@fontsource/manrope/500.css';
64
+ @import '@fontsource/manrope/600.css';
65
+ @import '@fontsource/manrope/700.css';
66
+ @import '@fontsource/manrope/800.css';
67
+ @import '@fontsource/jetbrains-mono/400.css';
68
+ ```
69
+
70
+ ### 6. Theme the page
71
+
72
+ In `src/index.html`, give `<body>` the theme background and text colour, so the page itself follows light and dark mode.
73
+
74
+ ```html
75
+ <body class="bg-bg text-text">
76
+ <app-root></app-root>
77
+ </body>
78
+ ```
79
+
80
+ ### 7. Switch to dark mode
81
+
82
+ Add the `dark` class to `<html>` (and remove it for light mode). Every token is redefined under `.dark`, and the theme sets `color-scheme`, so scrollbars and native controls follow too. Components need no `dark:` classes.
83
+
84
+ ```html
85
+ <html lang="en" class="dark">
86
+ <!-- head and body stay as they are -->
87
+ </html>
88
+ ```
89
+
90
+ ### 8. Use a first component
91
+
92
+ Import a widget from `@bitforgehq/ui` into the component that uses it. Replace `src/app/app.ts` with the code below and delete the welcome page it no longer uses, `app.html` and `app.css`. `app.spec.ts` tests that welcome page too: delete its `should render title` case (or make it check the button), so `ng test` keeps passing.
93
+
94
+ ```ts
95
+ import { Component } from '@angular/core';
96
+ import { BfButtonComponent } from '@bitforgehq/ui';
97
+
98
+ @Component({
99
+ selector: 'app-root',
100
+ imports: [BfButtonComponent],
101
+ template: `<bf-button variant="primary">Save</bf-button>`,
102
+ })
103
+ export class App {}
104
+ ```
105
+
106
+ ### 9. Check it
107
+
108
+ Run the app and open it: you should now see an indigo, pill-shaped **Save** button in Manrope on the theme background. With `class="dark"` on `<html>`, the whole page is dark.
109
+
110
+ ```bash
111
+ ng serve
112
+ ```
113
+
114
+ <!-- install:end -->
115
+
116
+ ## Peer dependencies
117
+
118
+ `@bitforgehq/ui` (the widgets entry) needs `@angular/common`, `@angular/core`, `@angular/forms`
119
+ and `lucide` (for `@bitforgehq/ui/icons` and `/mobile`); these are required peers. The widgets
120
+ entry loads no `@angular/forms` code at runtime (its form widgets only implement the Signal Forms
121
+ interfaces); `@bitforgehq/ui/number-input` does, since `bf-number-input` parses through Angular's
122
+ `transformedValue()`, so `@angular/forms` is required for it. The overlay entry
123
+ `@bitforgehq/ui/overlay` (the Capacitor-free overlay core) additionally needs `@angular/cdk` and
124
+ `rxjs` (a CDK peer). The mobile entry `@bitforgehq/ui/mobile` needs those plus `@angular/router`
125
+ and `@capacitor/core`. They are declared optional so a desktop-only install stays free of them:
126
+ an app that imports `/overlay` or `/mobile` installs them itself. The Capacitor plugins `@capacitor/app`,
127
+ `@capacitor/keyboard` and `@capacitor/haptics` are optional peers too; install only the ones your
128
+ app uses, and `/mobile` builds and runs without the others.
129
+
130
+ ## Compatibility
131
+
132
+ `@bitforgehq/ui` 0.x is client-rendered only. SSR, hydration and prerendering of pages that render
133
+ its components are not supported or tested. Component ids come from a module-level counter and can
134
+ differ between server and client, and the shell's theme is read from `localStorage` on the client.
135
+ Render library components only in the browser, for example in a `@defer` block or a client-only
136
+ route. Support will be decided before 1.0.
137
+
138
+ The one server-side check is a render smoke, not a support test: the library repository's
139
+ `tools/ssr-smoke.ts` renders 28 fixtures with `renderApplication()` (every root widget, `bf-icon`,
140
+ `bf-number-input`, a `/mobile` page with `provideBfShell()`, `bf-page`, `bf-header` and
141
+ `bf-content`, `bf-tabs` with `bf-stack-outlet` under the router, and an `/overlay` dialog), and all
142
+ of them render without an error. 19 of them render identically twice. The other 9 number their ids
143
+ differently on every render, from a module-level counter, so they could not hydrate: `bf-checkbox`,
144
+ `bf-input`, `bf-radio-group`, `bf-segmented`, `bf-select`, `bf-textarea`, `bf-toggle`,
145
+ `bf-number-input` and the `/overlay` dialog. Hydration itself is still not supported or tested, and
146
+ more stands in its way: `/mobile` writes to `<html>` and adds a keyboard probe to `<body>`, and an
147
+ `/overlay` dialog renders outside the app root and marks it inert.
148
+
149
+ ## Testing
150
+
151
+ `@bitforgehq/ui/testing` is for your specs only (Vitest, the Angular CLI default, or Jest) and needs
152
+ `@angular/cdk` as a dev dependency (`bun add -d @angular/cdk`) even in an app that never opens an
153
+ overlay. Call `installBfJsdomShims()` in the runner's setup file (the `setupFiles` of the `test`
154
+ target in `angular.json`): it adds the Web Animations API, `PointerEvent` and `matchMedia` where
155
+ jsdom lacks them. `provideBfTesting()` passes defaults and labels to the widgets and cleans up what
156
+ overlays and themes leave on the document after each test (when TestBed destroys the test
157
+ environment, so keep its default `teardown: { destroyAfterEach: true }`), and the CDK harnesses
158
+ (`BfSelectHarness`, `BfRadioGroupHarness`, `BfSegmentedHarness`, `BfDialogHarness`,
159
+ `BfMenuButtonHarness`, `BfMenuHarness`, `BfMenuItemHarness`, `BfDesktopToastHarness`) drive the
160
+ widgets whose DOM a spec should not query by hand; overlays come from
161
+ `TestbedHarnessEnvironment.documentRootLoader(fixture)`. An app on the mobile shell uses
162
+ `provideBfShellTesting()` from `@bitforgehq/ui/mobile` instead (router, shell, an in-memory theme
163
+ store and the same cleanup), so `/testing` itself never loads Capacitor.
164
+
165
+ ## Density and labels
166
+
167
+ Every field and control shares one height scale (`BfSize`: `sm` 32, `md` 40, `lg` 48 px) with a
168
+ compact `md` default for desktop web apps. Set another step once with `provideBfDefaults()` in
169
+ `ApplicationConfig.providers` (`{ size: 'sm' }` for a data-dense app, `{ fieldSize: 'lg' }` for a
170
+ Capacitor app, because under touch the actions and choice controls reach 44 px through an invisible
171
+ extension but text fields get none, so only the fields need the 48 px step) or in a component's
172
+ `providers` for one part of the app, such as a dense toolbar.
173
+ `provideBfLabels()` replaces every built-in English string, including the default error text
174
+ shown for a validator without a message, the same two ways. The docs site's Density and Labels
175
+ guides list the scale and every string.
@@ -0,0 +1,383 @@
1
+ {
2
+ "generatedFrom": "tools/gen-ai-docs.ts",
3
+ "components": [
4
+ {
5
+ "name": "action-bar",
6
+ "selector": "bf-action-bar",
7
+ "className": "BfActionBarComponent",
8
+ "category": "Actions",
9
+ "entryPoint": "@bitforgehq/ui",
10
+ "summary": "Floating pill of contextual actions that appears while items are selected",
11
+ "since": "0.1.0"
12
+ },
13
+ {
14
+ "name": "action-sheet",
15
+ "selector": "bf-action-sheet",
16
+ "className": "BfActionSheetComponent",
17
+ "category": "Overlays",
18
+ "entryPoint": "@bitforgehq/ui/mobile",
19
+ "summary": "Bottom panel of labelled actions with a separate cancel button, destructive ones shown in red",
20
+ "since": "0.2.0"
21
+ },
22
+ {
23
+ "name": "alert",
24
+ "selector": "bf-alert",
25
+ "className": "BfAlertComponent",
26
+ "category": "Feedback",
27
+ "entryPoint": "@bitforgehq/ui",
28
+ "summary": "Inline status message in four tones with a title and an optional dismiss button",
29
+ "since": "0.1.0"
30
+ },
31
+ {
32
+ "name": "alert-dialog",
33
+ "selector": "bf-alert-dialog",
34
+ "className": "BfAlertDialogComponent",
35
+ "category": "Overlays",
36
+ "entryPoint": "@bitforgehq/ui/mobile",
37
+ "summary": "Centred confirmation dialog with a title, message and a row of role-styled buttons",
38
+ "since": "0.2.0"
39
+ },
40
+ {
41
+ "name": "avatar",
42
+ "selector": "bf-avatar",
43
+ "className": "BfAvatarComponent",
44
+ "category": "Data display",
45
+ "entryPoint": "@bitforgehq/ui",
46
+ "summary": "Round avatar showing a photo or initials, in three sizes and four color variants",
47
+ "since": "0.1.0"
48
+ },
49
+ {
50
+ "name": "back-button",
51
+ "selector": "bf-back-button",
52
+ "className": "BfBackButtonComponent",
53
+ "category": "Navigation",
54
+ "entryPoint": "@bitforgehq/ui/mobile",
55
+ "summary": "Header back button that pops the page stack or falls back to a default route",
56
+ "since": "0.2.0"
57
+ },
58
+ {
59
+ "name": "badge",
60
+ "selector": "bf-badge",
61
+ "className": "BfBadgeComponent",
62
+ "category": "Data display",
63
+ "entryPoint": "@bitforgehq/ui",
64
+ "summary": "Small status label in semantic tones, or a compact numeric pill for counts",
65
+ "since": "0.1.0"
66
+ },
67
+ {
68
+ "name": "button",
69
+ "selector": "bf-button",
70
+ "className": "BfButtonComponent",
71
+ "category": "Actions",
72
+ "entryPoint": "@bitforgehq/ui",
73
+ "summary": "Pill-shaped action button with five variants, three sizes and a loading state",
74
+ "since": "0.1.0"
75
+ },
76
+ {
77
+ "name": "card",
78
+ "selector": "bf-card",
79
+ "className": "BfCardComponent",
80
+ "category": "Data display",
81
+ "entryPoint": "@bitforgehq/ui",
82
+ "summary": "Content surface with an optional header slot, in four visual styles from raised to flat",
83
+ "since": "0.1.0"
84
+ },
85
+ {
86
+ "name": "checkbox",
87
+ "selector": "bf-checkbox",
88
+ "className": "BfCheckboxComponent",
89
+ "category": "Forms",
90
+ "entryPoint": "@bitforgehq/ui",
91
+ "summary": "Rounded checkbox with an optional label that binds to Signal Forms",
92
+ "since": "0.1.0"
93
+ },
94
+ {
95
+ "name": "chip",
96
+ "selector": "bf-chip",
97
+ "className": "BfChipComponent",
98
+ "category": "Forms",
99
+ "entryPoint": "@bitforgehq/ui",
100
+ "summary": "Toggleable filter chip with a check mark when selected, in tonal or ink style",
101
+ "since": "0.1.0"
102
+ },
103
+ {
104
+ "name": "chip-group",
105
+ "selector": "bf-chip-group",
106
+ "className": "BfChipGroupComponent",
107
+ "category": "Forms",
108
+ "entryPoint": "@bitforgehq/ui",
109
+ "summary": "Named row of chips that picks one like radios, or groups independent toggles",
110
+ "since": "0.3.0"
111
+ },
112
+ {
113
+ "name": "content",
114
+ "selector": "bf-content",
115
+ "className": "BfContentComponent",
116
+ "category": "Navigation",
117
+ "entryPoint": "@bitforgehq/ui/mobile",
118
+ "summary": "Page's single scroll container that keeps focused fields clear of the soft keyboard",
119
+ "since": "0.2.0"
120
+ },
121
+ {
122
+ "name": "desktop-toast",
123
+ "selector": "bf-desktop-toast",
124
+ "className": "BfDesktopToastComponent",
125
+ "category": "Overlays",
126
+ "entryPoint": "@bitforgehq/ui/overlay",
127
+ "summary": "Desktop notification card in a bottom corner stack of up to three",
128
+ "since": "0.3.0"
129
+ },
130
+ {
131
+ "name": "dialog",
132
+ "selector": "bf-dialog",
133
+ "className": "BfDialogComponent",
134
+ "category": "Overlays",
135
+ "entryPoint": "@bitforgehq/ui/overlay",
136
+ "summary": "Desktop modal dialog with a title, scrolling body, footer actions and focus trap",
137
+ "since": "0.3.0"
138
+ },
139
+ {
140
+ "name": "empty-state",
141
+ "selector": "bf-empty-state",
142
+ "className": "BfEmptyStateComponent",
143
+ "category": "Feedback",
144
+ "entryPoint": "@bitforgehq/ui",
145
+ "summary": "Placeholder for an empty screen or list with icon, title, message and action",
146
+ "since": "0.1.0"
147
+ },
148
+ {
149
+ "name": "field",
150
+ "selector": "bf-field",
151
+ "className": "BfFieldComponent",
152
+ "category": "Forms",
153
+ "entryPoint": "@bitforgehq/ui",
154
+ "summary": "Label, help text and error text wrapper that wires ids for assistive tech",
155
+ "since": "0.1.0"
156
+ },
157
+ {
158
+ "name": "header",
159
+ "selector": "bf-header",
160
+ "className": "BfHeaderComponent",
161
+ "category": "Navigation",
162
+ "entryPoint": "@bitforgehq/ui/mobile",
163
+ "summary": "Page header toolbar with a large title that collapses into the toolbar on scroll",
164
+ "since": "0.2.0"
165
+ },
166
+ {
167
+ "name": "icon",
168
+ "selector": "bf-icon",
169
+ "className": "BfIconComponent",
170
+ "category": "Icons",
171
+ "entryPoint": "@bitforgehq/ui/icons",
172
+ "summary": "Tree-shakable Lucide icon renderer, decorative by default or labelled when meaningful",
173
+ "since": "0.1.0"
174
+ },
175
+ {
176
+ "name": "icon-button",
177
+ "selector": "bf-icon-button",
178
+ "className": "BfIconButtonComponent",
179
+ "category": "Actions",
180
+ "entryPoint": "@bitforgehq/ui",
181
+ "summary": "Round icon-only button for toolbars and rows, with a required accessible label",
182
+ "since": "0.1.0"
183
+ },
184
+ {
185
+ "name": "input",
186
+ "selector": "bf-input",
187
+ "className": "BfInputComponent",
188
+ "category": "Forms",
189
+ "entryPoint": "@bitforgehq/ui",
190
+ "summary": "Single-line text field with label, help and error text, icon slots and Signal Forms binding",
191
+ "since": "0.1.0"
192
+ },
193
+ {
194
+ "name": "list",
195
+ "selector": "bf-list",
196
+ "className": "BfListComponent",
197
+ "category": "Data display",
198
+ "entryPoint": "@bitforgehq/ui",
199
+ "summary": "Container for list rows, inset by default with rounded corners on a warm background",
200
+ "since": "0.1.0"
201
+ },
202
+ {
203
+ "name": "list-item",
204
+ "selector": "bf-list-item",
205
+ "className": "BfListItemComponent",
206
+ "category": "Data display",
207
+ "entryPoint": "@bitforgehq/ui",
208
+ "summary": "List row with leading slot, title, subtitle, trailing slot and an optional chevron",
209
+ "since": "0.1.0"
210
+ },
211
+ {
212
+ "name": "menu",
213
+ "selector": "bf-menu",
214
+ "className": "BfMenuComponent",
215
+ "category": "Overlays",
216
+ "entryPoint": "@bitforgehq/ui/overlay",
217
+ "summary": "Keyboard-operable menu panel with items, checkbox and radio items, groups and submenus",
218
+ "since": "0.3.0"
219
+ },
220
+ {
221
+ "name": "menu-button",
222
+ "selector": "bf-menu-button",
223
+ "className": "BfMenuButtonComponent",
224
+ "category": "Overlays",
225
+ "entryPoint": "@bitforgehq/ui/overlay",
226
+ "summary": "Styled button that opens a menu, with outline, text, tonal and icon-only looks",
227
+ "since": "0.3.0"
228
+ },
229
+ {
230
+ "name": "modal",
231
+ "selector": "bf-modal",
232
+ "className": "BfModalComponent",
233
+ "category": "Overlays",
234
+ "entryPoint": "@bitforgehq/ui/mobile",
235
+ "summary": "Modal overlay shown as an inset card over the scaled-down page, or full screen",
236
+ "since": "0.2.0"
237
+ },
238
+ {
239
+ "name": "number-input",
240
+ "selector": "bf-number-input",
241
+ "className": "BfNumberInputComponent",
242
+ "category": "Forms",
243
+ "entryPoint": "@bitforgehq/ui/number-input",
244
+ "summary": "Number field that binds number or null, with native min, max and step",
245
+ "since": "0.3.0"
246
+ },
247
+ {
248
+ "name": "page",
249
+ "selector": "bf-page",
250
+ "className": "BfPageComponent",
251
+ "category": "Navigation",
252
+ "entryPoint": "@bitforgehq/ui/mobile",
253
+ "summary": "Frame for one stacked mobile screen that supplies lifecycle events and shared page state",
254
+ "since": "0.2.0"
255
+ },
256
+ {
257
+ "name": "progress",
258
+ "selector": "bf-progress",
259
+ "className": "BfProgressComponent",
260
+ "category": "Data display",
261
+ "entryPoint": "@bitforgehq/ui",
262
+ "summary": "Progress bar in two sizes and four tones for completion, quotas and unknown waits",
263
+ "since": "0.1.0"
264
+ },
265
+ {
266
+ "name": "radio-group",
267
+ "selector": "bf-radio-group",
268
+ "className": "BfRadioGroupComponent",
269
+ "category": "Forms",
270
+ "entryPoint": "@bitforgehq/ui",
271
+ "summary": "Group of radio buttons for choosing one option, with optional per-option descriptions",
272
+ "since": "0.1.0"
273
+ },
274
+ {
275
+ "name": "refresher",
276
+ "selector": "bf-refresher",
277
+ "className": "BfRefresherComponent",
278
+ "category": "Navigation",
279
+ "entryPoint": "@bitforgehq/ui/mobile",
280
+ "summary": "Pull-to-refresh indicator with haptic feedback, native iOS bounce and an Android-style pull",
281
+ "since": "0.2.0"
282
+ },
283
+ {
284
+ "name": "segmented",
285
+ "selector": "bf-segmented",
286
+ "className": "BfSegmentedComponent",
287
+ "category": "Forms",
288
+ "entryPoint": "@bitforgehq/ui",
289
+ "summary": "Segmented control for switching between two to four views, keyboard-navigable like radios",
290
+ "since": "0.1.0"
291
+ },
292
+ {
293
+ "name": "select",
294
+ "selector": "bf-select",
295
+ "className": "BfSelectComponent",
296
+ "category": "Forms",
297
+ "entryPoint": "@bitforgehq/ui",
298
+ "summary": "Native single-choice dropdown styled like the text field, with Signal Forms binding",
299
+ "since": "0.1.0"
300
+ },
301
+ {
302
+ "name": "sheet",
303
+ "selector": "bf-sheet",
304
+ "className": "BfSheetComponent",
305
+ "category": "Overlays",
306
+ "entryPoint": "@bitforgehq/ui/mobile",
307
+ "summary": "Bottom sheet with snap points, drag to dismiss and a backdrop",
308
+ "since": "0.2.0"
309
+ },
310
+ {
311
+ "name": "spinner",
312
+ "selector": "bf-spinner",
313
+ "className": "BfSpinnerComponent",
314
+ "category": "Feedback",
315
+ "entryPoint": "@bitforgehq/ui",
316
+ "summary": "Indeterminate loading spinner in three sizes that inherits its parent's text color",
317
+ "since": "0.1.0"
318
+ },
319
+ {
320
+ "name": "stack-outlet",
321
+ "selector": "bf-stack-outlet",
322
+ "className": "BfStackOutletComponent",
323
+ "category": "Navigation",
324
+ "entryPoint": "@bitforgehq/ui/mobile",
325
+ "summary": "Router outlet keeping a live page stack with slide transitions and iOS swipe back",
326
+ "since": "0.2.0"
327
+ },
328
+ {
329
+ "name": "tab",
330
+ "selector": "bf-tab",
331
+ "className": "BfTabComponent",
332
+ "category": "Navigation",
333
+ "entryPoint": "@bitforgehq/ui",
334
+ "summary": "One tab bar destination with an icon, a label and an optional count badge",
335
+ "since": "0.1.0"
336
+ },
337
+ {
338
+ "name": "tab-bar",
339
+ "selector": "bf-tab-bar",
340
+ "className": "BfTabBarComponent",
341
+ "category": "Navigation",
342
+ "entryPoint": "@bitforgehq/ui",
343
+ "summary": "Floating pill tab bar for mobile apps with arrow-key selection and count badges",
344
+ "since": "0.1.0"
345
+ },
346
+ {
347
+ "name": "tabs",
348
+ "selector": "bf-tabs",
349
+ "className": "BfTabsComponent",
350
+ "category": "Navigation",
351
+ "entryPoint": "@bitforgehq/ui/mobile",
352
+ "summary": "Tabs page with one navigation stack per tab, wiring the tab bar to the router",
353
+ "since": "0.2.0"
354
+ },
355
+ {
356
+ "name": "textarea",
357
+ "selector": "bf-textarea",
358
+ "className": "BfTextareaComponent",
359
+ "category": "Forms",
360
+ "entryPoint": "@bitforgehq/ui",
361
+ "summary": "Multi-line text field with label, help and error text, and Signal Forms binding",
362
+ "since": "0.1.0"
363
+ },
364
+ {
365
+ "name": "toast",
366
+ "selector": "bf-toast",
367
+ "className": "BfToastComponent",
368
+ "category": "Overlays",
369
+ "entryPoint": "@bitforgehq/ui/mobile",
370
+ "summary": "Passive status pill with an optional action that never steals focus",
371
+ "since": "0.2.0"
372
+ },
373
+ {
374
+ "name": "toggle",
375
+ "selector": "bf-toggle",
376
+ "className": "BfToggleComponent",
377
+ "category": "Forms",
378
+ "entryPoint": "@bitforgehq/ui",
379
+ "summary": "On/off switch for settings that apply immediately, with Signal Forms binding",
380
+ "since": "0.1.0"
381
+ }
382
+ ]
383
+ }