@designbasekorea/ui-wc 0.2.0 → 0.2.2

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 (239) hide show
  1. package/README.md +322 -29
  2. package/dist/esm/components/animation-background/canvas-controller.js +1 -0
  3. package/dist/esm/components/animation-background/layers.js +1 -0
  4. package/dist/esm/components/animation-background/lumina-presets.js +1 -0
  5. package/dist/esm/components/animation-background/lumina-shaders.js +1 -0
  6. package/dist/esm/components/animation-background/lumina-utils.js +1 -0
  7. package/dist/esm/components/animation-background/particle-defaults.js +1 -0
  8. package/dist/esm/components/animation-background/renderers.js +1 -0
  9. package/dist/esm/components/animation-background/shader-controller.js +1 -0
  10. package/dist/esm/components/color-picker-utils.js +1 -0
  11. package/dist/esm/components/date-picker-utils.js +1 -0
  12. package/dist/esm/components/db-accordion.d.ts +40 -0
  13. package/dist/esm/components/db-accordion.js +1 -0
  14. package/dist/esm/components/db-ad-banner.d.ts +41 -0
  15. package/dist/esm/components/db-ad-banner.js +1 -0
  16. package/dist/esm/components/db-alert.d.ts +24 -0
  17. package/dist/esm/components/db-alert.js +1 -0
  18. package/dist/esm/components/db-animation-background.d.ts +20 -0
  19. package/dist/esm/components/db-animation-background.js +1 -0
  20. package/dist/esm/components/db-animation-text.d.ts +32 -0
  21. package/dist/esm/components/db-animation-text.js +1 -0
  22. package/dist/esm/components/db-app-badge.d.ts +20 -0
  23. package/dist/esm/components/db-app-badge.js +1 -0
  24. package/dist/esm/components/db-audio-player.d.ts +82 -0
  25. package/dist/esm/components/db-audio-player.js +1 -0
  26. package/dist/esm/components/db-avatar.d.ts +18 -0
  27. package/dist/esm/components/db-avatar.js +1 -0
  28. package/dist/esm/components/db-backdrop.d.ts +24 -0
  29. package/dist/esm/components/db-backdrop.js +1 -0
  30. package/dist/esm/components/db-badge.d.ts +27 -0
  31. package/dist/esm/components/db-badge.js +1 -0
  32. package/dist/esm/components/db-banner.d.ts +28 -0
  33. package/dist/esm/components/db-banner.js +1 -0
  34. package/dist/esm/components/db-bottom-navigation.d.ts +29 -0
  35. package/dist/esm/components/db-bottom-navigation.js +1 -0
  36. package/dist/esm/components/db-bottom-sheet.d.ts +49 -0
  37. package/dist/esm/components/db-bottom-sheet.js +1 -0
  38. package/dist/esm/components/db-breadcrumbs.d.ts +24 -0
  39. package/dist/esm/components/db-breadcrumbs.js +1 -0
  40. package/dist/esm/components/db-button.d.ts +57 -0
  41. package/dist/esm/components/db-button.js +1 -0
  42. package/dist/esm/components/db-calendar.d.ts +78 -0
  43. package/dist/esm/components/db-calendar.js +1 -0
  44. package/dist/esm/components/db-card.d.ts +42 -0
  45. package/dist/esm/components/db-card.js +1 -0
  46. package/dist/esm/components/db-carousel.d.ts +35 -0
  47. package/dist/esm/components/db-carousel.js +1 -0
  48. package/dist/esm/components/db-checkbox.d.ts +35 -0
  49. package/dist/esm/components/db-checkbox.js +1 -0
  50. package/dist/esm/components/db-chip.d.ts +14 -0
  51. package/dist/esm/components/db-chip.js +1 -0
  52. package/dist/esm/components/db-code-block.d.ts +28 -0
  53. package/dist/esm/components/db-code-block.js +1 -0
  54. package/dist/esm/components/db-color-picker.d.ts +83 -0
  55. package/dist/esm/components/db-color-picker.js +1 -0
  56. package/dist/esm/components/db-confirm.d.ts +23 -0
  57. package/dist/esm/components/db-confirm.js +1 -0
  58. package/dist/esm/components/db-container.d.ts +13 -0
  59. package/dist/esm/components/db-container.js +1 -0
  60. package/dist/esm/components/db-context-menu.d.ts +46 -0
  61. package/dist/esm/components/db-context-menu.js +1 -0
  62. package/dist/esm/components/db-countdown.d.ts +23 -0
  63. package/dist/esm/components/db-countdown.js +1 -0
  64. package/dist/esm/components/db-cursor-follower.d.ts +32 -0
  65. package/dist/esm/components/db-cursor-follower.js +1 -0
  66. package/dist/esm/components/db-date-picker.d.ts +84 -0
  67. package/dist/esm/components/db-date-picker.js +1 -0
  68. package/dist/esm/components/db-divider.d.ts +13 -0
  69. package/dist/esm/components/db-divider.js +1 -0
  70. package/dist/esm/components/db-drawer.d.ts +32 -0
  71. package/dist/esm/components/db-drawer.js +1 -0
  72. package/dist/esm/components/db-dropdown.d.ts +70 -0
  73. package/dist/esm/components/db-dropdown.js +1 -0
  74. package/dist/esm/components/db-dropzone.d.ts +29 -0
  75. package/dist/esm/components/db-dropzone.js +1 -0
  76. package/dist/esm/components/db-empty-state.d.ts +14 -0
  77. package/dist/esm/components/db-empty-state.js +1 -0
  78. package/dist/esm/components/db-file-uploader.d.ts +27 -0
  79. package/dist/esm/components/db-file-uploader.js +1 -0
  80. package/dist/esm/components/db-floating-action-button.d.ts +24 -0
  81. package/dist/esm/components/db-floating-action-button.js +1 -0
  82. package/dist/esm/components/db-form.d.ts +94 -0
  83. package/dist/esm/components/db-form.js +1 -0
  84. package/dist/esm/components/db-gradient.d.ts +26 -0
  85. package/dist/esm/components/db-gradient.js +1 -0
  86. package/dist/esm/components/db-grid.d.ts +20 -0
  87. package/dist/esm/components/db-grid.js +1 -0
  88. package/dist/esm/components/db-icons.js +1 -0
  89. package/dist/esm/components/db-image-list.d.ts +35 -0
  90. package/dist/esm/components/db-image-list.js +1 -0
  91. package/dist/esm/components/db-image-placeholder.d.ts +16 -0
  92. package/dist/esm/components/db-image-placeholder.js +1 -0
  93. package/dist/esm/components/db-image.d.ts +34 -0
  94. package/dist/esm/components/db-image.js +1 -0
  95. package/dist/esm/components/db-indicator.d.ts +46 -0
  96. package/dist/esm/components/db-indicator.js +1 -0
  97. package/dist/esm/components/db-input.d.ts +51 -0
  98. package/dist/esm/components/db-input.js +1 -0
  99. package/dist/esm/components/db-label.d.ts +13 -0
  100. package/dist/esm/components/db-label.js +1 -0
  101. package/dist/esm/components/db-lightbox.d.ts +52 -0
  102. package/dist/esm/components/db-lightbox.js +1 -0
  103. package/dist/esm/components/db-list.d.ts +46 -0
  104. package/dist/esm/components/db-list.js +1 -0
  105. package/dist/esm/components/db-logo-svg.js +1 -0
  106. package/dist/esm/components/db-logo.d.ts +15 -0
  107. package/dist/esm/components/db-logo.js +1 -0
  108. package/dist/esm/components/db-lottie.d.ts +20 -0
  109. package/dist/esm/components/db-lottie.js +1 -0
  110. package/dist/esm/components/db-markdown-editor.d.ts +53 -0
  111. package/dist/esm/components/db-markdown-editor.js +1 -0
  112. package/dist/esm/components/db-marquee.d.ts +34 -0
  113. package/dist/esm/components/db-marquee.js +1 -0
  114. package/dist/esm/components/db-masonry.d.ts +24 -0
  115. package/dist/esm/components/db-masonry.js +1 -0
  116. package/dist/esm/components/db-menu-item.d.ts +30 -0
  117. package/dist/esm/components/db-menu-item.js +1 -0
  118. package/dist/esm/components/db-modal.d.ts +63 -0
  119. package/dist/esm/components/db-modal.js +1 -0
  120. package/dist/esm/components/db-navbar.d.ts +57 -0
  121. package/dist/esm/components/db-navbar.js +1 -0
  122. package/dist/esm/components/db-onboarding-modal.d.ts +57 -0
  123. package/dist/esm/components/db-onboarding-modal.js +1 -0
  124. package/dist/esm/components/db-page-header.d.ts +33 -0
  125. package/dist/esm/components/db-page-header.js +1 -0
  126. package/dist/esm/components/db-pagination.d.ts +25 -0
  127. package/dist/esm/components/db-pagination.js +1 -0
  128. package/dist/esm/components/db-popover.d.ts +62 -0
  129. package/dist/esm/components/db-popover.js +1 -0
  130. package/dist/esm/components/db-progress-step.d.ts +28 -0
  131. package/dist/esm/components/db-progress-step.js +1 -0
  132. package/dist/esm/components/db-progress.d.ts +15 -0
  133. package/dist/esm/components/db-progress.js +1 -0
  134. package/dist/esm/components/db-progressbar.d.ts +13 -0
  135. package/dist/esm/components/db-progressbar.js +1 -0
  136. package/dist/esm/components/db-radio.d.ts +34 -0
  137. package/dist/esm/components/db-radio.js +1 -0
  138. package/dist/esm/components/db-random-gradient.d.ts +24 -0
  139. package/dist/esm/components/db-random-gradient.js +1 -0
  140. package/dist/esm/components/db-range-slider.d.ts +64 -0
  141. package/dist/esm/components/db-range-slider.js +1 -0
  142. package/dist/esm/components/db-rating.d.ts +31 -0
  143. package/dist/esm/components/db-rating.js +1 -0
  144. package/dist/esm/components/db-reorder.d.ts +38 -0
  145. package/dist/esm/components/db-reorder.js +1 -0
  146. package/dist/esm/components/db-resizable-panels.d.ts +42 -0
  147. package/dist/esm/components/db-resizable-panels.js +1 -0
  148. package/dist/esm/components/db-scroll-area.d.ts +23 -0
  149. package/dist/esm/components/db-scroll-area.js +1 -0
  150. package/dist/esm/components/db-search-bar.d.ts +53 -0
  151. package/dist/esm/components/db-search-bar.js +1 -0
  152. package/dist/esm/components/db-section-app-download.d.ts +32 -0
  153. package/dist/esm/components/db-section-app-download.js +1 -0
  154. package/dist/esm/components/db-section-contact.d.ts +22 -0
  155. package/dist/esm/components/db-section-contact.js +1 -0
  156. package/dist/esm/components/db-section-feature.d.ts +34 -0
  157. package/dist/esm/components/db-section-feature.js +1 -0
  158. package/dist/esm/components/db-section-hero.d.ts +34 -0
  159. package/dist/esm/components/db-section-hero.js +1 -0
  160. package/dist/esm/components/db-section.d.ts +44 -0
  161. package/dist/esm/components/db-section.js +1 -0
  162. package/dist/esm/components/db-segment-control.d.ts +41 -0
  163. package/dist/esm/components/db-segment-control.js +1 -0
  164. package/dist/esm/components/db-select.d.ts +66 -0
  165. package/dist/esm/components/db-select.js +1 -0
  166. package/dist/esm/components/db-share-icons.js +1 -0
  167. package/dist/esm/components/db-share.d.ts +48 -0
  168. package/dist/esm/components/db-share.js +1 -0
  169. package/dist/esm/components/db-sidebar.d.ts +59 -0
  170. package/dist/esm/components/db-sidebar.js +1 -0
  171. package/dist/esm/components/db-skeleton.d.ts +13 -0
  172. package/dist/esm/components/db-skeleton.js +1 -0
  173. package/dist/esm/components/db-spinner.d.ts +27 -0
  174. package/dist/esm/components/db-spinner.js +1 -0
  175. package/dist/esm/components/db-split-view.d.ts +33 -0
  176. package/dist/esm/components/db-split-view.js +1 -0
  177. package/dist/esm/components/db-stack.d.ts +13 -0
  178. package/dist/esm/components/db-stack.js +1 -0
  179. package/dist/esm/components/db-stat.d.ts +26 -0
  180. package/dist/esm/components/db-stat.js +1 -0
  181. package/dist/esm/components/db-stepper.d.ts +49 -0
  182. package/dist/esm/components/db-stepper.js +1 -0
  183. package/dist/esm/components/db-table.d.ts +39 -0
  184. package/dist/esm/components/db-table.js +1 -0
  185. package/dist/esm/components/db-tabs.d.ts +48 -0
  186. package/dist/esm/components/db-tabs.js +1 -0
  187. package/dist/esm/components/db-testimonial.d.ts +27 -0
  188. package/dist/esm/components/db-testimonial.js +1 -0
  189. package/dist/esm/components/db-textarea.d.ts +33 -0
  190. package/dist/esm/components/db-textarea.js +1 -0
  191. package/dist/esm/components/db-time-picker.d.ts +62 -0
  192. package/dist/esm/components/db-time-picker.js +1 -0
  193. package/dist/esm/components/db-timeline.d.ts +29 -0
  194. package/dist/esm/components/db-timeline.js +1 -0
  195. package/dist/esm/components/db-toast.d.ts +23 -0
  196. package/dist/esm/components/db-toast.js +1 -0
  197. package/dist/esm/components/db-toggle.d.ts +35 -0
  198. package/dist/esm/components/db-toggle.js +1 -0
  199. package/dist/esm/components/db-toolbar.d.ts +25 -0
  200. package/dist/esm/components/db-toolbar.js +1 -0
  201. package/dist/esm/components/db-tooltip.d.ts +55 -0
  202. package/dist/esm/components/db-tooltip.js +1 -0
  203. package/dist/esm/components/db-top-banner.d.ts +17 -0
  204. package/dist/esm/components/db-top-banner.js +1 -0
  205. package/dist/esm/components/db-tutorial.d.ts +54 -0
  206. package/dist/esm/components/db-tutorial.js +1 -0
  207. package/dist/esm/components/db-video-player.d.ts +67 -0
  208. package/dist/esm/components/db-video-player.js +1 -0
  209. package/dist/esm/components/db-youtube-player.d.ts +22 -0
  210. package/dist/esm/components/db-youtube-player.js +1 -0
  211. package/dist/esm/components/highlight-code.js +1 -0
  212. package/dist/esm/components/input-validation.js +1 -0
  213. package/dist/esm/components/number-scrub.js +1 -0
  214. package/dist/esm/components/random-gradient-palettes.js +1 -0
  215. package/dist/esm/helpers/confirm.d.ts +30 -0
  216. package/dist/esm/helpers/confirm.js +1 -0
  217. package/dist/esm/helpers/toast.d.ts +56 -0
  218. package/dist/esm/helpers/toast.js +1 -0
  219. package/dist/esm/index.d.ts +100 -0
  220. package/dist/esm/index.js +1 -0
  221. package/dist/esm/node_modules/prismjs/components/prism-bash.js +1 -0
  222. package/dist/esm/node_modules/prismjs/components/prism-clike.js +1 -0
  223. package/dist/esm/node_modules/prismjs/components/prism-css.js +1 -0
  224. package/dist/esm/node_modules/prismjs/components/prism-javascript.js +1 -0
  225. package/dist/esm/node_modules/prismjs/components/prism-json.js +1 -0
  226. package/dist/esm/node_modules/prismjs/components/prism-jsx.js +1 -0
  227. package/dist/esm/node_modules/prismjs/components/prism-markup.js +1 -0
  228. package/dist/esm/node_modules/prismjs/components/prism-scss.js +1 -0
  229. package/dist/esm/node_modules/prismjs/components/prism-tsx.js +1 -0
  230. package/dist/esm/node_modules/prismjs/components/prism-typescript.js +1 -0
  231. package/dist/index.cjs +1 -1
  232. package/dist/index.css +1 -1
  233. package/dist/index.d.ts +180 -3
  234. package/dist/index.esm.js +1 -1
  235. package/dist/react/index.cjs +1 -1
  236. package/dist/react/index.d.ts +203 -50
  237. package/dist/react/index.esm.js +1 -1
  238. package/package.json +10 -2
  239. /package/dist/chunks/{lottie-f6500ba3.js → lottie-e741cdda.js} +0 -0
