@react-spectrum/datepicker 3.10.2 → 3.11.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.
Files changed (54) hide show
  1. package/LICENSE +201 -0
  2. package/dist/DateField.main.js +2 -2
  3. package/dist/DateField.main.js.map +1 -1
  4. package/dist/DateField.mjs +2 -2
  5. package/dist/DateField.module.js +2 -2
  6. package/dist/DateField.module.js.map +1 -1
  7. package/dist/DatePicker.main.js +2 -2
  8. package/dist/DatePicker.main.js.map +1 -1
  9. package/dist/DatePicker.mjs +2 -2
  10. package/dist/DatePicker.module.js +2 -2
  11. package/dist/DatePicker.module.js.map +1 -1
  12. package/dist/DatePickerField.main.js +2 -2
  13. package/dist/DatePickerField.main.js.map +1 -1
  14. package/dist/DatePickerField.mjs +2 -2
  15. package/dist/DatePickerField.module.js +2 -2
  16. package/dist/DatePickerField.module.js.map +1 -1
  17. package/dist/DatePickerSegment.main.js +1 -1
  18. package/dist/DatePickerSegment.main.js.map +1 -1
  19. package/dist/DatePickerSegment.mjs +1 -1
  20. package/dist/DatePickerSegment.module.js +1 -1
  21. package/dist/DatePickerSegment.module.js.map +1 -1
  22. package/dist/DateRangePicker.main.js +2 -2
  23. package/dist/DateRangePicker.main.js.map +1 -1
  24. package/dist/DateRangePicker.mjs +2 -2
  25. package/dist/DateRangePicker.module.js +2 -2
  26. package/dist/DateRangePicker.module.js.map +1 -1
  27. package/dist/Input.main.js +1 -1
  28. package/dist/Input.main.js.map +1 -1
  29. package/dist/Input.mjs +1 -1
  30. package/dist/Input.module.js +1 -1
  31. package/dist/Input.module.js.map +1 -1
  32. package/dist/TimeField.main.js +1 -1
  33. package/dist/TimeField.main.js.map +1 -1
  34. package/dist/TimeField.mjs +1 -1
  35. package/dist/TimeField.module.js +1 -1
  36. package/dist/TimeField.module.js.map +1 -1
  37. package/dist/inputgroup_vars_css.main.js.map +1 -1
  38. package/dist/inputgroup_vars_css.module.js.map +1 -1
  39. package/dist/textfield_vars_css.main.js.map +1 -1
  40. package/dist/textfield_vars_css.module.js.map +1 -1
  41. package/dist/utils.main.js +1 -1
  42. package/dist/utils.main.js.map +1 -1
  43. package/dist/utils.mjs +1 -1
  44. package/dist/utils.module.js +1 -1
  45. package/dist/utils.module.js.map +1 -1
  46. package/package.json +25 -24
  47. package/src/DateField.tsx +4 -4
  48. package/src/DatePicker.tsx +3 -3
  49. package/src/DatePickerField.tsx +2 -2
  50. package/src/DatePickerSegment.tsx +1 -1
  51. package/src/DateRangePicker.tsx +3 -3
  52. package/src/Input.tsx +4 -4
  53. package/src/TimeField.tsx +3 -3
  54. package/src/utils.ts +2 -2
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,SAAS,0CAAkB,WAAC,OAAO,SAAE,KAAK,EAAE,GAAG,YAAmC;IACvF,OAAQ,QAAQ,IAAI;QAClB,gCAAgC;QAChC,KAAK;YACH,qBAAO,0DAAC;gBAAe,SAAS;;QAElC,mBAAmB;QACnB;YACE,qBAAO,0DAAC;gBAAgB,SAAS;gBAAS,OAAO;gBAAQ,GAAG,UAAU;;IAC1E;AACF;AAEA,SAAS,qCAAe,WAAC,OAAO,EAAsB;IACpD,qBACE,0DAAC;QACC,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAa,QAAQ,IAAI,KAAK,YAAY,YAAY,QAAQ,IAAI;OACjE,QAAQ,IAAI;AAGnB;AAEA,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,EAAyB;IAC/D,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAE;IACjB,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE,SAAS,OAAO;IAEpD,qBACE,0DAAC;QACE,GAAG,YAAY;QAChB,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,kCAAkC;YAC9D,kBAAkB,QAAQ,aAAa;YACvC,gBAAgB,CAAC,QAAQ,UAAU;QACrC;QACA,OAAO,aAAa,KAAK;QACzB,eAAa,QAAQ,IAAI;OACxB,QAAQ,aAAa,iBAAG,0DAAC;QAAK,eAAY;QAAO,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA2C,QAAQ,WAAW,IAAW,QAAQ,IAAI;AAG3K","sources":["packages/@react-spectrum/datepicker/src/DatePickerSegment.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DateFieldState, DateSegment} from '@react-stately/datepicker';\nimport {DatePickerBase, DateValue} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport styles from './styles.css';\nimport {useDateSegment} from '@react-aria/datepicker';\n\ninterface DatePickerSegmentProps extends DatePickerBase<DateValue> {\n segment: DateSegment,\n state: DateFieldState\n}\n\ninterface LiteralSegmentProps {\n segment: DateSegment\n}\n\nexport function DatePickerSegment({segment, state, ...otherProps}: DatePickerSegmentProps) {\n switch (segment.type) {\n // A separator, e.g. punctuation\n case 'literal':\n return <LiteralSegment segment={segment} />;\n\n // Editable segment\n default:\n return <EditableSegment segment={segment} state={state} {...otherProps} />;\n }\n}\n\nfunction LiteralSegment({segment}: LiteralSegmentProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={classNames(styles, 'react-spectrum-Datepicker-literal')}\n data-testid={segment.type === 'literal' ? undefined : segment.type}>\n {segment.text}\n </span>\n );\n}\n\nfunction EditableSegment({segment, state}: DatePickerSegmentProps) {\n let ref = useRef(undefined);\n let {segmentProps} = useDateSegment(segment, state, ref);\n\n return (\n <div\n {...segmentProps}\n ref={ref}\n className={classNames(styles, 'react-spectrum-DatePicker-cell', {\n 'is-placeholder': segment.isPlaceholder,\n 'is-read-only': !segment.isEditable\n })}\n style={segmentProps.style}\n data-testid={segment.type}>\n {segment.isPlaceholder ? <span aria-hidden=\"true\" className={classNames(styles, 'react-spectrum-DatePicker-placeholder')}>{segment.placeholder}</span> : segment.text}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"DatePickerSegment.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,SAAS,0CAAkB,WAAC,OAAO,SAAE,KAAK,EAAE,GAAG,YAAmC;IACvF,OAAQ,QAAQ,IAAI;QAClB,gCAAgC;QAChC,KAAK;YACH,qBAAO,0DAAC;gBAAe,SAAS;;QAElC,mBAAmB;QACnB;YACE,qBAAO,0DAAC;gBAAgB,SAAS;gBAAS,OAAO;gBAAQ,GAAG,UAAU;;IAC1E;AACF;AAEA,SAAS,qCAAe,WAAC,OAAO,EAAsB;IACpD,qBACE,0DAAC;QACC,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAa,QAAQ,IAAI,KAAK,YAAY,YAAY,QAAQ,IAAI;OACjE,QAAQ,IAAI;AAGnB;AAEA,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,EAAyB;IAC/D,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAyB;IACxC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,yCAAa,EAAE,SAAS,OAAO;IAEpD,qBACE,0DAAC;QACE,GAAG,YAAY;QAChB,KAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,kCAAkC;YAC9D,kBAAkB,QAAQ,aAAa;YACvC,gBAAgB,CAAC,QAAQ,UAAU;QACrC;QACA,OAAO,aAAa,KAAK;QACzB,eAAa,QAAQ,IAAI;OACxB,QAAQ,aAAa,iBAAG,0DAAC;QAAK,eAAY;QAAO,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA2C,QAAQ,WAAW,IAAW,QAAQ,IAAI;AAG3K","sources":["packages/@react-spectrum/datepicker/src/DatePickerSegment.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DateFieldState, DateSegment} from '@react-stately/datepicker';\nimport {DatePickerBase, DateValue} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport styles from './styles.css';\nimport {useDateSegment} from '@react-aria/datepicker';\n\ninterface DatePickerSegmentProps extends DatePickerBase<DateValue> {\n segment: DateSegment,\n state: DateFieldState\n}\n\ninterface LiteralSegmentProps {\n segment: DateSegment\n}\n\nexport function DatePickerSegment({segment, state, ...otherProps}: DatePickerSegmentProps) {\n switch (segment.type) {\n // A separator, e.g. punctuation\n case 'literal':\n return <LiteralSegment segment={segment} />;\n\n // Editable segment\n default:\n return <EditableSegment segment={segment} state={state} {...otherProps} />;\n }\n}\n\nfunction LiteralSegment({segment}: LiteralSegmentProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={classNames(styles, 'react-spectrum-Datepicker-literal')}\n data-testid={segment.type === 'literal' ? undefined : segment.type}>\n {segment.text}\n </span>\n );\n}\n\nfunction EditableSegment({segment, state}: DatePickerSegmentProps) {\n let ref = useRef<HTMLDivElement | null>(null);\n let {segmentProps} = useDateSegment(segment, state, ref);\n\n return (\n <div\n {...segmentProps}\n ref={ref}\n className={classNames(styles, 'react-spectrum-DatePicker-cell', {\n 'is-placeholder': segment.isPlaceholder,\n 'is-read-only': !segment.isEditable\n })}\n style={segmentProps.style}\n data-testid={segment.type}>\n {segment.isPlaceholder ? <span aria-hidden=\"true\" className={classNames(styles, 'react-spectrum-DatePicker-placeholder')}>{segment.placeholder}</span> : segment.text}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"DatePickerSegment.main.js.map"}
@@ -46,7 +46,7 @@ function $cfa347761f172638$var$LiteralSegment({ segment: segment }) {
46
46
  }, segment.text);
47
47
  }
