react-aria-components 1.12.2 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (162) hide show
  1. package/dist/Autocomplete.main.js +3 -3
  2. package/dist/Autocomplete.main.js.map +1 -1
  3. package/dist/Autocomplete.mjs +3 -3
  4. package/dist/Autocomplete.module.js +3 -3
  5. package/dist/Autocomplete.module.js.map +1 -1
  6. package/dist/Button.main.js +5 -11
  7. package/dist/Button.main.js.map +1 -1
  8. package/dist/Button.mjs +5 -11
  9. package/dist/Button.module.js +5 -11
  10. package/dist/Button.module.js.map +1 -1
  11. package/dist/DateField.main.js +12 -8
  12. package/dist/DateField.main.js.map +1 -1
  13. package/dist/DateField.mjs +12 -8
  14. package/dist/DateField.module.js +12 -8
  15. package/dist/DateField.module.js.map +1 -1
  16. package/dist/DatePicker.main.js +6 -2
  17. package/dist/DatePicker.main.js.map +1 -1
  18. package/dist/DatePicker.mjs +6 -2
  19. package/dist/DatePicker.module.js +6 -2
  20. package/dist/DatePicker.module.js.map +1 -1
  21. package/dist/GridList.main.js +24 -21
  22. package/dist/GridList.main.js.map +1 -1
  23. package/dist/GridList.mjs +25 -23
  24. package/dist/GridList.module.js +25 -23
  25. package/dist/GridList.module.js.map +1 -1
  26. package/dist/Group.main.js +3 -2
  27. package/dist/Group.main.js.map +1 -1
  28. package/dist/Group.mjs +3 -2
  29. package/dist/Group.module.js +3 -2
  30. package/dist/Group.module.js.map +1 -1
  31. package/dist/Input.main.js.map +1 -1
  32. package/dist/Input.module.js.map +1 -1
  33. package/dist/ListBox.main.js +14 -4
  34. package/dist/ListBox.main.js.map +1 -1
  35. package/dist/ListBox.mjs +14 -4
  36. package/dist/ListBox.module.js +14 -4
  37. package/dist/ListBox.module.js.map +1 -1
  38. package/dist/Menu.main.js +16 -6
  39. package/dist/Menu.main.js.map +1 -1
  40. package/dist/Menu.mjs +16 -6
  41. package/dist/Menu.module.js +16 -6
  42. package/dist/Menu.module.js.map +1 -1
  43. package/dist/Modal.main.js +9 -1
  44. package/dist/Modal.main.js.map +1 -1
  45. package/dist/Modal.mjs +10 -2
  46. package/dist/Modal.module.js +10 -2
  47. package/dist/Modal.module.js.map +1 -1
  48. package/dist/NumberField.main.js +2 -1
  49. package/dist/NumberField.main.js.map +1 -1
  50. package/dist/NumberField.mjs +2 -1
  51. package/dist/NumberField.module.js +2 -1
  52. package/dist/NumberField.module.js.map +1 -1
  53. package/dist/ProgressBar.main.js.map +1 -1
  54. package/dist/ProgressBar.module.js.map +1 -1
  55. package/dist/RSPContexts.main.js +4 -0
  56. package/dist/RSPContexts.main.js.map +1 -1
  57. package/dist/RSPContexts.mjs +3 -1
  58. package/dist/RSPContexts.module.js +3 -1
  59. package/dist/RSPContexts.module.js.map +1 -1
  60. package/dist/RadioGroup.main.js +10 -2
  61. package/dist/RadioGroup.main.js.map +1 -1
  62. package/dist/RadioGroup.mjs +10 -2
  63. package/dist/RadioGroup.module.js +10 -2
  64. package/dist/RadioGroup.module.js.map +1 -1
  65. package/dist/SearchField.main.js +2 -2
  66. package/dist/SearchField.main.js.map +1 -1
  67. package/dist/SearchField.mjs +2 -2
  68. package/dist/SearchField.module.js +2 -2
  69. package/dist/SearchField.module.js.map +1 -1
  70. package/dist/Select.main.js +62 -22
  71. package/dist/Select.main.js.map +1 -1
  72. package/dist/Select.mjs +65 -25
  73. package/dist/Select.module.js +65 -25
  74. package/dist/Select.module.js.map +1 -1
  75. package/dist/SelectionIndicator.main.js +45 -0
  76. package/dist/SelectionIndicator.main.js.map +1 -0
  77. package/dist/SelectionIndicator.mjs +35 -0
  78. package/dist/SelectionIndicator.module.js +35 -0
  79. package/dist/SelectionIndicator.module.js.map +1 -0
  80. package/dist/SharedElementTransition.main.js +139 -0
  81. package/dist/SharedElementTransition.main.js.map +1 -0
  82. package/dist/SharedElementTransition.mjs +129 -0
  83. package/dist/SharedElementTransition.module.js +129 -0
  84. package/dist/SharedElementTransition.module.js.map +1 -0
  85. package/dist/Table.main.js +16 -11
  86. package/dist/Table.main.js.map +1 -1
  87. package/dist/Table.mjs +17 -12
  88. package/dist/Table.module.js +17 -12
  89. package/dist/Table.module.js.map +1 -1
  90. package/dist/Tabs.main.js +11 -3
  91. package/dist/Tabs.main.js.map +1 -1
  92. package/dist/Tabs.mjs +11 -3
  93. package/dist/Tabs.module.js +11 -3
  94. package/dist/Tabs.module.js.map +1 -1
  95. package/dist/TagGroup.main.js +28 -16
  96. package/dist/TagGroup.main.js.map +1 -1
  97. package/dist/TagGroup.mjs +28 -16
  98. package/dist/TagGroup.module.js +28 -16
  99. package/dist/TagGroup.module.js.map +1 -1
  100. package/dist/TextField.main.js +2 -2
  101. package/dist/TextField.main.js.map +1 -1
  102. package/dist/TextField.mjs +2 -2
  103. package/dist/TextField.module.js +2 -2
  104. package/dist/TextField.module.js.map +1 -1
  105. package/dist/ToggleButton.main.js +7 -1
  106. package/dist/ToggleButton.main.js.map +1 -1
  107. package/dist/ToggleButton.mjs +7 -1
  108. package/dist/ToggleButton.module.js +7 -1
  109. package/dist/ToggleButton.module.js.map +1 -1
  110. package/dist/ToggleButtonGroup.main.js +3 -1
  111. package/dist/ToggleButtonGroup.main.js.map +1 -1
  112. package/dist/ToggleButtonGroup.mjs +3 -1
  113. package/dist/ToggleButtonGroup.module.js +3 -1
  114. package/dist/ToggleButtonGroup.module.js.map +1 -1
  115. package/dist/Tree.main.js +16 -4
  116. package/dist/Tree.main.js.map +1 -1
  117. package/dist/Tree.mjs +16 -4
  118. package/dist/Tree.module.js +16 -4
  119. package/dist/Tree.module.js.map +1 -1
  120. package/dist/import.mjs +10 -4
  121. package/dist/main.js +18 -3
  122. package/dist/main.js.map +1 -1
  123. package/dist/module.js +10 -4
  124. package/dist/module.js.map +1 -1
  125. package/dist/types.d.ts +99 -24
  126. package/dist/types.d.ts.map +1 -1
  127. package/dist/utils.main.js.map +1 -1
  128. package/dist/utils.module.js.map +1 -1
  129. package/package.json +23 -23
  130. package/src/Autocomplete.tsx +1 -1
  131. package/src/Button.tsx +9 -11
  132. package/src/DateField.tsx +21 -12
  133. package/src/DatePicker.tsx +11 -2
  134. package/src/GridList.tsx +32 -33
  135. package/src/Group.tsx +5 -2
  136. package/src/Input.tsx +7 -1
  137. package/src/ListBox.tsx +12 -7
  138. package/src/Menu.tsx +11 -6
  139. package/src/Modal.tsx +11 -2
  140. package/src/NumberField.tsx +1 -1
  141. package/src/ProgressBar.tsx +1 -1
  142. package/src/RSPContexts.ts +19 -0
  143. package/src/RadioGroup.tsx +8 -2
  144. package/src/SearchField.tsx +1 -1
  145. package/src/Select.tsx +75 -34
  146. package/src/SelectionIndicator.tsx +40 -0
  147. package/src/SharedElementTransition.tsx +185 -0
  148. package/src/Table.tsx +17 -16
  149. package/src/Tabs.tsx +8 -2
  150. package/src/TagGroup.tsx +31 -24
  151. package/src/TextField.tsx +1 -1
  152. package/src/ToggleButton.tsx +6 -1
  153. package/src/ToggleButtonGroup.tsx +4 -1
  154. package/src/Tree.tsx +16 -9
  155. package/src/index.ts +10 -3
  156. package/src/utils.tsx +1 -1
  157. package/dist/context.main.js +0 -25
  158. package/dist/context.main.js.map +0 -1
  159. package/dist/context.mjs +0 -19
  160. package/dist/context.module.js +0 -19
  161. package/dist/context.module.js.map +0 -1
  162. package/src/context.tsx +0 -34
