@react-spectrum/button 3.16.13 → 3.16.15

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.
@@ -1,4 +1,4 @@
1
- require("./button.040d375e.css");
1
+ require("./button.9e5e3032.css");
2
2
  var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
3
3
  var $9HF4v$reactspectrumutils = require("@react-spectrum/utils");
4
4
  var $9HF4v$spectrumiconsuiCornerTriangle = require("@spectrum-icons/ui/CornerTriangle");
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $kfV1G$button_vars_cssmodulejs from "./button_vars_css.mjs";
3
3
  import {useSlotProps as $kfV1G$useSlotProps, classNames as $kfV1G$classNames, useFocusableRef as $kfV1G$useFocusableRef, useStyleProps as $kfV1G$useStyleProps, ClearSlots as $kfV1G$ClearSlots, SlotProvider as $kfV1G$SlotProvider} from "@react-spectrum/utils";
4
4
  import $kfV1G$spectrumiconsuiCornerTriangle from "@spectrum-icons/ui/CornerTriangle";
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $kfV1G$button_vars_cssmodulejs from "./button_vars_css.module.js";
3
3
  import {useSlotProps as $kfV1G$useSlotProps, classNames as $kfV1G$classNames, useFocusableRef as $kfV1G$useFocusableRef, useStyleProps as $kfV1G$useStyleProps, ClearSlots as $kfV1G$ClearSlots, SlotProvider as $kfV1G$SlotProvider} from "@react-spectrum/utils";
4
4
  import $kfV1G$spectrumiconsuiCornerTriangle from "@spectrum-icons/ui/CornerTriangle";
@@ -1,5 +1,5 @@
1
1
  var $b2da92ebd9a2bc00$exports = require("./intlStrings.main.js");
2
- require("./button.040d375e.css");
2
+ require("./button.9e5e3032.css");
3
3
  var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
4
4
  var $hN0b7$reactspectrumutils = require("@react-spectrum/utils");
5
5
  var $hN0b7$reactariafocus = require("@react-aria/focus");
package/dist/Button.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import $l1zrX$intlStringsmodulejs from "./intlStrings.mjs";
2
- import "./button.040d375e.css";
2
+ import "./button.9e5e3032.css";
3
3
  import $l1zrX$button_vars_cssmodulejs from "./button_vars_css.mjs";
4
4
  import {useSlotProps as $l1zrX$useSlotProps, useFocusableRef as $l1zrX$useFocusableRef, useStyleProps as $l1zrX$useStyleProps, useHasChild as $l1zrX$useHasChild, classNames as $l1zrX$classNames, SlotProvider as $l1zrX$SlotProvider} from "@react-spectrum/utils";
5
5
  import {FocusRing as $l1zrX$FocusRing} from "@react-aria/focus";
@@ -1,5 +1,5 @@
1
1
  import $l1zrX$intlStringsmodulejs from "./intlStrings.module.js";
2
- import "./button.040d375e.css";
2
+ import "./button.9e5e3032.css";
3
3
  import $l1zrX$button_vars_cssmodulejs from "./button_vars_css.module.js";
4
4
  import {useSlotProps as $l1zrX$useSlotProps, useFocusableRef as $l1zrX$useFocusableRef, useStyleProps as $l1zrX$useStyleProps, useHasChild as $l1zrX$useHasChild, classNames as $l1zrX$classNames, SlotProvider as $l1zrX$SlotProvider} from "@react-spectrum/utils";
5
5
  import {FocusRing as $l1zrX$FocusRing} from "@react-aria/focus";
@@ -1,4 +1,4 @@
1
- require("./button.040d375e.css");
1
+ require("./button.9e5e3032.css");
2
2
  var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
3
3
  var $3cv9y$reactspectrumutils = require("@react-spectrum/utils");
4
4
  var $3cv9y$spectrumiconsuiCrossSmall = require("@spectrum-icons/ui/CrossSmall");
