@0xsquid/ui 0.8.3 → 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 +22 -0
- package/dist/cjs/index.js +104 -65
- package/dist/cjs/types/components/badges/index.d.ts +1 -0
- package/dist/cjs/types/components/controls/Input.d.ts +2 -2
- package/dist/cjs/types/components/controls/Tooltip.d.ts +1 -2
- package/dist/cjs/types/components/layout/DropdownMenu.d.ts +4 -1
- package/dist/cjs/types/components/layout/InfoBox.d.ts +8 -0
- package/dist/cjs/types/components/layout/Menu.d.ts +2 -1
- package/dist/cjs/types/components/layout/index.d.ts +1 -0
- package/dist/cjs/types/components/lists/DropdownMenuItem.d.ts +2 -1
- package/dist/cjs/types/components/lists/HistoryItem.d.ts +3 -1
- package/dist/cjs/types/components/lists/SettingsItem.d.ts +4 -1
- package/dist/cjs/types/hooks/index.d.ts +1 -1
- package/dist/cjs/types/hooks/useDropdownMenu.d.ts +10 -0
- package/dist/cjs/types/stories/buttons/AssetsButton.stories.d.ts +2 -1
- package/dist/cjs/types/stories/layout/InfoBox.stories.d.ts +7 -0
- package/dist/cjs/types/stories/lists/HistoryItem.stories.d.ts +1 -0
- package/dist/cjs/types/stories/lists/SettingsItem.stories.d.ts +2 -0
- package/dist/esm/index.js +102 -65
- package/dist/esm/types/components/badges/index.d.ts +1 -0
- package/dist/esm/types/components/controls/Input.d.ts +2 -2
- package/dist/esm/types/components/controls/Tooltip.d.ts +1 -2
- package/dist/esm/types/components/layout/DropdownMenu.d.ts +4 -1
- package/dist/esm/types/components/layout/InfoBox.d.ts +8 -0
- package/dist/esm/types/components/layout/Menu.d.ts +2 -1
- package/dist/esm/types/components/layout/index.d.ts +1 -0
- package/dist/esm/types/components/lists/DropdownMenuItem.d.ts +2 -1
- package/dist/esm/types/components/lists/HistoryItem.d.ts +3 -1
- package/dist/esm/types/components/lists/SettingsItem.d.ts +4 -1
- package/dist/esm/types/hooks/index.d.ts +1 -1
- package/dist/esm/types/hooks/useDropdownMenu.d.ts +10 -0
- package/dist/esm/types/stories/buttons/AssetsButton.stories.d.ts +2 -1
- package/dist/esm/types/stories/layout/InfoBox.stories.d.ts +7 -0
- package/dist/esm/types/stories/lists/HistoryItem.stories.d.ts +1 -0
- package/dist/esm/types/stories/lists/SettingsItem.stories.d.ts +2 -0
- package/dist/index.css +34 -10
- package/dist/index.d.ts +34 -14
- package/package.json +1 -1
- package/dist/cjs/types/hooks/useModal.d.ts +0 -10
- package/dist/esm/types/hooks/useModal.d.ts +0 -10
package/dist/index.d.ts
CHANGED
|
@@ -12,6 +12,11 @@ interface BadgeImageProps {
|
|
|
12
12
|
type BadgeSize = 'sm' | 'md';
|
|
13
13
|
declare function BadgeImage({ imageUrl, badgeUrl, size, extraMarginForBadge, rounded, }: BadgeImageProps): react_jsx_runtime.JSX.Element | null;
|
|
14
14
|
|
|
15
|
+
declare function LoadingSkeleton({ className, height, }: {
|
|
16
|
+
className?: string;
|
|
17
|
+
height?: string;
|
|
18
|
+
}): react_jsx_runtime.JSX.Element;
|
|
19
|
+
|
|
15
20
|
interface UsdAmountProps {
|
|
16
21
|
usdAmount: string;
|
|
17
22
|
}
|
|
@@ -101,10 +106,10 @@ interface InputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
|
101
106
|
showIcon?: boolean;
|
|
102
107
|
showPasteButton?: boolean;
|
|
103
108
|
icon?: React.ReactNode;
|
|
104
|
-
|
|
109
|
+
isError?: boolean;
|
|
105
110
|
onPasteButtonClick?: () => void;
|
|
106
111
|
}
|
|
107
|
-
declare function Input({ placeholder, showIcon, showPasteButton, className, icon,
|
|
112
|
+
declare function Input({ placeholder, showIcon, showPasteButton, className, icon, isError, onPasteButtonClick, ...props }: InputProps): react_jsx_runtime.JSX.Element;
|
|
108
113
|
|
|
109
114
|
interface Props extends InputHTMLAttributes<HTMLInputElement> {
|
|
110
115
|
onParsedValueChanged: (value: string) => void;
|
|
@@ -180,8 +185,9 @@ interface DropdownMenuItemProps {
|
|
|
180
185
|
labelClassName?: string;
|
|
181
186
|
imageUrl?: string;
|
|
182
187
|
icon?: React.ReactNode;
|
|
188
|
+
onClick?: () => void;
|
|
183
189
|
}
|
|
184
|
-
declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
190
|
+
declare function DropdownMenuItem({ label, imageUrl, icon, labelClassName, onClick, }: DropdownMenuItemProps): react_jsx_runtime.JSX.Element;
|
|
185
191
|
|
|
186
192
|
interface HistoryItemProps {
|
|
187
193
|
firstImageUrl: string;
|
|
@@ -193,8 +199,9 @@ interface HistoryItemProps {
|
|
|
193
199
|
dateCompleted: string;
|
|
194
200
|
fromAmount: string;
|
|
195
201
|
toAmount: string;
|
|
202
|
+
dropdownMenuItems?: DropdownMenuItemProps[];
|
|
196
203
|
}
|
|
197
|
-
declare function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, pendingLabel, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
|
|
204
|
+
declare function HistoryItem({ firstImageUrl, secondImageUrl, isPending, dateCompleted, fromAmount, fromLabel, toAmount, toLabel, pendingLabel, dropdownMenuItems, }: HistoryItemProps): react_jsx_runtime.JSX.Element;
|
|
198
205
|
|
|
199
206
|
interface ListItemProps extends React.HTMLAttributes<HTMLLIElement> {
|
|
200
207
|
itemTitle: string | React.ReactNode;
|
|
@@ -241,8 +248,10 @@ interface SettingsItemProps {
|
|
|
241
248
|
transparentControls?: boolean;
|
|
242
249
|
showHelpIcon?: boolean;
|
|
243
250
|
link?: string;
|
|
251
|
+
transparent?: boolean;
|
|
252
|
+
helpTooltip?: Omit<TooltipProps, 'children'>;
|
|
244
253
|
}
|
|
245
|
-
declare function SettingsItem({ icon, label, controls, transparentControls, showHelpIcon, link, }: SettingsItemProps): react_jsx_runtime.JSX.Element;
|
|
254
|
+
declare function SettingsItem({ icon, label, controls, transparentControls, showHelpIcon, link, transparent, helpTooltip, }: SettingsItemProps): react_jsx_runtime.JSX.Element;
|
|
246
255
|
|
|
247
256
|
interface SwapDetailListItemProps {
|
|
248
257
|
label: string;
|
|
@@ -263,10 +272,13 @@ declare function SwapStepItem({ descriptionBlocks, chipContent, showStepSeparato
|
|
|
263
272
|
|
|
264
273
|
interface DropdownMenuProps {
|
|
265
274
|
dropdownRef?: React.RefObject<HTMLDivElement>;
|
|
275
|
+
menuRef?: React.RefObject<HTMLDivElement>;
|
|
266
276
|
items: DropdownMenuItemProps[];
|
|
267
277
|
className?: string;
|
|
278
|
+
isHidden?: boolean;
|
|
279
|
+
listClassName?: string;
|
|
268
280
|
}
|
|
269
|
-
declare function DropdownMenu({ dropdownRef, items, className, }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
|
|
281
|
+
declare function DropdownMenu({ dropdownRef, items, className, menuRef, isHidden, listClassName, }: DropdownMenuProps): react_jsx_runtime.JSX.Element;
|
|
270
282
|
|
|
271
283
|
type ErrorMessageProps = {
|
|
272
284
|
message: string;
|
|
@@ -274,6 +286,13 @@ type ErrorMessageProps = {
|
|
|
274
286
|
};
|
|
275
287
|
declare function ErrorMessage({ message, showIcon }: ErrorMessageProps): react_jsx_runtime.JSX.Element;
|
|
276
288
|
|
|
289
|
+
interface InfoBoxProps {
|
|
290
|
+
title: string;
|
|
291
|
+
description: string;
|
|
292
|
+
icon?: React.ReactNode;
|
|
293
|
+
}
|
|
294
|
+
declare function InfoBox({ title, description, icon }: InfoBoxProps): react_jsx_runtime.JSX.Element;
|
|
295
|
+
|
|
277
296
|
type Rounded = 'sm' | 'lg';
|
|
278
297
|
interface MenuProps extends React$1.ComponentProps<'div'> {
|
|
279
298
|
containerClassName?: string;
|
|
@@ -281,8 +300,9 @@ interface MenuProps extends React$1.ComponentProps<'div'> {
|
|
|
281
300
|
title?: string;
|
|
282
301
|
displayControls?: boolean;
|
|
283
302
|
rounded?: Rounded;
|
|
303
|
+
menuRef?: React$1.RefObject<HTMLDivElement>;
|
|
284
304
|
}
|
|
285
|
-
declare function Menu({ children, containerClassName, contentClassName, title, displayControls, rounded, ...props }: MenuProps): react_jsx_runtime.JSX.Element;
|
|
305
|
+
declare function Menu({ children, containerClassName, contentClassName, title, displayControls, rounded, menuRef, ...props }: MenuProps): react_jsx_runtime.JSX.Element;
|
|
286
306
|
|
|
287
307
|
interface ModalProps {
|
|
288
308
|
children: React.ReactNode;
|
|
@@ -424,14 +444,14 @@ declare function SquidConfigProvider({ theme, children, themeType, }: {
|
|
|
424
444
|
themeType?: ThemeType;
|
|
425
445
|
}): react_jsx_runtime.JSX.Element;
|
|
426
446
|
|
|
427
|
-
declare function
|
|
447
|
+
declare function useDropdownMenu(props?: {
|
|
428
448
|
initialIsModalOpen?: boolean;
|
|
429
449
|
}): {
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
450
|
+
isDropdownOpen: boolean;
|
|
451
|
+
openDropdown: () => void;
|
|
452
|
+
closeDropdown: () => void;
|
|
453
|
+
dropdownRef: React.RefObject<HTMLDivElement>;
|
|
454
|
+
openDropdownButtonRef: React.RefObject<HTMLButtonElement>;
|
|
435
455
|
};
|
|
436
456
|
|
|
437
|
-
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, Input, ListItem, Menu, MenuItem, Modal, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipThreshold, type TooltipWidth, UsdAmount,
|
|
457
|
+
export { AddressButton, ArrowButton, AssetsButton, BadgeImage, BodyText, Boost, BoostButton, Button, CaptionText, Chip, DetailsToolbar, DropdownMenu, DropdownMenuItem, type DropdownMenuItemProps, ErrorMessage, FeeButton, HeadingText, HistoryItem, InfoBox, Input, ListItem, LoadingSkeleton, Menu, MenuItem, Modal, NavigationBar, NumericInput, ProductCard, ProfileHeaderBackground, SectionTitle, SettingsButton, type SettingsButtonProps, SettingsItem, type SettingsItemProps, SettingsSlider, type SettingsSliderProps, SquidConfigProvider, type SquidTheme, SwapConfiguration, SwapDetailListItem, SwapProgressViewHeader, SwapStepItem, SwapStepsCollapsed, Switch, TokenPair, Tooltip, type TooltipProps, type TooltipThreshold, type TooltipWidth, UsdAmount, useDropdownMenu };
|
package/package.json
CHANGED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare function useModal(props?: {
|
|
3
|
-
initialIsModalOpen?: boolean;
|
|
4
|
-
}): {
|
|
5
|
-
isModalOpen: boolean;
|
|
6
|
-
openModal: () => void;
|
|
7
|
-
closeModal: () => void;
|
|
8
|
-
modalRef: React.RefObject<HTMLDivElement>;
|
|
9
|
-
openModalButtonRef: React.RefObject<HTMLButtonElement>;
|
|
10
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
export declare function useModal(props?: {
|
|
3
|
-
initialIsModalOpen?: boolean;
|
|
4
|
-
}): {
|
|
5
|
-
isModalOpen: boolean;
|
|
6
|
-
openModal: () => void;
|
|
7
|
-
closeModal: () => void;
|
|
8
|
-
modalRef: React.RefObject<HTMLDivElement>;
|
|
9
|
-
openModalButtonRef: React.RefObject<HTMLButtonElement>;
|
|
10
|
-
};
|