@designbasekorea/ui-wc 0.2.1 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +322 -29
- package/dist/esm/components/animation-background/canvas-controller.js +1 -0
- package/dist/esm/components/animation-background/controls.js +1 -0
- package/dist/esm/components/animation-background/graphite-controller.js +1 -0
- package/dist/esm/components/animation-background/graphite-presets.js +1 -0
- package/dist/esm/components/animation-background/graphite-shader.js +1 -0
- package/dist/esm/components/animation-background/layers.js +1 -0
- package/dist/esm/components/animation-background/lumina-presets.js +1 -0
- package/dist/esm/components/animation-background/lumina-shaders.js +1 -0
- package/dist/esm/components/animation-background/lumina-utils.js +1 -0
- package/dist/esm/components/animation-background/particle-defaults.js +1 -0
- package/dist/esm/components/animation-background/renderers.js +1 -0
- package/dist/esm/components/animation-background/shader-controller.js +1 -0
- package/dist/esm/components/color-picker-utils.js +1 -0
- package/dist/esm/components/date-picker-utils.js +1 -0
- package/dist/esm/components/db-accordion.d.ts +40 -0
- package/dist/esm/components/db-accordion.js +1 -0
- package/dist/esm/components/db-ad-banner.d.ts +66 -0
- package/dist/esm/components/db-ad-banner.js +1 -0
- package/dist/esm/components/db-alert.d.ts +24 -0
- package/dist/esm/components/db-alert.js +1 -0
- package/dist/esm/components/db-animation-background.d.ts +41 -0
- package/dist/esm/components/db-animation-background.js +1 -0
- package/dist/esm/components/db-animation-text.d.ts +43 -0
- package/dist/esm/components/db-animation-text.js +1 -0
- package/dist/esm/components/db-app-badge.d.ts +20 -0
- package/dist/esm/components/db-app-badge.js +1 -0
- package/dist/esm/components/db-audio-player.d.ts +82 -0
- package/dist/esm/components/db-audio-player.js +1 -0
- package/dist/esm/components/db-avatar.d.ts +18 -0
- package/dist/esm/components/db-avatar.js +1 -0
- package/dist/esm/components/db-backdrop.d.ts +24 -0
- package/dist/esm/components/db-backdrop.js +1 -0
- package/dist/esm/components/db-badge.d.ts +27 -0
- package/dist/esm/components/db-badge.js +1 -0
- package/dist/esm/components/db-banner.d.ts +28 -0
- package/dist/esm/components/db-banner.js +1 -0
- package/dist/esm/components/db-bottom-navigation.d.ts +29 -0
- package/dist/esm/components/db-bottom-navigation.js +1 -0
- package/dist/esm/components/db-bottom-sheet.d.ts +49 -0
- package/dist/esm/components/db-bottom-sheet.js +1 -0
- package/dist/esm/components/db-breadcrumbs.d.ts +24 -0
- package/dist/esm/components/db-breadcrumbs.js +1 -0
- package/dist/esm/components/db-button.d.ts +57 -0
- package/dist/esm/components/db-button.js +1 -0
- package/dist/esm/components/db-calendar.d.ts +78 -0
- package/dist/esm/components/db-calendar.js +1 -0
- package/dist/esm/components/db-card.d.ts +42 -0
- package/dist/esm/components/db-card.js +1 -0
- package/dist/esm/components/db-carousel.d.ts +35 -0
- package/dist/esm/components/db-carousel.js +1 -0
- package/dist/esm/components/db-checkbox.d.ts +35 -0
- package/dist/esm/components/db-checkbox.js +1 -0
- package/dist/esm/components/db-chip.d.ts +14 -0
- package/dist/esm/components/db-chip.js +1 -0
- package/dist/esm/components/db-code-block.d.ts +28 -0
- package/dist/esm/components/db-code-block.js +1 -0
- package/dist/esm/components/db-color-picker.d.ts +83 -0
- package/dist/esm/components/db-color-picker.js +1 -0
- package/dist/esm/components/db-confirm.d.ts +23 -0
- package/dist/esm/components/db-confirm.js +1 -0
- package/dist/esm/components/db-container.d.ts +13 -0
- package/dist/esm/components/db-container.js +1 -0
- package/dist/esm/components/db-context-menu.d.ts +46 -0
- package/dist/esm/components/db-context-menu.js +1 -0
- package/dist/esm/components/db-countdown.d.ts +23 -0
- package/dist/esm/components/db-countdown.js +1 -0
- package/dist/esm/components/db-cursor-follower.d.ts +31 -0
- package/dist/esm/components/db-cursor-follower.js +1 -0
- package/dist/esm/components/db-date-picker.d.ts +84 -0
- package/dist/esm/components/db-date-picker.js +1 -0
- package/dist/esm/components/db-divider.d.ts +13 -0
- package/dist/esm/components/db-divider.js +1 -0
- package/dist/esm/components/db-drawer.d.ts +32 -0
- package/dist/esm/components/db-drawer.js +1 -0
- package/dist/esm/components/db-dropdown.d.ts +70 -0
- package/dist/esm/components/db-dropdown.js +1 -0
- package/dist/esm/components/db-dropzone.d.ts +29 -0
- package/dist/esm/components/db-dropzone.js +1 -0
- package/dist/esm/components/db-empty-state.d.ts +14 -0
- package/dist/esm/components/db-empty-state.js +1 -0
- package/dist/esm/components/db-file-uploader.d.ts +27 -0
- package/dist/esm/components/db-file-uploader.js +1 -0
- package/dist/esm/components/db-floating-action-button.d.ts +24 -0
- package/dist/esm/components/db-floating-action-button.js +1 -0
- package/dist/esm/components/db-footer.d.ts +74 -0
- package/dist/esm/components/db-footer.js +1 -0
- package/dist/esm/components/db-form.d.ts +94 -0
- package/dist/esm/components/db-form.js +1 -0
- package/dist/esm/components/db-gradient.d.ts +26 -0
- package/dist/esm/components/db-gradient.js +1 -0
- package/dist/esm/components/db-grid-background.d.ts +93 -0
- package/dist/esm/components/db-grid-background.js +1 -0
- package/dist/esm/components/db-grid.d.ts +20 -0
- package/dist/esm/components/db-grid.js +1 -0
- package/dist/esm/components/db-icons.js +1 -0
- package/dist/esm/components/db-image-list.d.ts +35 -0
- package/dist/esm/components/db-image-list.js +1 -0
- package/dist/esm/components/db-image-placeholder.d.ts +16 -0
- package/dist/esm/components/db-image-placeholder.js +1 -0
- package/dist/esm/components/db-image.d.ts +34 -0
- package/dist/esm/components/db-image.js +1 -0
- package/dist/esm/components/db-indicator.d.ts +58 -0
- package/dist/esm/components/db-indicator.js +1 -0
- package/dist/esm/components/db-input.d.ts +51 -0
- package/dist/esm/components/db-input.js +1 -0
- package/dist/esm/components/db-label.d.ts +13 -0
- package/dist/esm/components/db-label.js +1 -0
- package/dist/esm/components/db-lightbox.d.ts +53 -0
- package/dist/esm/components/db-lightbox.js +1 -0
- package/dist/esm/components/db-list.d.ts +46 -0
- package/dist/esm/components/db-list.js +1 -0
- package/dist/esm/components/db-logo-svg.js +1 -0
- package/dist/esm/components/db-logo.d.ts +15 -0
- package/dist/esm/components/db-logo.js +1 -0
- package/dist/esm/components/db-lottie.d.ts +20 -0
- package/dist/esm/components/db-lottie.js +1 -0
- package/dist/esm/components/db-markdown-editor.d.ts +53 -0
- package/dist/esm/components/db-markdown-editor.js +1 -0
- package/dist/esm/components/db-marquee.d.ts +56 -0
- package/dist/esm/components/db-marquee.js +1 -0
- package/dist/esm/components/db-masonry.d.ts +24 -0
- package/dist/esm/components/db-masonry.js +1 -0
- package/dist/esm/components/db-menu-item.d.ts +30 -0
- package/dist/esm/components/db-menu-item.js +1 -0
- package/dist/esm/components/db-modal.d.ts +63 -0
- package/dist/esm/components/db-modal.js +1 -0
- package/dist/esm/components/db-navbar.d.ts +88 -0
- package/dist/esm/components/db-navbar.js +1 -0
- package/dist/esm/components/db-onboarding-modal.d.ts +57 -0
- package/dist/esm/components/db-onboarding-modal.js +1 -0
- package/dist/esm/components/db-page-header.d.ts +33 -0
- package/dist/esm/components/db-page-header.js +1 -0
- package/dist/esm/components/db-pagination.d.ts +25 -0
- package/dist/esm/components/db-pagination.js +1 -0
- package/dist/esm/components/db-popover.d.ts +62 -0
- package/dist/esm/components/db-popover.js +1 -0
- package/dist/esm/components/db-progress-step.d.ts +28 -0
- package/dist/esm/components/db-progress-step.js +1 -0
- package/dist/esm/components/db-progress.d.ts +25 -0
- package/dist/esm/components/db-progress.js +1 -0
- package/dist/esm/components/db-progressbar.d.ts +13 -0
- package/dist/esm/components/db-progressbar.js +1 -0
- package/dist/esm/components/db-radio.d.ts +34 -0
- package/dist/esm/components/db-radio.js +1 -0
- package/dist/esm/components/db-random-gradient.d.ts +24 -0
- package/dist/esm/components/db-random-gradient.js +1 -0
- package/dist/esm/components/db-range-slider.d.ts +71 -0
- package/dist/esm/components/db-range-slider.js +1 -0
- package/dist/esm/components/db-rating.d.ts +31 -0
- package/dist/esm/components/db-rating.js +1 -0
- package/dist/esm/components/db-reorder.d.ts +38 -0
- package/dist/esm/components/db-reorder.js +1 -0
- package/dist/esm/components/db-resizable-panels.d.ts +42 -0
- package/dist/esm/components/db-resizable-panels.js +1 -0
- package/dist/esm/components/db-scroll-area.d.ts +23 -0
- package/dist/esm/components/db-scroll-area.js +1 -0
- package/dist/esm/components/db-search-bar.d.ts +53 -0
- package/dist/esm/components/db-search-bar.js +1 -0
- package/dist/esm/components/db-section-app-download.d.ts +32 -0
- package/dist/esm/components/db-section-app-download.js +1 -0
- package/dist/esm/components/db-section-contact.d.ts +22 -0
- package/dist/esm/components/db-section-contact.js +1 -0
- package/dist/esm/components/db-section-feature.d.ts +34 -0
- package/dist/esm/components/db-section-feature.js +1 -0
- package/dist/esm/components/db-section-hero.d.ts +34 -0
- package/dist/esm/components/db-section-hero.js +1 -0
- package/dist/esm/components/db-section.d.ts +44 -0
- package/dist/esm/components/db-section.js +1 -0
- package/dist/esm/components/db-segment-control.d.ts +41 -0
- package/dist/esm/components/db-segment-control.js +1 -0
- package/dist/esm/components/db-select.d.ts +66 -0
- package/dist/esm/components/db-select.js +1 -0
- package/dist/esm/components/db-share-icons.js +1 -0
- package/dist/esm/components/db-share.d.ts +48 -0
- package/dist/esm/components/db-share.js +1 -0
- package/dist/esm/components/db-sidebar.d.ts +59 -0
- package/dist/esm/components/db-sidebar.js +1 -0
- package/dist/esm/components/db-skeleton.d.ts +13 -0
- package/dist/esm/components/db-skeleton.js +1 -0
- package/dist/esm/components/db-spinner.d.ts +27 -0
- package/dist/esm/components/db-spinner.js +1 -0
- package/dist/esm/components/db-split-view.d.ts +33 -0
- package/dist/esm/components/db-split-view.js +1 -0
- package/dist/esm/components/db-stack.d.ts +13 -0
- package/dist/esm/components/db-stack.js +1 -0
- package/dist/esm/components/db-stat.d.ts +26 -0
- package/dist/esm/components/db-stat.js +1 -0
- package/dist/esm/components/db-stepper.d.ts +49 -0
- package/dist/esm/components/db-stepper.js +1 -0
- package/dist/esm/components/db-table.d.ts +39 -0
- package/dist/esm/components/db-table.js +1 -0
- package/dist/esm/components/db-tabs.d.ts +48 -0
- package/dist/esm/components/db-tabs.js +1 -0
- package/dist/esm/components/db-testimonial.d.ts +27 -0
- package/dist/esm/components/db-testimonial.js +1 -0
- package/dist/esm/components/db-textarea.d.ts +33 -0
- package/dist/esm/components/db-textarea.js +1 -0
- package/dist/esm/components/db-time-picker.d.ts +62 -0
- package/dist/esm/components/db-time-picker.js +1 -0
- package/dist/esm/components/db-timeline.d.ts +29 -0
- package/dist/esm/components/db-timeline.js +1 -0
- package/dist/esm/components/db-toast.d.ts +23 -0
- package/dist/esm/components/db-toast.js +1 -0
- package/dist/esm/components/db-toggle.d.ts +35 -0
- package/dist/esm/components/db-toggle.js +1 -0
- package/dist/esm/components/db-toolbar.d.ts +25 -0
- package/dist/esm/components/db-toolbar.js +1 -0
- package/dist/esm/components/db-tooltip.d.ts +58 -0
- package/dist/esm/components/db-tooltip.js +1 -0
- package/dist/esm/components/db-top-banner.d.ts +17 -0
- package/dist/esm/components/db-top-banner.js +1 -0
- package/dist/esm/components/db-tutorial.d.ts +54 -0
- package/dist/esm/components/db-tutorial.js +1 -0
- package/dist/esm/components/db-video-player.d.ts +67 -0
- package/dist/esm/components/db-video-player.js +1 -0
- package/dist/esm/components/db-youtube-player.d.ts +22 -0
- package/dist/esm/components/db-youtube-player.js +1 -0
- package/dist/esm/components/highlight-code.js +1 -0
- package/dist/esm/components/input-validation.js +1 -0
- package/dist/esm/components/number-scrub.js +1 -0
- package/dist/esm/components/random-gradient-palettes.js +1 -0
- package/dist/esm/helpers/confirm.d.ts +30 -0
- package/dist/esm/helpers/confirm.js +1 -0
- package/dist/esm/helpers/toast.d.ts +56 -0
- package/dist/esm/helpers/toast.js +1 -0
- package/dist/esm/index.d.ts +102 -0
- package/dist/esm/index.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-bash.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-clike.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-css.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-javascript.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-json.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-jsx.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-markup.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-scss.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-tsx.js +1 -0
- package/dist/esm/node_modules/prismjs/components/prism-typescript.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +475 -12
- package/dist/index.esm.js +1 -1
- package/dist/react/chunks/lottie-14e7addb.js +1 -0
- package/dist/react/index.cjs +1 -1
- package/dist/react/index.d.ts +604 -64
- package/dist/react/index.esm.js +1 -1
- package/package.json +10 -2
- package/dist/react/chunks/lottie-eed75107.js +0 -1
- /package/dist/chunks/{lottie-2c3b8673.js → lottie-1e5700ad.js} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createDbIcon as t}from"./db-icons.js";class DbEmptyState extends HTMLElement{static get observedAttributes(){return["variant","size","title","description","action-text","secondary-action-text","image","image-alt"]}connectedCallback(){this.render()}attributeChangedCallback(){this.render()}getIconName(t){return"no-results"===t?"search":"no-access"===t?"user":"error"===t?"cloud-close":"onboarding"===t?"bulb":"plus"}render(){const e=this.getAttribute("variant")||"no-data",s=this.getAttribute("size")||"m",a=this.getAttribute("title")||"",n=this.getAttribute("description")||"",i=this.getAttribute("action-text"),c=this.getAttribute("secondary-action-text"),d=this.getAttribute("image"),o=this.getAttribute("image-alt")||a,r="s"===s?24:"l"===s?48:32;this.className=`designbase-wc-empty-state designbase-wc-empty-state--${e} designbase-wc-empty-state--${s}`,this.setAttribute("role","status"),this.setAttribute("aria-live","polite"),this.replaceChildren();const m=document.createElement("div");if(m.className="designbase-wc-empty-state__content",d){const t=document.createElement("div");t.className="designbase-wc-empty-state__image";const e=document.createElement("img");e.className="designbase-wc-empty-state__image-element",e.src=d,e.alt=o,t.append(e),m.append(t)}else{const s=document.createElement("div");s.className="designbase-wc-empty-state__icon",s.append(t(this.getIconName(e),r)),m.append(s)}const b=document.createElement("h3");if(b.className="designbase-wc-empty-state__title",b.textContent=a,m.append(b),n){const t=document.createElement("p");t.className="designbase-wc-empty-state__description",t.textContent=n,m.append(t)}if(i||c){const t=document.createElement("div");if(t.className="designbase-wc-empty-state__actions",i){const a=document.createElement("db-button");a.setAttribute("variant","onboarding"===e?"primary":"secondary"),a.setAttribute("size",s),a.textContent=i,a.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-action",{bubbles:!0,composed:!0}))}),t.append(a)}if(c){const e=document.createElement("db-button");e.setAttribute("variant","tertiary"),e.setAttribute("size",s),e.textContent=c,e.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-secondary-action",{bubbles:!0,composed:!0}))}),t.append(e)}m.append(t)}this.append(m)}}customElements.get("db-empty-state")||customElements.define("db-empty-state",DbEmptyState);export{DbEmptyState};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
declare class DbFileUploader extends HTMLElement {
|
|
2
|
+
static get observedAttributes(): string[];
|
|
3
|
+
private dropzone?;
|
|
4
|
+
private uploadedFiles;
|
|
5
|
+
private uploadIntervals;
|
|
6
|
+
connectedCallback(): void;
|
|
7
|
+
disconnectedCallback(): void;
|
|
8
|
+
attributeChangedCallback(): void;
|
|
9
|
+
private isDisabled;
|
|
10
|
+
private ensureDropzone;
|
|
11
|
+
private formatFileSize;
|
|
12
|
+
private handleFileSelect;
|
|
13
|
+
private simulateUpload;
|
|
14
|
+
private updateFile;
|
|
15
|
+
private handleRemove;
|
|
16
|
+
private handleRetry;
|
|
17
|
+
private sync;
|
|
18
|
+
private renderStatusIcon;
|
|
19
|
+
private renderFileList;
|
|
20
|
+
}
|
|
21
|
+
declare global {
|
|
22
|
+
interface HTMLElementTagNameMap {
|
|
23
|
+
'db-file-uploader': DbFileUploader;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export { DbFileUploader };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createDbIcon as e}from"./db-icons.js";const t=["s","m","l"],s=["default","outlined","filled"];class DbFileUploader extends HTMLElement{constructor(){super(...arguments),this.uploadedFiles=[],this.uploadIntervals=new Map,this.handleFileSelect=e=>{if(this.isDisabled())return;const t=e.detail,s=t?.files??[];if(!s.length)return;const i=s.map(e=>({file:e,id:`${Date.now()}-${Math.random()}`,status:"pending",progress:0}));this.hasAttribute("multiple")?this.uploadedFiles=[...this.uploadedFiles,...i]:this.uploadedFiles=i,this.dispatchEvent(new CustomEvent("db-upload",{bubbles:!0,composed:!0,detail:{files:i}})),this.simulateUpload(i),this.renderFileList()},this.handleRemove=e=>{if(this.isDisabled())return;const t=this.uploadIntervals.get(e);t&&(clearInterval(t),this.uploadIntervals.delete(e)),this.uploadedFiles=this.uploadedFiles.filter(t=>t.id!==e),this.dispatchEvent(new CustomEvent("db-remove",{bubbles:!0,composed:!0,detail:{fileId:e}})),this.renderFileList()},this.handleRetry=e=>{if(this.isDisabled())return;const t=this.uploadedFiles.find(t=>t.id===e);t&&(this.updateFile(e,{status:"pending",progress:0,error:void 0}),this.dispatchEvent(new CustomEvent("db-retry",{bubbles:!0,composed:!0,detail:{fileId:e}})),this.simulateUpload([t]),this.renderFileList())}}static get observedAttributes(){return["size","variant","accept","max-size","multiple","show-file-list","show-progress","disabled","readonly"]}connectedCallback(){this.ensureDropzone(),this.sync(),this.dropzone?.addEventListener("db-file-select",this.handleFileSelect)}disconnectedCallback(){this.dropzone?.removeEventListener("db-file-select",this.handleFileSelect),this.uploadIntervals.forEach(e=>clearInterval(e)),this.uploadIntervals.clear()}attributeChangedCallback(){this.isConnected&&this.sync()}isDisabled(){return this.hasAttribute("disabled")||this.hasAttribute("readonly")}ensureDropzone(){this.dropzone||(this.dropzone=document.createElement("db-dropzone"),this.dropzone.setAttribute("data-wc-internal",""),this.prepend(this.dropzone))}formatFileSize(e){if(0===e)return"0 Bytes";const t=Math.floor(Math.log(e)/Math.log(1024));return`${parseFloat((e/1024**t).toFixed(2))} ${["Bytes","KB","MB","GB"][t]}`}simulateUpload(e){e.forEach((e,t)=>{this.updateFile(e.id,{status:"uploading",progress:0});let s=0;const i=setInterval(()=>{if(s+=20*Math.random(),s>=100)return s=100,clearInterval(i),this.uploadIntervals.delete(e.id),this.updateFile(e.id,{status:"success",progress:100}),void this.renderFileList();this.updateFile(e.id,{progress:s}),this.renderFileList()},100+50*t);this.uploadIntervals.set(e.id,i)})}updateFile(e,t){this.uploadedFiles=this.uploadedFiles.map(s=>s.id===e?{...s,...t}:s)}sync(){if(this.ensureDropzone(),!this.dropzone)return;const e=this.getAttribute("size")||"m",i=this.getAttribute("variant")||"default",l=t.includes(e)?e:"m",a=s.includes(i)?i:"default";this.className=["designbase-wc-file-uploader",`designbase-wc-file-uploader--size-${l}`,`designbase-wc-file-uploader--variant-${a}`,this.hasAttribute("disabled")&&"designbase-wc-file-uploader--disabled",this.hasAttribute("readonly")&&"designbase-wc-file-uploader--readonly"].filter(Boolean).join(" "),this.dropzone.setAttribute("size",l),this.dropzone.setAttribute("variant",a),this.getAttribute("accept")?this.dropzone.setAttribute("accept",this.getAttribute("accept")):this.dropzone.removeAttribute("accept"),this.getAttribute("max-size")?this.dropzone.setAttribute("max-size",this.getAttribute("max-size")):this.dropzone.removeAttribute("max-size"),this.dropzone.toggleAttribute("multiple",this.hasAttribute("multiple")),this.dropzone.toggleAttribute("disabled",this.hasAttribute("disabled")),this.dropzone.toggleAttribute("readonly",this.hasAttribute("readonly")),this.renderFileList()}renderStatusIcon(t){if("uploading"===t){const e=document.createElement("db-spinner");return e.setAttribute("type","circular"),e.setAttribute("size","s"),e}return e("success"===t?"done":"error"===t?"error-filled":"gallery",20)}renderFileList(){const e=!this.hasAttribute("show-file-list")||"false"!==this.getAttribute("show-file-list"),t=!this.hasAttribute("show-progress")||"false"!==this.getAttribute("show-progress");if(this.querySelector(":scope > .designbase-wc-file-uploader__file-list")?.remove(),!e||!this.uploadedFiles.length)return;const s=document.createElement("div");s.className="designbase-wc-file-uploader__file-list";const i=document.createElement("div");i.className="designbase-wc-file-uploader__file-list-title",i.textContent=`업로드된 파일들 (${this.uploadedFiles.length}개)`,s.append(i);const l=document.createElement("div");l.className="designbase-wc-file-uploader__file-items",this.uploadedFiles.forEach(e=>{const s=document.createElement("div");s.className=`designbase-wc-file-uploader__file-item designbase-wc-file-uploader__file-item--${e.status}`;const i=document.createElement("div");i.className="designbase-wc-file-uploader__file-info";const a=document.createElement("div");a.className="designbase-wc-file-uploader__file-icon",a.append(this.renderStatusIcon(e.status));const d=document.createElement("div");d.className="designbase-wc-file-uploader__file-details";const r=document.createElement("div");r.className="designbase-wc-file-uploader__file-name",r.textContent=e.file.name;const n=document.createElement("div");if(n.className="designbase-wc-file-uploader__file-size",n.textContent=this.formatFileSize(e.file.size),d.append(r,n),e.error){const t=document.createElement("div");t.className="designbase-wc-file-uploader__file-error",t.textContent=e.error,d.append(t)}if(i.append(a,d),s.append(i),t&&"uploading"===e.status){const t=document.createElement("div");t.className="designbase-wc-file-uploader__progress";const i=document.createElement("db-progressbar");i.setAttribute("value",String(Math.round(e.progress||0))),i.setAttribute("size","s"),i.setAttribute("variant","primary"),i.setAttribute("bar-style","solid"),i.setAttribute("show-label",""),i.setAttribute("label-position","inside"),i.setAttribute("full-width",""),t.append(i),s.append(t)}const o=document.createElement("div");if(o.className="designbase-wc-file-uploader__file-actions","error"===e.status){const t=document.createElement("button");t.type="button",t.className="designbase-wc-file-uploader__retry-button",t.textContent="재시도",t.disabled=this.isDisabled(),t.addEventListener("click",()=>this.handleRetry(e.id)),o.append(t)}const u=document.createElement("button");u.type="button",u.className="designbase-wc-file-uploader__remove-button",u.textContent="삭제",u.disabled=this.isDisabled(),u.addEventListener("click",()=>this.handleRemove(e.id)),o.append(u),s.append(o),l.append(s)}),s.append(l),this.append(s)}}customElements.get("db-file-uploader")||customElements.define("db-file-uploader",DbFileUploader);export{DbFileUploader};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare class DbFloatingActionButton extends HTMLElement {
|
|
2
|
+
static get observedAttributes(): string[];
|
|
3
|
+
get size(): string;
|
|
4
|
+
set size(value: string);
|
|
5
|
+
get variant(): string;
|
|
6
|
+
set variant(value: string);
|
|
7
|
+
get loading(): boolean;
|
|
8
|
+
set loading(value: boolean);
|
|
9
|
+
get disabled(): boolean;
|
|
10
|
+
set disabled(value: boolean);
|
|
11
|
+
connectedCallback(): void;
|
|
12
|
+
disconnectedCallback(): void;
|
|
13
|
+
attributeChangedCallback(): void;
|
|
14
|
+
private handleClick;
|
|
15
|
+
private resolveIconName;
|
|
16
|
+
private sync;
|
|
17
|
+
}
|
|
18
|
+
declare global {
|
|
19
|
+
interface HTMLElementTagNameMap {
|
|
20
|
+
'db-floating-action-button': DbFloatingActionButton;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export { DbFloatingActionButton };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createDbIcon as t}from"./db-icons.js";const e=["s","m","l"],i=["primary","secondary","tertiary"],s={s:12,m:16,l:20},n={s:"xs",m:"s",l:"m"};class DbFloatingActionButton extends HTMLElement{constructor(){super(...arguments),this.handleClick=t=>{if(this.disabled||this.loading)return t.preventDefault(),void t.stopPropagation();this.dispatchEvent(new CustomEvent("db-click",{bubbles:!0,composed:!0}))}}static get observedAttributes(){return["size","variant","icon","loading","disabled","aria-label"]}get size(){const t=this.getAttribute("size")||"m";return e.includes(t)?t:"m"}set size(t){this.setAttribute("size",t)}get variant(){const t=this.getAttribute("variant")||"primary";return i.includes(t)?t:"primary"}set variant(t){this.setAttribute("variant",t)}get loading(){return this.hasAttribute("loading")}set loading(t){this.toggleAttribute("loading",Boolean(t))}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",Boolean(t))}connectedCallback(){"button"!==this.getAttribute("role")&&this.setAttribute("role","button"),this.hasAttribute("type")||this.setAttribute("type","button"),this.addEventListener("click",this.handleClick),this.sync()}disconnectedCallback(){this.removeEventListener("click",this.handleClick)}attributeChangedCallback(){this.isConnected&&this.sync()}resolveIconName(t){if(!t)return;return t in{plus:1,search:1,settings:1,edit:1,close:1}?t:void 0}sync(){this.className=["designbase-wc-fab",`designbase-wc-fab--${this.size}`,`designbase-wc-fab--${this.variant}`,this.disabled&&"designbase-wc-fab--disabled",this.loading&&"designbase-wc-fab--loading"].filter(Boolean).join(" ");const e=this.getAttribute("aria-label")||"Floating action button";this.getAttribute("aria-label")!==e&&this.setAttribute("aria-label",e);const i=String(this.loading);this.getAttribute("aria-busy")!==i&&this.setAttribute("aria-busy",i);const a=String(this.disabled||this.loading);this.getAttribute("aria-disabled")!==a&&this.setAttribute("aria-disabled",a);let r=this.querySelector(":scope > .designbase-wc-fab__icon");if(r||(r=document.createElement("div"),r.className="designbase-wc-fab__icon",this.append(r)),r.replaceChildren(),this.loading){const t=document.createElement("span");return t.className=`designbase-wc-spinner designbase-wc-spinner--circular designbase-wc-spinner--${n[this.size]}`,t.setAttribute("aria-hidden","true"),t.innerHTML='<svg class="designbase-wc-spinner__circular" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg" aria-hidden="true"><circle class="designbase-wc-spinner__circular-track" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none"></circle><circle class="designbase-wc-spinner__circular-indicator" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="2" fill="none" stroke-linecap="round"></circle></svg>',void r.append(t)}const c=this.getAttribute("icon"),o=this.resolveIconName(c);if(o)return void r.append(t(o,s[this.size]));const l=Array.from(this.children).find(t=>t!==r&&!t.hasAttribute("data-wc-internal"));l&&!l.isConnected&&r.append(l)}}customElements.get("db-floating-action-button")||customElements.define("db-floating-action-button",DbFloatingActionButton);export{DbFloatingActionButton};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
type DbFooterSocialPlatform = 'youtube' | 'instagram' | 'x' | 'linkedin' | 'facebook' | 'email';
|
|
2
|
+
interface DbFooterLink {
|
|
3
|
+
id: string;
|
|
4
|
+
label: string;
|
|
5
|
+
href?: string;
|
|
6
|
+
external?: boolean;
|
|
7
|
+
/** 개인정보처리방침 등 강조 링크 */
|
|
8
|
+
emphasize?: boolean;
|
|
9
|
+
}
|
|
10
|
+
interface DbFooterLinkColumn {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
items: DbFooterLink[];
|
|
14
|
+
}
|
|
15
|
+
interface DbFooterSocialLink {
|
|
16
|
+
id: string;
|
|
17
|
+
platform: DbFooterSocialPlatform;
|
|
18
|
+
href: string;
|
|
19
|
+
label?: string;
|
|
20
|
+
}
|
|
21
|
+
interface DbFooterCompanyInfo {
|
|
22
|
+
companyName?: string;
|
|
23
|
+
representative?: string;
|
|
24
|
+
businessNumber?: string;
|
|
25
|
+
mailOrderNumber?: string;
|
|
26
|
+
address?: string;
|
|
27
|
+
phone?: string;
|
|
28
|
+
customerCenter?: string;
|
|
29
|
+
email?: string;
|
|
30
|
+
hostingProvider?: string;
|
|
31
|
+
}
|
|
32
|
+
interface DbFooterFamilySite {
|
|
33
|
+
id: string;
|
|
34
|
+
label: string;
|
|
35
|
+
href: string;
|
|
36
|
+
}
|
|
37
|
+
declare class DbFooter extends HTMLElement {
|
|
38
|
+
static get observedAttributes(): string[];
|
|
39
|
+
connectedCallback(): void;
|
|
40
|
+
attributeChangedCallback(): void;
|
|
41
|
+
get columns(): DbFooterLinkColumn[];
|
|
42
|
+
set columns(value: DbFooterLinkColumn[] | string);
|
|
43
|
+
get legalLinks(): DbFooterLink[];
|
|
44
|
+
set legalLinks(value: DbFooterLink[] | string);
|
|
45
|
+
get socialLinks(): DbFooterSocialLink[];
|
|
46
|
+
set socialLinks(value: DbFooterSocialLink[] | string);
|
|
47
|
+
get companyInfo(): DbFooterCompanyInfo;
|
|
48
|
+
set companyInfo(value: DbFooterCompanyInfo | string);
|
|
49
|
+
get familySites(): DbFooterFamilySite[];
|
|
50
|
+
set familySites(value: DbFooterFamilySite[] | string);
|
|
51
|
+
private syncHostClasses;
|
|
52
|
+
private dispatchLinkClick;
|
|
53
|
+
private createLink;
|
|
54
|
+
private createSocialLink;
|
|
55
|
+
private createCompanyInfoRows;
|
|
56
|
+
private showLogo;
|
|
57
|
+
private createLogo;
|
|
58
|
+
private renderBrand;
|
|
59
|
+
private renderColumns;
|
|
60
|
+
private createLegalNav;
|
|
61
|
+
private renderLegalBar;
|
|
62
|
+
private renderCompanyInfo;
|
|
63
|
+
private createCopyright;
|
|
64
|
+
private renderMinimal;
|
|
65
|
+
private render;
|
|
66
|
+
}
|
|
67
|
+
declare global {
|
|
68
|
+
interface HTMLElementTagNameMap {
|
|
69
|
+
'db-footer': DbFooter;
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
export { DbFooter };
|
|
74
|
+
export type { DbFooterCompanyInfo, DbFooterFamilySite, DbFooterLink, DbFooterLinkColumn, DbFooterSocialLink, DbFooterSocialPlatform };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createShareIcon as e}from"./db-share-icons.js";const t=["default","compact","minimal"],s=["s","m","l"],n={youtube:"youtube",instagram:"instagram",x:"x",linkedin:"linkedin",facebook:"facebook",email:"mail"};function parseJson(e,t){if(!e)return t;try{return JSON.parse(e)??t}catch{return t}}class DbFooter extends HTMLElement{static get observedAttributes(){return["columns","legal-links","social-links","company-info","family-sites","tagline","copyright","logo-type","variant","size","full-width","show-logo","show-social","family-site-label"]}connectedCallback(){this.render()}attributeChangedCallback(){this.isConnected&&this.render()}get columns(){return parseJson(this.getAttribute("columns"),[])}set columns(e){this.setAttribute("columns","string"==typeof e?e:JSON.stringify(e))}get legalLinks(){return parseJson(this.getAttribute("legal-links"),[])}set legalLinks(e){this.setAttribute("legal-links","string"==typeof e?e:JSON.stringify(e))}get socialLinks(){return parseJson(this.getAttribute("social-links"),[])}set socialLinks(e){this.setAttribute("social-links","string"==typeof e?e:JSON.stringify(e))}get companyInfo(){return parseJson(this.getAttribute("company-info"),{})}set companyInfo(e){this.setAttribute("company-info","string"==typeof e?e:JSON.stringify(e))}get familySites(){return parseJson(this.getAttribute("family-sites"),[])}set familySites(e){this.setAttribute("family-sites","string"==typeof e?e:JSON.stringify(e))}syncHostClasses(){const e=this.getAttribute("size")||"m",n=this.getAttribute("variant")||"default",a=s.includes(e)?e:"m",i=t.includes(n)?n:"default";this.className=["designbase-wc-footer",`designbase-wc-footer--${a}`,`designbase-wc-footer--${i}`,this.hasAttribute("full-width")&&"designbase-wc-footer--full-width"].filter(Boolean).join(" ")}dispatchLinkClick(e,t){this.dispatchEvent(new CustomEvent("db-link-click",{bubbles:!0,composed:!0,detail:{link:e,source:t}}))}createLink(e,t,s){const n=document.createElement("a");return n.href=e.href||"#",n.className=[t,e.emphasize&&`${t}--emphasize`].filter(Boolean).join(" "),n.textContent=e.label,e.external&&(n.target="_blank",n.rel="noopener noreferrer"),n.addEventListener("click",t=>{t.preventDefault(),this.dispatchLinkClick(e,s)}),n}createSocialLink(t,s){const a=document.createElement("a");a.href=t.href,a.className="designbase-wc-footer__social-link",a.target="_blank",a.rel="noopener noreferrer",a.setAttribute("aria-label",t.label||t.platform);const i=n[t.platform]||"share-alt";return a.append(e(i,s)),a.addEventListener("click",e=>{e.preventDefault(),this.dispatchEvent(new CustomEvent("db-social-click",{bubbles:!0,composed:!0,detail:{link:t}}))}),a}createCompanyInfoRows(e){const t=[],s=[];e.companyName&&s.push(e.companyName),e.representative&&s.push(`대표: ${e.representative}`),e.businessNumber&&s.push(`사업자등록번호: ${e.businessNumber}`),s.length&&t.push(s.join(" | "));const n=[];e.address&&n.push(e.address),e.phone&&n.push(`대표전화: ${e.phone}`),e.customerCenter&&n.push(`고객센터: ${e.customerCenter}`),n.length&&t.push(n.join(" | "));const a=[];return e.email&&a.push(`이메일: ${e.email}`),e.mailOrderNumber&&a.push(`통신판매업신고: ${e.mailOrderNumber}`),e.hostingProvider&&a.push(`호스팅: ${e.hostingProvider}`),a.length&&t.push(a.join(" | ")),t}showLogo(){return!this.hasAttribute("show-logo")||"false"!==this.getAttribute("show-logo")}createLogo(){const e=document.createElement("div");e.className="designbase-wc-footer__logo";const t=document.createElement("db-logo");return t.setAttribute("type",this.getAttribute("logo-type")||"designbase"),t.setAttribute("size","s"),t.setAttribute("clickable",""),t.addEventListener("db-click",()=>{this.dispatchEvent(new CustomEvent("db-logo-click",{bubbles:!0,composed:!0}))}),e.append(t),e}renderBrand(e,t={}){const{showTagline:s=!0}=t,n=document.createElement("div");n.className="designbase-wc-footer__brand",this.showLogo()&&n.append(this.createLogo());const a=this.getAttribute("tagline");if(s&&a){const e=document.createElement("p");e.className="designbase-wc-footer__tagline",e.textContent=a,n.append(e)}const i=this.socialLinks;if(i.length&&(!this.hasAttribute("show-social")||"false"!==this.getAttribute("show-social"))){const t=document.createElement("div");t.className="designbase-wc-footer__social",i.forEach(s=>t.append(this.createSocialLink(s,e))),n.append(t)}return n}renderColumns(e){if(!e.length)return null;const t=document.createElement("div");return t.className="designbase-wc-footer__columns",t.style.setProperty("--db-footer-columns",String(Math.min(e.length,4))),e.forEach(e=>{const s=document.createElement("div");s.className="designbase-wc-footer__column";const n=document.createElement("h3");n.className="designbase-wc-footer__column-title",n.textContent=e.title,s.append(n);const a=document.createElement("ul");a.className="designbase-wc-footer__column-list",e.items.forEach(e=>{const t=document.createElement("li");t.append(this.createLink(e,"designbase-wc-footer__column-link","column")),a.append(t)}),s.append(a),t.append(s)}),t}createLegalNav(e){const t=document.createElement("nav");t.className="designbase-wc-footer__legal-nav",t.setAttribute("aria-label","법적 고지");const s=document.createElement("ul");return s.className="designbase-wc-footer__legal-list",e.forEach((t,n)=>{const a=document.createElement("li");if(a.append(this.createLink(t,"designbase-wc-footer__legal-link","legal")),s.append(a),n<e.length-1){const e=document.createElement("span");e.className="designbase-wc-footer__legal-divider",e.setAttribute("aria-hidden","true"),e.textContent="|",a.append(e)}}),t.append(s),t}renderLegalBar(e,t){if(!e.length&&!t.length)return null;const s=document.createElement("div");if(s.className="designbase-wc-footer__legal-bar",e.length&&s.append(this.createLegalNav(e)),t.length){const e=document.createElement("div");e.className="designbase-wc-footer__family-site";const n=document.createElement("select");n.className="designbase-wc-footer__family-select",n.setAttribute("aria-label",this.getAttribute("family-site-label")||"패밀리 사이트");const a=document.createElement("option");a.value="",a.textContent=this.getAttribute("family-site-label")||"패밀리 사이트",a.disabled=!0,a.selected=!0,n.append(a),t.forEach(e=>{const t=document.createElement("option");t.value=e.href,t.textContent=e.label,t.dataset.id=e.id,n.append(t)}),n.addEventListener("change",()=>{const e=t.find(e=>e.href===n.value);e&&(n.selectedIndex=0,this.dispatchEvent(new CustomEvent("db-family-site-change",{bubbles:!0,composed:!0,detail:{site:e}})))}),e.append(n),s.append(e)}return s}renderCompanyInfo(e){const t=this.createCompanyInfoRows(e);if(!t.length)return null;const s=document.createElement("div");return s.className="designbase-wc-footer__company",t.forEach(e=>{const t=document.createElement("p");t.className="designbase-wc-footer__company-line",t.textContent=e,s.append(t)}),s}createCopyright(e){const t=document.createElement("div");t.className="designbase-wc-footer__bottom";const s=document.createElement("p");return s.className="designbase-wc-footer__copyright",s.textContent=e,t.append(s),t}renderMinimal(e,t,s){const n=document.createElement("div");n.className="designbase-wc-footer__minimal-bar";const a=document.createElement("div");if(a.className="designbase-wc-footer__minimal-start",this.showLogo()&&a.append(this.createLogo()),n.append(a),t.length){const e=document.createElement("div");e.className="designbase-wc-footer__minimal-legal",e.append(this.createLegalNav(t)),n.append(e)}e.append(n),e.append(this.createCopyright(s))}render(){this.syncHostClasses(),this.setAttribute("role","contentinfo");const e=this.getAttribute("variant")||"default",t=this.getAttribute("size")||"m",s="s"===t?18:"l"===t?22:20,n="default"===e?this.columns:[],a=this.legalLinks,i=this.companyInfo,o=this.familySites,r=this.getAttribute("copyright")||`© ${(new Date).getFullYear()} Designbase. All rights reserved.`;this.replaceChildren();const l=document.createElement("div");if(l.className=["designbase-wc-footer__container",this.hasAttribute("full-width")&&"designbase-wc-footer__container--full-width"].filter(Boolean).join(" "),"minimal"===e)return this.renderMinimal(l,a,r),void this.append(l);const c=document.createElement("div");c.className="designbase-wc-footer__top",c.append(this.renderBrand(s,{showTagline:"compact"!==e}));const d=this.renderColumns(n);d&&c.append(d),l.append(c);const m=this.renderLegalBar(a,o);m&&l.append(m);const u=this.renderCompanyInfo(i);u&&l.append(u),l.append(this.createCopyright(r)),this.append(l)}}customElements.get("db-footer")||customElements.define("db-footer",DbFooter);export{DbFooter};
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import './db-input.js';
|
|
2
|
+
import './db-textarea.js';
|
|
3
|
+
import './db-select.js';
|
|
4
|
+
import './db-checkbox.js';
|
|
5
|
+
import './db-radio.js';
|
|
6
|
+
import './db-button.js';
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Form Web Component
|
|
10
|
+
* packages/ui Form.tsx 기준 — ui-wc 폼 필드(db-input, db-select 등) 조합
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface DbFormFieldOption {
|
|
14
|
+
label: string;
|
|
15
|
+
value: string;
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
interface DbFormFieldValidation {
|
|
19
|
+
required?: boolean;
|
|
20
|
+
min?: number;
|
|
21
|
+
max?: number;
|
|
22
|
+
minLength?: number;
|
|
23
|
+
maxLength?: number;
|
|
24
|
+
pattern?: string;
|
|
25
|
+
}
|
|
26
|
+
interface DbFormFieldData {
|
|
27
|
+
name: string;
|
|
28
|
+
type?: 'text' | 'email' | 'password' | 'number' | 'tel' | 'url' | 'search' | 'textarea' | 'select' | 'radio' | 'checkbox';
|
|
29
|
+
label?: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
value?: string | number | boolean | string[];
|
|
32
|
+
defaultValue?: string | number | boolean | string[];
|
|
33
|
+
required?: boolean;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
readOnly?: boolean;
|
|
36
|
+
min?: number;
|
|
37
|
+
max?: number;
|
|
38
|
+
minLength?: number;
|
|
39
|
+
maxLength?: number;
|
|
40
|
+
pattern?: string;
|
|
41
|
+
errorMessage?: string;
|
|
42
|
+
helpText?: string;
|
|
43
|
+
options?: DbFormFieldOption[];
|
|
44
|
+
multiple?: boolean;
|
|
45
|
+
checkboxGroup?: boolean;
|
|
46
|
+
radioGroup?: boolean;
|
|
47
|
+
validation?: DbFormFieldValidation;
|
|
48
|
+
}
|
|
49
|
+
declare class DbForm extends HTMLElement {
|
|
50
|
+
static get observedAttributes(): string[];
|
|
51
|
+
private built;
|
|
52
|
+
private formEl;
|
|
53
|
+
private headerEl;
|
|
54
|
+
private fieldsEl;
|
|
55
|
+
private actionsEl;
|
|
56
|
+
private submitBtn;
|
|
57
|
+
private resetBtn;
|
|
58
|
+
private values;
|
|
59
|
+
private errors;
|
|
60
|
+
private touched;
|
|
61
|
+
private initialValues;
|
|
62
|
+
private fieldWrappers;
|
|
63
|
+
private boundSubmit;
|
|
64
|
+
private boundReset;
|
|
65
|
+
connectedCallback(): void;
|
|
66
|
+
attributeChangedCallback(name: string): void;
|
|
67
|
+
get fields(): DbFormFieldData[];
|
|
68
|
+
set fields(value: DbFormFieldData[] | string);
|
|
69
|
+
private parseFields;
|
|
70
|
+
private parseInitialValues;
|
|
71
|
+
private bootstrapValues;
|
|
72
|
+
private buildShell;
|
|
73
|
+
private syncAll;
|
|
74
|
+
private syncClasses;
|
|
75
|
+
private syncHeader;
|
|
76
|
+
private syncActions;
|
|
77
|
+
private renderFields;
|
|
78
|
+
private refreshFieldState;
|
|
79
|
+
private refreshAllFieldStates;
|
|
80
|
+
private createFieldControl;
|
|
81
|
+
private handleFieldChange;
|
|
82
|
+
private validateField;
|
|
83
|
+
private validateForm;
|
|
84
|
+
private handleSubmit;
|
|
85
|
+
private handleReset;
|
|
86
|
+
}
|
|
87
|
+
declare global {
|
|
88
|
+
interface HTMLElementTagNameMap {
|
|
89
|
+
'db-form': DbForm;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { DbForm };
|
|
94
|
+
export type { DbFormFieldData, DbFormFieldOption, DbFormFieldValidation };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"./db-input.js";import"./db-textarea.js";import"./db-select.js";import"./db-checkbox.js";import"./db-radio.js";import"./db-button.js";const e="designbase-wc-form";class DbForm extends HTMLElement{constructor(){super(...arguments),this.built=!1,this.formEl=null,this.headerEl=null,this.fieldsEl=null,this.actionsEl=null,this.submitBtn=null,this.resetBtn=null,this.values={},this.errors={},this.touched={},this.initialValues={},this.fieldWrappers=new Map,this.boundSubmit=e=>this.handleSubmit(e),this.boundReset=e=>this.handleReset(e)}static get observedAttributes(){return["fields","columns","size","variant","title","description","submit-text","reset-text","show-reset","submit-loading","submit-disabled","initial-values"]}connectedCallback(){this.built||(this.buildShell(),this.built=!0),this.bootstrapValues(),this.syncAll()}attributeChangedCallback(e){this.built&&("initial-values"===e&&this.bootstrapValues(),"fields"===e&&this.bootstrapValues(),this.syncAll())}get fields(){return this.parseFields(this.getAttribute("fields"))}set fields(e){this.setAttribute("fields","string"==typeof e?e:JSON.stringify(e))}parseFields(e){if(!e)return[];try{const t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}parseInitialValues(){const e=this.getAttribute("initial-values");if(!e)return{};try{const t=JSON.parse(e);return t&&"object"==typeof t?t:{}}catch{return{}}}bootstrapValues(){this.initialValues=this.parseInitialValues();const e={...this.initialValues};this.fields.forEach(t=>{void 0===e[t.name]&&(void 0===t.value?void 0===t.defaultValue?"checkbox"===t.type&&t.checkboxGroup?e[t.name]=[]:"checkbox"!==t.type?e[t.name]="":e[t.name]=!1:e[t.name]=t.defaultValue:e[t.name]=t.value)}),this.values=e}buildShell(){this.formEl=document.createElement("form"),this.formEl.className=`${e}__native`,this.formEl.noValidate=!0,this.formEl.addEventListener("submit",this.boundSubmit),this.headerEl=document.createElement("div"),this.headerEl.className=`${e}__header`,this.fieldsEl=document.createElement("div"),this.fieldsEl.className=`${e}__fields`,this.actionsEl=document.createElement("div"),this.actionsEl.className=`${e}__actions`,this.submitBtn=document.createElement("db-button"),this.submitBtn.setAttribute("type","submit"),this.submitBtn.setAttribute("variant","primary"),this.resetBtn=document.createElement("db-button"),this.resetBtn.setAttribute("type","button"),this.resetBtn.setAttribute("variant","secondary"),this.resetBtn.addEventListener("click",this.boundReset),this.actionsEl.append(this.submitBtn,this.resetBtn),this.formEl.append(this.fieldsEl,this.actionsEl),this.append(this.headerEl,this.formEl)}syncAll(){this.syncClasses(),this.syncHeader(),this.renderFields(),this.syncActions()}syncClasses(){const t=this.getAttribute("columns")||"1",i=this.getAttribute("size")||"m",s=this.getAttribute("variant")||"default";this.className=[e,`${e}--columns-${t}`,`${e}--${i}`,`${e}--${s}`,this.hasAttribute("submit-loading")&&`${e}--loading`].filter(Boolean).join(" ")}syncHeader(){if(!this.headerEl)return;const t=this.getAttribute("title")||"",i=this.getAttribute("description")||"";if(this.headerEl.innerHTML="",t||i){if(this.headerEl.hidden=!1,t){const i=document.createElement("h3");i.className=`${e}__title`,i.textContent=t,this.headerEl.appendChild(i)}if(i){const t=document.createElement("p");t.className=`${e}__description`,t.textContent=i,this.headerEl.appendChild(t)}}else this.headerEl.hidden=!0}syncActions(){const e=this.getAttribute("submit-text")||"제출",t=this.getAttribute("reset-text")||"리셋",i=this.hasAttribute("show-reset");this.submitBtn&&(this.submitBtn.textContent=e,this.hasAttribute("submit-loading")?this.submitBtn.setAttribute("loading",""):this.submitBtn.removeAttribute("loading"),this.hasAttribute("submit-disabled")?this.submitBtn.setAttribute("disabled",""):this.submitBtn.removeAttribute("disabled")),this.resetBtn&&(this.resetBtn.textContent=t,this.resetBtn.hidden=!i)}renderFields(){if(!this.fieldsEl)return;const t=this.getAttribute("size")||"m";this.fieldsEl.innerHTML="",this.fieldWrappers.clear(),this.fields.forEach(i=>{const s=document.createElement("div");if(s.className=`${e}__field-wrapper ${e}__field-wrapper--${i.type||"text"}`,s.dataset.field=i.name,i.label&&("checkbox"!==i.type||i.checkboxGroup)){const t=document.createElement("label");if(t.className=`${e}__label`,t.htmlFor=`db-form-${i.name}`,t.textContent=i.label,i.required||i.validation?.required){const i=document.createElement("span");i.className=`${e}__required`,i.textContent="*",i.setAttribute("aria-hidden","true"),t.appendChild(i)}s.appendChild(t)}s.appendChild(this.createFieldControl(i,t)),this.fieldsEl.appendChild(s),this.fieldWrappers.set(i.name,s),this.refreshFieldState(i.name)})}refreshFieldState(t){const i=this.fields.find(e=>e.name===t),s=this.fieldWrappers.get(t);if(!i||!s)return;const r=Boolean(this.touched[t]&&this.errors[t]);s.classList.toggle(`${e}__field-wrapper--error`,r),s.querySelector(`.${e}__error`)?.remove(),s.querySelector(`.${e}__help`)?.remove();const a=s.querySelector(`.${e}__field, db-input, db-textarea, db-select, db-checkbox`);if(a&&(r?(a.setAttribute("error",""),a.setAttribute("error-message",this.errors[t])):(a.removeAttribute("error"),a.removeAttribute("error-message"))),r){const i=document.createElement("div");return i.className=`${e}__error`,i.textContent=this.errors[t],void s.appendChild(i)}if(i.helpText){const t=document.createElement("div");t.className=`${e}__help`,t.textContent=i.helpText,s.appendChild(t)}}refreshAllFieldStates(){this.fields.forEach(e=>this.refreshFieldState(e.name))}createFieldControl(t,i){const s=t.type||"text",r=this.values[t.name],a=Boolean(this.touched[t.name]&&this.errors[t.name]),n=a?this.errors[t.name]:"";if("textarea"===s){const s=document.createElement("db-textarea");return s.className=`${e}__field`,s.setAttribute("name",t.name),s.id=`db-form-${t.name}`,s.setAttribute("size",i),s.setAttribute("full-width",""),t.placeholder&&s.setAttribute("placeholder",t.placeholder),void 0!==r&&s.setAttribute("value",String(r)),t.disabled&&s.setAttribute("disabled",""),t.readOnly&&s.setAttribute("readonly",""),t.required&&s.setAttribute("required",""),t.maxLength&&s.setAttribute("max-length",String(t.maxLength)),a&&(s.setAttribute("error",""),s.setAttribute("error-message",n)),s.addEventListener("db-change",e=>{const i=e.detail;this.handleFieldChange(t,i.value)}),s.addEventListener("db-input",e=>{const i=e.detail;this.handleFieldChange(t,i.value,!1)}),s}if("select"===s){const s=document.createElement("db-select");return s.className=`${e}__field`,s.setAttribute("name",t.name),s.id=`db-form-${t.name}`,s.setAttribute("size",i),s.setAttribute("full-width",""),t.placeholder&&s.setAttribute("placeholder",t.placeholder),t.options&&s.setAttribute("options",JSON.stringify(t.options)),t.multiple&&s.setAttribute("multiple",""),t.disabled&&s.setAttribute("disabled",""),t.readOnly&&s.setAttribute("readonly",""),t.required&&s.setAttribute("required",""),void 0!==r&&s.setAttribute("value",Array.isArray(r)?JSON.stringify(r):String(r)),a&&(s.setAttribute("error",""),s.setAttribute("error-message",n)),s.addEventListener("db-change",e=>{const i=e.detail;this.handleFieldChange(t,i.value)}),s}if("radio"===s&&t.radioGroup){const s=document.createElement("div");return s.className=`${e}__radio-group`,s.setAttribute("role","radiogroup"),(t.options||[]).forEach(e=>{const a=document.createElement("db-radio");a.setAttribute("name",t.name),a.setAttribute("value",e.value),a.setAttribute("size",i),r===e.value&&a.setAttribute("checked",""),(t.disabled||e.disabled)&&a.setAttribute("disabled",""),a.textContent=e.label,a.addEventListener("db-change",i=>{i.detail.checked&&this.handleFieldChange(t,e.value)}),s.appendChild(a)}),s}if("checkbox"===s&&t.checkboxGroup){const s=document.createElement("div");s.className=`${e}__checkbox-group`;const a=Array.isArray(r)?r:[];return(t.options||[]).forEach(e=>{const r=document.createElement("db-checkbox");r.setAttribute("name",t.name),r.setAttribute("value",e.value),r.setAttribute("size",i),a.includes(e.value)&&r.setAttribute("checked",""),(t.disabled||e.disabled)&&r.setAttribute("disabled",""),r.textContent=e.label,r.addEventListener("db-change",i=>{const s=i.detail,r=Array.isArray(this.values[t.name])?[...this.values[t.name]]:[],a=s.checked?[...new Set([...r,e.value])]:r.filter(t=>t!==e.value);this.handleFieldChange(t,a)}),s.appendChild(r)}),s}if("checkbox"===s){const s=document.createElement("db-checkbox");return s.className=`${e}__field`,s.setAttribute("name",t.name),s.id=`db-form-${t.name}`,s.setAttribute("size",i),r&&s.setAttribute("checked",""),t.disabled&&s.setAttribute("disabled",""),t.readOnly&&s.setAttribute("readonly",""),t.required&&s.setAttribute("required",""),s.textContent=t.label||"",s.addEventListener("db-change",e=>{const i=e.detail;this.handleFieldChange(t,i.checked)}),s}const l=document.createElement("db-input");return l.className=`${e}__field`,l.setAttribute("name",t.name),l.id=`db-form-${t.name}`,l.setAttribute("type",s),l.setAttribute("size",i),l.setAttribute("full-width",""),t.placeholder&&l.setAttribute("placeholder",t.placeholder),void 0!==r&&!1!==r&&l.setAttribute("value",String(r)),t.disabled&&l.setAttribute("disabled",""),t.readOnly&&l.setAttribute("readonly",""),t.required&&l.setAttribute("required",""),void 0!==t.min&&l.setAttribute("min",String(t.min)),void 0!==t.max&&l.setAttribute("max",String(t.max)),void 0!==t.minLength&&l.setAttribute("minlength",String(t.minLength)),void 0!==t.maxLength&&l.setAttribute("maxlength",String(t.maxLength)),t.pattern&&l.setAttribute("pattern",t.pattern),a&&(l.setAttribute("error",""),l.setAttribute("error-message",n)),l.addEventListener("db-change",e=>{const i=e.detail;this.handleFieldChange(t,i.value)}),l.addEventListener("db-input",e=>{const i=e.detail;this.handleFieldChange(t,i.value,!1)}),l}handleFieldChange(e,t,i=!0){this.values[e.name]=t,i&&(this.touched[e.name]=!0);const s=this.validateField(e,t);this.errors[e.name]=s||"",this.refreshFieldState(e.name),this.dispatchEvent(new CustomEvent("db-change",{bubbles:!0,composed:!0,detail:{values:{...this.values}}}))}validateField(e,t){const i=e.validation||{};if((i.required??e.required)&&(null==t||""===t||!1===t||Array.isArray(t)&&0===t.length))return e.errorMessage||`${e.label||e.name}은(는) 필수입니다.`;if(void 0!==i.min&&Number(t)<i.min)return e.errorMessage||`최소값은 ${i.min}입니다.`;if(void 0!==i.max&&Number(t)>i.max)return e.errorMessage||`최대값은 ${i.max}입니다.`;if(void 0!==i.minLength&&String(t).length<i.minLength)return e.errorMessage||`최소 ${i.minLength}자 이상 입력해주세요.`;if(void 0!==i.maxLength&&String(t).length>i.maxLength)return e.errorMessage||`최대 ${i.maxLength}자까지 입력 가능합니다.`;const s=i.pattern||e.pattern;if(s&&String(t))try{if(!new RegExp(s).test(String(t)))return e.errorMessage||"올바른 형식으로 입력해주세요."}catch{}}validateForm(){let e=!0;return this.fields.forEach(t=>{const i=this.validateField(t,this.values[t.name]);i?(this.errors[t.name]=i,e=!1):this.errors[t.name]=""}),e}handleSubmit(e){e.preventDefault(),this.fields.forEach(e=>{this.touched[e.name]=!0}),this.validateForm()?this.dispatchEvent(new CustomEvent("db-submit",{bubbles:!0,composed:!0,detail:{values:{...this.values}}})):this.refreshAllFieldStates()}handleReset(e){e.preventDefault(),this.values={...this.initialValues},this.bootstrapValues(),this.errors={},this.touched={},this.renderFields(),this.dispatchEvent(new CustomEvent("db-reset",{bubbles:!0,composed:!0,detail:{values:{...this.values}}})),this.dispatchEvent(new CustomEvent("db-change",{bubbles:!0,composed:!0,detail:{values:{...this.values}}}))}}customElements.get("db-form")||customElements.define("db-form",DbForm);export{DbForm};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
interface GradientColor {
|
|
2
|
+
color: string;
|
|
3
|
+
position?: number;
|
|
4
|
+
}
|
|
5
|
+
declare class DbGradient extends HTMLElement {
|
|
6
|
+
static get observedAttributes(): string[];
|
|
7
|
+
connectedCallback(): void;
|
|
8
|
+
attributeChangedCallback(): void;
|
|
9
|
+
private getBool;
|
|
10
|
+
get colors(): GradientColor[];
|
|
11
|
+
set colors(value: GradientColor[] | string);
|
|
12
|
+
private parseColors;
|
|
13
|
+
private directionMap;
|
|
14
|
+
private colorStops;
|
|
15
|
+
private generateGradientStyle;
|
|
16
|
+
private generateAnimatedStyle;
|
|
17
|
+
private generateMeshStyle;
|
|
18
|
+
private updateUI;
|
|
19
|
+
}
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'db-gradient': DbGradient;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export { DbGradient };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t="designbase-wc-gradient";class DbGradient extends HTMLElement{static get observedAttributes(){return["colors","direction","size","variant","animation-duration","animation-delay","full-width","full-height"]}connectedCallback(){this.style.display="flex",this.updateUI()}attributeChangedCallback(){this.updateUI()}getBool(t){return this.hasAttribute(t)&&"false"!==this.getAttribute(t)}get colors(){return this.parseColors()}set colors(t){this.setAttribute("colors","string"==typeof t?t:JSON.stringify(t))}parseColors(){try{const t=JSON.parse(this.getAttribute("colors")||"[]");return Array.isArray(t)?t:[]}catch{return[]}}directionMap(t){return{"to-right":"to right","to-left":"to left","to-bottom":"to bottom","to-top":"to top","to-bottom-right":"to bottom right","to-bottom-left":"to bottom left","to-top-right":"to top right","to-top-left":"to top left",radial:"circle"}[t]}colorStops(t){return t.map(t=>{const e=void 0!==t.position?`${t.position}%`:"";return e?`${t.color} ${e}`:t.color}).join(", ")}generateGradientStyle(t,e){if(0===t.length)return{};const i=this.colorStops(t);return"radial"===e?{background:`radial-gradient(circle, ${i})`}:{background:`linear-gradient(${this.directionMap(e)}, ${i})`}}generateAnimatedStyle(t,e,i,o){const r=t.map((t,e)=>{const i=((void 0!==t.position?t.position:0)+20*e)%100;return`${t.color} ${i}%`}).join(", ");return{background:"radial"===e?`radial-gradient(circle, ${r})`:`linear-gradient(${this.directionMap(e)}, ${r})`,animation:`gradient-shift ${i}s ease-in-out ${o}s infinite`,backgroundSize:"200% 200%"}}generateMeshStyle(t){return{background:`conic-gradient(from 0deg, ${t.slice(0,4).map((t,e)=>{const i=void 0!==t.position?t.position:33.33*e;return`${t.color} ${i}%`}).join(", ")})`}}updateUI(){const e=this.parseColors(),i=this.getAttribute("direction")||"to-right",o=this.getAttribute("size")||"m",r=this.getAttribute("variant")||"default",n=Number(this.getAttribute("animation-duration")||3),a=Number(this.getAttribute("animation-delay")||0),s=this.getBool("full-width"),l=this.getBool("full-height");this.className=[t,`${t}--size-${o}`,`${t}--variant-${r}`,`${t}--direction-${i}`,s&&`${t}--full-width`,l&&`${t}--full-height`].filter(Boolean).join(" ");let d={};d="animated"===r?this.generateAnimatedStyle(e,i,n,a):"mesh"===r?this.generateMeshStyle(e):this.generateGradientStyle(e,i),Object.assign(this.style,d)}}customElements.get("db-gradient")||customElements.define("db-gradient",DbGradient);export{DbGradient};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* db-grid-background — 캔버스 기반 그리드 배경.
|
|
3
|
+
*
|
|
4
|
+
* 패턴은 항상 중앙을 기준으로 대칭 배치되며(가장자리 라인 없음),
|
|
5
|
+
* 단독 배경으로도, 다른 배경 위 데코 레이어(overlay)로도 쓸 수 있다.
|
|
6
|
+
* interactive/animate 로 마우스 인터랙션과 앰비언트 애니메이션을 켤 수 있다.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* <db-grid-background type="lines" size="32" fade="all"
|
|
10
|
+
* interactive animate height="240"></db-grid-background>
|
|
11
|
+
*/
|
|
12
|
+
declare class DbGridBackground extends HTMLElement {
|
|
13
|
+
private canvas?;
|
|
14
|
+
private ctx?;
|
|
15
|
+
private hlCanvas?;
|
|
16
|
+
private maskCanvas?;
|
|
17
|
+
private ro?;
|
|
18
|
+
private rafId?;
|
|
19
|
+
private lastTime;
|
|
20
|
+
private lastPointerMove;
|
|
21
|
+
private bandAngle;
|
|
22
|
+
private pointer;
|
|
23
|
+
private cssW;
|
|
24
|
+
private cssH;
|
|
25
|
+
private colorProbe?;
|
|
26
|
+
private themeObserver?;
|
|
27
|
+
private themeMedia?;
|
|
28
|
+
private tracePulses;
|
|
29
|
+
private traceSpawnAccumulator;
|
|
30
|
+
private onThemeMediaChange;
|
|
31
|
+
private onPointerMove;
|
|
32
|
+
static get observedAttributes(): string[];
|
|
33
|
+
connectedCallback(): void;
|
|
34
|
+
disconnectedCallback(): void;
|
|
35
|
+
attributeChangedCallback(): void;
|
|
36
|
+
private getBool;
|
|
37
|
+
private getNumber;
|
|
38
|
+
private getSizeStyle;
|
|
39
|
+
private getColorProbe;
|
|
40
|
+
private resolveCssColor;
|
|
41
|
+
private isDarkContext;
|
|
42
|
+
private resolveThemeColor;
|
|
43
|
+
private effectiveOpacity;
|
|
44
|
+
private effectiveColor;
|
|
45
|
+
private effectiveInterColor;
|
|
46
|
+
private traceDrawColor;
|
|
47
|
+
private traceDrawOpacity;
|
|
48
|
+
private parseColorRgb;
|
|
49
|
+
private crossArm;
|
|
50
|
+
private interactionMode;
|
|
51
|
+
private animationStyle;
|
|
52
|
+
private traceDirection;
|
|
53
|
+
private linesLayout;
|
|
54
|
+
private crossStyle;
|
|
55
|
+
private parseGuideEdges;
|
|
56
|
+
private guideFraction;
|
|
57
|
+
private isGridLines;
|
|
58
|
+
private isTraceableLines;
|
|
59
|
+
private get cfg();
|
|
60
|
+
private ensureCanvas;
|
|
61
|
+
private applyHostStyles;
|
|
62
|
+
private startObserving;
|
|
63
|
+
private observeDocumentTheme;
|
|
64
|
+
private bindPointer;
|
|
65
|
+
private handlePointerMove;
|
|
66
|
+
private measure;
|
|
67
|
+
/** 중앙을 기준으로 대칭 배치되며 (0, extent) 내부 좌표만 반환 → 가장자리 라인 없음 */
|
|
68
|
+
private axis;
|
|
69
|
+
private scheduleDraw;
|
|
70
|
+
private ensureLoop;
|
|
71
|
+
private drawFrame;
|
|
72
|
+
private easeInOutCubic;
|
|
73
|
+
private traceSegmentLength;
|
|
74
|
+
private pulseHead;
|
|
75
|
+
private updateTracePulses;
|
|
76
|
+
private traceLinePositions;
|
|
77
|
+
private spawnTracePulse;
|
|
78
|
+
private drawTracePulseSegment;
|
|
79
|
+
private drawTraceHighlight;
|
|
80
|
+
private drawPattern;
|
|
81
|
+
private drawGridLines;
|
|
82
|
+
private drawFrameGuides;
|
|
83
|
+
private drawCenterGuides;
|
|
84
|
+
private buildEnergyMask;
|
|
85
|
+
private applyFade;
|
|
86
|
+
}
|
|
87
|
+
declare global {
|
|
88
|
+
interface HTMLElementTagNameMap {
|
|
89
|
+
'db-grid-background': DbGridBackground;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
export { DbGridBackground };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const t="designbase-wc-grid-background";class DbGridBackground extends HTMLElement{constructor(){super(...arguments),this.lastTime=0,this.lastPointerMove=0,this.bandAngle=Math.random()*Math.PI*2,this.pointer={x:0,y:0,strength:0,inside:!1},this.cssW=0,this.cssH=0,this.tracePulses=[],this.traceSpawnAccumulator=0,this.onThemeMediaChange=()=>this.scheduleDraw(),this.onPointerMove=t=>this.handlePointerMove(t)}static get observedAttributes(){return["type","size","thickness","color","theme","opacity","fade","fade-size","background","overlay","interactive","interaction","interaction-color","interaction-radius","cross-size","cross-style","lines-layout","guide-inset","guide-edges","guide-x","guide-y","guide-span-x","guide-span-y","animated","animation-style","animation-speed","trace-length","trace-direction","width","height","border-radius"]}connectedCallback(){this.ensureCanvas(),this.applyHostStyles(),this.startObserving(),this.observeDocumentTheme(),this.bindPointer(),this.measure(),this.scheduleDraw()}disconnectedCallback(){this.ro?.disconnect(),this.ro=void 0,this.themeObserver?.disconnect(),this.themeObserver=void 0,window.removeEventListener("pointermove",this.onPointerMove),this.themeMedia?.removeEventListener("change",this.onThemeMediaChange),this.themeMedia=void 0,null!=this.rafId&&cancelAnimationFrame(this.rafId),this.rafId=void 0}attributeChangedCallback(){this.isConnected&&(this.applyHostStyles(),this.bindPointer(),this.measure(),this.scheduleDraw())}getBool(t){return this.hasAttribute(t)&&"false"!==this.getAttribute(t)}getNumber(t,e){const i=this.getAttribute(t);if(null===i||""===i)return e;const s=Number(i);return Number.isFinite(s)?s:e}getSizeStyle(t){if(!t)return;const e=Number(t);return Number.isFinite(e)?`${e}px`:t}getColorProbe(){if(!this.colorProbe){const t=document.createElement("span");t.setAttribute("aria-hidden","true"),Object.assign(t.style,{position:"absolute",width:"0",height:"0",overflow:"hidden",visibility:"hidden",pointerEvents:"none"}),this.appendChild(t),this.colorProbe=t}return this.colorProbe}resolveCssColor(t){if(!t.includes("var(")&&!t.startsWith("color-mix"))return t;const e=this.getColorProbe();e.style.color=t;const i=getComputedStyle(e).color;return i&&"rgba(0, 0, 0, 0)"!==i?i:t}isDarkContext(){const t=this.getAttribute("theme");if("dark"===t)return!0;if("light"===t)return!1;const e=document.documentElement,i=e.getAttribute("data-color-mode");if("dark"===i)return!0;if("light"===i)return!1;const s=e.getAttribute("data-theme");return"dark"===s||"light"!==s&&window.matchMedia("(prefers-color-scheme: dark)").matches}resolveThemeColor(t,e,i,s){if(t)return this.resolveCssColor(t);const r=this.getColorProbe(),a=this.isDarkContext();r.style.color=`var(${e}, ${a?s:i})`;const o=getComputedStyle(r).color;return o&&"rgba(0, 0, 0, 0)"!==o?o:a?s:i}effectiveOpacity(){const t=this.getAttribute("opacity");return null!==t&&""!==t?this.getNumber("opacity",.05):this.isDarkContext()?.1:.05}effectiveColor(){const t=this.getAttribute("color");return t?this.resolveCssColor(t):this.isDarkContext()?"#ffffff":"#000000"}effectiveInterColor(){const t=this.getAttribute("interaction-color");return t?this.resolveCssColor(t):this.effectiveColor()}traceDrawColor(t){return this.hasAttribute("interaction-color")?t.interColor:t.color}traceDrawOpacity(t){const e=t.opacity;return this.hasAttribute("interaction-color")?Math.min(1,e+.2):Math.min(1,3*e)}parseColorRgb(t){const e=this.resolveCssColor(t).match(/rgba?\(\s*(\d+)[,\s]+(\d+)[,\s]+(\d+)/);return e?[Number(e[1]),Number(e[2]),Number(e[3])]:this.isDarkContext()?[255,255,255]:[0,0,0]}crossArm(t,e,i){return i>0?i<=1?t*i:i:Math.min(.32*t,8+1.5*e)}interactionMode(){const t=this.getAttribute("interaction");if("glow"===t||"magnet"===t||"rotate"===t||"none"===t)return t;if(!this.getBool("interactive"))return"none";const e=this.getAttribute("type")||"lines";return"dots"===e?"magnet":"cross"===e?"rotate":"glow"}animationStyle(){const t=this.getAttribute("animation-style")||"band";return"trace"===t||"both"===t?t:"band"}traceDirection(){const t=this.getAttribute("trace-direction")||"both";return"vertical"===t||"horizontal"===t?t:"both"}linesLayout(){const t=this.getAttribute("lines-layout")||"grid";return"frame"===t||"center"===t?t:"grid"}crossStyle(){return"line"===(this.getAttribute("cross-style")||"plus")?"line":"plus"}parseGuideEdges(t){const e=(t||"top,right,bottom,left").split(",").map(t=>t.trim().toLowerCase()).filter(Boolean);return new Set(e)}guideFraction(t,e){const i=this.getAttribute(t);if(null===i||""===i)return e;const s=Number(i);return Number.isFinite(s)?Math.min(1,Math.max(0,s)):e}isGridLines(t){return"lines"===t.type&&"grid"===t.linesLayout}isTraceableLines(t){return"lines"===t.type&&("grid"===t.linesLayout||"frame"===t.linesLayout)}get cfg(){return{type:this.getAttribute("type")||"lines",linesLayout:this.linesLayout(),crossStyle:this.crossStyle(),size:Math.max(4,this.getNumber("size",32)),thickness:Math.max(.5,this.getNumber("thickness",1)),color:this.effectiveColor(),opacity:this.effectiveOpacity(),fade:this.getAttribute("fade")||"none",fadeSize:this.getNumber("fade-size",.22),interaction:this.interactionMode(),interColor:this.effectiveInterColor(),interRadius:Math.max(20,this.getNumber("interaction-radius",130)),crossSize:this.getNumber("cross-size",0),guideInset:Math.max(0,this.getNumber("guide-inset",16)),guideEdges:this.parseGuideEdges(this.getAttribute("guide-edges")),guideX:this.guideFraction("guide-x",.5),guideY:this.guideFraction("guide-y",.5),guideSpanX:Math.max(0,this.getNumber("guide-span-x",0)),guideSpanY:Math.max(0,this.getNumber("guide-span-y",0)),animate:this.getBool("animated"),animSpeed:this.getNumber("animation-speed",1),animationStyle:this.animationStyle(),traceLength:this.getNumber("trace-length",0),traceDirection:this.traceDirection()}}ensureCanvas(){if(this.canvas)return;const t=document.createElement("canvas");Object.assign(t.style,{display:"block",width:"100%",height:"100%",pointerEvents:"none"}),this.appendChild(t),this.canvas=t,this.ctx=t.getContext("2d")??void 0,this.hlCanvas=document.createElement("canvas"),this.maskCanvas=document.createElement("canvas")}applyHostStyles(){const e=this.getBool("overlay");this.className=[t,`${t}--${this.getAttribute("type")||"lines"}`,e&&`${t}--overlay`].filter(Boolean).join(" "),this.style.display="block",this.style.boxSizing="border-box",this.style.pointerEvents="none";const i=this.getAttribute("background");if(this.style.backgroundColor=i?this.resolveCssColor(i):"transparent",e)this.style.position="absolute",this.style.inset="0",this.style.width="100%",this.style.height="100%",this.style.zIndex||(this.style.zIndex="1");else{"absolute"!==this.style.position&&this.style.position||(this.style.position="relative");const t=this.getSizeStyle(this.getAttribute("width")),e=this.getSizeStyle(this.getAttribute("height"));t&&(this.style.width=t),e&&(this.style.height=e)}const s=this.getSizeStyle(this.getAttribute("border-radius"));this.style.borderRadius=s||"",this.canvas&&(this.canvas.style.borderRadius=s||"")}startObserving(){this.ro||(this.ro=new ResizeObserver(()=>{this.measure(),this.scheduleDraw()}),this.ro.observe(this))}observeDocumentTheme(){this.themeObserver||"undefined"!=typeof MutationObserver&&(this.themeObserver=new MutationObserver(()=>this.scheduleDraw()),this.themeObserver.observe(document.documentElement,{attributes:!0,attributeFilter:["data-theme","data-color-mode","class"]}))}bindPointer(){window.removeEventListener("pointermove",this.onPointerMove),this.themeMedia?.removeEventListener("change",this.onThemeMediaChange),this.themeMedia||(this.themeMedia=window.matchMedia("(prefers-color-scheme: dark)")),this.themeMedia.addEventListener("change",this.onThemeMediaChange),"none"!==this.interactionMode()?window.addEventListener("pointermove",this.onPointerMove,{passive:!0}):(this.pointer.strength=0,this.pointer.inside=!1)}handlePointerMove(t){if(!this.canvas)return;const e=this.canvas.getBoundingClientRect(),i=t.clientX-e.left,s=t.clientY-e.top,r=this.cfg.interRadius,a=i>=-r&&i<=e.width+r&&s>=-r&&s<=e.height+r;this.pointer.x=i,this.pointer.y=s,this.pointer.inside=a,a&&(this.pointer.strength=1,this.lastPointerMove=performance.now(),this.ensureLoop())}measure(){if(!this.canvas||!this.ctx)return;const t=this.getBoundingClientRect(),e=Math.max(1,Math.round(t.width)),i=Math.max(1,Math.round(t.height));this.cssW=e,this.cssH=i,this.tracePulses=[],this.traceSpawnAccumulator=0;const s=Math.min(2,window.devicePixelRatio||1);[this.canvas,this.hlCanvas,this.maskCanvas].forEach(t=>{t&&(t.width=Math.round(e*s),t.height=Math.round(i*s))})}axis(t,e){const i=t/2,s=[],r=Math.ceil((0-i)/e),a=Math.floor((t-i)/e);for(let o=r;o<=a;o++){const r=i+o*e;r>.75&&r<t-.75&&s.push(r)}return s}scheduleDraw(){const t=this.cfg;this.drawFrame(performance.now(),0),t.animate||this.pointer.strength>.001?this.ensureLoop():null!=this.rafId&&(cancelAnimationFrame(this.rafId),this.rafId=void 0)}ensureLoop(){if(null!=this.rafId)return;this.lastTime=performance.now();const tick=t=>{const e=Math.min(.05,(t-this.lastTime)/1e3);this.lastTime=t,"none"!==this.interactionMode()?t-this.lastPointerMove>90&&(this.pointer.strength=Math.max(0,this.pointer.strength-2.2*e)):this.pointer.strength=0,this.drawFrame(t,e);this.cfg.animate||this.pointer.strength>.001?this.rafId=requestAnimationFrame(tick):(this.rafId=void 0,this.drawFrame(t,e))};this.rafId=requestAnimationFrame(tick)}drawFrame(t,e){const i=this.ctx;if(!i||!this.canvas)return;const{cssW:s,cssH:r}=this;if(s<=0||r<=0)return;const a=this.cfg,o=Math.min(2,window.devicePixelRatio||1),n=t/1e3;i.setTransform(o,0,0,o,0,0),i.clearRect(0,0,s,r),this.drawPattern(i,s,r,a,a.color,a.opacity,n),a.animate&&this.isTraceableLines(a)&&("trace"===a.animationStyle||"both"===a.animationStyle)&&this.drawTraceHighlight(i,s,r,a,e);if(("glow"===a.interaction&&this.pointer.strength>.001||a.animate&&"trace"!==a.animationStyle&&(this.isGridLines(a)||"diagonal"===a.type))&&this.hlCanvas&&this.maskCanvas){const t=this.hlCanvas.getContext("2d"),e=this.maskCanvas.getContext("2d");t&&e&&(t.setTransform(o,0,0,o,0,0),t.clearRect(0,0,s,r),this.drawPattern(t,s,r,a,a.interColor,Math.min(1,a.opacity+.4),n),this.buildEnergyMask(e,s,r,o,a,n),t.setTransform(1,0,0,1,0,0),t.globalCompositeOperation="destination-in",t.drawImage(this.maskCanvas,0,0),t.globalCompositeOperation="source-over",i.setTransform(1,0,0,1,0,0),i.globalCompositeOperation="lighter",i.drawImage(this.hlCanvas,0,0),i.globalCompositeOperation="source-over",i.setTransform(o,0,0,o,0,0))}this.applyFade(i,s,r,a)}easeInOutCubic(t){const e=Math.min(1,Math.max(0,t));return e<.5?4*e*e*e:1-(-2*e+2)**3/2}traceSegmentLength(t){return t.traceLength>0?t.traceLength:28}pulseHead(t,e){const i=this.easeInOutCubic(t.progress);return-t.length+i*(e+2*t.length)}updateTracePulses(t,e,i,s){const r=this.traceSegmentLength(i),a=Math.min(6,Math.max(2,Math.floor(t*e/(i.size*i.size*180)))),o=(.38+.52*Math.random())/Math.max(.25,i.animSpeed);for(this.traceSpawnAccumulator+=s;this.traceSpawnAccumulator>=o&&this.tracePulses.length<a&&(this.traceSpawnAccumulator-=o,this.spawnTracePulse(t,e,i,r),!(Math.random()>.45)););this.tracePulses=this.tracePulses.filter(t=>(t.progress+=s/t.duration,t.progress<.1?t.alpha=t.progress/.1:t.progress>.9?t.alpha=(1-t.progress)/.1:t.alpha=1,t.progress<1&&t.alpha>.02))}traceLinePositions(t,e,i){if("frame"===i.linesLayout){const s=Math.min(i.guideInset,t/2-1,e/2-1),r=i.guideEdges,a=[],o=[];return r.has("left")&&a.push(s),r.has("right")&&a.push(t-s),r.has("top")&&o.push(s),r.has("bottom")&&o.push(e-s),{xs:a,ys:o}}return{xs:this.axis(t,i.size),ys:this.axis(e,i.size)}}spawnTracePulse(t,e,i,s){const{xs:r,ys:a}=this.traceLinePositions(t,e,i),o="horizontal"!==i.traceDirection&&r.length>0,n="vertical"!==i.traceDirection&&a.length>0;if(!o&&!n)return;let h;h=o&&n?Math.random()<.5?"v":"h":o?"v":"h";const l=s,c=(("v"===h?e:t)+2*l)/(88*Math.max(.25,i.animSpeed)),d={axis:h,linePos:"v"===h?r[Math.floor(Math.random()*r.length)]:a[Math.floor(Math.random()*a.length)],progress:0,length:l,duration:c,alpha:0};this.tracePulses.push(d)}drawTracePulseSegment(t,e,i,s,r){const[a,o,n]=this.parseColorRgb(this.traceDrawColor(r)),h=Math.min(1,this.traceDrawOpacity(r)*e.alpha),l="v"===e.axis?s:i,c=this.pulseHead(e,l);let d,u,g,m;if("v"===e.axis?(d=g=e.linePos,m=Math.min(s,c),u=Math.max(0,c-e.length)):(u=m=e.linePos,g=Math.min(i,c),d=Math.max(0,c-e.length)),Math.abs(g-d)<.5&&Math.abs(m-u)<.5)return;const p=t.createLinearGradient(d,u,g,m);p.addColorStop(0,`rgba(${a},${o},${n},0)`),p.addColorStop(.18,`rgba(${a},${o},${n},${.2*h})`),p.addColorStop(.5,`rgba(${a},${o},${n},${h})`),p.addColorStop(.82,`rgba(${a},${o},${n},${.2*h})`),p.addColorStop(1,`rgba(${a},${o},${n},0)`),t.save(),t.strokeStyle=p,t.lineCap="round",t.globalAlpha=e.alpha,t.shadowColor=`rgba(${a},${o},${n},${.9*h})`,t.shadowBlur=12+5*r.thickness,t.lineWidth=Math.max(1.1,r.thickness+.6),t.beginPath(),t.moveTo(d,u),t.lineTo(g,m),t.stroke(),t.shadowBlur=0,t.lineWidth=Math.max(.6,.35*r.thickness),t.globalAlpha=Math.min(1,1.1*e.alpha),t.stroke(),t.restore()}drawTraceHighlight(t,e,i,s,r){this.updateTracePulses(e,i,s,r),t.save(),t.globalCompositeOperation="lighter",this.tracePulses.forEach(r=>this.drawTracePulseSegment(t,r,e,i,s)),t.restore()}drawPattern(t,e,i,s,r,a,o){const{type:n,size:h,thickness:l}=s;if(t.save(),t.globalAlpha=a,t.strokeStyle=r,t.fillStyle=r,t.lineWidth=l,t.lineCap="round","lines"===n)"frame"===s.linesLayout?this.drawFrameGuides(t,e,i,s):"center"===s.linesLayout?this.drawCenterGuides(t,e,i,s):this.drawGridLines(t,e,i,s.size);else if("dots"===n){const r=this.axis(e,h),a=this.axis(i,h),n=Math.max(.75,l),c="magnet"===s.interaction&&this.pointer.strength>.001,d=this.pointer,u=s.interRadius;r.forEach((e,i)=>{a.forEach((r,a)=>{let l=e,g=r,m=n;if(c&&d.inside){const t=d.x-e,i=d.y-r,s=Math.hypot(t,i);if(s<u){const e=(1-s/u)*d.strength;m=n*(1+1.6*e),l+=t/(s||1)*e*h*.28,g+=i/(s||1)*e*h*.28}}if(s.animate){m*=.75+.25*Math.sin(2*o*s.animSpeed+.9*(i+a))}t.beginPath(),t.arc(l,g,m,0,2*Math.PI),t.fill()})})}else if("cross"===n){const r=this.axis(e,h),a=this.axis(i,h),o=this.crossArm(h,l,s.crossSize),n="rotate"===s.interaction&&this.pointer.strength>.001,c=this.pointer;r.forEach(e=>{a.forEach(i=>{if(t.save(),t.translate(e,i),n&&c.inside&&c.strength>.01){const s=c.x-e,r=c.y-i;t.rotate(Math.atan2(r,s))}t.beginPath(),"line"===s.crossStyle?(t.moveTo(-o,0),t.lineTo(o,0)):(t.moveTo(-o,0),t.lineTo(o,0),t.moveTo(0,-o),t.lineTo(0,o)),t.stroke(),t.restore()})})}else{t.save(),t.beginPath(),t.rect(0,0,e,i),t.clip(),t.translate(e/2,i/2),t.rotate(Math.PI/4);const s=Math.hypot(e,i);t.beginPath();for(let e=-s;e<=s;e+=h)t.moveTo(e,-s),t.lineTo(e,s),t.moveTo(-s,e),t.lineTo(s,e);t.stroke(),t.restore()}t.restore()}drawGridLines(t,e,i,s){const r=this.axis(e,s),a=this.axis(i,s);t.beginPath(),r.forEach(e=>{t.moveTo(e,0),t.lineTo(e,i)}),a.forEach(i=>{t.moveTo(0,i),t.lineTo(e,i)}),t.stroke()}drawFrameGuides(t,e,i,s){const r=Math.min(s.guideInset,e/2-1,i/2-1),a=s.guideEdges;t.beginPath(),a.has("top")&&(t.moveTo(0,r),t.lineTo(e,r)),a.has("bottom")&&(t.moveTo(0,i-r),t.lineTo(e,i-r)),a.has("left")&&(t.moveTo(r,0),t.lineTo(r,i)),a.has("right")&&(t.moveTo(e-r,0),t.lineTo(e-r,i)),t.stroke()}drawCenterGuides(t,e,i,s){const r=e*s.guideX,a=i*s.guideY,o=s.guideSpanX>0?s.guideSpanX:e,n=s.guideSpanY>0?s.guideSpanY:i;t.beginPath(),t.moveTo(r-o/2,a),t.lineTo(r+o/2,a),t.moveTo(r,a-n/2),t.lineTo(r,a+n/2),t.stroke()}buildEnergyMask(t,e,i,s,r,a){if(t.setTransform(s,0,0,s,0,0),t.clearRect(0,0,e,i),t.globalCompositeOperation="lighter","glow"===r.interaction&&this.pointer.strength>.001&&this.pointer.inside){const s=r.interRadius,a=t.createRadialGradient(this.pointer.x,this.pointer.y,0,this.pointer.x,this.pointer.y,s);a.addColorStop(0,`rgba(255,255,255,${.9*this.pointer.strength})`),a.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=a,t.fillRect(0,0,e,i)}if(r.animate&&"trace"!==r.animationStyle){t.save(),t.translate(e/2,i/2),t.rotate(this.bandAngle);const s=Math.hypot(e,i),o=Math.max(60,.18*s),n=s+o,h=90*a*r.animSpeed%(2*n)-n,l=t.createLinearGradient(h-o,0,h+o,0);l.addColorStop(0,"rgba(255,255,255,0)"),l.addColorStop(.5,"rgba(255,255,255,0.55)"),l.addColorStop(1,"rgba(255,255,255,0)"),t.fillStyle=l,t.fillRect(-s,-s,2*s,2*s),t.restore()}t.globalCompositeOperation="source-over"}applyFade(t,e,i,s){const r=s.fade;if("none"===r)return;const a=s.fadeSize,o=a>1?a:Math.max(8,e*a),n=a>1?a:Math.max(8,i*a);t.save(),t.globalCompositeOperation="destination-in";const edge=s=>{let r;"top"===s?(r=t.createLinearGradient(0,0,0,n),r.addColorStop(0,"rgba(0,0,0,0)"),r.addColorStop(1,"rgba(0,0,0,1)")):"bottom"===s?(r=t.createLinearGradient(0,i-n,0,i),r.addColorStop(0,"rgba(0,0,0,1)"),r.addColorStop(1,"rgba(0,0,0,0)")):"left"===s?(r=t.createLinearGradient(0,0,o,0),r.addColorStop(0,"rgba(0,0,0,0)"),r.addColorStop(1,"rgba(0,0,0,1)")):(r=t.createLinearGradient(e-o,0,e,0),r.addColorStop(0,"rgba(0,0,0,1)"),r.addColorStop(1,"rgba(0,0,0,0)")),t.fillStyle=r,t.fillRect(0,0,e,i)};if("vignette"===r){const s=t.createRadialGradient(e/2,i/2,.2*Math.min(e,i),e/2,i/2,Math.hypot(e,i)/2);s.addColorStop(0,"rgba(0,0,0,1)"),s.addColorStop(1,"rgba(0,0,0,0)"),t.fillStyle=s,t.fillRect(0,0,e,i)}else{("top"===r?["top"]:"bottom"===r?["bottom"]:"left"===r?["left"]:"right"===r?["right"]:"vertical"===r?["top","bottom"]:"horizontal"===r?["left","right"]:["top","bottom","left","right"]).forEach(edge)}t.restore()}}customElements.get("db-grid-background")||customElements.define("db-grid-background",DbGridBackground);export{DbGridBackground};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
declare class DbGrid extends HTMLElement {
|
|
2
|
+
static get observedAttributes(): string[];
|
|
3
|
+
connectedCallback(): void;
|
|
4
|
+
attributeChangedCallback(): void;
|
|
5
|
+
private syncClasses;
|
|
6
|
+
}
|
|
7
|
+
declare class DbGridItem extends HTMLElement {
|
|
8
|
+
static get observedAttributes(): string[];
|
|
9
|
+
connectedCallback(): void;
|
|
10
|
+
attributeChangedCallback(): void;
|
|
11
|
+
private syncClasses;
|
|
12
|
+
}
|
|
13
|
+
declare global {
|
|
14
|
+
interface HTMLElementTagNameMap {
|
|
15
|
+
'db-grid': DbGrid;
|
|
16
|
+
'db-grid-item': DbGridItem;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { DbGrid, DbGridItem };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class DbGrid extends HTMLElement{static get observedAttributes(){return["columns","gap","fixed","no-padding","full-width"]}connectedCallback(){this.syncClasses()}attributeChangedCallback(){this.syncClasses()}syncClasses(){const t=Math.max(1,Number(this.getAttribute("columns")||12)),s=this.getAttribute("gap")||"m",e=["none","xs","s","m","l","xl"].includes(s)?s:"m",i={none:"0",xs:"var(--db-gap-xs)",s:"var(--db-gap-s)",m:"var(--db-gap-m)",l:"var(--db-gap-l)",xl:"var(--db-gap-xl)"};this.className=["designbase-wc-grid",`designbase-wc-grid--gap-${e}`,this.hasAttribute("fixed")&&"designbase-wc-grid--fixed",this.hasAttribute("no-padding")&&"designbase-wc-grid--no-padding",this.hasAttribute("full-width")&&"designbase-wc-grid--full-width"].filter(Boolean).join(" "),this.style.setProperty("--db-wc-grid-columns",String(t)),this.style.display="grid",this.style.gridTemplateColumns=`repeat(${t}, minmax(0, 1fr))`,this.style.gap=i[e]||i.m,this.style.alignItems="start"}}class DbGridItem extends HTMLElement{static get observedAttributes(){return["span","span-sm","span-md","span-lg","span-xl"]}connectedCallback(){this.syncClasses()}attributeChangedCallback(){this.syncClasses()}syncClasses(){const parseSpan=(t,s=12)=>{const e=Number(t??s);return Math.min(12,Math.max(1,Number.isFinite(e)?e:s))},t=parseSpan(this.getAttribute("span")),s=parseSpan(this.getAttribute("span-sm"),t),e=parseSpan(this.getAttribute("span-md"),s),i=parseSpan(this.getAttribute("span-lg"),e),a=parseSpan(this.getAttribute("span-xl"),i);this.className="designbase-wc-grid__item",this.style.gridColumn=`span ${t}`,this.style.setProperty("--db-wc-grid-item-span",String(t)),this.style.setProperty("--db-wc-grid-item-span-sm",String(s)),this.style.setProperty("--db-wc-grid-item-span-md",String(e)),this.style.setProperty("--db-wc-grid-item-span-lg",String(i)),this.style.setProperty("--db-wc-grid-item-span-xl",String(a))}}customElements.get("db-grid")||customElements.define("db-grid",DbGrid),customElements.get("db-grid-item")||customElements.define("db-grid-item",DbGridItem);export{DbGrid,DbGridItem};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const l={"arrow-bar-left":'<path fill="currentColor" d="M20.75 20h-1.5V4h1.5zM11.03 6.53l-4.72 4.72H16v1.5H6.31l4.72 4.72-1.06 1.06L3.44 12l6.53-6.53z"/>',"arrow-bar-right":'<path fill="currentColor" d="M4.75 20h-1.5V4h1.5zm15.81-8-6.53 6.53-1.06-1.06 4.72-4.72H8v-1.5h9.69l-4.72-4.72 1.06-1.06z"/>',award:'<path fill="currentColor" d="M11.753 15.5c-1.8 0-3.5-.7-4.77-1.98a6.74 6.74 0 0 1-1.98-4.77c0-1.8.7-3.5 1.98-4.77A6.74 6.74 0 0 1 11.753 2c1.8 0 3.5.7 4.77 1.98a6.74 6.74 0 0 1 1.98 4.77c0 1.8-.7 3.5-1.98 4.77a6.74 6.74 0 0 1-4.77 1.98m0-12c-1.4 0-2.72.55-3.71 1.54a5.22 5.22 0 0 0-1.54 3.71c0 1.4.55 2.72 1.54 3.71a5.22 5.22 0 0 0 3.71 1.54c1.4 0 2.72-.55 3.71-1.54a5.22 5.22 0 0 0 1.54-3.71c0-1.4-.55-2.72-1.54-3.71a5.22 5.22 0 0 0-3.71-1.54"/><path fill="currentColor" d="M15.313 21.5a.74.74 0 0 1-.64-.37l-3.56-5.96a.751.751 0 1 1 1.29-.77l2.86 4.8 1.06-2.07a.76.76 0 0 1 .72-.41l2.33.17-2.95-4.99a.76.76 0 0 1 .26-1.03c.36-.21.82-.09 1.03.26l3.68 6.22c.14.24.14.54 0 .78s-.4.37-.69.35l-3.27-.23-1.45 2.83c-.12.24-.37.4-.64.41h-.02z"/><path fill="currentColor" d="M8.193 21.5h-.02c-.27 0-.52-.17-.64-.41l-1.45-2.83-3.28.23a.75.75 0 0 1-.69-.35.73.73 0 0 1 0-.78l3.69-6.18c.21-.36.67-.47 1.03-.26s.47.67.26 1.03l-2.95 4.95 2.34-.17c.31-.01.58.14.72.41l1.06 2.07 2.86-4.8c.21-.36.67-.47 1.03-.26s.47.67.26 1.03l-3.56 5.96c-.14.23-.38.37-.64.37z"/>',apple:'<path fill="currentColor" fill-rule="evenodd" d="M18.644 18.648q-.807 1.15-1.316 1.592-.787.723-1.692.744-.649.001-1.562-.373-.914-.372-1.683-.371-.805-.001-1.73.371-.924.375-1.495.393-.866.038-1.729-.764-.55-.48-1.377-1.648-.885-1.245-1.455-2.891-.61-1.78-.611-3.447 0-1.91.826-3.292a4.86 4.86 0 0 1 1.73-1.751 4.65 4.65 0 0 1 2.34-.662q.69.001 1.81.422t1.436.422q.237 0 1.593-.498 1.279-.46 2.163-.384 2.4.192 3.6 1.895-2.145 1.301-2.123 3.637.02 1.82 1.317 3.023a4.3 4.3 0 0 0 1.315.863q-.159.46-.336.882a10.3 10.3 0 0 1-1.021 1.837M14.959 5.039c-.836.976-1.846 1.541-2.941 1.452a3 3 0 0 1-.021-.36c0-.913.396-1.889 1.103-2.688q.528-.607 1.343-1.009.813-.397 1.536-.435.02.192.019.381-.001 1.426-1.039 2.659" clip-rule="evenodd"/>',"play-store":'<path fill="currentColor" fill-rule="evenodd" d="M15.911 8.659 6.36 3.29c-.633-.342-1.226-.39-1.746-.016l8.34 8.34zm3.578 4.69c.6-.336.929-.812.929-1.34 0-.527-.329-1.004-.928-1.34l-2.783-1.563-3.133 3.132 2.841 2.84zM4 4.659v14.706c0 .38.084.709.236.97l8.097-8.098L4.1 4.002c-.064.197-.1.417-.1.658m.902 16.25q.232.09.495.09.47 0 .968-.275l9.255-5.197-2.666-2.67z" clip-rule="evenodd"/>',"arrow-right":'<path fill="currentColor" d="m20.06 12-7.53 7.53-1.06-1.06 5.72-5.72H4v-1.5h13.19l-5.72-5.72 1.06-1.06z"/>',star:'<path fill="currentColor" fill-rule="evenodd" d="M12 1.25a.75.75 0 0 1 .673.419l2.926 5.945 6.509.944a.75.75 0 0 1 .417 1.278l-4.718 4.624 1.132 6.511a.75.75 0 0 1-1.083.796L12 18.744l-5.856 3.023a.75.75 0 0 1-1.083-.796l1.133-6.511-4.719-4.624a.75.75 0 0 1 .417-1.278l6.51-.944 2.925-5.945A.75.75 0 0 1 12 1.25m0 2.449L9.573 8.63a.75.75 0 0 1-.565.411l-5.4.783 3.917 3.84a.75.75 0 0 1 .214.664l-.941 5.412 4.858-2.508a.75.75 0 0 1 .688 0l4.858 2.508-.94-5.412a.75.75 0 0 1 .213-.665l3.918-3.84-5.4-.782a.75.75 0 0 1-.566-.41z" clip-rule="evenodd"/>',"star-filled":'<path fill="currentColor" d="M23 9c-.1-.4-.4-.6-.8-.7l-6.4-.9-2.9-5.8c-.3-.7-1.5-.7-1.8 0L8.2 7.4l-6.4.9c-.4 0-.7.3-.8.7s0 .8.3 1l4.6 4.5-1.1 6.4c0 .4 0 .8.4 1 .3.2.7.3 1.1 0l5.7-3 5.7 3c.1 0 .3.1.5.1s.4 0 .6-.2c.3-.2.5-.6.4-1l-1.1-6.4 4.6-4.5c.3-.3.4-.7.3-1z"/>',"star-half":'<path fill="currentColor" d="M8.9 8.3 2 9.3l5 4.8L5.8 21l6.2-3.2V2z"/><path fill="currentColor" fill-rule="evenodd" d="M12 1.25a.75.75 0 0 1 .673.419l2.926 5.945 6.509.944a.75.75 0 0 1 .417 1.278l-4.718 4.624 1.132 6.511a.75.75 0 0 1-1.083.796L12 18.744l-5.856 3.023a.75.75 0 0 1-1.083-.796l1.133-6.511-4.719-4.624a.75.75 0 0 1 .417-1.278l6.51-.944 2.925-5.945A.75.75 0 0 1 12 1.25m0 2.449L9.573 8.63a.75.75 0 0 1-.565.411l-5.4.783 3.917 3.84a.75.75 0 0 1 .214.664l-.941 5.412 4.858-2.508a.75.75 0 0 1 .688 0l4.858 2.508-.94-5.412a.75.75 0 0 1 .213-.665l3.918-3.84-5.4-.782a.75.75 0 0 1-.566-.41z" clip-rule="evenodd"/>',"trending-up":'<path fill="currentColor" d="M22 11V5h-6"/><path fill="currentColor" fill-rule="evenodd" d="M21.53 6.53 13 15.06l-3-3-6.47 6.47-1.06-1.06L10 9.94l3 3 7.47-7.47z" clip-rule="evenodd"/>',cart:'<path fill="currentColor" d="M3 2.25c.945 0 1.714.75 1.747 1.688L4.94 6.25h16.899l-1.167 10.5h-2.093a2.75 2.75 0 1 1-3.156 0H9.578a2.75 2.75 0 1 1-3.156 0H4.31L3.253 4.063 3.25 4.03V4A.25.25 0 0 0 3 3.75H1v-1.5zm5 15.5a1.25 1.25 0 1 0-.001 2.499A1.25 1.25 0 0 0 8 17.75m9 0a1.25 1.25 0 1 0-.001 2.499A1.25 1.25 0 0 0 17 17.75m-11.31-2.5h13.64l.832-7.5H5.064z"/>',"bell-active":'<path fill="currentColor" fill-rule="evenodd" d="M6.75 10.015V13c0 1.445-.466 2.453-1.06 3.25h12.62c-.594-.797-1.06-1.805-1.06-3.25v-2.985c-.047-1.117-.55-2.449-1.465-3.497C14.879 5.479 13.6 4.75 12 4.75s-2.879.73-3.785 1.768c-.914 1.048-1.418 2.38-1.465 3.497m.335-4.483C8.229 4.221 9.9 3.25 12 3.25s3.771.97 4.915 2.282c1.132 1.298 1.777 2.96 1.834 4.44l.001.028v3c0 1.67.788 2.477 1.78 3.47a.75.75 0 0 1-.53 1.28H4a.75.75 0 0 1-.53-1.28c.992-.992 1.78-1.8 1.78-3.47V9.971c.057-1.48.703-3.141 1.835-4.439" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M9 16.25a.75.75 0 0 1 .75.75v1c0 1.286.964 2.25 2.25 2.25s2.25-.964 2.25-2.25v-1a.75.75 0 0 1 1.5 0v1c0 2.114-1.636 3.75-3.75 3.75S8.25 20.114 8.25 18v-1a.75.75 0 0 1 .75-.75M17.424 2.52a.75.75 0 0 1 1.056-.096c1.307 1.089 2.463 2.786 3.19 4.24a.75.75 0 1 1-1.34.671c-.673-1.345-1.717-2.848-2.81-3.759a.75.75 0 0 1-.096-1.056M6.576 2.52a.75.75 0 0 1-.096 1.056c-1.093.911-2.137 2.414-2.81 3.76a.75.75 0 0 1-1.34-.671c.727-1.455 1.883-3.152 3.19-4.241a.75.75 0 0 1 1.056.096M12 1.25a.75.75 0 0 1 .75.75v2a.75.75 0 0 1-1.5 0V2a.75.75 0 0 1 .75-.75" clip-rule="evenodd"/>',"caret-down-filled":'<path fill="currentColor" d="m12 14.5 5-5H7z"/>',"caret-updown-filled":'<path fill="currentColor" fill-rule="evenodd" d="m7 10 5-5 5 5zM17 14l-5 5-5-5z" clip-rule="evenodd"/>',"chevron-down":'<path fill="currentColor" fill-rule="evenodd" d="m5.47 9.53 1.06-1.06L12 13.94l5.47-5.47 1.06 1.06L12 16.06z" clip-rule="evenodd"/>',"chevron-up":'<path fill="currentColor" fill-rule="evenodd" d="m12 7.94 6.53 6.53-1.06 1.06L12 10.06l-5.47 5.47-1.06-1.06z" clip-rule="evenodd"/>',"chevron-left":'<path fill="currentColor" fill-rule="evenodd" d="m10.06 12 5.47-5.47-1.06-1.06L7.94 12l6.53 6.53 1.06-1.06z" clip-rule="evenodd"/>',"chevron-right":'<path fill="currentColor" fill-rule="evenodd" d="M9.53 5.47 16.06 12l-6.53 6.53-1.06-1.06L13.94 12 8.47 6.53z" clip-rule="evenodd"/>',calendar:'<path fill="currentColor" fill-rule="evenodd" d="M16.25 8V2h1.5v6zM6.25 8V2h1.5v6zM21 11.75H3v-1.5h18z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75a.25.25 0 0 0-.25.25v14c0 .138.112.25.25.25h16a.25.25 0 0 0 .25-.25V6a.25.25 0 0 0-.25-.25zM2.25 6c0-.966.784-1.75 1.75-1.75h16c.966 0 1.75.784 1.75 1.75v14A1.75 1.75 0 0 1 20 21.75H4A1.75 1.75 0 0 1 2.25 20z" clip-rule="evenodd"/>',clock:'<path fill="currentColor" fill-rule="evenodd" d="M12.75 11.25V6h-1.5v6.75H16v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75a8.25 8.25 0 1 0 0 16.5 8.25 8.25 0 0 0 0-16.5M2.25 12c0-5.385 4.365-9.75 9.75-9.75s9.75 4.365 9.75 9.75-4.365 9.75-9.75 9.75S2.25 17.385 2.25 12" clip-rule="evenodd"/>',bulb:'<path fill="currentColor" d="M15.5 17.5H8v-.75s-.02-1.79-1.06-3.21l-.29-.39C5.88 12.12 5 10.95 5 8.93 5 5.11 8.03 2 11.75 2s6.75 3.11 6.75 6.93c0 2-.87 3.17-1.65 4.2l-.29.39c-1.05 1.45-1.06 3.21-1.06 3.23zM9.44 16h4.62c.11-.81.42-2.16 1.29-3.36l.31-.41c.69-.93 1.35-1.8 1.35-3.31 0-2.99-2.36-5.43-5.25-5.43S6.5 5.93 6.5 8.93c0 1.52.66 2.4 1.35 3.32l.31.41c.86 1.19 1.17 2.53 1.28 3.34M15.75 20h-8v1.5h8z"/>',"circle-checked":'<path fill="currentColor" fill-rule="evenodd" d="m10.32 14.27 6.15-6.134 1.06 1.062-7.22 7.2L6.467 12.5l1.068-1.054z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M1.25 12C1.25 6.086 6.086 1.25 12 1.25S22.75 6.086 22.75 12 17.914 22.75 12 22.75 1.25 17.914 1.25 12M12 2.75c-5.086 0-9.25 4.164-9.25 9.25s4.164 9.25 9.25 9.25 9.25-4.164 9.25-9.25S17.086 2.75 12 2.75" clip-rule="evenodd"/>',"cloud-close":'<path fill="currentColor" fill-rule="evenodd" d="M5.23 9.323A7.75 7.75 0 0 1 12.5 4.25c3.782 0 6.923 2.71 7.606 6.291A4.74 4.74 0 0 1 23.25 15a4.75 4.75 0 0 1-4.75 4.75H6A5.25 5.25 0 0 1 .75 14.5c0-2.64 1.95-4.805 4.48-5.177M12.5 5.75a6.25 6.25 0 0 0-5.993 4.483l-.15.512-.534.025A3.74 3.74 0 0 0 2.25 14.5 3.75 3.75 0 0 0 6 18.25h12.5a3.243 3.243 0 0 0 .763-6.398l-.504-.122-.064-.514A6.25 6.25 0 0 0 12.5 5.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m14.47 15.53-5-5 1.06-1.06 5 5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m9.47 14.47 5-5 1.06 1.06-5 5z" clip-rule="evenodd"/>',close:'<path fill="currentColor" fill-rule="evenodd" d="m5.47 17.47 12-12 1.06 1.06-12 12z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m6.53 5.47 12 12-1.06 1.06-12-12z" clip-rule="evenodd"/>',done:'<path fill="currentColor" fill-rule="evenodd" d="M9.476 15.936 18.97 6.47l1.06 1.062L9.468 18.064l-5.502-5.58 1.068-1.053z" clip-rule="evenodd"/>',"error-filled":'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5M8.47 9.53l1.06-1.06L12 10.94l2.47-2.47 1.06 1.06L13.06 12l2.47 2.47-1.06 1.06L12 13.06l-2.47 2.47-1.06-1.06L10.94 12z" clip-rule="evenodd"/>',edit:'<path fill="currentColor" fill-rule="evenodd" d="M15.506 3.322a3.655 3.655 0 0 1 5.172 0 3.655 3.655 0 0 1 0 5.172L7.466 21.75H2.25v-5.215zm2.586.428c-.572 0-1.121.227-1.525.632l-.002.001L3.75 17.157v3.093h3.093L19.618 7.434a2.16 2.16 0 0 0-1.526-3.684" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M17.7 10.453 13.548 6.3l1.06-1.06 4.154 4.154z" clip-rule="evenodd"/>',eyedropper:'<path fill="currentColor" d="M17.889 11.615a.25.25 0 0 0 0-.353l-5.657-5.657a.25.25 0 0 0-.354 0l-1.414 1.414a.25.25 0 0 0 0 .354l5.657 5.656a.25.25 0 0 0 .354 0zm-.354 2.475a1.75 1.75 0 0 1-2.475 0L9.404 8.433a1.75 1.75 0 0 1 0-2.475l1.414-1.414a1.75 1.75 0 0 1 2.475 0l5.657 5.657a1.75 1.75 0 0 1 0 2.475z"/><path fill="currentColor" d="m15.951 12.86-7.077 7.076-.262.03-1.009.11-.453.454a2.85 2.85 0 0 1-4.03-4.03l.42-.42v-1.41l7.11-7.11zM5.04 15.291v1.41l-.86.86a1.35 1.35 0 0 0 1.91 1.909l.826-.826.262-.03 1.007-.111 5.644-5.644-3.18-3.178zM15.36 2.84a2.754 2.754 0 0 1 3.89 0l1.41 1.41a2.754 2.754 0 0 1 0 3.89l-2.94 2.941-5.3-5.3zm2.83 1.06a1.254 1.254 0 0 0-1.77 0l-1.88 1.88 3.18 3.18 1.88-1.88a1.255 1.255 0 0 0 0-1.77z"/><path fill="currentColor" d="m12.743 14.25-.006 1.5-8.46-.03.006-1.5z"/>',gallery:'<path fill="currentColor" d="M7.5 11c.8 0 1.5-.7 1.5-1.5S8.3 8 7.5 8 6 8.7 6 9.5 6.7 11 7.5 11"/><path fill="currentColor" fill-rule="evenodd" d="m16.698 9.015 5.787 4.913-.97 1.144-4.813-4.087L5.487 20.57l-.974-1.14z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 4.75c-.69 0-1.25.56-1.25 1.25v12c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V6c0-.69-.56-1.25-1.25-1.25zM1.25 6A2.75 2.75 0 0 1 4 3.25h16A2.75 2.75 0 0 1 22.75 6v12A2.75 2.75 0 0 1 20 20.75H4A2.75 2.75 0 0 1 1.25 18z" clip-rule="evenodd"/>',hide:'<path fill="currentColor" fill-rule="evenodd" d="M8.343 11.2c.056-.27.147-.581.284-.842l1.328.696c-.047.09-.102.252-.145.454-.041.199-.06.381-.06.492A2.27 2.27 0 0 0 12 14.25c.284 0 .685-.056.983-.2l.65 1.352c-.57.274-1.217.348-1.633.348-2.056 0-3.75-1.694-3.75-3.75 0-.238.035-.527.093-.8" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.833 12c.477-.936 1.58-2.68 3.626-3.843l-.742-1.304c-2.695 1.534-3.975 3.906-4.4 4.835L1.176 12l.143.312c.685 1.5 3.5 6.438 10.682 6.438 1.62 0 3.026-.253 4.242-.667l-.484-1.42c-1.054.36-2.297.587-3.758.587-5.874 0-8.377-3.707-9.167-5.25M12 6.75c-.673 0-1.6.084-2.202.227l-.346-1.46c.746-.177 1.797-.267 2.548-.267 7.182 0 9.997 4.939 10.682 6.438l.143.312-.143.312a11.1 11.1 0 0 1-3.22 4.037l-.923-1.184A9.7 9.7 0 0 0 21.166 12c-.79-1.544-3.292-5.25-9.166-5.25" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m19.763 22.237-18-18 1.06-1.06 18 18z" clip-rule="evenodd"/>',"info-filled":'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25a9.75 9.75 0 1 0 0 19.5 9.75 9.75 0 0 0 0-19.5m-.75 5h1.5v1.5h-1.5zm0 3h1.5v6.5h-1.5z" clip-rule="evenodd"/>',lock:'<path fill="currentColor" fill-rule="evenodd" d="M5 11.75a.25.25 0 0 0-.25.25v8c0 .138.112.25.25.25h14a.25.25 0 0 0 .25-.25v-8a.25.25 0 0 0-.25-.25zM3.25 12c0-.966.784-1.75 1.75-1.75h14c.966 0 1.75.784 1.75 1.75v8A1.75 1.75 0 0 1 19 21.75H5A1.75 1.75 0 0 1 3.25 20z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75A3.26 3.26 0 0 0 8.75 7v4h-1.5V7A4.76 4.76 0 0 1 12 2.25 4.76 4.76 0 0 1 16.75 7v4h-1.5V7A3.26 3.26 0 0 0 12 3.75" clip-rule="evenodd"/>',mail:'<path fill="currentColor" fill-rule="evenodd" d="m1.665 8.67.67-1.34L12 12.161l9.665-4.833.67 1.342L12 13.839z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M4 5.75c-.69 0-1.25.56-1.25 1.25v10c0 .69.56 1.25 1.25 1.25h16c.69 0 1.25-.56 1.25-1.25V7c0-.69-.56-1.25-1.25-1.25zM1.25 7A2.75 2.75 0 0 1 4 4.25h16A2.75 2.75 0 0 1 22.75 7v10A2.75 2.75 0 0 1 20 19.75H4A2.75 2.75 0 0 1 1.25 17z" clip-rule="evenodd"/>',minus:'<path fill="currentColor" fill-rule="evenodd" d="M6 10.75h12v1.5H6z" clip-rule="evenodd"/>',"more-vertical":'<path fill="currentColor" d="M11.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M11.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M11.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>',pause:'<path fill="currentColor" fill-rule="evenodd" d="M8 6.75h2.5v10.5H8zm5.5 0H16v10.5h-2.5z" clip-rule="evenodd"/>',play:'<path fill="currentColor" fill-rule="evenodd" d="M9.5 7.21v9.58l7.5-4.79z" clip-rule="evenodd"/>',plus:'<path fill="currentColor" fill-rule="evenodd" d="M11.25 11.25v-7h1.5v7h7v1.5h-7v7h-1.5v-7h-7v-1.5z" clip-rule="evenodd"/>',copy:'<path fill="currentColor" fill-rule="evenodd" d="M8 3.75a.25.25 0 0 0-.25.25v12c0 .138.112.25.25.25h12a.25.25 0 0 0 .25-.25V4a.25.25 0 0 0-.25-.25zM6.25 4c0-.966.784-1.75 1.75-1.75h12c.966 0 1.75.784 1.75 1.75v12A1.75 1.75 0 0 1 20 17.75H8A1.75 1.75 0 0 1 6.25 16z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M3.75 9v9A2.25 2.25 0 0 0 6 20.25h9v1.5H6A3.75 3.75 0 0 1 2.25 18V9z" clip-rule="evenodd"/>',code:'<path fill="currentColor" fill-rule="evenodd" d="m6.47 7.47 1.06 1.06L4.06 12l3.47 3.47-1.06 1.06L1.94 12zM19.94 12l-3.47-3.47 1.06-1.06L22.06 12l-4.53 4.53-1.06-1.06zM8.31 18.705l6-14 1.38.59-6 14z" clip-rule="evenodd"/>',write:'<path fill="currentColor" fill-rule="evenodd" d="M3.056 6.056A2.75 2.75 0 0 1 5 5.25h3v1.5H5A1.25 1.25 0 0 0 3.75 8v11A1.25 1.25 0 0 0 5 20.25h11A1.25 1.25 0 0 0 17.25 19v-3h1.5v3A2.75 2.75 0 0 1 16 21.75H5A2.75 2.75 0 0 1 2.25 19V8c0-.73.29-1.429.806-1.944" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M16.885 3.084a2.85 2.85 0 0 1 4.03 4.03l-9.604 9.636H7.25v-4.061zm2.015.666a1.35 1.35 0 0 0-.955.395L8.75 13.311v1.939h1.939l9.166-9.195A1.35 1.35 0 0 0 18.9 3.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m18.47 8.53-3-3 1.06-1.06 3 3z" clip-rule="evenodd"/>',upload:'<path fill="currentColor" d="m12 2.94 5.53 5.53-1.06 1.06-3.72-3.72V17h-1.5V5.81L7.53 9.53 6.47 8.47z"/><path fill="currentColor" d="M2.25 15h1.5v4.25h16.5V15h1.5v5.75H2.25z"/>',video:'<path fill="currentColor" fill-rule="evenodd" d="M21.37 6.347a.75.75 0 0 1 .38.653v10a.75.75 0 0 1-1.136.643l-5-3a.75.75 0 1 1 .772-1.286l3.864 2.318v-7.35l-3.864 2.318a.75.75 0 1 1-.772-1.286l5-3a.75.75 0 0 1 .755-.01" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.25 6A.75.75 0 0 1 3 5.25h13a.75.75 0 0 1 .75.75v12a.75.75 0 0 1-.75.75H3a.75.75 0 0 1-.75-.75zm1.5.75v10.5h11.5V6.75z" clip-rule="evenodd"/>',"volume-up":'<path fill="currentColor" fill-rule="evenodd" d="M12.325 4.324A.75.75 0 0 1 12.75 5v14a.75.75 0 0 1-1.219.586L6.738 15.75H3a.75.75 0 0 1-.75-.75V9A.75.75 0 0 1 3 8.25h3.737l4.794-3.836a.75.75 0 0 1 .794-.09M11.25 6.56 7.469 9.586A.75.75 0 0 1 7 9.75H3.75v4.5H7a.75.75 0 0 1 .469.164l3.781 3.025zM17.57 4.37a.75.75 0 0 1 1.06 0c2.046 2.046 3.12 4.739 3.12 7.63 0 2.908-1.185 5.589-3.105 7.616a.75.75 0 1 1-1.09-1.032c1.68-1.773 2.695-4.092 2.695-6.584 0-2.508-.926-4.815-2.68-6.57a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M14.97 7.97a.75.75 0 0 1 1.06 0c1.025 1.025 1.72 2.51 1.72 4.03 0 1.485-.571 2.998-1.748 4.058a.75.75 0 1 1-1.004-1.115c.823-.741 1.252-1.828 1.252-2.943 0-1.08-.505-2.195-1.28-2.97a.75.75 0 0 1 0-1.06" clip-rule="evenodd"/>',"mute-filled":'<path fill="currentColor" d="M12.3 4.1h.1c-.3-.2-.8 0-1.1.1L6.6 8H3c-.6 0-1 .4-1 1v6c0 .6.4 1 1 1h3.6l4.7 3.8c.2.1.4.2.6.2h.4c.3-.2.6-.5.6-.9V5q0-.6-.6-.9M21.9 9.7l-1.4-1.4-2.3 2.3-2.3-2.3-1.4 1.4 2.3 2.3-2.3 2.3 1.4 1.4 2.3-2.3 2.3 2.3 1.4-1.4-2.3-2.3z"/>',package:'<path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M12 1.14 21.65 6.56v9.78L12 21.76 2.35 16.44V6.56zm-8.15 6.3v8.12L12 20.04l7.8-4.48V7.44L12 2.86z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M21.27 7.75 12.37 12.75l-.74-1.31 8.9-5z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M11.25 21v-8.9h1.5V21z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M3.47 6.35 12.37 11.45l-.75 1.3-8.9-5.1z"/><path fill="currentColor" fill-rule="evenodd" clip-rule="evenodd" d="M7.23 8.85 16.13 3.85l.74 1.3-8.9 5z"/>',"delivery-filled":'<path fill="currentColor" d="M22.68 11.13 21.45 8.66A2.25 2.25 0 0 0 18.76 7H18a3 3 0 0 0-3-3H4a3 3 0 0 0-3 3v9c0 .87.39 1.67 1.02 2.23.14 1.54 1.43 2.77 3 2.77 1.3 0 2.4-.84 2.82-2h6.37c.42 1.16 1.52 2 2.82 2 1.65 0 3-1.35 3-3h1c1.1 0 2-.9 2-2v-3.53c0-.46-.11-.92-.32-1.34M5 19c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m12 0c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m4-3h-1.78c-.33-.37-.75-.65-1.22-.82V9h.76c.38 0 .73.21.9.55l1.24 2.47c.07.14.1.3.1.47z"/>',repeat:'<path fill="currentColor" fill-rule="evenodd" d="m18.94 6-3.47-3.47 1.06-1.06L21.06 6l-4.53 4.53-1.06-1.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M5.532 7.433c.587-.488 1.3-.783 1.968-.783h12.4v-1.5H7.5c-1.116 0-2.183.49-2.988 1.18l-.044.038-.037.044C3.757 7.197 3.25 8.164 3.25 9.3V11h1.5V9.3c0-.648.279-1.267.782-1.867M5.06 18l3.47-3.47-1.06-1.06L2.94 18l4.53 4.53 1.06-1.06z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M19.25 14.7V13h1.5v1.7c0 1.136-.508 2.103-1.18 2.888l-.038.044-.044.037c-.805.69-1.872 1.181-2.988 1.181H4v-1.5h12.5c.668 0 1.381-.295 1.968-.783.503-.6.782-1.22.782-1.867" clip-rule="evenodd"/>',settings:'<path fill="currentColor" fill-rule="evenodd" d="M8.25 12a3.75 3.75 0 1 1 7.5 0 3.75 3.75 0 0 1-7.5 0M12 9.75a2.25 2.25 0 1 0 0 4.5 2.25 2.25 0 0 0 0-4.5" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M9.757 1.888a.75.75 0 0 1 .742-.639h3a.75.75 0 0 1 .742.639l.425 2.836q.303.11.594.244l2.304-1.703a.75.75 0 0 1 .976.073l2.121 2.12a.75.75 0 0 1 .073.977l-1.702 2.304q.134.291.244.594l2.835.425a.75.75 0 0 1 .639.742v3a.75.75 0 0 1-.639.742l-2.836.425q-.11.303-.243.594l1.702 2.304a.75.75 0 0 1-.073.976l-2.12 2.121a.75.75 0 0 1-.977.073l-2.304-1.702q-.291.134-.594.244l-.425 2.835a.75.75 0 0 1-.742.639h-3a.75.75 0 0 1-.742-.639l-.425-2.836a8 8 0 0 1-.594-.244l-2.304 1.703a.75.75 0 0 1-.976-.073l-2.121-2.12a.75.75 0 0 1-.073-.977l1.702-2.304a8 8 0 0 1-.244-.594l-2.835-.425a.75.75 0 0 1-.639-.742v-3a.75.75 0 0 1 .639-.742l2.836-.425q.11-.303.244-.594L3.264 6.435a.75.75 0 0 1 .073-.976l2.12-2.121a.75.75 0 0 1 .977-.073l2.304 1.702q.291-.134.594-.244zm1.388.861-.398 2.653a.75.75 0 0 1-.53.608 6 6 0 0 0-1.197.493.75.75 0 0 1-.804-.056L6.062 4.855 4.854 6.063l1.592 2.154a.75.75 0 0 1 .056.804 6.2 6.2 0 0 0-.493 1.2.75.75 0 0 1-.608.527l-2.653.398v1.708l2.653.398a.75.75 0 0 1 .608.53q.188.634.493 1.197a.75.75 0 0 1-.056.804l-1.592 2.154 1.208 1.208 2.154-1.592a.75.75 0 0 1 .804-.056q.562.304 1.2.493a.75.75 0 0 1 .527.608l.398 2.653h1.708l.398-2.653a.75.75 0 0 1 .53-.608q.634-.188 1.197-.493a.75.75 0 0 1 .804.056l2.154 1.592 1.208-1.208-1.592-2.154a.75.75 0 0 1-.056-.804q.304-.562.493-1.2a.75.75 0 0 1 .608-.527l2.653-.398v-1.708l-2.653-.398a.75.75 0 0 1-.608-.53 6 6 0 0 0-.493-1.197.75.75 0 0 1 .056-.804l1.592-2.154-1.208-1.208-2.154 1.592a.75.75 0 0 1-.804.056 6.2 6.2 0 0 0-1.2-.493.75.75 0 0 1-.527-.608l-.398-2.653z" clip-rule="evenodd"/>',refresh:'<path fill="currentColor" fill-rule="evenodd" d="M20.25 8.25V3h1.5v6.75H16v-1.5z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M12 3.75A8.25 8.25 0 0 0 3.75 12 8.25 8.25 0 0 0 12 20.25 8.25 8.25 0 0 0 20.25 12h1.5A9.75 9.75 0 0 1 12 21.75 9.75 9.75 0 0 1 2.25 12 9.75 9.75 0 0 1 12 2.25a9.75 9.75 0 0 1 8.628 5.205l.094.106.324.361.011.012.462.517a3 3 0 0 1 .098.123c.007.01.03.044.054.09l-1.342.671a.586.586 0 0 0 .068.11l.009.012-.021-.025q-.037-.043-.107-.12l-.335-.373-.013-.015-.494-.554-.05-.065a1 1 0 0 1-.05-.084l-.002-.004A8.25 8.25 0 0 0 12 3.75" clip-rule="evenodd"/>',expand:'<path fill="currentColor" fill-rule="evenodd" d="M17.25 6.75H12v-1.5h6.75V12h-1.5zM6.75 17.25V12h-1.5v6.75H12v-1.5z" clip-rule="evenodd"/>',shrink:'<path fill="currentColor" fill-rule="evenodd" d="M9.25 14.75H4v-1.5h6.75V20h-1.5zM13.75 10.25V5h-1.5v6.75H19v-1.5z" clip-rule="evenodd"/>',"grip-vertical":'<path fill="currentColor" d="M9.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M9.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 8a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 13.5a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3M14.5 19a1.5 1.5 0 1 0 0-3 1.5 1.5 0 0 0 0 3"/>',"grip-horizontal":'<path fill="currentColor" d="M8 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M13.5 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M19 9.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M8 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M13.5 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0M19 14.5a1.5 1.5 0 1 0-3 0 1.5 1.5 0 0 0 3 0"/>',search:'<path fill="currentColor" fill-rule="evenodd" d="M2.25 11c0-4.814 3.936-8.75 8.75-8.75s8.75 3.936 8.75 8.75-3.936 8.75-8.75 8.75S2.25 15.814 2.25 11M11 3.75c-3.986 0-7.25 3.264-7.25 7.25s3.264 7.25 7.25 7.25 7.25-3.264 7.25-7.25S14.986 3.75 11 3.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="m17.13 16.07 4.4 4.4-1.06 1.06-4.4-4.4z" clip-rule="evenodd"/>',"share-alt":'<path fill="currentColor" fill-rule="evenodd" d="M13.69 3.317a.75.75 0 0 1 .804.119l8 7a.75.75 0 0 1 0 1.128l-8 7A.75.75 0 0 1 13.25 18v-3.24c-1.925.051-3.579.315-5.062.932-1.659.692-3.157 1.85-4.588 3.758A.75.75 0 0 1 2.25 19c0-4.145 1.147-6.888 3.291-8.698 1.96-1.655 4.655-2.437 7.709-2.943V4a.75.75 0 0 1 .44-.683m1.06 2.336V8a.75.75 0 0 1-.638.742c-3.283.497-5.85 1.225-7.603 2.706-1.359 1.147-2.303 2.812-2.631 5.39 1.153-1.15 2.386-1.969 3.734-2.53 1.928-.804 4.04-1.058 6.388-1.058a.75.75 0 0 1 .75.75v2.347L20.861 11z" clip-rule="evenodd"/>',show:'<path fill="currentColor" fill-rule="evenodd" d="M8.25 12c0-2.055 1.695-3.75 3.75-3.75s3.75 1.694 3.75 3.75-1.694 3.75-3.75 3.75S8.25 14.056 8.25 12M12 9.75A2.27 2.27 0 0 0 9.75 12 2.27 2.27 0 0 0 12 14.25 2.27 2.27 0 0 0 14.25 12 2.27 2.27 0 0 0 12 9.75" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M2.833 12c.791 1.543 3.297 5.25 9.167 5.25 5.872 0 8.374-3.704 9.167-5.25-.791-1.543-3.297-5.25-9.167-5.25-5.871 0-8.374 3.704-9.167 5.25m-1.515-.312C2.006 10.183 4.823 5.25 12 5.25s9.997 4.938 10.682 6.438l.143.312-.143.312C21.994 13.817 19.177 18.75 12 18.75s-9.997-4.938-10.682-6.438L1.175 12z" clip-rule="evenodd"/>',sparkle:'<path fill="currentColor" fill-rule="evenodd" d="M12 2.25 14.08 8 19.75 10l-5.67 2L12 17.75 9.92 12 4.25 10l5.67-2zm0 4.4-.9 2.49-2.45.86 2.45.86.9 2.49.9-2.49 2.45-.86-2.45-.86zM18.5 15.25l.88 2.37 2.37.88-2.37.88-.88 2.37-.88-2.37-2.37-.88 2.37-.88z" clip-rule="evenodd"/>',trash:'<path fill="currentColor" fill-rule="evenodd" d="M6.75 6v13c0 .69.56 1.25 1.25 1.25h8c.69 0 1.25-.56 1.25-1.25V6h1.5v13A2.75 2.75 0 0 1 16 21.75H8A2.75 2.75 0 0 1 5.25 19V6z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M21 6.75H3v-1.5h18z" clip-rule="evenodd"/><path fill="currentColor" fill-rule="evenodd" d="M7.25 4c0-.966.784-1.75 1.75-1.75h6c.966 0 1.75.784 1.75 1.75v2h-1.5V4a.25.25 0 0 0-.25-.25H9a.25.25 0 0 0-.25.25v2h-1.5zM9.25 16V9h1.5v7zM13.25 16V9h1.5v7z" clip-rule="evenodd"/>',user:'<path fill="currentColor" fill-rule="evenodd" d="M8.652 3.687C9.52 2.708 10.833 2.25 12 2.25c1.198 0 2.38.478 3.313 1.402.979.868 1.437 2.181 1.437 3.348 0 1.198-.477 2.38-1.402 3.313-.868.979-2.181 1.437-3.348 1.437-1.198 0-2.38-.477-3.313-1.402C7.715 9.488 7.25 8.277 7.25 7c0-1.198.478-2.38 1.402-3.313M12 3.75c-.826 0-1.703.336-2.236.944l-.016.019-.018.017c-.664.664-.98 1.475-.98 2.27 0 .915.329 1.697.944 2.236l.019.016.017.018c.664.664 1.475.98 2.27.98.826 0 1.703-.336 2.236-.944l.016-.019.018-.017c.664-.664.98-1.475.98-2.27 0-.826-.336-1.703-.944-2.236l-.019-.016-.017-.018c-.664-.664-1.475-.98-2.27-.98M8 15.75c-.795 0-1.606.317-2.27.98l-.017.018-.02.016c-.614.539-.943 1.321-.943 2.236v3h-1.5v-3c0-1.277.465-2.487 1.437-3.348.934-.925 2.115-1.402 3.313-1.402h8c1.277 0 2.487.465 3.348 1.437.925.934 1.402 2.115 1.402 3.313v3h-1.5v-3c0-.795-.317-1.606-.98-2.27l-.018-.017-.016-.02c-.539-.614-1.321-.943-2.236-.943z" clip-rule="evenodd"/>',"warning-filled":'<path fill="currentColor" fill-rule="evenodd" d="M10.34 3.78a1.9 1.9 0 0 1 3.32 0l8.06 14.5A1.9 1.9 0 0 1 20.06 21H3.94a1.9 1.9 0 0 1-1.66-2.72zm.91 5.47h1.5v5.5h-1.5zm0 7h1.5v1.5h-1.5z" clip-rule="evenodd"/>'};function isDbIconName(e){return Object.prototype.hasOwnProperty.call(l,e)}function getDbComponentIconSize(l){return"s"===l?12:"l"===l?20:16}function createDbIcon(e,r=16){const d=document.createElement("template");return d.innerHTML=`<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" width="${r}" height="${r}" aria-hidden="true" focusable="false" data-designbase-icon="${e}">${l[e]}</svg>`,d.content.firstElementChild}export{createDbIcon,getDbComponentIconSize,isDbIconName};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
interface DbImageListItem {
|
|
2
|
+
id?: string;
|
|
3
|
+
src: string;
|
|
4
|
+
alt?: string;
|
|
5
|
+
title?: string;
|
|
6
|
+
description?: string;
|
|
7
|
+
thumbnail?: string;
|
|
8
|
+
metadata?: {
|
|
9
|
+
width?: number;
|
|
10
|
+
height?: number;
|
|
11
|
+
size?: string;
|
|
12
|
+
date?: string;
|
|
13
|
+
tags?: string[];
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare class DbImageList extends HTMLElement {
|
|
17
|
+
private lightboxEl;
|
|
18
|
+
private selectedIndex;
|
|
19
|
+
static get observedAttributes(): string[];
|
|
20
|
+
connectedCallback(): void;
|
|
21
|
+
attributeChangedCallback(): void;
|
|
22
|
+
private parseImages;
|
|
23
|
+
private mapRoundedAttr;
|
|
24
|
+
private createImageItem;
|
|
25
|
+
private openLightbox;
|
|
26
|
+
private render;
|
|
27
|
+
}
|
|
28
|
+
declare global {
|
|
29
|
+
interface HTMLElementTagNameMap {
|
|
30
|
+
'db-image-list': DbImageList;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export { DbImageList };
|
|
35
|
+
export type { DbImageListItem };
|