@semcore/link 5.44.4-prerelease.0 → 5.45.0-prerelease.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/CHANGELOG.md +6 -0
- package/lib/cjs/Link.js +77 -110
- package/lib/cjs/Link.js.map +1 -1
- package/lib/cjs/Link.types.js +2 -0
- package/lib/cjs/Link.types.js.map +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index.js.map +1 -1
- package/lib/cjs/style/link.shadow.css +24 -36
- package/lib/es6/Link.js +74 -104
- package/lib/es6/Link.js.map +1 -1
- package/lib/es6/Link.types.js +2 -0
- package/lib/es6/Link.types.js.map +1 -0
- package/lib/es6/index.js.map +1 -1
- package/lib/es6/style/link.shadow.css +24 -36
- package/lib/esm/Link.mjs +61 -89
- package/lib/esm/style/link.shadow.css +24 -36
- package/lib/types/Link.d.ts +26 -0
- package/lib/types/Link.types.d.ts +35 -0
- package/lib/types/index.d.ts +3 -42
- package/package.json +6 -6
- package/lib/cjs/index.d.js +0 -2
- package/lib/cjs/index.d.js.map +0 -1
- package/lib/es6/index.d.js +0 -2
- package/lib/es6/index.d.js.map +0 -1
package/lib/esm/Link.mjs
CHANGED
|
@@ -1,72 +1,56 @@
|
|
|
1
1
|
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
2
2
|
import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
|
|
3
3
|
import _createClass from "@babel/runtime/helpers/esm/createClass";
|
|
4
|
-
import
|
|
4
|
+
import _callSuper from "@babel/runtime/helpers/esm/callSuper";
|
|
5
5
|
import _inherits from "@babel/runtime/helpers/esm/inherits";
|
|
6
|
-
import _createSuper from "@babel/runtime/helpers/esm/createSuper";
|
|
7
6
|
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
8
|
-
import { sstyled } from "@semcore/
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import { sstyled, CORE_INSTANCE, assignProps, Component, createComponent } from "@semcore/core";
|
|
8
|
+
import { Box, Hint } from "@semcore/base-components";
|
|
9
|
+
import addonTextChildren from "@semcore/core/lib/utils/addonTextChildren";
|
|
10
|
+
import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
|
|
11
|
+
import hasLabels from "@semcore/core/lib/utils/hasLabels";
|
|
12
|
+
import logger from "@semcore/core/lib/utils/logger";
|
|
11
13
|
import { Text } from "@semcore/typography";
|
|
12
|
-
import
|
|
13
|
-
import { Hint } from "@semcore/tooltip";
|
|
14
|
-
import keyboardFocusEnhance from "@semcore/utils/lib/enhances/keyboardFocusEnhance";
|
|
15
|
-
import addonTextChildren from "@semcore/utils/lib/addonTextChildren";
|
|
16
|
-
import logger from "@semcore/utils/lib/logger";
|
|
17
|
-
import hasLabels from "@semcore/utils/lib/hasLabels";
|
|
18
|
-
import resolveColorEnhance from "@semcore/utils/lib/enhances/resolveColorEnhance";
|
|
14
|
+
import React from "react";
|
|
19
15
|
/*!__reshadow-styles__:"./style/link.shadow.css"*/
|
|
20
16
|
var style = (
|
|
21
17
|
/*__reshadow_css_start__*/
|
|
22
18
|
(sstyled.insert(
|
|
23
19
|
/*__inner_css_start__*/
|
|
24
|
-
".
|
|
20
|
+
".___SLink_17c8v_gg_{display:inline;align-items:center;color:var(--intergalactic-text-link, rgb(36, 93, 229));position:relative;cursor:pointer;-webkit-text-decoration:none;text-decoration:none;-webkit-tap-highlight-color:transparent;background:0 0;transition:color .15s ease-in-out}.___SLink_17c8v_gg_::-moz-focus-inner{border:0;padding:0}.___SLink_17c8v_gg_.__active_17c8v_gg_,.___SLink_17c8v_gg_:active{color:var(--intergalactic-text-link-hover-active, rgb(34, 88, 217))}@media (hover:hover){.___SLink_17c8v_gg_:hover{color:var(--intergalactic-text-link-hover-active, rgb(34, 88, 217))}}.___SLink_17c8v_gg_.__active_17c8v_gg_ .___SText_17c8v_gg_,.___SLink_17c8v_gg_:active .___SText_17c8v_gg_{text-decoration-color:currentColor}@media (hover:hover){.___SLink_17c8v_gg_:hover .___SText_17c8v_gg_{text-decoration-color:currentColor}}.___SLink_17c8v_gg_.__enableVisited_17c8v_gg_:visited{color:var(--intergalactic-text-link-visited, rgb(128, 41, 236))}@media (hover:hover){.___SLink_17c8v_gg_.__enableVisited_17c8v_gg_:visited:hover{color:var(--intergalactic-text-link-visited, rgb(128, 41, 236))}}.___SLink_17c8v_gg_.__visually-disabled_17c8v_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none}.___SLink_17c8v_gg_.__noWrap_17c8v_gg_{white-space:nowrap}.___SLink_17c8v_gg_.__inline_17c8v_gg_{display:inline}.___SInner_17c8v_gg_{align-items:baseline;height:100%;width:100%}.___SAddon_17c8v_gg_{pointer-events:none;vertical-align:middle;display:inline-flex;margin-top:-2.5px}.___SLink_17c8v_gg_ .___SAddon_17c8v_gg_:not(:only-child):first-child{margin-right:var(--intergalactic-spacing-1x, 4px)}.___SLink_17c8v_gg_ .___SAddon_17c8v_gg_:not(:only-child):last-child{margin-left:var(--intergalactic-spacing-1x, 4px)}.___SText_17c8v_gg_{-webkit-text-decoration:underline;text-decoration:underline;text-decoration-style:solid;text-decoration-thickness:1px;text-decoration-color:transparent;text-underline-offset:17%;transition:text-decoration-color .15s ease-in-out}.___SLink_17c8v_gg_.__text-color_17c8v_gg_{color:var(--text-color_17c8v)}.___SLink_17c8v_gg_.__text-color_17c8v_gg_.__active_17c8v_gg_,.___SLink_17c8v_gg_.__text-color_17c8v_gg_:active{color:var(--text-color_17c8v);filter:brightness(.8)}@media (hover:hover){.___SLink_17c8v_gg_.__text-color_17c8v_gg_:hover{color:var(--text-color_17c8v);filter:brightness(.8)}}@media (prefers-reduced-motion){.___SLink_17c8v_gg_,.___SText_17c8v_gg_{transition:none}}",
|
|
25
21
|
/*__inner_css_end__*/
|
|
26
|
-
"
|
|
22
|
+
"17c8v_gg_"
|
|
27
23
|
), /*__reshadow_css_end__*/
|
|
28
24
|
{
|
|
29
|
-
"__SLink": "
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
34
|
-
"__SAddon": "
|
|
35
|
-
"__SText": "
|
|
36
|
-
"_active": "
|
|
37
|
-
"_enableVisited": "
|
|
38
|
-
"_text-color": "__text-
|
|
39
|
-
"--text-color": "--text-
|
|
25
|
+
"__SLink": "___SLink_17c8v_gg_",
|
|
26
|
+
"_visually-disabled": "__visually-disabled_17c8v_gg_",
|
|
27
|
+
"_noWrap": "__noWrap_17c8v_gg_",
|
|
28
|
+
"_inline": "__inline_17c8v_gg_",
|
|
29
|
+
"__SInner": "___SInner_17c8v_gg_",
|
|
30
|
+
"__SAddon": "___SAddon_17c8v_gg_",
|
|
31
|
+
"__SText": "___SText_17c8v_gg_",
|
|
32
|
+
"_active": "__active_17c8v_gg_",
|
|
33
|
+
"_enableVisited": "__enableVisited_17c8v_gg_",
|
|
34
|
+
"_text-color": "__text-color_17c8v_gg_",
|
|
35
|
+
"--text-color": "--text-color_17c8v"
|
|
40
36
|
})
|
|
41
37
|
);
|
|
42
|
-
var RootLink = /* @__PURE__ */ function(_Component) {
|
|
43
|
-
_inherits(RootLink2, _Component);
|
|
44
|
-
var _super = _createSuper(RootLink2);
|
|
38
|
+
var RootLink = /* @__PURE__ */ (function(_Component) {
|
|
45
39
|
function RootLink2() {
|
|
46
40
|
var _this;
|
|
47
41
|
_classCallCheck(this, RootLink2);
|
|
48
42
|
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
49
43
|
args[_key] = arguments[_key];
|
|
50
44
|
}
|
|
51
|
-
_this =
|
|
52
|
-
_defineProperty(
|
|
53
|
-
_defineProperty(
|
|
54
|
-
ariaLabelledByContent: ""
|
|
55
|
-
visibleHint: false
|
|
56
|
-
});
|
|
57
|
-
_defineProperty(_assertThisInitialized(_this), "handleMouseEnterOnlyAddon", function() {
|
|
58
|
-
_this.setState({
|
|
59
|
-
visibleHint: true
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
_defineProperty(_assertThisInitialized(_this), "handleMouseLeaveOnlyAddon", function() {
|
|
63
|
-
_this.setState({
|
|
64
|
-
visibleHint: false
|
|
65
|
-
});
|
|
45
|
+
_this = _callSuper(this, RootLink2, [].concat(args));
|
|
46
|
+
_defineProperty(_this, "containerRef", /* @__PURE__ */ React.createRef());
|
|
47
|
+
_defineProperty(_this, "state", {
|
|
48
|
+
ariaLabelledByContent: ""
|
|
66
49
|
});
|
|
67
50
|
return _this;
|
|
68
51
|
}
|
|
69
|
-
|
|
52
|
+
_inherits(RootLink2, _Component);
|
|
53
|
+
return _createClass(RootLink2, [{
|
|
70
54
|
key: "componentDidMount",
|
|
71
55
|
value: function componentDidMount() {
|
|
72
56
|
var _this2 = this;
|
|
@@ -83,72 +67,60 @@ var RootLink = /* @__PURE__ */ function(_Component) {
|
|
|
83
67
|
}
|
|
84
68
|
}
|
|
85
69
|
}, {
|
|
86
|
-
key: "
|
|
87
|
-
value: function
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
}) : null, addonTextChildren(Children, Link.Text, Link.Addon), AddonRight ? /* @__PURE__ */ React.createElement(Link.Addon, {
|
|
92
|
-
tag: AddonRight
|
|
93
|
-
}) : null);
|
|
94
|
-
}
|
|
95
|
-
}, {
|
|
96
|
-
key: "renderOnlyAddons",
|
|
97
|
-
value: function renderOnlyAddons() {
|
|
98
|
-
var _ref5, _ref9, _ref10;
|
|
99
|
-
var _this$asProps2 = this.asProps, styles = _this$asProps2.styles, AddonLeft = _this$asProps2.addonLeft, AddonRight = _this$asProps2.addonRight, title = _this$asProps2.title, ariaLabel = _this$asProps2["aria-label"], keyboardFocused = _this$asProps2.keyboardFocused;
|
|
100
|
-
var visibleHint = this.state.visibleHint;
|
|
101
|
-
var hintContent = (_ref9 = (_ref10 = title !== null && title !== void 0 ? title : ariaLabel) !== null && _ref10 !== void 0 ? _ref10 : this.state.ariaLabelledByContent) !== null && _ref9 !== void 0 ? _ref9 : "";
|
|
102
|
-
return _ref5 = sstyled$1(styles), /* @__PURE__ */ React.createElement(Link.Addon, {
|
|
103
|
-
tag: Hint,
|
|
104
|
-
title: hintContent,
|
|
105
|
-
timeout: [250, 50],
|
|
106
|
-
visible: keyboardFocused || visibleHint
|
|
107
|
-
}, AddonLeft && /* @__PURE__ */ React.createElement(AddonLeft, _ref5.cn("AddonLeft", {})), AddonRight && /* @__PURE__ */ React.createElement(AddonRight, _ref5.cn("AddonRight", {})));
|
|
70
|
+
key: "getTextProps",
|
|
71
|
+
value: function getTextProps() {
|
|
72
|
+
return {
|
|
73
|
+
"hint:triggerRef": this.containerRef
|
|
74
|
+
};
|
|
108
75
|
}
|
|
109
76
|
}, {
|
|
110
77
|
key: "render",
|
|
111
78
|
value: function render() {
|
|
112
|
-
var _ref = this.asProps,
|
|
79
|
+
var _ref = this.asProps, _ref4, _ref7, _ref8;
|
|
80
|
+
var _this$asProps = this.asProps, styles = _this$asProps.styles, color = _this$asProps.color, resolveColor = _this$asProps.resolveColor, disabled = _this$asProps.disabled, href = _this$asProps.href, children = _this$asProps.children, AddonLeft = _this$asProps.addonLeft, AddonRight = _this$asProps.addonRight, Children = _this$asProps.Children, title = _this$asProps.title, ariaLabel = _this$asProps["aria-label"], hintPlacement = _this$asProps.hintPlacement;
|
|
81
|
+
var Link2 = this[CORE_INSTANCE];
|
|
113
82
|
var SLink = Text;
|
|
114
|
-
var
|
|
115
|
-
|
|
116
|
-
|
|
83
|
+
var SInner = Box;
|
|
84
|
+
var hintContent = (_ref7 = (_ref8 = title !== null && title !== void 0 ? title : ariaLabel) !== null && _ref8 !== void 0 ? _ref8 : this.state.ariaLabelledByContent) !== null && _ref7 !== void 0 ? _ref7 : "";
|
|
85
|
+
var showHint = children === void 0 || title;
|
|
86
|
+
var excludeProps = ["title", "aria-disabled"];
|
|
87
|
+
if (!this.asProps["use:disabled"]) {
|
|
88
|
+
excludeProps.push("disabled");
|
|
89
|
+
}
|
|
90
|
+
return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SLink, _ref4.cn("SLink", _objectSpread({}, assignProps({
|
|
117
91
|
"tabIndex": disabled ? -1 : 0,
|
|
118
92
|
"use:href": disabled ? void 0 : href,
|
|
119
93
|
"visually-disabled": disabled,
|
|
120
94
|
"text-color": resolveColor(color),
|
|
121
95
|
"tag": "a",
|
|
122
|
-
"noWrapText": noWrap,
|
|
123
|
-
"use:noWrap": false,
|
|
124
96
|
"ref": this.containerRef,
|
|
125
|
-
"__excludeProps":
|
|
126
|
-
"
|
|
127
|
-
|
|
128
|
-
|
|
97
|
+
"__excludeProps": excludeProps,
|
|
98
|
+
"aria-label": showHint ? hintContent : void 0
|
|
99
|
+
}, _ref))), /* @__PURE__ */ React.createElement(SInner, _ref4.cn("SInner", {
|
|
100
|
+
"tag": "span",
|
|
101
|
+
"data-ui-name": "".concat(this.asProps["data-ui-name"], ".InnerWrapper")
|
|
102
|
+
}), AddonLeft ? /* @__PURE__ */ React.createElement(Link2.Addon, null, /* @__PURE__ */ React.createElement(AddonLeft, _ref4.cn("AddonLeft", {}))) : null, addonTextChildren(Children, Link2.Text, Link2.Addon), AddonRight ? /* @__PURE__ */ React.createElement(Link2.Addon, null, /* @__PURE__ */ React.createElement(AddonRight, _ref4.cn("AddonRight", {}))) : null)), showHint && /* @__PURE__ */ React.createElement(Hint, _ref4.cn("Hint", {
|
|
103
|
+
"triggerRef": this.containerRef,
|
|
104
|
+
"timeout": [250, 50],
|
|
105
|
+
"placement": hintPlacement
|
|
106
|
+
}), hintContent));
|
|
129
107
|
}
|
|
130
108
|
}]);
|
|
131
|
-
|
|
132
|
-
}(Component);
|
|
109
|
+
})(Component);
|
|
133
110
|
_defineProperty(RootLink, "displayName", "Link");
|
|
134
|
-
_defineProperty(RootLink, "defaultProps", {
|
|
135
|
-
noWrap: true
|
|
136
|
-
});
|
|
137
111
|
_defineProperty(RootLink, "style", style);
|
|
138
|
-
_defineProperty(RootLink, "enhance", [
|
|
112
|
+
_defineProperty(RootLink, "enhance", [resolveColorEnhance()]);
|
|
139
113
|
function LinkText(props) {
|
|
140
|
-
var _ref2 = arguments[0],
|
|
141
|
-
var SText =
|
|
114
|
+
var _ref2 = arguments[0], _ref5;
|
|
115
|
+
var SText = Text;
|
|
142
116
|
var styles = props.styles;
|
|
143
|
-
return
|
|
144
|
-
"tag": "span"
|
|
145
|
-
}, _ref2))));
|
|
117
|
+
return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref5.cn("SText", _objectSpread({}, assignProps({}, _ref2))));
|
|
146
118
|
}
|
|
147
119
|
function Addon(props) {
|
|
148
|
-
var _ref3 = arguments[0],
|
|
120
|
+
var _ref3 = arguments[0], _ref6;
|
|
149
121
|
var SAddon = Box;
|
|
150
122
|
var styles = props.styles;
|
|
151
|
-
return
|
|
123
|
+
return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SAddon, _ref6.cn("SAddon", _objectSpread({}, assignProps({
|
|
152
124
|
"tag": "span"
|
|
153
125
|
}, _ref3))));
|
|
154
126
|
}
|
|
@@ -1,27 +1,14 @@
|
|
|
1
1
|
SLink {
|
|
2
|
-
display: inline
|
|
3
|
-
|
|
4
|
-
color: var(--intergalactic-text-link,
|
|
5
|
-
line-height: normal;
|
|
2
|
+
display: inline;
|
|
3
|
+
align-items: center;
|
|
4
|
+
color: var(--intergalactic-text-link, oklch(0.53 0.214 263.4));
|
|
6
5
|
position: relative;
|
|
7
6
|
cursor: pointer;
|
|
8
7
|
text-decoration: none;
|
|
9
|
-
border: none;
|
|
10
|
-
padding: 0;
|
|
11
|
-
margin: 0;
|
|
12
|
-
box-shadow: none;
|
|
13
8
|
-webkit-tap-highlight-color: transparent;
|
|
14
|
-
outline: 0;
|
|
15
9
|
background: none;
|
|
16
10
|
transition: color 0.15s ease-in-out;
|
|
17
11
|
|
|
18
|
-
&:active,
|
|
19
|
-
&:hover,
|
|
20
|
-
&:focus {
|
|
21
|
-
outline: 0;
|
|
22
|
-
text-decoration: none;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
12
|
&::-moz-focus-inner {
|
|
26
13
|
border: none;
|
|
27
14
|
padding: 0;
|
|
@@ -30,33 +17,27 @@ SLink {
|
|
|
30
17
|
&[active],
|
|
31
18
|
&:hover,
|
|
32
19
|
&:active {
|
|
33
|
-
color: var(--intergalactic-text-link-hover-active,
|
|
20
|
+
color: var(--intergalactic-text-link-hover-active, oklch(0.51 0.206 263.4));
|
|
34
21
|
|
|
35
22
|
& SText {
|
|
36
|
-
|
|
23
|
+
text-decoration-color: currentColor;
|
|
37
24
|
}
|
|
38
25
|
}
|
|
39
26
|
|
|
40
27
|
&[enableVisited]:visited,
|
|
41
28
|
&[enableVisited]:visited:hover {
|
|
42
|
-
color: var(--intergalactic-text-link-visited,
|
|
29
|
+
color: var(--intergalactic-text-link-visited, oklch(0.53 0.26 296));
|
|
43
30
|
}
|
|
44
31
|
}
|
|
45
32
|
|
|
46
|
-
SLink[keyboardFocused] {
|
|
47
|
-
outline-color: var(--intergalactic-keyboard-focus-outline, rgba(0, 143, 248, 0.5));
|
|
48
|
-
outline-style: solid;
|
|
49
|
-
outline-width: 3px;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
33
|
SLink[visually-disabled] {
|
|
53
|
-
opacity: var(--intergalactic-disabled-opacity, 0.
|
|
34
|
+
opacity: var(--intergalactic-disabled-opacity, 0.4);
|
|
54
35
|
cursor: default;
|
|
55
36
|
/* Disable link interactions */
|
|
56
37
|
pointer-events: none;
|
|
57
38
|
}
|
|
58
39
|
|
|
59
|
-
SLink[
|
|
40
|
+
SLink[noWrap] {
|
|
60
41
|
white-space: nowrap;
|
|
61
42
|
}
|
|
62
43
|
|
|
@@ -64,13 +45,17 @@ SLink[inline] {
|
|
|
64
45
|
display: inline;
|
|
65
46
|
}
|
|
66
47
|
|
|
48
|
+
SInner {
|
|
49
|
+
align-items: baseline;
|
|
50
|
+
height: 100%;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
|
|
67
54
|
SAddon {
|
|
68
|
-
display: inline-flex;
|
|
69
|
-
justify-content: center;
|
|
70
|
-
align-items: center;
|
|
71
|
-
margin-bottom: var(--intergalactic-spacing-05x, 2px);
|
|
72
|
-
vertical-align: middle;
|
|
73
55
|
pointer-events: none;
|
|
56
|
+
vertical-align: middle;
|
|
57
|
+
display: inline-flex;
|
|
58
|
+
margin-top: -2.5px;
|
|
74
59
|
}
|
|
75
60
|
|
|
76
61
|
SLink SAddon {
|
|
@@ -84,10 +69,13 @@ SLink SAddon {
|
|
|
84
69
|
}
|
|
85
70
|
|
|
86
71
|
SText {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
text-decoration: underline;
|
|
73
|
+
text-decoration-style: solid;
|
|
74
|
+
text-decoration-thickness: 1px;
|
|
75
|
+
text-decoration-color: transparent;
|
|
76
|
+
text-underline-offset: 17%;
|
|
77
|
+
|
|
78
|
+
transition: text-decoration-color 0.15s ease-in-out;
|
|
91
79
|
}
|
|
92
80
|
|
|
93
81
|
SLink[text-color] {
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { BoxProps } from '@semcore/base-components';
|
|
2
|
+
import type { Intergalactic } from '@semcore/core';
|
|
3
|
+
import { Component } from '@semcore/core';
|
|
4
|
+
import type { NSText } from '@semcore/typography';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import type { LinkProps } from './Link.types';
|
|
7
|
+
type State = {
|
|
8
|
+
ariaLabelledByContent: string;
|
|
9
|
+
};
|
|
10
|
+
declare class RootLink extends Component<LinkProps, typeof RootLink.enhance, never, {}, State> {
|
|
11
|
+
static displayName: string;
|
|
12
|
+
static style: {
|
|
13
|
+
[key: string]: string;
|
|
14
|
+
};
|
|
15
|
+
static enhance: readonly [(props: any) => any];
|
|
16
|
+
containerRef: React.RefObject<HTMLElement | null>;
|
|
17
|
+
state: State;
|
|
18
|
+
componentDidMount(): void;
|
|
19
|
+
getTextProps(): NSText.HintProps;
|
|
20
|
+
render(): React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
declare const Link: Intergalactic.Component<"a", LinkProps, {}, typeof RootLink.enhance> & {
|
|
23
|
+
Text: Intergalactic.Component<"span", NSText.Props>;
|
|
24
|
+
Addon: Intergalactic.Component<"span", BoxProps>;
|
|
25
|
+
};
|
|
26
|
+
export default Link;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import type { BoxProps, SimpleHintPopperProps } from '@semcore/base-components';
|
|
2
|
+
import type { NSText } from '@semcore/typography';
|
|
3
|
+
import type React from 'react';
|
|
4
|
+
export type LinkProps = BoxProps & NSText.BaseProps & {
|
|
5
|
+
/**
|
|
6
|
+
* CSS property of the display link (inline|inline-block)
|
|
7
|
+
* @default false
|
|
8
|
+
* @deprecated. You should use default inline-flex for all cases.
|
|
9
|
+
*/
|
|
10
|
+
inline?: boolean;
|
|
11
|
+
/**
|
|
12
|
+
* Sets the link to the disabled state
|
|
13
|
+
*/
|
|
14
|
+
disabled?: boolean;
|
|
15
|
+
/**
|
|
16
|
+
* Sets the link to the active state
|
|
17
|
+
*/
|
|
18
|
+
active?: boolean;
|
|
19
|
+
/** This flag enables highlighting of the visited link
|
|
20
|
+
*/
|
|
21
|
+
enableVisited?: boolean;
|
|
22
|
+
/** The text will not be moved to a new line
|
|
23
|
+
* @default false
|
|
24
|
+
*/
|
|
25
|
+
noWrap?: boolean;
|
|
26
|
+
/** Left addon tag */
|
|
27
|
+
addonLeft?: React.ElementType;
|
|
28
|
+
/** Right addon tag */
|
|
29
|
+
addonRight?: React.ElementType;
|
|
30
|
+
/**
|
|
31
|
+
* The position of the popper relative to the trigger that called it.
|
|
32
|
+
* @default top
|
|
33
|
+
*/
|
|
34
|
+
hintPlacement?: SimpleHintPopperProps['placement'];
|
|
35
|
+
};
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,42 +1,3 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import { BoxProps } from '@semcore/flex-box';
|
|
5
|
-
import { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';
|
|
6
|
-
|
|
7
|
-
/** @deprecated */
|
|
8
|
-
export interface ILinkProps extends LinkProps, UnknownProperties {}
|
|
9
|
-
export type LinkProps = TextProps &
|
|
10
|
-
KeyboardFocusProps & {
|
|
11
|
-
/**
|
|
12
|
-
* CSS property of the display link (inline|inline-block)
|
|
13
|
-
* @default false
|
|
14
|
-
*/
|
|
15
|
-
inline?: boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Sets the link to the disabled state
|
|
18
|
-
*/
|
|
19
|
-
disabled?: boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Sets the link to the active state
|
|
22
|
-
*/
|
|
23
|
-
active?: boolean;
|
|
24
|
-
/** This flag enables highlighting of the visited link
|
|
25
|
-
*/
|
|
26
|
-
enableVisited?: boolean;
|
|
27
|
-
/** The text will not be moved to a new line
|
|
28
|
-
* @default true
|
|
29
|
-
*/
|
|
30
|
-
noWrap?: boolean;
|
|
31
|
-
/** Left addon tag */
|
|
32
|
-
addonLeft?: React.ElementType;
|
|
33
|
-
/** Right addon tag */
|
|
34
|
-
addonRight?: React.ElementType;
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
declare const Link: Intergalactic.Component<'a', LinkProps> & {
|
|
38
|
-
Text: Intergalactic.Component<'span', TextProps>;
|
|
39
|
-
Addon: Intergalactic.Component<'span', BoxProps>;
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export default Link;
|
|
1
|
+
import type { LinkProps } from './Link.types';
|
|
2
|
+
export { default } from './Link';
|
|
3
|
+
export type { LinkProps };
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@semcore/link",
|
|
3
3
|
"description": "Semrush Link Component",
|
|
4
|
-
"version": "5.
|
|
4
|
+
"version": "5.45.0-prerelease.0",
|
|
5
5
|
"main": "lib/cjs/index.js",
|
|
6
6
|
"module": "lib/es6/index.js",
|
|
7
7
|
"typings": "lib/types/index.d.ts",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"types": "./lib/types/index.d.ts"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@semcore/utils": "4.
|
|
18
|
-
"@semcore/typography": "5.
|
|
19
|
-
"@semcore/flex-box": "5.
|
|
20
|
-
"@semcore/tooltip": "6.
|
|
17
|
+
"@semcore/utils": "4.49.0-prerelease.0",
|
|
18
|
+
"@semcore/typography": "5.54.0-prerelease.0",
|
|
19
|
+
"@semcore/flex-box": "5.42.0-prerelease.0",
|
|
20
|
+
"@semcore/tooltip": "6.50.0-prerelease.0"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
|
-
"@semcore/core": "^2.
|
|
23
|
+
"@semcore/core": "^2.40.0-prerelease.0",
|
|
24
24
|
"react": "16.8 - 18",
|
|
25
25
|
"react-dom": "16.8 - 18"
|
|
26
26
|
},
|
package/lib/cjs/index.d.js
DELETED
package/lib/cjs/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { Intergalactic, UnknownProperties } from '@semcore/core';\nimport { TextProps } from '@semcore/typography';\nimport { BoxProps } from '@semcore/flex-box';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\n/** @deprecated */\nexport interface ILinkProps extends LinkProps, UnknownProperties {}\nexport type LinkProps = TextProps &\n KeyboardFocusProps & {\n /**\n * CSS property of the display link (inline|inline-block)\n * @default false\n */\n inline?: boolean;\n /**\n * Sets the link to the disabled state\n */\n disabled?: boolean;\n /**\n * Sets the link to the active state\n */\n active?: boolean;\n /** This flag enables highlighting of the visited link\n */\n enableVisited?: boolean;\n /** The text will not be moved to a new line\n * @default true\n */\n noWrap?: boolean;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n };\n\ndeclare const Link: Intergalactic.Component<'a', LinkProps> & {\n Text: Intergalactic.Component<'span', TextProps>;\n Addon: Intergalactic.Component<'span', BoxProps>;\n};\n\nexport default Link;\n"],"mappings":""}
|
package/lib/es6/index.d.js
DELETED
package/lib/es6/index.d.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import React from 'react';\nimport { Intergalactic, UnknownProperties } from '@semcore/core';\nimport { TextProps } from '@semcore/typography';\nimport { BoxProps } from '@semcore/flex-box';\nimport { KeyboardFocusProps } from '@semcore/utils/lib/enhances/keyboardFocusEnhance';\n\n/** @deprecated */\nexport interface ILinkProps extends LinkProps, UnknownProperties {}\nexport type LinkProps = TextProps &\n KeyboardFocusProps & {\n /**\n * CSS property of the display link (inline|inline-block)\n * @default false\n */\n inline?: boolean;\n /**\n * Sets the link to the disabled state\n */\n disabled?: boolean;\n /**\n * Sets the link to the active state\n */\n active?: boolean;\n /** This flag enables highlighting of the visited link\n */\n enableVisited?: boolean;\n /** The text will not be moved to a new line\n * @default true\n */\n noWrap?: boolean;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n };\n\ndeclare const Link: Intergalactic.Component<'a', LinkProps> & {\n Text: Intergalactic.Component<'span', TextProps>;\n Addon: Intergalactic.Component<'span', BoxProps>;\n};\n\nexport default Link;\n"],"mappings":""}
|