@react-spectrum/tag 3.2.15 → 3.3.1

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/Tag.main.js CHANGED
@@ -44,7 +44,7 @@ function $dd2c5d00108c1840$export$3288d34c523a1192(props) {
44
44
  let { styleProps: styleProps } = (0, $hZPqg$reactspectrumutils.useStyleProps)(otherProps);
45
45
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $hZPqg$reactariainteractions.useHover)({});
46
46
  let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $hZPqg$reactariafocus.useFocusRing)({
47
- within: true
47
+ within: false
48
48
  });
49
49
  let ref = (0, $hZPqg$react.useRef)(null);
50
50
  let { removeButtonProps: removeButtonProps, gridCellProps: gridCellProps, rowProps: rowProps, allowsRemoving: allowsRemoving } = (0, $hZPqg$reactariatag.useTag)({
@@ -85,7 +85,10 @@ function $dd2c5d00108c1840$export$3288d34c523a1192(props) {
85
85
  }
86
86
  function $dd2c5d00108c1840$var$TagRemoveButton(props) {
87
87
  let { styleProps: styleProps } = (0, $hZPqg$reactspectrumutils.useStyleProps)(props);
88
- return /*#__PURE__*/ (0, ($parcel$interopDefault($hZPqg$react))).createElement("span", styleProps, /*#__PURE__*/ (0, ($parcel$interopDefault($hZPqg$react))).createElement((0, $hZPqg$reactspectrumbutton.ClearButton), props));
88
+ return /*#__PURE__*/ (0, ($parcel$interopDefault($hZPqg$react))).createElement("span", styleProps, /*#__PURE__*/ (0, ($parcel$interopDefault($hZPqg$react))).createElement((0, $hZPqg$reactspectrumbutton.ClearButton), {
89
+ ...props,
90
+ inset: true
91
+ }));
89
92
  }
90
93
 
91
94
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiBM,SAAS,0CAAO,KAA0B;IAC/C,MAAM,QACJ,IAAI,SACJ,KAAK,EACL,GAAG,YACJ,GAA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CAAS,SACP,gCAAkB,0DAAC;QAAgB,MAAM;QAAO,GAAG,iBAAiB;QAAE,kBAAkB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;;AAMxH;AAEA,SAAS,sCAAgB,KAAK;IAC5B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IAEjC,qBACE,0DAAC,QAAS,0BACR,0DAAC,CAAA,GAAA,sCAAU,GAAM;AAGvB","sources":["packages/@react-spectrum/tag/src/Tag.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 {AriaTagProps, useTag} from '@react-aria/tag';\nimport {classNames, ClearSlots, SlotProvider, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport type {ListState} from '@react-stately/list';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactNode, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\n\nexport interface SpectrumTagProps<T> extends AriaTagProps<T> {\n state: ListState<T>\n}\n\nexport function Tag<T>(props: SpectrumTagProps<T>): ReactNode {\n const {\n item,\n state,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});\n let ref = useRef(null);\n let {removeButtonProps, gridCellProps, rowProps, allowsRemoving} = useTag({\n ...props,\n item\n }, state, ref);\n\n return (\n <div\n {...mergeProps(rowProps, hoverProps, focusProps)}\n className={classNames(\n styles,\n 'spectrum-Tag',\n {\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'is-hovered': isHovered,\n 'spectrum-Tag--removable': allowsRemoving\n },\n styleProps.className\n )}\n ref={ref}>\n <div\n className={classNames(styles, 'spectrum-Tag-cell')}\n {...gridCellProps}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content')},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Tag-avatar'), size: 'avatar-size-50'}\n }}>\n {typeof item.rendered === 'string' ? <Text>{item.rendered}</Text> : item.rendered}\n <ClearSlots>\n {allowsRemoving && <TagRemoveButton item={item} {...removeButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-removeButton')} />}\n </ClearSlots>\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n let {styleProps} = useStyleProps(props);\n\n return (\n <span {...styleProps}>\n <ClearButton {...props} />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"Tag.main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiBM,SAAS,0CAAO,KAA0B;IAC/C,MAAM,QACJ,IAAI,SACJ,KAAK,EACL,GAAG,YACJ,GAAG;IAEJ,aAAa;IACb,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE,CAAC;IACxC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,kCAAW,EAAE;QAAC,QAAQ;IAAK;IACzE,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAE;IACjB,IAAI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G9B","sources":["packages/@react-spectrum/tag/src/Tag.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 {AriaTagProps, useTag} from '@react-aria/tag';\nimport {classNames, ClearSlots, SlotProvider, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport type {ListState} from '@react-stately/list';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactNode, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\n\nexport interface SpectrumTagProps<T> extends AriaTagProps<T> {\n state: ListState<T>\n}\n\nexport function Tag<T>(props: SpectrumTagProps<T>): ReactNode {\n const {\n item,\n state,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: false});\n let ref = useRef(null);\n let {removeButtonProps, gridCellProps, rowProps, allowsRemoving} = useTag({\n ...props,\n item\n }, state, ref);\n\n return (\n <div\n {...mergeProps(rowProps, hoverProps, focusProps)}\n className={classNames(\n styles,\n 'spectrum-Tag',\n {\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'is-hovered': isHovered,\n 'spectrum-Tag--removable': allowsRemoving\n },\n styleProps.className\n )}\n ref={ref}>\n <div\n className={classNames(styles, 'spectrum-Tag-cell')}\n {...gridCellProps}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content')},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Tag-avatar'), size: 'avatar-size-50'}\n }}>\n {typeof item.rendered === 'string' ? <Text>{item.rendered}</Text> : item.rendered}\n <ClearSlots>\n {allowsRemoving && <TagRemoveButton item={item} {...removeButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-removeButton')} />}\n </ClearSlots>\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n let {styleProps} = useStyleProps(props);\n\n return (\n <span {...styleProps}>\n <ClearButton {...props} inset />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"Tag.main.js.map"}
package/dist/Tag.mjs CHANGED
@@ -38,7 +38,7 @@ function $b5f5ee35d3b6b95c$export$3288d34c523a1192(props) {
38
38
  let { styleProps: styleProps } = (0, $X1F04$useStyleProps)(otherProps);
39
39
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $X1F04$useHover)({});
40
40
  let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $X1F04$useFocusRing)({
41
- within: true
41
+ within: false
42
42
  });
