@bitforgehq/ui 0.3.0 → 0.3.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (158) hide show
  1. package/CHANGELOG.md +598 -0
  2. package/README.md +18 -11
  3. package/ai/MANIFEST.index.json +306 -0
  4. package/ai/MANIFEST.json +8915 -3788
  5. package/ai/REFERENCE.index.json +476 -0
  6. package/ai/REFERENCE.json +5810 -2905
  7. package/ai/UI_GUIDE.md +212 -58
  8. package/ai/components/app-frame.md +328 -0
  9. package/ai/components/back-button.md +42 -2
  10. package/ai/components/badge.md +17 -7
  11. package/ai/components/bar-chart.md +188 -0
  12. package/ai/components/breadcrumb-item.md +121 -0
  13. package/ai/components/breadcrumb.md +277 -0
  14. package/ai/components/button.md +82 -15
  15. package/ai/components/calendar.md +300 -0
  16. package/ai/components/card.md +119 -4
  17. package/ai/components/chart-card.md +283 -0
  18. package/ai/components/combobox.md +411 -0
  19. package/ai/components/date-input.md +396 -0
  20. package/ai/components/datetime-input.md +215 -0
  21. package/ai/components/description-item.md +111 -0
  22. package/ai/components/description-list.md +160 -0
  23. package/ai/components/donut-chart.md +169 -0
  24. package/ai/components/empty-state.md +99 -6
  25. package/ai/components/header.md +71 -2
  26. package/ai/components/icon-button.md +74 -16
  27. package/ai/components/icon.md +63 -7
  28. package/ai/components/line-chart.md +234 -0
  29. package/ai/components/list.md +70 -6
  30. package/ai/components/menu.md +5 -0
  31. package/ai/components/multi-combobox.md +257 -0
  32. package/ai/components/nav-group.md +178 -0
  33. package/ai/components/nav-item.md +210 -0
  34. package/ai/components/page-header.md +237 -0
  35. package/ai/components/pagination.md +173 -0
  36. package/ai/components/popover.md +250 -0
  37. package/ai/components/side-panel.md +391 -0
  38. package/ai/components/sidebar-toggle.md +287 -0
  39. package/ai/components/sidebar.md +541 -0
  40. package/ai/components/skeleton.md +215 -0
  41. package/ai/components/sparkline.md +188 -0
  42. package/ai/components/stat.md +297 -0
  43. package/ai/components/tab-group.md +226 -0
  44. package/ai/components/tab-panel.md +163 -0
  45. package/ai/components/table.md +697 -0
  46. package/ai/components/tabs.md +46 -2
  47. package/ai/components/theme-menu-button.md +182 -0
  48. package/ai/components/theme-switch.md +170 -0
  49. package/ai/components/time-input.md +240 -0
  50. package/ai/components/toolbar.md +354 -0
  51. package/ai/components/tooltip.md +230 -0
  52. package/ai/components/top-nav.md +159 -0
  53. package/ai/reference/bf-app-frame-breakpoint.md +27 -0
  54. package/ai/reference/bf-app-frame-content-width.md +29 -0
  55. package/ai/reference/bf-badge-appearance.md +36 -0
  56. package/ai/reference/bf-badge-variant.md +1 -1
  57. package/ai/reference/bf-bar-chart-orientation.md +27 -0
  58. package/ai/reference/bf-button-appearance.md +36 -0
  59. package/ai/reference/bf-button-variant.md +1 -1
  60. package/ai/reference/bf-calendar-disabled-date.md +23 -0
  61. package/ai/reference/bf-calendar-harness.md +51 -0
  62. package/ai/reference/bf-calendar-weekday.md +31 -0
  63. package/ai/reference/bf-chart-card-heading-level.md +26 -0
  64. package/ai/reference/bf-chart-curve.md +28 -0
  65. package/ai/reference/bf-chart-harness.md +51 -0
  66. package/ai/reference/bf-chart-legend-position.md +30 -0
  67. package/ai/reference/bf-chart-series.md +23 -0
  68. package/ai/reference/bf-chart-value-format.md +23 -0
  69. package/ai/reference/bf-color-scheme-service.md +30 -0
  70. package/ai/reference/bf-color-scheme.md +31 -0
  71. package/ai/reference/bf-combobox-filter.md +27 -0
  72. package/ai/reference/bf-combobox-harness.md +89 -0
  73. package/ai/reference/bf-combobox-option.md +33 -0
  74. package/ai/reference/bf-compare-with.md +2 -0
  75. package/ai/reference/bf-date-input-harness.md +67 -0
  76. package/ai/reference/bf-date-input-picker.md +27 -0
  77. package/ai/reference/bf-date-time-input-harness.md +76 -0
  78. package/ai/reference/bf-date-time-input-picker.md +27 -0
  79. package/ai/reference/bf-description-list-layout.md +26 -0
  80. package/ai/reference/bf-donut-slice.md +22 -0
  81. package/ai/reference/bf-empty-state-heading-level.md +1 -1
  82. package/ai/reference/bf-empty-state-heading.md +33 -0
  83. package/ai/reference/bf-labels.md +73 -20
  84. package/ai/reference/bf-menu-button-variant.md +1 -0
  85. package/ai/reference/bf-menu-placement.md +1 -0
  86. package/ai/reference/bf-overlay-options.md +28 -27
  87. package/ai/reference/bf-overlay-placement.md +34 -0
  88. package/ai/reference/bf-overlay-position.md +1 -1
  89. package/ai/reference/bf-overlay-service.md +5 -3
  90. package/ai/reference/bf-page-header-heading-level.md +26 -0
  91. package/ai/reference/bf-pagination-harness.md +61 -0
  92. package/ai/reference/bf-platform-service.md +17 -15
  93. package/ai/reference/bf-popover-harness.md +42 -0
  94. package/ai/reference/bf-popover-placement.md +28 -0
  95. package/ai/reference/bf-popover-trigger-directive.md +56 -0
  96. package/ai/reference/bf-side-panel-config.md +35 -0
  97. package/ai/reference/bf-side-panel-harness.md +34 -0
  98. package/ai/reference/bf-side-panel-ref.md +44 -0
  99. package/ai/reference/bf-side-panel-service.md +43 -0
  100. package/ai/reference/bf-side-panel-template-context.md +32 -0
  101. package/ai/reference/bf-side-panel-width.md +28 -0
  102. package/ai/reference/bf-sidebar-state-service.md +21 -0
  103. package/ai/reference/bf-sidebar-toggle-harness.md +32 -0
  104. package/ai/reference/bf-size.md +13 -0
  105. package/ai/reference/bf-skeleton-shape.md +28 -0
  106. package/ai/reference/bf-stat-appearance.md +33 -0
  107. package/ai/reference/bf-stat-trend-intent.md +27 -0
  108. package/ai/reference/bf-stat-trend.md +27 -0
  109. package/ai/reference/bf-stat-variant.md +26 -0
  110. package/ai/reference/bf-tab-group-harness.md +44 -0
  111. package/ai/reference/bf-table-align.md +26 -0
  112. package/ai/reference/bf-table-cell-context.md +24 -0
  113. package/ai/reference/bf-table-cell-directive.md +22 -0
  114. package/ai/reference/bf-table-column.md +28 -0
  115. package/ai/reference/bf-table-harness.md +77 -0
  116. package/ai/reference/bf-table-row-key.md +21 -0
  117. package/ai/reference/bf-table-sort-direction.md +26 -0
  118. package/ai/reference/bf-table-sort.md +27 -0
  119. package/ai/reference/bf-table-stack.md +29 -0
  120. package/ai/reference/bf-theme.md +5 -4
  121. package/ai/reference/bf-time-input-harness.md +67 -0
  122. package/ai/reference/bf-time-input-hour-cycle.md +27 -0
  123. package/ai/reference/bf-time-input-picker.md +27 -0
  124. package/ai/reference/bf-tooltip-directive.md +43 -0
  125. package/ai/reference/bf-tooltip-harness.md +43 -0
  126. package/ai/reference/bf-tooltip-placement.md +28 -0
  127. package/ai/reference/bf_color_scheme_storage.md +20 -0
  128. package/ai/reference/bf_side_panel_data.md +17 -0
  129. package/ai/reference/bf_sidebar_state_storage.md +20 -0
  130. package/ai/reference/bf_theme_storage.md +3 -1
  131. package/ai/reference/provide-bf-color-scheme.md +20 -0
  132. package/ai/reference/provide-bf-labels.md +13 -4
  133. package/ai/reference/provide-bf-sidebar-state.md +20 -0
  134. package/ai/reference/slide-in-from-end.md +24 -0
  135. package/ai/reference/slide-out-to-end.md +24 -0
  136. package/bin/bf-ui.js +433 -3
  137. package/fesm2022/bitforgehq-ui-charts.mjs +3045 -0
  138. package/fesm2022/bitforgehq-ui-charts.mjs.map +1 -0
  139. package/fesm2022/bitforgehq-ui-icons.mjs +107 -3
  140. package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -1
  141. package/fesm2022/bitforgehq-ui-mobile.mjs +14 -59
  142. package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -1
  143. package/fesm2022/bitforgehq-ui-overlay.mjs +6566 -38
  144. package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
  145. package/fesm2022/bitforgehq-ui-testing.mjs +634 -1
  146. package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
  147. package/fesm2022/bitforgehq-ui.mjs +5708 -137
  148. package/fesm2022/bitforgehq-ui.mjs.map +1 -1
  149. package/llms-full.txt +26766 -14470
  150. package/llms.txt +106 -1
  151. package/package.json +7 -3
  152. package/theme.css +101 -0
  153. package/types/bitforgehq-ui-charts.d.ts +967 -0
  154. package/types/bitforgehq-ui-icons.d.ts +13 -1
  155. package/types/bitforgehq-ui-mobile.d.ts +25 -18
  156. package/types/bitforgehq-ui-overlay.d.ts +1895 -7
  157. package/types/bitforgehq-ui-testing.d.ts +782 -1
  158. package/types/bitforgehq-ui.d.ts +2393 -45
