@adobe/react-spectrum 3.47.1 → 3.47.2

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 (232) hide show
  1. package/dist/private/accordion_vars.css +66 -48
  2. package/dist/private/accordion_vars.css.map +1 -1
  3. package/dist/private/actionbar/ActionBar.cjs.map +1 -1
  4. package/dist/private/actionbar/ActionBar.js.map +1 -1
  5. package/dist/private/actionbar/ActionBar.mjs.map +1 -1
  6. package/dist/private/actionbar/actionbar.css +59 -57
  7. package/dist/private/actionbar/actionbar.css.map +1 -1
  8. package/dist/private/actiongroup/ActionGroup.cjs +1 -1
  9. package/dist/private/actiongroup/ActionGroup.cjs.map +1 -1
  10. package/dist/private/actiongroup/ActionGroup.js +1 -1
  11. package/dist/private/actiongroup/ActionGroup.js.map +1 -1
  12. package/dist/private/actiongroup/ActionGroup.mjs +1 -1
  13. package/dist/private/actiongroup/ActionGroup.mjs.map +1 -1
  14. package/dist/private/actiongroup_vars.css +124 -114
  15. package/dist/private/actiongroup_vars.css.map +1 -1
  16. package/dist/private/autocomplete/MobileSearchAutocomplete.cjs.map +1 -1
  17. package/dist/private/autocomplete/MobileSearchAutocomplete.js.map +1 -1
  18. package/dist/private/autocomplete/MobileSearchAutocomplete.mjs.map +1 -1
  19. package/dist/private/autocomplete/SearchAutocomplete.cjs.map +1 -1
  20. package/dist/private/autocomplete/SearchAutocomplete.js.map +1 -1
  21. package/dist/private/autocomplete/SearchAutocomplete.mjs.map +1 -1
  22. package/dist/private/autocomplete/searchautocomplete.css +6 -6
  23. package/dist/private/autocomplete/searchautocomplete.css.map +1 -1
  24. package/dist/private/avatar_vars.css +12 -7
  25. package/dist/private/avatar_vars.css.map +1 -1
  26. package/dist/private/badge_vars.css +76 -68
  27. package/dist/private/badge_vars.css.map +1 -1
  28. package/dist/private/barloader_vars.css +132 -112
  29. package/dist/private/barloader_vars.css.map +1 -1
  30. package/dist/private/breadcrumb_vars.css +182 -148
  31. package/dist/private/breadcrumb_vars.css.map +1 -1
  32. package/dist/private/button/Button.cjs.map +1 -1
  33. package/dist/private/button/Button.js.map +1 -1
  34. package/dist/private/button/Button.mjs.map +1 -1
  35. package/dist/private/button_vars.css +822 -785
  36. package/dist/private/button_vars.css.map +1 -1
  37. package/dist/private/buttongroup_vars.css +25 -24
  38. package/dist/private/buttongroup_vars.css.map +1 -1
  39. package/dist/private/buttongroup_vars_css.cjs +5 -5
  40. package/dist/private/buttongroup_vars_css.mjs +5 -5
  41. package/dist/private/calendar/CalendarBase.cjs.map +1 -1
  42. package/dist/private/calendar/CalendarBase.js.map +1 -1
  43. package/dist/private/calendar/CalendarBase.mjs.map +1 -1
  44. package/dist/private/calendar_vars.css +280 -256
  45. package/dist/private/calendar_vars.css.map +1 -1
  46. package/dist/private/card/BaseLayout.cjs +2 -2
  47. package/dist/private/card/BaseLayout.cjs.map +1 -1
  48. package/dist/private/card/BaseLayout.js +2 -2
  49. package/dist/private/card/BaseLayout.js.map +1 -1
  50. package/dist/private/card/BaseLayout.mjs +2 -2
  51. package/dist/private/card/BaseLayout.mjs.map +1 -1
  52. package/dist/private/card/CardView.cjs.map +1 -1
  53. package/dist/private/card/CardView.js.map +1 -1
  54. package/dist/private/card/CardView.mjs.map +1 -1
  55. package/dist/private/card_vars.css +995 -907
  56. package/dist/private/card_vars.css.map +1 -1
  57. package/dist/private/checkbox_vars.css +318 -219
  58. package/dist/private/checkbox_vars.css.map +1 -1
  59. package/dist/private/circleloader_vars.css +99 -85
  60. package/dist/private/circleloader_vars.css.map +1 -1
  61. package/dist/private/color/ColorEditor.cjs.map +1 -1
  62. package/dist/private/color/ColorEditor.js.map +1 -1
  63. package/dist/private/color/ColorEditor.mjs.map +1 -1
  64. package/dist/private/color/ColorPicker.css +28 -14
  65. package/dist/private/color/ColorPicker.css.map +1 -1
  66. package/dist/private/color/colorfield.css +3 -3
  67. package/dist/private/color/colorfield.css.map +1 -1
  68. package/dist/private/colorarea_vars.css +36 -29
  69. package/dist/private/colorarea_vars.css.map +1 -1
  70. package/dist/private/colorhandle_vars.css +23 -23
  71. package/dist/private/colorloupe_vars.css +5 -5
  72. package/dist/private/colorloupe_vars.css.map +1 -1
  73. package/dist/private/colorslider_vars.css +34 -34
  74. package/dist/private/colorslider_vars.css.map +1 -1
  75. package/dist/private/colorwheel_vars.css +44 -38
  76. package/dist/private/colorwheel_vars.css.map +1 -1
  77. package/dist/private/combobox/ComboBox.cjs.map +1 -1
  78. package/dist/private/combobox/ComboBox.js.map +1 -1
  79. package/dist/private/combobox/ComboBox.mjs.map +1 -1
  80. package/dist/private/combobox/MobileComboBox.cjs.map +1 -1
  81. package/dist/private/combobox/MobileComboBox.js.map +1 -1
  82. package/dist/private/combobox/MobileComboBox.mjs.map +1 -1
  83. package/dist/private/combobox/combobox.css +6 -6
  84. package/dist/private/combobox/combobox.css.map +1 -1
  85. package/dist/private/contextualhelp/ContextualHelp.cjs.map +1 -1
  86. package/dist/private/contextualhelp/ContextualHelp.js.map +1 -1
  87. package/dist/private/contextualhelp/ContextualHelp.mjs.map +1 -1
  88. package/dist/private/contextualhelp_vars.css +13 -13
  89. package/dist/private/contextualhelp_vars.css.map +1 -1
  90. package/dist/private/datepicker/DatePicker.cjs.map +1 -1
  91. package/dist/private/datepicker/DatePicker.js.map +1 -1
  92. package/dist/private/datepicker/DatePicker.mjs.map +1 -1
  93. package/dist/private/datepicker/DateRangePicker.cjs.map +1 -1
  94. package/dist/private/datepicker/DateRangePicker.js.map +1 -1
  95. package/dist/private/datepicker/DateRangePicker.mjs.map +1 -1
  96. package/dist/private/datepicker/styles.css +33 -31
  97. package/dist/private/datepicker/styles.css.map +1 -1
  98. package/dist/private/dialog/AlertDialog.cjs.map +1 -1
  99. package/dist/private/dialog/AlertDialog.js.map +1 -1
  100. package/dist/private/dialog/AlertDialog.mjs.map +1 -1
  101. package/dist/private/dialog/Dialog.cjs.map +1 -1
  102. package/dist/private/dialog/Dialog.js.map +1 -1
  103. package/dist/private/dialog/Dialog.mjs.map +1 -1
  104. package/dist/private/dialog_vars.css +216 -180
  105. package/dist/private/dialog_vars.css.map +1 -1
  106. package/dist/private/dropdown_vars.css +150 -114
  107. package/dist/private/dropdown_vars.css.map +1 -1
  108. package/dist/private/dropzone/DropZone.cjs.map +1 -1
  109. package/dist/private/dropzone/DropZone.js.map +1 -1
  110. package/dist/private/dropzone/DropZone.mjs.map +1 -1
  111. package/dist/private/dropzone_vars.css +114 -85
  112. package/dist/private/dropzone_vars.css.map +1 -1
  113. package/dist/private/fieldgroup_vars.css +54 -46
  114. package/dist/private/fieldgroup_vars.css.map +1 -1
  115. package/dist/private/fieldlabel_vars.css +183 -169
  116. package/dist/private/fieldlabel_vars.css.map +1 -1
  117. package/dist/private/helptext_vars.css +83 -69
  118. package/dist/private/helptext_vars.css.map +1 -1
  119. package/dist/private/icon_vars.css +52 -36
  120. package/dist/private/icon_vars.css.map +1 -1
  121. package/dist/private/illustratedmessage_vars.css +33 -31
  122. package/dist/private/illustratedmessage_vars.css.map +1 -1
  123. package/dist/private/inlinealert/InlineAlert.cjs.map +1 -1
  124. package/dist/private/inlinealert/InlineAlert.js.map +1 -1
  125. package/dist/private/inlinealert/InlineAlert.mjs.map +1 -1
  126. package/dist/private/inlinealert_vars.css +54 -46
  127. package/dist/private/inlinealert_vars.css.map +1 -1
  128. package/dist/private/inputgroup_vars.css +499 -319
  129. package/dist/private/inputgroup_vars.css.map +1 -1
  130. package/dist/private/label/Label.cjs.map +1 -1
  131. package/dist/private/label/Label.js.map +1 -1
  132. package/dist/private/label/Label.mjs.map +1 -1
  133. package/dist/private/link_vars.css +101 -85
  134. package/dist/private/link_vars.css.map +1 -1
  135. package/dist/private/list/ListView.cjs.map +1 -1
  136. package/dist/private/list/ListView.js.map +1 -1
  137. package/dist/private/list/ListView.mjs.map +1 -1
  138. package/dist/private/list/styles.css +425 -333
  139. package/dist/private/list/styles.css.map +1 -1
  140. package/dist/private/listbox/ListBoxBase.cjs.map +1 -1
  141. package/dist/private/listbox/ListBoxBase.js.map +1 -1
  142. package/dist/private/listbox/ListBoxBase.mjs.map +1 -1
  143. package/dist/private/menu/ActionMenu.cjs.map +1 -1
  144. package/dist/private/menu/ActionMenu.js.map +1 -1
  145. package/dist/private/menu/ActionMenu.mjs.map +1 -1
  146. package/dist/private/menu/Menu.cjs.map +1 -1
  147. package/dist/private/menu/Menu.js.map +1 -1
  148. package/dist/private/menu/Menu.mjs.map +1 -1
  149. package/dist/private/menu/MenuItem.cjs.map +1 -1
  150. package/dist/private/menu/MenuItem.js.map +1 -1
  151. package/dist/private/menu/MenuItem.mjs.map +1 -1
  152. package/dist/private/menu_vars.css +178 -160
  153. package/dist/private/menu_vars.css.map +1 -1
  154. package/dist/private/modal_vars.css +64 -54
  155. package/dist/private/modal_vars.css.map +1 -1
  156. package/dist/private/overlays/overlays.css +7 -5
  157. package/dist/private/overlays/overlays.css.map +1 -1
  158. package/dist/private/package.cjs +1 -1
  159. package/dist/private/package.cjs.map +1 -1
  160. package/dist/private/package.js +1 -1
  161. package/dist/private/package.js.map +1 -1
  162. package/dist/private/package.mjs +1 -1
  163. package/dist/private/package.mjs.map +1 -1
  164. package/dist/private/page_vars.css +54 -46
  165. package/dist/private/page_vars.css.map +1 -1
  166. package/dist/private/picker/Picker.cjs.map +1 -1
  167. package/dist/private/picker/Picker.js.map +1 -1
  168. package/dist/private/picker/Picker.mjs.map +1 -1
  169. package/dist/private/popover_vars.css +105 -83
  170. package/dist/private/popover_vars.css.map +1 -1
  171. package/dist/private/radio_vars.css +257 -163
  172. package/dist/private/radio_vars.css.map +1 -1
  173. package/dist/private/rule_vars.css +73 -63
  174. package/dist/private/rule_vars.css.map +1 -1
  175. package/dist/private/search_vars.css +95 -87
  176. package/dist/private/search_vars.css.map +1 -1
  177. package/dist/private/slider/RangeSlider.cjs.map +1 -1
  178. package/dist/private/slider/RangeSlider.js.map +1 -1
  179. package/dist/private/slider/RangeSlider.mjs.map +1 -1
  180. package/dist/private/slider_vars.css +516 -402
  181. package/dist/private/slider_vars.css.map +1 -1
  182. package/dist/private/statuslight_vars.css +76 -68
  183. package/dist/private/statuslight_vars.css.map +1 -1
  184. package/dist/private/steplist/StepListItem.cjs.map +1 -1
  185. package/dist/private/steplist/StepListItem.js.map +1 -1
  186. package/dist/private/steplist/StepListItem.mjs.map +1 -1
  187. package/dist/private/steplist_vars.css +371 -297
  188. package/dist/private/steplist_vars.css.map +1 -1
  189. package/dist/private/stepper_vars.css +557 -438
  190. package/dist/private/stepper_vars.css.map +1 -1
  191. package/dist/private/table/Resizer.cjs.map +1 -1
  192. package/dist/private/table/Resizer.js.map +1 -1
  193. package/dist/private/table/Resizer.mjs.map +1 -1
  194. package/dist/private/table/TableViewBase.cjs.map +1 -1
  195. package/dist/private/table/TableViewBase.js.map +1 -1
  196. package/dist/private/table/TableViewBase.mjs.map +1 -1
  197. package/dist/private/table/table.css +103 -95
  198. package/dist/private/table/table.css.map +1 -1
  199. package/dist/private/table_vars.css +458 -350
  200. package/dist/private/table_vars.css.map +1 -1
  201. package/dist/private/tabs_vars.css +319 -281
  202. package/dist/private/tabs_vars.css.map +1 -1
  203. package/dist/private/tag/TagGroup.cjs.map +1 -1
  204. package/dist/private/tag/TagGroup.js.map +1 -1
  205. package/dist/private/tag/TagGroup.mjs.map +1 -1
  206. package/dist/private/tags_vars.css +167 -149
  207. package/dist/private/tags_vars.css.map +1 -1
  208. package/dist/private/textfield/TextFieldBase.cjs.map +1 -1
  209. package/dist/private/textfield/TextFieldBase.js.map +1 -1
  210. package/dist/private/textfield/TextFieldBase.mjs.map +1 -1
  211. package/dist/private/textfield_vars.css +278 -250
  212. package/dist/private/textfield_vars.css.map +1 -1
  213. package/dist/private/toast/Toast.cjs.map +1 -1
  214. package/dist/private/toast/Toast.js.map +1 -1
  215. package/dist/private/toast/Toast.mjs.map +1 -1
  216. package/dist/private/toast/toastContainer.css +64 -56
  217. package/dist/private/toast/toastContainer.css.map +1 -1
  218. package/dist/private/toast_vars.css +5 -3
  219. package/dist/private/toast_vars.css.map +1 -1
  220. package/dist/private/toggle_vars.css +287 -211
  221. package/dist/private/toggle_vars.css.map +1 -1
  222. package/dist/private/tooltip_vars.css +150 -127
  223. package/dist/private/tooltip_vars.css.map +1 -1
  224. package/dist/private/tray_vars.css +54 -46
  225. package/dist/private/tray_vars.css.map +1 -1
  226. package/dist/private/typography_index.css +54 -46
  227. package/dist/private/typography_index.css.map +1 -1
  228. package/dist/private/underlay_vars.css +58 -50
  229. package/dist/private/underlay_vars.css.map +1 -1
  230. package/dist/private/well_vars.css +54 -46
  231. package/dist/private/well_vars.css.map +1 -1
  232. package/package.json +6 -6
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AA2CM,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAkC,EAClC,GAAoC;IAEpC,IAAI,WAAC,UAAU,mBAAQ,YAAY,0BAAgB,QAAQ,EAAE,GAAG,YAAW,GAAG;IAE9E,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,OAAO,YAAY,uBAAS,0DAAC,CAAA,GAAA,iEAAU,yBAAO,0DAAC,CAAA,GAAA,iEAAU;IAE7D,IAAI,QAAQ;QACV,SAAS;YAAC,kBAAkB,CAAA,GAAA,mDAAS,CAAC,CAAC,wCAAwC;QAAA;QAC/E,QAAQ;YAAC,kBAAkB,CAAA,GAAA,mDAAS,CAAC,CAAC,uCAAuC;QAAA;IAC/E;IAEA,IAAI,aAAa,CAAA,GAAA,+CAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE9D,qBACE,0DAAC,CAAA,GAAA,uCAAY;QAAG,GAAG,UAAU;QAAE,MAAK;QAAU,WAAW;QAAW,WAAA;qBAClE,0DAAC,CAAA,GAAA,sCAAW;QACT,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,YAAY;YAAC,YAAY;QAAK,EAAE;QAC3D,KAAK;QACL,kBAAkB,CAAA,GAAA,oCAAS,EACzB,CAAA,GAAA,mDAAS,GACT,wCACA,WAAW,gBAAgB;QAE7B,SAAA;OACC,qBAEH,0DAAC,CAAA,GAAA,oCAAS,uBACR,0DAAC,CAAA,GAAA,sCAAW;QAAE,OAAO;qBACnB,0DAAC,CAAA,GAAA,gCAAK;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAS,GAAG;OAC9C;AAMb","sources":["packages/@adobe/react-spectrum/src/contextualhelp/ContextualHelp.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 {ActionButton} from '../button/ActionButton';\n\nimport {AriaLabelingProps, DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider} from '../utils/Slots';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport HelpOutline from '@spectrum-icons/workflow/HelpOutline';\nimport helpStyles from '@adobe/spectrum-css-temp/components/contextualhelp/vars.css';\nimport InfoOutline from '@spectrum-icons/workflow/InfoOutline';\n// @ts-ignore\nimport intlMessages from '../../intl/contextualhelp/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerProps} from 'react-stately/useOverlayTriggerState';\nimport {Placement, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface SpectrumContextualHelpProps\n extends OverlayTriggerProps, PositionProps, StyleProps, DOMProps, AriaLabelingProps {\n /** Contents of the Contextual Help popover. */\n children: ReactNode;\n /**\n * Indicates whether contents are informative or provides helpful guidance.\n *\n * @default 'help'\n */\n variant?: 'help' | 'info';\n /**\n * The placement of the popover with respect to the action button.\n *\n * @default 'bottom start'\n */\n placement?: Placement;\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a\n * total view.\n */\nexport const ContextualHelp = React.forwardRef(function ContextualHelp(\n props: SpectrumContextualHelpProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let {variant = 'help', placement = 'bottom start', children, ...otherProps} = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/contextualhelp');\n\n let icon = variant === 'info' ? <InfoOutline /> : <HelpOutline />;\n\n let slots = {\n content: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-content']},\n footer: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-footer']}\n };\n\n let labelProps = useLabels(otherProps, stringFormatter.format(variant));\n\n return (\n <DialogTrigger {...otherProps} type=\"popover\" placement={placement} hideArrow>\n <ActionButton\n {...mergeProps(otherProps, labelProps, {isDisabled: false})}\n ref={ref}\n UNSAFE_className={classNames(\n helpStyles,\n 'react-spectrum-ContextualHelp-button',\n otherProps.UNSAFE_className\n )}\n isQuiet>\n {icon}\n </ActionButton>\n <ClearSlots>\n <SlotProvider slots={slots}>\n <Dialog UNSAFE_className={classNames(helpStyles, 'react-spectrum-ContextualHelp-dialog')}>\n {children}\n </Dialog>\n </SlotProvider>\n </ClearSlots>\n </DialogTrigger>\n );\n});\n"],"names":[],"version":3,"file":"ContextualHelp.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AA0CM,MAAM,0DAAiB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAkC,EAClC,GAAoC;IAEpC,IAAI,WAAC,UAAU,mBAAQ,YAAY,0BAAgB,QAAQ,EAAE,GAAG,YAAW,GAAG;IAE9E,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;IAEhE,IAAI,OAAO,YAAY,uBAAS,0DAAC,CAAA,GAAA,iEAAU,yBAAO,0DAAC,CAAA,GAAA,iEAAU;IAE7D,IAAI,QAAQ;QACV,SAAS;YAAC,kBAAkB,CAAA,GAAA,mDAAS,CAAC,CAAC,wCAAwC;QAAA;QAC/E,QAAQ;YAAC,kBAAkB,CAAA,GAAA,mDAAS,CAAC,CAAC,uCAAuC;QAAA;IAC/E;IAEA,IAAI,aAAa,CAAA,GAAA,+CAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE9D,qBACE,0DAAC,CAAA,GAAA,uCAAY;QAAG,GAAG,UAAU;QAAE,MAAK;QAAU,WAAW;QAAW,WAAA;qBAClE,0DAAC,CAAA,GAAA,sCAAW;QACT,GAAG,CAAA,GAAA,qCAAS,EAAE,YAAY,YAAY;YAAC,YAAY;QAAK,EAAE;QAC3D,KAAK;QACL,kBAAkB,CAAA,GAAA,oCAAS,EACzB,CAAA,GAAA,mDAAS,GACT,wCACA,WAAW,gBAAgB;QAE7B,SAAA;OACC,qBAEH,0DAAC,CAAA,GAAA,oCAAS,uBACR,0DAAC,CAAA,GAAA,sCAAW;QAAE,OAAO;qBACnB,0DAAC,CAAA,GAAA,gCAAK;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAS,GAAG;OAC9C;AAMb","sources":["packages/@adobe/react-spectrum/src/contextualhelp/ContextualHelp.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 {ActionButton} from '../button/ActionButton';\n\nimport {AriaLabelingProps, DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider} from '../utils/Slots';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport HelpOutline from '@spectrum-icons/workflow/HelpOutline';\nimport helpStyles from '@adobe/spectrum-css-temp/components/contextualhelp/vars.css';\nimport InfoOutline from '@spectrum-icons/workflow/InfoOutline';\nimport intlMessages from '../../intl/contextualhelp/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerProps} from 'react-stately/useOverlayTriggerState';\nimport {Placement, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface SpectrumContextualHelpProps\n extends OverlayTriggerProps, PositionProps, StyleProps, DOMProps, AriaLabelingProps {\n /** Contents of the Contextual Help popover. */\n children: ReactNode;\n /**\n * Indicates whether contents are informative or provides helpful guidance.\n *\n * @default 'help'\n */\n variant?: 'help' | 'info';\n /**\n * The placement of the popover with respect to the action button.\n *\n * @default 'bottom start'\n */\n placement?: Placement;\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a\n * total view.\n */\nexport const ContextualHelp = React.forwardRef(function ContextualHelp(\n props: SpectrumContextualHelpProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let {variant = 'help', placement = 'bottom start', children, ...otherProps} = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/contextualhelp');\n\n let icon = variant === 'info' ? <InfoOutline /> : <HelpOutline />;\n\n let slots = {\n content: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-content']},\n footer: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-footer']}\n };\n\n let labelProps = useLabels(otherProps, stringFormatter.format(variant));\n\n return (\n <DialogTrigger {...otherProps} type=\"popover\" placement={placement} hideArrow>\n <ActionButton\n {...mergeProps(otherProps, labelProps, {isDisabled: false})}\n ref={ref}\n UNSAFE_className={classNames(\n helpStyles,\n 'react-spectrum-ContextualHelp-button',\n otherProps.UNSAFE_className\n )}\n isQuiet>\n {icon}\n </ActionButton>\n <ClearSlots>\n <SlotProvider slots={slots}>\n <Dialog UNSAFE_className={classNames(helpStyles, 'react-spectrum-ContextualHelp-dialog')}>\n {children}\n </Dialog>\n </SlotProvider>\n </ClearSlots>\n </DialogTrigger>\n );\n});\n"],"names":[],"version":3,"file":"ContextualHelp.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AA2CM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAkC,EAClC,GAAoC;IAEpC,IAAI,WAAC,UAAU,mBAAQ,YAAY,0BAAgB,QAAQ,EAAE,GAAG,YAAW,GAAG;IAE9E,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,8CAAW,GAAG;IAEhE,IAAI,OAAO,YAAY,uBAAS,gCAAC,CAAA,GAAA,uCAAU,yBAAO,gCAAC,CAAA,GAAA,uCAAU;IAE7D,IAAI,QAAQ;QACV,SAAS;YAAC,kBAAkB,CAAA,GAAA,2DAAS,CAAC,CAAC,wCAAwC;QAAA;QAC/E,QAAQ;YAAC,kBAAkB,CAAA,GAAA,2DAAS,CAAC,CAAC,uCAAuC;QAAA;IAC/E;IAEA,IAAI,aAAa,CAAA,GAAA,gBAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE9D,qBACE,gCAAC,CAAA,GAAA,yCAAY;QAAG,GAAG,UAAU;QAAE,MAAK;QAAU,WAAW;QAAW,WAAA;qBAClE,gCAAC,CAAA,GAAA,yCAAW;QACT,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,YAAY;YAAC,YAAY;QAAK,EAAE;QAC3D,KAAK;QACL,kBAAkB,CAAA,GAAA,yCAAS,EACzB,CAAA,GAAA,2DAAS,GACT,wCACA,WAAW,gBAAgB;QAE7B,SAAA;OACC,qBAEH,gCAAC,CAAA,GAAA,yCAAS,uBACR,gCAAC,CAAA,GAAA,yCAAW;QAAE,OAAO;qBACnB,gCAAC,CAAA,GAAA,yCAAK;QAAE,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,2DAAS,GAAG;OAC9C;AAMb","sources":["packages/@adobe/react-spectrum/src/contextualhelp/ContextualHelp.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 {ActionButton} from '../button/ActionButton';\n\nimport {AriaLabelingProps, DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider} from '../utils/Slots';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport HelpOutline from '@spectrum-icons/workflow/HelpOutline';\nimport helpStyles from '@adobe/spectrum-css-temp/components/contextualhelp/vars.css';\nimport InfoOutline from '@spectrum-icons/workflow/InfoOutline';\n// @ts-ignore\nimport intlMessages from '../../intl/contextualhelp/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerProps} from 'react-stately/useOverlayTriggerState';\nimport {Placement, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface SpectrumContextualHelpProps\n extends OverlayTriggerProps, PositionProps, StyleProps, DOMProps, AriaLabelingProps {\n /** Contents of the Contextual Help popover. */\n children: ReactNode;\n /**\n * Indicates whether contents are informative or provides helpful guidance.\n *\n * @default 'help'\n */\n variant?: 'help' | 'info';\n /**\n * The placement of the popover with respect to the action button.\n *\n * @default 'bottom start'\n */\n placement?: Placement;\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a\n * total view.\n */\nexport const ContextualHelp = React.forwardRef(function ContextualHelp(\n props: SpectrumContextualHelpProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let {variant = 'help', placement = 'bottom start', children, ...otherProps} = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/contextualhelp');\n\n let icon = variant === 'info' ? <InfoOutline /> : <HelpOutline />;\n\n let slots = {\n content: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-content']},\n footer: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-footer']}\n };\n\n let labelProps = useLabels(otherProps, stringFormatter.format(variant));\n\n return (\n <DialogTrigger {...otherProps} type=\"popover\" placement={placement} hideArrow>\n <ActionButton\n {...mergeProps(otherProps, labelProps, {isDisabled: false})}\n ref={ref}\n UNSAFE_className={classNames(\n helpStyles,\n 'react-spectrum-ContextualHelp-button',\n otherProps.UNSAFE_className\n )}\n isQuiet>\n {icon}\n </ActionButton>\n <ClearSlots>\n <SlotProvider slots={slots}>\n <Dialog UNSAFE_className={classNames(helpStyles, 'react-spectrum-ContextualHelp-dialog')}>\n {children}\n </Dialog>\n </SlotProvider>\n </ClearSlots>\n </DialogTrigger>\n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/ContextualHelp.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 {ActionButton} from '../button/ActionButton';\n\nimport {AriaLabelingProps, DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider} from '../utils/Slots';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport HelpOutline from '@spectrum-icons/workflow/HelpOutline';\nimport helpStyles from '@adobe/spectrum-css-temp/components/contextualhelp/vars.css';\nimport InfoOutline from '@spectrum-icons/workflow/InfoOutline';\nimport intlMessages from '../../intl/contextualhelp/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerProps} from 'react-stately/useOverlayTriggerState';\nimport {Placement, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface SpectrumContextualHelpProps\n extends OverlayTriggerProps, PositionProps, StyleProps, DOMProps, AriaLabelingProps {\n /** Contents of the Contextual Help popover. */\n children: ReactNode;\n /**\n * Indicates whether contents are informative or provides helpful guidance.\n *\n * @default 'help'\n */\n variant?: 'help' | 'info';\n /**\n * The placement of the popover with respect to the action button.\n *\n * @default 'bottom start'\n */\n placement?: Placement;\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a\n * total view.\n */\nexport const ContextualHelp = React.forwardRef(function ContextualHelp(\n props: SpectrumContextualHelpProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let {variant = 'help', placement = 'bottom start', children, ...otherProps} = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/contextualhelp');\n\n let icon = variant === 'info' ? <InfoOutline /> : <HelpOutline />;\n\n let slots = {\n content: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-content']},\n footer: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-footer']}\n };\n\n let labelProps = useLabels(otherProps, stringFormatter.format(variant));\n\n return (\n <DialogTrigger {...otherProps} type=\"popover\" placement={placement} hideArrow>\n <ActionButton\n {...mergeProps(otherProps, labelProps, {isDisabled: false})}\n ref={ref}\n UNSAFE_className={classNames(\n helpStyles,\n 'react-spectrum-ContextualHelp-button',\n otherProps.UNSAFE_className\n )}\n isQuiet>\n {icon}\n </ActionButton>\n <ClearSlots>\n <SlotProvider slots={slots}>\n <Dialog UNSAFE_className={classNames(helpStyles, 'react-spectrum-ContextualHelp-dialog')}>\n {children}\n </Dialog>\n </SlotProvider>\n </ClearSlots>\n </DialogTrigger>\n );\n});\n"],"names":[],"version":3,"file":"ContextualHelp.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AA2CM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAkC,EAClC,GAAoC;IAEpC,IAAI,WAAC,UAAU,mBAAQ,YAAY,0BAAgB,QAAQ,EAAE,GAAG,YAAW,GAAG;IAE9E,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAEhE,IAAI,OAAO,YAAY,uBAAS,gCAAC,CAAA,GAAA,uCAAU,yBAAO,gCAAC,CAAA,GAAA,uCAAU;IAE7D,IAAI,QAAQ;QACV,SAAS;YAAC,kBAAkB,CAAA,GAAA,2DAAS,CAAC,CAAC,wCAAwC;QAAA;QAC/E,QAAQ;YAAC,kBAAkB,CAAA,GAAA,2DAAS,CAAC,CAAC,uCAAuC;QAAA;IAC/E;IAEA,IAAI,aAAa,CAAA,GAAA,gBAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE9D,qBACE,gCAAC,CAAA,GAAA,yCAAY;QAAG,GAAG,UAAU;QAAE,MAAK;QAAU,WAAW;QAAW,WAAA;qBAClE,gCAAC,CAAA,GAAA,yCAAW;QACT,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,YAAY;YAAC,YAAY;QAAK,EAAE;QAC3D,KAAK;QACL,kBAAkB,CAAA,GAAA,yCAAS,EACzB,CAAA,GAAA,2DAAS,GACT,wCACA,WAAW,gBAAgB;QAE7B,SAAA;OACC,qBAEH,gCAAC,CAAA,GAAA,yCAAS,uBACR,gCAAC,CAAA,GAAA,yCAAW;QAAE,OAAO;qBACnB,gCAAC,CAAA,GAAA,yCAAK;QAAE,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,2DAAS,GAAG;OAC9C;AAMb","sources":["packages/@adobe/react-spectrum/src/contextualhelp/ContextualHelp.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 {ActionButton} from '../button/ActionButton';\n\nimport {AriaLabelingProps, DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider} from '../utils/Slots';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport HelpOutline from '@spectrum-icons/workflow/HelpOutline';\nimport helpStyles from '@adobe/spectrum-css-temp/components/contextualhelp/vars.css';\nimport InfoOutline from '@spectrum-icons/workflow/InfoOutline';\n// @ts-ignore\nimport intlMessages from '../../intl/contextualhelp/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerProps} from 'react-stately/useOverlayTriggerState';\nimport {Placement, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface SpectrumContextualHelpProps\n extends OverlayTriggerProps, PositionProps, StyleProps, DOMProps, AriaLabelingProps {\n /** Contents of the Contextual Help popover. */\n children: ReactNode;\n /**\n * Indicates whether contents are informative or provides helpful guidance.\n *\n * @default 'help'\n */\n variant?: 'help' | 'info';\n /**\n * The placement of the popover with respect to the action button.\n *\n * @default 'bottom start'\n */\n placement?: Placement;\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a\n * total view.\n */\nexport const ContextualHelp = React.forwardRef(function ContextualHelp(\n props: SpectrumContextualHelpProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let {variant = 'help', placement = 'bottom start', children, ...otherProps} = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/contextualhelp');\n\n let icon = variant === 'info' ? <InfoOutline /> : <HelpOutline />;\n\n let slots = {\n content: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-content']},\n footer: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-footer']}\n };\n\n let labelProps = useLabels(otherProps, stringFormatter.format(variant));\n\n return (\n <DialogTrigger {...otherProps} type=\"popover\" placement={placement} hideArrow>\n <ActionButton\n {...mergeProps(otherProps, labelProps, {isDisabled: false})}\n ref={ref}\n UNSAFE_className={classNames(\n helpStyles,\n 'react-spectrum-ContextualHelp-button',\n otherProps.UNSAFE_className\n )}\n isQuiet>\n {icon}\n </ActionButton>\n <ClearSlots>\n <SlotProvider slots={slots}>\n <Dialog UNSAFE_className={classNames(helpStyles, 'react-spectrum-ContextualHelp-dialog')}>\n {children}\n </Dialog>\n </SlotProvider>\n </ClearSlots>\n </DialogTrigger>\n );\n});\n"],"names":[],"version":3,"file":"ContextualHelp.mjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AA0CM,MAAM,0DAAiB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,eACtD,KAAkC,EAClC,GAAoC;IAEpC,IAAI,WAAC,UAAU,mBAAQ,YAAY,0BAAgB,QAAQ,EAAE,GAAG,YAAW,GAAG;IAE9E,IAAI,kBAAkB,CAAA,GAAA,kCAA0B,EAAE,CAAA,GAAA,+CAAW,GAAG;IAEhE,IAAI,OAAO,YAAY,uBAAS,gCAAC,CAAA,GAAA,uCAAU,yBAAO,gCAAC,CAAA,GAAA,uCAAU;IAE7D,IAAI,QAAQ;QACV,SAAS;YAAC,kBAAkB,CAAA,GAAA,2DAAS,CAAC,CAAC,wCAAwC;QAAA;QAC/E,QAAQ;YAAC,kBAAkB,CAAA,GAAA,2DAAS,CAAC,CAAC,uCAAuC;QAAA;IAC/E;IAEA,IAAI,aAAa,CAAA,GAAA,gBAAQ,EAAE,YAAY,gBAAgB,MAAM,CAAC;IAE9D,qBACE,gCAAC,CAAA,GAAA,yCAAY;QAAG,GAAG,UAAU;QAAE,MAAK;QAAU,WAAW;QAAW,WAAA;qBAClE,gCAAC,CAAA,GAAA,yCAAW;QACT,GAAG,CAAA,GAAA,iBAAS,EAAE,YAAY,YAAY;YAAC,YAAY;QAAK,EAAE;QAC3D,KAAK;QACL,kBAAkB,CAAA,GAAA,yCAAS,EACzB,CAAA,GAAA,2DAAS,GACT,wCACA,WAAW,gBAAgB;QAE7B,SAAA;OACC,qBAEH,gCAAC,CAAA,GAAA,yCAAS,uBACR,gCAAC,CAAA,GAAA,yCAAW;QAAE,OAAO;qBACnB,gCAAC,CAAA,GAAA,yCAAK;QAAE,kBAAkB,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,2DAAS,GAAG;OAC9C;AAMb","sources":["packages/@adobe/react-spectrum/src/contextualhelp/ContextualHelp.tsx"],"sourcesContent":["/*\n * Copyright 2021 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 {ActionButton} from '../button/ActionButton';\n\nimport {AriaLabelingProps, DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {classNames} from '../utils/classNames';\nimport {ClearSlots, SlotProvider} from '../utils/Slots';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport HelpOutline from '@spectrum-icons/workflow/HelpOutline';\nimport helpStyles from '@adobe/spectrum-css-temp/components/contextualhelp/vars.css';\nimport InfoOutline from '@spectrum-icons/workflow/InfoOutline';\nimport intlMessages from '../../intl/contextualhelp/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {OverlayTriggerProps} from 'react-stately/useOverlayTriggerState';\nimport {Placement, PositionProps} from 'react-aria/useOverlayPosition';\nimport React, {ReactNode} from 'react';\nimport {useLabels} from 'react-aria/private/utils/useLabels';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\n\nexport interface SpectrumContextualHelpProps\n extends OverlayTriggerProps, PositionProps, StyleProps, DOMProps, AriaLabelingProps {\n /** Contents of the Contextual Help popover. */\n children: ReactNode;\n /**\n * Indicates whether contents are informative or provides helpful guidance.\n *\n * @default 'help'\n */\n variant?: 'help' | 'info';\n /**\n * The placement of the popover with respect to the action button.\n *\n * @default 'bottom start'\n */\n placement?: Placement;\n}\n\n/**\n * Contextual help shows a user extra information about the state of an adjacent component, or a\n * total view.\n */\nexport const ContextualHelp = React.forwardRef(function ContextualHelp(\n props: SpectrumContextualHelpProps,\n ref: FocusableRef<HTMLButtonElement>\n) {\n let {variant = 'help', placement = 'bottom start', children, ...otherProps} = props;\n\n let stringFormatter = useLocalizedStringFormatter(intlMessages, '@react-spectrum/contextualhelp');\n\n let icon = variant === 'info' ? <InfoOutline /> : <HelpOutline />;\n\n let slots = {\n content: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-content']},\n footer: {UNSAFE_className: helpStyles['react-spectrum-ContextualHelp-footer']}\n };\n\n let labelProps = useLabels(otherProps, stringFormatter.format(variant));\n\n return (\n <DialogTrigger {...otherProps} type=\"popover\" placement={placement} hideArrow>\n <ActionButton\n {...mergeProps(otherProps, labelProps, {isDisabled: false})}\n ref={ref}\n UNSAFE_className={classNames(\n helpStyles,\n 'react-spectrum-ContextualHelp-button',\n otherProps.UNSAFE_className\n )}\n isQuiet>\n {icon}\n </ActionButton>\n <ClearSlots>\n <SlotProvider slots={slots}>\n <Dialog UNSAFE_className={classNames(helpStyles, 'react-spectrum-ContextualHelp-dialog')}>\n {children}\n </Dialog>\n </SlotProvider>\n </ClearSlots>\n </DialogTrigger>\n );\n});\n"],"names":[],"version":3,"file":"ContextualHelp.mjs.map"}
@@ -3,28 +3,28 @@
3
3
  --spectrum-actionbutton-height: var(--spectrum-global-dimension-size-250);