43
43
  let ref = (0, $X1F04$useRef)(null);
44
44
  let { removeButtonProps: removeButtonProps, gridCellProps: gridCellProps, rowProps: rowProps, allowsRemoving: allowsRemoving } = (0, $X1F04$useTag)({
@@ -79,7 +79,10 @@ function $b5f5ee35d3b6b95c$export$3288d34c523a1192(props) {
79
79
  }
80
80
  function $b5f5ee35d3b6b95c$var$TagRemoveButton(props) {
81
81
  let { styleProps: styleProps } = (0, $X1F04$useStyleProps)(props);
82
- return /*#__PURE__*/ (0, $X1F04$react).createElement("span", styleProps, /*#__PURE__*/ (0, $X1F04$react).createElement((0, $X1F04$ClearButton), props));
82
+ return /*#__PURE__*/ (0, $X1F04$react).createElement("span", styleProps, /*#__PURE__*/ (0, $X1F04$react).createElement((0, $X1F04$ClearButton), {
83
+ ...props,
84
+ inset: true
85
+ }));
83
86
  }
84
87
 
85
88
 
@@ -38,7 +38,7 @@ function $b5f5ee35d3b6b95c$export$3288d34c523a1192(props) {
38
38
  let { styleProps: styleProps } = (0, $X1F04$useStyleProps)(otherProps);
39
39
  let { hoverProps: hoverProps, isHovered: isHovered } = (0, $X1F04$useHover)({});
40
40
  let { isFocused: isFocused, isFocusVisible: isFocusVisible, focusProps: focusProps } = (0, $X1F04$useFocusRing)({
41
- within: true
41
+ within: false
42
42
  });
43
43
  let ref = (0, $X1F04$useRef)(null);
44
44
  let { removeButtonProps: removeButtonProps, gridCellProps: gridCellProps, rowProps: rowProps, allowsRemoving: allowsRemoving } = (0, $X1F04$useTag)({
@@ -79,7 +79,10 @@ function $b5f5ee35d3b6b95c$export$3288d34c523a1192(props) {
79
79
  }
80
80
  function $b5f5ee35d3b6b95c$var$TagRemoveButton(props) {
81
81
  let { styleProps: styleProps } = (0, $X1F04$useStyleProps)(props);
82
- return /*#__PURE__*/ (0, $X1F04$react).createElement("span", styleProps, /*#__PURE__*/ (0, $X1F04$react).createElement((0, $X1F04$ClearButton), props));
82
+ return /*#__PURE__*/ (0, $X1F04$react).createElement("span", styleProps, /*#__PURE__*/ (0, $X1F04$react).createElement((0, $X1F04$ClearButton), {
83
+ ...props,
84
+ inset: true
85
+ }));
83
86
  }
84
87
 
85
88
 
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiBM,SAAS,0CAAO,KAA0B;IAC/C,MAAM,QACJ,IAAI,SACJ,KAAK,EACL,GAAG,YACJ,GAAG;IAEJ,aAAa;IACb,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE,CAAC;IACxC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAA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AEjC,qBACE,gCAAC,QAAS,0BACR,gCAAC,CAAA,GAAA,kBAAU,GAAM;AAGvB","sources":["packages/@react-spectrum/tag/src/Tag.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 {AriaTagProps, useTag} from '@react-aria/tag';\nimport {classNames, ClearSlots, SlotProvider, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport type {ListState} from '@react-stately/list';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactNode, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\n\nexport interface SpectrumTagProps<T> extends AriaTagProps<T> {\n state: ListState<T>\n}\n\nexport function Tag<T>(props: SpectrumTagProps<T>): ReactNode {\n const {\n item,\n state,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});\n let ref = useRef(null);\n let {removeButtonProps, gridCellProps, rowProps, allowsRemoving} = useTag({\n ...props,\n item\n }, state, ref);\n\n return (\n <div\n {...mergeProps(rowProps, hoverProps, focusProps)}\n className={classNames(\n styles,\n 'spectrum-Tag',\n {\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'is-hovered': isHovered,\n 'spectrum-Tag--removable': allowsRemoving\n },\n styleProps.className\n )}\n ref={ref}>\n <div\n className={classNames(styles, 'spectrum-Tag-cell')}\n {...gridCellProps}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content')},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Tag-avatar'), size: 'avatar-size-50'}\n }}>\n {typeof item.rendered === 'string' ? <Text>{item.rendered}</Text> : item.rendered}\n <ClearSlots>\n {allowsRemoving && <TagRemoveButton item={item} {...removeButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-removeButton')} />}\n </ClearSlots>\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n let {styleProps} = useStyleProps(props);\n\n return (\n <span {...styleProps}>\n <ClearButton {...props} />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"Tag.module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;;AAiBM,SAAS,0CAAO,KAA0B;IAC/C,MAAM,QACJ,IAAI,SACJ,KAAK,EACL,GAAG,YACJ,GAAG;IAEJ,aAAa;IACb,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE,CAAC;IACxC,IAAI,aAAC,SAAS,kBAAE,cAAc,cAAE,UAAU,EAAC,GAAG,CAAA,GAAA,mBAAW,EAAE;QAAC,QAAQ;IAAK;IACzE,IAAI,MAAM,CAAA,GAAA,aAAK,EAAE;IACjB,IAAI,qBAAC,iBAAiB,iBAAE,aAAa,YAAE,QAAQ,kBAAE,cAAc,EAAC,GAAG,CAAA,GAAA,aAAK,EAAE;QACxE,GAAG,KAAK;cACR;IACF,GAAG,OAAO;IAEV,qBACE,gCAAC;QACE,GAAG,CAAA,GAAA,iBAAS,EAAE,UAAU,YAAY,WAAW;QAChD,WAAW,CAAA,GAAA,iBAAS,EAChB,CAAA,GAAA,sDAAK,GACL,gBACF;YACE,cAAc;YACd,cAAc;YACd,cAAc;YACd,2BAA2B;QAC7B,GACE,WAAW,SAAS;QAExB,KAAK;qBACL,gCAAC;QACC,WAAW,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;QAC7B,GAAG,aAAa;qBACjB,gCAAC,CAAA,GAAA,mBAAW;QACV,OAAO;YACL,MAAM;gBAAC,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;gBAAsB,MAAM;YAAI;YAC5E,MAAM;gBAAC,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;YAAuB;YACnE,QAAQ;gBAAC,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;gBAAwB,MAAM;YAAgB;QAC9F;OACC,OAAO,KAAK,QAAQ,KAAK,yBAAW,gCAAC,CAAA,GAAA,WAAG,SAAG,KAAK,QAAQ,IAAW,KAAK,QAAQ,gBACjF,gCAAC,CAAA,GAAA,iBAAS,SACP,gCAAkB,gCAAC;QAAgB,MAAM;QAAO,GAAG,iBAAiB;QAAE,kBAAkB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;;AAMxH;AAEA,SAAS,sCAAgB,KAAK;IAC5B,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IAEjC,qBACE,gCAAC,QAAS,0BACR,gCAAC,CAAA,GAAA,kBAAU;QAAG,GAAG,KAAK;QAAE,OAAA;;AAG9B","sources":["packages/@react-spectrum/tag/src/Tag.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 {AriaTagProps, useTag} from '@react-aria/tag';\nimport {classNames, ClearSlots, SlotProvider, useStyleProps} from '@react-spectrum/utils';\nimport {ClearButton} from '@react-spectrum/button';\nimport type {ListState} from '@react-stately/list';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {ReactNode, useRef} from 'react';\nimport styles from '@adobe/spectrum-css-temp/components/tags/vars.css';\nimport {Text} from '@react-spectrum/text';\nimport {useFocusRing} from '@react-aria/focus';\nimport {useHover} from '@react-aria/interactions';\n\nexport interface SpectrumTagProps<T> extends AriaTagProps<T> {\n state: ListState<T>\n}\n\nexport function Tag<T>(props: SpectrumTagProps<T>): ReactNode {\n const {\n item,\n state,\n ...otherProps\n } = props;\n\n // @ts-ignore\n let {styleProps} = useStyleProps(otherProps);\n let {hoverProps, isHovered} = useHover({});\n let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: false});\n let ref = useRef(null);\n let {removeButtonProps, gridCellProps, rowProps, allowsRemoving} = useTag({\n ...props,\n item\n }, state, ref);\n\n return (\n <div\n {...mergeProps(rowProps, hoverProps, focusProps)}\n className={classNames(\n styles,\n 'spectrum-Tag',\n {\n 'focus-ring': isFocusVisible,\n 'is-focused': isFocused,\n 'is-hovered': isHovered,\n 'spectrum-Tag--removable': allowsRemoving\n },\n styleProps.className\n )}\n ref={ref}>\n <div\n className={classNames(styles, 'spectrum-Tag-cell')}\n {...gridCellProps}>\n <SlotProvider\n slots={{\n icon: {UNSAFE_className: classNames(styles, 'spectrum-Tag-icon'), size: 'XS'},\n text: {UNSAFE_className: classNames(styles, 'spectrum-Tag-content')},\n avatar: {UNSAFE_className: classNames(styles, 'spectrum-Tag-avatar'), size: 'avatar-size-50'}\n }}>\n {typeof item.rendered === 'string' ? <Text>{item.rendered}</Text> : item.rendered}\n <ClearSlots>\n {allowsRemoving && <TagRemoveButton item={item} {...removeButtonProps} UNSAFE_className={classNames(styles, 'spectrum-Tag-removeButton')} />}\n </ClearSlots>\n </SlotProvider>\n </div>\n </div>\n );\n}\n\nfunction TagRemoveButton(props) {\n let {styleProps} = useStyleProps(props);\n\n return (\n <span {...styleProps}>\n <ClearButton {...props} inset />\n </span>\n );\n}\n"],"names":[],"version":3,"file":"Tag.module.js.map"}
package/package.json CHANGED
@@ -1,12 +1,16 @@
1
1
  {
2
2
  "name": "@react-spectrum/tag",
3
- "version": "3.2.15",
3
+ "version": "3.3.1",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
7
7
  "module": "dist/module.js",
8
8
  "exports": {
9
- "types": "./dist/types.d.ts",
9
+ "source": "./src/index.ts",
10
+ "types": [
11
+ "./dist/types.d.ts",
12
+ "./src/index.ts"
13
+ ],
10
14
  "import": "./dist/import.mjs",
11
15
  "require": "./dist/main.js"
12
16
  },
@@ -36,20 +40,20 @@
36
40
  "url": "https://github.com/adobe/react-spectrum"
37
41
  },
38
42
  "dependencies": {
39
- "@react-aria/focus": "^3.20.2",
40
- "@react-aria/i18n": "^3.12.8",
41
- "@react-aria/interactions": "^3.25.0",
42
- "@react-aria/selection": "^3.24.0",
43
- "@react-aria/tag": "^3.5.2",
44
- "@react-aria/utils": "^3.28.2",
45
- "@react-spectrum/button": "^3.16.13",
46
- "@react-spectrum/form": "^3.7.14",
47
- "@react-spectrum/label": "^3.16.14",
48
- "@react-spectrum/text": "^3.5.14",
49
- "@react-spectrum/utils": "^3.12.4",
50
- "@react-stately/collections": "^3.12.3",
51
- "@react-stately/list": "^3.12.1",
52
- "@react-types/shared": "^3.29.0",
43
+ "@react-aria/focus": "^3.20.4",
44
+ "@react-aria/i18n": "^3.12.10",
45
+ "@react-aria/interactions": "^3.25.2",
46
+ "@react-aria/selection": "^3.24.2",
47
+ "@react-aria/tag": "^3.6.1",
48
+ "@react-aria/utils": "^3.29.1",
49
+ "@react-spectrum/button": "^3.16.15",
50
+ "@react-spectrum/form": "^3.7.16",
51
+ "@react-spectrum/label": "^3.16.16",
52
+ "@react-spectrum/text": "^3.5.16",
53
+ "@react-spectrum/utils": "^3.12.6",
54
+ "@react-stately/collections": "^3.12.5",
55
+ "@react-stately/list": "^3.12.3",
56
+ "@react-types/shared": "^3.30.0",
53
57
  "@swc/helpers": "^0.5.0"
54
58
  },
55
59
  "devDependencies": {
@@ -63,5 +67,5 @@
63
67
  "publishConfig": {
64
68
  "access": "public"
65
69
  },
66
- "gitHead": "9b66d270572f482948afee95622a85cdf68ed408"
70
+ "gitHead": "265b4d7f107905ee1c6e87a8af1613ab440a6849"
67
71
  }
package/src/Tag.tsx CHANGED
@@ -35,7 +35,7 @@ export function Tag<T>(props: SpectrumTagProps<T>): ReactNode {
35
35
  // @ts-ignore
36
36
  let {styleProps} = useStyleProps(otherProps);
37
37
  let {hoverProps, isHovered} = useHover({});
38
- let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: true});
38
+ let {isFocused, isFocusVisible, focusProps} = useFocusRing({within: false});
39
39
  let ref = useRef(null);
40
40
  let {removeButtonProps, gridCellProps, rowProps, allowsRemoving} = useTag({
41
41
  ...props,
@@ -81,7 +81,7 @@ function TagRemoveButton(props) {
81
81
 
82
82
  return (
83
83
  <span {...styleProps}>
84
- <ClearButton {...props} />
84
+ <ClearButton {...props} inset />
85
85
  </span>
86
86
  );
87
87
  }