react-aria-components 1.10.1 → 1.11.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Breadcrumbs.main.js +9 -2
- package/dist/Breadcrumbs.main.js.map +1 -1
- package/dist/Breadcrumbs.mjs +10 -3
- package/dist/Breadcrumbs.module.js +10 -3
- package/dist/Breadcrumbs.module.js.map +1 -1
- package/dist/Button.main.js +7 -17
- package/dist/Button.main.js.map +1 -1
- package/dist/Button.mjs +7 -17
- package/dist/Button.module.js +7 -17
- package/dist/Button.module.js.map +1 -1
- package/dist/Calendar.main.js +36 -14
- package/dist/Calendar.main.js.map +1 -1
- package/dist/Calendar.mjs +38 -16
- package/dist/Calendar.module.js +38 -16
- package/dist/Calendar.module.js.map +1 -1
- package/dist/Checkbox.main.js +8 -3
- package/dist/Checkbox.main.js.map +1 -1
- package/dist/Checkbox.mjs +10 -5
- package/dist/Checkbox.module.js +10 -5
- package/dist/Checkbox.module.js.map +1 -1
- package/dist/Collection.main.js.map +1 -1
- package/dist/Collection.module.js.map +1 -1
- package/dist/ColorArea.main.js +4 -4
- package/dist/ColorArea.main.js.map +1 -1
- package/dist/ColorArea.mjs +5 -5
- package/dist/ColorArea.module.js +5 -5
- package/dist/ColorArea.module.js.map +1 -1
- package/dist/ColorField.main.js +14 -1
- package/dist/ColorField.main.js.map +1 -1
- package/dist/ColorField.mjs +14 -1
- package/dist/ColorField.module.js +14 -1
- package/dist/ColorField.module.js.map +1 -1
- package/dist/ColorSlider.main.js +3 -1
- package/dist/ColorSlider.main.js.map +1 -1
- package/dist/ColorSlider.mjs +3 -1
- package/dist/ColorSlider.module.js +3 -1
- package/dist/ColorSlider.module.js.map +1 -1
- package/dist/ColorSwatch.main.js +6 -2
- package/dist/ColorSwatch.main.js.map +1 -1
- package/dist/ColorSwatch.mjs +6 -2
- package/dist/ColorSwatch.module.js +6 -2
- package/dist/ColorSwatch.module.js.map +1 -1
- package/dist/ColorSwatchPicker.main.js.map +1 -1
- package/dist/ColorSwatchPicker.module.js.map +1 -1
- package/dist/ColorThumb.main.js +3 -1
- package/dist/ColorThumb.main.js.map +1 -1
- package/dist/ColorThumb.mjs +3 -1
- package/dist/ColorThumb.module.js +3 -1
- package/dist/ColorThumb.module.js.map +1 -1
- package/dist/ColorWheel.main.js +3 -1
- package/dist/ColorWheel.main.js.map +1 -1
- package/dist/ColorWheel.mjs +3 -1
- package/dist/ColorWheel.module.js +3 -1
- package/dist/ColorWheel.module.js.map +1 -1
- package/dist/ComboBox.main.js +4 -1
- package/dist/ComboBox.main.js.map +1 -1
- package/dist/ComboBox.mjs +4 -1
- package/dist/ComboBox.module.js +4 -1
- package/dist/ComboBox.module.js.map +1 -1
- package/dist/DateField.main.js +16 -3
- package/dist/DateField.main.js.map +1 -1
- package/dist/DateField.mjs +16 -3
- package/dist/DateField.module.js +16 -3
- package/dist/DateField.module.js.map +1 -1
- package/dist/DatePicker.main.js +15 -8
- package/dist/DatePicker.main.js.map +1 -1
- package/dist/DatePicker.mjs +16 -9
- package/dist/DatePicker.module.js +16 -9
- package/dist/DatePicker.module.js.map +1 -1
- package/dist/Dialog.main.js +4 -3
- package/dist/Dialog.main.js.map +1 -1
- package/dist/Dialog.mjs +5 -4
- package/dist/Dialog.module.js +5 -4
- package/dist/Dialog.module.js.map +1 -1
- package/dist/Disclosure.main.js +12 -10
- package/dist/Disclosure.main.js.map +1 -1
- package/dist/Disclosure.mjs +13 -11
- package/dist/Disclosure.module.js +13 -11
- package/dist/Disclosure.module.js.map +1 -1
- package/dist/DragAndDrop.main.js +31 -3
- package/dist/DragAndDrop.main.js.map +1 -1
- package/dist/DragAndDrop.mjs +31 -3
- package/dist/DragAndDrop.module.js +31 -3
- package/dist/DragAndDrop.module.js.map +1 -1
- package/dist/DropZone.main.js +4 -3
- package/dist/DropZone.main.js.map +1 -1
- package/dist/DropZone.mjs +4 -3
- package/dist/DropZone.module.js +4 -3
- package/dist/DropZone.module.js.map +1 -1
- package/dist/FieldError.main.js +3 -1
- package/dist/FieldError.main.js.map +1 -1
- package/dist/FieldError.mjs +3 -1
- package/dist/FieldError.module.js +3 -1
- package/dist/FieldError.module.js.map +1 -1
- package/dist/FileTrigger.main.js +3 -1
- package/dist/FileTrigger.main.js.map +1 -1
- package/dist/FileTrigger.mjs +3 -1
- package/dist/FileTrigger.module.js +3 -1
- package/dist/FileTrigger.module.js.map +1 -1
- package/dist/Form.main.js.map +1 -1
- package/dist/Form.module.js.map +1 -1
- package/dist/GridList.main.js +20 -13
- package/dist/GridList.main.js.map +1 -1
- package/dist/GridList.mjs +21 -14
- package/dist/GridList.module.js +21 -14
- package/dist/GridList.module.js.map +1 -1
- package/dist/HiddenDateInput.main.js +118 -0
- package/dist/HiddenDateInput.main.js.map +1 -0
- package/dist/HiddenDateInput.mjs +109 -0
- package/dist/HiddenDateInput.module.js +109 -0
- package/dist/HiddenDateInput.module.js.map +1 -0
- package/dist/Link.main.js +7 -1
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +7 -1
- package/dist/Link.module.js +7 -1
- package/dist/Link.module.js.map +1 -1
- package/dist/ListBox.main.js +22 -19
- package/dist/ListBox.main.js.map +1 -1
- package/dist/ListBox.mjs +23 -20
- package/dist/ListBox.module.js +23 -20
- package/dist/ListBox.module.js.map +1 -1
- package/dist/Menu.main.js +15 -8
- package/dist/Menu.main.js.map +1 -1
- package/dist/Menu.mjs +16 -9
- package/dist/Menu.module.js +16 -9
- package/dist/Menu.module.js.map +1 -1
- package/dist/Meter.main.js +6 -2
- package/dist/Meter.main.js.map +1 -1
- package/dist/Meter.mjs +6 -2
- package/dist/Meter.module.js +6 -2
- package/dist/Meter.module.js.map +1 -1
- package/dist/Modal.main.js +31 -6
- package/dist/Modal.main.js.map +1 -1
- package/dist/Modal.mjs +31 -6
- package/dist/Modal.module.js +31 -6
- package/dist/Modal.module.js.map +1 -1
- package/dist/NumberField.main.js +4 -1
- package/dist/NumberField.main.js.map +1 -1
- package/dist/NumberField.mjs +4 -1
- package/dist/NumberField.module.js +4 -1
- package/dist/NumberField.module.js.map +1 -1
- package/dist/Popover.main.js +3 -1
- package/dist/Popover.main.js.map +1 -1
- package/dist/Popover.mjs +3 -1
- package/dist/Popover.module.js +3 -1
- package/dist/Popover.module.js.map +1 -1
- package/dist/ProgressBar.main.js +6 -2
- package/dist/ProgressBar.main.js.map +1 -1
- package/dist/ProgressBar.mjs +6 -2
- package/dist/ProgressBar.module.js +6 -2
- package/dist/ProgressBar.module.js.map +1 -1
- package/dist/RadioGroup.main.js +8 -3
- package/dist/RadioGroup.main.js.map +1 -1
- package/dist/RadioGroup.mjs +9 -4
- package/dist/RadioGroup.module.js +9 -4
- package/dist/RadioGroup.module.js.map +1 -1
- package/dist/SearchField.main.js +3 -1
- package/dist/SearchField.main.js.map +1 -1
- package/dist/SearchField.mjs +3 -1
- package/dist/SearchField.module.js +3 -1
- package/dist/SearchField.module.js.map +1 -1
- package/dist/Select.main.js +12 -14
- package/dist/Select.main.js.map +1 -1
- package/dist/Select.mjs +13 -15
- package/dist/Select.module.js +13 -15
- package/dist/Select.module.js.map +1 -1
- package/dist/Separator.main.js +4 -2
- package/dist/Separator.main.js.map +1 -1
- package/dist/Separator.mjs +5 -3
- package/dist/Separator.module.js +5 -3
- package/dist/Separator.module.js.map +1 -1
- package/dist/Slider.main.js +7 -5
- package/dist/Slider.main.js.map +1 -1
- package/dist/Slider.mjs +8 -6
- package/dist/Slider.module.js +8 -6
- package/dist/Slider.module.js.map +1 -1
- package/dist/Switch.main.js +4 -1
- package/dist/Switch.main.js.map +1 -1
- package/dist/Switch.mjs +4 -1
- package/dist/Switch.module.js +4 -1
- package/dist/Switch.module.js.map +1 -1
- package/dist/Table.main.js +47 -26
- package/dist/Table.main.js.map +1 -1
- package/dist/Table.mjs +48 -27
- package/dist/Table.module.js +48 -27
- package/dist/Table.module.js.map +1 -1
- package/dist/Tabs.main.js +20 -10
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +21 -11
- package/dist/Tabs.module.js +21 -11
- package/dist/Tabs.module.js.map +1 -1
- package/dist/TagGroup.main.js +14 -8
- package/dist/TagGroup.main.js.map +1 -1
- package/dist/TagGroup.mjs +14 -8
- package/dist/TagGroup.module.js +14 -8
- package/dist/TagGroup.module.js.map +1 -1
- package/dist/TextField.main.js +13 -1
- package/dist/TextField.main.js.map +1 -1
- package/dist/TextField.mjs +13 -1
- package/dist/TextField.module.js +13 -1
- package/dist/TextField.module.js.map +1 -1
- package/dist/Toast.main.js +9 -5
- package/dist/Toast.main.js.map +1 -1
- package/dist/Toast.mjs +9 -5
- package/dist/Toast.module.js +9 -5
- package/dist/Toast.module.js.map +1 -1
- package/dist/ToggleButton.main.js +8 -2
- package/dist/ToggleButton.main.js.map +1 -1
- package/dist/ToggleButton.mjs +8 -2
- package/dist/ToggleButton.module.js +8 -2
- package/dist/ToggleButton.module.js.map +1 -1
- package/dist/ToggleButtonGroup.main.js +6 -2
- package/dist/ToggleButtonGroup.main.js.map +1 -1
- package/dist/ToggleButtonGroup.mjs +6 -2
- package/dist/ToggleButtonGroup.module.js +6 -2
- package/dist/ToggleButtonGroup.module.js.map +1 -1
- package/dist/Toolbar.main.js +4 -3
- package/dist/Toolbar.main.js.map +1 -1
- package/dist/Toolbar.mjs +4 -3
- package/dist/Toolbar.module.js +4 -3
- package/dist/Toolbar.module.js.map +1 -1
- package/dist/Tooltip.main.js +5 -3
- package/dist/Tooltip.main.js.map +1 -1
- package/dist/Tooltip.mjs +5 -3
- package/dist/Tooltip.module.js +5 -3
- package/dist/Tooltip.module.js.map +1 -1
- package/dist/Tree.main.js +73 -26
- package/dist/Tree.main.js.map +1 -1
- package/dist/Tree.mjs +74 -27
- package/dist/Tree.module.js +74 -27
- package/dist/Tree.module.js.map +1 -1
- package/dist/TreeDropTargetDelegate.main.js +8 -5
- package/dist/TreeDropTargetDelegate.main.js.map +1 -1
- package/dist/TreeDropTargetDelegate.mjs +8 -5
- package/dist/TreeDropTargetDelegate.module.js +8 -5
- package/dist/TreeDropTargetDelegate.module.js.map +1 -1
- package/dist/import.mjs +5 -5
- package/dist/main.js +4 -4
- package/dist/main.js.map +1 -1
- package/dist/module.js +5 -5
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +212 -203
- package/dist/types.d.ts.map +1 -1
- package/dist/useDragAndDrop.main.js.map +1 -1
- package/dist/useDragAndDrop.module.js.map +1 -1
- package/dist/utils.main.js.map +1 -1
- package/dist/utils.module.js.map +1 -1
- package/i18n/de-DE.js +1 -1
- package/i18n/de-DE.mjs +1 -1
- package/package.json +25 -25
- package/src/Breadcrumbs.tsx +10 -6
- package/src/Button.tsx +8 -30
- package/src/Calendar.tsx +41 -24
- package/src/Checkbox.tsx +8 -6
- package/src/Collection.tsx +2 -2
- package/src/ColorArea.tsx +5 -6
- package/src/ColorField.tsx +6 -4
- package/src/ColorSlider.tsx +3 -2
- package/src/ColorSwatch.tsx +6 -3
- package/src/ColorSwatchPicker.tsx +3 -3
- package/src/ColorThumb.tsx +3 -3
- package/src/ColorWheel.tsx +6 -5
- package/src/ComboBox.tsx +4 -4
- package/src/DateField.tsx +15 -10
- package/src/DatePicker.tsx +14 -12
- package/src/Dialog.tsx +6 -6
- package/src/Disclosure.tsx +10 -14
- package/src/DragAndDrop.tsx +31 -1
- package/src/DropZone.tsx +4 -5
- package/src/FieldError.tsx +3 -3
- package/src/FileTrigger.tsx +4 -3
- package/src/Form.tsx +2 -1
- package/src/GridList.tsx +25 -18
- package/src/HiddenDateInput.tsx +142 -0
- package/src/Link.tsx +7 -3
- package/src/ListBox.tsx +30 -26
- package/src/Menu.tsx +15 -12
- package/src/Meter.tsx +6 -3
- package/src/Modal.tsx +16 -5
- package/src/NumberField.tsx +4 -4
- package/src/Popover.tsx +3 -3
- package/src/ProgressBar.tsx +6 -2
- package/src/RadioGroup.tsx +8 -6
- package/src/SearchField.tsx +3 -2
- package/src/Select.tsx +13 -16
- package/src/Separator.tsx +6 -4
- package/src/Slider.tsx +9 -11
- package/src/Switch.tsx +4 -3
- package/src/Table.tsx +58 -56
- package/src/Tabs.tsx +18 -15
- package/src/TagGroup.tsx +13 -12
- package/src/TextField.tsx +5 -2
- package/src/Toast.tsx +10 -8
- package/src/ToggleButton.tsx +8 -4
- package/src/ToggleButtonGroup.tsx +6 -4
- package/src/Toolbar.tsx +4 -5
- package/src/Tooltip.tsx +6 -5
- package/src/Tree.tsx +90 -42
- package/src/TreeDropTargetDelegate.ts +5 -1
- package/src/index.ts +8 -8
- package/src/useDragAndDrop.tsx +2 -2
- package/src/utils.tsx +9 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAwCM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAkD;AACzF,MAAM,0DAA0B,CAAA,GAAA,0BAAY,EAA2B;AAKvE,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,YAAY,KAAuB,EAAE,GAAiC;IACrJ,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,UAAC,MAAM,EAAC,GAAG,CAAA,GAAA,0BAAQ;IACvB,IAAI,QAAQ,CAAA,GAAA,uCAAkB,EAAE;QAC9B,GAAG,KAAK;gBACR;4BACA;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,mBAAK,EAAoB;IACxC,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,C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QACX,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,WAAW,SAAS,IAAI;QACvC,MAAM,IAAI,kBAAI,0DAAC;QAAM,MAAK;QAAS,MAAM,MAAM,IAAI;QAAE,MAAM,MAAM,IAAI;QAAE,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAGtI","sources":["packages/react-aria-components/src/NumberField.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 */\n\nimport {AriaNumberFieldProps, useLocale, useNumberField} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, InputDOMProps} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport {NumberFieldState, useNumberFieldState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface NumberFieldRenderProps {\n /**\n * Whether the number field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the number field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the number field is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * State of the number field.\n */\n state: NumberFieldState\n}\n\nexport interface NumberFieldProps extends Omit<AriaNumberFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, InputDOMProps, RenderProps<NumberFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const NumberFieldContext = createContext<ContextValue<NumberFieldProps, HTMLDivElement>>(null);\nexport const NumberFieldStateContext = createContext<NumberFieldState | null>(null);\n\n/**\n * A number field allows a user to enter a number, and increment or decrement the value using stepper buttons.\n */\nexport const NumberField = /*#__PURE__*/ (forwardRef as forwardRefType)(function NumberField(props: NumberFieldProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, NumberFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useNumberFieldState({\n ...props,\n locale,\n validationBehavior\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n labelProps,\n groupProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useNumberField({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n },\n defaultClassName: 'react-aria-NumberField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [NumberFieldStateContext, state],\n [GroupContext, groupProps],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef}],\n [ButtonContext, {\n slots: {\n increment: incrementButtonProps,\n decrement: decrementButtonProps\n }\n }],\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-disabled={props.isDisabled || undefined}\n data-required={props.isRequired || undefined}\n data-invalid={validation.isInvalid || undefined} />\n {props.name && <input type=\"hidden\" name={props.name} form={props.form} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"NumberField.main.js.map"}
|
package/dist/NumberField.mjs
CHANGED
|
@@ -63,7 +63,9 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $a4EfP$forwa
|
|
|
63
63
|
},
|
|
64
64
|
defaultClassName: 'react-aria-NumberField'
|
|
65
65
|
});
|
|
66
|
-
let DOMProps = (0, $a4EfP$filterDOMProps)(props
|
|
66
|
+
let DOMProps = (0, $a4EfP$filterDOMProps)(props, {
|
|
67
|
+
global: true
|
|
68
|
+
});
|
|
67
69
|
delete DOMProps.id;
|
|
68
70
|
return /*#__PURE__*/ (0, $a4EfP$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
69
71
|
values: [
|
|
@@ -123,6 +125,7 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $a4EfP$forwa
|
|
|
123
125
|
}), props.name && /*#__PURE__*/ (0, $a4EfP$react).createElement("input", {
|
|
124
126
|
type: "hidden",
|
|
125
127
|
name: props.name,
|
|
128
|
+
form: props.form,
|
|
126
129
|
value: isNaN(state.numberValue) ? '' : state.numberValue
|
|
127
130
|
}));
|
|
128
131
|
});
|
|
@@ -63,7 +63,9 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $a4EfP$forwa
|
|
|
63
63
|
},
|
|
64
64
|
defaultClassName: 'react-aria-NumberField'
|
|
65
65
|
});
|
|
66
|
-
let DOMProps = (0, $a4EfP$filterDOMProps)(props
|
|
66
|
+
let DOMProps = (0, $a4EfP$filterDOMProps)(props, {
|
|
67
|
+
global: true
|
|
68
|
+
});
|
|
67
69
|
delete DOMProps.id;
|
|
68
70
|
return /*#__PURE__*/ (0, $a4EfP$react).createElement((0, $64fa3d84918910a7$export$2881499e37b75b9a), {
|
|
69
71
|
values: [
|
|
@@ -123,6 +125,7 @@ const $b91743d66a0ed188$export$63c5fa0b2fdccd2e = /*#__PURE__*/ (0, $a4EfP$forwa
|
|
|
123
125
|
}), props.name && /*#__PURE__*/ (0, $a4EfP$react).createElement("input", {
|
|
124
126
|
type: "hidden",
|
|
125
127
|
name: props.name,
|
|
128
|
+
form: props.form,
|
|
126
129
|
value: isNaN(state.numberValue) ? '' : state.numberValue
|
|
127
130
|
}));
|
|
128
131
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;;;;AAwCM,MAAM,0DAAqB,CAAA,GAAA,oBAAY,EAAkD;AACzF,MAAM,0DAA0B,CAAA,GAAA,oBAAY,EAA2B;AAKvE,MAAM,4CAA4B,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,YAAY,KAAuB,EAAE,GAAiC;IACrJ,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;IACvB,IAAI,QAAQ,CAAA,GAAA,0BAAkB,EAAE;QAC9B,GAAG,KAAK;gBACR;4BACA;IACF;IAEA,IAAI,WAAW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c;oBAChB;gBACF;aAAE;YACF;gBAAC,CAAA,GAAA,yCAAgB;gBAAG;aAAW;SAChC;qBACD,gCAAC;QACE,GAAG,QAAQ;QACX,GAAG,WAAW;QACf,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,iBAAe,MAAM,UAAU,IAAI;QACnC,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,WAAW,SAAS,IAAI;QACvC,MAAM,IAAI,kBAAI,gCAAC;QAAM,MAAK;QAAS,MAAM,MAAM,IAAI;QAAE,MAAM,MAAM,IAAI;QAAE,OAAO,MAAM,MAAM,WAAW,IAAI,KAAK,MAAM,WAAW;;AAGtI","sources":["packages/react-aria-components/src/NumberField.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 */\n\nimport {AriaNumberFieldProps, useLocale, useNumberField} from 'react-aria';\nimport {ButtonContext} from './Button';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, InputDOMProps} from '@react-types/shared';\nimport {GroupContext} from './Group';\nimport {InputContext} from './Input';\nimport {LabelContext} from './Label';\nimport {NumberFieldState, useNumberFieldState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useRef} from 'react';\nimport {TextContext} from './Text';\n\nexport interface NumberFieldRenderProps {\n /**\n * Whether the number field is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the number field is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the number field is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * State of the number field.\n */\n state: NumberFieldState\n}\n\nexport interface NumberFieldProps extends Omit<AriaNumberFieldProps, 'label' | 'placeholder' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, InputDOMProps, RenderProps<NumberFieldRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const NumberFieldContext = createContext<ContextValue<NumberFieldProps, HTMLDivElement>>(null);\nexport const NumberFieldStateContext = createContext<NumberFieldState | null>(null);\n\n/**\n * A number field allows a user to enter a number, and increment or decrement the value using stepper buttons.\n */\nexport const NumberField = /*#__PURE__*/ (forwardRef as forwardRefType)(function NumberField(props: NumberFieldProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, NumberFieldContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let {locale} = useLocale();\n let state = useNumberFieldState({\n ...props,\n locale,\n validationBehavior\n });\n\n let inputRef = useRef<HTMLInputElement>(null);\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n labelProps,\n groupProps,\n inputProps,\n incrementButtonProps,\n decrementButtonProps,\n descriptionProps,\n errorMessageProps,\n ...validation\n } = useNumberField({\n ...removeDataAttributes(props),\n label,\n validationBehavior\n }, state, inputRef);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n state,\n isDisabled: props.isDisabled || false,\n isInvalid: validation.isInvalid || false,\n isRequired: props.isRequired || false\n },\n defaultClassName: 'react-aria-NumberField'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <Provider\n values={[\n [NumberFieldStateContext, state],\n [GroupContext, groupProps],\n [InputContext, {...inputProps, ref: inputRef}],\n [LabelContext, {...labelProps, ref: labelRef}],\n [ButtonContext, {\n slots: {\n increment: incrementButtonProps,\n decrement: decrementButtonProps\n }\n }],\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-disabled={props.isDisabled || undefined}\n data-required={props.isRequired || undefined}\n data-invalid={validation.isInvalid || undefined} />\n {props.name && <input type=\"hidden\" name={props.name} form={props.form} value={isNaN(state.numberValue) ? '' : state.numberValue} />}\n </Provider>\n );\n});\n"],"names":[],"version":3,"file":"NumberField.module.js.map"}
|
package/dist/Popover.main.js
CHANGED
|
@@ -138,7 +138,9 @@ function $61e2b7078adb18bc$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
138
138
|
...renderProps.style
|
|
139
139
|
};
|
|
140
140
|
let overlay = /*#__PURE__*/ (0, ($parcel$interopDefault($4DQW2$react))).createElement("div", {
|
|
141
|
-
...(0, $4DQW2$reactariautils.mergeProps)((0, $4DQW2$reactariautils.filterDOMProps)(props
|
|
141
|
+
...(0, $4DQW2$reactariautils.mergeProps)((0, $4DQW2$reactariautils.filterDOMProps)(props, {
|
|
142
|
+
global: true
|
|
143
|
+
}), popoverProps),
|
|
142
144
|
...renderProps,
|
|
143
145
|
role: isDialog ? 'dialog' : undefined,
|
|
144
146
|
tabIndex: isDialog ? -1 : undefined,
|
package/dist/Popover.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA6EM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAkD;AAE5F,iFAAiF;AACjF,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAoC;AAKrE,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE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OAClC;QASgF;IAF3F,qEAAqE;IACrE,qBACE,0DAAC,CAAA,GAAA,wBAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB,CAAA,OAAA,qCAAA,sCAAA,2BAA4B,qBAAA,+BAAA,SAAU,OAAO,cAA7C,kBAAA,OAAiD;OACvI;AAGP","sources":["packages/react-aria-components/src/Popover.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 */\n\nimport {AriaLabelingProps, forwardRefType, RefObject} from '@react-types/shared';\nimport {AriaPopoverProps, DismissButton, Overlay, PlacementAxis, PositionProps, useLocale, usePopover} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {focusSafely} from '@react-aria/interactions';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {Context, createContext, ForwardedRef, forwardRef, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {useIsHidden} from '@react-aria/collections';\n\nexport interface PopoverProps extends Omit<PositionProps, 'isOpen'>, Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>, OverlayTriggerProps, RenderProps<PopoverRenderProps>, SlotProps, AriaLabelingProps {\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string,\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null,\n /**\n * The placement of the popover relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\ninterface PopoverContextValue extends PopoverProps {\n /** Contexts to clear. */\n clearContexts?: Context<any>[]\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverContextValue, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(props: PopoverProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction} />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState,\n isEntering?: boolean,\n isExiting: boolean,\n UNSTABLE_portalContainer?: Element,\n trigger?: string,\n dir?: 'ltr' | 'rtl',\n clearContexts?: Context<any>[]\n}\n\nfunction PopoverInner({state, isExiting, UNSTABLE_portalContainer, clearContexts, ...props}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {popoverProps, underlayProps, arrowProps, placement} = usePopover({\n ...props,\n offset: props.offset ?? 8,\n arrowSize: arrowWidth,\n // If this is a submenu/subdialog, use the root popover's container\n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n }, state);\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n useEffect(() => {\n if (isDialog && ref.current && !ref.current.contains(document.activeElement)) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref]);\n\n let children = useMemo(() => {\n let children = renderProps.children;\n if (clearContexts) {\n for (let Context of clearContexts) {\n children = <Context.Provider value={null}>{children}</Context.Provider>;\n }\n }\n return children;\n }, [renderProps.children, clearContexts]);\n\n let style = {...popoverProps.style, ...renderProps.style};\n let overlay = (\n <div\n {...mergeProps(filterDOMProps(props as any), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA6EM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAAkD;AAE5F,iFAAiF;AACjF,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAoC;AAKrE,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAA8B;IACtI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAe,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,oDAAyB;IACvD,IAAI,aAAa,CAAA,GAAA,0CAAqB,EAAE;IACxC,IAAI,QAAQ,MAAM,MAAM,IAAI,QAAQ,MAAM,WAAW,IAAI,QAAQ,CAAC,eAAe,aAAa;IAC9F,IAAI,YAAY,CAAA,GAAA,sCAAe,EAAE,KAAK,MAAM,MAAM,KAAK,MAAM,SAAS,IAAI;IAC1E,IAAI,WAAW,CAAA,GAAA,uCAAU;IACzB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,0BAAQ;IAE1B,sEAAsE;IACtE,IAAI,UAAU;QACZ,IAAI,WAAW,MAAM,QAAQ;QAC7B,IAAI,OAAO,aAAa,YACtB,WAAW,SAAS;YAClB,SAAS,MAAM,OAAO,IAAI;YAC1B,WAAW;YACX,YAAY;YACZ,WAAW;YACX,iBAAi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AAa;OAC1B,CAAC,MAAM,UAAU,kBAAI,0DAAC,CAAA,GAAA,8BAAY;QAAE,WAAW,MAAM,KAAK;sBAC3D,0DAAC,CAAA,GAAA,6CAAkB,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;uBAAE;YAAW,KAAK;QAAQ;OAC1E,yBAEH,0DAAC,CAAA,GAAA,8BAAY;QAAE,WAAW,MAAM,KAAK;;IAIzC,yGAAyG;IACzG,IAAI,CAAC,cACH,qBACE,0DAAC,CAAA,GAAA,wBAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB;OACtF,CAAC,MAAM,UAAU,IAAI,MAAM,MAAM,kBAAI,0DAAC;QAAI,eAAY;QAAY,GAAG,aAAa;QAAE,OAAO;YAAC,UAAU;YAAS,OAAO;QAAC;sBACxH,0DAAC;QAAI,KAAK;QAAc,OAAO;YAAC,SAAS;QAAU;qBACjD,0DAAC,0CAAoB,QAAQ;QAAC,OAAO;OAClC;QASgF;IAF3F,qEAAqE;IACrE,qBACE,0DAAC,CAAA,GAAA,wBAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB,CAAA,OAAA,qCAAA,sCAAA,2BAA4B,qBAAA,+BAAA,SAAU,OAAO,cAA7C,kBAAA,OAAiD;OACvI;AAGP","sources":["packages/react-aria-components/src/Popover.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 */\n\nimport {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {AriaPopoverProps, DismissButton, Overlay, PlacementAxis, PositionProps, useLocale, usePopover} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {focusSafely} from '@react-aria/interactions';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {Context, createContext, ForwardedRef, forwardRef, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {useIsHidden} from '@react-aria/collections';\n\nexport interface PopoverProps extends Omit<PositionProps, 'isOpen'>, Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>, OverlayTriggerProps, RenderProps<PopoverRenderProps>, SlotProps, AriaLabelingProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string,\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null,\n /**\n * The placement of the popover relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\ninterface PopoverContextValue extends PopoverProps {\n /** Contexts to clear. */\n clearContexts?: Context<any>[]\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverContextValue, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(props: PopoverProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction} />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState,\n isEntering?: boolean,\n isExiting: boolean,\n UNSTABLE_portalContainer?: Element,\n trigger?: string,\n dir?: 'ltr' | 'rtl',\n clearContexts?: Context<any>[]\n}\n\nfunction PopoverInner({state, isExiting, UNSTABLE_portalContainer, clearContexts, ...props}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {popoverProps, underlayProps, arrowProps, placement} = usePopover({\n ...props,\n offset: props.offset ?? 8,\n arrowSize: arrowWidth,\n // If this is a submenu/subdialog, use the root popover's container\n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n }, state);\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n useEffect(() => {\n if (isDialog && ref.current && !ref.current.contains(document.activeElement)) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref]);\n\n let children = useMemo(() => {\n let children = renderProps.children;\n if (clearContexts) {\n for (let Context of clearContexts) {\n children = <Context.Provider value={null}>{children}</Context.Provider>;\n }\n }\n return children;\n }, [renderProps.children, clearContexts]);\n\n let style = {...popoverProps.style, ...renderProps.style};\n let overlay = (\n <div\n {...mergeProps(filterDOMProps(props, {global: true}), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.main.js.map"}
|
package/dist/Popover.mjs
CHANGED
|
@@ -127,7 +127,9 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
127
127
|
...renderProps.style
|
|
128
128
|
};
|
|
129
129
|
let overlay = /*#__PURE__*/ (0, $ehFet$react).createElement("div", {
|
|
130
|
-
...(0, $ehFet$mergeProps)((0, $ehFet$filterDOMProps)(props
|
|
130
|
+
...(0, $ehFet$mergeProps)((0, $ehFet$filterDOMProps)(props, {
|
|
131
|
+
global: true
|
|
132
|
+
}), popoverProps),
|
|
131
133
|
...renderProps,
|
|
132
134
|
role: isDialog ? 'dialog' : undefined,
|
|
133
135
|
tabIndex: isDialog ? -1 : undefined,
|
package/dist/Popover.module.js
CHANGED
|
@@ -127,7 +127,9 @@ function $07b14b47974efb58$var$PopoverInner({ state: state, isExiting: isExiting
|
|
|
127
127
|
...renderProps.style
|
|
128
128
|
};
|
|
129
129
|
let overlay = /*#__PURE__*/ (0, $ehFet$react).createElement("div", {
|
|
130
|
-
...(0, $ehFet$mergeProps)((0, $ehFet$filterDOMProps)(props
|
|
130
|
+
...(0, $ehFet$mergeProps)((0, $ehFet$filterDOMProps)(props, {
|
|
131
|
+
global: true
|
|
132
|
+
}), popoverProps),
|
|
131
133
|
...renderProps,
|
|
132
134
|
role: isDialog ? 'dialog' : undefined,
|
|
133
135
|
tabIndex: isDialog ? -1 : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AA6EM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAAkD;AAE5F,iFAAiF;AACjF,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAoC;AAKrE,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAA8B;IACtI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,eAAe,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wCAAyB;IACvD,IAAI,aAAa,CAAA,GAAA,6BAAqB,EAAE;IACxC,IAAI,QAAQ,MAAM,MAAM,IAAI,QAAQ,MAAM,WAAW,IAAI,QAAQ,CAAC,eAAe,aAAa;IAC9F,IAAI,YAAY,CAAA,GAAA,uBAAe,EAAE,KAAK,MAAM,MAAM,KAAK,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;QACf,MAAM,WAAW,WAAW;QAC5B,UAAU,WAAW,KAAK;QAC1B,cAAY,KAAK,CAAC,aAAa;QAC/B,mBAAiB,KAAK,CAAC,kBAAkB;QACzC,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,OAAO;QACP,KAAK,MAAM,GAAG;QACd,gBAAc,MAAM,OAAO;QAC3B,kBAAgB;QAChB,iBAAe,cAAc;QAC7B,gBAAc,aAAa;OAC1B,CAAC,MAAM,UAAU,kBAAI,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM,KAAK;sBAC3D,gCAAC,CAAA,GAAA,yCAAkB,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;uBAAE;YAAW,KAAK;QAAQ;OAC1E,yBAEH,gCAAC,CAAA,GAAA,oBAAY;QAAE,WAAW,MAAM,KAAK;;IAIzC,yGAAyG;IACzG,IAAI,CAAC,cACH,qBACE,gCAAC,CAAA,GAAA,cAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB;OACtF,CAAC,MAAM,UAAU,IAAI,MAAM,MAAM,kBAAI,gCAAC;QAAI,eAAY;QAAY,GAAG,aAAa;QAAE,OAAO;YAAC,UAAU;YAAS,OAAO;QAAC;sBACxH,gCAAC;QAAI,KAAK;QAAc,OAAO;YAAC,SAAS;QAAU;qBACjD,gCAAC,0CAAoB,QAAQ;QAAC,OAAO;OAClC;QASgF;IAF3F,qEAAqE;IACrE,qBACE,gCAAC,CAAA,GAAA,cAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB,CAAA,OAAA,qCAAA,sCAAA,2BAA4B,qBAAA,+BAAA,SAAU,OAAO,cAA7C,kBAAA,OAAiD;OACvI;AAGP","sources":["packages/react-aria-components/src/Popover.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 */\n\nimport {AriaLabelingProps, forwardRefType, RefObject} from '@react-types/shared';\nimport {AriaPopoverProps, DismissButton, Overlay, PlacementAxis, PositionProps, useLocale, usePopover} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {focusSafely} from '@react-aria/interactions';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {Context, createContext, ForwardedRef, forwardRef, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {useIsHidden} from '@react-aria/collections';\n\nexport interface PopoverProps extends Omit<PositionProps, 'isOpen'>, Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>, OverlayTriggerProps, RenderProps<PopoverRenderProps>, SlotProps, AriaLabelingProps {\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string,\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null,\n /**\n * The placement of the popover relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\ninterface PopoverContextValue extends PopoverProps {\n /** Contexts to clear. */\n clearContexts?: Context<any>[]\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverContextValue, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(props: PopoverProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction} />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState,\n isEntering?: boolean,\n isExiting: boolean,\n UNSTABLE_portalContainer?: Element,\n trigger?: string,\n dir?: 'ltr' | 'rtl',\n clearContexts?: Context<any>[]\n}\n\nfunction PopoverInner({state, isExiting, UNSTABLE_portalContainer, clearContexts, ...props}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {popoverProps, underlayProps, arrowProps, placement} = usePopover({\n ...props,\n offset: props.offset ?? 8,\n arrowSize: arrowWidth,\n // If this is a submenu/subdialog, use the root popover's container\n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n }, state);\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n useEffect(() => {\n if (isDialog && ref.current && !ref.current.contains(document.activeElement)) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref]);\n\n let children = useMemo(() => {\n let children = renderProps.children;\n if (clearContexts) {\n for (let Context of clearContexts) {\n children = <Context.Provider value={null}>{children}</Context.Provider>;\n }\n }\n return children;\n }, [renderProps.children, clearContexts]);\n\n let style = {...popoverProps.style, ...renderProps.style};\n let overlay = (\n <div\n {...mergeProps(filterDOMProps(props as any), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;AAAA;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AAW;QAAW,iBAAiB;OACtF,CAAC,MAAM,UAAU,IAAI,MAAM,MAAM,kBAAI,gCAAC;QAAI,eAAY;QAAY,GAAG,aAAa;QAAE,OAAO;YAAC,UAAU;YAAS,OAAO;QAAC;sBACxH,gCAAC;QAAI,KAAK;QAAc,OAAO;YAAC,SAAS;QAAU;qBACjD,gCAAC,0CAAoB,QAAQ;QAAC,OAAO;OAClC;QASgF;IAF3F,qEAAqE;IACrE,qBACE,gCAAC,CAAA,GAAA,cAAM;QAAG,GAAG,KAAK;QAAE,oBAAoB;QAAU,WAAW;QAAW,iBAAiB,CAAA,OAAA,qCAAA,sCAAA,2BAA4B,qBAAA,+BAAA,SAAU,OAAO,cAA7C,kBAAA,OAAiD;OACvI;AAGP","sources":["packages/react-aria-components/src/Popover.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 */\n\nimport {AriaLabelingProps, forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {AriaPopoverProps, DismissButton, Overlay, PlacementAxis, PositionProps, useLocale, usePopover} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {focusSafely} from '@react-aria/interactions';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, OverlayTriggerState, useOverlayTriggerState} from 'react-stately';\nimport {OverlayTriggerStateContext} from './Dialog';\nimport React, {Context, createContext, ForwardedRef, forwardRef, useContext, useEffect, useMemo, useRef, useState} from 'react';\nimport {useIsHidden} from '@react-aria/collections';\n\nexport interface PopoverProps extends Omit<PositionProps, 'isOpen'>, Omit<AriaPopoverProps, 'popoverRef' | 'triggerRef' | 'groupRef' | 'offset' | 'arrowSize'>, OverlayTriggerProps, RenderProps<PopoverRenderProps>, SlotProps, AriaLabelingProps, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The name of the component that triggered the popover. This is reflected on the element\n * as the `data-trigger` attribute, and can be used to provide specific\n * styles for the popover depending on which element triggered it.\n */\n trigger?: string,\n /**\n * The ref for the element which the popover positions itself with respect to.\n *\n * When used within a trigger component such as DialogTrigger, MenuTrigger, Select, etc.,\n * this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the popover is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the popover is currently performing an exit animation.\n */\n isExiting?: boolean,\n /**\n * The container element in which the overlay portal will be placed. This may have unknown behavior depending on where it is portalled to.\n * @default document.body\n * @deprecated - Use a parent UNSAFE_PortalProvider to set your portal container instead.\n */\n UNSTABLE_portalContainer?: Element,\n /**\n * The additional offset applied along the main axis between the element and its\n * anchor element.\n * @default 8\n */\n offset?: number\n}\n\nexport interface PopoverRenderProps {\n /**\n * The name of the component that triggered the popover, e.g. \"DialogTrigger\" or \"ComboBox\".\n * @selector [data-trigger=\"...\"]\n */\n trigger: string | null,\n /**\n * The placement of the popover relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the popover is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the popover is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean\n}\n\ninterface PopoverContextValue extends PopoverProps {\n /** Contexts to clear. */\n clearContexts?: Context<any>[]\n}\n\nexport const PopoverContext = createContext<ContextValue<PopoverContextValue, HTMLElement>>(null);\n\n// Stores a ref for the portal container for a group of popovers (e.g. submenus).\nconst PopoverGroupContext = createContext<RefObject<Element | null> | null>(null);\n\n/**\n * A popover is an overlay element positioned relative to a trigger.\n */\nexport const Popover = /*#__PURE__*/ (forwardRef as forwardRefType)(function Popover(props: PopoverProps, ref: ForwardedRef<HTMLElement>) {\n [props, ref] = useContextProps(props, ref, PopoverContext);\n let contextState = useContext(OverlayTriggerStateContext);\n let localState = useOverlayTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n let isHidden = useIsHidden();\n let {direction} = useLocale();\n\n // If we are in a hidden tree, we still need to preserve our children.\n if (isHidden) {\n let children = props.children;\n if (typeof children === 'function') {\n children = children({\n trigger: props.trigger || null,\n placement: 'bottom',\n isEntering: false,\n isExiting: false,\n defaultChildren: null\n });\n }\n\n return <>{children}</>;\n }\n\n if (state && !state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <PopoverInner\n {...props}\n triggerRef={props.triggerRef!}\n state={state}\n popoverRef={ref}\n isExiting={isExiting}\n dir={direction} />\n );\n});\n\ninterface PopoverInnerProps extends AriaPopoverProps, RenderProps<PopoverRenderProps>, SlotProps {\n state: OverlayTriggerState,\n isEntering?: boolean,\n isExiting: boolean,\n UNSTABLE_portalContainer?: Element,\n trigger?: string,\n dir?: 'ltr' | 'rtl',\n clearContexts?: Context<any>[]\n}\n\nfunction PopoverInner({state, isExiting, UNSTABLE_portalContainer, clearContexts, ...props}: PopoverInnerProps) {\n // Calculate the arrow size internally (and remove props.arrowSize from PopoverProps)\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n let containerRef = useRef<HTMLDivElement | null>(null);\n let groupCtx = useContext(PopoverGroupContext);\n let isSubPopover = groupCtx && props.trigger === 'SubmenuTrigger';\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {popoverProps, underlayProps, arrowProps, placement} = usePopover({\n ...props,\n offset: props.offset ?? 8,\n arrowSize: arrowWidth,\n // If this is a submenu/subdialog, use the root popover's container\n // to detect outside interaction and add aria-hidden.\n groupRef: isSubPopover ? groupCtx! : containerRef\n }, state);\n\n let ref = props.popoverRef as RefObject<HTMLDivElement | null>;\n let isEntering = useEnterAnimation(ref, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Popover',\n values: {\n trigger: props.trigger || null,\n placement,\n isEntering,\n isExiting\n }\n });\n\n // Automatically render Popover with role=dialog except when isNonModal is true,\n // or a dialog is already nested inside the popover.\n let shouldBeDialog = !props.isNonModal || props.trigger === 'SubmenuTrigger';\n let [isDialog, setDialog] = useState(false);\n useLayoutEffect(() => {\n if (ref.current) {\n setDialog(shouldBeDialog && !ref.current.querySelector('[role=dialog]'));\n }\n }, [ref, shouldBeDialog]);\n\n // Focus the popover itself on mount, unless a child element is already focused.\n useEffect(() => {\n if (isDialog && ref.current && !ref.current.contains(document.activeElement)) {\n focusSafely(ref.current);\n }\n }, [isDialog, ref]);\n\n let children = useMemo(() => {\n let children = renderProps.children;\n if (clearContexts) {\n for (let Context of clearContexts) {\n children = <Context.Provider value={null}>{children}</Context.Provider>;\n }\n }\n return children;\n }, [renderProps.children, clearContexts]);\n\n let style = {...popoverProps.style, ...renderProps.style};\n let overlay = (\n <div\n {...mergeProps(filterDOMProps(props, {global: true}), popoverProps)}\n {...renderProps}\n role={isDialog ? 'dialog' : undefined}\n tabIndex={isDialog ? -1 : undefined}\n aria-label={props['aria-label']}\n aria-labelledby={props['aria-labelledby']}\n ref={ref}\n slot={props.slot || undefined}\n style={style}\n dir={props.dir}\n data-trigger={props.trigger}\n data-placement={placement}\n data-entering={isEntering || undefined}\n data-exiting={isExiting || undefined}>\n {!props.isNonModal && <DismissButton onDismiss={state.close} />}\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {children}\n </OverlayArrowContext.Provider>\n <DismissButton onDismiss={state.close} />\n </div>\n );\n\n // If this is a root popover, render an extra div to act as the portal container for submenus/subdialogs.\n if (!isSubPopover) {\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer}>\n {!props.isNonModal && state.isOpen && <div data-testid=\"underlay\" {...underlayProps} style={{position: 'fixed', inset: 0}} />}\n <div ref={containerRef} style={{display: 'contents'}}>\n <PopoverGroupContext.Provider value={containerRef}>\n {overlay}\n </PopoverGroupContext.Provider>\n </div>\n </Overlay>\n );\n }\n\n // Submenus/subdialogs are mounted into the root popover's container.\n return (\n <Overlay {...props} shouldContainFocus={isDialog} isExiting={isExiting} portalContainer={UNSTABLE_portalContainer ?? groupCtx?.current ?? undefined}>\n {overlay}\n </Overlay>\n );\n}\n"],"names":[],"version":3,"file":"Popover.module.js.map"}
|
package/dist/ProgressBar.main.js
CHANGED
|
@@ -2,6 +2,7 @@ var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
|
2
2
|
var $84ae0bf5bd8e2a5f$exports = require("./Label.main.js");
|
|
3
3
|
var $av4IL$reactaria = require("react-aria");
|
|
4
4
|
var $av4IL$reactstatelyutils = require("@react-stately/utils");
|
|
5
|
+
var $av4IL$reactariautils = require("@react-aria/utils");
|
|
5
6
|
var $av4IL$react = require("react");
|
|
6
7
|
|
|
7
8
|
|
|
@@ -30,6 +31,7 @@ $parcel$export(module.exports, "ProgressBar", () => $0d6436f6a1b0b001$export$c17
|
|
|
30
31
|
|
|
31
32
|
|
|
32
33
|
|
|
34
|
+
|
|
33
35
|
const $0d6436f6a1b0b001$export$e9f3bf65a26ce129 = /*#__PURE__*/ (0, $av4IL$react.createContext)(null);
|
|
34
36
|
const $0d6436f6a1b0b001$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $av4IL$react.forwardRef)(function ProgressBar(props, ref) {
|
|
35
37
|
[props, ref] = (0, $c5ccf687772c0422$exports.useContextProps)(props, ref, $0d6436f6a1b0b001$export$e9f3bf65a26ce129);
|
|
@@ -51,9 +53,11 @@ const $0d6436f6a1b0b001$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $av4IL$react
|
|
|
51
53
|
isIndeterminate: isIndeterminate
|
|
52
54
|
}
|
|
53
55
|
});
|
|
56
|
+
let DOMProps = (0, $av4IL$reactariautils.filterDOMProps)(props, {
|
|
57
|
+
global: true
|
|
58
|
+
});
|
|
54
59
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($av4IL$react))).createElement("div", {
|
|
55
|
-
...progressBarProps,
|
|
56
|
-
...renderProps,
|
|
60
|
+
...(0, $av4IL$reactariautils.mergeProps)(DOMProps, renderProps, progressBarProps),
|
|
57
61
|
ref: ref,
|
|
58
62
|
slot: props.slot || undefined
|
|
59
63
|
}, /*#__PURE__*/ (0, ($parcel$interopDefault($av4IL$react))).createElement((0, $84ae0bf5bd8e2a5f$exports.LabelContext).Provider, {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA6BM,MAAM,0DAAqB,CAAA,GAAA,0BAAY,EAAkD;AAMzF,MAAM,0DAAc,CAAA,GAAA,uBAAS,EAAE,SAAS,YAAY,KAAuB,EAAE,GAAiC;IACnH,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,SACF,QAAQ,aACR,WAAW,aACX,WAAW,sBACX,kBAAkB,OACnB,GAAG;IACJ,QAAQ,CAAA,GAAA,8BAAI,EAAE,OAAO,UAAU;IAE/B,IAAI,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IAEnD,IAAI,oBACF,gBAAgB,cAChB,UAAU,EACX,GAAG,CAAA,GAAA,+BAAa,EAAE;QAAC,GAAG,KAAK;eAAE;IAAK;IAEnC,0DAA0D;IAC1D,IAAI,aAAa,kBAAkB,YAAY,AAAC,CAAA,QAAQ,QAAO,IAAM,CAAA,WAAW,QAAO,IAAK;IAE5F,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;wBACN;YACA,WAAW,gBAAgB,CAAC,iBAAiB;6BAC7C;QACF;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QAAK,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,aAAa,iBAAiB;QAAE,KAAK;QAAK,MAAM,MAAM,IAAI,IAAI;qBAC1F,0DAAC,CAAA,GAAA,sCAAW,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ProgressBar.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 */\n\nimport {AriaProgressBarProps, useProgressBar} from 'react-aria';\nimport {clamp} from '@react-stately/utils';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps extends Omit<AriaProgressBarProps, 'label'>, RenderProps<ProgressBarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage?: number,\n /**\n * A formatted version of the value.\n * @selector [aria-valuetext]\n */\n valueText: string | undefined,\n /**\n * Whether the progress bar is indeterminate.\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean\n}\n\nexport const ProgressBarContext = createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(props: ProgressBarProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {\n value = 0,\n minValue = 0,\n maxValue = 100,\n isIndeterminate = false\n } = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n progressBarProps,\n labelProps\n } = useProgressBar({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = isIndeterminate ? undefined : (value - minValue) / (maxValue - minValue) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div {...mergeProps(DOMProps, renderProps, progressBarProps)} ref={ref} slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ProgressBar.main.js.map"}
|
package/dist/ProgressBar.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderP
|
|
|
2
2
|
import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.mjs";
|
|
3
3
|
import {useProgressBar as $hU2kz$useProgressBar} from "react-aria";
|
|
4
4
|
import {clamp as $hU2kz$clamp} from "@react-stately/utils";
|
|
5
|
+
import {filterDOMProps as $hU2kz$filterDOMProps, mergeProps as $hU2kz$mergeProps} from "@react-aria/utils";
|
|
5
6
|
import $hU2kz$react, {createContext as $hU2kz$createContext, forwardRef as $hU2kz$forwardRef} from "react";
|
|
6
7
|
|
|
7
8
|
/*
|
|
@@ -19,6 +20,7 @@ import $hU2kz$react, {createContext as $hU2kz$createContext, forwardRef as $hU2k
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
const $0393f8ab869a0f1a$export$e9f3bf65a26ce129 = /*#__PURE__*/ (0, $hU2kz$createContext)(null);
|
|
23
25
|
const $0393f8ab869a0f1a$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $hU2kz$forwardRef)(function ProgressBar(props, ref) {
|
|
24
26
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $0393f8ab869a0f1a$export$e9f3bf65a26ce129);
|
|
@@ -40,9 +42,11 @@ const $0393f8ab869a0f1a$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $hU2kz$forwa
|
|
|
40
42
|
isIndeterminate: isIndeterminate
|
|
41
43
|
}
|
|
42
44
|
});
|
|
45
|
+
let DOMProps = (0, $hU2kz$filterDOMProps)(props, {
|
|
46
|
+
global: true
|
|
47
|
+
});
|
|
43
48
|
return /*#__PURE__*/ (0, $hU2kz$react).createElement("div", {
|
|
44
|
-
...progressBarProps,
|
|
45
|
-
...renderProps,
|
|
49
|
+
...(0, $hU2kz$mergeProps)(DOMProps, renderProps, progressBarProps),
|
|
46
50
|
ref: ref,
|
|
47
51
|
slot: props.slot || undefined
|
|
48
52
|
}, /*#__PURE__*/ (0, $hU2kz$react).createElement((0, $01b77f81d0f07f68$export$75b6ee27786ba447).Provider, {
|
|
@@ -2,6 +2,7 @@ import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderP
|
|
|
2
2
|
import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.module.js";
|
|
3
3
|
import {useProgressBar as $hU2kz$useProgressBar} from "react-aria";
|
|
4
4
|
import {clamp as $hU2kz$clamp} from "@react-stately/utils";
|
|
5
|
+
import {filterDOMProps as $hU2kz$filterDOMProps, mergeProps as $hU2kz$mergeProps} from "@react-aria/utils";
|
|
5
6
|
import $hU2kz$react, {createContext as $hU2kz$createContext, forwardRef as $hU2kz$forwardRef} from "react";
|
|
6
7
|
|
|
7
8
|
/*
|
|
@@ -19,6 +20,7 @@ import $hU2kz$react, {createContext as $hU2kz$createContext, forwardRef as $hU2k
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
const $0393f8ab869a0f1a$export$e9f3bf65a26ce129 = /*#__PURE__*/ (0, $hU2kz$createContext)(null);
|
|
23
25
|
const $0393f8ab869a0f1a$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $hU2kz$forwardRef)(function ProgressBar(props, ref) {
|
|
24
26
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $0393f8ab869a0f1a$export$e9f3bf65a26ce129);
|
|
@@ -40,9 +42,11 @@ const $0393f8ab869a0f1a$export$c17561cb55d4db30 = /*#__PURE__*/ (0, $hU2kz$forwa
|
|
|
40
42
|
isIndeterminate: isIndeterminate
|
|
41
43
|
}
|
|
42
44
|
});
|
|
45
|
+
let DOMProps = (0, $hU2kz$filterDOMProps)(props, {
|
|
46
|
+
global: true
|
|
47
|
+
});
|
|
43
48
|
return /*#__PURE__*/ (0, $hU2kz$react).createElement("div", {
|
|
44
|
-
...progressBarProps,
|
|
45
|
-
...renderProps,
|
|
49
|
+
...(0, $hU2kz$mergeProps)(DOMProps, renderProps, progressBarProps),
|
|
46
50
|
ref: ref,
|
|
47
51
|
slot: props.slot || undefined
|
|
48
52
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,UAAU;YAAE,KAAK;YAAU,aAAa;QAAM;OAC7E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ProgressBar.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 */\n\nimport {AriaProgressBarProps, useProgressBar} from 'react-aria';\nimport {clamp} from '@react-stately/utils';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {GlobalDOMAttributes} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ProgressBarProps extends Omit<AriaProgressBarProps, 'label'>, RenderProps<ProgressBarRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport interface ProgressBarRenderProps {\n /**\n * The value as a percentage between the minimum and maximum.\n */\n percentage?: number,\n /**\n * A formatted version of the value.\n * @selector [aria-valuetext]\n */\n valueText: string | undefined,\n /**\n * Whether the progress bar is indeterminate.\n * @selector :not([aria-valuenow])\n */\n isIndeterminate: boolean\n}\n\nexport const ProgressBarContext = createContext<ContextValue<ProgressBarProps, HTMLDivElement>>(null);\n\n/**\n * Progress bars show either determinate or indeterminate progress of an operation\n * over time.\n */\nexport const ProgressBar = forwardRef(function ProgressBar(props: ProgressBarProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ProgressBarContext);\n let {\n value = 0,\n minValue = 0,\n maxValue = 100,\n isIndeterminate = false\n } = props;\n value = clamp(value, minValue, maxValue);\n\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {\n progressBarProps,\n labelProps\n } = useProgressBar({...props, label});\n\n // Calculate the width of the progress bar as a percentage\n let percentage = isIndeterminate ? undefined : (value - minValue) / (maxValue - minValue) * 100;\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-ProgressBar',\n values: {\n percentage,\n valueText: progressBarProps['aria-valuetext'],\n isIndeterminate\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div {...mergeProps(DOMProps, renderProps, progressBarProps)} ref={ref} slot={props.slot || undefined}>\n <LabelContext.Provider value={{...labelProps, ref: labelRef, elementType: 'span'}}>\n {renderProps.children}\n </LabelContext.Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ProgressBar.module.js.map"}
|
package/dist/RadioGroup.main.js
CHANGED
|
@@ -71,9 +71,11 @@ const $1456b76f687bd4ed$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $g9Qo8$react
|
|
|
71
71
|
},
|
|
72
72
|
defaultClassName: 'react-aria-RadioGroup'
|
|
73
73
|
});
|
|
74
|
+
let DOMProps = (0, $g9Qo8$reactariautils.filterDOMProps)(props, {
|
|
75
|
+
global: true
|
|
76
|
+
});
|
|
74
77
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($g9Qo8$react))).createElement("div", {
|
|
75
|
-
...radioGroupProps,
|
|
76
|
-
...renderProps,
|
|
78
|
+
...(0, $g9Qo8$reactariautils.mergeProps)(DOMProps, renderProps, radioGroupProps),
|
|
77
79
|
ref: ref,
|
|
78
80
|
slot: props.slot || undefined,
|
|
79
81
|
"data-orientation": props.orientation || 'vertical',
|
|
@@ -145,8 +147,11 @@ const $1456b76f687bd4ed$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $g9Qo8$react
|
|
|
145
147
|
isRequired: state.isRequired
|
|
146
148
|
}
|
|
147
149
|
});
|
|
148
|
-
let DOMProps = (0, $g9Qo8$reactariautils.filterDOMProps)(props
|
|
150
|
+
let DOMProps = (0, $g9Qo8$reactariautils.filterDOMProps)(props, {
|
|
151
|
+
global: true
|
|
152
|
+
});
|
|
149
153
|
delete DOMProps.id;
|
|
154
|
+
delete DOMProps.onClick;
|
|
150
155
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($g9Qo8$react))).createElement("label", {
|
|
151
156
|
...(0, $g9Qo8$reactariautils.mergeProps)(DOMProps, labelProps, hoverProps, renderProps),
|
|
152
157
|
ref: ref,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAqGM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAAuD;AACxF,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAClJ,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,CAAC,UAAU,MAAM,GAAG,CAAA,GAAA,iCAAM,EAC5B,CAAC,KAAK,CAAC,aAAa,IAAI,CAAC,KAAK,CAAC,kBAAkB;IAEnD,IAAI,mBAAC,eAAe,cAAE,UAAU,oBAAE,gBAAgB,qBAAE,iBAAiB,EAAE,GAAG,YAAW,GAAG,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,+BAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/RadioGroup.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 */\n\nimport {AriaRadioGroupProps, AriaRadioProps, HoverEvents, Orientation, useFocusRing, useHover, useRadio, useRadioGroup, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useMemo} from 'react';\nimport {TextContext} from './Text';\n\nexport interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<RadioGroupRenderProps>, SlotProps {}\nexport interface RadioProps extends Omit<AriaRadioProps, 'children'>, HoverEvents, RenderProps<RadioRenderProps>, SlotProps {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the radio group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the radio group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the radio group.\n */\n state: RadioGroupState\n}\n\nexport interface RadioRenderProps {\n /**\n * Whether the radio is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the radio is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the radio is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the radio is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the radio is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext = createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n */\nexport const RadioGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioGroup(props: RadioGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RadioGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useRadioGroupState({\n ...props,\n validationBehavior\n });\n\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useRadioGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n\n return (\n <div\n {...radioGroupProps}\n {...renderProps}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'vertical'}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [RadioGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(props: RadioProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isPressed} = useRadio({\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let interactionDisabled = isDisabled || state.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: interactionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props);\n delete DOMProps.id;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAqGM,MAAM,0DAAoB,CAAA,GAAA,0BAAY,EAAiD;AACvF,MAAM,0DAAe,CAAA,GAAA,0BAAY,EAAuD;AACxF,MAAM,0DAAyB,CAAA,GAAA,0BAAY,EAA0B;AAKrE,MAAM,4CAA2B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,WAAW,KAAsB,EAAE,GAAiC;IAClJ,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,MAA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1B,YAAY,MAAM,UAAU;QAC9B;IACF;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,YAAY,YAAY,YAAY;QAC7D,KAAK;QACL,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;QACtC,iBAAe,cAAc;QAC7B,iBAAe,MAAM,UAAU,IAAI;QACnC,gBAAc,MAAM,SAAS,IAAI;QACjC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,CAAA,GAAA,+BAAa;QAAE,aAAY;qBAC1B,0DAAC;QAAO,GAAG,CAAA,GAAA,gCAAS,EAAE,YAAY,WAAW;QAAE,KAAK;SAErD,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/RadioGroup.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 */\n\nimport {AriaRadioGroupProps, AriaRadioProps, HoverEvents, Orientation, useFocusRing, useHover, useRadio, useRadioGroup, VisuallyHidden} from 'react-aria';\nimport {ContextValue, Provider, RACValidation, removeDataAttributes, RenderProps, SlotProps, useContextProps, useRenderProps, useSlot, useSlottedContext} from './utils';\nimport {FieldErrorContext} from './FieldError';\nimport {filterDOMProps, mergeProps, mergeRefs, useObjectRef} from '@react-aria/utils';\nimport {FormContext} from './Form';\nimport {forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {LabelContext} from './Label';\nimport {RadioGroupState, useRadioGroupState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, useMemo} from 'react';\nimport {TextContext} from './Text';\n\nexport interface RadioGroupProps extends Omit<AriaRadioGroupProps, 'children' | 'label' | 'description' | 'errorMessage' | 'validationState' | 'validationBehavior'>, RACValidation, RenderProps<RadioGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\nexport interface RadioProps extends Omit<AriaRadioProps, 'children'>, HoverEvents, RenderProps<RadioRenderProps>, SlotProps, Omit<GlobalDOMAttributes<HTMLLabelElement>, 'onClick'> {\n /**\n * A ref for the HTML input element.\n */\n inputRef?: RefObject<HTMLInputElement | null>\n}\n\nexport interface RadioGroupRenderProps {\n /**\n * The orientation of the radio group.\n * @selector [data-orientation=\"horizontal | vertical\"]\n */\n orientation: Orientation,\n /**\n * Whether the radio group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio group is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio group is required.\n * @selector [data-required]\n */\n isRequired: boolean,\n /**\n * Whether the radio group is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * State of the radio group.\n */\n state: RadioGroupState\n}\n\nexport interface RadioRenderProps {\n /**\n * Whether the radio is selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * Whether the radio is currently hovered with a mouse.\n * @selector [data-hovered]\n */\n isHovered: boolean,\n /**\n * Whether the radio is currently in a pressed state.\n * @selector [data-pressed]\n */\n isPressed: boolean,\n /**\n * Whether the radio is focused, either via a mouse or keyboard.\n * @selector [data-focused]\n */\n isFocused: boolean,\n /**\n * Whether the radio is keyboard focused.\n * @selector [data-focus-visible]\n */\n isFocusVisible: boolean,\n /**\n * Whether the radio is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * Whether the radio is read only.\n * @selector [data-readonly]\n */\n isReadOnly: boolean,\n /**\n * Whether the radio is invalid.\n * @selector [data-invalid]\n */\n isInvalid: boolean,\n /**\n * Whether the checkbox is required.\n * @selector [data-required]\n */\n isRequired: boolean\n}\n\nexport const RadioGroupContext = createContext<ContextValue<RadioGroupProps, HTMLDivElement>>(null);\nexport const RadioContext = createContext<ContextValue<Partial<RadioProps>, HTMLLabelElement>>(null);\nexport const RadioGroupStateContext = createContext<RadioGroupState | null>(null);\n\n/**\n * A radio group allows a user to select a single item from a list of mutually exclusive options.\n */\nexport const RadioGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function RadioGroup(props: RadioGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, RadioGroupContext);\n let {validationBehavior: formValidationBehavior} = useSlottedContext(FormContext) || {};\n let validationBehavior = props.validationBehavior ?? formValidationBehavior ?? 'native';\n let state = useRadioGroupState({\n ...props,\n validationBehavior\n });\n\n let [labelRef, label] = useSlot(\n !props['aria-label'] && !props['aria-labelledby']\n );\n let {radioGroupProps, labelProps, descriptionProps, errorMessageProps, ...validation} = useRadioGroup({\n ...props,\n label,\n validationBehavior\n }, state);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n orientation: props.orientation || 'vertical',\n isDisabled: state.isDisabled,\n isReadOnly: state.isReadOnly,\n isRequired: state.isRequired,\n isInvalid: state.isInvalid,\n state\n },\n defaultClassName: 'react-aria-RadioGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, radioGroupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'vertical'}\n data-invalid={state.isInvalid || undefined}\n data-disabled={state.isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-required={state.isRequired || undefined}>\n <Provider\n values={[\n [RadioGroupStateContext, state],\n [LabelContext, {...labelProps, ref: labelRef, elementType: 'span'}],\n [TextContext, {\n slots: {\n description: descriptionProps,\n errorMessage: errorMessageProps\n }\n }],\n [FieldErrorContext, validation]\n ]}>\n {renderProps.children}\n </Provider>\n </div>\n );\n});\n\n/**\n * A radio represents an individual option within a radio group.\n */\nexport const Radio = /*#__PURE__*/ (forwardRef as forwardRefType)(function Radio(props: RadioProps, ref: ForwardedRef<HTMLLabelElement>) {\n let {\n inputRef: userProvidedInputRef = null,\n ...otherProps\n } = props;\n [props, ref] = useContextProps(otherProps, ref, RadioContext);\n let state = React.useContext(RadioGroupStateContext)!;\n let inputRef = useObjectRef(useMemo(() => mergeRefs(userProvidedInputRef, props.inputRef !== undefined ? props.inputRef : null), [userProvidedInputRef, props.inputRef]));\n let {labelProps, inputProps, isSelected, isDisabled, isPressed} = useRadio({\n ...removeDataAttributes<RadioProps>(props),\n // ReactNode type doesn't allow function children.\n children: typeof props.children === 'function' ? true : props.children\n }, state, inputRef);\n let {isFocused, isFocusVisible, focusProps} = useFocusRing();\n let interactionDisabled = isDisabled || state.isReadOnly;\n\n let {hoverProps, isHovered} = useHover({\n ...props,\n isDisabled: interactionDisabled\n });\n\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Radio',\n values: {\n isSelected,\n isPressed,\n isHovered,\n isFocused,\n isFocusVisible,\n isDisabled,\n isReadOnly: state.isReadOnly,\n isInvalid: state.isInvalid,\n isRequired: state.isRequired\n }\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <label\n {...mergeProps(DOMProps, labelProps, hoverProps, renderProps)}\n ref={ref}\n data-selected={isSelected || undefined}\n data-pressed={isPressed || undefined}\n data-hovered={isHovered || undefined}\n data-focused={isFocused || undefined}\n data-focus-visible={isFocusVisible || undefined}\n data-disabled={isDisabled || undefined}\n data-readonly={state.isReadOnly || undefined}\n data-invalid={state.isInvalid || undefined}\n data-required={state.isRequired || undefined}>\n <VisuallyHidden elementType=\"span\">\n <input {...mergeProps(inputProps, focusProps)} ref={inputRef} />\n </VisuallyHidden>\n {renderProps.children}\n </label>\n );\n});\n"],"names":[],"version":3,"file":"RadioGroup.main.js.map"}
|
package/dist/RadioGroup.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from "./Form.m
|
|
|
4
4
|
import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.mjs";
|
|
5
5
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.mjs";
|
|
6
6
|
import {useRadioGroup as $3sixo$useRadioGroup, useRadio as $3sixo$useRadio, useFocusRing as $3sixo$useFocusRing, useHover as $3sixo$useHover, VisuallyHidden as $3sixo$VisuallyHidden} from "react-aria";
|
|
7
|
-
import {
|
|
7
|
+
import {filterDOMProps as $3sixo$filterDOMProps, mergeProps as $3sixo$mergeProps, useObjectRef as $3sixo$useObjectRef, mergeRefs as $3sixo$mergeRefs} from "@react-aria/utils";
|
|
8
8
|
import {useRadioGroupState as $3sixo$useRadioGroupState} from "react-stately";
|
|
9
9
|
import $3sixo$react, {createContext as $3sixo$createContext, forwardRef as $3sixo$forwardRef, useMemo as $3sixo$useMemo} from "react";
|
|
10
10
|
|
|
@@ -57,9 +57,11 @@ const $b6c3ddc6086f204d$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $3sixo$forwa
|
|
|
57
57
|
},
|
|
58
58
|
defaultClassName: 'react-aria-RadioGroup'
|
|
59
59
|
});
|
|
60
|
+
let DOMProps = (0, $3sixo$filterDOMProps)(props, {
|
|
61
|
+
global: true
|
|
62
|
+
});
|
|
60
63
|
return /*#__PURE__*/ (0, $3sixo$react).createElement("div", {
|
|
61
|
-
...radioGroupProps,
|
|
62
|
-
...renderProps,
|
|
64
|
+
...(0, $3sixo$mergeProps)(DOMProps, renderProps, radioGroupProps),
|
|
63
65
|
ref: ref,
|
|
64
66
|
slot: props.slot || undefined,
|
|
65
67
|
"data-orientation": props.orientation || 'vertical',
|
|
@@ -131,8 +133,11 @@ const $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $3sixo$forwa
|
|
|
131
133
|
isRequired: state.isRequired
|
|
132
134
|
}
|
|
133
135
|
});
|
|
134
|
-
let DOMProps = (0, $3sixo$filterDOMProps)(props
|
|
136
|
+
let DOMProps = (0, $3sixo$filterDOMProps)(props, {
|
|
137
|
+
global: true
|
|
138
|
+
});
|
|
135
139
|
delete DOMProps.id;
|
|
140
|
+
delete DOMProps.onClick;
|
|
136
141
|
return /*#__PURE__*/ (0, $3sixo$react).createElement("label", {
|
|
137
142
|
...(0, $3sixo$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),
|
|
138
143
|
ref: ref,
|
|
@@ -4,7 +4,7 @@ import {FormContext as $d3e0e05bdfcf66bd$export$c24727297075ec6a} from "./Form.m
|
|
|
4
4
|
import {LabelContext as $01b77f81d0f07f68$export$75b6ee27786ba447} from "./Label.module.js";
|
|
5
5
|
import {TextContext as $514c0188e459b4c0$export$9afb8bc826b033ea} from "./Text.module.js";
|
|
6
6
|
import {useRadioGroup as $3sixo$useRadioGroup, useRadio as $3sixo$useRadio, useFocusRing as $3sixo$useFocusRing, useHover as $3sixo$useHover, VisuallyHidden as $3sixo$VisuallyHidden} from "react-aria";
|
|
7
|
-
import {
|
|
7
|
+
import {filterDOMProps as $3sixo$filterDOMProps, mergeProps as $3sixo$mergeProps, useObjectRef as $3sixo$useObjectRef, mergeRefs as $3sixo$mergeRefs} from "@react-aria/utils";
|
|
8
8
|
import {useRadioGroupState as $3sixo$useRadioGroupState} from "react-stately";
|
|
9
9
|
import $3sixo$react, {createContext as $3sixo$createContext, forwardRef as $3sixo$forwardRef, useMemo as $3sixo$useMemo} from "react";
|
|
10
10
|
|
|
@@ -57,9 +57,11 @@ const $b6c3ddc6086f204d$export$a98f0dcb43a68a25 = /*#__PURE__*/ (0, $3sixo$forwa
|
|
|
57
57
|
},
|
|
58
58
|
defaultClassName: 'react-aria-RadioGroup'
|
|
59
59
|
});
|
|
60
|
+
let DOMProps = (0, $3sixo$filterDOMProps)(props, {
|
|
61
|
+
global: true
|
|
62
|
+
});
|
|
60
63
|
return /*#__PURE__*/ (0, $3sixo$react).createElement("div", {
|
|
61
|
-
...radioGroupProps,
|
|
62
|
-
...renderProps,
|
|
64
|
+
...(0, $3sixo$mergeProps)(DOMProps, renderProps, radioGroupProps),
|
|
63
65
|
ref: ref,
|
|
64
66
|
slot: props.slot || undefined,
|
|
65
67
|
"data-orientation": props.orientation || 'vertical',
|
|
@@ -131,8 +133,11 @@ const $b6c3ddc6086f204d$export$d7b12c4107be0d61 = /*#__PURE__*/ (0, $3sixo$forwa
|
|
|
131
133
|
isRequired: state.isRequired
|
|
132
134
|
}
|
|
133
135
|
});
|
|
134
|
-
let DOMProps = (0, $3sixo$filterDOMProps)(props
|
|
136
|
+
let DOMProps = (0, $3sixo$filterDOMProps)(props, {
|
|
137
|
+
global: true
|
|
138
|
+
});
|
|
135
139
|
delete DOMProps.id;
|
|
140
|
+
delete DOMProps.onClick;
|
|
136
141
|
return /*#__PURE__*/ (0, $3sixo$react).createElement("label", {
|
|
137
142
|
...(0, $3sixo$mergeProps)(DOMProps, labelProps, hoverProps, renderProps),
|
|
138
143
|
ref: ref,
|