@sellmate/design-system 0.0.2 → 0.0.3

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.
@@ -66,7 +66,7 @@ export class SdGuide {
66
66
  };
67
67
  render() {
68
68
  const { name: iconName, size: iconSize, color: iconColor } = this.getGuidIcon();
69
- return (h(Host, { key: '4313417f5c41f1126e329bddd46d75f2f571bcbe', style: this.getGuideStyle() }, h("sd-button", { key: 'b7ba861de4752828dd7b8747d26b4a8549a409a8', ref: el => (this.guideRef = el), class: this.getGuideClasses(), variant: "outline", label: SdGuide.guideTitle[this.type], size: "md", color: "var(--guide-color)", icon: iconName, iconColor: iconColor, iconSize: iconSize, iconStyle: { marginRight: '4px' }, buttonStyle: {
69
+ return (h(Host, { key: 'a56286f0027547de784fe294510b3249f7899f15', style: this.getGuideStyle() }, h("sd-button", { key: 'c1db0647448b3830f05b9cd9856f349fc9b3c2ca', ref: el => (this.guideRef = el), class: this.getGuideClasses(), variant: "outline", label: SdGuide.guideTitle[this.type], size: "md", color: "var(--guide-color)", icon: iconName, iconColor: iconColor, iconSize: iconSize, iconStyle: { marginRight: '4px' }, buttonStyle: {
70
70
  height: '28px',
71
71
  minHeight: '28px',
72
72
  padding: '4px 12px',
@@ -76,7 +76,7 @@ export class SdGuide {
76
76
  fontSize: '12px',
77
77
  fontWeight: '400',
78
78
  backgroundColor: 'var(--guide-background)',
79
- }, onSdClick: this.handleClickGuide }), this.type === 'help' && this.popupShow && (h("sd-portal", { key: '31c52e9aef405c536dfd1a9da8d59450dbf179cf', open: this.popupShow, parentRef: this.guideRef, onSdClose: this.closeDropdown, offset: [0, 24] }, h("div", { key: 'b4798202e35dcd232ce66eb6b939b57993d8de6a', class: "sd-guide__popup", style: { width: this.popupWidth ? this.popupWidth + 'px' : '426px' } }, h("sd-button", { key: '9aa1f1d5e3bb224f606bb204754843e5cd8f5622', class: "sd-guide__popup__close", icon: "close", color: colors.grey_65, size: "md", variant: "ghost", noHover: true, buttonStyle: { padding: '0px', minHeight: '0px' }, onSdClick: this.closeDropdown }), h("div", { key: '87322cfaaced49ba6da7a9aa648eeed7403f88ca', class: "sd-guide__popup__header" }, h("sd-icon", { key: '231f23a8ceb669a39bd89c2054848f82edafd344', name: "helpOutline", size: 24, color: colors.green_65 }), h("h3", { key: 'c4dec3314abeb04d7b71962d76c8191c26332e7c', class: "sd-guide__popup__title" }, this.popupTitle || SdGuide.guideTitle[this.type])), h("ul", { key: '3c19dc7e2b14e29b3079d34e88e52230c1a16911', class: "sd-guide__popup__list" }, this.renderListItem(this.message)))))));
79
+ }, onSdClick: this.handleClickGuide }), this.type === 'help' && this.popupShow && (h("sd-portal", { key: 'bbd220ae09816df67a7cff96f5a8d7359ea02a0a', open: this.popupShow, parentRef: this.guideRef, onSdClose: this.closeDropdown, offset: [0, 24] }, h("div", { key: '839444f5533beba6a66a565bd28a59e0663eefef', class: "sd-guide__popup", style: { width: this.popupWidth ? this.popupWidth + 'px' : '426px' } }, h("sd-button", { key: 'eaf414c9d50d43fc12faab1a03c943b82d054a94', class: "sd-guide__popup__close", icon: "close", color: colors.grey_65, size: "md", variant: "ghost", noHover: true, buttonStyle: { padding: '0px', minHeight: '0px' }, onSdClick: this.closeDropdown }), h("div", { key: 'e3195a06835a8c98a3591e820ef2183446fdc685', class: "sd-guide__popup__header" }, h("sd-icon", { key: '5544db3d1bb4d887cf008b8ee9658ea0b5c5208f', name: "helpOutline", size: 24, color: colors.green_65 }), h("h3", { key: '9492b9846a7b00dd67f01e44c95c19c427e36b52', class: "sd-guide__popup__title" }, this.popupTitle || SdGuide.guideTitle[this.type])), h("ul", { key: 'abf36fa7c8a413c4d26eb8c981badfcbf38989a7', class: "sd-guide__popup__list" }, this.renderListItem(this.message)))))));
80
80
  }
81
81
  // 현재 2depth까지만 스타일 적용
82
82
  renderListItem(message, depth = 0) {
@@ -111,9 +111,14 @@ export class SdGuide {
111
111
  "type": "string",
112
112
  "mutable": false,
113
113
  "complexType": {
114
- "original": "'help' | 'pdf' | 'youtube' | 'notion' | 'event'",
114
+ "original": "GuideType",
115
115
  "resolved": "\"event\" | \"help\" | \"notion\" | \"pdf\" | \"youtube\"",
116
- "references": {}
116
+ "references": {
117
+ "GuideType": {
118
+ "location": "global",
119
+ "id": "global::GuideType"
120
+ }
121
+ }
117
122
  },
118
123
  "required": false,
119
124
  "optional": false,
@@ -1 +1 @@
1
- {"version":3,"file":"sd-guide.js","sourceRoot":"","sources":["../../../src/components/sd-guide/sd-guide.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAM7C,MAAM,OAAO,OAAO;IACR,EAAE,CAAe;IAEpB,IAAI,GAAoD,MAAM,CAAC;IAC/D,UAAU,GAAW,EAAE,CAAC;IACxB,OAAO,GAAsB,EAAE,CAAC;IAChC,QAAQ,GAAW,EAAE,CAAC;IACtB,UAAU,CAAU;IAEnB,SAAS,GAAY,KAAK,CAAC;IAE5B,QAAQ,CAAe;IAE/B,MAAM,CAAC,UAAU,GAAG;QACnB,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,cAAc;KACrB,CAAC;IAEM,gBAAgB,GAAG,GAAG,EAAE;QAC/B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;YACjC,OAAO;QACR,CAAC;QAED,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;YACnB,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QACtC,CAAC;IACF,CAAC,CAAC;IAEM,eAAe;QACtB,MAAM,OAAO,GA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KAAK,EAAE,MAAM,CAAC,QAAQ,GAAI;wBAChE,2DAAI,KAAK,EAAC,wBAAwB,IAAE,IAAI,CAAC,UAAU,IAAI,OAAO,CAAC,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAM,CACrF;oBACN,2DAAI,KAAK,EAAC,uBAAuB,IAAE,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC,CAAM,CACrE,CACK,CACZ,CACK,CACP,CAAC;IACH,CAAC;IAED,sBAAsB;IACtB,cAAc,CAAC,OAA0B,EAAE,QAAgB,CAAC;QAC3D,MAAM,SAAS,GAAkB,EAAE,CAAC;QAEpC,IAAI,KAAK,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,EAAE,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC;YACzE,SAAS,CAAC,IAAI,CAAC,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC;QACpC,CAAC;aAAM,CAAC;YACP,SAAS,CAAC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,KAAK,CAAC,CAAC,CAAC;QAC/C,CAAC;QAED,OAAO,SAAS,CAAC;IAClB,CAAC;IAED,QAAQ,GAAG,CAAC,OAAe,EAAE,KAAa,EAAE,EAAE;QAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC,CAAC;QACrD,OAAO,CACN,UAAI,KAAK,EAAE,kEAAkE,KAAK,EAAE;YACnF,SAAG,SAAS,EAAE,WAAW,GAAM,CAC3B,CACL,CAAC;IACH,CAAC,CAAC","sourcesContent":["import { Component, Element, Host, Prop, State, h } from '@stencil/core';\r\nimport colors from '../../styles/color.json';\r\n\r\n@Component({\r\n tag: 'sd-guide',\r\n styleUrl: 'sd-guide.scss',\r\n})\r\nexport class SdGuide {\r\n @Element() el!: HTMLElement;\r\n\r\n @Prop() type: 'help' | 'pdf' | 'youtube' | 'notion' | 'event' = 'help';\r\n @Prop() popupTitle: string = '';\r\n @Prop() message: string | string[] = '';\r\n @Prop() guideUrl: string = '';\r\n @Prop() popupWidth?: number;\r\n\r\n @State() popupShow: boolean = false;\r\n\r\n private guideRef?: HTMLElement;\r\n\r\n static guideTitle = {\r\n help: '활용 Tip',\r\n pdf: 'PDF Guide',\r\n youtube: 'Video Guide',\r\n notion: '사용 가이드',\r\n event: 'Event Button',\r\n };\r\n\r\n private handleClickGuide = () => {\r\n if (this.type === 'help') {\r\n this.popupShow = !this.popupShow;\r\n return;\r\n }\r\n\r\n if (this.guideUrl) {\r\n window.open(this.guideUrl, '_blank');\r\n }\r\n };\r\n\r\n private getGuideClasses(): string {\r\n const classes = ['sd-guide'];\r\n\r\n classes.push(`sd-guide--${this.type}`);\r\n\r\n if (this.popupShow) classes.push('sd-guide--active');\r\n\r\n return classes.join(' ');\r\n }\r\n\r\n private getGuideStyle(): StyleProps {\r\n const styles: StyleProps = {};\r\n\r\n if (this.type === 'help') {\r\n styles['--guide-border'] = this.popupShow ? colors.green_65 : colors.grey_45;\r\n styles['--guide-color'] = this.popupShow ? colors.white : colors.grey_90;\r\n styles['--guide-background'] = this.popupShow ? colors.green_65 : colors.white;\r\n } else {\r\n styles['--guide-border'] = colors.grey_45;\r\n styles['--guide-color'] = colors.grey_90;\r\n styles['--guide-background'] = colors.white;\r\n }\r\n\r\n return styles;\r\n }\r\n\r\n private getGuidIcon(): { name: IconName; size: number; color: string } {\r\n if (this.type === 'pdf') {\r\n return { name: 'pdf', size: 20, color: colors.red_75 };\r\n } else if (this.type === 'youtube') {\r\n return { name: 'youtube', size: 20, color: colors.red_75 };\r\n } else if (this.type === 'notion') {\r\n return { name: 'notion', size: 16, color: colors.black };\r\n } else if (this.type === 'event') {\r\n return { name: 'event', size: 16, color: colors.brilliantblue_70 };\r\n }\r\n\r\n return { name: 'helpOutline', size: 20, color: this.popupShow ? colors.white : colors.green_65 };\r\n }\r\n\r\n closeDropdown = () => {\r\n this.popupShow = false;\r\n };\r\n\r\n render() {\r\n const { name: iconName, size: iconSize, color: iconColor } = this.getGuidIcon();\r\n\r\n return (\r\n <Host style={this.getGuideStyle()}>\r\n <sd-button\r\n ref={el => (this.guideRef = el as unknown as HTMLElement)}\r\n class={this.getGuideClasses()}\r\n variant=\"outline\"\r\n label={SdGuide.guideTitle[this.type]}\r\n size=\"md\"\r\n color=\"var(--guide-color)\"\r\n icon={iconName}\r\n iconColor={iconColor}\r\n iconSize={iconSize}\r\n iconStyle={{ marginRight: '4px' }}\r\n buttonStyle={{\r\n height: '28px',\r\n minHeight: '28px',\r\n padding: '4px 12px',\r\n borderRadius: '16px',\r\n borderColor: 'var(--guide-border)',\r\n color: 'var(--guide-color)',\r\n fontSize: '12px',\r\n fontWeight: '400',\r\n backgroundColor: 'var(--guide-background)',\r\n }}\r\n onSdClick={this.handleClickGuide}\r\n />\r\n {this.type === 'help' && this.popupShow && (\r\n <sd-portal\r\n open={this.popupShow}\r\n parentRef={this.guideRef}\r\n onSdClose={this.closeDropdown}\r\n offset={[0, 24]}\r\n >\r\n <div\r\n class=\"sd-guide__popup\"\r\n style={{ width: this.popupWidth ? this.popupWidth + 'px' : '426px' } as any}\r\n >\r\n <sd-button\r\n class=\"sd-guide__popup__close\"\r\n icon=\"close\"\r\n color={colors.grey_65}\r\n size=\"md\"\r\n variant=\"ghost\"\r\n noHover\r\n buttonStyle={{ padding: '0px', minHeight: '0px' }}\r\n onSdClick={this.closeDropdown}\r\n />\r\n <div class=\"sd-guide__popup__header\">\r\n <sd-icon name=\"helpOutline\" size={24} color={colors.green_65} />\r\n <h3 class=\"sd-guide__popup__title\">{this.popupTitle || SdGuide.guideTitle[this.type]}</h3>\r\n </div>\r\n <ul class=\"sd-guide__popup__list\">{this.renderListItem(this.message)}</ul>\r\n </div>\r\n </sd-portal>\r\n )}\r\n </Host>\r\n );\r\n }\r\n\r\n // 현재 2depth까지만 스타일 적용\r\n renderListItem(message: string | string[], depth: number = 0): HTMLElement[] {\r\n const listItems: HTMLElement[] = [];\r\n\r\n if (Array.isArray(message)) {\r\n const depthMsg = message.map(msg => this.renderListItem(msg, depth + 1));\r\n listItems.push(...depthMsg.flat());\r\n } else {\r\n listItems.push(this.renderLi(message, depth));\r\n }\r\n\r\n return listItems;\r\n }\r\n\r\n renderLi = (message: string, depth: number) => {\r\n const listContent = message.replace(/ /gi, '&nbsp;');\r\n return (\r\n <li class={`sd-guide__popup__list__item sd-guide__popup__list__item--depth-${depth}`}>\r\n <p innerHTML={listContent}></p>\r\n </li>\r\n );\r\n };\r\n}\r\n"]}
1
+ {"version":3,"file":"sd-guide.js","sourceRoot":"","sources":["../../../src/components/sd-guide/sd-guide.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,CAAC,EAAE,MAAM,eAAe,CAAC;AACzE,OAAO,MAAM,MAAM,yBAAyB,CAAC;AAQ7C,MAAM,OAAO,OAAO;IACR,EAAE,CAAe;IAEpB,IAAI,GAAc,MAAM,CAAC;IACzB,UAAU,GAAW,EAAE,CAAC;IACxB,OAAO,GAAsB,EAAE,CAAC;IAChC,QAAQ,GAAW,EAAE,CAAC;IACtB,UAAU,CAAU;IAEnB,SAAS,GAAY,KAAK,CAAC;IAE5B,QAAQ,CAAe;IAE/B,MAAM,CAAC,UAAU,GAAG;QACnB,IAAI,EAAE,QAAQ;QACd,GAAG,EAAE,WAAW;QAChB,OAAO,EAAE,aAAa;QACtB,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,cAAc;KACrB,CAAC;IAEM,gBAAgB,GAAG,GAAG,EAAE;QAC/B,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;YAC1B,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC;YACjC,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AAG,SAAS,EAAE,WAAW,GAAM,CAC3B,CACL,CAAC;IACH,CAAC,CAAC","sourcesContent":["import { Component, Element, Host, Prop, State, h } from '@stencil/core';\r\nimport colors from '../../styles/color.json';\r\n\r\ntype GuideType = 'help' | 'pdf' | 'youtube' | 'notion' | 'event';\r\n\r\n@Component({\r\n tag: 'sd-guide',\r\n styleUrl: 'sd-guide.scss',\r\n})\r\nexport class SdGuide {\r\n @Element() el!: HTMLElement;\r\n\r\n @Prop() type: GuideType = 'help';\r\n @Prop() popupTitle: string = '';\r\n @Prop() message: string | string[] = '';\r\n @Prop() guideUrl: string = '';\r\n @Prop() popupWidth?: number;\r\n\r\n @State() popupShow: boolean = false;\r\n\r\n private guideRef?: HTMLElement;\r\n\r\n static guideTitle = {\r\n help: '활용 Tip',\r\n pdf: 'PDF Guide',\r\n youtube: 'Video Guide',\r\n notion: '사용 가이드',\r\n event: 'Event Button',\r\n };\r\n\r\n private handleClickGuide = () => {\r\n if (this.type === 'help') {\r\n this.popupShow = !this.popupShow;\r\n return;\r\n }\r\n\r\n if (this.guideUrl) {\r\n window.open(this.guideUrl, '_blank');\r\n }\r\n };\r\n\r\n private getGuideClasses(): string {\r\n const classes = ['sd-guide'];\r\n\r\n classes.push(`sd-guide--${this.type}`);\r\n\r\n if (this.popupShow) classes.push('sd-guide--active');\r\n\r\n return classes.join(' ');\r\n }\r\n\r\n private getGuideStyle(): StyleProps {\r\n const styles: StyleProps = {};\r\n\r\n if (this.type === 'help') {\r\n styles['--guide-border'] = this.popupShow ? colors.green_65 : colors.grey_45;\r\n styles['--guide-color'] = this.popupShow ? colors.white : colors.grey_90;\r\n styles['--guide-background'] = this.popupShow ? colors.green_65 : colors.white;\r\n } else {\r\n styles['--guide-border'] = colors.grey_45;\r\n styles['--guide-color'] = colors.grey_90;\r\n styles['--guide-background'] = colors.white;\r\n }\r\n\r\n return styles;\r\n }\r\n\r\n private getGuidIcon(): { name: IconName; size: number; color: string } {\r\n if (this.type === 'pdf') {\r\n return { name: 'pdf', size: 20, color: colors.red_75 };\r\n } else if (this.type === 'youtube') {\r\n return { name: 'youtube', size: 20, color: colors.red_75 };\r\n } else if (this.type === 'notion') {\r\n return { name: 'notion', size: 16, color: colors.black };\r\n } else if (this.type === 'event') {\r\n return { name: 'event', size: 16, color: colors.brilliantblue_70 };\r\n }\r\n\r\n return { name: 'helpOutline', size: 20, color: this.popupShow ? colors.white : colors.green_65 };\r\n }\r\n\r\n closeDropdown = () => {\r\n this.popupShow = false;\r\n };\r\n\r\n render() {\r\n const { name: iconName, size: iconSize, color: iconColor } = this.getGuidIcon();\r\n\r\n return (\r\n <Host style={this.getGuideStyle()}>\r\n <sd-button\r\n ref={el => (this.guideRef = el as unknown as HTMLElement)}\r\n class={this.getGuideClasses()}\r\n variant=\"outline\"\r\n label={SdGuide.guideTitle[this.type]}\r\n size=\"md\"\r\n color=\"var(--guide-color)\"\r\n icon={iconName}\r\n iconColor={iconColor}\r\n iconSize={iconSize}\r\n iconStyle={{ marginRight: '4px' }}\r\n buttonStyle={{\r\n height: '28px',\r\n minHeight: '28px',\r\n padding: '4px 12px',\r\n borderRadius: '16px',\r\n borderColor: 'var(--guide-border)',\r\n color: 'var(--guide-color)',\r\n fontSize: '12px',\r\n fontWeight: '400',\r\n backgroundColor: 'var(--guide-background)',\r\n }}\r\n onSdClick={this.handleClickGuide}\r\n />\r\n {this.type === 'help' && this.popupShow && (\r\n <sd-portal\r\n open={this.popupShow}\r\n parentRef={this.guideRef}\r\n onSdClose={this.closeDropdown}\r\n offset={[0, 24]}\r\n >\r\n <div\r\n class=\"sd-guide__popup\"\r\n style={{ width: this.popupWidth ? this.popupWidth + 'px' : '426px' } as any}\r\n >\r\n <sd-button\r\n class=\"sd-guide__popup__close\"\r\n icon=\"close\"\r\n color={colors.grey_65}\r\n size=\"md\"\r\n variant=\"ghost\"\r\n noHover\r\n buttonStyle={{ padding: '0px', minHeight: '0px' }}\r\n onSdClick={this.closeDropdown}\r\n />\r\n <div class=\"sd-guide__popup__header\">\r\n <sd-icon name=\"helpOutline\" size={24} color={colors.green_65} />\r\n <h3 class=\"sd-guide__popup__title\">{this.popupTitle || SdGuide.guideTitle[this.type]}</h3>\r\n </div>\r\n <ul class=\"sd-guide__popup__list\">{this.renderListItem(this.message)}</ul>\r\n </div>\r\n </sd-portal>\r\n )}\r\n </Host>\r\n );\r\n }\r\n\r\n // 현재 2depth까지만 스타일 적용\r\n renderListItem(message: string | string[], depth: number = 0): HTMLElement[] {\r\n const listItems: HTMLElement[] = [];\r\n\r\n if (Array.isArray(message)) {\r\n const depthMsg = message.map(msg => this.renderListItem(msg, depth + 1));\r\n listItems.push(...depthMsg.flat());\r\n } else {\r\n listItems.push(this.renderLi(message, depth));\r\n }\r\n\r\n return listItems;\r\n }\r\n\r\n renderLi = (message: string, depth: number) => {\r\n const listContent = message.replace(/ /gi, '&nbsp;');\r\n return (\r\n <li class={`sd-guide__popup__list__item sd-guide__popup__list__item--depth-${depth}`}>\r\n <p innerHTML={listContent}></p>\r\n </li>\r\n );\r\n };\r\n}\r\n"]}
@@ -77,7 +77,7 @@ const SdGuide$1 = /*@__PURE__*/ proxyCustomElement(class SdGuide extends H {
77
77
  };
78
78
  render() {
79
79
  const { name: iconName, size: iconSize, color: iconColor } = this.getGuidIcon();
80
- return (h(Host, { key: '4313417f5c41f1126e329bddd46d75f2f571bcbe', style: this.getGuideStyle() }, h("sd-button", { key: 'b7ba861de4752828dd7b8747d26b4a8549a409a8', ref: el => (this.guideRef = el), class: this.getGuideClasses(), variant: "outline", label: SdGuide.guideTitle[this.type], size: "md", color: "var(--guide-color)", icon: iconName, iconColor: iconColor, iconSize: iconSize, iconStyle: { marginRight: '4px' }, buttonStyle: {
80
+ return (h(Host, { key: 'a56286f0027547de784fe294510b3249f7899f15', style: this.getGuideStyle() }, h("sd-button", { key: 'c1db0647448b3830f05b9cd9856f349fc9b3c2ca', ref: el => (this.guideRef = el), class: this.getGuideClasses(), variant: "outline", label: SdGuide.guideTitle[this.type], size: "md", color: "var(--guide-color)", icon: iconName, iconColor: iconColor, iconSize: iconSize, iconStyle: { marginRight: '4px' }, buttonStyle: {
81
81
  height: '28px',
82
82
  minHeight: '28px',
83
83
  padding: '4px 12px',
@@ -87,7 +87,7 @@ const SdGuide$1 = /*@__PURE__*/ proxyCustomElement(class SdGuide extends H {
87
87
  fontSize: '12px',
88
88
  fontWeight: '400',
89
89
  backgroundColor: 'var(--guide-background)',
90
- }, onSdClick: this.handleClickGuide }), this.type === 'help' && this.popupShow && (h("sd-portal", { key: '31c52e9aef405c536dfd1a9da8d59450dbf179cf', open: this.popupShow, parentRef: this.guideRef, onSdClose: this.closeDropdown, offset: [0, 24] }, h("div", { key: 'b4798202e35dcd232ce66eb6b939b57993d8de6a', class: "sd-guide__popup", style: { width: this.popupWidth ? this.popupWidth + 'px' : '426px' } }, h("sd-button", { key: '9aa1f1d5e3bb224f606bb204754843e5cd8f5622', class: "sd-guide__popup__close", icon: "close", color: colors.grey_65, size: "md", variant: "ghost", noHover: true, buttonStyle: { padding: '0px', minHeight: '0px' }, onSdClick: this.closeDropdown }), h("div", { key: '87322cfaaced49ba6da7a9aa648eeed7403f88ca', class: "sd-guide__popup__header" }, h("sd-icon", { key: '231f23a8ceb669a39bd89c2054848f82edafd344', name: "helpOutline", size: 24, color: colors.green_65 }), h("h3", { key: 'c4dec3314abeb04d7b71962d76c8191c26332e7c', class: "sd-guide__popup__title" }, this.popupTitle || SdGuide.guideTitle[this.type])), h("ul", { key: '3c19dc7e2b14e29b3079d34e88e52230c1a16911', class: "sd-guide__popup__list" }, this.renderListItem(this.message)))))));
90
+ }, onSdClick: this.handleClickGuide }), this.type === 'help' && this.popupShow && (h("sd-portal", { key: 'bbd220ae09816df67a7cff96f5a8d7359ea02a0a', open: this.popupShow, parentRef: this.guideRef, onSdClose: this.closeDropdown, offset: [0, 24] }, h("div", { key: '839444f5533beba6a66a565bd28a59e0663eefef', class: "sd-guide__popup", style: { width: this.popupWidth ? this.popupWidth + 'px' : '426px' } }, h("sd-button", { key: 'eaf414c9d50d43fc12faab1a03c943b82d054a94', class: "sd-guide__popup__close", icon: "close", color: colors.grey_65, size: "md", variant: "ghost", noHover: true, buttonStyle: { padding: '0px', minHeight: '0px' }, onSdClick: this.closeDropdown }), h("div", { key: 'e3195a06835a8c98a3591e820ef2183446fdc685', class: "sd-guide__popup__header" }, h("sd-icon", { key: '5544db3d1bb4d887cf008b8ee9658ea0b5c5208f', name: "helpOutline", size: 24, color: colors.green_65 }), h("h3", { key: '9492b9846a7b00dd67f01e44c95c19c427e36b52', class: "sd-guide__popup__title" }, this.popupTitle || SdGuide.guideTitle[this.type])), h("ul", { key: 'abf36fa7c8a413c4d26eb8c981badfcbf38989a7', class: "sd-guide__popup__list" }, this.renderListItem(this.message)))))));
91
91
  }
92
92
  // 현재 2depth까지만 스타일 적용
93
93
  renderListItem(message, depth = 0) {
@@ -1 +1 @@
1
- {"file":"sd-guide.js","mappings":";;;;;AAAA,MAAM,UAAU,GAAG,shqBAAshqB;;MCO5hqBA,SAAO,iBAAAC,kBAAA,CAAA,MAAA,OAAA,SAAAC,CAAA,CAAA;;;;;;;;IAGX,IAAI,GAAoD,MAAM;IAC9D,UAAU,GAAW,EAAE;IACvB,OAAO,GAAsB,EAAE;IAC/B,QAAQ,GAAW,EAAE;AACrB,IAAA,UAAU;IAET,SAAS,GAAY,KAAK;AAE3B,IAAA,QAAQ;IAEhB,OAAO,UAAU,GAAG;AACnB,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,GAAG,EAAE,WAAW;AAChB,QAAA,OAAO,EAAE,aAAa;AACtB,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,KAAK,EAAE,cAAc;KACrB;IAEO,gBAAgB,GAAG,MAAK;AAC/B,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,MAAM,EAAE;AACzB,YAAA,IAAI,CAAC,SAAS,GAAG,CAAC,IAAI,CAAC,SAAS;YAChC;;AAGD,QAAA,IAAI,IAAI,CAA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C,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;QACpD,QACC,CAAI,CAAA,IAAA,EAAA,EAAA,KAAK,EAAE,CAAkE,+DAAA,EAAA,KAAK,CAAE,CAAA,EAAA,EACnF,CAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,WAAW,EAAM,CAAA,CAC3B;AAEP,KAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SdGuide","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sd-guide/sd-guide.scss?tag=sd-guide","src/components/sd-guide/sd-guide.tsx"],"sourcesContent":["@import '../../styles/global.scss';\r\n\r\n*,\r\n*::before {\r\n box-sizing: border-box;\r\n}\r\n\r\n.sd-guide__popup {\r\n position: relative;\r\n padding: 20px 32px;\r\n border-radius: 8px;\r\n box-shadow: 4px 4px 24px 4px rgba(0, 0, 0, 0.1);\r\n\r\n &__close {\r\n position: absolute;\r\n top: 12px;\r\n right: 12px;\r\n }\r\n\r\n &__header {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n margin-bottom: 12px;\r\n\r\n .sd-guide__popup__title {\r\n margin-top: 0;\r\n font-size: 16px;\r\n font-weight: 700;\r\n line-height: 26px;\r\n color: $grey_90;\r\n }\r\n }\r\n\r\n &__list {\r\n width: 100%;\r\n padding: 0;\r\n margin: 0;\r\n\r\n &__item {\r\n display: flex;\r\n width: 100%;\r\n align-items: start;\r\n list-style: none;\r\n color: $grey_90;\r\n font-size: 12px;\r\n font-weight: 400;\r\n\r\n p {\r\n width: 100%;\r\n padding: 0;\r\n margin: 0;\r\n word-wrap: break-word;\r\n word-break: break-word;\r\n white-space: normal;\r\n overflow-wrap: break-word;\r\n min-width: 0;\r\n }\r\n\r\n &::before {\r\n display: block;\r\n content: '-';\r\n width: 6px;\r\n color: $grey_90;\r\n font-size: 12px;\r\n font-weight: 400;\r\n margin-left: 10px;\r\n margin-right: 12px;\r\n flex-shrink: 0;\r\n }\r\n\r\n &--depth-2 {\r\n &::before {\r\n content: '•';\r\n }\r\n padding-left: 26px;\r\n }\r\n }\r\n }\r\n}\r\n","import { Component, Element, Host, Prop, State, h } from '@stencil/core';\r\nimport colors from '../../styles/color.json';\r\n\r\n@Component({\r\n tag: 'sd-guide',\r\n styleUrl: 'sd-guide.scss',\r\n})\r\nexport class SdGuide {\r\n @Element() el!: HTMLElement;\r\n\r\n @Prop() type: 'help' | 'pdf' | 'youtube' | 'notion' | 'event' = 'help';\r\n @Prop() popupTitle: string = '';\r\n @Prop() message: string | string[] = '';\r\n @Prop() guideUrl: string = '';\r\n @Prop() popupWidth?: number;\r\n\r\n @State() popupShow: boolean = false;\r\n\r\n private guideRef?: HTMLElement;\r\n\r\n static guideTitle = {\r\n help: '활용 Tip',\r\n pdf: 'PDF Guide',\r\n youtube: 'Video Guide',\r\n notion: '사용 가이드',\r\n event: 'Event Button',\r\n };\r\n\r\n private handleClickGuide = () => {\r\n if (this.type === 'help') {\r\n this.popupShow = !this.popupShow;\r\n return;\r\n }\r\n\r\n if (this.guideUrl) {\r\n window.open(this.guideUrl, '_blank');\r\n }\r\n };\r\n\r\n private getGuideClasses(): string {\r\n const classes = ['sd-guide'];\r\n\r\n classes.push(`sd-guide--${this.type}`);\r\n\r\n if (this.popupShow) classes.push('sd-guide--active');\r\n\r\n return classes.join(' ');\r\n }\r\n\r\n private getGuideStyle(): StyleProps {\r\n const styles: StyleProps = {};\r\n\r\n if (this.type === 'help') {\r\n styles['--guide-border'] = this.popupShow ? colors.green_65 : colors.grey_45;\r\n styles['--guide-color'] = this.popupShow ? colors.white : colors.grey_90;\r\n styles['--guide-background'] = this.popupShow ? colors.green_65 : colors.white;\r\n } else {\r\n styles['--guide-border'] = colors.grey_45;\r\n styles['--guide-color'] = colors.grey_90;\r\n styles['--guide-background'] = colors.white;\r\n }\r\n\r\n return styles;\r\n }\r\n\r\n private getGuidIcon(): { name: IconName; size: number; color: string } {\r\n if (this.type === 'pdf') {\r\n return { name: 'pdf', size: 20, color: colors.red_75 };\r\n } else if (this.type === 'youtube') {\r\n return { name: 'youtube', size: 20, color: colors.red_75 };\r\n } else if (this.type === 'notion') {\r\n return { name: 'notion', size: 16, color: colors.black };\r\n } else if (this.type === 'event') {\r\n return { name: 'event', size: 16, color: colors.brilliantblue_70 };\r\n }\r\n\r\n return { name: 'helpOutline', size: 20, color: this.popupShow ? colors.white : colors.green_65 };\r\n }\r\n\r\n closeDropdown = () => {\r\n this.popupShow = false;\r\n };\r\n\r\n render() {\r\n const { name: iconName, size: iconSize, color: iconColor } = this.getGuidIcon();\r\n\r\n return (\r\n <Host style={this.getGuideStyle()}>\r\n <sd-button\r\n ref={el => (this.guideRef = el as unknown as HTMLElement)}\r\n class={this.getGuideClasses()}\r\n variant=\"outline\"\r\n label={SdGuide.guideTitle[this.type]}\r\n size=\"md\"\r\n color=\"var(--guide-color)\"\r\n icon={iconName}\r\n iconColor={iconColor}\r\n iconSize={iconSize}\r\n iconStyle={{ marginRight: '4px' }}\r\n buttonStyle={{\r\n height: '28px',\r\n minHeight: '28px',\r\n padding: '4px 12px',\r\n borderRadius: '16px',\r\n borderColor: 'var(--guide-border)',\r\n color: 'var(--guide-color)',\r\n fontSize: '12px',\r\n fontWeight: '400',\r\n backgroundColor: 'var(--guide-background)',\r\n }}\r\n onSdClick={this.handleClickGuide}\r\n />\r\n {this.type === 'help' && this.popupShow && (\r\n <sd-portal\r\n open={this.popupShow}\r\n parentRef={this.guideRef}\r\n onSdClose={this.closeDropdown}\r\n offset={[0, 24]}\r\n >\r\n <div\r\n class=\"sd-guide__popup\"\r\n style={{ width: this.popupWidth ? this.popupWidth + 'px' : '426px' } as any}\r\n >\r\n <sd-button\r\n class=\"sd-guide__popup__close\"\r\n icon=\"close\"\r\n color={colors.grey_65}\r\n size=\"md\"\r\n variant=\"ghost\"\r\n noHover\r\n buttonStyle={{ padding: '0px', minHeight: '0px' }}\r\n onSdClick={this.closeDropdown}\r\n />\r\n <div class=\"sd-guide__popup__header\">\r\n <sd-icon name=\"helpOutline\" size={24} color={colors.green_65} />\r\n <h3 class=\"sd-guide__popup__title\">{this.popupTitle || SdGuide.guideTitle[this.type]}</h3>\r\n </div>\r\n <ul class=\"sd-guide__popup__list\">{this.renderListItem(this.message)}</ul>\r\n </div>\r\n </sd-portal>\r\n )}\r\n </Host>\r\n );\r\n }\r\n\r\n // 현재 2depth까지만 스타일 적용\r\n renderListItem(message: string | string[], depth: number = 0): HTMLElement[] {\r\n const listItems: HTMLElement[] = [];\r\n\r\n if (Array.isArray(message)) {\r\n const depthMsg = message.map(msg => this.renderListItem(msg, depth + 1));\r\n listItems.push(...depthMsg.flat());\r\n } else {\r\n listItems.push(this.renderLi(message, depth));\r\n }\r\n\r\n return listItems;\r\n }\r\n\r\n renderLi = (message: string, depth: number) => {\r\n const listContent = message.replace(/ /gi, '&nbsp;');\r\n return (\r\n <li class={`sd-guide__popup__list__item sd-guide__popup__list__item--depth-${depth}`}>\r\n <p innerHTML={listContent}></p>\r\n </li>\r\n );\r\n };\r\n}\r\n"],"version":3}
1
+ {"file":"sd-guide.js","mappings":";;;;;AAAA,MAAM,UAAU,GAAG,shqBAAshqB;;MCS5hqBA,SAAO,iBAAAC,kBAAA,CAAA,MAAA,OAAA,SAAAC,CAAA,CAAA;;;;;;;;IAGX,IAAI,GAAc,MAAM;IACxB,UAAU,GAAW,EAAE;IACvB,OAAO,GAAsB,EAAE;IAC/B,QAAQ,GAAW,EAAE;AACrB,IAAA,UAAU;IAET,SAAS,GAAY,KAAK;AAE3B,IAAA,QAAQ;IAEhB,OAAO,UAAU,GAAG;AACnB,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,GAAG,EAAE,WAAW;AAChB,QAAA,OAAO,EAAE,aAAa;AACtB,QAAA,MAAM,EAAE,QAAQ;AAChB,QAAA,KAAK,EAAE,cAAc;KACrB;IAEO,gBAAgB,GAAG,MAAK;AAC/B,QAAA,IAAI,IAAI,CAAC,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OAAO,EAAE,KAAK,CAAC,CAAC;;AAG9C,QAAA,OAAO,SAAS;;AAGjB,IAAA,QAAQ,GAAG,CAAC,OAAe,EAAE,KAAa,KAAI;QAC7C,MAAM,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,QAAQ,CAAC;QACpD,QACC,CAAI,CAAA,IAAA,EAAA,EAAA,KAAK,EAAE,CAAkE,+DAAA,EAAA,KAAK,CAAE,CAAA,EAAA,EACnF,CAAA,CAAA,GAAA,EAAA,EAAG,SAAS,EAAE,WAAW,EAAM,CAAA,CAC3B;AAEP,KAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","names":["SdGuide","__stencil_proxyCustomElement","HTMLElement"],"sources":["src/components/sd-guide/sd-guide.scss?tag=sd-guide","src/components/sd-guide/sd-guide.tsx"],"sourcesContent":["@import '../../styles/global.scss';\r\n\r\n*,\r\n*::before {\r\n box-sizing: border-box;\r\n}\r\n\r\n.sd-guide__popup {\r\n position: relative;\r\n padding: 20px 32px;\r\n border-radius: 8px;\r\n box-shadow: 4px 4px 24px 4px rgba(0, 0, 0, 0.1);\r\n\r\n &__close {\r\n position: absolute;\r\n top: 12px;\r\n right: 12px;\r\n }\r\n\r\n &__header {\r\n display: flex;\r\n align-items: center;\r\n gap: 8px;\r\n margin-bottom: 12px;\r\n\r\n .sd-guide__popup__title {\r\n margin-top: 0;\r\n font-size: 16px;\r\n font-weight: 700;\r\n line-height: 26px;\r\n color: $grey_90;\r\n }\r\n }\r\n\r\n &__list {\r\n width: 100%;\r\n padding: 0;\r\n margin: 0;\r\n\r\n &__item {\r\n display: flex;\r\n width: 100%;\r\n align-items: start;\r\n list-style: none;\r\n color: $grey_90;\r\n font-size: 12px;\r\n font-weight: 400;\r\n\r\n p {\r\n width: 100%;\r\n padding: 0;\r\n margin: 0;\r\n word-wrap: break-word;\r\n word-break: break-word;\r\n white-space: normal;\r\n overflow-wrap: break-word;\r\n min-width: 0;\r\n }\r\n\r\n &::before {\r\n display: block;\r\n content: '-';\r\n width: 6px;\r\n color: $grey_90;\r\n font-size: 12px;\r\n font-weight: 400;\r\n margin-left: 10px;\r\n margin-right: 12px;\r\n flex-shrink: 0;\r\n }\r\n\r\n &--depth-2 {\r\n &::before {\r\n content: '•';\r\n }\r\n padding-left: 26px;\r\n }\r\n }\r\n }\r\n}\r\n","import { Component, Element, Host, Prop, State, h } from '@stencil/core';\r\nimport colors from '../../styles/color.json';\r\n\r\ntype GuideType = 'help' | 'pdf' | 'youtube' | 'notion' | 'event';\r\n\r\n@Component({\r\n tag: 'sd-guide',\r\n styleUrl: 'sd-guide.scss',\r\n})\r\nexport class SdGuide {\r\n @Element() el!: HTMLElement;\r\n\r\n @Prop() type: GuideType = 'help';\r\n @Prop() popupTitle: string = '';\r\n @Prop() message: string | string[] = '';\r\n @Prop() guideUrl: string = '';\r\n @Prop() popupWidth?: number;\r\n\r\n @State() popupShow: boolean = false;\r\n\r\n private guideRef?: HTMLElement;\r\n\r\n static guideTitle = {\r\n help: '활용 Tip',\r\n pdf: 'PDF Guide',\r\n youtube: 'Video Guide',\r\n notion: '사용 가이드',\r\n event: 'Event Button',\r\n };\r\n\r\n private handleClickGuide = () => {\r\n if (this.type === 'help') {\r\n this.popupShow = !this.popupShow;\r\n return;\r\n }\r\n\r\n if (this.guideUrl) {\r\n window.open(this.guideUrl, '_blank');\r\n }\r\n };\r\n\r\n private getGuideClasses(): string {\r\n const classes = ['sd-guide'];\r\n\r\n classes.push(`sd-guide--${this.type}`);\r\n\r\n if (this.popupShow) classes.push('sd-guide--active');\r\n\r\n return classes.join(' ');\r\n }\r\n\r\n private getGuideStyle(): StyleProps {\r\n const styles: StyleProps = {};\r\n\r\n if (this.type === 'help') {\r\n styles['--guide-border'] = this.popupShow ? colors.green_65 : colors.grey_45;\r\n styles['--guide-color'] = this.popupShow ? colors.white : colors.grey_90;\r\n styles['--guide-background'] = this.popupShow ? colors.green_65 : colors.white;\r\n } else {\r\n styles['--guide-border'] = colors.grey_45;\r\n styles['--guide-color'] = colors.grey_90;\r\n styles['--guide-background'] = colors.white;\r\n }\r\n\r\n return styles;\r\n }\r\n\r\n private getGuidIcon(): { name: IconName; size: number; color: string } {\r\n if (this.type === 'pdf') {\r\n return { name: 'pdf', size: 20, color: colors.red_75 };\r\n } else if (this.type === 'youtube') {\r\n return { name: 'youtube', size: 20, color: colors.red_75 };\r\n } else if (this.type === 'notion') {\r\n return { name: 'notion', size: 16, color: colors.black };\r\n } else if (this.type === 'event') {\r\n return { name: 'event', size: 16, color: colors.brilliantblue_70 };\r\n }\r\n\r\n return { name: 'helpOutline', size: 20, color: this.popupShow ? colors.white : colors.green_65 };\r\n }\r\n\r\n closeDropdown = () => {\r\n this.popupShow = false;\r\n };\r\n\r\n render() {\r\n const { name: iconName, size: iconSize, color: iconColor } = this.getGuidIcon();\r\n\r\n return (\r\n <Host style={this.getGuideStyle()}>\r\n <sd-button\r\n ref={el => (this.guideRef = el as unknown as HTMLElement)}\r\n class={this.getGuideClasses()}\r\n variant=\"outline\"\r\n label={SdGuide.guideTitle[this.type]}\r\n size=\"md\"\r\n color=\"var(--guide-color)\"\r\n icon={iconName}\r\n iconColor={iconColor}\r\n iconSize={iconSize}\r\n iconStyle={{ marginRight: '4px' }}\r\n buttonStyle={{\r\n height: '28px',\r\n minHeight: '28px',\r\n padding: '4px 12px',\r\n borderRadius: '16px',\r\n borderColor: 'var(--guide-border)',\r\n color: 'var(--guide-color)',\r\n fontSize: '12px',\r\n fontWeight: '400',\r\n backgroundColor: 'var(--guide-background)',\r\n }}\r\n onSdClick={this.handleClickGuide}\r\n />\r\n {this.type === 'help' && this.popupShow && (\r\n <sd-portal\r\n open={this.popupShow}\r\n parentRef={this.guideRef}\r\n onSdClose={this.closeDropdown}\r\n offset={[0, 24]}\r\n >\r\n <div\r\n class=\"sd-guide__popup\"\r\n style={{ width: this.popupWidth ? this.popupWidth + 'px' : '426px' } as any}\r\n >\r\n <sd-button\r\n class=\"sd-guide__popup__close\"\r\n icon=\"close\"\r\n color={colors.grey_65}\r\n size=\"md\"\r\n variant=\"ghost\"\r\n noHover\r\n buttonStyle={{ padding: '0px', minHeight: '0px' }}\r\n onSdClick={this.closeDropdown}\r\n />\r\n <div class=\"sd-guide__popup__header\">\r\n <sd-icon name=\"helpOutline\" size={24} color={colors.green_65} />\r\n <h3 class=\"sd-guide__popup__title\">{this.popupTitle || SdGuide.guideTitle[this.type]}</h3>\r\n </div>\r\n <ul class=\"sd-guide__popup__list\">{this.renderListItem(this.message)}</ul>\r\n </div>\r\n </sd-portal>\r\n )}\r\n </Host>\r\n );\r\n }\r\n\r\n // 현재 2depth까지만 스타일 적용\r\n renderListItem(message: string | string[], depth: number = 0): HTMLElement[] {\r\n const listItems: HTMLElement[] = [];\r\n\r\n if (Array.isArray(message)) {\r\n const depthMsg = message.map(msg => this.renderListItem(msg, depth + 1));\r\n listItems.push(...depthMsg.flat());\r\n } else {\r\n listItems.push(this.renderLi(message, depth));\r\n }\r\n\r\n return listItems;\r\n }\r\n\r\n renderLi = (message: string, depth: number) => {\r\n const listContent = message.replace(/ /gi, '&nbsp;');\r\n return (\r\n <li class={`sd-guide__popup__list__item sd-guide__popup__list__item--depth-${depth}`}>\r\n <p innerHTML={listContent}></p>\r\n </li>\r\n );\r\n };\r\n}\r\n"],"version":3}
@@ -1,2 +1,2 @@
1
- import{p as e,g as o,b as t}from"./p-F7bQTYmD.js";export{s as setNonce}from"./p-F7bQTYmD.js";var a=()=>{const o=import.meta.url;const t={};if(o!==""){t.resourcesUrl=new URL(".",o).href}return e(t)};a().then((async e=>{await o();return t([["p-47a18185",[[256,"sd-guide",{type:[1],popupTitle:[1,"popup-title"],message:[1],guideUrl:[1,"guide-url"],popupWidth:[2,"popup-width"],popupShow:[32]}],[257,"sd-button",{variant:[1],size:[1],color:[1],label:[1],disabled:[4],type:[1],icon:[1],iconColor:[1,"icon-color"],iconSize:[2,"icon-size"],iconRight:[1,"icon-right"],noHover:[4,"no-hover"],buttonStyle:[16],iconStyle:[16]}],[260,"sd-portal",{to:[1],parentRef:[16],offset:[16],zIndex:[2,"z-index"],open:[4]},[[9,"scroll","updatePosition"],[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"]]],[258,"sd-icon",{name:[1],size:[8],color:[1],rotate:[2],label:[1],iconStyle:[16]}]]],["p-2106f2b1",[[256,"sd-table",{columns:[16],rows:[1040],selected:[1040],rowKey:[1,"row-key"],selectable:[4],resizable:[4],height:[2],stickyHeader:[4,"sticky-header"],stickyColumn:[16],noDataLabel:[1,"no-data-label"],pagination:[16],bodyCellRenderer:[16],currentPage:[32],innerRows:[32],innerSelected:[32],columnWidths:[32],scrolledLeft:[32],scrolledRight:[32]},null,{columns:["handleColumnsChange"],rows:["handleRowsChange"],selected:["handleSelectedChange"],pagination:["handlePaginationChange"]}]]],["p-af40a2ec",[[258,"sd-date-box",{date:[8],disabled:[4],selected:[4],isStartDate:[4,"is-start-date"],isEndDate:[4,"is-end-date"],isToday:[4,"is-today"],inRange:[4,"in-range"],type:[1]}],[260,"sd-input",{value:[1032],label:[1],placeholder:[1],disabled:[4],clearable:[4],width:[8],barcode:[4],rules:[16],autoFocus:[4,"auto-focus"],status:[1],inputClass:[1,"input-class"],readonly:[4],inputStyle:[16],internalValue:[32],error:[32],focused:[32],hovered:[32],getNativeElement:[64]},null,{value:["valueChanged"],internalValue:["internalValueChanged"]}]]],["p-2d8ef8b7",[[260,"sd-select",{value:[1032],label:[1],options:[1040],placeholder:[1],optionPlaceholder:[1,"option-placeholder"],width:[1],dropdownHeight:[1,"dropdown-height"],disabled:[4],clearable:[4],searchable:[4],containerStyle:[16],triggerStyle:[16],dropdownStyle:[16],optionStyle:[16],labelStyle:[16],optionRenderer:[16],filteredOptions:[32],isOpen:[32],searchText:[32],itemIndex:[32],isScrolled:[32]},null,{value:["valueChanged"],options:["optionsChanged"],searchText:["searchTextChanged"],itemIndex:["itemIndexChanged"],isOpen:["isOpenChanged"]}]]],["p-0be303fc",[[258,"sd-date-picker",{date:[1],label:[1],selectable:[16],disabled:[4],isOpen:[32],currentDate:[32],currentYear:[32],currentMonth:[32]}]]],["p-3d8c249d",[[258,"sd-date-range-picker",{date:[16],label:[1],selectable:[16],maxRange:[2,"max-range"],disabled:[4],isOpen:[32],dateRange:[32],hoverDate:[32],prevYear:[32],prevMonth:[32]}]]],["p-9e1abc28",[[257,"sd-popover",{show:[1028],placement:[513],color:[513],icon:[513],iconSize:[514,"icon-size"],label:[1],buttonSize:[513,"button-size"],buttonVariant:[513,"button-variant"],menuTitle:[513,"title"],messages:[16],buttons:[16],menuClass:[1,"menu-class"],noHover:[4,"no-hover"],useClose:[4,"use-close"],showPopover:[32],slotContent:[32]},null,{show:["watchShowHandler"]}]]],["p-95e7d47f",[[257,"sd-tag",{size:[1],color:[1],rounded:[4],label:[1],bgColor:[1,"bg-color"],textColor:[1,"text-color"]}]]],["p-bda0d32b",[[257,"sd-checkbox",{checked:[8],val:[8],disabled:[4],label:[1],checkboxStyle:[16],isChecked:[32]},null,{checked:["watchValueHandler"]}]]],["p-3ec8c5aa",[[257,"sd-select-option",{option:[16],index:[2],isSelected:[4,"is-selected"],isFocused:[4,"is-focused"],optionStyle:[16],disabled:[4],useCheckbox:[4,"use-checkbox"],isHovered:[32],isDisabled:[64]}]]],["p-9edcce39",[[257,"sd-tooltip-portal",{to:[1],parentRef:[16],offset:[16],zIndex:[2,"z-index"],placement:[1],open:[4]},[[9,"scroll","updatePosition"],[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"]]]]],["p-ae72caf9",[[257,"sd-tooltip",{trigger:[513],placement:[513],color:[513],icon:[513],iconSize:[514,"icon-size"],label:[1],buttonSize:[513,"button-size"],buttonVariant:[513,"button-variant"],noHover:[4,"no-hover"],useClose:[4,"use-close"],showTooltip:[32]}],[257,"sd-pagination",{currentPage:[2,"current-page"],lastPage:[2,"last-page"],simple:[4]},null,{currentPage:["onPropChange"],lastPage:["onPropChange"]}]]]],e)}));
1
+ import{p as e,g as o,b as t}from"./p-F7bQTYmD.js";export{s as setNonce}from"./p-F7bQTYmD.js";var a=()=>{const o=import.meta.url;const t={};if(o!==""){t.resourcesUrl=new URL(".",o).href}return e(t)};a().then((async e=>{await o();return t([["p-40f06495",[[256,"sd-guide",{type:[1],popupTitle:[1,"popup-title"],message:[1],guideUrl:[1,"guide-url"],popupWidth:[2,"popup-width"],popupShow:[32]}],[257,"sd-button",{variant:[1],size:[1],color:[1],label:[1],disabled:[4],type:[1],icon:[1],iconColor:[1,"icon-color"],iconSize:[2,"icon-size"],iconRight:[1,"icon-right"],noHover:[4,"no-hover"],buttonStyle:[16],iconStyle:[16]}],[260,"sd-portal",{to:[1],parentRef:[16],offset:[16],zIndex:[2,"z-index"],open:[4]},[[9,"scroll","updatePosition"],[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"]]],[258,"sd-icon",{name:[1],size:[8],color:[1],rotate:[2],label:[1],iconStyle:[16]}]]],["p-2106f2b1",[[256,"sd-table",{columns:[16],rows:[1040],selected:[1040],rowKey:[1,"row-key"],selectable:[4],resizable:[4],height:[2],stickyHeader:[4,"sticky-header"],stickyColumn:[16],noDataLabel:[1,"no-data-label"],pagination:[16],bodyCellRenderer:[16],currentPage:[32],innerRows:[32],innerSelected:[32],columnWidths:[32],scrolledLeft:[32],scrolledRight:[32]},null,{columns:["handleColumnsChange"],rows:["handleRowsChange"],selected:["handleSelectedChange"],pagination:["handlePaginationChange"]}]]],["p-af40a2ec",[[258,"sd-date-box",{date:[8],disabled:[4],selected:[4],isStartDate:[4,"is-start-date"],isEndDate:[4,"is-end-date"],isToday:[4,"is-today"],inRange:[4,"in-range"],type:[1]}],[260,"sd-input",{value:[1032],label:[1],placeholder:[1],disabled:[4],clearable:[4],width:[8],barcode:[4],rules:[16],autoFocus:[4,"auto-focus"],status:[1],inputClass:[1,"input-class"],readonly:[4],inputStyle:[16],internalValue:[32],error:[32],focused:[32],hovered:[32],getNativeElement:[64]},null,{value:["valueChanged"],internalValue:["internalValueChanged"]}]]],["p-2d8ef8b7",[[260,"sd-select",{value:[1032],label:[1],options:[1040],placeholder:[1],optionPlaceholder:[1,"option-placeholder"],width:[1],dropdownHeight:[1,"dropdown-height"],disabled:[4],clearable:[4],searchable:[4],containerStyle:[16],triggerStyle:[16],dropdownStyle:[16],optionStyle:[16],labelStyle:[16],optionRenderer:[16],filteredOptions:[32],isOpen:[32],searchText:[32],itemIndex:[32],isScrolled:[32]},null,{value:["valueChanged"],options:["optionsChanged"],searchText:["searchTextChanged"],itemIndex:["itemIndexChanged"],isOpen:["isOpenChanged"]}]]],["p-0be303fc",[[258,"sd-date-picker",{date:[1],label:[1],selectable:[16],disabled:[4],isOpen:[32],currentDate:[32],currentYear:[32],currentMonth:[32]}]]],["p-3d8c249d",[[258,"sd-date-range-picker",{date:[16],label:[1],selectable:[16],maxRange:[2,"max-range"],disabled:[4],isOpen:[32],dateRange:[32],hoverDate:[32],prevYear:[32],prevMonth:[32]}]]],["p-9e1abc28",[[257,"sd-popover",{show:[1028],placement:[513],color:[513],icon:[513],iconSize:[514,"icon-size"],label:[1],buttonSize:[513,"button-size"],buttonVariant:[513,"button-variant"],menuTitle:[513,"title"],messages:[16],buttons:[16],menuClass:[1,"menu-class"],noHover:[4,"no-hover"],useClose:[4,"use-close"],showPopover:[32],slotContent:[32]},null,{show:["watchShowHandler"]}]]],["p-95e7d47f",[[257,"sd-tag",{size:[1],color:[1],rounded:[4],label:[1],bgColor:[1,"bg-color"],textColor:[1,"text-color"]}]]],["p-bda0d32b",[[257,"sd-checkbox",{checked:[8],val:[8],disabled:[4],label:[1],checkboxStyle:[16],isChecked:[32]},null,{checked:["watchValueHandler"]}]]],["p-3ec8c5aa",[[257,"sd-select-option",{option:[16],index:[2],isSelected:[4,"is-selected"],isFocused:[4,"is-focused"],optionStyle:[16],disabled:[4],useCheckbox:[4,"use-checkbox"],isHovered:[32],isDisabled:[64]}]]],["p-9edcce39",[[257,"sd-tooltip-portal",{to:[1],parentRef:[16],offset:[16],zIndex:[2,"z-index"],placement:[1],open:[4]},[[9,"scroll","updatePosition"],[9,"resize","updatePosition"],[9,"mousedown","handleMouseDown"],[8,"click","handleWindowClick"]]]]],["p-ae72caf9",[[257,"sd-tooltip",{trigger:[513],placement:[513],color:[513],icon:[513],iconSize:[514,"icon-size"],label:[1],buttonSize:[513,"button-size"],buttonVariant:[513,"button-variant"],noHover:[4,"no-hover"],useClose:[4,"use-close"],showTooltip:[32]}],[257,"sd-pagination",{currentPage:[2,"current-page"],lastPage:[2,"last-page"],simple:[4]},null,{currentPage:["onPropChange"],lastPage:["onPropChange"]}]]]],e)}));
2
2
  //# sourceMappingURL=design-system.esm.js.map