Skip to content

Commit

Permalink
feat: add TextInput size
Browse files Browse the repository at this point in the history
  • Loading branch information
victordev13 committed May 6, 2023
1 parent f38f85c commit 013c092
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 5 deletions.
6 changes: 6 additions & 0 deletions packages/react/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @victordev-ignite-ui/react

## 2.0.4

### Patch Changes

- add TextInput size

## 2.0.3

### Patch Changes
Expand Down
5 changes: 4 additions & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
{
"name": "@victordev-ignite-ui/react",
"version": "2.0.3",
"version": "2.0.4",
"description": "",
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"author": "victordev",
"files": [
"dist"
],
"license": "MIT",
"scripts": {
"build": "tsup src/index.tsx --format esm,cjs --dts --external react",
Expand Down
8 changes: 5 additions & 3 deletions packages/react/src/components/TextInput/index.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
import { ComponentProps, ElementRef, forwardRef } from 'react'
import { Input, Prefix, TextInputContainer } from './styles'

export interface TextInputProps extends ComponentProps<typeof Input> {
export interface TextInputProps
extends Omit<ComponentProps<typeof Input>, 'size'> {
prefix?: string
size?: ComponentProps<typeof TextInputContainer>['size']
}

export const TextInput = forwardRef<ElementRef<typeof Input>, TextInputProps>(
({ prefix, ...props }, ref) => {
({ prefix, size, ...props }, ref) => {
return (
<TextInputContainer>
<TextInputContainer size={size}>
{!!prefix && <Prefix>{prefix}</Prefix>}
<Input ref={ref} {...props} />
</TextInputContainer>
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/TextInput/styles.ts
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,6 @@ export const Input = styled('input', {
},

'&::placeholder': {
color: '$gray400',
color: '$gray500',
},
})

0 comments on commit 013c092

Please sign in to comment.