react-aria-components 1.10.0 → 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 +22 -11
- package/dist/Tabs.main.js.map +1 -1
- package/dist/Tabs.mjs +23 -12
- package/dist/Tabs.module.js +23 -12
- 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 +20 -16
- 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":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA4BM,MAAM,0DAAsB,CAAA,GAAA,0BAAY,EAAsD,CAAC;AAK/F,MAAM,4CAA6B,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,aAAa,KAAwB,EAAE,GAAoC;IAC3J,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,aAAa,CAAA,GAAA,uBAAS,EAAE,CAAA,GAAA,iDAAsB;IAClD,IAAI,QAAQ,CAAA,GAAA,kCAAa,EAAE,cAAc,MAAM,EAAE,IAAI,OAAO;QAC1D,YAAY,WAAW,YAAY,CAAC,GAAG,CAAC,MAAM,EAAE;QAChD,UAAS,UAAU;YACjB,WAAW,WAAW,CAAC,MAAM,EAAE,EAAG;QACpC;IACF,IAAI;IAEJ,IAAI,eAAC,WAAW,aAAE,SAAS,cAAE,UAAU,cAAE,UAAU,EAAC,GAAG,cAAc,MAAM,EAAE,IAAI,OAE7E,CAAA,GAAA,yCAAuB,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE;IAAA,GAAG,YAAY,OAE/D,CAAA,GAAA,gCAAc,EAAE;QAAC,GAAG,KAAK;QAAE,IAAI,MAAM,EAAE,IAAI,OAAO,OAAO,MAAM,EAAE,IAAI;IAAS,GAAG,OAAO;IAE5F,IAAI,cAAC,UAAU,aAAE,SAAS,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,6BAAW,EAAE;IAC3D,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,yBAAO,EAAE;IACvC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,IAAI;QACJ,QAAQ;uBAAC;uBAAW;uBAAW;YAAW,YAAY,MAAM,UAAU;4BAAE;wBAAgB;mBAAY;QAAK;QACzG,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAc;QAAC,QAAQ;IAAI;IACzD,OAAO,SAAS,EAAE;IAClB,OAAO,SAAS,OAAO;IAEvB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;;AAE5C","sources":["packages/react-aria-components/src/ToggleButton.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 {AriaToggleButtonProps, HoverEvents, mergeProps, useFocusRing, useHover, useToggleButton, useToggleButtonGroupItem} from 'react-aria';\nimport {ButtonRenderProps} from './Button';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * State of the toggle button.\n */\n state: ToggleState\n}\n\nexport interface ToggleButtonProps extends Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>, HoverEvents, SlotProps, RenderProps<ToggleButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used standalone, a DOM id. */\n id?: Key\n}\n\nexport const ToggleButtonContext = createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(props: ToggleButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(groupState && props.id != null ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n } : props);\n\n let {buttonProps, isPressed, isSelected, isDisabled} = groupState && props.id != null\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useToggleButton({...props, id: props.id != null ? String(props.id) : undefined}, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover(props);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {isHovered, isPressed, isFocused, isSelected: state.isSelected, isFocusVisible, isDisabled, state},\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.main.js.map"}
|
package/dist/ToggleButton.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
2
2
|
import {ToggleGroupStateContext as $84b7d8702d4ff4a8$export$a8a71863db173133} from "./ToggleButtonGroup.mjs";
|
|
3
3
|
import {useToggleButtonGroupItem as $jrJ9L$useToggleButtonGroupItem, useToggleButton as $jrJ9L$useToggleButton, useFocusRing as $jrJ9L$useFocusRing, useHover as $jrJ9L$useHover, mergeProps as $jrJ9L$mergeProps} from "react-aria";
|
|
4
|
+
import {filterDOMProps as $jrJ9L$filterDOMProps} from "@react-aria/utils";
|
|
4
5
|
import $jrJ9L$react, {createContext as $jrJ9L$createContext, forwardRef as $jrJ9L$forwardRef, useContext as $jrJ9L$useContext} from "react";
|
|
5
6
|
import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
6
7
|
|
|
@@ -19,6 +20,7 @@ import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
const $efde0372d7a700fe$export$43506d75ebd2e218 = /*#__PURE__*/ (0, $jrJ9L$createContext)({});
|
|
23
25
|
const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwardRef)(function ToggleButton(props, ref) {
|
|
24
26
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
|
|
@@ -52,9 +54,13 @@ const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwa
|
|
|
52
54
|
},
|
|
53
55
|
defaultClassName: 'react-aria-ToggleButton'
|
|
54
56
|
});
|
|
57
|
+
let DOMProps = (0, $jrJ9L$filterDOMProps)(props, {
|
|
58
|
+
global: true
|
|
59
|
+
});
|
|
60
|
+
delete DOMProps.id;
|
|
61
|
+
delete DOMProps.onClick;
|
|
55
62
|
return /*#__PURE__*/ (0, $jrJ9L$react).createElement("button", {
|
|
56
|
-
...(0, $jrJ9L$mergeProps)(buttonProps, focusProps, hoverProps),
|
|
57
|
-
...renderProps,
|
|
63
|
+
...(0, $jrJ9L$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
58
64
|
ref: ref,
|
|
59
65
|
slot: props.slot || undefined,
|
|
60
66
|
"data-focused": isFocused || undefined,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
2
2
|
import {ToggleGroupStateContext as $84b7d8702d4ff4a8$export$a8a71863db173133} from "./ToggleButtonGroup.module.js";
|
|
3
3
|
import {useToggleButtonGroupItem as $jrJ9L$useToggleButtonGroupItem, useToggleButton as $jrJ9L$useToggleButton, useFocusRing as $jrJ9L$useFocusRing, useHover as $jrJ9L$useHover, mergeProps as $jrJ9L$mergeProps} from "react-aria";
|
|
4
|
+
import {filterDOMProps as $jrJ9L$filterDOMProps} from "@react-aria/utils";
|
|
4
5
|
import $jrJ9L$react, {createContext as $jrJ9L$createContext, forwardRef as $jrJ9L$forwardRef, useContext as $jrJ9L$useContext} from "react";
|
|
5
6
|
import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
6
7
|
|
|
@@ -19,6 +20,7 @@ import {useToggleState as $jrJ9L$useToggleState} from "react-stately";
|
|
|
19
20
|
|
|
20
21
|
|
|
21
22
|
|
|
23
|
+
|
|
22
24
|
const $efde0372d7a700fe$export$43506d75ebd2e218 = /*#__PURE__*/ (0, $jrJ9L$createContext)({});
|
|
23
25
|
const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwardRef)(function ToggleButton(props, ref) {
|
|
24
26
|
[props, ref] = (0, $64fa3d84918910a7$export$29f1550f4b0d4415)(props, ref, $efde0372d7a700fe$export$43506d75ebd2e218);
|
|
@@ -52,9 +54,13 @@ const $efde0372d7a700fe$export$d2b052e7b4be1756 = /*#__PURE__*/ (0, $jrJ9L$forwa
|
|
|
52
54
|
},
|
|
53
55
|
defaultClassName: 'react-aria-ToggleButton'
|
|
54
56
|
});
|
|
57
|
+
let DOMProps = (0, $jrJ9L$filterDOMProps)(props, {
|
|
58
|
+
global: true
|
|
59
|
+
});
|
|
60
|
+
delete DOMProps.id;
|
|
61
|
+
delete DOMProps.onClick;
|
|
55
62
|
return /*#__PURE__*/ (0, $jrJ9L$react).createElement("button", {
|
|
56
|
-
...(0, $jrJ9L$mergeProps)(buttonProps, focusProps, hoverProps),
|
|
57
|
-
...renderProps,
|
|
63
|
+
...(0, $jrJ9L$mergeProps)(DOMProps, renderProps, buttonProps, focusProps, hoverProps),
|
|
58
64
|
ref: ref,
|
|
59
65
|
slot: props.slot || undefined,
|
|
60
66
|
"data-focused": isFocused || undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;AA4BM,MAAM,0DAAsB,CAAA,GAAA,oBAAY,EAAsD,CAAC;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gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,aAAa,YAAY,WAAW;QAC1E,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,iBAAe,cAAc;QAC7B,gBAAc,aAAa;QAC3B,sBAAoB,kBAAkB;;AAE5C","sources":["packages/react-aria-components/src/ToggleButton.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 {AriaToggleButtonProps, HoverEvents, mergeProps, useFocusRing, useHover, useToggleButton, useToggleButtonGroupItem} from 'react-aria';\nimport {ButtonRenderProps} from './Button';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Key} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef, useContext} from 'react';\nimport {ToggleGroupStateContext} from './ToggleButtonGroup';\nimport {ToggleState, useToggleState} from 'react-stately';\n\nexport interface ToggleButtonRenderProps extends Omit<ButtonRenderProps, 'isPending'> {\n /**\n * Whether the button is currently selected.\n * @selector [data-selected]\n */\n isSelected: boolean,\n /**\n * State of the toggle button.\n */\n state: ToggleState\n}\n\nexport interface ToggleButtonProps extends Omit<AriaToggleButtonProps, 'children' | 'elementType' | 'id'>, HoverEvents, SlotProps, RenderProps<ToggleButtonRenderProps>, Omit<GlobalDOMAttributes<HTMLDivElement>, 'onClick'> {\n /** When used in a ToggleButtonGroup, an identifier for the item in `selectedKeys`. When used standalone, a DOM id. */\n id?: Key\n}\n\nexport const ToggleButtonContext = createContext<ContextValue<ToggleButtonProps, HTMLButtonElement>>({});\n\n/**\n * A toggle button allows a user to toggle a selection on or off, for example switching between two states or modes.\n */\nexport const ToggleButton = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButton(props: ToggleButtonProps, ref: ForwardedRef<HTMLButtonElement>) {\n [props, ref] = useContextProps(props, ref, ToggleButtonContext);\n let groupState = useContext(ToggleGroupStateContext);\n let state = useToggleState(groupState && props.id != null ? {\n isSelected: groupState.selectedKeys.has(props.id),\n onChange(isSelected) {\n groupState.setSelected(props.id!, isSelected);\n }\n } : props);\n\n let {buttonProps, isPressed, isSelected, isDisabled} = groupState && props.id != null\n // eslint-disable-next-line react-hooks/rules-of-hooks\n ? useToggleButtonGroupItem({...props, id: props.id}, groupState, ref)\n // eslint-disable-next-line react-hooks/rules-of-hooks\n : useToggleButton({...props, id: props.id != null ? String(props.id) : undefined}, state, ref);\n\n let {focusProps, isFocused, isFocusVisible} = useFocusRing(props);\n let {hoverProps, isHovered} = useHover(props);\n let renderProps = useRenderProps({\n ...props,\n id: undefined,\n values: {isHovered, isPressed, isFocused, isSelected: state.isSelected, isFocusVisible, isDisabled, state},\n defaultClassName: 'react-aria-ToggleButton'\n });\n\n let DOMProps = filterDOMProps(props as any, {global: true});\n delete DOMProps.id;\n delete DOMProps.onClick;\n\n return (\n <button\n {...mergeProps(DOMProps, renderProps, buttonProps, focusProps, hoverProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-focused={isFocused || undefined}\n data-disabled={isDisabled || undefined}\n data-pressed={isPressed || undefined}\n data-selected={isSelected || undefined}\n data-hovered={isHovered || undefined}\n data-focus-visible={isFocusVisible || undefined} />\n );\n});\n"],"names":[],"version":3,"file":"ToggleButton.module.js.map"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
2
2
|
var $kZVyu$reactaria = require("react-aria");
|
|
3
|
+
var $kZVyu$reactariautils = require("@react-aria/utils");
|
|
3
4
|
var $kZVyu$react = require("react");
|
|
4
5
|
var $kZVyu$reactstately = require("react-stately");
|
|
5
6
|
|
|
@@ -29,6 +30,7 @@ $parcel$export(module.exports, "ToggleButtonGroup", () => $fed71ed29b70a020$expo
|
|
|
29
30
|
|
|
30
31
|
|
|
31
32
|
|
|
33
|
+
|
|
32
34
|
const $fed71ed29b70a020$export$298258635ae0dd97 = /*#__PURE__*/ (0, $kZVyu$react.createContext)({});
|
|
33
35
|
const $fed71ed29b70a020$export$a8a71863db173133 = /*#__PURE__*/ (0, $kZVyu$react.createContext)(null);
|
|
34
36
|
const $fed71ed29b70a020$export$40258cc1d95ff477 = /*#__PURE__*/ (0, $kZVyu$react.forwardRef)(function ToggleButtonGroup(props, ref) {
|
|
@@ -43,9 +45,11 @@ const $fed71ed29b70a020$export$40258cc1d95ff477 = /*#__PURE__*/ (0, $kZVyu$react
|
|
|
43
45
|
},
|
|
44
46
|
defaultClassName: 'react-aria-ToggleButtonGroup'
|
|
45
47
|
});
|
|
48
|
+
let DOMProps = (0, $kZVyu$reactariautils.filterDOMProps)(props, {
|
|
49
|
+
global: true
|
|
50
|
+
});
|
|
46
51
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($kZVyu$react))).createElement("div", {
|
|
47
|
-
...groupProps,
|
|
48
|
-
...renderProps,
|
|
52
|
+
...(0, $kZVyu$reactariautils.mergeProps)(DOMProps, renderProps, groupProps),
|
|
49
53
|
ref: ref,
|
|
50
54
|
slot: props.slot || undefined,
|
|
51
55
|
"data-orientation": props.orientation || 'horizontal',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAsBM,MAAM,0DAA2B,CAAA,GAAA,0BAAY,EAAwD,CAAC;AACtG,MAAM,0DAA0B,CAAA,GAAA,0BAAY,EAA2B;AAKvE,MAAM,4CAAkC,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,kBAAkB,KAA6B,EAAE,GAAiC;IACvK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,uCAAkB,EAAE;IAChC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,qCAAmB,EAAE,OAAO,OAAO;IAEtD,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,aAAa,WAAW;QACjD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,oBAAkB,MAAM,WAAW,IAAI;QACvC,iBAAe,MAAM,UAAU,IAAI;qBACnC,0DAAC,0CAAwB,QAAQ;QAAC,OAAO;OACtC,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ToggleButtonGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaToggleButtonGroupProps, useToggleButtonGroup} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {ToggleGroupState, useToggleGroupState} from 'react-stately';\n\nexport interface ToggleButtonGroupRenderProps {\n /**\n * Whether the toggle button group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the toggle button group.\n */\n state: ToggleGroupState\n}\n\nexport interface ToggleButtonGroupProps extends AriaToggleButtonGroupProps, RenderProps<ToggleButtonGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const ToggleButtonGroupContext = createContext<ContextValue<ToggleButtonGroupProps, HTMLDivElement>>({});\nexport const ToggleGroupStateContext = createContext<ToggleGroupState | null>(null);\n\n/**\n * A toggle button group allows a user to toggle multiple options, with single or multiple selection.\n */\nexport const ToggleButtonGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButtonGroup(props: ToggleButtonGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToggleButtonGroupContext);\n let state = useToggleGroupState(props);\n let {groupProps} = useToggleButtonGroup(props, state, ref);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-ToggleButtonGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'horizontal'}\n data-disabled={props.isDisabled || undefined}>\n <ToggleGroupStateContext.Provider value={state}>\n {renderProps.children}\n </ToggleGroupStateContext.Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButtonGroup.main.js.map"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
2
2
|
import {useToggleButtonGroup as $1lXgK$useToggleButtonGroup} from "react-aria";
|
|
3
|
+
import {filterDOMProps as $1lXgK$filterDOMProps, mergeProps as $1lXgK$mergeProps} from "@react-aria/utils";
|
|
3
4
|
import $1lXgK$react, {createContext as $1lXgK$createContext, forwardRef as $1lXgK$forwardRef} from "react";
|
|
4
5
|
import {useToggleGroupState as $1lXgK$useToggleGroupState} from "react-stately";
|
|
5
6
|
|
|
@@ -17,6 +18,7 @@ import {useToggleGroupState as $1lXgK$useToggleGroupState} from "react-stately";
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
|
|
20
22
|
const $84b7d8702d4ff4a8$export$298258635ae0dd97 = /*#__PURE__*/ (0, $1lXgK$createContext)({});
|
|
21
23
|
const $84b7d8702d4ff4a8$export$a8a71863db173133 = /*#__PURE__*/ (0, $1lXgK$createContext)(null);
|
|
22
24
|
const $84b7d8702d4ff4a8$export$40258cc1d95ff477 = /*#__PURE__*/ (0, $1lXgK$forwardRef)(function ToggleButtonGroup(props, ref) {
|
|
@@ -31,9 +33,11 @@ const $84b7d8702d4ff4a8$export$40258cc1d95ff477 = /*#__PURE__*/ (0, $1lXgK$forwa
|
|
|
31
33
|
},
|
|
32
34
|
defaultClassName: 'react-aria-ToggleButtonGroup'
|
|
33
35
|
});
|
|
36
|
+
let DOMProps = (0, $1lXgK$filterDOMProps)(props, {
|
|
37
|
+
global: true
|
|
38
|
+
});
|
|
34
39
|
return /*#__PURE__*/ (0, $1lXgK$react).createElement("div", {
|
|
35
|
-
...groupProps,
|
|
36
|
-
...renderProps,
|
|
40
|
+
...(0, $1lXgK$mergeProps)(DOMProps, renderProps, groupProps),
|
|
37
41
|
ref: ref,
|
|
38
42
|
slot: props.slot || undefined,
|
|
39
43
|
"data-orientation": props.orientation || 'horizontal',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import {useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
2
2
|
import {useToggleButtonGroup as $1lXgK$useToggleButtonGroup} from "react-aria";
|
|
3
|
+
import {filterDOMProps as $1lXgK$filterDOMProps, mergeProps as $1lXgK$mergeProps} from "@react-aria/utils";
|
|
3
4
|
import $1lXgK$react, {createContext as $1lXgK$createContext, forwardRef as $1lXgK$forwardRef} from "react";
|
|
4
5
|
import {useToggleGroupState as $1lXgK$useToggleGroupState} from "react-stately";
|
|
5
6
|
|
|
@@ -17,6 +18,7 @@ import {useToggleGroupState as $1lXgK$useToggleGroupState} from "react-stately";
|
|
|
17
18
|
|
|
18
19
|
|
|
19
20
|
|
|
21
|
+
|
|
20
22
|
const $84b7d8702d4ff4a8$export$298258635ae0dd97 = /*#__PURE__*/ (0, $1lXgK$createContext)({});
|
|
21
23
|
const $84b7d8702d4ff4a8$export$a8a71863db173133 = /*#__PURE__*/ (0, $1lXgK$createContext)(null);
|
|
22
24
|
const $84b7d8702d4ff4a8$export$40258cc1d95ff477 = /*#__PURE__*/ (0, $1lXgK$forwardRef)(function ToggleButtonGroup(props, ref) {
|
|
@@ -31,9 +33,11 @@ const $84b7d8702d4ff4a8$export$40258cc1d95ff477 = /*#__PURE__*/ (0, $1lXgK$forwa
|
|
|
31
33
|
},
|
|
32
34
|
defaultClassName: 'react-aria-ToggleButtonGroup'
|
|
33
35
|
});
|
|
36
|
+
let DOMProps = (0, $1lXgK$filterDOMProps)(props, {
|
|
37
|
+
global: true
|
|
38
|
+
});
|
|
34
39
|
return /*#__PURE__*/ (0, $1lXgK$react).createElement("div", {
|
|
35
|
-
...groupProps,
|
|
36
|
-
...renderProps,
|
|
40
|
+
...(0, $1lXgK$mergeProps)(DOMProps, renderProps, groupProps),
|
|
37
41
|
ref: ref,
|
|
38
42
|
slot: props.slot || undefined,
|
|
39
43
|
"data-orientation": props.orientation || 'horizontal',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;AAAA;;;;;;;;;;CAUC;;;;;AAsBM,MAAM,0DAA2B,CAAA,GAAA,oBAAY,EAAwD,CAAC;AACtG,MAAM,0DAA0B,CAAA,GAAA,oBAAY,EAA2B;AAKvE,MAAM,4CAAkC,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,kBAAkB,KAA6B,EAAE,GAAiC;IACvK,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,QAAQ,CAAA,GAAA,0BAAkB,EAAE;IAChC,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,2BAAmB,EAAE,OAAO,OAAO;IAEtD,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YACN,YAAY,MAAM,UAAU;mBAC5B;QACF;QACA,kBAAkB;IACpB;IAEA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,WAAW;QACjD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,oBAAkB,MAAM,WAAW,IAAI;QACvC,iBAAe,MAAM,UAAU,IAAI;qBACnC,gCAAC,0CAAwB,QAAQ;QAAC,OAAO;OACtC,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/ToggleButtonGroup.tsx"],"sourcesContent":["/*\n * Copyright 2024 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\nimport {AriaToggleButtonGroupProps, useToggleButtonGroup} from 'react-aria';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\nimport {ToggleGroupState, useToggleGroupState} from 'react-stately';\n\nexport interface ToggleButtonGroupRenderProps {\n /**\n * Whether the toggle button group is disabled.\n * @selector [data-disabled]\n */\n isDisabled: boolean,\n /**\n * State of the toggle button group.\n */\n state: ToggleGroupState\n}\n\nexport interface ToggleButtonGroupProps extends AriaToggleButtonGroupProps, RenderProps<ToggleButtonGroupRenderProps>, SlotProps, GlobalDOMAttributes<HTMLDivElement> {}\n\nexport const ToggleButtonGroupContext = createContext<ContextValue<ToggleButtonGroupProps, HTMLDivElement>>({});\nexport const ToggleGroupStateContext = createContext<ToggleGroupState | null>(null);\n\n/**\n * A toggle button group allows a user to toggle multiple options, with single or multiple selection.\n */\nexport const ToggleButtonGroup = /*#__PURE__*/ (forwardRef as forwardRefType)(function ToggleButtonGroup(props: ToggleButtonGroupProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToggleButtonGroupContext);\n let state = useToggleGroupState(props);\n let {groupProps} = useToggleButtonGroup(props, state, ref);\n\n let renderProps = useRenderProps({\n ...props,\n values: {\n isDisabled: state.isDisabled,\n state\n },\n defaultClassName: 'react-aria-ToggleButtonGroup'\n });\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, groupProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'horizontal'}\n data-disabled={props.isDisabled || undefined}>\n <ToggleGroupStateContext.Provider value={state}>\n {renderProps.children}\n </ToggleGroupStateContext.Provider>\n </div>\n );\n});\n"],"names":[],"version":3,"file":"ToggleButtonGroup.module.js.map"}
|
package/dist/Toolbar.main.js
CHANGED
|
@@ -39,11 +39,12 @@ const $a36bb7fee39de77a$export$4c260019440d418f = /*#__PURE__*/ (0, $6hkB7$react
|
|
|
39
39
|
},
|
|
40
40
|
defaultClassName: 'react-aria-Toolbar'
|
|
41
41
|
});
|
|
42
|
-
let DOMProps = (0, $6hkB7$reactariautils.filterDOMProps)(props
|
|
42
|
+
let DOMProps = (0, $6hkB7$reactariautils.filterDOMProps)(props, {
|
|
43
|
+
global: true
|
|
44
|
+
});
|
|
43
45
|
delete DOMProps.id;
|
|
44
46
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($6hkB7$react))).createElement("div", {
|
|
45
|
-
...(0, $6hkB7$reactariautils.mergeProps)(
|
|
46
|
-
...renderProps,
|
|
47
|
+
...(0, $6hkB7$reactariautils.mergeProps)(DOMProps, renderProps, toolbarProps),
|
|
47
48
|
ref: ref,
|
|
48
49
|
slot: props.slot || undefined,
|
|
49
50
|
"data-orientation": props.orientation || 'horizontal'
|
package/dist/Toolbar.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAmBM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA8C,CAAC;AAMlF,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAAiC;IACzI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,kCAAS,EAAE,OAAO;IACvC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YAAC,aAAa,MAAM,WAAW,IAAI;QAAY;QACvD,kBAAkB;IACpB;IACA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE;
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;AAmBM,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA8C,CAAC;AAMlF,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAAiC;IACzI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,kCAAS,EAAE,OAAO;IACvC,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YAAC,aAAa,MAAM,WAAW,IAAI;QAAY;QACvD,kBAAkB;IACpB;IACA,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAElB,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,gCAAS,EAAE,UAAU,aAAa,aAAa;QACnD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,oBAAkB,MAAM,WAAW,IAAI;OACtC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Toolbar.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {AriaToolbarProps, useToolbar} from '@react-aria/toolbar';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Orientation} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ToolbarRenderProps {\n /**\n * The current orientation of the toolbar.\n * @selector [data-orientation]\n */\n orientation: Orientation\n}\n\nexport interface ToolbarProps extends AriaToolbarProps, SlotProps, RenderProps<ToolbarRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n}\n\nexport const ToolbarContext = createContext<ContextValue<ToolbarProps, HTMLDivElement>>({});\n\n/**\n * A toolbar is a container for a set of interactive controls, such as buttons, dropdown menus, or checkboxes,\n * with arrow key navigation.\n */\nexport const Toolbar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toolbar(props: ToolbarProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToolbarContext);\n let {toolbarProps} = useToolbar(props, ref);\n let renderProps = useRenderProps({\n ...props,\n values: {orientation: props.orientation || 'horizontal'},\n defaultClassName: 'react-aria-Toolbar'\n });\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, toolbarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'horizontal'}>\n {renderProps.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toolbar.main.js.map"}
|
package/dist/Toolbar.mjs
CHANGED
|
@@ -28,11 +28,12 @@ const $13c3c67164f4d5be$export$4c260019440d418f = /*#__PURE__*/ (0, $8qPHH$forwa
|
|
|
28
28
|
},
|
|
29
29
|
defaultClassName: 'react-aria-Toolbar'
|
|
30
30
|
});
|
|
31
|
-
let DOMProps = (0, $8qPHH$filterDOMProps)(props
|
|
31
|
+
let DOMProps = (0, $8qPHH$filterDOMProps)(props, {
|
|
32
|
+
global: true
|
|
33
|
+
});
|
|
32
34
|
delete DOMProps.id;
|
|
33
35
|
return /*#__PURE__*/ (0, $8qPHH$react).createElement("div", {
|
|
34
|
-
...(0, $8qPHH$mergeProps)(
|
|
35
|
-
...renderProps,
|
|
36
|
+
...(0, $8qPHH$mergeProps)(DOMProps, renderProps, toolbarProps),
|
|
36
37
|
ref: ref,
|
|
37
38
|
slot: props.slot || undefined,
|
|
38
39
|
"data-orientation": props.orientation || 'horizontal'
|
package/dist/Toolbar.module.js
CHANGED
|
@@ -28,11 +28,12 @@ const $13c3c67164f4d5be$export$4c260019440d418f = /*#__PURE__*/ (0, $8qPHH$forwa
|
|
|
28
28
|
},
|
|
29
29
|
defaultClassName: 'react-aria-Toolbar'
|
|
30
30
|
});
|
|
31
|
-
let DOMProps = (0, $8qPHH$filterDOMProps)(props
|
|
31
|
+
let DOMProps = (0, $8qPHH$filterDOMProps)(props, {
|
|
32
|
+
global: true
|
|
33
|
+
});
|
|
32
34
|
delete DOMProps.id;
|
|
33
35
|
return /*#__PURE__*/ (0, $8qPHH$react).createElement("div", {
|
|
34
|
-
...(0, $8qPHH$mergeProps)(
|
|
35
|
-
...renderProps,
|
|
36
|
+
...(0, $8qPHH$mergeProps)(DOMProps, renderProps, toolbarProps),
|
|
36
37
|
ref: ref,
|
|
37
38
|
slot: props.slot || undefined,
|
|
38
39
|
"data-orientation": props.orientation || 'horizontal'
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAmBM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAA8C,CAAC;AAMlF,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAAiC;IACzI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,OAAO;IACvC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YAAC,aAAa,MAAM,WAAW,IAAI;QAAY;QACvD,kBAAkB;IACpB;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE;
|
|
1
|
+
{"mappings":";;;;;AAAA;;;;;;;;;;CAUC;;;;AAmBM,MAAM,0DAAiB,CAAA,GAAA,oBAAY,EAA8C,CAAC;AAMlF,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,iBAAS,EAAqB,SAAS,QAAQ,KAAmB,EAAE,GAAiC;IACzI,CAAC,OAAO,IAAI,GAAG,CAAA,GAAA,yCAAc,EAAE,OAAO,KAAK;IAC3C,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,iBAAS,EAAE,OAAO;IACvC,IAAI,cAAc,CAAA,GAAA,uCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,QAAQ;YAAC,aAAa,MAAM,WAAW,IAAI;QAAY;QACvD,kBAAkB;IACpB;IACA,IAAI,WAAW,CAAA,GAAA,qBAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAClD,OAAO,SAAS,EAAE;IAElB,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,aAAa,aAAa;QACnD,KAAK;QACL,MAAM,MAAM,IAAI,IAAI;QACpB,oBAAkB,MAAM,WAAW,IAAI;OACtC,YAAY,QAAQ;AAG3B","sources":["packages/react-aria-components/src/Toolbar.tsx"],"sourcesContent":["/*\n * Copyright 2023 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 {AriaToolbarProps, useToolbar} from '@react-aria/toolbar';\nimport {ContextValue, RenderProps, SlotProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, mergeProps} from '@react-aria/utils';\nimport {forwardRefType, GlobalDOMAttributes, Orientation} from '@react-types/shared';\nimport React, {createContext, ForwardedRef, forwardRef} from 'react';\n\nexport interface ToolbarRenderProps {\n /**\n * The current orientation of the toolbar.\n * @selector [data-orientation]\n */\n orientation: Orientation\n}\n\nexport interface ToolbarProps extends AriaToolbarProps, SlotProps, RenderProps<ToolbarRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n}\n\nexport const ToolbarContext = createContext<ContextValue<ToolbarProps, HTMLDivElement>>({});\n\n/**\n * A toolbar is a container for a set of interactive controls, such as buttons, dropdown menus, or checkboxes,\n * with arrow key navigation.\n */\nexport const Toolbar = /*#__PURE__*/ (forwardRef as forwardRefType)(function Toolbar(props: ToolbarProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, ToolbarContext);\n let {toolbarProps} = useToolbar(props, ref);\n let renderProps = useRenderProps({\n ...props,\n values: {orientation: props.orientation || 'horizontal'},\n defaultClassName: 'react-aria-Toolbar'\n });\n let DOMProps = filterDOMProps(props, {global: true});\n delete DOMProps.id;\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, toolbarProps)}\n ref={ref}\n slot={props.slot || undefined}\n data-orientation={props.orientation || 'horizontal'}>\n {renderProps.children}\n </div>\n );\n});\n"],"names":[],"version":3,"file":"Toolbar.module.js.map"}
|
package/dist/Tooltip.main.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
var $c5ccf687772c0422$exports = require("./utils.main.js");
|
|
2
2
|
var $ee5958cbdc6becc1$exports = require("./OverlayArrow.main.js");
|
|
3
3
|
var $ct4WB$reactaria = require("react-aria");
|
|
4
|
+
var $ct4WB$reactariautils = require("@react-aria/utils");
|
|
4
5
|
var $ct4WB$reactariafocus = require("@react-aria/focus");
|
|
5
6
|
var $ct4WB$reactstately = require("react-stately");
|
|
6
7
|
var $ct4WB$react = require("react");
|
|
7
|
-
var $ct4WB$reactariautils = require("@react-aria/utils");
|
|
8
8
|
|
|
9
9
|
|
|
10
10
|
function $parcel$interopDefault(a) {
|
|
@@ -113,10 +113,12 @@ function $f9dd4061eb43ac38$var$TooltipInner(props) {
|
|
|
113
113
|
});
|
|
114
114
|
props = (0, $ct4WB$reactaria.mergeProps)(props, overlayProps);
|
|
115
115
|
let { tooltipProps: tooltipProps } = (0, $ct4WB$reactaria.useTooltip)(props, state);
|
|
116
|
+
let DOMProps = (0, $ct4WB$reactariautils.filterDOMProps)(props, {
|
|
117
|
+
global: true
|
|
118
|
+
});
|
|
116
119
|
return /*#__PURE__*/ (0, ($parcel$interopDefault($ct4WB$react))).createElement("div", {
|
|
117
|
-
...tooltipProps,
|
|
120
|
+
...(0, $ct4WB$reactaria.mergeProps)(DOMProps, renderProps, tooltipProps),
|
|
118
121
|
ref: props.tooltipRef,
|
|
119
|
-
...renderProps,
|
|
120
122
|
style: {
|
|
121
123
|
...overlayProps.style,
|
|
122
124
|
...renderProps.style
|
package/dist/Tooltip.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;AAiEM,MAAM,0DAA6B,CAAA,GAAA,0BAAY,EAA8B;AAC7E,MAAM,0DAAiB,CAAA,GAAA,0BAAY,EAA8C;AAOjF,SAAS,0CAAe,KAAmC;IAChE,IAAI,QAAQ,CAAA,GAAA,0CAAqB,EAAE;IACnC,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAoB;IACnC,IAAI,gBAAC,YAAY,gBAAE,YAAY,EAAC,GAAG,CAAA,GAAA,kCAAgB,EAAE,OAAO,OAAO;IAEnE,qBACE,0DAAC,CAAA,GAAA,kCAAO;QACN,QAAQ;YACN;gBAAC;gBAA4B;aAAM;YACnC;gBAAC;gBAAgB;oBAAC,GAAG,YAAY;oBAAE,YAAY;gBAAG;aAAE;SACrD;qBACD,0DAAC,CAAA,GAAA,uCAAgB;QAAG,GAAG,YAAY;QAAE,KAAK;OACvC,MAAM,QAAQ;AAIvB;AAKO,MAAM,4CAAwB,AAAd,WAAW,GAAI,CAAA,GAAA,uBAAS,EAAqB,SAAS,QAAQ,4BAAC,wBAAwB,EAAE,GAAG,OAAoB,EAAE,GAAiC;IACx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AAU,IAAI;IACzF,IAAI,cAAc,CAAA,GAAA,wCAAa,EAAE;QAC/B,GAAG,KAAK;QACR,kBAAkB;QAClB,QAAQ;uBACN;wBACA;YACA,WAAW,MAAM,SAAS;mBAC1B;QACF;IACF;IAEA,QAAQ,CAAA,GAAA,2BAAS,EAAE,OAAO;IAC1B,IAAI,gBAAC,YAAY,EAAC,GAAG,CAAA,GAAA,2BAAS,EAAE,OAAO;IAEvC,IAAI,WAAW,CAAA,GAAA,oCAAa,EAAE,OAAO;QAAC,QAAQ;IAAI;IAElD,qBACE,0DAAC;QACE,GAAG,CAAA,GAAA,2BAAS,EAAE,UAAU,aAAa,aAAa;QACnD,KAAK,MAAM,UAAU;QACrB,OAAO;YAAC,GAAG,aAAa,KAAK;YAAE,GAAG,YAAY,KAAK;QAAA;QACnD,kBAAgB,sBAAA,uBAAA,YAAa;QAC7B,iBAAe,cAAc;QAC7B,gBAAc,MAAM,SAAS,IAAI;qBACjC,0DAAC,CAAA,GAAA,6CAAkB,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;uBAAE;YAAW,KAAK;QAAQ;OAC1E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Tooltip.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, FocusableElement, forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {AriaPositionProps, mergeProps, OverlayContainer, Placement, PlacementAxis, PositionProps, useOverlayPosition, useTooltip, useTooltipTrigger} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {FocusableProvider} from '@react-aria/focus';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, TooltipTriggerProps, TooltipTriggerState, useTooltipTriggerState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useRef, useState} from 'react';\n\nexport interface TooltipTriggerComponentProps extends TooltipTriggerProps {\n children: ReactNode\n}\n\nexport interface TooltipProps extends PositionProps, Pick<AriaPositionProps, 'arrowBoundaryOffset'>, OverlayTriggerProps, AriaLabelingProps, RenderProps<TooltipRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The ref for the element which the tooltip positions itself with respect to.\n *\n * When used within a TooltipTrigger this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the tooltip is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the tooltip 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 placement of the tooltip with respect to the trigger.\n * @default 'top'\n */\n placement?: Placement\n}\n\nexport interface TooltipRenderProps {\n /**\n * The placement of the tooltip relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the tooltip is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the tooltip is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the tooltip.\n */\n state: TooltipTriggerState\n}\n\nexport const TooltipTriggerStateContext = createContext<TooltipTriggerState | null>(null);\nexport const TooltipContext = createContext<ContextValue<TooltipProps, HTMLDivElement>>(null);\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerComponentProps): JSX.Element {\n let state = useTooltipTriggerState(props);\n let ref = useRef<FocusableElement>(null);\n let {triggerProps, tooltipProps} = useTooltipTrigger(props, state, ref);\n\n return (\n <Provider\n values={[\n [TooltipTriggerStateContext, state],\n [TooltipContext, {...tooltipProps, triggerRef: ref}]\n ]}>\n <FocusableProvider {...triggerProps} ref={ref}>\n {props.children}\n </FocusableProvider>\n </Provider>\n );\n}\n\n/**\n * A tooltip displays a description of an element on hover or focus.\n */\nexport const Tooltip = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tooltip({UNSTABLE_portalContainer, ...props}: TooltipProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TooltipContext);\n let contextState = useContext(TooltipTriggerStateContext);\n let localState = useTooltipTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n if (!state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <OverlayContainer portalContainer={UNSTABLE_portalContainer}>\n <TooltipInner {...props} tooltipRef={ref} isExiting={isExiting} />\n </OverlayContainer>\n );\n});\n\nfunction TooltipInner(props: TooltipProps & {isExiting: boolean, tooltipRef: RefObject<HTMLDivElement | null>}) {\n let state = useContext(TooltipTriggerStateContext)!;\n\n // Calculate the arrow size internally\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {overlayProps, arrowProps, placement} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: props.triggerRef!,\n overlayRef: props.tooltipRef,\n offset: props.offset,\n crossOffset: props.crossOffset,\n isOpen: state.isOpen,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: props.arrowBoundaryOffset,\n shouldFlip: props.shouldFlip,\n onClose: () => state.close(true)\n });\n\n let isEntering = useEnterAnimation(props.tooltipRef, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tooltip',\n values: {\n placement,\n isEntering,\n isExiting: props.isExiting,\n state\n }\n });\n\n props = mergeProps(props, overlayProps);\n let {tooltipProps} = useTooltip(props, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, tooltipProps)}\n ref={props.tooltipRef}\n style={{...overlayProps.style, ...renderProps.style}}\n data-placement={placement ?? undefined}\n data-entering={isEntering || undefined}\n data-exiting={props.isExiting || undefined}>\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {renderProps.children}\n </OverlayArrowContext.Provider>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Tooltip.main.js.map"}
|
package/dist/Tooltip.mjs
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.mjs";
|
|
2
2
|
import {OverlayArrowContext as $44f671af83e7d9e0$export$2de4954e8ae13b9f} from "./OverlayArrow.mjs";
|
|
3
3
|
import {useTooltipTrigger as $cCslV$useTooltipTrigger, OverlayContainer as $cCslV$OverlayContainer, useOverlayPosition as $cCslV$useOverlayPosition, mergeProps as $cCslV$mergeProps, useTooltip as $cCslV$useTooltip} from "react-aria";
|
|
4
|
+
import {useExitAnimation as $cCslV$useExitAnimation, useLayoutEffect as $cCslV$useLayoutEffect, useEnterAnimation as $cCslV$useEnterAnimation, filterDOMProps as $cCslV$filterDOMProps} from "@react-aria/utils";
|
|
4
5
|
import {FocusableProvider as $cCslV$FocusableProvider} from "@react-aria/focus";
|
|
5
6
|
import {useTooltipTriggerState as $cCslV$useTooltipTriggerState} from "react-stately";
|
|
6
7
|
import $cCslV$react, {createContext as $cCslV$createContext, useRef as $cCslV$useRef, forwardRef as $cCslV$forwardRef, useContext as $cCslV$useContext, useState as $cCslV$useState} from "react";
|
|
7
|
-
import {useExitAnimation as $cCslV$useExitAnimation, useLayoutEffect as $cCslV$useLayoutEffect, useEnterAnimation as $cCslV$useEnterAnimation} from "@react-aria/utils";
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -100,10 +100,12 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
|
100
100
|
});
|
|
101
101
|
props = (0, $cCslV$mergeProps)(props, overlayProps);
|
|
102
102
|
let { tooltipProps: tooltipProps } = (0, $cCslV$useTooltip)(props, state);
|
|
103
|
+
let DOMProps = (0, $cCslV$filterDOMProps)(props, {
|
|
104
|
+
global: true
|
|
105
|
+
});
|
|
103
106
|
return /*#__PURE__*/ (0, $cCslV$react).createElement("div", {
|
|
104
|
-
...tooltipProps,
|
|
107
|
+
...(0, $cCslV$mergeProps)(DOMProps, renderProps, tooltipProps),
|
|
105
108
|
ref: props.tooltipRef,
|
|
106
|
-
...renderProps,
|
|
107
109
|
style: {
|
|
108
110
|
...overlayProps.style,
|
|
109
111
|
...renderProps.style
|
package/dist/Tooltip.module.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {Provider as $64fa3d84918910a7$export$2881499e37b75b9a, useContextProps as $64fa3d84918910a7$export$29f1550f4b0d4415, useRenderProps as $64fa3d84918910a7$export$4d86445c2cf5e3} from "./utils.module.js";
|
|
2
2
|
import {OverlayArrowContext as $44f671af83e7d9e0$export$2de4954e8ae13b9f} from "./OverlayArrow.module.js";
|
|
3
3
|
import {useTooltipTrigger as $cCslV$useTooltipTrigger, OverlayContainer as $cCslV$OverlayContainer, useOverlayPosition as $cCslV$useOverlayPosition, mergeProps as $cCslV$mergeProps, useTooltip as $cCslV$useTooltip} from "react-aria";
|
|
4
|
+
import {useExitAnimation as $cCslV$useExitAnimation, useLayoutEffect as $cCslV$useLayoutEffect, useEnterAnimation as $cCslV$useEnterAnimation, filterDOMProps as $cCslV$filterDOMProps} from "@react-aria/utils";
|
|
4
5
|
import {FocusableProvider as $cCslV$FocusableProvider} from "@react-aria/focus";
|
|
5
6
|
import {useTooltipTriggerState as $cCslV$useTooltipTriggerState} from "react-stately";
|
|
6
7
|
import $cCslV$react, {createContext as $cCslV$createContext, useRef as $cCslV$useRef, forwardRef as $cCslV$forwardRef, useContext as $cCslV$useContext, useState as $cCslV$useState} from "react";
|
|
7
|
-
import {useExitAnimation as $cCslV$useExitAnimation, useLayoutEffect as $cCslV$useLayoutEffect, useEnterAnimation as $cCslV$useEnterAnimation} from "@react-aria/utils";
|
|
8
8
|
|
|
9
9
|
/*
|
|
10
10
|
* Copyright 2022 Adobe. All rights reserved.
|
|
@@ -100,10 +100,12 @@ function $4e3b923658d69c60$var$TooltipInner(props) {
|
|
|
100
100
|
});
|
|
101
101
|
props = (0, $cCslV$mergeProps)(props, overlayProps);
|
|
102
102
|
let { tooltipProps: tooltipProps } = (0, $cCslV$useTooltip)(props, state);
|
|
103
|
+
let DOMProps = (0, $cCslV$filterDOMProps)(props, {
|
|
104
|
+
global: true
|
|
105
|
+
});
|
|
103
106
|
return /*#__PURE__*/ (0, $cCslV$react).createElement("div", {
|
|
104
|
-
...tooltipProps,
|
|
107
|
+
...(0, $cCslV$mergeProps)(DOMProps, renderProps, tooltipProps),
|
|
105
108
|
ref: props.tooltipRef,
|
|
106
|
-
...renderProps,
|
|
107
109
|
style: {
|
|
108
110
|
...overlayProps.style,
|
|
109
111
|
...renderProps.style
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;AAA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c;QAC7B,gBAAc,MAAM,SAAS,IAAI;qBACjC,gCAAC,CAAA,GAAA,yCAAkB,EAAE,QAAQ;QAAC,OAAO;YAAC,GAAG,UAAU;uBAAE;YAAW,KAAK;QAAQ;OAC1E,YAAY,QAAQ;AAI7B","sources":["packages/react-aria-components/src/Tooltip.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, FocusableElement, forwardRefType, GlobalDOMAttributes, RefObject} from '@react-types/shared';\nimport {AriaPositionProps, mergeProps, OverlayContainer, Placement, PlacementAxis, PositionProps, useOverlayPosition, useTooltip, useTooltipTrigger} from 'react-aria';\nimport {ContextValue, Provider, RenderProps, useContextProps, useRenderProps} from './utils';\nimport {filterDOMProps, useEnterAnimation, useExitAnimation, useLayoutEffect} from '@react-aria/utils';\nimport {FocusableProvider} from '@react-aria/focus';\nimport {OverlayArrowContext} from './OverlayArrow';\nimport {OverlayTriggerProps, TooltipTriggerProps, TooltipTriggerState, useTooltipTriggerState} from 'react-stately';\nimport React, {createContext, ForwardedRef, forwardRef, JSX, ReactNode, useContext, useRef, useState} from 'react';\n\nexport interface TooltipTriggerComponentProps extends TooltipTriggerProps {\n children: ReactNode\n}\n\nexport interface TooltipProps extends PositionProps, Pick<AriaPositionProps, 'arrowBoundaryOffset'>, OverlayTriggerProps, AriaLabelingProps, RenderProps<TooltipRenderProps>, GlobalDOMAttributes<HTMLDivElement> {\n /**\n * The ref for the element which the tooltip positions itself with respect to.\n *\n * When used within a TooltipTrigger this is set automatically. It is only required when used standalone.\n */\n triggerRef?: RefObject<Element | null>,\n /**\n * Whether the tooltip is currently performing an entry animation.\n */\n isEntering?: boolean,\n /**\n * Whether the tooltip 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 placement of the tooltip with respect to the trigger.\n * @default 'top'\n */\n placement?: Placement\n}\n\nexport interface TooltipRenderProps {\n /**\n * The placement of the tooltip relative to the trigger.\n * @selector [data-placement=\"left | right | top | bottom\"]\n */\n placement: PlacementAxis | null,\n /**\n * Whether the tooltip is currently entering. Use this to apply animations.\n * @selector [data-entering]\n */\n isEntering: boolean,\n /**\n * Whether the tooltip is currently exiting. Use this to apply animations.\n * @selector [data-exiting]\n */\n isExiting: boolean,\n /**\n * State of the tooltip.\n */\n state: TooltipTriggerState\n}\n\nexport const TooltipTriggerStateContext = createContext<TooltipTriggerState | null>(null);\nexport const TooltipContext = createContext<ContextValue<TooltipProps, HTMLDivElement>>(null);\n\n/**\n * TooltipTrigger wraps around a trigger element and a Tooltip. It handles opening and closing\n * the Tooltip when the user hovers over or focuses the trigger, and positioning the Tooltip\n * relative to the trigger.\n */\nexport function TooltipTrigger(props: TooltipTriggerComponentProps): JSX.Element {\n let state = useTooltipTriggerState(props);\n let ref = useRef<FocusableElement>(null);\n let {triggerProps, tooltipProps} = useTooltipTrigger(props, state, ref);\n\n return (\n <Provider\n values={[\n [TooltipTriggerStateContext, state],\n [TooltipContext, {...tooltipProps, triggerRef: ref}]\n ]}>\n <FocusableProvider {...triggerProps} ref={ref}>\n {props.children}\n </FocusableProvider>\n </Provider>\n );\n}\n\n/**\n * A tooltip displays a description of an element on hover or focus.\n */\nexport const Tooltip = /*#__PURE__*/ (forwardRef as forwardRefType)(function Tooltip({UNSTABLE_portalContainer, ...props}: TooltipProps, ref: ForwardedRef<HTMLDivElement>) {\n [props, ref] = useContextProps(props, ref, TooltipContext);\n let contextState = useContext(TooltipTriggerStateContext);\n let localState = useTooltipTriggerState(props);\n let state = props.isOpen != null || props.defaultOpen != null || !contextState ? localState : contextState;\n let isExiting = useExitAnimation(ref, state.isOpen) || props.isExiting || false;\n if (!state.isOpen && !isExiting) {\n return null;\n }\n\n return (\n <OverlayContainer portalContainer={UNSTABLE_portalContainer}>\n <TooltipInner {...props} tooltipRef={ref} isExiting={isExiting} />\n </OverlayContainer>\n );\n});\n\nfunction TooltipInner(props: TooltipProps & {isExiting: boolean, tooltipRef: RefObject<HTMLDivElement | null>}) {\n let state = useContext(TooltipTriggerStateContext)!;\n\n // Calculate the arrow size internally\n // Referenced from: packages/@react-spectrum/tooltip/src/TooltipTrigger.tsx\n let arrowRef = useRef<HTMLDivElement>(null);\n let [arrowWidth, setArrowWidth] = useState(0);\n useLayoutEffect(() => {\n if (arrowRef.current && state.isOpen) {\n setArrowWidth(arrowRef.current.getBoundingClientRect().width);\n }\n }, [state.isOpen, arrowRef]);\n\n let {overlayProps, arrowProps, placement} = useOverlayPosition({\n placement: props.placement || 'top',\n targetRef: props.triggerRef!,\n overlayRef: props.tooltipRef,\n offset: props.offset,\n crossOffset: props.crossOffset,\n isOpen: state.isOpen,\n arrowSize: arrowWidth,\n arrowBoundaryOffset: props.arrowBoundaryOffset,\n shouldFlip: props.shouldFlip,\n onClose: () => state.close(true)\n });\n\n let isEntering = useEnterAnimation(props.tooltipRef, !!placement) || props.isEntering || false;\n let renderProps = useRenderProps({\n ...props,\n defaultClassName: 'react-aria-Tooltip',\n values: {\n placement,\n isEntering,\n isExiting: props.isExiting,\n state\n }\n });\n\n props = mergeProps(props, overlayProps);\n let {tooltipProps} = useTooltip(props, state);\n\n let DOMProps = filterDOMProps(props, {global: true});\n\n return (\n <div\n {...mergeProps(DOMProps, renderProps, tooltipProps)}\n ref={props.tooltipRef}\n style={{...overlayProps.style, ...renderProps.style}}\n data-placement={placement ?? undefined}\n data-entering={isEntering || undefined}\n data-exiting={props.isExiting || undefined}>\n <OverlayArrowContext.Provider value={{...arrowProps, placement, ref: arrowRef}}>\n {renderProps.children}\n </OverlayArrowContext.Provider>\n </div>\n );\n}\n"],"names":[],"version":3,"file":"Tooltip.module.js.map"}
|