@designbasekorea/ui-wc 0.5.5 → 0.5.6

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 (155) hide show
  1. package/dist/chunks/lottie-e273b936.js +17032 -0
  2. package/dist/esm/components/animation-background/canvas-controller.js +121 -1
  3. package/dist/esm/components/animation-background/controls.js +180 -1
  4. package/dist/esm/components/animation-background/graphite-controller.js +196 -1
  5. package/dist/esm/components/animation-background/graphite-presets.js +42 -1
  6. package/dist/esm/components/animation-background/graphite-shader.js +111 -1
  7. package/dist/esm/components/animation-background/layers.js +369 -1
  8. package/dist/esm/components/animation-background/lumina-presets.js +53 -1
  9. package/dist/esm/components/animation-background/lumina-shaders.js +181 -1
  10. package/dist/esm/components/animation-background/lumina-utils.js +60 -1
  11. package/dist/esm/components/animation-background/particle-defaults.js +36 -1
  12. package/dist/esm/components/animation-background/renderers.js +167 -1
  13. package/dist/esm/components/animation-background/shader-controller.js +154 -1
  14. package/dist/esm/components/color-picker-utils.js +134 -1
  15. package/dist/esm/components/date-picker-utils.js +140 -1
  16. package/dist/esm/components/db-accordion.js +304 -1
  17. package/dist/esm/components/db-ad-banner.js +455 -1
  18. package/dist/esm/components/db-alert.js +149 -1
  19. package/dist/esm/components/db-animation-background.js +486 -1
  20. package/dist/esm/components/db-animation-text.js +601 -1
  21. package/dist/esm/components/db-app-badge.js +88 -1
  22. package/dist/esm/components/db-audio-player.js +752 -1
  23. package/dist/esm/components/db-avatar.js +188 -1
  24. package/dist/esm/components/db-backdrop.js +139 -1
  25. package/dist/esm/components/db-badge.js +91 -1
  26. package/dist/esm/components/db-banner.js +188 -1
  27. package/dist/esm/components/db-bottom-navigation.js +146 -1
  28. package/dist/esm/components/db-bottom-sheet.js +481 -1
  29. package/dist/esm/components/db-breadcrumbs.js +329 -1
  30. package/dist/esm/components/db-button.js +316 -1
  31. package/dist/esm/components/db-calendar.js +675 -1
  32. package/dist/esm/components/db-card.js +265 -1
  33. package/dist/esm/components/db-carousel.js +264 -1
  34. package/dist/esm/components/db-checkbox.js +202 -1
  35. package/dist/esm/components/db-chip.js +104 -1
  36. package/dist/esm/components/db-code-block.js +304 -1
  37. package/dist/esm/components/db-color-picker.js +746 -1
  38. package/dist/esm/components/db-confirm.js +191 -1
  39. package/dist/esm/components/db-container.js +39 -1
  40. package/dist/esm/components/db-context-menu.js +265 -1
  41. package/dist/esm/components/db-countdown.js +146 -1
  42. package/dist/esm/components/db-cursor-follower.js +173 -1
  43. package/dist/esm/components/db-date-picker.js +837 -1
  44. package/dist/esm/components/db-divider.js +66 -1
  45. package/dist/esm/components/db-drawer.js +245 -1
  46. package/dist/esm/components/db-dropdown.js +493 -1
  47. package/dist/esm/components/db-dropzone.js +266 -1
  48. package/dist/esm/components/db-empty-state.js +97 -1
  49. package/dist/esm/components/db-file-uploader.js +256 -1
  50. package/dist/esm/components/db-floating-action-button.js +139 -1
  51. package/dist/esm/components/db-footer.js +385 -1
  52. package/dist/esm/components/db-form.js +566 -1
  53. package/dist/esm/components/db-gantt.js +882 -1
  54. package/dist/esm/components/db-gradient.js +133 -1
  55. package/dist/esm/components/db-grid-background.js +909 -1
  56. package/dist/esm/components/db-grid.js +73 -1
  57. package/dist/esm/components/db-icons.js +82 -1
  58. package/dist/esm/components/db-image-list.js +214 -1
  59. package/dist/esm/components/db-image-placeholder.js +96 -1
  60. package/dist/esm/components/db-image.js +289 -1
  61. package/dist/esm/components/db-indicator.js +517 -1
  62. package/dist/esm/components/db-input.js +420 -1
  63. package/dist/esm/components/db-kanban.js +538 -1
  64. package/dist/esm/components/db-label.js +66 -1
  65. package/dist/esm/components/db-lightbox.js +372 -1
  66. package/dist/esm/components/db-list.js +340 -1
  67. package/dist/esm/components/db-logo-svg.js +72 -1
  68. package/dist/esm/components/db-logo.js +106 -1
  69. package/dist/esm/components/db-lottie.js +109 -1
  70. package/dist/esm/components/db-markdown-editor.js +458 -1
  71. package/dist/esm/components/db-marquee.js +402 -1
  72. package/dist/esm/components/db-masonry.js +94 -1
  73. package/dist/esm/components/db-menu-item.js +211 -1
  74. package/dist/esm/components/db-modal.js +522 -1
  75. package/dist/esm/components/db-navbar.js +680 -1
  76. package/dist/esm/components/db-onboarding-modal.js +322 -1
  77. package/dist/esm/components/db-page-header.js +312 -1
  78. package/dist/esm/components/db-pagination.js +271 -1
  79. package/dist/esm/components/db-popover.js +580 -1
  80. package/dist/esm/components/db-progress-step.js +166 -1
  81. package/dist/esm/components/db-progress.js +171 -1
  82. package/dist/esm/components/db-progressbar.js +72 -1
  83. package/dist/esm/components/db-radio.js +172 -1
  84. package/dist/esm/components/db-random-gradient.js +121 -1
  85. package/dist/esm/components/db-range-slider.js +811 -1
  86. package/dist/esm/components/db-rating.js +325 -1
  87. package/dist/esm/components/db-reorder.js +286 -1
  88. package/dist/esm/components/db-resizable-panels.js +282 -1
  89. package/dist/esm/components/db-scroll-area.js +126 -1
  90. package/dist/esm/components/db-search-bar.js +668 -1
  91. package/dist/esm/components/db-section-app-download.js +101 -1
  92. package/dist/esm/components/db-section-contact.js +102 -1
  93. package/dist/esm/components/db-section-cta.js +150 -1
  94. package/dist/esm/components/db-section-faq.js +120 -1
  95. package/dist/esm/components/db-section-feature-grid.js +137 -1
  96. package/dist/esm/components/db-section-feature.js +179 -1
  97. package/dist/esm/components/db-section-hero.js +243 -1
  98. package/dist/esm/components/db-section-logo-cloud.js +138 -1
  99. package/dist/esm/components/db-section-pricing.js +166 -1
  100. package/dist/esm/components/db-section-stats.js +129 -1
  101. package/dist/esm/components/db-section-testimonials.js +252 -1
  102. package/dist/esm/components/db-section.js +385 -1
  103. package/dist/esm/components/db-segment-control.js +231 -1
  104. package/dist/esm/components/db-select.js +571 -1
  105. package/dist/esm/components/db-share-icons.js +40 -1
  106. package/dist/esm/components/db-share.js +489 -1
  107. package/dist/esm/components/db-sidebar.js +1068 -1
  108. package/dist/esm/components/db-skeleton.js +94 -1
  109. package/dist/esm/components/db-spinner.js +102 -1
  110. package/dist/esm/components/db-split-view.js +297 -1
  111. package/dist/esm/components/db-stack.js +46 -1
  112. package/dist/esm/components/db-stat.js +218 -1
  113. package/dist/esm/components/db-stepper.js +398 -1
  114. package/dist/esm/components/db-table.js +412 -1
  115. package/dist/esm/components/db-tabs.js +335 -1
  116. package/dist/esm/components/db-testimonial.js +162 -1
  117. package/dist/esm/components/db-textarea.js +233 -1
  118. package/dist/esm/components/db-time-picker.js +523 -1
  119. package/dist/esm/components/db-timeline.js +174 -1
  120. package/dist/esm/components/db-toast.js +158 -1
  121. package/dist/esm/components/db-toggle.js +162 -1
  122. package/dist/esm/components/db-toolbar.js +94 -1
  123. package/dist/esm/components/db-tooltip.js +440 -1
  124. package/dist/esm/components/db-top-banner.js +121 -1
  125. package/dist/esm/components/db-tutorial.js +324 -1
  126. package/dist/esm/components/db-video-player.js +503 -1
  127. package/dist/esm/components/db-youtube-player.js +194 -1
  128. package/dist/esm/components/highlight-code.js +65 -1
  129. package/dist/esm/components/input-validation.js +50 -1
  130. package/dist/esm/components/marketing-block-host-utils.js +9 -1
  131. package/dist/esm/components/number-scrub.js +117 -1
  132. package/dist/esm/components/random-gradient-palettes.js +67 -1
  133. package/dist/esm/components/section-block-header-utils.js +48 -1
  134. package/dist/esm/helpers/confirm.js +52 -1
  135. package/dist/esm/helpers/toast.js +73 -1
  136. package/dist/esm/index.js +111 -1
  137. package/dist/esm/node_modules/prismjs/components/prism-bash.js +235 -1
  138. package/dist/esm/node_modules/prismjs/components/prism-clike.js +31 -1
  139. package/dist/esm/node_modules/prismjs/components/prism-css.js +64 -1
  140. package/dist/esm/node_modules/prismjs/components/prism-javascript.js +172 -1
  141. package/dist/esm/node_modules/prismjs/components/prism-json.js +27 -1
  142. package/dist/esm/node_modules/prismjs/components/prism-jsx.js +143 -1
  143. package/dist/esm/node_modules/prismjs/components/prism-markup.js +186 -1
  144. package/dist/esm/node_modules/prismjs/components/prism-scss.js +81 -1
  145. package/dist/esm/node_modules/prismjs/components/prism-tsx.js +15 -1
  146. package/dist/esm/node_modules/prismjs/components/prism-typescript.js +60 -1
  147. package/dist/index.cjs +55414 -1
  148. package/dist/index.css +1 -1
  149. package/dist/index.esm.js +38284 -1
  150. package/dist/react/chunks/lottie-72a4c6d4.js +17032 -0
  151. package/dist/react/index.cjs +56503 -1
  152. package/dist/react/index.esm.js +39373 -1
  153. package/package.json +1 -1
  154. package/dist/chunks/lottie-2637aa0f.js +0 -1
  155. package/dist/react/chunks/lottie-14e7addb.js +0 -1
