@instructure/ui-date-input 10.25.0 → 10.25.1-pr-snapshot-1757941125745

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,17 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [10.25.1-pr-snapshot-1757941125745](https://github.com/instructure/instructure-ui/compare/v10.25.0...v10.25.1-pr-snapshot-1757941125745) (2025-09-15)
7
+
8
+
9
+ ### Features
10
+
11
+ * **many:** remove prop-types; add support for react 19 and upgrade docs app to use it ([22311c7](https://github.com/instructure/instructure-ui/commit/22311c7bcf52d4e7b094c60c92192e5c85eac6c2))
12
+
13
+
14
+
15
+
16
+
6
17
  # [10.25.0](https://github.com/instructure/instructure-ui/compare/v10.24.2...v10.25.0) (2025-09-09)
7
18
 
8
19
  **Note:** Version bump only for package @instructure/ui-date-input
@@ -1,7 +1,7 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
2
2
  const _excluded = ["renderLabel", "value", "placeholder", "onBlur", "isRequired", "size", "isInline", "layout", "width", "onRequestValidateDate", "onRequestShowCalendar", "onRequestHideCalendar", "onRequestSelectNextDay", "onRequestSelectPrevDay", "onRequestRenderNextMonth", "onRequestRenderPrevMonth"],
3
3
  _excluded2 = ["ref"];
4
- var _dec, _dec2, _class, _DateInput, _IconCalendarMonthLin;
4
+ var _dec, _class, _DateInput, _IconCalendarMonthLin;
5
5
  /*
6
6
  * The MIT License (MIT)
7
7
  *
@@ -34,18 +34,17 @@ import { Selectable } from '@instructure/ui-selectable';
34
34
  import { TextInput } from '@instructure/ui-text-input';
35
35
  import { createChainedFunction } from '@instructure/ui-utils';
36
36
  import { getInteraction, callRenderProp, safeCloneElement, passthroughProps } from '@instructure/ui-react-utils';
37
- import { testable } from '@instructure/ui-testable';
38
37
  import { DateTime, Locale } from '@instructure/ui-i18n';
39
38
  import { withStyle } from '@instructure/emotion';
40
39
  import generateStyle from './styles';
41
- import { propTypes, allowedProps } from './props';
40
+ import { allowedProps } from './props';
42
41
  import { jsx as _jsx, jsxs as _jsxs } from "@emotion/react/jsx-runtime";
43
42
  /**
44
43
  ---
45
44
  category: components
46
45
  ---
47
46
  **/
48
- let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec(_class = _dec2(_class = (_DateInput = class DateInput extends Component {
47
+ let DateInput = (_dec = withStyle(generateStyle, null), _dec(_class = (_DateInput = class DateInput extends Component {
49
48
  constructor(...args) {
50
49
  super(...args);
51
50
  this.state = {
@@ -369,7 +368,10 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
369
368
  ...getRootProps({
370
369
  css: styles === null || styles === void 0 ? void 0 : styles.dateInput
371
370
  }),
372
- ref: el => this.ref = el,
371
+ ref: el => {
372
+ this.ref = el;
373
+ },
374
+ "data-cid": "DateInput",
373
375
  children: [this.renderInput({
374
376
  getInputProps,
375
377
  getTriggerProps
@@ -391,7 +393,7 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
391
393
  })
392
394
  });
393
395
  }
394
- }, _DateInput.displayName = "DateInput", _DateInput.componentId = 'DateInput', _DateInput.Day = Calendar.Day, _DateInput.propTypes = propTypes, _DateInput.allowedProps = allowedProps, _DateInput.defaultProps = {
396
+ }, _DateInput.displayName = "DateInput", _DateInput.componentId = 'DateInput', _DateInput.Day = Calendar.Day, _DateInput.allowedProps = allowedProps, _DateInput.defaultProps = {
395
397
  value: '',
396
398
  size: 'medium',
397
399
  onBlur: () => {},
@@ -402,6 +404,6 @@ let DateInput = (_dec = withStyle(generateStyle, null), _dec2 = testable(), _dec
402
404
  display: 'inline-block',
403
405
  placement: 'bottom center',
404
406
  isShowingCalendar: false
405
- }, _DateInput)) || _class) || _class);
407
+ }, _DateInput)) || _class);
406
408
  export default DateInput;
407
409
  export { DateInput };
@@ -22,48 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types';
26
- import { controllable, Children as ChildrenPropTypes } from '@instructure/ui-prop-types';
27
- import { FormPropTypes } from '@instructure/ui-form-field';
28
- import { PositionPropTypes } from '@instructure/ui-position';
29
- import { Calendar } from '@instructure/ui-calendar';
30
- const propTypes = {
31
- renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
32
- value: controllable(PropTypes.string),
33
- size: PropTypes.oneOf(['small', 'medium', 'large']),
34
- placeholder: PropTypes.string,
35
- onChange: PropTypes.func,
36
- onBlur: PropTypes.func,
37
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
38
- isRequired: PropTypes.bool,
39
- isInline: PropTypes.bool,
40
- assistiveText: PropTypes.string,
41
- layout: PropTypes.oneOf(['stacked', 'inline']),
42
- width: PropTypes.string,
43
- display: PropTypes.oneOf(['inline-block', 'block']),
44
- inputRef: PropTypes.func,
45
- messages: PropTypes.arrayOf(FormPropTypes.message),
46
- placement: PositionPropTypes.placement,
47
- isShowingCalendar: PropTypes.bool,
48
- onRequestValidateDate: PropTypes.func,
49
- onRequestShowCalendar: PropTypes.func,
50
- onRequestHideCalendar: PropTypes.func,
51
- onRequestSelectNextDay: PropTypes.func,
52
- onRequestSelectPrevDay: PropTypes.func,
53
- onRequestRenderNextMonth: PropTypes.func,
54
- onRequestRenderPrevMonth: PropTypes.func,
55
- renderNavigationLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
56
- renderWeekdayLabels: PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.node])),
57
- renderNextMonthButton: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
58
- renderPrevMonthButton: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
59
- children: ChildrenPropTypes.oneOf([Calendar.Day]),
60
- disabledDates: PropTypes.oneOfType([PropTypes.array, PropTypes.func]),
61
- currentDate: PropTypes.string,
62
- disabledDateErrorMessage: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
63
- invalidDateErrorMessage: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
64
- locale: PropTypes.string,
65
- timezone: PropTypes.string,
66
- withYearPicker: PropTypes.object
67
- };
68
25
  const allowedProps = ['renderLabel', 'value', 'size', 'placeholder', 'onChange', 'onBlur', 'interaction', 'isRequired', 'isInline', 'assistiveText', 'layout', 'width', 'display', 'inputRef', 'messages', 'placement', 'isShowingCalendar', 'onRequestValidateDate', 'onRequestShowCalendar', 'onRequestHideCalendar', 'onRequestSelectNextDay', 'onRequestSelectPrevDay', 'onRequestRenderNextMonth', 'onRequestRenderPrevMonth', 'renderNavigationLabel', 'renderWeekdayLabels', 'renderNextMonthButton', 'renderPrevMonthButton', 'children', 'disabledDates', 'currentDate', 'disabledDateErrorMessage', 'invalidDateErrorMessage', 'locale', 'timezone'];