@@ -65,7 +65,8 @@ const $40825cdb76e74f70$export$d9781c7894a82487 = /*#__PURE__*/ (0, $a9Sgq$forwa
65
65
  values: {
66
66
  state: state,
67
67
  isInvalid: state.isInvalid,
68
- isDisabled: state.isDisabled
68
+ isDisabled: state.isDisabled,
69
+ isReadOnly: state.isReadOnly
69
70
  },
70
71
  defaultClassName: 'react-aria-DateField'
71
72
  });
@@ -123,7 +124,8 @@ const $40825cdb76e74f70$export$d9781c7894a82487 = /*#__PURE__*/ (0, $a9Sgq$forwa
123
124
  ref: ref,
124
125
  slot: props.slot || undefined,
125
126
  "data-invalid": state.isInvalid || undefined,
126
- "data-disabled": state.isDisabled || undefined
127
+ "data-disabled": state.isDisabled || undefined,
128
+ "data-readonly": state.isReadOnly || undefined
127
129
  }), /*#__PURE__*/ (0, $a9Sgq$react).createElement((0, $c699643d2073b351$export$eefa3e19139f00f3), {
128
130
  autoComplete: props.autoComplete,
129
131
  name: props.name,
@@ -156,7 +158,8 @@ const $40825cdb76e74f70$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $a9Sgq$forwa
156
158
  values: {
157
159
  state: state,
158
160
  isInvalid: state.isInvalid,
159
- isDisabled: state.isDisabled
161
+ isDisabled: state.isDisabled,
162
+ isReadOnly: state.isReadOnly
160
163
  },
161
164
  defaultClassName: 'react-aria-TimeField'
162
165
  });
@@ -214,7 +217,8 @@ const $40825cdb76e74f70$export$5eaee2322dd727eb = /*#__PURE__*/ (0, $a9Sgq$forwa
214
217
  ref: ref,
215
218
  slot: props.slot || undefined,
216
219
  "data-invalid": state.isInvalid || undefined,
217
- "data-disabled": state.isDisabled || undefined
220
+ "data-disabled": state.isDisabled || undefined,
221
+ "data-readonly": state.isReadOnly || undefined
218
222
  }));
219
223
  });
