@0xsquid/ui 0.2.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.
@@ -1,6 +1 @@
1
- export * from './badges';
2
1
  export * from './buttons';
3
- export * from './controls';
4
- export * from './layout';
5
- export * from './lists';
6
- export * from './typography';
@@ -1,2 +1 @@
1
1
  export * from './components';
2
- export * from './providers';
@@ -1,5 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { ConfigTheme } from '../types/config';
3
+ export declare function useSquidConfig(): ConfigTheme;
3
4
  export declare function SquidConfigProvider({ theme, children, }: {
4
5
  theme?: ConfigTheme;
5
6
  children?: React.ReactNode;
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;
@@ -76,195 +51,4 @@ declare function Dropdown({ chainImageUrl, tokenImageUrl, tokenSymbol, }: Dropdo
76
51
 
77
52
  declare function FeeButton(): react_jsx_runtime.JSX.Element;
78
53
 
79
- interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
80
- placeholder?: string;
81
- showIcon?: boolean;
82
- showPasteButton?: boolean;
83
- icon?: React.ReactNode;
84
- }
85
- declare function Input({ placeholder, showIcon, showPasteButton, className, icon, ...props }: InputProps): react_jsx_runtime.JSX.Element;
86
-
87
- interface SwitchProps {
88
- checked: boolean;
89
- onChange: (checked: boolean) => void;
90
- size: SwitchSize;
91
- }
92
- declare function Switch({ checked, onChange, size }: SwitchProps): react_jsx_runtime.JSX.Element;
93
-
94
- type TooltipWidth = 'max' | 'container';
95
- type TooltipThreshold = 'xxs' | 'xs' | 's' | 'm' | 'l' | 'xl' | 'xxl';
96
- interface TooltipProps {
97
- children: React$1.ReactNode;
98
- tooltipContent: React$1.ReactNode;
99
- threshold?: TooltipThreshold;
100
- tooltipWidth?: TooltipWidth;
101
- className?: string;
102
- }
103
- declare function Tooltip({ children, tooltipContent, tooltipWidth, threshold, className, }: TooltipProps): react_jsx_runtime.JSX.Element;
104
-
105
- declare function Boost(): react_jsx_runtime.JSX.Element;
106
-
107
- interface DetailsToolbarProps {
108
- state?: DetailsToolbarState;
109
- errorMessage: string;
110
- }
111
- declare function DetailsToolbar({ state, errorMessage, }: DetailsToolbarProps): react_jsx_runtime.JSX.Element;
112
-
113
- interface MenuProps extends React$1.ComponentProps<'div'> {
114
- menuClassName?: string;
115
- contentClassName?: string;
116
- }
117
- declare function Menu({ children, menuClassName, contentClassName, ...props }: MenuProps): react_jsx_runtime.JSX.Element;
118
-
119
- interface ModalProps {
120
- children: React.ReactNode;
121
- }
122
- declare function Modal({ children }: ModalProps): react_jsx_runtime.JSX.Element;
123
-
124
- interface NavigationBarProps {
125
- title?: string;
126
- displayBackButton?: boolean;
127
- logoUrl?: string;
128
- }
129
- declare function NavigationBar({ title, displayBackButton, logoUrl, }: NavigationBarProps): react_jsx_runtime.JSX.Element;
130
-
131
- interface ProductCardProps {
132
- children?: React.ReactNode;
133
- }
134
- declare function ProductCard({ children }: ProductCardProps): react_jsx_runtime.JSX.Element;
135
-
136
- interface SwapConfigurationProps {
137
- direction: SwapDirection;
138
- priceImpactPercentage?: number;
139
- amount?: number;
140
- swapAmountUsd?: number;
141
- balance?: string;
142
- isFetching?: boolean;
143
- chain?: {
144
- iconUrl: string;
145
- };
146
- token?: {
147
- iconUrl: string;
148
- symbol: string;
149
- };
150
- }
151
- declare function SwapConfiguration({ priceImpactPercentage, amount, swapAmountUsd, balance, isFetching, chain, token, direction, }: SwapConfigurationProps): react_jsx_runtime.JSX.Element;
152
-
153
- interface WalletAddressProps {
154
- ens?: string;
155
- address?: string;
156
- }
157
- declare function WalletAddress({ address, ens }: WalletAddressProps): react_jsx_runtime.JSX.Element;
158
-
159
- interface DropdownMenuItemProps {
160
- label: string;
161
- imageUrl?: string;
162
- icon?: React.ReactNode;
163
- }
164
- declare function DropdownMenuItem({ label, imageUrl, icon, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
165
-
166
- interface HistoryItemProps {
167
- firstImageUrl: string;
168
- secondImageUrl: string;
169
- isPending?: boolean;
170
- fromLabel: string;
171
- toLabel: string;
172
- pendingLabel?: string;
173
- dateCompleted: string;
174
- fromAmount: string;
175
- toAmount: string;
176
- }
177
- declare function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, pendingLabel, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
178
-
179
- interface ListItemProps {
180
- title: string | React.ReactNode;
181
- mainImageUrl?: string;
182
- secondaryImageUrl?: string;
183
- subtitle?: string;
184
- detail?: string;
185
- icon?: React.ReactNode;
186
- size?: ListItemSize;
187
- mainIcon?: React.ReactNode;
188
- className?: string;
189
- }
190
- type ListItemSize = 'small' | 'large';
191
- declare function ListItem({ title, mainImageUrl, subtitle, detail, icon, secondaryImageUrl, size, mainIcon, className, }: ListItemProps): react_jsx_runtime.JSX.Element;
192
-
193
- interface MenuItemProps {
194
- label: string;
195
- imageUrl?: string;
196
- icon?: React.ReactNode;
197
- }
198
- declare function MenuItem({ label, imageUrl, icon }: MenuItemProps): react_jsx_runtime.JSX.Element;
199
-
200
- interface SectionTitleProps {
201
- title: string;
202
- icon?: React.ReactNode;
203
- accessory?: string | null;
204
- actionIcon?: React.ReactNode;
205
- className?: string;
206
- }
207
- declare function SectionTitle({ title, icon, accessory, actionIcon, className, }: SectionTitleProps): react_jsx_runtime.JSX.Element;
208
-
209
- interface BodyTextProps extends React.HTMLAttributes<HTMLSpanElement> {
210
- children: string | undefined;
211
- size: TextSize;
212
- bold?: boolean;
213
- }
214
- declare function BodyText({ size, children, bold, ...props }: BodyTextProps): react_jsx_runtime.JSX.Element;
215
-
216
- interface CaptionProps extends React.HTMLAttributes<HTMLSpanElement> {
217
- children?: string;
218
- bold?: boolean;
219
- }
220
- declare function CaptionText({ children, bold, ...props }: CaptionProps): react_jsx_runtime.JSX.Element;
221
-
222
- interface HeadingTextProps {
223
- children: string;
224
- size: TextSize;
225
- bold?: boolean;
226
- }
227
- declare function HeadingText({ children, bold, size }: HeadingTextProps): react_jsx_runtime.JSX.Element;
228
-
229
- interface ConfigTheme {
230
- 'grey-100': string;
231
- 'grey-200': string;
232
- 'grey-300': string;
233
- 'grey-400': string;
234
- 'grey-500': string;
235
- 'grey-600': string;
236
- 'grey-700': string;
237
- 'grey-800': string;
238
- 'grey-900': string;
239
- 'royal-100': string;
240
- 'royal-200': string;
241
- 'royal-300': string;
242
- 'royal-400': string;
243
- 'royal-500': string;
244
- 'royal-600': string;
245
- 'royal-700': string;
246
- 'royal-800': string;
247
- 'status-positive': string;
248
- 'status-negative': string;
249
- 'material-light-thin': string;
250
- 'material-light-average': string;
251
- 'material-light-thick': string;
252
- 'material-dark-thin': string;
253
- 'material-dark-average': string;
254
- 'material-dark-thick': string;
255
- 'volt-300': string;
256
- 'volt-400': string;
257
- 'volt-600': string;
258
- 'volt-700': string;
259
- 'volt-800': string;
260
- 'volt-900': string;
261
- 'accent-salmon': string;
262
- 'accent-gold': string;
263
- }
264
-
265
- declare function SquidConfigProvider({ theme, children, }: {
266
- theme?: ConfigTheme;
267
- children?: React.ReactNode;
268
- }): react_jsx_runtime.JSX.Element;
269
-
270
- 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
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/0xsquid/api-widget.git"
6
6
  },
7
7
  "description": "Squid's UI components",
8
- "version": "0.2.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",
@@ -71,7 +73,6 @@
71
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,2 +0,0 @@
1
- export * from './BadgeImage';
2
- export * from './UsdAmount';
@@ -1,3 +0,0 @@
1
- export * from './Input';
2
- export * from './Switch';
3
- export * from './Tooltip';
@@ -1,8 +0,0 @@
1
- export * from './Boost';
2
- export * from './DetailsToolbar';
3
- export * from './Menu';
4
- export * from './Modal';
5
- export * from './NavigationBar';
6
- export * from './ProductCard';
7
- export * from './SwapConfiguration';
8
- export * from './WalletAddress';
@@ -1,5 +0,0 @@
1
- export * from './DropdownMenuItem';
2
- export * from './HistoryItem';
3
- export * from './ListItem';
4
- export * from './MenuItem';
5
- export * from './SectionTitle';
@@ -1,3 +0,0 @@
1
- export * from './BodyText';
2
- export * from './CaptionText';
3
- export * from './HeadingText';
@@ -1 +0,0 @@
1
- export * from './SquidConfigProvider';
@@ -1,2 +0,0 @@
1
- export * from './BadgeImage';
2
- export * from './UsdAmount';
@@ -1,3 +0,0 @@
1
- export * from './Input';
2
- export * from './Switch';
3
- export * from './Tooltip';
@@ -1,8 +0,0 @@
1
- export * from './Boost';
2
- export * from './DetailsToolbar';
3
- export * from './Menu';
4
- export * from './Modal';
5
- export * from './NavigationBar';
6
- export * from './ProductCard';
7
- export * from './SwapConfiguration';
8
- export * from './WalletAddress';
@@ -1,5 +0,0 @@
1
- export * from './DropdownMenuItem';
2
- export * from './HistoryItem';
3
- export * from './ListItem';
4
- export * from './MenuItem';
5
- export * from './SectionTitle';
@@ -1,3 +0,0 @@
1
- export * from './BodyText';
2
- export * from './CaptionText';
3
- export * from './HeadingText';
@@ -1 +0,0 @@
1
- export * from './SquidConfigProvider';