69
- export { propTypes, allowedProps };
26
+ export { allowedProps };
@@ -32,7 +32,6 @@ import { Popover } from '@instructure/ui-popover';
32
32
  import { TextInput } from '@instructure/ui-text-input';
33
33
  import { callRenderProp, passthroughProps } from '@instructure/ui-react-utils';
34
34
  import { getLocale, getTimezone } from '@instructure/ui-i18n';
35
- import { propTypes } from './props';
36
35
  import { jsx as _jsx } from "@emotion/react/jsx-runtime";
37
36
  function parseLocaleDate(dateString = '', locale, timeZone) {
38
37
  // This function may seem complicated but it basically does one thing:
@@ -106,7 +105,6 @@ function parseLocaleDate(dateString = '', locale, timeZone) {
106
105
  category: components
107
106
  ---
108
107
  **/
109
- // eslint-disable-next-line react/display-name
110
108
  const DateInput2 = /*#__PURE__*/forwardRef(({
111
109
  renderLabel,
112
110
  screenReaderLabels,
@@ -288,6 +286,8 @@ const DateInput2 = /*#__PURE__*/forwardRef(({
288
286
  })
289
287
  });
290
288
  });
291
- DateInput2.propTypes = propTypes;
289
+
290
+ // TODO this is probably needed?
291
+ DateInput2.displayName = 'DateInput2';
292
292
  export default DateInput2;
293
293
  export { DateInput2 };
@@ -1,51 +1 @@
1
- /*
2
- * The MIT License (MIT)
3
- *
4
- * Copyright (c) 2015 - present Instructure, Inc.
5
- *
6
- * Permission is hereby granted, free of charge, to any person obtaining a copy
7
- * of this software and associated documentation files (the "Software"), to deal
8
- * in the Software without restriction, including without limitation the rights
9
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
- * copies of the Software, and to permit persons to whom the Software is
11
- * furnished to do so, subject to the following conditions:
12
- *
13
- * The above copyright notice and this permission notice shall be included in all
14
- * copies or substantial portions of the Software.
15
- *
16
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
22
- * SOFTWARE.
23
- */
24
-
25
- import PropTypes from 'prop-types';
26
- import { controllable } from '@instructure/ui-prop-types';
27
- import { FormPropTypes } from '@instructure/ui-form-field';
28
- const propTypes = {
29
- renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
30
- screenReaderLabels: PropTypes.object.isRequired,
31
- value: controllable(PropTypes.string),
32
- placeholder: PropTypes.string,
33
- onChange: PropTypes.func,
34
- onBlur: PropTypes.func,
35
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
36
- isRequired: PropTypes.bool,
37
- isInline: PropTypes.bool,
38
- width: PropTypes.string,
39
- messages: PropTypes.arrayOf(FormPropTypes.message),
40
- invalidDateErrorMessage: PropTypes.oneOfType([PropTypes.func, PropTypes.string]),
41
- locale: PropTypes.string,
42
- timezone: PropTypes.string,
43
- withYearPicker: PropTypes.object,
44
- dateFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
45
- onRequestValidateDate: PropTypes.func,
46
- renderCalendarIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
47
- margin: PropTypes.string,
48
- disabledDates: PropTypes.oneOfType([PropTypes.array, PropTypes.func]),
49
- inputRef: PropTypes.func
50
- };
51
- export { propTypes };
1
+ export {};
@@ -17,7 +17,6 @@ var _getInteraction = require("@instructure/ui-react-utils/lib/getInteraction.js
17
17
  var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js");
18
18
  var _safeCloneElement = require("@instructure/ui-react-utils/lib/safeCloneElement.js");
19
19
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
20
- var _testable = require("@instructure/ui-testable/lib/testable.js");
21
20
  var _DateTime = require("@instructure/ui-i18n/lib/DateTime.js");
22
21
  var _Locale = require("@instructure/ui-i18n/lib/Locale.js");
23
22
  var _emotion = require("@instructure/emotion");
@@ -26,7 +25,7 @@ var _props2 = require("./props");
26
25
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
27
26
  const _excluded = ["renderLabel", "value", "placeholder", "onBlur", "isRequired", "size", "isInline", "layout", "width", "onRequestValidateDate", "onRequestShowCalendar", "onRequestHideCalendar", "onRequestSelectNextDay", "onRequestSelectPrevDay", "onRequestRenderNextMonth", "onRequestRenderPrevMonth"],
28
27
  _excluded2 = ["ref"];
29
- var _dec, _dec2, _class, _DateInput, _IconCalendarMonthLin;
28
+ var _dec, _class, _DateInput, _IconCalendarMonthLin;
30
29
  /*
31
30
  * The MIT License (MIT)
32
31
  *
@@ -55,7 +54,7 @@ var _dec, _dec2, _class, _DateInput, _IconCalendarMonthLin;
55
54
  category: components
56
55
  ---
57
56
  **/
58
- let DateInput = exports.DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_DateInput = class DateInput extends _react.Component {
57
+ let DateInput = exports.DateInput = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec(_class = (_DateInput = class DateInput extends _react.Component {
59
58
  constructor(...args) {
60
59
  super(...args);
61
60
  this.state = {
@@ -379,7 +378,10 @@ let DateInput = exports.DateInput = (_dec = (0, _emotion.withStyle)(_styles.defa
379
378
  ...getRootProps({
380
379
  css: styles === null || styles === void 0 ? void 0 : styles.dateInput
381
380
  }),
382
- ref: el => this.ref = el,
381
+ ref: el => {
382
+ this.ref = el;
383
+ },
384
+ "data-cid": "DateInput",
383
385
  children: [this.renderInput({
384
386
  getInputProps,
385
387
  getTriggerProps
@@ -401,7 +403,7 @@ let DateInput = exports.DateInput = (_dec = (0, _emotion.withStyle)(_styles.defa
401
403
  })
402
404
  });
403
405
  }
404
- }, _DateInput.displayName = "DateInput", _DateInput.componentId = 'DateInput', _DateInput.Day = _Calendar.Calendar.Day, _DateInput.propTypes = _props2.propTypes, _DateInput.allowedProps = _props2.allowedProps, _DateInput.defaultProps = {
406
+ }, _DateInput.displayName = "DateInput", _DateInput.componentId = 'DateInput', _DateInput.Day = _Calendar.Calendar.Day, _DateInput.allowedProps = _props2.allowedProps, _DateInput.defaultProps = {
405
407
  value: '',
406
408
  size: 'medium',
407
409
  onBlur: () => {},
@@ -412,5 +414,5 @@ let DateInput = exports.DateInput = (_dec = (0, _emotion.withStyle)(_styles.defa
412
414
  display: 'inline-block',
413
415
  placement: 'bottom center',
414
416
  isShowingCalendar: false
415
- }, _DateInput)) || _class) || _class);
417
+ }, _DateInput)) || _class);
416
418
  var _default = exports.default = DateInput;
@@ -1,16 +1,9 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
5
  });
7
- exports.propTypes = exports.allowedProps = void 0;
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
10
- var _Children = require("@instructure/ui-prop-types/lib/Children.js");
11
- var _FormPropTypes = require("@instructure/ui-form-field/lib/FormPropTypes.js");
12
- var _PositionPropTypes = require("@instructure/ui-position/lib/PositionPropTypes.js");
13
- var _Calendar = require("@instructure/ui-calendar/lib/Calendar");
6
+ exports.allowedProps = void 0;
14
7
  /*
15
8
  * The MIT License (MIT)
16
9
  *
@@ -35,42 +28,4 @@ var _Calendar = require("@instructure/ui-calendar/lib/Calendar");
35
28
  * SOFTWARE.
36
29
  */
37
30
 
38
- const propTypes = exports.propTypes = {
39
- renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
40
- value: (0, _controllable.controllable)(_propTypes.default.string),
41
- size: _propTypes.default.oneOf(['small', 'medium', 'large']),
42
- placeholder: _propTypes.default.string,
43
- onChange: _propTypes.default.func,
44
- onBlur: _propTypes.default.func,
45
- interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
46
- isRequired: _propTypes.default.bool,
47
- isInline: _propTypes.default.bool,
48
- assistiveText: _propTypes.default.string,
49
- layout: _propTypes.default.oneOf(['stacked', 'inline']),
50
- width: _propTypes.default.string,
51
- display: _propTypes.default.oneOf(['inline-block', 'block']),
52
- inputRef: _propTypes.default.func,
53
- messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
54
- placement: _PositionPropTypes.PositionPropTypes.placement,
55
- isShowingCalendar: _propTypes.default.bool,
56
- onRequestValidateDate: _propTypes.default.func,
57
- onRequestShowCalendar: _propTypes.default.func,
58
- onRequestHideCalendar: _propTypes.default.func,
59
- onRequestSelectNextDay: _propTypes.default.func,
60
- onRequestSelectPrevDay: _propTypes.default.func,
61
- onRequestRenderNextMonth: _propTypes.default.func,
62
- onRequestRenderPrevMonth: _propTypes.default.func,
63
- renderNavigationLabel: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
64
- renderWeekdayLabels: _propTypes.default.arrayOf(_propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node])),
65
- renderNextMonthButton: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
66
- renderPrevMonthButton: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.node]),
67
- children: _Children.Children.oneOf([_Calendar.Calendar.Day]),
68
- disabledDates: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.func]),
69
- currentDate: _propTypes.default.string,
70
- disabledDateErrorMessage: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
71
- invalidDateErrorMessage: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
72
- locale: _propTypes.default.string,
73
- timezone: _propTypes.default.string,
74
- withYearPicker: _propTypes.default.object
75
- };
76
31
  const allowedProps = exports.allowedProps = ['renderLabel', 'value', 'size', 'placeholder', 'onChange', 'onBlur', 'interaction', 'isRequired', 'isInline', 'assistiveText', 'layout', 'width', 'display', 'inputRef', 'messages', 'placement', 'isShowingCalendar', 'onRequestValidateDate', 'onRequestShowCalendar', 'onRequestHideCalendar', 'onRequestSelectNextDay', 'onRequestSelectPrevDay', 'onRequestRenderNextMonth', 'onRequestRenderPrevMonth', 'renderNavigationLabel', 'renderWeekdayLabels', 'renderNextMonthButton', 'renderPrevMonthButton', 'children', 'disabledDates', 'currentDate', 'disabledDateErrorMessage', 'invalidDateErrorMessage', 'locale', 'timezone'];