220
224
  const $40825cdb76e74f70$export$7edc06cf1783b30f = /*#__PURE__*/ (0, $a9Sgq$forwardRef)(function DateInput(props, ref) {
@@ -280,6 +284,7 @@ const $40825cdb76e74f70$var$DateInputInner = /*#__PURE__*/ (0, $a9Sgq$forwardRef
280
284
  ref: ref,
281
285
  slot: props.slot || undefined,
282
286
  className: className !== null && className !== void 0 ? className : 'react-aria-DateInput',
287
+ isReadOnly: state.isReadOnly,
283
288
  isInvalid: state.isInvalid,
284
289
  isDisabled: state.isDisabled
285
290
  }, state.segments.map((segment, i)=>/*#__PURE__*/ (0, $a9Sgq$cloneElement)(children(segment), {
@@ -297,12 +302,11 @@ const $40825cdb76e74f70$export$336ab7fa954c4b5f = /*#__PURE__*/ (0, $a9Sgq$forwa
297
302
  ...otherProps,
298
303
  isDisabled: state.isDisabled || segment.type === 'literal'
299
304
  });
300
- let { isEditable: isEditable, ...segmentRest } = segment;
301
305
  let renderProps = (0, $64fa3d84918910a7$export$4d86445c2cf5e3)({
302
306
  ...otherProps,
303
307
  values: {
304
- ...segmentRest,
305
- isReadOnly: !isEditable,
308
+ ...segment,
309
+ isReadOnly: state.isReadOnly,
306
310
  isInvalid: state.isInvalid,
307
311
  isDisabled: state.isDisabled,
308
312
  isHovered: isHovered,
@@ -321,7 +325,7 @@ const $40825cdb76e74f70$export$336ab7fa954c4b5f = /*#__PURE__*/ (0, $a9Sgq$forwa
321
325
  ref: domRef,
322
326
  "data-placeholder": segment.isPlaceholder || undefined,
323
327
  "data-invalid": state.isInvalid || undefined,
324
- "data-readonly": !isEditable || undefined,
328
+ "data-readonly": state.isReadOnly || undefined,
325
329
  "data-disabled": state.isDisabled || undefined,
326
330
  "data-type": segment.type,
327
331
  "data-hovered": isHovered || undefined,
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;AAmCM,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAqD;AAC1F,MAAM,0DAAmB,CAAA,GAAA,oBAAY,EAAqD;AAC1F,MAAM,0DAAwB,CAAA,GAAA,oBAAY,EAAyB;AACnE,MAAM,0DAAwB,CAAA,GAAA,oBAAY,EAAyB;AAMnE,MAAM,4CAA0B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,UAA+B,KAAwB,EAAE,GAAiC;IACvK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,yCAAgB,EAAE,CAAA,GAAA,yCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,gBAAQ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AAA,iBAAS,EAAE,CAAA,GAAA,qBAAa,EAAE,YAAY;YAAC,QAAQ;QAAI,IAAI,cAAc,YAAY,WAAW;QAC/F,GAAG,WAAW;QACf,OAAO,aAAa,KAAK;QACzB,KAAK;QACL,oBAAkB,QAAQ,aAAa,IAAI;QAC3C,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,CAAC,cAAc;QAC9B,iBAAe,MAAM,UAAU,IAAI;QACnC,aAAW,QAAQ,IAAI;QACvB,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;;AAE5C","sources":["packages/react-aria-components/src/DateField.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaDateFieldProps, AriaTimeFieldProps, DateValue, HoverEvents, mergeProps, TimeValue, useDateField, useDateSegment, useFocusRing, useHover, useLocale, useTimeField} from 'react-aria';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {createCalendar} from '@internationalized/date';\nimport {DateFieldState, DateSegmentType, DateSegment as IDateSegment, TimeFieldState, useDateFieldState, useTimeFieldState} from 'react-stately';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {Group, GroupContext} from './Group';\nimport {HiddenDateInput} from './HiddenDateInput';\nimport {Input, InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {cloneElement, createContext, ForwardedRef, forwardRef, JSX, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DateFieldRenderProps {\n /**\n * State of the date field.\n */\n state: DateFieldState,\n /**\n * Whether the date field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean\n}\nexport interface DateFieldProps<T extends DateValue> extends Omit<AriaDateFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface TimeFieldProps<T extends TimeValue> extends Omit<AriaTimeFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const DateFieldContext = createContext<ContextValue<DateFieldProps<any>, HTMLDivElement>>(null);\nexport const TimeFieldContext = createContext<ContextValue<TimeFieldProps<any>, HTMLDivElement>>(null);\nexport const DateFieldStateContext = createContext<DateFieldState | null>(null);\nexport const TimeFieldStateContext = createContext<TimeFieldState | null>(null);\n\n/**\n * A date field allows users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport const DateField = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateField<T extends DateValue>(props: DateFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...props,\n locale,\n createCalendar,\n validationBehavior\n });\n\n let fieldRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let inputRef = useRef<HTMLInputElement>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useDateField({\n ...removeDataAttributes(props),\n label,\n inputRef,\n validationBehavior\n }, state, fieldRef);\n\n let renderProps = useRenderProps({\n ...removeDataAttributes(props),\n values: {\n state,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled\n },\n defaultClassName: 'react-aria-DateField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateFieldStateContext, state],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid, isDisabled: state.isDisabled}],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined} />\n <HiddenDateInput \n autoComplete={props.autoComplete}\n name={props.name}\n isDisabled={props.isDisabled}\n state={state} /> \n </Provider>\n );\n});\n\n/**\n * A time field allows users to enter and edit time values using a keyboard.\n * Each part of a time value is displayed in an individually editable segment.\n */\nexport const TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(function TimeField<T extends TimeValue>(props: TimeFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale,\n validationBehavior\n });\n\n let fieldRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let inputRef = useRef<HTMLInputElement>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useTimeField({\n ...removeDataAttributes(props),\n label,\n inputRef,\n validationBehavior\n }, state, fieldRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled\n },\n defaultClassName: 'react-aria-TimeField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [TimeFieldStateContext, state],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid, isDisabled: state.isDisabled}],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-invalid={state.isInvalid || undefined} \n data-disabled={state.isDisabled || undefined} />\n </Provider>\n );\n});\n\nexport interface DateInputRenderProps {\n /**\n * Whether the date input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether an element within the date input is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the date input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n\n /**\n * Whether the date input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface DateInputProps extends SlotProps, StyleRenderProps<DateInputRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n children: (segment: IDateSegment) => ReactElement\n}\n\n/**\n * A date input groups the editable date segments within a date field.\n */\nexport const DateInput = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateInput(props: DateInputProps, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n // If state is provided by DateField/TimeField, just render.\n // Otherwise (e.g. in DatePicker), we need to call hooks and create state ourselves.\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n return dateFieldState || timeFieldState\n ? <DateInputInner {...props} ref={ref} />\n : <DateInputStandalone {...props} ref={ref} />;\n});\n\nconst DateInputStandalone = forwardRef((props: DateInputProps, ref: ForwardedRef<HTMLDivElement>) => {\n let [dateFieldProps, fieldRef] = useContextProps({slot: props.slot} as DateFieldProps<any>, ref, DateFieldContext);\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...dateFieldProps,\n locale,\n createCalendar\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n let {fieldProps, inputProps} = useDateField({...dateFieldProps, inputRef}, state, fieldRef);\n\n return (\n <Provider\n values={[\n [DateFieldStateContext, state],\n [InputContext, {...inputProps, ref: inputRef}],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid, isDisabled: state.isDisabled}]\n ]}>\n <DateInputInner {...props} />\n </Provider>\n );\n});\n\nconst DateInputInner = forwardRef((props: DateInputProps, ref: ForwardedRef<HTMLDivElement>) => {\n let {className, children} = props;\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n let state = dateFieldState ?? timeFieldState!;\n\n return (\n <>\n <Group\n {...props}\n ref={ref}\n slot={props.slot || undefined}\n className={className ?? 'react-aria-DateInput'}\n isInvalid={state.isInvalid}\n isDisabled={state.isDisabled}>\n {state.segments.map((segment, i) => cloneElement(children(segment), {key: i}))}\n </Group>\n <Input />\n </>\n );\n});\n\nexport interface DateSegmentRenderProps extends Omit<IDateSegment, 'isEditable'> {\n /**\n * Whether the segment is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the segment is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the segment is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * Whether the segment is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the date field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date field is in an invalid state.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * The type of segment. Values include `literal`, `year`, `month`, `day`, etc.\n * @selector [data-type=\"...\"]\n */\n type: DateSegmentType\n}\n\nexport interface DateSegmentProps extends RenderProps<DateSegmentRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLSpanElement> {\n segment: IDateSegment\n}\n\n/**\n * A date segment displays an individual unit of a date and time, and allows users to edit\n * the value by typing or using the arrow keys to increment and decrement.\n */\nexport const DateSegment = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateSegment({segment, ...otherProps}: DateSegmentProps, ref: ForwardedRef<HTMLSpanElement>) {\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n let state = dateFieldState ?? timeFieldState!;\n let domRef = useObjectRef(ref);\n let {segmentProps} = useDateSegment(segment, state, domRef);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: state.isDisabled || segment.type === 'literal'});\n let {isEditable, ...segmentRest} = segment;\n let renderProps = useRenderProps({\n ...otherProps,\n values: {\n ...segmentRest,\n isReadOnly: !isEditable,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled,\n isHovered,\n isFocused,\n isFocusVisible\n },\n defaultChildren: segment.text,\n defaultClassName: 'react-aria-DateSegment'\n });\n\n return (\n <span\n {...mergeProps(filterDOMProps(otherProps, {global: true}), segmentProps, focusProps, hoverProps)}\n {...renderProps}\n style={segmentProps.style}\n ref={domRef}\n data-placeholder={segment.isPlaceholder || undefined}\n data-invalid={state.isInvalid || undefined}\n data-readonly={!isEditable || undefined}\n data-disabled={state.isDisabled || undefined}\n data-type={segment.type}\n data-hovered={isHovered || undefined}\n data-focused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3B,sBAAoB,kBAAkB;;AAE5C","sources":["packages/react-aria-components/src/DateField.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaDateFieldProps, AriaTimeFieldProps, DateValue, HoverEvents, mergeProps, TimeValue, useDateField, useDateSegment, useFocusRing, useHover, useLocale, useTimeField} from 'react-aria';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, StyleRenderProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {createCalendar} from '@internationalized/date';\nimport {DateFieldState, DateSegmentType, DateSegment as IDateSegment, TimeFieldState, useDateFieldState, useTimeFieldState} from 'react-stately';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {Group, GroupContext} from './Group';\nimport {HiddenDateInput} from './HiddenDateInput';\nimport {Input, InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport React, {cloneElement, createContext, ForwardedRef, forwardRef, JSX, ReactElement, useContext, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DateFieldRenderProps {\n /**\n * State of the date field.\n */\n state: DateFieldState,\n /**\n * Whether the date field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date field is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean\n}\nexport interface DateFieldProps<T extends DateValue> extends Omit<AriaDateFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface TimeFieldProps<T extends TimeValue> extends Omit<AriaTimeFieldProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<DateFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const DateFieldContext = createContext<ContextValue<DateFieldProps<any>, HTMLDivElement>>(null);\nexport const TimeFieldContext = createContext<ContextValue<TimeFieldProps<any>, HTMLDivElement>>(null);\nexport const DateFieldStateContext = createContext<DateFieldState | null>(null);\nexport const TimeFieldStateContext = createContext<TimeFieldState | null>(null);\n\n/**\n * A date field allows users to enter and edit date and time values using a keyboard.\n * Each part of a date value is displayed in an individually editable segment.\n */\nexport const DateField = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateField<T extends DateValue>(props: DateFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...props,\n locale,\n createCalendar,\n validationBehavior\n });\n\n let fieldRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let inputRef = useRef<HTMLInputElement>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useDateField({\n ...removeDataAttributes(props),\n label,\n inputRef,\n validationBehavior\n }, state, fieldRef);\n\n let renderProps = useRenderProps({\n ...removeDataAttributes(props),\n values: {\n state,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly\n },\n defaultClassName: 'react-aria-DateField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateFieldStateContext, state],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid, isDisabled: state.isDisabled}],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined} />\n <HiddenDateInput\n autoComplete={props.autoComplete}\n name={props.name}\n isDisabled={props.isDisabled}\n state={state} />\n </Provider>\n );\n});\n\n/**\n * A time field allows users to enter and edit time values using a keyboard.\n * Each part of a time value is displayed in an individually editable segment.\n */\nexport const TimeField = /*#__PURE__*/ (forwardRef as forwardRefType)(function TimeField<T extends TimeValue>(props: TimeFieldProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TimeFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useTimeFieldState({\n ...props,\n locale,\n validationBehavior\n });\n\n let fieldRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let inputRef = useRef<HTMLInputElement>(null);\n let {labelProps, fieldProps, inputProps, descriptionProps, errorMessageProps, ...validation} = useTimeField({\n ...removeDataAttributes(props),\n label,\n inputRef,\n validationBehavior\n }, state, fieldRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly\n },\n defaultClassName: 'react-aria-TimeField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [TimeFieldStateContext, state],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid, isDisabled: state.isDisabled}],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...DOMProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined} \n data-readonly={state.isReadOnly || undefined} />\n </Provider>\n );\n});\n\nexport interface DateInputRenderProps {\n /**\n * Whether the date input is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether an element within the date input is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the date input is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date input is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n\n /**\n * Whether the date input is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean\n}\n\nexport interface DateInputProps extends SlotProps, StyleRenderProps<DateInputRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n children: (segment: IDateSegment) => ReactElement\n}\n\n/**\n * A date input groups the editable date segments within a date field.\n */\nexport const DateInput = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateInput(props: DateInputProps, ref: ForwardedRef<HTMLDivElement>): JSX.Element {\n // If state is provided by DateField/TimeField, just render.\n // Otherwise (e.g. in DatePicker), we need to call hooks and create state ourselves.\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n return dateFieldState || timeFieldState\n ? <DateInputInner {...props} ref={ref} />\n : <DateInputStandalone {...props} ref={ref} />;\n});\n\nconst DateInputStandalone = forwardRef((props: DateInputProps, ref: ForwardedRef<HTMLDivElement>) => {\n let [dateFieldProps, fieldRef] = useContextProps({slot: props.slot} as DateFieldProps<any>, ref, DateFieldContext);\n let {locale} = useLocale();\n let state = useDateFieldState({\n ...dateFieldProps,\n locale,\n createCalendar\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n let {fieldProps, inputProps} = useDateField({...dateFieldProps, inputRef}, state, fieldRef);\n\n return (\n <Provider\n values={[\n [DateFieldStateContext, state],\n [InputContext, {...inputProps, ref: inputRef}],\n [GroupContext, {...fieldProps, ref: fieldRef, isInvalid: state.isInvalid, isDisabled: state.isDisabled}]\n ]}>\n <DateInputInner {...props} />\n </Provider>\n );\n});\n\nconst DateInputInner = forwardRef((props: DateInputProps, ref: ForwardedRef<HTMLDivElement>) => {\n let {className, children} = props;\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n let state = dateFieldState ?? timeFieldState!;\n\n return (\n <>\n <Group\n {...props}\n ref={ref}\n slot={props.slot || undefined}\n className={className ?? 'react-aria-DateInput'}\n isReadOnly={state.isReadOnly}\n isInvalid={state.isInvalid}\n isDisabled={state.isDisabled}>\n {state.segments.map((segment, i) => cloneElement(children(segment), {key: i}))}\n </Group>\n <Input />\n </>\n );\n});\n\nexport interface DateSegmentRenderProps extends Omit<IDateSegment, 'isEditable'> {\n /**\n * Whether the segment is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the segment is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the segment is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the value is a placeholder.\n * @selector [data-placeholder]\n */\n isPlaceholder: boolean,\n /**\n * Whether the segment is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the date field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date field is in an invalid state.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * The type of segment. Values include `literal`, `year`, `month`, `day`, etc.\n * @selector [data-type=\"...\"]\n */\n type: DateSegmentType\n}\n\nexport interface DateSegmentProps extends RenderProps<DateSegmentRenderProps>, HoverEvents, GlobalDOMAttributes<HTMLSpanElement> {\n segment: IDateSegment\n}\n\n/**\n * A date segment displays an individual unit of a date and time, and allows users to edit\n * the value by typing or using the arrow keys to increment and decrement.\n */\nexport const DateSegment = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateSegment({segment, ...otherProps}: DateSegmentProps, ref: ForwardedRef<HTMLSpanElement>) {\n let dateFieldState = useContext(DateFieldStateContext);\n let timeFieldState = useContext(TimeFieldStateContext);\n let state = dateFieldState ?? timeFieldState!;\n let domRef = useObjectRef(ref);\n let {segmentProps} = useDateSegment(segment, state, domRef);\n let {focusProps, isFocused, isFocusVisible} = useFocusRing();\n let {hoverProps, isHovered} = useHover({...otherProps, isDisabled: state.isDisabled || segment.type === 'literal'});\n let renderProps = useRenderProps({\n ...otherProps,\n values: {\n ...segment,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isDisabled: state.isDisabled,\n isHovered,\n isFocused,\n isFocusVisible\n },\n defaultChildren: segment.text,\n defaultClassName: 'react-aria-DateSegment'\n });\n\n return (\n <span\n {...mergeProps(filterDOMProps(otherProps, {global: true}), segmentProps, focusProps, hoverProps)}\n {...renderProps}\n style={segmentProps.style}\n ref={domRef}\n data-placeholder={segment.isPlaceholder || undefined}\n data-invalid={state.isInvalid || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-disabled={state.isDisabled || undefined}\n data-type={segment.type}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"DateField.module.js.map"}
@@ -103,7 +103,8 @@ const $adfe8d3f75d5162e$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $bhT4V$react
103
103
  isFocusVisible: isFocusVisible,
104
104
  isDisabled: props.isDisabled || false,
105
105
  isInvalid: state.isInvalid,
106
- isOpen: state.isOpen
106
+ isOpen: state.isOpen,
107
+ isReadOnly: props.isReadOnly || false
107
108
  },
108
109
  defaultClassName: 'react-aria-DatePicker'
109
110
  });
@@ -190,6 +191,7 @@ const $adfe8d3f75d5162e$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $bhT4V$react
190
191
  "data-invalid": state.isInvalid || undefined,
191
192
  "data-focus-visible": isFocusVisible || undefined,
192
193
  "data-disabled": props.isDisabled || undefined,
194
+ "data-readonly": props.isReadOnly || undefined,
193
195
  "data-open": state.isOpen || undefined
194
196
  }), /*#__PURE__*/ (0, ($parcel$interopDefault($bhT4V$react))).createElement((0, $7753596769f21492$exports.HiddenDateInput), {
195
197
  autoComplete: props.autoComplete,
@@ -234,7 +236,8 @@ const $adfe8d3f75d5162e$export$17334619f3ac2224 = /*#__PURE__*/ (0, $bhT4V$react
234
236
  isFocusVisible: isFocusVisible,
235
237
  isDisabled: props.isDisabled || false,
236
238
  isInvalid: state.isInvalid,
237
- isOpen: state.isOpen
239
+ isOpen: state.isOpen,
240
+ isReadOnly: props.isReadOnly || false
238
241
  },
239
242
  defaultClassName: 'react-aria-DateRangePicker'
240
243
  });