48
48
  function $cfa347761f172638$var$EditableSegment({ segment: segment, state: state }) {
49
- let ref = (0, $jOVo7$useRef)(undefined);
49
+ let ref = (0, $jOVo7$useRef)(null);
50
50
  let { segmentProps: segmentProps } = (0, $jOVo7$useDateSegment)(segment, state, ref);
51
51
  return /*#__PURE__*/ (0, $jOVo7$react).createElement("div", {
52
52
  ...segmentProps,
@@ -46,7 +46,7 @@ function $cfa347761f172638$var$LiteralSegment({ segment: segment }) {
46
46
  }, segment.text);
47
47
  }
48
48
  function $cfa347761f172638$var$EditableSegment({ segment: segment, state: state }) {
49
- let ref = (0, $jOVo7$useRef)(undefined);
49
+ let ref = (0, $jOVo7$useRef)(null);
50
50
  let { segmentProps: segmentProps } = (0, $jOVo7$useDateSegment)(segment, state, ref);
51
51
  return /*#__PURE__*/ (0, $jOVo7$react).createElement("div", {
52
52
  ...segmentProps,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,SAAS,0CAAkB,WAAC,OAAO,SAAE,KAAK,EAAE,GAAG,YAAmC;IACvF,OAAQ,QAAQ,IAAI;QAClB,gCAAgC;QAChC,KAAK;YACH,qBAAO,gCAAC;gBAAe,SAAS;;QAElC,mBAAmB;QACnB;YACE,qBAAO,gCAAC;gBAAgB,SAAS;gBAAS,OAAO;gBAAQ,GAAG,UAAU;;IAC1E;AACF;AAEA,SAAS,qCAAe,WAAC,OAAO,EAAsB;IACpD,qBACE,gCAAC;QACC,eAAY;QACZ,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAa,QAAQ,IAAI,KAAK,YAAY,YAAY,QAAQ,IAAI;OACjE,QAAQ,IAAI;AAGnB;AAEA,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,EAAyB;IAC/D,IAAI,MAAM,CAAA,GAAA,aAAK,EAAE;IACjB,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,SAAS,OAAO;IAEpD,qBACE,gCAAC;QACE,GAAG,YAAY;QAChB,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,kCAAkC;YAC9D,kBAAkB,QAAQ,aAAa;YACvC,gBAAgB,CAAC,QAAQ,UAAU;QACrC;QACA,OAAO,aAAa,KAAK;QACzB,eAAa,QAAQ,IAAI;OACxB,QAAQ,aAAa,iBAAG,gCAAC;QAAK,eAAY;QAAO,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA2C,QAAQ,WAAW,IAAW,QAAQ,IAAI;AAG3K","sources":["packages/@react-spectrum/datepicker/src/DatePickerSegment.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DateFieldState, DateSegment} from '@react-stately/datepicker';\nimport {DatePickerBase, DateValue} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport styles from './styles.css';\nimport {useDateSegment} from '@react-aria/datepicker';\n\ninterface DatePickerSegmentProps extends DatePickerBase<DateValue> {\n segment: DateSegment,\n state: DateFieldState\n}\n\ninterface LiteralSegmentProps {\n segment: DateSegment\n}\n\nexport function DatePickerSegment({segment, state, ...otherProps}: DatePickerSegmentProps) {\n switch (segment.type) {\n // A separator, e.g. punctuation\n case 'literal':\n return <LiteralSegment segment={segment} />;\n\n // Editable segment\n default:\n return <EditableSegment segment={segment} state={state} {...otherProps} />;\n }\n}\n\nfunction LiteralSegment({segment}: LiteralSegmentProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={classNames(styles, 'react-spectrum-Datepicker-literal')}\n data-testid={segment.type === 'literal' ? undefined : segment.type}>\n {segment.text}\n </span>\n );\n}\n\nfunction EditableSegment({segment, state}: DatePickerSegmentProps) {\n let ref = useRef(undefined);\n let {segmentProps} = useDateSegment(segment, state, ref);\n\n return (\n <div\n {...segmentProps}\n ref={ref}\n className={classNames(styles, 'react-spectrum-DatePicker-cell', {\n 'is-placeholder': segment.isPlaceholder,\n 'is-read-only': !segment.isEditable\n })}\n style={segmentProps.style}\n data-testid={segment.type}>\n {segment.isPlaceholder ? <span aria-hidden=\"true\" className={classNames(styles, 'react-spectrum-DatePicker-placeholder')}>{segment.placeholder}</span> : segment.text}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"DatePickerSegment.module.js.map"}
1
+ {"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAkBM,SAAS,0CAAkB,WAAC,OAAO,SAAE,KAAK,EAAE,GAAG,YAAmC;IACvF,OAAQ,QAAQ,IAAI;QAClB,gCAAgC;QAChC,KAAK;YACH,qBAAO,gCAAC;gBAAe,SAAS;;QAElC,mBAAmB;QACnB;YACE,qBAAO,gCAAC;gBAAgB,SAAS;gBAAS,OAAO;gBAAQ,GAAG,UAAU;;IAC1E;AACF;AAEA,SAAS,qCAAe,WAAC,OAAO,EAAsB;IACpD,qBACE,gCAAC;QACC,eAAY;QACZ,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QAC9B,eAAa,QAAQ,IAAI,KAAK,YAAY,YAAY,QAAQ,IAAI;OACjE,QAAQ,IAAI;AAGnB;AAEA,SAAS,sCAAgB,WAAC,OAAO,SAAE,KAAK,EAAyB;IAC/D,IAAI,MAAM,CAAA,GAAA,aAAK,EAAyB;IACxC,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,qBAAa,EAAE,SAAS,OAAO;IAEpD,qBACE,gCAAC;QACE,GAAG,YAAY;QAChB,KAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,kCAAkC;YAC9D,kBAAkB,QAAQ,aAAa;YACvC,gBAAgB,CAAC,QAAQ,UAAU;QACrC;QACA,OAAO,aAAa,KAAK;QACzB,eAAa,QAAQ,IAAI;OACxB,QAAQ,aAAa,iBAAG,gCAAC;QAAK,eAAY;QAAO,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAA2C,QAAQ,WAAW,IAAW,QAAQ,IAAI;AAG3K","sources":["packages/@react-spectrum/datepicker/src/DatePickerSegment.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DateFieldState, DateSegment} from '@react-stately/datepicker';\nimport {DatePickerBase, DateValue} from '@react-types/datepicker';\nimport React, {useRef} from 'react';\nimport styles from './styles.css';\nimport {useDateSegment} from '@react-aria/datepicker';\n\ninterface DatePickerSegmentProps extends DatePickerBase<DateValue> {\n segment: DateSegment,\n state: DateFieldState\n}\n\ninterface LiteralSegmentProps {\n segment: DateSegment\n}\n\nexport function DatePickerSegment({segment, state, ...otherProps}: DatePickerSegmentProps) {\n switch (segment.type) {\n // A separator, e.g. punctuation\n case 'literal':\n return <LiteralSegment segment={segment} />;\n\n // Editable segment\n default:\n return <EditableSegment segment={segment} state={state} {...otherProps} />;\n }\n}\n\nfunction LiteralSegment({segment}: LiteralSegmentProps) {\n return (\n <span\n aria-hidden=\"true\"\n className={classNames(styles, 'react-spectrum-Datepicker-literal')}\n data-testid={segment.type === 'literal' ? undefined : segment.type}>\n {segment.text}\n </span>\n );\n}\n\nfunction EditableSegment({segment, state}: DatePickerSegmentProps) {\n let ref = useRef<HTMLDivElement | null>(null);\n let {segmentProps} = useDateSegment(segment, state, ref);\n\n return (\n <div\n {...segmentProps}\n ref={ref}\n className={classNames(styles, 'react-spectrum-DatePicker-cell', {\n 'is-placeholder': segment.isPlaceholder,\n 'is-read-only': !segment.isEditable\n })}\n style={segmentProps.style}\n data-testid={segment.type}>\n {segment.isPlaceholder ? <span aria-hidden=\"true\" className={classNames(styles, 'react-spectrum-DatePicker-placeholder')}>{segment.placeholder}</span> : segment.text}\n </div>\n );\n}\n"],"names":[],"version":3,"file":"DatePickerSegment.module.js.map"}
@@ -77,7 +77,7 @@ function $16cafb71dac155a4$var$DateRangePicker(props, ref) {
77
77
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $56Vum$reactariainteractions.useHover)({
78
78
  isDisabled: isDisabled
79
79
  });
80
- let targetRef = (0, $56Vum$react.useRef)(undefined);
80
+ let targetRef = (0, $56Vum$react.useRef)(null);
81
81
  let state = (0, $56Vum$reactstatelydatepicker.useDateRangePickerState)({
82
82
  ...props,
83
83
  shouldCloseOnSelect: ()=>!state.hasTime
@@ -112,7 +112,7 @@ function $16cafb71dac155a4$var$DateRangePicker(props, ref) {
112
112
  // Note: this description is intentionally not passed to useDatePicker.
113
113
  // The format help text is unnecessary for screen reader users because each segment already has a label.
114
114
  let description = (0, $4d2e419f522adb48$exports.useFormatHelpText)(props);
115
- if (description && !props.description) descriptionProps.id = null;
115
+ if (description && !props.description) descriptionProps.id = undefined;
116
116
  let placeholder = placeholderValue;
117
117
  let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
118
118
  let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;AA8BD,SAAS,sCAAqC,KAAsC,EAAE,GAA8B;QAsJvF,kBAWA;IAhK3B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,WACF,OAAO,cACP,UAAU,aACV,SAAS,oBACT,gBAAgB,oBAChB,mBAAmB,iBACnB,YAAY,EACb,GAAG;IACJ,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAkB;IACvC,IAAI,QAAQ,CAAA,GAAA,qDAAsB,EAAE;QAClC,GAAG,KAAK;QACR,qBAAqB,IAAM,CAAC,MAAM,OAAO;IAC3C;IACA,IAAI,cAAC,UAAU,cAAE,UAAU,eAAE,WAAW,eAAE,WAAW,mBAAE,eAAe,iBAAE,aAAa,oBAAE,gBAAgB,qBAAE,iBAAiB,iBAAE,aAAa,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,6CAAiB,EAAE,OAAO,OAAO;IAC9N,IAAI,UAAC,MAAM,WAAE,OAAO,EAAC,GAAG;IACxB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,G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QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;;AAUtB;AAEA,SAAS;IACP,qBACE,0DAAC;QACC,eAAY;QACZ,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;;AAE9C;AAEA;;;CAGC,GACD,MAAM,0DAAmB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/DateRangePicker.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDateRangePickerProps} from '@react-types/datepicker';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {Flex} from '@react-spectrum/layout';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {RangeCalendar} from '@react-spectrum/calendar';\nimport React, {ReactElement, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePicker} from '@react-aria/datepicker';\nimport {useDateRangePickerState} from '@react-stately/datepicker';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth, useVisibleMonths} from './utils';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isQuiet,\n isDisabled,\n autoFocus,\n placeholderValue,\n maxVisibleMonths = 1,\n pageBehavior\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement>(undefined);\n let state = useDateRangePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {labelProps, groupProps, buttonProps, dialogProps, startFieldProps, endFieldProps, descriptionProps, errorMessageProps, calendarProps, isInvalid, validationErrors, validationDetails} = useDateRangePicker(props, state, targetRef);\n let {isOpen, setOpen} = state;\n let {direction} = useLocale();\n let domRef = useFocusManagerRef(ref);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/datepicker');\n\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true,\n isTextInput: true,\n autoFocus\n });\n\n let {isFocused: isFocusedButton, focusProps: focusPropsButton} = useFocusRing({\n within: false,\n isTextInput: false,\n autoFocus\n });\n\n let className = classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'spectrum-InputGroup--invalid': isInvalid && !isDisabled,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'focus-ring': isFocusVisible && !isFocusedButton\n }\n );\n\n let fieldClassName = classNames(\n styles,\n 'spectrum-InputGroup-input',\n {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\n }\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n descriptionProps.id = null;\n }\n\n let placeholder: DateValue = placeholderValue;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;\n let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n // Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash\n let approximateWidth = `calc(${useFormattedDateWidth(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-fieldWrapper')}>\n <div\n {...mergeProps(groupProps, hoverProps, focusProps)}\n className={className}\n ref={targetRef}>\n <Input\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n className={classNames(styles, 'spectrum-InputGroup-field')}\n inputClassName={fieldClassName}\n disableFocusRing\n minWidth={approximateWidth}>\n <DatePickerField\n {...startFieldProps}\n data-testid=\"start-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-startField')} />\n <DateRangeDash />\n <DatePickerField\n {...endFieldProps}\n data-testid=\"end-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(\n styles,\n 'spectrum-Datepicker-endField',\n classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-endField'\n )\n )} />\n </Input>\n <DialogTrigger\n type=\"popover\"\n mobileType=\"tray\"\n placement={direction === 'rtl' ? 'bottom right' : 'bottom left'}\n targetRef={targetRef}\n hideArrow\n isOpen={isOpen}\n onOpenChange={setOpen}\n shouldFlip={props.shouldFlip}>\n <FieldButton\n {...mergeProps(buttonProps, focusPropsButton)}\n UNSAFE_className={classNames(styles, 'spectrum-FieldButton')}\n isQuiet={isQuiet}\n validationState={validationState}>\n <CalendarIcon />\n </FieldButton>\n <Dialog UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')} {...dialogProps}>\n <Content>\n <div className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n pageBehavior={pageBehavior}\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-calendar', {'is-invalid': validationState === 'invalid'})} />\n {showTimeField &&\n <Flex gap=\"size-100\" marginTop=\"size-100\" UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-timeFields')}>\n <TimeField\n label={stringFormatter.format('startTime')}\n value={state.timeRange?.start || null}\n onChange={v => state.setTime('start', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n <TimeField\n label={stringFormatter.format('endTime')}\n value={state.timeRange?.end || null}\n onChange={v => state.setTime('end', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n </Flex>\n }\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}\n\nfunction DateRangeDash() {\n return (\n <div\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')} />\n );\n}\n\n/**\n * DateRangePickers combine two DateFields and a RangeCalendar popover to allow users\n * to enter or select a date and time range.\n */\nconst _DateRangePicker = React.forwardRef(DateRangePicker) as <T extends DateValue>(props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_DateRangePicker as DateRangePicker};\n"],"names":[],"version":3,"file":"DateRangePicker.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;AA8BD,SAAS,sCAAqC,KAAsC,EAAE,GAA8B;QAsJvF,kBAWA;IAhK3B,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,WACF,OAAO,cACP,UAAU,aACV,SAAS,oBACT,gBAAgB,oBAChB,mBAAmB,iBACnB,YAAY,EACb,GAAG;IACJ,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAyB;IAC9C,IAAI,QAAQ,CAAA,GAAA,qDAAsB,EAAE;QAClC,GAAG,KAAK;QACR,qBAAqB,IAAM,CAAC,MAAM,OAAO;IAC3C;IACA,IAAI,cAAC,UAAU,cAAE,UAAU,eAAE,WAAW,eAAE,WAAW,mBAAE,eAAe,iBAAE,aAAa,oBAAE,gBAAgB,qBAAE,iBAAiB,iBAAE,aAAa,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,6CAAiB,EAAE,OAAO,OAAO;IAC9N,IAAI,UAAC,MAAM,WAAE,OAAO,EAAC,GAAG;IACxB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,8BAAQ;IAC1B,IAAI,SAAS,CAAA,GAAA,4CAAiB,EAAE;IAChC,IAAI,kBAAkB,CAAA,GAAA,gDAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;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ACZ,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;;AAE9C;AAEA;;;CAGC,GACD,MAAM,0DAAmB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/DateRangePicker.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDateRangePickerProps} from '@react-types/datepicker';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {Flex} from '@react-spectrum/layout';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {RangeCalendar} from '@react-spectrum/calendar';\nimport React, {ReactElement, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePicker} from '@react-aria/datepicker';\nimport {useDateRangePickerState} from '@react-stately/datepicker';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth, useVisibleMonths} from './utils';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isQuiet,\n isDisabled,\n autoFocus,\n placeholderValue,\n maxVisibleMonths = 1,\n pageBehavior\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDateRangePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {labelProps, groupProps, buttonProps, dialogProps, startFieldProps, endFieldProps, descriptionProps, errorMessageProps, calendarProps, isInvalid, validationErrors, validationDetails} = useDateRangePicker(props, state, targetRef);\n let {isOpen, setOpen} = state;\n let {direction} = useLocale();\n let domRef = useFocusManagerRef(ref);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/datepicker');\n\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true,\n isTextInput: true,\n autoFocus\n });\n\n let {isFocused: isFocusedButton, focusProps: focusPropsButton} = useFocusRing({\n within: false,\n isTextInput: false,\n autoFocus\n });\n\n let className = classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'spectrum-InputGroup--invalid': isInvalid && !isDisabled,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'focus-ring': isFocusVisible && !isFocusedButton\n }\n );\n\n let fieldClassName = classNames(\n styles,\n 'spectrum-InputGroup-input',\n {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\n }\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n descriptionProps.id = undefined;\n }\n\n let placeholder: DateValue | null | undefined = placeholderValue;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;\n let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n // Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash\n let approximateWidth = `calc(${useFormattedDateWidth(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-fieldWrapper')}>\n <div\n {...mergeProps(groupProps, hoverProps, focusProps)}\n className={className}\n ref={targetRef}>\n <Input\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n className={classNames(styles, 'spectrum-InputGroup-field')}\n inputClassName={fieldClassName}\n disableFocusRing\n minWidth={approximateWidth}>\n <DatePickerField\n {...startFieldProps}\n data-testid=\"start-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-startField')} />\n <DateRangeDash />\n <DatePickerField\n {...endFieldProps}\n data-testid=\"end-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(\n styles,\n 'spectrum-Datepicker-endField',\n classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-endField'\n )\n )} />\n </Input>\n <DialogTrigger\n type=\"popover\"\n mobileType=\"tray\"\n placement={direction === 'rtl' ? 'bottom right' : 'bottom left'}\n targetRef={targetRef}\n hideArrow\n isOpen={isOpen}\n onOpenChange={setOpen}\n shouldFlip={props.shouldFlip}>\n <FieldButton\n {...mergeProps(buttonProps, focusPropsButton)}\n UNSAFE_className={classNames(styles, 'spectrum-FieldButton')}\n isQuiet={isQuiet}\n validationState={validationState}>\n <CalendarIcon />\n </FieldButton>\n <Dialog UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')} {...dialogProps}>\n <Content>\n <div className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n pageBehavior={pageBehavior}\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-calendar', {'is-invalid': validationState === 'invalid'})} />\n {showTimeField &&\n <Flex gap=\"size-100\" marginTop=\"size-100\" UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-timeFields')}>\n <TimeField\n label={stringFormatter.format('startTime')}\n value={state.timeRange?.start || null}\n onChange={v => state.setTime('start', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n <TimeField\n label={stringFormatter.format('endTime')}\n value={state.timeRange?.end || null}\n onChange={v => state.setTime('end', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n </Flex>\n }\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}\n\nfunction DateRangeDash() {\n return (\n <div\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')} />\n );\n}\n\n/**\n * DateRangePickers combine two DateFields and a RangeCalendar popover to allow users\n * to enter or select a date and time range.\n */\nconst _DateRangePicker = React.forwardRef(DateRangePicker) as <T extends DateValue>(props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_DateRangePicker as DateRangePicker};\n"],"names":[],"version":3,"file":"DateRangePicker.main.js.map"}
@@ -71,7 +71,7 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
71
71
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $dUbU7$useHover)({
72
72
  isDisabled: isDisabled
73
73
  });
