Make the 'helper text' feature more generic

This commit is contained in:
Alex Rock Ancelet 2023-10-04 11:22:08 +02:00
commit 4b805bad42
No known key found for this signature in database
GPG key ID: 11649C042A79165A
19 changed files with 181 additions and 76 deletions

32
types/HelperText/HelperText.svelte.d.ts vendored Normal file
View file

@ -0,0 +1,32 @@
import type { SvelteComponentTyped } from "svelte";
import type { SvelteHTMLElements } from "svelte/elements";
type RestProps = SvelteHTMLElements["div"];
export interface HelperTextProps extends RestProps {
/**
* Specify the helper text as parameter
* @default ""
*/
helperText?: string;
/**
* Set to `true` for the disabled variant
* @default false
*/
disabled?: boolean;
/**
* Set to `true` to use inline variant
* @default false
*/
inline?: boolean;
[key: `data-${string}`]: any;
}
export default class HelperText extends SvelteComponentTyped<
HelperTextProps,
Record<string, any>,
{ default: {} }
> {}