@@ -326,6 +329,7 @@ const $adfe8d3f75d5162e$export$17334619f3ac2224 = /*#__PURE__*/ (0, $bhT4V$react
326
329
  "data-invalid": state.isInvalid || undefined,
327
330
  "data-focus-visible": isFocusVisible || undefined,
328
331
  "data-disabled": props.isDisabled || undefined,
332
+ "data-readonly": props.isReadOnly || undefined,
329
333
  "data-open": state.isOpen || undefined
330
334
  }));
331
335
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AA4DM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAsD;AAC5F,MAAM,yDAAyB,CAAA,GAAA,0BAAY,EAA2D;AAC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;gBAAM;aAAE;YACnE;gBAAC,CAAA,GAAA,8CAAmB;gBAAG;aAAc;YACrC;gBAAC,CAAA,GAAA,oDAAyB;gBAAG;aAAM;YACnC;gBAAC,CAAA,GAAA,wCAAa;gBAAG;oBACf,SAAS;oBACT,YAAY;oBACZ,WAAW;oBACX,OAAO;wBAAC,mBAAmB;oBAAU;oBACrC,eAAe;gBACjB;aAAE;YACF;gBAAC,CAAA,GAAA,uCAAY;gBAAG;aAAY;YAC5B;gBAAC,CAAA,GAAA,0CAAe;gBAAG;oBACjB,OAAO;wBACL,OAAO;wBACP,KAAK;oBACP;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,qCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,2CAAgB;gBAAG;aAAW;SAChC;qBACD,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,aAAa,WAAW;QACjD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,qBAAmB,aAAa;QAChC,gBAAc,MAAM,SAAS,IAAI;QACjC,sBAAoB,kBAAkB;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,aAAW,MAAM,MAAM,IAAI;;AAGnC","sources":["packages/react-aria-components/src/DatePicker.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaDatePickerProps, AriaDateRangePickerProps, DateValue, useDatePicker, useDateRangePicker, useFocusRing} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarContext, RangeCalendarContext} from './Calendar';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {DateFieldContext} from './DateField';\nimport {DatePickerState, DatePickerStateOptions, DateRangePickerState, DateRangePickerStateOptions, useDatePickerState, useDateRangePickerState} from 'react-stately';\nimport {DialogContext, OverlayTriggerStateContext} from './Dialog';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {HiddenDateInput} from './HiddenDateInput';\nimport {LabelContext} from './Label';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, useCallback, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DatePickerRenderProps {\n /**\n * Whether an element within the date picker is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the date picker is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date picker is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date picker is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date picker's popover is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * State of the date picker.\n */\n state: DatePickerState\n}\nexport interface DateRangePickerRenderProps extends Omit<DatePickerRenderProps, 'state'> {\n /**\n * State of the date range picker.\n */\n state: DateRangePickerState\n}\n\nexport interface DatePickerProps<T extends DateValue> extends Omit<AriaDatePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DatePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DatePickerRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface DateRangePickerProps<T extends DateValue> extends Omit<AriaDateRangePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DateRangePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DateRangePickerRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const DatePickerContext = createContext<ContextValue<DatePickerProps<any>, HTMLDivElement>>(null);\nexport const DateRangePickerContext = createContext<ContextValue<DateRangePickerProps<any>, HTMLDivElement>>(null);\nexport const DatePickerStateContext = createContext<DatePickerState | null>(null);\nexport const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null);\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext];\n\n/**\n * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<T extends DateValue>(props: DatePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDatePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n labelProps,\n fieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDatePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen\n },\n defaultClassName: 'react-aria-DatePicker'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DatePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [DateFieldContext, fieldProps],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [CalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DatePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties,\n clearContexts: CLEAR_CONTEXTS\n }],\n [DialogContext, dialogProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-open={state.isOpen || undefined} />\n <HiddenDateInput\n autoComplete={props.autoComplete}\n name={props.name}\n isDisabled={props.isDisabled}\n state={state} />\n </Provider>\n );\n});\n\n/**\n * A date range picker combines two DateFields and a RangeCalendar popover to allow\n * users to enter or select a date and time range.\n */\nexport const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateRangePicker<T extends DateValue>(props: DateRangePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateRangePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDateRangePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n labelProps,\n startFieldProps,\n endFieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDateRangePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen\n },\n defaultClassName: 'react-aria-DateRangePicker'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateRangePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [RangeCalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DateRangePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties,\n clearContexts: CLEAR_CONTEXTS\n }],\n [DialogContext, dialogProps],\n [DateFieldContext, {\n slots: {\n start: startFieldProps,\n end: endFieldProps\n }\n }],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-open={state.isOpen || undefined} />\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DatePicker.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AAiEM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAsD;AAC5F,MAAM,yDAAyB,CAAA,GAAA,0BAAY,EAA2D;AACtG,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AACrE,MAAM,0DAA8B,CAAA,GAAA,0BAAY,EAA+B;AAEtF,wCAAwC;AACxC,MAAM,uCAAiB;IAAC,CAAA,GAAA,sCAAW;IAAG,CAAA,GAAA,uCAAY;IAAG,CAAA,GAAA,sCAAW;IAAG,CAAA,GAAA,qCAAU;CAAE;AAKxE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAAgC,KAAyB,EAAE,GAAiC;IAC1K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAAC,oBAAoB,sBAAsB,EAAC,GAAG,CAAA,GAAA,2CAAgB,EAAE,CAAA,GAAA,qCAAU,MAAM,CAAC;QAC7D,2BAAA;IAAzB,IAAI,qBAAqB,CAAA,OAAA,CAAA,4BAAA,MAAM,kBAAkB,cAAxB,uCAAA,4BAA4B,oCAA5B,kBAAA,OAAsD;IAC/E,IAAI,QAAQ,CAAA,GAAA,sCAAiB,EAAE;QAC7B,GAAG,KAAK;4BACR;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAkB;IACtC,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,k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,IAAI;QACnC,aAAW,MAAM,MAAM,IAAI;;AAGnC","sources":["packages/react-aria-components/src/DatePicker.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaDatePickerProps, AriaDateRangePickerProps, DateValue, useDatePicker, useDateRangePicker, useFocusRing} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarContext, RangeCalendarContext} from './Calendar';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {DateFieldContext} from './DateField';\nimport {DatePickerState, DatePickerStateOptions, DateRangePickerState, DateRangePickerStateOptions, useDatePickerState, useDateRangePickerState} from 'react-stately';\nimport {DialogContext, OverlayTriggerStateContext} from './Dialog';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {HiddenDateInput} from './HiddenDateInput';\nimport {LabelContext} from './Label';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, useCallback, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DatePickerRenderProps {\n /**\n * Whether an element within the date picker is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the date picker is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date picker is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date picker is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the date picker is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date picker's popover is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * State of the date picker.\n */\n state: DatePickerState\n}\nexport interface DateRangePickerRenderProps extends Omit<DatePickerRenderProps, 'state'> {\n /**\n * State of the date range picker.\n */\n state: DateRangePickerState\n}\n\nexport interface DatePickerProps<T extends DateValue> extends Omit<AriaDatePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DatePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DatePickerRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface DateRangePickerProps<T extends DateValue> extends Omit<AriaDateRangePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DateRangePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DateRangePickerRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const DatePickerContext = createContext<ContextValue<DatePickerProps<any>, HTMLDivElement>>(null);\nexport const DateRangePickerContext = createContext<ContextValue<DateRangePickerProps<any>, HTMLDivElement>>(null);\nexport const DatePickerStateContext = createContext<DatePickerState | null>(null);\nexport const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null);\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext];\n\n/**\n * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<T extends DateValue>(props: DatePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDatePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n labelProps,\n fieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDatePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen,\n isReadOnly: props.isReadOnly || false\n },\n defaultClassName: 'react-aria-DatePicker'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DatePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [DateFieldContext, fieldProps],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [CalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DatePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties,\n clearContexts: CLEAR_CONTEXTS\n }],\n [DialogContext, dialogProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-open={state.isOpen || undefined} />\n <HiddenDateInput\n autoComplete={props.autoComplete}\n name={props.name}\n isDisabled={props.isDisabled}\n state={state} />\n </Provider>\n );\n});\n\n/**\n * A date range picker combines two DateFields and a RangeCalendar popover to allow\n * users to enter or select a date and time range.\n */\nexport const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateRangePicker<T extends DateValue>(props: DateRangePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateRangePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDateRangePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n labelProps,\n startFieldProps,\n endFieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDateRangePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen,\n isReadOnly: props.isReadOnly || false\n },\n defaultClassName: 'react-aria-DateRangePicker'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateRangePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [RangeCalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DateRangePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties,\n clearContexts: CLEAR_CONTEXTS\n }],\n [DialogContext, dialogProps],\n [DateFieldContext, {\n slots: {\n start: startFieldProps,\n end: endFieldProps\n }\n }],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-open={state.isOpen || undefined} />\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DatePicker.main.js.map"}
@@ -88,7 +88,8 @@ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwa
88
88
  isFocusVisible: isFocusVisible,
