@semcore/link 16.0.11 → 17.0.0-prerelease.17

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,154 +1,128 @@
1
- import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
2
- import _classCallCheck from "@babel/runtime/helpers/esm/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/esm/createClass";
4
- import _callSuper from "@babel/runtime/helpers/esm/callSuper";
5
- import _inherits from "@babel/runtime/helpers/esm/inherits";
6
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
7
- import { createComponent, sstyled, assignProps, CORE_INSTANCE, Component } from "@semcore/core";
2
+ import { createComponent, sstyled, Component, CORE_INSTANCE, assignProps } from "@semcore/core";
3
+ import { Box, Hint } from "@semcore/base-components";
8
4
  import addonTextChildren from "@semcore/core/lib/utils/addonTextChildren";
9
- import keyboardFocusEnhance from "@semcore/core/lib/utils/enhances/keyboardFocusEnhance";
10
5
  import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
11
6
  import hasLabels from "@semcore/core/lib/utils/hasLabels";
12
7
  import logger from "@semcore/core/lib/utils/logger";
13
- import { Box } from "@semcore/flex-box";
14
- import { Hint } from "@semcore/tooltip";
15
8
  import { Text } from "@semcore/typography";
16
9
  import React from "react";
17
10
  /*!__reshadow-styles__:"./style/link.shadow.css"*/
