diff --git a/src/lib/StyledRawInput.svelte b/src/lib/StyledRawInput.svelte index 1cd08e5..4f80f82 100644 --- a/src/lib/StyledRawInput.svelte +++ b/src/lib/StyledRawInput.svelte @@ -8,7 +8,7 @@ import { generateIdentifier } from './util'; import { onMount } from 'svelte'; - type $Props = Omit & { + type $Props = Omit & { name?: string; value?: string; validate?: ValidatorOptions; @@ -16,7 +16,6 @@ use?: (node: HTMLInputElement) => void; ref?: HTMLInputElement | null; onvalidate?: (e: InputValidatorEvent) => void; - class?: ClassValue | null | undefined; }; let { @@ -25,6 +24,7 @@ value = $bindable(''), placeholder, validate: validateOpts, + disabled = false, focus: focusOnMount = false, use, ref = $bindable(null), @@ -68,8 +68,11 @@ 'dark:text-sui-background dark:placeholder:text-sui-background/60 dark:sm:bg-slate-800', 'ring-sui-primary ring-offset-1 placeholder-shown:text-ellipsis focus:ring-2', !valid && 'border-red-500!', + disabled && + 'border-sui-accent/20 text-sui-text/60 dark:text-sui-background/60 cursor-not-allowed', classValue ]} + {disabled} use:validate={validateOpts} use:conditionalUse onvalidate={(e) => { diff --git a/src/lib/TextInput.svelte b/src/lib/TextInput.svelte index cfc3a81..ee0175a 100644 --- a/src/lib/TextInput.svelte +++ b/src/lib/TextInput.svelte @@ -1,38 +1,27 @@