@instructure/ui-date-time-input 11.7.3-snapshot-38 → 11.7.3-snapshot-41

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,12 +3,13 @@
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
- ## [11.7.3-snapshot-38](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-38) (2026-05-07)
6
+ ## [11.7.3-snapshot-41](https://github.com/instructure/instructure-ui/compare/v11.7.2...v11.7.3-snapshot-41) (2026-05-07)
7
7
 
8
8
 
9
9
  ### Bug Fixes
10
10
 
11
11
  * **many:** update dependencies, remove lots of Babel plugins, remove Webpack 4 support ([f916fca](https://github.com/instructure/instructure-ui/commit/f916fcafdddcb2d7de401f93e8ff92cfdfa47bba))
12
+ * **ui-date-time-input,ui-date-input,ui-calendar:** set missing aria-selected on calendar days, BREAKING CHANGE: add mandatory prop selectedLabel, change datePickerDialog prop to mandatory ([08abed5](https://github.com/instructure/instructure-ui/commit/08abed5e8c8b29aecab0368e01e8e4ffd0c7fda7))
12
13
 
13
14
 
14
15
  ### Features
@@ -359,6 +359,9 @@ class DateTimeInput extends Component {
359
359
  });
360
360
  };
361
361
  renderDays() {
362
+ const {
363
+ selectedLabel
364
+ } = this.props;
362
365
  const renderedDate = this.state.renderedDate;
363
366
  // Sets it to the first local day of the week counting back from the start of the month.
364
367
  // Note that first day depends on the locale, e.g. it's Sunday in the US and
@@ -394,6 +397,7 @@ class DateTimeInput extends Component {
394
397
  isOutsideMonth: !date.isSame(renderedDate, 'month'),
395
398
  label: date.format('D MMMM YYYY') // used by screen readers
396
399
  ,
400
+ selectedLabel: selectedLabel,
397
401
  onClick: this.handleDayClick,
398
402
  interaction: this.isDisabledDate(date) ? 'disabled' : 'enabled',
399
403
  children: date.format('DD')
@@ -22,5 +22,5 @@
22
22
  * SOFTWARE.
23
23
  */
24
24
 
25
- const allowedProps = ['description', 'dateRenderLabel', 'prevMonthLabel', 'nextMonthLabel', 'datePlaceholder', 'timePlaceholder', 'dateFormat', 'interaction', 'timeRenderLabel', 'timeStep', 'timeFormat', 'locale', 'timezone', 'invalidDateTimeMessage', 'showMessages', 'messages', 'messageFormat', 'layout', 'rowSpacing', 'colSpacing', 'value', 'defaultValue', 'renderWeekdayLabels', 'isRequired', 'onChange', 'dateInputRef', 'timeInputRef', 'onBlur', 'disabledDates', 'disabledDateTimeMessage', 'allowNonStepInput', 'reset'];
25
+ const allowedProps = ['description', 'dateRenderLabel', 'prevMonthLabel', 'nextMonthLabel', 'datePlaceholder', 'timePlaceholder', 'dateFormat', 'interaction', 'timeRenderLabel', 'timeStep', 'timeFormat', 'locale', 'timezone', 'invalidDateTimeMessage', 'showMessages', 'messages', 'messageFormat', 'layout', 'rowSpacing', 'colSpacing', 'value', 'defaultValue', 'renderWeekdayLabels', 'isRequired', 'onChange', 'dateInputRef', 'timeInputRef', 'onBlur', 'disabledDates', 'disabledDateTimeMessage', 'allowNonStepInput', 'reset', 'selectedLabel'];
26
26
  export { allowedProps };
@@ -366,6 +366,9 @@ category: components
366
366
  });
367
367
  };
368
368
  renderDays() {
369
+ const {
370
+ selectedLabel
371
+ } = this.props;
369
372
  const renderedDate = this.state.renderedDate;
370
373
  // Sets it to the first local day of the week counting back from the start of the month.
371
374
  // Note that first day depends on the locale, e.g. it's Sunday in the US and
@@ -401,6 +404,7 @@ category: components
401
404
  isOutsideMonth: !date.isSame(renderedDate, 'month'),
402
405
  label: date.format('D MMMM YYYY') // used by screen readers
403
406
  ,
407
+ selectedLabel: selectedLabel,
404
408
  onClick: this.handleDayClick,
405
409
  interaction: this.isDisabledDate(date) ? 'disabled' : 'enabled',
406
410
  children: date.format('DD')
@@ -28,4 +28,4 @@ exports.allowedProps = void 0;
28
28
  * SOFTWARE.
29
29
  */
30
30
 
31
- const allowedProps = exports.allowedProps = ['description', 'dateRenderLabel', 'prevMonthLabel', 'nextMonthLabel', 'datePlaceholder', 'timePlaceholder', 'dateFormat', 'interaction', 'timeRenderLabel', 'timeStep', 'timeFormat', 'locale', 'timezone', 'invalidDateTimeMessage', 'showMessages', 'messages', 'messageFormat', 'layout', 'rowSpacing', 'colSpacing', 'value', 'defaultValue', 'renderWeekdayLabels', 'isRequired', 'onChange', 'dateInputRef', 'timeInputRef', 'onBlur', 'disabledDates', 'disabledDateTimeMessage', 'allowNonStepInput', 'reset'];
31
+ const allowedProps = exports.allowedProps = ['description', 'dateRenderLabel', 'prevMonthLabel', 'nextMonthLabel', 'datePlaceholder', 'timePlaceholder', 'dateFormat', 'interaction', 'timeRenderLabel', 'timeStep', 'timeFormat', 'locale', 'timezone', 'invalidDateTimeMessage', 'showMessages', 'messages', 'messageFormat', 'layout', 'rowSpacing', 'colSpacing', 'value', 'defaultValue', 'renderWeekdayLabels', 'isRequired', 'onChange', 'dateInputRef', 'timeInputRef', 'onBlur', 'disabledDates', 'disabledDateTimeMessage', 'allowNonStepInput', 'reset', 'selectedLabel'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-date-time-input",
3
- "version": "11.7.3-snapshot-38",
3
+ "version": "11.7.3-snapshot-41",
4
4
  "description": "A UI component that allows to select date and time.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "module": "./es/index.js",
@@ -15,25 +15,25 @@
15
15
  "license": "MIT",
16
16
  "dependencies": {
17
17
  "@babel/runtime": "^7.29.2",
18
- "@instructure/console": "11.7.3-snapshot-38",
19
- "@instructure/shared-types": "11.7.3-snapshot-38",
20
- "@instructure/ui-a11y-content": "11.7.3-snapshot-38",
21
- "@instructure/ui-buttons": "11.7.3-snapshot-38",
22
- "@instructure/ui-calendar": "11.7.3-snapshot-38",
23
- "@instructure/ui-date-input": "11.7.3-snapshot-38",
24
- "@instructure/ui-form-field": "11.7.3-snapshot-38",
25
- "@instructure/ui-i18n": "11.7.3-snapshot-38",
26
- "@instructure/ui-icons": "11.7.3-snapshot-38",
27
- "@instructure/ui-react-utils": "11.7.3-snapshot-38",
28
- "@instructure/ui-time-select": "11.7.3-snapshot-38",
29
- "@instructure/ui-utils": "11.7.3-snapshot-38"
18
+ "@instructure/console": "11.7.3-snapshot-41",
19
+ "@instructure/shared-types": "11.7.3-snapshot-41",
20
+ "@instructure/ui-a11y-content": "11.7.3-snapshot-41",
21
+ "@instructure/ui-buttons": "11.7.3-snapshot-41",
22
+ "@instructure/ui-calendar": "11.7.3-snapshot-41",
23
+ "@instructure/ui-i18n": "11.7.3-snapshot-41",
24
+ "@instructure/ui-form-field": "11.7.3-snapshot-41",
25
+ "@instructure/ui-react-utils": "11.7.3-snapshot-41",
26
+ "@instructure/ui-utils": "11.7.3-snapshot-41",
27
+ "@instructure/ui-icons": "11.7.3-snapshot-41",
28
+ "@instructure/ui-time-select": "11.7.3-snapshot-41",
29
+ "@instructure/ui-date-input": "11.7.3-snapshot-41"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@testing-library/jest-dom": "^6.6.3",
33
33
  "@testing-library/react": "15.0.7",
34
34
  "@testing-library/user-event": "^14.6.1",
35
35
  "vitest": "^3.2.2",
36
- "@instructure/ui-babel-preset": "11.7.3-snapshot-38"
36
+ "@instructure/ui-babel-preset": "11.7.3-snapshot-41"
37
37
  },
38
38
  "peerDependencies": {
39
39
  "react": ">=18 <=19"
@@ -34,6 +34,7 @@ type: example
34
34
  invalidDateTimeMessage="Invalid date!"
35
35
  prevMonthLabel="Previous month"
36
36
  nextMonthLabel="Next month"
37
+ selectedLabel="Selected"
37
38
  defaultValue="2018-01-18T13:30"
38
39
  layout="columns"
39
40
  />
@@ -93,6 +94,7 @@ type: example
93
94
  timeRenderLabel="Time"
94
95
  prevMonthLabel="Previous month"
95
96
  nextMonthLabel="Next month"
97
+ selectedLabel="Selected"
96
98
  onChange={onChange}
97
99
  layout="stacked"
98
100
  value={value}
@@ -146,6 +148,7 @@ type: example
146
148
  timeRenderLabel="Time"
147
149
  prevMonthLabel="Previous month"
148
150
  nextMonthLabel="Next month"
151
+ selectedLabel="Selected"
149
152
  invalidDateTimeMessage={(dvalue) => {
150
153
  return `'${dvalue} is not valid.`
151
154
  }}
@@ -219,6 +222,7 @@ type: example
219
222
  }
220
223
  prevMonthLabel="Previous month"
221
224
  nextMonthLabel="Next month"
225
+ selectedLabel="Selected"
222
226
  defaultValue="2022-04-08T13:30"
223
227
  layout="columns"
224
228
  disabledDates={getDisabledDates}
@@ -254,6 +258,7 @@ type: example
254
258
  invalidDateTimeMessage="Invalid date!"
255
259
  prevMonthLabel="Previous month"
256
260
  nextMonthLabel="Next month"
261
+ selectedLabel="Selected"
257
262
  value={date}
258
263
  onChange={(e, newDate) => setDate(newDate)}
259
264
  reset={(reset) => (resetFn.current = reset)}
@@ -427,6 +427,7 @@ class DateTimeInput extends Component<DateTimeInputProps, DateTimeInputState> {
427
427
  }
428
428
 
429
429
  renderDays() {
430
+ const { selectedLabel } = this.props
430
431
  const renderedDate = this.state.renderedDate
431
432
  // Sets it to the first local day of the week counting back from the start of the month.
432
433
  // Note that first day depends on the locale, e.g. it's Sunday in the US and
@@ -467,6 +468,7 @@ class DateTimeInput extends Component<DateTimeInputProps, DateTimeInputState> {
467
468
  )}
468
469
  isOutsideMonth={!date.isSame(renderedDate, 'month')}
469
470
  label={date.format('D MMMM YYYY')} // used by screen readers
471
+ selectedLabel={selectedLabel}
470
472
  onClick={this.handleDayClick}
471
473
  interaction={this.isDisabledDate(date) ? 'disabled' : 'enabled'}
472
474
  >
@@ -250,6 +250,11 @@ type DateTimeInputProps = {
250
250
  * NOTE: this won't call onChange, so you have to reset the value manually when calling reset
251
251
  */
252
252
  reset?: (reset: () => void) => void
253
+ /**
254
+ * Screen reader label appended to the date label when the day is selected.
255
+ * Used to announce the selected state to assistive technologies.
256
+ */
257
+ selectedLabel?: string
253
258
  }
254
259
 
255
260
  type DateTimeInputState = {
@@ -309,7 +314,8 @@ const allowedProps: AllowedPropKeys = [
309
314
  'disabledDates',
310
315
  'disabledDateTimeMessage',
311
316
  'allowNonStepInput',
312
- 'reset'
317
+ 'reset',
318
+ 'selectedLabel'
313
319
  ]
314
320
 
315
321
  export type { DateTimeInputProps, DateTimeInputState }
@@ -32,7 +32,13 @@ type: example
32
32
  dateRenderLabel="Date"
33
33
  timeRenderLabel="Time"
34
34
  invalidDateTimeMessage="Invalid date!"
35
- screenReaderLabels={{ calendarIcon: 'Open calendar', prevMonthButton: 'Previous month', nextMonthButton: 'Next month' }}
35
+ screenReaderLabels={{
36
+ calendarIcon: 'Open calendar',
37
+ prevMonthButton: 'Previous month',
38
+ nextMonthButton: 'Next month',
39
+ datePickerDialog: 'Date picker dialog',
40
+ selectedLabel: 'Selected'
41
+ }}
36
42
  defaultValue="2018-01-18T13:30"
37
43
  layout="columns"
38
44
  />
@@ -91,7 +97,13 @@ type: example
91
97
  datePlaceholder="Choose"
92
98
  dateRenderLabel="Date"
93
99
  timeRenderLabel="Time"
94
- screenReaderLabels={{ calendarIcon: 'Open calendar', prevMonthButton: 'Previous month', nextMonthButton: 'Next month' }}
100
+ screenReaderLabels={{
101
+ calendarIcon: 'Open calendar',
102
+ prevMonthButton: 'Previous month',
103
+ nextMonthButton: 'Next month',
104
+ datePickerDialog: 'Date picker dialog',
105
+ selectedLabel: 'Selected'
106
+ }}
95
107
  onChange={onChange}
96
108
  layout="stacked"
97
109
  value={value}
@@ -119,7 +131,13 @@ type: example
119
131
  datePlaceholder="Choose a date"
120
132
  dateRenderLabel="Date"
121
133
  timeRenderLabel="Time"
122
- screenReaderLabels={{ calendarIcon: 'Open calendar', prevMonthButton: 'Previous month', nextMonthButton: 'Next month' }}
134
+ screenReaderLabels={{
135
+ calendarIcon: 'Open calendar',
136
+ prevMonthButton: 'Previous month',
137
+ nextMonthButton: 'Next month',
138
+ datePickerDialog: 'Date picker dialog',
139
+ selectedLabel: 'Selected'
140
+ }}
123
141
  invalidDateTimeMessage={(dvalue) => { return `'${dvalue} is not valid.` }}
124
142
  layout="columns"
125
143
  defaultValue="2018-01-18T13:30"
@@ -142,7 +160,13 @@ type: example
142
160
  datePlaceholder="Choose a date"
143
161
  dateRenderLabel="Date"
144
162
  timeRenderLabel="Time"
145
- screenReaderLabels={{ calendarIcon: 'Open calendar', prevMonthButton: 'Previous month', nextMonthButton: 'Next month' }}
163
+ screenReaderLabels={{
164
+ calendarIcon: 'Open calendar',
165
+ prevMonthButton: 'Previous month',
166
+ nextMonthButton: 'Next month',
167
+ datePickerDialog: 'Date picker dialog',
168
+ selectedLabel: 'Selected'
169
+ }}
146
170
  invalidDateTimeMessage={(dvalue) => {
147
171
  return `'${dvalue} is not valid.`
148
172
  }}
@@ -170,7 +194,13 @@ type: example
170
194
  timeRenderLabel="Time"
171
195
  invalidDateTimeMessage="Invalid date"
172
196
  disabledDateTimeMessage="Disabled date"
173
- screenReaderLabels={{ calendarIcon: 'Open calendar', prevMonthButton: 'Previous month', nextMonthButton: 'Next month' }}
197
+ screenReaderLabels={{
198
+ calendarIcon: 'Open calendar',
199
+ prevMonthButton: 'Previous month',
200
+ nextMonthButton: 'Next month',
201
+ datePickerDialog: 'Date picker dialog',
202
+ selectedLabel: 'Selected'
203
+ }}
174
204
  defaultValue="2022-04-08T13:30"
175
205
  layout="columns"
176
206
  disabledDates={['2022-04-01T13:30', '2022-04-03T13:30', '2022-04-04T13:30']}
@@ -213,7 +243,13 @@ type: example
213
243
  disabledDateTimeMessage={(rawDateValue) =>
214
244
  'Disabled date: ' + rawDateValue
215
245
  }
216
- screenReaderLabels={{ calendarIcon: 'Open calendar', prevMonthButton: 'Previous month', nextMonthButton: 'Next month' }}
246
+ screenReaderLabels={{
247
+ calendarIcon: 'Open calendar',
248
+ prevMonthButton: 'Previous month',
249
+ nextMonthButton: 'Next month',
250
+ datePickerDialog: 'Date picker dialog',
251
+ selectedLabel: 'Selected'
252
+ }}
217
253
  defaultValue="2022-04-08T13:30"
218
254
  layout="columns"
219
255
  disabledDates={getDisabledDates}
@@ -247,7 +283,13 @@ type: example
247
283
  dateRenderLabel="Date"
248
284
  timeRenderLabel="Time"
249
285
  invalidDateTimeMessage="Invalid date!"
250
- screenReaderLabels={{ calendarIcon: 'Open calendar', prevMonthButton: 'Previous month', nextMonthButton: 'Next month' }}
286
+ screenReaderLabels={{
287
+ calendarIcon: 'Open calendar',
288
+ prevMonthButton: 'Previous month',
289
+ nextMonthButton: 'Next month',
290
+ datePickerDialog: 'Date picker dialog',
291
+ selectedLabel: 'Selected'
292
+ }}
251
293
  value={date}
252
294
  onChange={(e, newDate) => setDate(newDate)}
253
295
  reset={(reset) => (resetFn.current = reset)}
@@ -38,13 +38,14 @@ type DateTimeInputProps = {
38
38
  **/
39
39
  dateRenderLabel: Renderable
40
40
  /**
41
- * Accessible labels for the calendar icon button, month navigation buttons, and date picker dialog.
41
+ * Accessible labels for the calendar icon button, month navigation buttons, selected date, and date picker dialog.
42
42
  */
43
43
  screenReaderLabels: {
44
44
  calendarIcon: string
45
45
  prevMonthButton: string
46
46
  nextMonthButton: string
47
- datePickerDialog?: string
47
+ datePickerDialog: string
48
+ selectedLabel: string
48
49
  }
49
50
  /**
50
51
  * HTML placeholder text to display when the date input has no value.