@silentswap/ui-kit 0.0.41
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/dist/components/AssetTile.d.ts +10 -0
- package/dist/components/AssetTile.js +18 -0
- package/dist/components/Button.d.ts +15 -0
- package/dist/components/Button.js +26 -0
- package/dist/components/Card.d.ts +14 -0
- package/dist/components/Card.js +19 -0
- package/dist/components/Input.d.ts +19 -0
- package/dist/components/Input.js +23 -0
- package/dist/components/PopularTokensArea.d.ts +8 -0
- package/dist/components/PopularTokensArea.js +34 -0
- package/dist/components/ProgressBar.d.ts +17 -0
- package/dist/components/ProgressBar.js +30 -0
- package/dist/components/Select.d.ts +12 -0
- package/dist/components/Select.js +7 -0
- package/dist/components/Warning.d.ts +15 -0
- package/dist/components/Warning.js +23 -0
- package/dist/constants.d.ts +2 -0
- package/dist/constants.js +4 -0
- package/dist/data.d.ts +7 -0
- package/dist/data.js +14 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +13 -0
- package/dist/styles.css +399 -0
- package/dist/types.d.ts +15 -0
- package/dist/types.js +1 -0
- package/package.json +52 -0
- package/src/components/AssetTile.tsx +69 -0
- package/src/components/Button.tsx +51 -0
- package/src/components/Card.tsx +49 -0
- package/src/components/Input.tsx +72 -0
- package/src/components/PopularTokensArea.tsx +78 -0
- package/src/components/ProgressBar.tsx +67 -0
- package/src/components/Select.tsx +48 -0
- package/src/components/Warning.tsx +54 -0
- package/src/constants.ts +5 -0
- package/src/data.ts +19 -0
- package/src/index.ts +26 -0
- package/src/styles.css +399 -0
- package/src/types.ts +20 -0
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ReactNode } from 'react';
|
|
3
|
+
export interface AssetTileProps {
|
|
4
|
+
caip19: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
className?: string;
|
|
7
|
+
children?: ReactNode;
|
|
8
|
+
size?: 'small' | 'medium' | 'large';
|
|
9
|
+
}
|
|
10
|
+
export declare const AssetTile: React.FC<AssetTileProps>;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { asset_get, chain_get } from '../data';
|
|
4
|
+
export const AssetTile = ({ caip19, onClick, className = '', children, size = 'medium' }) => {
|
|
5
|
+
const asset = asset_get(caip19);
|
|
6
|
+
const chain = asset?.caip2 ? chain_get(asset.caip2) : undefined;
|
|
7
|
+
const sizeClasses = {
|
|
8
|
+
small: 'w-8 h-8',
|
|
9
|
+
medium: 'w-12 h-12',
|
|
10
|
+
large: 'w-16 h-16'
|
|
11
|
+
};
|
|
12
|
+
if (!asset) {
|
|
13
|
+
return (_jsx("div", { className: `flex items-center justify-center bg-gray-600 rounded-full ${sizeClasses[size]} ${className}`, children: _jsx("span", { className: "text-white text-xs", children: "?" }) }));
|
|
14
|
+
}
|
|
15
|
+
return (_jsxs("div", { className: `relative cursor-pointer ${className}`, onClick: onClick, children: [_jsx("div", { className: `flex items-center justify-center rounded-full ${sizeClasses[size]}`, style: {
|
|
16
|
+
background: asset.gradient ? `linear-gradient(135deg, ${asset.gradient.map((g) => `#${g}`).join(', ')})` : 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)'
|
|
17
|
+
}, children: _jsx("img", { src: `/images/tokens/${asset.coingeckoId}.${asset.ext || 'svg'}`, alt: asset.symbol, className: "w-3/4 h-3/4 object-contain", style: asset.style ? JSON.parse(asset.style) : {} }) }), chain && (_jsx("div", { className: "absolute -bottom-1 -right-1 w-4 h-4 bg-black rounded-full flex items-center justify-center", children: _jsx("img", { src: `/images/chains/${chain.coingeckoPlatformId}.${chain.ext || 'svg'}`, alt: chain.name, className: "w-3 h-3 rounded-full object-cover" }) })), children] }));
|
|
18
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { ButtonHTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
export interface ButtonProps extends ButtonHTMLAttributes<HTMLButtonElement> {
|
|
4
|
+
/** Visual variant of the button */
|
|
5
|
+
variant?: 'primary' | 'secondary' | 'call-to-action' | 'link' | 'purple' | 'green';
|
|
6
|
+
/** Size of the button */
|
|
7
|
+
size?: 'small' | 'medium' | 'large';
|
|
8
|
+
/** Button content */
|
|
9
|
+
children: ReactNode;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Simple button component with different variants
|
|
13
|
+
* Based on SilentSwap Form.svelte and Plate.svelte styles
|
|
14
|
+
*/
|
|
15
|
+
export declare const Button: React.FC<ButtonProps>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Simple button component with different variants
|
|
5
|
+
* Based on SilentSwap Form.svelte and Plate.svelte styles
|
|
6
|
+
*/
|
|
7
|
+
export const Button = ({ variant = 'primary', size = 'medium', className = '', children, ...props }) => {
|
|
8
|
+
const baseClasses = 'cursor-pointer select-none transition-all focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed rounded-lg border-none';
|
|
9
|
+
const variantClasses = {
|
|
10
|
+
primary: 'bg-[var(--color-yellow)] hover:opacity-80 text-black font-semibold focus:ring-[var(--color-yellow)]',
|
|
11
|
+
secondary: 'bg-[var(--color-dim-light)] hover:opacity-80 text-white focus:ring-[var(--color-dim-light)]',
|
|
12
|
+
'call-to-action': 'call-to-action', // Uses CSS class from styles.css
|
|
13
|
+
link: 'button-link bg-transparent text-[var(--color-yellow)] p-0 hover:opacity-80',
|
|
14
|
+
purple: 'bg-[var(--color-purple)] hover:opacity-80 text-white focus:ring-[var(--color-purple)]',
|
|
15
|
+
green: 'bg-[var(--color-green)] hover:opacity-80 text-black font-semibold focus:ring-[var(--color-green)]',
|
|
16
|
+
};
|
|
17
|
+
const sizeClasses = {
|
|
18
|
+
small: 'px-2 py-1 text-xs',
|
|
19
|
+
medium: 'px-4 py-2 text-sm',
|
|
20
|
+
large: 'px-6 py-3 text-base',
|
|
21
|
+
};
|
|
22
|
+
// Don't apply size classes to link variant
|
|
23
|
+
const applySizeClasses = variant !== 'link' && variant !== 'call-to-action';
|
|
24
|
+
const classes = `${baseClasses} ${variantClasses[variant]} ${applySizeClasses ? sizeClasses[size] : ''} ${className}`.trim();
|
|
25
|
+
return (_jsx("button", { className: classes, ...props, children: children }));
|
|
26
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
export interface CardProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
children: ReactNode;
|
|
5
|
+
/** Visual variant of the card */
|
|
6
|
+
variant?: 'default' | 'section' | 'elevated' | 'dark';
|
|
7
|
+
/** Whether to center the card */
|
|
8
|
+
centered?: boolean;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Simple card component with different variants
|
|
12
|
+
* Based on SilentSwap Form.svelte and Plate.svelte styles
|
|
13
|
+
*/
|
|
14
|
+
export declare const Card: React.ForwardRefExoticComponent<CardProps & React.RefAttributes<HTMLDivElement>>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Simple card component with different variants
|
|
5
|
+
* Based on SilentSwap Form.svelte and Plate.svelte styles
|
|
6
|
+
*/
|
|
7
|
+
export const Card = forwardRef(({ children, variant = 'default', centered = false, className = '', style, ...props }, ref) => {
|
|
8
|
+
const baseClasses = 'rounded-lg';
|
|
9
|
+
const variantClasses = {
|
|
10
|
+
default: 'bg-[var(--color-dim-med)] p-4',
|
|
11
|
+
section: 'card-section', // Uses CSS class from styles.css
|
|
12
|
+
elevated: 'bg-[var(--color-dim-med)] p-4 shadowed-box',
|
|
13
|
+
dark: 'bg-[var(--color-black)] p-4',
|
|
14
|
+
};
|
|
15
|
+
const centeredClasses = centered ? 'mx-auto' : '';
|
|
16
|
+
const classes = `${baseClasses} ${variantClasses[variant]} ${centeredClasses} ${className}`.trim();
|
|
17
|
+
return (_jsx("div", { ref: ref, className: classes, style: style, ...props, children: children }));
|
|
18
|
+
});
|
|
19
|
+
Card.displayName = 'Card';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { InputHTMLAttributes } from 'react';
|
|
3
|
+
export interface InputProps extends InputHTMLAttributes<HTMLInputElement> {
|
|
4
|
+
/** Visual variant of the input */
|
|
5
|
+
variant?: 'default' | 'digital' | 'amount';
|
|
6
|
+
/** Whether the input has an error */
|
|
7
|
+
error?: boolean;
|
|
8
|
+
/** Whether the input is loading */
|
|
9
|
+
loading?: boolean;
|
|
10
|
+
/** Optional label text */
|
|
11
|
+
label?: string;
|
|
12
|
+
/** Prefix text shown before input */
|
|
13
|
+
prefix?: string;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Simple input component with different variants
|
|
17
|
+
* Based on SilentSwap Form.svelte and Plate.svelte styles
|
|
18
|
+
*/
|
|
19
|
+
export declare const Input: React.ForwardRefExoticComponent<InputProps & React.RefAttributes<HTMLInputElement>>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Simple input component with different variants
|
|
5
|
+
* Based on SilentSwap Form.svelte and Plate.svelte styles
|
|
6
|
+
*/
|
|
7
|
+
export const Input = forwardRef(({ variant = 'default', error = false, loading = false, label, prefix, className = '', ...props }, ref) => {
|
|
8
|
+
const baseClasses = 'w-full border-0 rounded-lg transition-all focus:outline-none focus:ring-2 focus:ring-offset-2 disabled:opacity-50 disabled:cursor-not-allowed';
|
|
9
|
+
const variantClasses = {
|
|
10
|
+
default: 'px-3 py-2 text-base bg-black text-white',
|
|
11
|
+
digital: 'digital-input', // Uses CSS class from styles.css
|
|
12
|
+
amount: 'text-[28px] font-bold text-white px-3 py-1 bg-black rounded-t-lg rounded-b-none',
|
|
13
|
+
};
|
|
14
|
+
const errorClasses = error ? 'focus:ring-red-500' : 'focus:ring-[var(--color-yellow)]';
|
|
15
|
+
const loadingClasses = loading ? 'animate-[trill_350ms_linear_infinite] bg-[var(--color-gray-dark)]' : '';
|
|
16
|
+
const classes = `${baseClasses} ${variantClasses[variant]} ${errorClasses} ${loadingClasses} ${className}`.trim();
|
|
17
|
+
const inputElement = (_jsxs("div", { className: "relative flex items-center", children: [prefix && (_jsx("span", { className: "absolute left-3 text-gray-400 font-medium", children: prefix })), _jsx("input", { ref: ref, className: `${classes} ${prefix ? 'pl-8' : ''}`, ...props })] }));
|
|
18
|
+
if (label) {
|
|
19
|
+
return (_jsxs("div", { className: "w-full", children: [_jsx("label", { className: "block text-sm font-medium mb-1 text-gray-300", children: label }), inputElement] }));
|
|
20
|
+
}
|
|
21
|
+
return inputElement;
|
|
22
|
+
});
|
|
23
|
+
Input.displayName = 'Input';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { S_CAIP19_USDC_AVALANCHE } from '../constants';
|
|
4
|
+
import { asset_get } from '../data';
|
|
5
|
+
import { AssetTile } from './AssetTile';
|
|
6
|
+
export const PopularTokensArea = ({ onTokenSelect, title = 'Popular Tokens', tokens, className = '' }) => {
|
|
7
|
+
const defaultTokens = [
|
|
8
|
+
'eip155:1/slip44:60', // ETH on Ethereum
|
|
9
|
+
'eip155:1/erc20:0xdAC17F958D2ee523a2206206994597C13D831ec7', // USDT on Ethereum
|
|
10
|
+
'eip155:1/erc20:0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48', // USDC on Ethereum
|
|
11
|
+
'eip155:1/erc20:0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2', // WETH on Ethereum
|
|
12
|
+
'eip155:1/erc20:0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599', // WBTC on Ethereum
|
|
13
|
+
'eip155:56/slip44:714', // BNB on BSC
|
|
14
|
+
'eip155:56/erc20:0xbb4CdB9CBd36B01bD1cBaEBF2De08d9173bc095c', // WBNB on BSC
|
|
15
|
+
'eip155:8453/slip44:60', // ETH on Base
|
|
16
|
+
'eip155:8453/erc20:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913', // USDC on Base
|
|
17
|
+
'eip155:43114/slip44:9005', // WAVAX on Avalanche
|
|
18
|
+
S_CAIP19_USDC_AVALANCHE, // USDC on Avalanche
|
|
19
|
+
'eip155:137/slip44:966', // WMATIC/WPOL on Polygon
|
|
20
|
+
'eip155:137/erc20:0xc2132D05D31c914a87C6611C10748AEb04B58e8F', // USDT0 on Polygon
|
|
21
|
+
'eip155:137/erc20:0x3c499c542cEF5E3811e1192ce70d8cC03d5c3359', // USDC on Polygon
|
|
22
|
+
'eip155:10/slip44:60', // WETH on Optimism
|
|
23
|
+
'eip155:10/erc20:0x0b2C639c533813f4Aa9D7837CAf62653d097Ff85', // USDC on Optimism
|
|
24
|
+
'eip155:42161/slip44:60', // WETH on Arbitrum
|
|
25
|
+
'eip155:42161/erc20:0xaf88d065e77c8cC2239327C5EDb3A432268e5831', // USDC on Arbitrum
|
|
26
|
+
];
|
|
27
|
+
const popularTokens = tokens || defaultTokens;
|
|
28
|
+
return (_jsxs("div", { className: `${className}`, children: [_jsx("div", { className: "font-orbitron text-lg font-bold text-white mb-3", children: title }), _jsx("div", { className: "flex gap-2 overflow-x-auto pb-2", children: popularTokens.map((caip19) => {
|
|
29
|
+
const asset = asset_get(caip19);
|
|
30
|
+
if (!asset)
|
|
31
|
+
return null;
|
|
32
|
+
return (_jsxs("div", { className: "flex flex-col items-center gap-2 bg-dim-med rounded-lg p-2 cursor-pointer hover:bg-dim-light transition-colors min-w-fit", onClick: () => onTokenSelect?.(caip19), role: "button", tabIndex: 0, "aria-label": `Select ${asset.symbol}`, children: [_jsx(AssetTile, { caip19: caip19, size: "small" }), _jsx("div", { className: "text-text-dim text-xs text-center", children: asset.symbol?.toUpperCase() })] }, caip19));
|
|
33
|
+
}) })] }));
|
|
34
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HTMLAttributes } from 'react';
|
|
3
|
+
export interface ProgressBarProps extends Omit<HTMLAttributes<HTMLDivElement>, 'children'> {
|
|
4
|
+
/** Progress value from 0 to 1 (0 = 0%, 1 = 100%) */
|
|
5
|
+
value: number;
|
|
6
|
+
/** Height of the progress bar in pixels */
|
|
7
|
+
height?: number;
|
|
8
|
+
/** Color of the progress fill */
|
|
9
|
+
color?: 'green' | 'yellow' | 'purple' | 'orange';
|
|
10
|
+
/** Whether to show the progress bar (animates height) */
|
|
11
|
+
show?: boolean;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Simple progress bar component
|
|
15
|
+
* Based on SilentSwap Plate.svelte progress styles
|
|
16
|
+
*/
|
|
17
|
+
export declare const ProgressBar: React.FC<ProgressBarProps>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Simple progress bar component
|
|
5
|
+
* Based on SilentSwap Plate.svelte progress styles
|
|
6
|
+
*/
|
|
7
|
+
export const ProgressBar = ({ value, height = 6, color = 'green', show = true, className = '', style, ...props }) => {
|
|
8
|
+
const colorClasses = {
|
|
9
|
+
green: 'bg-[var(--color-green)]',
|
|
10
|
+
yellow: 'bg-[var(--color-yellow)]',
|
|
11
|
+
purple: 'bg-[var(--color-purple)]',
|
|
12
|
+
orange: 'bg-[var(--color-orange)]',
|
|
13
|
+
};
|
|
14
|
+
// Clamp value between 0 and 1
|
|
15
|
+
const clampedValue = Math.max(0, Math.min(1, value));
|
|
16
|
+
const containerStyle = {
|
|
17
|
+
height: show ? `${height}px` : '0px',
|
|
18
|
+
width: '100%',
|
|
19
|
+
backgroundColor: 'var(--color-gray-dark)',
|
|
20
|
+
transition: 'height 500ms linear',
|
|
21
|
+
overflow: 'hidden',
|
|
22
|
+
...style,
|
|
23
|
+
};
|
|
24
|
+
const fillStyle = {
|
|
25
|
+
width: `${clampedValue * 100}%`,
|
|
26
|
+
height: '100%',
|
|
27
|
+
transition: 'width 490ms linear',
|
|
28
|
+
};
|
|
29
|
+
return (_jsx("div", { className: className, style: containerStyle, role: "progressbar", "aria-valuenow": clampedValue * 100, "aria-valuemin": 0, "aria-valuemax": 100, ...props, children: _jsx("div", { className: colorClasses[color], style: fillStyle }) }));
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { SelectHTMLAttributes } from 'react';
|
|
3
|
+
export interface SelectOption {
|
|
4
|
+
value: string;
|
|
5
|
+
label: string;
|
|
6
|
+
disabled?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface SelectProps extends Omit<SelectHTMLAttributes<HTMLSelectElement>, 'children'> {
|
|
9
|
+
options: SelectOption[];
|
|
10
|
+
placeholder?: string;
|
|
11
|
+
}
|
|
12
|
+
export declare const Select: React.ForwardRefExoticComponent<SelectProps & React.RefAttributes<HTMLSelectElement>>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React, { forwardRef } from 'react';
|
|
3
|
+
export const Select = forwardRef(({ options, placeholder, className = '', ...props }, ref) => {
|
|
4
|
+
const classes = `bg-black border-0 rounded-lg text-white px-3 py-2 cursor-pointer transition-colors focus:outline-none focus:ring-2 focus:ring-yellow focus:ring-offset-2 hover:bg-dim-dark ${className}`.trim();
|
|
5
|
+
return (_jsxs("select", { ref: ref, className: classes, ...props, children: [placeholder && (_jsx("option", { value: "", disabled: true, children: placeholder })), options.map((option) => (_jsx("option", { value: option.value, disabled: option.disabled, className: "bg-black text-text-bright", children: option.label }, option.value)))] }));
|
|
6
|
+
});
|
|
7
|
+
Select.displayName = 'Select';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { HTMLAttributes, ReactNode } from 'react';
|
|
3
|
+
export interface WarningProps extends HTMLAttributes<HTMLDivElement> {
|
|
4
|
+
/** Warning content */
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
/** Variant of the warning */
|
|
7
|
+
variant?: 'warning' | 'error' | 'info' | 'success';
|
|
8
|
+
/** Whether to show a dot indicator */
|
|
9
|
+
showDot?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Simple warning/notice component
|
|
13
|
+
* Based on SilentSwap Plate.svelte input-notice styles
|
|
14
|
+
*/
|
|
15
|
+
export declare const Warning: React.FC<WarningProps>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Simple warning/notice component
|
|
5
|
+
* Based on SilentSwap Plate.svelte input-notice styles
|
|
6
|
+
*/
|
|
7
|
+
export const Warning = ({ children, variant = 'warning', showDot = true, className = '', ...props }) => {
|
|
8
|
+
const baseClasses = 'text-xs bg-black/80 rounded px-2 py-1 flex items-center gap-1';
|
|
9
|
+
const variantClasses = {
|
|
10
|
+
warning: 'text-[#FED703]',
|
|
11
|
+
error: 'text-red-500',
|
|
12
|
+
info: 'text-blue-400',
|
|
13
|
+
success: 'text-[var(--color-green)]',
|
|
14
|
+
};
|
|
15
|
+
const dotColor = {
|
|
16
|
+
warning: '#FED703',
|
|
17
|
+
error: '#ef4444',
|
|
18
|
+
info: '#60a5fa',
|
|
19
|
+
success: 'var(--color-green)',
|
|
20
|
+
};
|
|
21
|
+
const classes = `${baseClasses} ${variantClasses[variant]} ${className}`.trim();
|
|
22
|
+
return (_jsxs("div", { className: classes, ...props, children: [showDot && (_jsx("span", { className: "inline-block w-[5px] h-[6px] rounded-full", style: { backgroundColor: dotColor[variant] } })), _jsx("span", { children: children })] }));
|
|
23
|
+
};
|
package/dist/data.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Asset, WeakCaip19, WeakCaip2 } from './types';
|
|
2
|
+
export declare function loadAssets(assetData: {
|
|
3
|
+
assets: Record<WeakCaip19, Asset>;
|
|
4
|
+
chains: Record<WeakCaip2, any>;
|
|
5
|
+
}): void;
|
|
6
|
+
export declare function asset_get(si_caip19: string): Asset | undefined;
|
|
7
|
+
export declare function chain_get(si_caip2: string): any | undefined;
|
package/dist/data.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
// Global assets and chains stores
|
|
2
|
+
let H_ASSETS = {};
|
|
3
|
+
let H_CHAINS = {};
|
|
4
|
+
// Asset data loading function - needs to be called by consumer
|
|
5
|
+
export function loadAssets(assetData) {
|
|
6
|
+
H_ASSETS = assetData.assets;
|
|
7
|
+
H_CHAINS = assetData.chains;
|
|
8
|
+
}
|
|
9
|
+
export function asset_get(si_caip19) {
|
|
10
|
+
return H_ASSETS[si_caip19];
|
|
11
|
+
}
|
|
12
|
+
export function chain_get(si_caip2) {
|
|
13
|
+
return H_CHAINS[si_caip2];
|
|
14
|
+
}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export { Button } from './components/Button';
|
|
2
|
+
export { Input } from './components/Input';
|
|
3
|
+
export { Select } from './components/Select';
|
|
4
|
+
export { Card } from './components/Card';
|
|
5
|
+
export { Warning } from './components/Warning';
|
|
6
|
+
export { ProgressBar } from './components/ProgressBar';
|
|
7
|
+
export { AssetTile } from './components/AssetTile';
|
|
8
|
+
export { PopularTokensArea } from './components/PopularTokensArea';
|
|
9
|
+
export type { Asset, ContactId } from './types';
|
|
10
|
+
export type { ButtonProps } from './components/Button';
|
|
11
|
+
export type { InputProps } from './components/Input';
|
|
12
|
+
export type { SelectProps, SelectOption } from './components/Select';
|
|
13
|
+
export type { CardProps } from './components/Card';
|
|
14
|
+
export type { WarningProps } from './components/Warning';
|
|
15
|
+
export type { ProgressBarProps } from './components/ProgressBar';
|
|
16
|
+
export { S_CAIP19_USDC_AVALANCHE, X_MINIMUM_INPUT_USD } from './constants';
|
|
17
|
+
export { loadAssets } from './data';
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Components
|
|
2
|
+
export { Button } from './components/Button';
|
|
3
|
+
export { Input } from './components/Input';
|
|
4
|
+
export { Select } from './components/Select';
|
|
5
|
+
export { Card } from './components/Card';
|
|
6
|
+
export { Warning } from './components/Warning';
|
|
7
|
+
export { ProgressBar } from './components/ProgressBar';
|
|
8
|
+
export { AssetTile } from './components/AssetTile';
|
|
9
|
+
export { PopularTokensArea } from './components/PopularTokensArea';
|
|
10
|
+
// Constants
|
|
11
|
+
export { S_CAIP19_USDC_AVALANCHE, X_MINIMUM_INPUT_USD } from './constants';
|
|
12
|
+
// Data utilities
|
|
13
|
+
export { loadAssets } from './data';
|