@react-spectrum/link 3.1.2 → 3.2.2

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/main.css CHANGED
@@ -1,2 +1 @@
1
- ._spectrum-Link_f1e6e{background-color:initial;-webkit-text-decoration-skip:objects;transition:color .13s ease-in-out;outline:none;cursor:pointer}._spectrum-Link_f1e6e,._spectrum-Link_f1e6e._is-hovered_f1e6e{text-decoration:underline}._spectrum-Link_f1e6e._focus-ring_f1e6e{text-decoration:underline;-webkit-text-decoration-style:double;text-decoration-style:double}._spectrum-Link_f1e6e._is-disabled_f1e6e{cursor:default;pointer-events:none}._spectrum-Link_f1e6e._is-disabled_f1e6e._is-hovered_f1e6e,._spectrum-Link_f1e6e._is-disabled_f1e6e:focus{text-decoration:none}._spectrum-Link--overBackground_f1e6e,._spectrum-Link--secondary_f1e6e{text-decoration:underline}._spectrum-Link--quiet_f1e6e{text-decoration:none}._spectrum-Link_f1e6e,._spectrum-Link_f1e6e._is-hovered_f1e6e{color:var(--spectrum-global-color-blue-600)}._spectrum-Link_f1e6e:active{color:var(--spectrum-global-color-blue-700)}._spectrum-Link_f1e6e._focus-ring_f1e6e{color:var(--spectrum-alias-text-color-key-focus,var(--spectrum-global-color-blue-600))}._spectrum-Link_f1e6e._is-disabled_f1e6e{color:var(--spectrum-alias-text-color-disabled,var(--spectrum-global-color-gray-500))}._spectrum-Link--secondary_f1e6e,._spectrum-Link--secondary_f1e6e._is-hovered_f1e6e,._spectrum-Link--secondary_f1e6e:active,._spectrum-Link--secondary_f1e6e:focus{color:inherit}._spectrum-Link--overBackground_f1e6e,._spectrum-Link--overBackground_f1e6e._is-hovered_f1e6e,._spectrum-Link--overBackground_f1e6e:active,._spectrum-Link--overBackground_f1e6e:focus{color:var(--spectrum-global-color-static-white,#fff)}._spectrum-Link--overBackground_f1e6e._is-disabled_f1e6e{color:hsla(0,0%,100%,.5)}
2
- /*# sourceMappingURL=main.css.map */
1
+ .spectrum-Link_5a03c7{-webkit-text-decoration-skip:objects;transition:color var(--spectrum-global-animation-duration-100,130ms)ease-in-out;cursor:pointer;background-color:#0000;outline:0;text-decoration:underline}.spectrum-Link_5a03c7.is-hovered_5a03c7,.spectrum-Link_5a03c7.focus-ring_5a03c7{text-decoration:underline}.spectrum-Link_5a03c7.focus-ring_5a03c7{text-decoration:underline;text-decoration-style:double}.spectrum-Link_5a03c7.is-disabled_5a03c7{cursor:default;pointer-events:none}.spectrum-Link_5a03c7.is-disabled_5a03c7.is-hovered_5a03c7,.spectrum-Link_5a03c7.is-disabled_5a03c7:focus{text-decoration:none}.spectrum-Link--secondary_5a03c7,.spectrum-Link--overBackground_5a03c7{text-decoration:underline}.spectrum-Link--quiet_5a03c7{text-decoration:none}.spectrum-Link_5a03c7{color:var(--spectrum-link-text-color,var(--spectrum-global-color-blue-600))}.spectrum-Link_5a03c7.is-hovered_5a03c7{color:var(--spectrum-link-text-color-hover,var(--spectrum-global-color-blue-600))}.spectrum-Link_5a03c7:active{color:var(--spectrum-link-text-color-down,var(--spectrum-global-color-blue-700))}.spectrum-Link_5a03c7.focus-ring_5a03c7{color:var(--spectrum-link-text-color-key-focus,var(--spectrum-alias-text-color-key-focus))}.spectrum-Link_5a03c7.is-disabled_5a03c7{color:var(--spectrum-link-text-color-disabled,var(--spectrum-alias-text-color-disabled))}.spectrum-Link--secondary_5a03c7,.spectrum-Link--secondary_5a03c7.is-hovered_5a03c7,.spectrum-Link--secondary_5a03c7:active,.spectrum-Link--secondary_5a03c7:focus{color:inherit}.spectrum-Link--overBackground_5a03c7{color:var(--spectrum-link-over-background-text-color,var(--spectrum-global-color-static-white))}.spectrum-Link--overBackground_5a03c7.is-hovered_5a03c7{color:var(--spectrum-link-over-background-text-color-hover,var(--spectrum-global-color-static-white))}.spectrum-Link--overBackground_5a03c7:active{color:var(--spectrum-link-over-background-text-color-down,var(--spectrum-global-color-static-white))}.spectrum-Link--overBackground_5a03c7:focus{color:var(--spectrum-link-over-background-text-color-key-focus,var(--spectrum-global-color-static-white))}.spectrum-Link--overBackground_5a03c7.is-disabled_5a03c7{color:var(--spectrum-link-over-background-text-color-disabled,#ffffff80)}
package/dist/main.js CHANGED
@@ -1,100 +1,99 @@
1
- var {
2
- useProviderProps
3
- } = require("@react-spectrum/provider");
4
-
5
- var {
6
- useLink
7
- } = require("@react-aria/link");
8
-
9
- var {
10
- useHover
11
- } = require("@react-aria/interactions");
12
-
13
- var _react2 = require("react");
14
-
15
- var _react = $parcel$interopDefault(_react2);
16
-
17
- var {
18
- useRef
19
- } = _react2;
20
-
21
- var {
22
- mergeProps
23
- } = require("@react-aria/utils");
24
-
25
- var {
26
- FocusRing
27
- } = require("@react-aria/focus");
28
-
29
- var {
30
- classNames,
31
- getWrappedElement,
32
- useStyleProps
33
- } = require("@react-spectrum/utils");
34
-
35
- var _babelRuntimeHelpersExtends = $parcel$interopDefault(require("@babel/runtime/helpers/extends"));
36
-
37
1
  require("./main.css");
38
-
2
+ var $1vAVm$reactspectrumutils = require("@react-spectrum/utils");
3
+ var $1vAVm$reactariafocus = require("@react-aria/focus");
4
+ var $1vAVm$reactariautils = require("@react-aria/utils");
5
+ var $1vAVm$react = require("react");
6
+ var $1vAVm$reactariainteractions = require("@react-aria/interactions");
7
+ var $1vAVm$reactarialink = require("@react-aria/link");
8
+ var $1vAVm$reactspectrumprovider = require("@react-spectrum/provider");
9
+
10
+ function $parcel$exportWildcard(dest, source) {
11
+ Object.keys(source).forEach(function(key) {
12
+ if (key === 'default' || key === '__esModule' || dest.hasOwnProperty(key)) {
13
+ return;
14
+ }
15
+
16
+ Object.defineProperty(dest, key, {
17
+ enumerable: true,
18
+ get: function get() {
19
+ return source[key];
20
+ }
21
+ });
22
+ });
23
+
24
+ return dest;
25
+ }
39
26
  function $parcel$interopDefault(a) {
40
27
  return a && a.__esModule ? a.default : a;
41
28
  }
42
-
43
- // ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/link/vars.css
44
- var $ab502cff6933f7953f496b5b8a9d9e20$exports = {};
45
- $ab502cff6933f7953f496b5b8a9d9e20$exports = {
46
- "spectrum-Link": "_spectrum-Link_f1e6e",
47
- "is-hovered": "_is-hovered_f1e6e",
48
- "focus-ring": "_focus-ring_f1e6e",
49
- "is-disabled": "_is-disabled_f1e6e",
50
- "spectrum-Link--secondary": "_spectrum-Link--secondary_f1e6e",
51
- "spectrum-Link--overBackground": "_spectrum-Link--overBackground_f1e6e",
52
- "spectrum-Link--quiet": "_spectrum-Link--quiet_f1e6e"
53
- };
54
- var $ab502cff6933f7953f496b5b8a9d9e20$$interop$default = $parcel$interopDefault($ab502cff6933f7953f496b5b8a9d9e20$exports);
55
-
56
- /**
57
- * Links allow users to navigate to a different location.
58
- * They can be presented inline inside a paragraph or as standalone text.
59
- */
60
- function Link(props) {
61
- props = useProviderProps(props);
62
- let {
63
- variant = 'primary',
64
- isQuiet,
65
- children,
66
- // @ts-ignore
67
- href
68
- } = props;
69
- let {
70
- styleProps
71
- } = useStyleProps(props);
72
- let {
73
- hoverProps,
74
- isHovered
75
- } = useHover({});
76
-
77
- if (href) {
78
- console.warn('href is deprecated, please use an anchor element as children');
79
- }
80
-
81
- let ref = useRef();
82
- let {
83
- linkProps
84
- } = useLink(_babelRuntimeHelpersExtends({}, props, {
85
- elementType: typeof children === 'string' ? 'span' : 'a'
86
- }), ref);
87
- return /*#__PURE__*/_react.createElement(FocusRing, {
88
- focusRingClass: classNames($ab502cff6933f7953f496b5b8a9d9e20$$interop$default, 'focus-ring')
89
- }, /*#__PURE__*/_react.cloneElement(getWrappedElement(children), _babelRuntimeHelpersExtends({}, styleProps, mergeProps(linkProps, hoverProps), {
90
- ref,
91
- className: classNames($ab502cff6933f7953f496b5b8a9d9e20$$interop$default, 'spectrum-Link', {
92
- 'spectrum-Link--quiet': isQuiet,
93
- ["spectrum-Link--" + variant]: variant,
94
- 'is-hovered': isHovered
95
- }, styleProps.className)
96
- })));
29
+ function $parcel$export(e, n, v, s) {
30
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
97
31
  }
32
+ var $c813c9dd9e1d28bf$exports = {};
33
+
34
+ $parcel$export($c813c9dd9e1d28bf$exports, "Link", () => $c813c9dd9e1d28bf$export$a6c7ac8248d6e38a);
35
+
36
+
37
+
38
+
39
+ var $451aaf8155691d97$exports = {};
40
+
41
+ $parcel$export($451aaf8155691d97$exports, "spectrum-Link", () => $451aaf8155691d97$export$d85dd8b94975f388, (v) => $451aaf8155691d97$export$d85dd8b94975f388 = v);
42
+ $parcel$export($451aaf8155691d97$exports, "is-hovered", () => $451aaf8155691d97$export$b8813cd5d7824ce7, (v) => $451aaf8155691d97$export$b8813cd5d7824ce7 = v);
43
+ $parcel$export($451aaf8155691d97$exports, "focus-ring", () => $451aaf8155691d97$export$f39a09f249340e2a, (v) => $451aaf8155691d97$export$f39a09f249340e2a = v);
44
+ $parcel$export($451aaf8155691d97$exports, "is-disabled", () => $451aaf8155691d97$export$d35bc1e505d1ebbf, (v) => $451aaf8155691d97$export$d35bc1e505d1ebbf = v);
45
+ $parcel$export($451aaf8155691d97$exports, "spectrum-Link--secondary", () => $451aaf8155691d97$export$ab09ed292dcb9a79, (v) => $451aaf8155691d97$export$ab09ed292dcb9a79 = v);
46
+ $parcel$export($451aaf8155691d97$exports, "spectrum-Link--overBackground", () => $451aaf8155691d97$export$679b6267148797da, (v) => $451aaf8155691d97$export$679b6267148797da = v);
47
+ $parcel$export($451aaf8155691d97$exports, "spectrum-Link--quiet", () => $451aaf8155691d97$export$81921ea93435e997, (v) => $451aaf8155691d97$export$81921ea93435e997 = v);
48
+ var $451aaf8155691d97$export$d85dd8b94975f388;
49
+ var $451aaf8155691d97$export$b8813cd5d7824ce7;
50
+ var $451aaf8155691d97$export$f39a09f249340e2a;
51
+ var $451aaf8155691d97$export$d35bc1e505d1ebbf;
52
+ var $451aaf8155691d97$export$ab09ed292dcb9a79;
53
+ var $451aaf8155691d97$export$679b6267148797da;
54
+ var $451aaf8155691d97$export$81921ea93435e997;
55
+ $451aaf8155691d97$export$d85dd8b94975f388 = "spectrum-Link_5a03c7";
56
+ $451aaf8155691d97$export$b8813cd5d7824ce7 = "is-hovered_5a03c7";
57
+ $451aaf8155691d97$export$f39a09f249340e2a = "focus-ring_5a03c7";
58
+ $451aaf8155691d97$export$d35bc1e505d1ebbf = "is-disabled_5a03c7";
59
+ $451aaf8155691d97$export$ab09ed292dcb9a79 = "spectrum-Link--secondary_5a03c7";
60
+ $451aaf8155691d97$export$679b6267148797da = "spectrum-Link--overBackground_5a03c7";
61
+ $451aaf8155691d97$export$81921ea93435e997 = "spectrum-Link--quiet_5a03c7";
62
+
63
+
64
+
65
+
66
+
67
+ function $c813c9dd9e1d28bf$export$a6c7ac8248d6e38a(props) {
68
+ props = $1vAVm$reactspectrumprovider.useProviderProps(props);
69
+ props = $1vAVm$reactspectrumutils.useSlotProps(props, 'link');
70
+ let { variant: variant = 'primary' , isQuiet: isQuiet , children: children , href: // @ts-ignore
71
+ href } = props;
72
+ let { styleProps: styleProps } = $1vAVm$reactspectrumutils.useStyleProps(props);
73
+ let { hoverProps: hoverProps , isHovered: isHovered } = $1vAVm$reactariainteractions.useHover({
74
+ });
75
+ if (href) console.warn('href is deprecated, please use an anchor element as children');
76
+ let ref = $1vAVm$react.useRef();
77
+ let { linkProps: linkProps } = $1vAVm$reactarialink.useLink({
78
+ ...props,
79
+ elementType: typeof children === 'string' ? 'span' : 'a'
80
+ }, ref);
81
+ return(/*#__PURE__*/ ($parcel$interopDefault($1vAVm$react)).createElement($1vAVm$reactariafocus.FocusRing, {
82
+ focusRingClass: $1vAVm$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($451aaf8155691d97$exports)), 'focus-ring')
83
+ }, /*#__PURE__*/ ($parcel$interopDefault($1vAVm$react)).cloneElement($1vAVm$reactspectrumutils.getWrappedElement(children), {
84
+ ...styleProps,
85
+ ...$1vAVm$reactariautils.mergeProps(linkProps, hoverProps),
86
+ ref: ref,
87
+ className: $1vAVm$reactspectrumutils.classNames((/*@__PURE__*/$parcel$interopDefault($451aaf8155691d97$exports)), 'spectrum-Link', {
88
+ 'spectrum-Link--quiet': isQuiet,
89
+ [`spectrum-Link--${variant}`]: variant,
90
+ 'is-hovered': isHovered
91
+ }, styleProps.className)
92
+ })));
93
+ }
94
+
95
+
96
+ $parcel$exportWildcard(module.exports, $c813c9dd9e1d28bf$exports);
97
+
98
98
 
99
- exports.Link = Link;
100
99
  //# sourceMappingURL=main.js.map
package/dist/main.js.map CHANGED
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,4CAAiB;AACf,mBAAiB,sBADF;AAEf,gBAAc,mBAFC;AAGf,gBAAc,mBAHC;AAIf,iBAAe,oBAJA;AAKf,8BAA4B,iCALb;AAMf,mCAAiC,sCANlB;AAOf,0BAAwB;AAPT,CAAjB;;;ACsBA;;;;AAIO,SAASG,IAAT,CAAcC,KAAd,EAAwC;AAC7CA,EAAAA,KAAK,GAAGC,gBAAgB,CAACD,KAAD,CAAxB;AACA,MAAI;AACFE,IAAAA,OAAO,GAAG,SADR;AAEFC,IAAAA,OAFE;AAGFC,IAAAA,QAHE;AAIF;AACAC,IAAAA;AALE,MAMAL,KANJ;AAOA,MAAI;AAACM,IAAAA;AAAD,MAAeC,aAAa,CAACP,KAAD,CAAhC;AACA,MAAI;AAACQ,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA0BC,QAAQ,CAAC,EAAD,CAAtC;;AAEA,MAAIL,IAAJ,EAAU;AACRM,IAAAA,OAAO,CAACC,IAAR,CAAa,8DAAb;AACD;;AAED,MAAIC,GAAG,GAAGC,MAAM,EAAhB;AACA,MAAI;AAACC,IAAAA;AAAD,MAAcC,OAAO,iCACpBhB,KADoB;AAEvBiB,IAAAA,WAAW,EAAE,OAAOb,QAAP,KAAoB,QAApB,GAA+B,MAA/B,GAAwC;AAF9B,MAGtBS,GAHsB,CAAzB;AAKA,sBACE,qBAAC,SAAD;AAAW,IAAA,cAAc,EAAEK,UAAU,qDAAS,YAAT;AAArC,kBACGC,MAAK,CAACC,YAAN,CACCC,iBAAiB,CAACjB,QAAD,CADlB,kCAGME,UAHN,EAIMgB,UAAU,CAACP,SAAD,EAAYP,UAAZ,CAJhB;AAKGK,IAAAA,GALH;AAMGU,IAAAA,SAAS,EAAEL,UAAU,qDAEnB,eAFmB,EAGnB;AACE,8BAAwBf,OAD1B;AAEE,2BAAmBD,OAAnB,GAA+BA,OAFjC;AAGE,oBAAcO;AAHhB,KAHmB,EAQnBH,UAAU,CAACiB,SARQ;AANxB,KADH,CADF;AAsBD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/link/vars.css","./packages/@react-spectrum/link/src/Link.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","/*\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","/*\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, useStyleProps} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {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\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 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 if (href) {\n console.warn('href is deprecated, please use an anchor element as children');\n }\n\n let ref = useRef();\n let {linkProps} = useLink({\n ...props,\n elementType: typeof children === 'string' ? 'span' : 'a'\n }, ref);\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {React.cloneElement(\n getWrappedElement(children),\n {\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 </FocusRing>\n );\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","Link","props","useProviderProps","variant","isQuiet","children","href","styleProps","useStyleProps","hoverProps","isHovered","useHover","console","warn","ref","useRef","linkProps","useLink","elementType","classNames","React","cloneElement","getWrappedElement","mergeProps","className"],"version":3,"file":"main.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA+B;AAC/B,GAA4B;AAC5B,GAA4B;AAC5B,GAA6B;AAC7B,GAA0C;AAC1C,GAA+C;AAC/C,GAAsC;AANtC,yCAA+B,GAAG,CAAsB;AACxD,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA6B,GAAG,CAAoB;AACpD,yCAA0C,GAAG,CAAiC;AAC9E,yCAA+C,GAAG,CAAsC;AACxF,yCAAsC,GAAG,CAA6B;;;;;;SDoBtD,yCAAI,CAAC,KAAwB,EAAE,CAAC;IAC9C,KAAK,GAAG,6CAAgB,CAAC,KAAK;IAC9B,KAAK,GAAG,sCAAY,CAAC,KAAK,EAAE,CAAM;IAClC,GAAG,CAAC,CAAC,UACH,OAAO,GAAG,CAAS,oBACnB,OAAO,aACP,QAAQ,SACR,EAAa,AAAb,WAAa;IACb,IAAI,EACN,CAAC,GAAG,KAAK;IACT,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,uCAAa,CAAC,KAAK;IACtC,GAAG,CAAC,CAAC,aAAA,UAAU,cAAE,SAAS,EAAA,CAAC,GAAG,qCAAQ,CAAC,CAAC;IAAA,CAAC;IAEzC,EAAE,EAAE,IAAI,EACN,OAAO,CAAC,IAAI,CAAC,CAA8D;IAG7E,GAAG,CAAC,GAAG,GAAG,mBAAM;IAChB,GAAG,CAAC,CAAC,YAAA,SAAS,EAAA,CAAC,GAAG,4BAAO,CAAC,CAAC;WACtB,KAAK;QACR,WAAW,EAAE,MAAM,CAAC,QAAQ,KAAK,CAAQ,UAAG,CAAM,QAAG,CAAG;IAC1D,CAAC,EAAE,GAAG;IAEN,MAAM,oEACH,+BAAS;QAAC,cAAc,EAAE,oCAAU,CAAC,gEAAM,EAAE,CAAY;qBACvD,sCAAK,CAAC,YAAY,CACjB,2CAAiB,CAAC,QAAQ,GAC1B,CAAC;WACI,UAAU;WACV,gCAAU,CAAC,SAAS,EAAE,UAAU;aACnC,GAAG;QACH,SAAS,EAAE,oCAAU,CACnB,gEAAM,EACN,CAAe,gBACf,CAAC;YACC,CAAsB,uBAAE,OAAO;cAC7B,eAAe,EAAE,OAAO,KAAK,OAAO;YACtC,CAAY,aAAE,SAAS;QACzB,CAAC,EACD,UAAU,CAAC,SAAS;IAExB,CAAC;AAIT,CAAC","sources":["packages/@react-spectrum/link/src/index.ts","packages/@react-spectrum/link/src/Link.tsx","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/// <reference types=\"css-module-types\" />\n\nexport * from './Link';\n","/*\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} from '@react-aria/utils';\nimport React, {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\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 if (href) {\n console.warn('href is deprecated, please use an anchor element as children');\n }\n\n let ref = useRef();\n let {linkProps} = useLink({\n ...props,\n elementType: typeof children === 'string' ? 'span' : 'a'\n }, ref);\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {React.cloneElement(\n getWrappedElement(children),\n {\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 </FocusRing>\n );\n}\n","/*\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":"main.js.map"}
package/dist/module.js CHANGED
@@ -1,70 +1,83 @@
1
- import { useProviderProps } from "@react-spectrum/provider";
2
- import { useLink } from "@react-aria/link";
3
- import { useHover } from "@react-aria/interactions";
4
- import _react, { useRef } from "react";
5
- import { mergeProps } from "@react-aria/utils";
6
- import { FocusRing } from "@react-aria/focus";
7
- import { classNames, getWrappedElement, useStyleProps } from "@react-spectrum/utils";
8
- import _babelRuntimeHelpersEsmExtends from "@babel/runtime/helpers/esm/extends";
9
1
  import "./main.css";
2
+ import {useSlotProps as $iIJLa$useSlotProps, useStyleProps as $iIJLa$useStyleProps, classNames as $iIJLa$classNames, getWrappedElement as $iIJLa$getWrappedElement} from "@react-spectrum/utils";
3
+ import {FocusRing as $iIJLa$FocusRing} from "@react-aria/focus";
4
+ import {mergeProps as $iIJLa$mergeProps} from "@react-aria/utils";
5
+ import $iIJLa$react, {useRef as $iIJLa$useRef} from "react";
6
+ import {useHover as $iIJLa$useHover} from "@react-aria/interactions";
7
+ import {useLink as $iIJLa$useLink} from "@react-aria/link";
8
+ import {useProviderProps as $iIJLa$useProviderProps} from "@react-spectrum/provider";
10
9
 
11
10
  function $parcel$interopDefault(a) {
12
11
  return a && a.__esModule ? a.default : a;
13
12
  }
13
+ function $parcel$export(e, n, v, s) {
14
+ Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
15
+ }
16
+ var $679ffbd705ba6cf7$exports = {};
17
+
18
+ $parcel$export($679ffbd705ba6cf7$exports, "Link", () => $679ffbd705ba6cf7$export$a6c7ac8248d6e38a);
19
+
20
+
21
+
22
+
23
+ var $c9f2f68a832cd862$exports = {};
24
+
25
+ $parcel$export($c9f2f68a832cd862$exports, "spectrum-Link", () => $c9f2f68a832cd862$export$d85dd8b94975f388, (v) => $c9f2f68a832cd862$export$d85dd8b94975f388 = v);
26
+ $parcel$export($c9f2f68a832cd862$exports, "is-hovered", () => $c9f2f68a832cd862$export$b8813cd5d7824ce7, (v) => $c9f2f68a832cd862$export$b8813cd5d7824ce7 = v);
27
+ $parcel$export($c9f2f68a832cd862$exports, "focus-ring", () => $c9f2f68a832cd862$export$f39a09f249340e2a, (v) => $c9f2f68a832cd862$export$f39a09f249340e2a = v);
28
+ $parcel$export($c9f2f68a832cd862$exports, "is-disabled", () => $c9f2f68a832cd862$export$d35bc1e505d1ebbf, (v) => $c9f2f68a832cd862$export$d35bc1e505d1ebbf = v);
29
+ $parcel$export($c9f2f68a832cd862$exports, "spectrum-Link--secondary", () => $c9f2f68a832cd862$export$ab09ed292dcb9a79, (v) => $c9f2f68a832cd862$export$ab09ed292dcb9a79 = v);
30
+ $parcel$export($c9f2f68a832cd862$exports, "spectrum-Link--overBackground", () => $c9f2f68a832cd862$export$679b6267148797da, (v) => $c9f2f68a832cd862$export$679b6267148797da = v);
31
+ $parcel$export($c9f2f68a832cd862$exports, "spectrum-Link--quiet", () => $c9f2f68a832cd862$export$81921ea93435e997, (v) => $c9f2f68a832cd862$export$81921ea93435e997 = v);
32
+ var $c9f2f68a832cd862$export$d85dd8b94975f388;
33
+ var $c9f2f68a832cd862$export$b8813cd5d7824ce7;
34
+ var $c9f2f68a832cd862$export$f39a09f249340e2a;
35
+ var $c9f2f68a832cd862$export$d35bc1e505d1ebbf;
36
+ var $c9f2f68a832cd862$export$ab09ed292dcb9a79;
37
+ var $c9f2f68a832cd862$export$679b6267148797da;
38
+ var $c9f2f68a832cd862$export$81921ea93435e997;
39
+ $c9f2f68a832cd862$export$d85dd8b94975f388 = "spectrum-Link_5a03c7";
40
+ $c9f2f68a832cd862$export$b8813cd5d7824ce7 = "is-hovered_5a03c7";
41
+ $c9f2f68a832cd862$export$f39a09f249340e2a = "focus-ring_5a03c7";
42
+ $c9f2f68a832cd862$export$d35bc1e505d1ebbf = "is-disabled_5a03c7";
43
+ $c9f2f68a832cd862$export$ab09ed292dcb9a79 = "spectrum-Link--secondary_5a03c7";
44
+ $c9f2f68a832cd862$export$679b6267148797da = "spectrum-Link--overBackground_5a03c7";
45
+ $c9f2f68a832cd862$export$81921ea93435e997 = "spectrum-Link--quiet_5a03c7";
46
+
14
47
 
15
- // ASSET: /Users/govett/dev/react-spectrum-v3/node_modules/@adobe/spectrum-css-temp/components/link/vars.css
16
- var $b893bfef2c79e230cc467d335eb860$exports = {};
17
- $b893bfef2c79e230cc467d335eb860$exports = {
18
- "spectrum-Link": "_spectrum-Link_f1e6e",
19
- "is-hovered": "_is-hovered_f1e6e",
20
- "focus-ring": "_focus-ring_f1e6e",
21
- "is-disabled": "_is-disabled_f1e6e",
22
- "spectrum-Link--secondary": "_spectrum-Link--secondary_f1e6e",
23
- "spectrum-Link--overBackground": "_spectrum-Link--overBackground_f1e6e",
24
- "spectrum-Link--quiet": "_spectrum-Link--quiet_f1e6e"
25
- };
26
- var $b893bfef2c79e230cc467d335eb860$$interop$default = $parcel$interopDefault($b893bfef2c79e230cc467d335eb860$exports);
27
-
28
- /**
29
- * Links allow users to navigate to a different location.
30
- * They can be presented inline inside a paragraph or as standalone text.
31
- */
32
- export function Link(props) {
33
- props = useProviderProps(props);
34
- let {
35
- variant = 'primary',
36
- isQuiet,
37
- children,
38
- // @ts-ignore
39
- href
40
- } = props;
41
- let {
42
- styleProps
43
- } = useStyleProps(props);
44
- let {
45
- hoverProps,
46
- isHovered
47
- } = useHover({});
48
-
49
- if (href) {
50
- console.warn('href is deprecated, please use an anchor element as children');
51
- }
52
-
53
- let ref = useRef();
54
- let {
55
- linkProps
56
- } = useLink(_babelRuntimeHelpersEsmExtends({}, props, {
57
- elementType: typeof children === 'string' ? 'span' : 'a'
58
- }), ref);
59
- return /*#__PURE__*/_react.createElement(FocusRing, {
60
- focusRingClass: classNames($b893bfef2c79e230cc467d335eb860$$interop$default, 'focus-ring')
61
- }, /*#__PURE__*/_react.cloneElement(getWrappedElement(children), _babelRuntimeHelpersEsmExtends({}, styleProps, mergeProps(linkProps, hoverProps), {
62
- ref,
63
- className: classNames($b893bfef2c79e230cc467d335eb860$$interop$default, 'spectrum-Link', {
64
- 'spectrum-Link--quiet': isQuiet,
65
- ["spectrum-Link--" + variant]: variant,
66
- 'is-hovered': isHovered
67
- }, styleProps.className)
68
- })));
48
+
49
+
50
+
51
+ function $679ffbd705ba6cf7$export$a6c7ac8248d6e38a(props) {
52
+ props = $iIJLa$useProviderProps(props);
53
+ props = $iIJLa$useSlotProps(props, 'link');
54
+ let { variant: variant = 'primary' , isQuiet: isQuiet , children: children , href: // @ts-ignore
55
+ href } = props;
56
+ let { styleProps: styleProps } = $iIJLa$useStyleProps(props);
57
+ let { hoverProps: hoverProps , isHovered: isHovered } = $iIJLa$useHover({
58
+ });
59
+ if (href) console.warn('href is deprecated, please use an anchor element as children');
60
+ let ref = $iIJLa$useRef();
61
+ let { linkProps: linkProps } = $iIJLa$useLink({
62
+ ...props,
63
+ elementType: typeof children === 'string' ? 'span' : 'a'
64
+ }, ref);
65
+ return(/*#__PURE__*/ $iIJLa$react.createElement($iIJLa$FocusRing, {
66
+ focusRingClass: $iIJLa$classNames((/*@__PURE__*/$parcel$interopDefault($c9f2f68a832cd862$exports)), 'focus-ring')
67
+ }, /*#__PURE__*/ $iIJLa$react.cloneElement($iIJLa$getWrappedElement(children), {
68
+ ...styleProps,
69
+ ...$iIJLa$mergeProps(linkProps, hoverProps),
70
+ ref: ref,
71
+ className: $iIJLa$classNames((/*@__PURE__*/$parcel$interopDefault($c9f2f68a832cd862$exports)), 'spectrum-Link', {
72
+ 'spectrum-Link--quiet': isQuiet,
73
+ [`spectrum-Link--${variant}`]: variant,
74
+ 'is-hovered': isHovered
75
+ }, styleProps.className)
76
+ })));
69
77
  }
78
+
79
+
80
+
81
+
82
+ export {$679ffbd705ba6cf7$export$a6c7ac8248d6e38a as Link};
70
83
  //# sourceMappingURL=module.js.map
@@ -1 +1 @@
1
- {"mappings":";;;;;;;;;;AAAA,SAASA,sBAAT,CAAgCC,CAAhC,EAAmC;AACjC,SAAOA,CAAC,IAAIA,CAAC,CAACC,UAAP,GAAoBD,CAAC,CAACE,OAAtB,GAAgCF,CAAvC;AACD;;;;ACFD,0CAAiB;AACf,mBAAiB,sBADF;AAEf,gBAAc,mBAFC;AAGf,gBAAc,mBAHC;AAIf,iBAAe,oBAJA;AAKf,8BAA4B,iCALb;AAMf,mCAAiC,sCANlB;AAOf,0BAAwB;AAPT,CAAjB;;;ACsBA;;;;OAIO,SAASG,IAAT,CAAcC,KAAd,EAAwC;AAC7CA,EAAAA,KAAK,GAAGC,gBAAgB,CAACD,KAAD,CAAxB;AACA,MAAI;AACFE,IAAAA,OAAO,GAAG,SADR;AAEFC,IAAAA,OAFE;AAGFC,IAAAA,QAHE;AAIF;AACAC,IAAAA;AALE,MAMAL,KANJ;AAOA,MAAI;AAACM,IAAAA;AAAD,MAAeC,aAAa,CAACP,KAAD,CAAhC;AACA,MAAI;AAACQ,IAAAA,UAAD;AAAaC,IAAAA;AAAb,MAA0BC,QAAQ,CAAC,EAAD,CAAtC;;AAEA,MAAIL,IAAJ,EAAU;AACRM,IAAAA,OAAO,CAACC,IAAR,CAAa,8DAAb;AACD;;AAED,MAAIC,GAAG,GAAGC,MAAM,EAAhB;AACA,MAAI;AAACC,IAAAA;AAAD,MAAcC,OAAO,oCACpBhB,KADoB;AAEvBiB,IAAAA,WAAW,EAAE,OAAOb,QAAP,KAAoB,QAApB,GAA+B,MAA/B,GAAwC;AAF9B,MAGtBS,GAHsB,CAAzB;AAKA,sBACE,qBAAC,SAAD;AAAW,IAAA,cAAc,EAAEK,UAAU,mDAAS,YAAT;AAArC,kBACGC,MAAK,CAACC,YAAN,CACCC,iBAAiB,CAACjB,QAAD,CADlB,qCAGME,UAHN,EAIMgB,UAAU,CAACP,SAAD,EAAYP,UAAZ,CAJhB;AAKGK,IAAAA,GALH;AAMGU,IAAAA,SAAS,EAAEL,UAAU,mDAEnB,eAFmB,EAGnB;AACE,8BAAwBf,OAD1B;AAEE,2BAAmBD,OAAnB,GAA+BA,OAFjC;AAGE,oBAAcO;AAHhB,KAHmB,EAQnBH,UAAU,CAACiB,SARQ;AANxB,KADH,CADF;AAsBD","sources":["./node_modules/@parcel/scope-hoisting/lib/helpers.js","./node_modules/@adobe/spectrum-css-temp/components/link/vars.css","./packages/@react-spectrum/link/src/Link.tsx"],"sourcesContent":["function $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\nfunction $parcel$defineInteropFlag(a) {\n Object.defineProperty(a, '__esModule', {value: true});\n}\n\nfunction $parcel$exportWildcard(dest, source) {\n Object.keys(source).forEach(function(key) {\n if (key === 'default' || key === '__esModule') {\n return;\n }\n\n Object.defineProperty(dest, key, {\n enumerable: true,\n get: function get() {\n return source[key];\n },\n });\n });\n\n return dest;\n}\n\nfunction $parcel$missingModule(name) {\n var err = new Error(\"Cannot find module '\" + name + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n}\n\nvar $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n","/*\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","/*\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, useStyleProps} from '@react-spectrum/utils';\nimport {FocusRing} from '@react-aria/focus';\nimport {mergeProps} from '@react-aria/utils';\nimport React, {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\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 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 if (href) {\n console.warn('href is deprecated, please use an anchor element as children');\n }\n\n let ref = useRef();\n let {linkProps} = useLink({\n ...props,\n elementType: typeof children === 'string' ? 'span' : 'a'\n }, ref);\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {React.cloneElement(\n getWrappedElement(children),\n {\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 </FocusRing>\n );\n}\n"],"names":["$parcel$interopDefault","a","__esModule","default","Link","props","useProviderProps","variant","isQuiet","children","href","styleProps","useStyleProps","hoverProps","isHovered","useHover","console","warn","ref","useRef","linkProps","useLink","elementType","classNames","React","cloneElement","getWrappedElement","mergeProps","className"],"version":3,"file":"module.js.map"}
1
+ {"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AEAA,GAA+B;AAC/B,GAA4B;AAC5B,GAA4B;AAC5B,GAA6B;AAC7B,GAA0C;AAC1C,GAA+C;AAC/C,GAAsC;AANtC,yCAA+B,GAAG,CAAsB;AACxD,yCAA4B,GAAG,CAAmB;AAClD,yCAA4B,GAAG,CAAmB;AAClD,yCAA6B,GAAG,CAAoB;AACpD,yCAA0C,GAAG,CAAiC;AAC9E,yCAA+C,GAAG,CAAsC;AACxF,yCAAsC,GAAG,CAA6B;;;;;;SDoBtD,yCAAI,CAAC,KAAwB,EAAE,CAAC;IAC9C,KAAK,GAAG,uBAAgB,CAAC,KAAK;IAC9B,KAAK,GAAG,mBAAY,CAAC,KAAK,EAAE,CAAM;IAClC,GAAG,CAAC,CAAC,UACH,OAAO,GAAG,CAAS,oBACnB,OAAO,aACP,QAAQ,SACR,EAAa,AAAb,WAAa;IACb,IAAI,EACN,CAAC,GAAG,KAAK;IACT,GAAG,CAAC,CAAC,aAAA,UAAU,EAAA,CAAC,GAAG,oBAAa,CAAC,KAAK;IACtC,GAAG,CAAC,CAAC,aAAA,UAAU,cAAE,SAAS,EAAA,CAAC,GAAG,eAAQ,CAAC,CAAC;IAAA,CAAC;IAEzC,EAAE,EAAE,IAAI,EACN,OAAO,CAAC,IAAI,CAAC,CAA8D;IAG7E,GAAG,CAAC,GAAG,GAAG,aAAM;IAChB,GAAG,CAAC,CAAC,YAAA,SAAS,EAAA,CAAC,GAAG,cAAO,CAAC,CAAC;WACtB,KAAK;QACR,WAAW,EAAE,MAAM,CAAC,QAAQ,KAAK,CAAQ,UAAG,CAAM,QAAG,CAAG;IAC1D,CAAC,EAAE,GAAG;IAEN,MAAM,0CACH,gBAAS;QAAC,cAAc,EAAE,iBAAU,CAAC,gEAAM,EAAE,CAAY;qBACvD,YAAK,CAAC,YAAY,CACjB,wBAAiB,CAAC,QAAQ,GAC1B,CAAC;WACI,UAAU;WACV,iBAAU,CAAC,SAAS,EAAE,UAAU;aACnC,GAAG;QACH,SAAS,EAAE,iBAAU,CACnB,gEAAM,EACN,CAAe,gBACf,CAAC;YACC,CAAsB,uBAAE,OAAO;cAC7B,eAAe,EAAE,OAAO,KAAK,OAAO;YACtC,CAAY,aAAE,SAAS;QACzB,CAAC,EACD,UAAU,CAAC,SAAS;IAExB,CAAC;AAIT,CAAC","sources":["packages/@react-spectrum/link/src/index.ts","packages/@react-spectrum/link/src/Link.tsx","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/// <reference types=\"css-module-types\" />\n\nexport * from './Link';\n","/*\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} from '@react-aria/utils';\nimport React, {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\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 if (href) {\n console.warn('href is deprecated, please use an anchor element as children');\n }\n\n let ref = useRef();\n let {linkProps} = useLink({\n ...props,\n elementType: typeof children === 'string' ? 'span' : 'a'\n }, ref);\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {React.cloneElement(\n getWrappedElement(children),\n {\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 </FocusRing>\n );\n}\n","/*\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":"module.js.map"}
@@ -1 +1 @@
1
- {"mappings":"A;AAsBA;A;A;GAGG;AACH,qBAAqB,KAAK,EAAE,iBAAiB,eA4C5C","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"],"sourcesContent":[null,null],"names":[],"version":3,"file":"types.d.ts.map"}
1
+ {"mappings":";AAsBA;;;GAGG;AACH,qBAAqB,KAAK,EAAE,iBAAiB,eA6C5C","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 * from './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.1.2",
3
+ "version": "3.2.2",
4
4
  "description": "Spectrum UI components in React",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/main.js",
@@ -32,22 +32,22 @@
32
32
  },
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.6.2",
35
- "@react-aria/focus": "^3.3.0",
36
- "@react-aria/interactions": "^3.4.0",
37
- "@react-aria/link": "^3.1.3",
38
- "@react-aria/utils": "^3.8.0",
39
- "@react-spectrum/utils": "^3.5.2",
40
- "@react-types/link": "^3.1.2"
35
+ "@react-aria/focus": "^3.5.2",
36
+ "@react-aria/interactions": "^3.8.1",
37
+ "@react-aria/link": "^3.2.2",
38
+ "@react-aria/utils": "^3.11.2",
39
+ "@react-spectrum/utils": "^3.6.5",
40
+ "@react-types/link": "^3.2.2"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@adobe/spectrum-css-temp": "3.0.0-alpha.1"
44
44
  },
45
45
  "peerDependencies": {
46
- "@react-spectrum/provider": "^3.0.0-rc.1",
46
+ "@react-spectrum/provider": "^3.0.0",
47
47
  "react": "^16.8.0 || ^17.0.0-rc.1"
48
48
  },
49
49
  "publishConfig": {
50
50
  "access": "public"
51
51
  },
52
- "gitHead": "3aae08e7d8a75382bedcddac7c86107e40db9296"
52
+ "gitHead": "404d41859b7d6f56201d7fc01bd9f22ae3512937"
53
53
  }
package/src/Link.tsx CHANGED
@@ -10,7 +10,7 @@
10
10
  * governing permissions and limitations under the License.
11
11
  */
12
12
 
13
- import {classNames, getWrappedElement, useStyleProps} from '@react-spectrum/utils';
13
+ import {classNames, getWrappedElement, useSlotProps, useStyleProps} from '@react-spectrum/utils';
14
14
  import {FocusRing} from '@react-aria/focus';
15
15
  import {mergeProps} from '@react-aria/utils';
16
16
  import React, {useRef} from 'react';
@@ -26,6 +26,7 @@ import {useProviderProps} from '@react-spectrum/provider';
26
26
  */
27
27
  export function Link(props: SpectrumLinkProps) {
28
28
  props = useProviderProps(props);
29
+ props = useSlotProps(props, 'link');
29
30
  let {
30
31
  variant = 'primary',
31
32
  isQuiet,
package/dist/main.css.map DELETED
@@ -1 +0,0 @@
1
- {"mappings":"AAcA,sBAEE,wBAA6B,CAE7B,oCAAqC,CAErC,iCAA2E,CAC3E,YAAa,CACb,cAwBF,CAtBE,8DALA,yBAOA,CAMA,wCACE,yBAA0B,CAC1B,oCAA6B,CAA7B,4BACF,CAEA,yCACE,cAAe,CACf,mBAMF,CAJE,0GAEE,oBACF,CAQJ,uEACE,yBACF,CAEA,6BACE,oBACF,CC3CE,8DACE,2CACF,CAEA,6BACE,2CACF,CAEA,wCACE,sFACF,CAEA,yCACE,qFACF,CAcA,mKACE,aACF,CAcA,uLACE,oDACF,CAEA,yDACE,wBACF","sources":["./node_modules/@adobe/spectrum-css-temp/components/link/index.css","./node_modules/@adobe/spectrum-css-temp/components/link/skin.css"],"sourcesContent":["/*\nCopyright 2019 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\n@import '../commons/index.css';\n\n.spectrum-Link {\n /* Remove the gray background on active links in IE 10. */\n background-color: transparent;\n /* Remove gaps in links underline in iOS 8+ and Safari 8+. */\n -webkit-text-decoration-skip: objects;\n text-decoration: underline;\n transition: color var(--spectrum-global-animation-duration-100) ease-in-out;\n outline: none;\n cursor: pointer;\n\n &:hover {\n text-decoration: underline;\n }\n\n &:focus-ring {\n text-decoration: underline;\n }\n\n &:focus-ring {\n text-decoration: underline;\n text-decoration-style: double;\n }\n\n &.is-disabled {\n cursor: default;\n pointer-events: none;\n\n &:hover,\n &:focus {\n text-decoration: none;\n }\n }\n}\n\n.spectrum-Link--secondary {\n text-decoration: underline;\n}\n\n.spectrum-Link--overBackground {\n text-decoration: underline;\n}\n\n.spectrum-Link--quiet {\n text-decoration: none;\n}\n","/*\nCopyright 2019 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\n.spectrum-Link {\n color: var(--spectrum-link-text-color);\n\n &:hover {\n color: var(--spectrum-link-text-color-hover);\n }\n\n &:active {\n color: var(--spectrum-link-text-color-down);\n }\n\n &:focus-ring {\n color: var(--spectrum-link-text-color-key-focus);\n }\n\n &.is-disabled {\n color: var(--spectrum-link-text-color-disabled);\n }\n}\n\n.spectrum-Link--secondary{\n color: inherit;\n\n &:hover {\n color: inherit;\n }\n\n &:active {\n color: inherit;\n }\n\n &:focus {\n color: inherit;\n }\n}\n\n.spectrum-Link--overBackground {\n color: var(--spectrum-link-over-background-text-color);\n\n &:hover {\n color: var(--spectrum-link-over-background-text-color-hover);\n }\n\n &:active {\n color: var(--spectrum-link-over-background-text-color-down);\n }\n\n &:focus {\n color: var(--spectrum-link-over-background-text-color-key-focus);\n }\n\n &.is-disabled {\n color: var(--spectrum-link-over-background-text-color-disabled);\n }\n}\n"],"names":[],"version":3,"file":"main.css.map"}