Skip to content

Commit 64fe739

Browse files
committed
Remove propTypes
1 parent a011dc0 commit 64fe739

File tree

5 files changed

+3
-82
lines changed

5 files changed

+3
-82
lines changed

packages/react-timerange-picker/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
"dependencies": {
5050
"clsx": "^2.0.0",
5151
"make-event-props": "^1.6.0",
52-
"prop-types": "^15.6.0",
5352
"react-clock": "^4.5.0",
5453
"react-fit": "^1.7.0",
5554
"react-time-picker": "^6.5.0"

packages/react-timerange-picker/src/TimeRangePicker.tsx

Lines changed: 3 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,13 @@
22

33
import { createElement, useCallback, useEffect, useMemo, useRef, useState } from 'react';
44
import { createPortal } from 'react-dom';
5-
import PropTypes from 'prop-types';
65
import makeEventProps from 'make-event-props';
76
import clsx from 'clsx';
87
import Clock from 'react-clock';
98
import Fit from 'react-fit';
109

1110
import TimeInput from 'react-time-picker/dist/esm/TimeInput';
1211

13-
import { isTime, rangeOf } from './shared/propTypes.js';
14-
15-
import type { ReactNodeArray } from 'prop-types';
1612
import type {
1713
ClassName,
1814
CloseReason,
@@ -22,11 +18,8 @@ import type {
2218
Value,
2319
} from './shared/types.js';
2420

25-
const isBrowser = typeof document !== 'undefined';
26-
2721
const baseClassName = 'react-timerange-picker';
2822
const outsideActionEvents = ['mousedown', 'focusin', 'touchstart'] as const;
29-
const allViews = ['hour', 'minute', 'second'] as const;
3023

3124
const iconProps = {
3225
xmlns: 'http://www.w3.org/2000/svg',
@@ -58,7 +51,9 @@ const ClearIcon = (
5851
</svg>
5952
);
6053

61-
type Icon = React.ReactElement | ReactNodeArray | null | string | number | boolean;
54+
type ReactNodeLike = React.ReactNode | string | number | boolean | null | undefined;
55+
56+
type Icon = ReactNodeLike | ReactNodeLike[];
6257

6358
type IconOrRenderFunction = Icon | React.ComponentType | React.ReactElement;
6459

@@ -668,50 +663,4 @@ const TimeRangePicker: React.FC<TimeRangePickerProps> = function TimeRangePicker
668663
);
669664
};
670665

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-
717666
export default TimeRangePicker;

packages/react-timerange-picker/src/shared/propTypes.ts

Lines changed: 0 additions & 25 deletions
This file was deleted.

sample/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
"license": "MIT",
1717
"dependencies": {
1818
"@wojtekmaj/react-timerange-picker": "latest",
19-
"prop-types": "^15.6.0",
2019
"react": "^18.2.0",
2120
"react-dom": "^18.2.0"
2221
},

yarn.lock

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1221,7 +1221,6 @@ __metadata:
12211221
make-event-props: "npm:^1.6.0"
12221222
nodemon: "npm:^3.0.0"
12231223
prettier: "npm:^3.2.0"
1224-
prop-types: "npm:^15.6.0"
12251224
react: "npm:^18.2.0"
12261225
react-clock: "npm:^4.5.0"
12271226
react-dom: "npm:^18.2.0"

0 commit comments

Comments
 (0)