89
89
  isDisabled: props.isDisabled || false,
90
90
  isInvalid: state.isInvalid,
91
- isOpen: state.isOpen
91
+ isOpen: state.isOpen,
92
+ isReadOnly: props.isReadOnly || false
92
93
  },
93
94
  defaultClassName: 'react-aria-DatePicker'
94
95
  });
@@ -175,6 +176,7 @@ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwa
175
176
  "data-invalid": state.isInvalid || undefined,
176
177
  "data-focus-visible": isFocusVisible || undefined,
177
178
  "data-disabled": props.isDisabled || undefined,
179
+ "data-readonly": props.isReadOnly || undefined,
178
180
  "data-open": state.isOpen || undefined
179
181
  }), /*#__PURE__*/ (0, $8nhma$react).createElement((0, $c699643d2073b351$export$eefa3e19139f00f3), {
180
182
  autoComplete: props.autoComplete,
@@ -219,7 +221,8 @@ const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwa
219
221
  isFocusVisible: isFocusVisible,
220
222
  isDisabled: props.isDisabled || false,
221
223
  isInvalid: state.isInvalid,
222
- isOpen: state.isOpen
224
+ isOpen: state.isOpen,
225
+ isReadOnly: props.isReadOnly || false
223
226
  },
224
227
  defaultClassName: 'react-aria-DateRangePicker'
225
228
  });
