@0xsquid/ui 0.16.0 → 0.16.1

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
@@ -6714,8 +6714,8 @@ function SettingsItem({ icon, label, control, link, transparent = false, helpToo
6714
6714
  const helpIcon = !!helpTooltip && (jsxRuntime.jsx(HelpIcon, { className: "tw-cursor-help tw-text-grey-600 hover:tw-text-grey-400" }));
6715
6715
  const showDetailsBorder = !!control && !link && !(control.type === 'switch');
6716
6716
  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 })] }))] }))) })] })) }));
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, isSelected: control.value !== control.resetValueControl.value, onChange: control.onChange, decimalsFormat: control.decimalsFormat, 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", isSelected: control.value !== control.resetValueControl.value, decimalsFormat: control.decimalsFormat, max: control.max, min: control.min })] }))] }))) })] })) }));
6719
6719
  }
6720
6720
 
6721
6721
  function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
@@ -7155,7 +7155,7 @@ function NumericInput({ priceImpactPercentage, balance = '0', error, criticalPri
7155
7155
  : 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
7156
  }
7157
7157
 
7158
- function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }) {
7158
+ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }) {
7159
7159
  const [isInputVisible, setIsInputVisible] = React.useState(false);
7160
7160
  const [inputValue, setInputValue] = React.useState(String(value !== null && value !== void 0 ? value : 0));
7161
7161
  React.useEffect(() => {
@@ -7197,9 +7197,9 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }) {
7197
7197
  const handleCloseInput = React.useCallback(() => {
7198
7198
  setIsInputVisible(false);
7199
7199
  }, []);
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
7200
+ 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
7201
  ? '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) => {
7202
+ : '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
7203
  e.preventDefault();
7204
7204
  handleSubmit(inputValue);
7205
7205
  }, 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 +7299,7 @@ function generateMarkerLines(count) {
7299
7299
  }
7300
7300
 
7301
7301
  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 }) }));
7302
+ 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
7303
  }
7304
7304
 
7305
7305
  var v$5 = "5.10.0";
@@ -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;
@@ -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
@@ -6694,8 +6694,8 @@ function SettingsItem({ icon, label, control, link, transparent = false, helpToo
6694
6694
  const helpIcon = !!helpTooltip && (jsx(HelpIcon, { className: "tw-cursor-help tw-text-grey-600 hover:tw-text-grey-400" }));
6695
6695
  const showDetailsBorder = !!control && !link && !(control.type === 'switch');
6696
6696
  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 })] }))] }))) })] })) }));
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, isSelected: control.value !== control.resetValueControl.value, onChange: control.onChange, decimalsFormat: control.decimalsFormat, 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", isSelected: control.value !== control.resetValueControl.value, decimalsFormat: control.decimalsFormat, max: control.max, min: control.min })] }))] }))) })] })) }));
6699
6699
  }
6700
6700
 
6701
6701
  function SwapDetailListItem({ label, detail, icon, isLoading = false, }) {
@@ -7135,7 +7135,7 @@ function NumericInput({ priceImpactPercentage, balance = '0', error, criticalPri
7135
7135
  : 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
7136
  }
7137
7137
 
7138
- function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }) {
7138
+ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }) {
7139
7139
  const [isInputVisible, setIsInputVisible] = useState(false);
7140
7140
  const [inputValue, setInputValue] = useState(String(value !== null && value !== void 0 ? value : 0));
7141
7141
  useEffect(() => {
@@ -7177,9 +7177,9 @@ function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }) {
7177
7177
  const handleCloseInput = useCallback(() => {
7178
7178
  setIsInputVisible(false);
7179
7179
  }, []);
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
7180
+ 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
7181
  ? '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) => {
7182
+ : '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
7183
  e.preventDefault();
7184
7184
  handleSubmit(inputValue);
7185
7185
  }, 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 +7279,7 @@ function generateMarkerLines(count) {
7279
7279
  }
7280
7280
 
7281
7281
  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 }) }));
7282
+ 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
7283
  }
7284
7284
 
7285
7285
  var v$5 = "5.10.0";
@@ -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;
@@ -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
  }
package/dist/index.d.ts CHANGED
@@ -167,14 +167,15 @@ interface NumericInputProps {
167
167
  declare function NumericInput({ priceImpactPercentage, balance, error, criticalPriceImpactPercentage, token, onAmountChange, forcedAmount, maxDecimals, formatIfVerySmall, showDetails, isLoading, direction, amountUsd, }: NumericInputProps): react_jsx_runtime.JSX.Element;
168
168
 
169
169
  interface SettingsSliderProps {
170
- value: number;
170
+ value: number | undefined;
171
171
  type: 'percentage' | 'amount';
172
172
  onChange?: (value: number | undefined) => void;
173
173
  decimalsFormat?: number;
174
174
  min?: number;
175
175
  max?: number;
176
+ isSelected?: boolean;
176
177
  }
177
- declare function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, }: SettingsSliderProps): react_jsx_runtime.JSX.Element;
178
+ declare function SettingsSlider({ value, type, onChange, decimalsFormat, max, min, isSelected, }: SettingsSliderProps): react_jsx_runtime.JSX.Element;
178
179
 
179
180
  interface SwitchProps {
180
181
  checked?: boolean;
@@ -301,26 +302,27 @@ declare function SectionTitle({ title, icon, accessory, actionIcon, className, .
301
302
 
302
303
  type SettingsControl = {
303
304
  type: 'percentage';
304
- value: number;
305
- onChange: (value: number) => void;
305
+ value: number | undefined;
306
+ onChange: (value: number | undefined) => void;
306
307
  min?: number;
307
308
  max?: number;
308
- hasDecimals?: boolean;
309
+ decimalsFormat?: number;
309
310
  resetValueControl: {
310
311
  label: string;
311
312
  onSelect: () => void;
312
- value: number;
313
+ value: number | undefined;
313
314
  };
314
315
  } | {
315
316
  type: 'amount';
316
- value: number;
317
- onChange: (value: number) => void;
317
+ value: number | undefined;
318
+ onChange: (value: number | undefined) => void;
318
319
  options: {
319
320
  value: number;
320
321
  }[];
322
+ decimalsFormat?: number;
321
323
  resetValueControl: {
322
324
  label: string;
323
- value: number;
325
+ value: number | undefined;
324
326
  };
325
327
  } | {
326
328
  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.1",
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "resolutions": {