@react-spectrum/link 3.0.0-alpha.1 → 3.0.0-nightly-641446f65-240905
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/README.md +1 -1
- package/dist/Link.main.js +84 -0
- package/dist/Link.main.js.map +1 -0
- package/dist/Link.mjs +79 -0
- package/dist/Link.module.js +79 -0
- package/dist/Link.module.js.map +1 -0
- package/dist/import.mjs +18 -0
- package/dist/link_vars_css.main.js +41 -0
- package/dist/link_vars_css.main.js.map +1 -0
- package/dist/link_vars_css.mjs +43 -0
- package/dist/link_vars_css.module.js +43 -0
- package/dist/link_vars_css.module.js.map +1 -0
- package/dist/main.js +16 -72
- package/dist/main.js.map +1 -0
- package/dist/module.js +14 -55
- package/dist/module.js.map +1 -0
- package/dist/types.d.ts +2 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/vars.f73dc1cf.css +168 -0
- package/dist/vars.f73dc1cf.css.map +1 -0
- package/package.json +25 -14
- package/src/Link.tsx +90 -0
- package/src/index.ts +16 -0
- package/LICENSE +0 -201
- package/dist/main.css +0 -133
package/README.md
CHANGED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
require("./vars.f73dc1cf.css");
|
|
2
|
+
var $094ce2289235a9fa$exports = require("./link_vars_css.main.js");
|
|
3
|
+
var $jQffG$reactspectrumutils = require("@react-spectrum/utils");
|
|
4
|
+
var $jQffG$reactariafocus = require("@react-aria/focus");
|
|
5
|
+
var $jQffG$reactariautils = require("@react-aria/utils");
|
|
6
|
+
var $jQffG$react = require("react");
|
|
7
|
+
var $jQffG$reactariainteractions = require("@react-aria/interactions");
|
|
8
|
+
var $jQffG$reactarialink = require("@react-aria/link");
|
|
9
|
+
var $jQffG$reactspectrumprovider = require("@react-spectrum/provider");
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
function $parcel$export(e, n, v, s) {
|
|
17
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
$parcel$export(module.exports, "Link", () => $1148fb7fc40f1ce2$export$a6c7ac8248d6e38a);
|
|
21
|
+
/*
|
|
22
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
23
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
24
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
25
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
28
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
29
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
30
|
+
* governing permissions and limitations under the License.
|
|
31
|
+
*/
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
let $1148fb7fc40f1ce2$var$isOldReact = parseInt((0, ($parcel$interopDefault($jQffG$react))).version, 10) <= 18;
|
|
40
|
+
function $1148fb7fc40f1ce2$export$a6c7ac8248d6e38a(props) {
|
|
41
|
+
props = (0, $jQffG$reactspectrumprovider.useProviderProps)(props);
|
|
42
|
+
props = (0, $jQffG$reactspectrumutils.useSlotProps)(props, 'link');
|
|
43
|
+
let { variant: variant = 'primary', isQuiet: isQuiet, children: children, href: // @ts-ignore
|
|
44
|
+
href } = props;
|
|
45
|
+
let { styleProps: styleProps } = (0, $jQffG$reactspectrumutils.useStyleProps)(props);
|
|
46
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $jQffG$reactariainteractions.useHover)({});
|
|
47
|
+
let ref = (0, $jQffG$react.useRef)(null);
|
|
48
|
+
let { linkProps: linkProps } = (0, $jQffG$reactarialink.useLink)({
|
|
49
|
+
...props,
|
|
50
|
+
elementType: !href && typeof children === 'string' ? 'span' : 'a'
|
|
51
|
+
}, ref);
|
|
52
|
+
let domProps = {
|
|
53
|
+
...styleProps,
|
|
54
|
+
...(0, $jQffG$reactariautils.mergeProps)(linkProps, hoverProps),
|
|
55
|
+
ref: ref,
|
|
56
|
+
className: (0, $jQffG$reactspectrumutils.classNames)((0, ($parcel$interopDefault($094ce2289235a9fa$exports))), 'spectrum-Link', {
|
|
57
|
+
'spectrum-Link--quiet': isQuiet,
|
|
58
|
+
[`spectrum-Link--${variant}`]: variant,
|
|
59
|
+
'is-hovered': isHovered
|
|
60
|
+
}, styleProps.className)
|
|
61
|
+
};
|
|
62
|
+
let link;
|
|
63
|
+
if (href) link = /*#__PURE__*/ (0, ($parcel$interopDefault($jQffG$react))).createElement("a", domProps, children);
|
|
64
|
+
else {
|
|
65
|
+
// Backward compatibility.
|
|
66
|
+
let wrappedChild = (0, $jQffG$reactspectrumutils.getWrappedElement)(children);
|
|
67
|
+
let mergedRef = ref;
|
|
68
|
+
if ($1148fb7fc40f1ce2$var$isOldReact) // @ts-ignore
|
|
69
|
+
mergedRef = (0, $jQffG$reactariautils.mergeRefs)(ref, wrappedChild.ref);
|
|
70
|
+
else // @ts-ignore
|
|
71
|
+
mergedRef = (0, $jQffG$reactariautils.mergeRefs)(ref, wrappedChild.props.ref);
|
|
72
|
+
link = /*#__PURE__*/ (0, ($parcel$interopDefault($jQffG$react))).cloneElement(wrappedChild, {
|
|
73
|
+
...(0, $jQffG$reactariautils.mergeProps)(wrappedChild.props, domProps),
|
|
74
|
+
// @ts-ignore https://github.com/facebook/react/issues/8873
|
|
75
|
+
ref: mergedRef
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
return /*#__PURE__*/ (0, ($parcel$interopDefault($jQffG$react))).createElement((0, $jQffG$reactariafocus.FocusRing), {
|
|
79
|
+
focusRingClass: (0, $jQffG$reactspectrumutils.classNames)((0, ($parcel$interopDefault($094ce2289235a9fa$exports))), 'focus-ring')
|
|
80
|
+
}, link);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
|
|
84
|
+
//# sourceMappingURL=Link.main.js.map
|
|
@@ -0,0 +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,QAAQ,CAAC,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"}
|
package/dist/Link.mjs
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import "./vars.f73dc1cf.css";
|
|
2
|
+
import $35Vau$link_vars_cssmodulejs from "./link_vars_css.mjs";
|
|
3
|
+
import {useSlotProps as $35Vau$useSlotProps, useStyleProps as $35Vau$useStyleProps, classNames as $35Vau$classNames, getWrappedElement as $35Vau$getWrappedElement} from "@react-spectrum/utils";
|
|
4
|
+
import {FocusRing as $35Vau$FocusRing} from "@react-aria/focus";
|
|
5
|
+
import {mergeProps as $35Vau$mergeProps, mergeRefs as $35Vau$mergeRefs} from "@react-aria/utils";
|
|
6
|
+
import $35Vau$react, {useRef as $35Vau$useRef} from "react";
|
|
7
|
+
import {useHover as $35Vau$useHover} from "@react-aria/interactions";
|
|
8
|
+
import {useLink as $35Vau$useLink} from "@react-aria/link";
|
|
9
|
+
import {useProviderProps as $35Vau$useProviderProps} from "@react-spectrum/provider";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
let $3c5235ac12f2c9bb$var$isOldReact = parseInt((0, $35Vau$react).version, 10) <= 18;
|
|
34
|
+
function $3c5235ac12f2c9bb$export$a6c7ac8248d6e38a(props) {
|
|
35
|
+
props = (0, $35Vau$useProviderProps)(props);
|
|
36
|
+
props = (0, $35Vau$useSlotProps)(props, 'link');
|
|
37
|
+
let { variant: variant = 'primary', isQuiet: isQuiet, children: children, href: // @ts-ignore
|
|
38
|
+
href } = props;
|
|
39
|
+
let { styleProps: styleProps } = (0, $35Vau$useStyleProps)(props);
|
|
40
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $35Vau$useHover)({});
|
|
41
|
+
let ref = (0, $35Vau$useRef)(null);
|
|
42
|
+
let { linkProps: linkProps } = (0, $35Vau$useLink)({
|
|
43
|
+
...props,
|
|
44
|
+
elementType: !href && typeof children === 'string' ? 'span' : 'a'
|
|
45
|
+
}, ref);
|
|
46
|
+
let domProps = {
|
|
47
|
+
...styleProps,
|
|
48
|
+
...(0, $35Vau$mergeProps)(linkProps, hoverProps),
|
|
49
|
+
ref: ref,
|
|
50
|
+
className: (0, $35Vau$classNames)((0, ($parcel$interopDefault($35Vau$link_vars_cssmodulejs))), 'spectrum-Link', {
|
|
51
|
+
'spectrum-Link--quiet': isQuiet,
|
|
52
|
+
[`spectrum-Link--${variant}`]: variant,
|
|
53
|
+
'is-hovered': isHovered
|
|
54
|
+
}, styleProps.className)
|
|
55
|
+
};
|
|
56
|
+
let link;
|
|
57
|
+
if (href) link = /*#__PURE__*/ (0, $35Vau$react).createElement("a", domProps, children);
|
|
58
|
+
else {
|
|
59
|
+
// Backward compatibility.
|
|
60
|
+
let wrappedChild = (0, $35Vau$getWrappedElement)(children);
|
|
61
|
+
let mergedRef = ref;
|
|
62
|
+
if ($3c5235ac12f2c9bb$var$isOldReact) // @ts-ignore
|
|
63
|
+
mergedRef = (0, $35Vau$mergeRefs)(ref, wrappedChild.ref);
|
|
64
|
+
else // @ts-ignore
|
|
65
|
+
mergedRef = (0, $35Vau$mergeRefs)(ref, wrappedChild.props.ref);
|
|
66
|
+
link = /*#__PURE__*/ (0, $35Vau$react).cloneElement(wrappedChild, {
|
|
67
|
+
...(0, $35Vau$mergeProps)(wrappedChild.props, domProps),
|
|
68
|
+
// @ts-ignore https://github.com/facebook/react/issues/8873
|
|
69
|
+
ref: mergedRef
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return /*#__PURE__*/ (0, $35Vau$react).createElement((0, $35Vau$FocusRing), {
|
|
73
|
+
focusRingClass: (0, $35Vau$classNames)((0, ($parcel$interopDefault($35Vau$link_vars_cssmodulejs))), 'focus-ring')
|
|
74
|
+
}, link);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
export {$3c5235ac12f2c9bb$export$a6c7ac8248d6e38a as Link};
|
|
79
|
+
//# sourceMappingURL=Link.module.js.map
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import "./vars.f73dc1cf.css";
|
|
2
|
+
import $35Vau$link_vars_cssmodulejs from "./link_vars_css.module.js";
|
|
3
|
+
import {useSlotProps as $35Vau$useSlotProps, useStyleProps as $35Vau$useStyleProps, classNames as $35Vau$classNames, getWrappedElement as $35Vau$getWrappedElement} from "@react-spectrum/utils";
|
|
4
|
+
import {FocusRing as $35Vau$FocusRing} from "@react-aria/focus";
|
|
5
|
+
import {mergeProps as $35Vau$mergeProps, mergeRefs as $35Vau$mergeRefs} from "@react-aria/utils";
|
|
6
|
+
import $35Vau$react, {useRef as $35Vau$useRef} from "react";
|
|
7
|
+
import {useHover as $35Vau$useHover} from "@react-aria/interactions";
|
|
8
|
+
import {useLink as $35Vau$useLink} from "@react-aria/link";
|
|
9
|
+
import {useProviderProps as $35Vau$useProviderProps} from "@react-spectrum/provider";
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
function $parcel$interopDefault(a) {
|
|
13
|
+
return a && a.__esModule ? a.default : a;
|
|
14
|
+
}
|
|
15
|
+
/*
|
|
16
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
17
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
19
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
22
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
23
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
24
|
+
* governing permissions and limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
let $3c5235ac12f2c9bb$var$isOldReact = parseInt((0, $35Vau$react).version, 10) <= 18;
|
|
34
|
+
function $3c5235ac12f2c9bb$export$a6c7ac8248d6e38a(props) {
|
|
35
|
+
props = (0, $35Vau$useProviderProps)(props);
|
|
36
|
+
props = (0, $35Vau$useSlotProps)(props, 'link');
|
|
37
|
+
let { variant: variant = 'primary', isQuiet: isQuiet, children: children, href: // @ts-ignore
|
|
38
|
+
href } = props;
|
|
39
|
+
let { styleProps: styleProps } = (0, $35Vau$useStyleProps)(props);
|
|
40
|
+
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $35Vau$useHover)({});
|
|
41
|
+
let ref = (0, $35Vau$useRef)(null);
|
|
42
|
+
let { linkProps: linkProps } = (0, $35Vau$useLink)({
|
|
43
|
+
...props,
|
|
44
|
+
elementType: !href && typeof children === 'string' ? 'span' : 'a'
|
|
45
|
+
}, ref);
|
|
46
|
+
let domProps = {
|
|
47
|
+
...styleProps,
|
|
48
|
+
...(0, $35Vau$mergeProps)(linkProps, hoverProps),
|
|
49
|
+
ref: ref,
|
|
50
|
+
className: (0, $35Vau$classNames)((0, ($parcel$interopDefault($35Vau$link_vars_cssmodulejs))), 'spectrum-Link', {
|
|
51
|
+
'spectrum-Link--quiet': isQuiet,
|
|
52
|
+
[`spectrum-Link--${variant}`]: variant,
|
|
53
|
+
'is-hovered': isHovered
|
|
54
|
+
}, styleProps.className)
|
|
55
|
+
};
|
|
56
|
+
let link;
|
|
57
|
+
if (href) link = /*#__PURE__*/ (0, $35Vau$react).createElement("a", domProps, children);
|
|
58
|
+
else {
|
|
59
|
+
// Backward compatibility.
|
|
60
|
+
let wrappedChild = (0, $35Vau$getWrappedElement)(children);
|
|
61
|
+
let mergedRef = ref;
|
|
62
|
+
if ($3c5235ac12f2c9bb$var$isOldReact) // @ts-ignore
|
|
63
|
+
mergedRef = (0, $35Vau$mergeRefs)(ref, wrappedChild.ref);
|
|
64
|
+
else // @ts-ignore
|
|
65
|
+
mergedRef = (0, $35Vau$mergeRefs)(ref, wrappedChild.props.ref);
|
|
66
|
+
link = /*#__PURE__*/ (0, $35Vau$react).cloneElement(wrappedChild, {
|
|
67
|
+
...(0, $35Vau$mergeProps)(wrappedChild.props, domProps),
|
|
68
|
+
// @ts-ignore https://github.com/facebook/react/issues/8873
|
|
69
|
+
ref: mergedRef
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
return /*#__PURE__*/ (0, $35Vau$react).createElement((0, $35Vau$FocusRing), {
|
|
73
|
+
focusRingClass: (0, $35Vau$classNames)((0, ($parcel$interopDefault($35Vau$link_vars_cssmodulejs))), 'focus-ring')
|
|
74
|
+
}, link);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
export {$3c5235ac12f2c9bb$export$a6c7ac8248d6e38a as Link};
|
|
79
|
+
//# sourceMappingURL=Link.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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,QAAQ,CAAC,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) {\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"}
|
package/dist/import.mjs
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {Link as $3c5235ac12f2c9bb$export$a6c7ac8248d6e38a} from "./Link.mjs";
|
|
2
|
+
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/ /// <reference types="css-module-types" />
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
export {$3c5235ac12f2c9bb$export$a6c7ac8248d6e38a as Link};
|
|
18
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
|
|
2
|
+
function $parcel$export(e, n, v, s) {
|
|
3
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
$parcel$export(module.exports, "focus-ring", () => $094ce2289235a9fa$export$f39a09f249340e2a, (v) => $094ce2289235a9fa$export$f39a09f249340e2a = v);
|
|
7
|
+
$parcel$export(module.exports, "i18nFontFamily", () => $094ce2289235a9fa$export$8c4ee2c50c22c514, (v) => $094ce2289235a9fa$export$8c4ee2c50c22c514 = v);
|
|
8
|
+
$parcel$export(module.exports, "is-disabled", () => $094ce2289235a9fa$export$d35bc1e505d1ebbf, (v) => $094ce2289235a9fa$export$d35bc1e505d1ebbf = v);
|
|
9
|
+
$parcel$export(module.exports, "is-hovered", () => $094ce2289235a9fa$export$b8813cd5d7824ce7, (v) => $094ce2289235a9fa$export$b8813cd5d7824ce7 = v);
|
|
10
|
+
$parcel$export(module.exports, "spectrum-FocusRing-ring", () => $094ce2289235a9fa$export$4109102f950813a6, (v) => $094ce2289235a9fa$export$4109102f950813a6 = v);
|
|
11
|
+
$parcel$export(module.exports, "spectrum-FocusRing", () => $094ce2289235a9fa$export$24c7f46a6e3605dd, (v) => $094ce2289235a9fa$export$24c7f46a6e3605dd = v);
|
|
12
|
+
$parcel$export(module.exports, "spectrum-FocusRing--quiet", () => $094ce2289235a9fa$export$2927016961429360, (v) => $094ce2289235a9fa$export$2927016961429360 = v);
|
|
13
|
+
$parcel$export(module.exports, "spectrum-Link", () => $094ce2289235a9fa$export$d85dd8b94975f388, (v) => $094ce2289235a9fa$export$d85dd8b94975f388 = v);
|
|
14
|
+
$parcel$export(module.exports, "spectrum-Link--overBackground", () => $094ce2289235a9fa$export$679b6267148797da, (v) => $094ce2289235a9fa$export$679b6267148797da = v);
|
|
15
|
+
$parcel$export(module.exports, "spectrum-Link--quiet", () => $094ce2289235a9fa$export$81921ea93435e997, (v) => $094ce2289235a9fa$export$81921ea93435e997 = v);
|
|
16
|
+
$parcel$export(module.exports, "spectrum-Link--secondary", () => $094ce2289235a9fa$export$ab09ed292dcb9a79, (v) => $094ce2289235a9fa$export$ab09ed292dcb9a79 = v);
|
|
17
|
+
var $094ce2289235a9fa$export$f39a09f249340e2a;
|
|
18
|
+
var $094ce2289235a9fa$export$8c4ee2c50c22c514;
|
|
19
|
+
var $094ce2289235a9fa$export$d35bc1e505d1ebbf;
|
|
20
|
+
var $094ce2289235a9fa$export$b8813cd5d7824ce7;
|
|
21
|
+
var $094ce2289235a9fa$export$4109102f950813a6;
|
|
22
|
+
var $094ce2289235a9fa$export$24c7f46a6e3605dd;
|
|
23
|
+
var $094ce2289235a9fa$export$2927016961429360;
|
|
24
|
+
var $094ce2289235a9fa$export$d85dd8b94975f388;
|
|
25
|
+
var $094ce2289235a9fa$export$679b6267148797da;
|
|
26
|
+
var $094ce2289235a9fa$export$81921ea93435e997;
|
|
27
|
+
var $094ce2289235a9fa$export$ab09ed292dcb9a79;
|
|
28
|
+
$094ce2289235a9fa$export$f39a09f249340e2a = `WBgRPa_focus-ring`;
|
|
29
|
+
$094ce2289235a9fa$export$8c4ee2c50c22c514 = `WBgRPa_i18nFontFamily`;
|
|
30
|
+
$094ce2289235a9fa$export$d35bc1e505d1ebbf = `WBgRPa_is-disabled`;
|
|
31
|
+
$094ce2289235a9fa$export$b8813cd5d7824ce7 = `WBgRPa_is-hovered`;
|
|
32
|
+
$094ce2289235a9fa$export$4109102f950813a6 = `WBgRPa_spectrum-FocusRing-ring`;
|
|
33
|
+
$094ce2289235a9fa$export$24c7f46a6e3605dd = `WBgRPa_spectrum-FocusRing ${$094ce2289235a9fa$export$4109102f950813a6}`;
|
|
34
|
+
$094ce2289235a9fa$export$2927016961429360 = `WBgRPa_spectrum-FocusRing--quiet`;
|
|
35
|
+
$094ce2289235a9fa$export$d85dd8b94975f388 = `WBgRPa_spectrum-Link`;
|
|
36
|
+
$094ce2289235a9fa$export$679b6267148797da = `WBgRPa_spectrum-Link--overBackground`;
|
|
37
|
+
$094ce2289235a9fa$export$81921ea93435e997 = `WBgRPa_spectrum-Link--quiet`;
|
|
38
|
+
$094ce2289235a9fa$export$ab09ed292dcb9a79 = `WBgRPa_spectrum-Link--secondary`;
|
|
39
|
+
|
|
40
|
+
|
|
41
|
+
//# sourceMappingURL=link_vars_css.main.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAVA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAkC,CAAC,oBAAoB,CAAC;AACxD,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA6C,CAAC,+BAA+B,CAAC","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_vars_css.main.js.map"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
function $parcel$export(e, n, v, s) {
|
|
3
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
4
|
+
}
|
|
5
|
+
var $4564c6c10d1690b3$exports = {};
|
|
6
|
+
|
|
7
|
+
$parcel$export($4564c6c10d1690b3$exports, "focus-ring", () => $4564c6c10d1690b3$export$f39a09f249340e2a, (v) => $4564c6c10d1690b3$export$f39a09f249340e2a = v);
|
|
8
|
+
$parcel$export($4564c6c10d1690b3$exports, "i18nFontFamily", () => $4564c6c10d1690b3$export$8c4ee2c50c22c514, (v) => $4564c6c10d1690b3$export$8c4ee2c50c22c514 = v);
|
|
9
|
+
$parcel$export($4564c6c10d1690b3$exports, "is-disabled", () => $4564c6c10d1690b3$export$d35bc1e505d1ebbf, (v) => $4564c6c10d1690b3$export$d35bc1e505d1ebbf = v);
|
|
10
|
+
$parcel$export($4564c6c10d1690b3$exports, "is-hovered", () => $4564c6c10d1690b3$export$b8813cd5d7824ce7, (v) => $4564c6c10d1690b3$export$b8813cd5d7824ce7 = v);
|
|
11
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-FocusRing-ring", () => $4564c6c10d1690b3$export$4109102f950813a6, (v) => $4564c6c10d1690b3$export$4109102f950813a6 = v);
|
|
12
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-FocusRing", () => $4564c6c10d1690b3$export$24c7f46a6e3605dd, (v) => $4564c6c10d1690b3$export$24c7f46a6e3605dd = v);
|
|
13
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-FocusRing--quiet", () => $4564c6c10d1690b3$export$2927016961429360, (v) => $4564c6c10d1690b3$export$2927016961429360 = v);
|
|
14
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-Link", () => $4564c6c10d1690b3$export$d85dd8b94975f388, (v) => $4564c6c10d1690b3$export$d85dd8b94975f388 = v);
|
|
15
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-Link--overBackground", () => $4564c6c10d1690b3$export$679b6267148797da, (v) => $4564c6c10d1690b3$export$679b6267148797da = v);
|
|
16
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-Link--quiet", () => $4564c6c10d1690b3$export$81921ea93435e997, (v) => $4564c6c10d1690b3$export$81921ea93435e997 = v);
|
|
17
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-Link--secondary", () => $4564c6c10d1690b3$export$ab09ed292dcb9a79, (v) => $4564c6c10d1690b3$export$ab09ed292dcb9a79 = v);
|
|
18
|
+
var $4564c6c10d1690b3$export$f39a09f249340e2a;
|
|
19
|
+
var $4564c6c10d1690b3$export$8c4ee2c50c22c514;
|
|
20
|
+
var $4564c6c10d1690b3$export$d35bc1e505d1ebbf;
|
|
21
|
+
var $4564c6c10d1690b3$export$b8813cd5d7824ce7;
|
|
22
|
+
var $4564c6c10d1690b3$export$4109102f950813a6;
|
|
23
|
+
var $4564c6c10d1690b3$export$24c7f46a6e3605dd;
|
|
24
|
+
var $4564c6c10d1690b3$export$2927016961429360;
|
|
25
|
+
var $4564c6c10d1690b3$export$d85dd8b94975f388;
|
|
26
|
+
var $4564c6c10d1690b3$export$679b6267148797da;
|
|
27
|
+
var $4564c6c10d1690b3$export$81921ea93435e997;
|
|
28
|
+
var $4564c6c10d1690b3$export$ab09ed292dcb9a79;
|
|
29
|
+
$4564c6c10d1690b3$export$f39a09f249340e2a = `WBgRPa_focus-ring`;
|
|
30
|
+
$4564c6c10d1690b3$export$8c4ee2c50c22c514 = `WBgRPa_i18nFontFamily`;
|
|
31
|
+
$4564c6c10d1690b3$export$d35bc1e505d1ebbf = `WBgRPa_is-disabled`;
|
|
32
|
+
$4564c6c10d1690b3$export$b8813cd5d7824ce7 = `WBgRPa_is-hovered`;
|
|
33
|
+
$4564c6c10d1690b3$export$4109102f950813a6 = `WBgRPa_spectrum-FocusRing-ring`;
|
|
34
|
+
$4564c6c10d1690b3$export$24c7f46a6e3605dd = `WBgRPa_spectrum-FocusRing ${$4564c6c10d1690b3$export$4109102f950813a6}`;
|
|
35
|
+
$4564c6c10d1690b3$export$2927016961429360 = `WBgRPa_spectrum-FocusRing--quiet`;
|
|
36
|
+
$4564c6c10d1690b3$export$d85dd8b94975f388 = `WBgRPa_spectrum-Link`;
|
|
37
|
+
$4564c6c10d1690b3$export$679b6267148797da = `WBgRPa_spectrum-Link--overBackground`;
|
|
38
|
+
$4564c6c10d1690b3$export$81921ea93435e997 = `WBgRPa_spectrum-Link--quiet`;
|
|
39
|
+
$4564c6c10d1690b3$export$ab09ed292dcb9a79 = `WBgRPa_spectrum-Link--secondary`;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export {$4564c6c10d1690b3$exports as default};
|
|
43
|
+
//# sourceMappingURL=link_vars_css.module.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
|
|
2
|
+
function $parcel$export(e, n, v, s) {
|
|
3
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
4
|
+
}
|
|
5
|
+
var $4564c6c10d1690b3$exports = {};
|
|
6
|
+
|
|
7
|
+
$parcel$export($4564c6c10d1690b3$exports, "focus-ring", () => $4564c6c10d1690b3$export$f39a09f249340e2a, (v) => $4564c6c10d1690b3$export$f39a09f249340e2a = v);
|
|
8
|
+
$parcel$export($4564c6c10d1690b3$exports, "i18nFontFamily", () => $4564c6c10d1690b3$export$8c4ee2c50c22c514, (v) => $4564c6c10d1690b3$export$8c4ee2c50c22c514 = v);
|
|
9
|
+
$parcel$export($4564c6c10d1690b3$exports, "is-disabled", () => $4564c6c10d1690b3$export$d35bc1e505d1ebbf, (v) => $4564c6c10d1690b3$export$d35bc1e505d1ebbf = v);
|
|
10
|
+
$parcel$export($4564c6c10d1690b3$exports, "is-hovered", () => $4564c6c10d1690b3$export$b8813cd5d7824ce7, (v) => $4564c6c10d1690b3$export$b8813cd5d7824ce7 = v);
|
|
11
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-FocusRing-ring", () => $4564c6c10d1690b3$export$4109102f950813a6, (v) => $4564c6c10d1690b3$export$4109102f950813a6 = v);
|
|
12
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-FocusRing", () => $4564c6c10d1690b3$export$24c7f46a6e3605dd, (v) => $4564c6c10d1690b3$export$24c7f46a6e3605dd = v);
|
|
13
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-FocusRing--quiet", () => $4564c6c10d1690b3$export$2927016961429360, (v) => $4564c6c10d1690b3$export$2927016961429360 = v);
|
|
14
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-Link", () => $4564c6c10d1690b3$export$d85dd8b94975f388, (v) => $4564c6c10d1690b3$export$d85dd8b94975f388 = v);
|
|
15
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-Link--overBackground", () => $4564c6c10d1690b3$export$679b6267148797da, (v) => $4564c6c10d1690b3$export$679b6267148797da = v);
|
|
16
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-Link--quiet", () => $4564c6c10d1690b3$export$81921ea93435e997, (v) => $4564c6c10d1690b3$export$81921ea93435e997 = v);
|
|
17
|
+
$parcel$export($4564c6c10d1690b3$exports, "spectrum-Link--secondary", () => $4564c6c10d1690b3$export$ab09ed292dcb9a79, (v) => $4564c6c10d1690b3$export$ab09ed292dcb9a79 = v);
|
|
18
|
+
var $4564c6c10d1690b3$export$f39a09f249340e2a;
|
|
19
|
+
var $4564c6c10d1690b3$export$8c4ee2c50c22c514;
|
|
20
|
+
var $4564c6c10d1690b3$export$d35bc1e505d1ebbf;
|
|
21
|
+
var $4564c6c10d1690b3$export$b8813cd5d7824ce7;
|
|
22
|
+
var $4564c6c10d1690b3$export$4109102f950813a6;
|
|
23
|
+
var $4564c6c10d1690b3$export$24c7f46a6e3605dd;
|
|
24
|
+
var $4564c6c10d1690b3$export$2927016961429360;
|
|
25
|
+
var $4564c6c10d1690b3$export$d85dd8b94975f388;
|
|
26
|
+
var $4564c6c10d1690b3$export$679b6267148797da;
|
|
27
|
+
var $4564c6c10d1690b3$export$81921ea93435e997;
|
|
28
|
+
var $4564c6c10d1690b3$export$ab09ed292dcb9a79;
|
|
29
|
+
$4564c6c10d1690b3$export$f39a09f249340e2a = `WBgRPa_focus-ring`;
|
|
30
|
+
$4564c6c10d1690b3$export$8c4ee2c50c22c514 = `WBgRPa_i18nFontFamily`;
|
|
31
|
+
$4564c6c10d1690b3$export$d35bc1e505d1ebbf = `WBgRPa_is-disabled`;
|
|
32
|
+
$4564c6c10d1690b3$export$b8813cd5d7824ce7 = `WBgRPa_is-hovered`;
|
|
33
|
+
$4564c6c10d1690b3$export$4109102f950813a6 = `WBgRPa_spectrum-FocusRing-ring`;
|
|
34
|
+
$4564c6c10d1690b3$export$24c7f46a6e3605dd = `WBgRPa_spectrum-FocusRing ${$4564c6c10d1690b3$export$4109102f950813a6}`;
|
|
35
|
+
$4564c6c10d1690b3$export$2927016961429360 = `WBgRPa_spectrum-FocusRing--quiet`;
|
|
36
|
+
$4564c6c10d1690b3$export$d85dd8b94975f388 = `WBgRPa_spectrum-Link`;
|
|
37
|
+
$4564c6c10d1690b3$export$679b6267148797da = `WBgRPa_spectrum-Link--overBackground`;
|
|
38
|
+
$4564c6c10d1690b3$export$81921ea93435e997 = `WBgRPa_spectrum-Link--quiet`;
|
|
39
|
+
$4564c6c10d1690b3$export$ab09ed292dcb9a79 = `WBgRPa_spectrum-Link--secondary`;
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
export {$4564c6c10d1690b3$exports as default};
|
|
43
|
+
//# sourceMappingURL=link_vars_css.module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AACA,IAAA;AAVA,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAAmC,CAAC,qBAAqB,CAAC;AAC1D,4CAAgC,CAAC,kBAAkB,CAAC;AACpD,4CAA+B,CAAC,iBAAiB,CAAC;AAClD,4CAA4C,CAAC,8BAA8B,CAAC;AAC5E,4CAAuC,CAAC,0BAA0B,EAAE,0CAA0C,CAAC;AAC/G,4CAA8C,CAAC,gCAAgC,CAAC;AAChF,4CAAkC,CAAC,oBAAoB,CAAC;AACxD,4CAAkD,CAAC,oCAAoC,CAAC;AACxF,4CAAyC,CAAC,2BAA2B,CAAC;AACtE,4CAA6C,CAAC,+BAA+B,CAAC","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_vars_css.module.js.map"}
|
package/dist/main.js
CHANGED
|
@@ -1,79 +1,23 @@
|
|
|
1
|
-
require("./main.
|
|
1
|
+
var $1148fb7fc40f1ce2$exports = require("./Link.main.js");
|
|
2
2
|
|
|
3
|
-
var _babelRuntimeHelpersDefineProperty = $parcel$interopDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
4
3
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var _babelRuntimeHelpersObjectWithoutProperties = $parcel$interopDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
8
|
-
|
|
9
|
-
var _temp = require("@react-spectrum/utils");
|
|
10
|
-
|
|
11
|
-
var classNames = _temp.classNames;
|
|
12
|
-
var filterDOMProps = _temp.filterDOMProps;
|
|
13
|
-
var getWrappedElement = _temp.getWrappedElement;
|
|
14
|
-
var useStyleProps = _temp.useStyleProps;
|
|
15
|
-
|
|
16
|
-
var FocusRing = require("@react-aria/focus").FocusRing;
|
|
17
|
-
|
|
18
|
-
var _react2 = require("react");
|
|
19
|
-
|
|
20
|
-
var _react = $parcel$interopDefault(_react2);
|
|
21
|
-
|
|
22
|
-
var useRef = _react2.useRef;
|
|
23
|
-
|
|
24
|
-
var useLink = require("@react-aria/link").useLink;
|
|
25
|
-
|
|
26
|
-
var useProviderProps = require("@react-spectrum/provider").useProviderProps;
|
|
27
|
-
|
|
28
|
-
function $parcel$interopDefault(a) {
|
|
29
|
-
return a && a.__esModule ? a.default : a;
|
|
4
|
+
function $parcel$export(e, n, v, s) {
|
|
5
|
+
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
30
6
|
}
|
|
31
7
|
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* Links allow users to navigate to a different location.
|
|
46
|
-
* They can be presented inline inside a paragraph or as standalone text.
|
|
47
|
-
*/
|
|
48
|
-
function Link(props) {
|
|
49
|
-
props = useProviderProps(props);
|
|
50
|
-
|
|
51
|
-
var _props = props,
|
|
52
|
-
_props$variant = _props.variant,
|
|
53
|
-
variant = _props$variant === void 0 ? 'primary' : _props$variant,
|
|
54
|
-
isQuiet = _props.isQuiet,
|
|
55
|
-
children = _props.children,
|
|
56
|
-
otherProps = _babelRuntimeHelpersObjectWithoutProperties(_props, ["variant", "isQuiet", "children"]);
|
|
8
|
+
$parcel$export(module.exports, "Link", () => $1148fb7fc40f1ce2$exports.Link);
|
|
9
|
+
/*
|
|
10
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
11
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
12
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
13
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
14
|
+
*
|
|
15
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
16
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
17
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
18
|
+
* governing permissions and limitations under the License.
|
|
19
|
+
*/ /// <reference types="css-module-types" />
|
|
57
20
|
|
|
58
|
-
var _useStyleProps = useStyleProps(props),
|
|
59
|
-
styleProps = _useStyleProps.styleProps;
|
|
60
21
|
|
|
61
|
-
var ref = useRef();
|
|
62
|
-
|
|
63
|
-
var _useLink = useLink(_babelRuntimeHelpersObjectSpread({}, props, {
|
|
64
|
-
ref: ref
|
|
65
|
-
})),
|
|
66
|
-
linkProps = _useLink.linkProps;
|
|
67
|
-
|
|
68
|
-
return (/*#__PURE__*/_react.createElement(FocusRing, {
|
|
69
|
-
focusRingClass: classNames($ae0157463d6ed7bafe441012f67222e9$$interop$default, 'focus-ring')
|
|
70
|
-
}, _react.cloneElement(getWrappedElement(children), _babelRuntimeHelpersObjectSpread({}, filterDOMProps(otherProps), {}, styleProps, {}, linkProps, {
|
|
71
|
-
ref: ref,
|
|
72
|
-
className: classNames($ae0157463d6ed7bafe441012f67222e9$$interop$default, 'spectrum-Link', _babelRuntimeHelpersDefineProperty({
|
|
73
|
-
'spectrum-Link--quiet': isQuiet
|
|
74
|
-
}, "spectrum-Link--".concat(variant), variant), styleProps.className)
|
|
75
|
-
})))
|
|
76
|
-
);
|
|
77
|
-
}
|
|
78
22
|
|
|
79
|
-
|
|
23
|
+
//# sourceMappingURL=main.js.map
|
package/dist/main.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/link/src/index.ts"],"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 {Link} from './Link';\nexport type {SpectrumLinkProps} from '@react-types/link';\n"],"names":[],"version":3,"file":"main.js.map"}
|
package/dist/module.js
CHANGED
|
@@ -1,59 +1,18 @@
|
|
|
1
|
-
import "./
|
|
2
|
-
import _babelRuntimeHelpersEsmObjectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
-
import _babelRuntimeHelpersEsmObjectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
4
|
-
import { classNames, filterDOMProps, getWrappedElement, useStyleProps } from "@react-spectrum/utils";
|
|
5
|
-
import { FocusRing } from "@react-aria/focus";
|
|
6
|
-
import _react, { useRef } from "react";
|
|
7
|
-
import { useLink } from "@react-aria/link";
|
|
8
|
-
import { useProviderProps } from "@react-spectrum/provider";
|
|
1
|
+
import {Link as $3c5235ac12f2c9bb$export$a6c7ac8248d6e38a} from "./Link.module.js";
|
|
9
2
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
3
|
+
/*
|
|
4
|
+
* Copyright 2020 Adobe. All rights reserved.
|
|
5
|
+
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
|
|
6
|
+
* you may not use this file except in compliance with the License. You may obtain a copy
|
|
7
|
+
* of the License at http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
*
|
|
9
|
+
* Unless required by applicable law or agreed to in writing, software distributed under
|
|
10
|
+
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
|
|
11
|
+
* OF ANY KIND, either express or implied. See the License for the specific language
|
|
12
|
+
* governing permissions and limitations under the License.
|
|
13
|
+
*/ /// <reference types="css-module-types" />
|
|
13
14
|
|
|
14
|
-
// ASSET: /Users/govett/dev/react-spectrum/node_modules/@adobe/spectrum-css-temp/components/link/vars.css
|
|
15
|
-
var $c349aaa31861ceaba7271209d01fd$exports = {};
|
|
16
|
-
$c349aaa31861ceaba7271209d01fd$exports = {
|
|
17
|
-
"spectrum-Link": "_spectrum-Link_c678e",
|
|
18
|
-
"focus-ring": "_focus-ring_c678e",
|
|
19
|
-
"is-disabled": "_is-disabled_c678e",
|
|
20
|
-
"spectrum-Link--secondary": "_spectrum-Link--secondary_c678e",
|
|
21
|
-
"spectrum-Link--overBackground": "_spectrum-Link--overBackground_c678e",
|
|
22
|
-
"spectrum-Link--quiet": "_spectrum-Link--quiet_c678e"
|
|
23
|
-
};
|
|
24
|
-
var $c349aaa31861ceaba7271209d01fd$$interop$default = $parcel$interopDefault($c349aaa31861ceaba7271209d01fd$exports);
|
|
25
15
|
|
|
26
|
-
/**
|
|
27
|
-
* Links allow users to navigate to a different location.
|
|
28
|
-
* They can be presented inline inside a paragraph or as standalone text.
|
|
29
|
-
*/
|
|
30
|
-
export function Link(props) {
|
|
31
|
-
props = useProviderProps(props);
|
|
32
16
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
isQuiet,
|
|
36
|
-
children
|
|
37
|
-
} = props,
|
|
38
|
-
otherProps = _babelRuntimeHelpersEsmObjectWithoutProperties(props, ["variant", "isQuiet", "children"]);
|
|
39
|
-
|
|
40
|
-
let {
|
|
41
|
-
styleProps
|
|
42
|
-
} = useStyleProps(props);
|
|
43
|
-
let ref = useRef();
|
|
44
|
-
let {
|
|
45
|
-
linkProps
|
|
46
|
-
} = useLink(_babelRuntimeHelpersEsmObjectSpread({}, props, {
|
|
47
|
-
ref
|
|
48
|
-
}));
|
|
49
|
-
return (/*#__PURE__*/_react.createElement(FocusRing, {
|
|
50
|
-
focusRingClass: classNames($c349aaa31861ceaba7271209d01fd$$interop$default, 'focus-ring')
|
|
51
|
-
}, _react.cloneElement(getWrappedElement(children), _babelRuntimeHelpersEsmObjectSpread({}, filterDOMProps(otherProps), {}, styleProps, {}, linkProps, {
|
|
52
|
-
ref,
|
|
53
|
-
className: classNames($c349aaa31861ceaba7271209d01fd$$interop$default, 'spectrum-Link', {
|
|
54
|
-
'spectrum-Link--quiet': isQuiet,
|
|
55
|
-
["spectrum-Link--".concat(variant)]: variant
|
|
56
|
-
}, styleProps.className)
|
|
57
|
-
})))
|
|
58
|
-
);
|
|
59
|
-
}
|
|
17
|
+
export {$3c5235ac12f2c9bb$export$a6c7ac8248d6e38a as Link};
|
|
18
|
+
//# sourceMappingURL=module.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":";;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C","sources":["packages/@react-spectrum/link/src/index.ts"],"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 {Link} from './Link';\nexport type {SpectrumLinkProps} from '@react-types/link';\n"],"names":[],"version":3,"file":"module.js.map"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
import { JSX } from "react";
|
|
1
2
|
import { SpectrumLinkProps } from "@react-types/link";
|
|
2
3
|
/**
|
|
3
4
|
* Links allow users to navigate to a different location.
|
|
4
5
|
* They can be presented inline inside a paragraph or as standalone text.
|
|
5
6
|
*/
|
|
6
7
|
export function Link(props: SpectrumLinkProps): JSX.Element;
|
|
8
|
+
export type { SpectrumLinkProps } from '@react-types/link';
|
|
7
9
|
|
|
8
10
|
//# sourceMappingURL=types.d.ts.map
|