@shibui-ui/ui 1.20.0 → 1.21.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/dist/index362.js CHANGED
@@ -1,38 +1,133 @@
1
- import { _$LH as j } from "./index358.js";
2
- /**
3
- * @license
4
- * Copyright 2020 Google LLC
5
- * SPDX-License-Identifier: BSD-3-Clause
6
- */
7
- const { I: t } = j, i = (o) => o, s = () => document.createComment(""), v = (o, n, e) => {
1
+ import { html, nothing } from "lit";
2
+ function renderHamburger(ctx) {
3
+ const isLight = ["classic", "centered", "mega", "minimal", "shrink"].includes(ctx.variant);
4
+ const color = isLight ? "var(--color-washi-600, #7A6A5C)" : "rgba(250,247,244,0.5)";
5
+ return html`
6
+ <button
7
+ class="hdr-burger"
8
+ aria-label="${ctx._mobileOpen ? "Cerrar menú" : "Abrir menú"}"
9
+ aria-expanded="${ctx._mobileOpen}"
10
+ aria-controls="hdr-mobile-drawer"
11
+ @click="${() => ctx._toggleMobile()}"
12
+ >
13
+ <svg width="20" height="14" viewBox="0 0 20 14" fill="none"
14
+ stroke="${color}" stroke-width="1.6" stroke-linecap="round">
15
+ <line class="hdr-burger-top" x1="0" y1="1" x2="20" y2="1"/>
16
+ <line class="hdr-burger-mid" x1="0" y1="7" x2="20" y2="7"/>
17
+ <line class="hdr-burger-bot" x1="0" y1="13" x2="20" y2="13"/>
18
+ </svg>
19
+ </button>`;
20
+ }
21
+ function renderMobileDrawer(ctx) {
8
22
  var _a;
9
- const l = o._$AA.parentNode, d = void 0 === n ? o._$AB : n._$AA;
10
- if (void 0 === e) {
11
- const i2 = l.insertBefore(s(), d), n2 = l.insertBefore(s(), d);
12
- e = new t(i2, n2, o, o.options);
13
- } else {
14
- const t2 = e._$AB.nextSibling, n2 = e._$AM, c = n2 !== o;
15
- if (c) {
16
- let t3;
17
- (_a = e._$AQ) == null ? void 0 : _a.call(e, o), e._$AM = o, void 0 !== e._$AP && (t3 = o._$AU) !== n2._$AU && e._$AP(t3);
18
- }
19
- if (t2 !== d || c) {
20
- let o2 = e._$AA;
21
- for (; o2 !== t2; ) {
22
- const t3 = i(o2).nextSibling;
23
- i(l).insertBefore(o2, d), o2 = t3;
24
- }
25
- }
26
- }
27
- return e;
28
- }, u = (o, t2, i2 = o) => (o._$AI(t2, i2), o), m = {}, p = (o, t2 = m) => o._$AH = t2, M = (o) => o._$AH, h = (o) => {
29
- o._$AR(), o._$AA.remove();
30
- };
23
+ if (!ctx._mobileOpen) return html``;
24
+ return html`
25
+ <!-- Backdrop -->
26
+ <div
27
+ class="hdr-mobile-backdrop"
28
+ @click="${() => ctx._closeMobile()}"
29
+ aria-hidden="true"
30
+ ></div>
31
+
32
+ <!-- Drawer panel -->
33
+ <nav
34
+ id="hdr-mobile-drawer"
35
+ class="hdr-mobile-drawer ${ctx._mobileOpen ? "is-open" : ""}"
36
+ aria-label="Menú principal"
37
+ >
38
+ <!-- Links principales -->
39
+ <div class="hdr-mobile-links">
40
+ ${(ctx.links ?? []).map((link) => {
41
+ var _a2, _b;
42
+ return html`
43
+ <a
44
+ href="${link.href ?? "#"}"
45
+ class="hdr-mobile-link"
46
+ @click="${(e) => {
47
+ e.preventDefault();
48
+ ctx._onLinkClick(link.id);
49
+ }}"
50
+ >
51
+ ${link.label}
52
+ ${((_a2 = link.dropdown) == null ? void 0 : _a2.length) ? html`
53
+ <svg width="8" height="5" viewBox="0 0 10 6" fill="none"
54
+ stroke="currentColor" stroke-width="1.5" stroke-linecap="round">
55
+ <polyline points="1,1 5,5 9,1"/>
56
+ </svg>` : nothing}
57
+ </a>
58
+
59
+ <!-- Sub-items — siempre visibles en móvil -->
60
+ ${((_b = link.dropdown) == null ? void 0 : _b.length) ? html`
61
+ <div class="hdr-mobile-sub">
62
+ ${link.dropdown.map((item) => html`
63
+ <a href="${item.href ?? "#"}" class="hdr-mobile-sub-link">
64
+ › ${item.label}
65
+ </a>
66
+ `)}
67
+ </div>
68
+ ` : nothing}
69
+ `;
70
+ })}
71
+
72
+ <!-- Mega columns — accordion plano en móvil -->
73
+ ${((_a = ctx.megaColumns) == null ? void 0 : _a.length) ? html`
74
+ <div class="hdr-mobile-sub" style="margin-top:0;">
75
+ ${ctx.megaColumns.map((col) => html`
76
+ <p class="hdr-mobile-col-title">${col.title}</p>
77
+ ${col.items.map((item) => html`
78
+ <a href="${item.href ?? "#"}" class="hdr-mobile-sub-link">
79
+ › ${item.label}
80
+ </a>
81
+ `)}
82
+ `)}
83
+ </div>
84
+ ` : nothing}
85
+ </div>
86
+
87
+ <!-- Divider -->
88
+ <div class="hdr-mobile-divider"></div>
89
+
90
+ <!-- Actions / CTAs -->
91
+ <div class="hdr-mobile-actions">
92
+ ${ctx.loginLabel ? html`
93
+ <a href="${ctx.loginHref ?? "#"}" class="hdr-mobile-login">
94
+ ${ctx.loginLabel}
95
+ </a>
96
+ ` : nothing}
97
+
98
+ ${(ctx.actions ?? []).map((action) => html`
99
+ <a
100
+ href="${action.href ?? "#"}"
101
+ class="hdr-mobile-cta"
102
+ @click="${(e) => {
103
+ e.preventDefault();
104
+ ctx._onActionClick(action);
105
+ }}"
106
+ >
107
+ ${action.label}
108
+ </a>
109
+ `)}
110
+
111
+ ${ctx.contactLabel ? html`
112
+ <a href="${ctx.contactHref ?? "#"}" class="hdr-mobile-login">
113
+ ${ctx.contactLabel} →
114
+ </a>
115
+ ` : nothing}
116
+ </div>
117
+
118
+ <!-- Footer del drawer -->
119
+ <div class="hdr-mobile-footer">
120
+ <span>${ctx.brandName}</span>
121
+ <button
122
+ class="hdr-mobile-close"
123
+ aria-label="Cerrar menú"
124
+ @click="${() => ctx._closeMobile()}"
125
+ >✕</button>
126
+ </div>
127
+ </nav>`;
128
+ }
31
129
  export {
32
- M as getCommittedValue,
33
- v as insertPart,
34
- h as removePart,
35
- u as setChildPartValue,
36
- p as setCommittedValue
130
+ renderHamburger,
131
+ renderMobileDrawer
37
132
  };