4
4
  --spectrum-actionbutton-min-width: var(--spectrum-global-dimension-size-250);
5
5
  --spectrum-actionbutton-icon-padding-x: var(--spectrum-global-dimension-size-40);
6
- }
7
6
 
8
- .qJz8_W_react-spectrum-ContextualHelp-button svg {
9
- block-size: var(--spectrum-global-dimension-size-175);
10
- inline-size: var(--spectrum-global-dimension-size-175);
7
+ & svg {
8
+ block-size: var(--spectrum-global-dimension-size-175);
9
+ inline-size: var(--spectrum-global-dimension-size-175);
10
+ }
11
11
  }
12
12
 
13
13
  .qJz8_W_react-spectrum-ContextualHelp-dialog.qJz8_W_react-spectrum-ContextualHelp-dialog {
14
14
  --spectrum-dialog-padding-x: var(--spectrum-global-dimension-static-size-300, 24px);
15
15
  --spectrum-dialog-padding-y: var(--spectrum-global-dimension-static-size-300, 24px);
16
16
  width: 250px;
17
- }
18
17
 
19
- .qJz8_W_react-spectrum-ContextualHelp-dialog.qJz8_W_react-spectrum-ContextualHelp-dialog.qJz8_W_react-spectrum-ContextualHelp-dialog--isMobile {
20
- width: 100%;
21
- }
18
+ &.qJz8_W_react-spectrum-ContextualHelp-dialog--isMobile {
19
+ width: 100%;
20
+ }
22
21
 
