@bloxwap/hig 0.5.2 → 0.7.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 +1 -1
- package/chart/README.md +1 -1
- package/contracts/README.md +1 -1
- package/contracts/dist/index.d.ts +16 -0
- package/contracts/dist/index.js +22 -0
- package/contracts/dist/messages.d.ts +37 -4
- package/contracts/dist/messages.js +13 -2
- package/feedback/README.md +1 -1
- package/native/README.md +1 -1
- package/native/dist/account-block.d.ts +92 -0
- package/native/dist/account-block.js +61 -0
- package/native/dist/animated-number-model.d.ts +7 -1
- package/native/dist/animated-number-model.js +50 -1
- package/native/dist/animated-number.d.ts +3 -1
- package/native/dist/animated-number.js +8 -5
- package/native/dist/asset-balance-row.d.ts +36 -0
- package/native/dist/asset-balance-row.js +26 -0
- package/native/dist/bar-mark.d.ts +57 -0
- package/native/dist/bar-mark.js +48 -0
- package/native/dist/bar-pnl.d.ts +50 -0
- package/native/dist/bar-pnl.js +60 -0
- package/native/dist/blocks.d.ts +38 -0
- package/native/dist/blocks.js +42 -0
- package/native/dist/button.js +3 -1
- package/native/dist/data.d.ts +1 -1
- package/native/dist/data.js +6 -4
- package/native/dist/field.d.ts +14 -5
- package/native/dist/field.js +33 -8
- package/native/dist/figure.d.ts +23 -0
- package/native/dist/figure.js +10 -0
- package/native/dist/icons.d.ts +8 -0
- package/native/dist/icons.js +4 -0
- package/native/dist/language-block.d.ts +35 -0
- package/native/dist/language-block.js +30 -0
- package/native/dist/list-group.d.ts +60 -0
- package/native/dist/list-group.js +85 -0
- package/native/dist/manage-position-block.d.ts +95 -0
- package/native/dist/manage-position-block.js +82 -0
- package/native/dist/market-row.d.ts +46 -0
- package/native/dist/market-row.js +30 -0
- package/native/dist/notifications-block.d.ts +53 -0
- package/native/dist/notifications-block.js +22 -0
- package/native/dist/pickers.d.ts +35 -5
- package/native/dist/pickers.js +21 -9
- package/native/dist/position-block.d.ts +107 -0
- package/native/dist/position-block.js +55 -0
- package/native/dist/profile-block.d.ts +66 -0
- package/native/dist/profile-block.js +48 -0
- package/native/dist/provider.d.ts +9 -3
- package/native/dist/provider.js +7 -3
- package/native/dist/radio-group.d.ts +9 -3
- package/native/dist/radio-group.js +4 -5
- package/native/dist/recipes.d.ts +6 -46
- package/native/dist/recipes.js +6 -33
- package/native/dist/reward-block.d.ts +122 -0
- package/native/dist/reward-block.js +53 -0
- package/native/dist/screen-header.d.ts +49 -0
- package/native/dist/screen-header.js +29 -0
- package/native/dist/selection.d.ts +2 -2
- package/native/dist/setting-header.d.ts +2 -0
- package/native/dist/setting-header.js +2 -0
- package/native/dist/setting-switch.d.ts +31 -0
- package/native/dist/setting-switch.js +20 -0
- package/native/dist/signals-block.d.ts +61 -0
- package/native/dist/signals-block.js +26 -0
- package/native/dist/sound-haptics-block.d.ts +66 -0
- package/native/dist/sound-haptics-block.js +32 -0
- package/native/dist/status.d.ts +6 -5
- package/native/dist/status.js +5 -5
- package/native/dist/sticky-header.d.ts +28 -0
- package/native/dist/sticky-header.js +21 -0
- package/native/dist/surface.d.ts +3 -1
- package/native/dist/surface.js +2 -1
- package/native/dist/{swap-panel.d.ts → swap-panel-block.d.ts} +8 -3
- package/native/dist/{swap-panel.js → swap-panel-block.js} +13 -8
- package/native/dist/swap-parts.d.ts +5 -3
- package/native/dist/swap-parts.js +2 -2
- package/native/dist/swap-shared.d.ts +6 -0
- package/native/dist/swap-sheet.d.ts +4 -4
- package/native/dist/swap-sheet.js +4 -4
- package/native/dist/swap-views.d.ts +1 -1
- package/native/dist/swap-views.js +9 -7
- package/native/dist/switch-row.d.ts +3 -2
- package/native/dist/switch-row.js +5 -3
- package/native/dist/switch.d.ts +4 -2
- package/native/dist/switch.js +3 -3
- package/native/dist/target-block.d.ts +110 -0
- package/native/dist/target-block.js +74 -0
- package/native/dist/token-action-block.d.ts +47 -0
- package/native/dist/token-action-block.js +28 -0
- package/native/dist/trade-history-detail-block.d.ts +84 -0
- package/native/dist/trade-history-detail-block.js +46 -0
- package/native/dist/trade-history-list-block.d.ts +110 -0
- package/native/dist/trade-history-list-block.js +64 -0
- package/native/dist/wallet-address-core.d.ts +25 -0
- package/native/dist/wallet-address-core.js +31 -0
- package/native/dist/wallet-address.d.ts +6 -10
- package/native/dist/wallet-address.js +16 -20
- package/native-fonts/README.md +1 -1
- package/og-fonts/README.md +1 -1
- package/package.json +266 -41
- package/react/README.md +1 -1
- package/react/dist/animated-number-model.d.ts +6 -0
- package/react/dist/animated-number-model.js +33 -0
- package/react/dist/animated-number.d.ts +5 -1
- package/react/dist/animated-number.js +12 -8
- package/react/dist/asset-balance-row.d.ts +35 -0
- package/react/dist/asset-balance-row.js +18 -0
- package/react/dist/bar-mark.d.ts +38 -0
- package/react/dist/bar-mark.js +23 -0
- package/react/dist/bar-pnl.d.ts +49 -0
- package/react/dist/bar-pnl.js +45 -0
- package/react/dist/blocks/account-block.d.ts +92 -0
- package/react/dist/blocks/account-block.js +62 -0
- package/react/dist/blocks/language-block.d.ts +36 -0
- package/react/dist/blocks/language-block.js +52 -0
- package/react/dist/blocks/manage-position-block.d.ts +93 -0
- package/react/dist/blocks/manage-position-block.js +47 -0
- package/react/dist/blocks/market-row.d.ts +36 -0
- package/react/dist/blocks/market-row.js +16 -0
- package/react/dist/blocks/notifications-block.d.ts +46 -0
- package/react/dist/blocks/notifications-block.js +17 -0
- package/react/dist/{recipes → blocks}/pickers.d.ts +32 -4
- package/react/dist/{recipes → blocks}/pickers.js +35 -11
- package/react/dist/blocks/position-block.d.ts +72 -0
- package/react/dist/blocks/position-block.js +25 -0
- package/react/dist/blocks/profile-block.d.ts +71 -0
- package/react/dist/blocks/profile-block.js +41 -0
- package/react/dist/blocks/reward-block.d.ts +120 -0
- package/react/dist/blocks/reward-block.js +34 -0
- package/react/dist/blocks/screen-header.d.ts +33 -0
- package/react/dist/blocks/screen-header.js +20 -0
- package/react/dist/blocks/setting-switch.d.ts +23 -0
- package/react/dist/blocks/setting-switch.js +12 -0
- package/react/dist/blocks/signals-block.d.ts +54 -0
- package/react/dist/blocks/signals-block.js +15 -0
- package/react/dist/blocks/sound-haptics-block.d.ts +59 -0
- package/react/dist/blocks/sound-haptics-block.js +22 -0
- package/react/dist/blocks/sticky-header.d.ts +9 -0
- package/react/dist/blocks/sticky-header.js +43 -0
- package/react/dist/blocks/swap/amount-card.js +8 -0
- package/react/dist/{recipes → blocks}/swap/picker.d.ts +1 -1
- package/react/dist/{recipes → blocks}/swap/picker.js +4 -4
- package/react/dist/{recipes → blocks}/swap/settings.js +2 -2
- package/react/dist/{recipes → blocks}/swap/shared.d.ts +8 -1
- package/react/dist/{recipes → blocks}/swap/shared.js +7 -4
- package/react/dist/{recipes/swap-panel.d.ts → blocks/swap-panel-block.d.ts} +8 -2
- package/react/dist/{recipes/swap-panel.js → blocks/swap-panel-block.js} +9 -7
- package/react/dist/{recipes → blocks}/swap-sheet.d.ts +4 -4
- package/react/dist/{recipes → blocks}/swap-sheet.js +4 -4
- package/react/dist/blocks/target-block.d.ts +103 -0
- package/react/dist/blocks/target-block.js +73 -0
- package/react/dist/blocks/token-action-block.d.ts +46 -0
- package/react/dist/blocks/token-action-block.js +21 -0
- package/react/dist/{recipes → blocks}/trade-entry.js +2 -2
- package/react/dist/blocks/trade-history-detail-block.d.ts +78 -0
- package/react/dist/blocks/trade-history-detail-block.js +17 -0
- package/react/dist/blocks/trade-history-list-block.d.ts +67 -0
- package/react/dist/blocks/trade-history-list-block.js +28 -0
- package/react/dist/blocks.d.ts +20 -0
- package/react/dist/blocks.js +21 -0
- package/react/dist/button.js +6 -4
- package/react/dist/data.js +3 -3
- package/react/dist/field.d.ts +14 -6
- package/react/dist/field.js +19 -8
- package/react/dist/figure.d.ts +23 -0
- package/react/dist/figure.js +12 -0
- package/react/dist/list-group.d.ts +59 -0
- package/react/dist/list-group.js +52 -0
- package/react/dist/provider.d.ts +40 -3
- package/react/dist/provider.js +63 -6
- package/react/dist/selection.d.ts +8 -2
- package/react/dist/selection.js +11 -6
- package/react/dist/styles.css +425 -5
- package/react/dist/surface.d.ts +5 -1
- package/react/dist/surface.js +1 -1
- package/react/dist/wallet-address-core.d.ts +23 -0
- package/react/dist/wallet-address-core.js +24 -0
- package/react/dist/wallet-address.d.ts +6 -12
- package/react/dist/wallet-address.js +5 -16
- package/tokens/README.md +1 -1
- package/react/dist/recipes/activity-list.d.ts +0 -8
- package/react/dist/recipes/activity-list.js +0 -6
- package/react/dist/recipes/balance-card.d.ts +0 -6
- package/react/dist/recipes/balance-card.js +0 -5
- package/react/dist/recipes/code-window.d.ts +0 -4
- package/react/dist/recipes/code-window.js +0 -4
- package/react/dist/recipes/market-row.d.ts +0 -25
- package/react/dist/recipes/market-row.js +0 -8
- package/react/dist/recipes/swap/amount-card.js +0 -7
- package/react/dist/recipes.d.ts +0 -10
- package/react/dist/recipes.js +0 -11
- /package/react/dist/{recipes → blocks}/install-command.d.ts +0 -0
- /package/react/dist/{recipes → blocks}/install-command.js +0 -0
- /package/react/dist/{recipes → blocks}/marketing-hero.d.ts +0 -0
- /package/react/dist/{recipes → blocks}/marketing-hero.js +0 -0
- /package/react/dist/{recipes → blocks}/swap/amount-card.d.ts +0 -0
- /package/react/dist/{recipes → blocks}/swap/settings.d.ts +0 -0
- /package/react/dist/{recipes → blocks}/trade-entry.d.ts +0 -0
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
+
import { useState } from 'react';
|
|
4
|
+
import * as en from '@bloxwap/hig/contracts/messages';
|
|
5
|
+
import { PressDecoration, useHIG } from './provider.js';
|
|
6
|
+
import { VerticalAddress, addressKind, addressRows } from './data.js';
|
|
7
|
+
import { notify } from './notify.js';
|
|
8
|
+
export { VerticalAddress, addressKind } from './data.js';
|
|
9
|
+
/**
|
|
10
|
+
* `WalletAddress` without the QR encoder: the host passes the code as `qr`, so the optional `cuer` peer is not needed.
|
|
11
|
+
* The address column, the copy button, its hint and the notice are the same as `WalletAddress` from `wallet-address`.
|
|
12
|
+
*/
|
|
13
|
+
export function WalletAddress({ address, kind, qr, size = 196, onCopy, announce = true, className, style }) {
|
|
14
|
+
const { messages } = useHIG();
|
|
15
|
+
const [status, setStatus] = useState('');
|
|
16
|
+
const rows = addressRows(address, kind ?? addressKind(address)).length;
|
|
17
|
+
const copy = () => { Promise.resolve().then(onCopy).then(() => { if (!announce)
|
|
18
|
+
return; const text = messages.addressCopied ?? en.addressCopied; setStatus(notify(text, { severity: 'success', id: 'hig-wallet-address', dismissName: (messages.dismissNotice ?? en.dismissNotice)(text, messages.dismiss ?? en.dismiss) }) ? '' : text); }).catch(() => setStatus('')); };
|
|
19
|
+
const body = _jsxs(_Fragment, { children: [_jsxs("span", { className: 'hig-wallet-address-body', children: [_jsx("span", { className: 'hig-wallet-address-qr', role: 'img', "aria-label": messages.qrCode ?? en.qrCode, children: qr }), _jsx(VerticalAddress, { address: address, kind: kind, rowHeight: size / rows })] }), onCopy && _jsxs("span", { className: 'hig-wallet-address-hint', children: [_jsxs("svg", { "aria-hidden": 'true', focusable: 'false', viewBox: '0 0 20 20', children: [_jsx("rect", { x: '7', y: '7', width: '9.5', height: '9.5', rx: '2' }), _jsx("path", { d: 'M4.5 13H4a1.5 1.5 0 0 1-1.5-1.5V5A1.5 1.5 0 0 1 4 3.5h6.5A1.5 1.5 0 0 1 12 5v.5' })] }), messages.tapToCopy ?? en.tapToCopy] })] });
|
|
20
|
+
const shared = { className: `hig-wallet-address${className ? ` ${className}` : ''}`, style: { '--hig-qr': `${size}px`, ...style } };
|
|
21
|
+
return onCopy
|
|
22
|
+
? _jsxs(_Fragment, { children: [_jsxs("button", { type: 'button', ...shared, "aria-label": (messages.copyAddress ?? en.copyAddress) + ': ' + address, onClick: copy, children: [body, _jsx(PressDecoration, { kind: 'row' })] }), announce && _jsx("span", { className: 'hig-sr-only', role: 'status', children: status })] })
|
|
23
|
+
: _jsx("div", { ...shared, children: body });
|
|
24
|
+
}
|
|
@@ -1,23 +1,17 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { type
|
|
2
|
+
import { type WalletAddressCoreProps } from './wallet-address-core.js';
|
|
3
3
|
export { VerticalAddress, addressKind, type AddressKind } from './data.js';
|
|
4
|
-
export
|
|
5
|
-
|
|
6
|
-
/** Row layout; inferred from the address when omitted (`0x…` is Ethereum-style). */
|
|
7
|
-
kind?: AddressKind;
|
|
4
|
+
export type { WalletAddressCoreProps } from './wallet-address-core.js';
|
|
5
|
+
export interface WalletAddressProps extends Omit<WalletAddressCoreProps, 'qr'> {
|
|
8
6
|
/** QR payload when it differs from the address, for example an EIP-681 or Solana Pay URI. Defaults to the address. */
|
|
9
7
|
qrValue?: string;
|
|
10
8
|
/** Image URL shown in the centre of the QR; the code then uses high error correction. */
|
|
11
9
|
arena?: string;
|
|
12
|
-
/** QR
|
|
13
|
-
|
|
14
|
-
/** Host clipboard adapter. When set the whole component is one button that copies the address and shows the Tap to copy hint. */
|
|
15
|
-
onCopy?: () => Promise<void> | void;
|
|
16
|
-
className?: string;
|
|
17
|
-
style?: React.CSSProperties;
|
|
10
|
+
/** The host's own QR drawing in place of the Cuer code; `qrValue` and `arena` are then unused. Without `cuer` installed, import `WalletAddress` from `wallet-address-core` instead. */
|
|
11
|
+
qr?: React.ReactNode;
|
|
18
12
|
}
|
|
19
13
|
/**
|
|
20
14
|
* A wallet address to scan or copy: a Cuer QR code beside the address in HIG's vertical style, for Ethereum-style and
|
|
21
15
|
* Solana addresses. Needs the optional `cuer` peer. The host owns the clipboard through `onCopy`.
|
|
22
16
|
*/
|
|
23
|
-
export declare function WalletAddress({
|
|
17
|
+
export declare function WalletAddress({ qrValue, arena, qr, ...props }: WalletAddressProps): React.JSX.Element;
|
|
@@ -1,24 +1,13 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import {
|
|
3
|
-
import { useState } from 'react';
|
|
2
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
4
3
|
import { Cuer } from 'cuer';
|
|
5
|
-
import
|
|
6
|
-
import { useHIG } from './provider.js';
|
|
7
|
-
import { VerticalAddress, addressKind, addressRows } from './data.js';
|
|
8
|
-
import { notify } from './notify.js';
|
|
4
|
+
import { WalletAddress as WalletAddressCore } from './wallet-address-core.js';
|
|
9
5
|
export { VerticalAddress, addressKind } from './data.js';
|
|
10
6
|
/**
|
|
11
7
|
* A wallet address to scan or copy: a Cuer QR code beside the address in HIG's vertical style, for Ethereum-style and
|
|
12
8
|
* Solana addresses. Needs the optional `cuer` peer. The host owns the clipboard through `onCopy`.
|
|
13
9
|
*/
|
|
14
|
-
export function WalletAddress({
|
|
15
|
-
const {
|
|
16
|
-
|
|
17
|
-
const rows = addressRows(address, kind ?? addressKind(address)).length;
|
|
18
|
-
const copy = () => { Promise.resolve().then(onCopy).then(() => { const text = messages.addressCopied ?? en.addressCopied; setStatus(notify(text, { severity: 'success', id: 'hig-wallet-address', dismissName: (messages.dismissNotice ?? en.dismissNotice)(text, messages.dismiss ?? en.dismiss) }) ? '' : text); }).catch(() => setStatus('')); };
|
|
19
|
-
const body = _jsxs(_Fragment, { children: [_jsxs("span", { className: 'hig-wallet-address-body', children: [_jsx("span", { className: 'hig-wallet-address-qr', role: 'img', "aria-label": messages.qrCode ?? en.qrCode, children: _jsxs(Cuer.Root, { value: qrValue ?? address, errorCorrection: arena ? 'high' : 'medium', color: 'currentColor', "aria-hidden": 'true', children: [_jsx(Cuer.Finder, {}), _jsx(Cuer.Cells, {}), arena && _jsx(Cuer.Arena, { children: _jsx("img", { src: arena, alt: '', style: { width: '100%', height: '100%', objectFit: 'cover', borderRadius: 1 } }) })] }) }), _jsx(VerticalAddress, { address: address, kind: kind, rowHeight: size / rows })] }), onCopy && _jsxs("span", { className: 'hig-wallet-address-hint', children: [_jsxs("svg", { "aria-hidden": 'true', focusable: 'false', viewBox: '0 0 20 20', children: [_jsx("rect", { x: '7', y: '7', width: '9.5', height: '9.5', rx: '2' }), _jsx("path", { d: 'M4.5 13H4a1.5 1.5 0 0 1-1.5-1.5V5A1.5 1.5 0 0 1 4 3.5h6.5A1.5 1.5 0 0 1 12 5v.5' })] }), messages.tapToCopy ?? en.tapToCopy] })] });
|
|
20
|
-
const shared = { className: `hig-wallet-address${className ? ` ${className}` : ''}`, style: { '--hig-qr': `${size}px`, ...style } };
|
|
21
|
-
return onCopy
|
|
22
|
-
? _jsxs(_Fragment, { children: [_jsx("button", { type: 'button', ...shared, "aria-label": (messages.copyAddress ?? en.copyAddress) + ': ' + address, onClick: copy, children: body }), _jsx("span", { className: 'hig-sr-only', role: 'status', children: status })] })
|
|
23
|
-
: _jsx("div", { ...shared, children: body });
|
|
10
|
+
export function WalletAddress({ qrValue, arena, qr, ...props }) {
|
|
11
|
+
const code = qr ?? _jsxs(Cuer.Root, { value: qrValue ?? props.address, errorCorrection: arena ? 'high' : 'medium', color: 'currentColor', "aria-hidden": 'true', children: [_jsx(Cuer.Finder, {}), _jsx(Cuer.Cells, {}), arena && _jsx(Cuer.Arena, { children: _jsx("img", { src: arena, alt: '', style: { width: '100%', height: '100%', objectFit: 'cover', borderRadius: 1 } }) })] });
|
|
12
|
+
return _jsx(WalletAddressCore, { ...props, qr: code });
|
|
24
13
|
}
|
package/tokens/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @bloxwap/hig/tokens
|
|
2
2
|
|
|
3
|
-
Version 0.
|
|
3
|
+
Version 0.7.0, an entry of `@bloxwap/hig`. See the HIG architecture and platform limitations before adoption.
|
|
4
4
|
|
|
5
5
|
`resolvePrimaryColor('#ff0000')` resolves a custom brand's `action`, `focus`, and
|
|
6
6
|
`onAction` roles. Input is opaque sRGB hex (`#RGB` or `#RRGGBB`); the foreground
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import * as en from '@bloxwap/hig/contracts/messages';
|
|
4
|
-
import { useHIG } from '../provider.js';
|
|
5
|
-
import { Text } from '../surface.js';
|
|
6
|
-
export function ActivityList({ items }) { const { messages } = useHIG(); return items.length ? _jsx("ul", { children: items.map(i => _jsxs("li", { children: [_jsx("strong", { children: i.label }), " \u2014 ", i.status] }, i.id)) }) : _jsx(Text, { children: messages.noActivity ?? en.noActivity }); }
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Surface, Text } from '../surface.js';
|
|
4
|
-
import { Usd } from '../data.js';
|
|
5
|
-
export function BalanceCard({ label, balance, stale }) { return _jsxs(Surface, { className: 'hig-balance-card', children: [_jsx(Text, { children: label }), _jsx(Usd, { value: balance, stale: stale })] }); }
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Surface, Text } from '../surface.js';
|
|
4
|
-
export function CodeWindow({ language, children }) { return _jsxs(Surface, { children: [_jsx(Text, { children: language }), _jsx("pre", { className: 'hig-code', tabIndex: 0, children: _jsx("code", { children: children }) })] }); }
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
interface MarketRowContent {
|
|
3
|
-
symbol: string;
|
|
4
|
-
name: string;
|
|
5
|
-
price: number | null;
|
|
6
|
-
change: number | null; /** Intl display options, including a decimal style when the host omits a currency symbol. */
|
|
7
|
-
priceOptions?: Intl.NumberFormatOptions; /** Percent-point display precision/sign; forwarded to Percent. */
|
|
8
|
-
changeOptions?: Intl.NumberFormatOptions; /** Optional host-rendered market icon, favourite indicator/control and formatted volume. */
|
|
9
|
-
icon?: React.ReactNode;
|
|
10
|
-
favorite?: React.ReactNode;
|
|
11
|
-
volume?: React.ReactNode;
|
|
12
|
-
className?: string;
|
|
13
|
-
style?: React.CSSProperties;
|
|
14
|
-
}
|
|
15
|
-
export type MarketRowProps = MarketRowContent & ({
|
|
16
|
-
mode?: 'action';
|
|
17
|
-
onSelect: () => void;
|
|
18
|
-
identity?: never;
|
|
19
|
-
} | {
|
|
20
|
-
mode: 'presentation';
|
|
21
|
-
onSelect?: never; /** Host market identity, such as symbol/name with its existing compact layout. */
|
|
22
|
-
identity?: React.ReactNode;
|
|
23
|
-
});
|
|
24
|
-
export declare function MarketRow({ symbol, name, price, change, onSelect, priceOptions, changeOptions, mode, identity, icon, favorite, volume, className, style }: MarketRowProps): React.JSX.Element;
|
|
25
|
-
export {};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { Button } from '../button.js';
|
|
4
|
-
import { Usd, Percent } from '../data.js';
|
|
5
|
-
export function MarketRow({ symbol, name, price, change, onSelect, priceOptions, changeOptions, mode = 'action', identity, icon, favorite, volume, className, style }) {
|
|
6
|
-
const content = _jsxs(_Fragment, { children: [favorite !== undefined && _jsx("span", { className: 'hig-market-favorite', children: favorite }), icon !== undefined && _jsx("span", { className: 'hig-market-icon', children: icon }), mode === 'presentation' ? _jsx("span", { className: 'hig-market-name', children: identity === undefined ? _jsxs(_Fragment, { children: [name, " (", symbol, ")"] }) : identity }) : _jsxs(Button, { intent: 'ghost', onClick: onSelect, children: [name, " (", symbol, ")"] })] });
|
|
7
|
-
return _jsxs("div", { className: `hig-row hig-market-row${className ? ` ${className}` : ''}`, style: style, "data-mode": mode, "data-has-volume": volume !== undefined || undefined, children: [_jsx("div", { className: 'hig-market-identity', children: content }), _jsx("span", { className: 'hig-market-price', children: _jsx(Usd, { value: price, options: priceOptions }) }), _jsx("span", { className: 'hig-market-change', children: _jsx(Percent, { value: change, options: changeOptions }) }), volume !== undefined && _jsx("span", { className: 'hig-market-volume', children: volume })] });
|
|
8
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
|
-
import { AnimatedNumberReadout } from '../../animated-number.js';
|
|
4
|
-
/** The swap panel's From card on its own: the asset with its actions and balance in the slot, the entered amount under it. The host owns the entry, the keypad and what the amount means. */
|
|
5
|
-
export function SwapAmountCard({ name, symbol, icon, chainIcon, context, actions, meta, value, amountLabel, prefix = '', suffix = '', fractionDigits = 0, trailingDot = false, maximumFractionDigits = 8, conversion, onSelect, selectLabel, className, style }) {
|
|
6
|
-
return _jsxs("div", { className: `hig-swap-card${className ? ` ${className}` : ''}`, style: style, "data-side": 'from', children: [_jsxs("div", { className: 'hig-swap-slot', children: [onSelect && _jsx("button", { type: 'button', className: 'hig-swap-hit', "aria-label": selectLabel, onClick: onSelect }), _jsx("div", { className: 'hig-swap-slot-content', children: _jsxs("div", { className: 'hig-swap-selected', children: [_jsxs("span", { className: 'hig-swap-stack', "aria-hidden": 'true', children: [chainIcon && _jsx("img", { src: chainIcon, alt: '' }), typeof icon === 'string' ? _jsx("img", { src: icon, alt: '' }) : icon ?? _jsx("span", { className: 'hig-swap-initials', children: symbol.slice(0, 3) })] }), _jsxs("span", { className: 'hig-swap-identity', children: [context != null && _jsx("span", { children: context }), _jsx("strong", { children: name })] }), (actions != null || meta != null) && _jsxs("span", { className: 'hig-swap-meta', children: [actions != null && _jsx("span", { className: 'hig-swap-pills', children: actions }), meta != null && _jsx("span", { className: 'hig-number', children: meta })] })] }) })] }), _jsx("div", { className: 'hig-swap-amount-area', children: _jsxs("div", { className: 'hig-swap-amount-content', children: [_jsx("div", { className: 'hig-swap-amount', role: 'textbox', tabIndex: 0, "aria-readonly": 'true', "aria-label": amountLabel, children: _jsx(AnimatedNumberReadout, { value: value, prefix: prefix, suffix: (trailingDot ? '.' : '') + suffix, options: { minimumFractionDigits: Math.min(fractionDigits, maximumFractionDigits), maximumFractionDigits, useGrouping: false } }) }), conversion] }) })] });
|
|
7
|
-
}
|
package/react/dist/recipes.d.ts
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/** Aggregate entry. TradeEntry needs @radix-ui/react-dialog; import single recipes from `@bloxwap/hig/react/recipes/<name>` to avoid overlay peers. SwapSheet (Vaul) is only at `recipes/swap-sheet`. */
|
|
2
|
-
export { MarketRow } from './recipes/market-row.js';
|
|
3
|
-
export { BalanceCard } from './recipes/balance-card.js';
|
|
4
|
-
export { TradeEntry } from './recipes/trade-entry.js';
|
|
5
|
-
export { InstallCommand } from './recipes/install-command.js';
|
|
6
|
-
export { CodeWindow } from './recipes/code-window.js';
|
|
7
|
-
export { MarketingHero } from './recipes/marketing-hero.js';
|
|
8
|
-
export { ActivityList } from './recipes/activity-list.js';
|
|
9
|
-
export { FromPicker, ToPicker, type FromPickerProps, type ToPickerProps, type PickerListProps } from './recipes/pickers.js';
|
|
10
|
-
export { SwapPanel, swapAction, type SwapPanelProps, type SwapToken, type SwapChain, type SwapAction, type SwapDenomination, type SwapWallet, type SwapFee, type SwapReceive, type SwapDestination, type SwapDetail } from './recipes/swap-panel.js';
|
package/react/dist/recipes.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
/** Aggregate entry. TradeEntry needs @radix-ui/react-dialog; import single recipes from `@bloxwap/hig/react/recipes/<name>` to avoid overlay peers. SwapSheet (Vaul) is only at `recipes/swap-sheet`. */
|
|
3
|
-
export { MarketRow } from './recipes/market-row.js';
|
|
4
|
-
export { BalanceCard } from './recipes/balance-card.js';
|
|
5
|
-
export { TradeEntry } from './recipes/trade-entry.js';
|
|
6
|
-
export { InstallCommand } from './recipes/install-command.js';
|
|
7
|
-
export { CodeWindow } from './recipes/code-window.js';
|
|
8
|
-
export { MarketingHero } from './recipes/marketing-hero.js';
|
|
9
|
-
export { ActivityList } from './recipes/activity-list.js';
|
|
10
|
-
export { FromPicker, ToPicker } from './recipes/pickers.js';
|
|
11
|
-
export { SwapPanel, swapAction } from './recipes/swap-panel.js';
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|