diff --git a/src/ui/elements/forms/Checkbox.tsx b/src/ui/elements/forms/Checkbox.tsx new file mode 100644 index 0000000..e7b58fb --- /dev/null +++ b/src/ui/elements/forms/Checkbox.tsx @@ -0,0 +1,17 @@ +import { JSX, RefObject } from "preact"; +import { InputProps } from "./InputProps"; + +type CheckboxProps = InputProps & { + checkboxRef?: RefObject; +} + +export function Checkbox(props: CheckboxProps): JSX.Element { + return ( + + ) +} \ No newline at end of file diff --git a/src/ui/elements/Form.tsx b/src/ui/elements/forms/Form.tsx similarity index 100% rename from src/ui/elements/Form.tsx rename to src/ui/elements/forms/Form.tsx diff --git a/src/ui/elements/forms/InputProps.tsx b/src/ui/elements/forms/InputProps.tsx new file mode 100644 index 0000000..fb1ce06 --- /dev/null +++ b/src/ui/elements/forms/InputProps.tsx @@ -0,0 +1,9 @@ +export type InputProps = { + name?: string; + value?: string; + placeholder?: string; + onChange?: () => void; + required?: boolean; + checked?: boolean; + extraProps?: {}; +} \ No newline at end of file diff --git a/src/ui/elements/forms/NumberInput.tsx b/src/ui/elements/forms/NumberInput.tsx new file mode 100644 index 0000000..4f6b7e0 --- /dev/null +++ b/src/ui/elements/forms/NumberInput.tsx @@ -0,0 +1,17 @@ +import { JSX, RefObject } from "preact"; +import { InputProps } from "./InputProps"; + +type NumberInputProps = InputProps & { + inputRef?: RefObject; +} + +export function NumberInput(props: NumberInputProps): JSX.Element { + return ( + + ) +} \ No newline at end of file diff --git a/src/ui/elements/forms/PasswordInput.tsx b/src/ui/elements/forms/PasswordInput.tsx new file mode 100644 index 0000000..6c05276 --- /dev/null +++ b/src/ui/elements/forms/PasswordInput.tsx @@ -0,0 +1,17 @@ +import { JSX, RefObject } from "preact"; +import { InputProps } from "./InputProps"; + +type PasswordInputProps = InputProps & { + inputRef?: RefObject; +} + +export function PasswordInput(props: PasswordInputProps): JSX.Element { + return ( + + ) +} \ No newline at end of file diff --git a/src/ui/elements/forms/Select.tsx b/src/ui/elements/forms/Select.tsx new file mode 100644 index 0000000..182d294 --- /dev/null +++ b/src/ui/elements/forms/Select.tsx @@ -0,0 +1,33 @@ +import { JSX, RefObject } from "preact"; +import { InputProps } from "./InputProps"; + +type SelectProps = InputProps & { + selectRef?: RefObject; + children?: JSX.Element | JSX.Element[]; +} + +export function Select(props: SelectProps): JSX.Element { + return ( + + ) +} + +type SelectOptionProps = { + name: string; + value: string; + selected?: boolean; +} + +export function SelectOption(props: SelectOptionProps): JSX.Element { + return ( + + ) +} \ No newline at end of file diff --git a/src/ui/elements/forms/TextArea.tsx b/src/ui/elements/forms/TextArea.tsx new file mode 100644 index 0000000..1627d32 --- /dev/null +++ b/src/ui/elements/forms/TextArea.tsx @@ -0,0 +1,16 @@ +import { JSX, RefObject } from "preact"; +import { InputProps } from "./InputProps"; + +type TextInputProps = InputProps & { + textAreaRef?: RefObject; +} + +export function TextArea(props: TextInputProps): JSX.Element { + return ( +