diff --git a/package.json b/package.json index ecc02bb..df69bb0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bbodek-ui", - "version": "0.0.190", + "version": "0.0.191", "type": "module", "author": "Bbodek", "license": "MIT", diff --git a/src/core/components/Toggle/Toggle.stories.tsx b/src/core/components/Toggle/Toggle.stories.tsx index 8cf1e54..e91656a 100644 --- a/src/core/components/Toggle/Toggle.stories.tsx +++ b/src/core/components/Toggle/Toggle.stories.tsx @@ -24,6 +24,10 @@ const meta = { control: "boolean", description: "Toggle Reverse", }, + disabled: { + control: "boolean", + description: "Toggle Disabled", + }, }, } satisfies Meta; diff --git a/src/core/components/Toggle/index.tsx b/src/core/components/Toggle/index.tsx index a4a7a92..6388f7e 100644 --- a/src/core/components/Toggle/index.tsx +++ b/src/core/components/Toggle/index.tsx @@ -9,6 +9,7 @@ const Toggle = ({ className, onChange, checked, + disabled = false, reverse = false, }: ToggleProps) => { const id = useId(); @@ -29,8 +30,9 @@ const Toggle = ({ className = 'peer hidden' checked = {checked} onChange = {onChange} + disabled = {disabled} /> -
+
diff --git a/src/core/components/Toggle/types/index.ts b/src/core/components/Toggle/types/index.ts index 9a6447b..bffaa2f 100644 --- a/src/core/components/Toggle/types/index.ts +++ b/src/core/components/Toggle/types/index.ts @@ -1,7 +1,7 @@ export interface ToggleProps extends Pick< React.InputHTMLAttributes, - "onChange" | "className" | "checked" + "onChange" | "className" | "checked" | "disabled" > { label: string; reverse?: boolean;