@0xsquid/ui 0.16.0 → 0.16.2

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/cjs/index.js CHANGED
@@ -2591,8 +2591,8 @@ function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, roun
2591
2591
  imagesLoadState.badgeLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
2592
2592
  }
2593
2593
 
2594
- function LoadingSkeleton({ className, height = '20', }) {
2595
- return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100", height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_1246_29063)", children: jsxRuntime.jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1246_29063)" }) }), jsxRuntime.jsxs("defs", { children: [jsxRuntime.jsxs("linearGradient", { id: "paint0_linear_1246_29063", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient tw-text-material-light-thin", children: [jsxRuntime.jsx("stop", { stopColor: "currentColor" }), jsxRuntime.jsx("stop", { offset: "0.395881", stopColor: "currentColor" }), jsxRuntime.jsx("stop", { offset: "0.597867", stopColor: "currentColor", className: "group-data-[squid-theme-type=dark]:tw-text-material-light-average group-data-[squid-theme-type=light]:tw-text-transparent" }), jsxRuntime.jsx("stop", { offset: "0.697004", stopColor: "currentColor" })] }), jsxRuntime.jsx("clipPath", { id: "clip0_1246_29063", children: jsxRuntime.jsx("path", { d: "M0 10C0 4.47715 4.47715 0 10 0H90C95.5228 0 100 4.47715 100 10C100 15.5228 95.5229 20 90 20H10C4.47716 20 0 15.5228 0 10Z", fill: "white" }) })] }), ' '] }));
2594
+ function LoadingSkeleton({ className, height = '20', width = '100', }) {
2595
+ return (jsxRuntime.jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsxRuntime.jsx("g", { clipPath: "url(#clip0_1246_29063)", children: jsxRuntime.jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1246_29063)" }) }), jsxRuntime.jsxs("defs", { children: [jsxRuntime.jsxs("linearGradient", { id: "paint0_linear_1246_29063", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient tw-text-material-light-thin", children: [jsxRuntime.jsx("stop", { stopColor: "currentColor" }), jsxRuntime.jsx("stop", { offset: "0.395881", stopColor: "currentColor" }), jsxRuntime.jsx("stop", { offset: "0.597867", stopColor: "currentColor", className: "group-data-[squid-theme-type=dark]:tw-text-material-light-average group-data-[squid-theme-type=light]:tw-text-transparent" }), jsxRuntime.jsx("stop", { offset: "0.697004", stopColor: "currentColor" })] }), jsxRuntime.jsx("clipPath", { id: "clip0_1246_29063", children: jsxRuntime.jsx("path", { d: "M0 10C0 4.47715 4.47715 0 10 0H90C95.5228 0 100 4.47715 100 10C100 15.5228 95.5229 20 90 20H10C4.47716 20 0 15.5228 0 10Z", fill: "white" }) })] }), ' '] }));
2596
2596
  }
2597
2597
 
