Skip to content

Commit b8de3b6

Browse files
committed
Unify component exports
1 parent afb4e50 commit b8de3b6

File tree

7 files changed

+22
-28
lines changed

7 files changed

+22
-28
lines changed

src/chakra-components/control.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import type {
1818
import type { SizeProps } from "../types";
1919
import { useSize } from "../utils";
2020

21-
const Control = <
21+
export const Control = <
2222
Option,
2323
IsMulti extends boolean,
2424
Group extends GroupBase<Option>,
@@ -348,5 +348,3 @@ export const LoadingIndicator = <
348348
/>
349349
);
350350
};
351-
352-
export default Control;

src/chakra-components/index.ts

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,31 @@ import {
33
SelectContainer,
44
ValueContainer,
55
} from "./containers";
6-
import Control, {
6+
import {
77
ClearIndicator,
8+
Control,
89
DropdownIndicator,
910
IndicatorSeparator,
1011
LoadingIndicator,
1112
} from "./control";
12-
import Input from "./input";
13-
import Menu, {
13+
import { Input } from "./input";
14+
import {
1415
Group,
1516
GroupHeading,
1617
LoadingMessage,
18+
Menu,
1719
MenuList,
1820
NoOptionsMessage,
1921
Option,
2022
} from "./menu";
21-
import MultiValue, {
23+
import {
24+
MultiValue,
2225
MultiValueContainer,
2326
MultiValueLabel,
2427
MultiValueRemove,
2528
} from "./multi-value";
26-
import Placeholder from "./placeholder";
27-
import SingleValue from "./single-value";
29+
import { Placeholder } from "./placeholder";
30+
import { SingleValue } from "./single-value";
2831

2932
const chakraComponents = {
3033
ClearIndicator,

src/chakra-components/input.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import type { SystemStyleObject } from "@chakra-ui/react";
33
import type { GroupBase, InputProps } from "react-select";
44
import { cleanCommonProps } from "../utils";
55

6-
const Input = <
6+
export const Input = <
77
Option,
88
IsMulti extends boolean,
99
Group extends GroupBase<Option>,
@@ -79,5 +79,3 @@ const Input = <
7979
</Box>
8080
);
8181
};
82-
83-
export default Input;

src/chakra-components/menu.tsx

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ const alignToControl = (placement: CoercedMenuPlacement) => {
2424
return placement ? placementToCSSProp[placement] : "top";
2525
};
2626

27-
const Menu = <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(
27+
export const Menu = <
28+
Option,
29+
IsMulti extends boolean,
30+
Group extends GroupBase<Option>,
31+
>(
2832
props: MenuProps<Option, IsMulti, Group>
2933
) => {
3034
const {
@@ -63,8 +67,6 @@ const Menu = <Option, IsMulti extends boolean, Group extends GroupBase<Option>>(
6367
);
6468
};
6569

66-
export default Menu;
67-
6870
export const MenuList = <
6971
Option,
7072
IsMulti extends boolean,

src/chakra-components/multi-value.tsx

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const hasIsFixed = (option: unknown): option is { isFixed: boolean } =>
2626
"isFixed" in option &&
2727
typeof option.isFixed === "boolean";
2828

29-
const MultiValue = <
29+
export const MultiValue = <
3030
Option = unknown,
3131
IsMulti extends boolean = boolean,
3232
Group extends GroupBase<Option> = GroupBase<Option>,
@@ -166,7 +166,7 @@ const MultiValue = <
166166
);
167167
};
168168

169-
const MultiValueContainer = <
169+
export const MultiValueContainer = <
170170
Option = unknown,
171171
IsMulti extends boolean = boolean,
172172
Group extends GroupBase<Option> = GroupBase<Option>,
@@ -182,7 +182,7 @@ const MultiValueContainer = <
182182
);
183183
};
184184

185-
const MultiValueLabel = <
185+
export const MultiValueLabel = <
186186
Option = unknown,
187187
IsMulti extends boolean = boolean,
188188
Group extends GroupBase<Option> = GroupBase<Option>,
@@ -212,7 +212,7 @@ const TagCloseIcon = (props: IconProps) => (
212212
</Icon>
213213
);
214214

215-
const MultiValueRemove = <
215+
export const MultiValueRemove = <
216216
Option = unknown,
217217
IsMulti extends boolean = boolean,
218218
Group extends GroupBase<Option> = GroupBase<Option>,
@@ -237,6 +237,3 @@ const MultiValueRemove = <
237237
</Box>
238238
);
239239
};
240-
241-
export { MultiValueContainer, MultiValueLabel, MultiValueRemove };
242-
export default MultiValue;

src/chakra-components/placeholder.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Box } from "@chakra-ui/react";
22
import type { SystemStyleObject } from "@chakra-ui/react";
33
import type { GroupBase, PlaceholderProps } from "react-select";
44

5-
const Placeholder = <
5+
export const Placeholder = <
66
Option,
77
IsMulti extends boolean,
88
Group extends GroupBase<Option>,
@@ -43,5 +43,3 @@ const Placeholder = <
4343
</Box>
4444
);
4545
};
46-
47-
export default Placeholder;

src/chakra-components/single-value.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { Box } from "@chakra-ui/react";
22
import type { SystemStyleObject } from "@chakra-ui/react";
33
import type { GroupBase, SingleValueProps } from "react-select";
44

5-
const SingleValue = <
5+
export const SingleValue = <
66
Option,
77
IsMulti extends boolean,
88
Group extends GroupBase<Option>,
@@ -47,5 +47,3 @@ const SingleValue = <
4747
</Box>
4848
);
4949
};
50-
51-
export default SingleValue;

0 commit comments

Comments
 (0)