74
- let targetRef = (0, $dUbU7$useRef)(undefined);
74
+ let targetRef = (0, $dUbU7$useRef)(null);
75
75
  let state = (0, $dUbU7$useDateRangePickerState)({
76
76
  ...props,
77
77
  shouldCloseOnSelect: ()=>!state.hasTime
@@ -106,7 +106,7 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
106
106
  // Note: this description is intentionally not passed to useDatePicker.
107
107
  // The format help text is unnecessary for screen reader users because each segment already has a label.
108
108
  let description = (0, $04e96200274b03de$export$322f4580ccd8dde6)(props);
109
- if (description && !props.description) descriptionProps.id = null;
109
+ if (description && !props.description) descriptionProps.id = undefined;
110
110
  let placeholder = placeholderValue;
111
111
  let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
112
112
  let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;
@@ -71,7 +71,7 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
71
71
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $dUbU7$useHover)({
72
72
  isDisabled: isDisabled
73
73
  });
74
- let targetRef = (0, $dUbU7$useRef)(undefined);
74
+ let targetRef = (0, $dUbU7$useRef)(null);
75
75
  let state = (0, $dUbU7$useDateRangePickerState)({
76
76
  ...props,
77
77
  shouldCloseOnSelect: ()=>!state.hasTime
@@ -106,7 +106,7 @@ function $cb301300011a98f7$var$DateRangePicker(props, ref) {
106
106
  // Note: this description is intentionally not passed to useDatePicker.
107
107
  // The format help text is unnecessary for screen reader users because each segment already has a label.
108
108
  let description = (0, $04e96200274b03de$export$322f4580ccd8dde6)(props);
109
- if (description && !props.description) descriptionProps.id = null;
109
+ if (description && !props.description) descriptionProps.id = undefined;
110
110
  let placeholder = placeholderValue;
111
111
  let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;
112
112
  let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;AA8BD,SAAS,sCAAqC,KAAsC,EAAE,GAA8B;QAsJvF,kBAWA;IAhK3B,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,WACF,OAAO,cACP,UAAU,aACV,SAAS,oBACT,gBAAgB,oBAChB,mBAAmB,iBACnB,YAAY,EACb,GAAG;IACJ,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAkB;IACvC,IAAI,QAAQ,CAAA,GAAA,8BAAsB,EAAE;QAClC,GAAG,KAAK;QACR,qBAAqB,IAAM,CAAC,MAAM,OAAO;IAC3C;IACA,IAAI,cAAC,UAAU,cAAE,UAAU,eAAE,WAAW,eAAE,WAAW,mBAAE,eAAe,iBAAE,aAAa,oBAAE,gBAAgB,qBAAE,iBAAiB,iBAAE,aAAa,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,yBAAiB,EAAE,OAAO,OAAO;IAC9N,IAAI,UAAC,MAAM,WAAE,OAAO,EAAC,GAAG;IACxB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ;IAC1B,IAAI,SAAS,CAAA,GAAA,yCAAiB,EAAE;IAChC,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,oDAAW,GAAG;IAEhE,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CA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AAG;;AAE9C;AAEA;;;CAGC,GACD,MAAM,0DAAmB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/DateRangePicker.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDateRangePickerProps} from '@react-types/datepicker';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {Flex} from '@react-spectrum/layout';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {RangeCalendar} from '@react-spectrum/calendar';\nimport React, {ReactElement, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePicker} from '@react-aria/datepicker';\nimport {useDateRangePickerState} from '@react-stately/datepicker';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth, useVisibleMonths} from './utils';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isQuiet,\n isDisabled,\n autoFocus,\n placeholderValue,\n maxVisibleMonths = 1,\n pageBehavior\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement>(undefined);\n let state = useDateRangePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {labelProps, groupProps, buttonProps, dialogProps, startFieldProps, endFieldProps, descriptionProps, errorMessageProps, calendarProps, isInvalid, validationErrors, validationDetails} = useDateRangePicker(props, state, targetRef);\n let {isOpen, setOpen} = state;\n let {direction} = useLocale();\n let domRef = useFocusManagerRef(ref);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/datepicker');\n\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true,\n isTextInput: true,\n autoFocus\n });\n\n let {isFocused: isFocusedButton, focusProps: focusPropsButton} = useFocusRing({\n within: false,\n isTextInput: false,\n autoFocus\n });\n\n let className = classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'spectrum-InputGroup--invalid': isInvalid && !isDisabled,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'focus-ring': isFocusVisible && !isFocusedButton\n }\n );\n\n let fieldClassName = classNames(\n styles,\n 'spectrum-InputGroup-input',\n {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\n }\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n descriptionProps.id = null;\n }\n\n let placeholder: DateValue = placeholderValue;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;\n let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n // Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash\n let approximateWidth = `calc(${useFormattedDateWidth(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-fieldWrapper')}>\n <div\n {...mergeProps(groupProps, hoverProps, focusProps)}\n className={className}\n ref={targetRef}>\n <Input\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n className={classNames(styles, 'spectrum-InputGroup-field')}\n inputClassName={fieldClassName}\n disableFocusRing\n minWidth={approximateWidth}>\n <DatePickerField\n {...startFieldProps}\n data-testid=\"start-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-startField')} />\n <DateRangeDash />\n <DatePickerField\n {...endFieldProps}\n data-testid=\"end-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(\n styles,\n 'spectrum-Datepicker-endField',\n classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-endField'\n )\n )} />\n </Input>\n <DialogTrigger\n type=\"popover\"\n mobileType=\"tray\"\n placement={direction === 'rtl' ? 'bottom right' : 'bottom left'}\n targetRef={targetRef}\n hideArrow\n isOpen={isOpen}\n onOpenChange={setOpen}\n shouldFlip={props.shouldFlip}>\n <FieldButton\n {...mergeProps(buttonProps, focusPropsButton)}\n UNSAFE_className={classNames(styles, 'spectrum-FieldButton')}\n isQuiet={isQuiet}\n validationState={validationState}>\n <CalendarIcon />\n </FieldButton>\n <Dialog UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')} {...dialogProps}>\n <Content>\n <div className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n pageBehavior={pageBehavior}\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-calendar', {'is-invalid': validationState === 'invalid'})} />\n {showTimeField &&\n <Flex gap=\"size-100\" marginTop=\"size-100\" UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-timeFields')}>\n <TimeField\n label={stringFormatter.format('startTime')}\n value={state.timeRange?.start || null}\n onChange={v => state.setTime('start', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n <TimeField\n label={stringFormatter.format('endTime')}\n value={state.timeRange?.end || null}\n onChange={v => state.setTime('end', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n </Flex>\n }\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}\n\nfunction DateRangeDash() {\n return (\n <div\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')} />\n );\n}\n\n/**\n * DateRangePickers combine two DateFields and a RangeCalendar popover to allow users\n * to enter or select a date and time range.\n */\nconst _DateRangePicker = React.forwardRef(DateRangePicker) as <T extends DateValue>(props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_DateRangePicker as DateRangePicker};\n"],"names":[],"version":3,"file":"DateRangePicker.module.js.map"}
