@semcore/link 5.45.0-prerelease.0 → 5.45.0-prerelease.4

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/lib/esm/Link.mjs CHANGED
@@ -1,56 +1,72 @@
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 _callSuper from "@babel/runtime/helpers/esm/callSuper";
4
+ import _assertThisInitialized from "@babel/runtime/helpers/esm/assertThisInitialized";
5
5
  import _inherits from "@babel/runtime/helpers/esm/inherits";
6
+ import _createSuper from "@babel/runtime/helpers/esm/createSuper";
6
7
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
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";
13
- import { Text } from "@semcore/typography";
8
+ import { sstyled } from "@semcore/utils/lib/core/index";
9
+ import createComponent, { sstyled as sstyled$1, assignProps, Component } from "@semcore/core";
14
10
  import React from "react";
11
+ import { Text } from "@semcore/typography";
12
+ import { Box } from "@semcore/flex-box";
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";
15
19
  /*!__reshadow-styles__:"./style/link.shadow.css"*/
16
20
  var style = (
17
21
  /*__reshadow_css_start__*/
18
22
  (sstyled.insert(
19
23
  /*__inner_css_start__*/
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}}",
24
+ ".___SLink_jkp44_gg_{display:inline-block;font-family:inherit;color:var(--intergalactic-text-link, rgb(35, 95, 226));line-height:normal;position:relative;cursor:pointer;-webkit-text-decoration:none;text-decoration:none;border:0;padding:0;margin:0;box-shadow:none;-webkit-tap-highlight-color:transparent;outline:0;background:0 0;transition:color .15s ease-in-out}.___SLink_jkp44_gg_:active,.___SLink_jkp44_gg_:focus{outline:0;-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SLink_jkp44_gg_:hover{outline:0;-webkit-text-decoration:none;text-decoration:none}}.___SLink_jkp44_gg_::-moz-focus-inner{border:0;padding:0}.___SLink_jkp44_gg_.__active_jkp44_gg_,.___SLink_jkp44_gg_:active{color:var(--intergalactic-text-link-hover-active, rgb(33, 89, 215))}@media (hover:hover){.___SLink_jkp44_gg_:hover{color:var(--intergalactic-text-link-hover-active, rgb(33, 89, 215))}}.___SLink_jkp44_gg_.__active_jkp44_gg_ .___SText_jkp44_gg_,.___SLink_jkp44_gg_:active .___SText_jkp44_gg_{border-color:currentColor}@media (hover:hover){.___SLink_jkp44_gg_:hover .___SText_jkp44_gg_{border-color:currentColor}}.___SLink_jkp44_gg_.__enableVisited_jkp44_gg_:visited{color:var(--intergalactic-text-link-visited, rgb(128, 41, 236))}@media (hover:hover){.___SLink_jkp44_gg_.__enableVisited_jkp44_gg_:visited:hover{color:var(--intergalactic-text-link-visited, rgb(128, 41, 236))}}.___SLink_jkp44_gg_.__keyboardFocused_jkp44_gg_{outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 33, 220, 0.469));outline-style:solid;outline-width:3px}@supports (color:color(display-p3 0 0 0)){.___SLink_jkp44_gg_.__keyboardFocused_jkp44_gg_{outline-color:var(--intergalactic-keyboard-focus-outline, rgba(0, 33, 220, 0.469))}@media (color-gamut:p3){.___SLink_jkp44_gg_.__keyboardFocused_jkp44_gg_{outline-color:var(--intergalactic-keyboard-focus-outline, color(display-p3 0.03256 0.12227 0.83249 / 0.469))}}}.___SLink_jkp44_gg_.__visually-disabled_jkp44_gg_{opacity:var(--intergalactic-disabled-opacity, 0.4);cursor:default;pointer-events:none}.___SLink_jkp44_gg_.__noWrapText_jkp44_gg_{white-space:nowrap}.___SLink_jkp44_gg_.__inline_jkp44_gg_{display:inline}.___SAddon_jkp44_gg_{display:inline-flex;justify-content:center;align-items:center;margin-bottom:var(--intergalactic-spacing-05x, 2px);vertical-align:middle;pointer-events:none}.___SLink_jkp44_gg_ .___SAddon_jkp44_gg_:not(:only-child):first-child{margin-right:var(--intergalactic-spacing-1x, 4px)}.___SLink_jkp44_gg_ .___SAddon_jkp44_gg_:not(:only-child):last-child{margin-left:var(--intergalactic-spacing-1x, 4px)}.___SText_jkp44_gg_{border-bottom-width:1px;border-bottom-style:solid;border-color:transparent;transition:border-bottom-color .15s ease-in-out}.___SLink_jkp44_gg_.__text-color_jkp44_gg_{color:var(--text-color_jkp44)}.___SLink_jkp44_gg_.__text-color_jkp44_gg_.__active_jkp44_gg_,.___SLink_jkp44_gg_.__text-color_jkp44_gg_:active{color:var(--text-color_jkp44);filter:brightness(.8)}@media (hover:hover){.___SLink_jkp44_gg_.__text-color_jkp44_gg_:hover{color:var(--text-color_jkp44);filter:brightness(.8)}}@media (prefers-reduced-motion){.___SLink_jkp44_gg_,.___SText_jkp44_gg_{transition:none}}",
21
25
  /*__inner_css_end__*/
22
- "17c8v_gg_"
26
+ "jkp44_gg_"
23
27
  ), /*__reshadow_css_end__*/
