Skip to content

Commit

Permalink
feat: up
Browse files Browse the repository at this point in the history
  • Loading branch information
AllanOliveiraM committed Sep 22, 2023
1 parent 9407fd8 commit 1cecd9e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"react",
"typescript"
],
"version": "2.3.6",
"version": "2.3.7",
"main": "./dist/index.cjs.js",
"module": "./dist/index.esm.js",
"types": "./dist/index.d.ts",
Expand Down
7 changes: 5 additions & 2 deletions src/components/molecules/Fields/AsyncSelect/AsyncSelect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ export type AsyncSelectProps<FormType extends FieldValues> = {
label: string

placeholder?: string
selectedColor?: string

control: Control<FormType>
reactSelectProps?: any
Expand All @@ -53,6 +54,7 @@ const AsyncSelect = <FormType extends FieldValues>(props: AsyncSelectProps<FormT
debounceTime,
isClearable,
isSearchable,
selectedColor,
error,
isMulti,
noOptionsMessage,
Expand Down Expand Up @@ -121,7 +123,7 @@ const AsyncSelect = <FormType extends FieldValues>(props: AsyncSelectProps<FormT
...provided,
backgroundColor: state.isSelected
? styleMode === 'minimalist'
? '#9855ff'
? selectedColor || '#9855ff'
: '#2957a4'
: 'transparent',
}),
Expand All @@ -137,7 +139,7 @@ const AsyncSelect = <FormType extends FieldValues>(props: AsyncSelectProps<FormT
menuPortal: (provided: any) => ({ ...provided, zIndex: 9999 }),
...reactSelectStyles,
}),
[isMulti, reactSelectStyles, styleMode]
[isMulti, reactSelectStyles, selectedColor, styleMode]
)

useEffect(() => {
Expand Down Expand Up @@ -300,6 +302,7 @@ AsyncSelect.defaultProps = {
defaultOptions: undefined,
debounceTime: 700,
styleMode: undefined,
selectedColor: undefined,
isClearable: true,
isSearchable: true,
placeholder: undefined,
Expand Down
7 changes: 5 additions & 2 deletions src/components/molecules/Fields/Select/Select.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export type SelectProps<FormType extends FieldValues> = {
label: string
options: Array<SelectOption>
placeholder?: string
selectedColor?: string
styleMode?: StyleModes

control: Control<FormType>
Expand Down Expand Up @@ -65,6 +66,7 @@ const Select = <FormType extends FieldValues>(props: SelectProps<FormType>) => {
name,
required,
placeholder,
selectedColor,
id,
styleMode: localStyleMode,
onChange: customOnChange,
Expand Down Expand Up @@ -106,7 +108,7 @@ const Select = <FormType extends FieldValues>(props: SelectProps<FormType>) => {
...provided,
backgroundColor: state.isSelected
? styleMode === 'minimalist'
? '#9855ff'
? selectedColor || '#9855ff'
: '#2957a4'
: 'transparent',
}),
Expand All @@ -122,7 +124,7 @@ const Select = <FormType extends FieldValues>(props: SelectProps<FormType>) => {
menuPortal: (provided: any) => ({ ...provided, zIndex: 9999 }),
...reactSelectStyles,
}),
[isMulti, reactSelectStyles, styleMode]
[isMulti, reactSelectStyles, selectedColor, styleMode]
)

return (
Expand Down Expand Up @@ -246,6 +248,7 @@ Select.defaultProps = {
placeholder: undefined,
isClearable: true,
enableSearch: undefined,
selectedColor: undefined,
styleMode: undefined,
reactSelectProps: {
menuPosition: 'fixed',
Expand Down

0 comments on commit 1cecd9e

Please sign in to comment.