@0xsquid/ui 0.3.0 → 1.0.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 -76
- package/dist/cjs/index.js +4326 -466
- package/dist/cjs/types/components/buttons/Dropdown.d.ts +1 -4
- package/dist/cjs/types/components/index.d.ts +0 -5
- package/dist/cjs/types/components/layout/SwapConfiguration.d.ts +0 -3
- package/dist/cjs/types/index.d.ts +0 -1
- package/dist/cjs/types/providers/SquidConfigProvider.d.ts +1 -0
- package/dist/cjs/types/types/config.d.ts +0 -1
- package/dist/esm/index.js +4327 -445
- package/dist/esm/types/components/buttons/Dropdown.d.ts +1 -4
- package/dist/esm/types/components/index.d.ts +0 -5
- package/dist/esm/types/components/layout/SwapConfiguration.d.ts +0 -3
- package/dist/esm/types/index.d.ts +0 -1
- package/dist/esm/types/providers/SquidConfigProvider.d.ts +1 -0
- package/dist/esm/types/types/config.d.ts +0 -1
- package/dist/index.css +6 -6
- package/dist/index.d.ts +2 -224
- package/package.json +5 -8
- package/dist/cjs/types/components/badges/index.d.ts +0 -2
- package/dist/cjs/types/components/controls/index.d.ts +0 -3
- package/dist/cjs/types/components/layout/index.d.ts +0 -8
- package/dist/cjs/types/components/lists/index.d.ts +0 -5
- package/dist/cjs/types/components/typography/index.d.ts +0 -3
- package/dist/cjs/types/providers/index.d.ts +0 -1
- package/dist/esm/types/components/badges/index.d.ts +0 -2
- package/dist/esm/types/components/controls/index.d.ts +0 -3
- package/dist/esm/types/components/layout/index.d.ts +0 -8
- package/dist/esm/types/components/lists/index.d.ts +0 -5
- package/dist/esm/types/components/typography/index.d.ts +0 -3
- package/dist/esm/types/providers/index.d.ts +0 -1
|
@@ -2,9 +2,6 @@ interface DropdownProps {
|
|
|
2
2
|
tokenImageUrl?: string;
|
|
3
3
|
chainImageUrl?: string;
|
|
4
4
|
tokenSymbol?: string;
|
|
5
|
-
chainBgColor?: string;
|
|
6
|
-
tokenBgColor?: string;
|
|
7
|
-
tokenTextColor?: string;
|
|
8
5
|
}
|
|
9
|
-
export declare function Dropdown({ chainImageUrl, tokenImageUrl, tokenSymbol,
|
|
6
|
+
export declare function Dropdown({ chainImageUrl, tokenImageUrl, tokenSymbol, }: DropdownProps): import("react/jsx-runtime").JSX.Element;
|
|
10
7
|
export {};
|
|
@@ -8,13 +8,10 @@ interface SwapConfigurationProps {
|
|
|
8
8
|
isFetching?: boolean;
|
|
9
9
|
chain?: {
|
|
10
10
|
iconUrl: string;
|
|
11
|
-
bgColor: string;
|
|
12
11
|
};
|
|
13
12
|
token?: {
|
|
14
13
|
iconUrl: string;
|
|
15
14
|
symbol: string;
|
|
16
|
-
bgColor: string;
|
|
17
|
-
textColor: string;
|
|
18
15
|
};
|
|
19
16
|
}
|
|
20
17
|
export declare function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd, balance, isFetching, chain, token, direction, }: SwapConfigurationProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -37,7 +37,6 @@ export interface ConfigTheme {
|
|
|
37
37
|
'accent-salmon': string;
|
|
38
38
|
'accent-gold': string;
|
|
39
39
|
}
|
|
40
|
-
export declare const SQUID_THEME_CSS_VARIABLE_PREFIX = "--squid-theme-";
|
|
41
40
|
/**
|
|
42
41
|
* Mapping between readable variables name and css variables used TailwindCSS config
|
|
43
42
|
*/
|
package/dist/index.css
CHANGED
|
@@ -2009,9 +2009,9 @@ video {
|
|
|
2009
2009
|
cursor: not-allowed;
|
|
2010
2010
|
}
|
|
2011
2011
|
|
|
2012
|
-
.
|
|
2013
|
-
-webkit-mask-image: url('
|
|
2014
|
-
mask-image: url('
|
|
2012
|
+
.dropdown-mask {
|
|
2013
|
+
-webkit-mask-image: url('/public/assets/images/dropdown-mask.png');
|
|
2014
|
+
mask-image: url('/public/assets/images/dropdown-mask.png');
|
|
2015
2015
|
-webkit-mask-size: 100% 100%;
|
|
2016
2016
|
mask-size: 100% 100%;
|
|
2017
2017
|
aspect-ratio: 209/40;
|
|
@@ -2021,9 +2021,9 @@ video {
|
|
|
2021
2021
|
mask-position: center;
|
|
2022
2022
|
}
|
|
2023
2023
|
|
|
2024
|
-
.
|
|
2025
|
-
-webkit-mask-image: url('
|
|
2026
|
-
mask-image: url('
|
|
2024
|
+
.token-swap-mask {
|
|
2025
|
+
-webkit-mask-image: url('/public/assets/images/token-swap-mask.png');
|
|
2026
|
+
mask-image: url('/public/assets/images/token-swap-mask.png');
|
|
2027
2027
|
-webkit-mask-size: 100% 100%;
|
|
2028
2028
|
mask-size: 100% 100%;
|
|
2029
2029
|
aspect-ratio: 747/334;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,21 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import React$1 from 'react';
|
|
4
|
-
|
|
5
|
-
interface BadgeImageProps {
|
|
6
|
-
imageUrl?: string;
|
|
7
|
-
badgeUrl?: string;
|
|
8
|
-
size?: BadgeSize;
|
|
9
|
-
extraMarginForBadge?: boolean;
|
|
10
|
-
rounded?: boolean;
|
|
11
|
-
}
|
|
12
|
-
type BadgeSize = 'sm' | 'md';
|
|
13
|
-
declare function BadgeImage({ imageUrl, badgeUrl, size, extraMarginForBadge, rounded, }: BadgeImageProps): react_jsx_runtime.JSX.Element | null;
|
|
14
|
-
|
|
15
|
-
interface UsdAmountProps {
|
|
16
|
-
usdAmount: number;
|
|
17
|
-
}
|
|
18
|
-
declare function UsdAmount({ usdAmount }: UsdAmountProps): react_jsx_runtime.JSX.Element;
|
|
19
3
|
|
|
20
4
|
interface AddressButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
21
5
|
label: string;
|
|
@@ -31,18 +15,9 @@ interface ArrowButtonProps extends React.HTMLAttributes<HTMLButtonElement> {
|
|
|
31
15
|
}
|
|
32
16
|
declare function ArrowButton({ label, disabled, ...props }: ArrowButtonProps): react_jsx_runtime.JSX.Element;
|
|
33
17
|
|
|
34
|
-
type TextSize = 'small' | 'medium' | 'large';
|
|
35
|
-
type SwitchSize = 'small' | 'large';
|
|
36
18
|
type ButtonVariant = 'primary' | 'secondary' | 'tertiary';
|
|
37
19
|
type ButtonSize = 'md' | 'lg';
|
|
38
|
-
type SwapDirection = 'from' | 'to';
|
|
39
20
|
type BoostMode = 'normal' | 'boost';
|
|
40
|
-
declare enum DetailsToolbarState {
|
|
41
|
-
FULL = 0,
|
|
42
|
-
LOADING = 1,
|
|
43
|
-
EMPTY = 2,
|
|
44
|
-
ERROR = 3
|
|
45
|
-
}
|
|
46
21
|
|
|
47
22
|
interface BoostButtonProps {
|
|
48
23
|
boostMode?: BoostMode;
|
|
@@ -71,206 +46,9 @@ interface DropdownProps {
|
|
|
71
46
|
tokenImageUrl?: string;
|
|
72
47
|
chainImageUrl?: string;
|
|
73
48
|
tokenSymbol?: string;
|
|
74
|
-
chainBgColor?: string;
|
|
75
|
-
tokenBgColor?: string;
|
|
76
|
-
tokenTextColor?: string;
|
|
77
49
|
}
|
|
78
|
-
declare function Dropdown({ chainImageUrl, tokenImageUrl, tokenSymbol,
|
|
50
|
+
declare function Dropdown({ chainImageUrl, tokenImageUrl, tokenSymbol, }: DropdownProps): react_jsx_runtime.JSX.Element;
|
|
79
51
|
|
|
80
52
|
declare function FeeButton(): react_jsx_runtime.JSX.Element;
|
|
81
53
|
|
|
82
|
-
|
|
83
|
-
placeholder?: string;
|
|
84
|
-
showIcon?: boolean;
|
|
85
|
-
showPasteButton?: boolean;
|
|
86
|
-
icon?: React.ReactNode;
|
|
87
|
-
}
|
|
88
|
-
declare function Input({ placeholder, showIcon, showPasteButton, className, icon, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
89
|
-
|
|
90
|
-
interface SwitchProps {
|
|
91
|
-
checked: boolean;
|
|
92
|
-
onChange: (checked: boolean) => void;
|
|
93
|
-
size: SwitchSize;
|
|
94
|
-
}
|
|
95
|
-
declare function Switch({ checked, onChange, size }: SwitchProps): react_jsx_runtime.JSX.Element;
|
|
96
|
-
|
|
97
|
-
type TooltipWidth = 'max' | 'container';
|
|
98
|
-
type TooltipThreshold = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
|
|
99
|
-
interface TooltipProps {
|
|
100
|
-
children: React$1.ReactNode;
|
|
101
|
-
tooltipContent: React$1.ReactNode;
|
|
102
|
-
threshold?: TooltipThreshold;
|
|
103
|
-
tooltipWidth?: TooltipWidth;
|
|
104
|
-
className?: string;
|
|
105
|
-
}
|
|
106
|
-
declare function Tooltip({ children, tooltipContent, tooltipWidth, threshold, className, }: TooltipProps): react_jsx_runtime.JSX.Element;
|
|
107
|
-
|
|
108
|
-
declare function Boost(): react_jsx_runtime.JSX.Element;
|
|
109
|
-
|
|
110
|
-
interface DetailsToolbarProps {
|
|
111
|
-
state?: DetailsToolbarState;
|
|
112
|
-
errorMessage: string;
|
|
113
|
-
}
|
|
114
|
-
declare function DetailsToolbar({ state, errorMessage, }: DetailsToolbarProps): react_jsx_runtime.JSX.Element;
|
|
115
|
-
|
|
116
|
-
interface MenuProps extends React$1.ComponentProps<'div'> {
|
|
117
|
-
menuClassName?: string;
|
|
118
|
-
contentClassName?: string;
|
|
119
|
-
}
|
|
120
|
-
declare function Menu({ children, menuClassName, contentClassName, ...props }: MenuProps): react_jsx_runtime.JSX.Element;
|
|
121
|
-
|
|
122
|
-
interface ModalProps {
|
|
123
|
-
children: React.ReactNode;
|
|
124
|
-
}
|
|
125
|
-
declare function Modal({ children }: ModalProps): react_jsx_runtime.JSX.Element;
|
|
126
|
-
|
|
127
|
-
interface NavigationBarProps {
|
|
128
|
-
title?: string;
|
|
129
|
-
displayBackButton?: boolean;
|
|
130
|
-
logoUrl?: string;
|
|
131
|
-
}
|
|
132
|
-
declare function NavigationBar({ title, displayBackButton, logoUrl, }: NavigationBarProps): react_jsx_runtime.JSX.Element;
|
|
133
|
-
|
|
134
|
-
interface ProductCardProps {
|
|
135
|
-
children?: React.ReactNode;
|
|
136
|
-
}
|
|
137
|
-
declare function ProductCard({ children }: ProductCardProps): react_jsx_runtime.JSX.Element;
|
|
138
|
-
|
|
139
|
-
interface SwapConfigurationProps {
|
|
140
|
-
direction: SwapDirection;
|
|
141
|
-
priceImpactPercentage?: number;
|
|
142
|
-
amount?: number;
|
|
143
|
-
swapAmountUsd?: number;
|
|
144
|
-
balance?: string;
|
|
145
|
-
isFetching?: boolean;
|
|
146
|
-
chain?: {
|
|
147
|
-
iconUrl: string;
|
|
148
|
-
bgColor: string;
|
|
149
|
-
};
|
|
150
|
-
token?: {
|
|
151
|
-
iconUrl: string;
|
|
152
|
-
symbol: string;
|
|
153
|
-
bgColor: string;
|
|
154
|
-
textColor: string;
|
|
155
|
-
};
|
|
156
|
-
}
|
|
157
|
-
declare function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd, balance, isFetching, chain, token, direction, }: SwapConfigurationProps): react_jsx_runtime.JSX.Element;
|
|
158
|
-
|
|
159
|
-
interface WalletAddressProps {
|
|
160
|
-
ens?: string;
|
|
161
|
-
address?: string;
|
|
162
|
-
}
|
|
163
|
-
declare function WalletAddress({ address, ens }: WalletAddressProps): react_jsx_runtime.JSX.Element;
|
|
164
|
-
|
|
165
|
-
interface DropdownMenuItemProps {
|
|
166
|
-
label: string;
|
|
167
|
-
imageUrl?: string;
|
|
168
|
-
icon?: React.ReactNode;
|
|
169
|
-
}
|
|
170
|
-
declare function DropdownMenuItem({ label, imageUrl, icon, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
171
|
-
|
|
172
|
-
interface HistoryItemProps {
|
|
173
|
-
firstImageUrl: string;
|
|
174
|
-
secondImageUrl: string;
|
|
175
|
-
isPending?: boolean;
|
|
176
|
-
fromLabel: string;
|
|
177
|
-
toLabel: string;
|
|
178
|
-
pendingLabel?: string;
|
|
179
|
-
dateCompleted: string;
|
|
180
|
-
fromAmount: string;
|
|
181
|
-
toAmount: string;
|
|
182
|
-
}
|
|
183
|
-
declare function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, pendingLabel, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
|
|
184
|
-
|
|
185
|
-
interface ListItemProps {
|
|
186
|
-
title: string | React.ReactNode;
|
|
187
|
-
mainImageUrl?: string;
|
|
188
|
-
secondaryImageUrl?: string;
|
|
189
|
-
subtitle?: string;
|
|
190
|
-
detail?: string;
|
|
191
|
-
icon?: React.ReactNode;
|
|
192
|
-
size?: ListItemSize;
|
|
193
|
-
mainIcon?: React.ReactNode;
|
|
194
|
-
className?: string;
|
|
195
|
-
}
|
|
196
|
-
type ListItemSize = 'small' | 'large';
|
|
197
|
-
declare function ListItem({ title, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, }: ListItemProps): react_jsx_runtime.JSX.Element;
|
|
198
|
-
|
|
199
|
-
interface MenuItemProps {
|
|
200
|
-
label: string;
|
|
201
|
-
imageUrl?: string;
|
|
202
|
-
icon?: React.ReactNode;
|
|
203
|
-
}
|
|
204
|
-
declare function MenuItem({ label, imageUrl, icon }: MenuItemProps): react_jsx_runtime.JSX.Element;
|
|
205
|
-
|
|
206
|
-
interface SectionTitleProps {
|
|
207
|
-
title: string;
|
|
208
|
-
icon?: React.ReactNode;
|
|
209
|
-
accessory?: string | null;
|
|
210
|
-
actionIcon?: React.ReactNode;
|
|
211
|
-
className?: string;
|
|
212
|
-
}
|
|
213
|
-
declare function SectionTitle({ title, icon, accessory, actionIcon, className, }: SectionTitleProps): react_jsx_runtime.JSX.Element;
|
|
214
|
-
|
|
215
|
-
interface BodyTextProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
216
|
-
children: string | undefined;
|
|
217
|
-
size: TextSize;
|
|
218
|
-
bold?: boolean;
|
|
219
|
-
}
|
|
220
|
-
declare function BodyText({ size, children, bold, ...props }: BodyTextProps): react_jsx_runtime.JSX.Element;
|
|
221
|
-
|
|
222
|
-
interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
|
|
223
|
-
children?: string;
|
|
224
|
-
bold?: boolean;
|
|
225
|
-
}
|
|
226
|
-
declare function CaptionText({ children, bold, ...props }: CaptionProps): react_jsx_runtime.JSX.Element;
|
|
227
|
-
|
|
228
|
-
interface HeadingTextProps {
|
|
229
|
-
children: string;
|
|
230
|
-
size: TextSize;
|
|
231
|
-
bold?: boolean;
|
|
232
|
-
}
|
|
233
|
-
declare function HeadingText({ children, bold, size }: HeadingTextProps): react_jsx_runtime.JSX.Element;
|
|
234
|
-
|
|
235
|
-
interface ConfigTheme {
|
|
236
|
-
'grey-100': string;
|
|
237
|
-
'grey-200': string;
|
|
238
|
-
'grey-300': string;
|
|
239
|
-
'grey-400': string;
|
|
240
|
-
'grey-500': string;
|
|
241
|
-
'grey-600': string;
|
|
242
|
-
'grey-700': string;
|
|
243
|
-
'grey-800': string;
|
|
244
|
-
'grey-900': string;
|
|
245
|
-
'royal-100': string;
|
|
246
|
-
'royal-200': string;
|
|
247
|
-
'royal-300': string;
|
|
248
|
-
'royal-400': string;
|
|
249
|
-
'royal-500': string;
|
|
250
|
-
'royal-600': string;
|
|
251
|
-
'royal-700': string;
|
|
252
|
-
'royal-800': string;
|
|
253
|
-
'status-positive': string;
|
|
254
|
-
'status-negative': string;
|
|
255
|
-
'material-light-thin': string;
|
|
256
|
-
'material-light-average': string;
|
|
257
|
-
'material-light-thick': string;
|
|
258
|
-
'material-dark-thin': string;
|
|
259
|
-
'material-dark-average': string;
|
|
260
|
-
'material-dark-thick': string;
|
|
261
|
-
'volt-300': string;
|
|
262
|
-
'volt-400': string;
|
|
263
|
-
'volt-600': string;
|
|
264
|
-
'volt-700': string;
|
|
265
|
-
'volt-800': string;
|
|
266
|
-
'volt-900': string;
|
|
267
|
-
'accent-salmon': string;
|
|
268
|
-
'accent-gold': string;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
declare function SquidConfigProvider({ theme, children, }: {
|
|
272
|
-
theme?: ConfigTheme;
|
|
273
|
-
children?: React.ReactNode;
|
|
274
|
-
}): react_jsx_runtime.JSX.Element;
|
|
275
|
-
|
|
276
|
-
export { AddressButton, ArrowButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, Dropdown, DropdownMenuItem, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, ProductCard, SectionTitle, SquidConfigProvider, SwapConfiguration, Switch, Tooltip, type TooltipThreshold, type TooltipWidth, UsdAmount, WalletAddress };
|
|
54
|
+
export { AddressButton, ArrowButton, BoostButton, Button, Chip, Dropdown, FeeButton };
|
package/package.json
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
"name": "@0xsquid/ui",
|
|
3
3
|
"repository": {
|
|
4
4
|
"type": "git",
|
|
5
|
-
"url": "git+https://github.com/0xsquid/
|
|
5
|
+
"url": "git+https://github.com/0xsquid/api-widget.git"
|
|
6
6
|
},
|
|
7
7
|
"description": "Squid's UI components",
|
|
8
|
-
"version": "0.
|
|
8
|
+
"version": "1.0.0",
|
|
9
9
|
"author": "",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"scripts": {
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"clsx": "2.1.0",
|
|
27
27
|
"color": "4.2.3",
|
|
28
|
+
"react": "18.2.0",
|
|
29
|
+
"react-dom": "18.2.0",
|
|
28
30
|
"tailwind-merge": "2.3.0"
|
|
29
31
|
},
|
|
30
32
|
"main": "dist/cjs/index.js",
|
|
@@ -68,10 +70,9 @@
|
|
|
68
70
|
"postcss": "8.4.36",
|
|
69
71
|
"prettier": "3.2.5",
|
|
70
72
|
"prettier-plugin-tailwindcss": "0.5.12",
|
|
71
|
-
"release-it": "
|
|
73
|
+
"release-it": "16.3.0",
|
|
72
74
|
"rollup": "^4.17.2",
|
|
73
75
|
"rollup-plugin-dts": "^6.1.0",
|
|
74
|
-
"rollup-plugin-peer-deps-external": "^2.2.4",
|
|
75
76
|
"storybook": "^8.0.1",
|
|
76
77
|
"tailwindcss": "3.4.1",
|
|
77
78
|
"ts-loader": "9.5.1",
|
|
@@ -99,9 +100,5 @@
|
|
|
99
100
|
"npm": {
|
|
100
101
|
"publish": false
|
|
101
102
|
}
|
|
102
|
-
},
|
|
103
|
-
"peerDependencies": {
|
|
104
|
-
"react": "^18.3.1",
|
|
105
|
-
"react-dom": "^18.3.1"
|
|
106
103
|
}
|
|
107
104
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SquidConfigProvider';
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from './SquidConfigProvider';
|