@semcore/link 17.0.0-prerelease.30 → 17.0.0-prerelease.31

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 CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  CHANGELOG.md standards are inspired by [keepachangelog.com](https://keepachangelog.com/en/1.0.0/).
4
4
 
5
- ## [17.0.0] - 2026-03-09
5
+ ## [17.0.0] - 2026-03-27
6
6
 
7
7
  ### BREAK
8
8
 
package/lib/cjs/Link.js CHANGED
@@ -15,21 +15,20 @@ var _logger = _interopRequireDefault(require("@semcore/core/lib/utils/logger"));
15
15
  var _typography = require("@semcore/typography");
16
16
  var _react = _interopRequireDefault(require("react"));
17
17
  /*!__reshadow-styles__:"./style/link.shadow.css"*/
18
- const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___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}}", /*__inner_css_end__*/"1dx8e_gg_"),
18
+ const style = (/*__reshadow_css_start__*/_core.sstyled.insert(/*__inner_css_start__*/".___SLink_10jj4_gg_{display:inline;align-items:center;color:var(--intergalactic-text-link, #006dca);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_10jj4_gg_::-moz-focus-inner{border:0;padding:0}.___SLink_10jj4_gg_.__active_10jj4_gg_,.___SLink_10jj4_gg_:active{color:var(--intergalactic-text-link-hover-active, #044792)}@media (hover:hover){.___SLink_10jj4_gg_:hover{color:var(--intergalactic-text-link-hover-active, #044792)}}.___SLink_10jj4_gg_.__active_10jj4_gg_ .___SText_10jj4_gg_,.___SLink_10jj4_gg_:active .___SText_10jj4_gg_{text-decoration-color:currentColor}@media (hover:hover){.___SLink_10jj4_gg_:hover .___SText_10jj4_gg_{text-decoration-color:currentColor}}.___SLink_10jj4_gg_.__enableVisited_10jj4_gg_:visited{color:var(--intergalactic-text-link-visited, #8649e1)}@media (hover:hover){.___SLink_10jj4_gg_.__enableVisited_10jj4_gg_:visited:hover{color:var(--intergalactic-text-link-visited, #8649e1)}}.___SLink_10jj4_gg_.__visually-disabled_10jj4_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SLink_10jj4_gg_.__noWrap_10jj4_gg_{white-space:nowrap}.___SLink_10jj4_gg_.__inline_10jj4_gg_{display:inline}.___SInner_10jj4_gg_{align-items:baseline;height:100%;width:100%}.___SAddon_10jj4_gg_{pointer-events:none;vertical-align:middle;display:inline-flex;margin-top:-2.5px}.___SLink_10jj4_gg_ .___SAddon_10jj4_gg_:not(:only-child):first-child{margin-right:var(--intergalactic-spacing-1x, 4px)}.___SLink_10jj4_gg_ .___SAddon_10jj4_gg_:not(:only-child):last-child{margin-left:var(--intergalactic-spacing-1x, 4px)}.___SText_10jj4_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_10jj4_gg_.__text-color_10jj4_gg_{color:var(--text-color_10jj4)}.___SLink_10jj4_gg_.__text-color_10jj4_gg_.__active_10jj4_gg_,.___SLink_10jj4_gg_.__text-color_10jj4_gg_:active{color:var(--text-color_10jj4);filter:brightness(.8)}@media (hover:hover){.___SLink_10jj4_gg_.__text-color_10jj4_gg_:hover{color:var(--text-color_10jj4);filter:brightness(.8)}}@media (prefers-reduced-motion){.___SLink_10jj4_gg_,.___SText_10jj4_gg_{transition:none}}", /*__inner_css_end__*/"10jj4_gg_"),
19
19
  /*__reshadow_css_end__*/
20
20
  {
21
- "__SLink": "___SLink_1dx8e_gg_",
22
- "_visually-disabled": "__visually-disabled_1dx8e_gg_",
23
- "_noWrap": "__noWrap_1dx8e_gg_",
24
- "_inline": "__inline_1dx8e_gg_",
25
- "__SInner": "___SInner_1dx8e_gg_",
26
- "__SAddon": "___SAddon_1dx8e_gg_",
27
- "__SText": "___SText_1dx8e_gg_",
28
- "_ellipsis": "__ellipsis_1dx8e_gg_",
29
- "_active": "__active_1dx8e_gg_",
30
- "_enableVisited": "__enableVisited_1dx8e_gg_",
31
- "_text-color": "__text-color_1dx8e_gg_",
32
- "--text-color": "--text-color_1dx8e"
21
+ "__SLink": "___SLink_10jj4_gg_",
22
+ "_visually-disabled": "__visually-disabled_10jj4_gg_",
23
+ "_noWrap": "__noWrap_10jj4_gg_",
24
+ "_inline": "__inline_10jj4_gg_",
25
+ "__SInner": "___SInner_10jj4_gg_",
26
+ "__SAddon": "___SAddon_10jj4_gg_",
27
+ "__SText": "___SText_10jj4_gg_",
28
+ "_active": "__active_10jj4_gg_",
29
+ "_enableVisited": "__enableVisited_10jj4_gg_",
30
+ "_text-color": "__text-color_10jj4_gg_",
31
+ "--text-color": "--text-color_10jj4"
33
32
  });
34
33
  class RootLink extends _core.Component {
35
34
  constructor(...args) {
@@ -51,19 +50,9 @@ class RootLink extends _core.Component {
51
50
  }, 0);
52
51
  }
53
52
  }