@@ -311,6 +314,7 @@ const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwa
311
314
  "data-invalid": state.isInvalid || undefined,
312
315
  "data-focus-visible": isFocusVisible || undefined,
313
316
  "data-disabled": props.isDisabled || undefined,
317
+ "data-readonly": props.isReadOnly || undefined,
314
318
  "data-open": state.isOpen || undefined
315
319
  }));
316
320
  });
@@ -88,7 +88,8 @@ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwa
88
88
  isFocusVisible: isFocusVisible,
89
89
  isDisabled: props.isDisabled || false,
90
90
  isInvalid: state.isInvalid,
91
- isOpen: state.isOpen
91
+ isOpen: state.isOpen,
92
+ isReadOnly: props.isReadOnly || false
92
93
  },
93
94
  defaultClassName: 'react-aria-DatePicker'
94
95
  });
@@ -175,6 +176,7 @@ const $06d5b8ec9ee5d538$export$5109c6dd95d8fb00 = /*#__PURE__*/ (0, $8nhma$forwa
175
176
  "data-invalid": state.isInvalid || undefined,
176
177
  "data-focus-visible": isFocusVisible || undefined,
177
178
  "data-disabled": props.isDisabled || undefined,
179
+ "data-readonly": props.isReadOnly || undefined,
178
180
  "data-open": state.isOpen || undefined
179
181
  }), /*#__PURE__*/ (0, $8nhma$react).createElement((0, $c699643d2073b351$export$eefa3e19139f00f3), {
180
182
  autoComplete: props.autoComplete,
@@ -219,7 +221,8 @@ const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwa
219
221
  isFocusVisible: isFocusVisible,
220
222
  isDisabled: props.isDisabled || false,
221
223
  isInvalid: state.isInvalid,
222
- isOpen: state.isOpen
224
+ isOpen: state.isOpen,
225
+ isReadOnly: props.isReadOnly || false
223
226
  },
224
227
  defaultClassName: 'react-aria-DateRangePicker'
225
228
  });
@@ -311,6 +314,7 @@ const $06d5b8ec9ee5d538$export$17334619f3ac2224 = /*#__PURE__*/ (0, $8nhma$forwa
311
314
  "data-invalid": state.isInvalid || undefined,
312
315
  "data-focus-visible": isFocusVisible || undefined,
313
316
  "data-disabled": props.isDisabled || undefined,
317
+ "data-readonly": props.isReadOnly || undefined,
314
318
  "data-open": state.isOpen || undefined
315
319
  }));
