@happeouikit/form-elements 2.3.8 → 2.3.9

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
@@ -1,5 +1,8 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.3.9
4
+
5
+ - [Added] DatePicker. Added accessible description for DatePicker input
3
6
  ## 2.3.8
4
7
 
5
8
  - [Fixed] Switch a11y issues.
@@ -88,8 +88,10 @@ var DatePicker = function DatePicker(_ref) {
88
88
 
89
89
  var from = date.from,
90
90
  to = date.to;
91
+ var localeFormat = moment.localeData(locale).longDateFormat("L");
91
92
  var formattedValue = formatValue(value || date[type], locale);
92
93
  var isRangeMode = Boolean(from) && Boolean(to);
94
+ var intl = useIntl();
93
95
  useDevWarningOnce(value && date[type], "[DatePicker] Both the `value` and `date` props have been used.\n The `date` prop will be ignored. To get rid of this warning, remove one of these props.");
94
96
 
95
97
  var onChangeMonthYear = function onChangeMonthYear(_ref2) {
@@ -142,7 +144,11 @@ var DatePicker = function DatePicker(_ref) {
142
144
  }, dayPickerProps),
143
145
  ref: pickerRef,
144
146
  inputProps: _objectSpread({
145
- id: datePickerId
147
+ id: datePickerId,
148
+ "aria-label": label,
149
+ "aria-description": intl.formatMessage(messages.selectDateFormatDescription, {
150
+ localeFormat: localeFormat
151
+ })
146
152
  }, inputProps)
147
153
  }, props), date[type])]
148
154
  });
package/dist/messages.js CHANGED
@@ -28,6 +28,10 @@ export default defineMessages({
28
28
  id: "datePicker.message.invalid.time",
29
29
  defaultMessage: "Invalid Time"
30
30
  },
31
+ selectDateFormatDescription: {
32
+ id: "datePicker.message.formatDescription",
33
+ defaultMessage: "Provide a date using the format {localeFormat}"
34
+ },
31
35
  wrongFormat: {
32
36
  id: "datePicker.message.invalid.format",
33
37
  defaultMessage: "Invalid Format"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@happeouikit/form-elements",
3
- "version": "2.3.8",
3
+ "version": "2.3.9",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "module": "src/index.js",
@@ -45,5 +45,5 @@
45
45
  "publishConfig": {
46
46
  "access": "public"
47
47
  },
48
- "gitHead": "6ad4197aac342883ca171f6d64b99f5136eaa4b3"
48
+ "gitHead": "e9777d7e463eb24f1023c2eecf5ebbe35fed92a6"
49
49
  }