@@ -18,7 +18,6 @@ var _callRenderProp = require("@instructure/ui-react-utils/lib/callRenderProp.js
18
18
  var _passthroughProps = require("@instructure/ui-react-utils/lib/passthroughProps.js");
19
19
  var _getLocale = require("@instructure/ui-i18n/lib/getLocale.js");
20
20
  var _getTimezone = require("@instructure/ui-i18n/lib/getTimezone.js");
21
- var _props = require("./props");
22
21
  var _jsxRuntime = require("@emotion/react/jsx-runtime");
23
22
  var _IconCalendarMonthLin, _IconArrowOpenEndSoli, _IconArrowOpenStartSo;
24
23
  /*
@@ -116,7 +115,6 @@ function parseLocaleDate(dateString = '', locale, timeZone) {
116
115
  category: components
117
116
  ---
118
117
  **/
119
- // eslint-disable-next-line react/display-name
120
118
  const DateInput2 = exports.DateInput2 = /*#__PURE__*/(0, _react.forwardRef)(({
121
119
  renderLabel,
122
120
  screenReaderLabels,
@@ -298,5 +296,7 @@ const DateInput2 = exports.DateInput2 = /*#__PURE__*/(0, _react.forwardRef)(({
298
296
  })
299
297
  });
300
298
  });
301
- DateInput2.propTypes = _props.propTypes;
299
+
300
+ // TODO this is probably needed?
301
+ DateInput2.displayName = 'DateInput2';
302
302
  var _default = exports.default = DateInput2;
@@ -1,57 +1,5 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
4
3
  Object.defineProperty(exports, "__esModule", {
5
4
  value: true
6
- });
7
- exports.propTypes = void 0;
8
- var _propTypes = _interopRequireDefault(require("prop-types"));
9
- var _controllable = require("@instructure/ui-prop-types/lib/controllable.js");
10
- var _FormPropTypes = require("@instructure/ui-form-field/lib/FormPropTypes.js");
11
- /*
12
- * The MIT License (MIT)
13
- *
14
- * Copyright (c) 2015 - present Instructure, Inc.
15
- *
16
- * Permission is hereby granted, free of charge, to any person obtaining a copy
17
- * of this software and associated documentation files (the "Software"), to deal
18
- * in the Software without restriction, including without limitation the rights
19
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
- * copies of the Software, and to permit persons to whom the Software is
21
- * furnished to do so, subject to the following conditions:
22
- *
23
- * The above copyright notice and this permission notice shall be included in all
24
- * copies or substantial portions of the Software.
25
- *
26
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
- * SOFTWARE.
33
- */
34
-
35
- const propTypes = exports.propTypes = {
36
- renderLabel: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]).isRequired,
37
- screenReaderLabels: _propTypes.default.object.isRequired,
38
- value: (0, _controllable.controllable)(_propTypes.default.string),
39
- placeholder: _propTypes.default.string,
40
- onChange: _propTypes.default.func,
41
- onBlur: _propTypes.default.func,
42
- interaction: _propTypes.default.oneOf(['enabled', 'disabled', 'readonly']),
43
- isRequired: _propTypes.default.bool,
44
- isInline: _propTypes.default.bool,
45
- width: _propTypes.default.string,
46
- messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
47
- invalidDateErrorMessage: _propTypes.default.oneOfType([_propTypes.default.func, _propTypes.default.string]),
48
- locale: _propTypes.default.string,
49
- timezone: _propTypes.default.string,
50
- withYearPicker: _propTypes.default.object,
51
- dateFormat: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.object]),
52
- onRequestValidateDate: _propTypes.default.func,
53
- renderCalendarIcon: _propTypes.default.oneOfType([_propTypes.default.node, _propTypes.default.func]),
54
- margin: _propTypes.default.string,
55
- disabledDates: _propTypes.default.oneOfType([_propTypes.default.array, _propTypes.default.func]),
56
- inputRef: _propTypes.default.func
57
- };
5
+ });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-date-input",
3
- "version": "10.25.0",
3
+ "version": "10.25.1-pr-snapshot-1757941125745",
4
4
  "description": "A UI component library made by Instructure Inc.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -23,9 +23,9 @@
