@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,17 @@
|
|
|
1
|
+
# MAX_COMPLETE_MS
|
|
2
|
+
|
|
3
|
+
The longest a released swipe-back may take to settle, in milliseconds
|
|
4
|
+
|
|
5
|
+
Constant from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Upper bound of the settle animation after a released swipe.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { MAX_COMPLETE_MS } from '@bitforgehq/ui/mobile';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const MAX_COMPLETE_MS = 540
|
|
17
|
+
```
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
# mdTransition
|
|
2
|
+
|
|
3
|
+
Builds the Material fade-up page transition of a push or a pop
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Material fade-up: the entering page fades in while rising 16 px; a pop is the reverse on the
|
|
8
|
+
leaving page. No parallax, no dim.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { mdTransition } from '@bitforgehq/ui/mobile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
function mdTransition(kind: BfTransitionKind, entering: HTMLElement, leaving: HTMLElement): BfStackTransition
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| ---------- | ------------------ | ------------------------------ |
|
|
24
|
+
| `kind` | `BfTransitionKind` | `push` or `pop`. |
|
|
25
|
+
| `entering` | `HTMLElement` | The page that becomes visible. |
|
|
26
|
+
| `leaving` | `HTMLElement` | The page that goes away. |
|
|
27
|
+
|
|
28
|
+
## Uses
|
|
29
|
+
|
|
30
|
+
- [BfStackTransition](bf-stack-transition.md)
|
|
31
|
+
- [BfTransitionKind](bf-transition-kind.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# MD_DURATION
|
|
2
|
+
|
|
3
|
+
The duration of the Material fade-up stack transition, in milliseconds
|
|
4
|
+
|
|
5
|
+
Constant from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Material fade-up.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { MD_DURATION } from '@bitforgehq/ui/mobile';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const MD_DURATION: 220
|
|
17
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# MD_EASING
|
|
2
|
+
|
|
3
|
+
The Material standard easing curve of the Android page fade-up transition
|
|
4
|
+
|
|
5
|
+
Constant from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Material standard easing (the Android fade-up).
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { MD_EASING } from '@bitforgehq/ui/mobile';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const MD_EASING = 'cubic-bezier(0.2, 0, 0, 1)'
|
|
17
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# OVERLAY_DURATION
|
|
2
|
+
|
|
3
|
+
The duration of every overlay enter and exit animation, in milliseconds
|
|
4
|
+
|
|
5
|
+
Constant from `@bitforgehq/ui/overlay` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use OVERLAY_DURATION from '@bitforgehq/ui/overlay'; removed in 0.4.0).
|
|
8
|
+
|
|
9
|
+
Motion constants of the overlay core. `@bitforgehq/ui/mobile` reuses them for its own motion
|
|
10
|
+
(`DURATION_OVERLAY`, `DURATION_FAST`, `IOS_EASING`).
|
|
11
|
+
Overlay enter and exit (ms).
|
|
12
|
+
|
|
13
|
+
```ts
|
|
14
|
+
import { OVERLAY_DURATION } from '@bitforgehq/ui/overlay';
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Signature
|
|
18
|
+
|
|
19
|
+
```ts
|
|
20
|
+
const OVERLAY_DURATION = 260
|
|
21
|
+
```
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# OVERLAY_EASING
|
|
2
|
+
|
|
3
|
+
The easing curve of the overlay animations, the UIKit sheet curve
|
|
4
|
+
|
|
5
|
+
Constant from `@bitforgehq/ui/overlay` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use OVERLAY_EASING from '@bitforgehq/ui/overlay'; removed in 0.4.0).
|
|
8
|
+
|
|
9
|
+
The overlays' curve: UIKit's navigation and sheet curve.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { OVERLAY_EASING } from '@bitforgehq/ui/overlay';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
const OVERLAY_EASING = 'cubic-bezier(0.32, 0.72, 0, 1)'
|
|
19
|
+
```
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# OVERLAY_REDUCED_DURATION
|
|
2
|
+
|
|
3
|
+
The duration of the fade that replaces overlay motion under reduced motion
|
|
4
|
+
|
|
5
|
+
Constant from `@bitforgehq/ui/overlay` · since 0.3.0
|
|
6
|
+
|
|
7
|
+
The opacity fade that replaces every overlay animation under reduced motion (ms).
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { OVERLAY_REDUCED_DURATION } from '@bitforgehq/ui/overlay';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const OVERLAY_REDUCED_DURATION = 150
|
|
17
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# popFramesAt
|
|
2
|
+
|
|
3
|
+
The positions of the pop layers at a given progress, for scrubbing a swipe
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Frame values of the pop at progress `p` (0 = start, 1 = done), used to hand a scrubbed gesture
|
|
8
|
+
over to a fresh eased animation on release.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { popFramesAt } from '@bitforgehq/ui/mobile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
function popFramesAt(p: number, width: number): { top: number; under: number; dim: number }
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| --------- | -------- | ---------------------------------------- |
|
|
24
|
+
| `p` | `number` | The pop progress, 0 (start) to 1 (done). |
|
|
25
|
+
| `width` | `number` | The outlet width (px). |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# prefersReducedMotion
|
|
2
|
+
|
|
3
|
+
Tells whether the user asked the system to minimise motion
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/overlay` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Also exported from `@bitforgehq/ui/mobile`.
|
|
8
|
+
|
|
9
|
+
True when the user asked the system to minimise motion.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { prefersReducedMotion } from '@bitforgehq/ui/overlay';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
function prefersReducedMotion(view: Window | null | undefined): boolean
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Type | Description |
|
|
24
|
+
| --------- | ----------------------------- | ----------------------------------------------------------------------- |
|
|
25
|
+
| `view` | `Window \| null \| undefined` | The window to ask, usually `document.defaultView`; none reads as false. |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# provideBfDefaults
|
|
2
|
+
|
|
3
|
+
Sets the default field and control sizes for an app or a sub-tree
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui` · since 0.3.0
|
|
6
|
+
|
|
7
|
+
App-wide (ApplicationConfig) or sub-tree (a component's `providers`) widget defaults, merged
|
|
8
|
+
over the nearest parent's. Capacitor apps: `provideBfDefaults({ fieldSize: 'lg' })` keeps the
|
|
9
|
+
0.2 phone look; `{ size: 'lg' }` enlarges every control.
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { provideBfDefaults } from '@bitforgehq/ui';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
function provideBfDefaults(options: BfDefaultsOptions): Provider
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Type | Description |
|
|
24
|
+
| --------- | ------------------- | ------------------------------------------------------- |
|
|
25
|
+
| `options` | `BfDefaultsOptions` | The steps to set; any step left out keeps the parent's. |
|
|
26
|
+
|
|
27
|
+
## Uses
|
|
28
|
+
|
|
29
|
+
- [BfDefaultsOptions](bf-defaults-options.md)
|
|
30
|
+
|
|
31
|
+
## Used by
|
|
32
|
+
|
|
33
|
+
- [BfTestingOptions](bf-testing-options.md)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# provideBfDesktopToast
|
|
2
|
+
|
|
3
|
+
Sets where desktop toasts appear and how many show at once, app-wide
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/overlay` · since 0.3.0
|
|
6
|
+
|
|
7
|
+
Sets where the desktop toast stack sits, how many toasts it shows at once and its region name,
|
|
8
|
+
merged over the defaults. Add it to `ApplicationConfig.providers`.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { provideBfDesktopToast } from '@bitforgehq/ui/overlay';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
function provideBfDesktopToast(config?: Partial<BfDesktopToastConfig>): EnvironmentProviders
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| --------- | ------------------------------- | ---------------------------------------------------------------------- |
|
|
24
|
+
| `config?` | `Partial<BfDesktopToastConfig>` | The settings to change; any left out keep `BF_DESKTOP_TOAST_DEFAULTS`. |
|
|
25
|
+
|
|
26
|
+
## Uses
|
|
27
|
+
|
|
28
|
+
- [BfDesktopToastConfig](bf-desktop-toast-config.md)
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
# provideBfLabels
|
|
2
|
+
|
|
3
|
+
Replaces built-in strings for an app or a sub-tree, such as a translation
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui` · since 0.3.0
|
|
6
|
+
|
|
7
|
+
Replaces built-in strings, merged over the parent's (validation merged key by key); a key left
|
|
8
|
+
out or set to `undefined` keeps the parent's string. In `ApplicationConfig.providers` it covers
|
|
9
|
+
every string. In a component's `providers` it covers that sub-tree's widgets and form controls
|
|
10
|
+
(`loading`, `dismiss`, `tabBar`, `tabBadge`, `back`, `refreshing`, `validation`); the overlay
|
|
11
|
+
services (`ok`, `cancel`, `actions`, `sheet`, `modal`, `close`, `expand`, `collapse`,
|
|
12
|
+
`sheetPosition`, `dialog`, `notifications`) are
|
|
13
|
+
root singletons and pick it up only when the caller passes its injector:
|
|
14
|
+
`open(…, { injector: inject(Injector) })`.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { provideBfLabels } from '@bitforgehq/ui';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Signature
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
function provideBfLabels(overrides: BfLabelsOverrides): Provider
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Parameters
|
|
27
|
+
|
|
28
|
+
| Parameter | Type | Description |
|
|
29
|
+
| ----------- | ------------------- | ------------------------------------------------------------ |
|
|
30
|
+
| `overrides` | `BfLabelsOverrides` | The strings to replace; any key left out keeps the parent's. |
|
|
31
|
+
|
|
32
|
+
## Uses
|
|
33
|
+
|
|
34
|
+
- [BfLabelsOverrides](bf-labels-overrides.md)
|
|
35
|
+
|
|
36
|
+
## Used by
|
|
37
|
+
|
|
38
|
+
- [BfTestingOptions](bf-testing-options.md)
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
# provideBfShellTesting
|
|
2
|
+
|
|
3
|
+
Test providers for the mobile shell: router, shell, in-memory theme and cleanup
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.3.0
|
|
6
|
+
|
|
7
|
+
Test providers for an app on the mobile shell: `provideRouter(routes ?? [],
|
|
8
|
+
withComponentInputBinding(), withBfShellRouting())` plus `provideBfShell({ swipeBack: false,
|
|
9
|
+
hapticsOnTabChange: false, ...config })`, an in-memory `BF_THEME_STORAGE` (so a theme change
|
|
10
|
+
never reaches `localStorage`), and the same document cleanup as `provideBfTesting()` from
|
|
11
|
+
`@bitforgehq/ui/testing` on teardown (`dark` and `cdk-global-scrollblock` on `<html>`, `inert` on
|
|
12
|
+
body children, stray overlay panes). Like that cleanup, it needs TestBed's default
|
|
13
|
+
`teardown: { destroyAfterEach: true }`. Use it instead of the app's own shell providers in
|
|
14
|
+
`TestBed.configureTestingModule()`.
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
import { provideBfShellTesting } from '@bitforgehq/ui/mobile';
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Signature
|
|
21
|
+
|
|
22
|
+
```ts
|
|
23
|
+
function provideBfShellTesting(options?: BfShellTestingOptions): EnvironmentProviders
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
## Parameters
|
|
27
|
+
|
|
28
|
+
| Parameter | Type | Description |
|
|
29
|
+
| ---------- | ----------------------- | ---------------------------------- |
|
|
30
|
+
| `options?` | `BfShellTestingOptions` | The routes and the shell settings. |
|
|
31
|
+
|
|
32
|
+
## Uses
|
|
33
|
+
|
|
34
|
+
- [BfShellTestingOptions](bf-shell-testing-options.md)
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
# provideBfShell
|
|
2
|
+
|
|
3
|
+
Provides the Capacitor app shell: its configuration, navigation and platform services
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Provides the mobile shell: its configuration, the stack-aware route reuse strategy
|
|
8
|
+
(`BfStackReuseStrategy`) and `BF_OVERLAY_HOST` (the hardware back button closes the top overlay
|
|
9
|
+
through `BfBackButtonService`, which on native Android also stands in for the overlays'
|
|
10
|
+
`CloseWatcher`, and the document never scrolls, so overlays skip the scroll lock). An environment initializer starts `BfPlatformService` (theme sync, the `dark` class),
|
|
11
|
+
`BfBackButtonService` (the Android hardware back listener), `BfKeyboardService` (keyboard
|
|
12
|
+
listeners and the rest-height probe), `BfHapticsService` (its native plugin loads lazily on first
|
|
13
|
+
use, so this only makes the singleton available) and `BfTextScaleService` (iOS Dynamic Type on
|
|
14
|
+
the root font size) at bootstrap, before any page renders. Every service is
|
|
15
|
+
`providedIn: 'root'`, so this function lists none of them: `BfNavController` and the overlay
|
|
16
|
+
services (`BfOverlayStack`, `BfOverlayService`, `BfSheetService`, `BfModalService`,
|
|
17
|
+
`BfToastService`, `BfActionSheetService`, `BfAlertDialogService`) are created on first
|
|
18
|
+
injection, and an app that never injects an overlay service bundles no overlay code. Use it
|
|
19
|
+
together with `provideRouter(routes, withComponentInputBinding(), withBfShellRouting())`, in the
|
|
20
|
+
application providers: in a lazy route's environment injector the services still resolve from
|
|
21
|
+
the root injector.
|
|
22
|
+
|
|
23
|
+
```ts
|
|
24
|
+
import { provideBfShell } from '@bitforgehq/ui/mobile';
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Signature
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
function provideBfShell(config?: Partial<BfShellConfig>): EnvironmentProviders
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Parameters
|
|
34
|
+
|
|
35
|
+
| Parameter | Type | Description |
|
|
36
|
+
| --------- | ------------------------ | -------------------------------------------------------------- |
|
|
37
|
+
| `config?` | `Partial<BfShellConfig>` | The settings to change; any left out keep `BF_SHELL_DEFAULTS`. |
|
|
38
|
+
|
|
39
|
+
## Uses
|
|
40
|
+
|
|
41
|
+
- [BfShellConfig](bf-shell-config.md)
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# provideBfTesting
|
|
2
|
+
|
|
3
|
+
Test providers for the widgets and overlays, with document cleanup after each test
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/testing` · since 0.3.0
|
|
6
|
+
|
|
7
|
+
Test providers for apps using the root and overlay entries: passes `defaults`/`labels` to 3b's
|
|
8
|
+
providers, and on environment teardown removes what overlays and themes leave on the document —
|
|
9
|
+
`dark` and `cdk-global-scrollblock` on `<html>`, `inert` on body children, stray
|
|
10
|
+
`.cdk-overlay-container` children. The cleanup runs when TestBed destroys the test environment,
|
|
11
|
+
so it needs TestBed's default `teardown: { destroyAfterEach: true }`; with `destroyAfterEach:
|
|
12
|
+
false` nothing is cleaned between tests. Mobile shell apps use `provideBfShellTesting()` from
|
|
13
|
+
`@bitforgehq/ui/mobile` instead.
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
import { provideBfTesting } from '@bitforgehq/ui/testing';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Signature
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
function provideBfTesting(options?: BfTestingOptions): EnvironmentProviders
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type | Description |
|
|
28
|
+
| ---------- | ------------------ | ---------------------------------------- |
|
|
29
|
+
| `options?` | `BfTestingOptions` | The size defaults and labels to provide. |
|
|
30
|
+
|
|
31
|
+
## Uses
|
|
32
|
+
|
|
33
|
+
- [BfTestingOptions](bf-testing-options.md)
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# reducedTransition
|
|
2
|
+
|
|
3
|
+
Builds the cross-fade that replaces page motion when the user reduces motion
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Reduced motion: a 150 ms cross-fade of the two pages, nothing moves.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { reducedTransition } from '@bitforgehq/ui/mobile';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
function reducedTransition(entering: HTMLElement, leaving: HTMLElement): BfStackTransition
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
| Parameter | Type | Description |
|
|
22
|
+
| ---------- | ------------- | ------------------------------ |
|
|
23
|
+
| `entering` | `HTMLElement` | The page that becomes visible. |
|
|
24
|
+
| `leaving` | `HTMLElement` | The page that goes away. |
|
|
25
|
+
|
|
26
|
+
## Uses
|
|
27
|
+
|
|
28
|
+
- [BfStackTransition](bf-stack-transition.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# REDUCED_DURATION
|
|
2
|
+
|
|
3
|
+
The duration of the cross-fade that replaces page motion under reduced motion
|
|
4
|
+
|
|
5
|
+
Constant from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Cross-fade used under `prefers-reduced-motion`.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { REDUCED_DURATION } from '@bitforgehq/ui/mobile';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const REDUCED_DURATION: 150
|
|
17
|
+
```
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# resolveShellMode
|
|
2
|
+
|
|
3
|
+
Resolves the shell mode in effect from the configuration and the platform
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
The shell mode in effect: `config.mode`, or the platform's (`BfPlatformService.mode()`: iOS on
|
|
8
|
+
iOS, else Material) when it is `'auto'`. The one resolution every mode-dependent part of the
|
|
9
|
+
shell (stack outlet, modal, header, back button) shares; apps use it (or `injectShellMode()`)
|
|
10
|
+
to follow the same per-mode conventions, e.g. text vs icon header actions.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import { resolveShellMode } from '@bitforgehq/ui/mobile';
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Signature
|
|
17
|
+
|
|
18
|
+
```ts
|
|
19
|
+
function resolveShellMode(config: Readonly<BfShellConfig>, platform: BfPlatformService): BfShellMode
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Parameters
|
|
23
|
+
|
|
24
|
+
| Parameter | Type | Description |
|
|
25
|
+
| ---------- | ------------------------- | ----------------------------------------------------------- |
|
|
26
|
+
| `config` | `Readonly<BfShellConfig>` | The shell configuration, usually `inject(BF_SHELL_CONFIG)`. |
|
|
27
|
+
| `platform` | `BfPlatformService` | The platform service. |
|
|
28
|
+
|
|
29
|
+
## Uses
|
|
30
|
+
|
|
31
|
+
- [BfPlatformService](bf-platform-service.md)
|
|
32
|
+
- [BfShellConfig](bf-shell-config.md)
|
|
33
|
+
- [BfShellMode](bf-shell-mode.md)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# scaleIn
|
|
2
|
+
|
|
3
|
+
Scales an element up while fading it in, the enter animation of centred dialogs
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/overlay` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Also exported from `@bitforgehq/ui/mobile` (deprecated: 0.3.0 use scaleIn from '@bitforgehq/ui/overlay'; removed in 0.4.0).
|
|
8
|
+
|
|
9
|
+
Scales `el` up from 92 % while fading it in (centred dialogs).
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { scaleIn } from '@bitforgehq/ui/overlay';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
function scaleIn(el: HTMLElement): Animation
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Parameters
|
|
22
|
+
|
|
23
|
+
| Parameter | Type | Description |
|
|
24
|
+
| --------- | ------------- | -------------------------------------------------- |
|
|
25
|
+
| `el` | `HTMLElement` | The element to animate, usually the overlay panel. |
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# settleDuration
|
|
2
|
+
|
|
3
|
+
The duration of the settle animation after a released swipe-back gesture
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Duration of the settle animation after a release: the remaining distance at the release speed
|
|
8
|
+
(at least 0.5 px/ms), clamped to 120 ms … `MAX_COMPLETE_MS`.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { settleDuration } from '@bitforgehq/ui/mobile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
function settleDuration(remainingPx: number, velocity: number): number
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| ------------- | -------- | --------------------------------- |
|
|
24
|
+
| `remainingPx` | `number` | The distance left to travel (px). |
|
|
25
|
+
| `velocity` | `number` | The release speed (px/ms). |
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
# settlePop
|
|
2
|
+
|
|
3
|
+
Animates a released swipe-back from its progress to done or back to the start
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Animates top, under and dim from pop progress `from` to `to` with an ease-out.
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { settlePop } from '@bitforgehq/ui/mobile';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
function settlePop(top: HTMLElement, under: HTMLElement, dim: HTMLElement, width: number, from: number, to: number, duration: number): BfStackTransition
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
| Parameter | Type | Description |
|
|
22
|
+
| ---------- | ------------- | ------------------------------------------------------------- |
|
|
23
|
+
| `top` | `HTMLElement` | The page being popped. |
|
|
24
|
+
| `under` | `HTMLElement` | The page under it. |
|
|
25
|
+
| `dim` | `HTMLElement` | The dimming layer. |
|
|
26
|
+
| `width` | `number` | The outlet width (px). |
|
|
27
|
+
| `from` | `number` | The progress at release, 0 to 1. |
|
|
28
|
+
| `to` | `number` | The progress to settle at: 1 completes the pop, 0 cancels it. |
|
|
29
|
+
| `duration` | `number` | The settle duration (ms), see `settleDuration`. |
|
|
30
|
+
|
|
31
|
+
## Uses
|
|
32
|
+
|
|
33
|
+
- [BfStackTransition](bf-stack-transition.md)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# SETTLE_EASING
|
|
2
|
+
|
|
3
|
+
The ease-out curve a released swipe-back or refresher gesture settles with
|
|
4
|
+
|
|
5
|
+
Constant from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
Ease-out of a released gesture settling into place (swipe-back, refresher).
|
|
8
|
+
|
|
9
|
+
```ts
|
|
10
|
+
import { SETTLE_EASING } from '@bitforgehq/ui/mobile';
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Signature
|
|
14
|
+
|
|
15
|
+
```ts
|
|
16
|
+
const SETTLE_EASING = 'cubic-bezier(0.2, 0.8, 0.3, 1)'
|
|
17
|
+
```
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# shouldCompletePop
|
|
2
|
+
|
|
3
|
+
Decides whether a released swipe-back completes the pop or settles back
|
|
4
|
+
|
|
5
|
+
Function from `@bitforgehq/ui/mobile` · since 0.2.0
|
|
6
|
+
|
|
7
|
+
The release rule of the swipe-back: a flick (`velocity` above 0.2 px/ms) or a drag past half
|
|
8
|
+
the width completes the pop; anything else settles back.
|
|
9
|
+
|
|
10
|
+
```ts
|
|
11
|
+
import { shouldCompletePop } from '@bitforgehq/ui/mobile';
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Signature
|
|
15
|
+
|
|
16
|
+
```ts
|
|
17
|
+
function shouldCompletePop(velocity: number, delta: number, width: number): boolean
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Parameters
|
|
21
|
+
|
|
22
|
+
| Parameter | Type | Description |
|
|
23
|
+
| ---------- | -------- | --------------------------------------------------------- |
|
|
24
|
+
| `velocity` | `number` | The release speed (px/ms, positive towards the end edge). |
|
|
25
|
+
| `delta` | `number` | The distance swiped (px). |
|
|
26
|
+
| `width` | `number` | The outlet width (px). |
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
# slideDown
|
|
2
|
+
|
|
3
|
+
Slides an element down out of place, the exit 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 slideDown from '@bitforgehq/ui/overlay'; removed in 0.4.0).
|
|
8
|
+
|
|
9
|
+
Slides `el` down out of place by `distance` (default: its own height).
|
|
10
|
+
|
|
11
|
+
```ts
|
|
12
|
+
import { slideDown } from '@bitforgehq/ui/overlay';
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Signature
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
function slideDown(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 ends, as a CSS length. |
|