316
320
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AA4DM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAsD;AAC5F,MAAM,yDAAyB,CAAA,GAAA,oBAAY,EAA2D;AACtG,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AACrE,MAAM,0DAA8B,CAAA,GAAA,oBAAY,EAA+B;AAEtF,wCAAwC;AACxC,MAAM,uCAAiB;IAAC,CAAA,GAAA,yCAAW;IAAG,CAAA,GAAA,yCAAY;IAAG,CAAA,GAAA,yCAAW;IAAG,CAAA,GAAA,yCAAU;CAAE;AAKxE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,WAAgC,KAAyB,EAAE,GAAiC;IAC1K,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,EAA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;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAgB;gBAAG;aAAW;SAChC;qBACD,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,WAAW;QACjD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,qBAAmB,aAAa;QAChC,gBAAc,MAAM,SAAS,IAAI;QACjC,sBAAoB,kBAAkB;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,aAAW,MAAM,MAAM,IAAI;;AAGnC","sources":["packages/react-aria-components/src/DatePicker.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaDatePickerProps, AriaDateRangePickerProps, DateValue, useDatePicker, useDateRangePicker, useFocusRing} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarContext, RangeCalendarContext} from './Calendar';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {DateFieldContext} from './DateField';\nimport {DatePickerState, DatePickerStateOptions, DateRangePickerState, DateRangePickerStateOptions, useDatePickerState, useDateRangePickerState} from 'react-stately';\nimport {DialogContext, OverlayTriggerStateContext} from './Dialog';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {HiddenDateInput} from './HiddenDateInput';\nimport {LabelContext} from './Label';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, useCallback, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DatePickerRenderProps {\n /**\n * Whether an element within the date picker is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the date picker is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date picker is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date picker is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date picker's popover is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * State of the date picker.\n */\n state: DatePickerState\n}\nexport interface DateRangePickerRenderProps extends Omit<DatePickerRenderProps, 'state'> {\n /**\n * State of the date range picker.\n */\n state: DateRangePickerState\n}\n\nexport interface DatePickerProps<T extends DateValue> extends Omit<AriaDatePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DatePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DatePickerRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface DateRangePickerProps<T extends DateValue> extends Omit<AriaDateRangePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DateRangePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DateRangePickerRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const DatePickerContext = createContext<ContextValue<DatePickerProps<any>, HTMLDivElement>>(null);\nexport const DateRangePickerContext = createContext<ContextValue<DateRangePickerProps<any>, HTMLDivElement>>(null);\nexport const DatePickerStateContext = createContext<DatePickerState | null>(null);\nexport const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null);\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext];\n\n/**\n * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<T extends DateValue>(props: DatePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDatePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n labelProps,\n fieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDatePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen\n },\n defaultClassName: 'react-aria-DatePicker'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DatePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [DateFieldContext, fieldProps],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [CalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DatePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties,\n clearContexts: CLEAR_CONTEXTS\n }],\n [DialogContext, dialogProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-open={state.isOpen || undefined} />\n <HiddenDateInput\n autoComplete={props.autoComplete}\n name={props.name}\n isDisabled={props.isDisabled}\n state={state} />\n </Provider>\n );\n});\n\n/**\n * A date range picker combines two DateFields and a RangeCalendar popover to allow\n * users to enter or select a date and time range.\n */\nexport const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateRangePicker<T extends DateValue>(props: DateRangePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateRangePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDateRangePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n labelProps,\n startFieldProps,\n endFieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDateRangePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen\n },\n defaultClassName: 'react-aria-DateRangePicker'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateRangePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [RangeCalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DateRangePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties,\n clearContexts: CLEAR_CONTEXTS\n }],\n [DialogContext, dialogProps],\n [DateFieldContext, {\n slots: {\n start: startFieldProps,\n end: endFieldProps\n }\n }],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-open={state.isOpen || undefined} />\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DatePicker.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;AAiEM,MAAM,0DAAoB,CAAA,GAAA,oBAAY,EAAsD;AAC5F,MAAM,yDAAyB,CAAA,GAAA,oBAAY,EAA2D;AACtG,MAAM,0DAAyB,CAAA,GAAA,oBAAY,EAA0B;AACrE,MAAM,0DAA8B,CAAA,GAA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oBAAU,aAAa;gBAAM;aAAE;YACnE;gBAAC,CAAA,GAAA,yCAAmB;gBAAG;aAAc;YACrC;gBAAC,CAAA,GAAA,wCAAyB;gBAAG;aAAM;YACnC;gBAAC,CAAA,GAAA,yCAAa;gBAAG;oBACf,SAAS;oBACT,YAAY;oBACZ,WAAW;oBACX,OAAO;wBAAC,mBAAmB;oBAAU;oBACrC,eAAe;gBACjB;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAY;gBAAG;aAAY;YAC5B;gBAAC,CAAA,GAAA,yCAAe;gBAAG;oBACjB,OAAO;wBACL,OAAO;wBACP,KAAK;oBACP;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAU;gBAAG;oBACZ,OAAO;wBACL,aAAa;wBACb,cAAc;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAgB;gBAAG;aAAW;SAChC;qBACD,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,WAAW;QACjD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,qBAAmB,aAAa;QAChC,gBAAc,MAAM,SAAS,IAAI;QACjC,sBAAoB,kBAAkB;QACtC,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,MAAM,UAAU,IAAI;QACnC,aAAW,MAAM,MAAM,IAAI;;AAGnC","sources":["packages/react-aria-components/src/DatePicker.tsx"],"sourcesContent":["/*\n * Copyright 2022 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaDatePickerProps, AriaDateRangePickerProps, DateValue, useDatePicker, useDateRangePicker, useFocusRing} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {CalendarContext, RangeCalendarContext} from './Calendar';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {DateFieldContext} from './DateField';\nimport {DatePickerState, DatePickerStateOptions, DateRangePickerState, DateRangePickerStateOptions, useDatePickerState, useDateRangePickerState} from 'react-stately';\nimport {DialogContext, OverlayTriggerStateContext} from './Dialog';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, useResizeObserver} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {HiddenDateInput} from './HiddenDateInput';\nimport {LabelContext} from './Label';\nimport {PopoverContext} from './Popover';\nimport React, {createContext, ForwardedRef, forwardRef, useCallback, useRef, useState} from 'react';\nimport {TextContext} from './Text';\n\nexport interface DatePickerRenderProps {\n /**\n * Whether an element within the date picker is focused, either via a mouse or keyboard.\n * @selector [data-focus-within]\n */\n isFocusWithin: boolean,\n /**\n * Whether an element within the date picker is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the date picker is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the date picker is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the date picker is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the date picker's popover is currently open.\n * @selector [data-open]\n */\n isOpen: boolean,\n /**\n * State of the date picker.\n */\n state: DatePickerState\n}\nexport interface DateRangePickerRenderProps extends Omit<DatePickerRenderProps, 'state'> {\n /**\n * State of the date range picker.\n */\n state: DateRangePickerState\n}\n\nexport interface DatePickerProps<T extends DateValue> extends Omit<AriaDatePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DatePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DatePickerRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface DateRangePickerProps<T extends DateValue> extends Omit<AriaDateRangePickerProps<T>, 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, Pick<DateRangePickerStateOptions<T>, 'shouldCloseOnSelect'>, RACValidation, RenderProps<DateRangePickerRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const DatePickerContext = createContext<ContextValue<DatePickerProps<any>, HTMLDivElement>>(null);\nexport const DateRangePickerContext = createContext<ContextValue<DateRangePickerProps<any>, HTMLDivElement>>(null);\nexport const DatePickerStateContext = createContext<DatePickerState | null>(null);\nexport const DateRangePickerStateContext = createContext<DateRangePickerState | null>(null);\n\n// Contexts to clear inside the popover.\nconst CLEAR_CONTEXTS = [GroupContext, ButtonContext, LabelContext, TextContext];\n\n/**\n * A date picker combines a DateField and a Calendar popover to allow users to enter or select a date and time value.\n */\nexport const DatePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DatePicker<T extends DateValue>(props: DatePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DatePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDatePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n labelProps,\n fieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDatePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen,\n isReadOnly: props.isReadOnly || false\n },\n defaultClassName: 'react-aria-DatePicker'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DatePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [DateFieldContext, fieldProps],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [CalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DatePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties,\n clearContexts: CLEAR_CONTEXTS\n }],\n [DialogContext, dialogProps],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-open={state.isOpen || undefined} />\n <HiddenDateInput\n autoComplete={props.autoComplete}\n name={props.name}\n isDisabled={props.isDisabled}\n state={state} />\n </Provider>\n );\n});\n\n/**\n * A date range picker combines two DateFields and a RangeCalendar popover to allow\n * users to enter or select a date and time range.\n */\nexport const DateRangePicker = /*#__PURE__*/ (forwardRef as forwardRefType)(function DateRangePicker<T extends DateValue>(props: DateRangePickerProps<T>, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, DateRangePickerContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useDateRangePickerState({\n ...props,\n validationBehavior\n });\n\n let groupRef = useRef<HTMLDivElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n groupProps,\n labelProps,\n startFieldProps,\n endFieldProps,\n buttonProps,\n dialogProps,\n calendarProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useDateRangePicker({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, groupRef);\n\n // Allows calendar width to match input group\n let [groupWidth, setGroupWidth] = useState<string | null>(null);\n let onResize = useCallback(() => {\n if (groupRef.current) {\n setGroupWidth(groupRef.current.offsetWidth + 'px');\n }\n }, []);\n\n useResizeObserver({\n ref: groupRef,\n onResize: onResize\n });\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing({within: true});\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isFocusWithin: isFocused,\n isFocusVisible,\n isDisabled: props.isDisabled || false,\n isInvalid: state.isInvalid,\n isOpen: state.isOpen,\n isReadOnly: props.isReadOnly || false\n },\n defaultClassName: 'react-aria-DateRangePicker'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [DateRangePickerStateContext, state],\n [GroupContext, {...groupProps, ref: groupRef, isInvalid: state.isInvalid}],\n [ButtonContext, {...buttonProps, isPressed: state.isOpen}],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [RangeCalendarContext, calendarProps],\n [OverlayTriggerStateContext, state],\n [PopoverContext, {\n trigger: 'DateRangePicker',\n triggerRef: groupRef,\n placement: 'bottom start',\n style: {'--trigger-width': groupWidth} as React.CSSProperties,\n clearContexts: CLEAR_CONTEXTS\n }],\n [DialogContext, dialogProps],\n [DateFieldContext, {\n slots: {\n start: startFieldProps,\n end: endFieldProps\n }\n }],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n <div\n {...mergeProps(DOMProps, renderProps, focusProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focus-within={isFocused || undefined}\n data-invalid={state.isInvalid || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={props.isDisabled || undefined}\n data-readonly={props.isReadOnly || undefined}\n data-open={state.isOpen || undefined} />\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"DatePicker.module.js.map"}
@@ -3,9 +3,9 @@ var $525402dfec7da5bc$exports = require("./RSPContexts.main.js");
3
3
  var $3114c2382242bdc0$exports = require("./Collection.main.js");
4
4
  var $c5ccf687772c0422$exports = require("./utils.main.js");
5
5
  var $0c2289d253cb4544$exports = require("./DragAndDrop.main.js");
6
- var $09cb5ee89bb327e1$exports = require("./context.main.js");
7
- var $c7efb75a1a3fe2d2$exports = require("./Header.main.js");
8
6
  var $a03b42240404b420$exports = require("./ListBox.main.js");
7
+ var $54e872c96e6d295b$exports = require("./SelectionIndicator.main.js");
8
+ var $2d10bc562fea46b3$exports = require("./SharedElementTransition.main.js");
9
9
  var $a8a589c28affdc40$exports = require("./Text.main.js");
10
10
  var $UaDUV$reactaria = require("react-aria");
11
11
  var $UaDUV$reactariacollections = require("@react-aria/collections");
