@sellmate/design-system 1.12.0 → 1.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/dist/cjs/design-system.cjs.js +1 -1
  2. package/dist/cjs/loader.cjs.js +1 -1
  3. package/dist/cjs/sd-field_3.cjs.entry.js +41 -6
  4. package/dist/collection/components/sd-tooltip/sd-tooltip.js +99 -6
  5. package/dist/components/{p-zV0que9W.js → p--ZDL0WyX.js} +1 -1
  6. package/dist/components/{p-CBGAiS8T.js → p-8XgM7UEL.js} +1 -1
  7. package/dist/components/{p-ChMGPj-k.js → p-9SZAF9qv.js} +1 -1
  8. package/dist/components/{p-Bcxg13aZ.js → p-BUidFkYd.js} +1 -1
  9. package/dist/components/p-BygVDx5A.js +1 -0
  10. package/dist/components/{p-DcDe1yhx.js → p-CSRU_6IG.js} +1 -1
  11. package/dist/components/{p-CimFMM4i.js → p-CV1k__LR.js} +1 -1
  12. package/dist/components/{p-DkySTF-9.js → p-DACweegE.js} +1 -1
  13. package/dist/components/{p-D_oBtvP1.js → p-MMl4IPkT.js} +1 -1
  14. package/dist/components/{p-DtnoDxUp.js → p-zKW4Sw2l.js} +1 -1
  15. package/dist/components/sd-barcode-input.js +1 -1
  16. package/dist/components/sd-chip-input.js +1 -1
  17. package/dist/components/sd-date-picker.js +1 -1
  18. package/dist/components/sd-date-range-picker.js +1 -1
  19. package/dist/components/sd-field.js +1 -1
  20. package/dist/components/sd-file-picker.js +1 -1
  21. package/dist/components/sd-input.js +1 -1
  22. package/dist/components/sd-key-value-table.js +1 -1
  23. package/dist/components/sd-number-input.js +1 -1
  24. package/dist/components/sd-select.js +1 -1
  25. package/dist/components/sd-table.js +1 -1
  26. package/dist/components/sd-textarea.js +1 -1
  27. package/dist/components/sd-thead.js +1 -1
  28. package/dist/components/sd-tooltip.js +1 -1
  29. package/dist/design-system/design-system.esm.js +1 -1
  30. package/dist/design-system/{p-dad44248.entry.js → p-d604da14.entry.js} +1 -1
  31. package/dist/esm/design-system.js +1 -1
  32. package/dist/esm/loader.js +1 -1
  33. package/dist/esm/sd-field_3.entry.js +41 -6
  34. package/dist/types/components/sd-tooltip/sd-tooltip.d.ts +12 -0
  35. package/dist/types/components.d.ts +32 -0
  36. package/hydrate/index.js +45 -7
  37. package/hydrate/index.mjs +45 -7
  38. package/package.json +1 -1
  39. package/dist/components/p-BMkeoWD7.js +0 -1