@@ -11,11 +11,12 @@ type BfIconSize = 'sm' | 'md' | 'lg';
11
11
  * Renders a Lucide icon from its data, tree-shakably and without a registry.
12
12
  * Import the icon you need from `lucide` (e.g. `import { Search } from 'lucide'`) and bind it.
13
13
  * Decorative by default; pass `label` when the icon carries meaning on its own (e.g. an icon-only
14
- * control without visible text).
14
+ * control without visible text). `filled` fills a solid shape such as a heart or a star.
15
15
  *
16
16
  * @example
17
17
  * <bf-icon [icon]="Search" />
18
18
  * <bf-icon [icon]="Search" label="Search" size="lg" />
19
+ * <bf-icon [icon]="Heart" [filled]="favourite()" />
19
20
  * @summary Tree-shakable Lucide icon renderer, decorative by default or labelled when meaningful
20
21
  * @category Icons
21
22
  * @since 0.1.0
@@ -27,7 +28,13 @@ export declare class BfIconComponent {
27
28
  readonly size: import("@angular/core").InputSignal<BfIconSize>;
28
29
  /** Accessible name. Leave empty for decorative icons next to visible text. */
29
30
  readonly label: import("@angular/core").InputSignal<string>;
31
+ /** Fills the shape with `currentColor` (a favourite heart, a starred item); the stroke stays.
32
+ * Only icons whose every shape is closed are filled; a stroke icon (a check, a line) or an
33
+ * outline holding inner strokes renders as usual. */
34
+ readonly filled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
30
35
  readonly px: import("@angular/core").Signal<number>;
36
+ /** Whether the shape is filled: `filled`, on an icon that can take it without hiding a stroke. */
37
+ protected readonly fillsShape: import("@angular/core").Signal<boolean>;
31
38
  static ɵfac: i0.ɵɵFactoryDeclaration<BfIconComponent, never>;
32
39
  static ɵcmp: i0.ɵɵComponentDeclaration<BfIconComponent, "bf-icon", never, {
33
40
  "icon": {
@@ -45,6 +52,11 @@ export declare class BfIconComponent {
45
52
  "required": false;
46
53
  "isSignal": true;
47
54
  };
55
+ "filled": {
56
+ "alias": "filled";
57
+ "required": false;
58
+ "isSignal": true;
59
+ };
48
60
  }, {}, never, never, true, never>;
49
61
  }
50
62
  export type { BfIconSize };
@@ -1,10 +1,10 @@
1
+ import { SystemBarsStyle } from "@capacitor/core";
2
+ import { BfButtonVariant, BfColorScheme, BfTabBarController, ɵcreateMemoryColorSchemeStorage } from "@bitforgehq/ui";
1
3
  import * as i0 from "@angular/core";
2
4
  import { AfterViewInit, ComponentRef, EnvironmentInjector, EnvironmentProviders, InjectionToken, Injector, OnDestroy, OnInit, Signal, TemplateRef, Type } from "@angular/core";
3
- import { SystemBarsStyle } from "@capacitor/core";
4
5
  import { ActivatedRoute, ActivatedRouteSnapshot, BaseRouteReuseStrategy, Data, NavigationExtras, RouterConfigurationFeature, RouterOutletContract, Routes, UrlTree } from "@angular/router";
5
6
  import * as core from "@bitforgehq/ui/overlay";
6
7
  import { BfOverlayController, BfOverlayRef as BfOverlayRef$1, BfOverlayTemplateContext as BfOverlayTemplateContext$1, BfToastAction, BfToastAction as BfToastAction$1, BfToastDismissReason, BfToastRef, BfToastRef as BfToastRef$1, prefersReducedMotion } from "@bitforgehq/ui/overlay";
7
- import { BfButtonVariant, BfTabBarController } from "@bitforgehq/ui";
8
8
  import { IconNode } from "lucide";
9
9
  /**
10
10
  * The shell's transition and gesture style: `ios`, `md` (Material), or `auto` (iOS on iOS, else
@@ -135,25 +135,28 @@ type BfPlatform = 'ios' | 'android' | 'web';
135
135
  */
136
136
  type BfShellMode = 'ios' | 'md';
137
137
  /**
138
- * The app theme choice: follow the system, or force light or dark.
138
+ * The app theme choice: follow the system, or force light or dark. The same type as
139
+ * `BfColorScheme` from `@bitforgehq/ui`.
139
140
  *
140
141
  * @summary The app theme choice, following the system or forcing light or dark
141
142
  * @since 0.2.0
142
143
  */
143
- type BfTheme = 'system' | 'light' | 'dark';
144
+ type BfTheme = BfColorScheme;
144
145
  /** A theme store in memory, gone with the app: where `localStorage` is unavailable, and in tests. Internal. */
145
- declare function createMemoryThemeStorage(): Pick<Storage, 'getItem' | 'setItem'>;
146
+ declare const createMemoryThemeStorage: typeof ɵcreateMemoryColorSchemeStorage;
146
147
  /**
147
148
  * Where `BfPlatformService` keeps the theme choice (the key `bf-theme`): `localStorage` when it is
148
149
  * available, otherwise an in-memory map. Provide another store (a native preferences plugin, or an
149
- * in-memory one in tests, as `provideBfShellTesting()` does) to keep the choice elsewhere.
150
+ * in-memory one in tests, as `provideBfShellTesting()` does) to keep the choice elsewhere. It is
151
+ * the same token as `BF_COLOR_SCHEME_STORAGE` from `@bitforgehq/ui`, which `BfColorSchemeService`
152
+ * reads, so providing either one moves the choice for both.
150
153
  *
151
154
  * @example
152
155
  * providers: [{ provide: BF_THEME_STORAGE, useValue: sessionStorage }]
153
156
  * @summary Injection token for the store that keeps the app theme choice between visits
154
157
  * @since 0.3.0
155
158
  */
156
- export declare const BF_THEME_STORAGE: InjectionToken<Pick<Storage, "getItem" | "setItem">>;
159
+ export declare const BF_THEME_STORAGE: import("@angular/core").InjectionToken<Pick<Storage, "getItem" | "setItem">>;
157
160
  /**
158
161
  * The SystemBars style for a theme: Dark = light icons. Android WebView < 140 pads the WebView, so
159
162
  * the bar areas show the activity's window background (which follows the system theme): use
@@ -180,15 +183,17 @@ export declare function bfSystemBarsStyle(dark: boolean, platform: BfPlatform, w
180
183
  /**
181
184
  * Platform facts and the app theme: native or web, iOS or Android, the shell mode that follows
182
185
  * from it, and the user's theme choice (system, light, dark) reflected as the `dark` class on
183
- * `<html>`. `matchMedia('(prefers-color-scheme: dark)')` is the single source for the system
184
- * theme on every platform.
186
+ * `<html>`. The theme is `BfColorSchemeService` from `@bitforgehq/ui` (the Capacitor-free colour
187
+ * scheme a desktop app uses through `provideBfColorScheme()`): `theme` and `dark` are its
188
+ * `scheme` and `dark` signals, and `matchMedia('(prefers-color-scheme: dark)')` is the single
189
+ * source for the system theme on every platform.
185
190
  *
186
191
  * The `theme`/`dark` signals always compute, but the `<html>` class and storage writes
187
- * only run when `provideBfShell()` provided `BF_SHELL_CONFIG` — i.e. this service is the app's
188
- * own shell, not merely injected by something that wants `platform`/`mode`. Without it (e.g. a
189
- * docs demo that instantiates `BfPlatformService` directly to preview `bf-tabs`), this service
190
- * would otherwise fight the host page's own theme: its `effect` runs on construction and would
191
- * immediately overwrite `<html class="dark">` with whatever `prefers-color-scheme` says.
192
+ * only run when `provideBfShell()` provided `BF_SHELL_CONFIG` (or the app provided
193
+ * `provideBfColorScheme()`) — i.e. this service is the app's own shell, not merely injected by
194
+ * something that wants `platform`/`mode`. Without it (e.g. a docs demo that instantiates
195
+ * `BfPlatformService` directly to preview `bf-tabs`), this service would otherwise fight the host
196
+ * page's own theme, overwriting `<html class="dark">` with whatever `prefers-color-scheme` says.
192
197
  *
193
198
  * With `provideBfShell()` on a native platform it also makes the viewport meta forbid zoom
194
199
  * (`maximum-scale=1, user-scalable=no`, other directives kept; the meta is created if missing):
@@ -207,17 +212,19 @@ export declare function bfSystemBarsStyle(dark: boolean, platform: BfPlatform, w
207
212
  export declare class BfPlatformService {
208
213
  private readonly document;
209
214
  private readonly shellConfig;
210
- private readonly storage;
215
+ private readonly colorScheme;
211
216
  /** True inside the native iOS or Android app, false in a browser. */
212
217
  readonly isNative: boolean;
213
218
  /** The platform the app runs on. */
214
219
  readonly platform: BfPlatform;
215
220
  /** The platform's shell mode: `ios` on iOS, else `md`; `resolveShellMode()` applies the config. */
216
221
  readonly mode: import("@angular/core").Signal<BfShellMode>;
217
- /** The user's theme choice, stored in `BF_THEME_STORAGE` (`localStorage`); set it with `theme.set(…)`. */
218
- readonly theme: import("@angular/core").WritableSignal<BfTheme>;
222
+ /** The user's theme choice, stored in `BF_THEME_STORAGE` (`localStorage`); set it with
223
+ * `theme.set(…)`. The same signal as `BfColorSchemeService.scheme`. */
224
+ readonly theme: import("@angular/core").WritableSignal<BfColorScheme>;
219
225
  private readonly systemDark;
220
- /** Whether the app is dark now: the theme choice, or the system's under `system`. */
226
+ /** Whether the app is dark now: the theme choice, or the system's under `system`. The same
227
+ * signal as `BfColorSchemeService.dark`. */
221
228
  readonly dark: import("@angular/core").Signal<boolean>;
222
229
  constructor();
223
230
  /** The native system bars are outside the page; a failed call leaves them as they were. */