23
23
  },
24
24
  "license": "MIT",
25
25
  "devDependencies": {
26
- "@instructure/ui-babel-preset": "10.25.0",
27
- "@instructure/ui-buttons": "10.25.0",
28
- "@instructure/ui-scripts": "10.25.0",
26
+ "@instructure/ui-babel-preset": "10.25.1-pr-snapshot-1757941125745",
27
+ "@instructure/ui-buttons": "10.25.1-pr-snapshot-1757941125745",
28
+ "@instructure/ui-scripts": "10.25.1-pr-snapshot-1757941125745",
29
29
  "@testing-library/jest-dom": "^6.6.3",
30
30
  "@testing-library/react": "^16.0.1",
31
31
  "@testing-library/user-event": "^14.6.1",
@@ -33,25 +33,22 @@
33
33
  },
34
34
  "dependencies": {
35
35
  "@babel/runtime": "^7.27.6",
36
- "@instructure/emotion": "10.25.0",
37
- "@instructure/shared-types": "10.25.0",
38
- "@instructure/ui-calendar": "10.25.0",
39
- "@instructure/ui-form-field": "10.25.0",
40
- "@instructure/ui-i18n": "10.25.0",
41
- "@instructure/ui-icons": "10.25.0",
42
- "@instructure/ui-popover": "10.25.0",
43
- "@instructure/ui-position": "10.25.0",
44
- "@instructure/ui-prop-types": "10.25.0",
45
- "@instructure/ui-react-utils": "10.25.0",
46
- "@instructure/ui-selectable": "10.25.0",
47
- "@instructure/ui-testable": "10.25.0",
48
- "@instructure/ui-text-input": "10.25.0",
49
- "@instructure/ui-utils": "10.25.0",
50
- "moment-timezone": "^0.6.0",
51
- "prop-types": "^15.8.1"
36
+ "@instructure/emotion": "10.25.1-pr-snapshot-1757941125745",
37
+ "@instructure/shared-types": "10.25.1-pr-snapshot-1757941125745",
38
+ "@instructure/ui-calendar": "10.25.1-pr-snapshot-1757941125745",
39
+ "@instructure/ui-form-field": "10.25.1-pr-snapshot-1757941125745",
40
+ "@instructure/ui-i18n": "10.25.1-pr-snapshot-1757941125745",
41
+ "@instructure/ui-icons": "10.25.1-pr-snapshot-1757941125745",
42
+ "@instructure/ui-popover": "10.25.1-pr-snapshot-1757941125745",
43
+ "@instructure/ui-position": "10.25.1-pr-snapshot-1757941125745",
44
+ "@instructure/ui-react-utils": "10.25.1-pr-snapshot-1757941125745",
45
+ "@instructure/ui-selectable": "10.25.1-pr-snapshot-1757941125745",
46
+ "@instructure/ui-text-input": "10.25.1-pr-snapshot-1757941125745",
47
+ "@instructure/ui-utils": "10.25.1-pr-snapshot-1757941125745",
48
+ "moment-timezone": "^0.6.0"
52
49
  },
