diff --git a/package.json b/package.json index 2388ca3..4511912 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@programmer_network/yail", - "version": "1.0.192", + "version": "1.0.193", "description": "Programmer Network's official UI library for React", "author": "Aleksandar Grbic - (https://programmer.network)", "publishConfig": { diff --git a/src/Components/Inputs/Switch/Switch.stories.tsx b/src/Components/Inputs/Switch/Switch.stories.tsx index 5618a5c..4f7dde2 100644 --- a/src/Components/Inputs/Switch/Switch.stories.tsx +++ b/src/Components/Inputs/Switch/Switch.stories.tsx @@ -6,16 +6,26 @@ export default { title: "Input / Switch" }; -export const Default = () => { - const [isChecked, setIsChecked] = useState(false); +export const IsChecked = () => { + return ( + console.log(isEnabled)} + /> + ); +}; - console.log("🚀 ─── Default ─── isChecked:", isChecked); +export const IsNotChecked = () => { + const [isChecked, setIsChecked] = useState(false); return ( setIsChecked(isEnabled)} - name='isEnabled' /> ); }; diff --git a/src/Components/Inputs/Switch/index.tsx b/src/Components/Inputs/Switch/index.tsx index bb4ab13..4139014 100644 --- a/src/Components/Inputs/Switch/index.tsx +++ b/src/Components/Inputs/Switch/index.tsx @@ -7,33 +7,44 @@ const Switch: React.FC = ({ name, isChecked, onChange, - label = "Toggle me", + label, className }) => { const handleChange = (event: React.ChangeEvent) => { onChange({ [name]: event.target.checked }); }; - return ( -