File tree Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Expand file tree Collapse file tree 2 files changed +10
-10
lines changed Original file line number Diff line number Diff line change @@ -18,8 +18,8 @@ type Story = StoryObj<InputType>
18
18
export const Sizes : Story = {
19
19
render : ( ) => (
20
20
< VStack width = "154px" >
21
- < Input rightIcon = { BsSlashSquare } placeholder = "Search" />
22
- < Input rightIcon = { BsSlashSquare } placeholder = "Search" size = "sm" />
21
+ < Input rightIcon = { < BsSlashSquare /> } placeholder = "Search" />
22
+ < Input rightIcon = { < BsSlashSquare /> } placeholder = "Search" size = "sm" />
23
23
</ VStack >
24
24
) ,
25
25
}
@@ -28,8 +28,12 @@ export const ElementVariations: Story = {
28
28
render : ( ) => (
29
29
< VStack width = "258px" spacing = { 4 } >
30
30
< Input placeholder = "input text" />
31
- < Input rightIcon = { BsSlashSquare } placeholder = "input text" />
32
- < Input rightIcon = { BsSlashSquare } placeholder = "input text" isDisabled />
31
+ < Input rightIcon = { < BsSlashSquare /> } placeholder = "input text" />
32
+ < Input
33
+ rightIcon = { < BsSlashSquare /> }
34
+ placeholder = "input text"
35
+ isDisabled
36
+ />
33
37
</ VStack >
34
38
) ,
35
39
}
Original file line number Diff line number Diff line change 1
1
import * as React from "react"
2
2
import {
3
- Icon ,
4
3
Input as ChakraInput ,
5
4
InputGroup ,
6
5
InputGroupProps ,
7
6
InputProps as ChakraInputProps ,
8
7
InputRightElement ,
9
8
} from "@chakra-ui/react"
10
- import { IconType } from "react-icons/lib"
11
-
12
- type RightIconType = IconType | typeof Icon
13
9
14
10
type CommonProps = ChakraInputProps
15
11
@@ -19,7 +15,7 @@ type WithIconProps = CommonProps & {
19
15
/**
20
16
* The Icon used to render `InputRightElement` on the right side of the input
21
17
*/
22
- rightIcon : RightIconType
18
+ rightIcon ?: JSX . Element
23
19
/**
24
20
* Primarily for style props to be applied to the wrapper
25
21
*/
@@ -36,7 +32,7 @@ function Input(props: InputProps) {
36
32
return (
37
33
< InputGroup size = { size } { ...inputGroupProps } >
38
34
< ChakraInput data-peer { ...rest } />
39
- < InputRightElement children = { < Icon /> } />
35
+ < InputRightElement children = { Icon } />
40
36
</ InputGroup >
41
37
)
42
38
}
You can’t perform that action at this time.
0 commit comments