23
- .qJz8_W_react-spectrum-ContextualHelp-dialog.qJz8_W_react-spectrum-ContextualHelp-dialog .qJz8_W_react-spectrum-ContextualHelp-content {
24
- margin-top: var(--spectrum-global-dimension-static-size-100, 8px);
25
- }
22
+ & .qJz8_W_react-spectrum-ContextualHelp-content {
23
+ margin-top: var(--spectrum-global-dimension-static-size-100, 8px);
24
+ }
26
25
 
27
- .qJz8_W_react-spectrum-ContextualHelp-dialog.qJz8_W_react-spectrum-ContextualHelp-dialog .qJz8_W_react-spectrum-ContextualHelp-footer {
28
- padding-top: var(--spectrum-global-dimension-static-size-100, 8px);
26
+ & .qJz8_W_react-spectrum-ContextualHelp-footer {
27
+ padding-top: var(--spectrum-global-dimension-static-size-100, 8px);
28
+ }
29
29
  }
30
30
  /*# sourceMappingURL=contextualhelp_vars.css.map */
@@ -1 +1 @@
1
- {"mappings":"AAwBA;;;;;;;AAME;;;;;AAMF;;;;;;AAKE;;;;AAGA;;;;AAIA","sources":["packages/@adobe/spectrum-css-temp/components/contextualhelp/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":"contextualhelp_vars.css.map"}
1
+ {"mappings":"AAwBA;;;;;;EAME;;;;;;AAMF;;;;;EAKE;;;;EAGA;;;;EAIA","sources":["packages/@adobe/spectrum-css-temp/components/contextualhelp/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":"contextualhelp_vars.css.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEM,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAAiC,EACjC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,aAAC,SAAS,WAAE,OAAO,cAAE,UAAU,oBAAE,gBAAgB,oBAAE,mBAAmB,GAAE,GAAG;IAC/E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAyB;IAC9C,IAAI,QAAQ,CAAA,GAAA,wD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BAC5B,0DAAC,CAAA,GAAA,qCAAU;QACR,GAAG,CAAA,GAAA,qCAAS,EAAE,aAAa,iBAAiB;QAC7C,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACrC,SAAS;QACT,iBAAiB;qBACjB,0DAAC,CAAA,GAAA,8DAAW,yBAEd,0DAAC,CAAA,GAAA,gCAAK;QACJ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QAC9C,GAAG,WAAW;qBACf,0DAAC,CAAA,GAAA,iCAAM,uBACL,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBACxC,0DAAC,CAAA,GAAA,kCAAO;QACL,GAAG,aAAa;QACjB,eAAe;QACf,gBAAgB,MAAM,cAAc;QACpC,kBAAkB,CAAA,GAAA,oCAAS,EACzB,CAAA,GAAA,mDAAe,GACf,sCACA;YAAC,cAAc;QAAS;QAG3B,+BACC,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAe,GACf;qBAEF,0DAAC,CAAA,GAAA,mCAAQ;QACP,OAAO,gBAAgB,MAAM,CAAC;QAC9B,OAAO,MAAM,SAAS;QACtB,UAAU,MAAM,YAAY;QAC5B,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,WAAU;;AAWhC","sources":["packages/@adobe/react-spectrum/src/datepicker/DatePicker.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 {AriaDatePickerProps, DateValue, useDatePicker} from 'react-aria/useDatePicker';\n\nimport {Calendar} from '../calendar/Calendar';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {CalendarIdentifier, Calendar as ICalendar} from '@internationalized/date';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {FocusableRef, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\n// @ts-ignore\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDateFieldBase} from './DateField';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css'; // HACK: must be included BEFORE inputgroup\nimport {TimeField} from './TimeField';\nimport {useDatePickerState} from 'react-stately/useDatePickerState';\nimport '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDatePickerBase<T extends DateValue>\n extends SpectrumDateFieldBase<T>, SpectrumLabelableProps, StyleProps {\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n /**\n * Whether the calendar popover should automatically flip direction when space is limited.\n *\n * @default true\n */\n shouldFlip?: boolean;\n /**\n * A function to create a new\n * [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a\n * given calendar identifier. This will be used for the popover calendar. If not provided, the\n * `createCalendar` function from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n}\n\nexport interface SpectrumDatePickerProps<T extends DateValue>\n extends\n Omit<AriaDatePickerProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n SpectrumDatePickerBase<T> {}\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = React.forwardRef(function DatePicker<T extends DateValue>(\n props: SpectrumDatePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {autoFocus, isQuiet, isDisabled, placeholderValue, maxVisibleMonths = 1} = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDatePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {\n groupProps,\n labelProps,\n fieldProps,\n descriptionProps,\n errorMessageProps,\n buttonProps,\n dialogProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useDatePicker(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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\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 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 {...fieldProps} data-testid=\"date-field\" isQuiet={isQuiet} />\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <Calendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': isInvalid}\n )}\n />\n {showTimeField && (\n <div\n className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\n <TimeField\n label={stringFormatter.format('time')}\n value={state.timeValue}\n onChange={state.setTimeValue}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n marginTop=\"size-100\"\n />\n </div>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDatePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"DatePicker.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEM,MAAM,0DAAa,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAAiC,EACjC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,aAAC,SAAS,WAAE,OAAO,cAAE,UAAU,oBAAE,gBAAgB,oBAAE,mBAAmB,GAAE,GAAG;IAC/E,IAAI,cAAC,UAAU,aAAE,SAAS,E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AAY;QACX,MAAK;QACL,YAAW;QACX,WAAW,cAAc,QAAQ,iBAAiB;QAClD,WAAW;QACX,WAAA;QACA,QAAQ;QACR,cAAc;QACd,YAAY,MAAM,UAAU;qBAC5B,0DAAC,CAAA,GAAA,qCAAU;QACR,GAAG,CAAA,GAAA,qCAAS,EAAE,aAAa,iBAAiB;QAC7C,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;QACrC,SAAS;QACT,iBAAiB;qBACjB,0DAAC,CAAA,GAAA,8DAAW,yBAEd,0DAAC,CAAA,GAAA,gCAAK;QACJ,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;QAC9C,GAAG,WAAW;qBACf,0DAAC,CAAA,GAAA,iCAAM,uBACL,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;qBACxC,0DAAC,CAAA,GAAA,kCAAO;QACL,GAAG,aAAa;QACjB,eAAe;QACf,gBAAgB,MAAM,cAAc;QACpC,kBAAkB,CAAA,GAAA,oCAAS,EACzB,CAAA,GAAA,mDAAe,GACf,sCACA;YAAC,cAAc;QAAS;QAG3B,+BACC,0DAAC;QACC,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAe,GACf;qBAEF,0DAAC,CAAA,GAAA,mCAAQ;QACP,OAAO,gBAAgB,MAAM,CAAC;QAC9B,OAAO,MAAM,SAAS;QACtB,UAAU,MAAM,YAAY;QAC5B,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,WAAU;;AAWhC","sources":["packages/@adobe/react-spectrum/src/datepicker/DatePicker.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 {AriaDatePickerProps, DateValue, useDatePicker} from 'react-aria/useDatePicker';\nimport {Calendar} from '../calendar/Calendar';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {CalendarIdentifier, Calendar as ICalendar} from '@internationalized/date';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {FocusableRef, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDateFieldBase} from './DateField';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css'; // HACK: must be included BEFORE inputgroup\nimport {TimeField} from './TimeField';\nimport {useDatePickerState} from 'react-stately/useDatePickerState';\nimport '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDatePickerBase<T extends DateValue>\n extends SpectrumDateFieldBase<T>, SpectrumLabelableProps, StyleProps {\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n /**\n * Whether the calendar popover should automatically flip direction when space is limited.\n *\n * @default true\n */\n shouldFlip?: boolean;\n /**\n * A function to create a new\n * [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a\n * given calendar identifier. This will be used for the popover calendar. If not provided, the\n * `createCalendar` function from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n}\n\nexport interface SpectrumDatePickerProps<T extends DateValue>\n extends\n Omit<AriaDatePickerProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n SpectrumDatePickerBase<T> {}\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = React.forwardRef(function DatePicker<T extends DateValue>(\n props: SpectrumDatePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {autoFocus, isQuiet, isDisabled, placeholderValue, maxVisibleMonths = 1} = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDatePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {\n groupProps,\n labelProps,\n fieldProps,\n descriptionProps,\n errorMessageProps,\n buttonProps,\n dialogProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useDatePicker(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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\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 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 {...fieldProps} data-testid=\"date-field\" isQuiet={isQuiet} />\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <Calendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': isInvalid}\n )}\n />\n {showTimeField && (\n <div\n className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\n <TimeField\n label={stringFormatter.format('time')}\n value={state.timeValue}\n onChange={state.setTimeValue}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n marginTop=\"size-100\"\n />\n </div>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDatePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"DatePicker.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;AAwEM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,WAClD,KAAiC,EACjC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI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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 {AriaDatePickerProps, DateValue, useDatePicker} from 'react-aria/useDatePicker';\n\nimport {Calendar} from '../calendar/Calendar';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {CalendarIdentifier, Calendar as ICalendar} from '@internationalized/date';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {FocusableRef, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\n// @ts-ignore\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDateFieldBase} from './DateField';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css'; // HACK: must be included BEFORE inputgroup\nimport {TimeField} from './TimeField';\nimport {useDatePickerState} from 'react-stately/useDatePickerState';\nimport '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDatePickerBase<T extends DateValue>\n extends SpectrumDateFieldBase<T>, SpectrumLabelableProps, StyleProps {\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n /**\n * Whether the calendar popover should automatically flip direction when space is limited.\n *\n * @default true\n */\n shouldFlip?: boolean;\n /**\n * A function to create a new\n * [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a\n * given calendar identifier. This will be used for the popover calendar. If not provided, the\n * `createCalendar` function from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n}\n\nexport interface SpectrumDatePickerProps<T extends DateValue>\n extends\n Omit<AriaDatePickerProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n SpectrumDatePickerBase<T> {}\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = React.forwardRef(function DatePicker<T extends DateValue>(\n props: SpectrumDatePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {autoFocus, isQuiet, isDisabled, placeholderValue, maxVisibleMonths = 1} = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDatePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {\n groupProps,\n labelProps,\n fieldProps,\n descriptionProps,\n errorMessageProps,\n buttonProps,\n dialogProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useDatePicker(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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\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 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 {...fieldProps} data-testid=\"date-field\" isQuiet={isQuiet} />\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <Calendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': isInvalid}\n )}\n />\n {showTimeField && (\n <div\n className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\n <TimeField\n label={stringFormatter.format('time')}\n value={state.timeValue}\n onChange={state.setTimeValue}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n marginTop=\"size-100\"\n />\n </div>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDatePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"DatePicker.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;AAsEM,MAAM,0DAAa,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,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,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,WAAU;;AAWhC","sources":["packages/@adobe/react-spectrum/src/datepicker/DatePicker.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 {AriaDatePickerProps, DateValue, useDatePicker} from 'react-aria/useDatePicker';\nimport {Calendar} from '../calendar/Calendar';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {CalendarIdentifier, Calendar as ICalendar} from '@internationalized/date';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {FocusableRef, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDateFieldBase} from './DateField';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css'; // HACK: must be included BEFORE inputgroup\nimport {TimeField} from './TimeField';\nimport {useDatePickerState} from 'react-stately/useDatePickerState';\nimport '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDatePickerBase<T extends DateValue>\n extends SpectrumDateFieldBase<T>, SpectrumLabelableProps, StyleProps {\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n /**\n * Whether the calendar popover should automatically flip direction when space is limited.\n *\n * @default true\n */\n shouldFlip?: boolean;\n /**\n * A function to create a new\n * [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a\n * given calendar identifier. This will be used for the popover calendar. If not provided, the\n * `createCalendar` function from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n}\n\nexport interface SpectrumDatePickerProps<T extends DateValue>\n extends\n Omit<AriaDatePickerProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n SpectrumDatePickerBase<T> {}\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = React.forwardRef(function DatePicker<T extends DateValue>(\n props: SpectrumDatePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {autoFocus, isQuiet, isDisabled, placeholderValue, maxVisibleMonths = 1} = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDatePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {\n groupProps,\n labelProps,\n fieldProps,\n descriptionProps,\n errorMessageProps,\n buttonProps,\n dialogProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useDatePicker(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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\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 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 {...fieldProps} data-testid=\"date-field\" isQuiet={isQuiet} />\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <Calendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': isInvalid}\n )}\n />\n {showTimeField && (\n <div\n className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\n <TimeField\n label={stringFormatter.format('time')}\n value={state.timeValue}\n onChange={state.setTimeValue}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n marginTop=\"size-100\"\n />\n </div>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDatePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"DatePicker.js.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;A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QAC9B,OAAO,MAAM,SAAS;QACtB,UAAU,MAAM,YAAY;QAC5B,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,WAAU;;AAWhC","sources":["packages/@adobe/react-spectrum/src/datepicker/DatePicker.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 {AriaDatePickerProps, DateValue, useDatePicker} from 'react-aria/useDatePicker';\n\nimport {Calendar} from '../calendar/Calendar';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {CalendarIdentifier, Calendar as ICalendar} from '@internationalized/date';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {FocusableRef, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\n// @ts-ignore\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDateFieldBase} from './DateField';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css'; // HACK: must be included BEFORE inputgroup\nimport {TimeField} from './TimeField';\nimport {useDatePickerState} from 'react-stately/useDatePickerState';\nimport '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDatePickerBase<T extends DateValue>\n extends SpectrumDateFieldBase<T>, SpectrumLabelableProps, StyleProps {\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n /**\n * Whether the calendar popover should automatically flip direction when space is limited.\n *\n * @default true\n */\n shouldFlip?: boolean;\n /**\n * A function to create a new\n * [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a\n * given calendar identifier. This will be used for the popover calendar. If not provided, the\n * `createCalendar` function from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n}\n\nexport interface SpectrumDatePickerProps<T extends DateValue>\n extends\n Omit<AriaDatePickerProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n SpectrumDatePickerBase<T> {}\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = React.forwardRef(function DatePicker<T extends DateValue>(\n props: SpectrumDatePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {autoFocus, isQuiet, isDisabled, placeholderValue, maxVisibleMonths = 1} = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDatePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {\n groupProps,\n labelProps,\n fieldProps,\n descriptionProps,\n errorMessageProps,\n buttonProps,\n dialogProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useDatePicker(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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\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 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 {...fieldProps} data-testid=\"date-field\" isQuiet={isQuiet} />\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <Calendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': isInvalid}\n )}\n />\n {showTimeField && (\n <div\n className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\n <TimeField\n label={stringFormatter.format('time')}\n value={state.timeValue}\n onChange={state.setTimeValue}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n marginTop=\"size-100\"\n />\n </div>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDatePickerProps<T> & {ref?: Focusable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W,CAAA,GAAA,yCAAS,EAClB,CAAA,GAAA,8CAAe,GACf;qBAEF,gCAAC,CAAA,GAAA,yCAAQ;QACP,OAAO,gBAAgB,MAAM,CAAC;QAC9B,OAAO,MAAM,SAAS;QACtB,UAAU,MAAM,YAAY;QAC5B,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,WAAU;;AAWhC","sources":["packages/@adobe/react-spectrum/src/datepicker/DatePicker.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 {AriaDatePickerProps, DateValue, useDatePicker} from 'react-aria/useDatePicker';\nimport {Calendar} from '../calendar/Calendar';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {CalendarIdentifier, Calendar as ICalendar} from '@internationalized/date';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {FocusableRef, SpectrumLabelableProps, StyleProps} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDateFieldBase} from './DateField';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css'; // HACK: must be included BEFORE inputgroup\nimport {TimeField} from './TimeField';\nimport {useDatePickerState} from 'react-stately/useDatePickerState';\nimport '@adobe/spectrum-css-temp/components/textfield/vars.css';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDatePickerBase<T extends DateValue>\n extends SpectrumDateFieldBase<T>, SpectrumLabelableProps, StyleProps {\n /**\n * The maximum number of months to display at once in the calendar popover, if screen space\n * permits.\n *\n * @default 1\n */\n maxVisibleMonths?: number;\n /**\n * Whether the calendar popover should automatically flip direction when space is limited.\n *\n * @default true\n */\n shouldFlip?: boolean;\n /**\n * A function to create a new\n * [Calendar](https://react-spectrum.adobe.com/internationalized/date/Calendar.html) object for a\n * given calendar identifier. This will be used for the popover calendar. If not provided, the\n * `createCalendar` function from `@internationalized/date` will be used.\n */\n createCalendar?: (identifier: CalendarIdentifier) => ICalendar;\n}\n\nexport interface SpectrumDatePickerProps<T extends DateValue>\n extends\n Omit<AriaDatePickerProps<T>, 'isInvalid' | 'validationState' | 'autoComplete'>,\n SpectrumDatePickerBase<T> {}\n\n/**\n * DatePickers combine a DateField and a Calendar popover to allow users to enter or select a date\n * and time value.\n */\nexport const DatePicker = React.forwardRef(function DatePicker<T extends DateValue>(\n props: SpectrumDatePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {autoFocus, isQuiet, isDisabled, placeholderValue, maxVisibleMonths = 1} = props;\n let {hoverProps, isHovered} = useHover({isDisabled});\n let targetRef = useRef<HTMLDivElement | null>(null);\n let state = useDatePickerState({\n ...props,\n shouldCloseOnSelect: () => !state.hasTime\n });\n let {\n groupProps,\n labelProps,\n fieldProps,\n descriptionProps,\n errorMessageProps,\n buttonProps,\n dialogProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = useDatePicker(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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : null;\n let showTimeField = !!timeGranularity;\n\n let visibleMonths = useVisibleMonths(maxVisibleMonths);\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 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 {...fieldProps} data-testid=\"date-field\" isQuiet={isQuiet} />\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <Calendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': isInvalid}\n )}\n />\n {showTimeField && (\n <div\n className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\n <TimeField\n label={stringFormatter.format('time')}\n value={state.timeValue}\n onChange={state.setTimeValue}\n placeholderValue={timePlaceholder}\n granularity={timeGranularity}\n minValue={timeMinValue}\n maxValue={timeMaxValue}\n hourCycle={props.hourCycle}\n hideTimeZone={props.hideTimeZone}\n marginTop=\"size-100\"\n />\n </div>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDatePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n"],"names":[],"version":3,"file":"DatePicker.mjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDM,MAAM,0DAAkB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,gBACvD,KAAsC,EACtC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,WAAC,OAAO,cAAE,UAAU,aAAE,SAAS,oBAAE,gBAAgB,oBAAE,mBAAmB,GAAE,GAAG;IAC/E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAyB;IAC9C,IAAI,QAAQ,CAAA,GAAA,kEAAsB,EAAE;QAClC,GAAG,KAAK;QACR,qBAAqB,IAAM,CAAC,MAAM,OAAO;IAC3C;IACA,IAAI,cACF,UAAU,cACV,UAAU,eACV,WAAW,eACX,WAAW,mBACX,eAAe,iBACf,aAAa,oBACb,gBAAgB,qBAChB,iBAAiB,iBACjB,aAAa,aACb,SAAS,oBACT,gBAAgB,qBAChB,iBAAiB,EAClB,GAAG,CAAA,GAAA,qDAAiB,EAAE,OAAO,OAAO;IACrC,IAAI,UAAC,MAAM,WAAE,OAAO,EAAC,GAAG;IACxB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,sCAAQ;IAC1B,IAAI,SAAS,CAAA,GAAA,4CAAiB,EAAE;IAChC,IAAI,kBAAkB,CAAA,GAAA,uEAA0B,EAAE,CAAA,GAAA,mDAAW,GAAG;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;QACZ,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;;AAG9C","sources":["packages/@adobe/react-spectrum/src/datepicker/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 {\n AriaDateRangePickerProps,\n DateValue,\n useDateRangePicker\n} from 'react-aria/useDateRangePicker';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {Flex} from '../layout/Flex';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\n// @ts-ignore\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {RangeCalendar} from '../calendar/RangeCalendar';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDatePickerBase} from './DatePicker';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePickerState} from 'react-stately/useDateRangePickerState';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDateRangePickerProps<T extends DateValue>\n extends\n Omit<AriaDateRangePickerProps<T>, 'isInvalid' | 'validationState'>,\n Omit<SpectrumDatePickerBase<T>, 'validate'> {}\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 */\nexport const DateRangePicker = React.forwardRef(function DateRangePicker<T extends DateValue>(\n props: SpectrumDateRangePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {isQuiet, isDisabled, autoFocus, placeholderValue, maxVisibleMonths = 1} = 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 {\n labelProps,\n groupProps,\n buttonProps,\n dialogProps,\n startFieldProps,\n endFieldProps,\n descriptionProps,\n errorMessageProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = 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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : 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 <div style={{overflow: 'hidden', width: '100%'}}>\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 />\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(datepickerStyles, 'react-spectrum-Datepicker-endField')\n )}\n />\n </Input>\n </div>\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': validationState === 'invalid'}\n )}\n />\n {showTimeField && (\n <Flex\n gap=\"size-100\"\n marginTop=\"size-100\"\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\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 />\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 />\n </Flex>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n\nfunction DateRangeDash() {\n return (\n <span\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')}\n />\n );\n}\n"],"names":[],"version":3,"file":"DateRangePicker.cjs.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDM,MAAM,0DAAkB,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,gBACvD,KAAsC,EACtC,GAA8B;IAE9B,QAAQ,CAAA,GAAA,0CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE;IACrB,IAAI,WAAC,OAAO,cAAE,UAAU,aAAE,SAAS,oBAAE,gBAAgB,oBAAE,mBAAmB,GAAE,GAAG;IAC/E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,iCAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,mBAAK,EAAyB;IAC9C,IAAI,QAAQ,CAAA,GAAA,kEAAsB,EAAE;QAClC,GAAG,KAAK;QACR,qBAAqB,IAAM,CAAC,MAAM,OAAO;IAC3C;IACA,IAAI,cACF,UAAU,cACV,UAAU,eACV,WAAW,eACX,WAAW,mBACX,eAAe,iBACf,aAAa,oBACb,gBAAgB,qBAChB,iBAAiB,iBACjB,aAAa,aACb,SAAS,oBACT,gBAAgB,qBAChB,iBAAiB,EAClB,GAAG,CAAA,GAAA,qDAAiB,EAAE,OAAO,OAAO;IACrC,IAAI,UAAC,MAAM,WAAE,OAAO,EAAC,GAAG;IACxB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,sCAAQ;IAC1B,IAAI,SAAS,CAAA,GAAA,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;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;;AAWtB;AAIA,SAAS;IACP,qBACE,0DAAC;QACC,eAAY;QACZ,eAAY;QACZ,WAAW,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAe,GAAG;;AAG9C","sources":["packages/@adobe/react-spectrum/src/datepicker/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 {\n AriaDateRangePickerProps,\n DateValue,\n useDateRangePicker\n} from 'react-aria/useDateRangePicker';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {Flex} from '../layout/Flex';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {RangeCalendar} from '../calendar/RangeCalendar';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDatePickerBase} from './DatePicker';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePickerState} from 'react-stately/useDateRangePickerState';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDateRangePickerProps<T extends DateValue>\n extends\n Omit<AriaDateRangePickerProps<T>, 'isInvalid' | 'validationState'>,\n Omit<SpectrumDatePickerBase<T>, 'validate'> {}\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 */\nexport const DateRangePicker = React.forwardRef(function DateRangePicker<T extends DateValue>(\n props: SpectrumDateRangePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {isQuiet, isDisabled, autoFocus, placeholderValue, maxVisibleMonths = 1} = 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 {\n labelProps,\n groupProps,\n buttonProps,\n dialogProps,\n startFieldProps,\n endFieldProps,\n descriptionProps,\n errorMessageProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = 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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : 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 <div style={{overflow: 'hidden', width: '100%'}}>\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 />\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(datepickerStyles, 'react-spectrum-Datepicker-endField')\n )}\n />\n </Input>\n </div>\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': validationState === 'invalid'}\n )}\n />\n {showTimeField && (\n <Flex\n gap=\"size-100\"\n marginTop=\"size-100\"\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\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 />\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 />\n </Flex>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n\nfunction DateRangeDash() {\n return (\n <span\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')}\n />\n );\n}\n"],"names":[],"version":3,"file":"DateRangePicker.cjs.map"}
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;AAkDM,MAAM,0DAAkB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,gBACvD,KAAsC,EACtC,GAA8B;QAuKH,kBAYA;IAjL3B,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,WAAC,OAAO,cAAE,UAAU,aAAE,SAAS,oBAAE,gBAAgB,oBAAE,mBAAmB,GAAE,GAAG;IAC/E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAyB;IAC9C,IAAI,QAAQ,CAAA,GAAA,8BAAsB,EAAE;QAClC,GAAG,KAAK;QACR,qBAAqB,IAAM,CAAC,MAAM,OAAO;IAC3C;IACA,IAAI,cACF,UAAU,cACV,UAAU,eACV,WAAW,eACX,WAAW,mBACX,eAAe,iBACf,aAAa,oBACb,gBAAgB,qBAChB,iBAAiB,iBACjB,aAAa,aACb,SAAS,oBACT,gBAAgB,qBAChB,iBAAiB,EAClB,GAAG,CAAA,GAAA,yBAAiB,EAAE,OAAO,OAAO;IACrC,IAAI,UAAC,MAAM,WAAE,OAAO,EAAC,G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AM,SAAS,cAAf,wCAAA,kBAAiB,GAAG,KAAI;QAC/B,UAAU,CAAA,IAAK,MAAM,OAAO,CAAC,OAAO;QACpC,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;;AAWtB;AAIA,SAAS;IACP,qBACE,gCAAC;QACC,eAAY;QACZ,eAAY;QACZ,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,8CAAe,GAAG;;AAG9C","sources":["packages/@adobe/react-spectrum/src/datepicker/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 {\n AriaDateRangePickerProps,\n DateValue,\n useDateRangePicker\n} from 'react-aria/useDateRangePicker';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {Flex} from '../layout/Flex';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\n// @ts-ignore\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {RangeCalendar} from '../calendar/RangeCalendar';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDatePickerBase} from './DatePicker';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePickerState} from 'react-stately/useDateRangePickerState';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDateRangePickerProps<T extends DateValue>\n extends\n Omit<AriaDateRangePickerProps<T>, 'isInvalid' | 'validationState'>,\n Omit<SpectrumDatePickerBase<T>, 'validate'> {}\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 */\nexport const DateRangePicker = React.forwardRef(function DateRangePicker<T extends DateValue>(\n props: SpectrumDateRangePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {isQuiet, isDisabled, autoFocus, placeholderValue, maxVisibleMonths = 1} = 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 {\n labelProps,\n groupProps,\n buttonProps,\n dialogProps,\n startFieldProps,\n endFieldProps,\n descriptionProps,\n errorMessageProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = 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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : 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 <div style={{overflow: 'hidden', width: '100%'}}>\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 />\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(datepickerStyles, 'react-spectrum-Datepicker-endField')\n )}\n />\n </Input>\n </div>\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': validationState === 'invalid'}\n )}\n />\n {showTimeField && (\n <Flex\n gap=\"size-100\"\n marginTop=\"size-100\"\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\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 />\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 />\n </Flex>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n\nfunction DateRangeDash() {\n return (\n <span\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')}\n />\n );\n}\n"],"names":[],"version":3,"file":"DateRangePicker.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDM,MAAM,0DAAkB,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,gBACvD,KAAsC,EACtC,GAA8B;QAuKH,kBAYA;IAjL3B,QAAQ,CAAA,GAAA,yCAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,yCAAW,EAAE;IACrB,IAAI,WAAC,OAAO,cAAE,UAAU,aAAE,SAAS,oBAAE,gBAAgB,oBAAE,mBAAmB,GAAE,GAAG;IAC/E,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,YAAY,CAAA,GAAA,aAAK,EAAyB;IAC9C,IAAI,QAAQ,CAAA,GAAA,8BAAsB,EAAE;QAClC,GAAG,KAAK;QACR,qBAAqB,IAAM,CAAC,MAAM,OAAO;IAC3C;IACA,IAAI,cACF,UAAU,cACV,UAAU,eACV,WAAW,eACX,WAAW,mBACX,eAAe,iBACf,aAAa,oBACb,gBAAgB,qBACh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AU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;sBAEF,gCAAC,CAAA,GAAA,yCAAQ;QACP,OAAO,gBAAgB,MAAM,CAAC;QAC9B,OAAO,EAAA,oBAAA,MAAM,SAAS,cAAf,wCAAA,kBAAiB,GAAG,KAAI;QAC/B,UAAU,CAAA,IAAK,MAAM,OAAO,CAAC,OAAO;QACpC,kBAAkB;QAClB,aAAa;QACb,UAAU;QACV,UAAU;QACV,WAAW,MAAM,SAAS;QAC1B,cAAc,MAAM,YAAY;QAChC,MAAA;;AAWtB;AAIA,SAAS;IACP,qBACE,gCAAC;QACC,eAAY;QACZ,eAAY;QACZ,WAAW,CAAA,GAAA,yCAAS,EAAE,CAAA,GAAA,8CAAe,GAAG;;AAG9C","sources":["packages/@adobe/react-spectrum/src/datepicker/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 {\n AriaDateRangePickerProps,\n DateValue,\n useDateRangePicker\n} from 'react-aria/useDateRangePicker';\nimport CalendarIcon from '@spectrum-icons/workflow/Calendar';\nimport {classNames} from '../utils/classNames';\nimport {Content} from '../view/Content';\nimport {DatePickerField} from './DatePickerField';\nimport datepickerStyles from './styles.css';\nimport {Dialog} from '../dialog/Dialog';\nimport {DialogTrigger} from '../dialog/DialogTrigger';\nimport {Field} from '../label/Field';\nimport {FieldButton} from '../button/FieldButton';\nimport {Flex} from '../layout/Flex';\nimport {FocusableRef} from '@react-types/shared';\nimport {Input} from './Input';\nimport intlMessages from '../../intl/datepicker/*.json';\nimport {mergeProps} from 'react-aria/mergeProps';\nimport {RangeCalendar} from '../calendar/RangeCalendar';\nimport React, {ReactElement, useRef} from 'react';\nimport {SpectrumDatePickerBase} from './DatePicker';\nimport styles from '@adobe/spectrum-css-temp/components/inputgroup/vars.css';\nimport {TimeField} from './TimeField';\nimport {useDateRangePickerState} from 'react-stately/useDateRangePickerState';\nimport {\n useFocusManagerRef,\n useFormatHelpText,\n useFormattedDateWidth,\n useVisibleMonths\n} from './utils';\nimport {useFocusRing} from 'react-aria/useFocusRing';\nimport {useFormProps} from '../form/Form';\nimport {useHover} from 'react-aria/useHover';\nimport {useLocale} from 'react-aria/I18nProvider';\nimport {useLocalizedStringFormatter} from 'react-aria/useLocalizedStringFormatter';\nimport {useProviderProps} from '../provider/Provider';\n\nexport interface SpectrumDateRangePickerProps<T extends DateValue>\n extends\n Omit<AriaDateRangePickerProps<T>, 'isInvalid' | 'validationState'>,\n Omit<SpectrumDatePickerBase<T>, 'validate'> {}\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 */\nexport const DateRangePicker = React.forwardRef(function DateRangePicker<T extends DateValue>(\n props: SpectrumDateRangePickerProps<T>,\n ref: FocusableRef<HTMLElement>\n) {\n props = useProviderProps(props);\n props = useFormProps(props);\n let {isQuiet, isDisabled, autoFocus, placeholderValue, maxVisibleMonths = 1} = 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 {\n labelProps,\n groupProps,\n buttonProps,\n dialogProps,\n startFieldProps,\n endFieldProps,\n descriptionProps,\n errorMessageProps,\n calendarProps,\n isInvalid,\n validationErrors,\n validationDetails\n } = 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(styles, 'spectrum-InputGroup', {\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 let fieldClassName = classNames(styles, 'spectrum-InputGroup-input', {\n 'is-disabled': isDisabled,\n 'is-invalid': isInvalid && !isDisabled\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 =\n state.granularity === 'hour' || state.granularity === 'minute' || state.granularity === 'second'\n ? state.granularity\n : 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 <div style={{overflow: 'hidden', width: '100%'}}>\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 />\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(datepickerStyles, 'react-spectrum-Datepicker-endField')\n )}\n />\n </Input>\n </div>\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\n UNSAFE_className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialog')}\n {...dialogProps}>\n <Content>\n <div\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-dialogContent')}>\n <RangeCalendar\n {...calendarProps}\n visibleMonths={visibleMonths}\n createCalendar={props.createCalendar}\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-calendar',\n {'is-invalid': validationState === 'invalid'}\n )}\n />\n {showTimeField && (\n <Flex\n gap=\"size-100\"\n marginTop=\"size-100\"\n UNSAFE_className={classNames(\n datepickerStyles,\n 'react-spectrum-Datepicker-timeFields'\n )}>\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 />\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 />\n </Flex>\n )}\n </div>\n </Content>\n </Dialog>\n </DialogTrigger>\n </div>\n </Field>\n );\n}) as <T extends DateValue>(\n props: SpectrumDateRangePickerProps<T> & {ref?: FocusableRef<HTMLElement>}\n) => ReactElement;\n\nfunction DateRangeDash() {\n return (\n <span\n aria-hidden=\"true\"\n data-testid=\"date-range-dash\"\n className={classNames(datepickerStyles, 'react-spectrum-Datepicker-rangeDash')}\n />\n );\n}\n"],"names":[],"version":3,"file":"DateRangePicker.js.map"}