@react-spectrum/link 3.6.1 → 3.6.3
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/import.mjs +5 -1
- package/dist/main.css +202 -1
- package/dist/main.css.map +1 -0
- package/dist/main.js +5 -1
- package/dist/main.js.map +1 -1
- package/dist/module.js +5 -1
- package/dist/module.js.map +1 -1
- package/dist/types.d.ts +2 -2
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/Link.tsx +2 -2
package/dist/import.mjs
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import "./main.css";
|
|
2
4
|
import {useSlotProps as $11MUV$useSlotProps, useStyleProps as $11MUV$useStyleProps, classNames as $11MUV$classNames, getWrappedElement as $11MUV$getWrappedElement} from "@react-spectrum/utils";
|
|
3
5
|
import {FocusRing as $11MUV$FocusRing} from "@react-aria/focus";
|
|
@@ -7,9 +9,11 @@ import {useHover as $11MUV$useHover} from "@react-aria/interactions";
|
|
|
7
9
|
import {useLink as $11MUV$useLink} from "@react-aria/link";
|
|
8
10
|
import {useProviderProps as $11MUV$useProviderProps} from "@react-spectrum/provider";
|
|
9
11
|
|
|
12
|
+
|
|
10
13
|
function $parcel$interopDefault(a) {
|
|
11
14
|
return a && a.__esModule ? a.default : a;
|
|
12
15
|
}
|
|
16
|
+
|
|
13
17
|
function $parcel$export(e, n, v, s) {
|
|
14
18
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
19
|
}
|
|
@@ -85,7 +89,7 @@ function $3c5235ac12f2c9bb$export$a6c7ac8248d6e38a(props) {
|
|
|
85
89
|
href } = props;
|
|
86
90
|
let { styleProps: styleProps } = (0, $11MUV$useStyleProps)(props);
|
|
87
91
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $11MUV$useHover)({});
|
|
88
|
-
let ref = (0, $11MUV$useRef)();
|
|
92
|
+
let ref = (0, $11MUV$useRef)(null);
|
|
89
93
|
let { linkProps: linkProps } = (0, $11MUV$useLink)({
|
|
90
94
|
...props,
|
|
91
95
|
elementType: !href && typeof children === "string" ? "span" : "a"
|
package/dist/main.css
CHANGED
|
@@ -1 +1,202 @@
|
|
|
1
|
-
.WBgRPa_i18nFontFamily
|
|
1
|
+
.WBgRPa_i18nFontFamily {
|
|
2
|
+
font-synthesis: weight;
|
|
3
|
+
font-family: adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
.WBgRPa_i18nFontFamily:lang(ar) {
|
|
7
|
+
font-family: myriad-arabic, adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.WBgRPa_i18nFontFamily:lang(he) {
|
|
11
|
+
font-family: myriad-hebrew, adobe-clean, Source Sans Pro, -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Ubuntu, Trebuchet MS, Lucida Grande, sans-serif;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.WBgRPa_i18nFontFamily:lang(zh) {
|
|
15
|
+
font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Heiti TC Light, sans-serif;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
.WBgRPa_i18nFontFamily:lang(zh-Hans) {
|
|
19
|
+
font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
.WBgRPa_i18nFontFamily:lang(zh-Hant) {
|
|
23
|
+
font-family: adobe-clean-han-traditional, source-han-traditional, MingLiu, Microsoft JhengHei UI, Microsoft JhengHei, Heiti TC Light, sans-serif;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.WBgRPa_i18nFontFamily:lang(zh-SG) {
|
|
27
|
+
font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.WBgRPa_i18nFontFamily:lang(zh-CN) {
|
|
31
|
+
font-family: adobe-clean-han-simplified-c, source-han-simplified-c, SimSun, Heiti SC Light, sans-serif;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.WBgRPa_i18nFontFamily:lang(ko) {
|
|
35
|
+
font-family: adobe-clean-han-korean, source-han-korean, Malgun Gothic, Apple Gothic, sans-serif;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.WBgRPa_i18nFontFamily:lang(ja) {
|
|
39
|
+
font-family: adobe-clean-han-japanese, Hiragino Kaku Gothic ProN, ヒラギノ角ゴ ProN W3, Osaka, YuGothic, Yu Gothic, メイリオ, Meiryo, MS Pゴシック, MS PGothic, sans-serif;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.WBgRPa_spectrum-FocusRing-ring {
|
|
43
|
+
--spectrum-focus-ring-border-radius: var(--spectrum-textfield-border-radius, var(--spectrum-alias-border-radius-regular));
|
|
44
|
+
--spectrum-focus-ring-gap: var(--spectrum-alias-input-focusring-gap);
|
|
45
|
+
--spectrum-focus-ring-size: var(--spectrum-alias-input-focusring-size);
|
|
46
|
+
--spectrum-focus-ring-border-size: 0px;
|
|
47
|
+
--spectrum-focus-ring-color: var(--spectrum-high-contrast-focus-ring-color, var(--spectrum-alias-focus-ring-color, var(--spectrum-alias-focus-color)));
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.WBgRPa_spectrum-FocusRing-ring:after {
|
|
51
|
+
border-radius: calc(var(--spectrum-focus-ring-border-radius) + var(--spectrum-focus-ring-gap));
|
|
52
|
+
content: "";
|
|
53
|
+
margin: calc(-1 * var(--spectrum-focus-ring-border-size));
|
|
54
|
+
pointer-events: none;
|
|
55
|
+
transition: box-shadow var(--spectrum-global-animation-duration-100, .13s) ease-out, margin var(--spectrum-global-animation-duration-100, .13s) ease-out;
|
|
56
|
+
display: block;
|
|
57
|
+
position: absolute;
|
|
58
|
+
top: 0;
|
|
59
|
+
bottom: 0;
|
|
60
|
+
left: 0;
|
|
61
|
+
right: 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.WBgRPa_spectrum-FocusRing {
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.WBgRPa_spectrum-FocusRing.WBgRPa_focus-ring:after {
|
|
68
|
+
margin: calc(var(--spectrum-focus-ring-gap) * -1 - var(--spectrum-focus-ring-border-size));
|
|
69
|
+
box-shadow: 0 0 0 var(--spectrum-focus-ring-size) var(--spectrum-focus-ring-color);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.WBgRPa_spectrum-FocusRing--quiet:after {
|
|
73
|
+
border-radius: 0;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.WBgRPa_spectrum-FocusRing--quiet.WBgRPa_focus-ring:after {
|
|
77
|
+
margin: 0 0 calc(var(--spectrum-focus-ring-gap) * -1 - var(--spectrum-focus-ring-border-size)) 0;
|
|
78
|
+
box-shadow: 0 var(--spectrum-focus-ring-size) 0 var(--spectrum-focus-ring-color);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.WBgRPa_spectrum-Link {
|
|
82
|
+
-webkit-text-decoration-skip: objects;
|
|
83
|
+
transition: color var(--spectrum-global-animation-duration-100, .13s) ease-in-out;
|
|
84
|
+
cursor: pointer;
|
|
85
|
+
background-color: #0000;
|
|
86
|
+
outline: none;
|
|
87
|
+
text-decoration: underline;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.WBgRPa_spectrum-Link.WBgRPa_is-hovered {
|
|
91
|
+
text-decoration: underline;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.WBgRPa_spectrum-Link.WBgRPa_focus-ring {
|
|
95
|
+
text-decoration: underline;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.WBgRPa_spectrum-Link.WBgRPa_focus-ring {
|
|
99
|
+
-webkit-text-decoration: underline double;
|
|
100
|
+
text-decoration: underline double;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.WBgRPa_spectrum-Link.WBgRPa_is-disabled {
|
|
104
|
+
cursor: default;
|
|
105
|
+
pointer-events: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.WBgRPa_spectrum-Link.WBgRPa_is-disabled.WBgRPa_is-hovered {
|
|
109
|
+
text-decoration: none;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.WBgRPa_spectrum-Link.WBgRPa_is-disabled:focus {
|
|
113
|
+
text-decoration: none;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
.WBgRPa_spectrum-Link--secondary, .WBgRPa_spectrum-Link--overBackground {
|
|
117
|
+
text-decoration: underline;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.WBgRPa_spectrum-Link--quiet {
|
|
121
|
+
text-decoration: none;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.WBgRPa_spectrum-Link {
|
|
125
|
+
--spectrum-link-text-color: var(--spectrum-accent-color-1000);
|
|
126
|
+
--spectrum-link-text-color-hover: var(--spectrum-accent-color-1000);
|
|
127
|
+
--spectrum-link-text-color-down: var(--spectrum-accent-color-1100);
|
|
128
|
+
--spectrum-link-text-color-key-focus: var(--spectrum-accent-color-1000);
|
|
129
|
+
color: var(--spectrum-link-text-color, var(--spectrum-global-color-blue-600));
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.WBgRPa_spectrum-Link.WBgRPa_is-hovered {
|
|
133
|
+
color: var(--spectrum-link-text-color-hover, var(--spectrum-global-color-blue-600));
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
.WBgRPa_spectrum-Link:active {
|
|
137
|
+
color: var(--spectrum-link-text-color-down, var(--spectrum-global-color-blue-700));
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
.WBgRPa_spectrum-Link.WBgRPa_focus-ring {
|
|
141
|
+
color: var(--spectrum-link-text-color-key-focus, var(--spectrum-alias-text-color-key-focus));
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.WBgRPa_spectrum-Link.WBgRPa_is-disabled {
|
|
145
|
+
color: var(--spectrum-link-text-color-disabled, var(--spectrum-alias-text-color-disabled));
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
.WBgRPa_spectrum-Link--secondary {
|
|
149
|
+
color: inherit;
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
.WBgRPa_spectrum-Link--secondary.WBgRPa_is-hovered {
|
|
153
|
+
color: inherit;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.WBgRPa_spectrum-Link--secondary:active {
|
|
157
|
+
color: inherit;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.WBgRPa_spectrum-Link--secondary:focus {
|
|
161
|
+
color: inherit;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
.WBgRPa_spectrum-Link--overBackground {
|
|
165
|
+
color: var(--spectrum-link-over-background-text-color, var(--spectrum-global-color-static-white));
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
.WBgRPa_spectrum-Link--overBackground.WBgRPa_is-hovered {
|
|
169
|
+
color: var(--spectrum-link-over-background-text-color-hover, var(--spectrum-global-color-static-white));
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
.WBgRPa_spectrum-Link--overBackground:active {
|
|
173
|
+
color: var(--spectrum-link-over-background-text-color-down, var(--spectrum-global-color-static-white));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
.WBgRPa_spectrum-Link--overBackground:focus {
|
|
177
|
+
color: var(--spectrum-link-over-background-text-color-key-focus, var(--spectrum-global-color-static-white));
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
.WBgRPa_spectrum-Link--overBackground.WBgRPa_is-disabled {
|
|
181
|
+
color: var(--spectrum-link-over-background-text-color-disabled, #ffffff80);
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
@media (forced-colors: active) {
|
|
185
|
+
.WBgRPa_spectrum-Link {
|
|
186
|
+
color: LinkText;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.WBgRPa_spectrum-Link.WBgRPa_is-hovered {
|
|
190
|
+
color: LinkText;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
.WBgRPa_spectrum-Link:active {
|
|
194
|
+
color: LinkText;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.WBgRPa_spectrum-Link:focus {
|
|
198
|
+
color: LinkText;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
/*# sourceMappingURL=main.css.map */
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"mappings":"AA4DA;;;;;AAIE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;;;;;AAOE;;;;;;;;;;;;;;AAiBF;;;AAII;;;;;AAQF;;;;AAKE;;;;;AAOJ;;;;;;;;;AAUE;;;;AAIA;;;;AAIA;;;;;AAKA;;;;;AAIE;;;;AAAA;;;;AAOJ;;;;AAQA;;;;AAgBA;;;;;;;;AAQE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;;;;AAGE;;;;AAIA;;;;AAIA;;;;AAKF;;;;AAGE;;;;AAIA;;;;AAIA;;;;AAIA;;;;AAKF;EACE;;;;EAGE;;;;EAIA;;;;EAIA","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":"main.css.map"}
|
package/dist/main.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
require("./main.css");
|
|
2
4
|
var $fo5qX$reactspectrumutils = require("@react-spectrum/utils");
|
|
3
5
|
var $fo5qX$reactariafocus = require("@react-aria/focus");
|
|
@@ -7,9 +9,11 @@ var $fo5qX$reactariainteractions = require("@react-aria/interactions");
|
|
|
7
9
|
var $fo5qX$reactarialink = require("@react-aria/link");
|
|
8
10
|
var $fo5qX$reactspectrumprovider = require("@react-spectrum/provider");
|
|
9
11
|
|
|
12
|
+
|
|
10
13
|
function $parcel$export(e, n, v, s) {
|
|
11
14
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
12
15
|
}
|
|
16
|
+
|
|
13
17
|
function $parcel$interopDefault(a) {
|
|
14
18
|
return a && a.__esModule ? a.default : a;
|
|
15
19
|
}
|
|
@@ -87,7 +91,7 @@ function $1148fb7fc40f1ce2$export$a6c7ac8248d6e38a(props) {
|
|
|
87
91
|
href } = props;
|
|
88
92
|
let { styleProps: styleProps } = (0, $fo5qX$reactspectrumutils.useStyleProps)(props);
|
|
89
93
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $fo5qX$reactariainteractions.useHover)({});
|
|
90
|
-
let ref = (0, $fo5qX$react.useRef)();
|
|
94
|
+
let ref = (0, $fo5qX$react.useRef)(null);
|
|
91
95
|
let { linkProps: linkProps } = (0, $fo5qX$reactarialink.useLink)({
|
|
92
96
|
...props,
|
|
93
97
|
elementType: !href && typeof children === "string" ? "span" : "a"
|
package/dist/main.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;ACVD,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;;;;;;ADgBvE,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,gEAAK,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,qBAAO,CAAA,GAAA,sCAAI,EAAE,YAAY,CAAC,cAAc;YACtC,GAAG,CAAA,GAAA,gCAAS,EAAE,aAAa,KAAK,EAAE,SAAS;YAC3C,2DAA2D;YAC3D,KAAK,aAAa,GAAG,GAAG,CAAA,GAAA,+BAAQ,EAAE,KAAK,aAAa,GAAG,IAAI;QAC7D;IACF;IAGA,qBACE,0DAAC,CAAA,GAAA,+BAAQ;QAAE,gBAAgB,CAAA,GAAA,oCAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;OAC3C;AAGP;","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 {Link} from './Link';\nexport type {SpectrumLinkProps} from '@react-types/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, mergeRefs} from '@react-aria/utils';\nimport React, {JSX, 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 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 link = React.cloneElement(wrappedChild, {\n ...mergeProps(wrappedChild.props, domProps),\n // @ts-ignore https://github.com/facebook/react/issues/8873\n ref: wrappedChild.ref ? mergeRefs(ref, wrappedChild.ref) : ref\n });\n }\n\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {link}\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,3 +1,5 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
|
|
1
3
|
import "./main.css";
|
|
2
4
|
import {useSlotProps as $11MUV$useSlotProps, useStyleProps as $11MUV$useStyleProps, classNames as $11MUV$classNames, getWrappedElement as $11MUV$getWrappedElement} from "@react-spectrum/utils";
|
|
3
5
|
import {FocusRing as $11MUV$FocusRing} from "@react-aria/focus";
|
|
@@ -7,9 +9,11 @@ import {useHover as $11MUV$useHover} from "@react-aria/interactions";
|
|
|
7
9
|
import {useLink as $11MUV$useLink} from "@react-aria/link";
|
|
8
10
|
import {useProviderProps as $11MUV$useProviderProps} from "@react-spectrum/provider";
|
|
9
11
|
|
|
12
|
+
|
|
10
13
|
function $parcel$interopDefault(a) {
|
|
11
14
|
return a && a.__esModule ? a.default : a;
|
|
12
15
|
}
|
|
16
|
+
|
|
13
17
|
function $parcel$export(e, n, v, s) {
|
|
14
18
|
Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});
|
|
15
19
|
}
|
|
@@ -85,7 +89,7 @@ function $3c5235ac12f2c9bb$export$a6c7ac8248d6e38a(props) {
|
|
|
85
89
|
href } = props;
|
|
86
90
|
let { styleProps: styleProps } = (0, $11MUV$useStyleProps)(props);
|
|
87
91
|
let { hoverProps: hoverProps, isHovered: isHovered } = (0, $11MUV$useHover)({});
|
|
88
|
-
let ref = (0, $11MUV$useRef)();
|
|
92
|
+
let ref = (0, $11MUV$useRef)(null);
|
|
89
93
|
let { linkProps: linkProps } = (0, $11MUV$useLink)({
|
|
90
94
|
...props,
|
|
91
95
|
elementType: !href && typeof children === "string" ? "span" : "a"
|
package/dist/module.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":"
|
|
1
|
+
{"mappings":";;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;CAUC,GAED,0CAA0C;ACZ1C;;;;;;;;;;CAUC;;;;;;;;;;;;;;;;;ACVD,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;;;;;;ADgBvE,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,gEAAK,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,qBAAO,CAAA,GAAA,YAAI,EAAE,YAAY,CAAC,cAAc;YACtC,GAAG,CAAA,GAAA,iBAAS,EAAE,aAAa,KAAK,EAAE,SAAS;YAC3C,2DAA2D;YAC3D,KAAK,aAAa,GAAG,GAAG,CAAA,GAAA,gBAAQ,EAAE,KAAK,aAAa,GAAG,IAAI;QAC7D;IACF;IAGA,qBACE,gCAAC,CAAA,GAAA,gBAAQ;QAAE,gBAAgB,CAAA,GAAA,iBAAS,EAAE,CAAA,GAAA,gEAAK,GAAG;OAC3C;AAGP;","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 {Link} from './Link';\nexport type {SpectrumLinkProps} from '@react-types/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, mergeRefs} from '@react-aria/utils';\nimport React, {JSX, 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 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 link = React.cloneElement(wrappedChild, {\n ...mergeProps(wrappedChild.props, domProps),\n // @ts-ignore https://github.com/facebook/react/issues/8873\n ref: wrappedChild.ref ? mergeRefs(ref, wrappedChild.ref) : ref\n });\n }\n\n\n return (\n <FocusRing focusRingClass={classNames(styles, 'focus-ring')}>\n {link}\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"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { JSX } from "react";
|
|
2
2
|
import { SpectrumLinkProps } from "@react-types/link";
|
|
3
3
|
/**
|
|
4
4
|
* Links allow users to navigate to a different location.
|
|
5
5
|
* They can be presented inline inside a paragraph or as standalone text.
|
|
6
6
|
*/
|
|
7
|
-
export function Link(props: SpectrumLinkProps):
|
|
7
|
+
export function Link(props: SpectrumLinkProps): JSX.Element;
|
|
8
8
|
export type { SpectrumLinkProps } from '@react-types/link';
|
|
9
9
|
|
|
10
10
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"mappings":";;AAsBA;;;GAGG;AACH,qBAAqB,KAAK,EAAE,iBAAiB,
|
|
1
|
+
{"mappings":";;AAsBA;;;GAGG;AACH,qBAAqB,KAAK,EAAE,iBAAiB,eAsD5C;ACjED,YAAY,EAAC,iBAAiB,EAAC,MAAM,mBAAmB,CAAC","sources":["packages/@react-spectrum/link/src/packages/@react-spectrum/link/src/Link.tsx","packages/@react-spectrum/link/src/packages/@react-spectrum/link/src/index.ts","packages/@react-spectrum/link/src/index.ts"],"sourcesContent":[null,null,"/*\n * Copyright 2020 Adobe. All rights reserved.\n * This file is licensed to you under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License. You may obtain a copy\n * of the License at http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software distributed under\n * the License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\n * OF ANY KIND, either express or implied. See the License for the specific language\n * governing permissions and limitations under the License.\n */\n\n/// <reference types=\"css-module-types\" />\n\nexport {Link} from './Link';\nexport type {SpectrumLinkProps} from '@react-types/link';\n"],"names":[],"version":3,"file":"types.d.ts.map"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@react-spectrum/link",
|
|
3
|
-
"version": "3.6.
|
|
3
|
+
"version": "3.6.3",
|
|
4
4
|
"description": "Spectrum UI components in React",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/main.js",
|
|
@@ -36,12 +36,12 @@
|
|
|
36
36
|
"url": "https://github.com/adobe/react-spectrum"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@react-aria/focus": "^3.
|
|
40
|
-
"@react-aria/interactions": "^3.
|
|
41
|
-
"@react-aria/link": "^3.6.
|
|
42
|
-
"@react-aria/utils": "^3.
|
|
43
|
-
"@react-spectrum/utils": "^3.11.
|
|
44
|
-
"@react-types/link": "^3.5.
|
|
39
|
+
"@react-aria/focus": "^3.16.0",
|
|
40
|
+
"@react-aria/interactions": "^3.20.1",
|
|
41
|
+
"@react-aria/link": "^3.6.3",
|
|
42
|
+
"@react-aria/utils": "^3.23.0",
|
|
43
|
+
"@react-spectrum/utils": "^3.11.3",
|
|
44
|
+
"@react-types/link": "^3.5.2",
|
|
45
45
|
"@swc/helpers": "^0.5.0"
|
|
46
46
|
},
|
|
47
47
|
"devDependencies": {
|
|
@@ -54,5 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "86b38c87868ce7f262e0df905e5ac4eb2653791d"
|
|
58
58
|
}
|
package/src/Link.tsx
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import {classNames, getWrappedElement, useSlotProps, useStyleProps} from '@react-spectrum/utils';
|
|
14
14
|
import {FocusRing} from '@react-aria/focus';
|
|
15
15
|
import {mergeProps, mergeRefs} from '@react-aria/utils';
|
|
16
|
-
import React, {useRef} from 'react';
|
|
16
|
+
import React, {JSX, useRef} from 'react';
|
|
17
17
|
import {SpectrumLinkProps} from '@react-types/link';
|
|
18
18
|
import styles from '@adobe/spectrum-css-temp/components/link/vars.css';
|
|
19
19
|
import {useHover} from '@react-aria/interactions';
|
|
@@ -37,7 +37,7 @@ export function Link(props: SpectrumLinkProps) {
|
|
|
37
37
|
let {styleProps} = useStyleProps(props);
|
|
38
38
|
let {hoverProps, isHovered} = useHover({});
|
|
39
39
|
|
|
40
|
-
let ref = useRef();
|
|
40
|
+
let ref = useRef(null);
|
|
41
41
|
let {linkProps} = useLink({
|
|
42
42
|
...props,
|
|
43
43
|
elementType: !href && typeof children === 'string' ? 'span' : 'a'
|