24
28
  {
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"
29
+ "__SLink": "___SLink_jkp44_gg_",
30
+ "_keyboardFocused": "__keyboardFocused_jkp44_gg_",
31
+ "_visually-disabled": "__visually-disabled_jkp44_gg_",
32
+ "_noWrapText": "__noWrapText_jkp44_gg_",
33
+ "_inline": "__inline_jkp44_gg_",
34
+ "__SAddon": "___SAddon_jkp44_gg_",
35
+ "__SText": "___SText_jkp44_gg_",
36
+ "_active": "__active_jkp44_gg_",
37
+ "_enableVisited": "__enableVisited_jkp44_gg_",
38
+ "_text-color": "__text-color_jkp44_gg_",
39
+ "--text-color": "--text-color_jkp44"
36
40
  })
37
41
  );
38
- var RootLink = /* @__PURE__ */ (function(_Component) {
42
+ var RootLink = /* @__PURE__ */ function(_Component) {
43
+ _inherits(RootLink2, _Component);
44
+ var _super = _createSuper(RootLink2);
39
45
  function RootLink2() {
40
46
  var _this;
41
47
  _classCallCheck(this, RootLink2);
42
48
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
43
49
  args[_key] = arguments[_key];
44
50
  }
45
- _this = _callSuper(this, RootLink2, [].concat(args));
46
- _defineProperty(_this, "containerRef", /* @__PURE__ */ React.createRef());
47
- _defineProperty(_this, "state", {
48
- ariaLabelledByContent: ""
51
+ _this = _super.call.apply(_super, [this].concat(args));
52
+ _defineProperty(_assertThisInitialized(_this), "containerRef", /* @__PURE__ */ React.createRef());
53
+ _defineProperty(_assertThisInitialized(_this), "state", {
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
+ });
49
66
  });
50
67
  return _this;
51
68
  }
52
- _inherits(RootLink2, _Component);
53
- return _createClass(RootLink2, [{
69
+ _createClass(RootLink2, [{
54
70
  key: "componentDidMount",
55
71
  value: function componentDidMount() {
56
72
  var _this2 = this;
@@ -67,60 +83,72 @@ var RootLink = /* @__PURE__ */ (function(_Component) {
67
83
  }
68
84
  }
69
85
  }, {
70
- key: "getTextProps",
71
- value: function getTextProps() {
72
- return {
73
- "hint:triggerRef": this.containerRef
74
- };
86
+ key: "renderChildren",
87
+ value: function renderChildren() {
88
+ var _this$asProps = this.asProps, Children = _this$asProps.Children, styles = _this$asProps.styles, AddonLeft = _this$asProps.addonLeft, AddonRight = _this$asProps.addonRight;
89
+ return sstyled$1(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, AddonLeft ? /* @__PURE__ */ React.createElement(Link.Addon, {
90
+ tag: AddonLeft
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", {})));
75
108
  }
76
109
  }, {
77
110
  key: "render",
78
111
  value: function render() {
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];
112
+ var _ref = this.asProps, _ref6;
82
113
  var SLink = Text;
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({
114
+ var _this$asProps3 = this.asProps, styles = _this$asProps3.styles, noWrap = _this$asProps3.noWrap, color = _this$asProps3.color, resolveColor = _this$asProps3.resolveColor, disabled = _this$asProps3.disabled, href = _this$asProps3.href, hasChildren = _this$asProps3.children;
115
+ return _ref6 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SLink, _ref6.cn("SLink", _objectSpread({}, assignProps({
116
+ "role": "link",
91
117
  "tabIndex": disabled ? -1 : 0,
92
118
  "use:href": disabled ? void 0 : href,
93
119
  "visually-disabled": disabled,
94
120
  "text-color": resolveColor(color),
95
121
  "tag": "a",
122
+ "noWrapText": noWrap,
123
+ "use:noWrap": false,
96
124
  "ref": this.containerRef,
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));
125
+ "__excludeProps": ["disabled", "aria-disabled"],
126
+ "onMouseEnter": this.handleMouseEnterOnlyAddon,
127
+ "onMouseLeave": this.handleMouseLeaveOnlyAddon
128
+ }, _ref))), hasChildren !== void 0 ? this.renderChildren() : this.renderOnlyAddons());
107
129
  }
108
130
  }]);
109
- })(Component);
131
+ return RootLink2;
132
+ }(Component);
110
133
  _defineProperty(RootLink, "displayName", "Link");
134
+ _defineProperty(RootLink, "defaultProps", {
135
+ noWrap: true
136
+ });
111
137
  _defineProperty(RootLink, "style", style);
112
- _defineProperty(RootLink, "enhance", [resolveColorEnhance()]);
138
+ _defineProperty(RootLink, "enhance", [keyboardFocusEnhance(), resolveColorEnhance()]);
113
139
  function LinkText(props) {
114
- var _ref2 = arguments[0], _ref5;
115
- var SText = Text;
140
+ var _ref2 = arguments[0], _ref7;
141
+ var SText = Box;
116
142
  var styles = props.styles;
117
- return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref5.cn("SText", _objectSpread({}, assignProps({}, _ref2))));
143
+ return _ref7 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SText, _ref7.cn("SText", _objectSpread({}, assignProps({
144
+ "tag": "span"
145
+ }, _ref2))));
118
146
  }
119
147
  function Addon(props) {
120
- var _ref3 = arguments[0], _ref6;
148
+ var _ref3 = arguments[0], _ref8;
121
149
  var SAddon = Box;
122
150
  var styles = props.styles;
123
- return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SAddon, _ref6.cn("SAddon", _objectSpread({}, assignProps({
151
+ return _ref8 = sstyled$1(styles), /* @__PURE__ */ React.createElement(SAddon, _ref8.cn("SAddon", _objectSpread({}, assignProps({
124
152
  "tag": "span"
125
153
  }, _ref3))));
126
154
  }
@@ -1,14 +1,27 @@
1
1
  SLink {
2
- display: inline;
3
- align-items: center;
4
- color: var(--intergalactic-text-link, oklch(0.53 0.214 263.4));
2
+ display: inline-block;
3
+ font-family: inherit;
4
+ color: var(--intergalactic-text-link, oklch(0.53 0.21 263));
5
+ line-height: normal;
5
6
  position: relative;
6
7
  cursor: pointer;
7
8
  text-decoration: none;
9
+ border: none;
10
+ padding: 0;
11
+ margin: 0;
12
+ box-shadow: none;
8
13
  -webkit-tap-highlight-color: transparent;
14
+ outline: 0;
9
15
  background: none;
10
16
  transition: color 0.15s ease-in-out;
11
17
 
18
+ &:active,
19
+ &:hover,
20
+ &:focus {
21
+ outline: 0;
22
+ text-decoration: none;
23
+ }
24
+
12
25
  &::-moz-focus-inner {
13
26
  border: none;
14
27
  padding: 0;
@@ -17,10 +30,10 @@ SLink {
17
30
  &[active],
18
31
  &:hover,
19
32
  &:active {
20
- color: var(--intergalactic-text-link-hover-active, oklch(0.51 0.206 263.4));
33
+ color: var(--intergalactic-text-link-hover-active, oklch(0.51 0.202 263));
21
34
 
22
35
  & SText {
23
- text-decoration-color: currentColor;
36
+ border-color: currentColor;
24
37
  }
25
38
  }
26
39
 
@@ -30,6 +43,12 @@ SLink {
30
43
  }
31
44
  }
32
45
 
46
+ SLink[keyboardFocused] {
47
+ outline-color: var(--intergalactic-keyboard-focus-outline, oklch(0.424 0.269 264.2 / 0.469));
48
+ outline-style: solid;
49
+ outline-width: 3px;
50
+ }
51
+
33
52
  SLink[visually-disabled] {
34
53
  opacity: var(--intergalactic-disabled-opacity, 0.4);
35
54
  cursor: default;
@@ -37,7 +56,7 @@ SLink[visually-disabled] {
37
56
  pointer-events: none;
38
57
  }
39
58
 
40
- SLink[noWrap] {
59
+ SLink[noWrapText] {
41
60
  white-space: nowrap;
42
61
  }
43
62
 
@@ -45,17 +64,13 @@ SLink[inline] {
45
64
  display: inline;
46
65
  }
47
66
 
48
- SInner {
49
- align-items: baseline;
50
- height: 100%;
51
- width: 100%;
52
- }
53
-
54
67
  SAddon {
55
- pointer-events: none;
56
- vertical-align: middle;
57
68
  display: inline-flex;
58
- margin-top: -2.5px;
69
+ justify-content: center;
70
+ align-items: center;
71
+ margin-bottom: var(--intergalactic-spacing-05x, 2px);
72
+ vertical-align: middle;
73
+ pointer-events: none;
59
74
  }
60
75
 
61
76
  SLink SAddon {
@@ -69,13 +84,10 @@ SLink SAddon {
69
84
  }
70
85
 
71
86
  SText {
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;
87
+ border-bottom-width: 1px;
88
+ border-bottom-style: solid;
89
+ border-color: transparent;
90
+ transition: border-bottom-color 0.15s ease-in-out;
79
91
  }
80
92
 
81
93
  SLink[text-color] {
@@ -1,3 +1,42 @@
1
- import type { LinkProps } from './Link.types';
2
- export { default } from './Link';
3
- export type { LinkProps };
1
+ import React from 'react';
2
+ import { Intergalactic, UnknownProperties } from '@semcore/core';
3
+ import { TextProps } from '@semcore/typography';
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;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/link",
3
3
  "description": "Semrush Link Component",
4
- "version": "5.45.0-prerelease.0",
4
+ "version": "5.45.0-prerelease.4",
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.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"
17
+ "@semcore/utils": "4.49.0-prerelease.4",
18
+ "@semcore/typography": "5.54.0-prerelease.4",
19
+ "@semcore/flex-box": "5.42.0-prerelease.4",
20
+ "@semcore/tooltip": "6.50.0-prerelease.4"
21
21
  },
22
22
  "peerDependencies": {
23
- "@semcore/core": "^2.40.0-prerelease.0",
23
+ "@semcore/core": "^2.40.0-prerelease.4",
24
24
  "react": "16.8 - 18",
25
25
  "react-dom": "16.8 - 18"
26
26
  },
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=Link.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Link.types.js","names":[],"sources":["../../src/Link.types.ts"],"sourcesContent":["import type { BoxProps, SimpleHintPopperProps } from '@semcore/base-components';\nimport type { NSText } from '@semcore/typography';\nimport type React from 'react';\n\nexport type LinkProps = BoxProps & NSText.BaseProps & {\n /**\n * CSS property of the display link (inline|inline-block)\n * @default false\n * @deprecated. You should use default inline-flex for all cases.\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 false\n */\n noWrap?: boolean;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n /**\n * The position of the popper relative to the trigger that called it.\n * @default top\n */\n hintPlacement?: SimpleHintPopperProps['placement'];\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=Link.types.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Link.types.js","names":[],"sources":["../../src/Link.types.ts"],"sourcesContent":["import type { BoxProps, SimpleHintPopperProps } from '@semcore/base-components';\nimport type { NSText } from '@semcore/typography';\nimport type React from 'react';\n\nexport type LinkProps = BoxProps & NSText.BaseProps & {\n /**\n * CSS property of the display link (inline|inline-block)\n * @default false\n * @deprecated. You should use default inline-flex for all cases.\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 false\n */\n noWrap?: boolean;\n /** Left addon tag */\n addonLeft?: React.ElementType;\n /** Right addon tag */\n addonRight?: React.ElementType;\n /**\n * The position of the popper relative to the trigger that called it.\n * @default top\n */\n hintPlacement?: SimpleHintPopperProps['placement'];\n};\n"],"mappings":"","ignoreList":[]}
@@ -1,26 +0,0 @@
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;
@@ -1,35 +0,0 @@
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
- };