@bitforgehq/ui 0.3.0 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +598 -0
- package/README.md +18 -11
- package/ai/MANIFEST.index.json +306 -0
- package/ai/MANIFEST.json +8915 -3788
- package/ai/REFERENCE.index.json +476 -0
- package/ai/REFERENCE.json +5810 -2905
- package/ai/UI_GUIDE.md +212 -58
- package/ai/components/app-frame.md +328 -0
- package/ai/components/back-button.md +42 -2
- package/ai/components/badge.md +17 -7
- package/ai/components/bar-chart.md +188 -0
- package/ai/components/breadcrumb-item.md +121 -0
- package/ai/components/breadcrumb.md +277 -0
- package/ai/components/button.md +82 -15
- package/ai/components/calendar.md +300 -0
- package/ai/components/card.md +119 -4
- package/ai/components/chart-card.md +283 -0
- package/ai/components/combobox.md +411 -0
- package/ai/components/date-input.md +396 -0
- package/ai/components/datetime-input.md +215 -0
- package/ai/components/description-item.md +111 -0
- package/ai/components/description-list.md +160 -0
- package/ai/components/donut-chart.md +169 -0
- package/ai/components/empty-state.md +99 -6
- package/ai/components/header.md +71 -2
- package/ai/components/icon-button.md +74 -16
- package/ai/components/icon.md +63 -7
- package/ai/components/line-chart.md +234 -0
- package/ai/components/list.md +70 -6
- package/ai/components/menu.md +5 -0
- package/ai/components/multi-combobox.md +257 -0
- package/ai/components/nav-group.md +178 -0
- package/ai/components/nav-item.md +210 -0
- package/ai/components/page-header.md +237 -0
- package/ai/components/pagination.md +173 -0
- package/ai/components/popover.md +250 -0
- package/ai/components/side-panel.md +391 -0
- package/ai/components/sidebar-toggle.md +287 -0
- package/ai/components/sidebar.md +541 -0
- package/ai/components/skeleton.md +215 -0
- package/ai/components/sparkline.md +188 -0
- package/ai/components/stat.md +297 -0
- package/ai/components/tab-group.md +226 -0
- package/ai/components/tab-panel.md +163 -0
- package/ai/components/table.md +697 -0
- package/ai/components/tabs.md +46 -2
- package/ai/components/theme-menu-button.md +182 -0
- package/ai/components/theme-switch.md +170 -0
- package/ai/components/time-input.md +240 -0
- package/ai/components/toolbar.md +354 -0
- package/ai/components/tooltip.md +230 -0
- package/ai/components/top-nav.md +159 -0
- 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-badge-appearance.md +36 -0
- package/ai/reference/bf-badge-variant.md +1 -1
- package/ai/reference/bf-bar-chart-orientation.md +27 -0
- package/ai/reference/bf-button-appearance.md +36 -0
- package/ai/reference/bf-button-variant.md +1 -1
- package/ai/reference/bf-calendar-disabled-date.md +23 -0
- package/ai/reference/bf-calendar-harness.md +51 -0
- package/ai/reference/bf-calendar-weekday.md +31 -0
- package/ai/reference/bf-chart-card-heading-level.md +26 -0
- package/ai/reference/bf-chart-curve.md +28 -0
- package/ai/reference/bf-chart-harness.md +51 -0
- package/ai/reference/bf-chart-legend-position.md +30 -0
- package/ai/reference/bf-chart-series.md +23 -0
- package/ai/reference/bf-chart-value-format.md +23 -0
- package/ai/reference/bf-color-scheme-service.md +30 -0
- package/ai/reference/bf-color-scheme.md +31 -0
- package/ai/reference/bf-combobox-filter.md +27 -0
- package/ai/reference/bf-combobox-harness.md +89 -0
- package/ai/reference/bf-combobox-option.md +33 -0
- package/ai/reference/bf-compare-with.md +2 -0
- package/ai/reference/bf-date-input-harness.md +67 -0
- package/ai/reference/bf-date-input-picker.md +27 -0
- package/ai/reference/bf-date-time-input-harness.md +76 -0
- package/ai/reference/bf-date-time-input-picker.md +27 -0
- package/ai/reference/bf-description-list-layout.md +26 -0
- package/ai/reference/bf-donut-slice.md +22 -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 +73 -20
- package/ai/reference/bf-menu-button-variant.md +1 -0
- package/ai/reference/bf-menu-placement.md +1 -0
- package/ai/reference/bf-overlay-options.md +28 -27
- package/ai/reference/bf-overlay-placement.md +34 -0
- package/ai/reference/bf-overlay-position.md +1 -1
- package/ai/reference/bf-overlay-service.md +5 -3
- package/ai/reference/bf-page-header-heading-level.md +26 -0
- package/ai/reference/bf-pagination-harness.md +61 -0
- package/ai/reference/bf-platform-service.md +17 -15
- package/ai/reference/bf-popover-harness.md +42 -0
- package/ai/reference/bf-popover-placement.md +28 -0
- package/ai/reference/bf-popover-trigger-directive.md +56 -0
- package/ai/reference/bf-side-panel-config.md +35 -0
- package/ai/reference/bf-side-panel-harness.md +34 -0
- package/ai/reference/bf-side-panel-ref.md +44 -0
- package/ai/reference/bf-side-panel-service.md +43 -0
- package/ai/reference/bf-side-panel-template-context.md +32 -0
- package/ai/reference/bf-side-panel-width.md +28 -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 +13 -0
- package/ai/reference/bf-skeleton-shape.md +28 -0
- package/ai/reference/bf-stat-appearance.md +33 -0
- package/ai/reference/bf-stat-trend-intent.md +27 -0
- package/ai/reference/bf-stat-trend.md +27 -0
- package/ai/reference/bf-stat-variant.md +26 -0
- package/ai/reference/bf-tab-group-harness.md +44 -0
- package/ai/reference/bf-table-align.md +26 -0
- package/ai/reference/bf-table-cell-context.md +24 -0
- package/ai/reference/bf-table-cell-directive.md +22 -0
- package/ai/reference/bf-table-column.md +28 -0
- package/ai/reference/bf-table-harness.md +77 -0
- package/ai/reference/bf-table-row-key.md +21 -0
- package/ai/reference/bf-table-sort-direction.md +26 -0
- package/ai/reference/bf-table-sort.md +27 -0
- package/ai/reference/bf-table-stack.md +29 -0
- package/ai/reference/bf-theme.md +5 -4
- package/ai/reference/bf-time-input-harness.md +67 -0
- package/ai/reference/bf-time-input-hour-cycle.md +27 -0
- package/ai/reference/bf-time-input-picker.md +27 -0
- package/ai/reference/bf-tooltip-directive.md +43 -0
- package/ai/reference/bf-tooltip-harness.md +43 -0
- package/ai/reference/bf-tooltip-placement.md +28 -0
- package/ai/reference/bf_color_scheme_storage.md +20 -0
- package/ai/reference/bf_side_panel_data.md +17 -0
- package/ai/reference/bf_sidebar_state_storage.md +20 -0
- package/ai/reference/bf_theme_storage.md +3 -1
- package/ai/reference/provide-bf-color-scheme.md +20 -0
- package/ai/reference/provide-bf-labels.md +13 -4
- package/ai/reference/provide-bf-sidebar-state.md +20 -0
- package/ai/reference/slide-in-from-end.md +24 -0
- package/ai/reference/slide-out-to-end.md +24 -0
- package/bin/bf-ui.js +433 -3
- package/fesm2022/bitforgehq-ui-charts.mjs +3045 -0
- package/fesm2022/bitforgehq-ui-charts.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-icons.mjs +107 -3
- package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-mobile.mjs +14 -59
- package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-overlay.mjs +6566 -38
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui-testing.mjs +634 -1
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -1
- package/fesm2022/bitforgehq-ui.mjs +5708 -137
- package/fesm2022/bitforgehq-ui.mjs.map +1 -1
- package/llms-full.txt +26766 -14470
- package/llms.txt +106 -1
- package/package.json +7 -3
- package/theme.css +101 -0
- package/types/bitforgehq-ui-charts.d.ts +967 -0
- package/types/bitforgehq-ui-icons.d.ts +13 -1
- package/types/bitforgehq-ui-mobile.d.ts +25 -18
- package/types/bitforgehq-ui-overlay.d.ts +1895 -7
- package/types/bitforgehq-ui-testing.d.ts +782 -1
- package/types/bitforgehq-ui.d.ts +2393 -45
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
import { Component, DOCUMENT, DestroyRef, Directive, ElementRef, Injectable, InjectionToken, Injector, TemplateRef, ViewContainerRef, afterNextRender, afterRenderEffect, booleanAttribute, computed, contentChild, effect, inject, input, linkedSignal, makeEnvironmentProviders, output, provideEnvironmentInitializer, reflectComponentType, signal, untracked, viewChild } from "@angular/core";
|
|
3
3
|
import { Capacitor, SystemBars, SystemBarsStyle } from "@capacitor/core";
|
|
4
|
+
import { BF_COLOR_SCHEME_STORAGE, BF_LABELS, BF_TAB_BAR_CONTROLLER, BF_TAB_LINKS, BfButtonComponent, BfColorSchemeService, BfIconButtonComponent, BfListComponent, BfListItemComponent, BfSpinnerComponent, BfTabBarComponent, ɵcreateMemoryColorSchemeStorage, ɵprovideBfDocumentReset } from "@bitforgehq/ui";
|
|
4
5
|
import { ActivatedRoute, BaseRouteReuseStrategy, ChildrenOutletContexts, NavigationCancel, NavigationEnd, NavigationError, NavigationSkipped, NavigationStart, PRIMARY_OUTLET, RouteReuseStrategy, Router, provideRouter, withComponentInputBinding, withRouterConfig } from "@angular/router";
|
|
5
6
|
import * as core from "@bitforgehq/ui/overlay";
|
|
6
7
|
import { BF_OVERLAY_DATA as BF_OVERLAY_DATA$1, BF_OVERLAY_HOST, BfOverlayRef as BfOverlayRef$1, BfOverlayService as BfOverlayService$1, BfOverlayStack as BfOverlayStack$1, BfToastRef, OVERLAY_DURATION as OVERLAY_DURATION$1, OVERLAY_EASING as OVERLAY_EASING$1, OVERLAY_REDUCED_DURATION, fadeDown as fadeDown$1, fadeOut as fadeOut$1, fadeUp as fadeUp$1, prefersReducedMotion, scaleIn as scaleIn$1, slideDown as slideDown$1, slideUp as slideUp$1, ɵBfToastQueue, ɵwatchPanelHeading } from "@bitforgehq/ui/overlay";
|
|
7
8
|
import { Location, LocationStrategy, NgComponentOutlet, NgTemplateOutlet } from "@angular/common";
|
|
8
9
|
import { combineLatest } from "rxjs";
|
|
9
|
-
import { BF_LABELS, BF_TAB_BAR_CONTROLLER, BF_TAB_LINKS, BfButtonComponent, BfIconButtonComponent, BfListComponent, BfListItemComponent, BfSpinnerComponent, BfTabBarComponent, ɵprovideBfDocumentReset } from "@bitforgehq/ui";
|
|
10
10
|
import { BfIconComponent } from "@bitforgehq/ui/icons";
|
|
11
11
|
import { ArrowLeft, ChevronLeft } from "lucide";
|
|
12
12
|
import { LiveAnnouncer } from "@angular/cdk/a11y";
|
|
@@ -22,49 +22,13 @@ const BF_SHELL_DEFAULTS = {
|
|
|
22
22
|
maxLivePages: Infinity
|
|
23
23
|
};
|
|
24
24
|
const BF_SHELL_CONFIG = new InjectionToken("BF_SHELL_CONFIG");
|
|
25
|
-
const THEME_KEY = "bf-theme";
|
|
26
25
|
const VIEWPORT_CONTENT = "width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no, viewport-fit=cover";
|
|
27
26
|
const NO_ZOOM_DIRECTIVES = [["maximum-scale", "1"], ["user-scalable", "no"]];
|
|
28
27
|
function toPlatform(platform) {
|
|
29
28
|
return platform === "ios" || platform === "android" ? platform : "web";
|
|
30
29
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
getItem: (key) => values.get(key) ?? null,
|
|
35
|
-
setItem: (key, value) => {
|
|
36
|
-
values.set(key, String(value));
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
}
|
|
40
|
-
function browserStorage() {
|
|
41
|
-
try {
|
|
42
|
-
return typeof window !== "undefined" && window.localStorage ? window.localStorage : null;
|
|
43
|
-
} catch {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
const BF_THEME_STORAGE = new InjectionToken("BF_THEME_STORAGE", {
|
|
48
|
-
providedIn: "root",
|
|
49
|
-
factory: () => browserStorage() ?? createMemoryThemeStorage()
|
|
50
|
-
});
|
|
51
|
-
function readStoredTheme(storage) {
|
|
52
|
-
try {
|
|
53
|
-
const stored = storage.getItem(THEME_KEY);
|
|
54
|
-
return stored === "light" || stored === "dark" || stored === "system" ? stored : "system";
|
|
55
|
-
} catch {
|
|
56
|
-
return "system";
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
function persistTheme(storage, theme) {
|
|
60
|
-
try {
|
|
61
|
-
storage.setItem(THEME_KEY, theme);
|
|
62
|
-
} catch {}
|
|
63
|
-
}
|
|
64
|
-
function prefersDark() {
|
|
65
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return false;
|
|
66
|
-
return window.matchMedia("(prefers-color-scheme: dark)").matches;
|
|
67
|
-
}
|
|
30
|
+
const createMemoryThemeStorage = ɵcreateMemoryColorSchemeStorage;
|
|
31
|
+
const BF_THEME_STORAGE = BF_COLOR_SCHEME_STORAGE;
|
|
68
32
|
function forbidViewportZoom(document) {
|
|
69
33
|
const meta = document.head.querySelector("meta[name=\"viewport\"]");
|
|
70
34
|
if (!meta) {
|
|
@@ -98,31 +62,20 @@ function webViewMajor(navigator) {
|
|
|
98
62
|
const match = /Chrome\/(\d+)/.exec(navigator?.userAgent ?? "");
|
|
99
63
|
return match ? Number(match[1]) : null;
|
|
100
64
|
}
|
|
101
|
-
function listenToSystemTheme(onChange) {
|
|
102
|
-
if (typeof window === "undefined" || typeof window.matchMedia !== "function") return;
|
|
103
|
-
window.matchMedia("(prefers-color-scheme: dark)").addEventListener("change", (event) => onChange(event.matches));
|
|
104
|
-
}
|
|
105
65
|
var BfPlatformService = class BfPlatformService {
|
|
106
66
|
document = inject(DOCUMENT);
|
|
107
67
|
shellConfig = inject(BF_SHELL_CONFIG, { optional: true });
|
|
108
|
-
|
|
68
|
+
colorScheme = inject(BfColorSchemeService);
|
|
109
69
|
isNative = Capacitor.isNativePlatform();
|
|
110
70
|
platform = toPlatform(Capacitor.getPlatform());
|
|
111
71
|
mode = computed(() => this.platform === "ios" ? "ios" : "md", ...ngDevMode ? [{ debugName: "mode" }] : /* istanbul ignore next */ []);
|
|
112
|
-
theme =
|
|
113
|
-
systemDark =
|
|
114
|
-
dark =
|
|
72
|
+
theme = this.colorScheme.scheme;
|
|
73
|
+
systemDark = this.colorScheme.systemDark;
|
|
74
|
+
dark = this.colorScheme.dark;
|
|
115
75
|
constructor() {
|
|
116
|
-
listenToSystemTheme((matches) => this.systemDark.set(matches));
|
|
117
76
|
if (this.shellConfig === null) return;
|
|
118
77
|
if (this.isNative) forbidViewportZoom(this.document);
|
|
119
|
-
|
|
120
|
-
html.classList.toggle("dark", this.dark());
|
|
121
|
-
persistTheme(this.storage, this.theme());
|
|
122
|
-
effect(() => {
|
|
123
|
-
html.classList.toggle("dark", this.dark());
|
|
124
|
-
persistTheme(this.storage, this.theme());
|
|
125
|
-
});
|
|
78
|
+
this.colorScheme.claimDocument();
|
|
126
79
|
if (this.isNative && this.shellConfig.syncSystemBars !== false) {
|
|
127
80
|
const major = webViewMajor(this.document.defaultView?.navigator);
|
|
128
81
|
effect(() => {
|
|
@@ -2071,7 +2024,7 @@ var BfBackButtonComponent = class BfBackButtonComponent {
|
|
|
2071
2024
|
dependencies: [{
|
|
2072
2025
|
kind: "component",
|
|
2073
2026
|
type: BfIconButtonComponent,
|
|
2074
|
-
selector: "bf-icon-button",
|
|
2027
|
+
selector: "bf-icon-button, a[bfIconButton]",
|
|
2075
2028
|
inputs: [
|
|
2076
2029
|
"variant",
|
|
2077
2030
|
"size",
|
|
@@ -2087,7 +2040,8 @@ var BfBackButtonComponent = class BfBackButtonComponent {
|
|
|
2087
2040
|
inputs: [
|
|
2088
2041
|
"icon",
|
|
2089
2042
|
"size",
|
|
2090
|
-
"label"
|
|
2043
|
+
"label",
|
|
2044
|
+
"filled"
|
|
2091
2045
|
]
|
|
2092
2046
|
}]
|
|
2093
2047
|
});
|
|
@@ -5191,7 +5145,7 @@ var BfActionSheetComponent = class BfActionSheetComponent {
|
|
|
5191
5145
|
kind: "component",
|
|
5192
5146
|
type: BfListComponent,
|
|
5193
5147
|
selector: "bf-list",
|
|
5194
|
-
inputs: ["inset"]
|
|
5148
|
+
inputs: ["inset", "divided"]
|
|
5195
5149
|
},
|
|
5196
5150
|
{
|
|
5197
5151
|
kind: "component",
|
|
@@ -5228,7 +5182,8 @@ var BfActionSheetComponent = class BfActionSheetComponent {
|
|
|
5228
5182
|
inputs: [
|
|
5229
5183
|
"icon",
|
|
5230
5184
|
"size",
|
|
5231
|
-
"label"
|
|
5185
|
+
"label",
|
|
5186
|
+
"filled"
|
|
5232
5187
|
]
|
|
5233
5188
|
}
|
|
5234
5189
|
]
|