@bitforgehq/ui 0.3.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 +3665 -0
- package/LICENSE +21 -0
- package/README.md +175 -0
- package/ai/MANIFEST.index.json +383 -0
- package/ai/MANIFEST.json +7528 -0
- package/ai/REFERENCE.index.json +1461 -0
- package/ai/REFERENCE.json +7213 -0
- package/ai/UI_GUIDE.md +1159 -0
- package/ai/components/action-bar.md +209 -0
- package/ai/components/action-sheet.md +526 -0
- package/ai/components/alert-dialog.md +509 -0
- package/ai/components/alert.md +376 -0
- package/ai/components/avatar.md +146 -0
- package/ai/components/back-button.md +286 -0
- package/ai/components/badge.md +171 -0
- package/ai/components/button.md +431 -0
- package/ai/components/card.md +303 -0
- package/ai/components/checkbox.md +418 -0
- package/ai/components/chip-group.md +205 -0
- package/ai/components/chip.md +300 -0
- package/ai/components/content.md +474 -0
- package/ai/components/desktop-toast.md +420 -0
- package/ai/components/dialog.md +962 -0
- package/ai/components/empty-state.md +146 -0
- package/ai/components/field.md +319 -0
- package/ai/components/header.md +809 -0
- package/ai/components/icon-button.md +221 -0
- package/ai/components/icon.md +176 -0
- package/ai/components/input.md +455 -0
- package/ai/components/list-item.md +326 -0
- package/ai/components/list.md +178 -0
- package/ai/components/menu-button.md +377 -0
- package/ai/components/menu.md +661 -0
- package/ai/components/modal.md +613 -0
- package/ai/components/number-input.md +423 -0
- package/ai/components/page.md +299 -0
- package/ai/components/progress.md +215 -0
- package/ai/components/radio-group.md +432 -0
- package/ai/components/refresher.md +377 -0
- package/ai/components/segmented.md +517 -0
- package/ai/components/select.md +510 -0
- package/ai/components/sheet.md +845 -0
- package/ai/components/spinner.md +171 -0
- package/ai/components/stack-outlet.md +661 -0
- package/ai/components/tab-bar.md +427 -0
- package/ai/components/tab.md +295 -0
- package/ai/components/tabs.md +408 -0
- package/ai/components/textarea.md +371 -0
- package/ai/components/toast.md +522 -0
- package/ai/components/toggle.md +387 -0
- package/ai/reference/bf-action-directive.md +21 -0
- package/ai/reference/bf-action-sheet-action-role.md +27 -0
- package/ai/reference/bf-action-sheet-action.md +28 -0
- package/ai/reference/bf-action-sheet-options.md +28 -0
- package/ai/reference/bf-action-sheet-service.md +33 -0
- package/ai/reference/bf-alert-dialog-button-role.md +27 -0
- package/ai/reference/bf-alert-dialog-button.md +27 -0
- package/ai/reference/bf-alert-dialog-options.md +29 -0
- package/ai/reference/bf-alert-dialog-service.md +34 -0
- package/ai/reference/bf-alert-variant.md +28 -0
- package/ai/reference/bf-autocapitalize.md +30 -0
- package/ai/reference/bf-avatar-size.md +27 -0
- package/ai/reference/bf-avatar-variant.md +28 -0
- package/ai/reference/bf-back-at-root.md +28 -0
- package/ai/reference/bf-back-button-service.md +40 -0
- package/ai/reference/bf-badge-variant.md +29 -0
- package/ai/reference/bf-button-size.md +29 -0
- package/ai/reference/bf-button-type.md +28 -0
- package/ai/reference/bf-button-variant.md +29 -0
- package/ai/reference/bf-card-padding.md +26 -0
- package/ai/reference/bf-card-variant.md +28 -0
- package/ai/reference/bf-chip-group-mode.md +27 -0
- package/ai/reference/bf-chip-variant.md +26 -0
- package/ai/reference/bf-compare-with.md +24 -0
- package/ai/reference/bf-component-overlay-ref.md +33 -0
- package/ai/reference/bf-confirm-button-role.md +26 -0
- package/ai/reference/bf-confirm-button.md +27 -0
- package/ai/reference/bf-confirm-options.md +31 -0
- package/ai/reference/bf-confirm-size.md +26 -0
- package/ai/reference/bf-content-scroll-event.md +21 -0
- package/ai/reference/bf-defaults-options.md +32 -0
- package/ai/reference/bf-defaults.md +28 -0
- package/ai/reference/bf-desktop-toast-config.md +28 -0
- package/ai/reference/bf-desktop-toast-harness.md +33 -0
- package/ai/reference/bf-desktop-toast-options.md +28 -0
- package/ai/reference/bf-desktop-toast-position.md +28 -0
- package/ai/reference/bf-desktop-toast-service.md +42 -0
- package/ai/reference/bf-dialog-config.md +44 -0
- package/ai/reference/bf-dialog-harness.md +52 -0
- package/ai/reference/bf-dialog-ref.md +44 -0
- package/ai/reference/bf-dialog-role.md +26 -0
- package/ai/reference/bf-dialog-service.md +55 -0
- package/ai/reference/bf-dialog-size.md +31 -0
- package/ai/reference/bf-dialog-template-context.md +32 -0
- package/ai/reference/bf-empty-state-heading-level.md +26 -0
- package/ai/reference/bf-enter-key-hint.md +31 -0
- package/ai/reference/bf-field-control-class.md +32 -0
- package/ai/reference/bf-field-control-state.md +28 -0
- package/ai/reference/bf-field-size.md +29 -0
- package/ai/reference/bf-haptics-impact-style.md +27 -0
- package/ai/reference/bf-haptics-notification-type.md +27 -0
- package/ai/reference/bf-haptics-service.md +41 -0
- package/ai/reference/bf-harness-filters.md +29 -0
- package/ai/reference/bf-horizontal-scroll-directive.md +129 -0
- package/ai/reference/bf-icon-button-variant.md +28 -0
- package/ai/reference/bf-icon-size.md +27 -0
- package/ai/reference/bf-input-autocapitalize.md +36 -0
- package/ai/reference/bf-input-enter-key-hint.md +38 -0
- package/ai/reference/bf-input-input-mode.md +38 -0
- package/ai/reference/bf-input-mode.md +32 -0
- package/ai/reference/bf-input-type.md +35 -0
- package/ai/reference/bf-jsdom-shim-options.md +22 -0
- package/ai/reference/bf-keyboard-assist-behavior.md +26 -0
- package/ai/reference/bf-keyboard-assist-directive.md +185 -0
- package/ai/reference/bf-keyboard-phase.md +30 -0
- package/ai/reference/bf-keyboard-service.md +50 -0
- package/ai/reference/bf-labels-overrides.md +26 -0
- package/ai/reference/bf-labels.md +44 -0
- package/ai/reference/bf-menu-button-harness.md +40 -0
- package/ai/reference/bf-menu-button-variant.md +27 -0
- package/ai/reference/bf-menu-divider-directive.md +13 -0
- package/ai/reference/bf-menu-group-directive.md +14 -0
- package/ai/reference/bf-menu-harness.md +55 -0
- package/ai/reference/bf-menu-item-checkbox-directive.md +31 -0
- package/ai/reference/bf-menu-item-directive.md +31 -0
- package/ai/reference/bf-menu-item-harness.md +52 -0
- package/ai/reference/bf-menu-item-radio-directive.md +29 -0
- package/ai/reference/bf-menu-placement.md +29 -0
- package/ai/reference/bf-menu-trigger-directive.md +46 -0
- package/ai/reference/bf-modal-options.md +30 -0
- package/ai/reference/bf-modal-presentation.md +26 -0
- package/ai/reference/bf-modal-service.md +38 -0
- package/ai/reference/bf-nav-controller.md +59 -0
- package/ai/reference/bf-nav-direction.md +23 -0
- package/ai/reference/bf-nav-target.md +21 -0
- package/ai/reference/bf-number-input-mode.md +28 -0
- package/ai/reference/bf-number-input-step.md +25 -0
- package/ai/reference/bf-overlay-auto-focus.md +29 -0
- package/ai/reference/bf-overlay-controller.md +22 -0
- package/ai/reference/bf-overlay-host.md +36 -0
- package/ai/reference/bf-overlay-options.md +53 -0
- package/ai/reference/bf-overlay-position.md +30 -0
- package/ai/reference/bf-overlay-ref.md +53 -0
- package/ai/reference/bf-overlay-role.md +27 -0
- package/ai/reference/bf-overlay-service.md +53 -0
- package/ai/reference/bf-overlay-stack-options.md +24 -0
- package/ai/reference/bf-overlay-stack.md +81 -0
- package/ai/reference/bf-overlay-template-context.md +24 -0
- package/ai/reference/bf-overscroll-stretch-directive.md +163 -0
- package/ai/reference/bf-page-context.md +24 -0
- package/ai/reference/bf-platform-service.md +53 -0
- package/ai/reference/bf-platform.md +28 -0
- package/ai/reference/bf-progress-size.md +26 -0
- package/ai/reference/bf-progress-tone.md +28 -0
- package/ai/reference/bf-radio-group-harness.md +49 -0
- package/ai/reference/bf-radio-group-orientation.md +26 -0
- package/ai/reference/bf-radio-option.md +30 -0
- package/ai/reference/bf-refresher-refresh-event.md +22 -0
- package/ai/reference/bf-segment-option.md +29 -0
- package/ai/reference/bf-segmented-harness.md +48 -0
- package/ai/reference/bf-segmented-size.md +29 -0
- package/ai/reference/bf-select-harness.md +70 -0
- package/ai/reference/bf-select-option.md +29 -0
- package/ai/reference/bf-sheet-auto-focus.md +29 -0
- package/ai/reference/bf-sheet-options.md +32 -0
- package/ai/reference/bf-sheet-ref.md +45 -0
- package/ai/reference/bf-sheet-service.md +34 -0
- package/ai/reference/bf-shell-config-mode.md +28 -0
- package/ai/reference/bf-shell-config.md +38 -0
- package/ai/reference/bf-shell-dynamic-type-limit.md +21 -0
- package/ai/reference/bf-shell-dynamic-type.md +25 -0
- package/ai/reference/bf-shell-mode.md +28 -0
- package/ai/reference/bf-shell-testing-options.md +26 -0
- package/ai/reference/bf-size.md +45 -0
- package/ai/reference/bf-spinner-size.md +27 -0
- package/ai/reference/bf-stack-change.md +22 -0
- package/ai/reference/bf-stack-reuse-strategy.md +32 -0
- package/ai/reference/bf-stack-transition-event.md +26 -0
- package/ai/reference/bf-stack-transition.md +26 -0
- package/ai/reference/bf-stacked-overlay.md +23 -0
- package/ai/reference/bf-system-bars-style.md +38 -0
- package/ai/reference/bf-tab-bar-controller.md +51 -0
- package/ai/reference/bf-tab-bar-host.md +52 -0
- package/ai/reference/bf-tab-context.md +32 -0
- package/ai/reference/bf-tab-links.md +37 -0
- package/ai/reference/bf-testing-options.md +27 -0
- package/ai/reference/bf-text-scale-service.md +35 -0
- package/ai/reference/bf-theme.md +27 -0
- package/ai/reference/bf-toast-action.md +25 -0
- package/ai/reference/bf-toast-controller.md +17 -0
- package/ai/reference/bf-toast-dismiss-reason.md +29 -0
- package/ai/reference/bf-toast-options.md +29 -0
- package/ai/reference/bf-toast-position.md +26 -0
- package/ai/reference/bf-toast-ref.md +41 -0
- package/ai/reference/bf-toast-service.md +39 -0
- package/ai/reference/bf-toggle-label-position.md +26 -0
- package/ai/reference/bf-transition-kind.md +28 -0
- package/ai/reference/bf-validation-message.md +31 -0
- package/ai/reference/bf-validation-messages.md +33 -0
- package/ai/reference/bf-view-event.md +28 -0
- package/ai/reference/bf-view-lifecycle.md +41 -0
- package/ai/reference/bf-view-state.md +28 -0
- package/ai/reference/bf_default_labels.md +21 -0
- package/ai/reference/bf_default_values.md +21 -0
- package/ai/reference/bf_defaults.md +21 -0
- package/ai/reference/bf_desktop_toast_defaults.md +21 -0
- package/ai/reference/bf_dialog_data.md +17 -0
- package/ai/reference/bf_labels.md +21 -0
- package/ai/reference/bf_overlay_data.md +19 -0
- package/ai/reference/bf_overlay_host.md +21 -0
- package/ai/reference/bf_sheet_default_snap_points.md +17 -0
- package/ai/reference/bf_shell_config.md +21 -0
- package/ai/reference/bf_shell_defaults.md +21 -0
- package/ai/reference/bf_tab_bar.md +21 -0
- package/ai/reference/bf_tab_bar_controller.md +21 -0
- package/ai/reference/bf_tab_context.md +21 -0
- package/ai/reference/bf_tab_links.md +21 -0
- package/ai/reference/bf_theme_storage.md +19 -0
- package/ai/reference/create-transition.md +36 -0
- package/ai/reference/duration_fast.md +17 -0
- package/ai/reference/duration_md.md +17 -0
- package/ai/reference/duration_overlay.md +17 -0
- package/ai/reference/duration_push.md +17 -0
- package/ai/reference/fade-down.md +26 -0
- package/ai/reference/fade-in.md +25 -0
- package/ai/reference/fade-out.md +25 -0
- package/ai/reference/fade-up.md +26 -0
- package/ai/reference/inject-shell-mode.md +23 -0
- package/ai/reference/install-bf-jsdom-shims.md +31 -0
- package/ai/reference/ios_duration.md +17 -0
- package/ai/reference/ios_easing.md +17 -0
- package/ai/reference/is-text-entry.md +25 -0
- package/ai/reference/max_complete_ms.md +17 -0
- package/ai/reference/md-transition.md +31 -0
- package/ai/reference/md_duration.md +17 -0
- package/ai/reference/md_easing.md +17 -0
- package/ai/reference/overlay_duration.md +21 -0
- package/ai/reference/overlay_easing.md +19 -0
- package/ai/reference/overlay_reduced_duration.md +17 -0
- package/ai/reference/pop-frames-at.md +25 -0
- package/ai/reference/prefers-reduced-motion.md +25 -0
- package/ai/reference/provide-bf-defaults.md +33 -0
- package/ai/reference/provide-bf-desktop-toast.md +28 -0
- package/ai/reference/provide-bf-labels.md +38 -0
- package/ai/reference/provide-bf-shell-testing.md +34 -0
- package/ai/reference/provide-bf-shell.md +41 -0
- package/ai/reference/provide-bf-testing.md +33 -0
- package/ai/reference/reduced-transition.md +28 -0
- package/ai/reference/reduced_duration.md +17 -0
- package/ai/reference/resolve-shell-mode.md +33 -0
- package/ai/reference/scale-in.md +25 -0
- package/ai/reference/settle-duration.md +25 -0
- package/ai/reference/settle-pop.md +33 -0
- package/ai/reference/settle_easing.md +17 -0
- package/ai/reference/should-complete-pop.md +26 -0
- package/ai/reference/slide-down.md +26 -0
- package/ai/reference/slide-up.md +26 -0
- package/ai/reference/with-bf-shell-routing.md +19 -0
- package/bin/bf-ui.js +81 -0
- package/fesm2022/bitforgehq-ui-icons.mjs +230 -0
- package/fesm2022/bitforgehq-ui-icons.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-mobile.mjs +5530 -0
- package/fesm2022/bitforgehq-ui-mobile.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-number-input.mjs +680 -0
- package/fesm2022/bitforgehq-ui-number-input.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-overlay.mjs +2675 -0
- package/fesm2022/bitforgehq-ui-overlay.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui-testing.mjs +402 -0
- package/fesm2022/bitforgehq-ui-testing.mjs.map +1 -0
- package/fesm2022/bitforgehq-ui.mjs +7765 -0
- package/fesm2022/bitforgehq-ui.mjs.map +1 -0
- package/llms-full.txt +25394 -0
- package/llms.txt +329 -0
- package/package.json +94 -0
- package/theme.css +253 -0
- package/types/bitforgehq-ui-icons.d.ts +50 -0
- package/types/bitforgehq-ui-mobile.d.ts +2914 -0
- package/types/bitforgehq-ui-number-input.d.ts +282 -0
- package/types/bitforgehq-ui-overlay.d.ts +1514 -0
- package/types/bitforgehq-ui-testing.d.ts +495 -0
- package/types/bitforgehq-ui.d.ts +3499 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# slideUp
|
|
2
|
+
|
|
3
|
+
Slides an element up into place, the enter animation of a bottom sheet
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/overlay` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use slideUp from '@bitforgehq/ui/overlay'; removed in 0.4.0).
|
|
8
|
+
|
|
9
|
+
Slides `el` up into place from `distance` below it (default: its own height).
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { slideUp } from '@bitforgehq/ui/overlay';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
function slideUp(el: HTMLElement, distance?: string): Animation
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Type | Description |
|
|
24
|
+
| ----------- | ------------- | --------------------------------------------------- |
|
|
25
|
+
| `el` | `HTMLElement` | The element to animate, usually the overlay panel. |
|
|
26
|
+
| `distance?` | `string` | How far below its place it starts, as a CSS length. |
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# withBfShellRouting
|
|
2
|
+
|
|
3
|
+
The router setting the mobile shell's stack needs, passed to provideRouter
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
The router feature the stack needs: `canceledNavigationResolution: 'computed'`, so a refused
|
|
8
|
+
back navigation (a guard stopping a swipe-back) restores the browser history position and the
|
|
9
|
+
stack stays in sync with it. Pass it to `provideRouter()`.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { withBfShellRouting } from '@bitforgehq/ui/mobile';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
function withBfShellRouting(): RouterConfigurationFeature
|
|
19
|
+
```
|
package/bin/bf-ui.js
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* bf-ui CLI, shipped inside @bitforgehq/ui.
|
|
4
|
+
*
|
|
5
|
+
* Usage: bf-ui sync-ai [--check]
|
|
6
|
+
*
|
|
7
|
+
* Installs (or checks) the agent guide `ai/UI_GUIDE.md`, bundled next to this script, into the
|
|
8
|
+
* consuming project as `.ai/UI_GUIDE.md`.
|
|
9
|
+
*/
|
|
10
|
+
import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'node:fs';
|
|
11
|
+
import { dirname, join } from 'node:path';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
import process from 'node:process';
|
|
14
|
+
|
|
15
|
+
const USAGE = 'Usage: bf-ui sync-ai [--check]';
|
|
16
|
+
|
|
17
|
+
const CLAUDE_SNIPPET = `## Shared UI library
|
|
18
|
+
- Before creating any UI primitive, read \`.ai/UI_GUIDE.md\` (from @bitforgehq/ui).
|
|
19
|
+
- Component APIs and usage: \`node_modules/@bitforgehq/ui/ai/components/<name>.md\`.
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
function resolveBundledGuidePath() {
|
|
23
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
24
|
+
return join(scriptDir, '..', 'ai', 'UI_GUIDE.md');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
function readBundledGuide() {
|
|
28
|
+
const guidePath = resolveBundledGuidePath();
|
|
29
|
+
if (!existsSync(guidePath)) {
|
|
30
|
+
console.error(
|
|
31
|
+
`bf-ui: could not find the bundled agent guide at ${guidePath}. ` +
|
|
32
|
+
'This usually means @bitforgehq/ui was installed incorrectly — reinstall the package.',
|
|
33
|
+
);
|
|
34
|
+
process.exit(2);
|
|
35
|
+
}
|
|
36
|
+
return readFileSync(guidePath, 'utf8');
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function syncAi({ check }) {
|
|
40
|
+
const guide = readBundledGuide();
|
|
41
|
+
const targetDir = join(process.cwd(), '.ai');
|
|
42
|
+
const targetPath = join(targetDir, 'UI_GUIDE.md');
|
|
43
|
+
const current = existsSync(targetPath) ? readFileSync(targetPath, 'utf8') : undefined;
|
|
44
|
+
|
|
45
|
+
if (check) {
|
|
46
|
+
if (current === guide) {
|
|
47
|
+
console.log('.ai/UI_GUIDE.md is up to date');
|
|
48
|
+
process.exit(0);
|
|
49
|
+
}
|
|
50
|
+
console.error('.ai/UI_GUIDE.md is missing or stale — run: bunx bf-ui sync-ai');
|
|
51
|
+
process.exit(1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
mkdirSync(targetDir, { recursive: true });
|
|
55
|
+
writeFileSync(targetPath, guide);
|
|
56
|
+
console.log('Wrote .ai/UI_GUIDE.md');
|
|
57
|
+
console.log('');
|
|
58
|
+
console.log('Add this to your CLAUDE.md (or AGENTS.md):');
|
|
59
|
+
console.log(CLAUDE_SNIPPET);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function main() {
|
|
63
|
+
const args = process.argv.slice(2);
|
|
64
|
+
const [command, ...rest] = args;
|
|
65
|
+
|
|
66
|
+
if (command !== 'sync-ai') {
|
|
67
|
+
console.error(USAGE);
|
|
68
|
+
process.exit(1);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
const check = rest.includes('--check');
|
|
72
|
+
const unknown = rest.filter((arg) => arg !== '--check');
|
|
73
|
+
if (unknown.length > 0) {
|
|
74
|
+
console.error(USAGE);
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
syncAi({ check });
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
main();
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import * as i0 from "@angular/core";
|
|
2
|
+
import { Component, computed, input } from "@angular/core";
|
|
3
|
+
const SIZE_PX = {
|
|
4
|
+
sm: 16,
|
|
5
|
+
md: 20,
|
|
6
|
+
lg: 24
|
|
7
|
+
};
|
|
8
|
+
var BfIconComponent = class BfIconComponent {
|
|
9
|
+
icon = input.required(...ngDevMode ? [{ debugName: "icon" }] : /* istanbul ignore next */ []);
|
|
10
|
+
size = input("md", ...ngDevMode ? [{ debugName: "size" }] : /* istanbul ignore next */ []);
|
|
11
|
+
label = input("", ...ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []);
|
|
12
|
+
px = computed(() => SIZE_PX[this.size()], ...ngDevMode ? [{ debugName: "px" }] : /* istanbul ignore next */ []);
|
|
13
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
14
|
+
minVersion: "12.0.0",
|
|
15
|
+
version: "22.1.7",
|
|
16
|
+
ngImport: i0,
|
|
17
|
+
type: BfIconComponent,
|
|
18
|
+
deps: [],
|
|
19
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
20
|
+
});
|
|
21
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
22
|
+
minVersion: "17.0.0",
|
|
23
|
+
version: "22.1.7",
|
|
24
|
+
type: BfIconComponent,
|
|
25
|
+
isStandalone: true,
|
|
26
|
+
selector: "bf-icon",
|
|
27
|
+
inputs: {
|
|
28
|
+
icon: {
|
|
29
|
+
classPropertyName: "icon",
|
|
30
|
+
publicName: "icon",
|
|
31
|
+
isSignal: true,
|
|
32
|
+
isRequired: true,
|
|
33
|
+
transformFunction: null
|
|
34
|
+
},
|
|
35
|
+
size: {
|
|
36
|
+
classPropertyName: "size",
|
|
37
|
+
publicName: "size",
|
|
38
|
+
isSignal: true,
|
|
39
|
+
isRequired: false,
|
|
40
|
+
transformFunction: null
|
|
41
|
+
},
|
|
42
|
+
label: {
|
|
43
|
+
classPropertyName: "label",
|
|
44
|
+
publicName: "label",
|
|
45
|
+
isSignal: true,
|
|
46
|
+
isRequired: false,
|
|
47
|
+
transformFunction: null
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
host: { classAttribute: "inline-flex shrink-0" },
|
|
51
|
+
ngImport: i0,
|
|
52
|
+
template: `
|
|
53
|
+
<svg
|
|
54
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
55
|
+
[attr.width]="px()"
|
|
56
|
+
[attr.height]="px()"
|
|
57
|
+
viewBox="0 0 24 24"
|
|
58
|
+
fill="none"
|
|
59
|
+
stroke="currentColor"
|
|
60
|
+
stroke-width="2"
|
|
61
|
+
stroke-linecap="round"
|
|
62
|
+
stroke-linejoin="round"
|
|
63
|
+
[attr.role]="label() ? 'img' : null"
|
|
64
|
+
[attr.aria-label]="label() || null"
|
|
65
|
+
[attr.aria-hidden]="label() ? null : 'true'"
|
|
66
|
+
>
|
|
67
|
+
@for (node of icon(); track $index) {
|
|
68
|
+
@switch (node[0]) {
|
|
69
|
+
@case ('path') {
|
|
70
|
+
<path [attr.d]="node[1]['d']" [attr.fill]="node[1]['fill'] ?? null" />
|
|
71
|
+
}
|
|
72
|
+
@case ('circle') {
|
|
73
|
+
<circle
|
|
74
|
+
[attr.cx]="node[1]['cx']"
|
|
75
|
+
[attr.cy]="node[1]['cy']"
|
|
76
|
+
[attr.r]="node[1]['r']"
|
|
77
|
+
[attr.fill]="node[1]['fill'] ?? null"
|
|
78
|
+
/>
|
|
79
|
+
}
|
|
80
|
+
@case ('ellipse') {
|
|
81
|
+
<ellipse
|
|
82
|
+
[attr.cx]="node[1]['cx']"
|
|
83
|
+
[attr.cy]="node[1]['cy']"
|
|
84
|
+
[attr.rx]="node[1]['rx']"
|
|
85
|
+
[attr.ry]="node[1]['ry']"
|
|
86
|
+
[attr.fill]="node[1]['fill'] ?? null"
|
|
87
|
+
/>
|
|
88
|
+
}
|
|
89
|
+
@case ('line') {
|
|
90
|
+
<line
|
|
91
|
+
[attr.x1]="node[1]['x1']"
|
|
92
|
+
[attr.y1]="node[1]['y1']"
|
|
93
|
+
[attr.x2]="node[1]['x2']"
|
|
94
|
+
[attr.y2]="node[1]['y2']"
|
|
95
|
+
[attr.fill]="node[1]['fill'] ?? null"
|
|
96
|
+
/>
|
|
97
|
+
}
|
|
98
|
+
@case ('polyline') {
|
|
99
|
+
<polyline [attr.points]="node[1]['points']" [attr.fill]="node[1]['fill'] ?? null" />
|
|
100
|
+
}
|
|
101
|
+
@case ('polygon') {
|
|
102
|
+
<polygon [attr.points]="node[1]['points']" [attr.fill]="node[1]['fill'] ?? null" />
|
|
103
|
+
}
|
|
104
|
+
@case ('rect') {
|
|
105
|
+
<rect
|
|
106
|
+
[attr.x]="node[1]['x']"
|
|
107
|
+
[attr.y]="node[1]['y']"
|
|
108
|
+
[attr.width]="node[1]['width']"
|
|
109
|
+
[attr.height]="node[1]['height']"
|
|
110
|
+
[attr.rx]="node[1]['rx']"
|
|
111
|
+
[attr.ry]="node[1]['ry']"
|
|
112
|
+
[attr.fill]="node[1]['fill'] ?? null"
|
|
113
|
+
/>
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
</svg>
|
|
118
|
+
`,
|
|
119
|
+
isInline: true
|
|
120
|
+
});
|
|
121
|
+
};
|
|
122
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
123
|
+
minVersion: "12.0.0",
|
|
124
|
+
version: "22.1.7",
|
|
125
|
+
ngImport: i0,
|
|
126
|
+
type: BfIconComponent,
|
|
127
|
+
decorators: [{
|
|
128
|
+
type: Component,
|
|
129
|
+
args: [{
|
|
130
|
+
selector: "bf-icon",
|
|
131
|
+
host: { class: "inline-flex shrink-0" },
|
|
132
|
+
template: `
|
|
133
|
+
<svg
|
|
134
|
+
xmlns="http://www.w3.org/2000/svg"
|
|
135
|
+
[attr.width]="px()"
|
|
136
|
+
[attr.height]="px()"
|
|
137
|
+
viewBox="0 0 24 24"
|
|
138
|
+
fill="none"
|
|
139
|
+
stroke="currentColor"
|
|
140
|
+
stroke-width="2"
|
|
141
|
+
stroke-linecap="round"
|
|
142
|
+
stroke-linejoin="round"
|
|
143
|
+
[attr.role]="label() ? 'img' : null"
|
|
144
|
+
[attr.aria-label]="label() || null"
|
|
145
|
+
[attr.aria-hidden]="label() ? null : 'true'"
|
|
146
|
+
>
|
|
147
|
+
@for (node of icon(); track $index) {
|
|
148
|
+
@switch (node[0]) {
|
|
149
|
+
@case ('path') {
|
|
150
|
+
<path [attr.d]="node[1]['d']" [attr.fill]="node[1]['fill'] ?? null" />
|
|
151
|
+
}
|
|
152
|
+
@case ('circle') {
|
|
153
|
+
<circle
|
|
154
|
+
[attr.cx]="node[1]['cx']"
|
|
155
|
+
[attr.cy]="node[1]['cy']"
|
|
156
|
+
[attr.r]="node[1]['r']"
|
|
157
|
+
[attr.fill]="node[1]['fill'] ?? null"
|
|
158
|
+
/>
|
|
159
|
+
}
|
|
160
|
+
@case ('ellipse') {
|
|
161
|
+
<ellipse
|
|
162
|
+
[attr.cx]="node[1]['cx']"
|
|
163
|
+
[attr.cy]="node[1]['cy']"
|
|
164
|
+
[attr.rx]="node[1]['rx']"
|
|
165
|
+
[attr.ry]="node[1]['ry']"
|
|
166
|
+
[attr.fill]="node[1]['fill'] ?? null"
|
|
167
|
+
/>
|
|
168
|
+
}
|
|
169
|
+
@case ('line') {
|
|
170
|
+
<line
|
|
171
|
+
[attr.x1]="node[1]['x1']"
|
|
172
|
+
[attr.y1]="node[1]['y1']"
|
|
173
|
+
[attr.x2]="node[1]['x2']"
|
|
174
|
+
[attr.y2]="node[1]['y2']"
|
|
175
|
+
[attr.fill]="node[1]['fill'] ?? null"
|
|
176
|
+
/>
|
|
177
|
+
}
|
|
178
|
+
@case ('polyline') {
|
|
179
|
+
<polyline [attr.points]="node[1]['points']" [attr.fill]="node[1]['fill'] ?? null" />
|
|
180
|
+
}
|
|
181
|
+
@case ('polygon') {
|
|
182
|
+
<polygon [attr.points]="node[1]['points']" [attr.fill]="node[1]['fill'] ?? null" />
|
|
183
|
+
}
|
|
184
|
+
@case ('rect') {
|
|
185
|
+
<rect
|
|
186
|
+
[attr.x]="node[1]['x']"
|
|
187
|
+
[attr.y]="node[1]['y']"
|
|
188
|
+
[attr.width]="node[1]['width']"
|
|
189
|
+
[attr.height]="node[1]['height']"
|
|
190
|
+
[attr.rx]="node[1]['rx']"
|
|
191
|
+
[attr.ry]="node[1]['ry']"
|
|
192
|
+
[attr.fill]="node[1]['fill'] ?? null"
|
|
193
|
+
/>
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
</svg>
|
|
198
|
+
`
|
|
199
|
+
}]
|
|
200
|
+
}],
|
|
201
|
+
propDecorators: {
|
|
202
|
+
icon: [{
|
|
203
|
+
type: i0.Input,
|
|
204
|
+
args: [{
|
|
205
|
+
isSignal: true,
|
|
206
|
+
alias: "icon",
|
|
207
|
+
required: true
|
|
208
|
+
}]
|
|
209
|
+
}],
|
|
210
|
+
size: [{
|
|
211
|
+
type: i0.Input,
|
|
212
|
+
args: [{
|
|
213
|
+
isSignal: true,
|
|
214
|
+
alias: "size",
|
|
215
|
+
required: false
|
|
216
|
+
}]
|
|
217
|
+
}],
|
|
218
|
+
label: [{
|
|
219
|
+
type: i0.Input,
|
|
220
|
+
args: [{
|
|
221
|
+
isSignal: true,
|
|
222
|
+
alias: "label",
|
|
223
|
+
required: false
|
|
224
|
+
}]
|
|
225
|
+
}]
|
|
226
|
+
}
|
|
227
|
+
});
|
|
228
|
+
export { BfIconComponent };
|
|
229
|
+
|
|
230
|
+
//# sourceMappingURL=bitforgehq-ui-icons.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitforgehq-ui-icons.mjs","names":[],"sources":["../../../projects/ui/icons/icon.component.ts"],"sourcesContent":["import { Component, computed, input } from '@angular/core';\nimport { type IconNode } from 'lucide';\n\n/**\n * The size of a `bf-icon`: sm 16, md 20 or lg 24 px.\n *\n * @summary The three icon sizes, 16, 20 and 24 pixels, matching the text sizes\n * @since 0.1.0\n */\nexport type BfIconSize = 'sm' | 'md' | 'lg';\n\nconst SIZE_PX: Record<BfIconSize, number> = { sm: 16, md: 20, lg: 24 };\n\n/**\n * Renders a Lucide icon from its data, tree-shakably and without a registry.\n * Import the icon you need from `lucide` (e.g. `import { Search } from 'lucide'`) and bind it.\n * Decorative by default; pass `label` when the icon carries meaning on its own (e.g. an icon-only\n * control without visible text).\n *\n * @example\n * <bf-icon [icon]=\"Search\" />\n * <bf-icon [icon]=\"Search\" label=\"Search\" size=\"lg\" />\n * @summary Tree-shakable Lucide icon renderer, decorative by default or labelled when meaningful\n * @category Icons\n * @since 0.1.0\n */\n@Component({\n selector: 'bf-icon',\n host: { class: 'inline-flex shrink-0' },\n template: `\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n [attr.width]=\"px()\"\n [attr.height]=\"px()\"\n viewBox=\"0 0 24 24\"\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n [attr.role]=\"label() ? 'img' : null\"\n [attr.aria-label]=\"label() || null\"\n [attr.aria-hidden]=\"label() ? null : 'true'\"\n >\n @for (node of icon(); track $index) {\n @switch (node[0]) {\n @case ('path') {\n <path [attr.d]=\"node[1]['d']\" [attr.fill]=\"node[1]['fill'] ?? null\" />\n }\n @case ('circle') {\n <circle\n [attr.cx]=\"node[1]['cx']\"\n [attr.cy]=\"node[1]['cy']\"\n [attr.r]=\"node[1]['r']\"\n [attr.fill]=\"node[1]['fill'] ?? null\"\n />\n }\n @case ('ellipse') {\n <ellipse\n [attr.cx]=\"node[1]['cx']\"\n [attr.cy]=\"node[1]['cy']\"\n [attr.rx]=\"node[1]['rx']\"\n [attr.ry]=\"node[1]['ry']\"\n [attr.fill]=\"node[1]['fill'] ?? null\"\n />\n }\n @case ('line') {\n <line\n [attr.x1]=\"node[1]['x1']\"\n [attr.y1]=\"node[1]['y1']\"\n [attr.x2]=\"node[1]['x2']\"\n [attr.y2]=\"node[1]['y2']\"\n [attr.fill]=\"node[1]['fill'] ?? null\"\n />\n }\n @case ('polyline') {\n <polyline [attr.points]=\"node[1]['points']\" [attr.fill]=\"node[1]['fill'] ?? null\" />\n }\n @case ('polygon') {\n <polygon [attr.points]=\"node[1]['points']\" [attr.fill]=\"node[1]['fill'] ?? null\" />\n }\n @case ('rect') {\n <rect\n [attr.x]=\"node[1]['x']\"\n [attr.y]=\"node[1]['y']\"\n [attr.width]=\"node[1]['width']\"\n [attr.height]=\"node[1]['height']\"\n [attr.rx]=\"node[1]['rx']\"\n [attr.ry]=\"node[1]['ry']\"\n [attr.fill]=\"node[1]['fill'] ?? null\"\n />\n }\n }\n }\n </svg>\n `,\n})\nexport class BfIconComponent {\n /** Lucide icon data, e.g. `Search` from `lucide`. */\n readonly icon = input.required<IconNode>();\n /** Visual size: 16, 20 or 24 px. */\n readonly size = input<BfIconSize>('md');\n /** Accessible name. Leave empty for decorative icons next to visible text. */\n readonly label = input('');\n\n readonly px = computed(() => SIZE_PX[this.size()]);\n}\n"],"mappings":";;AAWA,MAAM,UAAsC;CAAE,IAAI;CAAI,IAAI;CAAI,IAAI;AAAE;AAsFpE,IAAa,kBAAb,MAAa,gBAAe;CAEjB,OAAO,MAAM,SAAoB,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,gCAAA,CAAA,CAAA;CAEjC,OAAO,MAAkB,MAAK,GAAA,YAAA,CAAA,EAAA,WAAA,OAAA,CAAA,gCAAA,CAAA,CAAA;CAE9B,QAAQ,MAAM,IAAG,GAAA,YAAA,CAAA,EAAA,WAAA,QAAA,CAAA,gCAAA,CAAA,CAAA;CAEjB,KAAK,eAAe,QAAQ,KAAK,KAAI,IAAI,GAAA,YAAA,CAAA,EAAA,WAAA,KAAA,CAAA,gCAAA,CAAA,CAAA;CARvC,OAAA,OAAA,GAAA,mBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,UAAA;EAAA,MAAA;EAAe,MAAA,CAAA;EAAA,QAAA,GAAA,gBAAA;CAAA,CAAA;CAAf,OAAA,OAAA,GAAA,qBAAA;EAAA,YAAA;EAAA,SAAA;EAAA,MAAA;EAAe,cAAA;EAAA,UAAA;EAAA,QAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,MAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;GAAA,OAAA;IAAA,mBAAA;IAAA,YAAA;IAAA,UAAA;IAAA,YAAA;IAAA,mBAAA;GAAA;EAAA;EAAA,MAAA,EAAA,gBAAA,uBAAA;EAAA,UAAA;EAAA,UApEhB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAkET,UAAA;CAAA,CAAA;;AAEU,GAAA,yBAAA;CAAA,YAAA;CAAA,SAAA;CAAA,UAAA;CAAA,MAAA;CAAe,YAAA,CAAA;EAvE3B,MAAA;EAAU,MAAA,CAAA;GACT,UAAU;GACV,MAAM,EAAE,OAAO,uBAAsB;GACrC,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAmEX,CAAA"}
|