@@ -1 +1,322 @@
1
- import{createDbIcon as t}from"./db-icons.js";class DbOnboardingModal extends HTMLElement{constructor(){super(...arguments),this.internalStep=0,this.keyHandler=null,this.isMounted=!1,this.handlePrev=()=>{this.getCurrentStep()>0&&this.goToStep(this.getCurrentStep()-1)},this.handleNext=()=>{const t=this.getSteps(),e=this.getCurrentStep();e>=t.length-1?this.dispatchEvent(new CustomEvent("db-complete",{bubbles:!0,composed:!0})):this.goToStep(e+1)}}static get observedAttributes(){return["open","steps","current-step","show-close-button","show-indicator","indicator-type","indicator-size"]}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}get steps(){return this.parseSteps()}set steps(t){const e="string"==typeof t?t:JSON.stringify(t);this.getAttribute("steps")!==e&&this.setAttribute("steps",e)}connectedCallback(){this.style.display="contents",this.syncStepFromAttribute(),this.syncOpenState()}disconnectedCallback(){this.detachKeyHandler(),this.unmount()}attributeChangedCallback(t){this.isConnected&&("open"!==t?("current-step"===t&&this.syncStepFromAttribute(),"steps"!==t?this.isMounted&&this.render():this.isOpenRequested()&&(this.isMounted?this.render():this.syncOpenState())):this.syncOpenState())}isOpenRequested(){return this.open}parseSteps(){const t=this.getAttribute("steps");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}syncStepFromAttribute(){if(!this.hasAttribute("current-step"))return;const t=Number(this.getAttribute("current-step")||0);Number.isFinite(t)&&(this.internalStep=Math.max(0,t))}getSteps(){return this.parseSteps()}getCurrentStep(){const t=this.getSteps();return t.length?Math.min(Math.max(this.internalStep,0),t.length-1):0}close(){this.open=!1,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}emitStepChange(t){this.dispatchEvent(new CustomEvent("db-step-change",{bubbles:!0,composed:!0,detail:{step:t}}))}goToStep(t){const e=this.getSteps();if(!e.length)return;const i=Math.min(Math.max(t,0),e.length-1);this.internalStep=i,this.emitStepChange(i),this.render()}attachKeyHandler(){this.keyHandler||(this.keyHandler=t=>{"Escape"!==t.key?"ArrowLeft"===t.key&&this.getCurrentStep()>0?this.handlePrev():"ArrowRight"===t.key&&this.getCurrentStep()<this.getSteps().length-1&&this.handleNext():this.close()},document.addEventListener("keydown",this.keyHandler))}detachKeyHandler(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}syncOpenState(){if(this.isOpenRequested())return this.mount(),void this.attachKeyHandler();this.detachKeyHandler(),this.unmount()}mount(){this.root||(this.root=document.createElement("div"),this.root.className="designbase-wc-onboarding-modal",this.root.setAttribute("role","dialog"),this.root.setAttribute("aria-modal","true"),this.root.tabIndex=-1,this.ensureStructure()),this.root.isConnected||document.body.append(this.root),this.isMounted=!0,this.render()}unmount(){this.isMounted=!1,this.root?.remove()}ensureStructure(){this.root&&(this.contentEl&&this.root.contains(this.contentEl)||(this.overlayEl=void 0,this.contentEl=void 0,this.closeButtonEl=void 0,this.mainEl=void 0,this.imageWrapEl=void 0,this.imageEl=void 0,this.textEl=void 0,this.titleEl=void 0,this.descriptionEl=void 0,this.navigationEl=void 0,this.prevButtonEl=void 0,this.nextButtonEl=void 0,this.indicatorEl=void 0,this.root.replaceChildren(),this.overlayEl=document.createElement("div"),this.overlayEl.className="designbase-wc-onboarding-modal__overlay",this.overlayEl.addEventListener("click",()=>this.close()),this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-onboarding-modal__content",this.closeButtonEl=document.createElement("button"),this.closeButtonEl.type="button",this.closeButtonEl.className="designbase-wc-onboarding-modal__close-button",this.closeButtonEl.setAttribute("aria-label","닫기"),this.closeButtonEl.append(t("close",20)),this.closeButtonEl.addEventListener("click",()=>this.close()),this.mainEl=document.createElement("div"),this.mainEl.className="designbase-wc-onboarding-modal__main",this.imageWrapEl=document.createElement("div"),this.imageWrapEl.className="designbase-wc-onboarding-modal__image",this.imageEl=document.createElement("img"),this.imageWrapEl.append(this.imageEl),this.textEl=document.createElement("div"),this.textEl.className="designbase-wc-onboarding-modal__text",this.titleEl=document.createElement("h2"),this.titleEl.id="onboarding-title",this.titleEl.className="designbase-wc-onboarding-modal__title",this.descriptionEl=document.createElement("p"),this.descriptionEl.id="onboarding-description",this.descriptionEl.className="designbase-wc-onboarding-modal__description",this.textEl.append(this.titleEl,this.descriptionEl),this.mainEl.append(this.imageWrapEl,this.textEl),this.navigationEl=document.createElement("div"),this.navigationEl.className="designbase-wc-onboarding-modal__navigation",this.prevButtonEl=document.createElement("db-button"),this.prevButtonEl.setAttribute("variant","secondary"),this.prevButtonEl.setAttribute("size","m"),this.prevButtonEl.setAttribute("start-icon","chevron-left"),this.prevButtonEl.setAttribute("aria-label","이전"),this.prevButtonEl.addEventListener("db-click",this.handlePrev),this.indicatorEl=document.createElement("db-indicator"),this.indicatorEl.addEventListener("db-step-click",t=>{const e=t.detail;this.goToStep(e.index??e.current)}),this.nextButtonEl=document.createElement("db-button"),this.nextButtonEl.setAttribute("variant","primary"),this.nextButtonEl.setAttribute("size","m"),this.nextButtonEl.addEventListener("db-click",this.handleNext),this.navigationEl.append(this.prevButtonEl,this.indicatorEl,this.nextButtonEl),this.contentEl.append(this.closeButtonEl,this.mainEl,this.navigationEl),this.root.append(this.overlayEl,this.contentEl)))}render(){if(!this.root||!this.isMounted)return;this.ensureStructure();const t=this.getSteps(),e=this.getCurrentStep(),i=t[e];if(!i)return;const s=!this.hasAttribute("show-close-button")||"false"!==this.getAttribute("show-close-button"),n=!this.hasAttribute("show-indicator")||"false"!==this.getAttribute("show-indicator"),o=this.getAttribute("indicator-type")||"dots",r=this.getAttribute("indicator-size")||"m",a=0===e,l=e===t.length-1;if(this.root.setAttribute("aria-labelledby","onboarding-title"),this.root.setAttribute("aria-describedby","onboarding-description"),this.closeButtonEl&&(this.closeButtonEl.style.display=s?"":"none"),this.imageWrapEl&&this.imageEl&&(i.image?(this.imageEl.src=i.image,this.imageEl.alt=i.title||"온보딩 이미지",this.imageWrapEl.style.display=""):this.imageWrapEl.style.display="none"),this.titleEl&&(this.titleEl.textContent=i.title||"",this.titleEl.style.display=i.title?"":"none"),this.descriptionEl&&(this.descriptionEl.textContent=i.description||"",this.descriptionEl.style.display=i.description?"":"none"),this.prevButtonEl&&(this.prevButtonEl.textContent="이전",a?this.prevButtonEl.setAttribute("disabled",""):this.prevButtonEl.removeAttribute("disabled")),this.nextButtonEl&&(this.nextButtonEl.textContent=l?"완료":"다음",this.nextButtonEl.setAttribute("aria-label",l?"완료":"다음"),l?this.nextButtonEl.removeAttribute("end-icon"):this.nextButtonEl.setAttribute("end-icon","chevron-right")),this.indicatorEl){const i=n&&t.length>1;this.indicatorEl.style.display=i?"":"none",i&&(this.indicatorEl.setAttribute("total",String(t.length)),this.indicatorEl.setAttribute("current",String(e)),this.indicatorEl.setAttribute("indicator-type",o),this.indicatorEl.setAttribute("size",r),this.indicatorEl.setAttribute("clickable",""))}}}customElements.get("db-onboarding-modal")||customElements.define("db-onboarding-modal",DbOnboardingModal);export{DbOnboardingModal};
1
+ import { createDbIcon } from './db-icons.js';
2
+
3
+ class DbOnboardingModal extends HTMLElement {
4
+ constructor() {
5
+ super(...arguments);
6
+ this.internalStep = 0;
7
+ this.keyHandler = null;
8
+ this.isMounted = false;
9
+ this.handlePrev = () => {
10
+ if (this.getCurrentStep() > 0)
11
+ this.goToStep(this.getCurrentStep() - 1);
12
+ };
13
+ this.handleNext = () => {
14
+ const steps = this.getSteps();
15
+ const current = this.getCurrentStep();
16
+ if (current >= steps.length - 1) {
17
+ this.dispatchEvent(new CustomEvent('db-complete', { bubbles: true, composed: true }));
18
+ return;
19
+ }
20
+ this.goToStep(current + 1);
21
+ };
22
+ }
23
+ static get observedAttributes() {
24
+ return [
25
+ 'open',
26
+ 'steps',
27
+ 'current-step',
28
+ 'show-close-button',
29
+ 'show-indicator',
30
+ 'indicator-type',
31
+ 'indicator-size',
32
+ ];
33
+ }
34
+ get open() {
35
+ return this.hasAttribute('open') && this.getAttribute('open') !== 'false';
36
+ }
37
+ set open(value) {
38
+ if (value)
39
+ this.setAttribute('open', '');
40
+ else
41
+ this.removeAttribute('open');
42
+ }
43
+ get steps() {
44
+ return this.parseSteps();
45
+ }
46
+ set steps(value) {
47
+ const next = typeof value === 'string' ? value : JSON.stringify(value);
48
+ if (this.getAttribute('steps') === next)
49
+ return;
50
+ this.setAttribute('steps', next);
51
+ }
52
+ connectedCallback() {
53
+ this.style.display = 'contents';
54
+ this.syncStepFromAttribute();
55
+ this.syncOpenState();
56
+ }
57
+ disconnectedCallback() {
58
+ this.detachKeyHandler();
59
+ this.unmount();
60
+ }
61
+ attributeChangedCallback(name) {
62
+ if (!this.isConnected)
63
+ return;
64
+ if (name === 'open') {
65
+ this.syncOpenState();
66
+ return;
67
+ }
68
+ if (name === 'current-step') {
69
+ this.syncStepFromAttribute();
70
+ }
71
+ if (name === 'steps') {
72
+ if (this.isOpenRequested()) {
73
+ if (!this.isMounted)
74
+ this.syncOpenState();
75
+ else
76
+ this.render();
77
+ }
78
+ return;
79
+ }
80
+ if (this.isMounted)
81
+ this.render();
82
+ }
83
+ isOpenRequested() {
84
+ return this.open;
85
+ }
86
+ parseSteps() {
87
+ const raw = this.getAttribute('steps');
88
+ if (!raw)
89
+ return [];
90
+ try {
91
+ const parsed = JSON.parse(raw);
92
+ return Array.isArray(parsed) ? parsed : [];
93
+ }
94
+ catch {
95
+ return [];
96
+ }
97
+ }
98
+ syncStepFromAttribute() {
99
+ if (!this.hasAttribute('current-step'))
100
+ return;
101
+ const next = Number(this.getAttribute('current-step') || 0);
102
+ if (Number.isFinite(next))
103
+ this.internalStep = Math.max(0, next);
104
+ }
105
+ getSteps() {
106
+ return this.parseSteps();
107
+ }
108
+ getCurrentStep() {
109
+ const steps = this.getSteps();
110
+ if (!steps.length)
111
+ return 0;
112
+ return Math.min(Math.max(this.internalStep, 0), steps.length - 1);
113
+ }
114
+ close() {
115
+ this.open = false;
116
+ this.dispatchEvent(new CustomEvent('db-close', { bubbles: true, composed: true }));
117
+ }
118
+ emitStepChange(step) {
119
+ this.dispatchEvent(new CustomEvent('db-step-change', {
120
+ bubbles: true,
121
+ composed: true,
122
+ detail: { step },
123
+ }));
124
+ }
125
+ goToStep(step) {
126
+ const steps = this.getSteps();
127
+ if (!steps.length)
128
+ return;
129
+ const next = Math.min(Math.max(step, 0), steps.length - 1);
130
+ this.internalStep = next;
131
+ this.emitStepChange(next);
132
+ this.render();
133
+ }
134
+ attachKeyHandler() {
135
+ if (this.keyHandler)
136
+ return;
137
+ this.keyHandler = (event) => {
138
+ if (event.key === 'Escape') {
139
+ this.close();
140
+ return;
141
+ }
142
+ if (event.key === 'ArrowLeft' && this.getCurrentStep() > 0) {
143
+ this.handlePrev();
144
+ return;
145
+ }
146
+ if (event.key === 'ArrowRight' && this.getCurrentStep() < this.getSteps().length - 1) {
147
+ this.handleNext();
148
+ }
149
+ };
150
+ document.addEventListener('keydown', this.keyHandler);
151
+ }
152
+ detachKeyHandler() {
153
+ if (!this.keyHandler)
154
+ return;
155
+ document.removeEventListener('keydown', this.keyHandler);
156
+ this.keyHandler = null;
157
+ }
158
+ syncOpenState() {
159
+ if (this.isOpenRequested()) {
160
+ this.mount();
161
+ this.attachKeyHandler();
162
+ return;
163
+ }
164
+ this.detachKeyHandler();
165
+ this.unmount();
166
+ }
167
+ mount() {
168
+ if (!this.root) {
169
+ this.root = document.createElement('div');
170
+ this.root.className = 'designbase-wc-onboarding-modal';
171
+ this.root.setAttribute('role', 'dialog');
172
+ this.root.setAttribute('aria-modal', 'true');
173
+ this.root.tabIndex = -1;
174
+ this.ensureStructure();
175
+ }
176
+ if (!this.root.isConnected) {
177
+ document.body.append(this.root);
178
+ }
179
+ this.isMounted = true;
180
+ this.render();
181
+ }
182
+ unmount() {
183
+ this.isMounted = false;
184
+ this.root?.remove();
185
+ }
186
+ ensureStructure() {
187
+ if (!this.root)
188
+ return;
189
+ if (this.contentEl && this.root.contains(this.contentEl))
190
+ return;
191
+ this.overlayEl = undefined;
192
+ this.contentEl = undefined;
193
+ this.closeButtonEl = undefined;
194
+ this.mainEl = undefined;
195
+ this.imageWrapEl = undefined;
196
+ this.imageEl = undefined;
197
+ this.textEl = undefined;
198
+ this.titleEl = undefined;
199
+ this.descriptionEl = undefined;
200
+ this.navigationEl = undefined;
201
+ this.prevButtonEl = undefined;
202
+ this.nextButtonEl = undefined;
203
+ this.indicatorEl = undefined;
204
+ this.root.replaceChildren();
205
+ this.overlayEl = document.createElement('div');
206
+ this.overlayEl.className = 'designbase-wc-onboarding-modal__overlay';
207
+ this.overlayEl.addEventListener('click', () => this.close());
208
+ this.contentEl = document.createElement('div');
209
+ this.contentEl.className = 'designbase-wc-onboarding-modal__content';
210
+ this.closeButtonEl = document.createElement('button');
211
+ this.closeButtonEl.type = 'button';
212
+ this.closeButtonEl.className = 'designbase-wc-onboarding-modal__close-button';
213
+ this.closeButtonEl.setAttribute('aria-label', '닫기');
214
+ this.closeButtonEl.append(createDbIcon('close', 20));
215
+ this.closeButtonEl.addEventListener('click', () => this.close());
216
+ this.mainEl = document.createElement('div');
217
+ this.mainEl.className = 'designbase-wc-onboarding-modal__main';
218
+ this.imageWrapEl = document.createElement('div');
219
+ this.imageWrapEl.className = 'designbase-wc-onboarding-modal__image';
220
+ this.imageEl = document.createElement('img');
221
+ this.imageWrapEl.append(this.imageEl);
222
+ this.textEl = document.createElement('div');
223
+ this.textEl.className = 'designbase-wc-onboarding-modal__text';
224
+ this.titleEl = document.createElement('h2');
225
+ this.titleEl.id = 'onboarding-title';
226
+ this.titleEl.className = 'designbase-wc-onboarding-modal__title';
227
+ this.descriptionEl = document.createElement('p');
228
+ this.descriptionEl.id = 'onboarding-description';
229
+ this.descriptionEl.className = 'designbase-wc-onboarding-modal__description';
230
+ this.textEl.append(this.titleEl, this.descriptionEl);
231
+ this.mainEl.append(this.imageWrapEl, this.textEl);
232
+ this.navigationEl = document.createElement('div');
233
+ this.navigationEl.className = 'designbase-wc-onboarding-modal__navigation';
234
+ this.prevButtonEl = document.createElement('db-button');
235
+ this.prevButtonEl.setAttribute('variant', 'secondary');
236
+ this.prevButtonEl.setAttribute('size', 'm');
237
+ this.prevButtonEl.setAttribute('start-icon', 'chevron-left');
238
+ this.prevButtonEl.setAttribute('aria-label', '이전');
239
+ this.prevButtonEl.addEventListener('db-click', this.handlePrev);
240
+ this.indicatorEl = document.createElement('db-indicator');
241
+ this.indicatorEl.addEventListener('db-step-click', (event) => {
242
+ const detail = event.detail;
243
+ this.goToStep(detail.index ?? detail.current);
244
+ });
245
+ this.nextButtonEl = document.createElement('db-button');
246
+ this.nextButtonEl.setAttribute('variant', 'primary');
247
+ this.nextButtonEl.setAttribute('size', 'm');
248
+ this.nextButtonEl.addEventListener('db-click', this.handleNext);
249
+ this.navigationEl.append(this.prevButtonEl, this.indicatorEl, this.nextButtonEl);
250
+ this.contentEl.append(this.closeButtonEl, this.mainEl, this.navigationEl);
251
+ this.root.append(this.overlayEl, this.contentEl);
252
+ }
253
+ render() {
254
+ if (!this.root || !this.isMounted)
255
+ return;
256
+ this.ensureStructure();
257
+ const steps = this.getSteps();
258
+ const current = this.getCurrentStep();
259
+ const step = steps[current];
260
+ if (!step)
261
+ return;
262
+ const showCloseButton = !this.hasAttribute('show-close-button') || this.getAttribute('show-close-button') !== 'false';
263
+ const showIndicator = !this.hasAttribute('show-indicator') || this.getAttribute('show-indicator') !== 'false';
264
+ const indicatorType = this.getAttribute('indicator-type') || 'dots';
265
+ const indicatorSize = this.getAttribute('indicator-size') || 'm';
266
+ const isFirst = current === 0;
267
+ const isLast = current === steps.length - 1;
268
+ this.root.setAttribute('aria-labelledby', 'onboarding-title');
269
+ this.root.setAttribute('aria-describedby', 'onboarding-description');
270
+ if (this.closeButtonEl)
271
+ this.closeButtonEl.style.display = showCloseButton ? '' : 'none';
272
+ if (this.imageWrapEl && this.imageEl) {
273
+ if (step.image) {
274
+ this.imageEl.src = step.image;
275
+ this.imageEl.alt = step.title || '온보딩 이미지';
276
+ this.imageWrapEl.style.display = '';
277
+ }
278
+ else {
279
+ this.imageWrapEl.style.display = 'none';
280
+ }
281
+ }
282
+ if (this.titleEl) {
283
+ this.titleEl.textContent = step.title || '';
284
+ this.titleEl.style.display = step.title ? '' : 'none';
285
+ }
286
+ if (this.descriptionEl) {
287
+ this.descriptionEl.textContent = step.description || '';
288
+ this.descriptionEl.style.display = step.description ? '' : 'none';
289
+ }
290
+ if (this.prevButtonEl) {
291
+ this.prevButtonEl.textContent = '이전';
292
+ if (isFirst)
293
+ this.prevButtonEl.setAttribute('disabled', '');
294
+ else
295
+ this.prevButtonEl.removeAttribute('disabled');
296
+ }
297
+ if (this.nextButtonEl) {
298
+ this.nextButtonEl.textContent = isLast ? '완료' : '다음';
299
+ this.nextButtonEl.setAttribute('aria-label', isLast ? '완료' : '다음');
300
+ if (isLast)
301
+ this.nextButtonEl.removeAttribute('end-icon');
302
+ else
303
+ this.nextButtonEl.setAttribute('end-icon', 'chevron-right');
304
+ }
305
+ if (this.indicatorEl) {
306
+ const shouldShowIndicator = showIndicator && steps.length > 1;
307
+ this.indicatorEl.style.display = shouldShowIndicator ? '' : 'none';
308
+ if (shouldShowIndicator) {
309
+ this.indicatorEl.setAttribute('total', String(steps.length));
310
+ this.indicatorEl.setAttribute('current', String(current));
311
+ this.indicatorEl.setAttribute('indicator-type', indicatorType);
312
+ this.indicatorEl.setAttribute('size', indicatorSize);
313
+ this.indicatorEl.setAttribute('clickable', '');
314
+ }
315
+ }
316
+ }
317
+ }
318
+ if (!customElements.get('db-onboarding-modal')) {
319
+ customElements.define('db-onboarding-modal', DbOnboardingModal);
320
+ }
321
+
322
+ export { DbOnboardingModal };
@@ -1 +1,312 @@
1
- const e=["default","minimal"],t=["center","left"];class DbPageHeader extends HTMLElement{constructor(){super(...arguments),this.internalTabId="",this.isRendering=!1,this.handleBack=()=>{const e=new CustomEvent("db-back",{bubbles:!0,composed:!0,cancelable:!0});this.dispatchEvent(e),e.defaultPrevented||function navigatePageHeaderBack(e="/"){if("undefined"==typeof window)return;const t=window.history.state?.idx;if("number"==typeof t&&t>0)return void window.history.back();(()=>{try{return!!document.referrer&&new URL(document.referrer).origin===window.location.origin}catch{return!1}})()||window.history.length>1?window.history.back():window.location.assign(e)}(this.getAttribute("back-fallback-href")||"/")},this.handleTabChange=e=>{const t=e.detail,a=t?.selectedId??this.parseTabs()[t?.index??0]?.id??String(t?.index??0);this.hasAttribute("selected-tab-id")||(this.internalTabId=a),this.dispatchEvent(new CustomEvent("db-tab-change",{bubbles:!0,composed:!0,detail:{tabId:a}}))}}static get observedAttributes(){return["title","subtitle","description","breadcrumbs","variant","show-back-button","back-fallback-href","back-label","tabs","selected-tab-id","default-selected-tab-id","align"]}connectedCallback(){this.syncDefaultTab(),this.render(),this.childObserver=new MutationObserver(()=>{this.isRendering||this.hasPendingSlottedChildren()&&this.render()}),this.childObserver.observe(this,{childList:!0})}disconnectedCallback(){this.childObserver?.disconnect()}attributeChangedCallback(e){this.isConnected&&("default-selected-tab-id"!==e&&"tabs"!==e||this.syncDefaultTab(),this.render())}hasPendingSlottedChildren(){return Array.from(this.children).some(e=>{const t=e.getAttribute("slot");return"actions"===t||"meta"===t||"description"===t})}syncDefaultTab(){if(this.internalTabId)return;const e=this.parseTabs(),t=this.getAttribute("default-selected-tab-id");this.internalTabId=t||e[0]?.id||""}parseTabs(){try{const e=JSON.parse(this.getAttribute("tabs")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseBreadcrumbs(){try{const e=JSON.parse(this.getAttribute("breadcrumbs")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}getActiveTabId(){return this.getAttribute("selected-tab-id")||this.internalTabId}getVariant(){const t=this.getAttribute("variant")||"default";return e.includes(t)?t:"default"}getAlign(){const e=this.getAttribute("align")||"center";return t.includes(e)?e:"center"}collectActions(){const e=Array.from(this.querySelectorAll(':scope > [slot="actions"]'));if(e.length)return e;const t=this.querySelector(".designbase-wc-page-header__cta");if(t?.children.length)return Array.from(t.children);const a=this.querySelector(".designbase-wc-page-header__actions");return a?.children.length?Array.from(a.children):[]}collectMeta(){const e=Array.from(this.querySelectorAll(':scope > [slot="meta"]'));if(e.length)return e;const t=this.querySelector(".designbase-wc-page-header__meta");return t?.children.length?Array.from(t.children):[]}renderMinimalAside(e,t){if(!e.length&&!t.length)return null;const a=document.createElement("div");if(a.className="designbase-wc-page-header__aside",e.length){const t=document.createElement("div");t.className="designbase-wc-page-header__meta",e.forEach(e=>t.append(e)),a.append(t)}if(t.length){const e=document.createElement("div");e.className="designbase-wc-page-header__cta",t.forEach(t=>e.append(t)),a.append(e)}return a}collectDescriptionSlot(){const e=this.querySelector(':scope > [slot="description"]');if(e)return e;const t=this.querySelector(":scope .designbase-wc-page-header__description"),a=t?.firstElementChild;return a||null}renderTitleBlock(e){const t=document.createDocumentFragment(),a=this.getAttribute("title")||"",n=this.getAttribute("subtitle"),s=document.createElement("h1");if(s.className="designbase-wc-page-header__title",s.textContent=a,t.append(s),n){const e=document.createElement("h2");e.className="designbase-wc-page-header__subtitle",e.textContent=n,t.append(e)}const i=this.getAttribute("description");if(e||i){const a=document.createElement("div");a.className="designbase-wc-page-header__description",e?a.append(e):a.textContent=i,t.append(a)}return t}render(){this.isRendering=!0;const e=this.collectActions(),t=this.collectMeta(),a=this.collectDescriptionSlot(),n="minimal"===this.getVariant(),s=this.getAlign(),i=this.parseBreadcrumbs(),r=this.parseTabs(),c=r.length>0,d=this.hasAttribute("show-back-button");if(this.className=["designbase-wc-page-header",n?"designbase-wc-page-header--minimal":`designbase-wc-page-header--${s}`,n&&c?"designbase-wc-page-header--has-tabs":""].filter(Boolean).join(" "),this.replaceChildren(),i.length){const e=document.createElement("div");e.className="designbase-wc-page-header__breadcrumbs";const t=document.createElement("db-breadcrumbs");t.setAttribute("size","s"),t.setAttribute("items",JSON.stringify(i)),e.append(t),this.append(e)}const l=document.createElement("div");l.className="designbase-wc-page-header__main";const o=document.createElement("div");if(o.className="designbase-wc-page-header__content",n&&d){const e=document.createElement("div");e.className="designbase-wc-page-header__title-row";const t=document.createElement("db-button");t.className="designbase-wc-page-header__back-button",t.setAttribute("variant","tertiary"),t.setAttribute("size","m"),t.setAttribute("icon-only",""),t.setAttribute("start-icon","chevron-left"),t.setAttribute("aria-label",this.getAttribute("back-label")||"뒤로가기"),t.setAttribute("tooltip",this.getAttribute("back-label")||"뒤로가기"),t.addEventListener("db-click",this.handleBack),e.append(t);const n=document.createElement("div");n.className="designbase-wc-page-header__title-group",n.append(this.renderTitleBlock(a)),e.append(n),o.append(e)}else o.append(this.renderTitleBlock(a));if(l.append(o),n){const a=this.renderMinimalAside(t,e);a&&l.append(a)}if(this.append(l),!n&&e.length){const t=document.createElement("div");t.className="designbase-wc-page-header__actions",e.forEach(e=>t.append(e)),this.append(t)}this.renderMinimalTabs(n,c,r),queueMicrotask(()=>{this.isRendering=!1})}renderMinimalTabs(e,t,a){if(!e||!t)return;const n=document.createElement("div");n.className="designbase-wc-page-header__toolbar";const s=document.createElement("div");s.className="designbase-wc-page-header__tabs";const i=document.createElement("db-tabs");i.setAttribute("size","m"),i.setAttribute("items",JSON.stringify(a)),i.setAttribute("selected-id",this.getActiveTabId()),i.addEventListener("db-change",this.handleTabChange),s.append(i),n.append(s),this.append(n)}}customElements.get("db-page-header")||customElements.define("db-page-header",DbPageHeader);export{DbPageHeader};
1
+ const VARIANTS = ['default', 'minimal'];
2
+ const ALIGNS = ['center', 'left'];
3
+ function navigatePageHeaderBack(fallbackHref = '/') {
4
+ if (typeof window === 'undefined')
5
+ return;
6
+ const historyIdx = window.history.state?.idx;
7
+ if (typeof historyIdx === 'number' && historyIdx > 0) {
8
+ window.history.back();
9
+ return;
10
+ }
11
+ const hasSameOriginReferrer = (() => {
12
+ try {
13
+ if (!document.referrer)
14
+ return false;
15
+ return new URL(document.referrer).origin === window.location.origin;
16
+ }
17
+ catch {
18
+ return false;
19
+ }
20
+ })();
21
+ if (hasSameOriginReferrer) {
22
+ window.history.back();
23
+ return;
24
+ }
25
+ if (window.history.length > 1) {
26
+ window.history.back();
27
+ return;
28
+ }
29
+ window.location.assign(fallbackHref);
30
+ }
31
+ class DbPageHeader extends HTMLElement {
32
+ constructor() {
33
+ super(...arguments);
34
+ this.internalTabId = '';
35
+ this.isRendering = false;
36
+ this.handleBack = () => {
37
+ const event = new CustomEvent('db-back', { bubbles: true, composed: true, cancelable: true });
38
+ this.dispatchEvent(event);
39
+ if (event.defaultPrevented)
40
+ return;
41
+ navigatePageHeaderBack(this.getAttribute('back-fallback-href') || '/');
42
+ };
43
+ this.handleTabChange = (event) => {
44
+ const detail = event.detail;
45
+ const tabId = detail?.selectedId ??
46
+ this.parseTabs()[detail?.index ?? 0]?.id ??
47
+ String(detail?.index ?? 0);
48
+ if (!this.hasAttribute('selected-tab-id')) {
49
+ this.internalTabId = tabId;
50
+ }
51
+ this.dispatchEvent(new CustomEvent('db-tab-change', {
52
+ bubbles: true,
53
+ composed: true,
54
+ detail: { tabId },
55
+ }));
56
+ };
57
+ }
58
+ static get observedAttributes() {
59
+ return [
60
+ 'title',
61
+ 'subtitle',
62
+ 'description',
63
+ 'breadcrumbs',
64
+ 'variant',
65
+ 'show-back-button',
66
+ 'back-fallback-href',
67
+ 'back-label',
68
+ 'tabs',
69
+ 'selected-tab-id',
70
+ 'default-selected-tab-id',
71
+ 'align',
72
+ ];
73
+ }
74
+ connectedCallback() {
75
+ this.syncDefaultTab();
76
+ this.render();
77
+ this.childObserver = new MutationObserver(() => {
78
+ if (this.isRendering)
79
+ return;
80
+ if (!this.hasPendingSlottedChildren())
81
+ return;
82
+ this.render();
83
+ });
84
+ this.childObserver.observe(this, { childList: true });
85
+ }
86
+ disconnectedCallback() {
87
+ this.childObserver?.disconnect();
88
+ }
89
+ attributeChangedCallback(name) {
90
+ if (!this.isConnected)
91
+ return;
92
+ if (name === 'default-selected-tab-id' || name === 'tabs') {
93
+ this.syncDefaultTab();
94
+ }
95
+ this.render();
96
+ }
97
+ /** React가 slot 자식을 host에 다시 붙였는지 감지 */
98
+ hasPendingSlottedChildren() {
99
+ return Array.from(this.children).some((child) => {
100
+ const slot = child.getAttribute('slot');
101
+ return slot === 'actions' || slot === 'meta' || slot === 'description';
102
+ });
103
+ }
104
+ syncDefaultTab() {
105
+ if (this.internalTabId)
106
+ return;
107
+ const tabs = this.parseTabs();
108
+ const defaultId = this.getAttribute('default-selected-tab-id');
109
+ this.internalTabId = defaultId || tabs[0]?.id || '';
110
+ }
111
+ parseTabs() {
112
+ try {
113
+ const parsed = JSON.parse(this.getAttribute('tabs') || '[]');
114
+ return Array.isArray(parsed) ? parsed : [];
115
+ }
116
+ catch {
117
+ return [];
118
+ }
119
+ }
120
+ parseBreadcrumbs() {
121
+ try {
122
+ const parsed = JSON.parse(this.getAttribute('breadcrumbs') || '[]');
123
+ return Array.isArray(parsed) ? parsed : [];
124
+ }
125
+ catch {
126
+ return [];
127
+ }
128
+ }
129
+ getActiveTabId() {
130
+ return this.getAttribute('selected-tab-id') || this.internalTabId;
131
+ }
132
+ getVariant() {
133
+ const raw = this.getAttribute('variant') || 'default';
134
+ return VARIANTS.includes(raw) ? raw : 'default';
135
+ }
136
+ getAlign() {
137
+ const raw = this.getAttribute('align') || 'center';
138
+ return ALIGNS.includes(raw) ? raw : 'center';
139
+ }
140
+ collectActions() {
141
+ const direct = Array.from(this.querySelectorAll(':scope > [slot="actions"]'));
142
+ if (direct.length)
143
+ return direct;
144
+ // aside > cta 로 이미 배치된 경우 (재렌더)
145
+ const cta = this.querySelector('.designbase-wc-page-header__cta');
146
+ if (cta?.children.length)
147
+ return Array.from(cta.children);
148
+ const actions = this.querySelector('.designbase-wc-page-header__actions');
149
+ if (actions?.children.length)
150
+ return Array.from(actions.children);
151
+ return [];
152
+ }
153
+ collectMeta() {
154
+ const direct = Array.from(this.querySelectorAll(':scope > [slot="meta"]'));
155
+ if (direct.length)
156
+ return direct;
157
+ // aside > meta 로 이미 배치된 경우 (재렌더)
158
+ const meta = this.querySelector('.designbase-wc-page-header__meta');
159
+ if (meta?.children.length)
160
+ return Array.from(meta.children);
161
+ return [];
162
+ }
163
+ renderMinimalAside(savedMeta, savedActions) {
164
+ if (!savedMeta.length && !savedActions.length)
165
+ return null;
166
+ const aside = document.createElement('div');
167
+ aside.className = 'designbase-wc-page-header__aside';
168
+ if (savedMeta.length) {
169
+ const meta = document.createElement('div');
170
+ meta.className = 'designbase-wc-page-header__meta';
171
+ savedMeta.forEach((node) => meta.append(node));
172
+ aside.append(meta);
173
+ }
174
+ if (savedActions.length) {
175
+ const cta = document.createElement('div');
176
+ cta.className = 'designbase-wc-page-header__cta';
177
+ savedActions.forEach((node) => cta.append(node));
178
+ aside.append(cta);
179
+ }
180
+ return aside;
181
+ }
182
+ collectDescriptionSlot() {
183
+ const slotted = this.querySelector(':scope > [slot="description"]');
184
+ if (slotted)
185
+ return slotted;
186
+ const description = this.querySelector(':scope .designbase-wc-page-header__description');
187
+ const child = description?.firstElementChild;
188
+ return child || null;
189
+ }
190
+ renderTitleBlock(descriptionSlot) {
191
+ const fragment = document.createDocumentFragment();
192
+ const title = this.getAttribute('title') || '';
193
+ const subtitle = this.getAttribute('subtitle');
194
+ const titleEl = document.createElement('h1');
195
+ titleEl.className = 'designbase-wc-page-header__title';
196
+ titleEl.textContent = title;
197
+ fragment.append(titleEl);
198
+ if (subtitle) {
199
+ const subtitleEl = document.createElement('h2');
200
+ subtitleEl.className = 'designbase-wc-page-header__subtitle';
201
+ subtitleEl.textContent = subtitle;
202
+ fragment.append(subtitleEl);
203
+ }
204
+ const description = this.getAttribute('description');
205
+ if (descriptionSlot || description) {
206
+ const descriptionEl = document.createElement('div');
207
+ descriptionEl.className = 'designbase-wc-page-header__description';
208
+ if (descriptionSlot) {
209
+ descriptionEl.append(descriptionSlot);
210
+ }
211
+ else {
212
+ descriptionEl.textContent = description;
213
+ }
214
+ fragment.append(descriptionEl);
215
+ }
216
+ return fragment;
217
+ }
218
+ render() {
219
+ this.isRendering = true;
220
+ const savedActions = this.collectActions();
221
+ const savedMeta = this.collectMeta();
222
+ const savedDescription = this.collectDescriptionSlot();
223
+ const variant = this.getVariant();
224
+ const isMinimal = variant === 'minimal';
225
+ const align = this.getAlign();
226
+ const breadcrumbs = this.parseBreadcrumbs();
227
+ const tabs = this.parseTabs();
228
+ const hasTabs = tabs.length > 0;
229
+ const showBackButton = this.hasAttribute('show-back-button');
230
+ this.className = [
231
+ 'designbase-wc-page-header',
232
+ isMinimal ? 'designbase-wc-page-header--minimal' : `designbase-wc-page-header--${align}`,
233
+ isMinimal && hasTabs ? 'designbase-wc-page-header--has-tabs' : '',
234
+ ]
235
+ .filter(Boolean)
236
+ .join(' ');
237
+ this.replaceChildren();
238
+ if (breadcrumbs.length) {
239
+ const breadcrumbsWrap = document.createElement('div');
240
+ breadcrumbsWrap.className = 'designbase-wc-page-header__breadcrumbs';
241
+ const crumbs = document.createElement('db-breadcrumbs');
242
+ crumbs.setAttribute('size', 's');
243
+ crumbs.setAttribute('items', JSON.stringify(breadcrumbs));
244
+ breadcrumbsWrap.append(crumbs);
245
+ this.append(breadcrumbsWrap);
246
+ }
247
+ const main = document.createElement('div');
248
+ main.className = 'designbase-wc-page-header__main';
249
+ const content = document.createElement('div');
250
+ content.className = 'designbase-wc-page-header__content';
251
+ if (isMinimal && showBackButton) {
252
+ const titleRow = document.createElement('div');
253
+ titleRow.className = 'designbase-wc-page-header__title-row';
254
+ const backButton = document.createElement('db-button');
255
+ backButton.className = 'designbase-wc-page-header__back-button';
256
+ backButton.setAttribute('variant', 'tertiary');
257
+ backButton.setAttribute('size', 'm');
258
+ backButton.setAttribute('icon-only', '');
259
+ backButton.setAttribute('start-icon', 'chevron-left');
260
+ backButton.setAttribute('aria-label', this.getAttribute('back-label') || '뒤로가기');
261
+ backButton.setAttribute('tooltip', this.getAttribute('back-label') || '뒤로가기');
262
+ backButton.addEventListener('db-click', this.handleBack);
263
+ titleRow.append(backButton);
264
+ const titleGroup = document.createElement('div');
265
+ titleGroup.className = 'designbase-wc-page-header__title-group';
266
+ titleGroup.append(this.renderTitleBlock(savedDescription));
267
+ titleRow.append(titleGroup);
268
+ content.append(titleRow);
269
+ }
270
+ else {
271
+ content.append(this.renderTitleBlock(savedDescription));
272
+ }
273
+ main.append(content);
274
+ if (isMinimal) {
275
+ const aside = this.renderMinimalAside(savedMeta, savedActions);
276
+ if (aside)
277
+ main.append(aside);
278
+ }
279
+ this.append(main);
280
+ if (!isMinimal && savedActions.length) {
281
+ const actionsWrap = document.createElement('div');
282
+ actionsWrap.className = 'designbase-wc-page-header__actions';
283
+ savedActions.forEach((node) => actionsWrap.append(node));
284
+ this.append(actionsWrap);
285
+ }
286
+ this.renderMinimalTabs(isMinimal, hasTabs, tabs);
287
+ queueMicrotask(() => {
288
+ this.isRendering = false;
289
+ });
290
+ }
291
+ renderMinimalTabs(isMinimal, hasTabs, tabs) {
292
+ if (!isMinimal || !hasTabs)
293
+ return;
294
+ const toolbar = document.createElement('div');
295
+ toolbar.className = 'designbase-wc-page-header__toolbar';
296
+ const tabsWrap = document.createElement('div');
297
+ tabsWrap.className = 'designbase-wc-page-header__tabs';
298
+ const tabsEl = document.createElement('db-tabs');
299
+ tabsEl.setAttribute('size', 'm');
300
+ tabsEl.setAttribute('items', JSON.stringify(tabs));
301
+ tabsEl.setAttribute('selected-id', this.getActiveTabId());
302
+ tabsEl.addEventListener('db-change', this.handleTabChange);
303
+ tabsWrap.append(tabsEl);
304
+ toolbar.append(tabsWrap);
305
+ this.append(toolbar);
306
+ }
307
+ }
308
+ if (!customElements.get('db-page-header')) {
309
+ customElements.define('db-page-header', DbPageHeader);
310
+ }
311
+
312
+ export { DbPageHeader };