@instructure/ui-date-input 10.25.1-pr-snapshot-1758274491790 → 10.25.1-snapshot-1

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.
@@ -22,9 +22,17 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
+ import PropTypes from 'prop-types'
25
26
  import type { SyntheticEvent, InputHTMLAttributes } from 'react'
27
+
28
+ import { controllable } from '@instructure/ui-prop-types'
29
+ import { FormPropTypes } from '@instructure/ui-form-field'
26
30
  import type { FormMessage } from '@instructure/ui-form-field'
27
- import type { OtherHTMLAttributes, Renderable } from '@instructure/shared-types'
31
+ import type {
32
+ OtherHTMLAttributes,
33
+ Renderable,
34
+ PropValidators
35
+ } from '@instructure/shared-types'
28
36
  import type { Spacing } from '@instructure/emotion'
29
37
 
30
38
  type DateInput2OwnProps = {
@@ -180,9 +188,40 @@ type DateInput2OwnProps = {
180
188
  inputRef?: (inputElement: HTMLInputElement | null) => void
181
189
  }
182
190
 
191
+ type PropKeys = keyof DateInput2OwnProps
192
+
183
193
  type DateInput2Props = DateInput2OwnProps &
184
194
  OtherHTMLAttributes<
185
195
  DateInput2OwnProps,
186
196
  InputHTMLAttributes<DateInput2OwnProps & Element>
187
197
  >
198
+
199
+ const propTypes: PropValidators<PropKeys> = {
200
+ renderLabel: PropTypes.oneOfType([PropTypes.node, PropTypes.func]).isRequired,
201
+ screenReaderLabels: PropTypes.object.isRequired,
202
+ value: controllable(PropTypes.string),
203
+ placeholder: PropTypes.string,
204
+ onChange: PropTypes.func,
205
+ onBlur: PropTypes.func,
206
+ interaction: PropTypes.oneOf(['enabled', 'disabled', 'readonly']),
207
+ isRequired: PropTypes.bool,
208
+ isInline: PropTypes.bool,
209
+ width: PropTypes.string,
210
+ messages: PropTypes.arrayOf(FormPropTypes.message),
211
+ invalidDateErrorMessage: PropTypes.oneOfType([
212
+ PropTypes.func,
213
+ PropTypes.string
214
+ ]),
215
+ locale: PropTypes.string,
216
+ timezone: PropTypes.string,
217
+ withYearPicker: PropTypes.object,
218
+ dateFormat: PropTypes.oneOfType([PropTypes.string, PropTypes.object]),
219
+ onRequestValidateDate: PropTypes.func,
220
+ renderCalendarIcon: PropTypes.oneOfType([PropTypes.node, PropTypes.func]),
221
+ margin: PropTypes.string,
222
+ disabledDates: PropTypes.oneOfType([PropTypes.array, PropTypes.func]),
223
+ inputRef: PropTypes.func
224
+ }
225
+
188
226
  export type { DateInput2Props }
227
+ export { propTypes }
@@ -15,9 +15,11 @@
15
15
  { "path": "../ui-icons/tsconfig.build.json" },
16
16
  { "path": "../ui-popover/tsconfig.build.json" },
17
17
  { "path": "../ui-position/tsconfig.build.json" },
18
+ { "path": "../ui-prop-types/tsconfig.build.json" },
18
19
  { "path": "../ui-react-utils/tsconfig.build.json" },
19
20
  { "path": "../ui-selectable/tsconfig.build.json" },
20
21
  { "path": "../shared-types/tsconfig.build.json" },
22
+ { "path": "../ui-testable/tsconfig.build.json" },
21
23
  { "path": "../ui-text-input/tsconfig.build.json" },
22
24
  { "path": "../ui-utils/tsconfig.build.json" },
23
25
  { "path": "../ui-i18n/tsconfig.build.json" },