2598
2598
  /******************************************************************************
@@ -6679,13 +6679,26 @@ function ListItem(_a) {
6679
6679
  },
6680
6680
  }
6681
6681
  : {};
6682
+ // There are two possible ways to handle loading state:
6683
+ // Can be boolean or string
6684
+ // If boolean and true, it will show a full loading skeleton
6685
+ // If it's a non empty string, means that we want to display the skeleton + some text
6686
+ const loadingComponent = () => {
6687
+ if ((loading === null || loading === void 0 ? void 0 : loading.subtitle) === true) {
6688
+ return (jsxRuntime.jsx(LoadingSkeleton, { className: "tw-text-grey-500", height: "10", width: "50" }));
6689
+ }
6690
+ if (typeof (loading === null || loading === void 0 ? void 0 : loading.subtitle) === 'string' && loading.subtitle.length > 0) {
6691
+ return (jsxRuntime.jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsxRuntime.jsx(LoadingSkeleton, { className: "tw-text-grey-500", width: "50" }), jsxRuntime.jsx(CaptionText, { className: subtitleClassName, children: loading.subtitle })] }));
6692
+ }
6693
+ return null;
6694
+ };
6682
6695
  const isInteractive = !!props.onClick;
6683
6696
  const ItemTag = isInteractive ? 'button' : 'div';
6684
6697
  const itemProps = isInteractive ? props : {};
6685
6698
  return (jsxRuntime.jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxRuntime.jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsxRuntime.jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsxRuntime.jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsxRuntime.jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsxRuntime.jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxRuntime.jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
6686
6699
  // 'large' variant has extra padding
6687
6700
  size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsxRuntime.jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
6688
- ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsxRuntime.jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxRuntime.jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsxRuntime.jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxRuntime.jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
6701
+ ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (loadingComponent()) : subtitle ? (jsxRuntime.jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsxRuntime.jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxRuntime.jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
6689
6702
  ? 'tw-opacity-0 hover:tw-opacity-100 focus:tw-opacity-100 group-hover/list-item:tw-opacity-100 group-focus/list-item:tw-opacity-100'
6690
6703
  : 'tw-flex', isDetailInteractive && 'hover:tw-bg-material-light-thin', detailButtonClassName), children: [!!detail && (jsxRuntime.jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsxRuntime.jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })) })));
6691
6704
  }
@@ -6714,8 +6727,8 @@ function SettingsItem({ icon, label, control, link, transparent = false, helpToo
6714
6727
  const helpIcon = !!helpTooltip && (jsxRuntime.jsx(HelpIcon, { className: "tw-cursor-help tw-text-grey-600 hover:tw-text-grey-400" }));
6715
6728
  const showDetailsBorder = !!control && !link && !(control.type === 'switch');
6716
6729
  return (jsxRuntime.jsx("li", { className: cn('tw-h-[50px] tw-self-stretch tw-px-squid-xs', transparent ? 'tw-bg-transparent' : 'tw-bg-grey-800'), children: jsxRuntime.jsxs(ContentTag, Object.assign({ className: cn('tw-flex tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xs tw-text-grey-300', link && 'hover:tw-bg-material-light-thin') }, contentTagProps, { children: [icon, jsxRuntime.jsxs("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-self-stretch", children: [jsxRuntime.jsx(BodyText, { size: "small", children: label }), helpTooltip ? (jsxRuntime.jsx(Tooltip, Object.assign({}, helpTooltip, { children: helpIcon }))) : (jsxRuntime.jsx(jsxRuntime.Fragment, { children: helpIcon }))] }), jsxRuntime.jsx("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-justify-center tw-rounded-squid-xs', showDetailsBorder &&
6717
- 'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsxRuntime.jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (!!control && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [control.type === 'amount' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { onClick: () => control.onChange(control.resetValueControl.value), label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value }), control.options.map(({ value }, index, _controls) => (jsxRuntime.jsx(SettingsButton, { label: '$' + value, isSelected: control.value === value, onClick: () => control.onChange(value) }, index))), jsxRuntime.jsx(SettingsSlider, { type: control.type, value: control.value, onChange: control.onChange, hasDecimals: false, max: 999 })] })), control.type === 'switch' &&
6718
- (control.tooltip ? (jsxRuntime.jsx(Tooltip, Object.assign({}, control.tooltip, { children: jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }) }))) : (jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }))), control.type === 'percentage' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value, onClick: control.resetValueControl.onSelect }), jsxRuntime.jsx(SettingsSlider, { onChange: control.onChange, value: control.value, type: "percentage", hasDecimals: control.hasDecimals, max: control.max, min: control.min })] }))] }))) })] })) }));
6730
+ 'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsxRuntime.jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (!!control && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [control.type === 'amount' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { onClick: () => control.onChange(control.resetValueControl.value), label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value }), control.options.map(({ value }, index, _controls) => (jsxRuntime.jsx(SettingsButton, { label: '$' + value, isSelected: control.value === value, onClick: () => control.onChange(value) }, index))), jsxRuntime.jsx(SettingsSlider, { type: control.type, value: control.value, isSelected: control.value !== control.resetValueControl.value, onChange: control.onChange, decimalsFormat: control.decimalsFormat, max: 999 })] })), control.type === 'switch' &&
6731
+ (control.tooltip ? (jsxRuntime.jsx(Tooltip, Object.assign({}, control.tooltip, { children: jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }) }))) : (jsxRuntime.jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }))), control.type === 'percentage' && (jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [jsxRuntime.jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value, onClick: control.resetValueControl.onSelect }), jsxRuntime.jsx(SettingsSlider, { onChange: control.onChange, value: control.value, type: "percentage", isSelected: control.value !== control.resetValueControl.value, decimalsFormat: control.decimalsFormat, max: control.max, min: control.min })] }))] }))) })] })) }));
6719
6732
  }
6720
6733
 
6721
6734
  function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
@@ -7155,7 +7168,7 @@ function NumericInput({ priceImpactPercentage, balance = '0', error, criticalPri
7155
7168
  : amountFormatted }), ' ', jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: token.symbol })] })), priceImpactPercentage && direction === 'to' ? (jsxRuntime.jsxs("span", { className: cn('tw-flex tw-items-center', priceImpactClass), children: [jsxRuntime.jsx(ArrowTriangle, {}), jsxRuntime.jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] })), jsxRuntime.jsxs(BalanceChipTag, { onClick: onBalanceButtonClick, className: cn(buttonClassName, isInteractive && interactiveChipClassName), children: [jsxRuntime.jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxRuntime.jsxs(CaptionText, { children: [balanceFormatted, " ", token.symbol] }), jsxRuntime.jsx(MaxIcon, {})] })] }))] }));
7156
7169
  }
7157
7170
 
7158
- function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }) {
7171
+ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }) {
7159
7172
  const [isInputVisible, setIsInputVisible] = React.useState(false);
7160
7173
  const [inputValue, setInputValue] = React.useState(String(value !== null && value !== void 0 ? value : 0));
7161
7174
  React.useEffect(() => {
@@ -7197,9 +7210,9 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }) {
7197
7210
  const handleCloseInput = React.useCallback(() => {
7198
7211
  setIsInputVisible(false);
7199
7212
  }, []);
7200
- return (jsxRuntime.jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxRuntime.jsxs("button", { className: cn('tw-relative tw-flex tw-h-[32px] tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xs tw-pr-[40px] tw-text-left tw-text-caption !tw-font-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', value === 0 || value === undefined
7213
+ return (jsxRuntime.jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxRuntime.jsxs("button", { className: cn('tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xs tw-pr-[40px] tw-text-left tw-text-caption !tw-font-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', value === 0 || value === undefined
7201
7214
  ? 'tw-text-grey-600'
7202
- : 'tw-text-grey-300', isInputVisible ? 'tw-bg-material-light-thin' : 'tw-bg-transparent'), children: [value !== null && value !== void 0 ? value : 0, jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === 'percentage' ? '%' : '$' })] }), jsxRuntime.jsx("button", { onClick: handleOpenInput, className: "tw-absolute tw-right-squid-xs tw-flex tw-h-[26px] tw-w-[26px] tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-xxs !tw-font-medium tw-leading-[10px] hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(Chip, { icon: jsxRuntime.jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsxRuntime.jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsxRuntime.jsx("form", { onSubmit: (e) => {
7215
+ : 'tw-text-grey-300', isInputVisible ? 'tw-bg-material-light-thin' : 'tw-bg-transparent', isSelected && 'tw-outline tw-outline-2 tw-outline-royal-500'), children: [value !== null && value !== void 0 ? value : 0, jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === 'percentage' ? '%' : '$' })] }), jsxRuntime.jsx("button", { onClick: handleOpenInput, className: "tw-absolute tw-right-squid-xs tw-flex tw-h-[26px] tw-w-[26px] tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-xxs !tw-font-medium tw-leading-[10px] hover:tw-bg-material-light-thin", children: jsxRuntime.jsx(Chip, { icon: jsxRuntime.jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsxRuntime.jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsxRuntime.jsx("form", { onSubmit: (e) => {
7203
7216
  e.preventDefault();
7204
7217
  handleSubmit(inputValue);
7205
7218
  }, children: jsxRuntime.jsx(Input, { autoFocus: true, min: min, max: max, onKeyDown: handleKeyDown, step: decimalsFormat, placeholder: "0", type: "number", defaultValue: value, value: inputValue, onChange: (e) => {
@@ -7299,7 +7312,7 @@ function generateMarkerLines(count) {
7299
7312
  }
7300
7313
 
7301
7314
  function SettingsButton({ label, isSelected = false, onClick, }) {
7302
- return (jsxRuntime.jsx("button", { onClick: onClick, className: cn('tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', isSelected && 'tw-outline-royal-500'), children: jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
7315
+ return (jsxRuntime.jsx("button", { onClick: onClick, className: cn('tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', isSelected && 'tw-outline tw-outline-2 tw-outline-royal-500'), children: jsxRuntime.jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
7303
7316
  }
7304
7317
 
7305
7318
  var v$5 = "5.10.0";
@@ -1,4 +1,5 @@
1
- export declare function LoadingSkeleton({ className, height, }: {
1
+ export declare function LoadingSkeleton({ className, height, width, }: {
2
2
  className?: string;
3
3
  height?: string;
4
+ width?: string;
4
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,10 @@
1
1
  export interface SettingsSliderProps {
2
- value: number;
2
+ value: number | undefined;
3
3
  type: 'percentage' | 'amount';
4
4
  onChange?: (value: number | undefined) => void;
5
5
  decimalsFormat?: number;
6
6
  min?: number;
7
7
  max?: number;
8
+ isSelected?: boolean;
8
9
  }
9
- export declare function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }: SettingsSliderProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }: SettingsSliderProps): import("react/jsx-runtime").JSX.Element;
@@ -16,7 +16,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
16
16
  rounded?: boolean;
17
17
  detailButtonClassName?: string;
18
18
  loading?: {
19
- subtitle?: boolean;
19
+ subtitle?: boolean | string;
20
20
  };
21
21
  containerProps?: React.HTMLAttributes<HTMLLIElement>;
22
22
  }
@@ -2,26 +2,27 @@
2
2
  import { TooltipProps } from '../controls';
3
3
  export type SettingsControl = {
4
4
  type: 'percentage';
5
- value: number;
6
- onChange: (value: number) => void;
5
+ value: number | undefined;
6
+ onChange: (value: number | undefined) => void;
7
7
  min?: number;
8
8
  max?: number;
9
- hasDecimals?: boolean;
9
+ decimalsFormat?: number;
10
10
  resetValueControl: {
11
11
  label: string;
12
12
  onSelect: () => void;
13
- value: number;
13
+ value: number | undefined;
14
14
  };
15
15
  } | {
16
16
  type: 'amount';
17
- value: number;
18
- onChange: (value: number) => void;
17
+ value: number | undefined;
18
+ onChange: (value: number | undefined) => void;
19
19
  options: {
20
20
  value: number;
21
21
  }[];
22
+ decimalsFormat?: number;
22
23
  resetValueControl: {
23
24
  label: string;
24
- value: number;
25
+ value: number | undefined;
25
26
  };
26
27
  } | {
27
28
  type: 'switch';
package/dist/esm/index.js CHANGED
@@ -2571,8 +2571,8 @@ function BadgeImage({ imageUrl, badgeUrl, size = 'sm', extraMarginForBadge, roun
2571
2571
  imagesLoadState.badgeLoaded ? 'tw-block' : 'tw-hidden') })] })) : null] })) : null;
2572
2572
  }
2573
2573
 
2574
- function LoadingSkeleton({ className, height = '20', }) {
2575
- return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: "100", height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsx("g", { clipPath: "url(#clip0_1246_29063)", children: jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1246_29063)" }) }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_1246_29063", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient tw-text-material-light-thin", children: [jsx("stop", { stopColor: "currentColor" }), jsx("stop", { offset: "0.395881", stopColor: "currentColor" }), jsx("stop", { offset: "0.597867", stopColor: "currentColor", className: "group-data-[squid-theme-type=dark]:tw-text-material-light-average group-data-[squid-theme-type=light]:tw-text-transparent" }), jsx("stop", { offset: "0.697004", stopColor: "currentColor" })] }), jsx("clipPath", { id: "clip0_1246_29063", children: jsx("path", { d: "M0 10C0 4.47715 4.47715 0 10 0H90C95.5228 0 100 4.47715 100 10C100 15.5228 95.5229 20 90 20H10C4.47716 20 0 15.5228 0 10Z", fill: "white" }) })] }), ' '] }));
2574
+ function LoadingSkeleton({ className, height = '20', width = '100', }) {
2575
+ return (jsxs("svg", { xmlns: "http://www.w3.org/2000/svg", width: width, height: height, viewBox: "0 0 100 20", fill: "none", className: className, children: [jsx("g", { clipPath: "url(#clip0_1246_29063)", children: jsx("rect", { width: "100", height: "20", fill: "url(#paint0_linear_1246_29063)" }) }), jsxs("defs", { children: [jsxs("linearGradient", { id: "paint0_linear_1246_29063", x1: "0", y1: "10", x2: "100", y2: "10", gradientUnits: "userSpaceOnUse", className: "tw-animate-loading-gradient tw-text-material-light-thin", children: [jsx("stop", { stopColor: "currentColor" }), jsx("stop", { offset: "0.395881", stopColor: "currentColor" }), jsx("stop", { offset: "0.597867", stopColor: "currentColor", className: "group-data-[squid-theme-type=dark]:tw-text-material-light-average group-data-[squid-theme-type=light]:tw-text-transparent" }), jsx("stop", { offset: "0.697004", stopColor: "currentColor" })] }), jsx("clipPath", { id: "clip0_1246_29063", children: jsx("path", { d: "M0 10C0 4.47715 4.47715 0 10 0H90C95.5228 0 100 4.47715 100 10C100 15.5228 95.5229 20 90 20H10C4.47716 20 0 15.5228 0 10Z", fill: "white" }) })] }), ' '] }));
2576
2576
  }
2577
2577
 
2578
2578
  /******************************************************************************
@@ -6659,13 +6659,26 @@ function ListItem(_a) {
6659
6659
  },
6660
6660
  }
6661
6661
  : {};
6662
+ // There are two possible ways to handle loading state:
6663
+ // Can be boolean or string
6664
+ // If boolean and true, it will show a full loading skeleton
6665
+ // If it's a non empty string, means that we want to display the skeleton + some text
6666
+ const loadingComponent = () => {
6667
+ if ((loading === null || loading === void 0 ? void 0 : loading.subtitle) === true) {
6668
+ return (jsx(LoadingSkeleton, { className: "tw-text-grey-500", height: "10", width: "50" }));
6669
+ }
6670
+ if (typeof (loading === null || loading === void 0 ? void 0 : loading.subtitle) === 'string' && loading.subtitle.length > 0) {
6671
+ return (jsxs("span", { className: "tw-flex tw-items-center tw-gap-squid-xxs", children: [jsx(LoadingSkeleton, { className: "tw-text-grey-500", width: "50" }), jsx(CaptionText, { className: subtitleClassName, children: loading.subtitle })] }));
6672
+ }
6673
+ return null;
6674
+ };
6662
6675
  const isInteractive = !!props.onClick;
6663
6676
  const ItemTag = isInteractive ? 'button' : 'div';
6664
6677
  const itemProps = isInteractive ? props : {};
6665
6678
  return (jsx("li", Object.assign({}, containerProps, { className: cn('tw-flex tw-max-w-full tw-bg-grey-900 tw-text-grey-300', listItemSizeMap[size], className), children: jsxs(ItemTag, Object.assign({}, itemProps, { className: cn('tw-group/list-item tw-flex tw-w-full tw-max-w-full tw-items-center tw-justify-start tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xxs', isSelected && 'tw-bg-material-light-thin', isInteractive && 'hover:tw-bg-material-light-thin'), children: [size === 'large' ? (jsx("div", { className: "tw-h-10 tw-w-10", children: mainIcon ? (mainIcon) : (jsx(BadgeImage, { extraMarginForBadge: false, imageUrl: mainImageUrl, badgeUrl: secondaryImageUrl, size: "md", rounded: rounded })) })) : (jsx("div", { className: "tw-flex tw-min-h-[30px] tw-min-w-[30px] tw-items-center tw-justify-center", children: mainIcon ? (mainIcon) : (jsx("img", { src: mainImageUrl, className: "tw-h-[30px] tw-w-[30px] tw-rounded-squid-xs" })) })), jsxs("div", { className: cn('tw-flex tw-h-[40px] tw-flex-1 tw-flex-col tw-items-start tw-justify-center tw-gap-squid-xxs',
6666
6679
  // 'large' variant has extra padding
6667
6680
  size === 'large' ? 'tw-w-[56%] tw-pl-squid-xxs' : 'tw-w-[67%]'), children: [typeof itemTitle === 'string' ? (jsx(BodyText, { size: "small", className: cn('tw-max-w-full tw-truncate', subtitle && 'tw-h-[17px] !tw-leading-[17px]'), children: itemTitle })) : (itemTitle), size === 'large' &&
6668
- ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (jsx(LoadingSkeleton, { className: "-tw-translate-x-6 tw-text-grey-500", height: "10" })) : subtitle ? (jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
6681
+ ((loading === null || loading === void 0 ? void 0 : loading.subtitle) ? (loadingComponent()) : subtitle ? (jsxs(CaptionText, { className: subtitleClassName, children: [subtitleOnHover && (jsx(CaptionText, { className: cn(subtitleClassName, 'tw-hidden group-hover/list-item:tw-block'), children: subtitleOnHover })), subtitle] })) : null)] }), showDetail && (jsxs(DetailTag, Object.assign({}, detailProps, { className: cn('tw-flex tw-w-fit tw-items-center tw-justify-center tw-rounded-squid-xs', size === 'large' ? 'tw-h-squid-xl' : 'tw-h-squid-l', showDetailOnHoverOnly
6669
6682
  ? 'tw-opacity-0 hover:tw-opacity-100 focus:tw-opacity-100 group-hover/list-item:tw-opacity-100 group-focus/list-item:tw-opacity-100'
6670
6683
  : 'tw-flex', isDetailInteractive && 'hover:tw-bg-material-light-thin', detailButtonClassName), children: [!!detail && (jsx(CaptionText, { className: "min-tw-w-4 min-tw-h-4 tw-px-squid-xxs tw-leading-[10px]", children: detail })), icon ? (jsx("span", { className: "tw-flex tw-items-center tw-justify-center tw-px-[3px] tw-py-2", children: icon })) : null] })))] })) })));
6671
6684
  }
@@ -6694,8 +6707,8 @@ function SettingsItem({ icon, label, control, link, transparent = false, helpToo
6694
6707
  const helpIcon = !!helpTooltip && (jsx(HelpIcon, { className: "tw-cursor-help tw-text-grey-600 hover:tw-text-grey-400" }));
6695
6708
  const showDetailsBorder = !!control && !link && !(control.type === 'switch');
6696
6709
  return (jsx("li", { className: cn('tw-h-[50px] tw-self-stretch tw-px-squid-xs', transparent ? 'tw-bg-transparent' : 'tw-bg-grey-800'), children: jsxs(ContentTag, Object.assign({ className: cn('tw-flex tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-s tw-px-squid-xs tw-py-squid-xs tw-text-grey-300', link && 'hover:tw-bg-material-light-thin') }, contentTagProps, { children: [icon, jsxs("div", { className: "tw-flex tw-flex-1 tw-items-center tw-gap-squid-xxs tw-self-stretch", children: [jsx(BodyText, { size: "small", children: label }), helpTooltip ? (jsx(Tooltip, Object.assign({}, helpTooltip, { children: helpIcon }))) : (jsx(Fragment, { children: helpIcon }))] }), jsx("div", { className: cn('tw-flex tw-h-squid-l tw-items-center tw-justify-center tw-rounded-squid-xs', showDetailsBorder &&
6697
- 'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (!!control && (jsxs(Fragment, { children: [control.type === 'amount' && (jsxs(Fragment, { children: [jsx(SettingsButton, { onClick: () => control.onChange(control.resetValueControl.value), label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value }), control.options.map(({ value }, index, _controls) => (jsx(SettingsButton, { label: '$' + value, isSelected: control.value === value, onClick: () => control.onChange(value) }, index))), jsx(SettingsSlider, { type: control.type, value: control.value, onChange: control.onChange, hasDecimals: false, max: 999 })] })), control.type === 'switch' &&
6698
- (control.tooltip ? (jsx(Tooltip, Object.assign({}, control.tooltip, { children: jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }) }))) : (jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }))), control.type === 'percentage' && (jsxs(Fragment, { children: [jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value, onClick: control.resetValueControl.onSelect }), jsx(SettingsSlider, { onChange: control.onChange, value: control.value, type: "percentage", hasDecimals: control.hasDecimals, max: control.max, min: control.min })] }))] }))) })] })) }));
6710
+ 'tw-rounded-squid-xs tw-border tw-border-solid tw-border-material-light-thin tw-bg-material-dark-thin'), children: !!link ? (jsx(SquareArrowTopRight2Icon, { className: "tw-text-material-light-average" })) : (!!control && (jsxs(Fragment, { children: [control.type === 'amount' && (jsxs(Fragment, { children: [jsx(SettingsButton, { onClick: () => control.onChange(control.resetValueControl.value), label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value }), control.options.map(({ value }, index, _controls) => (jsx(SettingsButton, { label: '$' + value, isSelected: control.value === value, onClick: () => control.onChange(value) }, index))), jsx(SettingsSlider, { type: control.type, value: control.value, isSelected: control.value !== control.resetValueControl.value, onChange: control.onChange, decimalsFormat: control.decimalsFormat, max: 999 })] })), control.type === 'switch' &&
6711
+ (control.tooltip ? (jsx(Tooltip, Object.assign({}, control.tooltip, { children: jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }) }))) : (jsx(Switch, { size: "large", checked: control.checked, onChange: control.onChange, disabled: control.disabled }))), control.type === 'percentage' && (jsxs(Fragment, { children: [jsx(SettingsButton, { label: control.resetValueControl.label, isSelected: control.resetValueControl.value === control.value, onClick: control.resetValueControl.onSelect }), jsx(SettingsSlider, { onChange: control.onChange, value: control.value, type: "percentage", isSelected: control.value !== control.resetValueControl.value, decimalsFormat: control.decimalsFormat, max: control.max, min: control.min })] }))] }))) })] })) }));
6699
6712
  }
6700
6713
 
6701
6714
  function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
@@ -7135,7 +7148,7 @@ function NumericInput({ priceImpactPercentage, balance = '0', error, criticalPri
7135
7148
  : amountFormatted }), ' ', jsx(CaptionText, { className: "tw-opacity-66", children: token.symbol })] })), priceImpactPercentage && direction === 'to' ? (jsxs("span", { className: cn('tw-flex tw-items-center', priceImpactClass), children: [jsx(ArrowTriangle, {}), jsx(CaptionText, { bold: true, children: priceImpactPercentage.toString().concat('%') })] })) : null] })), jsxs(BalanceChipTag, { onClick: onBalanceButtonClick, className: cn(buttonClassName, isInteractive && interactiveChipClassName), children: [jsx(CaptionText, { className: "tw-opacity-66", children: "Balance" }), jsxs(CaptionText, { children: [balanceFormatted, " ", token.symbol] }), jsx(MaxIcon, {})] })] }))] }));
7136
7149
  }
7137
7150
 
7138
- function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }) {
7151
+ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }) {
7139
7152
  const [isInputVisible, setIsInputVisible] = useState(false);
7140
7153
  const [inputValue, setInputValue] = useState(String(value !== null && value !== void 0 ? value : 0));
7141
7154
  useEffect(() => {
@@ -7177,9 +7190,9 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }) {
7177
7190
  const handleCloseInput = useCallback(() => {
7178
7191
  setIsInputVisible(false);
7179
7192
  }, []);
7180
- return (jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxs("button", { className: cn('tw-relative tw-flex tw-h-[32px] tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xs tw-pr-[40px] tw-text-left tw-text-caption !tw-font-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', value === 0 || value === undefined
7193
+ return (jsxs("div", { ref: sliderRef, className: "tw-relative tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-rounded-squid-xs", children: [jsxs("button", { className: cn('tw-relative tw-flex tw-h-full tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-p-squid-xs tw-pr-[40px] tw-text-left tw-text-caption !tw-font-medium tw-leading-[10px] placeholder-shown:tw-text-grey-600 hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', value === 0 || value === undefined
7181
7194
  ? 'tw-text-grey-600'
7182
- : 'tw-text-grey-300', isInputVisible ? 'tw-bg-material-light-thin' : 'tw-bg-transparent'), children: [value !== null && value !== void 0 ? value : 0, jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === 'percentage' ? '%' : '$' })] }), jsx("button", { onClick: handleOpenInput, className: "tw-absolute tw-right-squid-xs tw-flex tw-h-[26px] tw-w-[26px] tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-xxs !tw-font-medium tw-leading-[10px] hover:tw-bg-material-light-thin", children: jsx(Chip, { icon: jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsx("form", { onSubmit: (e) => {
7195
+ : 'tw-text-grey-300', isInputVisible ? 'tw-bg-material-light-thin' : 'tw-bg-transparent', isSelected && 'tw-outline tw-outline-2 tw-outline-royal-500'), children: [value !== null && value !== void 0 ? value : 0, jsx(CaptionText, { className: "!tw-font-medium !tw-leading-[10px] tw-text-grey-300", children: type === 'percentage' ? '%' : '$' })] }), jsx("button", { onClick: handleOpenInput, className: "tw-absolute tw-right-squid-xs tw-flex tw-h-[26px] tw-w-[26px] tw-items-center tw-justify-center tw-gap-squid-xs tw-rounded-squid-xxs !tw-font-medium tw-leading-[10px] hover:tw-bg-material-light-thin", children: jsx(Chip, { icon: jsx(ChevronGrabberVerticalIcon, { className: "tw-text-grey-900" }) }) }), isInputVisible && (jsx(Menu, { menuRef: menuRef, containerClassName: "tw-absolute tw-bottom-full tw-z-10 tw-pb-squid-m tw-w-[160px]", children: jsx("form", { onSubmit: (e) => {
7183
7196
  e.preventDefault();
7184
7197
  handleSubmit(inputValue);
7185
7198
  }, children: jsx(Input, { autoFocus: true, min: min, max: max, onKeyDown: handleKeyDown, step: decimalsFormat, placeholder: "0", type: "number", defaultValue: value, value: inputValue, onChange: (e) => {
@@ -7279,7 +7292,7 @@ function generateMarkerLines(count) {
7279
7292
  }
7280
7293
 
7281
7294
  function SettingsButton({ label, isSelected = false, onClick, }) {
7282
- return (jsx("button", { onClick: onClick, className: cn('tw-flex tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', isSelected && 'tw-outline-royal-500'), children: jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
7295
+ return (jsx("button", { onClick: onClick, className: cn('tw-flex tw-h-[30px] tw-items-center tw-justify-center tw-self-stretch tw-rounded-squid-xs tw-border-2 tw-border-transparent tw-p-squid-xs hover:tw-bg-material-light-thin focus:tw-bg-material-light-thin', isSelected && 'tw-outline tw-outline-2 tw-outline-royal-500'), children: jsx(CaptionText, { className: "!tw-font-medium", children: label }) }));
7283
7296
  }
7284
7297
 
7285
7298
  var v$5 = "5.10.0";
@@ -1,4 +1,5 @@
1
- export declare function LoadingSkeleton({ className, height, }: {
1
+ export declare function LoadingSkeleton({ className, height, width, }: {
2
2
  className?: string;
3
3
  height?: string;
4
+ width?: string;
4
5
  }): import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,10 @@
1
1
  export interface SettingsSliderProps {
2
- value: number;
2
+ value: number | undefined;
3
3
  type: 'percentage' | 'amount';
4
4
  onChange?: (value: number | undefined) => void;
5
5
  decimalsFormat?: number;
6
6
  min?: number;
7
7
  max?: number;
8
+ isSelected?: boolean;
8
9
  }
9
- export declare function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }: SettingsSliderProps): import("react/jsx-runtime").JSX.Element;
10
+ export declare function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }: SettingsSliderProps): import("react/jsx-runtime").JSX.Element;
@@ -16,7 +16,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
16
16
  rounded?: boolean;
17
17
  detailButtonClassName?: string;
18
18
  loading?: {
19
- subtitle?: boolean;
19
+ subtitle?: boolean | string;
20
20
  };
21
21
  containerProps?: React.HTMLAttributes<HTMLLIElement>;
22
22
  }
@@ -2,26 +2,27 @@
2
2
  import { TooltipProps } from '../controls';
3
3
  export type SettingsControl = {
4
4
  type: 'percentage';
5
- value: number;
6
- onChange: (value: number) => void;
5
+ value: number | undefined;
6
+ onChange: (value: number | undefined) => void;
7
7
  min?: number;
8
8
  max?: number;
9
- hasDecimals?: boolean;
9
+ decimalsFormat?: number;
10
10
  resetValueControl: {
11
11
  label: string;
12
12
  onSelect: () => void;
13
- value: number;
13
+ value: number | undefined;
14
14
  };
15
15
  } | {
16
16
  type: 'amount';
17
- value: number;
18
- onChange: (value: number) => void;
17
+ value: number | undefined;
18
+ onChange: (value: number | undefined) => void;
19
19
  options: {
20
20
  value: number;
21
21
  }[];
22
+ decimalsFormat?: number;
22
23
  resetValueControl: {
23
24
  label: string;
24
- value: number;
25
+ value: number | undefined;
25
26
  };
26
27
  } | {
27
28
  type: 'switch';
package/dist/index.css CHANGED
@@ -932,10 +932,6 @@ video {
932
932
  height: 30px;
933
933
  }
934
934
 
935
- .tw-h-\[32px\] {
936
- height: 32px;
937
- }
938
-
939
935
  .tw-h-\[40px\] {
940
936
  height: 40px;
941
937
  }
@@ -1377,11 +1373,6 @@ video {
1377
1373
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1378
1374
  }
1379
1375
 
1380
- .-tw-translate-x-6 {
1381
- --tw-translate-x: -1.5rem;
1382
- transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
1383
- }
1384
-
1385
1376
  .tw-rotate-180 {
1386
1377
  --tw-rotate: 180deg;
1387
1378
  transform: translate(var(--tw-translate-x), var(--tw-translate-y)) rotate(var(--tw-rotate)) skewX(var(--tw-skew-x)) skewY(var(--tw-skew-y)) scaleX(var(--tw-scale-x)) scaleY(var(--tw-scale-y));
package/dist/index.d.ts CHANGED
@@ -13,9 +13,10 @@ interface BadgeImageProps {
13
13
  type BadgeSize = 'sm' | 'md';
14
14
  declare function BadgeImage({ imageUrl, badgeUrl, size, extraMarginForBadge, rounded, }: BadgeImageProps): react_jsx_runtime.JSX.Element | null;
15
15
 
16
- declare function LoadingSkeleton({ className, height, }: {
16
+ declare function LoadingSkeleton({ className, height, width, }: {
17
17
  className?: string;
18
18
  height?: string;
19
+ width?: string;
19
20
  }): react_jsx_runtime.JSX.Element;
20
21
 
21
22
  interface UsdAmountProps {
@@ -167,14 +168,15 @@ interface NumericInputProps {
167
168
  declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxDecimals, formatIfVerySmall, showDetails, isLoading, direction, amountUsd, }: NumericInputProps): react_jsx_runtime.JSX.Element;
168
169
 
169
170
  interface SettingsSliderProps {
170
- value: number;
171
+ value: number | undefined;
171
172
  type: 'percentage' | 'amount';
172
173
  onChange?: (value: number | undefined) => void;
173
174
  decimalsFormat?: number;
174
175
  min?: number;
175
176
  max?: number;
177
+ isSelected?: boolean;
176
178
  }
177
- declare function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }: SettingsSliderProps): react_jsx_runtime.JSX.Element;
179
+ declare function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }: SettingsSliderProps): react_jsx_runtime.JSX.Element;
178
180
 
179
181
  interface SwitchProps {
180
182
  checked?: boolean;
@@ -276,7 +278,7 @@ interface ListItemProps extends React.HTMLAttributes<HTMLButtonElement> {
276
278
  rounded?: boolean;
277
279
  detailButtonClassName?: string;
278
280
  loading?: {
279
- subtitle?: boolean;
281
+ subtitle?: boolean | string;
280
282
  };
281
283
  containerProps?: React.HTMLAttributes<HTMLLIElement>;
282
284
  }
@@ -301,26 +303,27 @@ declare function SectionTitle({ title, icon, accessory, actionIcon, className, .
301
303
 
302
304
  type SettingsControl = {
303
305
  type: 'percentage';
304
- value: number;
305
- onChange: (value: number) => void;
306
+ value: number | undefined;
307
+ onChange: (value: number | undefined) => void;
306
308
  min?: number;
307
309
  max?: number;
308
- hasDecimals?: boolean;
310
+ decimalsFormat?: number;
309
311
  resetValueControl: {
310
312
  label: string;
311
313
  onSelect: () => void;
312
- value: number;
314
+ value: number | undefined;
313
315
  };
314
316
  } | {
315
317
  type: 'amount';
316
- value: number;
317
- onChange: (value: number) => void;
318
+ value: number | undefined;
319
+ onChange: (value: number | undefined) => void;
318
320
  options: {
319
321
  value: number;
320
322
  }[];
323
+ decimalsFormat?: number;
321
324
  resetValueControl: {
322
325
  label: string;
323
- value: number;
326
+ value: number | undefined;
324
327
  };
325
328
  } | {
326
329
  type: 'switch';
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "url": "git+https://github.com/0xsquid/squid-ui.git"
6
6
  },
7
7
  "description": "Squid's UI components",
8
- "version": "0.16.0",
8
+ "version": "0.16.2",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "resolutions": {