53
50
  "peerDependencies": {
54
- "react": ">=16.14 <=18"
51
+ "react": ">=18 <=19"
55
52
  },
56
53
  "publishConfig": {
57
54
  "access": "public"
@@ -42,7 +42,6 @@ import {
42
42
  safeCloneElement,
43
43
  passthroughProps
44
44
  } from '@instructure/ui-react-utils'
45
- import { testable } from '@instructure/ui-testable'
46
45
 
47
46
  import { DateTime, ApplyLocaleContext, Locale } from '@instructure/ui-i18n'
48
47
 
@@ -50,7 +49,7 @@ import { withStyle } from '@instructure/emotion'
50
49
 
51
50
  import generateStyle from './styles'
52
51
 
53
- import { propTypes, allowedProps } from './props'
52
+ import { allowedProps } from './props'
54
53
  import type { DateInputProps, DateInputState } from './props'
55
54
  import type { FormMessage } from '@instructure/ui-form-field'
56
55
 
@@ -60,12 +59,10 @@ category: components
60
59
  ---
61
60
  **/
62
61
  @withStyle(generateStyle, null)
63
- @testable()
64
62
  class DateInput extends Component<DateInputProps, DateInputState> {
65
63
  static readonly componentId = 'DateInput'
66
64
  static Day = Calendar.Day
67
65
  declare context: React.ContextType<typeof ApplyLocaleContext>
68
- static propTypes = propTypes
69
66
  static allowedProps = allowedProps
70
67
  static defaultProps = {
71
68
  value: '',
@@ -469,7 +466,10 @@ class DateInput extends Component<DateInputProps, DateInputState> {
469
466
  }) => (
470
467
  <span
471
468
  {...getRootProps({ css: styles?.dateInput })}
472
- ref={(el) => (this.ref = el)}
469
+ ref={(el) => {
470
+ this.ref = el
471
+ }}
472
+ data-cid="DateInput"
473
473
  >
474
474
  {this.renderInput({ getInputProps, getTriggerProps })}
475
475
  <span {...getDescriptionProps()} css={styles?.assistiveText}>
@@ -22,23 +22,10 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import PropTypes from 'prop-types'
26
-
27
- import {
28
- controllable,
29
- Children as ChildrenPropTypes
30
- } from '@instructure/ui-prop-types'
31
- import { FormPropTypes } from '@instructure/ui-form-field'
32
- import { PositionPropTypes } from '@instructure/ui-position'
33
- import { Calendar } from '@instructure/ui-calendar'
34
25
  import type { CalendarDayProps } from '@instructure/ui-calendar'
35
26
  import type { FormMessage } from '@instructure/ui-form-field'
36
27
  import type { PlacementPropValues } from '@instructure/ui-position'
37
- import type {
38
- Renderable,
39
- OtherHTMLAttributes,
40
- PropValidators
41
- } from '@instructure/shared-types'
28
+ import type { Renderable, OtherHTMLAttributes } from '@instructure/shared-types'
42
29
  import type { WithStyleProps, ComponentStyle } from '@instructure/emotion'
43
30
  import { InputHTMLAttributes, ReactElement, SyntheticEvent } from 'react'
44
31
 
@@ -282,54 +269,6 @@ type DateInputProps = DateInputOwnProps &
282
269
  >
283
270
 
284
271
  type DateInputStyle = ComponentStyle<'dateInput' | 'assistiveText'>
285
-
286
- const propTypes: PropValidators<PropKeys> = {
287
- renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
288
- value: controllable(PropTypes.string),
289
- size: PropTypes.oneOf(['small', 'medium', 'large']),
290
- placeholder: PropTypes.string,
291
- onChange: PropTypes.func,
292
- onBlur: PropTypes.func,
293
- interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
294
- isRequired: PropTypes.bool,
295
- isInline: PropTypes.bool,
296
- assistiveText: PropTypes.string,
297
- layout: PropTypes.oneOf(['stacked', 'inline']),
298
- width: PropTypes.string,
299
- display: PropTypes.oneOf(['inline-block', 'block']),
300
- inputRef: PropTypes.func,
301
- messages: PropTypes.arrayOf(FormPropTypes.message),
302
- placement: PositionPropTypes.placement,
303
- isShowingCalendar: PropTypes.bool,
304
- onRequestValidateDate: PropTypes.func,
305
- onRequestShowCalendar: PropTypes.func,
306
- onRequestHideCalendar: PropTypes.func,
307
- onRequestSelectNextDay: PropTypes.func,
308
- onRequestSelectPrevDay: PropTypes.func,
309
- onRequestRenderNextMonth: PropTypes.func,
310
- onRequestRenderPrevMonth: PropTypes.func,
311
- renderNavigationLabel: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
312
- renderWeekdayLabels: PropTypes.arrayOf(
313
- PropTypes.oneOfType([PropTypes.func, PropTypes.node])
314
- ),
315
- renderNextMonthButton: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
316
- renderPrevMonthButton: PropTypes.oneOfType([PropTypes.func, PropTypes.node]),
317
- children: ChildrenPropTypes.oneOf([Calendar.Day]),
318
- disabledDates: PropTypes.oneOfType([PropTypes.array, PropTypes.func]),
319
- currentDate: PropTypes.string,
320
- disabledDateErrorMessage: PropTypes.oneOfType([
321
- PropTypes.func,
322
- PropTypes.string
323
- ]),
324
- invalidDateErrorMessage: PropTypes.oneOfType([
325
- PropTypes.func,
326
- PropTypes.string
327
- ]),
328
- locale: PropTypes.string,
329
- timezone: PropTypes.string,
330
- withYearPicker: PropTypes.object
331
- }
332
-
333
272
  const allowedProps: AllowedPropKeys = [
334
273
  'renderLabel',
335
274
  'value',
@@ -376,4 +315,4 @@ type DateInputState = {
376
315
  }
377
316
 
378
317
  export type { DateInputProps, DateInputStyle, DateInputState }
379
- export { propTypes, allowedProps }
318
+ export { allowedProps }
@@ -22,13 +22,7 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- import {
26
- useState,
27
- useEffect,
28
- forwardRef,
29
- ForwardedRef,
30
- ValidationMap
31
- } from 'react'
25
+ import { useState, useEffect, forwardRef, ForwardedRef } from 'react'
32
26
  import type { SyntheticEvent } from 'react'
33
27
  import { Calendar } from '@instructure/ui-calendar'
34
28
  import { IconButton } from '@instructure/ui-buttons'
@@ -42,7 +36,6 @@ import { TextInput } from '@instructure/ui-text-input'
42
36
  import { callRenderProp, passthroughProps } from '@instructure/ui-react-utils'
43
37
  import { getLocale, getTimezone } from '@instructure/ui-i18n'
44
38
 
45
- import { propTypes } from './props'
46
39
  import type { DateInput2Props } from './props'
47
40
  import type { FormMessage } from '@instructure/ui-form-field'
48
41
  import type { Moment } from '@instructure/ui-i18n'
@@ -130,7 +123,6 @@ function parseLocaleDate(
130
123
  category: components
131
124
  ---
132
125
  **/
133
- // eslint-disable-next-line react/display-name
134
126
  const DateInput2 = forwardRef(
135
127
  (
136
128
  {
@@ -341,7 +333,8 @@ const DateInput2 = forwardRef(
341
333
  }
342
334
  )
343
335
 
344
- DateInput2.propTypes = propTypes as ValidationMap<DateInput2Props>
336
+ // TODO this is probably needed?
337
+ DateInput2.displayName = 'DateInput2'
345
338
 
346
339
  export default DateInput2
347
340
  export { DateInput2 }