@react-aria/datepicker 3.7.0 → 3.8.0

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/dist/import.mjs CHANGED
@@ -808,7 +808,7 @@ $dfb4eba373ed9493$exports = {
808
808
 
809
809
 
810
810
  function $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref, disableArrowNavigation) {
811
- let { direction: direction } = (0, $cIPI0$useLocale)();
811
+ let { direction: direction } = (0, $cIPI0$useLocale)();
812
812
  let focusManager = (0, $cIPI0$useMemo)(()=>(0, $cIPI0$createFocusManager)(ref), [
813
813
  ref
814
814
  ]);
@@ -864,7 +864,7 @@ function $3dfb0f96be0d6a08$export$4a931266a3838b86(state, ref, disableArrowNavig
864
864
  }
865
865
  if (target) target.focus();
866
866
  };
867
- let { pressProps: pressProps } = (0, $cIPI0$usePress)({
867
+ let { pressProps: pressProps } = (0, $cIPI0$usePress)({
868
868
  preventFocusOnPress: true,
869
869
  allowTextSelectionOnPress: true,
870
870
  onPressStart (e) {
@@ -888,11 +888,11 @@ const $16f0b7bb276bc17e$export$300019f83c56d282 = "__role_" + Date.now();
888
888
  const $16f0b7bb276bc17e$export$7b3062cd49e80452 = "__focusManager_" + Date.now();
889
889
  function $16f0b7bb276bc17e$export$5591b0b878c1a989(props, state, ref) {
890
890
  var _state_value;
891
- let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
891
+ let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
892
892
  ...props,
893
893
  labelElementType: "span"
894
894
  });
895
- let { focusWithinProps: focusWithinProps } = (0, $cIPI0$useFocusWithin)({
895
+ let { focusWithinProps: focusWithinProps } = (0, $cIPI0$useFocusWithin)({
896
896
  ...props,
897
897
  onBlurWithin: (e)=>{
898
898
  state.confirmPlaceholder();
@@ -995,13 +995,13 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
995
995
  let dialogId = (0, $cIPI0$useId)();
996
996
  let fieldId = (0, $cIPI0$useId)();
997
997
  let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
998
- let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
998
+ let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
999
999
  ...props,
1000
1000
  labelElementType: "span"
1001
1001
  });
1002
1002
  let groupProps = (0, $3dfb0f96be0d6a08$export$4a931266a3838b86)(state, ref);
1003
1003
  let labelledBy = fieldProps["aria-labelledby"] || fieldProps.id;
1004
- let { locale: locale } = (0, $cIPI0$useLocale)();
1004
+ let { locale: locale } = (0, $cIPI0$useLocale)();
1005
1005
  let date = state.formatValue(locale, {
1006
1006
  month: "long"
1007
1007
  });
@@ -1017,7 +1017,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
1017
1017
  let focusManager = (0, $cIPI0$useMemo)(()=>(0, $cIPI0$createFocusManager)(ref), [
1018
1018
  ref
1019
1019
  ]);
1020
- let { focusWithinProps: focusWithinProps } = (0, $cIPI0$useFocusWithin)({
1020
+ let { focusWithinProps: focusWithinProps } = (0, $cIPI0$useFocusWithin)({
1021
1021
  ...props,
1022
1022
  isDisabled: state.isOpen,
1023
1023
  onBlurWithin: props.onBlur,
@@ -1075,7 +1075,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
1075
1075
  "aria-label": stringFormatter.format("calendar"),
1076
1076
  "aria-labelledby": `${buttonId} ${labelledBy}`,
1077
1077
  "aria-describedby": ariaDescribedBy,
1078
- "aria-expanded": state.isOpen || undefined,
1078
+ "aria-expanded": state.isOpen,
1079
1079
  onPress: ()=>state.setOpen(true)
1080
1080
  },
1081
1081
  dialogProps: {
@@ -1131,7 +1131,7 @@ function $6057a3d2a53a12fd$export$42df105a73306d51(props, state, ref) {
1131
1131
 
1132
1132
 
1133
1133
  function $3aeceb3a64eb8358$export$d42c60378c8168f8() {
1134
- let { locale: locale } = (0, $cIPI0$useLocale)();
1134
+ let { locale: locale } = (0, $cIPI0$useLocale)();
1135
1135
  return (0, $cIPI0$useMemo)(()=>{
1136
1136
  // Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField
1137
1137
  // type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2
@@ -1161,9 +1161,9 @@ class $3aeceb3a64eb8358$var$DisplayNamesPolyfill {
1161
1161
 
1162
1162
  function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
1163
1163
  let enteredKeys = (0, $cIPI0$useRef)("");
1164
- let { locale: locale } = (0, $cIPI0$useLocale)();
1164
+ let { locale: locale } = (0, $cIPI0$useLocale)();
1165
1165
  let displayNames = (0, $3aeceb3a64eb8358$export$d42c60378c8168f8)();
1166
- let { ariaLabel: ariaLabel , ariaLabelledBy: ariaLabelledBy , ariaDescribedBy: ariaDescribedBy , focusManager: focusManager } = (0, $16f0b7bb276bc17e$export$653eddfc964b0f8a).get(state);
1166
+ let { ariaLabel: ariaLabel, ariaLabelledBy: ariaLabelledBy, ariaDescribedBy: ariaDescribedBy, focusManager: focusManager } = (0, $16f0b7bb276bc17e$export$653eddfc964b0f8a).get(state);
1167
1167
  let textValue = segment.isPlaceholder ? "" : segment.text;
1168
1168
  let options = (0, $cIPI0$useMemo)(()=>state.dateFormatter.resolvedOptions(), [
1169
1169
  state.dateFormatter
@@ -1181,7 +1181,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
1181
1181
  let monthTextValue = monthDateFormatter.format(state.dateValue);
1182
1182
  textValue = monthTextValue !== textValue ? `${textValue} – ${monthTextValue}` : monthTextValue;
1183
1183
  } else if (segment.type === "hour" && !segment.isPlaceholder) textValue = hourDateFormatter.format(state.dateValue);
1184
- let { spinButtonProps: spinButtonProps } = (0, $cIPI0$useSpinButton)({
1184
+ let { spinButtonProps: spinButtonProps } = (0, $cIPI0$useSpinButton)({
1185
1185
  // The ARIA spec says aria-valuenow is optional if there's no value, but aXe seems to require it.
1186
1186
  // This doesn't seem to have any negative effects with real AT since we also use aria-valuetext.
1187
1187
  // https://github.com/dequelabs/axe-core/issues/3505
@@ -1247,7 +1247,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
1247
1247
  }
1248
1248
  };
1249
1249
  // Safari dayPeriod option doesn't work...
1250
- let { startsWith: startsWith } = (0, $cIPI0$useFilter)({
1250
+ let { startsWith: startsWith } = (0, $cIPI0$useFilter)({
1251
1251
  sensitivity: "base"
1252
1252
  });
1253
1253
  let amPmFormatter = (0, $cIPI0$useDateFormatter)({
@@ -1387,7 +1387,7 @@ function $32489daedd52963e$export$1315d136e6f7581(segment, state, ref) {
1387
1387
  }
1388
1388
  });
1389
1389
  (0, $cIPI0$useEvent)(ref, "input", (e)=>{
1390
- let { inputType: inputType , data: data } = e;
1390
+ let { inputType: inputType, data: data } = e;
1391
1391
  switch(inputType){
1392
1392
  case "insertCompositionText":
1393
1393
  // Reset the DOM to how it was in the beforeinput event.
@@ -1508,12 +1508,12 @@ function $32489daedd52963e$var$commonPrefixLength(strings) {
1508
1508
  function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
1509
1509
  var _state_value, _state_value1;
1510
1510
  let stringFormatter = (0, $cIPI0$useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($dfb4eba373ed9493$exports))));
1511
- let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
1511
+ let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $cIPI0$useField)({
1512
1512
  ...props,
1513
1513
  labelElementType: "span"
1514
1514
  });
1515
1515
  let labelledBy = fieldProps["aria-labelledby"] || fieldProps.id;
1516
- let { locale: locale } = (0, $cIPI0$useLocale)();
1516
+ let { locale: locale } = (0, $cIPI0$useLocale)();
1517
1517
  let range = state.formatValue(locale, {
1518
1518
  month: "long"
1519
1519
  });
@@ -1561,7 +1561,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
1561
1561
  isInvalid: state.isInvalid
1562
1562
  };
1563
1563
  let domProps = (0, $cIPI0$filterDOMProps)(props);
1564
- let { focusWithinProps: focusWithinProps } = (0, $cIPI0$useFocusWithin)({
1564
+ let { focusWithinProps: focusWithinProps } = (0, $cIPI0$useFocusWithin)({
1565
1565
  ...props,
1566
1566
  isDisabled: state.isOpen,
1567
1567
  onBlurWithin: props.onBlur,
@@ -1595,7 +1595,7 @@ function $887cac91b7cc8801$export$12fd5f0e9f4bb192(props, state, ref) {
1595
1595
  "aria-label": stringFormatter.format("calendar"),
1596
1596
  "aria-labelledby": `${buttonId} ${labelledBy}`,
1597
1597
  "aria-describedby": ariaDescribedBy,
1598
- "aria-expanded": state.isOpen || undefined,
1598
+ "aria-expanded": state.isOpen,
1599
1599
  onPress: ()=>state.setOpen(true)
1600
1600
  },
1601
1601
  dialogProps: {
package/dist/main.js CHANGED
@@ -818,7 +818,7 @@ $c1905b78f6d2f5bf$exports = {
818
818
 
819
819
 
820
820
  function $715562ad3b4cced4$export$4a931266a3838b86(state, ref, disableArrowNavigation) {
821
- let { direction: direction } = (0, $IwcIq$reactariai18n.useLocale)();
821
+ let { direction: direction } = (0, $IwcIq$reactariai18n.useLocale)();
822
822
  let focusManager = (0, $IwcIq$react.useMemo)(()=>(0, $IwcIq$reactariafocus.createFocusManager)(ref), [
823
823
  ref
824
824
  ]);
@@ -874,7 +874,7 @@ function $715562ad3b4cced4$export$4a931266a3838b86(state, ref, disableArrowNavig
874
874
  }
875
875
  if (target) target.focus();
876
876
  };
877
- let { pressProps: pressProps } = (0, $IwcIq$reactariainteractions.usePress)({
877
+ let { pressProps: pressProps } = (0, $IwcIq$reactariainteractions.usePress)({
878
878
  preventFocusOnPress: true,
879
879
  allowTextSelectionOnPress: true,
880
880
  onPressStart (e) {
@@ -898,11 +898,11 @@ const $4acc2f407c169e55$export$300019f83c56d282 = "__role_" + Date.now();
898
898
  const $4acc2f407c169e55$export$7b3062cd49e80452 = "__focusManager_" + Date.now();
899
899
  function $4acc2f407c169e55$export$5591b0b878c1a989(props, state, ref) {
900
900
  var _state_value;
901
- let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
901
+ let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
902
902
  ...props,
903
903
  labelElementType: "span"
904
904
  });
905
- let { focusWithinProps: focusWithinProps } = (0, $IwcIq$reactariainteractions.useFocusWithin)({
905
+ let { focusWithinProps: focusWithinProps } = (0, $IwcIq$reactariainteractions.useFocusWithin)({
906
906
  ...props,
907
907
  onBlurWithin: (e)=>{
908
908
  state.confirmPlaceholder();
@@ -1005,13 +1005,13 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
1005
1005
  let dialogId = (0, $IwcIq$reactariautils.useId)();
1006
1006
  let fieldId = (0, $IwcIq$reactariautils.useId)();
1007
1007
  let stringFormatter = (0, $IwcIq$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($c1905b78f6d2f5bf$exports))));
1008
- let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
1008
+ let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
1009
1009
  ...props,
1010
1010
  labelElementType: "span"
1011
1011
  });
1012
1012
  let groupProps = (0, $715562ad3b4cced4$export$4a931266a3838b86)(state, ref);
1013
1013
  let labelledBy = fieldProps["aria-labelledby"] || fieldProps.id;
1014
- let { locale: locale } = (0, $IwcIq$reactariai18n.useLocale)();
1014
+ let { locale: locale } = (0, $IwcIq$reactariai18n.useLocale)();
1015
1015
  let date = state.formatValue(locale, {
1016
1016
  month: "long"
1017
1017
  });
@@ -1027,7 +1027,7 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
1027
1027
  let focusManager = (0, $IwcIq$react.useMemo)(()=>(0, $IwcIq$reactariafocus.createFocusManager)(ref), [
1028
1028
  ref
1029
1029
  ]);
1030
- let { focusWithinProps: focusWithinProps } = (0, $IwcIq$reactariainteractions.useFocusWithin)({
1030
+ let { focusWithinProps: focusWithinProps } = (0, $IwcIq$reactariainteractions.useFocusWithin)({
1031
1031
  ...props,
1032
1032
  isDisabled: state.isOpen,
1033
1033
  onBlurWithin: props.onBlur,
@@ -1085,7 +1085,7 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
1085
1085
  "aria-label": stringFormatter.format("calendar"),
1086
1086
  "aria-labelledby": `${buttonId} ${labelledBy}`,
1087
1087
  "aria-describedby": ariaDescribedBy,
1088
- "aria-expanded": state.isOpen || undefined,
1088
+ "aria-expanded": state.isOpen,
1089
1089
  onPress: ()=>state.setOpen(true)
1090
1090
  },
1091
1091
  dialogProps: {
@@ -1141,7 +1141,7 @@ function $e90ae7c26a69c6b1$export$42df105a73306d51(props, state, ref) {
1141
1141
 
1142
1142
 
1143
1143
  function $934ac650a0aceb4b$export$d42c60378c8168f8() {
1144
- let { locale: locale } = (0, $IwcIq$reactariai18n.useLocale)();
1144
+ let { locale: locale } = (0, $IwcIq$reactariai18n.useLocale)();
1145
1145
  return (0, $IwcIq$react.useMemo)(()=>{
1146
1146
  // Try to use Intl.DisplayNames if possible. It may be supported in browsers, but not support the dateTimeField
1147
1147
  // type as that was only added in v2. https://github.com/tc39/intl-displaynames-v2
@@ -1171,9 +1171,9 @@ class $934ac650a0aceb4b$var$DisplayNamesPolyfill {
1171
1171
 
1172
1172
  function $5c015c6316d1904d$export$1315d136e6f7581(segment, state, ref) {
1173
1173
  let enteredKeys = (0, $IwcIq$react.useRef)("");
1174
- let { locale: locale } = (0, $IwcIq$reactariai18n.useLocale)();
1174
+ let { locale: locale } = (0, $IwcIq$reactariai18n.useLocale)();
1175
1175
  let displayNames = (0, $934ac650a0aceb4b$export$d42c60378c8168f8)();
1176
- let { ariaLabel: ariaLabel , ariaLabelledBy: ariaLabelledBy , ariaDescribedBy: ariaDescribedBy , focusManager: focusManager } = (0, $4acc2f407c169e55$export$653eddfc964b0f8a).get(state);
1176
+ let { ariaLabel: ariaLabel, ariaLabelledBy: ariaLabelledBy, ariaDescribedBy: ariaDescribedBy, focusManager: focusManager } = (0, $4acc2f407c169e55$export$653eddfc964b0f8a).get(state);
1177
1177
  let textValue = segment.isPlaceholder ? "" : segment.text;
1178
1178
  let options = (0, $IwcIq$react.useMemo)(()=>state.dateFormatter.resolvedOptions(), [
1179
1179
  state.dateFormatter
@@ -1191,7 +1191,7 @@ function $5c015c6316d1904d$export$1315d136e6f7581(segment, state, ref) {
1191
1191
  let monthTextValue = monthDateFormatter.format(state.dateValue);
1192
1192
  textValue = monthTextValue !== textValue ? `${textValue} – ${monthTextValue}` : monthTextValue;
1193
1193
  } else if (segment.type === "hour" && !segment.isPlaceholder) textValue = hourDateFormatter.format(state.dateValue);
1194
- let { spinButtonProps: spinButtonProps } = (0, $IwcIq$reactariaspinbutton.useSpinButton)({
1194
+ let { spinButtonProps: spinButtonProps } = (0, $IwcIq$reactariaspinbutton.useSpinButton)({
1195
1195
  // The ARIA spec says aria-valuenow is optional if there's no value, but aXe seems to require it.
1196
1196
  // This doesn't seem to have any negative effects with real AT since we also use aria-valuetext.
1197
1197
  // https://github.com/dequelabs/axe-core/issues/3505
@@ -1257,7 +1257,7 @@ function $5c015c6316d1904d$export$1315d136e6f7581(segment, state, ref) {
1257
1257
  }
1258
1258
  };
1259
1259
  // Safari dayPeriod option doesn't work...
1260
- let { startsWith: startsWith } = (0, $IwcIq$reactariai18n.useFilter)({
1260
+ let { startsWith: startsWith } = (0, $IwcIq$reactariai18n.useFilter)({
1261
1261
  sensitivity: "base"
1262
1262
  });
1263
1263
  let amPmFormatter = (0, $IwcIq$reactariai18n.useDateFormatter)({
@@ -1397,7 +1397,7 @@ function $5c015c6316d1904d$export$1315d136e6f7581(segment, state, ref) {
1397
1397
  }
1398
1398
  });
1399
1399
  (0, $IwcIq$reactariautils.useEvent)(ref, "input", (e)=>{
1400
- let { inputType: inputType , data: data } = e;
1400
+ let { inputType: inputType, data: data } = e;
1401
1401
  switch(inputType){
1402
1402
  case "insertCompositionText":
1403
1403
  // Reset the DOM to how it was in the beforeinput event.
@@ -1518,12 +1518,12 @@ function $5c015c6316d1904d$var$commonPrefixLength(strings) {
1518
1518
  function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
1519
1519
  var _state_value, _state_value1;
1520
1520
  let stringFormatter = (0, $IwcIq$reactariai18n.useLocalizedStringFormatter)((0, (/*@__PURE__*/$parcel$interopDefault($c1905b78f6d2f5bf$exports))));
1521
- let { labelProps: labelProps , fieldProps: fieldProps , descriptionProps: descriptionProps , errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
1521
+ let { labelProps: labelProps, fieldProps: fieldProps, descriptionProps: descriptionProps, errorMessageProps: errorMessageProps } = (0, $IwcIq$reactarialabel.useField)({
1522
1522
  ...props,
1523
1523
  labelElementType: "span"
1524
1524
  });
1525
1525
  let labelledBy = fieldProps["aria-labelledby"] || fieldProps.id;
1526
- let { locale: locale } = (0, $IwcIq$reactariai18n.useLocale)();
1526
+ let { locale: locale } = (0, $IwcIq$reactariai18n.useLocale)();
1527
1527
  let range = state.formatValue(locale, {
1528
1528
  month: "long"
1529
1529
  });
@@ -1571,7 +1571,7 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
1571
1571
  isInvalid: state.isInvalid
1572
1572
  };
1573
1573
  let domProps = (0, $IwcIq$reactariautils.filterDOMProps)(props);
1574
- let { focusWithinProps: focusWithinProps } = (0, $IwcIq$reactariainteractions.useFocusWithin)({
1574
+ let { focusWithinProps: focusWithinProps } = (0, $IwcIq$reactariainteractions.useFocusWithin)({
1575
1575
  ...props,
1576
1576
  isDisabled: state.isOpen,
1577
1577
  onBlurWithin: props.onBlur,
@@ -1605,7 +1605,7 @@ function $20f695b1b69e6b9e$export$12fd5f0e9f4bb192(props, state, ref) {
1605
1605
  "aria-label": stringFormatter.format("calendar"),
1606
1606
  "aria-labelledby": `${buttonId} ${labelledBy}`,
1607
1607
  "aria-describedby": ariaDescribedBy,
1608
- "aria-expanded": state.isOpen || undefined,
1608
+ "aria-expanded": state.isOpen,
1609
1609
  onPress: ()=>state.setOpen(true)
1610
1610
  },
1611
1611
  dialogProps: {