@@ -39,7 +39,7 @@ $parcel$export(module.exports, "ClearButton", () => $9c84a434f1c9da63$export$13e
39
39
  const $9c84a434f1c9da63$export$13ec83e50bf04290 = /*#__PURE__*/ (0, ($parcel$interopDefault($3cv9y$react))).forwardRef(function ClearButton(props, ref) {
40
40
  let { children: children = /*#__PURE__*/ (0, ($parcel$interopDefault($3cv9y$react))).createElement((0, ($parcel$interopDefault($3cv9y$spectrumiconsuiCrossSmall))), {
41
41
  UNSAFE_className: (0, ($parcel$interopDefault($afc5a4514aca2340$exports)))['spectrum-Icon']
42
- }), focusClassName: focusClassName, variant: variant, autoFocus: autoFocus, isDisabled: isDisabled, preventFocus: preventFocus, elementType: elementType = preventFocus ? 'div' : 'button', ...otherProps } = props;
42
+ }), focusClassName: focusClassName, variant: variant, autoFocus: autoFocus, isDisabled: isDisabled, preventFocus: preventFocus, elementType: elementType = preventFocus ? 'div' : 'button', inset: inset = false, ...otherProps } = props;
43
43
  let domRef = (0, $3cv9y$reactspectrumutils.useFocusableRef)(ref);
44
44
  let { buttonProps: buttonProps, isPressed: isPressed } = (0, $3cv9y$reactariabutton.useButton)({
45
45
  ...props,
@@ -65,7 +65,8 @@ const $9c84a434f1c9da63$export$13ec83e50bf04290 = /*#__PURE__*/ (0, ($parcel$int
65
65
  [`spectrum-ClearButton--${variant}`]: variant,
66
66
  'is-disabled': isDisabled,
67
67
  'is-active': isPressed,
68
- 'is-hovered': isHovered
68
+ 'is-hovered': isHovered,
69
+ 'spectrum-ClearButton--inset': inset
69
70
  }, styleProps.className)
70
71
  }, children));
