diff --git a/src/components/BogForm/BogForm.tsx b/src/components/BogForm/BogForm.tsx new file mode 100644 index 0000000..7a7db6c --- /dev/null +++ b/src/components/BogForm/BogForm.tsx @@ -0,0 +1,23 @@ +import { Form } from 'radix-ui'; +import styles from './styles.module.css'; +import BogButton from '../BogButton/BogButton'; +import type { FormEventHandler } from 'react'; + +export interface BogFormProps { + onSubmit: FormEventHandler; + submitLabel?: string; + style?: React.CSSProperties; + className?: string; + children: React.ReactNode; +} + +export function BogForm({ onSubmit, submitLabel, style, className, children }: BogFormProps) { + return ( + + {children} + + {submitLabel || 'Submit'} + + + ); +} diff --git a/src/components/BogForm/styles.module.css b/src/components/BogForm/styles.module.css new file mode 100644 index 0000000..4711885 --- /dev/null +++ b/src/components/BogForm/styles.module.css @@ -0,0 +1,8 @@ +@layer base { + .root { + flex-direction: column; + display: flex; + row-gap: 1rem; + padding: 1rem; + } +} diff --git a/src/components/BogTextInput/BogTextInput.tsx b/src/components/BogTextInput/BogTextInput.tsx new file mode 100644 index 0000000..32762f3 --- /dev/null +++ b/src/components/BogTextInput/BogTextInput.tsx @@ -0,0 +1,62 @@ +import { Form } from 'radix-ui'; +import styles from './styles.module.css'; + +export interface BogTextInputProps { + multiline?: boolean; + type?: 'text' | 'email' | 'password' | 'tel' | 'search'; + name: string; + label: string; + placeholder?: string; + required?: boolean; + disabled?: boolean; + + style?: React.CSSProperties; + className?: string; +} + +export function BogTextInput({ + type = 'text', + name, + label, + multiline = false, + placeholder, + required = false, + disabled = false, + style, + className, +}: BogTextInputProps) { + return ( + +
+ {label} + + Please enter a value for {label} + + + Please provide a valid {label} + +
+ + {multiline ? ( +