@shibui-ui/ui 1.25.1 → 1.26.1
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/dist/index.js +68 -68
- package/dist/index107.js +2 -2
- package/dist/index107.js.map +1 -1
- package/dist/index108.js +2 -2
- package/dist/index108.js.map +1 -1
- package/dist/index109.js +2 -2
- package/dist/index109.js.map +1 -1
- package/dist/index11.js +1 -1
- package/dist/index110.js +2 -2
- package/dist/index110.js.map +1 -1
- package/dist/index115.js +2 -2
- package/dist/index115.js.map +1 -1
- package/dist/index116.js +2 -2
- package/dist/index116.js.map +1 -1
- package/dist/index117.js +2 -2
- package/dist/index117.js.map +1 -1
- package/dist/index118.js +2 -2
- package/dist/index118.js.map +1 -1
- package/dist/index119.js +2 -2
- package/dist/index119.js.map +1 -1
- package/dist/index120.js +2 -2
- package/dist/index120.js.map +1 -1
- package/dist/index121.js +2 -2
- package/dist/index121.js.map +1 -1
- package/dist/index122.js +2 -2
- package/dist/index122.js.map +1 -1
- package/dist/index123.js +2 -2
- package/dist/index123.js.map +1 -1
- package/dist/index124.js +2 -2
- package/dist/index124.js.map +1 -1
- package/dist/index125.js +2 -2
- package/dist/index125.js.map +1 -1
- package/dist/index126.js +2 -2
- package/dist/index126.js.map +1 -1
- package/dist/index127.js +2 -2
- package/dist/index127.js.map +1 -1
- package/dist/index128.js +2 -2
- package/dist/index128.js.map +1 -1
- package/dist/index129.js +2 -2
- package/dist/index129.js.map +1 -1
- package/dist/index130.js +2 -2
- package/dist/index130.js.map +1 -1
- package/dist/index131.js +2 -2
- package/dist/index131.js.map +1 -1
- package/dist/index132.js +2 -2
- package/dist/index132.js.map +1 -1
- package/dist/index133.js +2 -2
- package/dist/index133.js.map +1 -1
- package/dist/index134.js +2 -2
- package/dist/index134.js.map +1 -1
- package/dist/index135.js +2 -2
- package/dist/index135.js.map +1 -1
- package/dist/index136.js +2 -2
- package/dist/index136.js.map +1 -1
- package/dist/index137.js +2 -2
- package/dist/index137.js.map +1 -1
- package/dist/index138.js +2 -2
- package/dist/index138.js.map +1 -1
- package/dist/index139.js +2 -2
- package/dist/index139.js.map +1 -1
- package/dist/index140.js +2 -2
- package/dist/index140.js.map +1 -1
- package/dist/index141.js +2 -2
- package/dist/index141.js.map +1 -1
- package/dist/index142.js +2 -2
- package/dist/index142.js.map +1 -1
- package/dist/index143.js +2 -2
- package/dist/index143.js.map +1 -1
- package/dist/index144.js +2 -2
- package/dist/index144.js.map +1 -1
- package/dist/index145.js +2 -2
- package/dist/index145.js.map +1 -1
- package/dist/index146.js +2 -2
- package/dist/index146.js.map +1 -1
- package/dist/index147.js +2 -2
- package/dist/index147.js.map +1 -1
- package/dist/index148.js +2 -2
- package/dist/index148.js.map +1 -1
- package/dist/index149.js +2 -2
- package/dist/index149.js.map +1 -1
- package/dist/index150.js +2 -2
- package/dist/index150.js.map +1 -1
- package/dist/index151.js +2 -2
- package/dist/index151.js.map +1 -1
- package/dist/index152.js +2 -2
- package/dist/index152.js.map +1 -1
- package/dist/index153.js +2 -2
- package/dist/index153.js.map +1 -1
- package/dist/index154.js +2 -2
- package/dist/index154.js.map +1 -1
- package/dist/index155.js +2 -2
- package/dist/index155.js.map +1 -1
- package/dist/index156.js +2 -2
- package/dist/index156.js.map +1 -1
- package/dist/index157.js +2 -2
- package/dist/index157.js.map +1 -1
- package/dist/index158.js +2 -2
- package/dist/index158.js.map +1 -1
- package/dist/index159.js +2 -2
- package/dist/index159.js.map +1 -1
- package/dist/index160.js +2 -2
- package/dist/index160.js.map +1 -1
- package/dist/index161.js +2 -2
- package/dist/index161.js.map +1 -1
- package/dist/index162.js +2 -2
- package/dist/index162.js.map +1 -1
- package/dist/index163.js +2 -2
- package/dist/index163.js.map +1 -1
- package/dist/index164.js +2 -2
- package/dist/index164.js.map +1 -1
- package/dist/index165.js +2 -2
- package/dist/index165.js.map +1 -1
- package/dist/index166.js +2 -2
- package/dist/index166.js.map +1 -1
- package/dist/index167.js +2 -2
- package/dist/index167.js.map +1 -1
- package/dist/index168.js +2 -2
- package/dist/index168.js.map +1 -1
- package/dist/index169.js +2 -2
- package/dist/index169.js.map +1 -1
- package/dist/index170.js +2 -2
- package/dist/index170.js.map +1 -1
- package/dist/index171.js +2 -2
- package/dist/index171.js.map +1 -1
- package/dist/index172.js +2 -2
- package/dist/index172.js.map +1 -1
- package/dist/index173.js +2 -2
- package/dist/index173.js.map +1 -1
- package/dist/index174.js +2 -2
- package/dist/index174.js.map +1 -1
- package/dist/index175.js +2 -2
- package/dist/index175.js.map +1 -1
- package/dist/index176.js +2 -2
- package/dist/index176.js.map +1 -1
- package/dist/index177.js +2 -2
- package/dist/index177.js.map +1 -1
- package/dist/index178.js +2 -2
- package/dist/index178.js.map +1 -1
- package/dist/index194.js +6 -97
- package/dist/index194.js.map +1 -1
- package/dist/index195.js +2 -2
- package/dist/index197.js +18 -2
- package/dist/index197.js.map +1 -1
- package/dist/index198.js +2 -74
- package/dist/index198.js.map +1 -1
- package/dist/index199.js +74 -64
- package/dist/index199.js.map +1 -1
- package/dist/index200.js +2 -2
- package/dist/index201.js +2 -57
- package/dist/index201.js.map +1 -1
- package/dist/index202.js +39 -2
- package/dist/index202.js.map +1 -1
- package/dist/index203.js +2 -2
- package/dist/index204.js +219 -144
- package/dist/index204.js.map +1 -1
- package/dist/index205.js +82 -43
- package/dist/index205.js.map +1 -1
- package/dist/index206.js +2 -51
- package/dist/index206.js.map +1 -1
- package/dist/index207.js +94 -2
- package/dist/index207.js.map +1 -1
- package/dist/index208.js +2 -33
- package/dist/index208.js.map +1 -1
- package/dist/index209.js +268 -2
- package/dist/index209.js.map +1 -1
- package/dist/index210.js +2 -6
- package/dist/index210.js.map +1 -1
- package/dist/index211.js +21 -2
- package/dist/index211.js.map +1 -1
- package/dist/index212.js +2 -260
- package/dist/index212.js.map +1 -1
- package/dist/index213.js +8 -16
- package/dist/index213.js.map +1 -1
- package/dist/index214.js +2 -2
- package/dist/index215.js +15 -2
- package/dist/index215.js.map +1 -1
- package/dist/index216.js +2 -66
- package/dist/index216.js.map +1 -1
- package/dist/index217.js +146 -24
- package/dist/index217.js.map +1 -1
- package/dist/index218.js +2 -2
- package/dist/index219.js +5 -2
- package/dist/index219.js.map +1 -1
- package/dist/index220.js +2 -81
- package/dist/index220.js.map +1 -1
- package/dist/index221.js +6 -78
- package/dist/index221.js.map +1 -1
- package/dist/index222.js +2 -2
- package/dist/index223.js +2 -133
- package/dist/index223.js.map +1 -1
- package/dist/index224.js +92 -2
- package/dist/index224.js.map +1 -1
- package/dist/index225.js +59 -2
- package/dist/index225.js.map +1 -1
- package/dist/index226.js +2 -72
- package/dist/index226.js.map +1 -1
- package/dist/index227.js +97 -94
- package/dist/index227.js.map +1 -1
- package/dist/index228.js +2 -2
- package/dist/index229.js +2 -71
- package/dist/index229.js.map +1 -1
- package/dist/index230.js +74 -2
- package/dist/index230.js.map +1 -1
- package/dist/index231.js +74 -2
- package/dist/index231.js.map +1 -1
- package/dist/index232.js +2 -12
- package/dist/index232.js.map +1 -1
- package/dist/index233.js +53 -5
- package/dist/index233.js.map +1 -1
- package/dist/index234.js +2 -2
- package/dist/index235.js +2 -18
- package/dist/index235.js.map +1 -1
- package/dist/index236.js +162 -2
- package/dist/index236.js.map +1 -1
- package/dist/index237.js +43 -84
- package/dist/index237.js.map +1 -1
- package/dist/index238.js +51 -2
- package/dist/index238.js.map +1 -1
- package/dist/index239.js +2 -2
- package/dist/index240.js +33 -39
- package/dist/index240.js.map +1 -1
- package/dist/index241.js +2 -2
- package/dist/index242.js +5 -236
- package/dist/index242.js.map +1 -1
- package/dist/index243.js +2 -82
- package/dist/index243.js.map +1 -1
- package/dist/index244.js +260 -2
- package/dist/index244.js.map +1 -1
- package/dist/index245.js +16 -93
- package/dist/index245.js.map +1 -1
- package/dist/index246.js +2 -2
- package/dist/index247.js +2 -268
- package/dist/index247.js.map +1 -1
- package/dist/index248.js +66 -2
- package/dist/index248.js.map +1 -1
- package/dist/index249.js +24 -13
- package/dist/index249.js.map +1 -1
- package/dist/index250.js +2 -2
- package/dist/index251.js +2 -9
- package/dist/index251.js.map +1 -1
- package/dist/index252.js +81 -2
- package/dist/index252.js.map +1 -1
- package/dist/index253.js +78 -12
- package/dist/index253.js.map +1 -1
- package/dist/index254.js +2 -2
- package/dist/index255.js +111 -132
- package/dist/index255.js.map +1 -1
- package/dist/index256.js +2 -2
- package/dist/index257.js +2 -5
- package/dist/index257.js.map +1 -1
- package/dist/index258.js +72 -2
- package/dist/index258.js.map +1 -1
- package/dist/index259.js +93 -5
- package/dist/index259.js.map +1 -1
- package/dist/index260.js +2 -2
- package/dist/index261.js +71 -2
- package/dist/index261.js.map +1 -1
- package/dist/index262.js +2 -92
- package/dist/index262.js.map +1 -1
- package/dist/index263.js +2 -59
- package/dist/index263.js.map +1 -1
- package/dist/index264.js +12 -2
- package/dist/index264.js.map +1 -1
- package/dist/index3.js +73 -73
- package/dist/index3.js.map +1 -1
- package/dist/index34.js +1 -1
- package/dist/index347.js +1 -1
- package/dist/index352.js +26 -19
- package/dist/index352.js.map +1 -1
- package/dist/index353.js +24 -13
- package/dist/index353.js.map +1 -1
- package/dist/index354.js +6 -20
- package/dist/index354.js.map +1 -1
- package/dist/index355.js +18 -56
- package/dist/index355.js.map +1 -1
- package/dist/index356.js +57 -55
- package/dist/index356.js.map +1 -1
- package/dist/index357.js +64 -32
- package/dist/index357.js.map +1 -1
- package/dist/index44.js +1 -1
- package/dist/index47.js +1 -1
- package/dist/index49.js +2 -2
- package/dist/index50.js +2 -2
- package/dist/index51.js +2 -2
- package/dist/index52.js +2 -2
- package/dist/index53.js +3 -3
- package/dist/index54.js +2 -2
- package/dist/index55.js +2 -2
- package/dist/index56.js +3 -3
- package/dist/index57.js +2 -2
- package/dist/index58.js +2 -2
- package/dist/index59.js +2 -2
- package/dist/index60.js +2 -2
- package/dist/index61.js +2 -2
- package/dist/index62.js +2 -2
- package/dist/index63.js +2 -2
- package/dist/index64.js +2 -2
- package/dist/index65.js +2 -2
- package/dist/index66.js +1 -1
- package/dist/index67.js +1 -1
- package/dist/index68.js +2 -2
- package/dist/index69.js +2 -2
- package/dist/index70.js +2 -2
- package/dist/index71.js +2 -2
- package/dist/index72.js +2 -2
- package/dist/index73.js +2 -2
- package/dist/index74.js +2 -2
- package/dist/index75.js +2 -2
- package/dist/index76.js +2 -2
- package/dist/index77.js +2 -2
- package/dist/index78.js +2 -2
- package/dist/index79.js +2 -2
- package/dist/index80.js +2 -2
- package/dist/index81.js +2 -2
- package/dist/index82.js +1 -1
- package/dist/index83.js +2 -2
- package/dist/index84.js +2 -2
- package/dist/shared/icons/icon-registry.d.ts +2 -2
- package/dist/shared/icons/icon-registry.d.ts.map +1 -1
- package/dist/src/shared/icons/icon-registry.d.ts +2 -2
- package/dist/src/shared/icons/icon-registry.d.ts.map +1 -1
- package/package.json +1 -1
package/dist/index243.js
CHANGED
|
@@ -1,85 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
const closeSvg = html`
|
|
3
|
-
<svg width="12" height="12" viewBox="0 0 12 12" fill="none"
|
|
4
|
-
stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
|
|
5
|
-
<path d="M1 1l10 10M11 1L1 11"/>
|
|
6
|
-
</svg>
|
|
7
|
-
`;
|
|
8
|
-
const dangerSvg = html`
|
|
9
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
10
|
-
stroke="var(--color-error)" stroke-width="1.5"
|
|
11
|
-
stroke-linecap="round" stroke-linejoin="round">
|
|
12
|
-
<path d="M8 2L14.5 13H1.5L8 2z"/>
|
|
13
|
-
<path d="M8 6v3M8 11v.5"/>
|
|
14
|
-
</svg>
|
|
15
|
-
`;
|
|
16
|
-
const warningSvg = html`
|
|
17
|
-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none"
|
|
18
|
-
stroke="var(--color-warning)" stroke-width="1.5"
|
|
19
|
-
stroke-linecap="round" stroke-linejoin="round">
|
|
20
|
-
<circle cx="8" cy="8" r="6"/>
|
|
21
|
-
<path d="M8 5v3M8 10v.5"/>
|
|
22
|
-
</svg>
|
|
23
|
-
`;
|
|
24
|
-
function dialogTemplate(props) {
|
|
25
|
-
const {
|
|
26
|
-
eyebrow,
|
|
27
|
-
dlgTitle,
|
|
28
|
-
variant,
|
|
29
|
-
size,
|
|
30
|
-
layout,
|
|
31
|
-
footerMeta,
|
|
32
|
-
onClose
|
|
33
|
-
} = props;
|
|
34
|
-
const layoutCls = layout === "drawer-right" ? "dlg-drawer-right" : layout === "drawer-bottom" ? "dlg-drawer-bottom" : "";
|
|
35
|
-
const alertCls = layout === "alert" ? "dlg-alert" : "";
|
|
36
|
-
const sizeCls = `dlg-${size}`;
|
|
37
|
-
const dlgCls = `dlg ${sizeCls} ${layoutCls} ${alertCls}`.trim();
|
|
38
|
-
const hasIcon = variant === "danger" || variant === "warning";
|
|
39
|
-
const headerIcon = hasIcon ? html`<div class="dlg-header-icon">
|
|
40
|
-
${variant === "danger" ? dangerSvg : warningSvg}
|
|
41
|
-
</div>` : null;
|
|
42
|
-
return html`
|
|
43
|
-
<dialog
|
|
44
|
-
class="${dlgCls}"
|
|
45
|
-
@cancel="${(e) => {
|
|
46
|
-
e.preventDefault();
|
|
47
|
-
onClose();
|
|
48
|
-
}}"
|
|
49
|
-
@click="${(e) => {
|
|
50
|
-
if (e.target.tagName === "DIALOG") onClose();
|
|
51
|
-
}}"
|
|
52
|
-
>
|
|
53
|
-
<!-- HEADER -->
|
|
54
|
-
<div class="dlg-header">
|
|
55
|
-
${headerIcon}
|
|
56
|
-
<div class="dlg-header-text" style="${hasIcon ? "margin-left: var(--lib-space-md)" : ""}">
|
|
57
|
-
${eyebrow ? html`<p class="dlg-eyebrow">${eyebrow}</p>` : null}
|
|
58
|
-
<slot name="header">
|
|
59
|
-
<h2 class="dlg-title">${dlgTitle}</h2>
|
|
60
|
-
</slot>
|
|
61
|
-
</div>
|
|
62
|
-
<button
|
|
63
|
-
class="dlg-close"
|
|
64
|
-
aria-label="Cerrar"
|
|
65
|
-
@click="${() => onClose()}"
|
|
66
|
-
>${closeSvg}</button>
|
|
67
|
-
</div>
|
|
68
|
-
|
|
69
|
-
<!-- BODY -->
|
|
70
|
-
<div class="dlg-body">
|
|
71
|
-
<slot></slot>
|
|
72
|
-
</div>
|
|
73
|
-
|
|
74
|
-
<!-- FOOTER -->
|
|
75
|
-
<div class="dlg-footer">
|
|
76
|
-
${footerMeta ? html`<span class="dlg-footer-meta">${footerMeta}</span>` : null}
|
|
77
|
-
<slot name="footer"></slot>
|
|
78
|
-
</div>
|
|
79
|
-
</dialog>
|
|
80
|
-
`;
|
|
81
|
-
}
|
|
1
|
+
const uploaderCss = "@layer tokens,reset,components;@layer reset{*,*:before,*:after{box-sizing:border-box}:host{display:block}}@layer components{.fu-root{display:flex;flex-direction:column;width:100%}.fu-zone{position:relative;border:1.5px dashed var(--border-default);background:var(--bg-elevated);padding:var(--lib-space-xl) var(--lib-space-lg);display:flex;flex-direction:column;align-items:center;justify-content:center;gap:var(--lib-space-md);text-align:center;cursor:pointer;transition:border-color var(--duration-base) var(--ease-out),background var(--duration-base) var(--ease-out),transform var(--duration-fast);width:100%}.fu-zone input[type=file]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:pointer;width:100%;height:100%}.fu-zone:hover{border-color:var(--border-strong);background:var(--bg-surface)}.fu-zone.is-dragover{border-color:var(--color-kaki-400);background:var(--color-kaki-50);transform:scale(1.005)}.fu-zone.is-disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.fu-zone-icon{font-size:40px;color:var(--text-muted);line-height:1;display:flex;transition:color var(--duration-base),transform var(--duration-slow) var(--ease-bounce)}.fu-zone:hover .fu-zone-icon,.fu-zone.is-dragover .fu-zone-icon{color:var(--color-kaki-400);transform:translateY(-3px) scale(1.08)}.fu-zone-title{font-family:var(--lib-font-display);font-size:var(--text-xl);font-weight:var(--weight-light);letter-spacing:var(--tracking-tight);color:var(--text-primary)}.fu-zone-sub{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-wider);color:var(--text-muted);text-transform:uppercase}.fu-zone-sub span{color:var(--color-kaki-500);text-decoration:underline;text-underline-offset:2px}.fu-zone-hint{font-family:var(--lib-font-mono);font-size:10px;letter-spacing:var(--tracking-wide);color:var(--text-muted);margin-top:var(--lib-space-xs)}.fu-zone-sm{position:relative;border:1px dashed var(--border-default);background:var(--bg-elevated);padding:var(--lib-space-md) var(--lib-space-md);display:flex;align-items:center;gap:var(--lib-space-md);cursor:pointer;transition:border-color var(--duration-base) var(--ease-out),background var(--duration-base) var(--ease-out);width:100%}.fu-zone-sm input[type=file]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:pointer;width:100%;height:100%}.fu-zone-sm:hover,.fu-zone-sm.is-dragover{border-color:var(--color-kaki-400);background:var(--color-kaki-50)}.fu-zone-sm.is-disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.fu-zone-sm-icon{font-size:22px;color:var(--text-muted);flex-shrink:0;display:flex;transition:color var(--duration-base)}.fu-zone-sm:hover .fu-zone-sm-icon,.fu-zone-sm.is-dragover .fu-zone-sm-icon{color:var(--color-kaki-400)}.fu-zone-sm-text{display:flex;flex-direction:column;gap:2px}.fu-zone-sm-title{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-wider);color:var(--text-secondary);text-transform:uppercase}.fu-zone-sm-sub{font-family:var(--lib-font-mono);font-size:10px;color:var(--text-muted);letter-spacing:var(--tracking-wide)}.fu-zone-img{position:relative;border:1.5px dashed var(--border-default);background:var(--bg-surface);width:100%;aspect-ratio:16 / 7;overflow:hidden;cursor:pointer;transition:border-color var(--duration-base) var(--ease-out),background var(--duration-base) var(--ease-out);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:var(--lib-space-sm)}.fu-zone-img input[type=file]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;cursor:pointer;width:100%;height:100%}.fu-zone-img:hover{border-color:var(--border-strong)}.fu-zone-img.is-dragover{border-color:var(--color-kaki-400);background:var(--color-kaki-50)}.fu-zone-img.is-disabled{opacity:.45;cursor:not-allowed;pointer-events:none}.fu-zone-img-placeholder{display:flex;flex-direction:column;align-items:center;gap:var(--lib-space-sm);pointer-events:none}.fu-zone-img-preview{position:absolute;top:0;right:0;bottom:0;left:0;object-fit:cover;width:100%;height:100%;display:none}.fu-zone-img.has-preview .fu-zone-img-preview{display:block}.fu-zone-img.has-preview .fu-zone-img-placeholder{display:none}.fu-zone-img-overlay{position:absolute;top:0;right:0;bottom:0;left:0;background:#221c1680;display:flex;align-items:center;justify-content:center;gap:var(--lib-space-sm);opacity:0;transition:opacity var(--duration-base);pointer-events:none}.fu-zone-img.has-preview:hover .fu-zone-img-overlay{opacity:1}.fu-zone-img-overlay-text{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-wider);text-transform:uppercase;color:var(--color-white)}.fu-progress-bar{height:2px;background:var(--border-subtle);width:100%;overflow:hidden;margin-top:-1px}.fu-progress-fill{height:100%;background:var(--color-kaki-400);transition:width 80ms linear}.fu-list{display:flex;flex-direction:column;gap:1px;width:100%}.fu-file{display:grid;grid-template-columns:auto 1fr auto;align-items:center;gap:var(--lib-space-md);padding:var(--lib-space-md) var(--lib-space-md);background:var(--bg-elevated);border:1px solid var(--border-subtle);position:relative;overflow:hidden;transition:background var(--duration-base);animation:fu-slide-in .25s var(--ease-out)}.fu-file:hover{background:var(--bg-surface)}.fu-file-prog-bg{position:absolute;left:0;top:0;bottom:0;background:var(--color-kaki-50);transition:width 80ms linear;pointer-events:none;z-index:0}.fu-file>*{position:relative;z-index:1}.fu-file-icon{width:36px;height:36px;display:flex;align-items:center;justify-content:center;font-size:20px;color:var(--text-muted);background:var(--bg-surface);border:1px solid var(--border-subtle);flex-shrink:0;transition:color var(--duration-base),background var(--duration-base)}.fu-file.is-done .fu-file-icon{color:var(--color-celadon-500);background:var(--color-celadon-50);border-color:var(--color-celadon-100)}.fu-file.is-error .fu-file-icon{color:var(--color-error);background:#fff8f7;border-color:#f5c4bc}.fu-ext{font-family:var(--lib-font-mono);font-size:8px;letter-spacing:.04em;text-transform:uppercase;font-weight:600}.fu-file-thumb{width:36px;height:36px;object-fit:cover;flex-shrink:0;border:1px solid var(--border-subtle);display:block}.fu-file-meta{display:flex;flex-direction:column;gap:2px;min-width:0}.fu-file-name{font-family:var(--lib-font-mono);font-size:var(--text-xs);letter-spacing:var(--tracking-wide);color:var(--text-primary);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.fu-file-info{font-family:var(--lib-font-mono);font-size:10px;letter-spacing:var(--tracking-wide);color:var(--text-muted);display:flex;align-items:center;gap:var(--lib-space-sm)}.fu-file-info-sep{width:3px;height:3px;border-radius:var(--radius-full);background:var(--color-washi-300);flex-shrink:0}.fu-file-actions{display:flex;align-items:center;gap:var(--lib-space-sm);flex-shrink:0}.fu-file-pct{font-family:var(--lib-font-mono);font-size:10px;letter-spacing:var(--tracking-wide);color:var(--color-kaki-500);min-width:28px;text-align:right}.fu-status-done{color:var(--color-celadon-500);font-size:18px;display:flex}.fu-status-error{color:var(--color-error);font-size:18px;display:flex}.fu-file-remove{width:28px;height:28px;display:flex;align-items:center;justify-content:center;font-size:14px;color:var(--text-muted);background:transparent;border:none;cursor:pointer;border-radius:var(--radius-full);transition:background var(--duration-fast),color var(--duration-fast);flex-shrink:0}.fu-file-remove:hover{background:var(--color-washi-200);color:var(--text-primary)}.fu-file.is-error .fu-file-remove:hover{background:#fff8f7;color:var(--color-error)}.fu-summary{display:flex;align-items:center;justify-content:space-between;padding:var(--lib-space-sm) var(--lib-space-md);background:var(--bg-surface);border:1px solid var(--border-subtle);border-top:none}.fu-summary-text{font-family:var(--lib-font-mono);font-size:10px;letter-spacing:var(--tracking-wide);color:var(--text-muted)}.fu-summary-btn{font-family:var(--lib-font-mono);font-size:10px;letter-spacing:var(--tracking-wider);text-transform:uppercase;background:var(--color-washi-900);color:var(--color-washi-50);border:none;padding:var(--lib-space-sm) var(--lib-space-md);cursor:pointer;transition:background var(--duration-base)}.fu-summary-btn:hover{background:var(--color-washi-800)}.fu-summary-btn:disabled{opacity:.38;cursor:not-allowed}.fu-spinner{width:16px;height:16px;border:2px solid var(--color-washi-200);border-top-color:var(--color-kaki-400);border-radius:var(--radius-full);animation:fu-spin .7s linear infinite;flex-shrink:0}@keyframes fu-slide-in{0%{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}@keyframes fu-spin{to{transform:rotate(360deg)}}}";
|
|
82
2
|
export {
|
|
83
|
-
|
|
3
|
+
uploaderCss as default
|
|
84
4
|
};
|
|
85
5
|
//# sourceMappingURL=index243.js.map
|
package/dist/index243.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index243.js","sources":[
|
|
1
|
+
{"version":3,"file":"index243.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
package/dist/index244.js
CHANGED
|
@@ -1,5 +1,263 @@
|
|
|
1
|
-
|
|
1
|
+
import { nothing, html } from "lit";
|
|
2
|
+
import { map as o } from "./index264.js";
|
|
3
|
+
import { styleMap as o$1 } from "./index267.js";
|
|
4
|
+
function renderFileEntry(entry, onRemove) {
|
|
5
|
+
var _a;
|
|
6
|
+
const isUploading = entry.status === "uploading";
|
|
7
|
+
const isDone = entry.status === "done";
|
|
8
|
+
const isError = entry.status === "error";
|
|
9
|
+
const rowCls = [
|
|
10
|
+
"fu-file",
|
|
11
|
+
isDone ? "is-done" : "",
|
|
12
|
+
isError ? "is-error" : "",
|
|
13
|
+
isUploading ? "is-uploading" : ""
|
|
14
|
+
].filter(Boolean).join(" ");
|
|
15
|
+
const ext = ((_a = entry.file.name.split(".").pop()) == null ? void 0 : _a.toLowerCase()) ?? "";
|
|
16
|
+
const isImg = ["jpg", "jpeg", "png", "gif", "webp", "svg"].includes(ext);
|
|
17
|
+
const fileSize = entry.file.size < 1024 * 1024 ? `${(entry.file.size / 1024).toFixed(0)} KB` : `${(entry.file.size / (1024 * 1024)).toFixed(1)} MB`;
|
|
18
|
+
return html`
|
|
19
|
+
<div class="${rowCls}">
|
|
20
|
+
<!-- Progress background -->
|
|
21
|
+
<div
|
|
22
|
+
class="fu-file-prog-bg"
|
|
23
|
+
style="${o$1({ width: isUploading ? `${entry.progress}%` : isDone ? "100%" : "0%" })}"
|
|
24
|
+
></div>
|
|
25
|
+
|
|
26
|
+
<!-- Thumbnail o icono -->
|
|
27
|
+
${isImg && entry.previewUrl ? html`<img class="fu-file-thumb" src="${entry.previewUrl}" alt="${entry.file.name}">` : html`
|
|
28
|
+
<div class="fu-file-icon">
|
|
29
|
+
${isDone ? html`<lib-icon name="check-circle" weight="fill" size="sm"></lib-icon>` : isError ? html`<lib-icon name="warning-circle" weight="fill" size="sm"></lib-icon>` : html`<span class="fu-ext">${ext || "—"}</span>`}
|
|
30
|
+
</div>`}
|
|
31
|
+
|
|
32
|
+
<!-- Meta -->
|
|
33
|
+
<div class="fu-file-meta">
|
|
34
|
+
<span class="fu-file-name">${entry.file.name}</span>
|
|
35
|
+
<span class="fu-file-info">
|
|
36
|
+
<span>${fileSize}</span>
|
|
37
|
+
${isError ? html`
|
|
38
|
+
<span class="fu-file-info-sep"></span>
|
|
39
|
+
<span style="color:var(--color-error)">${entry.errorMessage ?? "Error al subir"}</span>` : nothing}
|
|
40
|
+
${isDone ? html`
|
|
41
|
+
<span class="fu-file-info-sep"></span>
|
|
42
|
+
<span style="color:var(--color-celadon-500)">Completado</span>` : nothing}
|
|
43
|
+
</span>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
<!-- Acciones -->
|
|
47
|
+
<div class="fu-file-actions">
|
|
48
|
+
${isUploading ? html`
|
|
49
|
+
<span class="fu-file-pct">${entry.progress}%</span>
|
|
50
|
+
<span class="fu-spinner"></span>` : isDone ? html`<span class="fu-status-done"><lib-icon name="check-circle" weight="fill" size="sm"></lib-icon></span>` : isError ? html`<span class="fu-status-error"><lib-icon name="warning" weight="fill" size="sm"></lib-icon></span>` : nothing}
|
|
51
|
+
|
|
52
|
+
<button
|
|
53
|
+
class="fu-file-remove"
|
|
54
|
+
aria-label="Eliminar ${entry.file.name}"
|
|
55
|
+
@click="${(e) => {
|
|
56
|
+
e.stopPropagation();
|
|
57
|
+
onRemove(entry.id);
|
|
58
|
+
}}"
|
|
59
|
+
>
|
|
60
|
+
<lib-icon name="x" size="xs"></lib-icon>
|
|
61
|
+
</button>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
`;
|
|
65
|
+
}
|
|
66
|
+
function fileUploaderTemplate(props) {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
const {
|
|
69
|
+
zone,
|
|
70
|
+
title,
|
|
71
|
+
/*subtitle*/
|
|
72
|
+
hint,
|
|
73
|
+
multiple,
|
|
74
|
+
accept,
|
|
75
|
+
disabled,
|
|
76
|
+
isDragover,
|
|
77
|
+
entries,
|
|
78
|
+
imagePreviewUrl,
|
|
79
|
+
onDragover,
|
|
80
|
+
onDragleave,
|
|
81
|
+
onDrop,
|
|
82
|
+
onInputChange,
|
|
83
|
+
onRemove,
|
|
84
|
+
onUploadAll,
|
|
85
|
+
onClearAll,
|
|
86
|
+
onResetImage
|
|
87
|
+
} = props;
|
|
88
|
+
const doneCount = entries.filter((e) => e.status === "done").length;
|
|
89
|
+
const uploadingCount = entries.filter((e) => e.status === "uploading").length;
|
|
90
|
+
const allDone = entries.length > 0 && doneCount === entries.length;
|
|
91
|
+
const anyUploading = uploadingCount > 0;
|
|
92
|
+
if (zone === "default") {
|
|
93
|
+
return html`
|
|
94
|
+
<div class="fu-root">
|
|
95
|
+
<!-- Drop zone -->
|
|
96
|
+
<div
|
|
97
|
+
class="fu-zone ${isDragover ? "is-dragover" : ""} ${disabled ? "is-disabled" : ""}"
|
|
98
|
+
@dragover="${(e) => {
|
|
99
|
+
if (!disabled) onDragover(e);
|
|
100
|
+
}}"
|
|
101
|
+
@dragleave="${() => {
|
|
102
|
+
if (!disabled) onDragleave();
|
|
103
|
+
}}"
|
|
104
|
+
@drop="${(e) => {
|
|
105
|
+
if (!disabled) onDrop(e);
|
|
106
|
+
}}"
|
|
107
|
+
>
|
|
108
|
+
<!-- input real cubriendo toda la zona -->
|
|
109
|
+
<input
|
|
110
|
+
type="file"
|
|
111
|
+
?multiple="${multiple}"
|
|
112
|
+
accept="${accept}"
|
|
113
|
+
?disabled="${disabled}"
|
|
114
|
+
@change="${onInputChange}"
|
|
115
|
+
aria-label="${title}"
|
|
116
|
+
>
|
|
117
|
+
|
|
118
|
+
<div class="fu-zone-icon">
|
|
119
|
+
<lib-icon name="cloud-arrow-up" weight="thin" size="xl"></lib-icon>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<div>
|
|
123
|
+
<p class="fu-zone-title">${title}</p>
|
|
124
|
+
<p class="fu-zone-sub" style="margin-top:var(--lib-space-sm)">
|
|
125
|
+
o <span>busca en tu equipo</span>
|
|
126
|
+
</p>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<p class="fu-zone-hint">${hint}</p>
|
|
130
|
+
</div>
|
|
131
|
+
|
|
132
|
+
<!-- Lista de archivos -->
|
|
133
|
+
${entries.length > 0 ? html`
|
|
134
|
+
<div class="fu-list">
|
|
135
|
+
${o(entries, (entry) => renderFileEntry(entry, onRemove))}
|
|
136
|
+
</div>
|
|
137
|
+
|
|
138
|
+
<!-- Footer summary -->
|
|
139
|
+
<div class="fu-summary">
|
|
140
|
+
<span class="fu-summary-text">
|
|
141
|
+
${allDone ? `${doneCount} archivo${doneCount !== 1 ? "s" : ""} subido${doneCount !== 1 ? "s" : ""}` : anyUploading ? `Subiendo ${uploadingCount} archivo${uploadingCount !== 1 ? "s" : ""}…` : `${entries.length} archivo${entries.length !== 1 ? "s" : ""} seleccionado${entries.length !== 1 ? "s" : ""}`}
|
|
142
|
+
</span>
|
|
143
|
+
<div style="display:flex;gap:var(--lib-space-sm)">
|
|
144
|
+
<button
|
|
145
|
+
class="fu-summary-btn"
|
|
146
|
+
style="background:transparent;color:var(--text-muted);border:1px solid var(--border-default)"
|
|
147
|
+
?disabled="${anyUploading}"
|
|
148
|
+
@click="${onClearAll}"
|
|
149
|
+
>Limpiar</button>
|
|
150
|
+
<button
|
|
151
|
+
class="fu-summary-btn"
|
|
152
|
+
?disabled="${anyUploading || allDone}"
|
|
153
|
+
@click="${onUploadAll}"
|
|
154
|
+
>
|
|
155
|
+
${anyUploading ? "Subiendo…" : "Subir todo"}
|
|
156
|
+
</button>
|
|
157
|
+
</div>
|
|
158
|
+
</div>
|
|
159
|
+
` : nothing}
|
|
160
|
+
</div>
|
|
161
|
+
`;
|
|
162
|
+
}
|
|
163
|
+
if (zone === "compact") {
|
|
164
|
+
return html`
|
|
165
|
+
<div class="fu-root">
|
|
166
|
+
<div
|
|
167
|
+
class="fu-zone-sm ${isDragover ? "is-dragover" : ""} ${disabled ? "is-disabled" : ""}"
|
|
168
|
+
@dragover="${(e) => {
|
|
169
|
+
if (!disabled) onDragover(e);
|
|
170
|
+
}}"
|
|
171
|
+
@dragleave="${() => {
|
|
172
|
+
if (!disabled) onDragleave();
|
|
173
|
+
}}"
|
|
174
|
+
@drop="${(e) => {
|
|
175
|
+
if (!disabled) onDrop(e);
|
|
176
|
+
}}"
|
|
177
|
+
>
|
|
178
|
+
<input
|
|
179
|
+
type="file"
|
|
180
|
+
?multiple="${multiple}"
|
|
181
|
+
accept="${accept}"
|
|
182
|
+
?disabled="${disabled}"
|
|
183
|
+
@change="${onInputChange}"
|
|
184
|
+
aria-label="${title}"
|
|
185
|
+
>
|
|
186
|
+
|
|
187
|
+
<span class="fu-zone-sm-icon">
|
|
188
|
+
<lib-icon name="paperclip" size="md"></lib-icon>
|
|
189
|
+
</span>
|
|
190
|
+
|
|
191
|
+
<div class="fu-zone-sm-text">
|
|
192
|
+
<span class="fu-zone-sm-title">${title}</span>
|
|
193
|
+
<span class="fu-zone-sm-sub">${hint}</span>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
|
|
197
|
+
${entries.length > 0 ? html`
|
|
198
|
+
<div class="fu-list" style="margin-top:1px">
|
|
199
|
+
${o(entries, (entry) => renderFileEntry(entry, onRemove))}
|
|
200
|
+
</div>
|
|
201
|
+
` : nothing}
|
|
202
|
+
</div>
|
|
203
|
+
`;
|
|
204
|
+
}
|
|
205
|
+
return html`
|
|
206
|
+
<div class="fu-root">
|
|
207
|
+
<div
|
|
208
|
+
class="fu-zone-img ${isDragover ? "is-dragover" : ""} ${imagePreviewUrl ? "has-preview" : ""} ${disabled ? "is-disabled" : ""}"
|
|
209
|
+
@dragover="${(e) => {
|
|
210
|
+
if (!disabled) onDragover(e);
|
|
211
|
+
}}"
|
|
212
|
+
@dragleave="${() => {
|
|
213
|
+
if (!disabled) onDragleave();
|
|
214
|
+
}}"
|
|
215
|
+
@drop="${(e) => {
|
|
216
|
+
if (!disabled) onDrop(e);
|
|
217
|
+
}}"
|
|
218
|
+
>
|
|
219
|
+
<input
|
|
220
|
+
type="file"
|
|
221
|
+
accept="image/*"
|
|
222
|
+
?disabled="${disabled || !!imagePreviewUrl}"
|
|
223
|
+
@change="${onInputChange}"
|
|
224
|
+
aria-label="${title}"
|
|
225
|
+
>
|
|
226
|
+
|
|
227
|
+
<!-- Placeholder (sin imagen) -->
|
|
228
|
+
<div class="fu-zone-img-placeholder">
|
|
229
|
+
<lib-icon name="image" weight="thin" size="xl" style="color:var(--text-muted)"></lib-icon>
|
|
230
|
+
<p class="fu-zone-sub">${title}</p>
|
|
231
|
+
<p class="fu-zone-hint">${hint}</p>
|
|
232
|
+
</div>
|
|
233
|
+
|
|
234
|
+
<!-- Preview (con imagen) -->
|
|
235
|
+
${imagePreviewUrl ? html`<img class="fu-zone-img-preview" src="${imagePreviewUrl}" alt="Preview">` : nothing}
|
|
236
|
+
|
|
237
|
+
<!-- Overlay de reemplazo -->
|
|
238
|
+
${imagePreviewUrl ? html`
|
|
239
|
+
<div class="fu-zone-img-overlay">
|
|
240
|
+
<lib-icon name="camera" size="md" style="color:#fff"></lib-icon>
|
|
241
|
+
<span class="fu-zone-img-overlay-text">Cambiar imagen</span>
|
|
242
|
+
</div>` : nothing}
|
|
243
|
+
</div>
|
|
244
|
+
|
|
245
|
+
<!-- Barra de progreso debajo de la zona imagen -->
|
|
246
|
+
${entries.length > 0 && ((_a = entries[0]) == null ? void 0 : _a.status) === "uploading" ? html`
|
|
247
|
+
<div class="fu-progress-bar">
|
|
248
|
+
<div class="fu-progress-fill" style="width:${((_b = entries[0]) == null ? void 0 : _b.progress) ?? 0}%"></div>
|
|
249
|
+
</div>` : nothing}
|
|
250
|
+
|
|
251
|
+
${imagePreviewUrl ? html`
|
|
252
|
+
<div style="display:flex;justify-content:flex-end;margin-top:var(--lib-space-sm)">
|
|
253
|
+
<button class="fu-file-remove" style="width:auto;padding:0 var(--lib-space-sm);border-radius:0;border:1px solid var(--border-default);font-family:var(--lib-font-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase" @click="${onResetImage}">
|
|
254
|
+
Eliminar
|
|
255
|
+
</button>
|
|
256
|
+
</div>` : nothing}
|
|
257
|
+
</div>
|
|
258
|
+
`;
|
|
259
|
+
}
|
|
2
260
|
export {
|
|
3
|
-
|
|
261
|
+
fileUploaderTemplate
|
|
4
262
|
};
|
|
5
263
|
//# sourceMappingURL=index244.js.map
|
package/dist/index244.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index244.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
1
|
+
{"version":3,"file":"index244.js","sources":["../src/components/molecules/file-uploader/lib-file-uploader.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport { map } from 'lit/directives/map.js';\nimport { styleMap } from 'lit/directives/style-map.js';\nimport type { FileEntry, FileUploaderTemplateProps } from './lib-file-uploader.types';\n\n/* ================================================================\n FILE ENTRY — una fila en la lista\n ================================================================ */\n\nfunction renderFileEntry(\n entry: FileEntry,\n onRemove: (id: string) => void,\n): TemplateResult {\n const isUploading = entry.status === 'uploading';\n const isDone = entry.status === 'done';\n const isError = entry.status === 'error';\n\n const rowCls = [\n 'fu-file',\n isDone ? 'is-done' : '',\n isError ? 'is-error' : '',\n isUploading ? 'is-uploading' : '',\n ].filter(Boolean).join(' ');\n\n /* Icono o thumbnail para imágenes */\n const ext = entry.file.name.split('.').pop()?.toLowerCase() ?? '';\n const isImg = ['jpg', 'jpeg', 'png', 'gif', 'webp', 'svg'].includes(ext);\n\n const fileSize = entry.file.size < 1024 * 1024\n ? `${(entry.file.size / 1024).toFixed(0)} KB`\n : `${(entry.file.size / (1024 * 1024)).toFixed(1)} MB`;\n\n return html`\n <div class=\"${rowCls}\">\n <!-- Progress background -->\n <div\n class=\"fu-file-prog-bg\"\n style=\"${styleMap({ width: isUploading ? `${entry.progress}%` : isDone ? '100%' : '0%' })}\"\n ></div>\n\n <!-- Thumbnail o icono -->\n ${isImg && entry.previewUrl\n ? html`<img class=\"fu-file-thumb\" src=\"${entry.previewUrl}\" alt=\"${entry.file.name}\">`\n : html`\n <div class=\"fu-file-icon\">\n ${isDone\n ? html`<lib-icon name=\"check-circle\" weight=\"fill\" size=\"sm\"></lib-icon>`\n : isError\n ? html`<lib-icon name=\"warning-circle\" weight=\"fill\" size=\"sm\"></lib-icon>`\n : html`<span class=\"fu-ext\">${ext || '—'}</span>`}\n </div>`}\n\n <!-- Meta -->\n <div class=\"fu-file-meta\">\n <span class=\"fu-file-name\">${entry.file.name}</span>\n <span class=\"fu-file-info\">\n <span>${fileSize}</span>\n ${isError\n ? html`\n <span class=\"fu-file-info-sep\"></span>\n <span style=\"color:var(--color-error)\">${entry.errorMessage ?? 'Error al subir'}</span>`\n : nothing}\n ${isDone\n ? html`\n <span class=\"fu-file-info-sep\"></span>\n <span style=\"color:var(--color-celadon-500)\">Completado</span>`\n : nothing}\n </span>\n </div>\n\n <!-- Acciones -->\n <div class=\"fu-file-actions\">\n ${isUploading\n ? html`\n <span class=\"fu-file-pct\">${entry.progress}%</span>\n <span class=\"fu-spinner\"></span>`\n : isDone\n ? html`<span class=\"fu-status-done\"><lib-icon name=\"check-circle\" weight=\"fill\" size=\"sm\"></lib-icon></span>`\n : isError\n ? html`<span class=\"fu-status-error\"><lib-icon name=\"warning\" weight=\"fill\" size=\"sm\"></lib-icon></span>`\n : nothing}\n\n <button\n class=\"fu-file-remove\"\n aria-label=\"Eliminar ${entry.file.name}\"\n @click=\"${(e: Event): void => { e.stopPropagation(); onRemove(entry.id); }}\"\n >\n <lib-icon name=\"x\" size=\"xs\"></lib-icon>\n </button>\n </div>\n </div>\n `;\n}\n\n/* ================================================================\n TEMPLATE PRINCIPAL\n ================================================================ */\n\nexport function fileUploaderTemplate(props: FileUploaderTemplateProps): TemplateResult {\n const {\n zone, title, /*subtitle*/ hint, multiple, accept, disabled,\n isDragover, entries, imagePreviewUrl,\n onDragover, onDragleave, onDrop, onInputChange, onRemove,\n onUploadAll, onClearAll, onResetImage,\n } = props;\n\n const doneCount = entries.filter(e => e.status === 'done').length;\n const uploadingCount = entries.filter(e => e.status === 'uploading').length;\n const allDone = entries.length > 0 && doneCount === entries.length;\n const anyUploading = uploadingCount > 0;\n\n /* ────────────────────────────────────\n VARIANTE: default (zona grande)\n ──────────────────────────────────── */\n if (zone === 'default') {\n return html`\n <div class=\"fu-root\">\n <!-- Drop zone -->\n <div\n class=\"fu-zone ${isDragover ? 'is-dragover' : ''} ${disabled ? 'is-disabled' : ''}\"\n @dragover=\"${(e: DragEvent): void => { if (!disabled) onDragover(e); }}\"\n @dragleave=\"${(): void => { if (!disabled) onDragleave(); }}\"\n @drop=\"${(e: DragEvent): void => { if (!disabled) onDrop(e); }}\"\n >\n <!-- input real cubriendo toda la zona -->\n <input\n type=\"file\"\n ?multiple=\"${multiple}\"\n accept=\"${accept}\"\n ?disabled=\"${disabled}\"\n @change=\"${onInputChange}\"\n aria-label=\"${title}\"\n >\n\n <div class=\"fu-zone-icon\">\n <lib-icon name=\"cloud-arrow-up\" weight=\"thin\" size=\"xl\"></lib-icon>\n </div>\n\n <div>\n <p class=\"fu-zone-title\">${title}</p>\n <p class=\"fu-zone-sub\" style=\"margin-top:var(--lib-space-sm)\">\n o <span>busca en tu equipo</span>\n </p>\n </div>\n\n <p class=\"fu-zone-hint\">${hint}</p>\n </div>\n\n <!-- Lista de archivos -->\n ${entries.length > 0 ? html`\n <div class=\"fu-list\">\n ${map(entries, (entry: FileEntry) => renderFileEntry(entry, onRemove))}\n </div>\n\n <!-- Footer summary -->\n <div class=\"fu-summary\">\n <span class=\"fu-summary-text\">\n ${allDone\n ? `${doneCount} archivo${doneCount !== 1 ? 's' : ''} subido${doneCount !== 1 ? 's' : ''}`\n : anyUploading\n ? `Subiendo ${uploadingCount} archivo${uploadingCount !== 1 ? 's' : ''}…`\n : `${entries.length} archivo${entries.length !== 1 ? 's' : ''} seleccionado${entries.length !== 1 ? 's' : ''}`}\n </span>\n <div style=\"display:flex;gap:var(--lib-space-sm)\">\n <button\n class=\"fu-summary-btn\"\n style=\"background:transparent;color:var(--text-muted);border:1px solid var(--border-default)\"\n ?disabled=\"${anyUploading}\"\n @click=\"${onClearAll}\"\n >Limpiar</button>\n <button\n class=\"fu-summary-btn\"\n ?disabled=\"${anyUploading || allDone}\"\n @click=\"${onUploadAll}\"\n >\n ${anyUploading ? 'Subiendo…' : 'Subir todo'}\n </button>\n </div>\n </div>\n ` : nothing}\n </div>\n `;\n }\n\n /* ────────────────────────────────────\n VARIANTE: compact (horizontal)\n ──────────────────────────────────── */\n if (zone === 'compact') {\n return html`\n <div class=\"fu-root\">\n <div\n class=\"fu-zone-sm ${isDragover ? 'is-dragover' : ''} ${disabled ? 'is-disabled' : ''}\"\n @dragover=\"${(e: DragEvent): void => { if (!disabled) onDragover(e); }}\"\n @dragleave=\"${(): void => { if (!disabled) onDragleave(); }}\"\n @drop=\"${(e: DragEvent): void => { if (!disabled) onDrop(e); }}\"\n >\n <input\n type=\"file\"\n ?multiple=\"${multiple}\"\n accept=\"${accept}\"\n ?disabled=\"${disabled}\"\n @change=\"${onInputChange}\"\n aria-label=\"${title}\"\n >\n\n <span class=\"fu-zone-sm-icon\">\n <lib-icon name=\"paperclip\" size=\"md\"></lib-icon>\n </span>\n\n <div class=\"fu-zone-sm-text\">\n <span class=\"fu-zone-sm-title\">${title}</span>\n <span class=\"fu-zone-sm-sub\">${hint}</span>\n </div>\n </div>\n\n ${entries.length > 0 ? html`\n <div class=\"fu-list\" style=\"margin-top:1px\">\n ${map(entries, (entry: FileEntry) => renderFileEntry(entry, onRemove))}\n </div>\n ` : nothing}\n </div>\n `;\n }\n\n /* ────────────────────────────────────\n VARIANTE: image (preview inline)\n ──────────────────────────────────── */\n return html`\n <div class=\"fu-root\">\n <div\n class=\"fu-zone-img ${isDragover ? 'is-dragover' : ''} ${imagePreviewUrl ? 'has-preview' : ''} ${disabled ? 'is-disabled' : ''}\"\n @dragover=\"${(e: DragEvent): void => { if (!disabled) onDragover(e); }}\"\n @dragleave=\"${(): void => { if (!disabled) onDragleave(); }}\"\n @drop=\"${(e: DragEvent): void => { if (!disabled) onDrop(e); }}\"\n >\n <input\n type=\"file\"\n accept=\"image/*\"\n ?disabled=\"${disabled || !!imagePreviewUrl}\"\n @change=\"${onInputChange}\"\n aria-label=\"${title}\"\n >\n\n <!-- Placeholder (sin imagen) -->\n <div class=\"fu-zone-img-placeholder\">\n <lib-icon name=\"image\" weight=\"thin\" size=\"xl\" style=\"color:var(--text-muted)\"></lib-icon>\n <p class=\"fu-zone-sub\">${title}</p>\n <p class=\"fu-zone-hint\">${hint}</p>\n </div>\n\n <!-- Preview (con imagen) -->\n ${imagePreviewUrl\n ? html`<img class=\"fu-zone-img-preview\" src=\"${imagePreviewUrl}\" alt=\"Preview\">`\n : nothing}\n\n <!-- Overlay de reemplazo -->\n ${imagePreviewUrl\n ? html`\n <div class=\"fu-zone-img-overlay\">\n <lib-icon name=\"camera\" size=\"md\" style=\"color:#fff\"></lib-icon>\n <span class=\"fu-zone-img-overlay-text\">Cambiar imagen</span>\n </div>`\n : nothing}\n </div>\n\n <!-- Barra de progreso debajo de la zona imagen -->\n ${entries.length > 0 && entries[0]?.status === 'uploading'\n ? html`\n <div class=\"fu-progress-bar\">\n <div class=\"fu-progress-fill\" style=\"width:${entries[0]?.progress ?? 0}%\"></div>\n </div>`\n : nothing}\n\n ${imagePreviewUrl\n ? html`\n <div style=\"display:flex;justify-content:flex-end;margin-top:var(--lib-space-sm)\">\n <button class=\"fu-file-remove\" style=\"width:auto;padding:0 var(--lib-space-sm);border-radius:0;border:1px solid var(--border-default);font-family:var(--lib-font-mono);font-size:10px;letter-spacing:.12em;text-transform:uppercase\" @click=\"${onResetImage}\">\n Eliminar\n </button>\n </div>`\n : nothing}\n </div>\n `;\n}"],"names":["styleMap","map"],"mappings":";;;AASA,SAAS,gBACP,OACA,UACgB;;AAChB,QAAM,cAAc,MAAM,WAAW;AACrC,QAAM,SAAc,MAAM,WAAW;AACrC,QAAM,UAAc,MAAM,WAAW;AAErC,QAAM,SAAS;AAAA,IACb;AAAA,IACA,SAAY,YAAiB;AAAA,IAC7B,UAAY,aAAiB;AAAA,IAC7B,cAAc,iBAAiB;AAAA,EAAA,EAC/B,OAAO,OAAO,EAAE,KAAK,GAAG;AAG1B,QAAM,QAAM,WAAM,KAAK,KAAK,MAAM,GAAG,EAAE,IAAA,MAA3B,mBAAkC,kBAAiB;AAC/D,QAAM,QAAQ,CAAC,OAAO,QAAQ,OAAO,OAAO,QAAQ,KAAK,EAAE,SAAS,GAAG;AAEvE,QAAM,WAAW,MAAM,KAAK,OAAO,OAAO,OACtC,IAAI,MAAM,KAAK,OAAO,MAAM,QAAQ,CAAC,CAAC,QACtC,IAAI,MAAM,KAAK,QAAQ,OAAO,OAAO,QAAQ,CAAC,CAAC;AAEnD,SAAO;AAAA,kBACS,MAAM;AAAA;AAAA;AAAA;AAAA,iBAIPA,IAAS,EAAE,OAAO,cAAc,GAAG,MAAM,QAAQ,MAAM,SAAS,SAAS,KAAA,CAAM,CAAC;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AAAA;AAAA;AAAA;AAAA,wBAKA,OAAO;AAAA;AAAA;AAAA;AAAA,QAIX,QAAQ,SAAS,OAAK,aAAQ,CAAC,MAAT,mBAAY,YAAW,cAC3C;AAAA;AAAA,6DAEiD,aAAQ,CAAC,MAAT,mBAAY,aAAY,CAAC;AAAA,sBAE1E,OAAO;AAAA;AAAA,QAET,kBACE;AAAA;AAAA,6PAEmP,YAAY;AAAA;AAAA;AAAA,sBAI/P,OAAO;AAAA;AAAA;AAGjB;"}
|
package/dist/index245.js
CHANGED
|
@@ -1,97 +1,20 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
@click="${(e) => {
|
|
17
|
-
if (e.target.classList.contains("dr-backdrop")) ctx._close();
|
|
18
|
-
}}"
|
|
19
|
-
>
|
|
20
|
-
<!-- Panel -->
|
|
21
|
-
<div
|
|
22
|
-
class="dr ${placementClass}"
|
|
23
|
-
part="panel"
|
|
24
|
-
role="dialog"
|
|
25
|
-
aria-modal="true"
|
|
26
|
-
aria-label="${ctx.drawerLabel}"
|
|
27
|
-
tabindex="-1"
|
|
28
|
-
>
|
|
29
|
-
<!-- RGB ghost layers (glitch variants únicamente) -->
|
|
30
|
-
${isGlitch ? html`
|
|
31
|
-
<div class="dr-rgb-r" aria-hidden="true"></div>
|
|
32
|
-
<div class="dr-rgb-b" aria-hidden="true"></div>
|
|
33
|
-
` : nothing}
|
|
34
|
-
|
|
35
|
-
<!-- Handle bar — solo top / bottom -->
|
|
36
|
-
${!isHorizontal ? html`
|
|
37
|
-
<div class="dr-handle" part="handle">
|
|
38
|
-
<div class="dr-handle-bar"></div>
|
|
39
|
-
</div>
|
|
40
|
-
` : nothing}
|
|
41
|
-
|
|
42
|
-
<!-- Header -->
|
|
43
|
-
<div class="dr-header" part="header">
|
|
44
|
-
<div class="dr-title-block">
|
|
45
|
-
|
|
46
|
-
<!-- Eyebrow — slot o prop -->
|
|
47
|
-
${ctx.eyebrow ? html`
|
|
48
|
-
<div class="dr-eyebrow" part="eyebrow">
|
|
49
|
-
<slot name="eyebrow">${ctx.eyebrow}</slot>
|
|
50
|
-
</div>
|
|
51
|
-
` : html`
|
|
52
|
-
<slot name="eyebrow">
|
|
53
|
-
<div class="dr-eyebrow" part="eyebrow" style="display:none"></div>
|
|
54
|
-
</slot>
|
|
55
|
-
`}
|
|
56
|
-
|
|
57
|
-
<!-- Title — slot o prop -->
|
|
58
|
-
<div class="dr-title" part="title" id="dr-title-${ctx._uid}">
|
|
59
|
-
<slot name="title">${ctx.label}</slot>
|
|
60
|
-
</div>
|
|
61
|
-
|
|
62
|
-
<!-- Subtitle — slot o prop -->
|
|
63
|
-
${ctx.subtitle ? html`
|
|
64
|
-
<div class="dr-subtitle" part="subtitle">
|
|
65
|
-
<slot name="subtitle">${ctx.subtitle}</slot>
|
|
66
|
-
</div>
|
|
67
|
-
` : html`<slot name="subtitle"></slot>`}
|
|
68
|
-
|
|
69
|
-
</div>
|
|
70
|
-
|
|
71
|
-
<!-- Botón cerrar -->
|
|
72
|
-
<button
|
|
73
|
-
class="dr-close"
|
|
74
|
-
part="close-btn"
|
|
75
|
-
aria-label="Cerrar"
|
|
76
|
-
@click="${() => ctx._close()}"
|
|
77
|
-
>${iconClose}</button>
|
|
78
|
-
</div>
|
|
79
|
-
|
|
80
|
-
<!-- Body — slot default -->
|
|
81
|
-
<div class="dr-body" part="body">
|
|
82
|
-
<slot></slot>
|
|
83
|
-
</div>
|
|
84
|
-
|
|
85
|
-
<!-- Footer — slot footer (oculto si vacío via CSS) -->
|
|
86
|
-
<div class="dr-footer" part="footer">
|
|
87
|
-
<slot name="footer"></slot>
|
|
88
|
-
</div>
|
|
89
|
-
|
|
90
|
-
</div>
|
|
91
|
-
</div>
|
|
92
|
-
`;
|
|
1
|
+
import { renderClassic } from "./index354.js";
|
|
2
|
+
import { renderCentered } from "./index355.js";
|
|
3
|
+
import { renderMega } from "./index356.js";
|
|
4
|
+
import { renderAppBar } from "./index357.js";
|
|
5
|
+
function headerTemplate(ctx) {
|
|
6
|
+
switch (ctx.variant) {
|
|
7
|
+
case "centered":
|
|
8
|
+
return renderCentered(ctx);
|
|
9
|
+
case "mega":
|
|
10
|
+
return renderMega(ctx);
|
|
11
|
+
case "app-bar":
|
|
12
|
+
return renderAppBar(ctx);
|
|
13
|
+
default:
|
|
14
|
+
return renderClassic(ctx);
|
|
15
|
+
}
|
|
93
16
|
}
|
|
94
17
|
export {
|
|
95
|
-
|
|
18
|
+
headerTemplate
|
|
96
19
|
};
|
|
97
20
|
//# sourceMappingURL=index245.js.map
|
package/dist/index245.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index245.js","sources":["../src/components/
|
|
1
|
+
{"version":3,"file":"index245.js","sources":["../src/components/molecules/header/lib-header.html.ts"],"sourcesContent":["import { TemplateResult } from 'lit';\nimport type { LibHeader } from './lib-header.component';\n\nimport { renderClassic } from './templates/header-classic.html';\nimport { renderCentered } from './templates/header-centered.html';\nimport { renderMega } from './templates/header-mega.html';\nimport { renderAppBar } from './templates/header-app-bar.html';\n\n/**\n * Dispatcher principal del componente lib-header.\n *\n * No contiene lógica de presentación propia.\n * Cada variante vive en su propio fichero dentro de /templates.\n *\n * Variantes → fichero\n * ───────────────────────────────────────────────────────────\n * classic · dark · transparent · kintsugi\n * glitch · minimal · shrink → header-classic.html.ts\n * centered → header-centered.html.ts\n * mega → header-mega.html.ts\n * app-bar → header-app-bar.html.ts\n *\n * Helpers compartidos (logo, links, actions, SVGs) → header-shared.html.ts\n * Móvil (hamburger + drawer) → header-mobile.html.ts\n */\nexport function headerTemplate(ctx: LibHeader): TemplateResult {\n switch (ctx.variant) {\n case 'centered': return renderCentered(ctx);\n case 'mega': return renderMega(ctx);\n case 'app-bar': return renderAppBar(ctx);\n default: return renderClassic(ctx);\n }\n}"],"names":[],"mappings":";;;;AAyBO,SAAS,eAAe,KAAgC;AAC7D,UAAQ,IAAI,SAAA;AAAA,IACV,KAAK;AAAY,aAAO,eAAe,GAAG;AAAA,IAC1C,KAAK;AAAY,aAAO,WAAW,GAAG;AAAA,IACtC,KAAK;AAAY,aAAO,aAAa,GAAG;AAAA,IACxC;AAAiB,aAAO,cAAc,GAAG;AAAA,EAAA;AAE7C;"}
|