@@ -0,0 +1 @@
1
+ import"./db-button.js";import{createDbIcon as t}from"./db-icons.js";const e="designbase-wc-alert";class DbAlert extends HTMLElement{static get observedAttributes(){return["title","message","variant","size","show-icon","closable","action-label","action-variant","action-buttons"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getIconName(t){return"success"===t?"circle-checked":"warning"===t?"warning-filled":"danger"===t?"error-filled":"info-filled"}parseActionButtons(){const t=this.getAttribute("action-buttons");if(!t)return[];try{const e=JSON.parse(t);return Array.isArray(e)?e:[]}catch{return[]}}render(){const n=this.getAttribute("variant")||"default",s=this.getAttribute("size")||"m",a="false"!==this.getAttribute("show-icon"),i="false"!==this.getAttribute("closable"),r=this.getAttribute("title")?.trim()||"",o=this.getAttribute("message")?.trim()||"",c=this.getAttribute("action-label"),l=this.getAttribute("action-variant")||"tertiary",d=this.parseActionButtons(),b=Boolean(o),m=Boolean(r),u=m&&!b||!m&&b,h=d.length>0?d:c?[{label:c,variant:l}]:[];this.className=[e,`${e}--${n}`,`${e}--${s}`,a&&`${e}--with-icon`,i&&`${e}--closable`,u&&`${e}--text-single`,h.length>0&&`${e}--has-actions`].filter(Boolean).join(" "),this.setAttribute("role","alert"),this.setAttribute("aria-live","polite"),this.querySelector(`.${e}__content`)?.remove(),this.querySelector(`.${e}__actions`)?.remove(),Array.from(this.childNodes).forEach(t=>{t.nodeType===Node.TEXT_NODE&&t.remove()});const p=document.createElement("div");if(p.className=`${e}__content`,a){const a=document.createElement("div");a.className=`${e}__icon`,a.append(t(this.getIconName(n),"s"===s?16:"l"===s?24:20)),p.append(a)}const g=document.createElement("div");if(g.className=`${e}__body`,m){const t=document.createElement("div");t.className=`${e}__title`,t.textContent=r,g.append(t)}if(b){const t=document.createElement("div");t.className=`${e}__message`,t.textContent=o,g.append(t)}if(p.append(g),h.length>0){const t=document.createElement("div");t.className=`${e}__actions`;const n=document.createElement("div");n.className=`${e}__action-buttons`,h.forEach((t,e)=>{const a=document.createElement("db-button");a.setAttribute("variant",t.variant||"tertiary"),a.setAttribute("size",t.size||s),a.textContent=t.label,t.disabled&&a.setAttribute("disabled",""),a.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0,detail:{index:e,label:t.label}}))}),n.append(a)}),t.append(n),p.append(t)}if(i){const n=document.createElement("button");n.type="button",n.className=`${e}__close`,n.setAttribute("aria-label","알림 닫기"),n.append(t("close",20)),n.addEventListener("click",()=>{this.hidden=!0,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}),p.append(n)}this.replaceChildren(p)}}customElements.get("db-alert")||customElements.define("db-alert",DbAlert);export{DbAlert};
@@ -0,0 +1,20 @@
1
+ declare class DbAnimationBackground extends HTMLElement {
2
+ private layersEl?;
3
+ private contentEl?;
4
+ private layerHandle?;
5
+ private clickHandler?;
6
+ static get observedAttributes(): string[];
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ attributeChangedCallback(): void;
10
+ private teardownLayers;
11
+ private getSizeStyle;
12
+ private render;
13
+ }
14
+ declare global {
15
+ interface HTMLElementTagNameMap {
16
+ 'db-animation-background': DbAnimationBackground;
17
+ }
18
+ }
19
+
20
+ export { DbAnimationBackground };
@@ -0,0 +1 @@
1
+ import{parseAnimationBackgroundConfig as t,applyContainerStyles as e,mountAnimationLayers as i,getEffectiveGridColor as s,ANIMATION_BACKGROUND_CLASS as n}from"./animation-background/layers.js";const a=n;class DbAnimationBackground extends HTMLElement{static get observedAttributes(){return["type","theme","intensity","blur","speed","direction","colors","width","height","border-radius","opacity","blend-mode","particle-count","particle-size","star-count","star-size","wind","clickable","disabled","show-grid","grid-size","grid-color","grid-opacity","noise","show-vignette","preset","zoom"]}connectedCallback(){this.style.display="block",this.render()}disconnectedCallback(){this.teardownLayers(),this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0)}attributeChangedCallback(){this.isConnected&&this.render()}teardownLayers(){this.layerHandle?.destroy?.(),this.layerHandle=void 0,this.layersEl&&this.layersEl.replaceChildren()}getSizeStyle(t){if(!t)return;const e=Number(t);return Number.isFinite(e)?`${e}px`:t}render(){const n=t(this);this.className=[a,`${a}--${n.type}`,n.clickable&&!n.disabled&&`${a}--clickable`,n.disabled&&`${a}--disabled`].filter(Boolean).join(" "),e(this,n);const l=this.getSizeStyle(this.getAttribute("width")),r=this.getSizeStyle(this.getAttribute("height")),o=this.getSizeStyle(this.getAttribute("border-radius"));l&&(this.style.width=l),r&&(this.style.height=r),o&&(this.style.borderRadius=o),this.style.opacity=String(n.opacity);const d=this.getAttribute("blend-mode");if(d&&(this.style.mixBlendMode=d),!this.layersEl){this.layersEl=document.createElement("div"),this.layersEl.className=`${a}__layers`,Object.assign(this.layersEl.style,{position:"absolute",inset:"0",width:"100%",height:"100%",zIndex:"0"}),this.contentEl=document.createElement("div"),this.contentEl.className=`${a}__content`,Object.assign(this.contentEl.style,{position:"relative",zIndex:"10",width:"100%",height:"100%"});const t=document.createElement("slot");this.contentEl.appendChild(t),this.append(this.layersEl,this.contentEl)}this.teardownLayers();const c=this.querySelector(`.${a}__grid-overlay`);if(c?.remove(),this.layerHandle=i(this.layersEl,n),n.showGrid&&!n.disabled){const t=document.createElement("div");t.className=`${a}__grid-overlay`,Object.assign(t.style,{position:"absolute",inset:"0",width:"100%",height:"100%",pointerEvents:"none",zIndex:"1",backgroundImage:`linear-gradient(to right, ${s(n)} 1px, transparent 1px), linear-gradient(to bottom, ${s(n)} 1px, transparent 1px)`,backgroundSize:`${n.gridSize}px ${n.gridSize}px`,opacity:String(n.gridOpacity),maskImage:"linear-gradient(to bottom, black 0%, black 92%, transparent 100%)",WebkitMaskImage:"linear-gradient(to bottom, black 0%, black 92%, transparent 100%)"}),this.insertBefore(t,this.contentEl??null)}this.clickHandler&&(this.removeEventListener("click",this.clickHandler),this.clickHandler=void 0),n.clickable&&!n.disabled&&(this.clickHandler=()=>{this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.addEventListener("click",this.clickHandler))}}customElements.get("db-animation-background")||customElements.define("db-animation-background",DbAnimationBackground);export{DbAnimationBackground};
@@ -0,0 +1,32 @@
1
+ declare class DbAnimationText extends HTMLElement {
2
+ private ghostEl?;
3
+ private layerEl?;
4
+ private observer?;
5
+ private timers;
6
+ private displayText;
7
+ private isVisible;
8
+ private isAnimating;
9
+ static get observedAttributes(): string[];
10
+ connectedCallback(): void;
11
+ disconnectedCallback(): void;
12
+ attributeChangedCallback(): void;
13
+ private getText;
14
+ private getType;
15
+ private getTrigger;
16
+ private ensureStructure;
17
+ private clearTimers;
18
+ private syncFromAttributes;
19
+ private syncClasses;
20
+ private setupTrigger;
21
+ private startAnimation;
22
+ private startTyping;
23
+ private startDecoding;
24
+ private renderLayer;
25
+ }
26
+ declare global {
27
+ interface HTMLElementTagNameMap {
28
+ 'db-animation-text': DbAnimationText;
29
+ }
30
+ }
31
+
32
+ export { DbAnimationText };
@@ -0,0 +1 @@
1
+ const t="designbase-wc-animation-text";class DbAnimationText extends HTMLElement{constructor(){super(...arguments),this.timers=[],this.displayText="",this.isVisible=!1,this.isAnimating=!1}static get observedAttributes(){return["text","trigger","type","speed","repeat","delay","direction","size","color","custom-color","weight","align","gradient-colors","wave-colors","glow-color","clickable","disabled"]}connectedCallback(){this.style.display="inline-block",this.ensureStructure(),this.syncFromAttributes(),this.setupTrigger()}disconnectedCallback(){this.clearTimers(),this.observer?.disconnect()}attributeChangedCallback(){this.isConnected&&(this.syncFromAttributes(),this.setupTrigger())}getText(){return this.getAttribute("text")||this.textContent?.trim()||""}getType(){const t=this.getAttribute("type")||"fade";return["typing","fade","slide","bounce","shake","glow","gradient","wave","flip","scale","decode"].includes(t)?t:"fade"}getTrigger(){const t=this.getAttribute("trigger")||"mount";return["mount","hover","click","in-view"].includes(t)?t:"mount"}ensureStructure(){this.ghostEl||(this.ghostEl=document.createElement("span"),this.ghostEl.setAttribute("aria-hidden","true"),this.ghostEl.style.visibility="hidden",this.ghostEl.style.pointerEvents="none",this.ghostEl.style.userSelect="none",this.layerEl=document.createElement("span"),this.layerEl.style.position="absolute",this.layerEl.style.top="0",this.layerEl.style.left="0",this.append(this.ghostEl,this.layerEl),this.addEventListener("mouseenter",()=>{"hover"!==this.getTrigger()||this.hasAttribute("disabled")||(this.isVisible=!0,this.startAnimation(),this.syncClasses())}),this.addEventListener("mouseleave",()=>{if("hover"!==this.getTrigger())return;this.isVisible=!1,this.isAnimating=!1,this.clearTimers();const t=this.getType();"typing"!==t&&"decode"!==t||(this.displayText=this.getText()),this.renderLayer(),this.syncClasses()}),this.addEventListener("click",()=>{if(!this.hasAttribute("disabled")){if("click"===this.getTrigger()){if(this.isVisible=!this.isVisible,this.isVisible)this.startAnimation();else{this.isAnimating=!1,this.clearTimers();const t=this.getType();"typing"!==t&&"decode"!==t||(this.displayText=this.getText()),this.renderLayer()}this.syncClasses()}this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))}}))}clearTimers(){this.timers.forEach(t=>window.clearInterval(t)),this.timers.forEach(t=>window.clearTimeout(t)),this.timers=[]}syncFromAttributes(){const e=this.getText(),i=this.getType(),s=this.getTrigger(),r=Number(this.getAttribute("speed")||1e3),n=Number(this.getAttribute("repeat")||1),h=this.getAttribute("custom-color"),l=(this.getAttribute("gradient-colors")||"#667eea,#764ba2").split(","),a=(this.getAttribute("wave-colors")||"#ff6b6b,#4ecdc4,#45b7d1,#96ceb4,#feca57").split(","),o=this.getAttribute("glow-color")||"#667eea";this.className=[t,"typing"!==i&&`${t}--${i}`,`${t}--${this.getAttribute("size")||"m"}`,`${t}--${this.getAttribute("color")||"primary"}`,`${t}--${this.getAttribute("weight")||"normal"}`,`${t}--${this.getAttribute("align")||"left"}`,`${t}--${this.getAttribute("direction")||"left"}`,this.isVisible&&`${t}--visible`,this.isAnimating&&`${t}--animating`,(this.hasAttribute("clickable")||"click"===s)&&`${t}--clickable`,this.hasAttribute("disabled")&&`${t}--disabled`].filter(Boolean).join(" "),this.style.setProperty("--db-animation-speed",`${Number.isFinite(r)?r:1e3}ms`),this.style.setProperty("--db-animation-iteration-count",0===n?"infinite":String(n)),h&&this.style.setProperty("--db-text-custom",h),this.style.setProperty("--db-wave-colors",a.join(", ")),this.style.setProperty("--db-glow-color",o),"gradient"===i&&l.length>=2?(this.style.background=`linear-gradient(45deg, ${l.join(", ")})`,this.style.backgroundSize="200% 200%",this.style.webkitBackgroundClip="text",this.style.webkitTextFillColor="transparent",this.style.backgroundClip="text"):(this.style.removeProperty("background"),this.style.removeProperty("background-size"),this.style.removeProperty("-webkit-background-clip"),this.style.removeProperty("-webkit-text-fill-color"),this.style.removeProperty("background-clip")),"typing"!==i&&"decode"!==i||"mount"!==s||this.isAnimating?this.isAnimating||(this.displayText=e):this.displayText="",this.ghostEl&&(this.ghostEl.textContent=e,this.ghostEl.style.whiteSpace="typing"===i?"pre-wrap":""),this.layerEl&&(this.layerEl.className=["typing"===i&&`${t}--typing`,this.isAnimating&&"typing"===i&&`${t}--animating`].filter(Boolean).join(" "),this.layerEl.style.width="typing"===i?"auto":"100%",this.layerEl.style.height="100%",this.layerEl.style.whiteSpace="typing"===i?"pre-wrap":""),this.renderLayer()}syncClasses(){this.classList.toggle(`${t}--visible`,this.isVisible),this.classList.toggle(`${t}--animating`,this.isAnimating)}setupTrigger(){this.clearTimers(),this.observer?.disconnect();const t=this.getTrigger(),e=Number(this.getAttribute("delay")||0);if("mount"===t){const t=window.setTimeout(()=>{this.isVisible=!0,this.syncClasses(),this.startAnimation()},e);return void this.timers.push(t)}"in-view"===t&&(this.observer=new IntersectionObserver(t=>{t[0]?.isIntersecting&&(window.setTimeout(()=>{this.isVisible=!0,this.syncClasses(),this.startAnimation()},e),this.observer?.disconnect())}),this.observer.observe(this))}startAnimation(){const t=this.getType(),e=this.getText();if(this.isAnimating=!0,this.syncClasses(),this.syncFromAttributes(),"typing"===t)return void this.startTyping(0);if("decode"===t)return void this.startDecoding(0);this.displayText=e,this.renderLayer();const i=Number(this.getAttribute("speed")||1e3),s=window.setTimeout(()=>{this.isAnimating=!1,this.syncClasses(),this.syncFromAttributes()},i);this.timers.push(s)}startTyping(t){const e=this.getText(),i=Number(this.getAttribute("speed")||1e3),s=Number(this.getAttribute("repeat")||1);this.displayText="",this.renderLayer();let r=0;const n=window.setInterval(()=>{if(r>=e.length)if(window.clearInterval(n),0===s||t<s-1){const e=window.setTimeout(()=>this.startTyping(t+1),500);this.timers.push(e)}else this.isAnimating=!1,this.syncClasses();else this.displayText=e.slice(0,r+1),this.renderLayer(),r+=1},Math.max(16,i/Math.max(e.length,1)));this.timers.push(n)}startDecoding(t){const e=this.getText(),i=Number(this.getAttribute("repeat")||1),s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+";let r=0;const n=window.setInterval(()=>{if(this.displayText=e.split("").map((t,i)=>i<r?e[i]:s[Math.floor(74*Math.random())]||t).join(""),this.renderLayer(),r>=e.length)if(window.clearInterval(n),this.displayText=e,this.renderLayer(),0===i||t<i-1){const e=window.setTimeout(()=>this.startDecoding(t+1),500);this.timers.push(e)}else this.isAnimating=!1,this.syncClasses();r+=1/3},30);this.timers.push(n)}renderLayer(){if(!this.layerEl)return;const t=this.getType(),e=this.getText(),i=this.isVisible||this.isAnimating;"wave"!==t&&"shake"!==t||!i?this.layerEl.textContent=this.displayText||(i?e:""):this.layerEl.replaceChildren(...e.split("").map((t,e)=>{const i=document.createElement("span");return i.style.animationDelay=.05*e+"s",i.style.display="inline-block",i.textContent=" "===t?" ":t,i}))}}customElements.get("db-animation-text")||customElements.define("db-animation-text",DbAnimationText);export{DbAnimationText};
@@ -0,0 +1,20 @@
1
+ declare class DbAppBadge extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ private built;
4
+ private labelEl?;
5
+ private storeEl?;
6
+ private iconWrapEl?;
7
+ connectedCallback(): void;
8
+ attributeChangedCallback(): void;
9
+ private getStore;
10
+ private getIconSize;
11
+ private build;
12
+ private updateUI;
13
+ }
14
+ declare global {
15
+ interface HTMLElementTagNameMap {
16
+ 'db-app-badge': DbAppBadge;
17
+ }
18
+ }
19
+
20
+ export { DbAppBadge };
@@ -0,0 +1 @@
1
+ import{createDbIcon as t}from"./db-icons.js";const e="designbase-wc-app-badge",s={"app-store":{label:"다운로드",storeName:"App Store"},"google-play":{label:"다운로드",storeName:"Google Play"}};class DbAppBadge extends HTMLElement{constructor(){super(...arguments),this.built=!1}static get observedAttributes(){return["store","href","label","store-name","size","theme"]}connectedCallback(){this.built||(this.built=!0,this.build()),this.updateUI()}attributeChangedCallback(){this.built&&this.updateUI()}getStore(){return"google-play"===(this.getAttribute("store")||"app-store")?"google-play":"app-store"}getIconSize(){const t=this.getAttribute("size")||"m";return"s"===t?18:"l"===t?24:20}build(){this.iconWrapEl=document.createElement("span"),this.iconWrapEl.className=`${e}__icon`,this.iconWrapEl.setAttribute("aria-hidden","true");const t=document.createElement("span");t.className=`${e}__text`,this.labelEl=document.createElement("span"),this.labelEl.className=`${e}__label`,this.storeEl=document.createElement("span"),this.storeEl.className=`${e}__store`,t.append(this.labelEl,this.storeEl),this.append(this.iconWrapEl,t),this.addEventListener("click",t=>{this.getAttribute("href")||this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0,detail:{event:t}}))})}updateUI(){const i=this.getStore(),a=s[i],l=this.getAttribute("size")||"m",r=this.getAttribute("theme")||"dark",o=this.getAttribute("label")||a.label,n=this.getAttribute("store-name")||a.storeName,p=this.getAttribute("href");this.className=[e,`${e}--${l}`,`${e}--${r}`,`${e}--${i}`].join(" "),p?(this.setAttribute("role","link"),this.tabIndex=0,this.onclick=()=>window.open(p,"_blank","noopener,noreferrer")):(this.setAttribute("role","button"),this.tabIndex=0),this.iconWrapEl&&this.iconWrapEl.replaceChildren(t("app-store"===i?"apple":"play-store",this.getIconSize())),this.labelEl&&(this.labelEl.textContent=o),this.storeEl&&(this.storeEl.textContent=n)}}customElements.get("db-app-badge")||customElements.define("db-app-badge",DbAppBadge);export{DbAppBadge};
@@ -0,0 +1,82 @@
1
+ declare class DbAudioPlayer extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ private built;
4
+ private audioEl?;
5
+ private progressEl?;
6
+ private progressBarEl?;
7
+ private progressHandleEl?;
8
+ private playButtonEl?;
9
+ private volumeInputEl?;
10
+ private settingsMenuEl?;
11
+ private timeCurrentEl?;
12
+ private timeDurationEl?;
13
+ private titleEl?;
14
+ private artistEl?;
15
+ private albumEl?;
16
+ private albumImgEl?;
17
+ private albumPlaceholderEl?;
18
+ private playlistTracksEl?;
19
+ private isPlaying;
20
+ private isMuted;
21
+ private volume;
22
+ private currentTime;
23
+ private duration;
24
+ private showSettingsMenu;
25
+ private playbackRate;
26
+ private currentRepeatMode;
27
+ private isShuffle;
28
+ private isLoading;
29
+ private error;
30
+ private playlistIndex;
31
+ private shuffledPlaylist;
32
+ private boundKeyDown;
33
+ connectedCallback(): void;
34
+ disconnectedCallback(): void;
35
+ attributeChangedCallback(name: string): void;
36
+ private getBool;
37
+ private getPlaylist;
38
+ private getPlaybackRates;
39
+ private getIconSize;
40
+ private getCurrentTrack;
41
+ private refreshShuffledPlaylist;
42
+ private formatTime;
43
+ private syncFromAttributes;
44
+ private loadCurrentTrack;
45
+ private bindAudioEvents;
46
+ private handleEnded;
47
+ private setPlaylistIndex;
48
+ private togglePlay;
49
+ private toggleMute;
50
+ private toggleRepeatMode;
51
+ private toggleShuffle;
52
+ private handlePlaybackRateChange;
53
+ private handleKeyDown;
54
+ private iconButton;
55
+ private build;
56
+ private get leftControls();
57
+ private get rightControls();
58
+ private get controlsEl();
59
+ private get timeEl();
60
+ private get volumeWrap();
61
+ private get settingsEl();
62
+ private get playlistEl();
63
+ private get rateSelect();
64
+ private get volumePercent();
65
+ private get muteButton();
66
+ private updateTrackInfo;
67
+ private updateProgress;
68
+ private updateTime;
69
+ private updateVolumeUI;
70
+ private updateSettingsMenu;
71
+ private rebuildControlButtons;
72
+ private rebuildPlaylist;
73
+ private updatePlaylistActive;
74
+ private updateUI;
75
+ }
76
+ declare global {
77
+ interface HTMLElementTagNameMap {
78
+ 'db-audio-player': DbAudioPlayer;
79
+ }
80
+ }
81
+
82
+ export { DbAudioPlayer };
@@ -0,0 +1 @@
1
+ import{createDbIcon as t}from"./db-icons.js";const e="designbase-wc-audio-player";class DbAudioPlayer extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.isPlaying=!1,this.isMuted=!1,this.volume=1,this.currentTime=0,this.duration=0,this.showSettingsMenu=!1,this.playbackRate=1,this.currentRepeatMode="none",this.isShuffle=!1,this.isLoading=!1,this.error=null,this.playlistIndex=0,this.shuffledPlaylist=[],this.boundKeyDown=t=>this.handleKeyDown(t)}static get observedAttributes(){return["src","title","artist","album","album-art","size","variant","theme","auto-play","loop","muted","show-controls","enable-keyboard","show-progress","show-time","show-volume","show-settings","playlist","current-index","playback-rates","default-playback-rate","repeat-mode","shuffle"]}connectedCallback(){this.style.display="block",this.built||(this.built=!0,this.build(),this.bindAudioEvents()),this.syncFromAttributes(),this.updateUI(),this.getBool("enable-keyboard",!0)&&document.addEventListener("keydown",this.boundKeyDown)}disconnectedCallback(){document.removeEventListener("keydown",this.boundKeyDown)}attributeChangedCallback(t){if(this.built){if("current-index"===t)return this.playlistIndex=Number(this.getAttribute("current-index")||0),void this.loadCurrentTrack();"repeat-mode"===t&&(this.currentRepeatMode=this.getAttribute("repeat-mode")||"none"),"shuffle"===t&&(this.isShuffle=this.getBool("shuffle"),this.refreshShuffledPlaylist()),"default-playback-rate"===t&&(this.playbackRate=Number(this.getAttribute("default-playback-rate")||1),this.audioEl&&(this.audioEl.playbackRate=this.playbackRate)),this.updateUI()}}getBool(t,e=!1){if(!this.hasAttribute(t))return e;const s=this.getAttribute(t);return""===s||"true"===s}getPlaylist(){try{const t=this.getAttribute("playlist"),e=t?JSON.parse(t):[];return Array.isArray(e)?e:[]}catch{return[]}}getPlaybackRates(){try{const t=this.getAttribute("playback-rates"),e=t?JSON.parse(t):[.5,.75,1,1.25,1.5,2];return Array.isArray(e)&&e.length>0?e:[.5,.75,1,1.25,1.5,2]}catch{return[.5,.75,1,1.25,1.5,2]}}getIconSize(){const t=this.getAttribute("size")||"m";return"s"===t?16:"l"===t?24:"xl"===t?32:20}getCurrentTrack(){const t=this.getPlaylist();if(t.length>0){return t[this.isShuffle&&this.shuffledPlaylist.length>0?this.shuffledPlaylist[this.playlistIndex]??this.playlistIndex:this.playlistIndex]||t[0]}return{src:this.getAttribute("src")||"",title:this.getAttribute("title")||void 0,artist:this.getAttribute("artist")||void 0,album:this.getAttribute("album")||void 0,albumArt:this.getAttribute("album-art")||void 0}}refreshShuffledPlaylist(){const t=this.getPlaylist();if(t.length>0&&this.isShuffle){const e=Array.from({length:t.length},(t,e)=>e);this.shuffledPlaylist=[...e].sort(()=>Math.random()-.5)}else this.shuffledPlaylist=[]}formatTime(t){return`${Math.floor(t/60)}:${Math.floor(t%60).toString().padStart(2,"0")}`}syncFromAttributes(){this.playlistIndex=Number(this.getAttribute("current-index")||0),this.currentRepeatMode=this.getAttribute("repeat-mode")||"none",this.isShuffle=this.getBool("shuffle"),this.playbackRate=Number(this.getAttribute("default-playback-rate")||1),this.isMuted=this.getBool("muted"),this.volume=this.isMuted?0:1,this.refreshShuffledPlaylist(),this.loadCurrentTrack()}loadCurrentTrack(){if(!this.audioEl)return;const t=this.getCurrentTrack(),e=t?.src||this.getAttribute("src")||"";this.audioEl.src!==e&&e&&(this.audioEl.src=e,this.audioEl.load()),this.updateTrackInfo(),this.updatePlaylistActive()}bindAudioEvents(){const t=this.audioEl;t&&(t.addEventListener("play",()=>{this.isPlaying=!0,this.dispatchEvent(new CustomEvent("db-play",{bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("pause",()=>{this.isPlaying=!1,this.dispatchEvent(new CustomEvent("db-pause",{bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("timeupdate",()=>{this.currentTime=t.currentTime,this.duration=t.duration||0,this.dispatchEvent(new CustomEvent("db-time-update",{detail:{currentTime:this.currentTime,duration:this.duration},bubbles:!0,composed:!0})),this.updateProgress(),this.updateTime()}),t.addEventListener("volumechange",()=>{this.volume=t.volume,this.isMuted=t.muted,this.dispatchEvent(new CustomEvent("db-volume-change",{detail:{volume:this.volume},bubbles:!0,composed:!0})),this.updateVolumeUI()}),t.addEventListener("ended",()=>this.handleEnded()),t.addEventListener("error",()=>{this.error="오디오를 재생할 수 없습니다.",this.dispatchEvent(new CustomEvent("db-error",{detail:{error:this.error},bubbles:!0,composed:!0})),this.updateUI()}),t.addEventListener("loadstart",()=>{this.isLoading=!0,this.error=null,this.updateUI()}),t.addEventListener("canplay",()=>{this.isLoading=!1,this.updateUI()}))}handleEnded(){this.isPlaying=!1,this.dispatchEvent(new CustomEvent("db-ended",{bubbles:!0,composed:!0}));const t=this.getPlaylist();if(t.length>0){if("one"===this.currentRepeatMode)this.audioEl&&(this.audioEl.currentTime=0,this.audioEl.play());else if("all"===this.currentRepeatMode||this.playlistIndex<t.length-1){const e=this.playlistIndex+1;e<t.length?this.setPlaylistIndex(e):"all"===this.currentRepeatMode&&this.setPlaylistIndex(0)}}else this.getBool("loop")&&this.audioEl&&(this.audioEl.currentTime=0,this.audioEl.play());this.updateUI()}setPlaylistIndex(t){this.playlistIndex=t,this.dispatchEvent(new CustomEvent("db-playlist-change",{detail:{index:t},bubbles:!0,composed:!0})),this.loadCurrentTrack(),this.audioEl&&this.audioEl.play()}togglePlay(){this.audioEl&&(this.isPlaying?this.audioEl.pause():this.audioEl.play())}toggleMute(){this.audioEl&&(this.audioEl.muted=!this.isMuted)}toggleRepeatMode(){const t=["none","one","all"],e=t[(t.indexOf(this.currentRepeatMode)+1)%t.length];this.currentRepeatMode=e,this.dispatchEvent(new CustomEvent("db-repeat-mode-change",{detail:{mode:e},bubbles:!0,composed:!0})),this.updateUI()}toggleShuffle(){this.isShuffle=!this.isShuffle,this.refreshShuffledPlaylist(),this.dispatchEvent(new CustomEvent("db-shuffle-change",{detail:{shuffle:this.isShuffle},bubbles:!0,composed:!0})),this.updateUI()}handlePlaybackRateChange(t){this.audioEl&&(this.audioEl.playbackRate=t,this.playbackRate=t,this.dispatchEvent(new CustomEvent("db-playback-rate-change",{detail:{rate:t},bubbles:!0,composed:!0})))}handleKeyDown(t){if(this.audioEl&&this.getBool("enable-keyboard",!0))switch(t.code){case"Space":t.preventDefault(),this.togglePlay();break;case"ArrowLeft":t.preventDefault(),this.audioEl.currentTime=Math.max(0,this.currentTime-10);break;case"ArrowRight":t.preventDefault(),this.audioEl.currentTime=Math.min(this.duration,this.currentTime+10);break;case"ArrowUp":t.preventDefault(),this.audioEl.volume=Math.min(1,this.volume+.1),this.audioEl.muted=!1;break;case"ArrowDown":t.preventDefault(),this.audioEl.volume=Math.max(0,this.volume-.1),this.audioEl.muted=0===this.audioEl.volume;break;case"KeyM":t.preventDefault(),this.toggleMute();break;case"KeyR":t.preventDefault(),this.toggleRepeatMode();break;case"KeyS":t.preventDefault(),this.toggleShuffle()}}iconButton(s,i,l){const a=document.createElement("button");return a.type="button",a.className=`${e}__control-button`,a.append(t(s,this.getIconSize())),l?.disabled&&(a.disabled=!0),l?.data&&Object.entries(l.data).forEach(([t,e])=>a.setAttribute(`data-${t}`,e)),a.addEventListener("click",i),a}build(){const t=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default",i=this.getAttribute("theme")||"auto";this.className=[e,`${e}--size-${t}`,`${e}--variant-${s}`,`${e}--theme-${i}`].join(" "),this.audioEl=document.createElement("audio"),this.audioEl.preload="metadata",this.audioEl.hidden=!0;const l=document.createElement("div");l.className=`${e}__loading`;const a=document.createElement("div");a.className=`${e}__spinner`,l.append(a);const n=document.createElement("div");n.className=`${e}__error`;const o=document.createElement("p");o.textContent="오디오를 재생할 수 없습니다.";const r=document.createElement("button");r.type="button",r.textContent="다시 시도",r.addEventListener("click",()=>window.location.reload()),n.append(o,r);const h=document.createElement("div");h.className=`${e}__album-art`,this.albumImgEl=document.createElement("img"),this.albumImgEl.addEventListener("error",()=>{this.albumImgEl&&(this.albumImgEl.style.display="none"),this.albumPlaceholderEl?.classList.remove("album-placeholder")}),this.albumPlaceholderEl=document.createElement("div"),this.albumPlaceholderEl.className="album-placeholder",this.albumPlaceholderEl.textContent="🎵",h.append(this.albumImgEl,this.albumPlaceholderEl);const u=document.createElement("div");u.className=`${e}__main`;const d=document.createElement("div");d.className=`${e}__info`,this.titleEl=document.createElement("div"),this.titleEl.className=`${e}__title`,this.artistEl=document.createElement("div"),this.artistEl.className=`${e}__artist`,this.albumEl=document.createElement("div"),this.albumEl.className=`${e}__album`,d.append(this.titleEl,this.artistEl,this.albumEl),this.progressEl=document.createElement("div"),this.progressEl.className=`${e}__progress`,this.progressBarEl=document.createElement("div"),this.progressBarEl.className=`${e}__progress-bar`,this.progressHandleEl=document.createElement("div"),this.progressHandleEl.className=`${e}__progress-handle`,this.progressEl.append(this.progressBarEl,this.progressHandleEl),this.progressEl.addEventListener("click",t=>{if(!this.audioEl||!this.progressEl)return;const e=this.progressEl.getBoundingClientRect(),s=(t.clientX-e.left)/e.width;this.audioEl.currentTime=s*(this.duration||0)});const c=document.createElement("div");c.className=`${e}__controls`;const m=document.createElement("div");m.className=`${e}__left-controls`;const p=document.createElement("div");p.className=`${e}__center-controls`;const E=document.createElement("div");E.className=`${e}__right-controls`,this.playButtonEl=document.createElement("button"),this.playButtonEl.type="button",this.playButtonEl.className=`${e}__play-button`,this.playButtonEl.addEventListener("click",()=>this.togglePlay()),p.append(this.playButtonEl),c.append(m,p,E);const g=document.createElement("div");g.className=`${e}__bottom-controls`;const b=document.createElement("div");b.className=`${e}__left-bottom`;const y=document.createElement("div");y.className=`${e}__right-bottom`;const v=document.createElement("div");v.className=`${e}__time`,this.timeCurrentEl=document.createElement("span");const f=document.createElement("span");f.textContent="/",this.timeDurationEl=document.createElement("span"),v.append(this.timeCurrentEl,f,this.timeDurationEl),b.append(v);const _=document.createElement("div");_.className=`${e}__volume`;const k=this.iconButton(this.isMuted||0===this.volume?"mute-filled":"volume-up",()=>this.toggleMute());k.title=this.isMuted||0===this.volume?"음소거 해제":"음소거";const C=document.createElement("div");C.className=`${e}__volume-slider`;const I=document.createElement("div");I.className="volume-label";const $=document.createElement("span");$.textContent="🔊";const P=document.createElement("span");I.append($,P),this.volumeInputEl=document.createElement("input"),this.volumeInputEl.type="range",this.volumeInputEl.min="0",this.volumeInputEl.max="1",this.volumeInputEl.step="0.1",this.volumeInputEl.addEventListener("input",()=>{if(!this.audioEl||!this.volumeInputEl)return;const t=parseFloat(this.volumeInputEl.value);this.audioEl.volume=t,this.audioEl.muted=0===t}),C.append(I,this.volumeInputEl),_.append(k,C);const A=document.createElement("div");A.className=`${e}__settings`;const x=this.iconButton("settings",()=>{this.showSettingsMenu=!this.showSettingsMenu,this.updateSettingsMenu()});this.settingsMenuEl=document.createElement("div"),this.settingsMenuEl.className=`${e}__settings-menu`,this.settingsMenuEl.hidden=!0;const M=document.createElement("div");M.className=`${e}__setting-group`;const w=document.createElement("label");w.textContent="재생 속도";const B=document.createElement("select");B.addEventListener("change",()=>this.handlePlaybackRateChange(parseFloat(B.value))),M.append(w,B),this.settingsMenuEl.append(M),A.append(x,this.settingsMenuEl),y.append(_,A),g.append(b,y),u.append(d,this.progressEl,c,g);const N=document.createElement("div");N.className=`${e}__playlist`,N.hidden=!0;const T=document.createElement("h4");T.textContent="플레이리스트",this.playlistTracksEl=document.createElement("div"),this.playlistTracksEl.className=`${e}__playlist-tracks`,N.append(T,this.playlistTracksEl),this.append(this.audioEl,l,n,h,u,N),this._leftControls=m,this._rightControls=E,this._controls=c,this._time=v,this._volumeWrap=_,this._settings=A,this._playlist=N,this._rateSelect=B,this._volumePercent=P,this._muteButton=k}get leftControls(){return this._leftControls}get rightControls(){return this._rightControls}get controlsEl(){return this._controls}get timeEl(){return this._time}get volumeWrap(){return this._volumeWrap}get settingsEl(){return this._settings}get playlistEl(){return this._playlist}get rateSelect(){return this._rateSelect}get volumePercent(){return this._volumePercent}get muteButton(){return this._muteButton}updateTrackInfo(){const t=this.getCurrentTrack();this.titleEl&&(this.titleEl.textContent=t?.title||"Unknown Track"),this.artistEl&&(this.artistEl.textContent=t?.artist||"Unknown Artist"),this.albumEl&&(t?.album?(this.albumEl.textContent=t.album,this.albumEl.hidden=!1):this.albumEl.hidden=!0),this.albumImgEl&&this.albumPlaceholderEl&&(t?.albumArt?(this.albumImgEl.src=t.albumArt,this.albumImgEl.alt=t.title||"Album Art",this.albumImgEl.style.display=""):(this.albumImgEl.removeAttribute("src"),this.albumImgEl.style.display="none"),this.albumPlaceholderEl.className="album-placeholder")}updateProgress(){const t=this.duration>0?this.currentTime/this.duration*100:0;this.progressBarEl&&(this.progressBarEl.style.width=`${t}%`),this.progressHandleEl&&(this.progressHandleEl.style.left=`${t}%`,this.progressHandleEl.style.transform=t<=0?"translate(0, -50%)":t>=100?"translate(-100%, -50%)":"translate(-50%, -50%)")}updateTime(){this.timeCurrentEl&&(this.timeCurrentEl.textContent=this.formatTime(this.currentTime)),this.timeDurationEl&&(this.timeDurationEl.textContent=this.formatTime(this.duration))}updateVolumeUI(){this.volumeInputEl&&(this.volumeInputEl.value=String(this.volume)),this.volumePercent&&(this.volumePercent.textContent=`${Math.round(100*this.volume)}%`),this.muteButton&&(this.muteButton.replaceChildren(t(this.isMuted||0===this.volume?"mute-filled":"volume-up",this.getIconSize())),this.muteButton.title=this.isMuted||0===this.volume?"음소거 해제":"음소거")}updateSettingsMenu(){this.settingsMenuEl&&(this.settingsMenuEl.hidden=!this.showSettingsMenu)}rebuildControlButtons(){const e=this.getPlaylist(),s=1.2*this.getIconSize();this.leftControls.replaceChildren(),this.rightControls.replaceChildren(),e.length>0&&this.leftControls.append(this.iconButton("refresh",()=>this.toggleShuffle(),{data:{shuffle:"true"}})),this.leftControls.append(this.iconButton("chevron-left",()=>{if(e.length>0){const t=this.playlistIndex-1;t>=0&&this.setPlaylistIndex(t)}else this.audioEl&&(this.audioEl.currentTime=0)},{disabled:e.length>0&&0===this.playlistIndex})),this.playButtonEl&&this.playButtonEl.replaceChildren(t(this.isPlaying?"pause":"play",s)),this.rightControls.append(this.iconButton("chevron-right",()=>{if(e.length>0){const t=this.playlistIndex+1;t<e.length&&this.setPlaylistIndex(t)}},{disabled:e.length>0&&this.playlistIndex===e.length-1})),e.length>0&&this.rightControls.append(this.iconButton("repeat",()=>this.toggleRepeatMode(),{data:{repeat:"true"}}))}rebuildPlaylist(){if(!this.playlistTracksEl)return;const t=this.getPlaylist(),s=this.getAttribute("variant")||"default";this.playlistEl.hidden=!("full"===s&&t.length>0),this.playlistTracksEl.replaceChildren(),t.forEach((t,s)=>{const i=document.createElement("div");if(i.className=`${e}__playlist-track${s===this.playlistIndex?` ${e}__playlist-track--active`:""}`,i.addEventListener("click",()=>this.setPlaylistIndex(s)),t.albumArt){const e=document.createElement("img");e.src=t.albumArt,e.alt=t.title||"Album Art",i.append(e)}const l=document.createElement("div");l.className=`${e}__playlist-track-info`;const a=document.createElement("div");a.className=`${e}__playlist-track-title`,a.textContent=t.title||"Unknown Track";const n=document.createElement("div");n.className=`${e}__playlist-track-artist`,n.textContent=t.artist||"Unknown Artist",l.append(a,n),i.append(l),this.playlistTracksEl?.append(i)})}updatePlaylistActive(){this.playlistTracksEl&&Array.from(this.playlistTracksEl.children).forEach((t,s)=>{t.classList.toggle(`${e}__playlist-track--active`,s===this.playlistIndex)})}updateUI(){const t=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default",i=this.getAttribute("theme")||"auto",l=this.getBool("show-controls",!0),a=this.getBool("show-progress",!0),n=this.getBool("show-time",!0),o=this.getBool("show-volume",!0),r=this.getBool("show-settings",!1);this.className=[e,`${e}--size-${t}`,`${e}--variant-${s}`,`${e}--theme-${i}`,this.isPlaying&&`${e}--playing`,!this.isPlaying&&`${e}--paused`,this.isMuted&&`${e}--muted`,this.isLoading&&`${e}--loading`,this.error&&`${e}--error`,this.isShuffle&&`${e}--shuffle`,`${e}--repeat-${this.currentRepeatMode}`].filter(Boolean).join(" "),this.audioEl&&(this.audioEl.autoplay=this.getBool("auto-play"),this.audioEl.loop=this.getBool("loop"),this.audioEl.muted=this.getBool("muted"),this.audioEl.playbackRate=this.playbackRate),this.progressEl&&(this.progressEl.hidden=!a),this.controlsEl&&(this.controlsEl.hidden=!l),this.timeEl&&(this.timeEl.hidden=!n),this.volumeWrap&&(this.volumeWrap.hidden=!o),this.settingsEl&&(this.settingsEl.hidden=!r),this.rateSelect.replaceChildren(...this.getPlaybackRates().map(t=>{const e=document.createElement("option");return e.value=String(t),e.textContent=`${t}x`,t===this.playbackRate&&(e.selected=!0),e})),this.rebuildControlButtons(),this.updateTrackInfo(),this.updateProgress(),this.updateTime(),this.updateVolumeUI(),this.updateSettingsMenu(),this.rebuildPlaylist()}}customElements.get("db-audio-player")||customElements.define("db-audio-player",DbAudioPlayer);export{DbAudioPlayer};
@@ -0,0 +1,18 @@
1
+ declare class DbAvatar extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ private imageFailed;
4
+ private imageLoaded;
5
+ connectedCallback(): void;
6
+ disconnectedCallback(): void;
7
+ attributeChangedCallback(name: string): void;
8
+ private handleClick;
9
+ private handleKeyDown;
10
+ private render;
11
+ }
12
+ declare global {
13
+ interface HTMLElementTagNameMap {
14
+ 'db-avatar': DbAvatar;
15
+ }
16
+ }
17
+
18
+ export { DbAvatar };
@@ -0,0 +1 @@
1
+ import{createDbIcon as t}from"./db-icons.js";const e=["xs","s","m","l","xl","2xl"],a=["default","primary","success","warning","danger","info"],s=["online","offline","away","busy"],i=["#E3F2FD","#F3E5F5","#E8F5E8","#FFF3E0","#FCE4EC","#E0F2F1","#FFF8E1","#F1F8E9","#E8EAF6","#FFEBEE"],n=["#1976D2","#7B1FA2","#388E3C","#F57C00","#C2185B","#00796B","#F9A825","#689F38","#3F51B5","#D32F2F"];class DbAvatar extends HTMLElement{constructor(){super(...arguments),this.imageFailed=!1,this.imageLoaded=!1,this.handleClick=()=>{!this.hasAttribute("disabled")&&this.hasAttribute("clickable")&&this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))},this.handleKeyDown=t=>{this.hasAttribute("clickable")&&!this.hasAttribute("disabled")&&("Enter"!==t.key&&" "!==t.key||(t.preventDefault(),this.handleClick()))}}static get observedAttributes(){return["src","alt","initials","size","variant","status","disabled","clickable","badge","badge-max-count","badge-variant","badge-style","badge-text"]}connectedCallback(){this.render(),this.addEventListener("click",this.handleClick),this.addEventListener("keydown",this.handleKeyDown)}disconnectedCallback(){this.removeEventListener("click",this.handleClick),this.removeEventListener("keydown",this.handleKeyDown)}attributeChangedCallback(t){"src"===t&&(this.imageFailed=!1,this.imageLoaded=!1),this.render()}render(){const r=e.includes(this.getAttribute("size")||"m")&&this.getAttribute("size")||"m",d=a.includes(this.getAttribute("variant")||"default")&&this.getAttribute("variant")||"default",l=this.hasAttribute("disabled"),c=this.hasAttribute("clickable"),o=this.getAttribute("src"),b=this.getAttribute("initials")||"",h=Boolean(o&&!this.imageFailed),u=h&&!this.imageLoaded;if(this.className=["designbase-wc-avatar",`designbase-wc-avatar--${r}`,`designbase-wc-avatar--${d}`,c&&"designbase-wc-avatar--clickable",l&&"designbase-wc-avatar--disabled",u&&"designbase-wc-avatar--loading"].filter(Boolean).join(" "),c&&!l?(this.setAttribute("role","button"),this.tabIndex=0):(this.removeAttribute("role"),this.removeAttribute("tabindex")),this.toggleAttribute("aria-disabled",l),this.replaceChildren(),u){const t=document.createElement("div");t.className="designbase-wc-avatar__loading";const e=document.createElement("div");e.className="designbase-wc-avatar__skeleton",t.append(e),this.append(t)}if(h){const t=document.createElement("img");t.className="designbase-wc-avatar__image",t.src=o,t.alt=this.getAttribute("alt")||"아바타 이미지",t.loading="lazy",t.addEventListener("load",()=>{this.imageLoaded=!0,this.classList.remove("designbase-wc-avatar--loading"),this.querySelector(".designbase-wc-avatar__loading")?.remove()}),t.addEventListener("error",()=>{this.imageFailed=!0,this.imageLoaded=!1,this.render()}),this.append(t)}else if(b){const t=document.createElement("div");if(t.className="designbase-wc-avatar__initials","default"===d){const e=function initialsColor(t){let e=0;for(let a=0;a<t.length;a++)e=t.charCodeAt(a)+((e<<5)-e);const a=Math.abs(e)%i.length;return{backgroundColor:i[a],color:n[a]}}(b);t.style.backgroundColor=e.backgroundColor,t.style.color=e.color}t.textContent=b.charAt(0).toUpperCase(),this.append(t)}else{const e=document.createElement("div");e.className="designbase-wc-avatar__icon",e.append(t("user",function iconSize(t){return"xs"===t?12:"s"===t?16:"m"===t?20:"l"===t?24:"xl"===t?32:40}(r))),this.append(e)}const g=this.getAttribute("status")||"";if(s.includes(g)){const t=document.createElement("span");t.className=`designbase-wc-avatar__status designbase-wc-avatar__status--${g}`,this.append(t)}if(this.hasAttribute("badge")){const t=document.createElement("div");t.className="designbase-wc-avatar__badge";const e=document.createElement("db-badge");e.setAttribute("count",this.getAttribute("badge")||"0");const a=this.getAttribute("badge-style")||"number";e.setAttribute("badge-style",a),this.hasAttribute("badge-max-count")&&e.setAttribute("max-count",this.getAttribute("badge-max-count")),e.setAttribute("variant",this.getAttribute("badge-variant")||"danger"),this.hasAttribute("badge-text")&&(e.textContent=this.getAttribute("badge-text"));const s="xl"===r||"2xl"===r?"m":"s";e.setAttribute("size",s),t.append(e),this.append(t)}}}customElements.get("db-avatar")||customElements.define("db-avatar",DbAvatar);export{DbAvatar};
@@ -0,0 +1,24 @@
1
+ declare class DbBackdrop extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ private portal?;
4
+ private keyHandler;
5
+ get open(): boolean;
6
+ set open(value: boolean);
7
+ connectedCallback(): void;
8
+ disconnectedCallback(): void;
9
+ attributeChangedCallback(): void;
10
+ private isOpen;
11
+ private syncOpenState;
12
+ private collectChildren;
13
+ private attachListeners;
14
+ private detachListeners;
15
+ private handlePortalClick;
16
+ private render;
17
+ }
18
+ declare global {
19
+ interface HTMLElementTagNameMap {
20
+ 'db-backdrop': DbBackdrop;
21
+ }
22
+ }
23
+
24
+ export { DbBackdrop };
@@ -0,0 +1 @@
1
+ const t=["fade","slide","zoom","none"];class DbBackdrop extends HTMLElement{constructor(){super(...arguments),this.keyHandler=null,this.handlePortalClick=t=>{t.target===this.portal&&"true"!==this.getAttribute("disable-backdrop-click")&&(this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0})))}}static get observedAttributes(){return["open","blur","opacity","blur-amount","animation","animation-duration","z-index","background-color","disable-backdrop-click","disable-escape-key-down"]}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}connectedCallback(){this.style.display="contents",this.syncOpenState()}disconnectedCallback(){this.detachListeners(),this.portal?.remove(),this.portal=void 0,document.body.style.overflow=""}attributeChangedCallback(){this.isConnected&&this.syncOpenState()}isOpen(){return this.open}syncOpenState(){this.isOpen()?this.render():(document.body.style.overflow="",this.detachListeners(),this.portal?.remove())}collectChildren(){return Array.from(this.children).filter(t=>!t.hasAttribute("data-wc-internal"))}attachListeners(){this.keyHandler||(this.keyHandler=t=>{"Escape"===t.key&&"true"!==this.getAttribute("disable-escape-key-down")&&(this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0})),this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0})))},document.addEventListener("keydown",this.keyHandler))}detachListeners(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}render(){if(!this.isOpen())return void this.syncOpenState();const e=this.hasAttribute("blur"),s=this.getAttribute("opacity")||"0.5",i=this.getAttribute("blur-amount")||"4",r=t.includes(this.getAttribute("animation")||"fade")&&this.getAttribute("animation")||"fade",o=this.getAttribute("animation-duration")||"300",n=this.getAttribute("z-index")||"1000",a=this.getAttribute("background-color"),d=this.collectChildren();document.body.style.overflow="hidden",this.attachListeners(),this.portal||(this.portal=document.createElement("div"),this.portal.setAttribute("data-wc-internal",""),this.portal.addEventListener("click",this.handlePortalClick)),this.portal.className=["designbase-wc-backdrop",`designbase-wc-backdrop--${r}`,"designbase-wc-backdrop--open",e?"designbase-wc-backdrop--blur":""].filter(Boolean).join(" "),this.portal.setAttribute("role","presentation"),this.portal.setAttribute("aria-hidden","false"),this.portal.style.setProperty("--backdrop-opacity",s),this.portal.style.setProperty("--backdrop-blur-amount",`${i}px`),this.portal.style.setProperty("--backdrop-animation-duration",`${o}ms`),this.portal.style.setProperty("--backdrop-z-index",n),a?this.portal.style.backgroundColor=a:this.portal.style.removeProperty("background-color"),this.portal.replaceChildren(...d),this.portal.isConnected||document.body.append(this.portal)}}customElements.get("db-backdrop")||customElements.define("db-backdrop",DbBackdrop);export{DbBackdrop};
@@ -0,0 +1,27 @@
1
+ declare class DbBadge extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ get variant(): string;
4
+ set variant(value: string);
5
+ get size(): string;
6
+ set size(value: string);
7
+ get badgeStyle(): string;
8
+ set badgeStyle(value: string);
9
+ get count(): number | undefined;
10
+ set count(value: number | undefined);
11
+ get maxCount(): number;
12
+ set maxCount(value: number);
13
+ get disabled(): boolean;
14
+ set disabled(value: boolean);
15
+ connectedCallback(): void;
16
+ attributeChangedCallback(name: string, _oldValue: string | null, _newValue: string | null): void;
17
+ private syncAttributes;
18
+ private syncContent;
19
+ private syncEnum;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ 'db-badge': DbBadge;
24
+ }
25
+ }
26
+
27
+ export { DbBadge };
@@ -0,0 +1 @@
1
+ const t="designbase-wc-badge",e=["primary","secondary","info","success","warning","danger"],s=["s","m","l"],i=["dot","number","text","outlined"];class DbBadge extends HTMLElement{static get observedAttributes(){return["variant","size","badge-style","count","max-count","disabled"]}get variant(){return this.getAttribute("variant")||"primary"}set variant(t){this.setAttribute("variant",t)}get size(){return this.getAttribute("size")||"m"}set size(t){this.setAttribute("size",t)}get badgeStyle(){return this.getAttribute("badge-style")||"text"}set badgeStyle(t){this.setAttribute("badge-style",t)}get count(){const t=this.getAttribute("count");return null===t?void 0:Number(t)}set count(t){void 0===t?this.removeAttribute("count"):this.setAttribute("count",String(t))}get maxCount(){return Number(this.getAttribute("max-count")||99)}set maxCount(t){this.setAttribute("max-count",String(t))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",t)}connectedCallback(){this.syncAttributes()}attributeChangedCallback(t,e,s){"count"!==t&&"max-count"!==t&&"badge-style"!==t||this.syncContent(),this.syncAttributes()}syncAttributes(){this.classList.add(t),this.setAttribute("aria-disabled",String(this.disabled)),this.syncEnum("variant",this.variant,e),this.syncEnum("size",this.size,s),this.syncEnum("style",this.badgeStyle,i),this.classList.toggle(`${t}--disabled`,this.disabled),this.syncContent()}syncContent(){"number"!==this.badgeStyle||void 0===this.count?"dot"===this.badgeStyle&&(this.textContent=""):this.textContent=this.count>this.maxCount?`${this.maxCount}+`:String(this.count)}syncEnum(e,s,i){i.forEach(e=>this.classList.remove(`${t}--${e}`)),i.includes(s)?this.classList.add(`${t}--${s}`):"style"===e&&this.classList.add(`${t}--text`)}}customElements.get("db-badge")||customElements.define("db-badge",DbBadge);export{DbBadge};
@@ -0,0 +1,28 @@
1
+ interface DbBannerAction {
2
+ text: string;
3
+ href?: string;
4
+ variant?: 'primary' | 'secondary' | 'outline' | 'ghost';
5
+ size?: 's' | 'm' | 'l' | 'sm' | 'md' | 'lg';
6
+ external?: boolean;
7
+ icon?: string;
8
+ iconOnly?: boolean;
9
+ }
10
+ declare class DbBanner extends HTMLElement {
11
+ static get observedAttributes(): string[];
12
+ connectedCallback(): void;
13
+ attributeChangedCallback(): void;
14
+ private parseActions;
15
+ private getIconSize;
16
+ private getActionIconSize;
17
+ private resolveIconName;
18
+ private createActionControl;
19
+ private render;
20
+ }
21
+ declare global {
22
+ interface HTMLElementTagNameMap {
23
+ 'db-banner': DbBanner;
24
+ }
25
+ }
26
+
27
+ export { DbBanner };
28
+ export type { DbBannerAction };
@@ -0,0 +1 @@
1
+ import{createDbIcon as e}from"./db-icons.js";const t={primary:"primary",secondary:"secondary",outline:"tertiary",ghost:"ghost"},n={s:"s",sm:"s",m:"m",md:"m",l:"l",lg:"l"};class DbBanner extends HTMLElement{static get observedAttributes(){return["title","description","icon","image","image-alt","actions","size","variant","background-image"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}parseActions(){const e=this.getAttribute("actions");if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}getIconSize(e){return"s"===e?16:"l"===e?24:20}getActionIconSize(e){return"s"===e?16:"l"===e?20:18}resolveIconName(e){if(e)return e in{close:1,"info-filled":1}?e:void 0}createActionControl(t,n,a,s){const i=this.resolveIconName(t.icon),r=Boolean(t.iconOnly&&i);if(t.href){const n=document.createElement("a");return n.className=`designbase-wc-button designbase-wc-button--${a} designbase-wc-button--${s}`,r&&n.classList.add("designbase-wc-button--icon-only"),n.href=t.href,n.setAttribute("aria-label",t.text),r&&i?n.append(e(i,this.getActionIconSize(s))):n.textContent=t.text,t.external&&(n.target="_blank",n.rel="noopener noreferrer"),n}const c=document.createElement("db-button");return c.setAttribute("variant",a),c.setAttribute("size",s),r?(c.setAttribute("icon-only",""),c.setAttribute("aria-label",t.text),i&&c.append(e(i,this.getActionIconSize(s)))):c.textContent=t.text,(e=>{e.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0,detail:{index:n,action:t}}))})})(c),c}render(){const a=this.getAttribute("title")||"",s=this.getAttribute("description")||"",i=this.getAttribute("icon"),r=this.getAttribute("image"),c=this.getAttribute("image-alt")||a||"Banner image",o=this.getAttribute("size")||"m",d=this.getAttribute("variant")||"primary",b=this.getAttribute("background-image"),l=this.parseActions();if(this.className=`designbase-wc-banner designbase-wc-banner--${o} designbase-wc-banner--${d}`,this.replaceChildren(),"image"===d&&b){const e=document.createElement("div");e.className="designbase-wc-banner__background",e.style.backgroundImage=`url(${b})`,e.style.backgroundSize="cover",e.style.backgroundPosition="center",e.style.backgroundRepeat="no-repeat",this.append(e);const t=document.createElement("div");t.className="designbase-wc-banner__overlay",this.append(t)}const m=document.createElement("div");if(m.className="designbase-wc-banner__container",i){const t=document.createElement("div");t.className="designbase-wc-banner__icon",t.append(e(i,this.getIconSize(o))),m.append(t)}if(r){const e=document.createElement("div");e.className="designbase-wc-banner__image";const t=document.createElement("img");t.src=r,t.alt=c,e.append(t),m.append(e)}const g=document.createElement("div");if(g.className="designbase-wc-banner__content",a){const e=document.createElement("h3");e.className="designbase-wc-banner__title",e.textContent=a,g.append(e)}if(s){const e=document.createElement("p");e.className="designbase-wc-banner__description",e.textContent=s,g.append(e)}if(m.append(g),l.length>0){const e=document.createElement("div");e.className="designbase-wc-banner__actions",l.forEach((a,s)=>{const i=t[a.variant||"primary"]||"primary",r=n[a.size||"sm"]||"s";e.append(this.createActionControl(a,s,i,r))}),m.append(e)}this.append(m)}}customElements.get("db-banner")||customElements.define("db-banner",DbBanner);export{DbBanner};
@@ -0,0 +1,29 @@
1
+ interface DbBottomNavigationItem {
2
+ id: string;
3
+ icon: string;
4
+ activeIcon?: string;
5
+ label: string;
6
+ isActive?: boolean;
7
+ disabled?: boolean;
8
+ badge?: string | number;
9
+ badgeColor?: 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'info';
10
+ }
11
+ declare class DbBottomNavigation extends HTMLElement {
12
+ static get observedAttributes(): string[];
13
+ connectedCallback(): void;
14
+ attributeChangedCallback(): void;
15
+ get items(): DbBottomNavigationItem[];
16
+ set items(value: DbBottomNavigationItem[] | string);
17
+ private parseItems;
18
+ private iconSize;
19
+ private syncHostClasses;
20
+ private render;
21
+ }
22
+ declare global {
23
+ interface HTMLElementTagNameMap {
24
+ 'db-bottom-navigation': DbBottomNavigation;
25
+ }
26
+ }
27
+
28
+ export { DbBottomNavigation };
29
+ export type { DbBottomNavigationItem };
@@ -0,0 +1 @@
1
+ import{createDbIcon as t}from"./db-icons.js";const e=["s","m","l"],i=["default","glass","transparent"];class DbBottomNavigation extends HTMLElement{static get observedAttributes(){return["items","active-item-id","size","background-color","fixed"]}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}get items(){return this.parseItems()}set items(t){this.setAttribute("items","string"==typeof t?t:JSON.stringify(t))}parseItems(){try{const t=JSON.parse(this.getAttribute("items")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}iconSize(t){return"s"===t?20:"l"===t?28:24}syncHostClasses(){const t=this.getAttribute("size")||"m",a=e.includes(t)?t:"m",n=this.getAttribute("background-color")||"default",s=i.includes(n)?n:"default";this.className=["designbase-wc-bottom-navigation",`designbase-wc-bottom-navigation--${a}`,`designbase-wc-bottom-navigation--${s}`,"false"!==this.getAttribute("fixed")&&"designbase-wc-bottom-navigation--fixed"].filter(Boolean).join(" ")}render(){this.syncHostClasses(),this.setAttribute("role","navigation"),this.setAttribute("aria-label","하단 네비게이션");const e=this.parseItems(),i=this.getAttribute("active-item-id")||"",a=this.getAttribute("size")||"m",n=this.iconSize(a);let s=this.querySelector(".designbase-wc-bottom-navigation__container");s?s.replaceChildren():(s=document.createElement("div"),s.className="designbase-wc-bottom-navigation__container",this.replaceChildren(s)),e.forEach(e=>{const a=i===e.id||Boolean(e.isActive),o=function resolveIcon(t){if(t)return t}(a&&e.activeIcon?e.activeIcon:e.icon),r=document.createElement("button");r.type="button",r.className=["designbase-wc-bottom-navigation__item",a&&"designbase-wc-bottom-navigation__item--active",e.disabled&&"designbase-wc-bottom-navigation__item--disabled"].filter(Boolean).join(" "),r.disabled=Boolean(e.disabled),r.setAttribute("aria-label",e.label),a&&r.setAttribute("aria-current","page");const c=document.createElement("div");c.className="designbase-wc-bottom-navigation__item-content";const d=document.createElement("div");if(d.className="designbase-wc-bottom-navigation__icon-wrapper",o){const e=t(o,n);e.classList.add("designbase-wc-bottom-navigation__icon"),d.append(e)}if(void 0!==e.badge&&""!==e.badge){const t=document.createElement("db-badge");t.className="designbase-wc-bottom-navigation__badge",t.setAttribute("size","s"),t.setAttribute("variant",function mapBadgeVariant(t){return"error"===t?"danger":"warning"===t?"warning":"success"===t?"success":"info"===t?"info":"primary"===t?"primary":"secondary"}(e.badgeColor)),t.setAttribute("badge-style","number"),t.setAttribute("count",String(e.badge)),d.append(t)}const b=document.createElement("span");b.className="designbase-wc-bottom-navigation__label",b.textContent=e.label,c.append(d,b),r.append(c),r.addEventListener("click",()=>{e.disabled||this.dispatchEvent(new CustomEvent("db-item-click",{bubbles:!0,composed:!0,detail:{item:e}}))}),s.append(r)})}}customElements.get("db-bottom-navigation")||customElements.define("db-bottom-navigation",DbBottomNavigation);export{DbBottomNavigation};
@@ -0,0 +1,49 @@
1
+ declare class DbBottomSheet extends HTMLElement {
2
+ static get observedAttributes(): string[];
3
+ private root?;
4
+ private backdrop?;
5
+ private sheet?;
6
+ private grabBar?;
7
+ private contentEl?;
8
+ private sheetHeightPercent;
9
+ private isDragging;
10
+ private isVisible;
11
+ private isMounted;
12
+ private enterFrame?;
13
+ private exitTimer?;
14
+ private keyHandler;
15
+ private childObserver?;
16
+ private dragState;
17
+ get open(): boolean;
18
+ set open(value: boolean);
19
+ private shouldMountPortal;
20
+ connectedCallback(): void;
21
+ disconnectedCallback(): void;
22
+ attributeChangedCallback(name: string): void;
23
+ private isOpenRequested;
24
+ private clearTimers;
25
+ /** 닫힌 transform이 페인트된 뒤 --open을 붙여 슬라이드 업 전환이 보이게 함 */
26
+ private scheduleEnterAnimation;
27
+ private getMaxHeightLimit;
28
+ private close;
29
+ private attachEscape;
30
+ private detachEscape;
31
+ private collectSlotted;
32
+ private collectContentNodes;
33
+ private finishDrag;
34
+ private handlePointerDown;
35
+ private handlePointerMove;
36
+ private handlePointerUp;
37
+ private syncOpenState;
38
+ private syncActiveClasses;
39
+ private applySheetDimensions;
40
+ private detachContentToHost;
41
+ private render;
42
+ }
43
+ declare global {
44
+ interface HTMLElementTagNameMap {
45
+ 'db-bottom-sheet': DbBottomSheet;
46
+ }
47
+ }
48
+
49
+ export { DbBottomSheet };
@@ -0,0 +1 @@
1
+ import{createDbIcon as t}from"./db-icons.js";const e={s:40,m:60,l:80,full:100},s=["default","persistent","temporary","fullscreen"],i=["slide","fade","scale","none"];function resolveHeightPercent(t){if(!t)return e.m;const s=e[t];if(s)return Math.min(100,Math.max(20,s));const i=Number(t);return Number.isFinite(i)?Math.min(100,Math.max(20,i)):e.m}class DbBottomSheet extends HTMLElement{constructor(){super(...arguments),this.sheetHeightPercent=e.m,this.isDragging=!1,this.isVisible=!1,this.isMounted=!1,this.keyHandler=null,this.dragState={active:!1,pointerId:-1,startY:0,startHeight:e.m,lastY:0,lastTime:0},this.handlePointerDown=t=>{"true"!==this.getAttribute("disable-drag")&&0===t.button&&(t.preventDefault(),t.currentTarget.setPointerCapture(t.pointerId),this.dragState={active:!0,pointerId:t.pointerId,startY:t.clientY,startHeight:this.sheetHeightPercent,lastY:t.clientY,lastTime:Date.now()},this.isDragging=!0,this.syncActiveClasses())},this.handlePointerMove=t=>{const e=this.dragState;if(!e.active||t.pointerId!==e.pointerId)return;t.preventDefault(),e.lastY=t.clientY,e.lastTime=Date.now();const s=window.innerHeight||1,i=(e.startY-t.clientY)/s*100,r=this.getMaxHeightLimit(resolveHeightPercent(this.getAttribute("height")));this.sheetHeightPercent=Math.min(r,Math.max(20,e.startHeight+i)),this.applySheetDimensions()},this.handlePointerUp=t=>{const e=this.dragState;if(!e.active||t.pointerId!==e.pointerId)return;const s=t.currentTarget;s.hasPointerCapture(t.pointerId)&&s.releasePointerCapture(t.pointerId),this.finishDrag()}}static get observedAttributes(){return["open","title","subtitle","height","max-height","variant","disable-backdrop-click","disable-escape-key-down","disable-drag","show-close-button","animation","animation-duration","z-index","show-backdrop","backdrop-blur","backdrop-opacity","sticky-header","sticky-footer"]}get open(){return this.hasAttribute("open")&&"false"!==this.getAttribute("open")}set open(t){t?this.setAttribute("open",""):this.removeAttribute("open")}shouldMountPortal(){return this.isOpenRequested()||this.isMounted}connectedCallback(){this.style.display="contents",this.childObserver=new MutationObserver(()=>{this.isOpenRequested()&&this.render()}),this.childObserver.observe(this,{childList:!0}),this.syncOpenState()}disconnectedCallback(){this.childObserver?.disconnect(),this.childObserver=void 0,this.clearTimers(),this.detachEscape(),this.root?.remove(),this.root=void 0,document.body.style.overflow=""}attributeChangedCallback(t){this.isConnected&&("open"!==t?("height"===t&&this.isOpenRequested()&&(this.sheetHeightPercent=resolveHeightPercent(this.getAttribute("height"))),this.shouldMountPortal()&&(this.render(),this.isMounted&&this.syncActiveClasses())):this.syncOpenState())}isOpenRequested(){return this.open}clearTimers(){this.enterFrame&&(cancelAnimationFrame(this.enterFrame),this.enterFrame=void 0),this.exitTimer&&(clearTimeout(this.exitTimer),this.exitTimer=void 0)}scheduleEnterAnimation(){this.enterFrame&&cancelAnimationFrame(this.enterFrame),this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=requestAnimationFrame(()=>{this.enterFrame=void 0,this.isOpenRequested()&&this.sheet&&(this.sheet.offsetHeight,this.isVisible=!0,this.syncActiveClasses())})})}getMaxHeightLimit(t){const e=Number(this.getAttribute("max-height")||0),s=t>=100;return Math.min(100,Math.max(t,e||(s?100:90)))}close(){this.open=!1,this.dispatchEvent(new CustomEvent("db-close",{bubbles:!0,composed:!0}))}attachEscape(){this.keyHandler||(this.keyHandler=t=>{"Escape"===t.key&&"true"!==this.getAttribute("disable-escape-key-down")&&this.close()},document.addEventListener("keydown",this.keyHandler))}detachEscape(){this.keyHandler&&(document.removeEventListener("keydown",this.keyHandler),this.keyHandler=null)}collectSlotted(t){const e=Array.from(this.querySelectorAll(`:scope > [slot="${t}"]`));if(e.length)return e;if("header"===t){const t=this.sheet?.querySelector(".designbase-wc-bottom-sheet__header-main");return t?Array.from(t.children):[]}if("footer"===t){const t=this.sheet?.querySelector(".designbase-wc-bottom-sheet__footer");return t?Array.from(t.children):[]}return[]}collectContentNodes(){const t=Array.from(this.children).filter(t=>{const e=t.getAttribute("slot");return!e||"default"===e});return t.length?t:this.contentEl?Array.from(this.contentEl.children):[]}finishDrag(){const t=this.dragState;if(!t.active)return;t.active=!1,this.isDragging=!1;const e=t.lastY-t.startY,s=e/Math.max(1,Date.now()-t.lastTime),i=window.innerHeight||1,r=(t.startY-t.lastY)/i*100,n=this.getMaxHeightLimit(resolveHeightPercent(this.getAttribute("height"))),o=Math.min(n,Math.max(20,t.startHeight+r));o<=22||e>72||s>.6?this.close():(this.sheetHeightPercent=o,this.applySheetDimensions(),this.syncActiveClasses())}syncOpenState(){const t=this.isOpenRequested(),e=Number(this.getAttribute("animation-duration")||400);if(this.clearTimers(),t)return this.sheetHeightPercent=resolveHeightPercent(this.getAttribute("height")),this.render(),this.isMounted=!0,this.isVisible=!1,this.syncActiveClasses(),this.root&&!this.root.isConnected&&document.body.append(this.root),this.scheduleEnterAnimation(),document.body.style.overflow="hidden",void this.attachEscape();this.isVisible=!1,this.syncActiveClasses(),this.exitTimer=setTimeout(()=>{this.exitTimer=void 0,this.detachContentToHost(),this.isMounted=!1,this.syncActiveClasses(),this.root?.remove(),document.body.style.overflow="",this.detachEscape()},e),this.detachEscape()}syncActiveClasses(){if(!this.sheet)return;const t=resolveHeightPercent(this.getAttribute("height")),e=this.getAttribute("variant")||"default",r=this.getAttribute("animation")||"slide",n=s.includes(e)?e:"default",o=i.includes(r)?r:"slide",a="false"!==this.getAttribute("show-backdrop"),h=this.hasAttribute("sticky-header"),c=this.hasAttribute("sticky-footer");this.sheet.className=["designbase-wc-bottom-sheet",`designbase-wc-bottom-sheet--${n}`,`designbase-wc-bottom-sheet--${o}`,this.isMounted&&this.isVisible&&"designbase-wc-bottom-sheet--open",this.isDragging&&"designbase-wc-bottom-sheet--dragging",h&&"designbase-wc-bottom-sheet--sticky-header",c&&"designbase-wc-bottom-sheet--sticky-footer",!a&&"designbase-wc-bottom-sheet--no-backdrop",(t>=100||this.sheetHeightPercent>=100)&&"designbase-wc-bottom-sheet--full"].filter(Boolean).join(" "),this.backdrop?.classList.toggle("designbase-wc-backdrop--open",this.isMounted&&this.isVisible)}applySheetDimensions(){if(!this.sheet)return;const t=this.getMaxHeightLimit(resolveHeightPercent(this.getAttribute("height")));this.sheet.style.height=`${this.sheetHeightPercent}vh`,this.sheet.style.maxHeight=`${t}vh`}detachContentToHost(){this.contentEl&&Array.from(this.contentEl.children).forEach(t=>this.append(t));const t=this.sheet?.querySelector(".designbase-wc-bottom-sheet__header-main");t&&Array.from(t.children).forEach(t=>{"bottom-sheet-title"!==t.id&&"bottom-sheet-subtitle"!==t.id&&this.append(t)});const e=this.sheet?.querySelector(".designbase-wc-bottom-sheet__footer");e&&Array.from(e.children).forEach(t=>this.append(t))}render(){if(!this.shouldMountPortal())return;const e=this.getAttribute("title"),s=this.getAttribute("subtitle"),i="false"!==this.getAttribute("show-close-button"),r="false"!==this.getAttribute("show-backdrop"),n=this.hasAttribute("backdrop-blur"),o=this.getAttribute("backdrop-opacity")||"0.5",a=this.getAttribute("animation-duration")||"400",h=this.getAttribute("z-index")||"1000",c=this.hasAttribute("sticky-header"),d=this.hasAttribute("sticky-footer"),l=this.collectSlotted("header"),b=this.collectSlotted("footer"),m=this.collectContentNodes();if(this.root||(this.root=document.createElement("div"),this.root.setAttribute("data-wc-internal",""),this.backdrop=document.createElement("div"),this.backdrop.className="designbase-wc-backdrop designbase-wc-backdrop--bottom-sheet",this.backdrop.setAttribute("role","presentation"),this.backdrop.addEventListener("click",t=>{t.target===this.backdrop&&"true"!==this.getAttribute("disable-backdrop-click")&&this.close()}),this.sheet=document.createElement("div"),this.sheet.setAttribute("role","dialog"),this.sheet.setAttribute("aria-modal","true"),this.grabBar=document.createElement("div"),this.grabBar.className="designbase-wc-bottom-sheet__grab-bar",this.grabBar.addEventListener("pointerdown",this.handlePointerDown),this.grabBar.addEventListener("pointermove",this.handlePointerMove),this.grabBar.addEventListener("pointerup",this.handlePointerUp),this.grabBar.addEventListener("pointercancel",this.handlePointerUp),this.contentEl=document.createElement("div"),this.contentEl.className="designbase-wc-bottom-sheet__content"),this.root.replaceChildren(),r&&this.backdrop&&(this.backdrop.className=["designbase-wc-backdrop","designbase-wc-backdrop--bottom-sheet",n&&"designbase-wc-backdrop--blur"].filter(Boolean).join(" "),this.backdrop.style.setProperty("--backdrop-opacity",o),this.backdrop.style.setProperty("--bottom-sheet-animation-duration",`${a}ms`),this.backdrop.style.zIndex=h,this.backdrop.setAttribute("aria-hidden",String(!this.isOpenRequested())),this.root.append(this.backdrop)),!this.sheet||!this.grabBar||!this.contentEl)return;this.sheet.style.zIndex=String(Number(h)+1),this.sheet.style.setProperty("--bottom-sheet-animation-duration",`${a}ms`),this.applySheetDimensions(),e?this.sheet.setAttribute("aria-labelledby","bottom-sheet-title"):this.sheet.removeAttribute("aria-labelledby"),s?this.sheet.setAttribute("aria-describedby","bottom-sheet-subtitle"):this.sheet.removeAttribute("aria-describedby"),this.sheet.replaceChildren();const u="true"===this.getAttribute("disable-drag");if(this.grabBar.className=["designbase-wc-bottom-sheet__grab-bar",!u&&"designbase-wc-bottom-sheet__grab-bar--draggable"].filter(Boolean).join(" "),this.grabBar.replaceChildren(),!u){const t=document.createElement("div");t.className="designbase-wc-bottom-sheet__handle",t.setAttribute("aria-hidden","true"),this.grabBar.append(t)}this.sheet.append(this.grabBar);if(Boolean(e||s||l.length||i)){const r=document.createElement("div");r.className=["designbase-wc-bottom-sheet__header",c&&"designbase-wc-bottom-sheet__header--sticky"].filter(Boolean).join(" ");const n=document.createElement("div");if(n.className="designbase-wc-bottom-sheet__header-main",l.length)l.forEach(t=>n.append(t));else{if(e){const t=document.createElement("h2");t.id="bottom-sheet-title",t.className="designbase-wc-bottom-sheet__title",t.textContent=e,n.append(t)}if(s){const t=document.createElement("p");t.id="bottom-sheet-subtitle",t.className="designbase-wc-bottom-sheet__subtitle",t.textContent=s,n.append(t)}}if(r.append(n),i){const e=document.createElement("button");e.type="button",e.className="designbase-wc-bottom-sheet__close-button",e.setAttribute("aria-label","닫기"),e.append(t("close",20)),e.addEventListener("click",()=>this.close()),r.append(e)}this.sheet.append(r)}if(this.contentEl.replaceChildren(...m),this.sheet.append(this.contentEl),b.length){const t=document.createElement("div");t.className=["designbase-wc-bottom-sheet__footer",d&&"designbase-wc-bottom-sheet__footer--sticky"].filter(Boolean).join(" "),b.forEach(e=>t.append(e)),this.sheet.append(t)}this.root.append(this.sheet),this.isMounted&&!this.root.isConnected&&document.body.append(this.root),this.syncActiveClasses()}}customElements.get("db-bottom-sheet")||customElements.define("db-bottom-sheet",DbBottomSheet);export{DbBottomSheet};
@@ -0,0 +1,24 @@
1
+ interface BreadcrumbItem {
2
+ id?: string;
3
+ label: string;
4
+ href?: string;
5
+ active?: boolean;
6
+ disabled?: boolean;
7
+ icon?: string;
8
+ }
9
+ declare class DbBreadcrumbs extends HTMLElement {
10
+ static get observedAttributes(): string[];
11
+ get items(): BreadcrumbItem[] | string;
12
+ set items(value: BreadcrumbItem[] | string);
13
+ connectedCallback(): void;
14
+ attributeChangedCallback(): void;
15
+ private visibleItems;
16
+ private render;
17
+ }
18
+ declare global {
19
+ interface HTMLElementTagNameMap {
20
+ 'db-breadcrumbs': DbBreadcrumbs;
21
+ }
22
+ }
23
+
24
+ export { DbBreadcrumbs };
@@ -0,0 +1 @@
1
+ import{createDbIcon as e}from"./db-icons.js";class DbBreadcrumbs extends HTMLElement{static get observedAttributes(){return["items","size","variant","breadcrumb-style","max-items"]}get items(){try{return JSON.parse(this.getAttribute("items")||"[]")}catch{return[]}}set items(e){this.setAttribute("items","string"==typeof e?e:JSON.stringify(e))}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}visibleItems(){const e=this.items,t=Number(this.getAttribute("max-items")||0);if(!t||e.length<=t)return e;const s=e[0],a=e[e.length-1],i=e.slice(1,-1),n=t-2;if(n<=0)return[s,a];const r=Math.floor(i.length/2)-Math.floor(n/2);return[s,...i.slice(r,r+n),a]}render(){const t=this.getAttribute("size")||"m",s=this.getAttribute("breadcrumb-style")||this.getAttribute("variant")||"default",a=this.visibleItems(),i=a.length<this.items.length;this.className=["designbase-wc-breadcrumbs",`designbase-wc-breadcrumbs--${t}`,`designbase-wc-breadcrumbs--${s}`,i&&"designbase-wc-breadcrumbs--collapsed"].filter(Boolean).join(" "),this.setAttribute("role","navigation"),this.setAttribute("aria-label","브레드크럼 네비게이션"),this.replaceChildren();const n=document.createElement("ol");n.className="designbase-wc-breadcrumbs__list",a.forEach((t,s)=>{const i=s===a.length-1,r=document.createElement("li");r.className="designbase-wc-breadcrumbs__item";const c=!t.href||i||t.disabled?document.createElement("span"):document.createElement("a");if(c.className=c instanceof HTMLAnchorElement?["designbase-wc-breadcrumbs__link",t.active&&"designbase-wc-breadcrumbs__link--active",t.disabled&&"designbase-wc-breadcrumbs__link--disabled"].filter(Boolean).join(" "):["designbase-wc-breadcrumbs__text",i&&"designbase-wc-breadcrumbs__text--active",t.disabled&&"designbase-wc-breadcrumbs__text--disabled"].filter(Boolean).join(" "),t.icon){const s=document.createElement("span");s.className="designbase-wc-breadcrumbs__icon",s.append(e(t.icon,16)),c.append(s)}const b=document.createElement("span");if(b.className="designbase-wc-breadcrumbs__label",b.textContent=t.label,c.append(b),c instanceof HTMLAnchorElement&&(c.href=t.href||"#"),c.addEventListener("click",e=>{(t.disabled||t.active||i)&&e.preventDefault(),this.dispatchEvent(new CustomEvent("db-click",{detail:{item:t},bubbles:!0,composed:!0}))}),r.append(c),!i){const t=document.createElement("span");t.className="designbase-wc-breadcrumbs__separator",t.setAttribute("aria-hidden","true"),t.append(e("chevron-right",16)),r.append(t)}n.append(r)}),this.append(n)}}customElements.get("db-breadcrumbs")||customElements.define("db-breadcrumbs",DbBreadcrumbs);export{DbBreadcrumbs};
@@ -0,0 +1,57 @@
1
+ /**
2
+ * Light DOM custom element for the canonical web Button.
3
+ *
4
+ * The host itself behaves like the button so framework children stay owned by
5
+ * their renderer. This keeps React/Vue slots stable while sharing one element.
6
+ */
7
+ declare class DbButton extends HTMLElement {
8
+ static get observedAttributes(): string[];
9
+ get variant(): string;
10
+ set variant(value: string);
11
+ get size(): string;
12
+ set size(value: string);
13
+ get radius(): string;
14
+ set radius(value: string);
15
+ get accentStyle(): string;
16
+ set accentStyle(value: string);
17
+ get type(): string;
18
+ set type(value: string);
19
+ get loadingText(): string;
20
+ set loadingText(value: string);
21
+ get disabled(): boolean;
22
+ set disabled(value: boolean);
23
+ get loading(): boolean;
24
+ set loading(value: boolean);
25
+ get iconOnly(): boolean;
26
+ set iconOnly(value: boolean);
27
+ get fullWidth(): boolean;
28
+ set fullWidth(value: boolean);
29
+ connectedCallback(): void;
30
+ disconnectedCallback(): void;
31
+ attributeChangedCallback(): void;
32
+ private handleClick;
33
+ private handleKeyDown;
34
+ private handleKeyUp;
35
+ private handlePointerDown;
36
+ private handlePointerUp;
37
+ private syncAttributes;
38
+ private getIconSize;
39
+ private resolveIconName;
40
+ private isManagedIconNode;
41
+ private syncIcons;
42
+ private getDefaultRadiusClass;
43
+ private syncRadius;
44
+ private syncAccentStyle;
45
+ private syncAccentField;
46
+ private syncModifier;
47
+ private syncBooleanModifier;
48
+ private getSpinnerSize;
49
+ private syncLoadingVisual;
50
+ }
51
+ declare global {
52
+ interface HTMLElementTagNameMap {
53
+ 'db-button': DbButton;
54
+ }
55
+ }
56
+
57
+ export { DbButton };