@lifi/widget 3.8.0 → 3.8.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/CHANGELOG.md +8 -0
- package/dist/esm/components/Search/SearchInput.d.ts +2 -1
- package/dist/esm/components/Search/SearchInput.js +3 -3
- package/dist/esm/components/Search/SearchInput.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/utils/format.d.ts +1 -1
- package/dist/esm/utils/format.js +3 -3
- package/package.json +1 -1
- package/src/components/Search/SearchInput.tsx +4 -1
- package/src/config/version.ts +1 -1
- package/src/utils/format.ts +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [3.8.1](https://github.com/lifinance/widget/compare/v3.8.0...v3.8.1) (2024-10-21)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* add auto focus for search input field ([#314](https://github.com/lifinance/widget/issues/314)) ([01c1b49](https://github.com/lifinance/widget/commit/01c1b494886247f3f57f0a072041622998c38a53))
|
|
11
|
+
* increase fractional and significant digits ([#313](https://github.com/lifinance/widget/issues/313)) ([06e4df6](https://github.com/lifinance/widget/commit/06e4df69a8cf2221eda87348e685880f02f5473b))
|
|
12
|
+
|
|
5
13
|
## [3.8.0](https://github.com/lifinance/widget/compare/v3.7.0...v3.8.0) (2024-10-18)
|
|
6
14
|
|
|
7
15
|
|
|
@@ -5,7 +5,8 @@ interface SearchInputProps {
|
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
onChange?: FormEventHandler<HTMLInputElement>;
|
|
7
7
|
onBlur?: FocusEventHandler<HTMLInputElement>;
|
|
8
|
+
autoFocus?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export declare const SearchInput: ({ name, placeholder, onChange, onBlur, value, }: SearchInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const SearchInput: ({ name, placeholder, onChange, onBlur, value, autoFocus, }: SearchInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export declare const StickySearchInput: (props: SearchInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
12
|
export {};
|
|
@@ -4,7 +4,7 @@ import { FormControl, InputAdornment } from '@mui/material';
|
|
|
4
4
|
import { InputCard } from '../../components/Card/InputCard.js';
|
|
5
5
|
import { useHeaderHeight } from '../../stores/header/useHeaderStore.js';
|
|
6
6
|
import { Input, StickySearchInputContainer } from './SearchInput.style.js';
|
|
7
|
-
export const SearchInput = ({ name, placeholder, onChange, onBlur, value, }) => {
|
|
7
|
+
export const SearchInput = ({ name, placeholder, onChange, onBlur, value, autoFocus, }) => {
|
|
8
8
|
return (_jsx(InputCard, { children: _jsx(FormControl, { fullWidth: true, children: _jsx(Input, { size: "small", placeholder: placeholder, endAdornment: _jsx(InputAdornment, { position: "end", children: _jsx(Search, {}) }), inputProps: {
|
|
9
9
|
inputMode: 'search',
|
|
10
10
|
onChange,
|
|
@@ -12,10 +12,10 @@ export const SearchInput = ({ name, placeholder, onChange, onBlur, value, }) =>
|
|
|
12
12
|
name,
|
|
13
13
|
value,
|
|
14
14
|
maxLength: 128,
|
|
15
|
-
}, autoComplete: "off" }) }) }));
|
|
15
|
+
}, autoComplete: "off", autoFocus: autoFocus }) }) }));
|
|
16
16
|
};
|
|
17
17
|
export const StickySearchInput = (props) => {
|
|
18
18
|
const { headerHeight } = useHeaderHeight();
|
|
19
|
-
return (_jsx(StickySearchInputContainer, { headerHeight: headerHeight, children: _jsx(SearchInput, { ...props }) }));
|
|
19
|
+
return (_jsx(StickySearchInputContainer, { headerHeight: headerHeight, children: _jsx(SearchInput, { ...props, autoFocus: true }) }));
|
|
20
20
|
};
|
|
21
21
|
//# sourceMappingURL=SearchInput.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../../src/components/Search/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;
|
|
1
|
+
{"version":3,"file":"SearchInput.js","sourceRoot":"","sources":["../../../../src/components/Search/SearchInput.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAE3D,OAAO,EAAE,SAAS,EAAE,MAAM,oCAAoC,CAAA;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAA;AACvE,OAAO,EAAE,KAAK,EAAE,0BAA0B,EAAE,MAAM,wBAAwB,CAAA;AAW1E,MAAM,CAAC,MAAM,WAAW,GAAG,CAAC,EAC1B,IAAI,EACJ,WAAW,EACX,QAAQ,EACR,MAAM,EACN,KAAK,EACL,SAAS,GACQ,EAAE,EAAE;IACrB,OAAO,CACL,KAAC,SAAS,cACR,KAAC,WAAW,IAAC,SAAS,kBACpB,KAAC,KAAK,IACJ,IAAI,EAAC,OAAO,EACZ,WAAW,EAAE,WAAW,EACxB,YAAY,EACV,KAAC,cAAc,IAAC,QAAQ,EAAC,KAAK,YAC5B,KAAC,MAAM,KAAG,GACK,EAEnB,UAAU,EAAE;oBACV,SAAS,EAAE,QAAQ;oBACnB,QAAQ;oBACR,MAAM;oBACN,IAAI;oBACJ,KAAK;oBACL,SAAS,EAAE,GAAG;iBACf,EACD,YAAY,EAAC,KAAK,EAClB,SAAS,EAAE,SAAS,GACpB,GACU,GACJ,CACb,CAAA;AACH,CAAC,CAAA;AAED,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAAC,KAAuB,EAAE,EAAE;IAC3D,MAAM,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAA;IAE1C,OAAO,CACL,KAAC,0BAA0B,IAAC,YAAY,EAAE,YAAY,YACpD,KAAC,WAAW,OAAK,KAAK,EAAE,SAAS,SAAG,GACT,CAC9B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "3.8.
|
|
2
|
+
export declare const version = "3.8.1";
|
package/dist/esm/utils/format.js
CHANGED
|
@@ -3,12 +3,12 @@ const subscriptMap = ['₀', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '
|
|
|
3
3
|
export const precisionFormatter = new Intl.NumberFormat('en', {
|
|
4
4
|
notation: 'standard',
|
|
5
5
|
roundingPriority: 'morePrecision',
|
|
6
|
-
maximumSignificantDigits:
|
|
7
|
-
maximumFractionDigits:
|
|
6
|
+
maximumSignificantDigits: 6,
|
|
7
|
+
maximumFractionDigits: 6,
|
|
8
8
|
useGrouping: false,
|
|
9
9
|
});
|
|
10
10
|
/**
|
|
11
|
-
* Format token amount to at least
|
|
11
|
+
* Format token amount to at least 6 decimals.
|
|
12
12
|
* @param amount amount to format.
|
|
13
13
|
* @returns formatted amount.
|
|
14
14
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "3.8.
|
|
3
|
+
"version": "3.8.1",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -11,6 +11,7 @@ interface SearchInputProps {
|
|
|
11
11
|
placeholder?: string
|
|
12
12
|
onChange?: FormEventHandler<HTMLInputElement>
|
|
13
13
|
onBlur?: FocusEventHandler<HTMLInputElement>
|
|
14
|
+
autoFocus?: boolean
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export const SearchInput = ({
|
|
@@ -19,6 +20,7 @@ export const SearchInput = ({
|
|
|
19
20
|
onChange,
|
|
20
21
|
onBlur,
|
|
21
22
|
value,
|
|
23
|
+
autoFocus,
|
|
22
24
|
}: SearchInputProps) => {
|
|
23
25
|
return (
|
|
24
26
|
<InputCard>
|
|
@@ -40,6 +42,7 @@ export const SearchInput = ({
|
|
|
40
42
|
maxLength: 128,
|
|
41
43
|
}}
|
|
42
44
|
autoComplete="off"
|
|
45
|
+
autoFocus={autoFocus}
|
|
43
46
|
/>
|
|
44
47
|
</FormControl>
|
|
45
48
|
</InputCard>
|
|
@@ -51,7 +54,7 @@ export const StickySearchInput = (props: SearchInputProps) => {
|
|
|
51
54
|
|
|
52
55
|
return (
|
|
53
56
|
<StickySearchInputContainer headerHeight={headerHeight}>
|
|
54
|
-
<SearchInput {...props} />
|
|
57
|
+
<SearchInput {...props} autoFocus />
|
|
55
58
|
</StickySearchInputContainer>
|
|
56
59
|
)
|
|
57
60
|
}
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget'
|
|
2
|
-
export const version = '3.8.
|
|
2
|
+
export const version = '3.8.1'
|
package/src/utils/format.ts
CHANGED
|
@@ -5,13 +5,13 @@ const subscriptMap = ['₀', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '
|
|
|
5
5
|
export const precisionFormatter = new Intl.NumberFormat('en', {
|
|
6
6
|
notation: 'standard',
|
|
7
7
|
roundingPriority: 'morePrecision',
|
|
8
|
-
maximumSignificantDigits:
|
|
9
|
-
maximumFractionDigits:
|
|
8
|
+
maximumSignificantDigits: 6,
|
|
9
|
+
maximumFractionDigits: 6,
|
|
10
10
|
useGrouping: false,
|
|
11
11
|
})
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
|
-
* Format token amount to at least
|
|
14
|
+
* Format token amount to at least 6 decimals.
|
|
15
15
|
* @param amount amount to format.
|
|
16
16
|
* @returns formatted amount.
|
|
17
17
|
*/
|