38
133
  //# sourceMappingURL=index362.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index362.js","sources":["../../../node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directive-helpers.js"],"sourcesContent":["import{_$LH as o}from\"./lit-html.js\";\n/**\n * @license\n * Copyright 2020 Google LLC\n * SPDX-License-Identifier: BSD-3-Clause\n */const{I:t}=o,i=o=>o,n=o=>null===o||\"object\"!=typeof o&&\"function\"!=typeof o,e={HTML:1,SVG:2,MATHML:3},l=(o,t)=>void 0===t?void 0!==o?._$litType$:o?._$litType$===t,d=o=>null!=o?._$litType$?.h,c=o=>void 0!==o?._$litDirective$,f=o=>o?._$litDirective$,r=o=>void 0===o.strings,s=()=>document.createComment(\"\"),v=(o,n,e)=>{const l=o._$AA.parentNode,d=void 0===n?o._$AB:n._$AA;if(void 0===e){const i=l.insertBefore(s(),d),n=l.insertBefore(s(),d);e=new t(i,n,o,o.options)}else{const t=e._$AB.nextSibling,n=e._$AM,c=n!==o;if(c){let t;e._$AQ?.(o),e._$AM=o,void 0!==e._$AP&&(t=o._$AU)!==n._$AU&&e._$AP(t)}if(t!==d||c){let o=e._$AA;for(;o!==t;){const t=i(o).nextSibling;i(l).insertBefore(o,d),o=t}}}return e},u=(o,t,i=o)=>(o._$AI(t,i),o),m={},p=(o,t=m)=>o._$AH=t,M=o=>o._$AH,h=o=>{o._$AR(),o._$AA.remove()},j=o=>{o._$AR()};export{e as TemplateResultType,j as clearPart,M as getCommittedValue,f as getDirectiveClass,v as insertPart,d as isCompiledTemplateResult,c as isDirectiveResult,n as isPrimitive,r as isSingleExpression,l as isTemplateResult,h as removePart,u as setChildPartValue,p as setCommittedValue};\n//# sourceMappingURL=directive-helpers.js.map\n"],"names":["o","i","n","t"],"mappings":";AACA;AAAA;AAAA;AAAA;AAAA;AAIO,MAAC,EAAC,GAAE,EAAC,IAAEA,GAAE,IAAE,OAAG,GAA8P,IAAE,MAAI,SAAS,cAAc,EAAE,GAAE,IAAE,CAAC,GAAE,GAAE,MAAI;;AAAC,QAAM,IAAE,EAAE,KAAK,YAAW,IAAE,WAAS,IAAE,EAAE,OAAK,EAAE;AAAK,MAAG,WAAS,GAAE;AAAC,UAAMC,KAAE,EAAE,aAAa,EAAC,GAAG,CAAC,GAAEC,KAAE,EAAE,aAAa,EAAC,GAAG,CAAC;AAAE,QAAE,IAAI,EAAED,IAAEC,IAAE,GAAE,EAAE,OAAO;AAAA,EAAC,OAAK;AAAC,UAAMC,KAAE,EAAE,KAAK,aAAYD,KAAE,EAAE,MAAK,IAAEA,OAAI;AAAE,QAAG,GAAE;AAAC,UAAIC;AAAE,cAAE,SAAF,2BAAS,IAAG,EAAE,OAAK,GAAE,WAAS,EAAE,SAAOA,KAAE,EAAE,UAAQD,GAAE,QAAM,EAAE,KAAKC,EAAC;AAAA,IAAC;AAAC,QAAGA,OAAI,KAAG,GAAE;AAAC,UAAIH,KAAE,EAAE;AAAK,aAAKA,OAAIG,MAAG;AAAC,cAAMA,KAAE,EAAEH,EAAC,EAAE;AAAY,UAAE,CAAC,EAAE,aAAaA,IAAE,CAAC,GAAEA,KAAEG;AAAA,MAAC;AAAA,IAAC;AAAA,EAAC;AAAC,SAAO;AAAC,GAAE,IAAE,CAAC,GAAEA,IAAEF,KAAE,OAAK,EAAE,KAAKE,IAAEF,EAAC,GAAE,IAAG,IAAE,CAAA,GAAG,IAAE,CAAC,GAAEE,KAAE,MAAI,EAAE,OAAKA,IAAE,IAAE,OAAG,EAAE,MAAK,IAAE,OAAG;AAAC,IAAE,KAAI,GAAG,EAAE,KAAK;AAAQ;","x_google_ignoreList":[0]}
