@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,179 @@
1
- import{syncMarketingBlockHost as t}from"./marketing-block-host-utils.js";const e="designbase-wc-section-feature";class DbSectionFeature extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["headline","subtitle","description","badge","image","image-alt","media-position","actions","tinted","content-padding","size","full-width","full-height","overflow-visible"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}parseBadge(){try{const t=this.getAttribute("badge");return t?JSON.parse(t):null}catch{return null}}get actions(){return this.parseActions()}set actions(t){this.setAttribute("actions","string"==typeof t?t:JSON.stringify(t))}parseActions(){try{const t=JSON.parse(this.getAttribute("actions")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}build(){this.innerEl=document.createElement("div"),this.innerEl.className=`${e}__inner`;const t=document.createElement("div");t.className=`${e}__content`,this.contentEl=t,this.headlineEl=document.createElement("h2"),this.headlineEl.className=`${e}__headline`,this.subtitleEl=document.createElement("p"),this.subtitleEl.className=`${e}__subtitle`,this.descriptionEl=document.createElement("p"),this.descriptionEl.className=`${e}__description`,this.actionsEl=document.createElement("div"),this.actionsEl.className=`${e}__actions`,t.append(this.headlineEl,this.subtitleEl,this.descriptionEl,this.actionsEl),this.mediaEl=document.createElement("div"),this.mediaEl.className=`${e}__media`,this.imageEl=document.createElement("img"),this.imageEl.className=`${e}__image`,this.mediaEl.append(this.imageEl),this.innerEl.append(t,this.mediaEl),this.append(this.innerEl)}updateUI(){const i=this.getAttribute("headline")||"",s=this.getAttribute("subtitle")||"",n=this.getAttribute("description")||"",a=this.getAttribute("image")||"",l=this.getAttribute("image-alt")||i||"feature",h=this.getAttribute("media-position")||"right",d=this.getAttribute("content-padding")||"l",r=this.hasAttribute("tinted"),c=this.parseBadge(),o=this.parseActions();if(this.className=[e,`${e}--media-${h}`,`${e}--padding-${d}`,r&&`${e}--tinted`].filter(Boolean).join(" "),t(this,e),this.contentEl&&this.headlineEl){const t=c?.text?.trim();t?(this.badgeEl||(this.badgeEl=document.createElement("db-badge"),this.badgeEl.className=`${e}__badge`),this.badgeEl.setAttribute("variant",c.variant||"primary"),this.badgeEl.setAttribute("badge-style",c.style||"text"),this.badgeEl.setAttribute("size",c.size||"m"),this.badgeEl.textContent=t,this.badgeEl.isConnected||this.contentEl.insertBefore(this.badgeEl,this.headlineEl)):this.badgeEl&&this.badgeEl.remove()}this.headlineEl&&(this.headlineEl.textContent=i),this.subtitleEl&&(this.subtitleEl.textContent=s,this.subtitleEl.hidden=!s),this.descriptionEl&&(this.descriptionEl.textContent=n,this.descriptionEl.hidden=!n),this.mediaEl&&this.imageEl&&(a?(this.mediaEl.hidden=!1,this.imageEl.src=a,this.imageEl.alt=l):this.mediaEl.hidden=!0),this.actionsEl&&(this.actionsEl.replaceChildren(),o.length>0?(o.forEach(t=>{const e=document.createElement("db-button");e.setAttribute("variant",t.variant||"primary"),e.setAttribute("size",t.size||"m"),t.href&&e.setAttribute("href",t.href),e.textContent=t.label,e.addEventListener("click",e=>{e.stopPropagation(),this.dispatchEvent(new CustomEvent("db-action",{detail:{action:t},bubbles:!0,composed:!0}))}),this.actionsEl.append(e)}),this.actionsEl.hidden=!1):this.actionsEl.hidden=!0)}}customElements.get("db-section-feature")||customElements.define("db-section-feature",DbSectionFeature);export{DbSectionFeature};
1
+ import { syncMarketingBlockHost } from './marketing-block-host-utils.js';
2
+
3
+ const CLASS = 'designbase-wc-section-feature';
4
+ class DbSectionFeature extends HTMLElement {
5
+ constructor() {
6
+ super(...arguments);
7
+ this.built = false;
8
+ }
9
+ static get observedAttributes() {
10
+ return [
11
+ 'headline',
12
+ 'subtitle',
13
+ 'description',
14
+ 'badge',
15
+ 'image',
16
+ 'image-alt',
17
+ 'media-position',
18
+ 'actions',
19
+ 'tinted',
20
+ 'content-padding',
21
+ 'size',
22
+ 'full-width',
23
+ 'full-height',
24
+ 'overflow-visible',
25
+ ];
26
+ }
27
+ connectedCallback() {
28
+ this.style.display = 'block';
29
+ if (!this.built) {
30
+ this.built = true;
31
+ this.build();
32
+ }
33
+ this.updateUI();
34
+ }
35
+ attributeChangedCallback() {
36
+ if (!this.built)
37
+ return;
38
+ this.updateUI();
39
+ }
40
+ parseBadge() {
41
+ try {
42
+ const raw = this.getAttribute('badge');
43
+ if (!raw)
44
+ return null;
45
+ return JSON.parse(raw);
46
+ }
47
+ catch {
48
+ return null;
49
+ }
50
+ }
51
+ get actions() {
52
+ return this.parseActions();
53
+ }
54
+ set actions(value) {
55
+ this.setAttribute('actions', typeof value === 'string' ? value : JSON.stringify(value));
56
+ }
57
+ parseActions() {
58
+ try {
59
+ const parsed = JSON.parse(this.getAttribute('actions') || '[]');
60
+ return Array.isArray(parsed) ? parsed : [];
61
+ }
62
+ catch {
63
+ return [];
64
+ }
65
+ }
66
+ build() {
67
+ this.innerEl = document.createElement('div');
68
+ this.innerEl.className = `${CLASS}__inner`;
69
+ const content = document.createElement('div');
70
+ content.className = `${CLASS}__content`;
71
+ this.contentEl = content;
72
+ this.headlineEl = document.createElement('h2');
73
+ this.headlineEl.className = `${CLASS}__headline`;
74
+ this.subtitleEl = document.createElement('p');
75
+ this.subtitleEl.className = `${CLASS}__subtitle`;
76
+ this.descriptionEl = document.createElement('p');
77
+ this.descriptionEl.className = `${CLASS}__description`;
78
+ this.actionsEl = document.createElement('div');
79
+ this.actionsEl.className = `${CLASS}__actions`;
80
+ content.append(this.headlineEl, this.subtitleEl, this.descriptionEl, this.actionsEl);
81
+ this.mediaEl = document.createElement('div');
82
+ this.mediaEl.className = `${CLASS}__media`;
83
+ this.imageEl = document.createElement('img');
84
+ this.imageEl.className = `${CLASS}__image`;
85
+ this.mediaEl.append(this.imageEl);
86
+ this.innerEl.append(content, this.mediaEl);
87
+ this.append(this.innerEl);
88
+ }
89
+ updateUI() {
90
+ const headline = this.getAttribute('headline') || '';
91
+ const subtitle = this.getAttribute('subtitle') || '';
92
+ const description = this.getAttribute('description') || '';
93
+ const image = this.getAttribute('image') || '';
94
+ const imageAlt = this.getAttribute('image-alt') || headline || 'feature';
95
+ const mediaPosition = this.getAttribute('media-position') || 'right';
96
+ const contentPadding = this.getAttribute('content-padding') || 'l';
97
+ const tinted = this.hasAttribute('tinted');
98
+ const badge = this.parseBadge();
99
+ const actions = this.parseActions();
100
+ this.className = [
101
+ CLASS,
102
+ `${CLASS}--media-${mediaPosition}`,
103
+ `${CLASS}--padding-${contentPadding}`,
104
+ tinted && `${CLASS}--tinted`,
105
+ ]
106
+ .filter(Boolean)
107
+ .join(' ');
108
+ syncMarketingBlockHost(this, CLASS);
109
+ if (this.contentEl && this.headlineEl) {
110
+ const badgeText = badge?.text?.trim();
111
+ if (badgeText) {
112
+ if (!this.badgeEl) {
113
+ this.badgeEl = document.createElement('db-badge');
114
+ this.badgeEl.className = `${CLASS}__badge`;
115
+ }
116
+ this.badgeEl.setAttribute('variant', badge.variant || 'primary');
117
+ this.badgeEl.setAttribute('badge-style', badge.style || 'text');
118
+ this.badgeEl.setAttribute('size', badge.size || 'm');
119
+ this.badgeEl.textContent = badgeText;
120
+ if (!this.badgeEl.isConnected) {
121
+ this.contentEl.insertBefore(this.badgeEl, this.headlineEl);
122
+ }
123
+ }
124
+ else if (this.badgeEl) {
125
+ this.badgeEl.remove();
126
+ }
127
+ }
128
+ if (this.headlineEl)
129
+ this.headlineEl.textContent = headline;
130
+ if (this.subtitleEl) {
131
+ this.subtitleEl.textContent = subtitle;
132
+ this.subtitleEl.hidden = !subtitle;
133
+ }
134
+ if (this.descriptionEl) {
135
+ this.descriptionEl.textContent = description;
136
+ this.descriptionEl.hidden = !description;
137
+ }
138
+ if (this.mediaEl && this.imageEl) {
139
+ if (image) {
140
+ this.mediaEl.hidden = false;
141
+ this.imageEl.src = image;
142
+ this.imageEl.alt = imageAlt;
143
+ }
144
+ else {
145
+ this.mediaEl.hidden = true;
146
+ }
147
+ }
148
+ if (this.actionsEl) {
149
+ this.actionsEl.replaceChildren();
150
+ if (actions.length > 0) {
151
+ actions.forEach((action) => {
152
+ const button = document.createElement('db-button');
153
+ button.setAttribute('variant', action.variant || 'primary');
154
+ button.setAttribute('size', action.size || 'm');
155
+ if (action.href)
156
+ button.setAttribute('href', action.href);
157
+ button.textContent = action.label;
158
+ button.addEventListener('click', (event) => {
159
+ event.stopPropagation();
160
+ this.dispatchEvent(new CustomEvent('db-action', {
161
+ detail: { action },
162
+ bubbles: true,
163
+ composed: true,
164
+ }));
165
+ });
166
+ this.actionsEl.append(button);
167
+ });
168
+ this.actionsEl.hidden = false;
169
+ }
170
+ else {
171
+ this.actionsEl.hidden = true;
172
+ }
173
+ }
174
+ }
175
+ }
176
+ if (!customElements.get('db-section-feature'))
177
+ customElements.define('db-section-feature', DbSectionFeature);
178
+
179
+ export { DbSectionFeature };
@@ -1 +1,243 @@
1
- const t="designbase-wc-section-hero";class DbSectionHero extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["title","subtitle","description","background-image","background-video","overlay-color","overlay-opacity","buttons","variant","theme","alignment","animated","full-height","min-height","max-height","content-max-width"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}get buttons(){return this.parseButtons()}set buttons(t){this.setAttribute("buttons","string"==typeof t?t:JSON.stringify(t))}parseButtons(){try{const t=JSON.parse(this.getAttribute("buttons")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}build(){this.backgroundVideoEl=document.createElement("video"),this.backgroundVideoEl.className=`${t}__background-video`,this.backgroundVideoEl.autoplay=!0,this.backgroundVideoEl.muted=!0,this.backgroundVideoEl.loop=!0,this.backgroundVideoEl.playsInline=!0,this.backgroundVideoEl.hidden=!0,this.backgroundImageEl=document.createElement("div"),this.backgroundImageEl.className=`${t}__background-image`,this.backgroundImageEl.hidden=!0,this.overlayEl=document.createElement("div"),this.overlayEl.className=`${t}__overlay`,this.overlayEl.hidden=!0;const e=document.createElement("div");e.className=`${t}__container`;const i=document.createElement("div");i.className=`${t}__content`,this.titleEl=document.createElement("h1"),this.titleEl.className=`${t}__title`,this.subtitleEl=document.createElement("p"),this.subtitleEl.className=`${t}__subtitle`,this.descriptionEl=document.createElement("p"),this.descriptionEl.className=`${t}__description`,this.buttonsEl=document.createElement("div"),this.buttonsEl.className=`${t}__buttons`,i.append(this.titleEl,this.subtitleEl,this.descriptionEl,this.buttonsEl),e.append(i),this.append(this.backgroundVideoEl,this.backgroundImageEl,this.overlayEl,e)}updateUI(){const e=this.getAttribute("title")||"",i=this.getAttribute("subtitle")||"",s=this.getAttribute("description")||"",n=this.getAttribute("background-image")||"",a=this.getAttribute("background-video")||"",o=this.getAttribute("overlay-color")||"",r=Number(this.getAttribute("overlay-opacity")||.5),l=this.getAttribute("variant")||"default",d=this.getAttribute("theme")||"light",c=this.getAttribute("alignment")||"left",h=this.hasAttribute("animated"),u=this.hasAttribute("full-height"),b=this.getAttribute("min-height"),g=this.getAttribute("max-height"),m=this.getAttribute("content-max-width"),E=this.parseButtons(),p=Boolean(n||a),y="dark"===d||"gradient"===d||p&&("overlay"===l||"image"===d);this.className=[t,`${t}--variant-${l}`,`${t}--theme-${d}`,`${t}--alignment-${c}`,h&&`${t}--animated`,u&&`${t}--full-height`,y&&`${t}--on-media`].filter(Boolean).join(" "),this.style.minHeight=b||"",this.style.maxHeight=g||"",this.titleEl&&(this.titleEl.textContent=e),this.subtitleEl&&(this.subtitleEl.textContent=i,this.subtitleEl.hidden=!i),this.descriptionEl&&(this.descriptionEl.textContent=s,this.descriptionEl.hidden=!s);const k=this.querySelector(`.${t}__content`);if(k&&(m?k.style.maxWidth=/^\d+$/.test(m)?`${m}px`:m:k.style.removeProperty("max-width")),this.backgroundVideoEl)if(a){this.backgroundVideoEl.hidden=!1,this.backgroundVideoEl.replaceChildren();const t=document.createElement("source");t.src=a,t.type="video/mp4",this.backgroundVideoEl.append(t)}else this.backgroundVideoEl.hidden=!0;this.backgroundImageEl&&(n?(this.backgroundImageEl.hidden=!1,this.backgroundImageEl.style.backgroundImage=`url(${n})`,this.backgroundImageEl.style.backgroundSize="cover",this.backgroundImageEl.style.backgroundPosition="center",this.backgroundImageEl.style.backgroundRepeat="no-repeat"):this.backgroundImageEl.hidden=!0),this.overlayEl&&(p?(this.overlayEl.hidden=!1,o?(this.overlayEl.style.background=o,this.overlayEl.style.opacity=String(r)):(this.overlayEl.style.background=`linear-gradient(180deg, rgba(0, 0, 0, ${.35*r}) 0%, rgba(0, 0, 0, ${r}) 100%)`,this.overlayEl.style.opacity="1")):this.overlayEl.hidden=!0),this.buttonsEl&&(this.buttonsEl.replaceChildren(),E.length>0?(E.forEach(e=>{const i=document.createElement("db-button");if(i.setAttribute("variant",function mapButtonVariant(t){return"outline"===t?"tertiary":"ghost"===t?"ghost":"secondary"===t?"secondary":"tertiary"===t?"tertiary":"primary"}(e.variant)),i.setAttribute("size",e.size||"m"),e.href&&i.setAttribute("href",e.href),e.external&&(i.setAttribute("target","_blank"),i.setAttribute("rel","noopener noreferrer")),e.startIcon)i.setAttribute("start-icon",e.startIcon),i.textContent=e.text;else if(e.icon){const s=document.createElement("span");s.className=`${t}__button-content`;const n=document.createElement("span");n.className=`${t}__button-icon`,n.setAttribute("aria-hidden","true"),n.textContent=e.icon;const a=document.createElement("span");a.textContent=e.text,s.append(n,a),i.append(s)}else i.textContent=e.text;i.addEventListener("click",t=>{t.stopPropagation(),this.dispatchEvent(new CustomEvent("db-button-click",{detail:{button:e},bubbles:!0,composed:!0}))}),this.buttonsEl.append(i)}),this.buttonsEl.hidden=!1):this.buttonsEl.hidden=!0)}}customElements.get("db-section-hero")||customElements.define("db-section-hero",DbSectionHero);export{DbSectionHero};
1
+ const CLASS = 'designbase-wc-section-hero';
2
+ function mapButtonVariant(variant) {
3
+ if (variant === 'outline')
4
+ return 'tertiary';
5
+ if (variant === 'ghost')
6
+ return 'ghost';
7
+ if (variant === 'secondary')
8
+ return 'secondary';
9
+ if (variant === 'tertiary')
10
+ return 'tertiary';
11
+ return 'primary';
12
+ }
13
+ class DbSectionHero extends HTMLElement {
14
+ constructor() {
15
+ super(...arguments);
16
+ this.built = false;
17
+ }
18
+ static get observedAttributes() {
19
+ return [
20
+ 'title',
21
+ 'subtitle',
22
+ 'description',
23
+ 'background-image',
24
+ 'background-video',
25
+ 'overlay-color',
26
+ 'overlay-opacity',
27
+ 'buttons',
28
+ 'variant',
29
+ 'theme',
30
+ 'alignment',
31
+ 'animated',
32
+ 'full-height',
33
+ 'min-height',
34
+ 'max-height',
35
+ 'content-max-width',
36
+ ];
37
+ }
38
+ connectedCallback() {
39
+ this.style.display = 'block';
40
+ if (!this.built) {
41
+ this.built = true;
42
+ this.build();
43
+ }
44
+ this.updateUI();
45
+ }
46
+ attributeChangedCallback() {
47
+ if (!this.built)
48
+ return;
49
+ this.updateUI();
50
+ }
51
+ get buttons() {
52
+ return this.parseButtons();
53
+ }
54
+ set buttons(value) {
55
+ this.setAttribute('buttons', typeof value === 'string' ? value : JSON.stringify(value));
56
+ }
57
+ parseButtons() {
58
+ try {
59
+ const parsed = JSON.parse(this.getAttribute('buttons') || '[]');
60
+ return Array.isArray(parsed) ? parsed : [];
61
+ }
62
+ catch {
63
+ return [];
64
+ }
65
+ }
66
+ build() {
67
+ this.backgroundVideoEl = document.createElement('video');
68
+ this.backgroundVideoEl.className = `${CLASS}__background-video`;
69
+ this.backgroundVideoEl.autoplay = true;
70
+ this.backgroundVideoEl.muted = true;
71
+ this.backgroundVideoEl.loop = true;
72
+ this.backgroundVideoEl.playsInline = true;
73
+ this.backgroundVideoEl.hidden = true;
74
+ this.backgroundImageEl = document.createElement('div');
75
+ this.backgroundImageEl.className = `${CLASS}__background-image`;
76
+ this.backgroundImageEl.hidden = true;
77
+ this.overlayEl = document.createElement('div');
78
+ this.overlayEl.className = `${CLASS}__overlay`;
79
+ this.overlayEl.hidden = true;
80
+ const container = document.createElement('div');
81
+ container.className = `${CLASS}__container`;
82
+ const content = document.createElement('div');
83
+ content.className = `${CLASS}__content`;
84
+ this.titleEl = document.createElement('h1');
85
+ this.titleEl.className = `${CLASS}__title`;
86
+ this.subtitleEl = document.createElement('p');
87
+ this.subtitleEl.className = `${CLASS}__subtitle`;
88
+ this.descriptionEl = document.createElement('p');
89
+ this.descriptionEl.className = `${CLASS}__description`;
90
+ this.buttonsEl = document.createElement('div');
91
+ this.buttonsEl.className = `${CLASS}__buttons`;
92
+ content.append(this.titleEl, this.subtitleEl, this.descriptionEl, this.buttonsEl);
93
+ container.append(content);
94
+ this.append(this.backgroundVideoEl, this.backgroundImageEl, this.overlayEl, container);
95
+ }
96
+ updateUI() {
97
+ const title = this.getAttribute('title') || '';
98
+ const subtitle = this.getAttribute('subtitle') || '';
99
+ const description = this.getAttribute('description') || '';
100
+ const backgroundImage = this.getAttribute('background-image') || '';
101
+ const backgroundVideo = this.getAttribute('background-video') || '';
102
+ const overlayColor = this.getAttribute('overlay-color') || '';
103
+ const overlayOpacity = Number(this.getAttribute('overlay-opacity') || 0.5);
104
+ const variant = this.getAttribute('variant') || 'default';
105
+ const theme = this.getAttribute('theme') || 'light';
106
+ const alignment = this.getAttribute('alignment') || 'left';
107
+ const animated = this.hasAttribute('animated');
108
+ const fullHeight = this.hasAttribute('full-height');
109
+ const minHeight = this.getAttribute('min-height');
110
+ const maxHeight = this.getAttribute('max-height');
111
+ const contentMaxWidth = this.getAttribute('content-max-width');
112
+ const buttons = this.parseButtons();
113
+ const hasMediaBackground = Boolean(backgroundImage || backgroundVideo);
114
+ const isOnMedia = theme === 'dark' ||
115
+ theme === 'gradient' ||
116
+ (hasMediaBackground && (variant === 'overlay' || theme === 'image'));
117
+ this.className = [
118
+ CLASS,
119
+ `${CLASS}--variant-${variant}`,
120
+ `${CLASS}--theme-${theme}`,
121
+ `${CLASS}--alignment-${alignment}`,
122
+ animated && `${CLASS}--animated`,
123
+ fullHeight && `${CLASS}--full-height`,
124
+ isOnMedia && `${CLASS}--on-media`,
125
+ ]
126
+ .filter(Boolean)
127
+ .join(' ');
128
+ this.style.minHeight = minHeight || '';
129
+ this.style.maxHeight = maxHeight || '';
130
+ if (this.titleEl)
131
+ this.titleEl.textContent = title;
132
+ if (this.subtitleEl) {
133
+ this.subtitleEl.textContent = subtitle;
134
+ this.subtitleEl.hidden = !subtitle;
135
+ }
136
+ if (this.descriptionEl) {
137
+ this.descriptionEl.textContent = description;
138
+ this.descriptionEl.hidden = !description;
139
+ }
140
+ const content = this.querySelector(`.${CLASS}__content`);
141
+ if (content) {
142
+ if (contentMaxWidth) {
143
+ content.style.maxWidth = /^\d+$/.test(contentMaxWidth) ? `${contentMaxWidth}px` : contentMaxWidth;
144
+ }
145
+ else {
146
+ content.style.removeProperty('max-width');
147
+ }
148
+ }
149
+ if (this.backgroundVideoEl) {
150
+ if (backgroundVideo) {
151
+ this.backgroundVideoEl.hidden = false;
152
+ this.backgroundVideoEl.replaceChildren();
153
+ const source = document.createElement('source');
154
+ source.src = backgroundVideo;
155
+ source.type = 'video/mp4';
156
+ this.backgroundVideoEl.append(source);
157
+ }
158
+ else {
159
+ this.backgroundVideoEl.hidden = true;
160
+ }
161
+ }
162
+ if (this.backgroundImageEl) {
163
+ if (backgroundImage) {
164
+ this.backgroundImageEl.hidden = false;
165
+ this.backgroundImageEl.style.backgroundImage = `url(${backgroundImage})`;
166
+ this.backgroundImageEl.style.backgroundSize = 'cover';
167
+ this.backgroundImageEl.style.backgroundPosition = 'center';
168
+ this.backgroundImageEl.style.backgroundRepeat = 'no-repeat';
169
+ }
170
+ else {
171
+ this.backgroundImageEl.hidden = true;
172
+ }
173
+ }
174
+ if (this.overlayEl) {
175
+ if (hasMediaBackground) {
176
+ this.overlayEl.hidden = false;
177
+ if (overlayColor) {
178
+ this.overlayEl.style.background = overlayColor;
179
+ this.overlayEl.style.opacity = String(overlayOpacity);
180
+ }
181
+ else {
182
+ this.overlayEl.style.background = `linear-gradient(180deg, rgba(0, 0, 0, ${overlayOpacity * 0.35}) 0%, rgba(0, 0, 0, ${overlayOpacity}) 100%)`;
183
+ this.overlayEl.style.opacity = '1';
184
+ }
185
+ }
186
+ else {
187
+ this.overlayEl.hidden = true;
188
+ }
189
+ }
190
+ if (this.buttonsEl) {
191
+ this.buttonsEl.replaceChildren();
192
+ if (buttons.length > 0) {
193
+ buttons.forEach((button) => {
194
+ const el = document.createElement('db-button');
195
+ el.setAttribute('variant', mapButtonVariant(button.variant));
196
+ el.setAttribute('size', button.size || 'm');
197
+ if (button.href)
198
+ el.setAttribute('href', button.href);
199
+ if (button.external) {
200
+ el.setAttribute('target', '_blank');
201
+ el.setAttribute('rel', 'noopener noreferrer');
202
+ }
203
+ if (button.startIcon) {
204
+ el.setAttribute('start-icon', button.startIcon);
205
+ el.textContent = button.text;
206
+ }
207
+ else if (button.icon) {
208
+ const content = document.createElement('span');
209
+ content.className = `${CLASS}__button-content`;
210
+ const iconSpan = document.createElement('span');
211
+ iconSpan.className = `${CLASS}__button-icon`;
212
+ iconSpan.setAttribute('aria-hidden', 'true');
213
+ iconSpan.textContent = button.icon;
214
+ const textSpan = document.createElement('span');
215
+ textSpan.textContent = button.text;
216
+ content.append(iconSpan, textSpan);
217
+ el.append(content);
218
+ }
219
+ else {
220
+ el.textContent = button.text;
221
+ }
222
+ el.addEventListener('click', (event) => {
223
+ event.stopPropagation();
224
+ this.dispatchEvent(new CustomEvent('db-button-click', {
225
+ detail: { button },
226
+ bubbles: true,
227
+ composed: true,
228
+ }));
229
+ });
230
+ this.buttonsEl.append(el);
231
+ });
232
+ this.buttonsEl.hidden = false;
233
+ }
234
+ else {
235
+ this.buttonsEl.hidden = true;
236
+ }
237
+ }
238
+ }
239
+ }
240
+ if (!customElements.get('db-section-hero'))
241
+ customElements.define('db-section-hero', DbSectionHero);
242
+
243
+ export { DbSectionHero };
@@ -1 +1,138 @@
1
- import{applySectionBlockHeader as e}from"./section-block-header-utils.js";import{syncMarketingBlockHost as t}from"./marketing-block-host-utils.js";const s="designbase-wc-section-logo-cloud";class DbSectionLogoCloud extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["headline","subtitle","description","badge","logos","variant","align","content-padding","size","full-width","full-height","overflow-visible"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}parseLogos(){try{const e=JSON.parse(this.getAttribute("logos")||"[]");return Array.isArray(e)?e:[]}catch{return[]}}parseBadge(){try{const e=this.getAttribute("badge");return e?JSON.parse(e):null}catch{return null}}build(){this.innerEl=document.createElement("div"),this.innerEl.className=`${s}__inner`,this.headerEl=document.createElement("div"),this.headerEl.className="designbase-wc-section-block-header",this.headerEl.innerHTML='\n <db-badge class="designbase-wc-section-block-header__badge" hidden></db-badge>\n <h2 class="designbase-wc-section-block-header__headline"></h2>\n <p class="designbase-wc-section-block-header__subtitle"></p>\n <p class="designbase-wc-section-block-header__description"></p>\n ',this.contentEl=document.createElement("div"),this.innerEl.append(this.headerEl,this.contentEl),this.append(this.innerEl)}updateUI(){const i=this.getAttribute("headline")||"함께하는 파트너",n=this.getAttribute("subtitle")||"",a=this.getAttribute("description")||"",l=this.getAttribute("variant")||"grid",r=this.getAttribute("content-padding")||"m",c=this.getAttribute("align")||"center",o=this.parseBadge(),d=this.parseLogos();if(this.className=[s,`${s}--${l}`,`${s}--padding-${r}`].join(" "),t(this,s),this.headerEl&&e(this.headerEl,{headline:i,subtitle:n,description:a,badge:o,align:c}),this.contentEl){if(this.contentEl.replaceChildren(),"marquee"===l){this.contentEl.className=`${s}__marquee`;const e=document.createElement("db-marquee");return e.setAttribute("items",JSON.stringify(d.map(e=>e.label??e.alt))),void this.contentEl.append(e)}this.contentEl.className=`${s}__grid`,d.forEach(e=>{const t=document.createElement(e.href?"a":"div");if(t.className=`${s}__item`,e.href&&t instanceof HTMLAnchorElement&&(t.href=e.href,t.target="_blank",t.rel="noopener noreferrer"),e.src){const i=document.createElement("img");i.src=e.src,i.alt=e.alt,i.className=`${s}__image`,t.append(i)}else{const i=document.createElement("span");i.className=`${s}__label`,i.textContent=e.label??e.alt,t.append(i)}this.contentEl.append(t)})}}}customElements.get("db-section-logo-cloud")||customElements.define("db-section-logo-cloud",DbSectionLogoCloud);export{DbSectionLogoCloud};
1
+ import { applySectionBlockHeader } from './section-block-header-utils.js';
2
+ import { syncMarketingBlockHost } from './marketing-block-host-utils.js';
3
+
4
+ const CLASS = 'designbase-wc-section-logo-cloud';
5
+ class DbSectionLogoCloud extends HTMLElement {
6
+ constructor() {
7
+ super(...arguments);
8
+ this.built = false;
9
+ }
10
+ static get observedAttributes() {
11
+ return [
12
+ 'headline',
13
+ 'subtitle',
14
+ 'description',
15
+ 'badge',
16
+ 'logos',
17
+ 'variant',
18
+ 'align',
19
+ 'content-padding',
20
+ 'size',
21
+ 'full-width',
22
+ 'full-height',
23
+ 'overflow-visible',
24
+ ];
25
+ }
26
+ connectedCallback() {
27
+ this.style.display = 'block';
28
+ if (!this.built) {
29
+ this.built = true;
30
+ this.build();
31
+ }
32
+ this.updateUI();
33
+ }
34
+ attributeChangedCallback() {
35
+ if (!this.built)
36
+ return;
37
+ this.updateUI();
38
+ }
39
+ parseLogos() {
40
+ try {
41
+ const parsed = JSON.parse(this.getAttribute('logos') || '[]');
42
+ return Array.isArray(parsed) ? parsed : [];
43
+ }
44
+ catch {
45
+ return [];
46
+ }
47
+ }
48
+ parseBadge() {
49
+ try {
50
+ const raw = this.getAttribute('badge');
51
+ if (!raw)
52
+ return null;
53
+ return JSON.parse(raw);
54
+ }
55
+ catch {
56
+ return null;
57
+ }
58
+ }
59
+ build() {
60
+ this.innerEl = document.createElement('div');
61
+ this.innerEl.className = `${CLASS}__inner`;
62
+ this.headerEl = document.createElement('div');
63
+ this.headerEl.className = 'designbase-wc-section-block-header';
64
+ this.headerEl.innerHTML = `
65
+ <db-badge class="designbase-wc-section-block-header__badge" hidden></db-badge>
66
+ <h2 class="designbase-wc-section-block-header__headline"></h2>
67
+ <p class="designbase-wc-section-block-header__subtitle"></p>
68
+ <p class="designbase-wc-section-block-header__description"></p>
69
+ `;
70
+ this.contentEl = document.createElement('div');
71
+ this.innerEl.append(this.headerEl, this.contentEl);
72
+ this.append(this.innerEl);
73
+ }
74
+ updateUI() {
75
+ const headline = this.getAttribute('headline') || '함께하는 파트너';
76
+ const subtitle = this.getAttribute('subtitle') || '';
77
+ const description = this.getAttribute('description') || '';
78
+ const variant = this.getAttribute('variant') || 'grid';
79
+ const contentPadding = this.getAttribute('content-padding') || 'm';
80
+ const align = this.getAttribute('align') || 'center';
81
+ const badge = this.parseBadge();
82
+ const logos = this.parseLogos();
83
+ this.className = [
84
+ CLASS,
85
+ `${CLASS}--${variant}`,
86
+ `${CLASS}--padding-${contentPadding}`,
87
+ ].join(' ');
88
+ syncMarketingBlockHost(this, CLASS);
89
+ if (this.headerEl) {
90
+ applySectionBlockHeader(this.headerEl, {
91
+ headline,
92
+ subtitle,
93
+ description,
94
+ badge,
95
+ align,
96
+ });
97
+ }
98
+ if (!this.contentEl)
99
+ return;
100
+ this.contentEl.replaceChildren();
101
+ if (variant === 'marquee') {
102
+ this.contentEl.className = `${CLASS}__marquee`;
103
+ const marquee = document.createElement('db-marquee');
104
+ marquee.setAttribute('items', JSON.stringify(logos.map((l) => l.label ?? l.alt)));
105
+ this.contentEl.append(marquee);
106
+ return;
107
+ }
108
+ this.contentEl.className = `${CLASS}__grid`;
109
+ logos.forEach((logo) => {
110
+ const item = document.createElement(logo.href ? 'a' : 'div');
111
+ item.className = `${CLASS}__item`;
112
+ if (logo.href && item instanceof HTMLAnchorElement) {
113
+ item.href = logo.href;
114
+ item.target = '_blank';
115
+ item.rel = 'noopener noreferrer';
116
+ }
117
+ if (logo.src) {
118
+ const img = document.createElement('img');
119
+ img.src = logo.src;
120
+ img.alt = logo.alt;
121
+ img.className = `${CLASS}__image`;
122
+ item.append(img);
123
+ }
124
+ else {
125
+ const label = document.createElement('span');
126
+ label.className = `${CLASS}__label`;
127
+ label.textContent = logo.label ?? logo.alt;
128
+ item.append(label);
129
+ }
130
+ this.contentEl.append(item);
131
+ });
132
+ }
133
+ }
134
+ if (!customElements.get('db-section-logo-cloud')) {
135
+ customElements.define('db-section-logo-cloud', DbSectionLogoCloud);
136
+ }
137
+
138
+ export { DbSectionLogoCloud };