54
- getTextProps(props) {
55
- if ('hintProps' in props) {
56
- return {
57
- 'use:hintProps': {
58
- triggerRef: this.containerRef,
59
- ...props.hintProps
60
- }
61
- };
62
- }
53
+ getTextProps() {
63
54
  return {
64
- 'use:hintProps': {
65
- triggerRef: this.containerRef
66
- }
55
+ 'hint:triggerRef': this.containerRef
67
56
  };
68
57
  }
69
58
  render() {
@@ -89,16 +78,19 @@ class RootLink extends _core.Component {
89
78
  const SInner = _baseComponents.Box;
90
79
  const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';
91
80
  const showHint = children === undefined || title;
81
+ const excludeProps = ['title', 'aria-disabled'];
82
+ if (!this.asProps['use:disabled']) {
83
+ excludeProps.push('disabled');
84
+ }
92
85
  return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(SLink, _ref4.cn("SLink", {
93
86
  ...(0, _core.assignProps)({
94
- "role": 'link',
95
87
  "tabIndex": disabled ? -1 : 0,
96
88
  "use:href": disabled ? undefined : href,
97
89
  "visually-disabled": disabled,
98
90
  "text-color": resolveColor(color),
99
91
  "tag": 'a',
100
92
  "ref": this.containerRef,
101
- "__excludeProps": ['disabled', 'aria-disabled', 'title'],
93
+ "__excludeProps": excludeProps,
102
94
  "aria-label": showHint ? hintContent : undefined
103
95
  }, _ref)
104
96
  }), /*#__PURE__*/_react.default.createElement(SInner, _ref4.cn("SInner", {
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","names":["_core","require","_baseComponents","_addonTextChildren","_interopRequireDefault","_resolveColorEnhance","_hasLabels","_logger","_typography","_react","style","sstyled","insert","RootLink","Component","constructor","args","_defineProperty2","default","React","createRef","ariaLabelledByContent","componentDidMount","process","env","NODE_ENV","logger","warn","containerRef","current","hasLabels","asProps","displayName","setTimeout","setState","document","getElementById","textContent","getTextProps","props","triggerRef","hintProps","render","_ref","_ref4","styles","color","resolveColor","disabled","href","children","addonLeft","AddonLeft","addonRight","AddonRight","Children","title","ariaLabel","hintPlacement","Link","CORE_INSTANCE","SLink","Text","SInner","Box","hintContent","state","showHint","undefined","createElement","Fragment","cn","assignProps","Addon","addonTextChildren","Hint","resolveColorEnhance","LinkText","_ref2","arguments[0]","_ref5","SText","_ref3","_ref6","SAddon","createComponent","_default","exports"],"sources":["../../src/Link.tsx"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport { Box, Hint } from '@semcore/base-components';\nimport type { Intergalactic, IRootComponentProps } from '@semcore/core';\nimport { createComponent, Component, Root, sstyled, CORE_INSTANCE } from '@semcore/core';\nimport addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport hasLabels from '@semcore/core/lib/utils/hasLabels';\nimport logger from '@semcore/core/lib/utils/logger';\nimport type { TextProps } from '@semcore/typography';\nimport { Text } from '@semcore/typography';\nimport React from 'react';\n\nimport type { LinkProps } from './Link.types';\nimport style from './style/link.shadow.css';\n\ntype State = {\n ariaLabelledByContent: string;\n};\n\nclass RootLink extends Component<LinkProps, typeof RootLink.enhance, never, {}, State> {\n static displayName = 'Link';\n\n static style = style;\n static enhance = [resolveColorEnhance()] as const;\n containerRef = React.createRef<HTMLElement | null>();\n\n state: State = {\n ariaLabelledByContent: '',\n };\n\n componentDidMount() {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(\n this.containerRef.current && !hasLabels(this.containerRef.current),\n `'title' or 'aria-label' or 'aria-labelledby' are required props for links without text content`,\n this.asProps['data-ui-name'] || RootLink.displayName,\n );\n }\n\n if (this.asProps['aria-labelledby']) {\n setTimeout(() => {\n this.setState({\n ariaLabelledByContent:\n document.getElementById(this.asProps['aria-labelledby'])?.textContent ?? '',\n });\n }, 0);\n }\n }\n\n getTextProps(props: TextProps) {\n if ('hintProps' in props) {\n return {\n 'use:hintProps': { triggerRef: this.containerRef, ...props.hintProps },\n };\n }\n\n return {\n 'use:hintProps': { triggerRef: this.containerRef },\n };\n }\n\n render() {\n const {\n styles,\n color,\n resolveColor,\n disabled,\n href,\n children,\n addonLeft: AddonLeft,\n addonRight: AddonRight,\n Children,\n title,\n 'aria-label': ariaLabel,\n hintPlacement,\n } = this.asProps;\n // @ts-ignore\n const Link = this[CORE_INSTANCE];\n const SLink = Root;\n const SInner = Box;\n const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';\n const showHint = children === undefined || title;\n return sstyled(styles)(\n <>\n <SLink\n role='link'\n tabIndex={disabled ? -1 : 0}\n use:href={disabled ? undefined : href}\n visually-disabled={disabled}\n render={Text}\n text-color={resolveColor(color)}\n tag='a'\n ref={this.containerRef}\n __excludeProps={['disabled', 'aria-disabled', 'title']}\n aria-label={showHint ? hintContent : undefined}\n >\n <SInner\n tag='span'\n data-ui-name={`${this.asProps['data-ui-name']}.InnerWrapper`}\n >\n {AddonLeft\n ? (\n <Link.Addon>\n <AddonLeft />\n </Link.Addon>\n )\n : null}\n {addonTextChildren(Children, Link.Text, Link.Addon)}\n {AddonRight\n ? (\n <Link.Addon>\n <AddonRight />\n </Link.Addon>\n )\n : null}\n </SInner>\n </SLink>\n {showHint && (\n <Hint\n triggerRef={this.containerRef}\n timeout={[250, 50]}\n placement={hintPlacement}\n >\n {hintContent}\n </Hint>\n )}\n </>,\n );\n }\n}\n\nfunction LinkText(props: IRootComponentProps) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Text} />);\n}\n\nfunction Addon(props: IRootComponentProps) {\n const SAddon = Root;\n const { styles } = props;\n return sstyled(styles)(<SAddon render={Box} tag='span' />);\n}\n\nconst Link = createComponent(RootLink, {\n Text: LinkText,\n Addon,\n}) as Intergalactic.Component<'a', LinkProps, {}, typeof RootLink.enhance> & {\n Text: Intergalactic.Component<'span', TextProps>;\n Addon: Intergalactic.Component<'span', BoxProps>;\n};\n\nexport default Link;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AAFA,IAAAC,eAAA,GAAAD,OAAA;AAGA,IAAAE,kBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,oBAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,UAAA,GAAAF,sBAAA,CAAAH,OAAA;AACA,IAAAM,OAAA,GAAAH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C,SAASC,QAAQA,CAACtC,KAA0B,EAAE;EAAA,IAAAuC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EAC5C,MAAMC,KAAK,GAE2BnB,gBAAI;EAD1C,MAAM;IAAEjB;EAAO,CAAC,GAAGN,KAAK;EACxB,OAAAyC,KAAA,GAAO,IAAArE,aAAO,EAACkC,MAAM,CAAC,eAACpC,MAAA,CAAAS,OAAA,CAAAmD,aAAA,CAACY,KAAK,EAAAD,KAAA,CAAAT,EAAA;IAAA,OAAAvE,KAAA,CAAAwE,WAAA,MAAAM,KAAA;EAAA,EAAgB,CAAC;AAChD;AAEA,SAASL,KAAKA,CAAClC,KAA0B,EAAE;EAAA,IAAA2C,KAAA,GAAAH,YAAA;IAAAI,KAAA;EACzC,MAAMC,MAAM,GAE2BpB,mBAAG;EAD1C,MAAM;IAAEnB;EAAO,CAAC,GAAGN,KAAK;EACxB,OAAA4C,KAAA,GAAO,IAAAxE,aAAO,EAACkC,MAAM,CAAC,eAACpC,MAAA,CAAAS,OAAA,CAAAmD,aAAA,CAACe,MAAM,EAAAD,KAAA,CAAAZ,EAAA;IAAA,OAAAvE,KAAA,CAAAwE,WAAA;MAAA,OAAkB;IAAM,GAAAU,KAAA;EAAA,EAAE,CAAC;AAC3D;AAEA,MAAMvB,IAAI,GAAG,IAAA0B,qBAAe,EAACxE,QAAQ,EAAE;EACrCiD,IAAI,EAAEe,QAAQ;EACdJ;AACF,CAAC,CAGA;AAAC,IAAAa,QAAA,GAAAC,OAAA,CAAArE,OAAA,GAEayC,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Link.js","names":["_core","require","_baseComponents","_addonTextChildren","_interopRequireDefault","_resolveColorEnhance","_hasLabels","_logger","_typography","_react","style","sstyled","insert","RootLink","Component","constructor","args","_defineProperty2","default","React","createRef","ariaLabelledByContent","componentDidMount","process","env","NODE_ENV","logger","warn","containerRef","current","hasLabels","asProps","displayName","setTimeout","setState","document","getElementById","textContent","getTextProps","render","_ref","_ref4","styles","color","resolveColor","disabled","href","children","addonLeft","AddonLeft","addonRight","AddonRight","Children","title","ariaLabel","hintPlacement","Link","CORE_INSTANCE","SLink","Text","SInner","Box","hintContent","state","showHint","undefined","excludeProps","push","createElement","Fragment","cn","assignProps","Addon","addonTextChildren","Hint","resolveColorEnhance","LinkText","props","_ref2","arguments[0]","_ref5","SText","_ref3","_ref6","SAddon","createComponent","_default","exports"],"sources":["../../src/Link.tsx"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport { Box, Hint } from '@semcore/base-components';\nimport type { Intergalactic, IRootComponentProps } from '@semcore/core';\nimport { createComponent, Component, Root, sstyled, CORE_INSTANCE } from '@semcore/core';\nimport addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport hasLabels from '@semcore/core/lib/utils/hasLabels';\nimport logger from '@semcore/core/lib/utils/logger';\nimport type { TextProps, TextHintProps } from '@semcore/typography';\nimport { Text } from '@semcore/typography';\nimport React from 'react';\n\nimport type { LinkProps } from './Link.types';\nimport style from './style/link.shadow.css';\n\ntype State = {\n ariaLabelledByContent: string;\n};\n\nclass RootLink extends Component<LinkProps, typeof RootLink.enhance, never, {}, State> {\n static displayName = 'Link';\n\n static style = style;\n static enhance = [resolveColorEnhance()] as const;\n containerRef = React.createRef<HTMLElement | null>();\n\n state: State = {\n ariaLabelledByContent: '',\n };\n\n componentDidMount() {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(\n this.containerRef.current && !hasLabels(this.containerRef.current),\n `'title' or 'aria-label' or 'aria-labelledby' are required props for links without text content`,\n this.asProps['data-ui-name'] || RootLink.displayName,\n );\n }\n\n if (this.asProps['aria-labelledby']) {\n setTimeout(() => {\n this.setState({\n ariaLabelledByContent:\n document.getElementById(this.asProps['aria-labelledby'])?.textContent ?? '',\n });\n }, 0);\n }\n }\n\n getTextProps(): TextHintProps {\n return {\n 'hint:triggerRef': this.containerRef,\n };\n }\n\n render() {\n const {\n styles,\n color,\n resolveColor,\n disabled,\n href,\n children,\n addonLeft: AddonLeft,\n addonRight: AddonRight,\n Children,\n title,\n 'aria-label': ariaLabel,\n hintPlacement,\n } = this.asProps;\n // @ts-ignore\n const Link = this[CORE_INSTANCE];\n const SLink = Root;\n const SInner = Box;\n const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';\n const showHint = children === undefined || title;\n\n const excludeProps = ['title', 'aria-disabled'];\n if (!this.asProps['use:disabled']) {\n excludeProps.push('disabled');\n }\n\n return sstyled(styles)(\n <>\n <SLink\n tabIndex={disabled ? -1 : 0}\n use:href={disabled ? undefined : href}\n visually-disabled={disabled}\n render={Text}\n text-color={resolveColor(color)}\n tag='a'\n ref={this.containerRef}\n __excludeProps={excludeProps}\n aria-label={showHint ? hintContent : undefined}\n >\n <SInner\n tag='span'\n data-ui-name={`${this.asProps['data-ui-name']}.InnerWrapper`}\n >\n {AddonLeft\n ? (\n <Link.Addon>\n <AddonLeft />\n </Link.Addon>\n )\n : null}\n {addonTextChildren(Children, Link.Text, Link.Addon)}\n {AddonRight\n ? (\n <Link.Addon>\n <AddonRight />\n </Link.Addon>\n )\n : null}\n </SInner>\n </SLink>\n {showHint && (\n <Hint\n triggerRef={this.containerRef}\n timeout={[250, 50]}\n placement={hintPlacement}\n >\n {hintContent}\n </Hint>\n )}\n </>,\n );\n }\n}\n\nfunction LinkText(props: IRootComponentProps) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Text} />);\n}\n\nfunction Addon(props: IRootComponentProps) {\n const SAddon = Root;\n const { styles } = props;\n return sstyled(styles)(<SAddon render={Box} tag='span' />);\n}\n\nconst Link = createComponent(RootLink, {\n Text: LinkText,\n Addon,\n}) as Intergalactic.Component<'a', LinkProps, {}, typeof RootLink.enhance> & {\n Text: Intergalactic.Component<'span', TextProps>;\n Addon: Intergalactic.Component<'span', BoxProps>;\n};\n\nexport default Link;\n"],"mappings":";;;;;;;;AAGA,IAAA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AAI,gBAAA,CAAAC,OAAA,EADvBL,QAAQ,WAGGH,KAAK;AAAA,IAAAO,gBAAA,CAAAC,OAAA,EAHhBL,QAAQ,aAIK,CAAC,IAAA8D,4BAAmB,EAAC,CAAC,CAAC;AA2G1C,SAASC,QAAQA,CAACC,KAA0B,EAAE;EAAA,IAAAC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EAC5C,MAAMC,KAAK,GAE2BtB,gBAAI;EAD1C,MAAM;IAAEjB;EAAO,CAAC,GAAGmC,KAAK;EACxB,OAAAG,KAAA,GAAO,IAAArE,aAAO,EAAC+B,MAAM,CAAC,eAACjC,MAAA,CAAAS,OAAA,CAAAkD,aAAA,CAACa,KAAK,EAAAD,KAAA,CAAAV,EAAA;IAAA,OAAAtE,KAAA,CAAAuE,WAAA,MAAAO,KAAA;EAAA,EAAgB,CAAC;AAChD;AAEA,SAASN,KAAKA,CAACK,KAA0B,EAAE;EAAA,IAAAK,KAAA,GAAAH,YAAA;IAAAI,KAAA;EACzC,MAAMC,MAAM,GAE2BvB,mBAAG;EAD1C,MAAM;IAAEnB;EAAO,CAAC,GAAGmC,KAAK;EACxB,OAAAM,KAAA,GAAO,IAAAxE,aAAO,EAAC+B,MAAM,CAAC,eAACjC,MAAA,CAAAS,OAAA,CAAAkD,aAAA,CAACgB,MAAM,EAAAD,KAAA,CAAAb,EAAA;IAAA,OAAAtE,KAAA,CAAAuE,WAAA;MAAA,OAAkB;IAAM,GAAAW,KAAA;EAAA,EAAE,CAAC;AAC3D;AAEA,MAAM1B,IAAI,GAAG,IAAA6B,qBAAe,EAACxE,QAAQ,EAAE;EACrC8C,IAAI,EAAEiB,QAAQ;EACdJ;AACF,CAAC,CAGA;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAArE,OAAA,GAEasC,IAAI","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Link.types.js","names":[],"sources":["../../src/Link.types.ts"],"sourcesContent":["import type { SimpleHintPopperProps } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { TextProps } from '@semcore/typography';\nimport type React from 'react';\n\nexport type LinkProps = Intergalactic.InternalTypings.EfficientOmit<TextProps, 'ellipsis' | 'hintProps'> & {\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
+ {"version":3,"file":"Link.types.js","names":[],"sources":["../../src/Link.types.ts"],"sourcesContent":["import type { BoxProps, SimpleHintPopperProps } from '@semcore/base-components';\nimport type { BaseTextProps } from '@semcore/typography';\nimport type React from 'react';\n\nexport type LinkProps = BoxProps & BaseTextProps & {\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":[]}
@@ -9,11 +9,6 @@ SLink {
9
9
  background: none;
10
10
  transition: color 0.15s ease-in-out;
11
11
 
12
- &:active,
13
- &:hover {
14
- text-decoration: none;
15
- }
16
-
17
12
  &::-moz-focus-inner {
18
13
  border: none;
19
14
  padding: 0;
@@ -25,7 +20,7 @@ SLink {
25
20
  color: var(--intergalactic-text-link-hover-active, #044792);
26
21
 
27
22
  & SText {
28
- border-color: currentColor;
23
+ text-decoration-color: currentColor;
29
24
  }
30
25
  }
31
26
 
@@ -57,10 +52,10 @@ SInner {
57
52
  }
58
53
 
59
54
  SAddon {
60
- align-items: baseline;
61
- vertical-align: -2px;
62
55
  pointer-events: none;
63
- align-self: center;
56
+ vertical-align: middle;
57
+ display: inline-flex;
58
+ margin-top: -2.5px;
64
59
  }
65
60
 
66
61
  SLink SAddon {
@@ -74,13 +69,13 @@ SLink SAddon {
74
69
  }
75
70
 
76
71
  SText {
77
- border-bottom-width: 1px;
78
- border-bottom-style: solid;
79
- border-color: transparent;
80
- transition: border-bottom-color 0.15s ease-in-out;
81
- }
82
- SText[ellipsis] {
83
- vertical-align: middle;
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;
84
79
  }
85
80
 
86
81
  SLink[text-color] {
package/lib/es6/Link.js CHANGED
@@ -12,21 +12,20 @@ import logger from '@semcore/core/lib/utils/logger';
12
12
  import { Text } from '@semcore/typography';
13
13
  import React from 'react';
14
14
  /*!__reshadow-styles__:"./style/link.shadow.css"*/
15
- const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___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}}", /*__inner_css_end__*/"1dx8e_gg_"),
15
+ const style = (/*__reshadow_css_start__*/_sstyled.insert(/*__inner_css_start__*/".___SLink_10jj4_gg_{display:inline;align-items:center;color:var(--intergalactic-text-link, #006dca);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_10jj4_gg_::-moz-focus-inner{border:0;padding:0}.___SLink_10jj4_gg_.__active_10jj4_gg_,.___SLink_10jj4_gg_:active{color:var(--intergalactic-text-link-hover-active, #044792)}@media (hover:hover){.___SLink_10jj4_gg_:hover{color:var(--intergalactic-text-link-hover-active, #044792)}}.___SLink_10jj4_gg_.__active_10jj4_gg_ .___SText_10jj4_gg_,.___SLink_10jj4_gg_:active .___SText_10jj4_gg_{text-decoration-color:currentColor}@media (hover:hover){.___SLink_10jj4_gg_:hover .___SText_10jj4_gg_{text-decoration-color:currentColor}}.___SLink_10jj4_gg_.__enableVisited_10jj4_gg_:visited{color:var(--intergalactic-text-link-visited, #8649e1)}@media (hover:hover){.___SLink_10jj4_gg_.__enableVisited_10jj4_gg_:visited:hover{color:var(--intergalactic-text-link-visited, #8649e1)}}.___SLink_10jj4_gg_.__visually-disabled_10jj4_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SLink_10jj4_gg_.__noWrap_10jj4_gg_{white-space:nowrap}.___SLink_10jj4_gg_.__inline_10jj4_gg_{display:inline}.___SInner_10jj4_gg_{align-items:baseline;height:100%;width:100%}.___SAddon_10jj4_gg_{pointer-events:none;vertical-align:middle;display:inline-flex;margin-top:-2.5px}.___SLink_10jj4_gg_ .___SAddon_10jj4_gg_:not(:only-child):first-child{margin-right:var(--intergalactic-spacing-1x, 4px)}.___SLink_10jj4_gg_ .___SAddon_10jj4_gg_:not(:only-child):last-child{margin-left:var(--intergalactic-spacing-1x, 4px)}.___SText_10jj4_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_10jj4_gg_.__text-color_10jj4_gg_{color:var(--text-color_10jj4)}.___SLink_10jj4_gg_.__text-color_10jj4_gg_.__active_10jj4_gg_,.___SLink_10jj4_gg_.__text-color_10jj4_gg_:active{color:var(--text-color_10jj4);filter:brightness(.8)}@media (hover:hover){.___SLink_10jj4_gg_.__text-color_10jj4_gg_:hover{color:var(--text-color_10jj4);filter:brightness(.8)}}@media (prefers-reduced-motion){.___SLink_10jj4_gg_,.___SText_10jj4_gg_{transition:none}}", /*__inner_css_end__*/"10jj4_gg_"),
16
16
  /*__reshadow_css_end__*/
17
17
  {
18
- "__SLink": "___SLink_1dx8e_gg_",
19
- "_visually-disabled": "__visually-disabled_1dx8e_gg_",
20
- "_noWrap": "__noWrap_1dx8e_gg_",
21
- "_inline": "__inline_1dx8e_gg_",
22
- "__SInner": "___SInner_1dx8e_gg_",
23
- "__SAddon": "___SAddon_1dx8e_gg_",
24
- "__SText": "___SText_1dx8e_gg_",
25
- "_ellipsis": "__ellipsis_1dx8e_gg_",
26
- "_active": "__active_1dx8e_gg_",
27
- "_enableVisited": "__enableVisited_1dx8e_gg_",
28
- "_text-color": "__text-color_1dx8e_gg_",
29
- "--text-color": "--text-color_1dx8e"
18
+ "__SLink": "___SLink_10jj4_gg_",
19
+ "_visually-disabled": "__visually-disabled_10jj4_gg_",
20
+ "_noWrap": "__noWrap_10jj4_gg_",
21
+ "_inline": "__inline_10jj4_gg_",
22
+ "__SInner": "___SInner_10jj4_gg_",
23
+ "__SAddon": "___SAddon_10jj4_gg_",
24
+ "__SText": "___SText_10jj4_gg_",
25
+ "_active": "__active_10jj4_gg_",
26
+ "_enableVisited": "__enableVisited_10jj4_gg_",
27
+ "_text-color": "__text-color_10jj4_gg_",
28
+ "--text-color": "--text-color_10jj4"
30
29
  });
31
30
  class RootLink extends Component {
32
31
  constructor(...args) {
@@ -48,19 +47,9 @@ class RootLink extends Component {
48
47
  }, 0);
49
48
  }
50
49
  }
51
- getTextProps(props) {
52
- if ('hintProps' in props) {
53
- return {
54
- 'use:hintProps': {
55
- triggerRef: this.containerRef,
56
- ...props.hintProps
57
- }
58
- };
59
- }
50
+ getTextProps() {
60
51
  return {
61
- 'use:hintProps': {
62
- triggerRef: this.containerRef
63
- }
52
+ 'hint:triggerRef': this.containerRef
64
53
  };
65
54
  }
66
55
  render() {
@@ -86,16 +75,19 @@ class RootLink extends Component {
86
75
  const SInner = Box;
87
76
  const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';
88
77
  const showHint = children === undefined || title;
78
+ const excludeProps = ['title', 'aria-disabled'];
79
+ if (!this.asProps['use:disabled']) {
80
+ excludeProps.push('disabled');
81
+ }
89
82
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SLink, _ref4.cn("SLink", {
90
83
  ..._assignProps({
91
- "role": 'link',
92
84
  "tabIndex": disabled ? -1 : 0,
93
85
  "use:href": disabled ? undefined : href,
94
86
  "visually-disabled": disabled,
95
87
  "text-color": resolveColor(color),
96
88
  "tag": 'a',
97
89
  "ref": this.containerRef,
98
- "__excludeProps": ['disabled', 'aria-disabled', 'title'],
90
+ "__excludeProps": excludeProps,
99
91
  "aria-label": showHint ? hintContent : undefined
100
92
  }, _ref)
101
93
  }), /*#__PURE__*/React.createElement(SInner, _ref4.cn("SInner", {
@@ -1 +1 @@
1
- {"version":3,"file":"Link.js","names":["Box","Hint","createComponent","Component","Root","sstyled","CORE_INSTANCE","addonTextChildren","resolveColorEnhance","hasLabels","logger","Text","React","style","_sstyled","insert","RootLink","constructor","args","_defineProperty","createRef","ariaLabelledByContent","componentDidMount","process","env","NODE_ENV","warn","containerRef","current","asProps","displayName","setTimeout","setState","document","getElementById","textContent","getTextProps","props","triggerRef","hintProps","render","_ref","_ref4","styles","color","resolveColor","disabled","href","children","addonLeft","AddonLeft","addonRight","AddonRight","Children","title","ariaLabel","hintPlacement","Link","SLink","SInner","hintContent","state","showHint","undefined","createElement","Fragment","cn","_assignProps","Addon","LinkText","_ref2","arguments[0]","_ref5","SText","_assignProps2","_ref3","_ref6","SAddon","_assignProps3"],"sources":["../../src/Link.tsx"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport { Box, Hint } from '@semcore/base-components';\nimport type { Intergalactic, IRootComponentProps } from '@semcore/core';\nimport { createComponent, Component, Root, sstyled, CORE_INSTANCE } from '@semcore/core';\nimport addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport hasLabels from '@semcore/core/lib/utils/hasLabels';\nimport logger from '@semcore/core/lib/utils/logger';\nimport type { TextProps } from '@semcore/typography';\nimport { Text } from '@semcore/typography';\nimport React from 'react';\n\nimport type { LinkProps } from './Link.types';\nimport style from './style/link.shadow.css';\n\ntype State = {\n ariaLabelledByContent: string;\n};\n\nclass RootLink extends Component<LinkProps, typeof RootLink.enhance, never, {}, State> {\n static displayName = 'Link';\n\n static style = style;\n static enhance = [resolveColorEnhance()] as const;\n containerRef = React.createRef<HTMLElement | null>();\n\n state: State = {\n ariaLabelledByContent: '',\n };\n\n componentDidMount() {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(\n this.containerRef.current && !hasLabels(this.containerRef.current),\n `'title' or 'aria-label' or 'aria-labelledby' are required props for links without text content`,\n this.asProps['data-ui-name'] || RootLink.displayName,\n );\n }\n\n if (this.asProps['aria-labelledby']) {\n setTimeout(() => {\n this.setState({\n ariaLabelledByContent:\n document.getElementById(this.asProps['aria-labelledby'])?.textContent ?? '',\n });\n }, 0);\n }\n }\n\n getTextProps(props: TextProps) {\n if ('hintProps' in props) {\n return {\n 'use:hintProps': { triggerRef: this.containerRef, ...props.hintProps },\n };\n }\n\n return {\n 'use:hintProps': { triggerRef: this.containerRef },\n };\n }\n\n render() {\n const {\n styles,\n color,\n resolveColor,\n disabled,\n href,\n children,\n addonLeft: AddonLeft,\n addonRight: AddonRight,\n Children,\n title,\n 'aria-label': ariaLabel,\n hintPlacement,\n } = this.asProps;\n // @ts-ignore\n const Link = this[CORE_INSTANCE];\n const SLink = Root;\n const SInner = Box;\n const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';\n const showHint = children === undefined || title;\n return sstyled(styles)(\n <>\n <SLink\n role='link'\n tabIndex={disabled ? -1 : 0}\n use:href={disabled ? undefined : href}\n visually-disabled={disabled}\n render={Text}\n text-color={resolveColor(color)}\n tag='a'\n ref={this.containerRef}\n __excludeProps={['disabled', 'aria-disabled', 'title']}\n aria-label={showHint ? hintContent : undefined}\n >\n <SInner\n tag='span'\n data-ui-name={`${this.asProps['data-ui-name']}.InnerWrapper`}\n >\n {AddonLeft\n ? (\n <Link.Addon>\n <AddonLeft />\n </Link.Addon>\n )\n : null}\n {addonTextChildren(Children, Link.Text, Link.Addon)}\n {AddonRight\n ? (\n <Link.Addon>\n <AddonRight />\n </Link.Addon>\n )\n : null}\n </SInner>\n </SLink>\n {showHint && (\n <Hint\n triggerRef={this.containerRef}\n timeout={[250, 50]}\n placement={hintPlacement}\n >\n {hintContent}\n </Hint>\n )}\n </>,\n );\n }\n}\n\nfunction LinkText(props: IRootComponentProps) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Text} />);\n}\n\nfunction Addon(props: IRootComponentProps) {\n const SAddon = Root;\n const { styles } = props;\n return sstyled(styles)(<SAddon render={Box} tag='span' />);\n}\n\nconst Link = createComponent(RootLink, {\n Text: LinkText,\n Addon,\n}) as Intergalactic.Component<'a', LinkProps, {}, typeof RootLink.enhance> & {\n Text: Intergalactic.Component<'span', TextProps>;\n Addon: Intergalactic.Component<'span', BoxPro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AChC,KAA0B,EAAE;EAAA,IAAAiC,KAAA,GAAAC,YAAA;IAAAC,KAAA;EAC5C,MAAMC,KAAK,GAE2B9D,IAAI;EAD1C,MAAM;IAAEgC;EAAO,CAAC,GAAGN,KAAK;EACxB,OAAAmC,KAAA,GAAOnE,OAAO,CAACsC,MAAM,CAAC,eAAC/B,KAAA,CAAAoD,aAAA,CAACS,KAAK,EAAAD,KAAA,CAAAN,EAAA;IAAA,GAAAQ,aAAA,KAAAJ,KAAA;EAAA,EAAgB,CAAC;AAChD;AAEA,SAASF,KAAKA,CAAC/B,KAA0B,EAAE;EAAA,IAAAsC,KAAA,GAAAJ,YAAA;IAAAK,KAAA;EACzC,MAAMC,MAAM,GAE2B7E,GAAG;EAD1C,MAAM;IAAE2C;EAAO,CAAC,GAAGN,KAAK;EACxB,OAAAuC,KAAA,GAAOvE,OAAO,CAACsC,MAAM,CAAC,eAAC/B,KAAA,CAAAoD,aAAA,CAACa,MAAM,EAAAD,KAAA,CAAAV,EAAA;IAAA,GAAAY,aAAA;MAAA,OAAkB;IAAM,GAAAH,KAAA;EAAA,EAAE,CAAC;AAC3D;AAEA,MAAMlB,IAAI,GAAGvD,eAAe,CAACc,QAAQ,EAAE;EACrCL,IAAI,EAAE0D,QAAQ;EACdD;AACF,CAAC,CAGA;AAED,eAAeX,IAAI","ignoreList":[]}
1
+ {"version":3,"file":"Link.js","names":["Box","Hint","createComponent","Component","Root","sstyled","CORE_INSTANCE","addonTextChildren","resolveColorEnhance","hasLabels","logger","Text","React","style","_sstyled","insert","RootLink","constructor","args","_defineProperty","createRef","ariaLabelledByContent","componentDidMount","process","env","NODE_ENV","warn","containerRef","current","asProps","displayName","setTimeout","setState","document","getElementById","textContent","getTextProps","render","_ref","_ref4","styles","color","resolveColor","disabled","href","children","addonLeft","AddonLeft","addonRight","AddonRight","Children","title","ariaLabel","hintPlacement","Link","SLink","SInner","hintContent","state","showHint","undefined","excludeProps","push","createElement","Fragment","cn","_assignProps","Addon","LinkText","props","_ref2","arguments[0]","_ref5","SText","_assignProps2","_ref3","_ref6","SAddon","_assignProps3"],"sources":["../../src/Link.tsx"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport { Box, Hint } from '@semcore/base-components';\nimport type { Intergalactic, IRootComponentProps } from '@semcore/core';\nimport { createComponent, Component, Root, sstyled, CORE_INSTANCE } from '@semcore/core';\nimport addonTextChildren from '@semcore/core/lib/utils/addonTextChildren';\nimport resolveColorEnhance from '@semcore/core/lib/utils/enhances/resolveColorEnhance';\nimport hasLabels from '@semcore/core/lib/utils/hasLabels';\nimport logger from '@semcore/core/lib/utils/logger';\nimport type { TextProps, TextHintProps } from '@semcore/typography';\nimport { Text } from '@semcore/typography';\nimport React from 'react';\n\nimport type { LinkProps } from './Link.types';\nimport style from './style/link.shadow.css';\n\ntype State = {\n ariaLabelledByContent: string;\n};\n\nclass RootLink extends Component<LinkProps, typeof RootLink.enhance, never, {}, State> {\n static displayName = 'Link';\n\n static style = style;\n static enhance = [resolveColorEnhance()] as const;\n containerRef = React.createRef<HTMLElement | null>();\n\n state: State = {\n ariaLabelledByContent: '',\n };\n\n componentDidMount() {\n if (process.env.NODE_ENV !== 'production') {\n logger.warn(\n this.containerRef.current && !hasLabels(this.containerRef.current),\n `'title' or 'aria-label' or 'aria-labelledby' are required props for links without text content`,\n this.asProps['data-ui-name'] || RootLink.displayName,\n );\n }\n\n if (this.asProps['aria-labelledby']) {\n setTimeout(() => {\n this.setState({\n ariaLabelledByContent:\n document.getElementById(this.asProps['aria-labelledby'])?.textContent ?? '',\n });\n }, 0);\n }\n }\n\n getTextProps(): TextHintProps {\n return {\n 'hint:triggerRef': this.containerRef,\n };\n }\n\n render() {\n const {\n styles,\n color,\n resolveColor,\n disabled,\n href,\n children,\n addonLeft: AddonLeft,\n addonRight: AddonRight,\n Children,\n title,\n 'aria-label': ariaLabel,\n hintPlacement,\n } = this.asProps;\n // @ts-ignore\n const Link = this[CORE_INSTANCE];\n const SLink = Root;\n const SInner = Box;\n const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';\n const showHint = children === undefined || title;\n\n const excludeProps = ['title', 'aria-disabled'];\n if (!this.asProps['use:disabled']) {\n excludeProps.push('disabled');\n }\n\n return sstyled(styles)(\n <>\n <SLink\n tabIndex={disabled ? -1 : 0}\n use:href={disabled ? undefined : href}\n visually-disabled={disabled}\n render={Text}\n text-color={resolveColor(color)}\n tag='a'\n ref={this.containerRef}\n __excludeProps={excludeProps}\n aria-label={showHint ? hintContent : undefined}\n >\n <SInner\n tag='span'\n data-ui-name={`${this.asProps['data-ui-name']}.InnerWrapper`}\n >\n {AddonLeft\n ? (\n <Link.Addon>\n <AddonLeft />\n </Link.Addon>\n )\n : null}\n {addonTextChildren(Children, Link.Text, Link.Addon)}\n {AddonRight\n ? (\n <Link.Addon>\n <AddonRight />\n </Link.Addon>\n )\n : null}\n </SInner>\n </SLink>\n {showHint && (\n <Hint\n triggerRef={this.containerRef}\n timeout={[250, 50]}\n placement={hintPlacement}\n >\n {hintContent}\n </Hint>\n )}\n </>,\n );\n }\n}\n\nfunction LinkText(props: IRootComponentProps) {\n const SText = Root;\n const { styles } = props;\n return sstyled(styles)(<SText render={Text} />);\n}\n\nfunction Addon(props: IRootComponentProps) {\n const SAddon = Root;\n const { styles } = props;\n return sstyled(styles)(<SAddon render={Box} tag='span' />);\n}\n\nconst Link = createComponent(RootLink, {\n Text: LinkText,\n Addon,\n}) as Intergalactic.Component<'a', LinkProps, {}, typeof RootLink.enhance> & {\n Text: Intergalactic.Component<'span', TextProps>;\n Addon: Intergalactic.Component<'span', BoxProps>;\n};\n\nexport default Link;\n"],"mappings":";;;;;AACA,SAASA,GAAG,EAAEC,IAAI,QAAQ,0BAA0B;AAEpD,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,EAAEC,aAAa,QAAQ,eAAe;AACxF,OAAOC,iBAAiB,MAAM,2CAA2C;AACzE,OAAOC,mBAAmB,MAAM,sDAAsD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EAAgB,CAAC;AAChD;AAEA,SAASH,KAAKA,CAACE,KAA0B,EAAE;EAAA,IAAAM,KAAA,GAAAJ,YAAA;IAAAK,KAAA;EACzC,MAAMC,MAAM,GAE2B7E,GAAG;EAD1C,MAAM;IAAEwC;EAAO,CAAC,GAAG6B,KAAK;EACxB,OAAAO,KAAA,GAAOvE,OAAO,CAACmC,MAAM,CAAC,eAAC5B,KAAA,CAAAmD,aAAA,CAACc,MAAM,EAAAD,KAAA,CAAAX,EAAA;IAAA,GAAAa,aAAA;MAAA,OAAkB;IAAM,GAAAH,KAAA;EAAA,EAAE,CAAC;AAC3D;AAEA,MAAMrB,IAAI,GAAGpD,eAAe,CAACc,QAAQ,EAAE;EACrCL,IAAI,EAAEyD,QAAQ;EACdD;AACF,CAAC,CAGA;AAED,eAAeb,IAAI","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Link.types.js","names":[],"sources":["../../src/Link.types.ts"],"sourcesContent":["import type { SimpleHintPopperProps } from '@semcore/base-components';\nimport type { Intergalactic } from '@semcore/core';\nimport type { TextProps } from '@semcore/typography';\nimport type React from 'react';\n\nexport type LinkProps = Intergalactic.InternalTypings.EfficientOmit<TextProps, 'ellipsis' | 'hintProps'> & {\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
+ {"version":3,"file":"Link.types.js","names":[],"sources":["../../src/Link.types.ts"],"sourcesContent":["import type { BoxProps, SimpleHintPopperProps } from '@semcore/base-components';\nimport type { BaseTextProps } from '@semcore/typography';\nimport type React from 'react';\n\nexport type LinkProps = BoxProps & BaseTextProps & {\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":[]}
@@ -9,11 +9,6 @@ SLink {
9
9
  background: none;
10
10
  transition: color 0.15s ease-in-out;
11
11
 
12
- &:active,
13
- &:hover {
14
- text-decoration: none;
15
- }
16
-
17
12
  &::-moz-focus-inner {
18
13
  border: none;
19
14
  padding: 0;
@@ -25,7 +20,7 @@ SLink {
25
20
  color: var(--intergalactic-text-link-hover-active, #044792);
26
21
 
27
22
  & SText {
28
- border-color: currentColor;
23
+ text-decoration-color: currentColor;
29
24
  }
30
25
  }
31
26
 
@@ -57,10 +52,10 @@ SInner {
57
52
  }
58
53
 
59
54
  SAddon {
60
- align-items: baseline;
61
- vertical-align: -2px;
62
55
  pointer-events: none;
63
- align-self: center;
56
+ vertical-align: middle;
57
+ display: inline-flex;
58
+ margin-top: -2.5px;
64
59
  }
65
60
 
66
61
  SLink SAddon {
@@ -74,13 +69,13 @@ SLink SAddon {
74
69
  }
75
70
 
76
71
  SText {
77
- border-bottom-width: 1px;
78
- border-bottom-style: solid;
79
- border-color: transparent;
80
- transition: border-bottom-color 0.15s ease-in-out;
81
- }
82
- SText[ellipsis] {
83
- vertical-align: middle;
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;
84
79
  }
85
80
 
86
81
  SLink[text-color] {
package/lib/esm/Link.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
2
- import { createComponent, sstyled, Component, CORE_INSTANCE, assignProps } from "@semcore/core";
2
+ import { sstyled, createComponent, Component, CORE_INSTANCE, assignProps } from "@semcore/core";
3
3
  import { Box, Hint } from "@semcore/base-components";
4
4
  import addonTextChildren from "@semcore/core/lib/utils/addonTextChildren";
5
5
  import resolveColorEnhance from "@semcore/core/lib/utils/enhances/resolveColorEnhance";
@@ -12,23 +12,22 @@ const style = (
12
12
  /*__reshadow_css_start__*/
13
13
  (sstyled.insert(
14
14
  /*__inner_css_start__*/
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}}",
15
+ ".___SLink_10jj4_gg_{display:inline;align-items:center;color:var(--intergalactic-text-link, #006dca);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_10jj4_gg_::-moz-focus-inner{border:0;padding:0}.___SLink_10jj4_gg_.__active_10jj4_gg_,.___SLink_10jj4_gg_:active{color:var(--intergalactic-text-link-hover-active, #044792)}@media (hover:hover){.___SLink_10jj4_gg_:hover{color:var(--intergalactic-text-link-hover-active, #044792)}}.___SLink_10jj4_gg_.__active_10jj4_gg_ .___SText_10jj4_gg_,.___SLink_10jj4_gg_:active .___SText_10jj4_gg_{text-decoration-color:currentColor}@media (hover:hover){.___SLink_10jj4_gg_:hover .___SText_10jj4_gg_{text-decoration-color:currentColor}}.___SLink_10jj4_gg_.__enableVisited_10jj4_gg_:visited{color:var(--intergalactic-text-link-visited, #8649e1)}@media (hover:hover){.___SLink_10jj4_gg_.__enableVisited_10jj4_gg_:visited:hover{color:var(--intergalactic-text-link-visited, #8649e1)}}.___SLink_10jj4_gg_.__visually-disabled_10jj4_gg_{opacity:var(--intergalactic-disabled-opacity, 0.3);cursor:default;pointer-events:none}.___SLink_10jj4_gg_.__noWrap_10jj4_gg_{white-space:nowrap}.___SLink_10jj4_gg_.__inline_10jj4_gg_{display:inline}.___SInner_10jj4_gg_{align-items:baseline;height:100%;width:100%}.___SAddon_10jj4_gg_{pointer-events:none;vertical-align:middle;display:inline-flex;margin-top:-2.5px}.___SLink_10jj4_gg_ .___SAddon_10jj4_gg_:not(:only-child):first-child{margin-right:var(--intergalactic-spacing-1x, 4px)}.___SLink_10jj4_gg_ .___SAddon_10jj4_gg_:not(:only-child):last-child{margin-left:var(--intergalactic-spacing-1x, 4px)}.___SText_10jj4_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_10jj4_gg_.__text-color_10jj4_gg_{color:var(--text-color_10jj4)}.___SLink_10jj4_gg_.__text-color_10jj4_gg_.__active_10jj4_gg_,.___SLink_10jj4_gg_.__text-color_10jj4_gg_:active{color:var(--text-color_10jj4);filter:brightness(.8)}@media (hover:hover){.___SLink_10jj4_gg_.__text-color_10jj4_gg_:hover{color:var(--text-color_10jj4);filter:brightness(.8)}}@media (prefers-reduced-motion){.___SLink_10jj4_gg_,.___SText_10jj4_gg_{transition:none}}",
16
16
  /*__inner_css_end__*/
17
- "1dx8e_gg_"
17
+ "10jj4_gg_"
18
18
  ), /*__reshadow_css_end__*/
19
19
  {
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"
20
+ "__SLink": "___SLink_10jj4_gg_",
21
+ "_visually-disabled": "__visually-disabled_10jj4_gg_",
22
+ "_noWrap": "__noWrap_10jj4_gg_",
23
+ "_inline": "__inline_10jj4_gg_",
24
+ "__SInner": "___SInner_10jj4_gg_",
25
+ "__SAddon": "___SAddon_10jj4_gg_",
26
+ "__SText": "___SText_10jj4_gg_",
27
+ "_active": "__active_10jj4_gg_",
28
+ "_enableVisited": "__enableVisited_10jj4_gg_",
29
+ "_text-color": "__text-color_10jj4_gg_",
30
+ "--text-color": "--text-color_10jj4"
32
31
  })
33
32
  );
34
33
  class RootLink extends Component {
@@ -52,19 +51,9 @@ class RootLink extends Component {
52
51
  }, 0);
53
52
  }
54
53
  }
55
- getTextProps(props) {
56
- if ("hintProps" in props) {
57
- return {
58
- "use:hintProps": {
59
- triggerRef: this.containerRef,
60
- ...props.hintProps
61
- }
62
- };
63
- }
54
+ getTextProps() {
64
55
  return {
65
- "use:hintProps": {
66
- triggerRef: this.containerRef
67
- }
56
+ "hint:triggerRef": this.containerRef
68
57
  };
69
58
  }
70
59
  render() {
@@ -88,16 +77,19 @@ class RootLink extends Component {
88
77
  const SInner = Box;
89
78
  const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? "";
90
79
  const showHint = children === void 0 || title;
80
+ const excludeProps = ["title", "aria-disabled"];
81
+ if (!this.asProps["use:disabled"]) {
82
+ excludeProps.push("disabled");
83
+ }
91
84
  return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SLink, _ref4.cn("SLink", {
92
85
  ...assignProps({
93
- "role": "link",
94
86
  "tabIndex": disabled ? -1 : 0,
95
87
  "use:href": disabled ? void 0 : href,
96
88
  "visually-disabled": disabled,
97
89
  "text-color": resolveColor(color),
98
90
  "tag": "a",
99
91
  "ref": this.containerRef,
100
- "__excludeProps": ["disabled", "aria-disabled", "title"],
92
+ "__excludeProps": excludeProps,
101
93
  "aria-label": showHint ? hintContent : void 0
102
94
  }, _ref)
103
95
  }), /* @__PURE__ */ React.createElement(SInner, _ref4.cn("SInner", {
@@ -9,11 +9,6 @@ SLink {
9
9
  background: none;
10
10
  transition: color 0.15s ease-in-out;
11
11
 
12
- &:active,
13
- &:hover {
14
- text-decoration: none;
15
- }
16
-
17
12
  &::-moz-focus-inner {
18
13
  border: none;
19
14
  padding: 0;
@@ -25,7 +20,7 @@ SLink {
25
20
  color: var(--intergalactic-text-link-hover-active, #044792);
26
21
 
27
22
  & SText {
28
- border-color: currentColor;
23
+ text-decoration-color: currentColor;
29
24
  }
30
25
  }
31
26
 
@@ -57,10 +52,10 @@ SInner {
57
52
  }
58
53
 
59
54
  SAddon {
60
- align-items: baseline;
61
- vertical-align: -2px;
62
55
  pointer-events: none;
63
- align-self: center;
56
+ vertical-align: middle;
57
+ display: inline-flex;
58
+ margin-top: -2.5px;
64
59
  }
65
60
 
66
61
  SLink SAddon {
@@ -74,13 +69,13 @@ SLink SAddon {
74
69
  }
75
70
 
76
71
  SText {
77
- border-bottom-width: 1px;
78
- border-bottom-style: solid;
79
- border-color: transparent;
80
- transition: border-bottom-color 0.15s ease-in-out;
81
- }
82
- SText[ellipsis] {
83
- vertical-align: middle;
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;
84
79
  }
85
80
 
86
81
  SLink[text-color] {
@@ -1,7 +1,7 @@
1
1
  import type { BoxProps } from '@semcore/base-components';
2
2
  import type { Intergalactic } from '@semcore/core';
3
3
  import { Component } from '@semcore/core';
4
- import type { TextProps } from '@semcore/typography';
4
+ import type { TextProps, TextHintProps } from '@semcore/typography';
5
5
  import React from 'react';
6
6
  import type { LinkProps } from './Link.types';
7
7
  type State = {
@@ -16,16 +16,7 @@ declare class RootLink extends Component<LinkProps, typeof RootLink.enhance, nev
16
16
  containerRef: React.RefObject<HTMLElement | null>;
17
17
  state: State;
18
18
  componentDidMount(): void;
19
- getTextProps(props: TextProps): {
20
- 'use:hintProps': {
21
- placement?: import("@floating-ui/dom").Placement;
22
- triggerRef: React.RefObject<HTMLElement | null>;
23
- timeout?: number | [number, number];
24
- visible?: boolean;
25
- defaultVisible?: boolean;
26
- onVisibleChange?: (visible: boolean, e?: Event) => boolean | void;
27
- };
28
- };
19
+ getTextProps(): TextHintProps;
29
20
  render(): React.ReactNode;
30
21
  }
31
22
  declare const Link: Intergalactic.Component<"a", LinkProps, {}, typeof RootLink.enhance> & {
@@ -1,8 +1,7 @@
1
- import type { SimpleHintPopperProps } from '@semcore/base-components';
2
- import type { Intergalactic } from '@semcore/core';
3
- import type { TextProps } from '@semcore/typography';
1
+ import type { BoxProps, SimpleHintPopperProps } from '@semcore/base-components';
2
+ import type { BaseTextProps } from '@semcore/typography';
4
3
  import type React from 'react';
5
- export type LinkProps = Intergalactic.InternalTypings.EfficientOmit<TextProps, 'ellipsis' | 'hintProps'> & {
4
+ export type LinkProps = BoxProps & BaseTextProps & {
6
5
  /**
7
6
  * CSS property of the display link (inline|inline-block)
8
7
  * @default false
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semcore/link",
3
3
  "description": "Semrush Link Component",
4
- "version": "17.0.0-prerelease.30",
4
+ "version": "17.0.0-prerelease.31",
5
5
  "main": "lib/cjs/index.js",
6
6
  "module": "lib/es6/index.js",
7
7
  "typings": "lib/types/index.d.ts",
@@ -14,8 +14,7 @@
14
14
  "types": "./lib/types/index.d.ts"
15
15
  },
16
16
  "dependencies": {
17
- "@semcore/tooltip": "^17.0.0-prerelease.30",
18
- "@semcore/typography": "^17.0.0-prerelease.30"
17
+ "@semcore/typography": "^17.0.0-prerelease.31"
19
18
  },
20
19
  "peerDependencies": {
21
20
  "@semcore/base-components": "^17.0.0 || ^17.0.0-0"
@@ -26,10 +25,11 @@
26
25
  "directory": "semcore/link"
27
26
  },
28
27
  "devDependencies": {
29
- "@semcore/core": "17.0.0-prerelease.30",
30
- "@semcore/base-components": "17.0.0-prerelease.30",
31
- "@semcore/icon": "16.7.2-prerelease.30",
32
- "@semcore/testing-utils": "1.0.0"
28
+ "@floating-ui/dom": "1.7.2",
29
+ "@semcore/core": "17.0.0-prerelease.31",
30
+ "@semcore/base-components": "17.0.0-prerelease.31",
31
+ "@semcore/testing-utils": "1.0.0",
32
+ "@semcore/icon": "16.7.2-prerelease.31"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "pnpm semcore-builder && pnpm vite build"