18
- var style = (
11
+ const style = (
19
12
  /*__reshadow_css_start__*/
20
13
  (sstyled.insert(
21
14
  /*__inner_css_start__*/
22
- ".___SLink_7kc3r_gg_{display:inline-block;font-family:inherit;color:var(--intergalactic-text-link, #006dca);line-height:normal;position:relative;cursor:pointer;border:0;padding:0;margin:0;box-shadow:none;-webkit-tap-highlight-color:transparent;background:0 0;transition:color .15s ease-in-out}.___SLink_7kc3r_gg_,.___SLink_7kc3r_gg_:active{-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SLink_7kc3r_gg_:hover{-webkit-text-decoration:none;text-decoration:none}}.___SLink_7kc3r_gg_::-moz-focus-inner{border:0;padding:0}.___SLink_7kc3r_gg_.__active_7kc3r_gg_,.___SLink_7kc3r_gg_:active{color:var(--intergalactic-text-link-hover-active, #044792)}@media (hover:hover){.___SLink_7kc3r_gg_:hover{color:var(--intergalactic-text-link-hover-active, #044792)}}.___SLink_7kc3r_gg_.__active_7kc3r_gg_ .___SText_7kc3r_gg_,.___SLink_7kc3r_gg_:active .___SText_7kc3r_gg_{border-color:currentColor}@media (hover:hover){.___SLink_7kc3r_gg_:hover .___SText_7kc3r_gg_{border-color:currentColor}}.___SLink_7kc3r_gg_.__enableVisited_7kc3r_gg_:visited{color:var(--intergalactic-text-link-visited, #8649e1)}@media (hover:hover){.___SLink_7kc3r_gg_.__enableVisited_7kc3r_gg_:visited:hover{color:var(--intergalactic-text-link-visited, #8649e1)}}.___SLink_7kc3r_gg_.__visually-disabled_7kc3r_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SLink_7kc3r_gg_.__noWrapText_7kc3r_gg_{white-space:nowrap}.___SLink_7kc3r_gg_.__inline_7kc3r_gg_{display:inline}.___SAddon_7kc3r_gg_{display:inline-flex;justify-content:center;align-items:center;margin-bottom:var(--intergalactic-spacing-05x, 2px);vertical-align:middle;pointer-events:none}.___SLink_7kc3r_gg_ .___SAddon_7kc3r_gg_:not(:only-child):first-child{margin-right:var(--intergalactic-spacing-1x, 4px)}.___SLink_7kc3r_gg_ .___SAddon_7kc3r_gg_:not(:only-child):last-child{margin-left:var(--intergalactic-spacing-1x, 4px)}.___SText_7kc3r_gg_{border-bottom-width:1px;border-bottom-style:solid;border-color:transparent;transition:border-bottom-color .15s ease-in-out}.___SLink_7kc3r_gg_.__text-color_7kc3r_gg_{color:var(--text-color_7kc3r)}.___SLink_7kc3r_gg_.__text-color_7kc3r_gg_.__active_7kc3r_gg_,.___SLink_7kc3r_gg_.__text-color_7kc3r_gg_:active{color:var(--text-color_7kc3r);filter:brightness(.8)}@media (hover:hover){.___SLink_7kc3r_gg_.__text-color_7kc3r_gg_:hover{color:var(--text-color_7kc3r);filter:brightness(.8)}}@media (prefers-reduced-motion){.___SLink_7kc3r_gg_,.___SText_7kc3r_gg_{transition:none}}",
15
+ ".___SLink_1dx8e_gg_{display:inline;align-items:center;color:var(--intergalactic-text-link, #006dca);position:relative;cursor:pointer;-webkit-tap-highlight-color:transparent;background:0 0;transition:color .15s ease-in-out}.___SLink_1dx8e_gg_,.___SLink_1dx8e_gg_:active{-webkit-text-decoration:none;text-decoration:none}@media (hover:hover){.___SLink_1dx8e_gg_:hover{-webkit-text-decoration:none;text-decoration:none}}.___SLink_1dx8e_gg_::-moz-focus-inner{border:0;padding:0}.___SLink_1dx8e_gg_.__active_1dx8e_gg_,.___SLink_1dx8e_gg_:active{color:var(--intergalactic-text-link-hover-active, #044792)}@media (hover:hover){.___SLink_1dx8e_gg_:hover{color:var(--intergalactic-text-link-hover-active, #044792)}}.___SLink_1dx8e_gg_.__active_1dx8e_gg_ .___SText_1dx8e_gg_,.___SLink_1dx8e_gg_:active .___SText_1dx8e_gg_{border-color:currentColor}@media (hover:hover){.___SLink_1dx8e_gg_:hover .___SText_1dx8e_gg_{border-color:currentColor}}.___SLink_1dx8e_gg_.__enableVisited_1dx8e_gg_:visited{color:var(--intergalactic-text-link-visited, #8649e1)}@media (hover:hover){.___SLink_1dx8e_gg_.__enableVisited_1dx8e_gg_:visited:hover{color:var(--intergalactic-text-link-visited, #8649e1)}}.___SLink_1dx8e_gg_.__visually-disabled_1dx8e_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SLink_1dx8e_gg_.__noWrap_1dx8e_gg_{white-space:nowrap}.___SLink_1dx8e_gg_.__inline_1dx8e_gg_{display:inline}.___SInner_1dx8e_gg_{align-items:baseline;height:100%;width:100%}.___SAddon_1dx8e_gg_{align-items:baseline;vertical-align:-2px;pointer-events:none;align-self:center}.___SLink_1dx8e_gg_ .___SAddon_1dx8e_gg_:not(:only-child):first-child{margin-right:var(--intergalactic-spacing-1x, 4px)}.___SLink_1dx8e_gg_ .___SAddon_1dx8e_gg_:not(:only-child):last-child{margin-left:var(--intergalactic-spacing-1x, 4px)}.___SText_1dx8e_gg_{border-bottom-width:1px;border-bottom-style:solid;border-color:transparent;transition:border-bottom-color .15s ease-in-out}.___SText_1dx8e_gg_.__ellipsis_1dx8e_gg_{vertical-align:middle}.___SLink_1dx8e_gg_.__text-color_1dx8e_gg_{color:var(--text-color_1dx8e)}.___SLink_1dx8e_gg_.__text-color_1dx8e_gg_.__active_1dx8e_gg_,.___SLink_1dx8e_gg_.__text-color_1dx8e_gg_:active{color:var(--text-color_1dx8e);filter:brightness(.8)}@media (hover:hover){.___SLink_1dx8e_gg_.__text-color_1dx8e_gg_:hover{color:var(--text-color_1dx8e);filter:brightness(.8)}}@media (prefers-reduced-motion){.___SLink_1dx8e_gg_,.___SText_1dx8e_gg_{transition:none}}",
23
16
  /*__inner_css_end__*/
24
- "7kc3r_gg_"
17
+ "1dx8e_gg_"
25
18
  ), /*__reshadow_css_end__*/
26
19
  {
27
- "__SLink": "___SLink_7kc3r_gg_",
28
- "_visually-disabled": "__visually-disabled_7kc3r_gg_",
29
- "_noWrapText": "__noWrapText_7kc3r_gg_",
30
- "_inline": "__inline_7kc3r_gg_",
31
- "__SAddon": "___SAddon_7kc3r_gg_",
32
- "__SText": "___SText_7kc3r_gg_",
33
- "_active": "__active_7kc3r_gg_",
34
- "_enableVisited": "__enableVisited_7kc3r_gg_",
35
- "_text-color": "__text-color_7kc3r_gg_",
36
- "--text-color": "--text-color_7kc3r"
20
+ "__SLink": "___SLink_1dx8e_gg_",
21
+ "_visually-disabled": "__visually-disabled_1dx8e_gg_",
22
+ "_noWrap": "__noWrap_1dx8e_gg_",
23
+ "_inline": "__inline_1dx8e_gg_",
24
+ "__SInner": "___SInner_1dx8e_gg_",
25
+ "__SAddon": "___SAddon_1dx8e_gg_",
26
+ "__SText": "___SText_1dx8e_gg_",
27
+ "_ellipsis": "__ellipsis_1dx8e_gg_",
28
+ "_active": "__active_1dx8e_gg_",
29
+ "_enableVisited": "__enableVisited_1dx8e_gg_",
30
+ "_text-color": "__text-color_1dx8e_gg_",
31
+ "--text-color": "--text-color_1dx8e"
37
32
  })
38
33
  );
39
- var RootLink = /* @__PURE__ */ (function(_Component) {
40
- function RootLink2() {
41
- var _this;
42
- _classCallCheck(this, RootLink2);
43
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
44
- args[_key] = arguments[_key];
45
- }
46
- _this = _callSuper(this, RootLink2, [].concat(args));
47
- _defineProperty(_this, "containerRef", /* @__PURE__ */ React.createRef());
48
- _defineProperty(_this, "state", {
34
+ class RootLink extends Component {
35
+ constructor(...args) {
36
+ super(...args);
37
+ _defineProperty(this, "containerRef", /* @__PURE__ */ React.createRef());
38
+ _defineProperty(this, "state", {
49
39
  ariaLabelledByContent: ""
50
40
  });
51
- return _this;
52
41
  }
53
- _inherits(RootLink2, _Component);
54
- return _createClass(RootLink2, [{
55
- key: "componentDidMount",
56
- value: function componentDidMount() {
57
- var _this2 = this;
58
- if (process.env.NODE_ENV !== "production") {
59
- logger.warn(this.containerRef.current && !hasLabels(this.containerRef.current), "'title' or 'aria-label' or 'aria-labelledby' are required props for links without text content", this.asProps["data-ui-name"] || RootLink2.displayName);
60
- }
61
- if (this.asProps["aria-labelledby"]) {
62
- setTimeout(function() {
63
- var _document$getElementB, _document$getElementB2;
64
- _this2.setState({
65
- ariaLabelledByContent: (_document$getElementB = (_document$getElementB2 = document.getElementById(_this2.asProps["aria-labelledby"])) === null || _document$getElementB2 === void 0 ? void 0 : _document$getElementB2.textContent) !== null && _document$getElementB !== void 0 ? _document$getElementB : ""
66
- });
67
- }, 0);
68
- }
69
- }
70
- }, {
71
- key: "renderLink",
72
- value: function renderLink(_ref0) {
73
- var _ref = this.asProps, _ref5;
74
- var linkProps = _ref0.linkProps, children = _ref0.children;
75
- var styles = this.asProps.styles;
76
- var SLink = Text;
77
- return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SLink, _ref5.cn("SLink", _objectSpread({}, assignProps(_objectSpread({}, linkProps), _ref))), children);
42
+ componentDidMount() {
43
+ if (process.env.NODE_ENV !== "production") {
44
+ logger.warn(this.containerRef.current && !hasLabels(this.containerRef.current), `'title' or 'aria-label' or 'aria-labelledby' are required props for links without text content`, this.asProps["data-ui-name"] || RootLink.displayName);
78
45
  }
79
- }, {
80
- key: "renderLinkWithHint",
81
- value: function renderLinkWithHint(_ref1) {
82
- var _ref2 = this.asProps, _ref6;
83
- var linkProps = _ref1.linkProps, children = _ref1.children, hintProps = _ref1.hintProps;
84
- var styles = this.asProps.styles;
85
- var SLink = Hint;
86
- return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SLink, _ref6.cn("SLink", _objectSpread({}, assignProps(_objectSpread(_objectSpread({}, linkProps), hintProps), _ref2))), children);
46
+ if (this.asProps["aria-labelledby"]) {
47
+ setTimeout(() => {
48
+ var _a;
49
+ this.setState({
50
+ ariaLabelledByContent: ((_a = document.getElementById(this.asProps["aria-labelledby"])) == null ? void 0 : _a.textContent) ?? ""
51
+ });
52
+ }, 0);
87
53
  }
88
- }, {
89
- key: "render",
90
- value: function render() {
91
- var _ref7, _ref10, _ref11;
92
- var _this$asProps = this.asProps, styles = _this$asProps.styles, noWrap = _this$asProps.noWrap, color = _this$asProps.color, resolveColor = _this$asProps.resolveColor, disabled = _this$asProps.disabled, href = _this$asProps.href, hasChildren = _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;
93
- var Link2 = this[CORE_INSTANCE];
94
- var children = (_ref7 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, AddonLeft ? /* @__PURE__ */ React.createElement(Link2.Addon, null, /* @__PURE__ */ React.createElement(AddonLeft, _ref7.cn("AddonLeft", {}))) : null, addonTextChildren(Children, Link2.Text, Link2.Addon), AddonRight ? /* @__PURE__ */ React.createElement(Link2.Addon, null, /* @__PURE__ */ React.createElement(AddonRight, _ref7.cn("AddonRight", {}))) : null));
95
- var hintContent = (_ref10 = (_ref11 = title !== null && title !== void 0 ? title : ariaLabel) !== null && _ref11 !== void 0 ? _ref11 : this.state.ariaLabelledByContent) !== null && _ref10 !== void 0 ? _ref10 : "";
96
- var linkProps = {
54
+ }
55
+ render() {
56
+ var _ref = this.asProps, _ref4;
57
+ const {
58
+ styles,
59
+ color,
60
+ resolveColor,
61
+ disabled,
62
+ href,
63
+ children,
64
+ addonLeft: AddonLeft,
65
+ addonRight: AddonRight,
66
+ Children,
67
+ title,
68
+ "aria-label": ariaLabel,
69
+ hintPlacement
70
+ } = this.asProps;
71
+ const Link2 = this[CORE_INSTANCE];
72
+ const SLink = Text;
73
+ const SInner = Box;
74
+ const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? "";
75
+ const showHint = children === void 0 || title;
76
+ return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SLink, _ref4.cn("SLink", {
77
+ ...assignProps({
97
78
  "role": "link",
98
79
  "tabIndex": disabled ? -1 : 0,
99
80
  "use:href": disabled ? void 0 : href,
100
81
  "visually-disabled": disabled,
101
- "render": Text,
102
82
  "text-color": resolveColor(color),
103
83
  "tag": "a",
104
- "noWrapText": noWrap,
105
- "use:noWrap": false,
106
84
  "ref": this.containerRef,
107
- "__excludeProps": ["disabled", "aria-disabled"]
108
- };
109
- var hintProps = {
110
- title: hintContent,
111
- timeout: [250, 50],
112
- placement: hintPlacement,
113
- __excludeProps: []
114
- };
115
- if (hasChildren === void 0 || title) {
116
- return this.renderLinkWithHint({
117
- linkProps,
118
- hintProps,
119
- children
120
- });
121
- }
122
- return this.renderLink({
123
- linkProps,
124
- children
125
- });
126
- }
127
- }]);
128
- })(Component);
85
+ "__excludeProps": ["disabled", "aria-disabled"],
86
+ "aria-label": showHint ? hintContent : void 0
87
+ }, _ref)
88
+ }), /* @__PURE__ */ React.createElement(SInner, _ref4.cn("SInner", {
89
+ "tag": "span",
90
+ "data-ui-name": `${this.asProps["data-ui-name"]}.InnerWrapper`
91
+ }), 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", {
92
+ "triggerRef": this.containerRef,
93
+ "timeout": [250, 50],
94
+ "placement": hintPlacement
95
+ }), hintContent));
96
+ }
97
+ }
129
98
  _defineProperty(RootLink, "displayName", "Link");
