@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
@@ -0,0 +1,163 @@
1
+ # bf-tab-panel
2
+
3
+ One tab of a tab group with its label, badge, icon and lazy content
4
+
5
+ `BfTabPanelComponent` from `@bitforgehq/ui` · Navigation · since 0.3.1
6
+
7
+ ## Example
8
+
9
+ ```ts
10
+ import { Component } from '@angular/core';
11
+ import { BfTabGroupComponent, BfTabPanelComponent } from '@bitforgehq/ui';
12
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
13
+ import { Inbox, Star } from 'lucide';
14
+
15
+ /**
16
+ * The bf-tab-panel overview.
17
+ *
18
+ * Live demo of `bf-tab-panel`: two panels in a `bf-tab-group`, each with an icon, one with a
19
+ * count badge and lazy content in an `ng-template`.
20
+ */
21
+ @Component({
22
+ selector: 'app-example-tab-panel-overview',
23
+ imports: [BfTabGroupComponent, BfTabPanelComponent, BfIconComponent],
24
+ template: `
25
+ <bf-tab-group label="Mailbox">
26
+ <bf-tab-panel value="starred" label="Starred">
27
+ <bf-icon bfSlot="icon" [icon]="star" />
28
+ <p class="text-body">Two starred threads.</p>
29
+ </bf-tab-panel>
30
+ <bf-tab-panel value="inbox" label="Inbox" [badge]="4">
31
+ <bf-icon bfSlot="icon" [icon]="inbox" />
32
+ <ng-template><p class="text-body">Four unread messages.</p></ng-template>
33
+ </bf-tab-panel>
34
+ </bf-tab-group>
35
+ `,
36
+ })
37
+ export class TabPanelOverviewExampleComponent {
38
+ protected readonly star = Star;
39
+ protected readonly inbox = Inbox;
40
+ }
41
+ ```
42
+
43
+ ## Overview
44
+
45
+ One tab of a `bf-tab-group` and the content it shows: `label` is the tab's text, `value` the
46
+ key the group's `selected` holds. Put the content in an `ng-template` inside the panel and it is
47
+ created only while the panel is selected (`keepAlive` keeps it once visited); plain content
48
+ renders at once and is only hidden. An icon in `bfSlot="icon"` shows in the tab before the label.
49
+
50
+ One tab of a [`bf-tab-group`](https://bitforge-ui.web.app/components/tab-group) and the content it shows. `label` is the tab's text and `value` the key the group's `selected` holds; the group renders the tab, owns the selection and the keyboard, and shows one panel at a time.
51
+
52
+ ## When to use
53
+
54
+ Use `bf-tab-panel` for each section of a [bf-tab-group](https://bitforge-ui.web.app/components/tab-group), and only there. Use [bf-tab](https://bitforge-ui.web.app/components/tab) instead for a destination of the phone's [bf-tab-bar](https://bitforge-ui.web.app/components/tab-bar), and an `a[bfNavItem]` in a [bf-top-nav](https://bitforge-ui.web.app/components/top-nav) for a tab that is its own route.
55
+
56
+ ## Content
57
+
58
+ Content in an `ng-template` inside the panel is created only while the panel shows and destroyed when another one does; `keepAlive` keeps it, hidden, once it has been shown. Plain content renders at once and is hidden while another tab is selected. The [tab group page](https://bitforge-ui.web.app/components/tab-group) shows both.
59
+
60
+ ## Badge, icon and disabled
61
+
62
+ `badge` adds a count pill after the tab's label (`null` shows none), announced through `provideBfLabels()`'s `tabBadge(n)` ("3 new"). An element with `bfSlot="icon"`, usually a `bf-icon`, shows in the tab before the label. `disabled` greys the tab out: it cannot be clicked and the arrow keys skip it.
63
+
64
+ ```ts
65
+ import { Component } from '@angular/core';
66
+ import { BfTabGroupComponent, BfTabPanelComponent } from '@bitforgehq/ui';
67
+ import { BfIconComponent } from '@bitforgehq/ui/icons';
68
+ import { Activity, FileText, LayoutDashboard, Lock } from 'lucide';
69
+
70
+ /**
71
+ * Tabs with icons, a count badge and a disabled tab.
72
+ *
73
+ * Each panel's `bfSlot="icon"` shows in its tab before the label; `badge` adds an announced
74
+ * count, and `disabled` takes a tab out of the selection and the keyboard navigation.
75
+ */
76
+ @Component({
77
+ selector: 'app-example-tab-group-badges-and-icons',
78
+ imports: [BfTabGroupComponent, BfTabPanelComponent, BfIconComponent],
79
+ template: `
80
+ <bf-tab-group label="Project with icons">
81
+ <bf-tab-panel value="overview" label="Overview">
82
+ <bf-icon bfSlot="icon" [icon]="dashboard" />
83
+ <p class="text-body">The project at a glance.</p>
84
+ </bf-tab-panel>
85
+ <bf-tab-panel value="activity" label="Activity" [badge]="12">
86
+ <bf-icon bfSlot="icon" [icon]="activity" />
87
+ <p class="text-body">12 updates since your last visit.</p>
88
+ </bf-tab-panel>
89
+ <bf-tab-panel value="files" label="Files">
90
+ <bf-icon bfSlot="icon" [icon]="files" />
91
+ <p class="text-body">The brief and two mock-ups.</p>
92
+ </bf-tab-panel>
93
+ <bf-tab-panel value="billing" label="Billing" [disabled]="true">
94
+ <bf-icon bfSlot="icon" [icon]="lock" />
95
+ <p class="text-body">Billing is managed by the workspace owner.</p>
96
+ </bf-tab-panel>
97
+ </bf-tab-group>
98
+ `,
99
+ })
100
+ export class TabGroupBadgesAndIconsExampleComponent {
101
+ protected readonly dashboard = LayoutDashboard;
102
+ protected readonly activity = Activity;
103
+ protected readonly files = FileText;
104
+ protected readonly lock = Lock;
105
+ }
106
+ ```
107
+
108
+ ## Desktop
109
+
110
+ The panel's tab takes the group's hover, pressed and focus styles; see the [tab group's Desktop section](https://bitforge-ui.web.app/components/tab-group#desktop). The panel itself is in the tab order and shows the focus ring on keyboard focus only.
111
+
112
+ ## Theming
113
+
114
+ - The panel has no surface of its own; its focus ring is `ring` on `rounded-tile` corners.
115
+ - The tab's tokens are on the [tab group](https://bitforge-ui.web.app/components/tab-group#theming) page.
116
+
117
+ ## Accessibility
118
+
119
+ The host is `role="tabpanel"` with `aria-labelledby` naming its tab, `tabindex="0"` so the keyboard reaches content without a focusable element, and `hidden` while another tab is selected. Its tab is a `<button role="tab">` whose `aria-controls` names the panel; the visible `label` is the tab's name, followed by the badge's announcement when there is one.
120
+
121
+ ### Keyboard
122
+
123
+ The group owns the tab stop and the arrow keys; its [keyboard table](https://bitforge-ui.web.app/components/tab-group#keyboard) has them all.
124
+
125
+ | Key | Action |
126
+ | ------------------------------------------------ | ------------------------------------------ |
127
+ | <kbd>Tab</kbd> / <kbd>Shift</kbd>+<kbd>Tab</kbd> | Moves from the selected tab into the panel |
128
+
129
+ ## Inputs
130
+
131
+ | Name | Type | Default | Description |
132
+ | ----------- | ---------------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
133
+ | `value` | `string` | required | The key of this panel; the group's `selected` holds it while the panel is shown. |
134
+ | `label` | `string` | required | The tab's visible text, also its accessible name. |
135
+ | `disabled` | `boolean` | `false` | Disables the tab: it cannot be clicked and the arrow keys skip it. |
136
+ | `badge` | `number \| null` | `null` | A count shown as a pill after the tab's label, announced with `provideBfLabels()`'s `tabBadge(count)` ("3 new"); `null` shows none. |
137
+ | `keepAlive` | `boolean` | `false` | Keeps the content of an `ng-template` in the DOM, hidden, once the panel has been shown, so its state (scroll, form input) survives switching tabs. |
138
+
139
+ ## Slots
140
+
141
+ - `icon`: An icon in the tab before the label, a `bf-icon`.
142
+ - `default`: Content rendered at once and hidden while another tab is selected; put it in an `ng-template` instead to create it only when the panel is shown.
143
+
144
+ ## Notes
145
+
146
+ ### Do
147
+
148
+ - Give every panel a stable, meaningful `value` (`overview`, `activity`): it is what `selected` stores.
149
+ - Wrap content that fetches or draws a lot in an `ng-template`.
150
+
151
+ ### Don't
152
+
153
+ - Don't use a `bf-tab-panel` outside a `bf-tab-group`; it needs one.
154
+ - Don't rely on the badge alone for important information; it is a count, not a message.
155
+
156
+ ## Migration notes
157
+
158
+ ### 0.3.1
159
+
160
+ New `bf-tab-panel`: one tab of a `bf-tab-group` and its content (`role="tabpanel"`,
161
+ `aria-labelledby` its tab, `tabindex="0"`): `value`, `label`, `disabled`, a `badge` count
162
+ announced with `tabBadge(count)` and an `icon` slot shown in the tab. Content in an `ng-template`
163
+ is created only while the panel shows; `keepAlive` keeps it, hidden, once visited.