diff --git a/src/lib/components/formFields/ListCheckbox/Checkbox/Checkbox.stories.ts b/src/lib/components/formFields/ListCheckbox/Checkbox/Checkbox.stories.ts index 2412166..a98199e 100644 --- a/src/lib/components/formFields/ListCheckbox/Checkbox/Checkbox.stories.ts +++ b/src/lib/components/formFields/ListCheckbox/Checkbox/Checkbox.stories.ts @@ -101,6 +101,20 @@ export const TextSwitchChecked: Story = { }, }; +export const TextSwitchDisabled: Story = { + ...template, + args: { + ...template.args, + // args for this specific story here + name: "text-switch", + styleType: "text-switch", + checked: true, + checkedText: "Ativo", + uncheckedText: "Inativo", + disabled: true, + }, +}; + export const Labeled: Story = { ...template, args: { diff --git a/src/lib/components/formFields/ListCheckbox/Checkbox/Checkbox.svelte b/src/lib/components/formFields/ListCheckbox/Checkbox/Checkbox.svelte index 6410064..a4c24eb 100644 --- a/src/lib/components/formFields/ListCheckbox/Checkbox/Checkbox.svelte +++ b/src/lib/components/formFields/ListCheckbox/Checkbox/Checkbox.svelte @@ -73,6 +73,8 @@ export let uncheckedText = ""; + export let disabled = false; + const isInsideContext = hasContext("FormContext"); const { setFieldValue, addFieldToContext, removeFieldFromContext } = isInsideContext && getContext("FormContext"); @@ -147,6 +149,7 @@ {id} class={styleType} {checked} + {disabled} bind:this={inputElement} on:click={handleCheck} />