@react-spectrum/link 3.6.15 → 3.6.17
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/Link.main.js +1 -1
- package/dist/Link.main.js.map +1 -1
- package/dist/Link.mjs +1 -1
- package/dist/Link.module.js +1 -1
- package/dist/Link.module.js.map +1 -1
- package/dist/{vars.04bcd764.css → link.60ca145f.css} +1 -1
- package/dist/{vars.04bcd764.css.map → link.60ca145f.css.map} +1 -1
- package/dist/types.d.ts.map +1 -1
- package/package.json +9 -9
- package/src/Link.tsx +1 -1
package/dist/Link.main.js
CHANGED
package/dist/Link.main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAYD,IAAI,mCAAa,SAAS,CAAA,GAAA,sCAAI,EAAE,OAAO,EAAE,OAAO;AAKzC,SAAS,0CAAK,KAAwB;IAC3C,QAAQ,CAAA,GAAA,6CAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,sCAAW,EAAE,OAAO;IAC5B,IAAI,WACF,UAAU,oBACV,OAAO,YACP,QAAQ,QACR,aAAa;IACb,IAAI,EACL,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,uCAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,qCAAO,EAAE,CAAC;IAExC,IAAI,MAAM,CAAA,GAAA,mBAAK,EAAE;IACjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,4BAAM,EAAE;QACxB,GAAG,KAAK;QACR,aAAa,CAAC,QAAQ,OAAO,aAAa,WAAW,SAAS;IAChE,GAAG;IAEH,IAAI,WAAW;QACb,GAAG,UAAU;QACb,GAAG,CAAA,GAAA,gCAAS,EAAE,WAAW,WAAW;aACpC;QACA,WAAW,CAAA,GAAA,oCAAS,EAClB,CAAA,GAAA,mDAAK,GACL,iBACA;YACE,wBAAwB;YACxB,CAAC,CAAC,eAAe,EAAE,SAAS,CAAC,EAAE;YAC/B,cAAc;QAChB,GACA,WAAW,SAAS;IAExB;IAEA,IAAI;IACJ,IAAI,MACF,qBAAO,0DAAC,KAAM,UAAW;SACpB;QACL,0BAA0B;QAC1B,IAAI,eAAe,CAAA,GAAA,2CAAgB,EAAE;QACrC,IAAI,YAAuD;QAC3D,IAAI,kCACF,aAAa;QACb,YAAY,CAAA,GAAA,+BAAQ,EAAE,KAAK,aAAa,GAAG;aAE3C,aAAa;QACb,YAAY,CAAA,GAAA,+BAAQ,EAAE,KAAK,aAAa,KAAK,CAAC,GAAG;QAEnD,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,cAAc;YACtC,GAAG,CAAA,GAAA,gCAAS,EAAE,aAAa,KAAK,EAAE,SAAS;YAC3C,2DAA2D;YAC3D,KAAK;QACP;IACF;IAGA,qBACE,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAC3C;AAGP","sources":["packages/@react-spectrum/link/src/Link.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 {classNames, getWrappedElement, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps, mergeRefs} from '@react-aria/utils';\nimport React, {ForwardedRef, JSX, MutableRefObject, useRef} from 'react';\nimport {SpectrumLinkProps} from '@react-types/link';\nimport styles from '@adobe/spectrum-css-temp/components/link/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useLink} from '@react-aria/link';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nlet isOldReact = parseInt(React.version, 10) <= 18;\n/**\n * Links allow users to navigate to a different location.\n * They can be presented inline inside a paragraph or as standalone text.\n */\nexport function Link(props: SpectrumLinkProps) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'link');\n let {\n variant = 'primary',\n isQuiet,\n children,\n // @ts-ignore\n href\n } = props;\n let {styleProps} = useStyleProps(props);\n let {hoverProps, isHovered} = useHover({});\n\n let ref = useRef(null);\n let {linkProps} = useLink({\n ...props,\n elementType: !href && typeof children === 'string' ? 'span' : 'a'\n }, ref);\n\n let domProps = {\n ...styleProps,\n ...mergeProps(linkProps, hoverProps),\n ref,\n className: classNames(\n styles,\n 'spectrum-Link',\n {\n 'spectrum-Link--quiet': isQuiet,\n [`spectrum-Link--${variant}`]: variant,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n };\n\n let link: JSX.Element;\n if (href) {\n link = <a {...domProps}>{children}</a>;\n } else {\n // Backward compatibility.\n let wrappedChild = getWrappedElement(children);\n let mergedRef: MutableRefObject<any> | ForwardedRef<any> = ref;\n if (isOldReact) {\n // @ts-ignore\n mergedRef = mergeRefs(ref, wrappedChild.ref);\n } else {\n // @ts-ignore\n mergedRef = mergeRefs(ref, wrappedChild.props.ref);\n }\n link = React.cloneElement(wrappedChild, {\n ...mergeProps(wrappedChild.props, domProps),\n // @ts-ignore https://github.com/facebook/react/issues/8873\n ref: mergedRef\n });\n }\n\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {link}\n </FocusRing>\n );\n}\n"],"names":[],"version":3,"file":"Link.main.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAYD,IAAI,mCAAa,SAAS,CAAA,GAAA,sCAAI,EAAE,OAAO,EAAE,OAAO;AAKzC,SA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ACE,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,mDAAK,GAAG;OAC3C;AAGP","sources":["packages/@react-spectrum/link/src/Link.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 {classNames, getWrappedElement, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps, mergeRefs} from '@react-aria/utils';\nimport React, {ForwardedRef, JSX, MutableRefObject, useRef} from 'react';\nimport {SpectrumLinkProps} from '@react-types/link';\nimport styles from '@adobe/spectrum-css-temp/components/link/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useLink} from '@react-aria/link';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nlet isOldReact = parseInt(React.version, 10) <= 18;\n/**\n * Links allow users to navigate to a different location.\n * They can be presented inline inside a paragraph or as standalone text.\n */\nexport function Link(props: SpectrumLinkProps): JSX.Element {\n props = useProviderProps(props);\n props = useSlotProps(props, 'link');\n let {\n variant = 'primary',\n isQuiet,\n children,\n // @ts-ignore\n href\n } = props;\n let {styleProps} = useStyleProps(props);\n let {hoverProps, isHovered} = useHover({});\n\n let ref = useRef(null);\n let {linkProps} = useLink({\n ...props,\n elementType: !href && typeof children === 'string' ? 'span' : 'a'\n }, ref);\n\n let domProps = {\n ...styleProps,\n ...mergeProps(linkProps, hoverProps),\n ref,\n className: classNames(\n styles,\n 'spectrum-Link',\n {\n 'spectrum-Link--quiet': isQuiet,\n [`spectrum-Link--${variant}`]: variant,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n };\n\n let link: JSX.Element;\n if (href) {\n link = <a {...domProps}>{children}</a>;\n } else {\n // Backward compatibility.\n let wrappedChild = getWrappedElement(children);\n let mergedRef: MutableRefObject<any> | ForwardedRef<any> = ref;\n if (isOldReact) {\n // @ts-ignore\n mergedRef = mergeRefs(ref, wrappedChild.ref);\n } else {\n // @ts-ignore\n mergedRef = mergeRefs(ref, wrappedChild.props.ref);\n }\n link = React.cloneElement(wrappedChild, {\n ...mergeProps(wrappedChild.props, domProps),\n // @ts-ignore https://github.com/facebook/react/issues/8873\n ref: mergedRef\n });\n }\n\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {link}\n </FocusRing>\n );\n}\n"],"names":[],"version":3,"file":"Link.main.js.map"}
|
package/dist/Link.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./link.60ca145f.css";
|
|
2
2
|
import $35Vau$link_vars_cssmodulejs from "./link_vars_css.mjs";
|
|
3
3
|
import {useSlotProps as $35Vau$useSlotProps, useStyleProps as $35Vau$useStyleProps, classNames as $35Vau$classNames, getWrappedElement as $35Vau$getWrappedElement} from "@react-spectrum/utils";
|
|
4
4
|
import {FocusRing as $35Vau$FocusRing} from "@react-aria/focus";
|
package/dist/Link.module.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./
|
|
1
|
+
import "./link.60ca145f.css";
|
|
2
2
|
import $35Vau$link_vars_cssmodulejs from "./link_vars_css.module.js";
|
|
3
3
|
import {useSlotProps as $35Vau$useSlotProps, useStyleProps as $35Vau$useStyleProps, classNames as $35Vau$classNames, getWrappedElement as $35Vau$getWrappedElement} from "@react-spectrum/utils";
|
|
4
4
|
import {FocusRing as $35Vau$FocusRing} from "@react-aria/focus";
|
package/dist/Link.module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;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,GAAA,iBAAS,EAAE,aAAa,KAAK,EAAE,SAAS;YAC3C,2DAA2D;YAC3D,KAAK;QACP;IACF;IAGA,qBACE,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;OAC3C;AAGP","sources":["packages/@react-spectrum/link/src/Link.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 {classNames, getWrappedElement, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps, mergeRefs} from '@react-aria/utils';\nimport React, {ForwardedRef, JSX, MutableRefObject, useRef} from 'react';\nimport {SpectrumLinkProps} from '@react-types/link';\nimport styles from '@adobe/spectrum-css-temp/components/link/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useLink} from '@react-aria/link';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nlet isOldReact = parseInt(React.version, 10) <= 18;\n/**\n * Links allow users to navigate to a different location.\n * They can be presented inline inside a paragraph or as standalone text.\n */\nexport function Link(props: SpectrumLinkProps) {\n props = useProviderProps(props);\n props = useSlotProps(props, 'link');\n let {\n variant = 'primary',\n isQuiet,\n children,\n // @ts-ignore\n href\n } = props;\n let {styleProps} = useStyleProps(props);\n let {hoverProps, isHovered} = useHover({});\n\n let ref = useRef(null);\n let {linkProps} = useLink({\n ...props,\n elementType: !href && typeof children === 'string' ? 'span' : 'a'\n }, ref);\n\n let domProps = {\n ...styleProps,\n ...mergeProps(linkProps, hoverProps),\n ref,\n className: classNames(\n styles,\n 'spectrum-Link',\n {\n 'spectrum-Link--quiet': isQuiet,\n [`spectrum-Link--${variant}`]: variant,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n };\n\n let link: JSX.Element;\n if (href) {\n link = <a {...domProps}>{children}</a>;\n } else {\n // Backward compatibility.\n let wrappedChild = getWrappedElement(children);\n let mergedRef: MutableRefObject<any> | ForwardedRef<any> = ref;\n if (isOldReact) {\n // @ts-ignore\n mergedRef = mergeRefs(ref, wrappedChild.ref);\n } else {\n // @ts-ignore\n mergedRef = mergeRefs(ref, wrappedChild.props.ref);\n }\n link = React.cloneElement(wrappedChild, {\n ...mergeProps(wrappedChild.props, domProps),\n // @ts-ignore https://github.com/facebook/react/issues/8873\n ref: mergedRef\n });\n }\n\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {link}\n </FocusRing>\n );\n}\n"],"names":[],"version":3,"file":"Link.module.js.map"}
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC;;;;;;;;AAYD,IAAI,mCAAa,SAAS,CAAA,GAAA,YAAI,EAAE,OAAO,EAAE,OAAO;AAKzC,SAAS,0CAAK,KAAwB;IAC3C,QAAQ,CAAA,GAAA,uBAAe,EAAE;IACzB,QAAQ,CAAA,GAAA,mBAAW,EAAE,OAAO;IAC5B,IAAI,WACF,UAAU,oBACV,OAAO,YACP,QAAQ,QACR,aAAa;IACb,IAAI,EACL,GAAG;IACJ,IAAI,cAAC,UAAU,EAAC,GAAG,CAAA,GAAA,oBAAY,EAAE;IACjC,IAAI,cAAC,UAAU,aAAE,SAAS,EAAC,GAAG,CAAA,GAAA,eAAO,EAAE,CAAC;IAExC,IAAI,MAAM,CAAA,GAAA,aAAK,EAAE;IACjB,IAAI,aAAC,SAAS,EAAC,GAAG,CAAA,GAAA,cAAM,EAAE;QACxB,GAAG,KAAK;QACR,aAAa,CAAC,QAAQ,OAAO,aAAa,WAAW,SAAS;IAChE,GAAG;IAEH,IAAI,WAAW;QACb,GAAG,UAAU;QACb,GAAG,CAAA,GAAA,iBAAS,EAAE,WAAW,WAAW;aACpC;QACA,WAAW,CAAA,GAAA,iBAAS,EAClB,CAAA,GAAA,sDAAK,GACL,iBACA;YACE,wBAAwB;YACxB,CAAC,CAAC,eAAe,EAAE,SAAS,CAAC,EAAE;YAC/B,cAAc;QAChB,GACA,WAAW,SAAS;IAExB;IAEA,IAAI;IACJ,IAAI,MACF,qBAAO,gCAAC,KAAM,UAAW;SACpB;QACL,0BAA0B;QAC1B,IAAI,eAAe,CAAA,GAAA,wBAAgB,EAAE;QACrC,IAAI,YAAuD;QAC3D,IAAI,kCACF,aAAa;QACb,YAAY,CAAA,GAAA,gBAAQ,EAAE,KAAK,aAAa,GAAG;aAE3C,aAAa;QACb,YAAY,CAAA,GAAA,gBAAQ,EAAE,KAAK,aAAa,KAAK,CAAC,GAAG;QAEnD,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,cAAc;YACtC,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,KAAK,EAAE,SAAS;YAC3C,2DAA2D;YAC3D,KAAK;QACP;IACF;IAGA,qBACE,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,sDAAK,GAAG;OAC3C;AAGP","sources":["packages/@react-spectrum/link/src/Link.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 {classNames, getWrappedElement, useSlotProps, useStyleProps} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps, mergeRefs} from '@react-aria/utils';\nimport React, {ForwardedRef, JSX, MutableRefObject, useRef} from 'react';\nimport {SpectrumLinkProps} from '@react-types/link';\nimport styles from '@adobe/spectrum-css-temp/components/link/vars.css';\nimport {useHover} from '@react-aria/interactions';\nimport {useLink} from '@react-aria/link';\nimport {useProviderProps} from '@react-spectrum/provider';\n\nlet isOldReact = parseInt(React.version, 10) <= 18;\n/**\n * Links allow users to navigate to a different location.\n * They can be presented inline inside a paragraph or as standalone text.\n */\nexport function Link(props: SpectrumLinkProps): JSX.Element {\n props = useProviderProps(props);\n props = useSlotProps(props, 'link');\n let {\n variant = 'primary',\n isQuiet,\n children,\n // @ts-ignore\n href\n } = props;\n let {styleProps} = useStyleProps(props);\n let {hoverProps, isHovered} = useHover({});\n\n let ref = useRef(null);\n let {linkProps} = useLink({\n ...props,\n elementType: !href && typeof children === 'string' ? 'span' : 'a'\n }, ref);\n\n let domProps = {\n ...styleProps,\n ...mergeProps(linkProps, hoverProps),\n ref,\n className: classNames(\n styles,\n 'spectrum-Link',\n {\n 'spectrum-Link--quiet': isQuiet,\n [`spectrum-Link--${variant}`]: variant,\n 'is-hovered': isHovered\n },\n styleProps.className\n )\n };\n\n let link: JSX.Element;\n if (href) {\n link = <a {...domProps}>{children}</a>;\n } else {\n // Backward compatibility.\n let wrappedChild = getWrappedElement(children);\n let mergedRef: MutableRefObject<any> | ForwardedRef<any> = ref;\n if (isOldReact) {\n // @ts-ignore\n mergedRef = mergeRefs(ref, wrappedChild.ref);\n } else {\n // @ts-ignore\n mergedRef = mergeRefs(ref, wrappedChild.props.ref);\n }\n link = React.cloneElement(wrappedChild, {\n ...mergeProps(wrappedChild.props, domProps),\n // @ts-ignore https://github.com/facebook/react/issues/8873\n ref: mergedRef\n });\n }\n\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {link}\n </FocusRing>\n );\n}\n"],"names":[],"version":3,"file":"Link.module.js.map"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;AAUE;;;;AAQA;;;;AAKA;;;;;AAIE;;;;AAOJ;;;;AAQA;;;;AAgBA;;;;;;;;AAQE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;AAgBA;;;;AAGE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;EACE","sources":["packages/@adobe/spectrum-css-temp/components/link/vars.css"],"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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"
|
|
1
|
+
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAQA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;AAqBE;;;;;AAQF;;;;AAKE;;;;;AAOJ;EACE;;;;EAIE;;;;;AAMJ;;;;;;;;;AAUE;;;;AAQA;;;;AAKA;;;;;AAIE;;;;AAOJ;;;;AAQA;;;;AAgBA;;;;;;;;AAQE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;AAgBA;;;;AAGE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;EACE","sources":["packages/@adobe/spectrum-css-temp/components/link/vars.css"],"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\n@import './index.css';\n@import './skin.css';\n"],"names":[],"version":3,"file":"link.60ca145f.css.map"}
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAuBA;;;GAGG;AACH,qBAAqB,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"mappings":";;AAuBA;;;GAGG;AACH,qBAAqB,KAAK,EAAE,iBAAiB,GAAG,IAAI,OAAO,CA8D1D;AC1ED,YAAY,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC","sources":["packages/@react-spectrum/link/src/packages/@react-spectrum/link/src/Link.tsx","packages/@react-spectrum/link/src/packages/@react-spectrum/link/src/index.ts","packages/@react-spectrum/link/src/index.ts"],"sourcesContent":[null,null,"/*\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\n/// <reference types=\"css-module-types\" />\n\nexport {Link} from './Link';\nexport type {SpectrumLinkProps} from '@react-types/link';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/link",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.17",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,13 +36,13 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/focus": "^3.20.
|
|
40
|
-
"@react-aria/interactions": "^3.
|
|
41
|
-
"@react-aria/link": "^3.
|
|
42
|
-
"@react-aria/utils": "^3.
|
|
43
|
-
"@react-spectrum/utils": "^3.12.
|
|
44
|
-
"@react-types/link": "^3.
|
|
45
|
-
"@react-types/shared": "^3.
|
|
39
|
+
"@react-aria/focus": "^3.20.3",
|
|
40
|
+
"@react-aria/interactions": "^3.25.1",
|
|
41
|
+
"@react-aria/link": "^3.8.1",
|
|
42
|
+
"@react-aria/utils": "^3.29.0",
|
|
43
|
+
"@react-spectrum/utils": "^3.12.5",
|
|
44
|
+
"@react-types/link": "^3.6.1",
|
|
45
|
+
"@react-types/shared": "^3.29.1",
|
|
46
46
|
"@swc/helpers": "^0.5.0"
|
|
47
47
|
},
|
|
48
48
|
"devDependencies": {
|
|
@@ -56,5 +56,5 @@
|
|
|
56
56
|
"publishConfig": {
|
|
57
57
|
"access": "public"
|
|
58
58
|
},
|
|
59
|
-
"gitHead": "
|
|
59
|
+
"gitHead": "9c77d4e8267ed39469c65f65da94ece7be509874"
|
|
60
60
|
}
|
package/src/Link.tsx
CHANGED
|
@@ -25,7 +25,7 @@ let isOldReact = parseInt(React.version, 10) <= 18;
|
|
|
25
25
|
* Links allow users to navigate to a different location.
|
|
26
26
|
* They can be presented inline inside a paragraph or as standalone text.
|
|
27
27
|
*/
|
|
28
|
-
export function Link(props: SpectrumLinkProps) {
|
|
28
|
+
export function Link(props: SpectrumLinkProps): JSX.Element {
|
|
29
29
|
props = useProviderProps(props);
|
|
30
30
|
props = useSlotProps(props, 'link');
|
|
31
31
|
let {
|