1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2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '@react-spectrum/utils';\nimport {Content} from '@react-spectrum/view';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {DateValue, SpectrumDateRangePickerProps} from '@react-types/datepicker';\nimport {Dialog, DialogTrigger} from '@react-spectrum/dialog';\nimport {Field} from '@react-spectrum/label';\nimport {FieldButton} from '@react-spectrum/button';\nimport {Flex} from '@react-spectrum/layout';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\n// @ts-ignore\nimport intlMessages from '../intl/*.json';\nimport {mergeProps} from '@react-aria/utils';\nimport {RangeCalendar} from '@react-spectrum/calendar';\nimport React, {ReactElement, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePicker} from '@react-aria/datepicker';\nimport {useDateRangePickerState} from '@react-stately/datepicker';\nimport {useFocusManagerRef, useFormatHelpText, useFormattedDateWidth, useVisibleMonths} from './utils';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useHover} from '@react-aria/interactions';\nimport {useLocale, useLocalizedStringFormatter} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nfunction DateRangePicker<T extends DateValue>(props: SpectrumDateRangePickerProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n isQuiet,\n isDisabled,\n autoFocus,\n placeholderValue,\n maxVisibleMonths = 1,\n pageBehavior\n } = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDateRangePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {labelProps, groupProps, buttonProps, dialogProps, startFieldProps, endFieldProps, descriptionProps, errorMessageProps, calendarProps, isInvalid, validationErrors, validationDetails} = useDateRangePicker(props, state, targetRef);\n let {isOpen, setOpen} = state;\n let {direction} = useLocale();\n let domRef = useFocusManagerRef(ref);\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/datepicker');\n\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({\n within: true,\n isTextInput: true,\n autoFocus\n });\n\n let {isFocused: isFocusedButton, focusProps: focusPropsButton} = useFocusRing({\n within: false,\n isTextInput: false,\n autoFocus\n });\n\n let className = classNames(\n styles,\n 'spectrum-InputGroup',\n {\n 'spectrum-InputGroup--quiet': isQuiet,\n 'spectrum-InputGroup--invalid': isInvalid && !isDisabled,\n 'is-disabled': isDisabled,\n 'is-hovered': isHovered,\n 'is-focused': isFocused,\n 'focus-ring': isFocusVisible && !isFocusedButton\n }\n );\n\n let fieldClassName = classNames(\n styles,\n 'spectrum-InputGroup-input',\n {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\n }\n );\n\n // Note: this description is intentionally not passed to useDatePicker.\n // The format help text is unnecessary for screen reader users because each segment already has a label.\n let description = useFormatHelpText(props);\n if (description && !props.description) {\n descriptionProps.id = undefined;\n }\n\n let placeholder: DateValue | null | undefined = placeholderValue;\n let timePlaceholder = placeholder && 'hour' in placeholder ? placeholder : null;\n let timeMinValue = props.minValue && 'hour' in props.minValue ? props.minValue : null;\n let timeMaxValue = props.maxValue && 'hour' in props.maxValue ? props.maxValue : null;\n let timeGranularity = state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second' ? state.granularity : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n // Multiplying by two for the two dates, adding one character for the dash, and then the padding around the dash\n let approximateWidth = `calc(${useFormattedDateWidth(state) * 2 + 1}ch + 2 * var(--spectrum-global-dimension-size-100))`;\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n description={description}\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-fieldWrapper')}>\n <div\n {...mergeProps(groupProps, hoverProps, focusProps)}\n className={className}\n ref={targetRef}>\n <Input\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n validationState={validationState}\n className={classNames(styles, 'spectrum-InputGroup-field')}\n inputClassName={fieldClassName}\n disableFocusRing\n minWidth={approximateWidth}>\n <DatePickerField\n {...startFieldProps}\n data-testid=\"start-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(datepickerStyles, 'react-spectrum-Datepicker-startField')} />\n <DateRangeDash />\n <DatePickerField\n {...endFieldProps}\n data-testid=\"end-date\"\n isQuiet={props.isQuiet}\n inputClassName={classNames(\n styles,\n 'spectrum-Datepicker-endField',\n classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-endField'\n )\n )} />\n </Input>\n <DialogTrigger\n type=\"popover\"\n mobileType=\"tray\"\n placement={direction === 'rtl' ? 'bottom right' : 'bottom left'}\n targetRef={targetRef}\n hideArrow\n isOpen={isOpen}\n onOpenChange={setOpen}\n shouldFlip={props.shouldFlip}>\n <FieldButton\n {...mergeProps(buttonProps, focusPropsButton)}\n UNSAFE_className={classNames(styles, 'spectrum-FieldButton')}\n isQuiet={isQuiet}\n validationState={validationState}>\n <CalendarIcon />\n </FieldButton>\n <Dialog UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')} {...dialogProps}>\n <Content>\n <div className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n pageBehavior={pageBehavior}\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-calendar', {'is-invalid': validationState === 'invalid'})} />\n {showTimeField &&\n <Flex gap=\"size-100\" marginTop=\"size-100\" UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-timeFields')}>\n <TimeField\n label={stringFormatter.format('startTime')}\n value={state.timeRange?.start || null}\n onChange={v => state.setTime('start', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n <TimeField\n label={stringFormatter.format('endTime')}\n value={state.timeRange?.end || null}\n onChange={v => state.setTime('end', v)}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n flex />\n </Flex>\n }\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}\n\nfunction DateRangeDash() {\n return (\n <div\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')} />\n );\n}\n\n/**\n * DateRangePickers combine two DateFields and a RangeCalendar popover to allow users\n * to enter or select a date and time range.\n */\nconst _DateRangePicker = React.forwardRef(DateRangePicker) as <T extends DateValue>(props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_DateRangePicker as DateRangePicker};\n"],"names":[],"version":3,"file":"DateRangePicker.module.js.map"}
@@ -45,7 +45,7 @@ function $c3ebc4931d9b9977$var$Input(props, ref) {
45
45
  // not cause a layout shift.
46
46
  let [reservePadding, setReservePadding] = (0, $9cini$reactspectrumutils.useValueEffect)(false);
47
47
  let onResize = (0, $9cini$react.useCallback)(()=>setReservePadding(function*(reservePadding) {
48
- if (inputRef.current) {
48
+ if (inputRef.current && inputRef.current.parentElement) {
49
49
  if (reservePadding) // Try to collapse padding if the content is clipped.
50
50
  {
51
51
  if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWD,SAAS,4BAAM,KAAK,EAAE,GAAG;IACvB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,cACF,UAAU,WACV,OAAO,kBACP,cAAc,mBACd,eAAe,YACf,QAAQ,cACR,UAAU,aACV,SAAS,SACT,KAAK,oBACL,gBAAgB,EACjB,GAAG;IAEJ,mFAAmF;IACnF,iFAAiF;IACjF,4BAA4B;IAC5B,IAAI,CAAC,gBAAgB,kBAAkB,GAAG,CAAA,GAAA,wCAAa,EAAE;IACzD,IAAI,WAAW,CAAA,GAAA,wBAAU,EAAE,IAAM,kBAAkB,UAAW,cAAc;YAC1E,IAAI,SAAS,OAAO,EAAE;gBACpB,IAAI,gBACF,qDAAqD;gBACrD;oBAAA,IAAI,SAAS,OAAO,CAAC,WAAW,GAAG,SAAS,OAAO,CAAC,WAAW,EAAE;wBAC/D,IAAI,QAAQ,SAAS,OAAO,CAAC,aAAa,CAAC,WAAW;wBACtD,MAAM;wBAEN,0DAA0D;wBAC1D,IAAI,SAAS,OAAO,CAAC,aAAa,CAAC,WAAW,KAAK,OACjD,MAAM;oBAEV;gBAAA,OAEA,oDAAoD;gBACpD,IAAI,SAAS,OAAO,CAAC,WAAW,IAAI,SAAS,OAAO,CAAC,WAAW,EAAE;oBAChE,IAAI,QAAQ,SAAS,OAAO,CAAC,aAAa,CAAC,WAAW;oBACtD,MAAM;oBAEN,4FAA4F;oBAC5F,IAAI,SAAS,OAAO,CAAC,aAAa,CAAC,WAAW,KAAK,OACjD,MAAM;gBAEV;YAEJ;QAEF,I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K;QAAgB,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,WAAW;QAAE,WAAW;QAAgB,OAAO;qBACjG,0DAAC;QAAI,MAAK;QAAe,WAAW;qBAClC,0DAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QACxC,KAAK,CAAA,GAAA,+BAAQ,EAAE,KAAK;qBACpB,0DAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QACxC,OAAO;YAAC,UAAU,MAAM,QAAQ;QAAA;OAC/B,aAIN;AAGP;AAEA,MAAM,0DAAS,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/Input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Alert from '@spectrum-icons/ui/AlertMedium';\nimport Checkmark from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, useValueEffect} from '@react-spectrum/utils';\nimport datepickerStyles from './styles.css';\nimport {mergeProps, mergeRefs, useEvent, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport React, {useCallback, useRef} from 'react';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\n\nfunction Input(props, ref) {\n let inputRef = useRef(null);\n let {\n isDisabled,\n isQuiet,\n inputClassName,\n validationState,\n children,\n fieldProps,\n className,\n style,\n disableFocusRing\n } = props;\n\n // Reserve padding for the error icon when the width of the input is unconstrained.\n // When constrained, don't reserve space because adding it only when invalid will\n // not cause a layout shift.\n let [reservePadding, setReservePadding] = useValueEffect(false);\n let onResize = useCallback(() => setReservePadding(function *(reservePadding) {\n if (inputRef.current) {\n if (reservePadding) {\n // Try to collapse padding if the content is clipped.\n if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield false;\n\n // If removing padding causes a layout shift, add it back.\n if (inputRef.current.parentElement.offsetWidth !== width) {\n yield true;\n }\n }\n } else {\n // Try to add padding if the content is not clipped.\n if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield true;\n\n // If adding padding does not change the width (i.e. width is constrained), remove it again.\n if (inputRef.current.parentElement.offsetWidth === width) {\n yield false;\n }\n }\n }\n }\n\n }), [inputRef, setReservePadding]);\n\n useLayoutEffect(onResize, [onResize]);\n useResizeObserver({\n ref: inputRef,\n onResize\n });\n\n // We also need to listen for resize events of the window so we can detect\n // when there is enough space for the padding to be re-added. Ideally we'd\n // use a resize observer on a parent element, but it's hard to know _what_\n // parent element.\n useEvent(useRef(typeof window !== 'undefined' ? window : null), 'resize', onResize);\n\n let {focusProps, isFocusVisible, isFocused} = useFocusRing({\n isTextInput: true,\n within: true\n });\n\n let isInvalid = validationState === 'invalid' && !isDisabled;\n let textfieldClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--quiet': isQuiet,\n 'focus-ring': isFocusVisible && !disableFocusRing\n },\n classNames(datepickerStyles, 'react-spectrum-Datepicker-field'),\n className\n );\n\n let inputClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-input',\n {\n 'is-disabled': isDisabled,\n 'is-focused': isFocused\n },\n classNames(datepickerStyles, 'react-spectrum-DateField-Input'),\n reservePadding && classNames(datepickerStyles, 'react-spectrum-Datepicker-input'),\n inputClassName\n );\n\n let iconClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon'\n );\n\n let validationIcon = null;\n if (validationState === 'invalid' && !isDisabled) {\n validationIcon = <Alert data-testid=\"invalid-icon\" UNSAFE_className={iconClass} />;\n } else if (validationState === 'valid' && !isDisabled) {\n validationIcon = <Checkmark data-testid=\"valid-icon\" UNSAFE_className={iconClass} />;\n }\n\n return (\n <div role=\"presentation\" {...mergeProps(fieldProps, focusProps)} className={textfieldClass} style={style}>\n <div role=\"presentation\" className={inputClass}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputContents')}\n ref={mergeRefs(ref, inputRef)}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputSized')}\n style={{minWidth: props.minWidth}}>\n {children}\n </div>\n </div>\n </div>\n {validationIcon}\n </div>\n );\n}\n\nconst _Input = React.forwardRef(Input);\nexport {_Input as Input};\n"],"names":[],"version":3,"file":"Input.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWD,SAAS,4BAAM,KAAK,EAAE,GAAG;IACvB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,cACF,UAAU,WACV,OAAO,kBACP,cAAc,mBACd,eAAe,YACf,QAAQ,cACR,UAAU,aACV,SAAS,SACT,KAAK,oBACL,gBAAgB,EACjB,GAAG;IAEJ,mFAAmF;IACnF,iFAAiF;IACjF,4BAA4B;IAC5B,IAAI,CAAC,gBAAgB,kBAAkB,GAAG,CAAA,GAAA,wCAAa,EAAE;IACzD,IAAI,WAAW,CAAA,GAAA,wBAAU,EAAE,IAAM,kBAAkB,UAAW,cAAc;YAC1E,IAAI,SAAS,OAAO,IAAI,SAAS,OAAO,CAAC,aAAa,EAAE;gBACtD,IAAI,gBACF,qDAAqD;gBACrD;oBAAA,IAAI,SAAS,OAAO,CAAC,WAAW,G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ACf,cAAc;IAChB,GACA,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,mCAC7B,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,oCAC/C;IAGF,IAAI,YAAY,CAAA,GAAA,oCAAS,EACvB,CAAA,GAAA,mDAAc,GACd;IAGF,IAAI,iBAAsC;IAC1C,IAAI,oBAAoB,aAAa,CAAC,YACpC,+BAAiB,0DAAC,CAAA,GAAA,2DAAI;QAAE,eAAY;QAAe,kBAAkB;;SAChE,IAAI,oBAAoB,WAAW,CAAC,YACzC,+BAAiB,0DAAC,CAAA,GAAA,+DAAQ;QAAE,eAAY;QAAa,kBAAkB;;IAGzE,qBACE,0DAAC;QAAI,MAAK;QAAgB,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,WAAW;QAAE,WAAW;QAAgB,OAAO;qBACjG,0DAAC;QAAI,MAAK;QAAe,WAAW;qBAClC,0DAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QACxC,KAAK,CAAA,GAAA,+BAAQ,EAAE,KAAK;qBACpB,0DAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QACxC,OAAO;YAAC,UAAU,MAAM,QAAQ;QAAA;OAC/B,aAIN;AAGP;AAEA,MAAM,0DAAS,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/Input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Alert from '@spectrum-icons/ui/AlertMedium';\nimport Checkmark from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, useValueEffect} from '@react-spectrum/utils';\nimport datepickerStyles from './styles.css';\nimport {mergeProps, mergeRefs, useEvent, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport React, {ReactElement, useCallback, useRef} from 'react';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\n\nfunction Input(props, ref) {\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {\n isDisabled,\n isQuiet,\n inputClassName,\n validationState,\n children,\n fieldProps,\n className,\n style,\n disableFocusRing\n } = props;\n\n // Reserve padding for the error icon when the width of the input is unconstrained.\n // When constrained, don't reserve space because adding it only when invalid will\n // not cause a layout shift.\n let [reservePadding, setReservePadding] = useValueEffect(false);\n let onResize = useCallback(() => setReservePadding(function *(reservePadding) {\n if (inputRef.current && inputRef.current.parentElement) {\n if (reservePadding) {\n // Try to collapse padding if the content is clipped.\n if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield false;\n\n // If removing padding causes a layout shift, add it back.\n if (inputRef.current.parentElement.offsetWidth !== width) {\n yield true;\n }\n }\n } else {\n // Try to add padding if the content is not clipped.\n if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield true;\n\n // If adding padding does not change the width (i.e. width is constrained), remove it again.\n if (inputRef.current.parentElement.offsetWidth === width) {\n yield false;\n }\n }\n }\n }\n\n }), [inputRef, setReservePadding]);\n\n useLayoutEffect(onResize, [onResize]);\n useResizeObserver({\n ref: inputRef,\n onResize\n });\n\n // We also need to listen for resize events of the window so we can detect\n // when there is enough space for the padding to be re-added. Ideally we'd\n // use a resize observer on a parent element, but it's hard to know _what_\n // parent element.\n useEvent(useRef(typeof window !== 'undefined' ? window : null), 'resize', onResize);\n\n let {focusProps, isFocusVisible, isFocused} = useFocusRing({\n isTextInput: true,\n within: true\n });\n\n let isInvalid = validationState === 'invalid' && !isDisabled;\n let textfieldClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--quiet': isQuiet,\n 'focus-ring': isFocusVisible && !disableFocusRing\n },\n classNames(datepickerStyles, 'react-spectrum-Datepicker-field'),\n className\n );\n\n let inputClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-input',\n {\n 'is-disabled': isDisabled,\n 'is-focused': isFocused\n },\n classNames(datepickerStyles, 'react-spectrum-DateField-Input'),\n reservePadding && classNames(datepickerStyles, 'react-spectrum-Datepicker-input'),\n inputClassName\n );\n\n let iconClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon'\n );\n\n let validationIcon: ReactElement | null = null;\n if (validationState === 'invalid' && !isDisabled) {\n validationIcon = <Alert data-testid=\"invalid-icon\" UNSAFE_className={iconClass} />;\n } else if (validationState === 'valid' && !isDisabled) {\n validationIcon = <Checkmark data-testid=\"valid-icon\" UNSAFE_className={iconClass} />;\n }\n\n return (\n <div role=\"presentation\" {...mergeProps(fieldProps, focusProps)} className={textfieldClass} style={style}>\n <div role=\"presentation\" className={inputClass}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputContents')}\n ref={mergeRefs(ref, inputRef)}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputSized')}\n style={{minWidth: props.minWidth}}>\n {children}\n </div>\n </div>\n </div>\n {validationIcon}\n </div>\n );\n}\n\nconst _Input = React.forwardRef(Input);\nexport {_Input as Input};\n"],"names":[],"version":3,"file":"Input.main.js.map"}
package/dist/Input.mjs CHANGED
@@ -39,7 +39,7 @@ function $79348162c55d687f$var$Input(props, ref) {
39
39
  // not cause a layout shift.
40
40
  let [reservePadding, setReservePadding] = (0, $fVzF9$useValueEffect)(false);
41
41
  let onResize = (0, $fVzF9$useCallback)(()=>setReservePadding(function*(reservePadding) {
42
- if (inputRef.current) {
42
+ if (inputRef.current && inputRef.current.parentElement) {
43
43
  if (reservePadding) // Try to collapse padding if the content is clipped.
44
44
  {
45
45
  if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {
@@ -39,7 +39,7 @@ function $79348162c55d687f$var$Input(props, ref) {
39
39
  // not cause a layout shift.
40
40
  let [reservePadding, setReservePadding] = (0, $fVzF9$useValueEffect)(false);
41
41
  let onResize = (0, $fVzF9$useCallback)(()=>setReservePadding(function*(reservePadding) {
42
- if (inputRef.current) {
42
+ if (inputRef.current && inputRef.current.parentElement) {
43
43
  if (reservePadding) // Try to collapse padding if the content is clipped.
44
44
  {
45
45
  if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWD,SAAS,4BAAM,KAAK,EAAE,GAAG;IACvB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,cACF,UAAU,WACV,OAAO,kBACP,cAAc,mBACd,eAAe,YACf,QAAQ,cACR,UAAU,aACV,SAAS,SACT,KAAK,oBACL,gBAAgB,EACjB,GAAG;IAEJ,mFAAmF;IACnF,iFAAiF;IACjF,4BAA4B;IAC5B,IAAI,CAAC,gBAAgB,kBAAkB,GAAG,CAAA,GAAA,qBAAa,EAAE;IACzD,IAAI,WAAW,CAAA,GAAA,kBAAU,EAAE,IAAM,kBAAkB,UAAW,cAAc;YAC1E,IAAI,SAAS,OAAO,EAAE;gBACpB,IAAI,gBACF,qDAAqD;gBACrD;oBAAA,IAAI,SAAS,OAAO,CAAC,WAAW,GAAG,SAAS,OAAO,CAAC,WAAW,EAAE;wBAC/D,IAAI,QAAQ,SAAS,OAAO,CAAC,aAAa,CAAC,WAAW;wBACtD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BAAS,EAAE,CAAA,GAAA,mDAAe,GAAG,oCAC/C;IAGF,IAAI,YAAY,CAAA,GAAA,iBAAS,EACvB,CAAA,GAAA,2DAAc,GACd;IAGF,IAAI,iBAAiB;IACrB,IAAI,oBAAoB,aAAa,CAAC,YACpC,+BAAiB,gCAAC,CAAA,GAAA,iCAAI;QAAE,eAAY;QAAe,kBAAkB;;SAChE,IAAI,oBAAoB,WAAW,CAAC,YACzC,+BAAiB,gCAAC,CAAA,GAAA,qCAAQ;QAAE,eAAY;QAAa,kBAAkB;;IAGzE,qBACE,gCAAC;QAAI,MAAK;QAAgB,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,WAAW;QAAE,WAAW;QAAgB,OAAO;qBACjG,gCAAC;QAAI,MAAK;QAAe,WAAW;qBAClC,gCAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QACxC,KAAK,CAAA,GAAA,gBAAQ,EAAE,KAAK;qBACpB,gCAAC;QACC,MAAK;QACL,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QACxC,OAAO;YAAC,UAAU,MAAM,QAAQ;QAAA;OAC/B,aAIN;AAGP;AAEA,MAAM,0DAAS,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/Input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Alert from '@spectrum-icons/ui/AlertMedium';\nimport Checkmark from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, useValueEffect} from '@react-spectrum/utils';\nimport datepickerStyles from './styles.css';\nimport {mergeProps, mergeRefs, useEvent, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport React, {useCallback, useRef} from 'react';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\n\nfunction Input(props, ref) {\n let inputRef = useRef(null);\n let {\n isDisabled,\n isQuiet,\n inputClassName,\n validationState,\n children,\n fieldProps,\n className,\n style,\n disableFocusRing\n } = props;\n\n // Reserve padding for the error icon when the width of the input is unconstrained.\n // When constrained, don't reserve space because adding it only when invalid will\n // not cause a layout shift.\n let [reservePadding, setReservePadding] = useValueEffect(false);\n let onResize = useCallback(() => setReservePadding(function *(reservePadding) {\n if (inputRef.current) {\n if (reservePadding) {\n // Try to collapse padding if the content is clipped.\n if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield false;\n\n // If removing padding causes a layout shift, add it back.\n if (inputRef.current.parentElement.offsetWidth !== width) {\n yield true;\n }\n }\n } else {\n // Try to add padding if the content is not clipped.\n if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield true;\n\n // If adding padding does not change the width (i.e. width is constrained), remove it again.\n if (inputRef.current.parentElement.offsetWidth === width) {\n yield false;\n }\n }\n }\n }\n\n }), [inputRef, setReservePadding]);\n\n useLayoutEffect(onResize, [onResize]);\n useResizeObserver({\n ref: inputRef,\n onResize\n });\n\n // We also need to listen for resize events of the window so we can detect\n // when there is enough space for the padding to be re-added. Ideally we'd\n // use a resize observer on a parent element, but it's hard to know _what_\n // parent element.\n useEvent(useRef(typeof window !== 'undefined' ? window : null), 'resize', onResize);\n\n let {focusProps, isFocusVisible, isFocused} = useFocusRing({\n isTextInput: true,\n within: true\n });\n\n let isInvalid = validationState === 'invalid' && !isDisabled;\n let textfieldClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--quiet': isQuiet,\n 'focus-ring': isFocusVisible && !disableFocusRing\n },\n classNames(datepickerStyles, 'react-spectrum-Datepicker-field'),\n className\n );\n\n let inputClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-input',\n {\n 'is-disabled': isDisabled,\n 'is-focused': isFocused\n },\n classNames(datepickerStyles, 'react-spectrum-DateField-Input'),\n reservePadding && classNames(datepickerStyles, 'react-spectrum-Datepicker-input'),\n inputClassName\n );\n\n let iconClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon'\n );\n\n let validationIcon = null;\n if (validationState === 'invalid' && !isDisabled) {\n validationIcon = <Alert data-testid=\"invalid-icon\" UNSAFE_className={iconClass} />;\n } else if (validationState === 'valid' && !isDisabled) {\n validationIcon = <Checkmark data-testid=\"valid-icon\" UNSAFE_className={iconClass} />;\n }\n\n return (\n <div role=\"presentation\" {...mergeProps(fieldProps, focusProps)} className={textfieldClass} style={style}>\n <div role=\"presentation\" className={inputClass}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputContents')}\n ref={mergeRefs(ref, inputRef)}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputSized')}\n style={{minWidth: props.minWidth}}>\n {children}\n </div>\n </div>\n </div>\n {validationIcon}\n </div>\n );\n}\n\nconst _Input = React.forwardRef(Input);\nexport {_Input as Input};\n"],"names":[],"version":3,"file":"Input.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAWD,SAAS,4BAAM,KAAK,EAAE,GAAG;IACvB,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,cACF,UAAU,WACV,OAAO,kBACP,cAAc,mBACd,eAAe,YACf,QAAQ,cACR,UAAU,aACV,SA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,0DAAS,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/Input.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport Alert from '@spectrum-icons/ui/AlertMedium';\nimport Checkmark from '@spectrum-icons/ui/CheckmarkMedium';\nimport {classNames, useValueEffect} from '@react-spectrum/utils';\nimport datepickerStyles from './styles.css';\nimport {mergeProps, mergeRefs, useEvent, useLayoutEffect, useResizeObserver} from '@react-aria/utils';\nimport React, {ReactElement, useCallback, useRef} from 'react';\nimport textfieldStyles from '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {useFocusRing} from '@react-aria/focus';\n\nfunction Input(props, ref) {\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {\n isDisabled,\n isQuiet,\n inputClassName,\n validationState,\n children,\n fieldProps,\n className,\n style,\n disableFocusRing\n } = props;\n\n // Reserve padding for the error icon when the width of the input is unconstrained.\n // When constrained, don't reserve space because adding it only when invalid will\n // not cause a layout shift.\n let [reservePadding, setReservePadding] = useValueEffect(false);\n let onResize = useCallback(() => setReservePadding(function *(reservePadding) {\n if (inputRef.current && inputRef.current.parentElement) {\n if (reservePadding) {\n // Try to collapse padding if the content is clipped.\n if (inputRef.current.scrollWidth > inputRef.current.offsetWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield false;\n\n // If removing padding causes a layout shift, add it back.\n if (inputRef.current.parentElement.offsetWidth !== width) {\n yield true;\n }\n }\n } else {\n // Try to add padding if the content is not clipped.\n if (inputRef.current.offsetWidth >= inputRef.current.scrollWidth) {\n let width = inputRef.current.parentElement.offsetWidth;\n yield true;\n\n // If adding padding does not change the width (i.e. width is constrained), remove it again.\n if (inputRef.current.parentElement.offsetWidth === width) {\n yield false;\n }\n }\n }\n }\n\n }), [inputRef, setReservePadding]);\n\n useLayoutEffect(onResize, [onResize]);\n useResizeObserver({\n ref: inputRef,\n onResize\n });\n\n // We also need to listen for resize events of the window so we can detect\n // when there is enough space for the padding to be re-added. Ideally we'd\n // use a resize observer on a parent element, but it's hard to know _what_\n // parent element.\n useEvent(useRef(typeof window !== 'undefined' ? window : null), 'resize', onResize);\n\n let {focusProps, isFocusVisible, isFocused} = useFocusRing({\n isTextInput: true,\n within: true\n });\n\n let isInvalid = validationState === 'invalid' && !isDisabled;\n let textfieldClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield',\n {\n 'spectrum-Textfield--invalid': isInvalid,\n 'spectrum-Textfield--valid': validationState === 'valid' && !isDisabled,\n 'spectrum-Textfield--quiet': isQuiet,\n 'focus-ring': isFocusVisible && !disableFocusRing\n },\n classNames(datepickerStyles, 'react-spectrum-Datepicker-field'),\n className\n );\n\n let inputClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-input',\n {\n 'is-disabled': isDisabled,\n 'is-focused': isFocused\n },\n classNames(datepickerStyles, 'react-spectrum-DateField-Input'),\n reservePadding && classNames(datepickerStyles, 'react-spectrum-Datepicker-input'),\n inputClassName\n );\n\n let iconClass = classNames(\n textfieldStyles,\n 'spectrum-Textfield-validationIcon'\n );\n\n let validationIcon: ReactElement | null = null;\n if (validationState === 'invalid' && !isDisabled) {\n validationIcon = <Alert data-testid=\"invalid-icon\" UNSAFE_className={iconClass} />;\n } else if (validationState === 'valid' && !isDisabled) {\n validationIcon = <Checkmark data-testid=\"valid-icon\" UNSAFE_className={iconClass} />;\n }\n\n return (\n <div role=\"presentation\" {...mergeProps(fieldProps, focusProps)} className={textfieldClass} style={style}>\n <div role=\"presentation\" className={inputClass}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputContents')}\n ref={mergeRefs(ref, inputRef)}>\n <div\n role=\"presentation\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-inputSized')}\n style={{minWidth: props.minWidth}}>\n {children}\n </div>\n </div>\n </div>\n {validationIcon}\n </div>\n );\n}\n\nconst _Input = React.forwardRef(Input);\nexport {_Input as Input};\n"],"names":[],"version":3,"file":"Input.module.js.map"}
@@ -69,7 +69,7 @@ function $740ff83729a8f317$var$TimeField(props, ref) {
69
69
  labelProps: labelProps,
70
70
  descriptionProps: descriptionProps,
71
71
  errorMessageProps: errorMessageProps,
72
- validationState: validationState,
72
+ validationState: validationState !== null && validationState !== void 0 ? validationState : undefined,
73
73
  isInvalid: isInvalid,
74
74
  validationErrors: validationErrors,
75
75
  validationDetails: validationDetails,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiBD,SAAS,gCAA+B,KAAgC,EAAE,GAA8B;IACtG,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,aACF,SAAS,cACT,UAAU,cACV,UAAU,cACV,UAAU,WACV,OAAO,EACR,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,4CAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,+CAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,uCAAW,EAAE;QAC3I,GAAG,KAAK;kBACR;IACF,GAAG,OAAO;IAEV,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,IAAI,mBAAmB,CAAA,GAAA,+CAAoB,EAAE,SAAS;IAEtD,qBACE,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB;QACjB,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,0DAAC,CAAA,GAAA,+BAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,UAAU;QACV,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,0DAAC,CAAA,GAAA,2CAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,0DAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC;AAEA;;;CAGC,GACD,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/TimeField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumTimeFieldProps, TimeValue} from '@react-types/datepicker';\nimport {useFocusManagerRef, useFormattedDateWidth} from './utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTimeField} from '@react-aria/datepicker';\nimport {useTimeFieldState} from '@react-stately/datepicker';\n\nfunction TimeField<T extends TimeValue>(props: SpectrumTimeFieldProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n isQuiet\n } = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale\n });\n\n let fieldRef = useRef(null);\n let inputRef = useRef(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useTimeField({\n ...props,\n inputRef\n }, state, fieldRef);\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n let approximateWidth = useFormattedDateWidth(state) + 'ch';\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-TimeField-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n minWidth={approximateWidth}\n className={classNames(datepickerStyles, 'react-spectrum-TimeField')}>\n {state.segments.map((segment, i) =>\n (<DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />)\n )}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nconst _TimeField = React.forwardRef(TimeField) as <T extends TimeValue>(props: SpectrumTimeFieldProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_TimeField as TimeField};\n"],"names":[],"version":3,"file":"TimeField.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiBD,SAAS,gCAA+B,KAAgC,EAAE,GAA8B;IACtG,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,qCAAW,EAAE;IACrB,IAAI,aACF,SAAS,cACT,UAAU,cACV,UAAU,cACV,UAAU,WACV,OAAO,EACR,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,4CAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,8BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,+CAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAyB;IAC7C,IAAI,WAAW,CAAA,GAAA,mBAAK,EAA2B;IAC/C,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,uCAAW,EAAE;QAC3I,GAAG,KAAK;kBACR;IACF,GAAG,OAAO;IAEV,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,IAAI,mBAAmB,CAAA,GAAA,+CAAoB,EAAE,SAAS;IAEtD,qBACE,0DAAC,CAAA,GAAA,+BAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB,4BAAA,6BAAA,kBAAmB;QACpC,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,0DAAC,CAAA,GAAA,+BAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,UAAU;QACV,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,0DAAC,CAAA,GAAA,2CAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,0DAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC;AAEA;;;CAGC,GACD,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/TimeField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumTimeFieldProps, TimeValue} from '@react-types/datepicker';\nimport {useFocusManagerRef, useFormattedDateWidth} from './utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTimeField} from '@react-aria/datepicker';\nimport {useTimeFieldState} from '@react-stately/datepicker';\n\nfunction TimeField<T extends TimeValue>(props: SpectrumTimeFieldProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n isQuiet\n } = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale\n });\n\n let fieldRef = useRef<HTMLDivElement | null>(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useTimeField({\n ...props,\n inputRef\n }, state, fieldRef);\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n let approximateWidth = useFormattedDateWidth(state) + 'ch';\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState ?? undefined}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-TimeField-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n minWidth={approximateWidth}\n className={classNames(datepickerStyles, 'react-spectrum-TimeField')}>\n {state.segments.map((segment, i) =>\n (<DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />)\n )}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nconst _TimeField = React.forwardRef(TimeField) as <T extends TimeValue>(props: SpectrumTimeFieldProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_TimeField as TimeField};\n"],"names":[],"version":3,"file":"TimeField.main.js.map"}
@@ -63,7 +63,7 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
63
63
  labelProps: labelProps,
64
64
  descriptionProps: descriptionProps,
65
65
  errorMessageProps: errorMessageProps,
66
- validationState: validationState,
66
+ validationState: validationState !== null && validationState !== void 0 ? validationState : undefined,
67
67
  isInvalid: isInvalid,
68
68
  validationErrors: validationErrors,
69
69
  validationDetails: validationDetails,
@@ -63,7 +63,7 @@ function $f0a04554754386b6$var$TimeField(props, ref) {
63
63
  labelProps: labelProps,
64
64
  descriptionProps: descriptionProps,
65
65
  errorMessageProps: errorMessageProps,
66
- validationState: validationState,
66
+ validationState: validationState !== null && validationState !== void 0 ? validationState : undefined,
67
67
  isInvalid: isInvalid,
68
68
  validationErrors: validationErrors,
69
69
  validationDetails: validationDetails,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiBD,SAAS,gCAA+B,KAAgC,EAAE,GAA8B;IACtG,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,aACF,SAAS,cACT,UAAU,cACV,UAAU,cACV,UAAU,WACV,OAAO,EACR,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,yCAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,WAAW,CAAA,GAAA,aAAK,EAAE;IACtB,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAC3I,GAAG,KAAK;kBACR;IACF,GAAG,OAAO;IAEV,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,IAAI,mBAAmB,CAAA,GAAA,yCAAoB,EAAE,SAAS;IAEtD,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB;QACjB,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,gCAAC,CAAA,GAAA,yCAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,UAAU;QACV,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,gCAAC,CAAA,GAAA,yCAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,gCAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC;AAEA;;;CAGC,GACD,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/TimeField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumTimeFieldProps, TimeValue} from '@react-types/datepicker';\nimport {useFocusManagerRef, useFormattedDateWidth} from './utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTimeField} from '@react-aria/datepicker';\nimport {useTimeFieldState} from '@react-stately/datepicker';\n\nfunction TimeField<T extends TimeValue>(props: SpectrumTimeFieldProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n isQuiet\n } = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale\n });\n\n let fieldRef = useRef(null);\n let inputRef = useRef(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useTimeField({\n ...props,\n inputRef\n }, state, fieldRef);\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n let approximateWidth = useFormattedDateWidth(state) + 'ch';\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-TimeField-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n minWidth={approximateWidth}\n className={classNames(datepickerStyles, 'react-spectrum-TimeField')}>\n {state.segments.map((segment, i) =>\n (<DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />)\n )}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nconst _TimeField = React.forwardRef(TimeField) as <T extends TimeValue>(props: SpectrumTimeFieldProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_TimeField as TimeField};\n"],"names":[],"version":3,"file":"TimeField.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAiBD,SAAS,gCAA+B,KAAgC,EAAE,GAA8B;IACtG,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE;IACrB,IAAI,aACF,SAAS,cACT,UAAU,cACV,UAAU,cACV,UAAU,WACV,OAAO,EACR,GAAG;IAEJ,IAAI,SAAS,CAAA,GAAA,yCAAiB,EAAE;IAChC,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,wBAAgB,EAAE;QAC5B,GAAG,KAAK;gBACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,aAAK,EAAyB;IAC7C,IAAI,WAAW,CAAA,GAAA,aAAK,EAA2B;IAC/C,IAAI,cAAC,UAAU,cAAE,UAAU,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,aAAE,SAAS,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAC3I,GAAG,KAAK;kBACR;IACF,GAAG,OAAO;IAEV,IAAI,kBAAkB,MAAM,eAAe,IAAK,CAAA,YAAY,YAAY,IAAG;IAE3E,IAAI,mBAAmB,CAAA,GAAA,yCAAoB,EAAE,SAAS;IAEtD,qBACE,gCAAC,CAAA,GAAA,YAAI;QACF,GAAG,KAAK;QACT,KAAK;QACL,aAAY;QACZ,YAAY;QACZ,kBAAkB;QAClB,mBAAmB;QACnB,iBAAiB,4BAAA,6BAAA,kBAAmB;QACpC,WAAW;QACX,kBAAkB;QAClB,mBAAmB;QACnB,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBAC/C,gCAAC,CAAA,GAAA,yCAAI;QACH,KAAK;QACL,YAAY;QACZ,YAAY;QACZ,SAAS;QACT,WAAW;QACX,iBAAiB;QACjB,UAAU;QACV,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;OACvC,MAAM,QAAQ,CAAC,GAAG,CAAC,CAAC,SAAS,kBAC3B,gCAAC,CAAA,GAAA,yCAAgB;YAChB,KAAK;YACL,SAAS;YACT,OAAO;YACP,YAAY;YACZ,YAAY;YACZ,YAAY;2BAEhB,gCAAC;QAAO,GAAG,UAAU;QAAE,KAAK;;AAIpC;AAEA;;;CAGC,GACD,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC","sources":["packages/@react-spectrum/datepicker/src/TimeField.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {classNames} from '@react-spectrum/utils';\nimport {DatePickerSegment} from './DatePickerSegment';\nimport datepickerStyles from './styles.css';\nimport {Field} from '@react-spectrum/label';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumTimeFieldProps, TimeValue} from '@react-types/datepicker';\nimport {useFocusManagerRef, useFormattedDateWidth} from './utils';\nimport {useFormProps} from '@react-spectrum/form';\nimport {useLocale} from '@react-aria/i18n';\nimport {useProviderProps} from '@react-spectrum/provider';\nimport {useTimeField} from '@react-aria/datepicker';\nimport {useTimeFieldState} from '@react-stately/datepicker';\n\nfunction TimeField<T extends TimeValue>(props: SpectrumTimeFieldProps<T>, ref: FocusableRef<HTMLElement>) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {\n autoFocus,\n isDisabled,\n isReadOnly,\n isRequired,\n isQuiet\n } = props;\n\n let domRef = useFocusManagerRef(ref);\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale\n });\n\n let fieldRef = useRef<HTMLDivElement | null>(null);\n let inputRef = useRef<HTMLInputElement | null>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, isInvalid, validationErrors, validationDetails} = useTimeField({\n ...props,\n inputRef\n }, state, fieldRef);\n\n let validationState = state.validationState || (isInvalid ? 'invalid' : null);\n\n let approximateWidth = useFormattedDateWidth(state) + 'ch';\n\n return (\n <Field\n {...props}\n ref={domRef}\n elementType=\"span\"\n labelProps={labelProps}\n descriptionProps={descriptionProps}\n errorMessageProps={errorMessageProps}\n validationState={validationState ?? undefined}\n isInvalid={isInvalid}\n validationErrors={validationErrors}\n validationDetails={validationDetails}\n wrapperClassName={classNames(datepickerStyles, 'react-spectrum-TimeField-fieldWrapper')}>\n <Input\n ref={fieldRef}\n fieldProps={fieldProps}\n isDisabled={isDisabled}\n isQuiet={isQuiet}\n autoFocus={autoFocus}\n validationState={validationState}\n minWidth={approximateWidth}\n className={classNames(datepickerStyles, 'react-spectrum-TimeField')}>\n {state.segments.map((segment, i) =>\n (<DatePickerSegment\n key={i}\n segment={segment}\n state={state}\n isDisabled={isDisabled}\n isReadOnly={isReadOnly}\n isRequired={isRequired} />)\n )}\n <input {...inputProps} ref={inputRef} />\n </Input>\n </Field>\n );\n}\n\n/**\n * TimeFields allow users to enter and edit time values using a keyboard.\n * Each part of the time is displayed in an individually editable segment.\n */\nconst _TimeField = React.forwardRef(TimeField) as <T extends TimeValue>(props: SpectrumTimeFieldProps<T> & {ref?: FocusableRef<HTMLElement>}) => ReactElement;\nexport {_TimeField as TimeField};\n"],"names":[],"version":3,"file":"TimeField.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAzBA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAAuD,CAAC,yCAAyC,CAAC;AAClG,2CAA+C,CAAC,iCAAiC,CAAC;AAClF,2CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAwC,CAAC,2BAA2B,EAAE,0CAAqC,CAAC;AAC5G,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAA+C,CAAC,kCAAkC,EAAE,0CAA4C,CAAC;AACjI,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,2CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA2D,CAAC,6CAA6C,CAAC;AAC1G,4CAA6D,CAAC,+CAA+C,CAAC;AAC9G,4CAAuD,CAAC,yCAAyC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/inputgroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"inputgroup_vars_css.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAzBA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAAuD,CAAC,yCAAyC,CAAC;AAClG,2CAA+C,CAAC,iCAAiC,CAAC;AAClF,2CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAwC,CAAC,2BAA2B,EAAE,2CAAsC;AAC5G,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAA+C,CAAC,kCAAkC,EAAE,2CAA6C;AACjI,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,2CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA2D,CAAC,6CAA6C,CAAC;AAC1G,4CAA6D,CAAC,+CAA+C,CAAC;AAC9G,4CAAuD,CAAC,yCAAyC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/inputgroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"inputgroup_vars_css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,6CAA6C,CAAC;AAC1G,4CAA6D,CAAC,+CAA+C,CAAC;AAC9G,4CAAuD,CAAC,yCAAyC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/inputgroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"inputgroup_vars_css.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAzBA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAAuD,CAAC,yCAAyC,CAAC;AAClG,2CAA+C,CAAC,iCAAiC,CAAC;AAClF,2CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAmD,CAAC,qCAAqC,CAAC;AAC1F,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAwC,CAAC,2BAA2B,EAAE,2CAAsC;AAC5G,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAA+C,CAAC,kCAAkC,EAAE,2CAA6C;AACjI,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA6C,CAAC,+BAA+B,CAAC;AAC9E,2CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAA2D,CAAC,6CAA6C,CAAC;AAC1G,4CAA6D,CAAC,+CAA+C,CAAC;AAC9G,4CAAuD,CAAC,yCAAyC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/inputgroup/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"inputgroup_vars_css.module.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AArBA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAuC,CAAC,0BAA0B,EAAE,0CAAqC,CAAC;AAC1G,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAA8C,CAAC,iCAAiC,EAAE,0CAA4C,CAAC;AAC/H,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,0CAAoD,CAAC,sCAAsC,CAAC;AAC5F,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA6C,CAAC,gCAAgC,EAAE,0CAAiC,CAAC;AAClH,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAAsD,CAAC,wCAAwC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/textfield/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"textfield_vars_css.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AArBA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAuC,CAAC,0BAA0B,EAAE,2CAAsC;AAC1G,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAA8C,CAAC,iCAAiC,EAAE,2CAA6C;AAC/H,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,0CAAoD,CAAC,sCAAsC,CAAC;AAC5F,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA6C,CAAC,gCAAgC,EAAE,2CAAkC;AAClH,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAAsD,CAAC,wCAAwC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/textfield/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"textfield_vars_css.main.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AArBA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAuC,CAAC,0BAA0B,EAAE,0CAAqC,CAAC;AAC1G,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAA8C,CAAC,iCAAiC,EAAE,0CAA4C,CAAC;AAC/H,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,0CAAoD,CAAC,sCAAsC,CAAC;AAC5F,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA6C,CAAC,gCAAgC,EAAE,0CAAiC,CAAC;AAClH,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAAsD,CAAC,wCAAwC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/textfield/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"textfield_vars_css.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AArBA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,2CAA2C;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAuC,CAAC,0BAA0B,EAAE,2CAAsC;AAC1G,4CAAgD,CAAC,kCAAkC,CAAC;AACpF,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAA8C,CAAC,iCAAiC,EAAE,2CAA6C;AAC/H,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,0CAAoD,CAAC,sCAAsC,CAAC;AAC5F,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAA6C,CAAC,gCAAgC,EAAE,2CAAkC;AAClH,4CAAiD,CAAC,mCAAmC,CAAC;AACtF,4CAAsD,CAAC,wCAAwC,CAAC;AAChG,4CAA+C,CAAC,iCAAiC,CAAC;AAClF,4CAAsD,CAAC,wCAAwC,CAAC","sources":["packages/@adobe/spectrum-css-temp/components/textfield/vars.css"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"textfield_vars_css.module.js.map"}
@@ -74,7 +74,7 @@ function $4d2e419f522adb48$var$getVisibleMonths(scale) {
74
74
  return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
75
75
  }
76
76
  function $4d2e419f522adb48$export$71a23a36270e4bf0(ref) {
77
- let domRef = (0, $61dVa$react.useRef)(undefined);
77
+ let domRef = (0, $61dVa$react.useRef)(null);
78
78
  (0, $61dVa$react.useImperativeHandle)(ref, ()=>({
79
79
  ...(0, $61dVa$reactspectrumutils.createDOMRef)(domRef),
80
80
  focus () {
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;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,SAAS,0CAAmB,GAA8B;IAC/D,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAE;IACpB,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAO,CAAA;YAC9B,GAAG,CAAA,GAAA,sCAAW,EAAE,OAAO;YACvB;gBACE,CAAA,GAAA,wCAAiB,EAAE,QAAQ,UAAU,CAAC;oBAAC,UAAU;gBAAI;YACvD;QACF,CAAA;IACA,OAAO;AACT;AAEO,SAAS,0CAAsB,KAAK;QAC5B;IAAb,IAAI,UAAS,aAAA,CAAA,GAAA,8BAAQ,iBAAR,iCAAA,WAAa,MAAM;IAChC,IAAI,cAAc,IAAI;IACtB,IAAI,eAAe,MAAM,gBAAgB,CAAC,QAAQ;QAAC,yBAAyB;IAAI,GAAG,MAAM,CAAC,aAAa;IACvG,IAAI,kBAAmB,aAAa,MAAM;IAE1C,+CAA+C;IAC/C,8EAA8E;IAC9E,mFAAmF;IACnF,iEAAiE;IACjE,OAAQ,kBAAkB,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,kBAAkB,IAAI;AACtE","sources":["packages/@react-spectrum/datepicker/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {createFocusManager} from '@react-aria/focus';\nimport {FocusableRef} from '@react-types/shared';\nimport {SpectrumDatePickerBase} from '@react-types/datepicker';\nimport {useDateFormatter, useLocale} from '@react-aria/i18n';\nimport {useDisplayNames} from '@react-aria/datepicker';\nimport {useImperativeHandle, useMemo, useRef, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport function useFormatHelpText(props: Pick<SpectrumDatePickerBase<any>, 'description' | 'showFormatHelpText'>) {\n let formatter = useDateFormatter({dateStyle: 'short'});\n let displayNames = useDisplayNames();\n return useMemo(() => {\n if (props.description) {\n return props.description;\n }\n\n if (props.showFormatHelpText) {\n return formatter.formatToParts(new Date()).map(s => {\n if (s.type === 'literal') {\n return s.value;\n }\n\n return displayNames.of(s.type);\n }).join(' ');\n }\n\n return '';\n }, [props.description, props.showFormatHelpText, formatter, displayNames]);\n}\n\nexport function useVisibleMonths(maxVisibleMonths: number) {\n let {scale} = useProvider();\n let [visibleMonths, setVisibleMonths] = useState(getVisibleMonths(scale));\n useLayoutEffect(() => {\n let onResize = () => setVisibleMonths(getVisibleMonths(scale));\n onResize();\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [scale]);\n\n return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));\n}\n\nfunction getVisibleMonths(scale) {\n if (typeof window === 'undefined') {\n return 1;\n }\n let monthWidth = scale === 'large' ? 336 : 280;\n let gap = scale === 'large' ? 30 : 24;\n let popoverPadding = scale === 'large' ? 32 : 48;\n return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));\n}\n\nexport function useFocusManagerRef(ref: FocusableRef<HTMLElement>) {\n let domRef = useRef(undefined);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n createFocusManager(domRef).focusFirst({tabbable: true});\n }\n }));\n return domRef;\n}\n\nexport function useFormattedDateWidth(state) {\n let locale = useLocale()?.locale;\n let currentDate = new Date();\n let formatedDate = state.getDateFormatter(locale, {shouldForceLeadingZeros: true}).format(currentDate, locale);\n let totalCharacters = formatedDate.length;\n\n // The max of two is for times with only hours.\n // As the length of a date grows we need to proportionally increase the width.\n // We use the character count with 'ch' units and add extra padding to accomate for\n // dates with months and time dashes, which are wider characters.\n return (totalCharac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IAC9C,OAAO,KAAK,KAAK,CAAC,AAAC,CAAA,OAAO,UAAU,GAAG,iBAAiB,CAAA,IAAM,CAAA,aAAa,GAAE;AAC/E;AAEO,SAAS,0CAAmB,GAA8B;IAC/D,IAAI,SAAS,CAAA,GAAA,mBAAK,EAAsB;IACxC,CAAA,GAAA,gCAAkB,EAAE,KAAK,IAAO,CAAA;YAC9B,GAAG,CAAA,GAAA,sCAAW,EAAE,OAAO;YACvB;gBACE,CAAA,GAAA,wCAAiB,EAAE,QAAQ,UAAU,CAAC;oBAAC,UAAU;gBAAI;YACvD;QACF,CAAA;IACA,OAAO;AACT;AAEO,SAAS,0CAAsB,KAAK;QAC5B;IAAb,IAAI,UAAS,aAAA,CAAA,GAAA,8BAAQ,iBAAR,iCAAA,WAAa,MAAM;IAChC,IAAI,cAAc,IAAI;IACtB,IAAI,eAAe,MAAM,gBAAgB,CAAC,QAAQ;QAAC,yBAAyB;IAAI,GAAG,MAAM,CAAC,aAAa;IACvG,IAAI,kBAAmB,aAAa,MAAM;IAE1C,+CAA+C;IAC/C,8EAA8E;IAC9E,mFAAmF;IACnF,iEAAiE;IACjE,OAAQ,kBAAkB,KAAK,GAAG,CAAC,KAAK,KAAK,CAAC,kBAAkB,IAAI;AACtE","sources":["packages/@react-spectrum/datepicker/src/utils.ts"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {createDOMRef} from '@react-spectrum/utils';\nimport {createFocusManager} from '@react-aria/focus';\nimport {FocusableRef} from '@react-types/shared';\nimport {SpectrumDatePickerBase} from '@react-types/datepicker';\nimport {useDateFormatter, useLocale} from '@react-aria/i18n';\nimport {useDisplayNames} from '@react-aria/datepicker';\nimport {useImperativeHandle, useMemo, useRef, useState} from 'react';\nimport {useLayoutEffect} from '@react-aria/utils';\nimport {useProvider} from '@react-spectrum/provider';\n\nexport function useFormatHelpText(props: Pick<SpectrumDatePickerBase<any>, 'description' | 'showFormatHelpText'>) {\n let formatter = useDateFormatter({dateStyle: 'short'});\n let displayNames = useDisplayNames();\n return useMemo(() => {\n if (props.description) {\n return props.description;\n }\n\n if (props.showFormatHelpText) {\n return formatter.formatToParts(new Date()).map(s => {\n if (s.type === 'literal') {\n return s.value;\n }\n\n return displayNames.of(s.type);\n }).join(' ');\n }\n\n return '';\n }, [props.description, props.showFormatHelpText, formatter, displayNames]);\n}\n\nexport function useVisibleMonths(maxVisibleMonths: number) {\n let {scale} = useProvider()!;\n let [visibleMonths, setVisibleMonths] = useState(getVisibleMonths(scale));\n useLayoutEffect(() => {\n let onResize = () => setVisibleMonths(getVisibleMonths(scale));\n onResize();\n\n window.addEventListener('resize', onResize);\n return () => {\n window.removeEventListener('resize', onResize);\n };\n }, [scale]);\n\n return Math.max(1, Math.min(visibleMonths, maxVisibleMonths, 3));\n}\n\nfunction getVisibleMonths(scale) {\n if (typeof window === 'undefined') {\n return 1;\n }\n let monthWidth = scale === 'large' ? 336 : 280;\n let gap = scale === 'large' ? 30 : 24;\n let popoverPadding = scale === 'large' ? 32 : 48;\n return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));\n}\n\nexport function useFocusManagerRef(ref: FocusableRef<HTMLElement>) {\n let domRef = useRef<HTMLElement | null>(null);\n useImperativeHandle(ref, () => ({\n ...createDOMRef(domRef),\n focus() {\n createFocusManager(domRef).focusFirst({tabbable: true});\n }\n }));\n return domRef;\n}\n\nexport function useFormattedDateWidth(state) {\n let locale = useLocale()?.locale;\n let currentDate = new Date();\n let formatedDate = state.getDateFormatter(locale, {shouldForceLeadingZeros: true}).format(currentDate, locale);\n let totalCharacters = formatedDate.length;\n\n // The max of two is for times with only hours.\n // As the length of a date grows we need to proportionally increase the width.\n // We use the character count with 'ch' units and add extra padding to accomate for\n // dates with months and time dashes, which are wider characters.\n return (totalCharacters + Math.max(Math.floor(totalCharacters / 5), 2));\n}\n"],"names":[],"version":3,"file":"utils.main.js.map"}
package/dist/utils.mjs CHANGED
@@ -65,7 +65,7 @@ function $04e96200274b03de$var$getVisibleMonths(scale) {
65
65
  return Math.floor((window.innerWidth - popoverPadding * 2) / (monthWidth + gap));
66
66
  }
67
67
  function $04e96200274b03de$export$71a23a36270e4bf0(ref) {
68
- let domRef = (0, $d7JPl$useRef)(undefined);
68
+ let domRef = (0, $d7JPl$useRef)(null);
69
69
  (0, $d7JPl$useImperativeHandle)(ref, ()=>({
70
70
  ...(0, $d7JPl$createDOMRef)(domRef),
71
71
  focus () {