UNPKG

@mskcc/carbon-react

Version:

Carbon react components for the MSKCC DSM

102 lines (101 loc) 3.08 kB
/** * MSKCC DSM 2021, 2023 */ import React from 'react'; import { ForwardRefReturn, ReactAttr } from '../../types/common'; type ExcludedAttributes = 'id' | 'value'; export interface TimePickerProps extends Omit<ReactAttr<HTMLInputElement>, ExcludedAttributes> { /** * Pass in the children that will be rendered next to the form control */ children?: React.ReactNode; /** * Specify an optional className to be applied to the container node */ className?: string; /** * Specify whether the `<input>` should be disabled */ disabled?: boolean; /** * Specify whether you want the underlying label to be visually hidden */ hideLabel?: boolean; /** * Specify a custom `id` for the `<input>` */ id: string; /** * Specify whether the control is currently invalid */ invalid?: boolean; /** * Provide the text that is displayed when the control is in an invalid state */ invalidText?: React.ReactNode; /** * Specify a warning message */ warning?: boolean; /** * Provide the text that is displayed when the control is in an warning state */ warningText?: React.ReactNode; /** * Provide the text that will be read by a screen reader when visiting this * control */ labelText?: React.ReactNode; /** * The `light` prop for `TimePicker` has been deprecated. It will be removed in v12. Use the `Layer` component instead. * * @deprecated The `light` prop for `TimePicker` is no longer needed and has been deprecated. It will be removed in the next major release. Use the `Layer` component instead. */ light?: boolean; /** * Specify the maximum length of the time string in `<input>` */ maxLength?: number; /** * Optionally provide an `onBlur` handler that is called whenever the * `<input>` loses focus */ onBlur?: React.FocusEventHandler<HTMLInputElement>; /** * Optionally provide an `onChange` handler that is called whenever `<input>` * is updated */ onChange?: React.ChangeEventHandler<HTMLInputElement>; /** * Optionally provide an `onClick` handler that is called whenever the * `<input>` is clicked */ onClick?: React.MouseEventHandler<HTMLInputElement>; /** * Specify the regular expression working as the pattern of the time string in `<input>` */ pattern?: string; /** * Specify the placeholder attribute for the `<input>` */ placeholder?: string; /** * Specify whether the TimePicker should be read-only */ readOnly?: boolean; /** * Specify the size of the Time Picker. */ size?: 'sm' | 'md' | 'lg'; /** * Specify the type of the `<input>` */ type?: string; /** * Specify the value of the `<input>` */ value?: string; } export type TimePickerComponent = ForwardRefReturn<HTMLInputElement, TimePickerProps>; declare const TimePicker: TimePickerComponent; export default TimePicker;