@bitforgehq/ui 0.3.1 → 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.
- package/CHANGELOG.md +116 -0
- package/README.md +9 -8
- package/ai/MANIFEST.index.json +18 -0
- package/ai/MANIFEST.json +368 -31
- package/ai/REFERENCE.index.json +63 -0
- package/ai/REFERENCE.json +247 -5
- package/ai/UI_GUIDE.md +59 -33
- package/ai/components/app-frame.md +328 -0
- package/ai/components/card.md +56 -2
- package/ai/components/empty-state.md +99 -6
- package/ai/components/header.md +5 -1
- package/ai/components/sidebar-toggle.md +287 -0
- package/ai/components/sidebar.md +188 -10
- package/ai/components/stat.md +74 -10
- package/ai/components/table.md +134 -5
- package/ai/components/tabs.md +5 -1
- package/ai/components/toolbar.md +69 -4
- package/ai/reference/bf-app-frame-breakpoint.md +27 -0
- package/ai/reference/bf-app-frame-content-width.md +29 -0
- package/ai/reference/bf-empty-state-heading-level.md +1 -1
- package/ai/reference/bf-empty-state-heading.md +33 -0
- package/ai/reference/bf-labels.md +6 -0
- package/ai/reference/bf-sidebar-state-service.md +21 -0
- package/ai/reference/bf-sidebar-toggle-harness.md +32 -0
- package/ai/reference/bf-size.md +1 -0
- package/ai/reference/bf-stat-appearance.md +33 -0
- package/ai/reference/bf-stat-variant.md +1 -1
- package/ai/reference/bf-table-harness.md +1 -1
- package/ai/reference/bf-table-stack.md +29 -0
- package/ai/reference/bf_sidebar_state_storage.md +20 -0
- package/ai/reference/provide-bf-labels.md +4 -3
- package/ai/reference/provide-bf-sidebar-state.md +20 -0
- package/bin/bf-ui.js +433 -3
- package/fesm2022/bitforgehq-ui-overlay.mjs +571 -446
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +18 -2
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +759 -127
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +1560 -43
- package/llms.txt +11 -0
- package/package.json +1 -1
- package/types/bitforgehq-ui-overlay.d.ts +51 -0
- package/types/bitforgehq-ui-testing.d.ts +35 -1
- package/types/bitforgehq-ui.d.ts +276 -20
package/types/bitforgehq-ui.d.ts
CHANGED
|
@@ -236,6 +236,21 @@ interface BfLabels {
|
|
|
236
236
|
* @default 'Select all rows'
|
|
237
237
|
*/
|
|
238
238
|
readonly tableSelectAll: string;
|
|
239
|
+
/**
|
|
240
|
+
* The label of a stacked bf-table's sort select.
|
|
241
|
+
* @default 'Sort by'
|
|
242
|
+
*/
|
|
243
|
+
readonly tableSortBy: string;
|
|
244
|
+
/**
|
|
245
|
+
* A stacked bf-table's sort option for a column in ascending order.
|
|
246
|
+
* @default (column) => `${column}, ascending`
|
|
247
|
+
*/
|
|
248
|
+
readonly tableSortAscending: (column: string) => string;
|
|
249
|
+
/**
|
|
250
|
+
* A stacked bf-table's sort option for a column in descending order.
|
|
251
|
+
* @default (column) => `${column}, descending`
|
|
252
|
+
*/
|
|
253
|
+
readonly tableSortDescending: (column: string) => string;
|
|
239
254
|
/**
|
|
240
255
|
* bf-theme-switch's and bf-theme-menu-button's name without a label.
|
|
241
256
|
* @default 'Theme'
|
|
@@ -276,6 +291,21 @@ interface BfLabels {
|
|
|
276
291
|
* @default (count) => `${count} new`
|
|
277
292
|
*/
|
|
278
293
|
readonly navBadge: (count: number) => string;
|
|
294
|
+
/**
|
|
295
|
+
* bf-sidebar-toggle's name and tooltip while the sidebar is expanded.
|
|
296
|
+
* @default 'Collapse sidebar'
|
|
297
|
+
*/
|
|
298
|
+
readonly sidebarCollapse: string;
|
|
299
|
+
/**
|
|
300
|
+
* bf-sidebar-toggle's name and tooltip while the sidebar is an icon rail.
|
|
301
|
+
* @default 'Expand sidebar'
|
|
302
|
+
*/
|
|
303
|
+
readonly sidebarExpand: string;
|
|
304
|
+
/**
|
|
305
|
+
* bf-app-frame's skip link, the first stop of the tab order, which moves focus to the content.
|
|
306
|
+
* @default 'Skip to main content'
|
|
307
|
+
*/
|
|
308
|
+
readonly skipToContent: string;
|
|
279
309
|
/**
|
|
280
310
|
* bf-pagination's navigation name.
|
|
281
311
|
* @default 'Pagination'
|
|
@@ -507,9 +537,10 @@ export declare const BF_LABELS: InjectionToken<BfLabels>;
|
|
|
507
537
|
* Replaces built-in strings, merged over the parent's (validation merged key by key); a key left
|
|
508
538
|
* out or set to `undefined` keeps the parent's string. In `ApplicationConfig.providers` it covers
|
|
509
539
|
* every string. In a component's `providers` it covers that sub-tree's widgets and form controls
|
|
510
|
-
* (`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `tableSelectAll`, `
|
|
511
|
-
* `
|
|
512
|
-
* `
|
|
540
|
+
* (`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `tableSelectAll`, `tableSortBy`,
|
|
541
|
+
* `tableSortAscending`, `tableSortDescending`, `theme`, `themeSystem`, `themeLight`, `themeDark`,
|
|
542
|
+
* `breadcrumb`, `breadcrumbExpand`, `navigation`, `navBadge`, `sidebarCollapse`, `sidebarExpand`,
|
|
543
|
+
* `skipToContent`, `pagination`, `previousPage`, `nextPage`, `pageOf`, `goToPage`, `tabGroup`,
|
|
513
544
|
* `calendarPreviousMonth`, `calendarNextMonth`, `calendarChooseMonth`, `calendarChooseYear`,
|
|
514
545
|
* `statTrendUp`, `statTrendDown`, `statTrendFlat`, `comboboxEmpty`, `comboboxRemove`,
|
|
515
546
|
* `dateInputDay`, `dateInputMonth`, `dateInputYear`, `dateInputOpenCalendar`, `dateInputInvalid`,
|
|
@@ -542,6 +573,9 @@ type BfColorSchemeStorage = Pick<Storage, 'getItem' | 'setItem'>;
|
|
|
542
573
|
* `ɵcreateMemoryColorSchemeStorage`.
|
|
543
574
|
*/
|
|
544
575
|
declare function createMemoryColorSchemeStorage(): BfColorSchemeStorage;
|
|
576
|
+
/** `localStorage`, or `null` where there is none or reading it throws (storage disabled, SSR).
|
|
577
|
+
* Internal: `BF_SIDEBAR_STATE_STORAGE` (`sidebar-state.ts`) falls back the same way. */
|
|
578
|
+
declare function browserStorage(): Storage | null;
|
|
545
579
|
/**
|
|
546
580
|
* Where `BfColorSchemeService` keeps the colour scheme choice (the key `bf-theme`): `localStorage`
|
|
547
581
|
* when it is available, otherwise an in-memory map. Provide another store (a native preferences
|
|
@@ -608,6 +642,61 @@ export declare class BfColorSchemeService {
|
|
|
608
642
|
* @since 0.3.1
|
|
609
643
|
*/
|
|
610
644
|
export declare function provideBfColorScheme(): EnvironmentProviders;
|
|
645
|
+
/**
|
|
646
|
+
* Where `BfSidebarStateService` keeps whether the sidebar is collapsed (the key
|
|
647
|
+
* `bf-sidebar-collapsed`, `'true'` or `'false'`): `localStorage` when it is available, otherwise
|
|
648
|
+
* an in-memory map. Provide another store (`sessionStorage`, or an in-memory one in tests) to keep
|
|
649
|
+
* it elsewhere.
|
|
650
|
+
*
|
|
651
|
+
* @example
|
|
652
|
+
* providers: [{ provide: BF_SIDEBAR_STATE_STORAGE, useValue: sessionStorage }]
|
|
653
|
+
* @summary Injection token for the store that keeps the collapsed sidebar between visits
|
|
654
|
+
* @since 0.3.2
|
|
655
|
+
*/
|
|
656
|
+
export declare const BF_SIDEBAR_STATE_STORAGE: InjectionToken<Pick<Storage, "getItem" | "setItem">>;
|
|
657
|
+
/**
|
|
658
|
+
* Whether the app's `bf-sidebar` is collapsed to an icon rail, remembered between visits: the app
|
|
659
|
+
* binds the sidebar's `[(collapsed)]` to `sidebarState.collapsed`. With `provideBfSidebarState()`
|
|
660
|
+
* every change is stored in `BF_SIDEBAR_STATE_STORAGE` under `bf-sidebar-collapsed`; without it
|
|
661
|
+
* the signal still holds the state but nothing is written. Storage is read in the browser only, so a
|
|
662
|
+
* server render starts expanded and writes nothing. The widgets never inject it.
|
|
663
|
+
*
|
|
664
|
+
* @example
|
|
665
|
+
* protected readonly sidebarState = inject(BfSidebarStateService);
|
|
666
|
+
* // <bf-sidebar [(collapsed)]="sidebarState.collapsed">…</bf-sidebar>
|
|
667
|
+
* @summary The sidebar's collapsed state, kept in storage between visits of the app
|
|
668
|
+
* @since 0.3.2
|
|
669
|
+
*/
|
|
670
|
+
export declare class BfSidebarStateService {
|
|
671
|
+
private readonly storage;
|
|
672
|
+
private readonly injector;
|
|
673
|
+
private readonly browser;
|
|
674
|
+
/** Whether the sidebar is collapsed: the stored state in the browser, else false. Bind it
|
|
675
|
+
* two-way to `bf-sidebar`'s `collapsed`. */
|
|
676
|
+
readonly collapsed: import("@angular/core").WritableSignal<boolean>;
|
|
677
|
+
private claimed;
|
|
678
|
+
/**
|
|
679
|
+
* Starts storing every change, once: called by `provideBfSidebarState()`. Nothing is written on
|
|
680
|
+
* the server.
|
|
681
|
+
* @internal
|
|
682
|
+
*/
|
|
683
|
+
claimStorage(): void;
|
|
684
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfSidebarStateService, never>;
|
|
685
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<any>;
|
|
686
|
+
}
|
|
687
|
+
/**
|
|
688
|
+
* Lets `BfSidebarStateService` remember the collapsed sidebar: it stores every change of its
|
|
689
|
+
* `collapsed` signal (key `bf-sidebar-collapsed`, `localStorage` in the browser), so the app opens
|
|
690
|
+
* with the sidebar as the user left it. Add it to `ApplicationConfig.providers` and bind the
|
|
691
|
+
* sidebar's `[(collapsed)]` to `sidebarState.collapsed`.
|
|
692
|
+
*
|
|
693
|
+
* @example
|
|
694
|
+
* export const appConfig: ApplicationConfig = { providers: [provideBfSidebarState()] };
|
|
695
|
+
* @returns The providers that make the service store the state and start it with the app.
|
|
696
|
+
* @summary Remembers the collapsed sidebar between visits, for desktop web apps
|
|
697
|
+
* @since 0.3.2
|
|
698
|
+
*/
|
|
699
|
+
export declare function provideBfSidebarState(): EnvironmentProviders;
|
|
611
700
|
/**
|
|
612
701
|
* The diameter of a `bf-spinner`: sm, md or lg.
|
|
613
702
|
*
|
|
@@ -3474,6 +3563,15 @@ export declare class BfAlertComponent {
|
|
|
3474
3563
|
* @since 0.3.0
|
|
3475
3564
|
*/
|
|
3476
3565
|
type BfEmptyStateHeadingLevel = 2 | 3;
|
|
3566
|
+
/**
|
|
3567
|
+
* The heading level a `bf-empty-state` title takes: a `BfEmptyStateHeadingLevel`, or `1` when the
|
|
3568
|
+
* empty state is the page itself (a not-found or no-access page). A new type, so `Record`s over
|
|
3569
|
+
* the released `BfEmptyStateHeadingLevel` keep compiling.
|
|
3570
|
+
*
|
|
3571
|
+
* @summary The heading level of an empty state title, one for a whole page
|
|
3572
|
+
* @since 0.3.2
|
|
3573
|
+
*/
|
|
3574
|
+
type BfEmptyStateHeading = BfEmptyStateHeadingLevel | 1;
|
|
3477
3575
|
/**
|
|
3478
3576
|
* Placeholder for a screen or list with nothing in it yet: an icon tile, a title, one sentence,
|
|
3479
3577
|
* and the action that fills it.
|
|
@@ -3494,8 +3592,8 @@ export declare class BfEmptyStateComponent {
|
|
|
3494
3592
|
readonly title: import("@angular/core").InputSignal<string>;
|
|
3495
3593
|
/** One sentence on how to fill it. */
|
|
3496
3594
|
readonly description: import("@angular/core").InputSignal<string>;
|
|
3497
|
-
/** Heading level of the title so the empty state fits the page outline. */
|
|
3498
|
-
readonly headingLevel: import("@angular/core").InputSignal<
|
|
3595
|
+
/** Heading level of the title so the empty state fits the page outline; 1 when it is the page. */
|
|
3596
|
+
readonly headingLevel: import("@angular/core").InputSignal<BfEmptyStateHeading>;
|
|
3499
3597
|
static ɵfac: i0.ɵɵFactoryDeclaration<BfEmptyStateComponent, never>;
|
|
3500
3598
|
static ɵcmp: i0.ɵɵComponentDeclaration<BfEmptyStateComponent, "bf-empty-state", never, {
|
|
3501
3599
|
"title": {
|
|
@@ -3683,7 +3781,7 @@ export declare class BfTabComponent {
|
|
|
3683
3781
|
/** `aria-current` of the link form: `page` while the active tab's root page is shown, `true`
|
|
3684
3782
|
* while a child page of it is (the tab is the current section, not the current page), else
|
|
3685
3783
|
* `null`. */
|
|
3686
|
-
readonly current: import("@angular/core").Signal<"
|
|
3784
|
+
readonly current: import("@angular/core").Signal<"true" | "page" | null>;
|
|
3687
3785
|
/** The badge as announced after the label in the accessible name when `badge()` is set. */
|
|
3688
3786
|
readonly badgeAnnouncement: import("@angular/core").Signal<string | null>;
|
|
3689
3787
|
/**
|
|
@@ -4153,7 +4251,7 @@ export declare class BfPageHeaderComponent {
|
|
|
4153
4251
|
* @since 0.3.1
|
|
4154
4252
|
* @slot default The search field and the filters (bf-input, bf-select, bf-chip-group), in order.
|
|
4155
4253
|
* @slot view A view switch after the filters, such as a bf-segmented of list and grid.
|
|
4156
|
-
* @slot actions The trailing actions, kept together at the inline end of the row.
|
|
4254
|
+
* @slot actions The trailing actions, kept together at the inline end of the row, beside the status.
|
|
4157
4255
|
*/
|
|
4158
4256
|
export declare class BfToolbarComponent {
|
|
4159
4257
|
/** The group's accessible name, such as "Project filters"; unnamed when empty. */
|
|
@@ -4247,6 +4345,15 @@ type BfTableAlign = 'start' | 'end';
|
|
|
4247
4345
|
* @since 0.3.1
|
|
4248
4346
|
*/
|
|
4249
4347
|
type BfTableSortDirection = 'ascending' | 'descending';
|
|
4348
|
+
/**
|
|
4349
|
+
* When a `bf-table` renders each row as a card of label/value pairs: `never` (the default),
|
|
4350
|
+
* `narrow` while the table is narrower than 36rem (a container query), or `coarse` under a coarse
|
|
4351
|
+
* pointer at any width.
|
|
4352
|
+
*
|
|
4353
|
+
* @summary When a table stacks its rows into cards: never, when narrow, or under touch
|
|
4354
|
+
* @since 0.3.2
|
|
4355
|
+
*/
|
|
4356
|
+
type BfTableStack = 'never' | 'narrow' | 'coarse';
|
|
4250
4357
|
/**
|
|
4251
4358
|
* One column of a `bf-table`: the row property it shows, its header and how it behaves.
|
|
4252
4359
|
*
|
|
@@ -4296,7 +4403,8 @@ interface BfTableEntry<T> {
|
|
|
4296
4403
|
/**
|
|
4297
4404
|
* Data table for desktop: column headers that set a sort, optional row selection with
|
|
4298
4405
|
* checkboxes, custom cells from `bfTableCell` templates and an empty slot. It never sorts or
|
|
4299
|
-
* filters itself; the consumer sorts the rows in a `computed()` from `sort`.
|
|
4406
|
+
* filters itself; the consumer sorts the rows in a `computed()` from `sort`. With `stack` it
|
|
4407
|
+
* renders each row as a tile of label/value pairs in a narrow space or under touch.
|
|
4300
4408
|
*
|
|
4301
4409
|
* @example
|
|
4302
4410
|
* <bf-table label="Tasks" [rows]="sorted()" [columns]="columns" [(sort)]="sort" selectable [(selection)]="selected">
|
|
@@ -4331,11 +4439,16 @@ export declare class BfTableComponent<T = unknown> {
|
|
|
4331
4439
|
/** Row height step: sm 40, md 48, lg 56 px (the header 32/40/48; at least 44 px under a coarse
|
|
4332
4440
|
* pointer); unset follows `provideBfDefaults()` (`controlSize`, `md` by default). */
|
|
4333
4441
|
readonly size: import("@angular/core").InputSignal<BfSize | undefined>;
|
|
4334
|
-
|
|
4442
|
+
/** When the rows render as cards of label/value pairs: `never`, `narrow` (the table is
|
|
4443
|
+
* narrower than 36rem) or `coarse` (under a coarse pointer, at any width). */
|
|
4444
|
+
readonly stack: import("@angular/core").InputSignal<BfTableStack>;
|
|
4445
|
+
protected readonly labels: import("@bitforgehq/ui").BfLabels;
|
|
4335
4446
|
private readonly defaults;
|
|
4336
4447
|
private readonly table;
|
|
4337
4448
|
private readonly cells;
|
|
4338
4449
|
private readonly id;
|
|
4450
|
+
/** The caption's id, which names the table while it can stack. */
|
|
4451
|
+
protected readonly captionId: string;
|
|
4339
4452
|
/** The size in effect: `size`, else the app's `controlSize` default. */
|
|
4340
4453
|
protected readonly resolvedSize: import("@angular/core").Signal<BfSize>;
|
|
4341
4454
|
/** The header checkbox's name: `selectAllLabel`, else the `tableSelectAll` label. */
|
|
@@ -4351,19 +4464,36 @@ export declare class BfTableComponent<T = unknown> {
|
|
|
4351
4464
|
protected readonly someSelected: import("@angular/core").Signal<boolean>;
|
|
4352
4465
|
/** The number of columns, the selection column included: the empty row's `colspan`. */
|
|
4353
4466
|
protected readonly columnCount: import("@angular/core").Signal<number>;
|
|
4354
|
-
|
|
4467
|
+
/** Whether the table can stack its rows (any `stack` but `never`); it then sets explicit
|
|
4468
|
+
* table roles, because some browsers drop a table's semantics once its display changes. */
|
|
4469
|
+
protected readonly stacks: import("@angular/core").Signal<boolean>;
|
|
4470
|
+
/** The Sort by select's options: each sortable column ascending and descending. */
|
|
4471
|
+
protected readonly sortOptions: import("@angular/core").Signal<BfSelectOption<string>[]>;
|
|
4472
|
+
/** The Sort by select's value: the option of `sort`, `null` while unsorted. */
|
|
4473
|
+
protected readonly sortValue: import("@angular/core").Signal<string | null>;
|
|
4474
|
+
protected readonly hostClasses: import("@angular/core").Signal<string>;
|
|
4475
|
+
protected readonly stackBarClasses: import("@angular/core").Signal<string>;
|
|
4476
|
+
protected readonly tableClasses: import("@angular/core").Signal<string>;
|
|
4477
|
+
protected readonly headClasses: import("@angular/core").Signal<string>;
|
|
4478
|
+
protected readonly bodyGroupClasses: import("@angular/core").Signal<string>;
|
|
4479
|
+
protected readonly sortButtonClasses: import("@angular/core").Signal<string>;
|
|
4480
|
+
protected readonly notStackedClasses: import("@angular/core").Signal<string>;
|
|
4481
|
+
protected readonly stackedOnlyClasses: import("@angular/core").Signal<string>;
|
|
4482
|
+
protected readonly stackEmptyClasses: import("@angular/core").Signal<string>;
|
|
4355
4483
|
protected readonly selectHeadClasses: import("@angular/core").Signal<string>;
|
|
4356
4484
|
protected readonly selectBodyClasses: import("@angular/core").Signal<string>;
|
|
4485
|
+
/** A body cell's height step, with the coarse-pointer height unless the table stacks there. */
|
|
4486
|
+
private readonly bodyHeight;
|
|
4357
4487
|
/**
|
|
4358
4488
|
* The classes of a column's header cell.
|
|
4359
4489
|
* @internal
|
|
4360
4490
|
*/
|
|
4361
|
-
|
|
4491
|
+
headCellClasses(column: BfTableColumn): string;
|
|
4362
4492
|
/**
|
|
4363
|
-
* The classes of a column's body cell.
|
|
4493
|
+
* The classes of a column's body cell; the first one is a stacked tile's title.
|
|
4364
4494
|
* @internal
|
|
4365
4495
|
*/
|
|
4366
|
-
bodyClasses(column: BfTableColumn): string;
|
|
4496
|
+
bodyClasses(column: BfTableColumn, first: boolean): string;
|
|
4367
4497
|
/**
|
|
4368
4498
|
* The classes of the body row with this key.
|
|
4369
4499
|
* @internal
|
|
@@ -4395,6 +4525,11 @@ export declare class BfTableComponent<T = unknown> {
|
|
|
4395
4525
|
* @param key The column's `key`.
|
|
4396
4526
|
*/
|
|
4397
4527
|
sortBy(key: string): void;
|
|
4528
|
+
/**
|
|
4529
|
+
* Sorts by a Sort by option (`<key>:<direction>`) of a stacked table.
|
|
4530
|
+
* @internal
|
|
4531
|
+
*/
|
|
4532
|
+
sortFromOption(value: string): void;
|
|
4398
4533
|
/**
|
|
4399
4534
|
* Selects or clears every row; keys of rows not shown stay as they are.
|
|
4400
4535
|
* @param selected True to select every row, false to clear them.
|
|
@@ -4459,6 +4594,11 @@ export declare class BfTableComponent<T = unknown> {
|
|
|
4459
4594
|
"required": false;
|
|
4460
4595
|
"isSignal": true;
|
|
4461
4596
|
};
|
|
4597
|
+
"stack": {
|
|
4598
|
+
"alias": "stack";
|
|
4599
|
+
"required": false;
|
|
4600
|
+
"isSignal": true;
|
|
4601
|
+
};
|
|
4462
4602
|
}, {
|
|
4463
4603
|
"sort": "sortChange";
|
|
4464
4604
|
"selection": "selectionChange";
|
|
@@ -4543,6 +4683,15 @@ export declare class BfDescriptionItemComponent {
|
|
|
4543
4683
|
* @since 0.3.1
|
|
4544
4684
|
*/
|
|
4545
4685
|
type BfStatVariant = 'plain' | 'card';
|
|
4686
|
+
/**
|
|
4687
|
+
* The surface of a `bf-stat`, as its `variant` input takes it: a `BfStatVariant` or tile (a
|
|
4688
|
+
* sunken, borderless tile for a stats row inside a raised card). A new type, so `Record`s over
|
|
4689
|
+
* the released `BfStatVariant` keep compiling.
|
|
4690
|
+
*
|
|
4691
|
+
* @summary The three stat surfaces, plain, an outlined card or a sunken tile
|
|
4692
|
+
* @since 0.3.2
|
|
4693
|
+
*/
|
|
4694
|
+
type BfStatAppearance = BfStatVariant | 'tile';
|
|
4546
4695
|
/**
|
|
4547
4696
|
* The direction of a `bf-stat` delta: up, down or flat (no change).
|
|
4548
4697
|
*
|
|
@@ -4566,6 +4715,7 @@ type BfStatTrendIntent = 'positive' | 'negative';
|
|
|
4566
4715
|
*
|
|
4567
4716
|
* @example
|
|
4568
4717
|
* <bf-stat label="Revenue" value="€48,200" delta="+12%" trend="up" />
|
|
4718
|
+
* <bf-stat label="Orders" value="1,204" variant="tile" />
|
|
4569
4719
|
* <bf-stat label="Cook time" value="30 min" variant="card">
|
|
4570
4720
|
* <bf-icon bfSlot="icon" [icon]="Flame" />
|
|
4571
4721
|
* Oven at 200 °C
|
|
@@ -4581,8 +4731,8 @@ export declare class BfStatComponent {
|
|
|
4581
4731
|
readonly label: import("@angular/core").InputSignal<string>;
|
|
4582
4732
|
/** The figure, already formatted (`45 min`, `1,204`, `98%`). */
|
|
4583
4733
|
readonly value: import("@angular/core").InputSignal<string>;
|
|
4584
|
-
/** Surface: plain (default) on its container,
|
|
4585
|
-
readonly variant: import("@angular/core").InputSignal<
|
|
4734
|
+
/** Surface: plain (default) on its container, card (an outlined tile) or tile (sunken, no border). */
|
|
4735
|
+
readonly variant: import("@angular/core").InputSignal<BfStatAppearance>;
|
|
4586
4736
|
/** A change shown in a pill beside the value, already formatted (`+12%`); empty shows none. */
|
|
4587
4737
|
readonly delta: import("@angular/core").InputSignal<string>;
|
|
4588
4738
|
/** The delta's direction: an arrow mark and a hidden word; left unset, the pill is neutral. */
|
|
@@ -4592,6 +4742,8 @@ export declare class BfStatComponent {
|
|
|
4592
4742
|
private readonly labels;
|
|
4593
4743
|
readonly classes: import("@angular/core").Signal<string>;
|
|
4594
4744
|
/** @internal */
|
|
4745
|
+
readonly iconTileClasses: import("@angular/core").Signal<string>;
|
|
4746
|
+
/** @internal */
|
|
4595
4747
|
readonly deltaClasses: import("@angular/core").Signal<string>;
|
|
4596
4748
|
/** @internal */
|
|
4597
4749
|
readonly markClasses: import("@angular/core").Signal<string>;
|
|
@@ -4760,9 +4912,9 @@ export declare class BfBreadcrumbItemComponent {
|
|
|
4760
4912
|
/**
|
|
4761
4913
|
* The vertical navigation of a desktop app: a `nav` landmark with a `header` slot (the brand),
|
|
4762
4914
|
* the destinations (`a[bfNavItem]` links, optionally in `bf-nav-group`s) and a `footer` slot.
|
|
4763
|
-
* `collapsed` turns it into an icon rail
|
|
4764
|
-
* `[(collapsed)]
|
|
4765
|
-
* `bf-menu-button` from the same routes.
|
|
4915
|
+
* `collapsed` turns it into an icon rail: put a `bf-sidebar-toggle` (`@bitforgehq/ui/overlay`) in
|
|
4916
|
+
* it, or bind `[(collapsed)]` to your own button. Below a breakpoint hide it
|
|
4917
|
+
* (`class="hidden md:flex"`) and drive a `bf-menu-button` from the same routes.
|
|
4766
4918
|
*
|
|
4767
4919
|
* @example
|
|
4768
4920
|
* <bf-sidebar label="Main" [(collapsed)]="collapsed" class="hidden md:flex">
|
|
@@ -4786,9 +4938,13 @@ export declare class BfSidebarComponent {
|
|
|
4786
4938
|
* ("Main"). Name each landmark differently when a page has more than one. */
|
|
4787
4939
|
readonly label: import("@angular/core").InputSignal<string>;
|
|
4788
4940
|
/** Collapses the sidebar to an icon rail: items show their icon only, their label stays for
|
|
4789
|
-
* screen readers and becomes a tooltip.
|
|
4941
|
+
* screen readers and becomes a tooltip. A `bf-sidebar-toggle` inside flips it; bind
|
|
4942
|
+
* `[(collapsed)]` to keep it in your state. */
|
|
4790
4943
|
readonly collapsed: import("@angular/core").ModelSignal<boolean>;
|
|
4791
4944
|
private readonly labels;
|
|
4945
|
+
/** The `nav` element's id, which `bf-sidebar-toggle` points `aria-controls` at.
|
|
4946
|
+
* @internal */
|
|
4947
|
+
readonly navId: string;
|
|
4792
4948
|
/** The rendered navigation name: `label`, else the `navigation` label. */
|
|
4793
4949
|
protected readonly name: import("@angular/core").Signal<string>;
|
|
4794
4950
|
private readonly width;
|
|
@@ -4934,6 +5090,86 @@ export declare class BfNavItemComponent {
|
|
|
4934
5090
|
};
|
|
4935
5091
|
}, {}, never, ["[bfSlot=icon]", "*"], true, never>;
|
|
4936
5092
|
}
|
|
5093
|
+
/**
|
|
5094
|
+
* The viewport width from which `bf-app-frame` shows its sidebar column instead of the narrow
|
|
5095
|
+
* header bar: Tailwind's `md` (768 px) or `lg` (1024 px).
|
|
5096
|
+
*
|
|
5097
|
+
* @summary The breakpoint where an app frame switches from its header bar to the sidebar
|
|
5098
|
+
* @since 0.3.2
|
|
5099
|
+
*/
|
|
5100
|
+
type BfAppFrameBreakpoint = 'md' | 'lg';
|
|
5101
|
+
/**
|
|
5102
|
+
* The maximum width of `bf-app-frame`'s content column: `md` 48rem, `lg` 64rem, `xl` 80rem, or
|
|
5103
|
+
* `full` for no limit.
|
|
5104
|
+
*
|
|
5105
|
+
* @summary The maximum width of an app frame's content column, from medium to full
|
|
5106
|
+
* @since 0.3.2
|
|
5107
|
+
*/
|
|
5108
|
+
type BfAppFrameContentWidth = 'md' | 'lg' | 'xl' | 'full';
|
|
5109
|
+
/**
|
|
5110
|
+
* The frame of a desktop web app: a skip link, a sticky full-height sidebar column from the
|
|
5111
|
+
* breakpoint up, a header bar with the brand, the narrow-screen menu and actions below it, and
|
|
5112
|
+
* the `main` landmark with a content column of a set maximum width.
|
|
5113
|
+
*
|
|
5114
|
+
* @example
|
|
5115
|
+
* <bf-app-frame>
|
|
5116
|
+
* <bf-sidebar bfSlot="sidebar" label="Main">…</bf-sidebar>
|
|
5117
|
+
* <span bfSlot="brand" class="text-heading">Atlas</span>
|
|
5118
|
+
* <bf-menu-button bfSlot="menu" [menu]="navMenu">Sections</bf-menu-button>
|
|
5119
|
+
* <router-outlet />
|
|
5120
|
+
* </bf-app-frame>
|
|
5121
|
+
* @summary Desktop app frame with skip link, sticky sidebar, narrow header and main content
|
|
5122
|
+
* @category Navigation
|
|
5123
|
+
* @since 0.3.2
|
|
5124
|
+
* @slot sidebar The `bf-sidebar`, shown from the breakpoint up; it fills the column's height.
|
|
5125
|
+
* @slot brand The app's name or logo in the narrow header bar.
|
|
5126
|
+
* @slot menu The narrow-screen navigation: a `bf-menu-button` of `a[bfMenuItem]` links.
|
|
5127
|
+
* @slot actions End actions of the narrow header bar, such as the theme menu.
|
|
5128
|
+
* @slot default The page: what the router shows, inside the `main` landmark.
|
|
5129
|
+
*/
|
|
5130
|
+
export declare class BfAppFrameComponent {
|
|
5131
|
+
/** The viewport width from which the sidebar column replaces the narrow header bar. */
|
|
5132
|
+
readonly breakpoint: import("@angular/core").InputSignal<BfAppFrameBreakpoint>;
|
|
5133
|
+
/** The maximum width of the content column (`md` 48rem, `lg` 64rem, `xl` 80rem, `full`). */
|
|
5134
|
+
readonly contentWidth: import("@angular/core").InputSignal<BfAppFrameContentWidth>;
|
|
5135
|
+
/** The id of the `main` landmark, the skip link's target; generated when left out. */
|
|
5136
|
+
readonly mainId: import("@angular/core").InputSignal<string>;
|
|
5137
|
+
protected readonly labels: import("@bitforgehq/ui").BfLabels;
|
|
5138
|
+
private readonly host;
|
|
5139
|
+
private readonly main;
|
|
5140
|
+
/** True when the frame sits inside another `main` landmark, so its own drops the role. */
|
|
5141
|
+
protected readonly nested: import("@angular/core").WritableSignal<boolean>;
|
|
5142
|
+
protected readonly sidebarClasses: import("@angular/core").Signal<string>;
|
|
5143
|
+
protected readonly headerClasses: import("@angular/core").Signal<string>;
|
|
5144
|
+
protected readonly paddingClasses: import("@angular/core").Signal<string>;
|
|
5145
|
+
protected readonly widthClasses: import("@angular/core").Signal<string>;
|
|
5146
|
+
constructor();
|
|
5147
|
+
/**
|
|
5148
|
+
* Moves focus to the content without following the href (see the template comment).
|
|
5149
|
+
*
|
|
5150
|
+
* @internal
|
|
5151
|
+
* @param event The skip link's click (also fired by Enter).
|
|
5152
|
+
*/
|
|
5153
|
+
skip(event: Event): void;
|
|
5154
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<BfAppFrameComponent, never>;
|
|
5155
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<BfAppFrameComponent, "bf-app-frame", never, {
|
|
5156
|
+
"breakpoint": {
|
|
5157
|
+
"alias": "breakpoint";
|
|
5158
|
+
"required": false;
|
|
5159
|
+
"isSignal": true;
|
|
5160
|
+
};
|
|
5161
|
+
"contentWidth": {
|
|
5162
|
+
"alias": "contentWidth";
|
|
5163
|
+
"required": false;
|
|
5164
|
+
"isSignal": true;
|
|
5165
|
+
};
|
|
5166
|
+
"mainId": {
|
|
5167
|
+
"alias": "mainId";
|
|
5168
|
+
"required": false;
|
|
5169
|
+
"isSignal": true;
|
|
5170
|
+
};
|
|
5171
|
+
}, {}, never, ["[bfSlot=sidebar]", "[bfSlot=brand]", "[bfSlot=menu]", "[bfSlot=actions]", "*"], true, never>;
|
|
5172
|
+
}
|
|
4937
5173
|
/**
|
|
4938
5174
|
* The shape of a `bf-skeleton`: text lines, a rectangle (an image, a chart, a field) or a circle
|
|
4939
5175
|
* (an avatar).
|
|
@@ -5579,6 +5815,26 @@ declare const COARSE_HIT_BASE = "pointer-coarse:after:absolute pointer-coarse:af
|
|
|
5579
5815
|
* (1.5 px border) position the ::after inside the border, so their inset adds the border back.
|
|
5580
5816
|
*/
|
|
5581
5817
|
declare const PILL_HIT: Record<BfSize, Record<'plain' | 'bordered', string>>;
|
|
5818
|
+
/** Where a nav item sits: a vertical sidebar or a horizontal top row. */
|
|
5819
|
+
type BfNavLayout = 'sidebar' | 'top';
|
|
5820
|
+
/** What `a[bfNavItem]`, `bf-nav-group` and `bf-sidebar-toggle` read from the enclosing `bf-sidebar`
|
|
5821
|
+
* or `bf-top-nav`. */
|
|
5822
|
+
interface BfNavHost {
|
|
5823
|
+
/** The host's layout: full-width rows in a sidebar, inline items in a top row. */
|
|
5824
|
+
readonly layout: BfNavLayout;
|
|
5825
|
+
/** True while the sidebar is collapsed to an icon rail; always false in a top nav. */
|
|
5826
|
+
readonly collapsed: Signal<boolean>;
|
|
5827
|
+
/** The id of the host's `nav` element (for a toggle's `aria-controls`); null in a top nav. */
|
|
5828
|
+
readonly navId: string | null;
|
|
5829
|
+
/** Writes the sidebar's `collapsed` model, as a user change; does nothing in a top nav. */
|
|
5830
|
+
setCollapsed(collapsed: boolean): void;
|
|
5831
|
+
}
|
|
5832
|
+
/**
|
|
5833
|
+
* Provided by `bf-sidebar` and `bf-top-nav`, so their items and groups follow the layout and the
|
|
5834
|
+
* collapsed state without the item files importing the container files. `bf-sidebar-toggle`
|
|
5835
|
+
* (`@bitforgehq/ui/overlay`) reads and flips the state through it, as the internal `ɵBF_NAV`.
|
|
5836
|
+
*/
|
|
5837
|
+
declare const BF_NAV: InjectionToken<BfNavHost>;
|
|
5582
5838
|
/**
|
|
5583
5839
|
* Removes what overlays and themes leave on a document: the `dark` and `cdk-global-scrollblock`
|
|
5584
5840
|
* classes on `<html>`, `inert` on the children of `<body>`, and every child of a
|
|
@@ -5588,4 +5844,4 @@ declare const PILL_HIT: Record<BfSize, Record<'plain' | 'bordered', string>>;
|
|
|
5588
5844
|
declare function resetBfDocument(document: Document): void;
|
|
5589
5845
|
/** Runs `resetBfDocument()` when the environment injector that holds it is destroyed. Internal. */
|
|
5590
5846
|
declare function provideBfDocumentReset(): EnvironmentProviders;
|
|
5591
|
-
export { type BfAlertVariant, type BfAutocapitalize, type BfAvatarSize, type BfAvatarVariant, type BfBadgeAppearance, type BfBadgeVariant, type BfButtonAppearance, type BfButtonSize, type BfButtonType, type BfButtonVariant, type BfCalendarDisabledDate, type BfCalendarWeekday, type BfCardPadding, type BfCardVariant, type BfChipGroupMode, type BfChipVariant, type BfColorScheme, type BfCompareWith, type BfDefaults, type BfDefaultsOptions, type BfDescriptionListLayout, type BfEmptyStateHeadingLevel, type BfEnterKeyHint, type BfFieldControlState, type BfFieldSize, type BfIconButtonVariant, type BfInputAutocapitalize, type BfInputEnterKeyHint, type BfInputInputMode, type BfInputMode, type BfInputType, type BfLabels, type BfLabelsOverrides, type BfPageHeaderHeadingLevel, type BfProgressSize, type BfProgressTone, type BfRadioGroupOrientation, type BfRadioOption, type BfSegmentOption, type BfSegmentedSize, type BfSelectOption, type BfSize, type BfSkeletonShape, type BfSpinnerSize, type BfStatTrend, type BfStatTrendIntent, type BfStatVariant, type BfTabBarController, type BfTabBarHost, type BfTabLinks, type BfTableAlign, type BfTableCellContext, type BfTableColumn, type BfTableRowKey, type BfTableSort, type BfTableSortDirection, type BfToggleLabelPosition, type BfValidationMessages, BUTTON_CLASSES as ɵBF_BUTTON_CLASSES, ICON_BUTTON_CLASSES as ɵBF_ICON_BUTTON_CLASSES, FIELD_BOX as ɵFIELD_BOX, FIELD_ICON_END as ɵFIELD_ICON_END, FIELD_ICON_START as ɵFIELD_ICON_START, FIELD_PADDING_END as ɵFIELD_PADDING_END, FIELD_PADDING_START as ɵFIELD_PADDING_START, PILL_HIT as ɵPILL_HIT, compareIso as ɵcompareIso, createMemoryColorSchemeStorage as ɵcreateMemoryColorSchemeStorage, daysInMonth as ɵdaysInMonth, fieldDescribedBy as ɵfieldDescribedBy, fieldErrorMessageId as ɵfieldErrorMessageId, fieldErrorText as ɵfieldErrorText, fieldShowsError as ɵfieldShowsError, formatIsoDate as ɵformatIsoDate, localIsoDate as ɵlocalIsoDate, parseIsoDate as ɵparseIsoDate, provideBfDocumentReset as ɵprovideBfDocumentReset, uniqueId as ɵuniqueId, validIsoDate as ɵvalidIsoDate };
|
|
5847
|
+
export { type BfAlertVariant, type BfAppFrameBreakpoint, type BfAppFrameContentWidth, type BfAutocapitalize, type BfAvatarSize, type BfAvatarVariant, type BfBadgeAppearance, type BfBadgeVariant, type BfButtonAppearance, type BfButtonSize, type BfButtonType, type BfButtonVariant, type BfCalendarDisabledDate, type BfCalendarWeekday, type BfCardPadding, type BfCardVariant, type BfChipGroupMode, type BfChipVariant, type BfColorScheme, type BfCompareWith, type BfDefaults, type BfDefaultsOptions, type BfDescriptionListLayout, type BfEmptyStateHeading, type BfEmptyStateHeadingLevel, type BfEnterKeyHint, type BfFieldControlState, type BfFieldSize, type BfIconButtonVariant, type BfInputAutocapitalize, type BfInputEnterKeyHint, type BfInputInputMode, type BfInputMode, type BfInputType, type BfLabels, type BfLabelsOverrides, type BfPageHeaderHeadingLevel, type BfProgressSize, type BfProgressTone, type BfRadioGroupOrientation, type BfRadioOption, type BfSegmentOption, type BfSegmentedSize, type BfSelectOption, type BfSize, type BfSkeletonShape, type BfSpinnerSize, type BfStatAppearance, type BfStatTrend, type BfStatTrendIntent, type BfStatVariant, type BfTabBarController, type BfTabBarHost, type BfTabLinks, type BfTableAlign, type BfTableCellContext, type BfTableColumn, type BfTableRowKey, type BfTableSort, type BfTableSortDirection, type BfTableStack, type BfToggleLabelPosition, type BfValidationMessages, BUTTON_CLASSES as ɵBF_BUTTON_CLASSES, ICON_BUTTON_CLASSES as ɵBF_ICON_BUTTON_CLASSES, BF_NAV as ɵBF_NAV, type BfNavHost as ɵBfNavHost, FIELD_BOX as ɵFIELD_BOX, FIELD_ICON_END as ɵFIELD_ICON_END, FIELD_ICON_START as ɵFIELD_ICON_START, FIELD_PADDING_END as ɵFIELD_PADDING_END, FIELD_PADDING_START as ɵFIELD_PADDING_START, PILL_HIT as ɵPILL_HIT, compareIso as ɵcompareIso, createMemoryColorSchemeStorage as ɵcreateMemoryColorSchemeStorage, daysInMonth as ɵdaysInMonth, fieldDescribedBy as ɵfieldDescribedBy, fieldErrorMessageId as ɵfieldErrorMessageId, fieldErrorText as ɵfieldErrorText, fieldShowsError as ɵfieldShowsError, formatIsoDate as ɵformatIsoDate, localIsoDate as ɵlocalIsoDate, parseIsoDate as ɵparseIsoDate, provideBfDocumentReset as ɵprovideBfDocumentReset, uniqueId as ɵuniqueId, validIsoDate as ɵvalidIsoDate };
|