@bloxwap/hig 0.7.0 → 0.9.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/README.md +2 -2
- package/chart/README.md +13 -2
- package/chart/dist/altimeter-burst.d.ts +4 -0
- package/chart/dist/altimeter-burst.js +43 -0
- package/chart/dist/altimeter-chart.d.ts +52 -0
- package/chart/dist/altimeter-chart.js +275 -0
- package/chart/dist/altimeter-model.d.ts +43 -0
- package/chart/dist/altimeter-model.js +148 -0
- package/chart/dist/altimeter-targets.d.ts +33 -0
- package/chart/dist/altimeter-targets.js +88 -0
- package/chart/dist/bitcoin-price.d.ts +8 -0
- package/chart/dist/bitcoin-price.js +41 -0
- package/chart/dist/champions-league.d.ts +19 -0
- package/chart/dist/champions-league.js +104 -0
- package/chart/dist/index.d.ts +6 -0
- package/chart/dist/index.js +5 -0
- package/chart/dist/outcome-chart.d.ts +37 -0
- package/chart/dist/outcome-chart.js +212 -0
- package/chart/dist/outcome-model.d.ts +43 -0
- package/chart/dist/outcome-model.js +71 -0
- package/chart/dist/plus-grid.d.ts +6 -0
- package/chart/dist/plus-grid.js +29 -0
- package/contracts/README.md +1 -1
- package/contracts/dist/avatar.d.ts +68 -0
- package/contracts/dist/avatar.js +93 -0
- package/contracts/dist/confetti.d.ts +174 -0
- package/contracts/dist/confetti.js +138 -0
- package/contracts/dist/decimal.d.ts +7 -0
- package/contracts/dist/decimal.js +35 -0
- package/contracts/dist/index.d.ts +29 -2
- package/contracts/dist/index.js +123 -4
- package/contracts/dist/invariants.d.ts +17 -0
- package/contracts/dist/invariants.js +24 -0
- package/contracts/dist/login.d.ts +34 -0
- package/contracts/dist/login.js +43 -0
- package/contracts/dist/messages.d.ts +57 -3
- package/contracts/dist/messages.js +20 -2
- package/contracts/dist/number-flow.d.ts +90 -0
- package/contracts/dist/number-flow.js +150 -0
- package/contracts/dist/qr.d.ts +151 -0
- package/contracts/dist/qr.js +581 -0
- package/contracts/dist/toast.d.ts +168 -0
- package/contracts/dist/toast.js +171 -0
- package/feedback/README.md +1 -1
- package/feedback/dist/contract.js +1 -1
- package/feedback/dist/react.js +2 -4
- package/native/README.md +6 -1
- package/native/dist/account-block.d.ts +10 -1
- package/native/dist/account-block.js +17 -7
- package/native/dist/animated-number-model.d.ts +41 -1
- package/native/dist/animated-number-model.js +201 -23
- package/native/dist/animated-number.d.ts +39 -1
- package/native/dist/animated-number.js +164 -17
- package/native/dist/announce.d.ts +2 -0
- package/native/dist/announce.js +10 -0
- package/native/dist/asset-balance-row.d.ts +3 -1
- package/native/dist/asset-balance-row.js +15 -4
- package/native/dist/assets-block.d.ts +115 -0
- package/native/dist/assets-block.js +87 -0
- package/native/dist/async-result.d.ts +2 -0
- package/native/dist/async-result.js +11 -0
- package/native/dist/avatar-frame.d.ts +29 -0
- package/native/dist/avatar-frame.js +56 -0
- package/native/dist/avatar.d.ts +21 -0
- package/native/dist/avatar.js +31 -0
- package/native/dist/bar-mark.d.ts +2 -0
- package/native/dist/bar-mark.js +4 -2
- package/native/dist/bar-pnl.js +2 -1
- package/native/dist/blocks.d.ts +9 -2
- package/native/dist/blocks.js +8 -1
- package/native/dist/brand.js +2 -1
- package/native/dist/button.d.ts +7 -2
- package/native/dist/button.js +13 -3
- package/native/dist/checkbox.js +2 -1
- package/native/dist/confetti.d.ts +33 -0
- package/native/dist/confetti.js +143 -0
- package/native/dist/confirm-block.d.ts +98 -0
- package/native/dist/confirm-block.js +48 -0
- package/native/dist/data.d.ts +1 -1
- package/native/dist/data.js +5 -1
- package/native/dist/deposit-block.d.ts +19 -0
- package/native/dist/deposit-block.js +17 -0
- package/native/dist/explainer-block.d.ts +91 -0
- package/native/dist/explainer-block.js +34 -0
- package/native/dist/field.d.ts +5 -1
- package/native/dist/field.js +27 -6
- package/native/dist/gesture-sheet-model.d.ts +50 -0
- package/native/dist/gesture-sheet-model.js +105 -0
- package/native/dist/gesture-sheet-next.d.ts +82 -0
- package/native/dist/gesture-sheet-next.js +315 -0
- package/native/dist/gesture-sheet.d.ts +5 -1
- package/native/dist/gesture-sheet.js +13 -6
- package/native/dist/icons.d.ts +9 -6
- package/native/dist/icons.js +25 -24
- package/native/dist/language-block.d.ts +10 -1
- package/native/dist/language-block.js +11 -4
- package/native/dist/list-group.d.ts +3 -1
- package/native/dist/list-group.js +26 -13
- package/native/dist/login-block.d.ts +4 -0
- package/native/dist/login-block.js +22 -0
- package/native/dist/manage-position-block.d.ts +8 -1
- package/native/dist/manage-position-block.js +7 -2
- package/native/dist/market-row.js +19 -8
- package/native/dist/navigation.js +5 -3
- package/native/dist/number-format.d.ts +6 -0
- package/native/dist/number-format.js +9 -0
- package/native/dist/pickers.d.ts +8 -0
- package/native/dist/pickers.js +3 -3
- package/native/dist/position-block.d.ts +5 -5
- package/native/dist/preset-group.d.ts +31 -0
- package/native/dist/preset-group.js +39 -0
- package/native/dist/preset-picker-block.d.ts +107 -0
- package/native/dist/preset-picker-block.js +43 -0
- package/native/dist/profile-block.d.ts +10 -1
- package/native/dist/profile-block.js +8 -3
- package/native/dist/provider.d.ts +5 -2
- package/native/dist/provider.js +27 -5
- package/native/dist/qr-code.d.ts +33 -0
- package/native/dist/qr-code.js +29 -0
- package/native/dist/radio-group.d.ts +19 -7
- package/native/dist/radio-group.js +39 -10
- package/native/dist/reward-block.d.ts +10 -7
- package/native/dist/reward-block.js +9 -4
- package/native/dist/screen-header.d.ts +13 -3
- package/native/dist/screen-header.js +12 -4
- package/native/dist/select.js +4 -2
- package/native/dist/selection.d.ts +2 -1
- package/native/dist/selection.js +1 -0
- package/native/dist/setting-switch.d.ts +1 -1
- package/native/dist/setting-switch.js +7 -3
- package/native/dist/slider.js +5 -1
- package/native/dist/sound-haptics-block.js +1 -1
- package/native/dist/status.d.ts +41 -9
- package/native/dist/status.js +34 -17
- package/native/dist/sticky-header.js +9 -1
- package/native/dist/swap-amount-card.d.ts +57 -0
- package/native/dist/swap-amount-card.js +31 -0
- package/native/dist/{swap-panel-block.d.ts → swap-block.d.ts} +18 -8
- package/native/dist/{swap-panel-block.js → swap-block.js} +63 -35
- package/native/dist/swap-parts.d.ts +3 -10
- package/native/dist/swap-parts.js +22 -24
- package/native/dist/swap-shared.d.ts +2 -2
- package/native/dist/swap-shared.js +10 -6
- package/native/dist/swap-sheet.d.ts +3 -3
- package/native/dist/swap-sheet.js +3 -3
- package/native/dist/swap-views.js +1 -1
- package/native/dist/target-block.d.ts +7 -1
- package/native/dist/target-block.js +13 -6
- package/native/dist/toast.d.ts +47 -0
- package/native/dist/toast.js +386 -0
- package/native/dist/token-action-block.d.ts +11 -2
- package/native/dist/token-action-block.js +10 -4
- package/native/dist/trade-history-list-block.js +7 -4
- package/native/dist/wallet-address-core.js +6 -3
- package/native-fonts/README.md +1 -1
- package/og-fonts/README.md +1 -1
- package/package.json +155 -11
- package/react/README.md +3 -1
- package/react/dist/animated-number-flow.d.ts +72 -0
- package/react/dist/animated-number-flow.js +316 -0
- package/react/dist/animated-number-model.d.ts +18 -0
- package/react/dist/animated-number-model.js +75 -5
- package/react/dist/animated-number.d.ts +45 -1
- package/react/dist/animated-number.js +137 -6
- package/react/dist/asset-balance-row.d.ts +3 -1
- package/react/dist/asset-balance-row.js +10 -4
- package/react/dist/async-result.d.ts +2 -0
- package/react/dist/async-result.js +11 -0
- package/react/dist/avatar.d.ts +25 -0
- package/react/dist/avatar.js +50 -0
- package/react/dist/blocks/account-block.d.ts +5 -1
- package/react/dist/blocks/account-block.js +11 -6
- package/react/dist/blocks/assets-block.d.ts +106 -0
- package/react/dist/blocks/assets-block.js +135 -0
- package/react/dist/blocks/confirm-block.d.ts +91 -0
- package/react/dist/blocks/confirm-block.js +31 -0
- package/react/dist/blocks/deposit-block.d.ts +19 -0
- package/react/dist/blocks/deposit-block.js +15 -0
- package/react/dist/blocks/explainer-block.d.ts +80 -0
- package/react/dist/blocks/explainer-block.js +20 -0
- package/react/dist/blocks/install-command.js +3 -1
- package/react/dist/blocks/language-block.d.ts +5 -1
- package/react/dist/blocks/language-block.js +4 -3
- package/react/dist/blocks/login-block.d.ts +4 -0
- package/react/dist/blocks/login-block.js +14 -0
- package/react/dist/blocks/manage-position-block.d.ts +3 -1
- package/react/dist/blocks/manage-position-block.js +2 -2
- package/react/dist/blocks/market-row.js +8 -3
- package/react/dist/blocks/notifications-block.d.ts +3 -1
- package/react/dist/blocks/notifications-block.js +2 -2
- package/react/dist/blocks/pickers.d.ts +9 -0
- package/react/dist/blocks/pickers.js +4 -2
- package/react/dist/blocks/position-block.d.ts +3 -3
- package/react/dist/blocks/preset-picker-block.d.ts +85 -0
- package/react/dist/blocks/preset-picker-block.js +19 -0
- package/react/dist/blocks/profile-block.d.ts +5 -1
- package/react/dist/blocks/profile-block.js +12 -13
- package/react/dist/blocks/reward-block.d.ts +13 -8
- package/react/dist/blocks/reward-block.js +7 -4
- package/react/dist/blocks/screen-header.d.ts +10 -2
- package/react/dist/blocks/screen-header.js +7 -4
- package/react/dist/blocks/setting-switch.js +6 -3
- package/react/dist/blocks/signals-block.d.ts +3 -1
- package/react/dist/blocks/signals-block.js +4 -3
- package/react/dist/blocks/sound-haptics-block.d.ts +3 -1
- package/react/dist/blocks/sound-haptics-block.js +2 -2
- package/react/dist/blocks/sticky-header.d.ts +14 -4
- package/react/dist/blocks/sticky-header.js +68 -8
- package/react/dist/blocks/swap/settings.js +2 -1
- package/react/dist/blocks/swap/shared.d.ts +22 -22
- package/react/dist/blocks/swap/shared.js +30 -28
- package/react/dist/blocks/{swap-panel-block.d.ts → swap-block.d.ts} +19 -8
- package/react/dist/blocks/swap-block.js +215 -0
- package/react/dist/blocks/swap-sheet.d.ts +3 -3
- package/react/dist/blocks/swap-sheet.js +3 -3
- package/react/dist/blocks/target-block.d.ts +7 -1
- package/react/dist/blocks/target-block.js +10 -4
- package/react/dist/blocks/token-action-block.d.ts +6 -2
- package/react/dist/blocks/token-action-block.js +3 -2
- package/react/dist/blocks/trade-history-detail-block.d.ts +3 -1
- package/react/dist/blocks/trade-history-detail-block.js +2 -2
- package/react/dist/blocks/trade-history-list-block.d.ts +3 -1
- package/react/dist/blocks/trade-history-list-block.js +7 -4
- package/react/dist/blocks.d.ts +8 -2
- package/react/dist/blocks.js +7 -1
- package/react/dist/brand.js +2 -1
- package/react/dist/button.d.ts +9 -3
- package/react/dist/button.js +8 -3
- package/react/dist/confetti.d.ts +27 -0
- package/react/dist/confetti.js +240 -0
- package/react/dist/data.js +8 -1
- package/react/dist/field.d.ts +6 -1
- package/react/dist/field.js +18 -9
- package/react/dist/gesture-sheet.d.ts +15 -1
- package/react/dist/gesture-sheet.js +53 -8
- package/react/dist/list-group.js +11 -7
- package/react/dist/navigation.js +11 -3
- package/react/dist/overlay.d.ts +1 -4
- package/react/dist/overlay.js +1 -3
- package/react/dist/popover.d.ts +30 -0
- package/react/dist/popover.js +34 -0
- package/react/dist/preset-group.d.ts +30 -0
- package/react/dist/preset-group.js +13 -0
- package/react/dist/provider.d.ts +2 -2
- package/react/dist/provider.js +23 -6
- package/react/dist/qr-code.d.ts +32 -0
- package/react/dist/qr-code.js +28 -0
- package/react/dist/select.js +10 -3
- package/react/dist/selection.d.ts +13 -5
- package/react/dist/selection.js +13 -8
- package/react/dist/slider.js +5 -1
- package/react/dist/status.d.ts +14 -10
- package/react/dist/status.js +17 -9
- package/react/dist/styles.css +260 -165
- package/react/dist/toast.d.ts +19 -12
- package/react/dist/toast.js +29 -7
- package/react/dist/wallet-address-core.d.ts +8 -4
- package/react/dist/wallet-address-core.js +10 -5
- package/tokens/README.md +2 -2
- package/tokens/assets/onramps/apple-pay.svg +33 -0
- package/tokens/assets/onramps/bank.svg +98 -0
- package/tokens/assets/onramps/blink.svg +37 -0
- package/tokens/assets/onramps/cashapp.svg +33 -0
- package/tokens/assets/onramps/crypto.svg +121 -0
- package/tokens/assets/onramps/exchange.svg +105 -0
- package/tokens/dist/deposit-icons.d.ts +1 -0
- package/tokens/dist/deposit-icons.js +28 -0
- package/tokens/dist/index.d.ts +16 -0
- package/tokens/dist/index.js +16 -0
- package/tokens/dist/manifest.json +8 -0
- package/tokens/dist/tokens.css +6 -0
- package/react/dist/blocks/swap-panel-block.js +0 -178
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ArrowUp } from '@bloxwap/icons/native/arrow-up';
|
|
3
|
+
import { ArrowDown } from '@bloxwap/icons/native/arrow-down';
|
|
2
4
|
import { Image, Pressable, View } from 'react-native';
|
|
3
|
-
import { formatNumber } from '
|
|
5
|
+
import { formatNumber } from './number-format.js';
|
|
4
6
|
import { useColors, useFills, useHIG, useNumberLocale, usePresentNumber } from './provider.js';
|
|
5
7
|
import { Text } from './surface.js';
|
|
6
8
|
import { ChevronIcon } from './icons.js';
|
|
@@ -15,7 +17,7 @@ const avatar = 40, skeletons = [0, 1, 2, 3], dot = '·';
|
|
|
15
17
|
const keyOf = (trade) => trade.id;
|
|
16
18
|
function Gap() { return _jsx(View, { style: { height: 8 } }); }
|
|
17
19
|
/** Points up; a short turns it over. */
|
|
18
|
-
function Arrow({ color, down }) {
|
|
20
|
+
function Arrow({ color, down }) { const Symbol = down ? ArrowDown : ArrowUp; return _jsx(Symbol, { size: 16, color: color }); }
|
|
19
21
|
/** A history of closed trades as one screen: a header, then one row per trade with the asset, its side and leverage in the market direction colour, and the net result in the market direction colour over its age. */
|
|
20
22
|
export function TradeHistoryListBlock({ labels, trades, onSelect, onBack, headerAction, pnlOptions = pnlFormat, loading, loadingLabel, error, notice, footer, renderList, listChrome, stickyHeader, stickyHeaderBackground, scrollComponent, testID }) {
|
|
21
23
|
const colors = useColors(), fills = useFills(), { direction } = useHIG(), locale = useNumberLocale(), present = usePresentNumber();
|
|
@@ -31,10 +33,11 @@ export function TradeHistoryListBlock({ labels, trades, onSelect, onBack, header
|
|
|
31
33
|
return onSelect ? _jsxs(Pressable, { testID: testID ? `${testID}-${trade.id}` : undefined, accessibilityRole: 'button', accessibilityLabel: reading, onPress: () => onSelect(trade), style: ({ pressed }) => row(pressed), children: [content, _jsx(View, { ...hidden, style: { transform: [{ rotate: direction === 'rtl' ? '90deg' : '-90deg' }] }, children: _jsx(ChevronIcon, { color: colors.muted }) })] }, trade.id)
|
|
32
34
|
: _jsx(View, { testID: testID ? `${testID}-${trade.id}` : undefined, accessible: true, accessibilityLabel: reading, style: row(false), children: content }, trade.id);
|
|
33
35
|
};
|
|
34
|
-
|
|
36
|
+
// The empty and error lines keep 32 above them and none below: the block's (or the host sheet's) 16 bottom inset is the only space under the text.
|
|
37
|
+
const plain = { paddingTop: 32, paddingBottom: 0, textAlign: 'center', fontSize: 14, lineHeight: 20 };
|
|
35
38
|
const body = loading ? _jsx(View, { testID: testID ? `${testID}-loading` : undefined, accessible: !!loadingLabel, accessibilityLabel: loadingLabel, accessibilityState: { busy: true }, style: { gap: 8 }, children: skeletons.map(index => _jsx(View, { style: { minHeight: 56, borderRadius: 28, backgroundColor: fills.raised } }, index)) })
|
|
36
39
|
: error ? _jsx(Text, { testID: testID ? `${testID}-error` : undefined, accessibilityRole: 'alert', accessibilityLiveRegion: 'polite', style: { ...plain, color: colors.negative }, children: error })
|
|
37
|
-
: trades.length === 0 ? (labels.emptyDescription ? _jsxs(View, { testID: testID ? `${testID}-empty` : undefined, accessible: true, accessibilityLabel: `${labels.empty}, ${labels.emptyDescription}`, style: {
|
|
40
|
+
: trades.length === 0 ? (labels.emptyDescription ? _jsxs(View, { testID: testID ? `${testID}-empty` : undefined, accessible: true, accessibilityLabel: `${labels.empty}, ${labels.emptyDescription}`, style: { paddingTop: 32, gap: 4 }, children: [_jsx(Text, { style: { ...plain, paddingTop: 0, fontWeight: '600', color: colors.text }, children: labels.empty }), _jsx(Text, { style: { ...plain, paddingTop: 0, color: colors.muted }, children: labels.emptyDescription })] }) : _jsx(Text, { testID: testID ? `${testID}-empty` : undefined, style: { ...plain, color: colors.muted }, children: labels.empty }))
|
|
38
41
|
: null;
|
|
39
42
|
const header = _jsx(ScreenHeader, { testID: testID, title: labels.title, onBack: onBack, action: headerAction });
|
|
40
43
|
const noticeView = notice != null && notice !== false ? _jsx(View, { testID: testID ? `${testID}-notice` : undefined, style: { gap: 8 }, children: notice }) : null;
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { Copy } from '@bloxwap/icons/native/copy';
|
|
3
|
+
import { useAsyncResult } from './async-result.js';
|
|
2
4
|
import { Pressable, View } from 'react-native';
|
|
3
5
|
import { useColors, useMessages } from './provider.js';
|
|
4
6
|
import { Text } from './surface.js';
|
|
@@ -7,7 +9,7 @@ import { VerticalAddress, addressKind } from './data.js';
|
|
|
7
9
|
export { VerticalAddress, addressKind } from './data.js';
|
|
8
10
|
const hidden = { accessible: false, accessibilityElementsHidden: true, importantForAccessibility: 'no-hide-descendants' };
|
|
9
11
|
/** Two overlapping rounded squares: copy. */
|
|
10
|
-
function CopyIcon({ color }) { return
|
|
12
|
+
function CopyIcon({ color }) { return _jsx(Copy, { size: 16, color: color }); }
|
|
11
13
|
/** @internal The layout both `WalletAddress` entries share. `code` is the QR as drawn, already named for assistive technology. */
|
|
12
14
|
export function WalletAddressFrame({ address, kind, code, size = 196, onCopy, announce = true, testID }) {
|
|
13
15
|
const colors = useColors();
|
|
@@ -15,8 +17,9 @@ export function WalletAddressFrame({ address, kind, code, size = 196, onCopy, an
|
|
|
15
17
|
const { notice, show, dismiss } = useTransientNotice();
|
|
16
18
|
const layout = kind ?? addressKind(address), rows = Math.max(1, Math.ceil(address.length / (layout === 'ethereum' ? 6 : 4)));
|
|
17
19
|
const body = _jsxs(_Fragment, { children: [_jsxs(View, { style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 16 }, children: [_jsx(View, { style: { width: size, height: size }, children: code }), _jsx(VerticalAddress, { address: address, kind: layout, rowHeight: size / rows, testID: 'wallet-address-column' })] }), onCopy ? _jsxs(View, { ...hidden, style: { flexDirection: 'row', alignItems: 'center', justifyContent: 'center', gap: 8, marginTop: 12 }, children: [_jsx(CopyIcon, { color: colors.muted }), _jsx(Text, { style: { color: colors.muted, fontSize: 14, lineHeight: 21 }, children: t.tapToCopy })] }) : null] });
|
|
18
|
-
const
|
|
19
|
-
|
|
20
|
+
const beginCopy = useAsyncResult(address);
|
|
21
|
+
const copy = () => { const current = beginCopy(); if (!onCopy)
|
|
22
|
+
return; Promise.resolve().then(onCopy).then(() => { if (current() && announce)
|
|
20
23
|
show(t.addressCopied); }).catch(() => { }); };
|
|
21
24
|
// The toast sits outside the button so its dismiss control is not nested in another control.
|
|
22
25
|
return _jsxs(View, { testID: testID, style: { alignItems: 'center' }, children: [onCopy ? _jsx(Pressable, { accessibilityRole: 'button', accessibilityLabel: `${t.copyAddress}: ${address}`, testID: 'wallet-address-copy', onPress: copy, style: ({ pressed }) => ({ opacity: pressed ? 0.8 : 1 }), children: body }) : _jsx(View, { children: body }), notice ? _jsx(View, { style: { marginTop: 8 }, children: _jsx(Toast, { notices: [notice], onDismiss: dismiss }) }) : null] });
|
package/native-fonts/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bloxwap/hig/native-fonts
|
|
2
2
|
|
|
3
|
-
Version 0.
|
|
3
|
+
Version 0.9.0, an entry of `@bloxwap/hig`. Static Bloxwap Sans/Mono (and Korean/Simplified Chinese Sans) TTF faces for React Native and Expo hosts, derived reproducibly from pinned `@bloxwap/font` 0.1.4 by `npm run generate:fonts`.
|
|
4
4
|
|
|
5
5
|
Web hosts never import this entry: load fonts through `@bloxwap/font` and use `@bloxwap/hig/tokens/css`. Open Graph card renderers (Satori, `next/og`) use the much smaller `@bloxwap/hig/og-fonts` entry instead (#99).
|
|
6
6
|
|
package/og-fonts/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bloxwap/hig/og-fonts
|
|
2
2
|
|
|
3
|
-
Version 0.
|
|
3
|
+
Version 0.9.0, an entry of `@bloxwap/hig`. Five static Latin Bloxwap Sans/Mono TTF faces for Open Graph card renderers: Satori, `next/og` `ImageResponse` and `@vercel/og`. Satori reads TTF/OTF but not WOFF2, and `@bloxwap/font` ships only WOFF2.
|
|
4
4
|
|
|
5
5
|
| Face | File | Weight |
|
|
6
6
|
| --- | --- | --- |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bloxwap/hig",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.0",
|
|
4
4
|
"description": "Bloxwap Human Interface Guidelines: tokens, contracts, React and React Native components, chart adapter, feedback and fonts in one package.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -10,6 +10,11 @@
|
|
|
10
10
|
"import": "./tokens/dist/index.js",
|
|
11
11
|
"default": "./tokens/dist/index.js"
|
|
12
12
|
},
|
|
13
|
+
"./tokens/deposit-icons": {
|
|
14
|
+
"types": "./tokens/dist/deposit-icons.d.ts",
|
|
15
|
+
"import": "./tokens/dist/deposit-icons.js",
|
|
16
|
+
"default": "./tokens/dist/deposit-icons.js"
|
|
17
|
+
},
|
|
13
18
|
"./tokens/brand": {
|
|
14
19
|
"types": "./tokens/dist/brand.d.ts",
|
|
15
20
|
"import": "./tokens/dist/brand.js",
|
|
@@ -36,11 +41,41 @@
|
|
|
36
41
|
"import": "./contracts/dist/announcements.js",
|
|
37
42
|
"default": "./contracts/dist/announcements.js"
|
|
38
43
|
},
|
|
44
|
+
"./contracts/number-flow": {
|
|
45
|
+
"types": "./contracts/dist/number-flow.d.ts",
|
|
46
|
+
"import": "./contracts/dist/number-flow.js",
|
|
47
|
+
"default": "./contracts/dist/number-flow.js"
|
|
48
|
+
},
|
|
49
|
+
"./contracts/login": {
|
|
50
|
+
"types": "./contracts/dist/login.d.ts",
|
|
51
|
+
"import": "./contracts/dist/login.js",
|
|
52
|
+
"default": "./contracts/dist/login.js"
|
|
53
|
+
},
|
|
39
54
|
"./contracts/messages": {
|
|
40
55
|
"types": "./contracts/dist/messages.d.ts",
|
|
41
56
|
"import": "./contracts/dist/messages.js",
|
|
42
57
|
"default": "./contracts/dist/messages.js"
|
|
43
58
|
},
|
|
59
|
+
"./contracts/toast": {
|
|
60
|
+
"types": "./contracts/dist/toast.d.ts",
|
|
61
|
+
"import": "./contracts/dist/toast.js",
|
|
62
|
+
"default": "./contracts/dist/toast.js"
|
|
63
|
+
},
|
|
64
|
+
"./contracts/confetti": {
|
|
65
|
+
"types": "./contracts/dist/confetti.d.ts",
|
|
66
|
+
"import": "./contracts/dist/confetti.js",
|
|
67
|
+
"default": "./contracts/dist/confetti.js"
|
|
68
|
+
},
|
|
69
|
+
"./contracts/avatar": {
|
|
70
|
+
"types": "./contracts/dist/avatar.d.ts",
|
|
71
|
+
"import": "./contracts/dist/avatar.js",
|
|
72
|
+
"default": "./contracts/dist/avatar.js"
|
|
73
|
+
},
|
|
74
|
+
"./contracts/qr": {
|
|
75
|
+
"types": "./contracts/dist/qr.d.ts",
|
|
76
|
+
"import": "./contracts/dist/qr.js",
|
|
77
|
+
"default": "./contracts/dist/qr.js"
|
|
78
|
+
},
|
|
44
79
|
"./native-fonts": {
|
|
45
80
|
"types": "./native-fonts/dist/index.d.ts",
|
|
46
81
|
"import": "./native-fonts/dist/index.js",
|
|
@@ -140,6 +175,11 @@
|
|
|
140
175
|
"import": "./react/dist/status.js",
|
|
141
176
|
"default": "./react/dist/status.js"
|
|
142
177
|
},
|
|
178
|
+
"./react/avatar": {
|
|
179
|
+
"types": "./react/dist/avatar.d.ts",
|
|
180
|
+
"import": "./react/dist/avatar.js",
|
|
181
|
+
"default": "./react/dist/avatar.js"
|
|
182
|
+
},
|
|
143
183
|
"./react/toast": {
|
|
144
184
|
"types": "./react/dist/toast.d.ts",
|
|
145
185
|
"import": "./react/dist/toast.js",
|
|
@@ -185,20 +225,25 @@
|
|
|
185
225
|
"import": "./react/dist/blocks/trade-entry.js",
|
|
186
226
|
"default": "./react/dist/blocks/trade-entry.js"
|
|
187
227
|
},
|
|
228
|
+
"./react/blocks/swap-block": {
|
|
229
|
+
"types": "./react/dist/blocks/swap-block.d.ts",
|
|
230
|
+
"import": "./react/dist/blocks/swap-block.js",
|
|
231
|
+
"default": "./react/dist/blocks/swap-block.js"
|
|
232
|
+
},
|
|
188
233
|
"./react/blocks/swap-panel-block": {
|
|
189
|
-
"types": "./react/dist/blocks/swap-
|
|
190
|
-
"import": "./react/dist/blocks/swap-
|
|
191
|
-
"default": "./react/dist/blocks/swap-
|
|
234
|
+
"types": "./react/dist/blocks/swap-block.d.ts",
|
|
235
|
+
"import": "./react/dist/blocks/swap-block.js",
|
|
236
|
+
"default": "./react/dist/blocks/swap-block.js"
|
|
192
237
|
},
|
|
193
238
|
"./react/blocks/swap-panel": {
|
|
194
|
-
"types": "./react/dist/blocks/swap-
|
|
195
|
-
"import": "./react/dist/blocks/swap-
|
|
196
|
-
"default": "./react/dist/blocks/swap-
|
|
239
|
+
"types": "./react/dist/blocks/swap-block.d.ts",
|
|
240
|
+
"import": "./react/dist/blocks/swap-block.js",
|
|
241
|
+
"default": "./react/dist/blocks/swap-block.js"
|
|
197
242
|
},
|
|
198
243
|
"./react/recipes/swap-panel": {
|
|
199
|
-
"types": "./react/dist/blocks/swap-
|
|
200
|
-
"import": "./react/dist/blocks/swap-
|
|
201
|
-
"default": "./react/dist/blocks/swap-
|
|
244
|
+
"types": "./react/dist/blocks/swap-block.d.ts",
|
|
245
|
+
"import": "./react/dist/blocks/swap-block.js",
|
|
246
|
+
"default": "./react/dist/blocks/swap-block.js"
|
|
202
247
|
},
|
|
203
248
|
"./react/blocks/pickers": {
|
|
204
249
|
"types": "./react/dist/blocks/pickers.d.ts",
|
|
@@ -263,6 +308,16 @@
|
|
|
263
308
|
"import": "./react/dist/wallet-address-core.js",
|
|
264
309
|
"default": "./react/dist/wallet-address-core.js"
|
|
265
310
|
},
|
|
311
|
+
"./react/qr-code": {
|
|
312
|
+
"types": "./react/dist/qr-code.d.ts",
|
|
313
|
+
"import": "./react/dist/qr-code.js",
|
|
314
|
+
"default": "./react/dist/qr-code.js"
|
|
315
|
+
},
|
|
316
|
+
"./native/qr-code": {
|
|
317
|
+
"types": "./native/dist/qr-code.d.ts",
|
|
318
|
+
"import": "./native/dist/qr-code.js",
|
|
319
|
+
"default": "./native/dist/qr-code.js"
|
|
320
|
+
},
|
|
266
321
|
"./react/asset-balance-row": {
|
|
267
322
|
"types": "./react/dist/asset-balance-row.d.ts",
|
|
268
323
|
"import": "./react/dist/asset-balance-row.js",
|
|
@@ -278,6 +333,16 @@
|
|
|
278
333
|
"import": "./react/dist/blocks/token-action-block.js",
|
|
279
334
|
"default": "./react/dist/blocks/token-action-block.js"
|
|
280
335
|
},
|
|
336
|
+
"./react/blocks/login-block": {
|
|
337
|
+
"types": "./react/dist/blocks/login-block.d.ts",
|
|
338
|
+
"import": "./react/dist/blocks/login-block.js",
|
|
339
|
+
"default": "./react/dist/blocks/login-block.js"
|
|
340
|
+
},
|
|
341
|
+
"./react/blocks/deposit-block": {
|
|
342
|
+
"types": "./react/dist/blocks/deposit-block.d.ts",
|
|
343
|
+
"import": "./react/dist/blocks/deposit-block.js",
|
|
344
|
+
"default": "./react/dist/blocks/deposit-block.js"
|
|
345
|
+
},
|
|
281
346
|
"./react/blocks/language-block": {
|
|
282
347
|
"types": "./react/dist/blocks/language-block.d.ts",
|
|
283
348
|
"import": "./react/dist/blocks/language-block.js",
|
|
@@ -333,6 +398,51 @@
|
|
|
333
398
|
"import": "./react/dist/blocks/profile-block.js",
|
|
334
399
|
"default": "./react/dist/blocks/profile-block.js"
|
|
335
400
|
},
|
|
401
|
+
"./react/blocks/confirm-block": {
|
|
402
|
+
"types": "./react/dist/blocks/confirm-block.d.ts",
|
|
403
|
+
"import": "./react/dist/blocks/confirm-block.js",
|
|
404
|
+
"default": "./react/dist/blocks/confirm-block.js"
|
|
405
|
+
},
|
|
406
|
+
"./native/confirm-block": {
|
|
407
|
+
"types": "./native/dist/confirm-block.d.ts",
|
|
408
|
+
"import": "./native/dist/confirm-block.js",
|
|
409
|
+
"default": "./native/dist/confirm-block.js"
|
|
410
|
+
},
|
|
411
|
+
"./react/blocks/preset-picker-block": {
|
|
412
|
+
"types": "./react/dist/blocks/preset-picker-block.d.ts",
|
|
413
|
+
"import": "./react/dist/blocks/preset-picker-block.js",
|
|
414
|
+
"default": "./react/dist/blocks/preset-picker-block.js"
|
|
415
|
+
},
|
|
416
|
+
"./native/preset-picker-block": {
|
|
417
|
+
"types": "./native/dist/preset-picker-block.d.ts",
|
|
418
|
+
"import": "./native/dist/preset-picker-block.js",
|
|
419
|
+
"default": "./native/dist/preset-picker-block.js"
|
|
420
|
+
},
|
|
421
|
+
"./react/blocks/explainer-block": {
|
|
422
|
+
"types": "./react/dist/blocks/explainer-block.d.ts",
|
|
423
|
+
"import": "./react/dist/blocks/explainer-block.js",
|
|
424
|
+
"default": "./react/dist/blocks/explainer-block.js"
|
|
425
|
+
},
|
|
426
|
+
"./native/explainer-block": {
|
|
427
|
+
"types": "./native/dist/explainer-block.d.ts",
|
|
428
|
+
"import": "./native/dist/explainer-block.js",
|
|
429
|
+
"default": "./native/dist/explainer-block.js"
|
|
430
|
+
},
|
|
431
|
+
"./react/confetti": {
|
|
432
|
+
"types": "./react/dist/confetti.d.ts",
|
|
433
|
+
"import": "./react/dist/confetti.js",
|
|
434
|
+
"default": "./react/dist/confetti.js"
|
|
435
|
+
},
|
|
436
|
+
"./native/confetti": {
|
|
437
|
+
"types": "./native/dist/confetti.d.ts",
|
|
438
|
+
"import": "./native/dist/confetti.js",
|
|
439
|
+
"default": "./native/dist/confetti.js"
|
|
440
|
+
},
|
|
441
|
+
"./react/blocks/assets-block": {
|
|
442
|
+
"types": "./react/dist/blocks/assets-block.d.ts",
|
|
443
|
+
"import": "./react/dist/blocks/assets-block.js",
|
|
444
|
+
"default": "./react/dist/blocks/assets-block.js"
|
|
445
|
+
},
|
|
336
446
|
"./react/blocks/screen-header": {
|
|
337
447
|
"types": "./react/dist/blocks/screen-header.d.ts",
|
|
338
448
|
"import": "./react/dist/blocks/screen-header.js",
|
|
@@ -388,6 +498,16 @@
|
|
|
388
498
|
"import": "./native/dist/token-action-block.js",
|
|
389
499
|
"default": "./native/dist/token-action-block.js"
|
|
390
500
|
},
|
|
501
|
+
"./native/login-block": {
|
|
502
|
+
"types": "./native/dist/login-block.d.ts",
|
|
503
|
+
"import": "./native/dist/login-block.js",
|
|
504
|
+
"default": "./native/dist/login-block.js"
|
|
505
|
+
},
|
|
506
|
+
"./native/deposit-block": {
|
|
507
|
+
"types": "./native/dist/deposit-block.d.ts",
|
|
508
|
+
"import": "./native/dist/deposit-block.js",
|
|
509
|
+
"default": "./native/dist/deposit-block.js"
|
|
510
|
+
},
|
|
391
511
|
"./native/language-block": {
|
|
392
512
|
"types": "./native/dist/language-block.d.ts",
|
|
393
513
|
"import": "./native/dist/language-block.js",
|
|
@@ -443,6 +563,11 @@
|
|
|
443
563
|
"import": "./native/dist/profile-block.js",
|
|
444
564
|
"default": "./native/dist/profile-block.js"
|
|
445
565
|
},
|
|
566
|
+
"./native/assets-block": {
|
|
567
|
+
"types": "./native/dist/assets-block.d.ts",
|
|
568
|
+
"import": "./native/dist/assets-block.js",
|
|
569
|
+
"default": "./native/dist/assets-block.js"
|
|
570
|
+
},
|
|
446
571
|
"./native/screen-header": {
|
|
447
572
|
"types": "./native/dist/screen-header.d.ts",
|
|
448
573
|
"import": "./native/dist/screen-header.js",
|
|
@@ -513,6 +638,11 @@
|
|
|
513
638
|
"import": "./native/dist/status.js",
|
|
514
639
|
"default": "./native/dist/status.js"
|
|
515
640
|
},
|
|
641
|
+
"./native/avatar": {
|
|
642
|
+
"types": "./native/dist/avatar.d.ts",
|
|
643
|
+
"import": "./native/dist/avatar.js",
|
|
644
|
+
"default": "./native/dist/avatar.js"
|
|
645
|
+
},
|
|
516
646
|
"./native/data": {
|
|
517
647
|
"types": "./native/dist/data.d.ts",
|
|
518
648
|
"import": "./native/dist/data.js",
|
|
@@ -568,11 +698,21 @@
|
|
|
568
698
|
"import": "./native/dist/gesture-sheet.js",
|
|
569
699
|
"default": "./native/dist/gesture-sheet.js"
|
|
570
700
|
},
|
|
701
|
+
"./native/gesture-sheet-next": {
|
|
702
|
+
"types": "./native/dist/gesture-sheet-next.d.ts",
|
|
703
|
+
"import": "./native/dist/gesture-sheet-next.js",
|
|
704
|
+
"default": "./native/dist/gesture-sheet-next.js"
|
|
705
|
+
},
|
|
571
706
|
"./native/animated-number": {
|
|
572
707
|
"types": "./native/dist/animated-number.d.ts",
|
|
573
708
|
"import": "./native/dist/animated-number.js",
|
|
574
709
|
"default": "./native/dist/animated-number.js"
|
|
575
710
|
},
|
|
711
|
+
"./native/toast": {
|
|
712
|
+
"types": "./native/dist/toast.d.ts",
|
|
713
|
+
"import": "./native/dist/toast.js",
|
|
714
|
+
"default": "./native/dist/toast.js"
|
|
715
|
+
},
|
|
576
716
|
"./package.json": "./package.json"
|
|
577
717
|
},
|
|
578
718
|
"files": [
|
|
@@ -628,7 +768,8 @@
|
|
|
628
768
|
"@gorhom/bottom-sheet": "^5.2.14",
|
|
629
769
|
"react-native-reanimated": "^4.1.1",
|
|
630
770
|
"react-native-worklets": "^0.5.1 || ^0.7.4 || ^0.13.0",
|
|
631
|
-
"react-native-gesture-handler": "^2.28.0 || ^3.3.0"
|
|
771
|
+
"react-native-gesture-handler": "^2.28.0 || ^3.3.0",
|
|
772
|
+
"@bloxwap/icons": "^0.1.0"
|
|
632
773
|
},
|
|
633
774
|
"peerDependenciesMeta": {
|
|
634
775
|
"react": {
|
|
@@ -693,6 +834,9 @@
|
|
|
693
834
|
},
|
|
694
835
|
"react-native-gesture-handler": {
|
|
695
836
|
"optional": true
|
|
837
|
+
},
|
|
838
|
+
"@bloxwap/icons": {
|
|
839
|
+
"optional": true
|
|
696
840
|
}
|
|
697
841
|
},
|
|
698
842
|
"repository": {
|
package/react/README.md
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
# @bloxwap/hig/react
|
|
2
2
|
|
|
3
|
-
Version 0.
|
|
3
|
+
Version 0.9.0, an entry of `@bloxwap/hig`. Import individual entries; see docs/components for platform and accessibility contracts.
|
|
4
|
+
|
|
5
|
+
UI symbols come from `@bloxwap/icons` (install `@bloxwap/icons@^0.1.0`). The web entry renders inline SVG and imports individual icon modules.
|
|
4
6
|
|
|
5
7
|
Set a brand accent with `<HIGProvider primaryColor='#ff0000'>` from
|
|
6
8
|
`@bloxwap/hig/react/provider`. It accepts opaque sRGB hex (`#RGB` or `#RRGGBB`),
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { type NumberFlowTimings } from '@bloxwap/hig/contracts/number-flow';
|
|
2
|
+
/** One timing as the Web Animations API takes it. `fallback` is the curve for a browser without `linear()`. */
|
|
3
|
+
export interface NumberFlowWebTiming {
|
|
4
|
+
duration: number;
|
|
5
|
+
easing: string;
|
|
6
|
+
fallback: string;
|
|
7
|
+
}
|
|
8
|
+
export interface NumberFlowWebMotion {
|
|
9
|
+
spin: NumberFlowWebTiming;
|
|
10
|
+
transform: NumberFlowWebTiming;
|
|
11
|
+
opacity: NumberFlowWebTiming;
|
|
12
|
+
}
|
|
13
|
+
/** One place's turn: how many glyphs, around a reel of what length, starting from which digit when the place is not already turning. */
|
|
14
|
+
export interface NumberFlowSpin {
|
|
15
|
+
delta: number;
|
|
16
|
+
length: number;
|
|
17
|
+
from: number;
|
|
18
|
+
}
|
|
19
|
+
export declare function numberFlowWebMotion(timings: NumberFlowTimings): NumberFlowWebMotion;
|
|
20
|
+
export declare const numberFlowCommit: {
|
|
21
|
+
/** A figure will read and write in the commit that is starting. */
|
|
22
|
+
expect(): void;
|
|
23
|
+
/** That figure has read all it needs: the last one to say so writes for all of them. */
|
|
24
|
+
done(): void;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* NumberFlow's motion over elements React drew. React owns the final text of every part; this adds what moves, and removes it
|
|
28
|
+
* when it lands, so nothing here survives into a render:
|
|
29
|
+
* - a window over a turning place and, inside it, a strip of glyphs that rolls through every digit between the old and the new;
|
|
30
|
+
* - a sideways slide for each part whose position changed (first, last, invert, play), so a figure that gains or loses a
|
|
31
|
+
* place closes up instead of jumping;
|
|
32
|
+
* - a fade for parts that arrive, and a fading copy of each part that left;
|
|
33
|
+
* - a clip on the digits (first digit to last, with the separators between) that travels from their old edges to their new
|
|
34
|
+
* ones, so a place arriving or leaving passes under the edge rather than over the sign or the text beside it.
|
|
35
|
+
* A roll or a slide that joins another in flight on the same element is an additive animation on `transform`, so a new value
|
|
36
|
+
* joins the motion instead of restarting it. After the commit that starts it there is no script and no layout per frame.
|
|
37
|
+
* Chromium does not hand an additive animation to its compositor, though: it runs on the main thread, one style recalculation
|
|
38
|
+
* a frame for the parts that move (55 for one 900 ms roll against 6 for a plain one), so a movement that is alone on its
|
|
39
|
+
* element, which is most of them, is written as a plain animation instead (see `retimable`). Fades animate `opacity`, and
|
|
40
|
+
* the clip animates `clip-path` only while the figure changes width.
|
|
41
|
+
*/
|
|
42
|
+
export declare class NumberFlowEngine {
|
|
43
|
+
private root;
|
|
44
|
+
private before;
|
|
45
|
+
private extent;
|
|
46
|
+
private clip;
|
|
47
|
+
private readonly reels;
|
|
48
|
+
private readonly slides;
|
|
49
|
+
private readonly running;
|
|
50
|
+
private readonly fades;
|
|
51
|
+
private ghosts;
|
|
52
|
+
private epoch;
|
|
53
|
+
/** The element holding the parts. Fading copies are drawn in the empty layers React left in it: one inside the digits, clipped with them, and one for the signs and affixes around them. */
|
|
54
|
+
attach(root: HTMLElement | null): void;
|
|
55
|
+
/** Whether anything is still moving. */
|
|
56
|
+
get busy(): boolean;
|
|
57
|
+
/** First: where every part is now, read before the commit that changes them. */
|
|
58
|
+
measure(): void;
|
|
59
|
+
/** Last, invert, play: slide every part from where it was, fade in what arrived and fade out a copy of what left. Does nothing without a `measure` since the last call. */
|
|
60
|
+
flip(motion: NumberFlowWebMotion): void;
|
|
61
|
+
/** Turn the places whose digits changed. `glyphs` are the ten digits of the reading's numbering system, zero first. */
|
|
62
|
+
spin(spins: ReadonlyMap<string, NumberFlowSpin>, glyphs: readonly string[], timing: NumberFlowWebTiming): void;
|
|
63
|
+
/** Stop everything where it is going: the parts are left exactly as React drew them. */
|
|
64
|
+
cancel(): void;
|
|
65
|
+
/** Writes now, or with the rest of the commit when other figures are still to read. A `cancel` in between drops it. */
|
|
66
|
+
private write;
|
|
67
|
+
/** Makes room on an element for another movement: one in flight alone becomes its additive twin, where it is and on the same clock. Returns what is still in flight. */
|
|
68
|
+
private join;
|
|
69
|
+
private stop;
|
|
70
|
+
private settle;
|
|
71
|
+
private play;
|
|
72
|
+
}
|