@semcore/link 17.0.0-prerelease.29 → 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-02-27
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,6 +50,11 @@ class RootLink extends _core.Component {
51
50
  }, 0);
52
51
  }
53
52
  }
53
+ getTextProps() {
54
+ return {
55
+ 'hint:triggerRef': this.containerRef
56
+ };
57
+ }
54
58
  render() {
55
59
  var _ref = this.asProps,
56
60
  _ref4;
@@ -74,16 +78,19 @@ class RootLink extends _core.Component {
74
78
  const SInner = _baseComponents.Box;
75
79
  const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';
76
80
  const showHint = children === undefined || title;
81
+ const excludeProps = ['title', 'aria-disabled'];
82
+ if (!this.asProps['use:disabled']) {
83
+ excludeProps.push('disabled');
84
+ }
77
85
  return _ref4 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(SLink, _ref4.cn("SLink", {
78
86
  ...(0, _core.assignProps)({
79
- "role": 'link',
80
87
  "tabIndex": disabled ? -1 : 0,
81
88
  "use:href": disabled ? undefined : href,
82
89
  "visually-disabled": disabled,
83
90
  "text-color": resolveColor(color),
84
91
  "tag": 'a',
85
92
  "ref": this.containerRef,
86
- "__excludeProps": ['disabled', 'aria-disabled', 'title'],
93
+ "__excludeProps": excludeProps,
87
94
  "aria-label": showHint ? hintContent : undefined
88
95
  }, _ref)
89
96
  }), /*#__PURE__*/_react.default.createElement(SInner, _ref4.cn("SInner", {
@@ -107,9 +114,7 @@ function LinkText(props) {
107
114
  styles
108
115
  } = props;
109
116
  return _ref5 = (0, _core.sstyled)(styles), /*#__PURE__*/_react.default.createElement(SText, _ref5.cn("SText", {
110
- ...(0, _core.assignProps)({
111
- "tag": 'span'
112
- }, _ref2)
117
+ ...(0, _core.assignProps)({}, _ref2)
113
118
  }));
114
119
  }
115
120
  function Addon(props) {
@@ -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","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","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 { Flex, 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 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} tag='span' />);\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,sBAAA,CAAAH,OAAA;AAEA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AAA;IAAA,OAAAnE,KAAA,CAAAoE,WAAA;MAAA,OAAmB;IAAM,GAAAO,KAAA;EAAA,EAAE,CAAC;AAC3D;AAEA,SAASN,KAAKA,CAACK,KAA0B,EAAE;EAAA,IAAAK,KAAA,GAAAH,YAAA;IAAAI,KAAA;EACzC,MAAMC,MAAM,GAE2BrB,mBAAG;EAD1C,MAAM;IAAEnB;EAAO,CAAC,GAAGiC,KAAK;EACxB,OAAAM,KAAA,GAAO,IAAArE,aAAO,EAAC8B,MAAM,CAAC,eAAChC,MAAA,CAAAS,OAAA,CAAA+C,aAAA,CAACgB,MAAM,EAAAD,KAAA,CAAAb,EAAA;IAAA,OAAAnE,KAAA,CAAAoE,WAAA;MAAA,OAAkB;IAAM,GAAAW,KAAA;EAAA,EAAE,CAAC;AAC3D;AAEA,MAAMxB,IAAI,GAAG,IAAA2B,qBAAe,EAACrE,QAAQ,EAAE;EACrC6C,IAAI,EAAEe,QAAQ;EACdJ;AACF,CAAC,CAGA;AAAC,IAAAc,QAAA,GAAAC,OAAA,CAAAlE,OAAA,GAEaqC,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,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,sBAAA,CAAAH,OAAA;AAEA,IAAAO,WAAA,GAAAP,OAAA;AACA,IAA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AAM;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,6 +47,11 @@ class RootLink extends Component {
48
47
  }, 0);
49
48
  }
50
49
  }
50
+ getTextProps() {
51
+ return {
52
+ 'hint:triggerRef': this.containerRef
53
+ };
54
+ }
51
55
  render() {
52
56
  var _ref = this.asProps,
53
57
  _ref4;
@@ -71,16 +75,19 @@ class RootLink extends Component {
71
75
  const SInner = Box;
72
76
  const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? '';
73
77
  const showHint = children === undefined || title;
78
+ const excludeProps = ['title', 'aria-disabled'];
79
+ if (!this.asProps['use:disabled']) {
80
+ excludeProps.push('disabled');
81
+ }
74
82
  return _ref4 = sstyled(styles), /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SLink, _ref4.cn("SLink", {
75
83
  ..._assignProps({
76
- "role": 'link',
77
84
  "tabIndex": disabled ? -1 : 0,
78
85
  "use:href": disabled ? undefined : href,
79
86
  "visually-disabled": disabled,
80
87
  "text-color": resolveColor(color),
81
88
  "tag": 'a',
82
89
  "ref": this.containerRef,
83
- "__excludeProps": ['disabled', 'aria-disabled', 'title'],
90
+ "__excludeProps": excludeProps,
84
91
  "aria-label": showHint ? hintContent : undefined
85
92
  }, _ref)
86
93
  }), /*#__PURE__*/React.createElement(SInner, _ref4.cn("SInner", {
@@ -104,9 +111,7 @@ function LinkText(props) {
104
111
  styles
105
112
  } = props;
106
113
  return _ref5 = sstyled(styles), /*#__PURE__*/React.createElement(SText, _ref5.cn("SText", {
107
- ..._assignProps2({
108
- "tag": 'span'
109
- }, _ref2)
114
+ ..._assignProps2({}, _ref2)
110
115
  }));
111
116
  }
112
117
  function Addon(props) {
@@ -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","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","props","_ref2","arguments[0]","_ref5","SText","_assignProps2","_ref3","_ref6","SAddon","_assignProps3"],"sources":["../../src/Link.tsx"],"sourcesContent":["import type { BoxProps } from '@semcore/base-components';\nimport { Flex, 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 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} tag='span' />);\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,SAAeA,GAAG,EAAEC,IAAI,QAAQ,0BAA0B;AAE1D,SAASC,eAAe,EAAEC,SAAS,EAAEC,IAAI,EAAEC,OAAO,EAAEC,aAAa,QAAQ,eAAe;AACxF,OAAOC,iBAAiB,MAAM,2CAA2C;AACzE,OAAOC,mBAAmB,MAAM,sDAAsD;AACtF,OAAOC,SAAS,MAAM,mCAAmC;AACzD,OAAOC,MAAM,MAAM,gCAAgC;AAEnD,SAASC,IAAI,QAAQ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,MAAM,EAAAD,KAAA,CAAAX,EAAA;IAAA,GAAAa,aAAA;MAAA,OAAkB;IAAM,GAAAH,KAAA;EAAA,EAAE,CAAC;AAC3D;AAEA,MAAMnB,IAAI,GAAGnD,eAAe,CAACc,QAAQ,EAAE;EACrCL,IAAI,EAAEsD,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;AACtF,OAAOC,SAAS,MAAM,mCAAmC;AACzD,OAAOC,MAAM,MAAM,gCAAgC;AAEnD,SAASC,IAAI,QAAQ,qBAAqB;AAC1C,OAAOC,KAAK,MAAM,OAAO;AAAC;AAAA,MAAAC,KAAA,8BAAAC,QAAA,CAAAC,MAAA;AAAA;AAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;EAAA;AAAA;AAS1B,MAAMC,QAAQ,SAASb,SAAS,CAAuD;EAAAc,YAAA,GAAAC,IAAA;IAAA,SAAAA,IAAA;IAAAC,eAAA,oCAKtEP,KAAK,CAACQ,SAAS,CAAqB,CAAC;IAAAD,eAAA,gBAErC;MACbE,qBAAqB,EAAE;IACzB,CAAC;EAAA;EAEDC,iBAAiBA,CAAA,EAAG;IAClB,IAAIC,OAAO,CAACC,GAAG,CAACC,QAAQ,KAAK,YAAY,EAAE;MACzCf,MAAM,CAACgB,IA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ourcesContent":["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,6 +51,11 @@ class RootLink extends Component {
52
51
  }, 0);
53
52
  }
54
53
  }
54
+ getTextProps() {
55
+ return {
56
+ "hint:triggerRef": this.containerRef
57
+ };
58
+ }
55
59
  render() {
56
60
  var _ref = this.asProps, _ref4;
57
61
  const {
@@ -73,16 +77,19 @@ class RootLink extends Component {
73
77
  const SInner = Box;
74
78
  const hintContent = title ?? ariaLabel ?? this.state.ariaLabelledByContent ?? "";
75
79
  const showHint = children === void 0 || title;
80
+ const excludeProps = ["title", "aria-disabled"];
81
+ if (!this.asProps["use:disabled"]) {
82
+ excludeProps.push("disabled");
83
+ }
76
84
  return _ref4 = sstyled(styles), /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SLink, _ref4.cn("SLink", {
77
85
  ...assignProps({
78
- "role": "link",
79
86
  "tabIndex": disabled ? -1 : 0,
80
87
  "use:href": disabled ? void 0 : href,
81
88
  "visually-disabled": disabled,
82
89
  "text-color": resolveColor(color),
83
90
  "tag": "a",
84
91
  "ref": this.containerRef,
85
- "__excludeProps": ["disabled", "aria-disabled", "title"],
92
+ "__excludeProps": excludeProps,
86
93
  "aria-label": showHint ? hintContent : void 0
87
94
  }, _ref)
88
95
  }), /* @__PURE__ */ React.createElement(SInner, _ref4.cn("SInner", {
@@ -105,9 +112,7 @@ function LinkText(props) {
105
112
  styles
106
113
  } = props;
107
114
  return _ref5 = sstyled(styles), /* @__PURE__ */ React.createElement(SText, _ref5.cn("SText", {
108
- ...assignProps({
109
- "tag": "span"
110
- }, _ref2)
115
+ ...assignProps({}, _ref2)
111
116
  }));
112
117
  }
113
118
  function Addon(props) {
@@ -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,6 +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(): TextHintProps;
19
20
  render(): React.ReactNode;
20
21
  }
21
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.29",
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.29",
18
- "@semcore/typography": "^17.0.0-prerelease.29"
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/base-components": "17.0.0-prerelease.29",
30
- "@semcore/core": "17.0.0-prerelease.29",
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
31
  "@semcore/testing-utils": "1.0.0",
32
- "@semcore/icon": "16.7.2-prerelease.29"
32
+ "@semcore/icon": "16.7.2-prerelease.31"
33
33
  },
34
34
  "scripts": {
35
35
  "build": "pnpm semcore-builder && pnpm vite build"