71
72
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAoBM,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAAuB,EAAE,GAAoC;IAC5H,IAAI,YACF,yBAAW,0DAAC,CAAA,GAAA,0DAAS;QAAE,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,gBAAgB;wBAChE,cAAc,WACd,OAAO,aACP,SAAS,cACT,UAAU,gBACV,YAAY,eACZ,cAAc,eAAe,QAAQ,UACrC,GAAG,YACJ,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,gCAAQ,EAAE;QAAC,GAAG,KAAK;qBAAE;IAAW,GAAG;IAClE,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,4EAA4E;IAC5E,4EAA4E;IAC5E,2CAA2C;IAC3C,IAAI,cACF,OAAO,YAAY,QAAQ;IAG7B,IAAI,cAAc;IAClB,qBACE,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,cAAc;QAAiB,WAAW;qBACtF,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,CAAA,GAAA,gCAAS,EAAE,aAAa,WAAW;QACvC,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,wBACA;YACE,CAAC,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAE;YACtC,eAAe;YACf,aAAa;YACb,cAAc;QAChB,GACA,WAAW,SAAS;OAGvB;AAIT","sources":["packages/@react-spectrum/button/src/ClearButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonElementTypeProps, ButtonProps} from '@react-types/button';\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossSmall from '@spectrum-icons/ui/CrossSmall';\nimport {DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ElementType} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport {useButton} from '@react-aria/button';\nimport {useHover} from '@react-aria/interactions';\n\ninterface ClearButtonProps<T extends ElementType = 'button'> extends ButtonProps, AriaButtonElementTypeProps<T>, DOMProps, StyleProps {\n focusClassName?: string,\n variant?: 'overBackground',\n excludeFromTabOrder?: boolean,\n preventFocus?: boolean\n}\n\nexport const ClearButton = React.forwardRef(function ClearButton(props: ClearButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n let {\n children = <CrossSmall UNSAFE_className={styles['spectrum-Icon']} />,\n focusClassName,\n variant,\n autoFocus,\n isDisabled,\n preventFocus,\n elementType = preventFocus ? 'div' : 'button' as ElementType,\n ...otherProps\n } = props;\n let domRef = useFocusableRef(ref);\n let {buttonProps, isPressed} = useButton({...props, elementType}, domRef);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {styleProps} = useStyleProps(otherProps);\n\n // For cases like the clear button in a search field, remove the tabIndex so\n // iOS 14 with VoiceOver doesn't focus the button and hide the keyboard when\n // moving the cursor over the clear button.\n if (preventFocus) {\n delete buttonProps.tabIndex;\n }\n\n let ElementType = elementType;\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring', focusClassName)} autoFocus={autoFocus}>\n <ElementType\n {...styleProps}\n {...mergeProps(buttonProps, hoverProps)}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ClearButton',\n {\n [`spectrum-ClearButton--${variant}`]: variant,\n 'is-disabled': isDisabled,\n 'is-active': isPressed,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n {children}\n </ElementType>\n </FocusRing>\n );\n});\n"],"names":[],"version":3,"file":"ClearButton.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAqBM,MAAM,0DAAc,CAAA,GAAA,sCAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAAuB,EAAE,GAAoC;IAC5H,IAAI,YACF,yBAAW,0DAAC,CAAA,GAAA,0DAAS;QAAE,kBAAkB,CAAA,GAAA,mDAAK,CAAC,CAAC,gBAAgB;wBAChE,cAAc,WACd,OAAO,aACP,SAAS,cACT,UAAU,gBACV,YAAY,eACZ,cAAc,eAAe,QAAQ,iBACrC,QAAQ,OACR,GAAG,YACJ,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,yCAAc,EAAE;IAC7B,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,gCAAQ,EAAE;QAAC,GAAG,KAAK;qBAAE;IAAW,GAAG;IAClE,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,4EAA4E;IAC5E,4EAA4E;IAC5E,2CAA2C;IAC3C,IAAI,cACF,OAAO,YAAY,QAAQ;IAG7B,IAAI,cAAc;IAClB,qBACE,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG,cAAc;QAAiB,WAAW;qBACtF,0DAAC;QACE,GAAG,UAAU;QACb,GAAG,CAAA,GAAA,gCAAS,EAAE,aAAa,WAAW;QACvC,KAAK;QACL,WACE,CAAA,GAAA,oCAAS,EACP,CAAA,GAAA,mDAAK,GACL,wBACA;YACE,CAAC,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAE;YACtC,eAAe;YACf,aAAa;YACb,cAAc;YACd,+BAA+B;QACjC,GACA,WAAW,SAAS;OAGvB;AAIT","sources":["packages/@react-spectrum/button/src/ClearButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonElementTypeProps, ButtonProps} from '@react-types/button';\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossSmall from '@spectrum-icons/ui/CrossSmall';\nimport {DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ElementType} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport {useButton} from '@react-aria/button';\nimport {useHover} from '@react-aria/interactions';\n\ninterface ClearButtonProps<T extends ElementType = 'button'> extends ButtonProps, AriaButtonElementTypeProps<T>, DOMProps, StyleProps {\n focusClassName?: string,\n variant?: 'overBackground',\n excludeFromTabOrder?: boolean,\n preventFocus?: boolean,\n inset?: boolean\n}\n\nexport const ClearButton = React.forwardRef(function ClearButton(props: ClearButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n let {\n children = <CrossSmall UNSAFE_className={styles['spectrum-Icon']} />,\n focusClassName,\n variant,\n autoFocus,\n isDisabled,\n preventFocus,\n elementType = preventFocus ? 'div' : 'button' as ElementType,\n inset = false,\n ...otherProps\n } = props;\n let domRef = useFocusableRef(ref);\n let {buttonProps, isPressed} = useButton({...props, elementType}, domRef);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {styleProps} = useStyleProps(otherProps);\n\n // For cases like the clear button in a search field, remove the tabIndex so\n // iOS 14 with VoiceOver doesn't focus the button and hide the keyboard when\n // moving the cursor over the clear button.\n if (preventFocus) {\n delete buttonProps.tabIndex;\n }\n\n let ElementType = elementType;\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring', focusClassName)} autoFocus={autoFocus}>\n <ElementType\n {...styleProps}\n {...mergeProps(buttonProps, hoverProps)}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ClearButton',\n {\n [`spectrum-ClearButton--${variant}`]: variant,\n 'is-disabled': isDisabled,\n 'is-active': isPressed,\n 'is-hovered': isHovered,\n 'spectrum-ClearButton--inset': inset\n },\n styleProps.className\n )\n }>\n {children}\n </ElementType>\n </FocusRing>\n );\n});\n"],"names":[],"version":3,"file":"ClearButton.main.js.map"}
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $d0kJV$button_vars_cssmodulejs from "./button_vars_css.mjs";
3
3
  import {useFocusableRef as $d0kJV$useFocusableRef, useStyleProps as $d0kJV$useStyleProps, classNames as $d0kJV$classNames} from "@react-spectrum/utils";
4
4
  import $d0kJV$spectrumiconsuiCrossSmall from "@spectrum-icons/ui/CrossSmall";
@@ -33,7 +33,7 @@ function $parcel$interopDefault(a) {
33
33
  const $dd24e555a16de2ae$export$13ec83e50bf04290 = /*#__PURE__*/ (0, $d0kJV$react).forwardRef(function ClearButton(props, ref) {
34
34
  let { children: children = /*#__PURE__*/ (0, $d0kJV$react).createElement((0, $d0kJV$spectrumiconsuiCrossSmall), {
35
35
  UNSAFE_className: (0, ($parcel$interopDefault($d0kJV$button_vars_cssmodulejs)))['spectrum-Icon']
36
- }), focusClassName: focusClassName, variant: variant, autoFocus: autoFocus, isDisabled: isDisabled, preventFocus: preventFocus, elementType: elementType = preventFocus ? 'div' : 'button', ...otherProps } = props;
36
+ }), focusClassName: focusClassName, variant: variant, autoFocus: autoFocus, isDisabled: isDisabled, preventFocus: preventFocus, elementType: elementType = preventFocus ? 'div' : 'button', inset: inset = false, ...otherProps } = props;
37
37
  let domRef = (0, $d0kJV$useFocusableRef)(ref);
38
38
  let { buttonProps: buttonProps, isPressed: isPressed } = (0, $d0kJV$useButton)({
39
39
  ...props,
@@ -59,7 +59,8 @@ const $dd24e555a16de2ae$export$13ec83e50bf04290 = /*#__PURE__*/ (0, $d0kJV$react
59
59
  [`spectrum-ClearButton--${variant}`]: variant,
60
60
  'is-disabled': isDisabled,
61
61
  'is-active': isPressed,
62
- 'is-hovered': isHovered
62
+ 'is-hovered': isHovered,
63
+ 'spectrum-ClearButton--inset': inset
63
64
  }, styleProps.className)
64
65
  }, children));
