@bitforgehq/ui 0.5.0-next.3 → 0.5.0-next.4
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 +47 -0
- package/README.md +3 -3
- package/ai/MANIFEST.index.json +9 -0
- package/ai/MANIFEST.json +265 -5
- package/ai/REFERENCE.index.json +28 -0
- package/ai/REFERENCE.json +172 -3
- package/ai/UI_GUIDE.md +14 -5
- package/ai/components/badge.md +41 -1
- package/ai/components/image-tile.md +452 -0
- package/ai/components/menu-button.md +65 -9
- package/ai/components/pagination.md +59 -11
- package/ai/reference/bf-image-tile-aspect.md +28 -0
- package/ai/reference/bf-image-tile-caption-placement.md +27 -0
- package/ai/reference/bf-image-tile-harness.md +70 -0
- package/ai/reference/bf-labels.md +3 -1
- package/ai/reference/bf-pagination-position-label.md +22 -0
- package/ai/reference/provide-bf-labels.md +2 -1
- package/fesm2022/bitforgehq-ui-overlay.mjs +26 -3
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +59 -1
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +576 -55
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +779 -9
- package/llms.txt +5 -0
- package/package.json +1 -1
- package/types/bitforgehq-ui-overlay.d.ts +11 -0
- package/types/bitforgehq-ui-testing.d.ts +83 -0
- package/types/bitforgehq-ui.d.ts +239 -12
package/ai/REFERENCE.json
CHANGED
|
@@ -915,6 +915,40 @@
|
|
|
915
915
|
"signature": "type BfImageInputShape = 'round' | 'square'",
|
|
916
916
|
"values": ["round", "square"]
|
|
917
917
|
},
|
|
918
|
+
{
|
|
919
|
+
"name": "BfImageTileAspect",
|
|
920
|
+
"slug": "bf-image-tile-aspect",
|
|
921
|
+
"kind": "type",
|
|
922
|
+
"entryPoint": "@bitforgehq/ui",
|
|
923
|
+
"file": "src/components/image-tile/image-tile.component.ts",
|
|
924
|
+
"summary": "The four aspect ratios of an image tile's picture, square by default",
|
|
925
|
+
"description": "The aspect ratio of a `bf-image-tile`'s picture: square (default), 4:3, 16:9 or 3:4.",
|
|
926
|
+
"members": [],
|
|
927
|
+
"methods": [],
|
|
928
|
+
"slots": [],
|
|
929
|
+
"references": [],
|
|
930
|
+
"usedBy": ["bf-image-tile-component"],
|
|
931
|
+
"since": "0.5.0",
|
|
932
|
+
"signature": "type BfImageTileAspect = '1/1' | '4/3' | '16/9' | '3/4'",
|
|
933
|
+
"values": ["1/1", "4/3", "16/9", "3/4"]
|
|
934
|
+
},
|
|
935
|
+
{
|
|
936
|
+
"name": "BfImageTileCaptionPlacement",
|
|
937
|
+
"slug": "bf-image-tile-caption-placement",
|
|
938
|
+
"kind": "type",
|
|
939
|
+
"entryPoint": "@bitforgehq/ui",
|
|
940
|
+
"file": "src/components/image-tile/image-tile.component.ts",
|
|
941
|
+
"summary": "Where an image tile's caption sits, below the picture or over it",
|
|
942
|
+
"description": "Where a `bf-image-tile`'s title and meta line sit: `below` the picture (default), or `overlay`,\non a soft gradient over the bottom of the picture.",
|
|
943
|
+
"members": [],
|
|
944
|
+
"methods": [],
|
|
945
|
+
"slots": [],
|
|
946
|
+
"references": [],
|
|
947
|
+
"usedBy": ["bf-image-tile-component"],
|
|
948
|
+
"since": "0.5.0",
|
|
949
|
+
"signature": "type BfImageTileCaptionPlacement = 'below' | 'overlay'",
|
|
950
|
+
"values": ["below", "overlay"]
|
|
951
|
+
},
|
|
918
952
|
{
|
|
919
953
|
"name": "BfInputAutocapitalize",
|
|
920
954
|
"slug": "bf-input-autocapitalize",
|
|
@@ -1899,10 +1933,28 @@
|
|
|
1899
1933
|
"kind": "property",
|
|
1900
1934
|
"type": "string",
|
|
1901
1935
|
"required": true,
|
|
1902
|
-
"doc": "bf-media-card's and bf-image-viewer's message for an image that failed to load.",
|
|
1936
|
+
"doc": "bf-media-card's, bf-image-tile's and bf-image-viewer's message for an image that failed to load.",
|
|
1903
1937
|
"readonly": true,
|
|
1904
1938
|
"default": "'The image could not be loaded'"
|
|
1905
1939
|
},
|
|
1940
|
+
{
|
|
1941
|
+
"name": "imageTileEmpty",
|
|
1942
|
+
"kind": "property",
|
|
1943
|
+
"type": "string",
|
|
1944
|
+
"required": true,
|
|
1945
|
+
"doc": "bf-image-tile's placeholder text while it has no image yet.",
|
|
1946
|
+
"readonly": true,
|
|
1947
|
+
"default": "'No image yet'"
|
|
1948
|
+
},
|
|
1949
|
+
{
|
|
1950
|
+
"name": "imageTileSelected",
|
|
1951
|
+
"kind": "property",
|
|
1952
|
+
"type": "string",
|
|
1953
|
+
"required": true,
|
|
1954
|
+
"doc": "bf-image-tile's selected state, read before the tile's title (\"Selected, Dragon\").",
|
|
1955
|
+
"readonly": true,
|
|
1956
|
+
"default": "'Selected'"
|
|
1957
|
+
},
|
|
1906
1958
|
{
|
|
1907
1959
|
"name": "imageViewer",
|
|
1908
1960
|
"kind": "property",
|
|
@@ -2020,6 +2072,22 @@
|
|
|
2020
2072
|
"signature": "type BfPageHeaderHeadingLevel = 1 | 2",
|
|
2021
2073
|
"values": ["1", "2"]
|
|
2022
2074
|
},
|
|
2075
|
+
{
|
|
2076
|
+
"name": "BfPaginationPositionLabel",
|
|
2077
|
+
"slug": "bf-pagination-position-label",
|
|
2078
|
+
"kind": "type",
|
|
2079
|
+
"entryPoint": "@bitforgehq/ui",
|
|
2080
|
+
"file": "src/components/pagination/pagination.component.ts",
|
|
2081
|
+
"summary": "Function that writes a compact pager's position text, such as \"v3 of 7\"",
|
|
2082
|
+
"description": "Writes a compact `bf-pagination`'s position text from the current page and the page count, such\nas \"v3 of 7\" for page 3 of 7.",
|
|
2083
|
+
"members": [],
|
|
2084
|
+
"methods": [],
|
|
2085
|
+
"slots": [],
|
|
2086
|
+
"references": [],
|
|
2087
|
+
"usedBy": ["bf-pagination-component"],
|
|
2088
|
+
"since": "0.5.0",
|
|
2089
|
+
"signature": "type BfPaginationPositionLabel = (page: number, count: number) => string"
|
|
2090
|
+
},
|
|
2023
2091
|
{
|
|
2024
2092
|
"name": "BfProgressSize",
|
|
2025
2093
|
"slug": "bf-progress-size",
|
|
@@ -3170,7 +3238,7 @@
|
|
|
3170
3238
|
"entryPoint": "@bitforgehq/ui",
|
|
3171
3239
|
"file": "src/config/labels.ts",
|
|
3172
3240
|
"summary": "Replaces built-in strings for an app or a sub-tree, such as a translation",
|
|
3173
|
-
"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`,\n`fileInputChoose`, `fileInputDropHint`, `fileInputDropzone`, `fileInputTapToChoose`, `fileInputRemove`,\n`fileInputDismiss`, `fileInputAdded`, `fileInputNotAdded`, `fileInputRemoved`, `fileInputCount`,\n`fileRejectedType`, `fileRejectedSize`, `fileRejectedCount`,\n`imageInputChoose`, `imageInputUpload`, `imageInputReplace`, `imageInputRemove`,\n`chatThread`, `chatJumpToLatest`, `chatMessageStopped`, `chatMessageFailed`, `chatComposer`,\n`chatSend`, `chatStop`, `mediaCardSelect`, `imageLoadFailed`, `validation`); the overlay\nservices (`ok`, `cancel`, `actions`, `sheet`, `modal`, `close`, `expand`, `collapse`,\n`sheetPosition`, `dialog`, `notifications`, `imageViewer`, `imageViewerPrevious`,\n`imageViewerNext`, `imageViewerPosition`) are root singletons and pick it up only when the caller passes its injector:\n`open(…, { injector: inject(Injector) })`.",
|
|
3241
|
+
"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`,\n`fileInputChoose`, `fileInputDropHint`, `fileInputDropzone`, `fileInputTapToChoose`, `fileInputRemove`,\n`fileInputDismiss`, `fileInputAdded`, `fileInputNotAdded`, `fileInputRemoved`, `fileInputCount`,\n`fileRejectedType`, `fileRejectedSize`, `fileRejectedCount`,\n`imageInputChoose`, `imageInputUpload`, `imageInputReplace`, `imageInputRemove`,\n`chatThread`, `chatJumpToLatest`, `chatMessageStopped`, `chatMessageFailed`, `chatComposer`,\n`chatSend`, `chatStop`, `mediaCardSelect`, `imageLoadFailed`, `imageTileEmpty`,\n`imageTileSelected`, `validation`); the overlay\nservices (`ok`, `cancel`, `actions`, `sheet`, `modal`, `close`, `expand`, `collapse`,\n`sheetPosition`, `dialog`, `notifications`, `imageViewer`, `imageViewerPrevious`,\n`imageViewerNext`, `imageViewerPosition`) are root singletons and pick it up only when the caller passes its injector:\n`open(…, { injector: inject(Injector) })`.",
|
|
3174
3242
|
"members": [],
|
|
3175
3243
|
"methods": [
|
|
3176
3244
|
{
|
|
@@ -3185,7 +3253,7 @@
|
|
|
3185
3253
|
}
|
|
3186
3254
|
],
|
|
3187
3255
|
"returns": "Provider",
|
|
3188
|
-
"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`,\n`fileInputChoose`, `fileInputDropHint`, `fileInputDropzone`, `fileInputTapToChoose`, `fileInputRemove`,\n`fileInputDismiss`, `fileInputAdded`, `fileInputNotAdded`, `fileInputRemoved`, `fileInputCount`,\n`fileRejectedType`, `fileRejectedSize`, `fileRejectedCount`,\n`imageInputChoose`, `imageInputUpload`, `imageInputReplace`, `imageInputRemove`,\n`chatThread`, `chatJumpToLatest`, `chatMessageStopped`, `chatMessageFailed`, `chatComposer`,\n`chatSend`, `chatStop`, `mediaCardSelect`, `imageLoadFailed`, `validation`); the overlay\nservices (`ok`, `cancel`, `actions`, `sheet`, `modal`, `close`, `expand`, `collapse`,\n`sheetPosition`, `dialog`, `notifications`, `imageViewer`, `imageViewerPrevious`,\n`imageViewerNext`, `imageViewerPosition`) are root singletons and pick it up only when the caller passes its injector:\n`open(…, { injector: inject(Injector) })`."
|
|
3256
|
+
"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`,\n`fileInputChoose`, `fileInputDropHint`, `fileInputDropzone`, `fileInputTapToChoose`, `fileInputRemove`,\n`fileInputDismiss`, `fileInputAdded`, `fileInputNotAdded`, `fileInputRemoved`, `fileInputCount`,\n`fileRejectedType`, `fileRejectedSize`, `fileRejectedCount`,\n`imageInputChoose`, `imageInputUpload`, `imageInputReplace`, `imageInputRemove`,\n`chatThread`, `chatJumpToLatest`, `chatMessageStopped`, `chatMessageFailed`, `chatComposer`,\n`chatSend`, `chatStop`, `mediaCardSelect`, `imageLoadFailed`, `imageTileEmpty`,\n`imageTileSelected`, `validation`); the overlay\nservices (`ok`, `cancel`, `actions`, `sheet`, `modal`, `close`, `expand`, `collapse`,\n`sheetPosition`, `dialog`, `notifications`, `imageViewer`, `imageViewerPrevious`,\n`imageViewerNext`, `imageViewerPosition`) are root singletons and pick it up only when the caller passes its injector:\n`open(…, { injector: inject(Injector) })`."
|
|
3189
3257
|
}
|
|
3190
3258
|
],
|
|
3191
3259
|
"slots": [],
|
|
@@ -10229,6 +10297,107 @@
|
|
|
10229
10297
|
"since": "0.5.0",
|
|
10230
10298
|
"signature": "class BfImageInputHarness extends ComponentHarness"
|
|
10231
10299
|
},
|
|
10300
|
+
{
|
|
10301
|
+
"name": "BfImageTileHarness",
|
|
10302
|
+
"slug": "bf-image-tile-harness",
|
|
10303
|
+
"kind": "class",
|
|
10304
|
+
"entryPoint": "@bitforgehq/ui/testing",
|
|
10305
|
+
"file": "testing/harnesses/image-tile.harness.ts",
|
|
10306
|
+
"summary": "Test harness for an image tile: its picture state, title, meta, selection and action",
|
|
10307
|
+
"description": "Harness for `bf-image-tile`. jsdom never loads images, so `loadImage()` and `failImage()` fire\nthe picture's `load` and `error` events the way a browser would; `getState()` then tells what\nthe tile shows. `click()` clicks the tile's `bfAction` link or button.",
|
|
10308
|
+
"members": [],
|
|
10309
|
+
"methods": [
|
|
10310
|
+
{
|
|
10311
|
+
"name": "getTitle",
|
|
10312
|
+
"signature": "getTitle(): Promise<string>",
|
|
10313
|
+
"params": [],
|
|
10314
|
+
"returns": "Promise<string>",
|
|
10315
|
+
"doc": "The tile's title: the text of its default slot."
|
|
10316
|
+
},
|
|
10317
|
+
{
|
|
10318
|
+
"name": "getMeta",
|
|
10319
|
+
"signature": "getMeta(): Promise<string>",
|
|
10320
|
+
"params": [],
|
|
10321
|
+
"returns": "Promise<string>",
|
|
10322
|
+
"doc": "The meta line under the title."
|
|
10323
|
+
},
|
|
10324
|
+
{
|
|
10325
|
+
"name": "getState",
|
|
10326
|
+
"signature": "getState(): Promise<'empty' | 'loading' | 'loaded' | 'failed'>",
|
|
10327
|
+
"params": [],
|
|
10328
|
+
"returns": "Promise<'empty' | 'loading' | 'loaded' | 'failed'>",
|
|
10329
|
+
"doc": "What the picture area shows: `empty` (the placeholder), `loading` (the skeleton), `loaded`\n(the picture) or `failed` (the failure message)."
|
|
10330
|
+
},
|
|
10331
|
+
{
|
|
10332
|
+
"name": "getSrc",
|
|
10333
|
+
"signature": "getSrc(): Promise<string>",
|
|
10334
|
+
"params": [],
|
|
10335
|
+
"returns": "Promise<string>",
|
|
10336
|
+
"doc": "The URL of the picture."
|
|
10337
|
+
},
|
|
10338
|
+
{
|
|
10339
|
+
"name": "getAlt",
|
|
10340
|
+
"signature": "getAlt(): Promise<string>",
|
|
10341
|
+
"params": [],
|
|
10342
|
+
"returns": "Promise<string>",
|
|
10343
|
+
"doc": "The alternative text of the picture."
|
|
10344
|
+
},
|
|
10345
|
+
{
|
|
10346
|
+
"name": "getPlaceholderText",
|
|
10347
|
+
"signature": "getPlaceholderText(): Promise<string>",
|
|
10348
|
+
"params": [],
|
|
10349
|
+
"returns": "Promise<string>",
|
|
10350
|
+
"doc": "The placeholder text while there is no picture."
|
|
10351
|
+
},
|
|
10352
|
+
{
|
|
10353
|
+
"name": "getFailedMessage",
|
|
10354
|
+
"signature": "getFailedMessage(): Promise<string>",
|
|
10355
|
+
"params": [],
|
|
10356
|
+
"returns": "Promise<string>",
|
|
10357
|
+
"doc": "The failure message."
|
|
10358
|
+
},
|
|
10359
|
+
{
|
|
10360
|
+
"name": "isSelected",
|
|
10361
|
+
"signature": "isSelected(): Promise<boolean>",
|
|
10362
|
+
"params": [],
|
|
10363
|
+
"returns": "Promise<boolean>",
|
|
10364
|
+
"doc": "Whether the tile is marked selected."
|
|
10365
|
+
},
|
|
10366
|
+
{
|
|
10367
|
+
"name": "isClickable",
|
|
10368
|
+
"signature": "isClickable(): Promise<boolean>",
|
|
10369
|
+
"params": [],
|
|
10370
|
+
"returns": "Promise<boolean>",
|
|
10371
|
+
"doc": "Whether the tile is clickable (has a `bfAction` link or button)."
|
|
10372
|
+
},
|
|
10373
|
+
{
|
|
10374
|
+
"name": "click",
|
|
10375
|
+
"signature": "click(): Promise<void>",
|
|
10376
|
+
"params": [],
|
|
10377
|
+
"returns": "Promise<void>",
|
|
10378
|
+
"doc": "Clicks the tile's `bfAction` link or button. Throws for a tile without one."
|
|
10379
|
+
},
|
|
10380
|
+
{
|
|
10381
|
+
"name": "loadImage",
|
|
10382
|
+
"signature": "loadImage(): Promise<void>",
|
|
10383
|
+
"params": [],
|
|
10384
|
+
"returns": "Promise<void>",
|
|
10385
|
+
"doc": "Fires the picture's `load` event, as a browser does when it arrives. Throws without one."
|
|
10386
|
+
},
|
|
10387
|
+
{
|
|
10388
|
+
"name": "failImage",
|
|
10389
|
+
"signature": "failImage(): Promise<void>",
|
|
10390
|
+
"params": [],
|
|
10391
|
+
"returns": "Promise<void>",
|
|
10392
|
+
"doc": "Fires the picture's `error` event, as a browser does when it fails. Throws without one."
|
|
10393
|
+
}
|
|
10394
|
+
],
|
|
10395
|
+
"slots": [],
|
|
10396
|
+
"references": [],
|
|
10397
|
+
"usedBy": [],
|
|
10398
|
+
"since": "0.5.0",
|
|
10399
|
+
"signature": "class BfImageTileHarness extends ComponentHarness"
|
|
10400
|
+
},
|
|
10232
10401
|
{
|
|
10233
10402
|
"name": "BfImageViewerHarness",
|
|
10234
10403
|
"slug": "bf-image-viewer-harness",
|
package/ai/UI_GUIDE.md
CHANGED
|
@@ -147,10 +147,10 @@ Render library components only in the browser, for example in a `@defer` block o
|
|
|
147
147
|
route. Support will be decided before 1.0.
|
|
148
148
|
|
|
149
149
|
The one server-side check is a render smoke, not a support test: the library repository's
|
|
150
|
-
`tools/ssr-smoke.ts` renders
|
|
150
|
+
`tools/ssr-smoke.ts` renders 50 fixtures with `renderApplication()` (every root widget, `bf-icon`,
|
|
151
151
|
`bf-number-input`, `bf-select` from `/overlay`, a `/charts` line chart, a `/mobile` page with
|
|
152
152
|
`provideBfShell()`, `bf-page`, `bf-header` and `bf-content`, `bf-tabs` with `bf-stack-outlet` under
|
|
153
|
-
the router, and an `/overlay` dialog), and all of them render without an error.
|
|
153
|
+
the router, and an `/overlay` dialog), and all of them render without an error. 32 of them render
|
|
154
154
|
identically twice. The other 18 number their ids differently on every render, from a module-level
|
|
155
155
|
counter, so they could not hydrate: `bf-app-frame`, `bf-calendar`, `bf-checkbox`, `bf-file-input`, `bf-image-input`, `bf-input`,
|
|
156
156
|
`bf-radio-group`, `bf-segmented`, `bf-select`, `bf-sidebar`, `bf-tab-group`, `bf-table`,
|
|
@@ -254,7 +254,7 @@ you can guess a binding without looking it up:
|
|
|
254
254
|
spinner, tab bar, progress or icon); every component that renders a native input, select or
|
|
255
255
|
textarea (checkbox and toggle included) also takes `ariaLabel` and `ariaLabelledby` for when no
|
|
256
256
|
visible `label` is shown; a built-in sub-control's name is `<part>Label` (`dismissLabel`,
|
|
257
|
-
`closeLabel`, `actionLabel`); `alt` only on `bf-avatar` and `bf-
|
|
257
|
+
`closeLabel`, `actionLabel`); `alt` only on `bf-avatar`, `bf-media-card` and `bf-image-tile`.
|
|
258
258
|
- Types: every union or object type of an input, model, output, `Bf…Options`/`Bf…Config` property
|
|
259
259
|
or an interface they name is a named type exported from the same entry
|
|
260
260
|
(`BfToggleLabelPosition`, `BfRefresherRefreshEvent`, `BfDialogRole`, …), so type your own state
|
|
@@ -416,6 +416,11 @@ protected readonly colorScheme = inject(BfColorSchemeService);
|
|
|
416
416
|
when it fails; retry with a changed `src`. Never project your own `<img>` for the main picture.
|
|
417
417
|
Clickable like `bf-card` (a `bfAction` in the title); `selectable` with `[(selected)]` and
|
|
418
418
|
`label` for a pick-several grid.
|
|
419
|
+
- **Thumbnail grids:** `bf-image-tile` (`[src]`, `alt`, `aspect`, `captionPlacement="overlay"`
|
|
420
|
+
for the title on a gradient over the picture), with a `bfAction` link or button in its title
|
|
421
|
+
heading, `bfSlot="meta"` for a date or count, `bfSlot="badge"` for a `bf-badge` and
|
|
422
|
+
`[selected]` for the current one. Put tiles straight into a CSS grid: they stretch to the row
|
|
423
|
+
and keep two title lines, so a row lines up; give every tile a meta line or none.
|
|
419
424
|
- **Rows on a card:** `<bf-list [inset]="false" divided class="-mx-card">`, flush to the card's
|
|
420
425
|
edges with lines between the rows.
|
|
421
426
|
- **Theme switch:** `<bf-theme-switch [(value)]="colorScheme.scheme" />` (or
|
|
@@ -427,6 +432,9 @@ protected readonly colorScheme = inject(BfColorSchemeService);
|
|
|
427
432
|
- **Paging and loading:** `<bf-pagination [(page)]="page" [total]="count" [pageSize]="20">` under a
|
|
428
433
|
`bf-table` (the app slices its rows); `bf-skeleton` (`shape` text/rect/circle, `lines`) as the
|
|
429
434
|
placeholder while data loads, inside a region with `aria-busy="true"`.
|
|
435
|
+
- **Stepping through versions:** a compact `bf-pagination` with `[pageCount]`,
|
|
436
|
+
`[positionLabel]="(page, count) => …"` ("v3 of 7") and `previousLabel`/`nextLabel`; past four
|
|
437
|
+
options it replaces a `bf-segmented`.
|
|
430
438
|
- **Dates and times:** `<bf-calendar [(value)]="date">` for an inline month view;
|
|
431
439
|
`bf-date-input`, `bf-time-input` and `bf-datetime-input` (`/overlay`) for a field: typed parts
|
|
432
440
|
in locale order plus a calendar or time-list popover (`picker="none"` for typed only, `native`
|
|
@@ -1027,7 +1035,7 @@ describe('bf-button in a consumer app (Vitest)', () => {
|
|
|
1027
1035
|
|
|
1028
1036
|
### 6. Drive a form widget through its harness
|
|
1029
1037
|
|
|
1030
|
-
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`, `BfFileInputHarness`, `BfImageInputHarness`, `BfMediaCardHarness`, `BfChatComposerHarness` and `BfChartHarness`. `with({ label })` finds a widget by its label. Load an in-page widget with `TestbedHarnessEnvironment.loader(fixture)`. jsdom has no `URL.createObjectURL`, so after `addFile()` `BfImageInputHarness.hasPreview()` stays false: assert on the bound value, or stub `URL.createObjectURL` to read the preview.
|
|
1038
|
+
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`, `BfFileInputHarness`, `BfImageInputHarness`, `BfMediaCardHarness`, `BfImageTileHarness`, `BfChatComposerHarness` and `BfChartHarness`. `with({ label })` finds a widget by its label. Load an in-page widget with `TestbedHarnessEnvironment.loader(fixture)`. jsdom has no `URL.createObjectURL`, so after `addFile()` `BfImageInputHarness.hasPreview()` stays false: assert on the bound value, or stub `URL.createObjectURL` to read the preview.
|
|
1031
1039
|
|
|
1032
1040
|
`select-harness.spec.ts`:
|
|
1033
1041
|
|
|
@@ -1097,7 +1105,7 @@ describe('BfSelectHarness in a consumer app (Vitest)', () => {
|
|
|
1097
1105
|
|
|
1098
1106
|
### 7. Drive a dialog from the document root
|
|
1099
1107
|
|
|
1100
|
-
Dialogs, menus and toasts render in the CDK overlay container at the end of `<body>`, outside the fixture. Load their harnesses with `TestbedHarnessEnvironment.documentRootLoader(fixture)`; `BfImageViewerHarness` drives the image viewer the same way. jsdom never loads images: `BfMediaCardHarness` and `BfImageViewerHarness` fire the `load` and `error` events with `loadImage()` and `failImage()`.
|
|
1108
|
+
Dialogs, menus and toasts render in the CDK overlay container at the end of `<body>`, outside the fixture. Load their harnesses with `TestbedHarnessEnvironment.documentRootLoader(fixture)`; `BfImageViewerHarness` drives the image viewer the same way. jsdom never loads images: `BfMediaCardHarness`, `BfImageTileHarness` and `BfImageViewerHarness` fire the `load` and `error` events with `loadImage()` and `failImage()`.
|
|
1101
1109
|
|
|
1102
1110
|
`dialog-harness.spec.ts`:
|
|
1103
1111
|
|
|
@@ -1289,6 +1297,7 @@ notes.
|
|
|
1289
1297
|
| `div[bfDescriptionItem]` | `@bitforgehq/ui` | One label and value pair of a description list, label as term, content as value |
|
|
1290
1298
|
| `bf-description-list` | `@bitforgehq/ui` | Native description list of label-value pairs, as divided rows or a tile grid |
|
|
1291
1299
|
| `bf-donut-chart` | `@bitforgehq/ui/charts` | Donut chart of the parts of a whole, with a legend, tooltip and centre slot |
|
|
1300
|
+
| `bf-image-tile` | `@bitforgehq/ui` | Small card for thumbnail grids: a picture and title that act as one target |
|
|
1292
1301
|
| `bf-line-chart` | `@bitforgehq/ui/charts` | Line chart of series over categories, with tooltip, legend and data table |
|
|
1293
1302
|
| `bf-list` | `@bitforgehq/ui` | Container for list rows, inset by default with rounded corners on a warm background |
|
|
1294
1303
|
| `bf-list-item` | `@bitforgehq/ui` | List row with leading slot, title, subtitle, trailing slot and an optional chevron |
|
package/ai/components/badge.md
CHANGED
|
@@ -91,6 +91,37 @@ import { BfBadgeComponent } from '@bitforgehq/ui';
|
|
|
91
91
|
export class BadgeStrongExampleComponent {}
|
|
92
92
|
```
|
|
93
93
|
|
|
94
|
+
## Icon
|
|
95
|
+
|
|
96
|
+
An icon in the `icon-start` slot sits before the text, at 12 px whatever the `bf-icon`'s own `size`, 4 px from the text, and the start padding tightens to match. Use it to repeat what the text says at a glance, a check on "Reference" or a cube on "3 versions", never instead of the text. A count pill does not show it.
|
|
97
|
+
|
|
98
|
+
```ts
|
|
99
|
+
import { Component } from '@angular/core';
|
|
100
|
+
import { BfBadgeComponent } from '@bitforgehq/ui';
|
|
101
|
+
import { BfIconComponent } from '@bitforgehq/ui/icons';
|
|
102
|
+
import { Box, Check, Clock } from 'lucide';
|
|
103
|
+
|
|
104
|
+
/** Badges with a leading icon: the icon repeats the meaning, the text still says it. */
|
|
105
|
+
@Component({
|
|
106
|
+
selector: 'app-example-badge-icon',
|
|
107
|
+
imports: [BfBadgeComponent, BfIconComponent],
|
|
108
|
+
template: `
|
|
109
|
+
<div class="flex flex-wrap items-center gap-2">
|
|
110
|
+
<bf-badge variant="success"><bf-icon bfSlot="icon-start" [icon]="check" />Reference</bf-badge>
|
|
111
|
+
<bf-badge variant="info"><bf-icon bfSlot="icon-start" [icon]="box" />3 versions</bf-badge>
|
|
112
|
+
<bf-badge variant="warning" emphasis="strong"
|
|
113
|
+
><bf-icon bfSlot="icon-start" [icon]="clock" />Queued</bf-badge
|
|
114
|
+
>
|
|
115
|
+
</div>
|
|
116
|
+
`,
|
|
117
|
+
})
|
|
118
|
+
export class BadgeIconExampleComponent {
|
|
119
|
+
protected readonly check = Check;
|
|
120
|
+
protected readonly box = Box;
|
|
121
|
+
protected readonly clock = Clock;
|
|
122
|
+
}
|
|
123
|
+
```
|
|
124
|
+
|
|
94
125
|
## Count pill
|
|
95
126
|
|
|
96
127
|
Setting `count` switches to the compact primary pill. Values above 99 render as "99+"; zero renders as "0".
|
|
@@ -154,11 +185,12 @@ Consumes tokens by variant, background then text:
|
|
|
154
185
|
- `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)
|
|
155
186
|
- Count pill (`count` set): `primary` / `on-primary`, ignoring `variant`
|
|
156
187
|
- 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
|
|
188
|
+
- Icon (`icon-start`): drawn in the text colour (`currentColor`), so it follows the variant and stays visible in forced colours
|
|
157
189
|
- Shape (label and count pill): `rounded-control` (`--radius-control`, `9999px` by default).
|
|
158
190
|
|
|
159
191
|
## Accessibility
|
|
160
192
|
|
|
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.
|
|
193
|
+
A badge is a plain `<span>` with no role or ARIA attributes; a `bf-icon` in `icon-start` is decorative (`aria-hidden`) unless it has a `label`, so the text alone carries the meaning; 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.
|
|
162
194
|
|
|
163
195
|
## Inputs
|
|
164
196
|
|
|
@@ -171,6 +203,7 @@ A badge is a plain `<span>` with no role or ARIA attributes; its text is read as
|
|
|
171
203
|
|
|
172
204
|
## Slots
|
|
173
205
|
|
|
206
|
+
- `icon-start`: An icon before the text, drawn at 12 px; not shown on a count pill.
|
|
174
207
|
- `default`: The badge text, shown when no `count` is set.
|
|
175
208
|
|
|
176
209
|
## Notes
|
|
@@ -190,6 +223,13 @@ A badge is a plain `<span>` with no role or ARIA attributes; its text is read as
|
|
|
190
223
|
|
|
191
224
|
## Migration notes
|
|
192
225
|
|
|
226
|
+
### 0.5.0
|
|
227
|
+
|
|
228
|
+
New `icon-start` slot: `<bf-icon bfSlot="icon-start" … />` before the label text, drawn at 12 px
|
|
229
|
+
whatever the icon's `size`, 4 px from the text, with the start padding tightened to 8 px. It
|
|
230
|
+
takes the text colour, so it follows the variant and forced colours. A count pill does not show
|
|
231
|
+
it.
|
|
232
|
+
|
|
193
233
|
### 0.4.0
|
|
194
234
|
|
|
195
235
|
New `emphasis` input (`BfBadgeEmphasis`: `soft`, the default, or `strong`). `strong` is a solid
|