package/hydrate/index.mjs CHANGED
@@ -17887,9 +17887,20 @@ class SdTooltip {
17887
17887
  type = 'button';
17888
17888
  useClose = false;
17889
17889
  sdClass = '';
17890
+ /**
17891
+ * 툴팁 본문에 표시할 메시지. 각 항목이 한 줄로 innerHTML 렌더링됩니다.
17892
+ * (HTML 문자열 허용) 지정하지 않으면 slot 으로 전달한 내용을 본문으로 사용합니다.
17893
+ */
17894
+ message = [];
17895
+ /** anchor 트리거 래퍼(.sd-tooltip-trigger)에 추가할 클래스. (예: Tailwind `block w-full`) */
17896
+ triggerClass = '';
17897
+ /** anchor 트리거 래퍼에 적용할 인라인 스타일(CSS 문자열). (예: `width:100%`) */
17898
+ triggerStyle = '';
17890
17899
  showTooltip = false;
17891
17900
  slotContentHTML = '';
17892
17901
  buttonEl;
17902
+ triggerEl;
17903
+ isAnchorMode = false;
17893
17904
  menuEl;
17894
17905
  hideTimeout;
17895
17906
  closeTimeout;
@@ -17944,10 +17955,22 @@ class SdTooltip {
17944
17955
  this.closeTooltip();
17945
17956
  }
17946
17957
  componentWillLoad() {
17947
- this.slotContentHTML = this.el.innerHTML;
17948
- this.el.replaceChildren();
17958
+ // slot="anchor" 자식이 있으면 anchor 모드(다른 컴포넌트를 트리거로 사용)
17959
+ this.isAnchorMode = Array.from(this.el.children).some(child => child.getAttribute('slot') === 'anchor');
17960
+ if (!this.isAnchorMode) {
17961
+ // 레거시 모드: 슬롯 내용을 본문으로 캡처하고 자식을 비웁니다.
17962
+ this.slotContentHTML = this.el.innerHTML;
17963
+ this.el.replaceChildren();
17964
+ }
17965
+ // anchor 모드: 자식(slot="anchor")은 그대로 두어 Stencil 슬롯으로 투영합니다.
17949
17966
  this.el.classList.toggle('visible', true);
17950
17967
  }
17968
+ componentDidRender() {
17969
+ // CSS 문자열 스타일은 ref로 직접 적용 (속성/프로퍼티 전달 모두 호환)
17970
+ if (this.triggerEl && this.triggerStyle !== '') {
17971
+ this.triggerEl.setAttribute('style', this.triggerStyle);
17972
+ }
17973
+ }
17951
17974
  render() {
17952
17975
  const trigger = this.trigger ?? 'hover';
17953
17976
  const placement = this.placement ?? 'top';
@@ -17961,9 +17984,21 @@ class SdTooltip {
17961
17984
  };
17962
17985
  const toggleTooltip = () => (this.showTooltip = !this.showTooltip);
17963
17986
  const hasLabel = this.label !== undefined && this.label !== '';
17964
- const divTrigger = trigger === 'hover' ? hoverTrigger : hasLabel ? {} : { onClick: toggleTooltip };
17965
- const buttonClickTrigger = trigger === 'click' && hasLabel ? { onSdClick: toggleTooltip } : {};
17966
- return (hAsync(Fragment, { key: '11fbd6ec652363cb49d96f0764361ae3751fc774' }, hAsync("div", { key: 'a7ea602929a7f7cef6b589767b59a389ca6e33c4', class: `sd-tooltip-trigger ${this.sdClass !== undefined && this.sdClass !== '' ? this.sdClass : ''}`, ...divTrigger }, hasLabel ? (hAsync("sd-button", { ref: el => (this.buttonEl = el), name: this.name ?? 'primary_sm', label: this.label, icon: icon, rightIcon: this.rightIcon, ariaLabel: this.ariaLabel, disabled: this.disabled, type: this.type ?? 'button', class: "sd-tooltip", ...buttonClickTrigger })) : (hAsync("sd-icon", { ref: el => (this.buttonEl = el), name: icon, size: this.iconSize ?? 12, color: color, class: "sd-tooltip" }))), this.showTooltip && (hAsync("sd-floating-portal", { key: '1123c5ace6539b8f9b92279e2b9d7db74f690755', parentRef: this.buttonEl, onSdClose: this.handleClose, placement: placement, offset: this.tooltipOffset }, hAsync("div", { key: '0545b2a282eba7585045a1730c51e66cc5546535', ref: el => (this.menuEl = el), class: {
17987
+ const anchorMode = this.isAnchorMode;
17988
+ const divTrigger = trigger === 'hover'
17989
+ ? hoverTrigger
17990
+ : anchorMode || !hasLabel
17991
+ ? { onClick: toggleTooltip }
17992
+ : {};
17993
+ const buttonClickTrigger = trigger === 'click' && !anchorMode && hasLabel ? { onSdClick: toggleTooltip } : {};
17994
+ const triggerClasses = ['sd-tooltip-trigger', this.sdClass, this.triggerClass]
17995
+ .filter(c => c !== undefined && c !== '')
17996
+ .join(' ');
17997
+ // anchor 모드에서는 slot 을 트리거로 쓰므로 본문은 message 로 받습니다.
17998
+ const bodyHTML = this.message && this.message.length > 0
17999
+ ? this.message.map(line => `<div>${line}</div>`).join('')
18000
+ : this.slotContentHTML;
18001
+ return (hAsync(Fragment, { key: 'be1e7f58505f3689f236559792357ce882f9a5d1' }, hAsync("div", { key: 'c289652eba29ed9526db76794180b192057973d2', ref: el => (this.triggerEl = el), class: triggerClasses, ...divTrigger }, anchorMode ? (hAsync("slot", { name: "anchor" })) : hasLabel ? (hAsync("sd-button", { ref: el => (this.buttonEl = el), name: this.name ?? 'primary_sm', label: this.label, icon: icon, rightIcon: this.rightIcon, ariaLabel: this.ariaLabel, disabled: this.disabled, type: this.type ?? 'button', class: "sd-tooltip", ...buttonClickTrigger })) : (hAsync("sd-icon", { ref: el => (this.buttonEl = el), name: icon, size: this.iconSize ?? 12, color: color, class: "sd-tooltip" }))), this.showTooltip && (hAsync("sd-floating-portal", { key: '138bfd2f0c75e7602b3176d1fd1dd2f9da0b624f', parentRef: anchorMode ? this.triggerEl : this.buttonEl, onSdClose: this.handleClose, placement: placement, offset: this.tooltipOffset }, hAsync("div", { key: '65c82fcb90080898783119232016e6c079d4b183', ref: el => (this.menuEl = el), class: {
17967
18002
  'sd-floating-menu': true,
17968
18003
  [`sd-floating-menu--${tooltipType}`]: true,
17969
18004
  [`sd-floating-menu--${placement}`]: true,
@@ -17971,11 +18006,11 @@ class SdTooltip {
17971
18006
  }, style: {
17972
18007
  '--sd-floating-bg': typeConfig.bg,
17973
18008
  '--sd-floating-content': typeConfig.content,
17974
- }, onMouseEnter: () => this.openTooltip(), onMouseLeave: () => this.startHideTimer() }, hAsync("i", { key: 'd183dd7bb30444931296342dc0fcf8d5486a3f22', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${placement}` }, hAsync(TooltipArrow, { key: '69349fa0bc7184112b572153fe9a53a391923869' })), hAsync("div", { key: '5363fbd0178fc893e7c1b194687ce8bada2fdd5a', class: "sd-floating-menu__content", innerHTML: this.slotContentHTML }), this.useClose && (hAsync("sd-ghost-button", { key: 'd11ec43d5947bfbfe93961f9b72b15e8b3191e7c', class: "sd-floating-menu__close-button", icon: "close", ariaLabel: "close", size: "xxs", onClick: this.handleClose })))))));
18009
+ }, onMouseEnter: () => this.openTooltip(), onMouseLeave: () => this.startHideTimer() }, hAsync("i", { key: '81e2e2cd64f6c656ea307176c58b93a3b886e79d', class: `sd-floating-menu__arrow sd-floating-menu__arrow--${placement}` }, hAsync(TooltipArrow, { key: '7ced7bc259479dda4bddf22120cb6c22d61aaf3b' })), hAsync("div", { key: '62b4ed5852825ba3de9095cd1b81423f44a768fb', class: "sd-floating-menu__content", innerHTML: bodyHTML }), this.useClose && (hAsync("sd-ghost-button", { key: 'e0834930b12d7a1e3ff2151d733a84765ecd0535', class: "sd-floating-menu__close-button", icon: "close", ariaLabel: "close", size: "xxs", onClick: this.handleClose })))))));
17975
18010
  }
17976
18011
  static get style() { return sdTooltipCss(); }
17977
18012
  static get cmpMeta() { return {
17978
- "$flags$": 512,
18013
+ "$flags$": 772,
17979
18014
  "$tagName$": "sd-tooltip",
17980
18015
  "$members$": {
17981
18016
  "trigger": [1],
@@ -17992,6 +18027,9 @@ class SdTooltip {
17992
18027
  "type": [1],
17993
18028
  "useClose": [4, "use-close"],
17994
18029
  "sdClass": [1, "sd-class"],
18030
+ "message": [16],
18031
+ "triggerClass": [1, "trigger-class"],
18032
+ "triggerStyle": [1, "trigger-style"],
17995
18033
  "showTooltip": [32],
17996
18034
  "slotContentHTML": [32],
17997
18035
  "show": [64],
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sellmate/design-system",
3
- "version": "1.12.0",
3
+ "version": "1.13.0",
4
4
  "description": "Sellmate Design System - Web Components Library built with Stencil",
5
5
  "keywords": [
6
6
  "web-components",
@@ -1 +0,0 @@
1
- import{p as t,H as s,h as e,F as i,t as o}from"./p-BFjxNqDj.js";import{T as n}from"./p-D9fTZjTl.js";import{d as a}from"./p-BklUnzX5.js";import{d as l}from"./p-DK5GPWo_.js";import{d as c}from"./p-CuuPUA52.js";import{d as r}from"./p-BoXTUvyq.js";import{d}from"./p-CMVIH_LA.js";var h={bg:"#07284A",content:"#FFFFFF"},m={bg:"#FCEFEF",content:"#FB4444"},p={bg:"#FEF1EA",content:"#FF6B00"},b={bg:"#E6F1FF",content:"#0075FF"};const u={default:{bg:h.bg,content:h.content},danger:{bg:m.bg,content:m.content},warning:{bg:p.bg,content:p.content},accent:{bg:b.bg,content:b.content}},f=t(class t extends s{constructor(t){super(),!1!==t&&this.__registerHost()}get el(){return this}trigger="hover";placement="top";color="#01BB4B";tooltipType="default";icon="helpOutline";iconSize=12;label="";name="primary_sm";rightIcon;ariaLabel="";disabled=!1;type="button";useClose=!1;sdClass="";showTooltip=!1;slotContentHTML="";buttonEl;menuEl;hideTimeout;closeTimeout;static CLOSE_ANIM_MS=150;openTooltip=()=>{this.cancelHideTimer(),this.showTooltip=!0,this.menuEl&&this.menuEl.classList.remove("sd-floating-menu--closing")};closeTooltip=()=>{this.menuEl&&this.menuEl.classList.add("sd-floating-menu--closing"),this.closeTimeout=setTimeout((()=>{this.showTooltip=!1}),t.CLOSE_ANIM_MS)};startHideTimer=()=>{this.hideTimeout=setTimeout((()=>this.closeTooltip()),100)};cancelHideTimer=()=>{this.hideTimeout&&(clearTimeout(this.hideTimeout),this.hideTimeout=void 0),this.closeTimeout&&(clearTimeout(this.closeTimeout),this.closeTimeout=void 0)};get tooltipOffset(){switch(this.placement??"top"){case"top":return[0,-4];case"bottom":return[0,4];case"left":case"right":return[4,0]}}handleClose=()=>this.closeTooltip();async show(){this.openTooltip()}async hide(){this.closeTooltip()}componentWillLoad(){this.slotContentHTML=this.el.innerHTML,this.el.replaceChildren(),this.el.classList.toggle("visible",!0)}render(){const t=this.trigger??"hover",s=this.placement??"top",o=this.tooltipType??"default",a=this.icon??"helpOutline",l=this.color??"#01BB4B",c=u[o]??u.default,r=()=>this.showTooltip=!this.showTooltip,d=void 0!==this.label&&""!==this.label;return e(i,{key:"11fbd6ec652363cb49d96f0764361ae3751fc774"},e("div",{key:"a7ea602929a7f7cef6b589767b59a389ca6e33c4",class:`sd-tooltip-trigger ${void 0!==this.sdClass&&""!==this.sdClass?this.sdClass:""}`,..."hover"===t?{onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>this.startHideTimer()}:d?{}:{onClick:r}},d?e("sd-button",{ref:t=>this.buttonEl=t,name:this.name??"primary_sm",label:this.label,icon:a,rightIcon:this.rightIcon,ariaLabel:this.ariaLabel,disabled:this.disabled,type:this.type??"button",class:"sd-tooltip",..."click"===t&&d?{onSdClick:r}:{}}):e("sd-icon",{ref:t=>this.buttonEl=t,name:a,size:this.iconSize??12,color:l,class:"sd-tooltip"})),this.showTooltip&&e("sd-floating-portal",{key:"1123c5ace6539b8f9b92279e2b9d7db74f690755",parentRef:this.buttonEl,onSdClose:this.handleClose,placement:s,offset:this.tooltipOffset},e("div",{key:"0545b2a282eba7585045a1730c51e66cc5546535",ref:t=>this.menuEl=t,class:{"sd-floating-menu":!0,[`sd-floating-menu--${o}`]:!0,[`sd-floating-menu--${s}`]:!0,"sd-floating-menu--has-close":this.useClose},style:{"--sd-floating-bg":c.bg,"--sd-floating-content":c.content},onMouseEnter:()=>this.openTooltip(),onMouseLeave:()=>this.startHideTimer()},e("i",{key:"d183dd7bb30444931296342dc0fcf8d5486a3f22",class:`sd-floating-menu__arrow sd-floating-menu__arrow--${s}`},e(n,{key:"69349fa0bc7184112b572153fe9a53a391923869"})),e("div",{key:"5363fbd0178fc893e7c1b194687ce8bada2fdd5a",class:"sd-floating-menu__content",innerHTML:this.slotContentHTML}),this.useClose&&e("sd-ghost-button",{key:"d11ec43d5947bfbfe93961f9b72b15e8b3191e7c",class:"sd-floating-menu__close-button",icon:"close",ariaLabel:"close",size:"xxs",onClick:this.handleClose}))))}static get style(){return"sd-tooltip{visibility:hidden !important;display:inline-flex}sd-tooltip.visible{visibility:visible !important}sd-tooltip .sd-tooltip-trigger{display:inline-flex;position:relative;cursor:pointer;align-items:center;justify-content:center}"}},[512,"sd-tooltip",{trigger:[1],placement:[1],color:[1],tooltipType:[1,"tooltip-type"],icon:[1],iconSize:[2,"icon-size"],label:[1],name:[1],rightIcon:[1,"right-icon"],ariaLabel:[1,"aria-label"],disabled:[4],type:[1],useClose:[4,"use-close"],sdClass:[1,"sd-class"],showTooltip:[32],slotContentHTML:[32],show:[64],hide:[64]}]);function g(){"undefined"!=typeof customElements&&["sd-tooltip","sd-button","sd-floating-portal","sd-ghost-button","sd-icon","sd-tag"].forEach((t=>{switch(t){case"sd-tooltip":customElements.get(o(t))||customElements.define(o(t),f);break;case"sd-button":customElements.get(o(t))||a();break;case"sd-floating-portal":customElements.get(o(t))||l();break;case"sd-ghost-button":customElements.get(o(t))||c();break;case"sd-icon":customElements.get(o(t))||r();break;case"sd-tag":customElements.get(o(t))||d()}}))}export{f as S,g as d}