65
66
  });
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $d0kJV$button_vars_cssmodulejs from "./button_vars_css.module.js";
3
3
  import {useFocusableRef as $d0kJV$useFocusableRef, useStyleProps as $d0kJV$useStyleProps, classNames as $d0kJV$classNames} from "@react-spectrum/utils";
4
4
  import $d0kJV$spectrumiconsuiCrossSmall from "@spectrum-icons/ui/CrossSmall";
@@ -33,7 +33,7 @@ function $parcel$interopDefault(a) {
33
33
  const $dd24e555a16de2ae$export$13ec83e50bf04290 = /*#__PURE__*/ (0, $d0kJV$react).forwardRef(function ClearButton(props, ref) {
34
34
  let { children: children = /*#__PURE__*/ (0, $d0kJV$react).createElement((0, $d0kJV$spectrumiconsuiCrossSmall), {
35
35
  UNSAFE_className: (0, ($parcel$interopDefault($d0kJV$button_vars_cssmodulejs)))['spectrum-Icon']
36
- }), focusClassName: focusClassName, variant: variant, autoFocus: autoFocus, isDisabled: isDisabled, preventFocus: preventFocus, elementType: elementType = preventFocus ? 'div' : 'button', ...otherProps } = props;
36
+ }), focusClassName: focusClassName, variant: variant, autoFocus: autoFocus, isDisabled: isDisabled, preventFocus: preventFocus, elementType: elementType = preventFocus ? 'div' : 'button', inset: inset = false, ...otherProps } = props;
37
37
  let domRef = (0, $d0kJV$useFocusableRef)(ref);
