import React from "react"; import type { UseControllerProps } from "react-hook-form"; import type { XOR } from "ts-xor"; import type { Clearable } from "@jobber/hooks"; import type { InputFieldWrapperProps } from "../InputFieldWrapper"; import type { InputPressableProps } from "../InputPressable/InputPressable"; interface InputTimeBaseProps extends Pick, Pick { /** * Defaulted to "always" so user can clear the time whenever there's a value. */ readonly clearable?: Extract; /** * Add a custom value to display when no time is selected * @default undefined */ readonly emptyValueLabel?: string; /** * Adjusts the UX of the time picker based on where you'd use it. * * - `"granular"` - allows the user to pick a very specific time * - `"scheduling"` - only allows user to select between 5 minutes interval. * If your design is catered towards "scheduling", you should use this type. * * @default scheduling */ readonly type?: "granular" | "scheduling"; /** * Hide or show the timer icon. */ readonly showIcon?: boolean; } export interface InputTimeFormControlled extends InputTimeBaseProps { /** * Adding a `name` would make this component "Form controlled" and must be * nested within a `
` component. * * Cannot be declared if `value` prop is used. */ readonly name: string; /** * Shows an error message below the field and highlights it red when the * value is invalid. Only applies when nested within a `` component. */ readonly validations?: UseControllerProps["rules"]; /** * The callback that fires whenever a time gets selected. */ readonly onChange?: (value?: Date | null) => void; } interface InputTimeDevControlled extends InputTimeBaseProps { /** * The value shown on the field. This gets automatically formatted to the * account's time format. */ readonly value: Date | string | undefined; /** * The callback that fires whenever a time gets selected. */ readonly onChange: (value?: Date) => void; } export type InputTimeProps = XOR; export declare function InputTime(props: InputTimeProps): React.JSX.Element; export {};