@@ -27,6 +27,7 @@ $parcel$export(module.exports, "GridList", () => $132cbde493282f82$export$a7bfbd
27
27
  $parcel$export(module.exports, "GridListItem", () => $132cbde493282f82$export$e96fc9a8407faa6b);
28
28
  $parcel$export(module.exports, "GridListLoadMoreItem", () => $132cbde493282f82$export$392b9a0bbc7c7e43);
29
29
  $parcel$export(module.exports, "GridListSection", () => $132cbde493282f82$export$f696877219115b14);
30
+ $parcel$export(module.exports, "GridListHeaderContext", () => $132cbde493282f82$export$87f5843bfb30d205);
30
31
  $parcel$export(module.exports, "GridListHeader", () => $132cbde493282f82$export$1b574dbdb0075ff6);
31
32
  /*
32
33
  * Copyright 2022 Adobe. All rights reserved.
@@ -65,17 +66,13 @@ const $132cbde493282f82$export$a7bfbda1311ca015 = /*#__PURE__*/ (0, $UaDUV$react
65
66
  }));
66
67
  });
67
68
  function $132cbde493282f82$var$GridListInner({ props: props, collection: collection, gridListRef: ref }) {
68
- // TODO: for now, don't grab collection ref and collectionProps from the autocomplete, rely on the user tabbing to the gridlist
69
- // figure out if we want to support virtual focus for grids when wrapped in an autocomplete
70
- let contextProps;
71
- [contextProps] = (0, $c5ccf687772c0422$exports.useContextProps)({}, null, (0, $09cb5ee89bb327e1$exports.SelectableCollectionContext));
72
- let { filter: filter, ...collectionProps } = contextProps;
69
+ [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, (0, $525402dfec7da5bc$exports.SelectableCollectionContext));
73
70
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
74
- let { shouldUseVirtualFocus: shouldUseVirtualFocus, disallowTypeAhead: disallowTypeAhead, ...DOMCollectionProps } = collectionProps || {};
71
+ let { shouldUseVirtualFocus: shouldUseVirtualFocus, filter: filter, disallowTypeAhead: disallowTypeAhead, ...DOMCollectionProps } = props;
75
72
  let { dragAndDropHooks: dragAndDropHooks, keyboardNavigationBehavior: keyboardNavigationBehavior = 'arrow', layout: layout = 'stack' } = props;
76
73
  let { CollectionRoot: CollectionRoot, isVirtualized: isVirtualized, layoutDelegate: layoutDelegate, dropTargetDelegate: ctxDropTargetDelegate } = (0, $UaDUV$react.useContext)((0, $3114c2382242bdc0$exports.CollectionRendererContext));
77
74
  let gridlistState = (0, $UaDUV$reactstately.useListState)({
78
- ...props,
75
+ ...DOMCollectionProps,
79
76
  collection: collection,
80
77
  children: undefined,
81
78
  layoutDelegate: layoutDelegate
@@ -107,7 +104,6 @@ function $132cbde493282f82$var$GridListInner({ props: props, collection: collect
107
104
  direction
108
105
  ]);
109
106
  let { gridProps: gridProps } = (0, $UaDUV$reactaria.useGridList)({
110
- ...props,
111
107
  ...DOMCollectionProps,
112
108
  keyboardDelegate: keyboardDelegate,
113
109
  // Only tab navigation is supported in grid layout.
@@ -236,12 +232,12 @@ function $132cbde493282f82$var$GridListInner({ props: props, collection: collect
236
232
  }
237
233
  ]
238
234
  ]
239
- }, isListDroppable && /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement($132cbde493282f82$var$RootDropIndicator, null), /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement(CollectionRoot, {
235
+ }, isListDroppable && /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement($132cbde493282f82$var$RootDropIndicator, null), /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement((0, $2d10bc562fea46b3$exports.SharedElementTransition), null, /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement(CollectionRoot, {
240
236
  collection: filteredState.collection,
241
237
  scrollRef: ref,
242
238
  persistedKeys: (0, $0c2289d253cb4544$exports.useDndPersistedKeys)(selectionManager, dragAndDropHooks, dropState),
243
239
  renderDropIndicator: (0, $0c2289d253cb4544$exports.useRenderDropIndicator)(dragAndDropHooks, dropState)
244
- })), emptyState, dragPreview));
240
+ }))), emptyState, dragPreview));
245
241
  }
246
242
  const $132cbde493282f82$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $UaDUV$reactariacollections.createLeafComponent)((0, $UaDUV$reactariacollections.ItemNode), function GridListItem(props, forwardedRef, item) {
247
243
  let state = (0, $UaDUV$react.useContext)((0, $a03b42240404b420$exports.ListStateContext));
@@ -387,12 +383,18 @@ const $132cbde493282f82$export$e96fc9a8407faa6b = /*#__PURE__*/ (0, $UaDUV$react
387
383
  null
388
384
  ],
389
385
  [
390
- (0, $09cb5ee89bb327e1$exports.SelectableCollectionContext),
386
+ (0, $525402dfec7da5bc$exports.SelectableCollectionContext),
391
387
  null
392
388
  ],
393
389
  [
394
- (0, $09cb5ee89bb327e1$exports.FieldInputContext),
390
+ (0, $525402dfec7da5bc$exports.FieldInputContext),
395
391
  null
392
+ ],
393
+ [
394
+ (0, $54e872c96e6d295b$exports.SelectionIndicatorContext),
395
+ {
396
+ isSelected: states.isSelected
397
+ }
396
398
  ]
397
399
  ]
398
400
  }, renderProps.children))));
@@ -536,20 +538,20 @@ const $132cbde493282f82$export$f696877219115b14 = /*#__PURE__*/ (0, $UaDUV$react
536
538
  global: true
537
539
  });
538
540
  delete DOMProps.id;
539
- return /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement("section", {
541
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement("div", {
540
542
  ...(0, $UaDUV$reactaria.mergeProps)(DOMProps, renderProps, rowGroupProps),
541
543
  ref: ref
542
544
  }, /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement((0, $c5ccf687772c0422$exports.Provider), {
543
545
  values: [
544
546
  [
545
- (0, $c7efb75a1a3fe2d2$exports.HeaderContext),
547
+ $132cbde493282f82$export$87f5843bfb30d205,
546
548
  {
547
549
  ...rowProps,
548
550
  ref: headingRef
549
551
  }
550
552
  ],
551
553
  [
552
- $132cbde493282f82$var$GridListHeaderContext,
554
+ $132cbde493282f82$var$GridListHeaderInnerContext,
553
555
  {
554
556
  ...rowHeaderProps
555
557
  }
@@ -560,11 +562,12 @@ const $132cbde493282f82$export$f696877219115b14 = /*#__PURE__*/ (0, $UaDUV$react
560
562
  parent: item
561
563
  })));
562
564
  });
563
- const $132cbde493282f82$var$GridListHeaderContext = /*#__PURE__*/ (0, $UaDUV$react.createContext)(null);
565
+ const $132cbde493282f82$export$87f5843bfb30d205 = /*#__PURE__*/ (0, $UaDUV$react.createContext)({});
566
+ const $132cbde493282f82$var$GridListHeaderInnerContext = /*#__PURE__*/ (0, $UaDUV$react.createContext)(null);
564
567
  const $132cbde493282f82$export$1b574dbdb0075ff6 = /*#__PURE__*/ (0, $UaDUV$reactariacollections.createLeafComponent)((0, $UaDUV$reactariacollections.HeaderNode), function Header(props, ref) {
565
- [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, (0, $c7efb75a1a3fe2d2$exports.HeaderContext));
566
- let rowHeaderProps = (0, $UaDUV$react.useContext)($132cbde493282f82$var$GridListHeaderContext);
567
- return /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement("header", {
568
+ [props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $132cbde493282f82$export$87f5843bfb30d205);
569
+ let rowHeaderProps = (0, $UaDUV$react.useContext)($132cbde493282f82$var$GridListHeaderInnerContext);
570
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($UaDUV$react))).createElement("div", {
568
571
  className: "react-aria-GridListHeader",
569
572
  ref: ref,
570
573
  ...props