@bitforgehq/ui 0.3.3 → 0.4.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.
- package/CHANGELOG.md +91 -0
- package/README.md +4 -4
- package/ai/MANIFEST.index.json +36 -0
- package/ai/MANIFEST.json +414 -14
- package/ai/REFERENCE.index.json +35 -0
- package/ai/REFERENCE.json +184 -8
- package/ai/UI_GUIDE.md +25 -4
- package/ai/components/badge.md +39 -2
- package/ai/components/list-item.md +105 -9
- package/ai/components/step.md +112 -0
- package/ai/components/steps.md +124 -0
- package/ai/components/table.md +98 -2
- package/ai/components/timeline-event.md +144 -0
- package/ai/components/timeline.md +201 -0
- package/ai/components/toggle.md +11 -1
- package/ai/reference/bf-action-directive.md +3 -1
- package/ai/reference/bf-badge-emphasis.md +27 -0
- package/ai/reference/bf-labels.md +1 -0
- package/ai/reference/bf-step-heading-level.md +28 -0
- package/ai/reference/bf-table-align.md +1 -1
- package/ai/reference/bf-table-column-align.md +33 -0
- package/ai/reference/bf-table-column.md +7 -7
- package/ai/reference/bf-table-harness.md +12 -0
- package/ai/reference/bf-timeline-tone.md +31 -0
- package/ai/reference/bf-toggle-harness.md +55 -0
- package/ai/reference/provide-bf-labels.md +1 -1
- package/dark-ink.css +124 -0
- package/fesm2022/bitforgehq-ui-mobile.mjs +2 -1
- package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +51 -2
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +682 -32
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +1072 -15
- package/llms.txt +9 -0
- package/package.json +2 -1
- package/theme.css +24 -0
- package/types/bitforgehq-ui-testing.d.ts +76 -1
- package/types/bitforgehq-ui.d.ts +288 -8
package/ai/REFERENCE.index.json
CHANGED
|
@@ -120,6 +120,13 @@
|
|
|
120
120
|
"entryPoint": "@bitforgehq/ui",
|
|
121
121
|
"summary": "Every badge tone, the five variants plus the informational info tone"
|
|
122
122
|
},
|
|
123
|
+
{
|
|
124
|
+
"name": "BfBadgeEmphasis",
|
|
125
|
+
"slug": "bf-badge-emphasis",
|
|
126
|
+
"kind": "type",
|
|
127
|
+
"entryPoint": "@bitforgehq/ui",
|
|
128
|
+
"summary": "The two badge emphases, the soft tint or the solid strong fill"
|
|
129
|
+
},
|
|
123
130
|
{
|
|
124
131
|
"name": "BfBadgeVariant",
|
|
125
132
|
"slug": "bf-badge-variant",
|
|
@@ -449,6 +456,13 @@
|
|
|
449
456
|
"entryPoint": "@bitforgehq/ui",
|
|
450
457
|
"summary": "The two stat surfaces, plain on its container or an outlined card tile"
|
|
451
458
|
},
|
|
459
|
+
{
|
|
460
|
+
"name": "BfStepHeadingLevel",
|
|
461
|
+
"slug": "bf-step-heading-level",
|
|
462
|
+
"kind": "type",
|
|
463
|
+
"entryPoint": "@bitforgehq/ui",
|
|
464
|
+
"summary": "The heading level a step title can take, two, three or four"
|
|
465
|
+
},
|
|
452
466
|
{
|
|
453
467
|
"name": "BfTabBarController",
|
|
454
468
|
"slug": "bf-tab-bar-controller",
|
|
@@ -491,6 +505,13 @@
|
|
|
491
505
|
"entryPoint": "@bitforgehq/ui",
|
|
492
506
|
"summary": "One table column with its row key, header label, sorting and alignment"
|
|
493
507
|
},
|
|
508
|
+
{
|
|
509
|
+
"name": "BfTableColumnAlign",
|
|
510
|
+
"slug": "bf-table-column-align",
|
|
511
|
+
"kind": "type",
|
|
512
|
+
"entryPoint": "@bitforgehq/ui",
|
|
513
|
+
"summary": "The inline alignment of a table column: start, end, or centred for controls"
|
|
514
|
+
},
|
|
494
515
|
{
|
|
495
516
|
"name": "BfTableRowKey",
|
|
496
517
|
"slug": "bf-table-row-key",
|
|
@@ -526,6 +547,13 @@
|
|
|
526
547
|
"entryPoint": "@bitforgehq/ui",
|
|
527
548
|
"summary": "The URLs a router-aware parent gives a tab bar to render its tabs as links"
|
|
528
549
|
},
|
|
550
|
+
{
|
|
551
|
+
"name": "BfTimelineTone",
|
|
552
|
+
"slug": "bf-timeline-tone",
|
|
553
|
+
"kind": "type",
|
|
554
|
+
"entryPoint": "@bitforgehq/ui",
|
|
555
|
+
"summary": "The marker colour of a timeline event, neutral, primary or a status"
|
|
556
|
+
},
|
|
529
557
|
{
|
|
530
558
|
"name": "BfToggleLabelPosition",
|
|
531
559
|
"slug": "bf-toggle-label-position",
|
|
@@ -1912,6 +1940,13 @@
|
|
|
1912
1940
|
"entryPoint": "@bitforgehq/ui/testing",
|
|
1913
1941
|
"summary": "Test harness for the time input: types a time or picks one from its list"
|
|
1914
1942
|
},
|
|
1943
|
+
{
|
|
1944
|
+
"name": "BfToggleHarness",
|
|
1945
|
+
"slug": "bf-toggle-harness",
|
|
1946
|
+
"kind": "class",
|
|
1947
|
+
"entryPoint": "@bitforgehq/ui/testing",
|
|
1948
|
+
"summary": "Test harness for the toggle: reads its name and state and switches it"
|
|
1949
|
+
},
|
|
1915
1950
|
{
|
|
1916
1951
|
"name": "BfTooltipHarness",
|
|
1917
1952
|
"slug": "bf-tooltip-harness",
|
package/ai/REFERENCE.json
CHANGED
|
@@ -152,7 +152,7 @@
|
|
|
152
152
|
"entryPoint": "@bitforgehq/ui",
|
|
153
153
|
"file": "src/components/action/action.directive.ts",
|
|
154
154
|
"summary": "Makes one link or button the click target of a whole card or list row",
|
|
155
|
-
"description": "The one interactive element of a `bf-card` or `bf-list-item` (the stretched-link pattern): put\nit on the `<a>` (navigation) or `<button>` (an action) that holds the card's heading text or the\nrow's title. Its `::after` stretches the hit area over the nearest positioned ancestor (the card\nbox, the row), so the whole surface is clickable while only the heading's link or button is\nexposed: the heading stays a heading and the accessible name is the title alone. It registers\nwith the nearest card or row, which then draws the pointer, the hover and, while the action has\nkeyboard focus, the focus ring; a card is never lit by the actions of rows nested in it. Give\nsecondary controls inside the surface `class=\"relative z-1\"` so they stay clickable above the\nstretched area.",
|
|
155
|
+
"description": "The one interactive element of a `bf-card` or `bf-list-item` (the stretched-link pattern): put\nit on the `<a>` (navigation) or `<button>` (an action) that holds the card's heading text or the\nrow's title. Its `::after` stretches the hit area over the nearest positioned ancestor (the card\nbox, the row), so the whole surface is clickable while only the heading's link or button is\nexposed: the heading stays a heading and the accessible name is the title alone. It registers\nwith the nearest card or row, which then draws the pointer, the hover and, while the action has\nkeyboard focus, the focus ring; a card is never lit by the actions of rows nested in it. Give\nsecondary controls inside the surface `class=\"relative z-1\"` so they stay clickable above the\nstretched area. When the surface marks a state that belongs in the name (an `unread` list\nrow), the directive names the element `aria-labelledby=\"<state id> <own id>\"`, so the link reads\n\"Unread, Account\", and restores the element's own `aria-labelledby` when the state goes.",
|
|
156
156
|
"members": [],
|
|
157
157
|
"methods": [],
|
|
158
158
|
"slots": [],
|
|
@@ -280,6 +280,23 @@
|
|
|
280
280
|
"signature": "type BfBadgeAppearance = BfBadgeVariant | 'info'",
|
|
281
281
|
"values": ["neutral", "primary", "success", "warning", "danger", "info"]
|
|
282
282
|
},
|
|
283
|
+
{
|
|
284
|
+
"name": "BfBadgeEmphasis",
|
|
285
|
+
"slug": "bf-badge-emphasis",
|
|
286
|
+
"kind": "type",
|
|
287
|
+
"entryPoint": "@bitforgehq/ui",
|
|
288
|
+
"file": "src/components/badge/badge.component.ts",
|
|
289
|
+
"summary": "The two badge emphases, the soft tint or the solid strong fill",
|
|
290
|
+
"description": "How loud a `bf-badge` is: `soft`, a pale tint with tinted text (the default), or `strong`, a\nsolid fill with contrasting text for the one state that must stand out, such as \"Critical\".",
|
|
291
|
+
"members": [],
|
|
292
|
+
"methods": [],
|
|
293
|
+
"slots": [],
|
|
294
|
+
"references": [],
|
|
295
|
+
"usedBy": ["bf-badge-component"],
|
|
296
|
+
"since": "0.4.0",
|
|
297
|
+
"signature": "type BfBadgeEmphasis = 'soft' | 'strong'",
|
|
298
|
+
"values": ["soft", "strong"]
|
|
299
|
+
},
|
|
283
300
|
{
|
|
284
301
|
"name": "BfBadgeVariant",
|
|
285
302
|
"slug": "bf-badge-variant",
|
|
@@ -1543,6 +1560,15 @@
|
|
|
1543
1560
|
"readonly": true,
|
|
1544
1561
|
"default": "'The data could not be loaded'"
|
|
1545
1562
|
},
|
|
1563
|
+
{
|
|
1564
|
+
"name": "listItemUnread",
|
|
1565
|
+
"kind": "property",
|
|
1566
|
+
"type": "string",
|
|
1567
|
+
"required": true,
|
|
1568
|
+
"doc": "bf-list-item's visually hidden state text before the title of an `unread` row.",
|
|
1569
|
+
"readonly": true,
|
|
1570
|
+
"default": "'Unread'"
|
|
1571
|
+
},
|
|
1546
1572
|
{
|
|
1547
1573
|
"name": "validation",
|
|
1548
1574
|
"kind": "property",
|
|
@@ -1961,6 +1987,23 @@
|
|
|
1961
1987
|
"signature": "type BfStatVariant = 'plain' | 'card'",
|
|
1962
1988
|
"values": ["plain", "card"]
|
|
1963
1989
|
},
|
|
1990
|
+
{
|
|
1991
|
+
"name": "BfStepHeadingLevel",
|
|
1992
|
+
"slug": "bf-step-heading-level",
|
|
1993
|
+
"kind": "type",
|
|
1994
|
+
"entryPoint": "@bitforgehq/ui",
|
|
1995
|
+
"file": "src/components/steps/step.component.ts",
|
|
1996
|
+
"summary": "The heading level a step title can take, two, three or four",
|
|
1997
|
+
"description": "The heading level of a `bf-step` title, for a guide whose steps hold enough content (screenshots,\ncode) that a screen-reader user moves between them by heading.",
|
|
1998
|
+
"members": [],
|
|
1999
|
+
"methods": [],
|
|
2000
|
+
"slots": [],
|
|
2001
|
+
"references": [],
|
|
2002
|
+
"usedBy": ["bf-step-component"],
|
|
2003
|
+
"since": "0.4.0",
|
|
2004
|
+
"signature": "type BfStepHeadingLevel = 2 | 3 | 4",
|
|
2005
|
+
"values": ["2", "3", "4"]
|
|
2006
|
+
},
|
|
1964
2007
|
{
|
|
1965
2008
|
"name": "BfTabBarController",
|
|
1966
2009
|
"slug": "bf-tab-bar-controller",
|
|
@@ -2135,7 +2178,7 @@
|
|
|
2135
2178
|
"methods": [],
|
|
2136
2179
|
"slots": [],
|
|
2137
2180
|
"references": [],
|
|
2138
|
-
"usedBy": ["bf-table-column"],
|
|
2181
|
+
"usedBy": ["bf-table-column-align"],
|
|
2139
2182
|
"since": "0.3.1",
|
|
2140
2183
|
"signature": "type BfTableAlign = 'start' | 'end'",
|
|
2141
2184
|
"values": ["start", "end"]
|
|
@@ -2238,20 +2281,37 @@
|
|
|
2238
2281
|
{
|
|
2239
2282
|
"name": "align",
|
|
2240
2283
|
"kind": "property",
|
|
2241
|
-
"type": "
|
|
2284
|
+
"type": "BfTableColumnAlign",
|
|
2242
2285
|
"required": false,
|
|
2243
|
-
"doc": "The inline alignment of the header and cells; `end` also sets tabular figures.",
|
|
2286
|
+
"doc": "The inline alignment of the header and cells; `end` also sets tabular figures, `center` centres a cell's control (a toggle, a checkbox) in the column.",
|
|
2244
2287
|
"optional": true,
|
|
2245
2288
|
"default": "'start'",
|
|
2246
|
-
"expandedType": "'start' | 'end'"
|
|
2289
|
+
"expandedType": "'start' | 'end' | 'center'"
|
|
2247
2290
|
}
|
|
2248
2291
|
],
|
|
2249
2292
|
"methods": [],
|
|
2250
2293
|
"slots": [],
|
|
2251
|
-
"references": ["bf-table-align"],
|
|
2294
|
+
"references": ["bf-table-column-align"],
|
|
2252
2295
|
"usedBy": ["bf-table-component"],
|
|
2253
2296
|
"since": "0.3.1"
|
|
2254
2297
|
},
|
|
2298
|
+
{
|
|
2299
|
+
"name": "BfTableColumnAlign",
|
|
2300
|
+
"slug": "bf-table-column-align",
|
|
2301
|
+
"kind": "type",
|
|
2302
|
+
"entryPoint": "@bitforgehq/ui",
|
|
2303
|
+
"file": "src/components/table/table.component.ts",
|
|
2304
|
+
"summary": "The inline alignment of a table column: start, end, or centred for controls",
|
|
2305
|
+
"description": "Where a `bf-table` column lines up its header and cells: a `BfTableAlign`, or `center` for a\ncolumn of controls such as the toggles of a settings matrix. A new type, so `Record`s over the\nreleased `BfTableAlign` keep compiling.",
|
|
2306
|
+
"members": [],
|
|
2307
|
+
"methods": [],
|
|
2308
|
+
"slots": [],
|
|
2309
|
+
"references": ["bf-table-align"],
|
|
2310
|
+
"usedBy": ["bf-table-column"],
|
|
2311
|
+
"since": "0.4.0",
|
|
2312
|
+
"signature": "type BfTableColumnAlign = BfTableAlign | 'center'",
|
|
2313
|
+
"values": ["start", "end", "center"]
|
|
2314
|
+
},
|
|
2255
2315
|
{
|
|
2256
2316
|
"name": "BfTableRowKey",
|
|
2257
2317
|
"slug": "bf-table-row-key",
|
|
@@ -2377,6 +2437,23 @@
|
|
|
2377
2437
|
"usedBy": ["bf-tab-bar-controller", "bf_tab_links"],
|
|
2378
2438
|
"since": "0.3.0"
|
|
2379
2439
|
},
|
|
2440
|
+
{
|
|
2441
|
+
"name": "BfTimelineTone",
|
|
2442
|
+
"slug": "bf-timeline-tone",
|
|
2443
|
+
"kind": "type",
|
|
2444
|
+
"entryPoint": "@bitforgehq/ui",
|
|
2445
|
+
"file": "src/components/timeline/timeline-event.component.ts",
|
|
2446
|
+
"summary": "The marker colour of a timeline event, neutral, primary or a status",
|
|
2447
|
+
"description": "The colour of a `bf-timeline-event`'s marker: `neutral` (the default), `primary`, or a status\n(`success`, `warning`, `danger`, `info`), such as danger for a failed CI run.",
|
|
2448
|
+
"members": [],
|
|
2449
|
+
"methods": [],
|
|
2450
|
+
"slots": [],
|
|
2451
|
+
"references": [],
|
|
2452
|
+
"usedBy": ["bf-timeline-event-component"],
|
|
2453
|
+
"since": "0.4.0",
|
|
2454
|
+
"signature": "type BfTimelineTone = 'neutral' | 'primary' | 'success' | 'warning' | 'danger' | 'info'",
|
|
2455
|
+
"values": ["neutral", "primary", "success", "warning", "danger", "info"]
|
|
2456
|
+
},
|
|
2380
2457
|
{
|
|
2381
2458
|
"name": "BfToggleLabelPosition",
|
|
2382
2459
|
"slug": "bf-toggle-label-position",
|
|
@@ -2608,7 +2685,7 @@
|
|
|
2608
2685
|
"entryPoint": "@bitforgehq/ui",
|
|
2609
2686
|
"file": "src/config/labels.ts",
|
|
2610
2687
|
"summary": "Replaces built-in strings for an app or a sub-tree, such as a translation",
|
|
2611
|
-
"description": "Replaces built-in strings, merged over the parent's (validation merged key by key); a key left\nout or set to `undefined` keeps the parent's string. In `ApplicationConfig.providers` it covers\nevery string. In a component's `providers` it covers that sub-tree's widgets and form controls\n(`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `tableSelectAll`, `tableSortBy`,\n`tableSortNone`, `tableSortAscending`, `tableSortDescending`, `theme`, `themeSystem`, `themeLight`, `themeDark`,\n`breadcrumb`, `breadcrumbExpand`, `navigation`, `navBadge`, `sidebarCollapse`, `sidebarExpand`,\n`skipToContent`, `pagination`, `previousPage`, `nextPage`, `pageOf`, `goToPage`, `tabGroup`,\n`calendarPreviousMonth`, `calendarNextMonth`, `calendarChooseMonth`, `calendarChooseYear`,\n`statTrendUp`, `statTrendDown`, `statTrendFlat`, `comboboxEmpty`, `comboboxRemove`,\n`dateInputDay`, `dateInputMonth`, `dateInputYear`, `dateInputOpenCalendar`, `dateInputInvalid`,\n`dateInputUnavailable`, `timeInputHour`, `timeInputMinute`, `timeInputSecond`,\n`timeInputDayPeriod`, `timeInputOpenList`, `timeInputInvalid`, `timeInputMin`, `timeInputMax`,\n`chart`, `chartLegend`, `chartValues`, `chartShowData`, `chartHideData`, `chartCategory`,\n`chartValue`, `chartEmpty`, `chartError`, `validation`); the overlay services (`ok`, `cancel`,\n`actions`, `sheet`, `modal`, `close`, `expand`, `collapse`, `sheetPosition`, `dialog`,\n`notifications`) are root singletons and pick it up only when the caller passes its injector:\n`open(…, { injector: inject(Injector) })`.",
|
|
2688
|
+
"description": "Replaces built-in strings, merged over the parent's (validation merged key by key); a key left\nout or set to `undefined` keeps the parent's string. In `ApplicationConfig.providers` it covers\nevery string. In a component's `providers` it covers that sub-tree's widgets and form controls\n(`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `tableSelectAll`, `tableSortBy`,\n`tableSortNone`, `tableSortAscending`, `tableSortDescending`, `theme`, `themeSystem`, `themeLight`, `themeDark`,\n`breadcrumb`, `breadcrumbExpand`, `navigation`, `navBadge`, `sidebarCollapse`, `sidebarExpand`,\n`skipToContent`, `pagination`, `previousPage`, `nextPage`, `pageOf`, `goToPage`, `tabGroup`,\n`calendarPreviousMonth`, `calendarNextMonth`, `calendarChooseMonth`, `calendarChooseYear`,\n`statTrendUp`, `statTrendDown`, `statTrendFlat`, `comboboxEmpty`, `comboboxRemove`,\n`dateInputDay`, `dateInputMonth`, `dateInputYear`, `dateInputOpenCalendar`, `dateInputInvalid`,\n`dateInputUnavailable`, `timeInputHour`, `timeInputMinute`, `timeInputSecond`,\n`timeInputDayPeriod`, `timeInputOpenList`, `timeInputInvalid`, `timeInputMin`, `timeInputMax`,\n`chart`, `chartLegend`, `chartValues`, `chartShowData`, `chartHideData`, `chartCategory`,\n`chartValue`, `chartEmpty`, `chartError`, `listItemUnread`, `validation`); the overlay services (`ok`, `cancel`,\n`actions`, `sheet`, `modal`, `close`, `expand`, `collapse`, `sheetPosition`, `dialog`,\n`notifications`) are root singletons and pick it up only when the caller passes its injector:\n`open(…, { injector: inject(Injector) })`.",
|
|
2612
2689
|
"members": [],
|
|
2613
2690
|
"methods": [
|
|
2614
2691
|
{
|
|
@@ -2623,7 +2700,7 @@
|
|
|
2623
2700
|
}
|
|
2624
2701
|
],
|
|
2625
2702
|
"returns": "Provider",
|
|
2626
|
-
"doc": "Replaces built-in strings, merged over the parent's (validation merged key by key); a key left\nout or set to `undefined` keeps the parent's string. In `ApplicationConfig.providers` it covers\nevery string. In a component's `providers` it covers that sub-tree's widgets and form controls\n(`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `tableSelectAll`, `tableSortBy`,\n`tableSortNone`, `tableSortAscending`, `tableSortDescending`, `theme`, `themeSystem`, `themeLight`, `themeDark`,\n`breadcrumb`, `breadcrumbExpand`, `navigation`, `navBadge`, `sidebarCollapse`, `sidebarExpand`,\n`skipToContent`, `pagination`, `previousPage`, `nextPage`, `pageOf`, `goToPage`, `tabGroup`,\n`calendarPreviousMonth`, `calendarNextMonth`, `calendarChooseMonth`, `calendarChooseYear`,\n`statTrendUp`, `statTrendDown`, `statTrendFlat`, `comboboxEmpty`, `comboboxRemove`,\n`dateInputDay`, `dateInputMonth`, `dateInputYear`, `dateInputOpenCalendar`, `dateInputInvalid`,\n`dateInputUnavailable`, `timeInputHour`, `timeInputMinute`, `timeInputSecond`,\n`timeInputDayPeriod`, `timeInputOpenList`, `timeInputInvalid`, `timeInputMin`, `timeInputMax`,\n`chart`, `chartLegend`, `chartValues`, `chartShowData`, `chartHideData`, `chartCategory`,\n`chartValue`, `chartEmpty`, `chartError`, `validation`); the overlay services (`ok`, `cancel`,\n`actions`, `sheet`, `modal`, `close`, `expand`, `collapse`, `sheetPosition`, `dialog`,\n`notifications`) are root singletons and pick it up only when the caller passes its injector:\n`open(…, { injector: inject(Injector) })`."
|
|
2703
|
+
"doc": "Replaces built-in strings, merged over the parent's (validation merged key by key); a key left\nout or set to `undefined` keeps the parent's string. In `ApplicationConfig.providers` it covers\nevery string. In a component's `providers` it covers that sub-tree's widgets and form controls\n(`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `tableSelectAll`, `tableSortBy`,\n`tableSortNone`, `tableSortAscending`, `tableSortDescending`, `theme`, `themeSystem`, `themeLight`, `themeDark`,\n`breadcrumb`, `breadcrumbExpand`, `navigation`, `navBadge`, `sidebarCollapse`, `sidebarExpand`,\n`skipToContent`, `pagination`, `previousPage`, `nextPage`, `pageOf`, `goToPage`, `tabGroup`,\n`calendarPreviousMonth`, `calendarNextMonth`, `calendarChooseMonth`, `calendarChooseYear`,\n`statTrendUp`, `statTrendDown`, `statTrendFlat`, `comboboxEmpty`, `comboboxRemove`,\n`dateInputDay`, `dateInputMonth`, `dateInputYear`, `dateInputOpenCalendar`, `dateInputInvalid`,\n`dateInputUnavailable`, `timeInputHour`, `timeInputMinute`, `timeInputSecond`,\n`timeInputDayPeriod`, `timeInputOpenList`, `timeInputInvalid`, `timeInputMin`, `timeInputMax`,\n`chart`, `chartLegend`, `chartValues`, `chartShowData`, `chartHideData`, `chartCategory`,\n`chartValue`, `chartEmpty`, `chartError`, `listItemUnread`, `validation`); the overlay services (`ok`, `cancel`,\n`actions`, `sheet`, `modal`, `close`, `expand`, `collapse`, `sheetPosition`, `dialog`,\n`notifications`) are root singletons and pick it up only when the caller passes its injector:\n`open(…, { injector: inject(Injector) })`."
|
|
2627
2704
|
}
|
|
2628
2705
|
],
|
|
2629
2706
|
"slots": [],
|
|
@@ -9827,6 +9904,32 @@
|
|
|
9827
9904
|
"returns": "Promise<string>",
|
|
9828
9905
|
"doc": "The text of one cell."
|
|
9829
9906
|
},
|
|
9907
|
+
{
|
|
9908
|
+
"name": "getCellHarness",
|
|
9909
|
+
"signature": "getCellHarness<T extends ComponentHarness>(row: number, column: string, query: HarnessQuery<T>): Promise<T>",
|
|
9910
|
+
"params": [
|
|
9911
|
+
{
|
|
9912
|
+
"name": "row",
|
|
9913
|
+
"type": "number",
|
|
9914
|
+
"optional": false,
|
|
9915
|
+
"doc": "The row's position, from 0."
|
|
9916
|
+
},
|
|
9917
|
+
{
|
|
9918
|
+
"name": "column",
|
|
9919
|
+
"type": "string",
|
|
9920
|
+
"optional": false,
|
|
9921
|
+
"doc": "The column's header text."
|
|
9922
|
+
},
|
|
9923
|
+
{
|
|
9924
|
+
"name": "query",
|
|
9925
|
+
"type": "HarnessQuery<T>",
|
|
9926
|
+
"optional": false,
|
|
9927
|
+
"doc": "The harness type, or a predicate from its `with()`."
|
|
9928
|
+
}
|
|
9929
|
+
],
|
|
9930
|
+
"returns": "Promise<T>",
|
|
9931
|
+
"doc": "A harness for a control in one cell, such as a `bf-toggle` of a settings matrix or a\n`bf-select` in a custom cell. Throws for an unknown row or column, or when the cell holds no\nmatching control."
|
|
9932
|
+
},
|
|
9830
9933
|
{
|
|
9831
9934
|
"name": "sortBy",
|
|
9832
9935
|
"signature": "sortBy(column: string): Promise<void>",
|
|
@@ -10016,6 +10119,79 @@
|
|
|
10016
10119
|
"since": "0.3.1",
|
|
10017
10120
|
"signature": "class BfTimeInputHarness extends ComponentHarness"
|
|
10018
10121
|
},
|
|
10122
|
+
{
|
|
10123
|
+
"name": "BfToggleHarness",
|
|
10124
|
+
"slug": "bf-toggle-harness",
|
|
10125
|
+
"kind": "class",
|
|
10126
|
+
"entryPoint": "@bitforgehq/ui/testing",
|
|
10127
|
+
"file": "testing/harnesses/toggle.harness.ts",
|
|
10128
|
+
"summary": "Test harness for the toggle: reads its name and state and switches it",
|
|
10129
|
+
"description": "Harness for `bf-toggle`. Its `label` filter matches the switch's name: the text of the elements\n`ariaLabelledby` names, else `ariaLabel`, else the visible label, so a label-less switch in a\ntable cell or a list row is found the same way.",
|
|
10130
|
+
"members": [],
|
|
10131
|
+
"methods": [
|
|
10132
|
+
{
|
|
10133
|
+
"name": "getLabel",
|
|
10134
|
+
"signature": "getLabel(): Promise<string>",
|
|
10135
|
+
"params": [],
|
|
10136
|
+
"returns": "Promise<string>",
|
|
10137
|
+
"doc": "The switch's name, as the browser computes it: the text of the elements `ariaLabelledby`\nnames, else `ariaLabel`, else the visible label (the `label` text and the default slot)."
|
|
10138
|
+
},
|
|
10139
|
+
{
|
|
10140
|
+
"name": "isChecked",
|
|
10141
|
+
"signature": "isChecked(): Promise<boolean>",
|
|
10142
|
+
"params": [],
|
|
10143
|
+
"returns": "Promise<boolean>",
|
|
10144
|
+
"doc": "Whether the switch is on."
|
|
10145
|
+
},
|
|
10146
|
+
{
|
|
10147
|
+
"name": "isDisabled",
|
|
10148
|
+
"signature": "isDisabled(): Promise<boolean>",
|
|
10149
|
+
"params": [],
|
|
10150
|
+
"returns": "Promise<boolean>",
|
|
10151
|
+
"doc": "Whether the switch is disabled."
|
|
10152
|
+
},
|
|
10153
|
+
{
|
|
10154
|
+
"name": "isReadonly",
|
|
10155
|
+
"signature": "isReadonly(): Promise<boolean>",
|
|
10156
|
+
"params": [],
|
|
10157
|
+
"returns": "Promise<boolean>",
|
|
10158
|
+
"doc": "Whether the switch is read-only (`aria-readonly`): it shows its state but a click does nothing."
|
|
10159
|
+
},
|
|
10160
|
+
{
|
|
10161
|
+
"name": "toggle",
|
|
10162
|
+
"signature": "toggle(): Promise<void>",
|
|
10163
|
+
"params": [],
|
|
10164
|
+
"returns": "Promise<void>",
|
|
10165
|
+
"doc": "Clicks the switch, as a user would, so it turns on or off. Throws while it is disabled (a\nuser's click would do nothing); a read-only switch takes the click and stays as it is."
|
|
10166
|
+
},
|
|
10167
|
+
{
|
|
10168
|
+
"name": "check",
|
|
10169
|
+
"signature": "check(): Promise<void>",
|
|
10170
|
+
"params": [],
|
|
10171
|
+
"returns": "Promise<void>",
|
|
10172
|
+
"doc": "Turns the switch on with a click; an on switch stays on. Throws while it is disabled."
|
|
10173
|
+
},
|
|
10174
|
+
{
|
|
10175
|
+
"name": "uncheck",
|
|
10176
|
+
"signature": "uncheck(): Promise<void>",
|
|
10177
|
+
"params": [],
|
|
10178
|
+
"returns": "Promise<void>",
|
|
10179
|
+
"doc": "Turns the switch off with a click; an off switch stays off. Throws while it is disabled."
|
|
10180
|
+
},
|
|
10181
|
+
{
|
|
10182
|
+
"name": "getErrorText",
|
|
10183
|
+
"signature": "getErrorText(): Promise<string>",
|
|
10184
|
+
"params": [],
|
|
10185
|
+
"returns": "Promise<string>",
|
|
10186
|
+
"doc": "The error text under the switch."
|
|
10187
|
+
}
|
|
10188
|
+
],
|
|
10189
|
+
"slots": [],
|
|
10190
|
+
"references": [],
|
|
10191
|
+
"usedBy": [],
|
|
10192
|
+
"since": "0.4.0",
|
|
10193
|
+
"signature": "class BfToggleHarness extends ComponentHarness"
|
|
10194
|
+
},
|
|
10019
10195
|
{
|
|
10020
10196
|
"name": "BfTooltipHarness",
|
|
10021
10197
|
"slug": "bf-tooltip-harness",
|
package/ai/UI_GUIDE.md
CHANGED
|
@@ -72,7 +72,7 @@ In `src/index.html`, give `<body>` the theme background and text colour, so the
|
|
|
72
72
|
|
|
73
73
|
### 7. Switch to dark mode
|
|
74
74
|
|
|
75
|
-
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. To let users choose System, Light or Dark, add `provideBfColorScheme()` to the app providers: it sets the class, follows the OS and remembers the choice.
|
|
75
|
+
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. To let users choose System, Light or Dark, add `provideBfColorScheme()` to the app providers: it sets the class, follows the OS and remembers the choice. For a near-black dark mode, add `@import '@bitforgehq/ui/dark-ink.css';` right after the theme import: the Ink preset, which changes dark mode only.
|
|
76
76
|
|
|
77
77
|
```html
|
|
78
78
|
<html lang="en" class="dark">
|
|
@@ -123,6 +123,10 @@ pressed, soft and strong steps, `on-primary`, `primary-text`, `selected`, `ring`
|
|
|
123
123
|
and a `.dark` block with each contrast pair's ratio, and exits 1 naming the pairs below their
|
|
124
124
|
minimum and a shade that passes; paste its output, never hand-pick the steps. Example (the
|
|
125
125
|
Meadow Sage green): `bunx bf-ui theme '#238652' --dark '#5cc48a'`.
|
|
126
|
+
For a near-black dark mode, import the opt-in Ink preset right after the theme,
|
|
127
|
+
`@import '@bitforgehq/ui/dark-ink.css';`: it redefines every dark token but the brand set under
|
|
128
|
+
`.dark` (light mode and the default dark stay as they are), so a brand `.dark` block goes after
|
|
129
|
+
it. Never copy its values into `.dark` by hand, and never put `dark:` classes on widgets for it.
|
|
126
130
|
`--radius-control` (`9999px`, pills) reshapes buttons, chips, badges, segmented, the tab bar, the
|
|
127
131
|
action bar and toggles at once:
|
|
128
132
|
|
|
@@ -143,10 +147,10 @@ Render library components only in the browser, for example in a `@defer` block o
|
|
|
143
147
|
route. Support will be decided before 1.0.
|
|
144
148
|
|
|
145
149
|
The one server-side check is a render smoke, not a support test: the library repository's
|
|
146
|
-
`tools/ssr-smoke.ts` renders
|
|
150
|
+
`tools/ssr-smoke.ts` renders 45 fixtures with `renderApplication()` (every root widget, `bf-icon`,
|
|
147
151
|
`bf-number-input`, a `/charts` line chart, a `/mobile` page with `provideBfShell()`, `bf-page`,
|
|
148
152
|
`bf-header` and `bf-content`, `bf-tabs` with `bf-stack-outlet` under the router, and an `/overlay`
|
|
149
|
-
dialog), and all of them render without an error.
|
|
153
|
+
dialog), and all of them render without an error. 29 of them render identically twice. The other 16
|
|
150
154
|
number their ids differently on every render, from a module-level counter, so they could not
|
|
151
155
|
hydrate: `bf-app-frame`, `bf-calendar`, `bf-checkbox`, `bf-input`, `bf-radio-group`, `bf-segmented`,
|
|
152
156
|
`bf-select`, `bf-sidebar`, `bf-tab-group`, `bf-table`, `bf-textarea`, `bf-theme-switch`,
|
|
@@ -374,8 +378,14 @@ protected readonly colorScheme = inject(BfColorSchemeService);
|
|
|
374
378
|
sorts the rows in a `computed()`, and a selection shows a `bf-action-bar`. `stack="narrow"`
|
|
375
379
|
(below 36rem of its own width) or `stack="coarse"` turns each row into a label/value tile with
|
|
376
380
|
a sort and select bar; in the Capacitor shell use `bf-list-item` rows instead.
|
|
381
|
+
A settings matrix puts a `bf-toggle` in each cell (`align: 'center'` columns, the row label
|
|
382
|
+
first, every toggle named `[ariaLabel]="column + ', ' + row"`).
|
|
377
383
|
- **Details:** `bf-description-list` of `div[bfDescriptionItem]` label/value pairs, and `bf-stat`
|
|
378
384
|
figure tiles in a grid; both work in both shells.
|
|
385
|
+
- **History:** `<bf-timeline label="…">` of `<bf-timeline-event actor="…" [time]="iso" tone="…">`
|
|
386
|
+
(text with inline links in the content, a small action in `bfSlot="end"`) for a record's
|
|
387
|
+
history or an audit trail, in the order the app gives; times follow `LOCALE_ID` (`timeFormat`,
|
|
388
|
+
`timeText` for a relative time). Not for navigation or steps.
|
|
379
389
|
- **Cards in a grid:** the grid stretches each `bf-card` and its `bfSlot="footer"` sits on the
|
|
380
390
|
bottom edge, so footers line up; put a footer's parts in one element.
|
|
381
391
|
- **Rows on a card:** `<bf-list [inset]="false" divided class="-mx-card">`, flush to the card's
|
|
@@ -408,6 +418,13 @@ protected readonly colorScheme = inject(BfColorSchemeService);
|
|
|
408
418
|
- **Empty pages:** a 404, "no access" or "nothing here yet" page is a `bf-empty-state` with
|
|
409
419
|
`headingLevel` 1, centred in the content area, with the main action and an optional link.
|
|
410
420
|
- **Toolbar on a phone:** `bf-toolbar` keeps its status and actions together on the last row.
|
|
421
|
+
- **Severity:** soft `bf-badge` tones for most states; `emphasis="strong"` (a solid fill, also on
|
|
422
|
+
a count pill) only for the one that must stand out, such as `variant="danger"` "Critical".
|
|
423
|
+
- **Inbox and notifications:** `bf-list-item [unread]="!item.read"` (dot, bolder title, "Unread"
|
|
424
|
+
read before the title, also in its `bfAction`'s name); clear it when the row is opened.
|
|
425
|
+
- **Instructions in order:** `<bf-steps>` of `<bf-step title="Install the app">…details…</bf-step>`
|
|
426
|
+
(`start` to continue a list) for setup steps in both shells; not a wizard (a multi-page flow
|
|
427
|
+
with state is a set of pages).
|
|
411
428
|
|
|
412
429
|
## Overlays (`@bitforgehq/ui/overlay`)
|
|
413
430
|
|
|
@@ -976,7 +993,7 @@ describe('bf-button in a consumer app (Vitest)', () => {
|
|
|
976
993
|
|
|
977
994
|
### 6. Drive a form widget through its harness
|
|
978
995
|
|
|
979
|
-
The entry ships CDK harnesses for the widgets whose markup is not obvious to drive: `BfSelectHarness`, `BfRadioGroupHarness`, `BfSegmentedHarness`, `BfDialogHarness`, `BfMenuHarness`, `BfMenuItemHarness`, `BfMenuButtonHarness`, `BfDesktopToastHarness`, `BfTableHarness`, `BfPaginationHarness` `BfTabGroupHarness`, `BfCalendarHarness` and `BfChartHarness`. `with({ label })` finds a widget by its label. Load an in-page widget with `TestbedHarnessEnvironment.loader(fixture)`.
|
|
996
|
+
The entry ships CDK harnesses for the widgets whose markup is not obvious to drive: `BfSelectHarness`, `BfRadioGroupHarness`, `BfSegmentedHarness`, `BfDialogHarness`, `BfMenuHarness`, `BfMenuItemHarness`, `BfMenuButtonHarness`, `BfDesktopToastHarness`, `BfTableHarness`, `BfToggleHarness`, `BfPaginationHarness` `BfTabGroupHarness`, `BfCalendarHarness` and `BfChartHarness`. `with({ label })` finds a widget by its label. Load an in-page widget with `TestbedHarnessEnvironment.loader(fixture)`.
|
|
980
997
|
|
|
981
998
|
`select-harness.spec.ts`:
|
|
982
999
|
|
|
@@ -1239,7 +1256,11 @@ notes.
|
|
|
1239
1256
|
| `bf-progress` | `@bitforgehq/ui` | Progress bar in two sizes and four tones for completion, quotas and unknown waits |
|
|
1240
1257
|
| `bf-sparkline` | `@bitforgehq/ui/charts` | Tiny trend line with no axes or legend, for stats and table cells |
|
|
1241
1258
|
| `bf-stat` | `@bitforgehq/ui` | One labelled figure with an optional icon tile and a supporting line |
|
|
1259
|
+
| `bf-step` | `@bitforgehq/ui` | One numbered step of an instruction list, with a title and its details |
|
|
1260
|
+
| `bf-steps` | `@bitforgehq/ui` | Numbered instruction steps a user follows in order, with joined markers |
|
|
1242
1261
|
| `bf-table` | `@bitforgehq/ui` | Desktop data table with sortable headers, row selection, custom cells and an empty slot |
|
|
1262
|
+
| `bf-timeline` | `@bitforgehq/ui` | Dated list of events with who did what and when, on a vertical line |
|
|
1263
|
+
| `bf-timeline-event` | `@bitforgehq/ui` | One timeline event with a coloured marker, its text, actor and time |
|
|
1243
1264
|
|
|
1244
1265
|
### Feedback
|
|
1245
1266
|
|
package/ai/components/badge.md
CHANGED
|
@@ -66,6 +66,31 @@ import { BfBadgeComponent } from '@bitforgehq/ui';
|
|
|
66
66
|
export class BadgeStatusExampleComponent {}
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
+
## Emphasis
|
|
70
|
+
|
|
71
|
+
`emphasis="strong"` turns the soft tint into a solid fill with contrasting text, for the one state that must stand out from the rest: a "Critical" finding among "High" and "Medium" ones. It takes every variant (`primary` uses the brand fill) and the count pill too: a strong count takes its fill from `variant`, so `variant="danger" emphasis="strong" [count]="3"` is a red pill, while a soft count stays the primary pill. `emphasis` takes a `BfBadgeEmphasis` (`soft`, the default, or `strong`).
|
|
72
|
+
|
|
73
|
+
```ts
|
|
74
|
+
import { Component } from '@angular/core';
|
|
75
|
+
import { BfBadgeComponent } from '@bitforgehq/ui';
|
|
76
|
+
|
|
77
|
+
/** A strong badge marks the one critical finding among soft status badges. */
|
|
78
|
+
@Component({
|
|
79
|
+
selector: 'app-example-badge-strong',
|
|
80
|
+
imports: [BfBadgeComponent],
|
|
81
|
+
template: `
|
|
82
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
83
|
+
<bf-badge variant="danger" emphasis="strong">Critical</bf-badge>
|
|
84
|
+
<bf-badge variant="danger">High</bf-badge>
|
|
85
|
+
<bf-badge variant="warning">Medium</bf-badge>
|
|
86
|
+
<bf-badge>Low</bf-badge>
|
|
87
|
+
<bf-badge variant="danger" emphasis="strong" [count]="3" countLabel="critical findings" />
|
|
88
|
+
</div>
|
|
89
|
+
`,
|
|
90
|
+
})
|
|
91
|
+
export class BadgeStrongExampleComponent {}
|
|
92
|
+
```
|
|
93
|
+
|
|
69
94
|
## Count pill
|
|
70
95
|
|
|
71
96
|
Setting `count` switches to the compact primary pill. Values above 99 render as "99+"; zero renders as "0".
|
|
@@ -128,17 +153,19 @@ Consumes tokens by variant, background then text:
|
|
|
128
153
|
- `danger`: `danger-soft` / `danger`
|
|
129
154
|
- `info`: `info-soft` / `info` (≥ 4.5:1 in both modes; it is not derived from the primary, so a custom brand colour leaves it unchanged)
|
|
130
155
|
- Count pill (`count` set): `primary` / `on-primary`, ignoring `variant`
|
|
156
|
+
- Strong (`emphasis="strong"`, label and count pill): `<variant>-strong` / `on-<variant>-strong` (`neutral-strong`, `success-strong`, `warning-strong`, `danger-strong`, `info-strong`, each with its `on-` text token; ≥ 4.5:1 in both modes and the fill ≥ 3:1 on `bg`, `surface` and `surface-sunken`); `primary` uses `primary` / `on-primary`. An app can retune `--color-danger-strong` and `--color-on-danger-strong` (and the others) in `@theme` and `.dark` like any status token
|
|
131
157
|
- Shape (label and count pill): `rounded-control` (`--radius-control`, `9999px` by default).
|
|
132
158
|
|
|
133
159
|
## Accessibility
|
|
134
160
|
|
|
135
|
-
A badge is a plain `<span>` with no role or ARIA attributes; its text is read as part of the surrounding content, so pair it with a label or context that says what it means rather than relying on color alone. A count pill with `countLabel` carries that context itself: a visually hidden (`sr-only`) span after the number, read as one phrase with it ("99+ unread messages").
|
|
161
|
+
A badge is a plain `<span>` with no role or ARIA attributes; its text is read as part of the surrounding content, so pair it with a label or context that says what it means rather than relying on color alone. A count pill with `countLabel` carries that context itself: a visually hidden (`sr-only`) span after the number, read as one phrase with it ("99+ unread messages"). A strong badge is louder, not more meaningful: its text ("Critical", "Kritisch") still says the state. In forced colours (Windows High Contrast) the fills give way to the system colours, so a strong badge draws a `CanvasText` outline and still reads as a filled pill next to a soft one.
|
|
136
162
|
|
|
137
163
|
## Inputs
|
|
138
164
|
|
|
139
165
|
| Name | Type | Default | Description |
|
|
140
166
|
| ------------ | ---------------------------------------------------------------------------------------------- | ----------- | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
141
|
-
| `variant` | `BfBadgeAppearance` (`'neutral' \| 'primary' \| 'success' \| 'warning' \| 'danger' \| 'info'`) | `'neutral'` | Tint for the label style: neutral, primary, success, warning, danger or info. Ignored
|
|
167
|
+
| `variant` | `BfBadgeAppearance` (`'neutral' \| 'primary' \| 'success' \| 'warning' \| 'danger' \| 'info'`) | `'neutral'` | Tint for the label style: neutral, primary, success, warning, danger or info. Ignored by a soft count pill; a strong one takes its fill from it. |
|
|
168
|
+
| `emphasis` | `BfBadgeEmphasis` (`'soft' \| 'strong'`) | `'soft'` | `soft` (a pale tint, the default) or `strong` (a solid fill with contrasting text, also for the count pill). |
|
|
142
169
|
| `count` | `number \| undefined` | `undefined` | Switches to the count pill; values above 99 render as "99+". |
|
|
143
170
|
| `countLabel` | `string` | `''` | What the count counts ("unread messages"), read by assistive tech after the number ("99+ unread messages"); visually hidden. Only used with `count`. |
|
|
144
171
|
|
|
@@ -152,15 +179,25 @@ A badge is a plain `<span>` with no role or ARIA attributes; its text is read as
|
|
|
152
179
|
|
|
153
180
|
- Keep labels to one or two words; badges are scanned, not read.
|
|
154
181
|
- Pair a count pill with a label or icon that says what is being counted, and set `countLabel` so the number is not read alone.
|
|
182
|
+
- Keep `emphasis="strong"` for the one state that must stand out on the screen, such as critical findings.
|
|
155
183
|
|
|
156
184
|
### Don't
|
|
157
185
|
|
|
158
186
|
- Don't use a badge as a button; it has no interactive states.
|
|
159
187
|
- Don't invent new colors on it; pick the variant that matches the meaning.
|
|
160
188
|
- Don't use `primary` or `success` for a category; use `info`, so the status tones keep their meaning.
|
|
189
|
+
- Don't make every badge strong: when all of them shout, none stands out.
|
|
161
190
|
|
|
162
191
|
## Migration notes
|
|
163
192
|
|
|
193
|
+
### 0.4.0
|
|
194
|
+
|
|
195
|
+
New `emphasis` input (`BfBadgeEmphasis`: `soft`, the default, or `strong`). `strong` is a solid
|
|
196
|
+
fill with contrasting text in every variant, for the one state that must stand out ("Critical");
|
|
197
|
+
`primary` uses the brand fill. A strong count pill takes its fill from `variant` (a soft count pill
|
|
198
|
+
stays primary, as before). In forced colours a strong badge keeps a `CanvasText` outline. Opt-in:
|
|
199
|
+
without `emphasis` nothing changes.
|
|
200
|
+
|
|
164
201
|
### 0.3.1
|
|
165
202
|
|
|
166
203
|
New `info` tone for informational labels such as a category, on the new `info` / `info-soft`
|