@purpurds/link 7.14.0 → 8.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/link.cjs.js +2 -2
- package/dist/link.es.js +51 -51
- package/dist/styles.css +1 -1
- package/package.json +5 -5
- package/src/link.module.scss +5 -5
- package/src/link.stories.tsx +0 -20
package/dist/link.cjs.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("react/jsx-runtime");function b(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var o={exports:{}};/*!
|
|
2
2
|
Copyright (c) 2018 Jed Watson.
|
|
3
3
|
Licensed under the MIT License (MIT), see
|
|
4
4
|
http://jedwatson.github.io/classnames
|
|
5
|
-
*/var
|
|
5
|
+
*/var f;function N(){return f||(f=1,function(n){(function(){var u={}.hasOwnProperty;function i(){for(var t="",r=0;r<arguments.length;r++){var e=arguments[r];e&&(t=s(t,p.call(this,e)))}return t}function p(t){if(typeof t=="string"||typeof t=="number")return this&&this[t]||t;if(typeof t!="object")return"";if(Array.isArray(t))return i.apply(this,t);if(t.toString!==Object.prototype.toString&&!t.toString.toString().includes("[native code]"))return t.toString();var r="";for(var e in t)u.call(t,e)&&t[e]&&(r=s(r,this&&this[e]||e));return r}function s(t,r){return r?t?t+" "+r:t+r:t}n.exports?(i.default=i,n.exports=i):window.classNames=i})()}(o)),o.exports}var x=N();const y=b(x),A={"purpur-link":"_purpur-link_5pram_1","purpur-link--text":"_purpur-link--text_5pram_18","purpur-link--standalone":"_purpur-link--standalone_5pram_18","purpur-link--navigation":"_purpur-link--navigation_5pram_18","purpur-link--disable-visited":"_purpur-link--disable-visited_5pram_29","purpur-link--text-negative":"_purpur-link--text-negative_5pram_32","purpur-link--standalone-negative":"_purpur-link--standalone-negative_5pram_32","purpur-link--navigation-negative":"_purpur-link--navigation-negative_5pram_32","purpur-link--ensure-target-area":"_purpur-link--ensure-target-area_5pram_71","purpur-link--silent":"_purpur-link--silent_5pram_77"},j=y.bind(A),a="purpur-link",v={TEXT:"text",STANDALONE:"standalone",NAVIGATION:"navigation"},O=Object.values(v),k=({["data-testid"]:n,children:u,className:i,disableVisited:p=!0,ensureTargetArea:s,href:t,negative:r=!1,onClick:e,rel:m,silent:l,target:g,variant:_,...c})=>d.jsx("span",{className:j(i,a,`${a}--${r?`${_}-negative`:_}`,{[`${a}--silent`]:l,[`${a}--negative`]:r,[`${a}--disable-visited`]:p??l,[`${a}--ensure-target-area`]:s}),"data-testid":n,onClick:t?void 0:e,...t?{}:c,children:t?d.jsx("a",{href:t,target:g,rel:m,onClick:e,"data-testid":n?`${n} a`:void 0,...c,children:u}):u});k.displayName="Link";exports.LINK_VARIANT=v;exports.Link=k;exports.linkVariants=O;
|
|
6
6
|
//# sourceMappingURL=link.cjs.js.map
|
package/dist/link.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
function
|
|
3
|
-
return
|
|
1
|
+
import { jsx as d } from "react/jsx-runtime";
|
|
2
|
+
function m(n) {
|
|
3
|
+
return n && n.__esModule && Object.prototype.hasOwnProperty.call(n, "default") ? n.default : n;
|
|
4
4
|
}
|
|
5
5
|
var o = { exports: {} };
|
|
6
6
|
/*!
|
|
@@ -8,19 +8,19 @@ var o = { exports: {} };
|
|
|
8
8
|
Licensed under the MIT License (MIT), see
|
|
9
9
|
http://jedwatson.github.io/classnames
|
|
10
10
|
*/
|
|
11
|
-
var
|
|
12
|
-
function
|
|
13
|
-
return
|
|
11
|
+
var f;
|
|
12
|
+
function g() {
|
|
13
|
+
return f || (f = 1, function(n) {
|
|
14
14
|
(function() {
|
|
15
|
-
var
|
|
15
|
+
var p = {}.hasOwnProperty;
|
|
16
16
|
function i() {
|
|
17
|
-
for (var t = "",
|
|
18
|
-
var e = arguments[
|
|
19
|
-
e && (t =
|
|
17
|
+
for (var t = "", r = 0; r < arguments.length; r++) {
|
|
18
|
+
var e = arguments[r];
|
|
19
|
+
e && (t = u(t, s.call(this, e)));
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function s(t) {
|
|
24
24
|
if (typeof t == "string" || typeof t == "number")
|
|
25
25
|
return this && this[t] || t;
|
|
26
26
|
if (typeof t != "object")
|
|
@@ -29,79 +29,79 @@ function b() {
|
|
|
29
29
|
return i.apply(this, t);
|
|
30
30
|
if (t.toString !== Object.prototype.toString && !t.toString.toString().includes("[native code]"))
|
|
31
31
|
return t.toString();
|
|
32
|
-
var
|
|
32
|
+
var r = "";
|
|
33
33
|
for (var e in t)
|
|
34
|
-
|
|
35
|
-
return
|
|
34
|
+
p.call(t, e) && t[e] && (r = u(r, this && this[e] || e));
|
|
35
|
+
return r;
|
|
36
36
|
}
|
|
37
|
-
function
|
|
38
|
-
return
|
|
37
|
+
function u(t, r) {
|
|
38
|
+
return r ? t ? t + " " + r : t + r : t;
|
|
39
39
|
}
|
|
40
|
-
|
|
40
|
+
n.exports ? (i.default = i, n.exports = i) : window.classNames = i;
|
|
41
41
|
})();
|
|
42
42
|
}(o)), o.exports;
|
|
43
43
|
}
|
|
44
|
-
var
|
|
45
|
-
const
|
|
46
|
-
"purpur-link": "_purpur-
|
|
47
|
-
"purpur-link--text": "_purpur-link--
|
|
48
|
-
"purpur-link--standalone": "_purpur-link--
|
|
49
|
-
"purpur-link--navigation": "_purpur-link--
|
|
50
|
-
"purpur-link--disable-visited": "_purpur-link--disable-
|
|
51
|
-
"purpur-link--text-negative": "_purpur-link--text-
|
|
52
|
-
"purpur-link--standalone-negative": "_purpur-link--standalone-
|
|
53
|
-
"purpur-link--navigation-negative": "_purpur-link--navigation-
|
|
54
|
-
"purpur-link--ensure-target-area": "_purpur-link--ensure-target-
|
|
55
|
-
"purpur-link--silent": "_purpur-link--
|
|
56
|
-
}, y =
|
|
44
|
+
var b = g();
|
|
45
|
+
const x = /* @__PURE__ */ m(b), N = {
|
|
46
|
+
"purpur-link": "_purpur-link_5pram_1",
|
|
47
|
+
"purpur-link--text": "_purpur-link--text_5pram_18",
|
|
48
|
+
"purpur-link--standalone": "_purpur-link--standalone_5pram_18",
|
|
49
|
+
"purpur-link--navigation": "_purpur-link--navigation_5pram_18",
|
|
50
|
+
"purpur-link--disable-visited": "_purpur-link--disable-visited_5pram_29",
|
|
51
|
+
"purpur-link--text-negative": "_purpur-link--text-negative_5pram_32",
|
|
52
|
+
"purpur-link--standalone-negative": "_purpur-link--standalone-negative_5pram_32",
|
|
53
|
+
"purpur-link--navigation-negative": "_purpur-link--navigation-negative_5pram_32",
|
|
54
|
+
"purpur-link--ensure-target-area": "_purpur-link--ensure-target-area_5pram_71",
|
|
55
|
+
"purpur-link--silent": "_purpur-link--silent_5pram_77"
|
|
56
|
+
}, y = x.bind(N), a = "purpur-link", h = {
|
|
57
57
|
TEXT: "text",
|
|
58
58
|
STANDALONE: "standalone",
|
|
59
59
|
NAVIGATION: "navigation"
|
|
60
60
|
}, $ = Object.values(h), A = ({
|
|
61
|
-
["data-testid"]:
|
|
62
|
-
children:
|
|
61
|
+
["data-testid"]: n,
|
|
62
|
+
children: p,
|
|
63
63
|
className: i,
|
|
64
|
-
disableVisited:
|
|
65
|
-
ensureTargetArea:
|
|
64
|
+
disableVisited: s = !0,
|
|
65
|
+
ensureTargetArea: u,
|
|
66
66
|
href: t,
|
|
67
|
-
negative:
|
|
67
|
+
negative: r = !1,
|
|
68
68
|
onClick: e,
|
|
69
69
|
rel: v,
|
|
70
70
|
silent: l,
|
|
71
71
|
target: k,
|
|
72
|
-
variant:
|
|
73
|
-
...
|
|
72
|
+
variant: _,
|
|
73
|
+
...c
|
|
74
74
|
}) => (
|
|
75
75
|
/* eslint-disable-next-line jsx-a11y/click-events-have-key-events */
|
|
76
|
-
/* @__PURE__ */
|
|
76
|
+
/* @__PURE__ */ d(
|
|
77
77
|
"span",
|
|
78
78
|
{
|
|
79
79
|
className: y(
|
|
80
80
|
i,
|
|
81
|
-
|
|
82
|
-
`${
|
|
81
|
+
a,
|
|
82
|
+
`${a}--${r ? `${_}-negative` : _}`,
|
|
83
83
|
{
|
|
84
|
-
[`${
|
|
85
|
-
[`${
|
|
86
|
-
[`${
|
|
87
|
-
[`${
|
|
84
|
+
[`${a}--silent`]: l,
|
|
85
|
+
[`${a}--negative`]: r,
|
|
86
|
+
[`${a}--disable-visited`]: s ?? l,
|
|
87
|
+
[`${a}--ensure-target-area`]: u
|
|
88
88
|
}
|
|
89
89
|
),
|
|
90
|
-
"data-testid":
|
|
90
|
+
"data-testid": n,
|
|
91
91
|
onClick: t ? void 0 : e,
|
|
92
|
-
...t ? {} :
|
|
93
|
-
children: t ? /* @__PURE__ */
|
|
92
|
+
...t ? {} : c,
|
|
93
|
+
children: t ? /* @__PURE__ */ d(
|
|
94
94
|
"a",
|
|
95
95
|
{
|
|
96
96
|
href: t,
|
|
97
97
|
target: k,
|
|
98
98
|
rel: v,
|
|
99
99
|
onClick: e,
|
|
100
|
-
"data-testid":
|
|
101
|
-
...
|
|
102
|
-
children:
|
|
100
|
+
"data-testid": n ? `${n} a` : void 0,
|
|
101
|
+
...c,
|
|
102
|
+
children: p
|
|
103
103
|
}
|
|
104
|
-
) :
|
|
104
|
+
) : p
|
|
105
105
|
}
|
|
106
106
|
)
|
|
107
107
|
);
|
package/dist/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
._purpur-
|
|
1
|
+
._purpur-link_5pram_1{font-family:var(--purpur-typography-family-default)}._purpur-link_5pram_1 a{align-items:center;cursor:pointer;display:inline-flex;gap:var(--purpur-spacing-50);text-decoration:underline}._purpur-link_5pram_1 a:focus,._purpur-link_5pram_1 a:active{outline:solid var(--purpur-border-width-sm) var(--purpur-color-border-interactive-focus);outline-offset:var(--purpur-spacing-25)}._purpur-link_5pram_1 a:focus:not(:focus-visible){outline:0}._purpur-link--text_5pram_18 a,._purpur-link--standalone_5pram_18 a,._purpur-link--navigation_5pram_18 a{color:var(--purpur-color-text-interactive-primary)}._purpur-link--text_5pram_18 a:hover,._purpur-link--standalone_5pram_18 a:hover,._purpur-link--navigation_5pram_18 a:hover{color:var(--purpur-color-text-interactive-primary-hover);background-color:var(--purpur-color-background-interactive-transparent-hover)}._purpur-link--text_5pram_18 a:active,._purpur-link--standalone_5pram_18 a:active,._purpur-link--navigation_5pram_18 a:active{color:var(--purpur-color-text-interactive-primary-active);background-color:var(--purpur-color-background-interactive-transparent-active)}._purpur-link--text_5pram_18 a:visited:not(._purpur-link--disable-visited_5pram_29>a),._purpur-link--standalone_5pram_18 a:visited:not(._purpur-link--disable-visited_5pram_29>a),._purpur-link--navigation_5pram_18 a:visited:not(._purpur-link--disable-visited_5pram_29>a){color:var(--purpur-color-text-interactive-primary-active)}._purpur-link--text-negative_5pram_32 a,._purpur-link--standalone-negative_5pram_32 a,._purpur-link--navigation-negative_5pram_32 a{color:var(--purpur-color-text-interactive-primary-negative)}._purpur-link--text-negative_5pram_32 a:hover,._purpur-link--standalone-negative_5pram_32 a:hover,._purpur-link--navigation-negative_5pram_32 a:hover{background-color:var(--purpur-color-background-interactive-transparent-hover-negative);color:var(--purpur-color-text-interactive-primary-hover-negative)}._purpur-link--text-negative_5pram_32 a:active,._purpur-link--standalone-negative_5pram_32 a:active,._purpur-link--navigation-negative_5pram_32 a:active{background-color:var(--purpur-color-background-interactive-transparent-active-negative);color:var(--purpur-color-text-interactive-primary-active-negative)}._purpur-link--text-negative_5pram_32 a:visited:not(._purpur-link--disable-visited_5pram_29>a),._purpur-link--standalone-negative_5pram_32 a:visited:not(._purpur-link--disable-visited_5pram_29>a),._purpur-link--navigation-negative_5pram_32 a:visited:not(._purpur-link--disable-visited_5pram_29>a){color:var(--purpur-color-text-interactive-primary-active-negative)}._purpur-link--standalone_5pram_18,._purpur-link--standalone-negative_5pram_32{display:inline-block}._purpur-link--standalone_5pram_18 a,._purpur-link--standalone-negative_5pram_32 a{font-family:var(--purpur-typography-family-default);font-weight:var(--purpur-typography-weight-normal);font-size:var(--purpur-typography-scale-100);line-height:var(--purpur-typography-line-height-loose);padding:var(--purpur-spacing-100) 0}._purpur-link--navigation_5pram_18 a,._purpur-link--navigation-negative_5pram_32 a{font-family:var(--purpur-typography-family-default);font-weight:var(--purpur-typography-weight-normal);font-size:var(--purpur-typography-scale-100);line-height:var(--purpur-typography-line-height-loose);align-items:center;background-color:var(--purpur-color-functional-transparent);display:flex;font-weight:var(--purpur-typography-weight-medium);text-decoration:none}._purpur-link--navigation_5pram_18 a:active,._purpur-link--navigation_5pram_18 a:hover,._purpur-link--navigation-negative_5pram_32 a:active,._purpur-link--navigation-negative_5pram_32 a:hover{background-color:var(--purpur-color-functional-transparent);text-decoration:underline}._purpur-link--ensure-target-area_5pram_71,._purpur-link--ensure-target-area_5pram_71 a{align-items:center;display:flex;min-height:var(--purpur-spacing-600);min-width:var(--purpur-spacing-600)}._purpur-link--silent_5pram_77 a{background-color:inherit;color:inherit;height:100%;text-decoration:none}._purpur-link--silent_5pram_77 a:hover,._purpur-link--silent_5pram_77 a:focus,._purpur-link--silent_5pram_77 a:active{background-color:inherit;color:inherit}._purpur-link--silent_5pram_77 a:focus{outline:0}._purpur-link--silent_5pram_77:is(._purpur-link--disable-visited_5pram_29) a:visited{color:inherit}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@purpurds/link",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"main": "./dist/link.cjs.js",
|
|
6
6
|
"types": "./dist/link.d.ts",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"source": "src/link.tsx",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"classnames": "~2.5.0",
|
|
19
|
-
"@purpurds/
|
|
20
|
-
"@purpurds/
|
|
21
|
-
"@purpurds/
|
|
19
|
+
"@purpurds/paragraph": "8.0.0",
|
|
20
|
+
"@purpurds/common-types": "8.0.0",
|
|
21
|
+
"@purpurds/tokens": "8.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"@storybook/react-vite": "^9.0.18",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"vite": "^6.2.1",
|
|
40
40
|
"vitest": "^3.1.2",
|
|
41
41
|
"@purpurds/component-rig": "1.0.0",
|
|
42
|
-
"@purpurds/icon": "
|
|
42
|
+
"@purpurds/icon": "8.0.0"
|
|
43
43
|
},
|
|
44
44
|
"peerDependencies": {
|
|
45
45
|
"@types/react": "^18 || ^19",
|
package/src/link.module.scss
CHANGED
|
@@ -52,17 +52,17 @@
|
|
|
52
52
|
color: var(--purpur-color-text-interactive-primary-negative);
|
|
53
53
|
|
|
54
54
|
&:hover {
|
|
55
|
-
background-color: var(--purpur-color-background-interactive-transparent-negative
|
|
56
|
-
color: var(--purpur-color-text-interactive-primary-negative
|
|
55
|
+
background-color: var(--purpur-color-background-interactive-transparent-hover-negative);
|
|
56
|
+
color: var(--purpur-color-text-interactive-primary-hover-negative);
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
&:active {
|
|
60
|
-
background-color: var(--purpur-color-background-interactive-transparent-negative
|
|
61
|
-
color: var(--purpur-color-text-interactive-primary-negative
|
|
60
|
+
background-color: var(--purpur-color-background-interactive-transparent-active-negative);
|
|
61
|
+
color: var(--purpur-color-text-interactive-primary-active-negative);
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
&:visited:not(#{$root}--disable-visited > a) {
|
|
65
|
-
color: var(--purpur-color-text-interactive-primary-negative
|
|
65
|
+
color: var(--purpur-color-text-interactive-primary-active-negative);
|
|
66
66
|
}
|
|
67
67
|
}
|
|
68
68
|
}
|
package/src/link.stories.tsx
CHANGED
|
@@ -33,26 +33,6 @@ const meta = {
|
|
|
33
33
|
negative: false,
|
|
34
34
|
children: "Hello Link!",
|
|
35
35
|
},
|
|
36
|
-
decorators: [
|
|
37
|
-
(Story, context) => {
|
|
38
|
-
const {
|
|
39
|
-
args: { negative },
|
|
40
|
-
} = context;
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<div
|
|
44
|
-
style={{
|
|
45
|
-
backgroundColor: negative
|
|
46
|
-
? "var(--purpur-color-background-tone-on-tone-primary)"
|
|
47
|
-
: undefined,
|
|
48
|
-
padding: "var(--purpur-spacing-200)",
|
|
49
|
-
}}
|
|
50
|
-
>
|
|
51
|
-
<Story {...context} />
|
|
52
|
-
</div>
|
|
53
|
-
);
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
36
|
} satisfies Meta<typeof Link>;
|
|
57
37
|
|
|
58
38
|
export default meta;
|