From 1cecd9e1dc8bec7737ca4bf64ae6931f5f1b7679 Mon Sep 17 00:00:00 2001 From: Allan Oliveira Date: Fri, 22 Sep 2023 11:38:56 -0300 Subject: [PATCH] feat: up --- package.json | 2 +- .../molecules/Fields/AsyncSelect/AsyncSelect.tsx | 7 +++++-- src/components/molecules/Fields/Select/Select.tsx | 7 +++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/package.json b/package.json index 3652567..a1f29cf 100644 --- a/package.json +++ b/package.json @@ -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", diff --git a/src/components/molecules/Fields/AsyncSelect/AsyncSelect.tsx b/src/components/molecules/Fields/AsyncSelect/AsyncSelect.tsx index 53eadb6..1176747 100644 --- a/src/components/molecules/Fields/AsyncSelect/AsyncSelect.tsx +++ b/src/components/molecules/Fields/AsyncSelect/AsyncSelect.tsx @@ -38,6 +38,7 @@ export type AsyncSelectProps = { label: string placeholder?: string + selectedColor?: string control: Control reactSelectProps?: any @@ -53,6 +54,7 @@ const AsyncSelect = (props: AsyncSelectProps(props: AsyncSelectProps(props: AsyncSelectProps ({ ...provided, zIndex: 9999 }), ...reactSelectStyles, }), - [isMulti, reactSelectStyles, styleMode] + [isMulti, reactSelectStyles, selectedColor, styleMode] ) useEffect(() => { @@ -300,6 +302,7 @@ AsyncSelect.defaultProps = { defaultOptions: undefined, debounceTime: 700, styleMode: undefined, + selectedColor: undefined, isClearable: true, isSearchable: true, placeholder: undefined, diff --git a/src/components/molecules/Fields/Select/Select.tsx b/src/components/molecules/Fields/Select/Select.tsx index 1e736bd..73b0a79 100644 --- a/src/components/molecules/Fields/Select/Select.tsx +++ b/src/components/molecules/Fields/Select/Select.tsx @@ -33,6 +33,7 @@ export type SelectProps = { label: string options: Array placeholder?: string + selectedColor?: string styleMode?: StyleModes control: Control @@ -65,6 +66,7 @@ const Select = (props: SelectProps) => { name, required, placeholder, + selectedColor, id, styleMode: localStyleMode, onChange: customOnChange, @@ -106,7 +108,7 @@ const Select = (props: SelectProps) => { ...provided, backgroundColor: state.isSelected ? styleMode === 'minimalist' - ? '#9855ff' + ? selectedColor || '#9855ff' : '#2957a4' : 'transparent', }), @@ -122,7 +124,7 @@ const Select = (props: SelectProps) => { menuPortal: (provided: any) => ({ ...provided, zIndex: 9999 }), ...reactSelectStyles, }), - [isMulti, reactSelectStyles, styleMode] + [isMulti, reactSelectStyles, selectedColor, styleMode] ) return ( @@ -246,6 +248,7 @@ Select.defaultProps = { placeholder: undefined, isClearable: true, enableSearch: undefined, + selectedColor: undefined, styleMode: undefined, reactSelectProps: { menuPosition: 'fixed',