1
+ {"version":3,"file":"index362.js","sources":["../src/components/molecules/header/templates/header-mobile.html.ts"],"sourcesContent":["import { html, nothing, TemplateResult } from 'lit';\nimport type { LibHeader } from '../lib-header.component';\nimport type { NavLink, DropdownItem, HeaderAction } from '../lib-header.types';\n\n/* ══════════════════════════════════════\n HAMBURGER BUTTON\n ══════════════════════════════════════ */\n\nexport function renderHamburger(ctx: LibHeader): TemplateResult {\n const isLight = ['classic', 'centered', 'mega', 'minimal', 'shrink'].includes(ctx.variant);\n const color = isLight\n ? 'var(--color-washi-600, #7A6A5C)'\n : 'rgba(250,247,244,0.5)';\n\n return html`\n <button\n class=\"hdr-burger\"\n aria-label=\"${ctx._mobileOpen ? 'Cerrar menú' : 'Abrir menú'}\"\n aria-expanded=\"${ctx._mobileOpen}\"\n aria-controls=\"hdr-mobile-drawer\"\n @click=\"${(): void => ctx._toggleMobile()}\"\n >\n <svg width=\"20\" height=\"14\" viewBox=\"0 0 20 14\" fill=\"none\"\n stroke=\"${color}\" stroke-width=\"1.6\" stroke-linecap=\"round\">\n <line class=\"hdr-burger-top\" x1=\"0\" y1=\"1\" x2=\"20\" y2=\"1\"/>\n <line class=\"hdr-burger-mid\" x1=\"0\" y1=\"7\" x2=\"20\" y2=\"7\"/>\n <line class=\"hdr-burger-bot\" x1=\"0\" y1=\"13\" x2=\"20\" y2=\"13\"/>\n </svg>\n </button>`;\n}\n\n/* ══════════════════════════════════════\n MOBILE DRAWER\n ══════════════════════════════════════ */\n\nexport function renderMobileDrawer(ctx: LibHeader): TemplateResult {\n if (!ctx._mobileOpen) return html``;\n\n return html`\n <!-- Backdrop -->\n <div\n class=\"hdr-mobile-backdrop\"\n @click=\"${(): void => ctx._closeMobile()}\"\n aria-hidden=\"true\"\n ></div>\n\n <!-- Drawer panel -->\n <nav\n id=\"hdr-mobile-drawer\"\n class=\"hdr-mobile-drawer ${ctx._mobileOpen ? 'is-open' : ''}\"\n aria-label=\"Menú principal\"\n >\n <!-- Links principales -->\n <div class=\"hdr-mobile-links\">\n ${(ctx.links ?? []).map((link: NavLink) => html`\n <a\n href=\"${link.href ?? '#'}\"\n class=\"hdr-mobile-link\"\n @click=\"${(e: Event): void => {\n e.preventDefault();\n ctx._onLinkClick(link.id);\n }}\"\n >\n ${link.label}\n ${link.dropdown?.length ? html`\n <svg width=\"8\" height=\"5\" viewBox=\"0 0 10 6\" fill=\"none\"\n stroke=\"currentColor\" stroke-width=\"1.5\" stroke-linecap=\"round\">\n <polyline points=\"1,1 5,5 9,1\"/>\n </svg>` : nothing}\n </a>\n\n <!-- Sub-items — siempre visibles en móvil -->\n ${link.dropdown?.length ? html`\n <div class=\"hdr-mobile-sub\">\n ${link.dropdown.map((item: DropdownItem) => html`\n <a href=\"${item.href ?? '#'}\" class=\"hdr-mobile-sub-link\">\n › ${item.label}\n </a>\n `)}\n </div>\n ` : nothing}\n `)}\n\n <!-- Mega columns — accordion plano en móvil -->\n ${ctx.megaColumns?.length ? html`\n <div class=\"hdr-mobile-sub\" style=\"margin-top:0;\">\n ${ctx.megaColumns.map(col => html`\n <p class=\"hdr-mobile-col-title\">${col.title}</p>\n ${col.items.map(item => html`\n <a href=\"${item.href ?? '#'}\" class=\"hdr-mobile-sub-link\">\n › ${item.label}\n </a>\n `)}\n `)}\n </div>\n ` : nothing}\n </div>\n\n <!-- Divider -->\n <div class=\"hdr-mobile-divider\"></div>\n\n <!-- Actions / CTAs -->\n <div class=\"hdr-mobile-actions\">\n ${ctx.loginLabel ? html`\n <a href=\"${ctx.loginHref ?? '#'}\" class=\"hdr-mobile-login\">\n ${ctx.loginLabel}\n </a>\n ` : nothing}\n\n ${(ctx.actions ?? []).map((action: HeaderAction) => html`\n <a\n href=\"${action.href ?? '#'}\"\n class=\"hdr-mobile-cta\"\n @click=\"${(e: Event): void => {\n e.preventDefault();\n ctx._onActionClick(action);\n }}\"\n >\n ${action.label}\n </a>\n `)}\n\n ${ctx.contactLabel ? html`\n <a href=\"${ctx.contactHref ?? '#'}\" class=\"hdr-mobile-login\">\n ${ctx.contactLabel} →\n </a>\n ` : nothing}\n </div>\n\n <!-- Footer del drawer -->\n <div class=\"hdr-mobile-footer\">\n <span>${ctx.brandName}</span>\n <button\n class=\"hdr-mobile-close\"\n aria-label=\"Cerrar menú\"\n @click=\"${(): void => ctx._closeMobile()}\"\n >✕</button>\n </div>\n </nav>`;\n}"],"names":["_a"],"mappings":";AAQO,SAAS,gBAAgB,KAAgC;AAC9D,QAAM,UAAU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