Skip to content

Commit fb32dd9

Browse files
committed
v4.0.0
1 parent 9704ce4 commit fb32dd9

File tree

6 files changed

+16
-17
lines changed

6 files changed

+16
-17
lines changed

__stories__/helpers/components/CodeMarkup.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -97,9 +97,7 @@ const CodeMarkup = memo<CodeMarkupProps>(({
9797
formatFn
9898
}) => (
9999
<CodeMarkupContainer>
100-
<Header>
101-
{header}
102-
</Header>
100+
<Header>{header}</Header>
103101
<PreContainer>
104102
<SyntaxHighlighter
105103
wrapLines

__stories__/helpers/styled/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ export const Li = styled.li`
131131

132132
export const TextHeader = styled.span`
133133
color: #476582;
134-
font-size: 94%;
134+
font-size: 90%;
135135
line-height: 1.7;
136136
border-radius: 4px;
137137
padding: .175em .475em;

src/components/Value/index.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,8 @@ const Value: FunctionComponent<ValueProps> = ({
5555
}
5656

5757
if (!isMulti) {
58-
return <SingleValue>{renderOptionLabel(selectedOption[0].data)}</SingleValue>;
58+
const labelNode = renderOptionLabel(selectedOption[0].data);
59+
return <SingleValue>{labelNode}</SingleValue>;
5960
}
6061

6162
return (

src/hooks/useMenuPositioner.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const useMenuPositioner = (
4747

4848
useUpdateEffect(() => {
4949
if (menuOpen) {
50-
const handleOnMenuOpen = (availableSpace?: number): void => {
50+
const handleOnMenuOpen = (availableSpace?: number) => {
5151
onMenuOpenRef();
5252
if (availableSpace) {
5353
resetMenuHeightRef.current = true;

src/utils/menu.ts

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ function easeOutCubic(t: number, b: number, c: number, d: number): number {
1515
/**
1616
* @private
1717
*/
18-
function getScrollTop(el: Element): number {
18+
function getScrollTop(el: HTMLElement): number {
1919
return isDocumentElement(el) ? window.pageYOffset : el.scrollTop;
2020
}
2121

2222
/**
2323
* @private
2424
*/
25-
function scrollTo(el: Element, top: number): void {
25+
function scrollTo(el: HTMLElement, top: number): void {
2626
isDocumentElement(el) ? window.scrollTo(0, top) : (el.scrollTop = top);
2727
}
2828

2929
/**
3030
* @private
3131
*/
32-
function isDocumentElement(el: Element | typeof window): boolean {
32+
function isDocumentElement(el: HTMLElement | typeof window): boolean {
3333
return el === document.body || el === document.documentElement || el === window;
3434
}
3535

3636
/**
3737
* @private
3838
*/
39-
function getScrollParent(el: Element): Element {
39+
function getScrollParent(el: HTMLElement): HTMLElement {
4040
let style = getComputedStyle(el);
4141
const isParentAbs = style.position === 'absolute';
4242
const overflowRegExp = /(auto|scroll)/;
@@ -45,7 +45,7 @@ function getScrollParent(el: Element): Element {
4545
return document.documentElement;
4646
}
4747

48-
for (let parent: Element | null = el; (parent = parent?.parentElement); ) {
48+
for (let parent: HTMLElement | null = el; (parent = parent?.parentElement);) {
4949
style = getComputedStyle(parent);
5050
if (
5151
!(isParentAbs && style.position === 'static') &&
@@ -62,7 +62,7 @@ function getScrollParent(el: Element): Element {
6262
* @private
6363
*/
6464
function smoothScrollTo(
65-
el: Element,
65+
el: HTMLElement,
6666
to: number,
6767
duration: number = 300,
6868
callback?: CallbackFn
@@ -87,8 +87,8 @@ function smoothScrollTo(
8787
*/
8888
export const calculateMenuTop = (
8989
menuHeight: number,
90-
menuEl: Element | null,
91-
controlEl: Element | null
90+
menuEl: HTMLElement | null,
91+
controlEl: HTMLElement | null
9292
): string => {
9393
const menuElStyle = menuEl && getComputedStyle(menuEl);
9494
const marginBottom = menuElStyle ? parseInt(menuElStyle.marginBottom, 10) : 0;
@@ -101,7 +101,7 @@ export const calculateMenuTop = (
101101
return `calc(${basePx}px + ${adjustPx}px)`;
102102
};
103103

104-
export const menuFitsBelowControl = (el: Element | null): boolean => {
104+
export const menuFitsBelowControl = (el: HTMLElement | null): boolean => {
105105
if (!el) return true;
106106

107107
const scrollParent = getScrollParent(el);
@@ -117,7 +117,7 @@ export const menuFitsBelowControl = (el: Element | null): boolean => {
117117
* scroll can performed to show the menu in full view. Also, execute a callback if defined.
118118
*/
119119
export const scrollMenuIntoViewOnOpen = (
120-
menuEl: Element | null,
120+
menuEl: HTMLElement | null,
121121
menuScrollDuration: number | undefined,
122122
scrollMenuIntoView: boolean | undefined,
123123
handleOnMenuOpen: (availableSpace?: number) => void

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"compilerOptions": {
33
"jsx": "react",
4-
"target": "ES2018",
4+
"target": "ES2020",
55
"module": "ESNext",
66
"moduleResolution": "node",
77
"strict": true,

0 commit comments

Comments
 (0)