130
- _defineProperty(RootLink, "defaultProps", {
131
- noWrap: true
132
- });
133
99
  _defineProperty(RootLink, "style", style);
134
- _defineProperty(RootLink, "enhance", [keyboardFocusEnhance(), resolveColorEnhance()]);
100
+ _defineProperty(RootLink, "enhance", [resolveColorEnhance()]);
135
101
  function LinkText(props) {
136
- var _ref3 = arguments[0], _ref8;
137
- var SText = Box;
138
- var styles = props.styles;
139
- return _ref8 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref8.cn("SText", _objectSpread({}, assignProps({
140
- "tag": "span"
141
- }, _ref3))));
102
+ var _ref2 = arguments[0], _ref5;
103
+ const SText = Text;
104
+ const {
105
+ styles
106
+ } = props;
107
+ return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref5.cn("SText", {
108
+ ...assignProps({
109
+ "tag": "span"
110
+ }, _ref2)
111
+ }));
142
112
  }
143
113
  function Addon(props) {
144
- var _ref4 = arguments[0], _ref9;
145
- var SAddon = Box;
146
- var styles = props.styles;
147
- return _ref9 = sstyled(styles), /* @__PURE__ */ React.createElement(SAddon, _ref9.cn("SAddon", _objectSpread({}, assignProps({
148
- "tag": "span"
149
- }, _ref4))));
114
+ var _ref3 = arguments[0], _ref6;
115
+ const SAddon = Box;
116
+ const {
117
+ styles
118
+ } = props;
119
+ return _ref6 = sstyled(styles), /* @__PURE__ */ React.createElement(SAddon, _ref6.cn("SAddon", {
120
+ ...assignProps({
121
+ "tag": "span"
122
+ }, _ref3)
123
+ }));
150
124
  }
