diff --git a/packages/input/date/src/DateField.tsx b/packages/input/date/src/DateField.tsx index d01219932..60dab981e 100644 --- a/packages/input/date/src/DateField.tsx +++ b/packages/input/date/src/DateField.tsx @@ -1,4 +1,4 @@ -import {Field, Label, Value} from '@alinea/core' +import {Field, Label, Shape} from '@alinea/core' /** Optional settings to configure a text field */ export type DateOptions = { @@ -16,16 +16,16 @@ export type DateOptions = { autoFocus?: boolean } -/** Internal representation of a text field */ +/** Internal representation of a date field */ export interface DateField extends Field.Scalar { label: Label options: DateOptions } -/** Create a text field configuration */ +/** Create a date field configuration */ export function createDate(label: Label, options: DateOptions = {}): DateField { return { - type: Value.Scalar(label), + shape: Shape.Scalar(label), label, options } diff --git a/packages/input/date/src/DateInput.tsx b/packages/input/date/src/DateInput.tsx index a55c034f0..54dbe4c1f 100644 --- a/packages/input/date/src/DateInput.tsx +++ b/packages/input/date/src/DateInput.tsx @@ -1,10 +1,8 @@ import {InputLabel, InputState, useInput} from '@alinea/editor' - -import {DateField} from './DateField' +import {fromModule} from '@alinea/ui' import {IcRoundDateRange} from '@alinea/ui/icons/IcRoundDateRange' +import {DateField} from './DateField' import css from './DateInput.module.scss' -import {fromModule} from '@alinea/ui' -import {useState} from 'react' const styles = fromModule(css) @@ -16,15 +14,14 @@ export type DateInputProps = { export function DateInput({state, field}: DateInputProps) { const {width, inline, optional, help, autoFocus, initialValue} = field.options const [value = initialValue, setValue] = useInput(state) - const [focus, setFocus] = useState(false) return ( ({ }) return (