|  | 
| 2 | 2 | 
 | 
| 3 | 3 | import { createElement, useCallback, useEffect, useMemo, useRef, useState } from 'react'; | 
| 4 | 4 | import { createPortal } from 'react-dom'; | 
| 5 |  | -import PropTypes from 'prop-types'; | 
| 6 | 5 | import makeEventProps from 'make-event-props'; | 
| 7 | 6 | import clsx from 'clsx'; | 
| 8 | 7 | import Clock from 'react-clock'; | 
| 9 | 8 | import Fit from 'react-fit'; | 
| 10 | 9 | 
 | 
| 11 | 10 | import TimeInput from 'react-time-picker/dist/esm/TimeInput'; | 
| 12 | 11 | 
 | 
| 13 |  | -import { isTime, rangeOf } from './shared/propTypes.js'; | 
| 14 |  | - | 
| 15 |  | -import type { ReactNodeArray } from 'prop-types'; | 
| 16 | 12 | import type { | 
| 17 | 13 |   ClassName, | 
| 18 | 14 |   CloseReason, | 
| @@ -58,7 +54,9 @@ const ClearIcon = ( | 
| 58 | 54 |   </svg> | 
| 59 | 55 | ); | 
| 60 | 56 | 
 | 
| 61 |  | -type Icon = React.ReactElement | ReactNodeArray | null | string | number | boolean; | 
|  | 57 | +type ReactNodeLike = React.ReactNode | string | number | boolean | null | undefined; | 
|  | 58 | + | 
|  | 59 | +type Icon = ReactNodeLike | ReactNodeLike[]; | 
| 62 | 60 | 
 | 
| 63 | 61 | type IconOrRenderFunction = Icon | React.ComponentType | React.ReactElement; | 
| 64 | 62 | 
 | 
| @@ -668,50 +666,4 @@ const TimeRangePicker: React.FC<TimeRangePickerProps> = function TimeRangePicker | 
| 668 | 666 |   ); | 
| 669 | 667 | }; | 
| 670 | 668 | 
 | 
| 671 |  | -const isValue = PropTypes.oneOfType([PropTypes.string, PropTypes.instanceOf(Date)]); | 
| 672 |  | - | 
| 673 |  | -const isValueOrValueArray = PropTypes.oneOfType([isValue, rangeOf(isValue)]); | 
| 674 |  | - | 
| 675 |  | -TimeRangePicker.propTypes = { | 
| 676 |  | -  amPmAriaLabel: PropTypes.string, | 
| 677 |  | -  autoFocus: PropTypes.bool, | 
| 678 |  | -  className: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), | 
| 679 |  | -  clearAriaLabel: PropTypes.string, | 
| 680 |  | -  clearIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | 
| 681 |  | -  clockAriaLabel: PropTypes.string, | 
| 682 |  | -  clockClassName: PropTypes.oneOfType([PropTypes.string, PropTypes.arrayOf(PropTypes.string)]), | 
| 683 |  | -  clockIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]), | 
| 684 |  | -  closeClock: PropTypes.bool, | 
| 685 |  | -  'data-testid': PropTypes.string, | 
| 686 |  | -  disableClock: PropTypes.bool, | 
| 687 |  | -  disabled: PropTypes.bool, | 
| 688 |  | -  format: PropTypes.string, | 
| 689 |  | -  hourAriaLabel: PropTypes.string, | 
| 690 |  | -  hourPlaceholder: PropTypes.string, | 
| 691 |  | -  id: PropTypes.string, | 
| 692 |  | -  isOpen: PropTypes.bool, | 
| 693 |  | -  locale: PropTypes.string, | 
| 694 |  | -  maxDetail: PropTypes.oneOf(allViews), | 
| 695 |  | -  maxTime: isTime, | 
| 696 |  | -  minTime: isTime, | 
| 697 |  | -  minuteAriaLabel: PropTypes.string, | 
| 698 |  | -  minutePlaceholder: PropTypes.string, | 
| 699 |  | -  name: PropTypes.string, | 
| 700 |  | -  nativeInputAriaLabel: PropTypes.string, | 
| 701 |  | -  onChange: PropTypes.func, | 
| 702 |  | -  onClockClose: PropTypes.func, | 
| 703 |  | -  onClockOpen: PropTypes.func, | 
| 704 |  | -  onFocus: PropTypes.func, | 
| 705 |  | -  openClockOnFocus: PropTypes.bool, | 
| 706 |  | -  rangeDivider: PropTypes.node, | 
| 707 |  | -  required: PropTypes.bool, | 
| 708 |  | -  secondAriaLabel: PropTypes.string, | 
| 709 |  | -  secondPlaceholder: PropTypes.string, | 
| 710 |  | -  value: isValueOrValueArray, | 
| 711 |  | -}; | 
| 712 |  | - | 
| 713 |  | -if (isBrowser) { | 
| 714 |  | -  TimeRangePicker.propTypes.portalContainer = PropTypes.instanceOf(HTMLElement); | 
| 715 |  | -} | 
| 716 |  | - | 
| 717 | 669 | export default TimeRangePicker; | 
0 commit comments