151
- var Link = createComponent(RootLink, {
125
+ const Link = createComponent(RootLink, {
152
126
  Text: LinkText,
153
127
  Addon
154
128
  });
@@ -1,15 +1,10 @@
1
1
  SLink {
2
- display: inline-block;
3
- font-family: inherit;
2
+ display: inline;
3
+ align-items: center;
4
4
  color: var(--intergalactic-text-link, #006dca);
5
- line-height: normal;
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
9
  background: none;
15
10
  transition: color 0.15s ease-in-out;
@@ -47,7 +42,7 @@ SLink[visually-disabled] {
47
42
  pointer-events: none;
48
43
  }
49
44
 
50
- SLink[noWrapText] {
45
+ SLink[noWrap] {
51
46
  white-space: nowrap;
52
47
  }
53
48
 
@@ -55,13 +50,17 @@ SLink[inline] {
55
50
  display: inline;
56
51
  }
57
52
 
53
+ SInner {
54
+ align-items: baseline;
55
+ height: 100%;
56
+ width: 100%;
57
+ }
58
+
58
59
  SAddon {
59
- display: inline-flex;
60
- justify-content: center;
61
- align-items: center;
62
- margin-bottom: var(--intergalactic-spacing-05x, 2px);
63
- vertical-align: middle;
60
+ align-items: baseline;
61
+ vertical-align: -2px;
64
62
  pointer-events: none;
63
+ align-self: center;
65
64
  }
66
65
 
67
66
  SLink SAddon {
@@ -80,6 +79,9 @@ SText {
80
79
  border-color: transparent;
81
80
  transition: border-bottom-color 0.15s ease-in-out;
82
81
  }
82
+ SText[ellipsis] {
83
+ vertical-align: middle;
84
+ }
83
85
 
84
86
  SLink[text-color] {
85
87
  color: var(--text-color);
@@ -0,0 +1,25 @@
1
+ import type { BoxProps } from '@semcore/base-components';
2
+ import type { Intergalactic } from '@semcore/core';
3
+ import { Component } from '@semcore/core';
4
+ import type { TextProps } 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
+ render(): React.ReactNode;
20
+ }
21
+ declare const Link: Intergalactic.Component<"a", LinkProps, {}, typeof RootLink.enhance> & {
22
+ Text: Intergalactic.Component<"span", TextProps>;
23
+ Addon: Intergalactic.Component<"span", BoxProps>;
24
+ };
25
+ export default Link;
@@ -0,0 +1,36 @@
1
+ import type { SimpleHintPopperProps } from '@semcore/base-components';
2
+ import type { Intergalactic } from '@semcore/core';
3
+ import type { TextProps } from '@semcore/typography';
4
+ import type React from 'react';
5
+ export type LinkProps = Intergalactic.InternalTypings.EfficientOmit<TextProps, 'ellipsis' | 'hintProps'> & {
6
+ /**
7
+ * CSS property of the display link (inline|inline-block)
8
+ * @default false
9
+ * @deprecated. You should use default inline-flex for all cases.
10
+ */
11
+ inline?: boolean;
12
+ /**
13
+ * Sets the link to the disabled state
14
+ */
15
+ disabled?: boolean;
16
+ /**
17
+ * Sets the link to the active state
18
+ */
19
+ active?: boolean;
20
+ /** This flag enables highlighting of the visited link
21
+ */
22
+ enableVisited?: boolean;
23
+ /** The text will not be moved to a new line
24
+ * @default false
25
+ */
26
+ noWrap?: boolean;
27
+ /** Left addon tag */
28
+ addonLeft?: React.ElementType;
29
+ /** Right addon tag */
30
+ addonRight?: React.ElementType;
31
+ /**
32
+ * The position of the popper relative to the trigger that called it.
33
+ * @default top
34
+ */
35
+ hintPlacement?: SimpleHintPopperProps['placement'];
36
+ };
@@ -1,40 +1,3 @@
1
- import type { Intergalactic, UnknownProperties } from '@semcore/core';
2
- import type { BoxProps } from '@semcore/flex-box';
3
- import type { TextProps } from '@semcore/typography';
4
- import type React from 'react';
5
-
6
- /** @deprecated */
7
- export interface ILinkProps extends LinkProps, UnknownProperties {}
8
- export type LinkProps = TextProps & {
9
- /**
10
- * CSS property of the display link (inline|inline-block)
11
- * @default false
12
- */
13
- inline?: boolean;
14
- /**
15
- * Sets the link to the disabled state
16
- */
17
- disabled?: boolean;
18
- /**
19
- * Sets the link to the active state
20
- */
21
- active?: boolean;
22
- /** This flag enables highlighting of the visited link
23
- */
24
- enableVisited?: boolean;
25
- /** The text will not be moved to a new line
26
- * @default true
27
- */
28
- noWrap?: boolean;
29
- /** Left addon tag */
30
- addonLeft?: React.ElementType;
31
- /** Right addon tag */
32
- addonRight?: React.ElementType;
33
- };
34
-
35
- declare const Link: Intergalactic.Component<'a', LinkProps> & {
36
- Text: Intergalactic.Component<'span', TextProps>;
37
- Addon: Intergalactic.Component<'span', BoxProps>;
38
- };
39
-
40
- 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": "16.0.11",
4
+ "version": "17.0.0-prerelease.17",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,12 +14,11 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/flex-box": "16.0.11",
18
- "@semcore/tooltip": "16.0.11",
19
- "@semcore/typography": "16.3.1"
17
+ "@semcore/tooltip": "^17.0.0-prerelease.17",
18
+ "@semcore/typography": "^16.3.3-prerelease.17"
20
19
  },
21
20
  "peerDependencies": {
22
- "@semcore/base-components": "^16.0.0"
21
+ "@semcore/base-components": "^17.0.0-prerelease.17"
23
22
  },
24
23
  "repository": {
25
24
  "type": "git",
@@ -27,11 +26,12 @@
27
26
  "directory": "semcore/link"
28
27
  },
29
28
  "devDependencies": {
30
- "@semcore/core": "16.5.1",
29
+ "@semcore/core": "17.0.0-prerelease.17",
30
+ "@semcore/base-components": "17.0.0-prerelease.17",
31
31
  "@semcore/testing-utils": "1.0.0",
32
- "@semcore/icon": "16.7.2"
32
+ "@semcore/icon": "16.7.2-prerelease.17"
33
33
  },
34
34
  "scripts": {
35
- "build": "pnpm semcore-builder --source=js && pnpm vite build"
35
+ "build": "pnpm semcore-builder && pnpm vite build"
36
36
  }
37
37
  }
@@ -1,2 +0,0 @@
1
- "use strict";
2
- //# sourceMappingURL=index.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { Intergalactic, UnknownProperties } from '@semcore/core';\nimport type { BoxProps } from '@semcore/flex-box';\nimport type { TextProps } from '@semcore/typography';\nimport type React from 'react';\n\n/** @deprecated */\nexport interface ILinkProps extends LinkProps, UnknownProperties {}\nexport type LinkProps = TextProps & {\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":"","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=index.d.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.js","names":[],"sources":["../../src/index.d.ts"],"sourcesContent":["import type { Intergalactic, UnknownProperties } from '@semcore/core';\nimport type { BoxProps } from '@semcore/flex-box';\nimport type { TextProps } from '@semcore/typography';\nimport type React from 'react';\n\n/** @deprecated */\nexport interface ILinkProps extends LinkProps, UnknownProperties {}\nexport type LinkProps = TextProps & {\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":"","ignoreList":[]}