@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,221 @@
1
+ # bf-icon-button
2
+
3
+ Round icon-only button for toolbars and rows, with a required accessible label
4
+
5
+ `BfIconButtonComponent` from `@bitforgehq/ui` · Actions · since 0.1.0
6
+
7
+ ## Example
8
+
9
+ ```ts
10
+ import { Component, signal } from '@angular/core';
11
+ import { BfIconButtonComponent } from '@bitforgehq/ui';
12
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
13
+ import { Ellipsis, Plus, Search, X } from 'lucide';
14
+
15
+ /**
16
+ * The bf-icon-button overview.
17
+ *
18
+ * Live demo of `bf-icon-button`: the four visual variants, each reporting its press; then the sm, md and lg sizes in a row.
19
+ */
20
+ @Component({
21
+ selector: 'app-example-icon-button-overview',
22
+ imports: [BfIconButtonComponent, BfIconComponent],
23
+ template: `
24
+ <div class="flex flex-col gap-3">
25
+ <div class="flex flex-wrap items-center gap-3">
26
+ <bf-icon-button label="Search" variant="tonal" (clicked)="press('Search')">
27
+ <bf-icon [icon]="search" />
28
+ </bf-icon-button>
29
+ <bf-icon-button label="Add" variant="primary" (clicked)="press('Add')">
30
+ <bf-icon [icon]="plus" />
31
+ </bf-icon-button>
32
+ <bf-icon-button label="More" variant="outline" (clicked)="press('More')">
33
+ <bf-icon [icon]="ellipsis" />
34
+ </bf-icon-button>
35
+ <bf-icon-button label="Close" variant="text" (clicked)="press('Close')">
36
+ <bf-icon [icon]="x" />
37
+ </bf-icon-button>
38
+ </div>
39
+ <p data-status aria-live="polite" class="text-caption text-text-muted">{{ status() }}</p>
40
+ <div data-sizes class="flex flex-wrap items-center gap-3">
41
+ <bf-icon-button size="sm" label="New task, sm"><bf-icon [icon]="plus" /></bf-icon-button>
42
+ <bf-icon-button label="New task, md"><bf-icon [icon]="plus" /></bf-icon-button>
43
+ <bf-icon-button size="lg" label="New task, lg"><bf-icon [icon]="plus" /></bf-icon-button>
44
+ </div>
45
+ </div>
46
+ `,
47
+ })
48
+ export class IconButtonOverviewExampleComponent {
49
+ readonly search = Search;
50
+ readonly plus = Plus;
51
+ readonly ellipsis = Ellipsis;
52
+ readonly x = X;
53
+ readonly status = signal('Press an icon button.');
54
+
55
+ press(label: string): void {
56
+ this.status.set(`Pressed ${label}.`);
57
+ }
58
+ }
59
+ ```
60
+
61
+ ## Overview
62
+
63
+ Round button that holds a single icon, for toolbars, headers and list rows. The `label` is
64
+ required because the icon alone gives assistive tech no name.
65
+
66
+ A round button for a single icon: search in a header, close on a sheet, more-actions on a row. `label` is required and becomes the accessible name.
67
+
68
+ ## When to use
69
+
70
+ Use `bf-icon-button` for a frequent action whose icon is unmistakable: search, close, more, edit in a table row. Use [bf-button](https://bitforge-ui.web.app/components/button) instead when the action needs a word to be understood, and [bf-menu-button](https://bitforge-ui.web.app/components/menu-button) with `iconOnly` for a "More" button that opens a menu.
71
+
72
+ ## Basic usage
73
+
74
+ ```ts
75
+ import { Component, signal } from '@angular/core';
76
+ import { BfIconButtonComponent } from '@bitforgehq/ui';
77
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
78
+ import { Search } from 'lucide';
79
+
80
+ /**
81
+ * An icon button named by its label.
82
+ *
83
+ * The label is the accessible name (and the tooltip); `clicked` reports the press.
84
+ */
85
+ @Component({
86
+ selector: 'app-example-icon-button-basic',
87
+ imports: [BfIconButtonComponent, BfIconComponent],
88
+ template: `
89
+ <div class="flex items-center gap-3">
90
+ <bf-icon-button label="Search" (clicked)="opened.set(true)">
91
+ <bf-icon [icon]="search" />
92
+ </bf-icon-button>
93
+ <span aria-live="polite" class="text-caption text-text-muted">{{
94
+ opened() ? 'Search opened.' : ''
95
+ }}</span>
96
+ </div>
97
+ `,
98
+ })
99
+ export class IconButtonBasicExampleComponent {
100
+ protected readonly search = Search;
101
+ protected readonly opened = signal(false);
102
+ }
103
+ ```
104
+
105
+ ## Variants and sizes
106
+
107
+ `tonal` (default), `primary`, `outline`, `text`; square sizes `sm` 32, `md` 40 (default), `lg` 48 px, the `BfSize` scale of `bf-button`. Unset, `size` follows `provideBfDefaults()`'s `controlSize`, `md` by default (`provideBfDefaults({ size: 'lg' })` enlarges every control of a Capacitor app; `{ size: 'sm' }` in a component's `providers` makes a dense sub-tree). Under a fine pointer (mouse, trackpad) the visible box is the hit area (32 px and up, above the 24 px of WCAG 2.5.8), so dense rows never overlap; under a coarse pointer (touch) `sm` and `md` grow to a 44 px hit area through an invisible extension.
108
+
109
+ ```ts
110
+ import { Component } from '@angular/core';
111
+ import { BfIconButtonComponent } from '@bitforgehq/ui';
112
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
113
+ import { Ellipsis, Plus } from 'lucide';
114
+
115
+ /** A large primary icon button and a small text one. */
116
+ @Component({
117
+ selector: 'app-example-icon-button-variants',
118
+ imports: [BfIconButtonComponent, BfIconComponent],
119
+ template: `
120
+ <div class="flex items-center gap-3">
121
+ <bf-icon-button label="Add" variant="primary" size="lg"
122
+ ><bf-icon [icon]="plus"
123
+ /></bf-icon-button>
124
+ <bf-icon-button label="More" variant="text" size="sm"
125
+ ><bf-icon [icon]="ellipsis"
126
+ /></bf-icon-button>
127
+ </div>
128
+ `,
129
+ })
130
+ export class IconButtonVariantsExampleComponent {
131
+ protected readonly plus = Plus;
132
+ protected readonly ellipsis = Ellipsis;
133
+ }
134
+ ```
135
+
136
+ ## Desktop
137
+
138
+ Hover tints the button (`tonal`, `text`) or darkens it (`primary`, the `outline` border), with the pointer cursor; disabled shows `not-allowed`. Hover styles apply only on devices that can hover, so a tap never leaves one stuck. The focus ring shows on keyboard focus only. There is no built-in tooltip, and `label` is read by assistive tech only, so keep to icons whose meaning is clear without one. Under a fine pointer the 32/40/48 px square is the hit area. Desktop density is the default `md` step; `provideBfDefaults({ size: 'sm' })`, or `{ size: 'sm' }` in a component's `providers`, makes a dense toolbar, table or sidebar ([density guide](https://bitforge-ui.web.app/density)).
139
+
140
+ ## Theming
141
+
142
+ Consumes tokens by variant, rest → hover:
143
+
144
+ - `tonal` (default): `primary-soft` / `primary-strong` → `primary-soft-hover`
145
+ - `primary`: `primary` / `on-primary` → `primary-hover`
146
+ - `outline`: `surface` / `text` / `border-strong` (the control boundary, ≥ 3:1) → `text-muted` border; focus swaps the border to `primary`
147
+ - `text`: `text-muted` → `surface-muted` / `text`
148
+
149
+ Pressed: `primary` → `primary-pressed`; `tonal`, `outline` and `text` → `primary-soft-pressed`
150
+ (the `text` icon turns `text`). A disabled icon button has no pressed state.
151
+
152
+ Cursor: `pointer` while enabled, `not-allowed` when disabled. Disabled (any variant):
153
+ `surface-sunken` / `text-disabled`, border turns transparent. Focus ring: `ring`. Shape: `rounded-control` (`--radius-control`, `9999px` by default, so a pill); override the token to move every pill control off the pill at once.
154
+
155
+ ## Accessibility
156
+
157
+ Native `<button>`; its `type` reflects the `type` input. `label` is required and becomes the button's `aria-label`, since the icon inside carries no text of its own. `disabled` sets the native attribute, which also removes it from the tab order and swallows clicks.
158
+
159
+ ### Keyboard
160
+
161
+ | Key | Action |
162
+ | ----------------------------------- | ------------------------------------------------------ |
163
+ | <kbd>Tab</kbd> | Moves focus to the button; a `disabled` one is skipped |
164
+ | <kbd>Enter</kbd> / <kbd>Space</kbd> | Activates it and emits `clicked` |
165
+
166
+ ## Inputs
167
+
168
+ | Name | Type | Default | Description |
169
+ | ---------- | --------------------------------------------------------------------- | ----------- | ------------------------------------------------------------------------------------------------------------------- |
170
+ | `variant` | `BfIconButtonVariant` (`'tonal' \| 'primary' \| 'outline' \| 'text'`) | `'tonal'` | Visual style: tonal (soft tint, default), primary, outline, text. |
171
+ | `size` | `BfSize \| undefined` (`'sm' \| 'md' \| 'lg' \| undefined`) | `undefined` | Height step: sm 32, md 40, lg 48 px (square); unset follows `provideBfDefaults()` (`controlSize`, `md` by default). |
172
+ | `type` | `BfButtonType` (`'button' \| 'submit' \| 'reset'`) | `'button'` | Native button type. |
173
+ | `disabled` | `boolean` | `false` | Disables the control and swallows clicks. |
174
+ | `label` | `string` | required | Accessible name announced instead of the icon. |
175
+
176
+ ## Outputs
177
+
178
+ | Name | Payload | Description |
179
+ | --------- | ------- | ------------------------------- |
180
+ | `clicked` | `Event` | Emitted on click while enabled. |
181
+
182
+ ## Slots
183
+
184
+ - `default`: The icon, a `bf-icon`.
185
+
186
+ ## Notes
187
+
188
+ ### Do
189
+
190
+ - Write the label as the action ("Search", "Close"), not the icon name.
191
+ - Use `text` inside list rows and cards so the row stays calm.
192
+
193
+ ### Don't
194
+
195
+ - Don't put text in the slot; use `bf-button` with an icon slot instead.
196
+
197
+ ## Migration notes
198
+
199
+ ### 0.3.0
200
+
201
+ **Behaviour:** `size` is a `BfSize` and, unset, follows `provideBfDefaults()`'s `controlSize`. The
202
+ 44 px hit extension applies only under a coarse pointer, and the `outline` variant's compensates its
203
+ 1.5 px border.
204
+
205
+ **Behaviour:** shaped with the new `rounded-control` (`--radius-control`, `9999px` by default, so it renders as before); override the token to move off the pill.
206
+
207
+ JSDoc of `icon-button.component.ts` for the API reference: `@summary`/`@since` on the exported
208
+ symbols; `@slot` docs for `default`; template handlers and framework hooks marked `@internal`, so
209
+ the reference leaves them out. No behaviour change.
210
+
211
+ **Behaviour:** a pressed state (F-045): `primary` takes `primary-pressed`, `tonal`, `outline` and `text` `primary-soft-pressed` (the `text` icon turns `text`) while the button is held down. None while disabled; under forced colours the system colours win.
212
+
213
+ ### 0.2.0
214
+
215
+ The `outline` border is `border-strong` (hover `text-muted`).
216
+
217
+ Fixed: pointer cursor while enabled, `not-allowed` when disabled.
218
+
219
+ ### 0.1.0
220
+
221
+ New `bf-icon-button`: a round button that holds a single icon, with `tonal` (default), `primary`, `outline` and `text` variants and `sm`/`md`/`lg` (32/40/48 px) square sizes. `label` is required and renders as `aria-label` since the icon alone gives assistive tech no name. `sm` and `md` extend the hit area vertically to 44 px with an invisible `::after`, matching `bf-button`, so adjacent icon buttons in a toolbar don't overlap.
@@ -0,0 +1,176 @@
1
+ # bf-icon
2
+
3
+ Tree-shakable Lucide icon renderer, decorative by default or labelled when meaningful
4
+
5
+ `BfIconComponent` from `@bitforgehq/ui/icons` · Icons · since 0.1.0
6
+
7
+ ## Example
8
+
9
+ ```ts
10
+ import { Component } from '@angular/core';
11
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
12
+ import { ChevronLeft, Heart, Search } from 'lucide';
13
+
14
+ /**
15
+ * The bf-icon overview.
16
+ *
17
+ * Live demo of `bf-icon`: three Lucide icons across the three visual sizes.
18
+ */
19
+ @Component({
20
+ selector: 'app-example-icon-overview',
21
+ imports: [BfIconComponent],
22
+ template: `
23
+ <div class="text-text flex flex-wrap items-center gap-4">
24
+ <bf-icon [icon]="search" size="sm" />
25
+ <bf-icon [icon]="search" size="md" />
26
+ <bf-icon [icon]="search" size="lg" />
27
+ <bf-icon [icon]="heart" size="sm" />
28
+ <bf-icon [icon]="heart" size="md" />
29
+ <bf-icon [icon]="heart" size="lg" />
30
+ <bf-icon [icon]="chevronLeft" size="sm" />
31
+ <bf-icon [icon]="chevronLeft" size="md" />
32
+ <bf-icon [icon]="chevronLeft" size="lg" />
33
+ </div>
34
+ `,
35
+ })
36
+ export class IconOverviewExampleComponent {
37
+ readonly search = Search;
38
+ readonly heart = Heart;
39
+ readonly chevronLeft = ChevronLeft;
40
+ }
41
+ ```
42
+
43
+ ## Overview
44
+
45
+ Renders a Lucide icon from its data, tree-shakably and without a registry.
46
+ Import the icon you need from `lucide` (e.g. `import { Search } from 'lucide'`) and bind it.
47
+ Decorative by default; pass `label` when the icon carries meaning on its own (e.g. an icon-only
48
+ control without visible text).
49
+
50
+ Renders a Lucide icon from its data. Import the icon you need from `lucide` and bind it; nothing is registered globally and unused icons are tree-shaken. Every widget's icon slot accepts a `bf-icon`, and also any other SVG or component, including privately licensed icon sets.
51
+
52
+ ## When to use
53
+
54
+ Use `bf-icon` for a Lucide icon anywhere an icon is needed, in a widget's icon slot or on its own. Use [bf-icon-button](https://bitforge-ui.web.app/components/icon-button) instead when the icon is a control, and [bf-avatar](https://bitforge-ui.web.app/components/avatar) for a person.
55
+
56
+ ## Basic usage
57
+
58
+ ```ts
59
+ import { Component } from '@angular/core';
60
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
61
+ import { Search } from 'lucide';
62
+
63
+ /** An icon from its imported data. */
64
+ @Component({
65
+ selector: 'app-example-icon-basic',
66
+ imports: [BfIconComponent],
67
+ template: `<bf-icon [icon]="search" />`,
68
+ })
69
+ export class IconBasicExampleComponent {
70
+ readonly search = Search;
71
+ }
72
+ ```
73
+
74
+ ## Sizes
75
+
76
+ `sm` 16 px, `md` 20 px (default), `lg` 24 px. The stroke follows `currentColor`.
77
+
78
+ ```ts
79
+ import { Component } from '@angular/core';
80
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
81
+ import { Search } from 'lucide';
82
+
83
+ /** A large icon that takes its colour from a text class. */
84
+ @Component({
85
+ selector: 'app-example-icon-sizes',
86
+ imports: [BfIconComponent],
87
+ template: `<bf-icon [icon]="search" size="lg" class="text-text-muted" />`,
88
+ })
89
+ export class IconSizesExampleComponent {
90
+ protected readonly search = Search;
91
+ }
92
+ ```
93
+
94
+ ## Filled details
95
+
96
+ A few Lucide icons fill small shapes on top of their strokes: the dots of `Palette`, the points of `ChartScatter`, the hole of `KeyRound`. `bf-icon` renders every attribute Lucide sets on an element, including its `fill`, so those shapes show as solid `currentColor` dots instead of disappearing. `tools/lucide-attributes.test.ts` fails if a Lucide release adds an attribute the renderer does not bind.
97
+
98
+ ```ts
99
+ import { Component } from '@angular/core';
100
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
101
+ import { ChartScatter, KeyRound, Palette } from 'lucide';
102
+
103
+ /** Icons whose Lucide data fills some shapes: the palette dots, the scatter points, the key hole. */
104
+ @Component({
105
+ selector: 'app-example-icon-filled',
106
+ imports: [BfIconComponent],
107
+ template: `
108
+ <div class="text-text flex items-center gap-4">
109
+ <bf-icon [icon]="palette" size="lg" label="Palette" />
110
+ <bf-icon [icon]="chartScatter" size="lg" label="Scatter chart" />
111
+ <bf-icon [icon]="keyRound" size="lg" label="Key" />
112
+ </div>
113
+ `,
114
+ })
115
+ export class IconFilledExampleComponent {
116
+ protected readonly palette = Palette;
117
+ protected readonly chartScatter = ChartScatter;
118
+ protected readonly keyRound = KeyRound;
119
+ }
120
+ ```
121
+
122
+ ## Theming
123
+
124
+ `bf-icon` defines no color of its own; its stroke (and any fill Lucide sets) uses `currentColor`, so it takes on whatever text color its parent sets (a class like `text-text-muted`, or the button/link text color around it).
125
+
126
+ ## Accessibility
127
+
128
+ Icons are decorative by default (`aria-hidden`). Pass `label` when the icon carries meaning on its own, for example in an icon-only control.
129
+
130
+ ```ts
131
+ import { Component } from '@angular/core';
132
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
133
+ import { Search } from 'lucide';
134
+
135
+ /** An icon that carries meaning, named by its label. */
136
+ @Component({
137
+ selector: 'app-example-icon-labelled',
138
+ imports: [BfIconComponent],
139
+ template: `<bf-icon [icon]="search" label="Search" />`,
140
+ })
141
+ export class IconLabelledExampleComponent {
142
+ protected readonly search = Search;
143
+ }
144
+ ```
145
+
146
+ ## Inputs
147
+
148
+ | Name | Type | Default | Description |
149
+ | ------- | ------------------------------------- | -------- | ----------------------------------------------------------------------- |
150
+ | `icon` | `IconNode` | required | Lucide icon data, e.g. `Search` from `lucide`. |
151
+ | `size` | `BfIconSize` (`'sm' \| 'md' \| 'lg'`) | `'md'` | Visual size: 16, 20 or 24 px. |
152
+ | `label` | `string` | `''` | Accessible name. Leave empty for decorative icons next to visible text. |
153
+
154
+ ## Notes
155
+
156
+ ### Do
157
+
158
+ - Put icons in a widget's `icon-start` / `icon-end` slot rather than in its default slot.
159
+ - Use `label` only when there is no visible text saying the same thing.
160
+
161
+ ### Don't
162
+
163
+ - Don't inline `<svg>` markup in app templates; use `bf-icon` or an icon component.
164
+ - Don't ship Streamline pro icons in a public package; use them in your app's private code through the slots.
165
+
166
+ ## Migration notes
167
+
168
+ ### 0.3.0
169
+
170
+ JSDoc of `icon.component.ts` for the API reference: `@summary`/`@since` on the exported symbols. No
171
+ behaviour change.
172
+
173
+ **Behaviour:** `bf-icon` binds `[attr.fill]` on every element it renders (F-065), so the filled
174
+ details of Lucide icons show (`Palette`'s dots and 9 other distinct icons); elements without a Lucide
175
+ `fill` get no attribute and inherit the `none` of the `<svg>`. `tools/lucide-attributes.test.ts`
176
+ fails when an installed Lucide icon sets an attribute the renderer does not bind. See Migration 27.