38
38
  let { buttonProps: buttonProps, isPressed: isPressed } = (0, $d0kJV$useButton)({
39
39
  ...props,
@@ -59,7 +59,8 @@ const $dd24e555a16de2ae$export$13ec83e50bf04290 = /*#__PURE__*/ (0, $d0kJV$react
59
59
  [`spectrum-ClearButton--${variant}`]: variant,
60
60
  'is-disabled': isDisabled,
61
61
  'is-active': isPressed,
62
- 'is-hovered': isHovered
62
+ 'is-hovered': isHovered,
63
+ 'spectrum-ClearButton--inset': inset
63
64
  }, styleProps.className)
64
65
  }, children));
65
66
  });
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAoBM,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAAuB,EAAE,GAAoC;IAC5H,IAAI,YACF,yBAAW,gCAAC,CAAA,GAAA,gCAAS;QAAE,kBAAkB,CAAA,GAAA,wDAAK,CAAC,CAAC,gBAAgB;wBAChE,cAAc,WACd,OAAO,aACP,SAAS,cACT,UAAU,gBACV,YAAY,eACZ,cAAc,eAAe,QAAQ,UACrC,GAAG,YACJ,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE;IAC7B,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE;QAAC,GAAG,KAAK;qBAAE;IAAW,GAAG;IAClE,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,4EAA4E;IAC5E,4EAA4E;IAC5E,2CAA2C;IAC3C,IAAI,cACF,OAAO,YAAY,QAAQ;IAG7B,IAAI,cAAc;IAClB,qBACE,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG,cAAc;QAAiB,WAAW;qBACtF,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,WAAW;QACvC,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAK,GACL,wBACA;YACE,CAAC,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAE;YACtC,eAAe;YACf,aAAa;YACb,cAAc;QAChB,GACA,WAAW,SAAS;OAGvB;AAIT","sources":["packages/@react-spectrum/button/src/ClearButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonElementTypeProps, ButtonProps} from '@react-types/button';\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossSmall from '@spectrum-icons/ui/CrossSmall';\nimport {DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ElementType} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport {useButton} from '@react-aria/button';\nimport {useHover} from '@react-aria/interactions';\n\ninterface ClearButtonProps<T extends ElementType = 'button'> extends ButtonProps, AriaButtonElementTypeProps<T>, DOMProps, StyleProps {\n focusClassName?: string,\n variant?: 'overBackground',\n excludeFromTabOrder?: boolean,\n preventFocus?: boolean\n}\n\nexport const ClearButton = React.forwardRef(function ClearButton(props: ClearButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n let {\n children = <CrossSmall UNSAFE_className={styles['spectrum-Icon']} />,\n focusClassName,\n variant,\n autoFocus,\n isDisabled,\n preventFocus,\n elementType = preventFocus ? 'div' : 'button' as ElementType,\n ...otherProps\n } = props;\n let domRef = useFocusableRef(ref);\n let {buttonProps, isPressed} = useButton({...props, elementType}, domRef);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {styleProps} = useStyleProps(otherProps);\n\n // For cases like the clear button in a search field, remove the tabIndex so\n // iOS 14 with VoiceOver doesn't focus the button and hide the keyboard when\n // moving the cursor over the clear button.\n if (preventFocus) {\n delete buttonProps.tabIndex;\n }\n\n let ElementType = elementType;\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring', focusClassName)} autoFocus={autoFocus}>\n <ElementType\n {...styleProps}\n {...mergeProps(buttonProps, hoverProps)}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ClearButton',\n {\n [`spectrum-ClearButton--${variant}`]: variant,\n 'is-disabled': isDisabled,\n 'is-active': isPressed,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n }>\n {children}\n </ElementType>\n </FocusRing>\n );\n});\n"],"names":[],"version":3,"file":"ClearButton.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAqBM,MAAM,0DAAc,CAAA,GAAA,YAAI,EAAE,UAAU,CAAC,SAAS,YAAY,KAAuB,EAAE,GAAoC;IAC5H,IAAI,YACF,yBAAW,gCAAC,CAAA,GAAA,gCAAS;QAAE,kBAAkB,CAAA,GAAA,wDAAK,CAAC,CAAC,gBAAgB;wBAChE,cAAc,WACd,OAAO,aACP,SAAS,cACT,UAAU,gBACV,YAAY,eACZ,cAAc,eAAe,QAAQ,iBACrC,QAAQ,OACR,GAAG,YACJ,GAAG;IACJ,IAAI,SAAS,CAAA,GAAA,sBAAc,EAAE;IAC7B,IAAI,eAAC,WAAW,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,gBAAQ,EAAE;QAAC,GAAG,KAAK;qBAAE;IAAW,GAAG;IAClE,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE;oBAAC;IAAU;IAClD,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,4EAA4E;IAC5E,4EAA4E;IAC5E,2CAA2C;IAC3C,IAAI,cACF,OAAO,YAAY,QAAQ;IAG7B,IAAI,cAAc;IAClB,qBACE,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,wDAAK,GAAG,cAAc;QAAiB,WAAW;qBACtF,gCAAC;QACE,GAAG,UAAU;QACb,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,WAAW;QACvC,KAAK;QACL,WACE,CAAA,GAAA,iBAAS,EACP,CAAA,GAAA,wDAAK,GACL,wBACA;YACE,CAAC,CAAC,sBAAsB,EAAE,SAAS,CAAC,EAAE;YACtC,eAAe;YACf,aAAa;YACb,cAAc;YACd,+BAA+B;QACjC,GACA,WAAW,SAAS;OAGvB;AAIT","sources":["packages/@react-spectrum/button/src/ClearButton.tsx"],"sourcesContent":["/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\nimport {AriaButtonElementTypeProps, ButtonProps} from '@react-types/button';\nimport {classNames, useFocusableRef, useStyleProps} from '@react-spectrum/utils';\nimport CrossSmall from '@spectrum-icons/ui/CrossSmall';\nimport {DOMProps, FocusableRef, StyleProps} from '@react-types/shared';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ElementType} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/button/vars.css';\nimport {useButton} from '@react-aria/button';\nimport {useHover} from '@react-aria/interactions';\n\ninterface ClearButtonProps<T extends ElementType = 'button'> extends ButtonProps, AriaButtonElementTypeProps<T>, DOMProps, StyleProps {\n focusClassName?: string,\n variant?: 'overBackground',\n excludeFromTabOrder?: boolean,\n preventFocus?: boolean,\n inset?: boolean\n}\n\nexport const ClearButton = React.forwardRef(function ClearButton(props: ClearButtonProps, ref: FocusableRef<HTMLButtonElement>) {\n let {\n children = <CrossSmall UNSAFE_className={styles['spectrum-Icon']} />,\n focusClassName,\n variant,\n autoFocus,\n isDisabled,\n preventFocus,\n elementType = preventFocus ? 'div' : 'button' as ElementType,\n inset = false,\n ...otherProps\n } = props;\n let domRef = useFocusableRef(ref);\n let {buttonProps, isPressed} = useButton({...props, elementType}, domRef);\n let {hoverProps, isHovered} = useHover({isDisabled});\n let {styleProps} = useStyleProps(otherProps);\n\n // For cases like the clear button in a search field, remove the tabIndex so\n // iOS 14 with VoiceOver doesn't focus the button and hide the keyboard when\n // moving the cursor over the clear button.\n if (preventFocus) {\n delete buttonProps.tabIndex;\n }\n\n let ElementType = elementType;\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring', focusClassName)} autoFocus={autoFocus}>\n <ElementType\n {...styleProps}\n {...mergeProps(buttonProps, hoverProps)}\n ref={domRef}\n className={\n classNames(\n styles,\n 'spectrum-ClearButton',\n {\n [`spectrum-ClearButton--${variant}`]: variant,\n 'is-disabled': isDisabled,\n 'is-active': isPressed,\n 'is-hovered': isHovered,\n 'spectrum-ClearButton--inset': inset\n },\n styleProps.className\n )\n }>\n {children}\n </ElementType>\n </FocusRing>\n );\n});\n"],"names":[],"version":3,"file":"ClearButton.module.js.map"}
@@ -1,4 +1,4 @@
1
- require("./button.040d375e.css");
1
+ require("./button.9e5e3032.css");
2
2
  var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
3
3
  var $7mUYa$reactspectrumutils = require("@react-spectrum/utils");
4
4
  var $7mUYa$reactariafocus = require("@react-aria/focus");
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $b8ZoF$button_vars_cssmodulejs from "./button_vars_css.mjs";
3
3
  import {useSlotProps as $b8ZoF$useSlotProps, useFocusableRef as $b8ZoF$useFocusableRef, useStyleProps as $b8ZoF$useStyleProps, classNames as $b8ZoF$classNames, SlotProvider as $b8ZoF$SlotProvider} from "@react-spectrum/utils";
4
4
  import {FocusRing as $b8ZoF$FocusRing} from "@react-aria/focus";
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $b8ZoF$button_vars_cssmodulejs from "./button_vars_css.module.js";
3
3
  import {useSlotProps as $b8ZoF$useSlotProps, useFocusableRef as $b8ZoF$useFocusableRef, useStyleProps as $b8ZoF$useStyleProps, classNames as $b8ZoF$classNames, SlotProvider as $b8ZoF$SlotProvider} from "@react-spectrum/utils";
4
4
  import {FocusRing as $b8ZoF$FocusRing} from "@react-aria/focus";
@@ -1,4 +1,4 @@
1
- require("./button.040d375e.css");
1
+ require("./button.9e5e3032.css");
2
2
  var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
3
3
  var $adWKT$reactspectrumutils = require("@react-spectrum/utils");
4
4
  var $adWKT$reactariafocus = require("@react-aria/focus");
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $g8O0d$button_vars_cssmodulejs from "./button_vars_css.mjs";
3
3
  import {useFocusableRef as $g8O0d$useFocusableRef, useStyleProps as $g8O0d$useStyleProps, classNames as $g8O0d$classNames} from "@react-spectrum/utils";
4
4
  import {FocusRing as $g8O0d$FocusRing} from "@react-aria/focus";
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $g8O0d$button_vars_cssmodulejs from "./button_vars_css.module.js";
3
3
  import {useFocusableRef as $g8O0d$useFocusableRef, useStyleProps as $g8O0d$useStyleProps, classNames as $g8O0d$classNames} from "@react-spectrum/utils";
4
4
  import {FocusRing as $g8O0d$FocusRing} from "@react-aria/focus";
@@ -1,4 +1,4 @@
1
- require("./button.040d375e.css");
1
+ require("./button.9e5e3032.css");
2
2
  var $afc5a4514aca2340$exports = require("./button_vars_css.main.js");
3
3
  var $58xyJ$reactspectrumutils = require("@react-spectrum/utils");
4
4
  var $58xyJ$reactariafocus = require("@react-aria/focus");
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $3XyjH$button_vars_cssmodulejs from "./button_vars_css.mjs";
3
3
  import {useFocusableRef as $3XyjH$useFocusableRef, useStyleProps as $3XyjH$useStyleProps, classNames as $3XyjH$classNames, SlotProvider as $3XyjH$SlotProvider} from "@react-spectrum/utils";
4
4
  import {FocusRing as $3XyjH$FocusRing} from "@react-aria/focus";
@@ -1,4 +1,4 @@
1
- import "./button.040d375e.css";
1
+ import "./button.9e5e3032.css";
2
2
  import $3XyjH$button_vars_cssmodulejs from "./button_vars_css.module.js";
3
3
  import {useFocusableRef as $3XyjH$useFocusableRef, useStyleProps as $3XyjH$useStyleProps, classNames as $3XyjH$classNames, SlotProvider as $3XyjH$SlotProvider} from "@react-spectrum/utils";
4
4
  import {FocusRing as $3XyjH$FocusRing} from "@react-aria/focus";